@thibezer/ui-components-kit 1.0.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/LICENSE +21 -0
- package/README.md +624 -0
- package/dist/botao.cjs +1 -0
- package/dist/botao.d.ts +8 -0
- package/dist/botao.js +6 -0
- package/dist/camadas.cjs +296 -0
- package/dist/camadas.d.ts +14 -0
- package/dist/camadas.js +1857 -0
- package/dist/campo-texto.cjs +1 -0
- package/dist/campo-texto.d.ts +8 -0
- package/dist/campo-texto.js +11 -0
- package/dist/canvas.cjs +254 -0
- package/dist/canvas.d.ts +8 -0
- package/dist/canvas.js +3082 -0
- package/dist/card.cjs +1 -0
- package/dist/card.d.ts +7 -0
- package/dist/card.js +5 -0
- package/dist/components/ui-alerta/index.d.ts +2 -0
- package/dist/components/ui-alerta/ui-alerta-base.d.ts +23 -0
- package/dist/components/ui-alerta/ui-alerta.d.ts +2 -0
- package/dist/components/ui-alerta/ui-toast.d.ts +34 -0
- package/dist/components/ui-avatar/index.d.ts +1 -0
- package/dist/components/ui-avatar/ui-avatar.d.ts +12 -0
- package/dist/components/ui-badge/index.d.ts +1 -0
- package/dist/components/ui-badge/ui-badge.d.ts +20 -0
- package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +22 -0
- package/dist/components/ui-barra-ferramentas/ferramentas-icones.d.ts +24 -0
- package/dist/components/ui-barra-ferramentas/index.d.ts +4 -0
- package/dist/components/ui-barra-ferramentas/tipos.d.ts +55 -0
- package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +54 -0
- package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +52 -0
- package/dist/components/ui-botao/index.d.ts +1 -0
- package/dist/components/ui-botao/ui-botao.d.ts +26 -0
- package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +18 -0
- package/dist/components/ui-camadas/camadas-drag-drop.d.ts +18 -0
- package/dist/components/ui-camadas/camadas-eventos-arvore.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-eventos-camadas.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-eventos-rodape.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-host.d.ts +23 -0
- package/dist/components/ui-camadas/camadas-icones.d.ts +23 -0
- package/dist/components/ui-camadas/camadas-mapas-base.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-metricas.d.ts +17 -0
- package/dist/components/ui-camadas/camadas-persistencia.d.ts +65 -0
- package/dist/components/ui-camadas/camadas-resizer.d.ts +16 -0
- package/dist/components/ui-camadas/camadas-rodape.d.ts +2 -0
- package/dist/components/ui-camadas/camadas-selecao.d.ts +24 -0
- package/dist/components/ui-camadas/camadas-sincronizacao-dom.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-teclado.d.ts +3 -0
- package/dist/components/ui-camadas/camadas-utils.d.ts +26 -0
- package/dist/components/ui-camadas/index.d.ts +11 -0
- package/dist/components/ui-camadas/tipos.d.ts +116 -0
- package/dist/components/ui-camadas/ui-camadas.d.ts +112 -0
- package/dist/components/ui-campo-texto/campo-texto-estados.d.ts +12 -0
- package/dist/components/ui-campo-texto/campo-texto-template.d.ts +2 -0
- package/dist/components/ui-campo-texto/index.d.ts +1 -0
- package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +57 -0
- package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +13 -0
- package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +19 -0
- package/dist/components/ui-canvas-cad/cad-colecoes-dados.d.ts +46 -0
- package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +26 -0
- package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +19 -0
- package/dist/components/ui-canvas-cad/cad-painel-camadas.d.ts +9 -0
- package/dist/components/ui-canvas-cad/cad-tamanho-observer.d.ts +7 -0
- package/dist/components/ui-canvas-cad/cad-template.d.ts +1 -0
- package/dist/components/ui-canvas-cad/cad-toolbar-painel.d.ts +29 -0
- package/dist/components/ui-canvas-cad/index.d.ts +8 -0
- package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +91 -0
- package/dist/components/ui-card/index.d.ts +1 -0
- package/dist/components/ui-card/ui-card.d.ts +18 -0
- package/dist/components/ui-checkbox/index.d.ts +1 -0
- package/dist/components/ui-checkbox/ui-checkbox.d.ts +36 -0
- package/dist/components/ui-drawer/drawer-acessibilidade.d.ts +16 -0
- package/dist/components/ui-drawer/index.d.ts +1 -0
- package/dist/components/ui-drawer/ui-drawer.d.ts +37 -0
- package/dist/components/ui-icone/index.d.ts +1 -0
- package/dist/components/ui-icone/ui-icone.d.ts +15 -0
- package/dist/components/ui-lista-flutuante/index.d.ts +1 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-posicionamento.d.ts +15 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-render.d.ts +9 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-teclado.d.ts +13 -0
- package/dist/components/ui-lista-flutuante/lista-flutuante-template.d.ts +2 -0
- package/dist/components/ui-lista-flutuante/tipos.d.ts +4 -0
- package/dist/components/ui-lista-flutuante/ui-lista-flutuante.d.ts +63 -0
- package/dist/components/ui-mapa/index.d.ts +3 -0
- package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -0
- package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -0
- package/dist/components/ui-mapa/ui-mapa.d.ts +16 -0
- package/dist/components/ui-modal/index.d.ts +2 -0
- package/dist/components/ui-modal/modal-acessibilidade.d.ts +12 -0
- package/dist/components/ui-modal/ui-modal.d.ts +30 -0
- package/dist/components/ui-radio/index.d.ts +1 -0
- package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
- package/dist/components/ui-radio/ui-radio.d.ts +29 -0
- package/dist/components/ui-segmented/index.d.ts +1 -0
- package/dist/components/ui-segmented/segmented-indicador.d.ts +13 -0
- package/dist/components/ui-segmented/segmented-teclado.d.ts +4 -0
- package/dist/components/ui-segmented/segmented-template.d.ts +4 -0
- package/dist/components/ui-segmented/ui-segmented.d.ts +48 -0
- package/dist/components/ui-seletor-mapa-base/index.d.ts +2 -0
- package/dist/components/ui-seletor-mapa-base/tipos.d.ts +22 -0
- package/dist/components/ui-seletor-mapa-base/ui-seletor-mapa-base.d.ts +43 -0
- package/dist/components/ui-skeleton/index.d.ts +1 -0
- package/dist/components/ui-skeleton/ui-skeleton.d.ts +19 -0
- package/dist/components/ui-stat/index.d.ts +1 -0
- package/dist/components/ui-stat/ui-stat.d.ts +30 -0
- package/dist/components/ui-switch/index.d.ts +1 -0
- package/dist/components/ui-switch/ui-switch.d.ts +36 -0
- package/dist/components/ui-tabela/index.d.ts +7 -0
- package/dist/components/ui-tabela/tabela-atributos-sync.d.ts +14 -0
- package/dist/components/ui-tabela/tabela-corpo.d.ts +18 -0
- package/dist/components/ui-tabela/tabela-dom.d.ts +15 -0
- package/dist/components/ui-tabela/tabela-header.d.ts +18 -0
- package/dist/components/ui-tabela/tabela-interacao.d.ts +9 -0
- package/dist/components/ui-tabela/tabela-localizador.d.ts +4 -0
- package/dist/components/ui-tabela/tabela-ordenacao.d.ts +12 -0
- package/dist/components/ui-tabela/tabela-orquestrador-dados.d.ts +18 -0
- package/dist/components/ui-tabela/tabela-redimensionamento.d.ts +28 -0
- package/dist/components/ui-tabela/tabela-remota.d.ts +15 -0
- package/dist/components/ui-tabela/tabela-renderizador.d.ts +29 -0
- package/dist/components/ui-tabela/tabela-selecao.d.ts +24 -0
- package/dist/components/ui-tabela/tipos.d.ts +27 -0
- package/dist/components/ui-tabela/ui-tabela.d.ts +83 -0
- package/dist/components/ui-tabela-propriedades/avaliador-expressao.d.ts +6 -0
- package/dist/components/ui-tabela-propriedades/editores-basicos.d.ts +7 -0
- package/dist/components/ui-tabela-propriedades/editores-cad.d.ts +17 -0
- package/dist/components/ui-tabela-propriedades/index.d.ts +6 -0
- package/dist/components/ui-tabela-propriedades/propriedades-densidade.d.ts +5 -0
- package/dist/components/ui-tabela-propriedades/propriedades-dom-utils.d.ts +6 -0
- package/dist/components/ui-tabela-propriedades/propriedades-editores.d.ts +5 -0
- package/dist/components/ui-tabela-propriedades/propriedades-flutuante.d.ts +7 -0
- package/dist/components/ui-tabela-propriedades/propriedades-gerenciador-valores.d.ts +26 -0
- package/dist/components/ui-tabela-propriedades/propriedades-painel-controles.d.ts +15 -0
- package/dist/components/ui-tabela-propriedades/propriedades-render-arvore.d.ts +24 -0
- package/dist/components/ui-tabela-propriedades/propriedades-seletor-tipo.d.ts +13 -0
- package/dist/components/ui-tabela-propriedades/propriedades-splitter.d.ts +13 -0
- package/dist/components/ui-tabela-propriedades/propriedades-template.d.ts +1 -0
- package/dist/components/ui-tabela-propriedades/tipos.d.ts +48 -0
- package/dist/components/ui-tabela-propriedades/ui-tabela-propriedades.d.ts +66 -0
- package/dist/components/ui-texto/index.d.ts +1 -0
- package/dist/components/ui-texto/ui-texto.d.ts +15 -0
- package/dist/components/ui-tooltip/index.d.ts +1 -0
- package/dist/components/ui-tooltip/ui-tooltip.d.ts +25 -0
- package/dist/core/acessibilidade.d.ts +21 -0
- package/dist/core/form-associated-element.d.ts +33 -0
- package/dist/core/form-validacao.d.ts +34 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/leaflet-loader.d.ts +7 -0
- package/dist/core/leaflet-style.d.ts +7 -0
- package/dist/core/listener-bag.d.ts +21 -0
- package/dist/core/ssr-safe.d.ts +20 -0
- package/dist/core/ui-bus.d.ts +85 -0
- package/dist/core/zero-js-triggers.d.ts +1 -0
- package/dist/core.cjs +1 -0
- package/dist/core.js +22 -0
- package/dist/data.cjs +1 -0
- package/dist/data.d.ts +22 -0
- package/dist/data.js +63 -0
- package/dist/feedback.cjs +1 -0
- package/dist/feedback.d.ts +26 -0
- package/dist/feedback.js +25 -0
- package/dist/form-validacao-BIOXxt-1.js +140 -0
- package/dist/form-validacao-ytRYSF3E.cjs +1 -0
- package/dist/forms.cjs +1 -0
- package/dist/forms.d.ts +22 -0
- package/dist/forms.js +25 -0
- package/dist/gerencigeo-canvas/canvas_destaque.d.ts +13 -0
- package/dist/gerencigeo-canvas/canvas_destaque_marcadores.d.ts +8 -0
- package/dist/gerencigeo-canvas/canvas_interacao.d.ts +56 -0
- package/dist/gerencigeo-canvas/canvas_selecao_box.d.ts +23 -0
- package/dist/gerencigeo-canvas/controller_dados_ops.d.ts +15 -0
- package/dist/gerencigeo-canvas/index.d.ts +17 -0
- package/dist/gerencigeo-canvas/layer_defaults.d.ts +3 -0
- package/dist/gerencigeo-canvas/layer_instance_ops.d.ts +6 -0
- package/dist/gerencigeo-canvas/layer_manager.d.ts +37 -0
- package/dist/gerencigeo-canvas/layer_pane_ops.d.ts +8 -0
- package/dist/gerencigeo-canvas/layer_renderer_factory.d.ts +14 -0
- package/dist/gerencigeo-canvas/layer_state_ops.d.ts +6 -0
- package/dist/gerencigeo-canvas/mapa_config.d.ts +11 -0
- package/dist/gerencigeo-canvas/mapa_controller.d.ts +53 -0
- package/dist/gerencigeo-canvas/mapa_core.d.ts +30 -0
- package/dist/gerencigeo-canvas/mapa_linhas.d.ts +14 -0
- package/dist/gerencigeo-canvas/mapa_marcadores.d.ts +18 -0
- package/dist/gerencigeo-canvas/mapa_pontos_shapes.d.ts +8 -0
- package/dist/gerencigeo-canvas/renderers/grid_renderer.d.ts +9 -0
- package/dist/gerencigeo-canvas/renderers/tile_renderer.d.ts +8 -0
- package/dist/gerencigeo-canvas/renderers/vector_lines_builder.d.ts +4 -0
- package/dist/gerencigeo-canvas/renderers/vector_lines_renderer.d.ts +9 -0
- package/dist/gerencigeo-canvas/renderers/vector_points_renderer.d.ts +11 -0
- package/dist/gerencigeo-canvas/renderers/vector_polygons_renderer.d.ts +9 -0
- package/dist/gerencigeo-canvas/renderers/wms_renderer.d.ts +8 -0
- package/dist/gerencigeo-canvas/sigef_consultor.d.ts +9 -0
- package/dist/gerencigeo-canvas/tile_preloader.d.ts +2 -0
- package/dist/gerencigeo-canvas/types.d.ts +169 -0
- package/dist/gerencigeo-canvas/utils.d.ts +46 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +116 -0
- package/dist/index.js +186 -0
- package/dist/leaflet-Cw6tqYFh.cjs +1 -0
- package/dist/leaflet-DkaFZYc5.js +69 -0
- package/dist/leaflet-loader-94z5VsdY.cjs +2 -0
- package/dist/leaflet-loader-Cjcdgj5R.js +21 -0
- package/dist/listener-bag-D5omxZ9h.cjs +1 -0
- package/dist/listener-bag-DQgv7OON.js +34 -0
- package/dist/mapa.cjs +19 -0
- package/dist/mapa.d.ts +11 -0
- package/dist/mapa.js +264 -0
- package/dist/modal.cjs +1 -0
- package/dist/modal.d.ts +8 -0
- package/dist/modal.js +8 -0
- package/dist/register.cjs +1 -0
- package/dist/register.d.ts +7 -0
- package/dist/register.js +21 -0
- package/dist/seletor-mapa-base.cjs +53 -0
- package/dist/seletor-mapa-base.d.ts +8 -0
- package/dist/seletor-mapa-base.js +275 -0
- package/dist/ssr-safe-5cWfJP-s.js +10 -0
- package/dist/ssr-safe-CiHD1adl.cjs +1 -0
- package/dist/tabela.cjs +1 -0
- package/dist/tabela.d.ts +12 -0
- package/dist/tabela.js +56 -0
- package/dist/tools.cjs +1 -0
- package/dist/tools.d.ts +8 -0
- package/dist/tools.js +30 -0
- package/dist/ui-badge-92yelKls.js +183 -0
- package/dist/ui-badge-B95jSECC.cjs +28 -0
- package/dist/ui-botao-BShEouvi.js +124 -0
- package/dist/ui-botao-DF1yuUUD.cjs +12 -0
- package/dist/ui-campo-texto-BCh5HyCM.cjs +16 -0
- package/dist/ui-campo-texto-B_JF6POq.js +361 -0
- package/dist/ui-card-BJ8SmvVf.js +111 -0
- package/dist/ui-card-Bhm6k91e.cjs +20 -0
- package/dist/ui-kit.css +1 -0
- package/dist/ui-modal-Bi4isGYh.cjs +18 -0
- package/dist/ui-modal-DV-pw2x1.js +194 -0
- package/dist/ui-paleta-ferramentas-B6dJ0O6K.cjs +18 -0
- package/dist/ui-paleta-ferramentas-Bpp4XBVg.js +633 -0
- package/dist/ui-segmented-C8wuycjJ.js +411 -0
- package/dist/ui-segmented-NC5cBXLh.cjs +19 -0
- package/dist/ui-skeleton-B3xQyn0Z.js +396 -0
- package/dist/ui-skeleton-D42oQufF.cjs +33 -0
- package/dist/ui-switch-C6o4yZUF.cjs +53 -0
- package/dist/ui-switch-CO9MoS8x.js +826 -0
- package/dist/ui-tabela-propriedades-7yJ9g7ti.cjs +145 -0
- package/dist/ui-tabela-propriedades-D-XKNVwK.js +2078 -0
- package/dist/ui-toast-CQBqvUm3.cjs +20 -0
- package/dist/ui-toast-CwUmiqyG.js +156 -0
- package/dist/zero-js-triggers-DdESy0tk.js +205 -0
- package/dist/zero-js-triggers-QGD7FOTv.cjs +1 -0
- package/package.json +149 -0
package/dist/camadas.js
ADDED
|
@@ -0,0 +1,1857 @@
|
|
|
1
|
+
var ge = Object.defineProperty;
|
|
2
|
+
var be = (a, r, e) => r in a ? ge(a, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[r] = e;
|
|
3
|
+
var y = (a, r, e) => be(a, typeof r != "symbol" ? r + "" : r, e);
|
|
4
|
+
/* empty css */
|
|
5
|
+
import { d as G, S as ve } from "./ssr-safe-5cWfJP-s.js";
|
|
6
|
+
import { L as ye } from "./listener-bag-DQgv7OON.js";
|
|
7
|
+
import { UIMapaBase as pa, UISeletorMapaBase as fa } from "./seletor-mapa-base.js";
|
|
8
|
+
const m = {
|
|
9
|
+
camadas: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
10
|
+
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
|
|
11
|
+
<polyline points="2 17 12 22 22 17"></polyline>
|
|
12
|
+
<polyline points="2 12 12 17 22 12"></polyline>
|
|
13
|
+
</svg>`,
|
|
14
|
+
inspecao: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
15
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
16
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
17
|
+
</svg>`,
|
|
18
|
+
equipe: `<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
19
|
+
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
20
|
+
<circle cx="9" cy="7" r="4"></circle>
|
|
21
|
+
<path d="M23 21v-2a4 4 0 0 0-3-3.87"></path>
|
|
22
|
+
<path d="M16 3.13a4 4 0 0 1 0 7.75"></path>
|
|
23
|
+
</svg>`,
|
|
24
|
+
olhoAberto: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
25
|
+
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"></path>
|
|
26
|
+
<circle cx="12" cy="12" r="3"></circle>
|
|
27
|
+
</svg>`,
|
|
28
|
+
olhoFechado: `<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="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>
|
|
30
|
+
<line x1="1" y1="1" x2="23" y2="23"></line>
|
|
31
|
+
</svg>`,
|
|
32
|
+
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">
|
|
33
|
+
<rect x="3" y="11" width="18" height="11" rx="2" ry="2"></rect>
|
|
34
|
+
<path d="M7 11V7a5 5 0 0 1 10 0v4"></path>
|
|
35
|
+
</svg>`,
|
|
36
|
+
cadeadoAberto: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="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 9.9-1"></path>
|
|
39
|
+
</svg>`,
|
|
40
|
+
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">
|
|
41
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
42
|
+
</svg>`,
|
|
43
|
+
dragHandle: `<svg viewBox="0 0 24 24" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round">
|
|
44
|
+
<line x1="8" y1="6" x2="8" y2="6.01"></line>
|
|
45
|
+
<line x1="16" y1="6" x2="16" y2="6.01"></line>
|
|
46
|
+
<line x1="8" y1="12" x2="8" y2="12.01"></line>
|
|
47
|
+
<line x1="16" y1="12" x2="16" y2="12.01"></line>
|
|
48
|
+
<line x1="8" y1="18" x2="8" y2="18.01"></line>
|
|
49
|
+
<line x1="16" y1="18" x2="16" y2="18.01"></line>
|
|
50
|
+
</svg>`,
|
|
51
|
+
alvoEnquadrar: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
52
|
+
<circle cx="12" cy="12" r="10"></circle>
|
|
53
|
+
<line x1="12" y1="2" x2="12" y2="6"></line>
|
|
54
|
+
<line x1="12" y1="18" x2="12" y2="22"></line>
|
|
55
|
+
<line x1="2" y1="12" x2="6" y2="12"></line>
|
|
56
|
+
<line x1="18" y1="12" x2="22" y2="12"></line>
|
|
57
|
+
</svg>`,
|
|
58
|
+
engrenagem: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
59
|
+
<circle cx="12" cy="12" r="3"></circle>
|
|
60
|
+
<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>
|
|
61
|
+
</svg>`,
|
|
62
|
+
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">
|
|
63
|
+
<line x1="12" y1="5" x2="12" y2="19"></line>
|
|
64
|
+
<line x1="5" y1="12" x2="19" y2="12"></line>
|
|
65
|
+
</svg>`,
|
|
66
|
+
lixeira: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
67
|
+
<polyline points="3 6 5 6 21 6"></polyline>
|
|
68
|
+
<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>
|
|
69
|
+
</svg>`,
|
|
70
|
+
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">
|
|
71
|
+
<line x1="18" y1="6" x2="6" y2="18"></line>
|
|
72
|
+
<line x1="6" y1="6" x2="18" y2="18"></line>
|
|
73
|
+
</svg>`,
|
|
74
|
+
busca: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
75
|
+
<circle cx="11" cy="11" r="8"></circle>
|
|
76
|
+
<line x1="21" y1="21" x2="16.65" y2="16.65"></line>
|
|
77
|
+
</svg>`,
|
|
78
|
+
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">
|
|
79
|
+
<polyline points="13 17 18 12 13 7"></polyline>
|
|
80
|
+
<polyline points="6 17 11 12 6 7"></polyline>
|
|
81
|
+
</svg>`,
|
|
82
|
+
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">
|
|
83
|
+
<polyline points="11 17 6 12 11 7"></polyline>
|
|
84
|
+
<polyline points="18 17 13 12 18 7"></polyline>
|
|
85
|
+
</svg>`,
|
|
86
|
+
reguaMetrica: `<svg viewBox="0 0 24 24" width="10" height="10" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
87
|
+
<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>
|
|
88
|
+
<line x1="14.5" y1="8.5" x2="12" y2="11"></line>
|
|
89
|
+
<line x1="10.5" y1="12.5" x2="8" y2="15"></line>
|
|
90
|
+
</svg>`,
|
|
91
|
+
moverPasta: `<svg viewBox="0 0 24 24" width="11" height="11" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
92
|
+
<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>
|
|
93
|
+
</svg>`,
|
|
94
|
+
mapa: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
95
|
+
<polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"></polygon>
|
|
96
|
+
<line x1="8" y1="2" x2="8" y2="18"></line>
|
|
97
|
+
<line x1="16" y1="6" x2="16" y2="22"></line>
|
|
98
|
+
</svg>`,
|
|
99
|
+
gradeCad: `<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
100
|
+
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
101
|
+
<line x1="3" y1="9" x2="21" y2="9"></line>
|
|
102
|
+
<line x1="3" y1="15" x2="21" y2="15"></line>
|
|
103
|
+
<line x1="9" y1="3" x2="9" y2="21"></line>
|
|
104
|
+
<line x1="15" y1="3" x2="15" y2="21"></line>
|
|
105
|
+
</svg>`
|
|
106
|
+
}, V = 6378137;
|
|
107
|
+
function xe(a, r) {
|
|
108
|
+
if (!a || !r) return 0;
|
|
109
|
+
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, d = o - t, n = Math.sin(s / 2) * Math.sin(s / 2) + Math.cos(e) * Math.cos(i) * Math.sin(d / 2) * Math.sin(d / 2);
|
|
110
|
+
return V * 2 * Math.atan2(Math.sqrt(n), Math.sqrt(1 - n));
|
|
111
|
+
}
|
|
112
|
+
function te(a) {
|
|
113
|
+
if (!Array.isArray(a) || a.length < 2) return 0;
|
|
114
|
+
if (Array.isArray(a[0]) && Array.isArray(a[0][0]))
|
|
115
|
+
return a.reduce((e, t) => e + te(t), 0);
|
|
116
|
+
let r = 0;
|
|
117
|
+
for (let e = 0; e < a.length - 1; e++) {
|
|
118
|
+
const t = a[e], i = a[e + 1];
|
|
119
|
+
Array.isArray(t) && Array.isArray(i) && t.length >= 2 && i.length >= 2 && (r += xe([t[0], t[1]], [i[0], i[1]]));
|
|
120
|
+
}
|
|
121
|
+
return r;
|
|
122
|
+
}
|
|
123
|
+
function ie(a) {
|
|
124
|
+
if (!Array.isArray(a) || a.length === 0) return 0;
|
|
125
|
+
if (Array.isArray(a[0]) && Array.isArray(a[0][0]))
|
|
126
|
+
return a.reduce((i, o) => i + ie(o), 0);
|
|
127
|
+
const r = a.length;
|
|
128
|
+
if (r < 3) return 0;
|
|
129
|
+
let e = 0;
|
|
130
|
+
for (let i = 0; i < r; i++) {
|
|
131
|
+
const o = a[i], s = a[(i + 1) % r], d = a[(i + 2) % r];
|
|
132
|
+
if (!Array.isArray(o) || !Array.isArray(s) || !Array.isArray(d)) continue;
|
|
133
|
+
const n = (s[1] - o[1]) * (Math.PI / 180), l = (s[0] - o[0]) * (Math.PI / 180), c = (d[1] - s[1]) * (Math.PI / 180), p = (d[0] - s[0]) * (Math.PI / 180);
|
|
134
|
+
e += n * p - l * c;
|
|
135
|
+
}
|
|
136
|
+
const t = Math.abs(e * (V * V) / 2);
|
|
137
|
+
return isNaN(t) ? 0 : t;
|
|
138
|
+
}
|
|
139
|
+
function re(a) {
|
|
140
|
+
if (!a || a.length === 0) return "";
|
|
141
|
+
const r = a.filter(
|
|
142
|
+
(t) => t.type === "Polygon" || t.type === "MultiPolygon" || t.geometryType === "Polygon"
|
|
143
|
+
);
|
|
144
|
+
if (r.length > 0) {
|
|
145
|
+
const t = r.reduce(
|
|
146
|
+
(i, o) => i + (ie(o.coordinates) || 0),
|
|
147
|
+
0
|
|
148
|
+
);
|
|
149
|
+
return t >= 1e4 ? `${(t / 1e4).toLocaleString("pt-BR", {
|
|
150
|
+
minimumFractionDigits: 1,
|
|
151
|
+
maximumFractionDigits: 2
|
|
152
|
+
})} ha` : `${Math.round(t).toLocaleString("pt-BR")} m²`;
|
|
153
|
+
}
|
|
154
|
+
const e = a.filter(
|
|
155
|
+
(t) => t.type === "LineString" || t.type === "MultiLineString" || t.geometryType === "LineString"
|
|
156
|
+
);
|
|
157
|
+
if (e.length > 0) {
|
|
158
|
+
const t = e.reduce(
|
|
159
|
+
(i, o) => i + (te(o.coordinates) || 0),
|
|
160
|
+
0
|
|
161
|
+
);
|
|
162
|
+
return t >= 1e3 ? `${(t / 1e3).toLocaleString("pt-BR", {
|
|
163
|
+
minimumFractionDigits: 1,
|
|
164
|
+
maximumFractionDigits: 2
|
|
165
|
+
})} km` : `${Math.round(t).toLocaleString("pt-BR")} m`;
|
|
166
|
+
}
|
|
167
|
+
return "";
|
|
168
|
+
}
|
|
169
|
+
function k(a) {
|
|
170
|
+
return a == null ? "" : String(a).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
171
|
+
}
|
|
172
|
+
const we = /^(#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})|(?:rgb|hsl)a?\(\s*[\w.%\s,/+-]+\)|[a-z]{3,30})$/i;
|
|
173
|
+
function D(a, r = "#00E08A") {
|
|
174
|
+
if (!a || typeof a != "string") return r;
|
|
175
|
+
const e = a.trim();
|
|
176
|
+
return we.test(e) ? e : r;
|
|
177
|
+
}
|
|
178
|
+
function H(a) {
|
|
179
|
+
return Math.max(0, Math.min(255, Math.round(a))).toString(16).padStart(2, "0");
|
|
180
|
+
}
|
|
181
|
+
function Ee(a, r, e) {
|
|
182
|
+
const t = r / 100, i = e / 100, o = (n) => (n + a / 30) % 12, s = t * Math.min(i, 1 - i), d = (n) => i - s * Math.max(-1, Math.min(o(n) - 3, Math.min(9 - o(n), 1)));
|
|
183
|
+
return [d(0) * 255, d(8) * 255, d(4) * 255];
|
|
184
|
+
}
|
|
185
|
+
function Ae(a, r = "#000000") {
|
|
186
|
+
if (!a || typeof a != "string") return r;
|
|
187
|
+
const e = a.trim().toLowerCase(), t = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.exec(e);
|
|
188
|
+
if (t) {
|
|
189
|
+
const o = t[1];
|
|
190
|
+
return o.length <= 4 ? `#${o[0]}${o[0]}${o[1]}${o[1]}${o[2]}${o[2]}` : `#${o.slice(0, 6)}`;
|
|
191
|
+
}
|
|
192
|
+
const i = /^(rgb|hsl)a?\(([^)]+)\)$/.exec(e);
|
|
193
|
+
if (i) {
|
|
194
|
+
const o = i[2].split(/[\s,/]+/).filter(Boolean).map((s) => parseFloat(s));
|
|
195
|
+
if (o.length >= 3 && o.slice(0, 3).every((s) => !isNaN(s))) {
|
|
196
|
+
const [s, d, n] = o, [l, c, p] = i[1] === "rgb" ? [s, d, n] : Ee(s, d, n);
|
|
197
|
+
return `#${H(l)}${H(c)}${H(p)}`;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return r;
|
|
201
|
+
}
|
|
202
|
+
function S(a, r, e) {
|
|
203
|
+
const t = a.querySelectorAll(`[${r}]`);
|
|
204
|
+
for (let i = 0; i < t.length; i++)
|
|
205
|
+
if (t[i].getAttribute(r) === e) return t[i];
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
function oe(a, r = 80) {
|
|
209
|
+
let e = null;
|
|
210
|
+
return (...t) => {
|
|
211
|
+
e && clearTimeout(e), e = setTimeout(() => {
|
|
212
|
+
a(...t), e = null;
|
|
213
|
+
}, r);
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
function $(a, r) {
|
|
217
|
+
a.setAttribute("title", r), a.setAttribute("aria-label", r);
|
|
218
|
+
}
|
|
219
|
+
const se = [
|
|
220
|
+
{
|
|
221
|
+
id: "none",
|
|
222
|
+
nome: "Sem Mapa",
|
|
223
|
+
descricao: "Tela CAD neutra com grade quadriculada"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
id: "google_satelite_puro",
|
|
227
|
+
nome: "Google Puro",
|
|
228
|
+
descricao: "Satélite limpo sem ruas ou rótulos",
|
|
229
|
+
thumbnailUrl: "https://images.unsplash.com/photo-1524661135-423995f22d0b?w=160&auto=format&fit=crop&q=80"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
id: "google_satelite",
|
|
233
|
+
nome: "Google Híbrido",
|
|
234
|
+
descricao: "Satélite com nomes de ruas e divisas",
|
|
235
|
+
thumbnailUrl: "https://images.unsplash.com/photo-1524661135-423995f22d0b?w=160&auto=format&fit=crop&q=80"
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: "satelite",
|
|
239
|
+
nome: "Esri Satélite",
|
|
240
|
+
descricao: "Imagens orbitais de alta resolução",
|
|
241
|
+
thumbnailUrl: "https://images.unsplash.com/photo-1451187580459-43490279c0fa?w=160&auto=format&fit=crop&q=80"
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
id: "osm",
|
|
245
|
+
nome: "OpenStreetMap",
|
|
246
|
+
descricao: "Mapa viário e urbano colaborativo",
|
|
247
|
+
thumbnailUrl: "https://images.unsplash.com/photo-1569336415962-a4bd9f69cd83?w=160&auto=format&fit=crop&q=80"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
id: "topografia",
|
|
251
|
+
nome: "Topografia",
|
|
252
|
+
descricao: "Curvas de nível e relevo sombreado",
|
|
253
|
+
thumbnailUrl: "https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?w=160&auto=format&fit=crop&q=80"
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "dark",
|
|
257
|
+
nome: "Dark Canvas",
|
|
258
|
+
descricao: "Mapa escuro de alto contraste para CAD",
|
|
259
|
+
thumbnailUrl: "https://images.unsplash.com/photo-1518709268805-4e9042af9f23?w=160&auto=format&fit=crop&q=80"
|
|
260
|
+
}
|
|
261
|
+
];
|
|
262
|
+
function ke(a = se, r = "satelite") {
|
|
263
|
+
return !a || a.length === 0 ? "" : `
|
|
264
|
+
<div class="ui-basemap-section">
|
|
265
|
+
<div class="ui-basemap-title">Mapa Base</div>
|
|
266
|
+
<div class="ui-basemap-grid">
|
|
267
|
+
${a.map((t) => {
|
|
268
|
+
const i = r === t.id, o = k(t.id), s = k(t.nome), d = k(t.descricao || t.nome);
|
|
269
|
+
let n = "";
|
|
270
|
+
return t.thumbnailUrl ? n = `<img class="ui-basemap-preview" src="${k(t.thumbnailUrl)}" alt="" loading="lazy" referrerpolicy="no-referrer" data-basemap-thumb />` : n = `<div class="ui-basemap-preview-none">${m.gradeCad}</div>`, `
|
|
271
|
+
<div class="ui-basemap-card ${i ? "active" : ""}" data-basemap-id="${o}" role="button" tabindex="0" aria-pressed="${i}" title="${d}">
|
|
272
|
+
${n}
|
|
273
|
+
<span>${s}</span>
|
|
274
|
+
</div>
|
|
275
|
+
`;
|
|
276
|
+
}).join("")}
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
`;
|
|
280
|
+
}
|
|
281
|
+
function Ie(a, r, e) {
|
|
282
|
+
const t = r.filter((l) => e.has(l.id)), i = t.length > 0, o = re(t), s = i ? t.length : a.length, d = i ? t.length > 1 ? "selecionados" : "selecionado" : a.length > 1 ? "camadas" : "camada", n = a.map((l) => `<option value="${k(l.id)}">${k(l.name)}</option>`).join("");
|
|
283
|
+
return `
|
|
284
|
+
<div class="ui-tree-footer">
|
|
285
|
+
<div class="ui-footer-left">
|
|
286
|
+
<span class="ui-footer-count" id="footer-count">${s}</span>
|
|
287
|
+
<span class="ui-footer-label" id="footer-label">${d}</span>
|
|
288
|
+
<span class="ui-footer-metric" style="display: ${o ? "inline-flex" : "none"};">${o ? `${m.reguaMetrica} ${o}` : ""}</span>
|
|
289
|
+
</div>
|
|
290
|
+
<div class="ui-footer-right">
|
|
291
|
+
<button class="ui-footer-btn ${i ? "" : "disabled"}" id="btn-footer-vis" title="Alternar visibilidade coletiva" aria-label="Alternar visibilidade coletiva" ${i ? "" : "disabled"}>
|
|
292
|
+
${m.olhoAberto}
|
|
293
|
+
</button>
|
|
294
|
+
|
|
295
|
+
<button class="ui-footer-btn ${i ? "" : "disabled"}" id="btn-footer-lock" title="Alternar bloqueio coletivo" aria-label="Alternar bloqueio coletivo" ${i ? "" : "disabled"}>
|
|
296
|
+
${m.cadeadoTrancado}
|
|
297
|
+
</button>
|
|
298
|
+
|
|
299
|
+
<div class="ui-footer-color-wrapper ${i ? "" : "disabled"}" title="Alterar cor dos selecionados">
|
|
300
|
+
<input type="color" id="input-footer-color" aria-label="Cor dos selecionados" value="#00E08A" class="ui-footer-color" ${i ? "" : "disabled"} />
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<div class="ui-footer-move-wrapper ${i ? "" : "disabled"}" title="Mover selecionados para outra camada">
|
|
304
|
+
<select id="select-footer-move" aria-label="Mover selecionados para outra camada" class="ui-footer-select" ${i ? "" : "disabled"}>
|
|
305
|
+
<option value="" disabled selected>📂</option>
|
|
306
|
+
${n}
|
|
307
|
+
</select>
|
|
308
|
+
</div>
|
|
309
|
+
|
|
310
|
+
<button class="ui-footer-btn" id="btn-footer-new-layer" title="Criar Nova Camada" aria-label="Criar Nova Camada">
|
|
311
|
+
${m.mais}
|
|
312
|
+
</button>
|
|
313
|
+
|
|
314
|
+
<button class="ui-footer-btn ${i ? "" : "disabled"}" id="btn-footer-del" title="Excluir selecionados" aria-label="Excluir selecionados" ${i ? "" : "disabled"}>
|
|
315
|
+
${m.lixeira}
|
|
316
|
+
</button>
|
|
317
|
+
|
|
318
|
+
${i ? `<button class="ui-footer-btn" id="btn-footer-clear" title="Limpar seleção" aria-label="Limpar seleção">${m.fechar}</button>` : ""}
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
`;
|
|
322
|
+
}
|
|
323
|
+
const ne = 80;
|
|
324
|
+
function K(a, r) {
|
|
325
|
+
const e = (r || "").trim().toLowerCase();
|
|
326
|
+
return e ? a.filter(
|
|
327
|
+
(t) => (t.name || "").toLowerCase().includes(e) || (t.category || "").toLowerCase().includes(e) || (t.type || "").toLowerCase().includes(e)
|
|
328
|
+
) : a;
|
|
329
|
+
}
|
|
330
|
+
function Le(a, r, e, t = "", i = ne) {
|
|
331
|
+
const o = (t || "").trim() !== "", s = [], d = /* @__PURE__ */ new Map();
|
|
332
|
+
for (let n = 0; n < r.length; n++) {
|
|
333
|
+
const l = r[n], c = l.layerId || "";
|
|
334
|
+
d.has(c) || d.set(c, []), d.get(c).push(l);
|
|
335
|
+
}
|
|
336
|
+
for (let n = 0; n < a.length; n++) {
|
|
337
|
+
const l = a[n];
|
|
338
|
+
if (o || e.has(l.id)) {
|
|
339
|
+
const c = K(d.get(l.id) || [], t).slice(0, i);
|
|
340
|
+
for (let p = 0; p < c.length; p++)
|
|
341
|
+
s.push(c[p].id);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return s;
|
|
345
|
+
}
|
|
346
|
+
function Ce(a, r, e, t, i, o) {
|
|
347
|
+
if (!a.includes(t)) return null;
|
|
348
|
+
const s = new Set(r);
|
|
349
|
+
let d = e;
|
|
350
|
+
if (o && e && a.includes(e)) {
|
|
351
|
+
const n = a.indexOf(e), l = a.indexOf(t), c = Math.min(n, l), p = Math.max(n, l);
|
|
352
|
+
i || s.clear();
|
|
353
|
+
for (let u = c; u <= p; u++)
|
|
354
|
+
s.add(a[u]);
|
|
355
|
+
} else i ? (s.has(t) ? s.delete(t) : s.add(t), d = t) : (s.clear(), s.add(t), d = t);
|
|
356
|
+
return { selecionados: s, ultimoClicadoId: d };
|
|
357
|
+
}
|
|
358
|
+
function $e(a, r) {
|
|
359
|
+
if (a.size === 0) return;
|
|
360
|
+
const e = new Set(r.map((t) => t.id));
|
|
361
|
+
for (const t of a)
|
|
362
|
+
e.has(t) || a.delete(t);
|
|
363
|
+
}
|
|
364
|
+
function Se(a, r) {
|
|
365
|
+
const e = D(r, "#00E08A"), t = (a || "").toLowerCase();
|
|
366
|
+
return t === "polygon" || t === "multipolygon" ? `<svg viewBox="0 0 16 16" width="11" height="11"><polygon points="2,14 14,14 12,2 4,4" fill="${e}" fill-opacity="0.45" stroke="${e}" stroke-width="1.5"/></svg>` : t === "linestring" || t === "multilinestring" ? `<svg viewBox="0 0 16 16" width="11" height="11"><polyline points="2,13 8,3 14,10" fill="none" stroke="${e}" stroke-width="2"/></svg>` : t === "text" ? `<svg viewBox="0 0 16 16" width="11" height="11"><text x="8" y="12" font-size="12" font-weight="bold" fill="${e}" 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="${e}" stroke="#ffffff" stroke-width="1.2"/></svg>`;
|
|
367
|
+
}
|
|
368
|
+
function ze(a) {
|
|
369
|
+
const {
|
|
370
|
+
camadas: r,
|
|
371
|
+
feicoes: e,
|
|
372
|
+
camadaAtivaId: t,
|
|
373
|
+
expandedLayers: i,
|
|
374
|
+
selectedFeatureIds: o,
|
|
375
|
+
activeSettingsLayerId: s,
|
|
376
|
+
editingLayerId: d,
|
|
377
|
+
editingFeatureId: n,
|
|
378
|
+
searchQuery: l,
|
|
379
|
+
limiteFeicoesPorCamada: c = ne,
|
|
380
|
+
mostrarBotaoColapsar: p = !1
|
|
381
|
+
} = a, u = (l || "").trim().toLowerCase(), f = /* @__PURE__ */ new Map();
|
|
382
|
+
for (let h = 0; h < e.length; h++) {
|
|
383
|
+
const b = e[h], w = b.layerId || "";
|
|
384
|
+
f.has(w) || f.set(w, []), f.get(w).push(b);
|
|
385
|
+
}
|
|
386
|
+
const g = r.every((h) => h.visible !== !1), v = r.length > 0 && r.every((h) => i.has(h.id)), E = `
|
|
387
|
+
<div class="ui-tree-toolbar">
|
|
388
|
+
<div class="ui-tree-title-group">
|
|
389
|
+
<span class="ui-tree-section-title">CAMADAS</span>
|
|
390
|
+
<span class="ui-tree-count-badge">${r.length}</span>
|
|
391
|
+
</div>
|
|
392
|
+
<div class="ui-tree-actions">
|
|
393
|
+
<button id="btn-toggle-all-vis" class="ui-tree-action-btn" title="${g ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas"}" aria-label="${g ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas"}">
|
|
394
|
+
${g ? m.olhoAberto : m.olhoFechado}
|
|
395
|
+
</button>
|
|
396
|
+
<button id="btn-toggle-all-expand" class="ui-tree-action-btn" aria-label="${v ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}" title="${v ? "Recolher Todos os Grupos" : "Expandir Todos os Grupos"}">
|
|
397
|
+
<span class="ui-chevron-icon ${v ? "open" : ""}">${m.chevronDir}</span>
|
|
398
|
+
</button>
|
|
399
|
+
<button id="btn-add-layer" class="ui-tree-btn-new" title="Adicionar nova camada vetorial">
|
|
400
|
+
${m.mais} Camada
|
|
401
|
+
</button>
|
|
402
|
+
${p ? `<button id="btn-colapsar" class="ui-camadas-btn-colapsar" title="Recolher painel" aria-label="Recolher painel">${m.recolherPainel}</button>` : ""}
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
|
|
406
|
+
<div class="ui-tree-search-wrapper">
|
|
407
|
+
<span class="ui-tree-search-icon">${m.busca}</span>
|
|
408
|
+
<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="${k(
|
|
409
|
+
l
|
|
410
|
+
)}" />
|
|
411
|
+
${l ? `<button class="ui-tree-search-clear" id="btn-clear-layer-search" title="Limpar busca" aria-label="Limpar busca">${m.fechar}</button>` : ""}
|
|
412
|
+
</div>
|
|
413
|
+
`, x = r.map((h) => {
|
|
414
|
+
const b = k(h.id), w = k(h.name || "Camada"), L = D(h.color, "#00E08A"), F = h.visible !== !1, z = h.locked === !0, B = u ? !0 : i.has(h.id), O = s === h.id, Y = t === h.id, I = K(f.get(h.id) || [], u), J = I.length > 0 && I.every((A) => o.has(A.id)), de = !J && I.some((A) => o.has(A.id)), ce = I.slice(0, c), ue = I.length > c, pe = ce.map((A) => {
|
|
415
|
+
const C = k(A.id), X = k(A.name || "Feição"), Z = D(A.color, L), q = A.visible !== !1, P = z, j = A.locked === !0 || P, ee = P ? "Bloqueada pela camada" : j ? "Desbloquear Feição" : "Bloquear Feição", R = o.has(A.id), ae = A.status;
|
|
416
|
+
let N = "";
|
|
417
|
+
return ae === "oficial" ? N = '<span class="ui-geom-tag oficial" title="Geometria Oficial">OFICIAL</span>' : ae === "previa" && (N = '<span class="ui-geom-tag previa" title="Geometria Prévia">PRÉVIA</span>'), `
|
|
418
|
+
<div class="ui-feat-row ${R ? "selected-row" : ""} ${q ? "" : "hidden-row"}" data-feat-row="${C}" data-feat-select="${C}" data-feat-layer="${b}" role="treeitem" aria-selected="${R}" tabindex="-1" draggable="true" title="Clique para selecionar | Arraste para reordenar">
|
|
419
|
+
<div class="ui-col ui-col-eye" data-feat-eye="${C}" role="button" tabindex="0" aria-label="${q ? "Ocultar Feição" : "Exibir Feição"}" title="${q ? "Ocultar Feição" : "Exibir Feição"}">
|
|
420
|
+
${q ? m.olhoAberto : m.olhoFechado}
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
<div class="ui-col ui-col-lock ${j ? "" : "ui-lock-open"}" data-feat-lock="${C}" ${P ? 'data-locked-by-layer="true"' : ""} role="button" tabindex="0" aria-label="${ee}" title="${ee}">
|
|
424
|
+
${j ? m.cadeadoTrancado : m.cadeadoAberto}
|
|
425
|
+
</div>
|
|
426
|
+
|
|
427
|
+
<div class="ui-col ui-col-colorbar" style="background: ${Z};"></div>
|
|
428
|
+
<div class="ui-col ui-col-branch"><span style="opacity: 0.35;">└─</span></div>
|
|
429
|
+
<div class="ui-col ui-col-thumb">
|
|
430
|
+
<div class="ui-thumb-box">${Se(A.type || A.geometryType, Z)}</div>
|
|
431
|
+
</div>
|
|
432
|
+
|
|
433
|
+
<div class="ui-col ui-col-name" data-feat-name-trigger="${C}" title="Duplo clique para renomear">
|
|
434
|
+
${n === A.id ? `<input type="text" class="ui-inline-rename-input" data-inline-feat-input="${C}" value="${X}" />` : `<span class="ui-name-text">${X}</span>${N}`}
|
|
435
|
+
</div>
|
|
436
|
+
|
|
437
|
+
<div class="ui-col ui-col-actions">
|
|
438
|
+
<button class="ui-micro-btn" data-feat-fit="${C}" title="Enquadrar no mapa" aria-label="Enquadrar feição no mapa">${m.alvoEnquadrar}</button>
|
|
439
|
+
</div>
|
|
440
|
+
|
|
441
|
+
<div class="ui-col ui-col-target" data-feat-target="${C}" role="button" tabindex="0" aria-label="Selecionar feição" title="Selecionar feição">
|
|
442
|
+
<div class="ui-target-circle ${R ? "selected" : ""}"></div>
|
|
443
|
+
</div>
|
|
444
|
+
</div>
|
|
445
|
+
`;
|
|
446
|
+
}).join(""), fe = ue ? `<div style="padding: 4px 10px; font-size: 10px; color: var(--ui-cor-texto-secundario, #888899); font-style: italic; background: rgba(0,0,0,0.2);">Exibindo ${c} de ${I.length} feições. Use a busca acima para filtrar.</div>` : "", W = h.opacity !== void 0 ? h.opacity : 1, me = Math.round(W * 100), he = O ? `
|
|
447
|
+
<div class="ui-layer-settings-drawer" id="settings-drawer-${b}" style="--drawer-cor-camada: ${L};">
|
|
448
|
+
<div class="ui-drawer-header">
|
|
449
|
+
<div class="ui-drawer-header-left">
|
|
450
|
+
<span class="ui-drawer-icon">${m.engrenagem}</span>
|
|
451
|
+
<span class="ui-drawer-title">Configurações da Camada</span>
|
|
452
|
+
</div>
|
|
453
|
+
<button type="button" class="ui-drawer-btn-fechar" data-layer-settings-close="${b}" title="Fechar configurações (Esc)" aria-label="Fechar configurações">
|
|
454
|
+
${m.fechar}
|
|
455
|
+
</button>
|
|
456
|
+
</div>
|
|
457
|
+
|
|
458
|
+
<div class="ui-drawer-body">
|
|
459
|
+
<!-- Cor da Camada -->
|
|
460
|
+
<div class="ui-drawer-row">
|
|
461
|
+
<div class="ui-drawer-row-label">
|
|
462
|
+
<span>Cor do Vetor</span>
|
|
463
|
+
</div>
|
|
464
|
+
<div class="ui-drawer-color-group">
|
|
465
|
+
<label class="ui-drawer-color-pill" title="Clique para alterar a cor da camada">
|
|
466
|
+
<span class="ui-drawer-color-sample" id="sample-color-${b}" style="background-color: ${L};"></span>
|
|
467
|
+
<span class="ui-drawer-color-hex" id="hex-color-${b}">${L.toUpperCase()}</span>
|
|
468
|
+
<input type="color" aria-label="Cor da camada" data-layer-color-picker="${b}" value="${Ae(L, "#00e08a")}" class="ui-drawer-color-native" />
|
|
469
|
+
</label>
|
|
470
|
+
</div>
|
|
471
|
+
</div>
|
|
472
|
+
|
|
473
|
+
<!-- Opacidade da Camada -->
|
|
474
|
+
<div class="ui-drawer-row">
|
|
475
|
+
<div class="ui-drawer-row-label">
|
|
476
|
+
<span>Opacidade</span>
|
|
477
|
+
<span class="ui-drawer-badge" id="badge-op-${b}">${me}%</span>
|
|
478
|
+
</div>
|
|
479
|
+
<div class="ui-drawer-slider-container">
|
|
480
|
+
<input type="range" aria-label="Opacidade da camada" min="0.05" max="1" step="0.05" value="${Number(W) || 0}" data-layer-opacity-slider="${b}" class="ui-drawer-slider" />
|
|
481
|
+
</div>
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
|
|
485
|
+
<div class="ui-drawer-footer">
|
|
486
|
+
<div class="ui-drawer-meta-info">
|
|
487
|
+
<span>${I.length} ${I.length === 1 ? "feição" : "feições"} nesta camada</span>
|
|
488
|
+
</div>
|
|
489
|
+
<div class="ui-drawer-actions">
|
|
490
|
+
<button type="button" class="ui-drawer-btn-danger" data-delete-layer="${b}" title="Excluir esta camada e todas as suas feições">
|
|
491
|
+
${m.lixeira}
|
|
492
|
+
<span class="ui-btn-label">Excluir Camada</span>
|
|
493
|
+
</button>
|
|
494
|
+
</div>
|
|
495
|
+
</div>
|
|
496
|
+
</div>
|
|
497
|
+
` : "";
|
|
498
|
+
return `
|
|
499
|
+
<div class="ui-layer-group" data-layer-id="${b}" role="treeitem" aria-expanded="${B}">
|
|
500
|
+
<div class="ui-layer-row ${F ? "" : "hidden-layer"} ${Y ? "active-drawing-layer" : ""}" data-layer-row="${b}" data-layer-id="${b}" tabindex="-1" draggable="true" style="--layer-active-color: ${L};">
|
|
501
|
+
<div class="ui-col ui-col-drag" title="Arrastar para reordenar Z-Index">${m.dragHandle}</div>
|
|
502
|
+
|
|
503
|
+
<div class="ui-col ui-col-eye" data-layer-eye="${b}" role="button" tabindex="0" aria-label="${F ? "Ocultar Camada" : "Exibir Camada"}" title="${F ? "Ocultar Camada" : "Exibir Camada"}">
|
|
504
|
+
${F ? m.olhoAberto : m.olhoFechado}
|
|
505
|
+
</div>
|
|
506
|
+
|
|
507
|
+
<div class="ui-col ui-col-lock ${z ? "" : "ui-lock-open"}" data-layer-lock="${b}" role="button" tabindex="0" aria-label="${z ? "Desbloquear Camada" : "Bloquear Camada"}" title="${z ? "Desbloquear Camada" : "Bloquear Camada"}">
|
|
508
|
+
${z ? m.cadeadoTrancado : m.cadeadoAberto}
|
|
509
|
+
</div>
|
|
510
|
+
|
|
511
|
+
<div class="ui-col ui-col-colorbar" style="background: ${L};"></div>
|
|
512
|
+
|
|
513
|
+
<div class="ui-col ui-col-chevron" data-layer-expand="${b}" role="button" tabindex="0" aria-label="${B ? "Recolher grupo" : "Expandir grupo"}">
|
|
514
|
+
<span class="ui-chevron-icon ${B ? "open" : ""}">${m.chevronDir}</span>
|
|
515
|
+
</div>
|
|
516
|
+
|
|
517
|
+
<div class="ui-col ui-col-name" data-layer-name-trigger="${b}" title="Clique para ativar camada de desenho | Duplo clique para renomear">
|
|
518
|
+
${d === h.id ? `<input type="text" class="ui-inline-rename-input" data-inline-layer-input="${b}" value="${w}" />` : `<span class="ui-name-text">${w}</span>
|
|
519
|
+
${Y ? '<span class="ui-active-badge" title="Camada ativa para novos desenhos">✓ Ativa</span>' : ""}
|
|
520
|
+
<span class="ui-count-chip">${I.length}</span>`}
|
|
521
|
+
</div>
|
|
522
|
+
|
|
523
|
+
<div class="ui-col ui-col-actions">
|
|
524
|
+
<button class="ui-micro-btn" data-layer-fit="${b}" title="Enquadrar camada no mapa" aria-label="Enquadrar camada no mapa">${m.alvoEnquadrar}</button>
|
|
525
|
+
<button class="ui-micro-btn ${O ? "active" : ""}" data-layer-settings="${b}" title="Ajustar cor, opacidade e excluir" aria-label="Configurações da camada" aria-expanded="${O}">${m.engrenagem}</button>
|
|
526
|
+
</div>
|
|
527
|
+
|
|
528
|
+
<div class="ui-col ui-col-target" data-layer-target="${b}" role="button" tabindex="0" aria-label="Selecionar todas as feições deste grupo" title="Selecionar todas as feições deste grupo">
|
|
529
|
+
<div class="ui-target-circle ${J ? "selected" : de ? "partial" : ""}"></div>
|
|
530
|
+
</div>
|
|
531
|
+
</div>
|
|
532
|
+
|
|
533
|
+
${he}
|
|
534
|
+
|
|
535
|
+
<div class="ui-children-container" role="group" style="display: ${B ? "block" : "none"};">
|
|
536
|
+
${pe}
|
|
537
|
+
${fe}
|
|
538
|
+
${I.length === 0 ? `<div class="ui-empty-row"><span>${u ? "Nenhum item correspondente" : "Nenhum elemento neste grupo"}</span></div>` : ""}
|
|
539
|
+
</div>
|
|
540
|
+
</div>
|
|
541
|
+
`;
|
|
542
|
+
}).join("");
|
|
543
|
+
return `
|
|
544
|
+
${E}
|
|
545
|
+
<div class="ui-panel-box">
|
|
546
|
+
<div class="ui-layer-tree" id="ui-layer-tree-mount" role="tree" aria-label="Camadas e feições" aria-multiselectable="true">
|
|
547
|
+
${x}
|
|
548
|
+
</div>
|
|
549
|
+
</div>
|
|
550
|
+
`;
|
|
551
|
+
}
|
|
552
|
+
class Me {
|
|
553
|
+
constructor(r, e) {
|
|
554
|
+
y(this, "host");
|
|
555
|
+
y(this, "shadow");
|
|
556
|
+
this.host = r, this.shadow = e;
|
|
557
|
+
}
|
|
558
|
+
bindAll() {
|
|
559
|
+
this.bindInlineRename(), this.bindDragAndDrop();
|
|
560
|
+
}
|
|
561
|
+
bindInlineRename() {
|
|
562
|
+
this.shadow.querySelectorAll("[data-layer-name-trigger]").forEach((r) => {
|
|
563
|
+
r.addEventListener("dblclick", (e) => {
|
|
564
|
+
e.stopPropagation();
|
|
565
|
+
const t = r.getAttribute("data-layer-name-trigger");
|
|
566
|
+
if (!t) return;
|
|
567
|
+
this.host.editingLayerId = t, this.host.solicitarRenderizacao();
|
|
568
|
+
const i = S(
|
|
569
|
+
this.shadow,
|
|
570
|
+
"data-inline-layer-input",
|
|
571
|
+
t
|
|
572
|
+
);
|
|
573
|
+
if (i) {
|
|
574
|
+
i.focus(), i.select();
|
|
575
|
+
let o = !1;
|
|
576
|
+
const s = (d) => {
|
|
577
|
+
var n, l;
|
|
578
|
+
if (!o) {
|
|
579
|
+
if (o = !0, this.host.editingLayerId = null, d) {
|
|
580
|
+
const c = i.value.trim(), p = this.host.camadas.find((u) => u.id === t);
|
|
581
|
+
c && p && p.name !== c && (p.name = c, (l = (n = this.host).salvarLembrancaEstado) == null || l.call(n), this.host.dispararEvento("ui-camada-renomeada", {
|
|
582
|
+
camadaId: t,
|
|
583
|
+
novoNome: c,
|
|
584
|
+
camada: p
|
|
585
|
+
}));
|
|
586
|
+
}
|
|
587
|
+
this.host.solicitarRenderizacao();
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
i.addEventListener("keydown", (d) => {
|
|
591
|
+
d.key === "Enter" ? (d.preventDefault(), s(!0)) : d.key === "Escape" && (d.preventDefault(), s(!1));
|
|
592
|
+
}), i.addEventListener("blur", () => s(!0));
|
|
593
|
+
}
|
|
594
|
+
});
|
|
595
|
+
}), this.shadow.querySelectorAll("[data-feat-name-trigger]").forEach((r) => {
|
|
596
|
+
r.addEventListener("dblclick", (e) => {
|
|
597
|
+
e.stopPropagation();
|
|
598
|
+
const t = r.getAttribute("data-feat-name-trigger");
|
|
599
|
+
if (!t) return;
|
|
600
|
+
this.host.editingFeatureId = t, this.host.solicitarRenderizacao();
|
|
601
|
+
const i = S(
|
|
602
|
+
this.shadow,
|
|
603
|
+
"data-inline-feat-input",
|
|
604
|
+
t
|
|
605
|
+
);
|
|
606
|
+
if (i) {
|
|
607
|
+
i.focus(), i.select();
|
|
608
|
+
let o = !1;
|
|
609
|
+
const s = (d) => {
|
|
610
|
+
if (!o) {
|
|
611
|
+
if (o = !0, this.host.editingFeatureId = null, d) {
|
|
612
|
+
const n = i.value.trim(), l = this.host.feicoes.find((c) => c.id === t);
|
|
613
|
+
n && l && l.name !== n && (l.name = n, this.host.dispararEvento("ui-feicao-renomeada", {
|
|
614
|
+
feicaoId: t,
|
|
615
|
+
novoNome: n,
|
|
616
|
+
feicao: l
|
|
617
|
+
}));
|
|
618
|
+
}
|
|
619
|
+
this.host.solicitarRenderizacao();
|
|
620
|
+
}
|
|
621
|
+
};
|
|
622
|
+
i.addEventListener("keydown", (d) => {
|
|
623
|
+
d.key === "Enter" ? (d.preventDefault(), s(!0)) : d.key === "Escape" && (d.preventDefault(), s(!1));
|
|
624
|
+
}), i.addEventListener("blur", () => s(!0));
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
});
|
|
628
|
+
}
|
|
629
|
+
bindDragAndDrop() {
|
|
630
|
+
let r = null, e = null, t = null;
|
|
631
|
+
const i = () => {
|
|
632
|
+
this.shadow.querySelectorAll(".ui-layer-row, .ui-feat-row, .ui-layer-group").forEach((o) => {
|
|
633
|
+
o.classList.remove("dragging", "drop-above", "drop-below", "drop-into");
|
|
634
|
+
});
|
|
635
|
+
};
|
|
636
|
+
this.shadow.querySelectorAll('.ui-layer-row[draggable="true"]').forEach((o) => {
|
|
637
|
+
const s = o.getAttribute("data-layer-id");
|
|
638
|
+
s && (o.addEventListener("dragstart", (d) => {
|
|
639
|
+
const n = d;
|
|
640
|
+
if (n.target.closest("input, button, select") || this.host.editingLayerId || this.host.editingFeatureId) {
|
|
641
|
+
n.preventDefault();
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
r = "layer", e = s, n.dataTransfer && (n.dataTransfer.setData("text/plain", JSON.stringify({ type: "layer", id: s })), n.dataTransfer.effectAllowed = "move"), o.classList.add("dragging");
|
|
645
|
+
}), o.addEventListener("dragover", (d) => {
|
|
646
|
+
const n = d;
|
|
647
|
+
if (n.preventDefault(), n.stopPropagation(), n.dataTransfer && (n.dataTransfer.dropEffect = "move"), r === "layer") {
|
|
648
|
+
if (e === s) return;
|
|
649
|
+
const l = o.getBoundingClientRect(), c = n.clientY - l.top < l.height / 2;
|
|
650
|
+
o.classList.toggle("drop-above", c), o.classList.toggle("drop-below", !c);
|
|
651
|
+
} else r === "feature" && o.classList.add("drop-into");
|
|
652
|
+
}), o.addEventListener("dragleave", (d) => {
|
|
653
|
+
const n = d.relatedTarget;
|
|
654
|
+
n && o.contains(n) || o.classList.remove("drop-above", "drop-below", "drop-into");
|
|
655
|
+
}), o.addEventListener("drop", (d) => {
|
|
656
|
+
var c, p;
|
|
657
|
+
const n = d;
|
|
658
|
+
n.preventDefault(), n.stopPropagation();
|
|
659
|
+
const l = o.classList.contains("drop-above");
|
|
660
|
+
if (i(), r === "layer") {
|
|
661
|
+
if (!e || e === s) return;
|
|
662
|
+
const u = this.host.camadas.findIndex((v) => v.id === e);
|
|
663
|
+
if (u === -1) return;
|
|
664
|
+
const [f] = this.host.camadas.splice(u, 1), g = this.host.camadas.findIndex((v) => v.id === s);
|
|
665
|
+
g === -1 ? this.host.camadas.push(f) : this.host.camadas.splice(l ? g : g + 1, 0, f), (p = (c = this.host).salvarLembrancaEstado) == null || p.call(c), this.host.dispararEvento("ui-camadas-reordenadas", {
|
|
666
|
+
camadas: [...this.host.camadas]
|
|
667
|
+
}), this.host.solicitarRenderizacao();
|
|
668
|
+
} else if (r === "feature") {
|
|
669
|
+
if (!t) return;
|
|
670
|
+
const u = this.host.feicoes.find((g) => g.id === t), f = this.host.camadas.find((g) => g.id === s);
|
|
671
|
+
if (u && f && u.layerId !== s) {
|
|
672
|
+
const g = u.layerId;
|
|
673
|
+
u.layerId = s, this.host.dispararEvento("ui-feicao-movida", {
|
|
674
|
+
feicaoId: u.id,
|
|
675
|
+
camadaOrigemId: g,
|
|
676
|
+
camadaDestinoId: s,
|
|
677
|
+
feicao: u
|
|
678
|
+
}), this.host.solicitarRenderizacao();
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
}), o.addEventListener("dragend", () => {
|
|
682
|
+
r = null, e = null, t = null, i();
|
|
683
|
+
}));
|
|
684
|
+
}), this.shadow.querySelectorAll('.ui-feat-row[draggable="true"]').forEach((o) => {
|
|
685
|
+
const s = o.getAttribute("data-feat-row"), d = o.getAttribute("data-feat-layer");
|
|
686
|
+
s && (o.addEventListener("dragstart", (n) => {
|
|
687
|
+
const l = n;
|
|
688
|
+
if (l.target.closest("input, button, select") || this.host.editingLayerId || this.host.editingFeatureId) {
|
|
689
|
+
l.preventDefault();
|
|
690
|
+
return;
|
|
691
|
+
}
|
|
692
|
+
l.stopPropagation(), r = "feature", t = s, e = d, l.dataTransfer && (l.dataTransfer.setData(
|
|
693
|
+
"text/plain",
|
|
694
|
+
JSON.stringify({ type: "feature", id: s, layerId: d })
|
|
695
|
+
), l.dataTransfer.effectAllowed = "move"), o.classList.add("dragging");
|
|
696
|
+
}), o.addEventListener("dragover", (n) => {
|
|
697
|
+
const l = n;
|
|
698
|
+
if (r !== "feature" || t === s) return;
|
|
699
|
+
l.preventDefault(), l.stopPropagation(), l.dataTransfer && (l.dataTransfer.dropEffect = "move");
|
|
700
|
+
const c = o.getBoundingClientRect(), p = l.clientY - c.top < c.height / 2;
|
|
701
|
+
o.classList.toggle("drop-above", p), o.classList.toggle("drop-below", !p);
|
|
702
|
+
}), o.addEventListener("dragleave", (n) => {
|
|
703
|
+
const l = n.relatedTarget;
|
|
704
|
+
l && o.contains(l) || o.classList.remove("drop-above", "drop-below");
|
|
705
|
+
}), o.addEventListener("drop", (n) => {
|
|
706
|
+
const l = n;
|
|
707
|
+
if (r !== "feature" || !t || t === s) return;
|
|
708
|
+
l.preventDefault(), l.stopPropagation();
|
|
709
|
+
const c = o.classList.contains("drop-above");
|
|
710
|
+
i();
|
|
711
|
+
const p = this.host.feicoes.findIndex((h) => h.id === t);
|
|
712
|
+
if (p === -1) return;
|
|
713
|
+
const u = this.host.feicoes.find((h) => h.id === s);
|
|
714
|
+
if (!u) return;
|
|
715
|
+
const [f] = this.host.feicoes.splice(p, 1), g = f.layerId, v = u.layerId, E = g !== v;
|
|
716
|
+
E && (f.layerId = v);
|
|
717
|
+
const x = this.host.feicoes.findIndex((h) => h.id === s);
|
|
718
|
+
x === -1 ? this.host.feicoes.push(f) : this.host.feicoes.splice(c ? x : x + 1, 0, f), E && this.host.dispararEvento("ui-feicao-movida", {
|
|
719
|
+
feicaoId: f.id,
|
|
720
|
+
camadaOrigemId: g,
|
|
721
|
+
camadaDestinoId: v,
|
|
722
|
+
feicao: f
|
|
723
|
+
}), this.host.dispararEvento("ui-feicoes-reordenadas", {
|
|
724
|
+
feicoes: [...this.host.feicoes]
|
|
725
|
+
}), this.host.solicitarRenderizacao();
|
|
726
|
+
}), o.addEventListener("dragend", (n) => {
|
|
727
|
+
n.stopPropagation(), r = null, t = null, e = null, i();
|
|
728
|
+
}));
|
|
729
|
+
});
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
const Fe = "ui_camadas_estado_";
|
|
733
|
+
function Be(a, r) {
|
|
734
|
+
const e = (a || r || "default").trim();
|
|
735
|
+
return `${Fe}${e}`;
|
|
736
|
+
}
|
|
737
|
+
function U(a) {
|
|
738
|
+
if (typeof window > "u" || typeof localStorage > "u")
|
|
739
|
+
return null;
|
|
740
|
+
try {
|
|
741
|
+
const r = localStorage.getItem(a);
|
|
742
|
+
if (!r) return null;
|
|
743
|
+
const e = JSON.parse(r);
|
|
744
|
+
if (e && typeof e == "object")
|
|
745
|
+
return e;
|
|
746
|
+
} catch (r) {
|
|
747
|
+
console.warn(`[UI-Camadas] Não foi possível carregar o estado persistido (${a}):`, r);
|
|
748
|
+
}
|
|
749
|
+
return null;
|
|
750
|
+
}
|
|
751
|
+
function qe(a, r) {
|
|
752
|
+
if (!(typeof window > "u" || typeof localStorage > "u"))
|
|
753
|
+
try {
|
|
754
|
+
localStorage.setItem(a, JSON.stringify(r));
|
|
755
|
+
} catch (e) {
|
|
756
|
+
console.warn(`[UI-Camadas] Não foi possível salvar o estado persistido (${a}):`, e);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
function Te(a) {
|
|
760
|
+
if (!(typeof window > "u" || typeof localStorage > "u"))
|
|
761
|
+
try {
|
|
762
|
+
localStorage.removeItem(a);
|
|
763
|
+
} catch {
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
function _(a) {
|
|
767
|
+
return {
|
|
768
|
+
name: a.name,
|
|
769
|
+
visible: a.visible !== !1,
|
|
770
|
+
locked: !!a.locked,
|
|
771
|
+
opacity: typeof a.opacity == "number" ? a.opacity : 1,
|
|
772
|
+
color: a.color || "#00E08A"
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function De(a, r, e, t) {
|
|
776
|
+
if (!Array.isArray(a)) return;
|
|
777
|
+
const i = (r == null ? void 0 : r.camadasOverrides) || {}, o = new Set((r == null ? void 0 : r.expandedLayerIds) || []), s = new Set((r == null ? void 0 : r.collapsedLayerIds) || []), d = o.size > 0 || s.size > 0;
|
|
778
|
+
for (let n = 0; n < a.length; n++) {
|
|
779
|
+
const l = a[n], c = i[l.id];
|
|
780
|
+
if (t == null || t.set(l.id, _(l)), c) {
|
|
781
|
+
const p = c.origem, u = (f) => {
|
|
782
|
+
var v;
|
|
783
|
+
const g = (v = t == null ? void 0 : t.get(l.id)) == null ? void 0 : v[f];
|
|
784
|
+
return p !== void 0 && p[f] !== g;
|
|
785
|
+
};
|
|
786
|
+
typeof c.name == "string" && c.name.trim() && !u("name") && (l.name = c.name), typeof c.visible == "boolean" && !u("visible") && (l.visible = c.visible), typeof c.locked == "boolean" && !u("locked") && (l.locked = c.locked), typeof c.opacity == "number" && !u("opacity") && (l.opacity = c.opacity), typeof c.color == "string" && !u("color") && (l.color = c.color);
|
|
787
|
+
}
|
|
788
|
+
d ? o.has(l.id) ? e.add(l.id) : s.has(l.id) ? e.delete(l.id) : e.add(l.id) : e.add(l.id);
|
|
789
|
+
}
|
|
790
|
+
if (Array.isArray(r == null ? void 0 : r.ordemCamadasIds) && r.ordemCamadasIds.length > 0) {
|
|
791
|
+
const n = /* @__PURE__ */ new Map();
|
|
792
|
+
r.ordemCamadasIds.forEach((l, c) => n.set(l, c)), a.sort((l, c) => {
|
|
793
|
+
const p = n.has(l.id) ? n.get(l.id) : 9999, u = n.has(c.id) ? n.get(c.id) : 9999;
|
|
794
|
+
return p - u;
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
function Oe(a) {
|
|
799
|
+
const { estadoAnterior: r, camadas: e, expandedLayers: t } = a;
|
|
800
|
+
let i = (r == null ? void 0 : r.expandedLayerIds) || [], o = (r == null ? void 0 : r.collapsedLayerIds) || [], s = (r == null ? void 0 : r.ordemCamadasIds) || [];
|
|
801
|
+
const d = {
|
|
802
|
+
...(r == null ? void 0 : r.camadasOverrides) || {}
|
|
803
|
+
};
|
|
804
|
+
return e.length > 0 && (i = [], o = [], s = e.map((n) => n.id), e.forEach((n) => {
|
|
805
|
+
var l, c;
|
|
806
|
+
t.has(n.id) ? i.push(n.id) : o.push(n.id), d[n.id] = {
|
|
807
|
+
name: n.name,
|
|
808
|
+
visible: n.visible !== !1,
|
|
809
|
+
locked: !!n.locked,
|
|
810
|
+
opacity: typeof n.opacity == "number" ? n.opacity : 1,
|
|
811
|
+
color: n.color || "#00E08A",
|
|
812
|
+
origem: ((l = a.origensCamadas) == null ? void 0 : l.get(n.id)) ?? ((c = d[n.id]) == null ? void 0 : c.origem)
|
|
813
|
+
};
|
|
814
|
+
})), {
|
|
815
|
+
versao: 1,
|
|
816
|
+
expandedLayerIds: i,
|
|
817
|
+
collapsedLayerIds: o,
|
|
818
|
+
camadaAtivaId: a.camadaAtivaId,
|
|
819
|
+
painelColapsado: a.painelColapsado,
|
|
820
|
+
ordemCamadasIds: s,
|
|
821
|
+
mapaBaseAtivo: a.mapaBaseAtivo,
|
|
822
|
+
densidade: a.densidade,
|
|
823
|
+
altura: a.altura,
|
|
824
|
+
camadasOverrides: d,
|
|
825
|
+
ultimaAtualizacao: Date.now()
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
const Pe = ':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-linha-altura: 25px;--camada-thumb-tamanho: 15px;--camada-transicao: .16s cubic-bezier(.16, 1, .3, 1)}:host([densidade="compacto"]){--camada-linha-altura: 22px;--camada-thumb-tamanho: 13px;font-size:10px}:host([flutuante]){position:absolute;top:10px;right:10px;bottom:46px;z-index:var(--ui-z-workspace-hud, 500);width:auto;height:var(--ui-camadas-altura, auto)}*,*:before,*:after{box-sizing:border-box}:host(:not([flutuante])) .ui-camadas-container{max-width:100%;min-width:0;border:none;box-shadow:none;border-radius:0;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none}.ui-camadas-container{display:flex;flex-direction:column;flex:1 1 auto;height:100%;min-height:0;width:100%;max-width:380px;min-width:270px;background:var(--ui-cor-superficie, #141417);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));border-radius:var(--ui-raio-borda, 8px);box-shadow:0 10px 30px -4px #00000080,0 0 0 1px #ffffff0d;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-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:0 8px 20px #00000073;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 #00e08a59}.ui-camadas-header{height:32px;min-height:32px;max-height:32px;display:flex;align-items:center;justify-content:space-between;padding:0 5px;border-bottom:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));background:var(--ui-cor-fundo-elevado, rgba(0, 0, 0, .28));gap:4px}.ui-camadas-tabs{display:flex;gap:3px;flex:1}.ui-camadas-tab-btn{flex:1;background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);height:24px;padding:0 6px;font-size:11px;font-weight:500;border-radius:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap;transition:all var(--camada-transicao)}.ui-camadas-tab-btn:hover{color:var(--ui-cor-texto, #ffffff);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .07))}.ui-camadas-tab-btn.active{color:var(--ui-cor-primaria, #00E08A);background:#00e08a1f;box-shadow:inset 0 0 0 1px #00e08a40;font-weight:600}.ui-camadas-btn-colapsar{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:22px;height:22px;cursor:pointer;border-radius: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:6px 6px 4px;display:flex;flex-direction:column;gap:6px;scrollbar-width:thin;scrollbar-color:rgba(255,255,255,.16) transparent}.ui-camadas-corpo::-webkit-scrollbar{width:4px}.ui-camadas-corpo::-webkit-scrollbar-thumb{background:#ffffff2e;border-radius:4px}.ui-camadas-corpo::-webkit-scrollbar-thumb:hover{background:#ffffff52}.ui-tree-toolbar{display:flex;align-items:center;justify-content:space-between;padding:1px 2px 3px;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-mono, monospace);font-variant-numeric:tabular-nums;background:#ffffff12;color:var(--ui-cor-texto-secundario, #888899);padding:1px 5px;border-radius:8px;border:1px solid rgba(255,255,255,.06)}.ui-tree-actions{display:flex;align-items:center;gap:3px}.ui-tree-action-btn{background:transparent;border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .1));color:var(--ui-cor-texto-secundario, #888899);border-radius:4px;width:22px;height:22px;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);border-color:var(--ui-cor-primaria, #00E08A);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .09))}.ui-tree-btn-new{background:#00e08a1f;border:1px solid rgba(0,224,138,.35);color:var(--ui-cor-primaria, #00E08A);border-radius:4px;height:22px;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);box-shadow:0 0 10px #00e08a59}.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 #00e08a2e}.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:#ffffff1a}.ui-panel-box{background:var(--ui-cor-fundo, #0c0c0f);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));border-radius:var(--ui-raio-borda, 6px);overflow:hidden;display:flex;flex-direction:column;flex:1 1 0%;min-height:80px}.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:#00e08a17!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:#00e08a1f!important;border-left:3px solid var(--layer-active-color, var(--ui-cor-primaria, #00E08A))!important;box-shadow:inset 0 0 12px #00e08a12}.ui-layer-row.active-drawing-layer .ui-name-text{color:#fff;font-weight:700}.ui-feat-row{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:#38bdf82e!important;outline:1px solid rgba(56,189,248,.5)!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:#f59e0b;opacity:.95}.ui-layer-row.dragging,.ui-feat-row.dragging{opacity:.35;background:#38bdf829!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:#38bdf8;box-shadow:0 0 8px #38bdf8;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:#38bdf8;box-shadow:0 0 8px #38bdf8;z-index:20;pointer-events:none}.ui-col{display:flex;align-items:center;justify-content:center;flex-shrink:0;height:var(--camada-linha-altura)}.ui-col-drag{width:14px;cursor:grab;color:var(--ui-cor-texto-secundario, #888899);opacity:.35;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:#f59e0b}.ui-col-colorbar{width:3.5px;height:16px;margin:0 3px 0 2px;border-radius:1.5px;flex-shrink:0}.ui-col-chevron{width:14px;cursor:pointer;color:var(--ui-cor-texto-secundario, #888899);display:flex;align-items:center;justify-content:center}.ui-chevron-icon{display:inline-flex;align-items:center;justify-content:center;transition:transform var(--camada-transicao)}.ui-chevron-icon.open{transform:rotate(90deg)}.ui-col-branch{width:14px;display:flex;align-items:center;justify-content:center;color:#ffffff38;font-size:10px;font-family:var(--ui-fonte-mono, monospace)}.ui-col-thumb{width:18px;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 rgba(255,255,255,.15);border-radius:2.5px;background:#0d0d10;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-active-badge{font-size:8px;font-weight:700;color:var(--ui-cor-primaria, #00E08A);background:#00e08a2e;border:1px solid rgba(0,224,138,.45);padding:1px 4px;border-radius:3px;display:inline-flex;align-items:center;gap:2px;white-space:nowrap;flex-shrink:0;animation:pulseBadge 2.8s infinite}@keyframes pulseBadge{0%{opacity:.85}50%{opacity:1;filter:drop-shadow(0 0 4px rgba(0,224,138,.5))}to{opacity:.85}}.ui-count-chip{font-size:9px;font-family:var(--ui-fonte-mono, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-texto-secundario, #888899);background:#ffffff0f;padding:0 4px;border-radius:8px}.ui-col-actions{display:flex;align-items:center;gap:2px;opacity:0;transition:opacity var(--camada-transicao)}.ui-layer-row:hover .ui-col-actions,.ui-feat-row:hover .ui-col-actions{opacity:1}.ui-micro-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:18px;height:18px;padding:0;border-radius:3px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-micro-btn:hover{color:var(--ui-cor-primaria, #00E08A);background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-micro-btn.active{color:var(--ui-cor-primaria, #00E08A);background:#00e08a2e}.ui-col-target{width:22px;cursor:pointer}.ui-target-circle{width:11px;height:11px;border-radius:50%;border:1.5px solid rgba(255,255,255,.32);background:transparent;transition:all .12s ease}.ui-col-target:hover .ui-target-circle{border-color:#38bdf8;transform:scale(1.18)}.ui-target-circle.selected{border:2px solid #38bdf8;background:#38bdf8;box-shadow:inset 0 0 0 2px #141418}.ui-target-circle.partial{border:2px solid #38bdf8;background:#38bdf866}.ui-inline-rename-input{width:100%;height:20px;background:#0d0d10;color:#fff;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 #00e08a66}.ui-layer-settings-drawer{background:linear-gradient(180deg,#17171e,#0f0f13);padding:10px 14px 12px;border-top:1px solid rgba(255,255,255,.08);border-bottom:1px solid rgba(255,255,255,.12);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 #ffffff0f,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 rgba(255,255,255,.07)}.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:#fff;text-transform:uppercase;letter-spacing:.6px;white-space:nowrap}.ui-drawer-layer-chip{font-size:9.5px;font-weight:500;color:#99b;background:#ffffff12;padding:1px 6px;border-radius:4px;border:1px solid rgba(255,255,255,.08);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:4px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all var(--camada-transicao)}.ui-drawer-btn-fechar:hover{color:#fff;background:#ffffff1f}.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:#9f9fb5}.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:#0006;border:1px solid rgba(255,255,255,.16);border-radius: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:#ffffff14;box-shadow:0 0 10px #00e08a40}.ui-drawer-color-sample{width:14px;height:14px;border-radius:3px;border:1px solid rgba(255,255,255,.35);box-shadow:0 1px 3px #00000080;flex-shrink:0;transition:background-color .1s ease}.ui-drawer-color-hex{font-size:10px;font-family:var(--ui-fonte-mono, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:#f1f1f5;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-mono, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:#fff;background:#ffffff1a;padding:1px 6px;border-radius:4px;border:1px solid rgba(255,255,255,.12)}.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,rgba(255,255,255,.08) 0%,var(--drawer-cor-camada, var(--ui-cor-primaria, #00E08A)) 100%);border-radius:3px;outline:none;margin:3px 0;cursor:pointer;border:1px solid rgba(255,255,255,.12)}.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 rgba(255,255,255,.07)}.ui-drawer-meta-info{font-size:9.5px;color:#77778b;font-style:italic}.ui-drawer-actions{display:flex;align-items:center;gap:6px}.ui-drawer-btn-danger{background:#ef44441a;border:1px solid rgba(239,68,68,.35);color:#f87171;border-radius: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:#ef4444;color:#fff;border-color:#ef4444;box-shadow:0 0 10px #ef444473;transform:translateY(-.5px)}.ui-drawer-btn-danger.confirming{background:#dc2626;color:#fff;border-color:#f87171;animation:pulseDanger 1.2s infinite}@keyframes pulseDanger{0%{transform:scale(1)}50%{transform:scale(1.02)}to{transform:scale(1)}}.ui-geom-tag{font-size:8px;font-weight:700;letter-spacing:.4px;padding:1px 4px;border-radius:3px;margin-left:4px;text-transform:uppercase;flex-shrink:0}.ui-geom-tag.oficial{background:#10b98129;color:#10b981;border:1px solid rgba(16,185,129,.35)}.ui-geom-tag.previa{background:#f59e0b29;color:#f59e0b;border:1px solid rgba(245,158,11,.35)}.ui-tree-footer{height:28px;min-height:28px;background:var(--ui-cor-fundo-elevado, #111115);border-top:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .08));display:flex;align-items:center;justify-content:space-between;padding:0 6px;gap:4px}.ui-footer-left{display:flex;align-items:center;gap:4px;white-space:nowrap;min-width:0}.ui-footer-count{font-size:10.5px;font-family:var(--ui-fonte-mono, monospace);font-variant-numeric:tabular-nums;font-weight:700;color:var(--ui-cor-primaria, #00E08A)}.ui-footer-label{font-size:10px;font-weight:500;color:var(--ui-cor-texto-secundario, #888899)}.ui-footer-metric{font-size:9.5px;font-family:var(--ui-fonte-mono, monospace);font-variant-numeric:tabular-nums;color:var(--ui-cor-primaria, #00E08A);display:inline-flex;align-items:center;gap:3px;white-space:nowrap}.ui-footer-right{display:flex;align-items:center;gap:2px;flex-shrink:0}.ui-footer-btn{background:transparent;border:none;color:var(--ui-cor-texto-secundario, #888899);width:20px;height:20px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center;border-radius:3px;transition:all var(--camada-transicao)}.ui-footer-btn:hover:not(.disabled){color:#fff;background:var(--ui-cor-hover-menu, rgba(255, 255, 255, .12))}.ui-footer-btn.disabled{opacity:.25;cursor:not-allowed}.ui-footer-color-wrapper,.ui-footer-move-wrapper{display:flex;align-items:center}.ui-footer-color{width:15px;height:15px;border:none;background:transparent;cursor:pointer;padding:0}.ui-footer-select{background:var(--ui-cor-fundo, #18181d);border:1px solid var(--ui-cor-borda, rgba(255, 255, 255, .12));color:#fff;border-radius:3px;font-size:9.5px;height:20px;padding:0 2px;cursor:pointer}.ui-basemap-section{display:flex;flex-direction:column;gap:4px;flex-shrink:0}.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-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:#00e08a1f;color:var(--ui-cor-primaria, #00E08A);font-weight:600;box-shadow:inset 0 0 0 1px #00e08a59}.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:#ffffff0a;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-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:#00000026}:host-context([data-tema="claro"]),:host-context(.light),:host([data-tema="claro"]){color:#1a1a1e}:host-context([data-tema="claro"]) .ui-camadas-container,:host([data-tema="claro"]) .ui-camadas-container{background:#fff;border-color:#0000001f;box-shadow:0 10px 30px -4px #00000026}:host-context([data-tema="claro"]) .ui-layer-row,:host([data-tema="claro"]) .ui-layer-row{background:#f1f3f5;color:#1a1a1e}:host-context([data-tema="claro"]) .ui-feat-row,:host([data-tema="claro"]) .ui-feat-row{background:#fff;color:#2b2b36}:host-context([data-tema="claro"]) .ui-panel-box,:host([data-tema="claro"]) .ui-panel-box{background:#fff;border-color:#00000014}.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:#00e08a17;border-top-color:var(--ui-cor-primaria, #00E08A)}.ui-camadas-resizer-grip{width:32px;height:3px;border-radius:2px;background:#ffffff38;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 #00e08a73}: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:#fff;background:#dc2626;width:auto;padding:0 6px}';
|
|
829
|
+
function je(a, r) {
|
|
830
|
+
r.querySelectorAll("[data-layer-row]").forEach((i) => {
|
|
831
|
+
i.addEventListener("click", (o) => {
|
|
832
|
+
if (o.target.closest(
|
|
833
|
+
"[data-layer-eye], [data-layer-lock], [data-layer-expand], [data-layer-target], [data-layer-fit], [data-layer-settings], input, button"
|
|
834
|
+
))
|
|
835
|
+
return;
|
|
836
|
+
const d = i.getAttribute("data-layer-row");
|
|
837
|
+
d && a.definirCamadaAtiva(d, !0);
|
|
838
|
+
});
|
|
839
|
+
}), r.querySelectorAll("[data-layer-expand]").forEach((i) => {
|
|
840
|
+
i.addEventListener("click", (o) => {
|
|
841
|
+
o.stopPropagation();
|
|
842
|
+
const s = i.getAttribute("data-layer-expand");
|
|
843
|
+
if (!s) return;
|
|
844
|
+
a.expandedLayers.has(s) ? a.expandedLayers.delete(s) : a.expandedLayers.add(s);
|
|
845
|
+
const d = i.closest(".ui-layer-group"), n = i.querySelector(".ui-chevron-icon"), l = a.expandedLayers.has(s);
|
|
846
|
+
if (n && n.classList.toggle("open", l), d) {
|
|
847
|
+
const c = d.querySelector(".ui-children-container");
|
|
848
|
+
c && (c.style.display = l ? "block" : "none");
|
|
849
|
+
}
|
|
850
|
+
a.salvarLembrancaEstado();
|
|
851
|
+
});
|
|
852
|
+
}), r.querySelectorAll("[data-layer-eye]").forEach((i) => {
|
|
853
|
+
i.addEventListener("click", (o) => {
|
|
854
|
+
o.stopPropagation();
|
|
855
|
+
const s = i.getAttribute("data-layer-eye"), d = a.camadas.find((n) => n.id === s);
|
|
856
|
+
if (d) {
|
|
857
|
+
d.visible = d.visible === !1;
|
|
858
|
+
const n = d.visible !== !1;
|
|
859
|
+
i.innerHTML = n ? m.olhoAberto : m.olhoFechado, $(i, n ? "Ocultar Camada" : "Exibir Camada");
|
|
860
|
+
const l = i.closest(".ui-layer-row");
|
|
861
|
+
l && l.classList.toggle("hidden-layer", !n), Re(a, r), a.salvarLembrancaEstado(), a.dispararEvento("ui-camada-visibilidade", {
|
|
862
|
+
camadaId: d.id,
|
|
863
|
+
visivel: n
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
});
|
|
867
|
+
}), r.querySelectorAll("[data-layer-lock]").forEach((i) => {
|
|
868
|
+
i.addEventListener("click", (o) => {
|
|
869
|
+
o.stopPropagation();
|
|
870
|
+
const s = i.getAttribute("data-layer-lock"), d = a.camadas.find((n) => n.id === s);
|
|
871
|
+
d && (d.locked = !d.locked, i.innerHTML = d.locked ? m.cadeadoTrancado : m.cadeadoAberto, i.classList.toggle("ui-lock-open", !d.locked), $(i, d.locked ? "Desbloquear Camada" : "Bloquear Camada"), Ne(a, r, d.id, d.locked === !0), a.salvarLembrancaEstado(), a.dispararEvento("ui-camada-bloqueio", {
|
|
872
|
+
camadaId: d.id,
|
|
873
|
+
bloqueado: d.locked
|
|
874
|
+
}));
|
|
875
|
+
});
|
|
876
|
+
}), r.querySelectorAll("[data-layer-fit]").forEach((i) => {
|
|
877
|
+
i.addEventListener("click", (o) => {
|
|
878
|
+
o.stopPropagation();
|
|
879
|
+
const s = i.getAttribute("data-layer-fit");
|
|
880
|
+
s && a.dispararEvento("ui-camada-enquadrar", { camadaId: s });
|
|
881
|
+
});
|
|
882
|
+
}), r.querySelectorAll("[data-layer-settings]").forEach((i) => {
|
|
883
|
+
i.addEventListener("click", (o) => {
|
|
884
|
+
o.stopPropagation();
|
|
885
|
+
const s = i.getAttribute("data-layer-settings");
|
|
886
|
+
a.activeSettingsLayerId = a.activeSettingsLayerId === s ? null : s, a.solicitarRenderizacao();
|
|
887
|
+
});
|
|
888
|
+
}), r.querySelectorAll("[data-layer-settings-close]").forEach((i) => {
|
|
889
|
+
i.addEventListener("click", (o) => {
|
|
890
|
+
o.stopPropagation(), a.activeSettingsLayerId = null, a.solicitarRenderizacao();
|
|
891
|
+
});
|
|
892
|
+
});
|
|
893
|
+
const e = (i, o, s) => {
|
|
894
|
+
const d = a.camadas.find((f) => f.id === i);
|
|
895
|
+
if (!d) return;
|
|
896
|
+
const n = D(o, d.color || "#00E08A");
|
|
897
|
+
d.color = n;
|
|
898
|
+
const l = r.getElementById(`sample-color-${i}`);
|
|
899
|
+
l && (l.style.backgroundColor = n);
|
|
900
|
+
const c = r.getElementById(`hex-color-${i}`);
|
|
901
|
+
c && (c.textContent = n.toUpperCase());
|
|
902
|
+
const p = r.getElementById(`settings-drawer-${i}`);
|
|
903
|
+
p && p.style.setProperty("--drawer-cor-camada", n);
|
|
904
|
+
const u = S(r, "data-layer-row", i);
|
|
905
|
+
if (u) {
|
|
906
|
+
u.style.setProperty("--layer-active-color", n);
|
|
907
|
+
const f = u.querySelector(".ui-col-colorbar");
|
|
908
|
+
f && (f.style.backgroundColor = n);
|
|
909
|
+
}
|
|
910
|
+
s ? a.salvarLembrancaEstado() : a.agendarSalvarLembranca(), a.dispararEvento("ui-camada-cor", { camadaId: d.id, cor: n });
|
|
911
|
+
};
|
|
912
|
+
r.querySelectorAll("[data-layer-color-picker]").forEach((i) => {
|
|
913
|
+
const o = i, s = (d) => (n) => {
|
|
914
|
+
const l = o.getAttribute("data-layer-color-picker");
|
|
915
|
+
if (!l) return;
|
|
916
|
+
const c = n.target.value;
|
|
917
|
+
e(l, c, d);
|
|
918
|
+
};
|
|
919
|
+
o.addEventListener("input", s(!1)), o.addEventListener("change", s(!0));
|
|
920
|
+
});
|
|
921
|
+
const t = (i, o) => {
|
|
922
|
+
const s = a.camadas.find((l) => l.id === i);
|
|
923
|
+
if (!s) return;
|
|
924
|
+
s.opacity = o;
|
|
925
|
+
const d = r.getElementById(`badge-op-${i}`);
|
|
926
|
+
d && (d.textContent = `${Math.round(o * 100)}%`);
|
|
927
|
+
const n = S(r, "data-layer-opacity-slider", i);
|
|
928
|
+
n && parseFloat(n.value) !== o && (n.value = String(o)), a.agendarSalvarLembranca(), a.dispararEvento("ui-camada-opacidade", { camadaId: s.id, opacidade: o });
|
|
929
|
+
};
|
|
930
|
+
r.querySelectorAll("[data-layer-opacity-slider]").forEach((i) => {
|
|
931
|
+
i.addEventListener("input", (o) => {
|
|
932
|
+
const s = i.getAttribute("data-layer-opacity-slider");
|
|
933
|
+
if (!s) return;
|
|
934
|
+
const d = parseFloat(o.target.value);
|
|
935
|
+
t(s, d);
|
|
936
|
+
});
|
|
937
|
+
}), r.querySelectorAll("[data-delete-layer]").forEach((i) => {
|
|
938
|
+
let o = null;
|
|
939
|
+
i.addEventListener("click", (s) => {
|
|
940
|
+
s.stopPropagation();
|
|
941
|
+
const d = i.getAttribute("data-delete-layer");
|
|
942
|
+
if (!d) return;
|
|
943
|
+
if (i.classList.contains("confirming")) {
|
|
944
|
+
o && clearTimeout(o), a.dispararEvento("ui-camada-excluida", { camadaId: d });
|
|
945
|
+
const l = a.selectedFeatureIds.size;
|
|
946
|
+
a.removerCamada(d), a.selectedFeatureIds.size !== l && a.notificarMudancaSelecao();
|
|
947
|
+
} else {
|
|
948
|
+
i.classList.add("confirming");
|
|
949
|
+
const l = i.querySelector(".ui-btn-label");
|
|
950
|
+
l && (l.textContent = "Confirmar Exclusão?"), o = setTimeout(() => {
|
|
951
|
+
i.classList.remove("confirming"), l && (l.textContent = "Excluir Camada");
|
|
952
|
+
}, 3500);
|
|
953
|
+
}
|
|
954
|
+
});
|
|
955
|
+
}), r.querySelectorAll("[data-layer-target]").forEach((i) => {
|
|
956
|
+
i.addEventListener("click", (o) => {
|
|
957
|
+
o.stopPropagation();
|
|
958
|
+
const s = o, d = i.getAttribute("data-layer-target"), n = K(
|
|
959
|
+
a.feicoes.filter((c) => c.layerId === d),
|
|
960
|
+
a.searchQuery
|
|
961
|
+
);
|
|
962
|
+
if (n.length === 0) return;
|
|
963
|
+
n.every((c) => a.selectedFeatureIds.has(c.id)) ? n.forEach((c) => a.selectedFeatureIds.delete(c.id)) : (!s.ctrlKey && !s.metaKey && a.selectedFeatureIds.clear(), n.forEach((c) => a.selectedFeatureIds.add(c.id))), a.lastClickedFeatureId = n[n.length - 1].id, a.sincronizarSelecaoDOM(), a.notificarMudancaSelecao();
|
|
964
|
+
});
|
|
965
|
+
});
|
|
966
|
+
}
|
|
967
|
+
function Re(a, r) {
|
|
968
|
+
const e = r.getElementById("btn-toggle-all-vis");
|
|
969
|
+
if (!e) return;
|
|
970
|
+
const t = a.camadas.every((i) => i.visible !== !1);
|
|
971
|
+
e.innerHTML = t ? m.olhoAberto : m.olhoFechado, $(e, t ? "Ocultar Todas as Camadas" : "Exibir Todas as Camadas");
|
|
972
|
+
}
|
|
973
|
+
function Ne(a, r, e, t) {
|
|
974
|
+
a.feicoes.filter((i) => i.layerId === e).forEach((i) => {
|
|
975
|
+
const o = S(r, "data-feat-lock", i.id);
|
|
976
|
+
if (!o) return;
|
|
977
|
+
const s = i.locked === !0 || t;
|
|
978
|
+
o.innerHTML = s ? m.cadeadoTrancado : m.cadeadoAberto, o.classList.toggle("ui-lock-open", !s), t ? o.setAttribute("data-locked-by-layer", "true") : o.removeAttribute("data-locked-by-layer"), $(
|
|
979
|
+
o,
|
|
980
|
+
t ? "Bloqueada pela camada" : s ? "Desbloquear Feição" : "Bloquear Feição"
|
|
981
|
+
);
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
function He(a, r) {
|
|
985
|
+
const e = r.getElementById("btn-footer-vis");
|
|
986
|
+
e && e.addEventListener("click", () => {
|
|
987
|
+
const l = a.feicoes.filter((u) => a.selectedFeatureIds.has(u.id));
|
|
988
|
+
if (l.length === 0) return;
|
|
989
|
+
const p = !l.some((u) => u.visible !== !1);
|
|
990
|
+
l.forEach((u) => u.visible = p), a.dispararEvento("ui-acao-massa", {
|
|
991
|
+
acao: "visibilidade",
|
|
992
|
+
feicoesIds: l.map((u) => u.id),
|
|
993
|
+
feicoes: l,
|
|
994
|
+
valor: p
|
|
995
|
+
}), a.solicitarRenderizacao();
|
|
996
|
+
});
|
|
997
|
+
const t = r.getElementById("btn-footer-lock");
|
|
998
|
+
t && t.addEventListener("click", () => {
|
|
999
|
+
const l = a.feicoes.filter((u) => a.selectedFeatureIds.has(u.id));
|
|
1000
|
+
if (l.length === 0) return;
|
|
1001
|
+
const p = !l.some((u) => u.locked === !0);
|
|
1002
|
+
l.forEach((u) => u.locked = p), a.dispararEvento("ui-acao-massa", {
|
|
1003
|
+
acao: "bloqueio",
|
|
1004
|
+
feicoesIds: l.map((u) => u.id),
|
|
1005
|
+
feicoes: l,
|
|
1006
|
+
valor: p
|
|
1007
|
+
}), a.solicitarRenderizacao();
|
|
1008
|
+
});
|
|
1009
|
+
const i = r.getElementById("input-footer-color");
|
|
1010
|
+
i && i.addEventListener("change", (l) => {
|
|
1011
|
+
const c = l.target.value, p = a.feicoes.filter((u) => a.selectedFeatureIds.has(u.id));
|
|
1012
|
+
p.length !== 0 && (p.forEach((u) => {
|
|
1013
|
+
u.color = c, u.style = { ...u.style || {}, fillColor: c, strokeColor: c };
|
|
1014
|
+
}), a.dispararEvento("ui-acao-massa", {
|
|
1015
|
+
acao: "cor",
|
|
1016
|
+
feicoesIds: p.map((u) => u.id),
|
|
1017
|
+
feicoes: p,
|
|
1018
|
+
valor: c
|
|
1019
|
+
}), a.solicitarRenderizacao());
|
|
1020
|
+
});
|
|
1021
|
+
const o = r.getElementById("select-footer-move");
|
|
1022
|
+
o && o.addEventListener("change", (l) => {
|
|
1023
|
+
const c = l.target.value;
|
|
1024
|
+
if (!c) return;
|
|
1025
|
+
const p = a.feicoes.filter((f) => a.selectedFeatureIds.has(f.id));
|
|
1026
|
+
if (p.length === 0) return;
|
|
1027
|
+
const u = new Map(p.map((f) => [f.id, f.layerId]));
|
|
1028
|
+
p.forEach((f) => f.layerId = c), p.forEach((f) => {
|
|
1029
|
+
u.get(f.id) !== c && a.dispararEvento("ui-feicao-movida", {
|
|
1030
|
+
feicaoId: f.id,
|
|
1031
|
+
camadaOrigemId: u.get(f.id),
|
|
1032
|
+
camadaDestinoId: c,
|
|
1033
|
+
feicao: f
|
|
1034
|
+
});
|
|
1035
|
+
}), a.dispararEvento("ui-acao-massa", {
|
|
1036
|
+
acao: "mover",
|
|
1037
|
+
feicoesIds: p.map((f) => f.id),
|
|
1038
|
+
feicoes: p,
|
|
1039
|
+
valor: c
|
|
1040
|
+
}), a.solicitarRenderizacao();
|
|
1041
|
+
});
|
|
1042
|
+
const s = r.getElementById("btn-footer-new-layer");
|
|
1043
|
+
s && s.addEventListener("click", () => {
|
|
1044
|
+
a.dispararEvento("ui-camada-adicionar", {});
|
|
1045
|
+
});
|
|
1046
|
+
const d = r.getElementById("btn-footer-del");
|
|
1047
|
+
if (d) {
|
|
1048
|
+
let l = null;
|
|
1049
|
+
const c = "Excluir selecionados";
|
|
1050
|
+
d.addEventListener("click", () => {
|
|
1051
|
+
const p = Array.from(a.selectedFeatureIds);
|
|
1052
|
+
if (p.length === 0) return;
|
|
1053
|
+
if (!d.classList.contains("confirming")) {
|
|
1054
|
+
d.classList.add("confirming"), $(d, `Clique novamente para excluir ${p.length} selecionado(s)`), l = setTimeout(() => {
|
|
1055
|
+
d.classList.remove("confirming"), $(d, c);
|
|
1056
|
+
}, 3500);
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
l && clearTimeout(l);
|
|
1060
|
+
const u = a.feicoes.filter((f) => a.selectedFeatureIds.has(f.id));
|
|
1061
|
+
a.feicoes = a.feicoes.filter((f) => !a.selectedFeatureIds.has(f.id)), a.selectedFeatureIds.clear(), a.lastClickedFeatureId = null, a.dispararEvento("ui-acao-massa", {
|
|
1062
|
+
acao: "excluir",
|
|
1063
|
+
feicoesIds: p,
|
|
1064
|
+
feicoes: u
|
|
1065
|
+
}), a.notificarMudancaSelecao(), a.solicitarRenderizacao();
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
const n = r.getElementById("btn-footer-clear");
|
|
1069
|
+
n && n.addEventListener("click", () => a.limparSelecao(!0));
|
|
1070
|
+
}
|
|
1071
|
+
function Ue(a, r) {
|
|
1072
|
+
const e = r.getElementById("btn-toggle-all-vis");
|
|
1073
|
+
e && e.addEventListener("click", () => a.alternarVisibilidadeTodas(!0));
|
|
1074
|
+
const t = r.getElementById("btn-toggle-all-expand");
|
|
1075
|
+
t && t.addEventListener("click", (s) => {
|
|
1076
|
+
s.stopPropagation(), a.camadas.length > 0 && a.camadas.every((n) => a.expandedLayers.has(n.id)) ? a.colapsarTodas() : a.expandirTodas();
|
|
1077
|
+
});
|
|
1078
|
+
const i = r.getElementById("btn-add-layer");
|
|
1079
|
+
i && i.addEventListener("click", () => {
|
|
1080
|
+
a.dispararEvento("ui-camada-adicionar", {});
|
|
1081
|
+
});
|
|
1082
|
+
const o = r.getElementById("btn-colapsar");
|
|
1083
|
+
o && o.addEventListener("click", () => a.colapsar(!0)), Ve(a, r);
|
|
1084
|
+
}
|
|
1085
|
+
function Ve(a, r) {
|
|
1086
|
+
const e = r.getElementById("input-layer-search"), t = r.getElementById("btn-clear-layer-search"), i = () => {
|
|
1087
|
+
var o;
|
|
1088
|
+
a.searchQuery = "", a.solicitarRenderizacao(), (o = r.getElementById("input-layer-search")) == null || o.focus();
|
|
1089
|
+
};
|
|
1090
|
+
if (e) {
|
|
1091
|
+
const o = oe(() => a.solicitarRenderizacao(), 75);
|
|
1092
|
+
e.addEventListener("input", (s) => {
|
|
1093
|
+
a.searchQuery = s.target.value, o();
|
|
1094
|
+
}), e.addEventListener("keydown", (s) => {
|
|
1095
|
+
s.key === "Escape" && a.searchQuery && (s.preventDefault(), i());
|
|
1096
|
+
});
|
|
1097
|
+
}
|
|
1098
|
+
t && t.addEventListener("click", i);
|
|
1099
|
+
}
|
|
1100
|
+
function _e(a, r) {
|
|
1101
|
+
r.querySelectorAll("[data-feat-select]").forEach((e) => {
|
|
1102
|
+
e.addEventListener("click", (t) => {
|
|
1103
|
+
if (a.editingFeatureId) return;
|
|
1104
|
+
const i = t;
|
|
1105
|
+
if (i.target.closest(
|
|
1106
|
+
"[data-feat-eye], [data-feat-lock], [data-feat-fit], [data-feat-target], input, button"
|
|
1107
|
+
))
|
|
1108
|
+
return;
|
|
1109
|
+
const s = e.getAttribute("data-feat-select");
|
|
1110
|
+
s && a.selecionarFeicao(s, i.ctrlKey || i.metaKey, i.shiftKey, !0);
|
|
1111
|
+
});
|
|
1112
|
+
}), r.querySelectorAll("[data-feat-target]").forEach((e) => {
|
|
1113
|
+
e.addEventListener("click", (t) => {
|
|
1114
|
+
t.stopPropagation();
|
|
1115
|
+
const i = t, o = e.getAttribute("data-feat-target");
|
|
1116
|
+
o && a.selecionarFeicao(o, i.ctrlKey || i.metaKey, i.shiftKey, !0);
|
|
1117
|
+
});
|
|
1118
|
+
}), r.querySelectorAll("[data-feat-eye]").forEach((e) => {
|
|
1119
|
+
e.addEventListener("click", (t) => {
|
|
1120
|
+
t.stopPropagation();
|
|
1121
|
+
const i = e.getAttribute("data-feat-eye"), o = a.feicoes.find((s) => s.id === i);
|
|
1122
|
+
if (o) {
|
|
1123
|
+
o.visible = o.visible === !1;
|
|
1124
|
+
const s = o.visible !== !1;
|
|
1125
|
+
e.innerHTML = s ? m.olhoAberto : m.olhoFechado, $(e, s ? "Ocultar Feição" : "Exibir Feição");
|
|
1126
|
+
const d = e.closest(".ui-feat-row");
|
|
1127
|
+
d && d.classList.toggle("hidden-row", !s), a.dispararEvento("ui-feicao-visibilidade", {
|
|
1128
|
+
feicaoId: o.id,
|
|
1129
|
+
visivel: s
|
|
1130
|
+
});
|
|
1131
|
+
}
|
|
1132
|
+
});
|
|
1133
|
+
}), r.querySelectorAll("[data-feat-lock]").forEach((e) => {
|
|
1134
|
+
e.addEventListener("click", (t) => {
|
|
1135
|
+
if (t.stopPropagation(), e.hasAttribute("data-locked-by-layer")) return;
|
|
1136
|
+
const i = e.getAttribute("data-feat-lock"), o = a.feicoes.find((s) => s.id === i);
|
|
1137
|
+
o && (o.locked = !o.locked, e.innerHTML = o.locked ? m.cadeadoTrancado : m.cadeadoAberto, e.classList.toggle("ui-lock-open", !o.locked), $(e, o.locked ? "Desbloquear Feição" : "Bloquear Feição"), a.dispararEvento("ui-feicao-bloqueio", {
|
|
1138
|
+
feicaoId: o.id,
|
|
1139
|
+
bloqueado: o.locked
|
|
1140
|
+
}));
|
|
1141
|
+
});
|
|
1142
|
+
}), r.querySelectorAll("[data-feat-fit]").forEach((e) => {
|
|
1143
|
+
e.addEventListener("click", (t) => {
|
|
1144
|
+
t.stopPropagation();
|
|
1145
|
+
const i = e.getAttribute("data-feat-fit");
|
|
1146
|
+
i && a.dispararEvento("ui-feicao-enquadrar", { feicaoId: i });
|
|
1147
|
+
});
|
|
1148
|
+
});
|
|
1149
|
+
}
|
|
1150
|
+
function Ge(a, r) {
|
|
1151
|
+
r.querySelectorAll("[data-basemap-thumb]").forEach((e) => {
|
|
1152
|
+
e.addEventListener(
|
|
1153
|
+
"error",
|
|
1154
|
+
() => {
|
|
1155
|
+
const t = document.createElement("div");
|
|
1156
|
+
t.className = "ui-basemap-preview-none", t.innerHTML = m.mapa, e.replaceWith(t);
|
|
1157
|
+
},
|
|
1158
|
+
{ once: !0 }
|
|
1159
|
+
);
|
|
1160
|
+
}), r.querySelectorAll("[data-basemap-id]").forEach((e) => {
|
|
1161
|
+
e.addEventListener("click", () => {
|
|
1162
|
+
const t = e.getAttribute("data-basemap-id");
|
|
1163
|
+
t && a.selecionarMapaBase(t, !0);
|
|
1164
|
+
});
|
|
1165
|
+
});
|
|
1166
|
+
}
|
|
1167
|
+
function Ke(a, r) {
|
|
1168
|
+
Ue(a, r), je(a, r), _e(a, r), Ge(a, r), He(a, r);
|
|
1169
|
+
}
|
|
1170
|
+
const Qe = '[role="button"][tabindex]', M = "[data-layer-row], [data-feat-row]", Ye = ["color", "range", "checkbox", "radio", "button"];
|
|
1171
|
+
function le(a) {
|
|
1172
|
+
return a instanceof HTMLSelectElement || a instanceof HTMLTextAreaElement ? !0 : a instanceof HTMLInputElement && !Ye.includes(a.type);
|
|
1173
|
+
}
|
|
1174
|
+
function Je(a) {
|
|
1175
|
+
return Array.from(a.querySelectorAll(M)).filter((r) => {
|
|
1176
|
+
const e = r.closest(".ui-children-container");
|
|
1177
|
+
return !(e && e.style.display === "none") && !r.classList.contains("ui-search-hidden");
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
function T(a, r) {
|
|
1181
|
+
r && (a.querySelectorAll(M).forEach((e) => e.setAttribute("tabindex", "-1")), r.setAttribute("tabindex", "0"), r.focus());
|
|
1182
|
+
}
|
|
1183
|
+
function We(a, r) {
|
|
1184
|
+
a.dispatchEvent(
|
|
1185
|
+
new MouseEvent("click", {
|
|
1186
|
+
bubbles: !0,
|
|
1187
|
+
ctrlKey: r.ctrlKey || r.metaKey,
|
|
1188
|
+
shiftKey: r.shiftKey
|
|
1189
|
+
})
|
|
1190
|
+
);
|
|
1191
|
+
}
|
|
1192
|
+
function Xe(a, r, e) {
|
|
1193
|
+
var t;
|
|
1194
|
+
if (!le(e.composedPath()[0])) {
|
|
1195
|
+
if (a.activeSettingsLayerId) {
|
|
1196
|
+
e.preventDefault();
|
|
1197
|
+
const i = a.activeSettingsLayerId;
|
|
1198
|
+
a.activeSettingsLayerId = null, a.solicitarRenderizacao(), (t = S(r, "data-layer-settings", i)) == null || t.focus();
|
|
1199
|
+
return;
|
|
1200
|
+
}
|
|
1201
|
+
a.selectedFeatureIds.size > 0 && (e.preventDefault(), a.limparSelecao(!0));
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
function Ze(a, r, e) {
|
|
1205
|
+
var s;
|
|
1206
|
+
const t = e.composedPath()[0];
|
|
1207
|
+
if (!(t instanceof HTMLElement) || le(t)) return;
|
|
1208
|
+
if ((e.key === "Enter" || e.key === " ") && t.matches(Qe)) {
|
|
1209
|
+
e.preventDefault(), t.click();
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
if (!t.matches(M)) return;
|
|
1213
|
+
const i = Je(a), o = i.indexOf(t);
|
|
1214
|
+
switch (e.key) {
|
|
1215
|
+
case "ArrowDown":
|
|
1216
|
+
e.preventDefault(), T(a, i[Math.min(i.length - 1, o + 1)]);
|
|
1217
|
+
break;
|
|
1218
|
+
case "ArrowUp":
|
|
1219
|
+
e.preventDefault(), T(a, i[Math.max(0, o - 1)]);
|
|
1220
|
+
break;
|
|
1221
|
+
case "Home":
|
|
1222
|
+
e.preventDefault(), T(a, i[0]);
|
|
1223
|
+
break;
|
|
1224
|
+
case "End":
|
|
1225
|
+
e.preventDefault(), T(a, i[i.length - 1]);
|
|
1226
|
+
break;
|
|
1227
|
+
case "ArrowRight":
|
|
1228
|
+
case "ArrowLeft": {
|
|
1229
|
+
const d = t.getAttribute("data-layer-row");
|
|
1230
|
+
if (!d) return;
|
|
1231
|
+
const n = t.closest(".ui-layer-group"), l = (n == null ? void 0 : n.getAttribute("aria-expanded")) === "true";
|
|
1232
|
+
e.key === "ArrowRight" !== l && (e.preventDefault(), (s = S(r, "data-layer-expand", d)) == null || s.click());
|
|
1233
|
+
break;
|
|
1234
|
+
}
|
|
1235
|
+
case "Enter":
|
|
1236
|
+
case " ":
|
|
1237
|
+
e.preventDefault(), We(t, e);
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
function ea(a, r, e, t, i) {
|
|
1242
|
+
i.add(r, "keydown", (o) => {
|
|
1243
|
+
o.key === "Escape" && Xe(a, e, o);
|
|
1244
|
+
}), i.add(t, "keydown", (o) => Ze(t, e, o)), i.add(t, "focusin", (o) => {
|
|
1245
|
+
const s = o.composedPath()[0];
|
|
1246
|
+
s instanceof HTMLElement && s.matches(M) && (t.querySelectorAll(M).forEach((d) => d.setAttribute("tabindex", "-1")), s.setAttribute("tabindex", "0"));
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
function aa(a, r) {
|
|
1250
|
+
r.querySelectorAll("[data-layer-row]").forEach((t) => {
|
|
1251
|
+
const o = t.getAttribute("data-layer-row") === a.camadaAtivaId;
|
|
1252
|
+
t.classList.toggle("active-drawing-layer", o);
|
|
1253
|
+
const s = t.querySelector(".ui-col-name");
|
|
1254
|
+
if (s) {
|
|
1255
|
+
let d = s.querySelector(".ui-active-badge");
|
|
1256
|
+
if (o && !d) {
|
|
1257
|
+
d = document.createElement("span"), d.className = "ui-active-badge", d.textContent = "✓ Ativa";
|
|
1258
|
+
const n = s.querySelector(".ui-count-chip");
|
|
1259
|
+
n ? s.insertBefore(d, n) : s.appendChild(d);
|
|
1260
|
+
} else !o && d && d.remove();
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
}
|
|
1264
|
+
function ta(a, r) {
|
|
1265
|
+
r.querySelectorAll(".ui-feat-row").forEach((g) => {
|
|
1266
|
+
const v = g.getAttribute("data-feat-row"), E = v ? a.selectedFeatureIds.has(v) : !1;
|
|
1267
|
+
g.classList.toggle("selected-row", E), g.setAttribute("aria-selected", String(E));
|
|
1268
|
+
const x = g.querySelector(".ui-target-circle");
|
|
1269
|
+
x && x.classList.toggle("selected", E);
|
|
1270
|
+
}), r.querySelectorAll(".ui-layer-group").forEach((g) => {
|
|
1271
|
+
const v = g.getAttribute("data-layer-id"), E = a.feicoes.filter((h) => h.layerId === v), x = g.querySelector(".ui-layer-row .ui-target-circle");
|
|
1272
|
+
if (x && E.length > 0) {
|
|
1273
|
+
const h = E.every((w) => a.selectedFeatureIds.has(w.id)), b = !h && E.some((w) => a.selectedFeatureIds.has(w.id));
|
|
1274
|
+
x.classList.toggle("selected", h), x.classList.toggle("partial", b);
|
|
1275
|
+
} else x && x.classList.remove("selected", "partial");
|
|
1276
|
+
});
|
|
1277
|
+
const e = a.feicoes.filter((g) => a.selectedFeatureIds.has(g.id)), t = e.length > 0, i = r.getElementById("footer-count"), o = r.getElementById("footer-label");
|
|
1278
|
+
i && (i.textContent = String(t ? e.length : a.camadas.length)), o && (o.textContent = t ? e.length > 1 ? "selecionados" : "selecionado" : a.camadas.length > 1 ? "camadas" : "camada");
|
|
1279
|
+
const s = r.querySelector(".ui-footer-metric"), d = re(e);
|
|
1280
|
+
s && (d ? (s.innerHTML = `${m.reguaMetrica} ${d}`, s.style.display = "inline-flex") : s.style.display = "none"), ["btn-footer-vis", "btn-footer-lock", "btn-footer-del"].forEach((g) => {
|
|
1281
|
+
const v = r.getElementById(g);
|
|
1282
|
+
v && (v.disabled = !t, v.classList.toggle("disabled", !t));
|
|
1283
|
+
});
|
|
1284
|
+
const n = r.querySelector(".ui-footer-move-wrapper");
|
|
1285
|
+
n && n.classList.toggle("disabled", !t);
|
|
1286
|
+
const l = r.getElementById("select-footer-move");
|
|
1287
|
+
l && (l.disabled = !t);
|
|
1288
|
+
const c = r.querySelector(".ui-footer-color-wrapper");
|
|
1289
|
+
c && c.classList.toggle("disabled", !t);
|
|
1290
|
+
const p = r.getElementById("input-footer-color");
|
|
1291
|
+
p && (p.disabled = !t);
|
|
1292
|
+
let u = r.getElementById("btn-footer-clear");
|
|
1293
|
+
const f = r.querySelector(".ui-footer-right");
|
|
1294
|
+
t && !u && f ? (u = document.createElement("button"), u.id = "btn-footer-clear", u.className = "ui-footer-btn", u.title = "Limpar seleção", u.innerHTML = m.fechar, u.addEventListener("click", () => a.limparSelecao(!0)), f.appendChild(u)) : !t && u && u.remove();
|
|
1295
|
+
}
|
|
1296
|
+
function ia(a) {
|
|
1297
|
+
function t() {
|
|
1298
|
+
return a.getMinAltura ? a.getMinAltura() : 140;
|
|
1299
|
+
}
|
|
1300
|
+
function i() {
|
|
1301
|
+
return a.getMaxAltura ? a.getMaxAltura() : 1600;
|
|
1302
|
+
}
|
|
1303
|
+
function o(l, c = !1) {
|
|
1304
|
+
if (l == null || l === "") {
|
|
1305
|
+
a.hostElement.style.removeProperty("height"), a.hostElement.style.removeProperty("--ui-camadas-altura"), c && a.hostElement.dispatchEvent(
|
|
1306
|
+
new CustomEvent("ui-redimensionar-altura", {
|
|
1307
|
+
bubbles: !0,
|
|
1308
|
+
composed: !0,
|
|
1309
|
+
detail: { altura: null }
|
|
1310
|
+
})
|
|
1311
|
+
);
|
|
1312
|
+
return;
|
|
1313
|
+
}
|
|
1314
|
+
const p = typeof l == "number" ? l : parseFloat(String(l));
|
|
1315
|
+
if (isNaN(p)) return;
|
|
1316
|
+
const u = Math.max(t(), Math.min(i(), Math.round(p)));
|
|
1317
|
+
a.hostElement.style.height = `${u}px`, a.hostElement.style.setProperty("--ui-camadas-altura", `${u}px`), c && a.hostElement.dispatchEvent(
|
|
1318
|
+
new CustomEvent("ui-redimensionar-altura", {
|
|
1319
|
+
bubbles: !0,
|
|
1320
|
+
composed: !0,
|
|
1321
|
+
detail: { altura: u }
|
|
1322
|
+
})
|
|
1323
|
+
);
|
|
1324
|
+
}
|
|
1325
|
+
let s = null;
|
|
1326
|
+
function d() {
|
|
1327
|
+
if (!a.resizerElement) return;
|
|
1328
|
+
let l = !1, c = 0, p = 0;
|
|
1329
|
+
const u = (g) => {
|
|
1330
|
+
if (g.button !== 0) return;
|
|
1331
|
+
g.preventDefault(), g.stopPropagation(), l = !0, c = g.clientY, p = a.hostElement.getBoundingClientRect().height, a.resizerElement.classList.add("ui-camadas-resizer--ativo"), a.hostElement.classList.add("ui-camadas--redimensionando");
|
|
1332
|
+
try {
|
|
1333
|
+
a.resizerElement.setPointerCapture(g.pointerId);
|
|
1334
|
+
} catch {
|
|
1335
|
+
}
|
|
1336
|
+
const v = (h) => {
|
|
1337
|
+
if (!l) return;
|
|
1338
|
+
h.preventDefault();
|
|
1339
|
+
const b = h.clientY - c, w = Math.max(t(), Math.min(i(), Math.round(p + b)));
|
|
1340
|
+
a.hostElement.style.height = `${w}px`, a.hostElement.style.setProperty("--ui-camadas-altura", `${w}px`), a.onRedimensionando && a.onRedimensionando(w), a.hostElement.dispatchEvent(
|
|
1341
|
+
new CustomEvent("ui-redimensionando-altura", {
|
|
1342
|
+
bubbles: !0,
|
|
1343
|
+
composed: !0,
|
|
1344
|
+
detail: { altura: w }
|
|
1345
|
+
})
|
|
1346
|
+
);
|
|
1347
|
+
}, E = () => {
|
|
1348
|
+
var h;
|
|
1349
|
+
l = !1, s = null, window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", x), window.removeEventListener("pointercancel", x), (h = a.resizerElement) == null || h.classList.remove("ui-camadas-resizer--ativo"), a.hostElement.classList.remove("ui-camadas--redimensionando");
|
|
1350
|
+
}, x = (h) => {
|
|
1351
|
+
if (!l) return;
|
|
1352
|
+
l = !1, a.resizerElement.classList.remove("ui-camadas-resizer--ativo"), a.hostElement.classList.remove("ui-camadas--redimensionando");
|
|
1353
|
+
try {
|
|
1354
|
+
a.resizerElement.hasPointerCapture(h.pointerId) && a.resizerElement.releasePointerCapture(h.pointerId);
|
|
1355
|
+
} catch {
|
|
1356
|
+
}
|
|
1357
|
+
window.removeEventListener("pointermove", v), window.removeEventListener("pointerup", x), window.removeEventListener("pointercancel", x);
|
|
1358
|
+
const b = a.hostElement.getBoundingClientRect().height, w = Math.round(b);
|
|
1359
|
+
a.onAlturaAlterada && a.onAlturaAlterada(w), a.hostElement.dispatchEvent(
|
|
1360
|
+
new CustomEvent("ui-redimensionar-altura", {
|
|
1361
|
+
bubbles: !0,
|
|
1362
|
+
composed: !0,
|
|
1363
|
+
detail: { altura: w }
|
|
1364
|
+
})
|
|
1365
|
+
);
|
|
1366
|
+
};
|
|
1367
|
+
s = E, window.addEventListener("pointermove", v), window.addEventListener("pointerup", x), window.addEventListener("pointercancel", x);
|
|
1368
|
+
}, f = (g) => {
|
|
1369
|
+
g.preventDefault(), g.stopPropagation(), o(null, !0), a.onAlturaAlterada && a.onAlturaAlterada(null);
|
|
1370
|
+
};
|
|
1371
|
+
a.listeners.add(a.resizerElement, "pointerdown", u), a.listeners.add(a.resizerElement, "dblclick", f);
|
|
1372
|
+
}
|
|
1373
|
+
function n() {
|
|
1374
|
+
s == null || s(), a.listeners.cleanup();
|
|
1375
|
+
}
|
|
1376
|
+
return {
|
|
1377
|
+
init: d,
|
|
1378
|
+
definirAltura: o,
|
|
1379
|
+
destruir: n
|
|
1380
|
+
};
|
|
1381
|
+
}
|
|
1382
|
+
class Q extends ve {
|
|
1383
|
+
constructor() {
|
|
1384
|
+
super();
|
|
1385
|
+
y(this, "shadow");
|
|
1386
|
+
y(this, "listeners", new ye());
|
|
1387
|
+
y(this, "dragDropManager");
|
|
1388
|
+
y(this, "resizerController");
|
|
1389
|
+
y(this, "alturaCustomizada", null);
|
|
1390
|
+
y(this, "conectado", !1);
|
|
1391
|
+
y(this, "origensCamadas", /* @__PURE__ */ new Map());
|
|
1392
|
+
y(this, "salvarLembrancaDebounced", oe(() => this.salvarLembrancaEstado(), 200));
|
|
1393
|
+
// Estado interno
|
|
1394
|
+
y(this, "camadas", []);
|
|
1395
|
+
y(this, "feicoes", []);
|
|
1396
|
+
y(this, "mapasBase", [...se]);
|
|
1397
|
+
y(this, "expandedLayers", /* @__PURE__ */ new Set());
|
|
1398
|
+
y(this, "selectedFeatureIds", /* @__PURE__ */ new Set());
|
|
1399
|
+
y(this, "lastClickedFeatureId", null);
|
|
1400
|
+
y(this, "activeSettingsLayerId", null);
|
|
1401
|
+
y(this, "editingLayerId", null);
|
|
1402
|
+
y(this, "editingFeatureId", null);
|
|
1403
|
+
y(this, "searchQuery", "");
|
|
1404
|
+
y(this, "corpoElement");
|
|
1405
|
+
y(this, "btnExpandirFlutuante");
|
|
1406
|
+
this.shadow = this.attachShadow({ mode: "open" }), this.shadow.innerHTML = `
|
|
1407
|
+
<style>${Pe}</style>
|
|
1408
|
+
<div class="ui-camadas-container" id="panel-container" role="region" aria-label="Painel de Camadas">
|
|
1409
|
+
<div class="ui-camadas-corpo" id="painel-corpo"></div>
|
|
1410
|
+
<div class="ui-camadas-resizer-altura" id="resizer-altura" title="Arraste para redimensionar a altura (duplo-clique para resetar)" aria-label="Redimensionar altura">
|
|
1411
|
+
<span class="ui-camadas-resizer-grip"></span>
|
|
1412
|
+
</div>
|
|
1413
|
+
</div>
|
|
1414
|
+
<button class="ui-camadas-toggle-flutuante" id="btn-expandir-flutuante" title="Expandir Painel de Camadas" aria-label="Expandir Painel de Camadas">
|
|
1415
|
+
${m.camadas}
|
|
1416
|
+
</button>
|
|
1417
|
+
`, this.corpoElement = this.shadow.getElementById("painel-corpo"), this.btnExpandirFlutuante = this.shadow.getElementById("btn-expandir-flutuante"), this.dragDropManager = new Me(this, this.shadow);
|
|
1418
|
+
const e = this.shadow.getElementById("resizer-altura");
|
|
1419
|
+
this.resizerController = ia({
|
|
1420
|
+
hostElement: this,
|
|
1421
|
+
resizerElement: e,
|
|
1422
|
+
listeners: this.listeners,
|
|
1423
|
+
getMinAltura: () => {
|
|
1424
|
+
const t = this.getAttribute("min-altura");
|
|
1425
|
+
return t && parseFloat(t) || 140;
|
|
1426
|
+
},
|
|
1427
|
+
getMaxAltura: () => {
|
|
1428
|
+
const t = this.getAttribute("max-altura");
|
|
1429
|
+
return t && parseFloat(t) || 1600;
|
|
1430
|
+
},
|
|
1431
|
+
onAlturaAlterada: (t) => {
|
|
1432
|
+
this.alturaCustomizada = t, this.salvarLembrancaEstado();
|
|
1433
|
+
}
|
|
1434
|
+
});
|
|
1435
|
+
}
|
|
1436
|
+
static get observedAttributes() {
|
|
1437
|
+
return [
|
|
1438
|
+
"titulo",
|
|
1439
|
+
"mapa-base-ativo",
|
|
1440
|
+
"camada-ativa",
|
|
1441
|
+
"aba-ativa",
|
|
1442
|
+
"colapsavel",
|
|
1443
|
+
"colapsado",
|
|
1444
|
+
"flutuante",
|
|
1445
|
+
"mostrar-mapas-base",
|
|
1446
|
+
"mostrar-rodape",
|
|
1447
|
+
"mostrar-busca",
|
|
1448
|
+
"densidade",
|
|
1449
|
+
"persistir",
|
|
1450
|
+
"storage-key",
|
|
1451
|
+
"redimensionavel",
|
|
1452
|
+
"redimensionavel-altura",
|
|
1453
|
+
"altura",
|
|
1454
|
+
"min-altura",
|
|
1455
|
+
"max-altura"
|
|
1456
|
+
];
|
|
1457
|
+
}
|
|
1458
|
+
connectedCallback() {
|
|
1459
|
+
if (this.persistir) {
|
|
1460
|
+
const e = U(this.obterChaveStorageAtual());
|
|
1461
|
+
e && (e.painelColapsado === !0 && !this.hasAttribute("colapsado") && (this.colapsado = !0), e.camadaAtivaId && !this.getAttribute("camada-ativa") && (this.camadaAtivaId = e.camadaAtivaId), e.mapaBaseAtivo && !this.getAttribute("mapa-base-ativo") && (this.mapaBaseAtivo = e.mapaBaseAtivo), e.densidade && !this.getAttribute("densidade") && (this.densidade = e.densidade), typeof e.altura == "number" && !this.getAttribute("altura") && !this.style.height && (this.resizerController.definirAltura(e.altura, !1), this.alturaCustomizada = e.altura));
|
|
1462
|
+
}
|
|
1463
|
+
this.hasAttribute("altura") && this.resizerController.definirAltura(this.getAttribute("altura"), !1), this.resizerController.init(), this.render(), this.conectarEventosGerais(), ea(this, this, this.shadow, this.corpoElement, this.listeners), this.conectado = !0, this.camadas.length > 0 && this.salvarLembrancaEstado();
|
|
1464
|
+
}
|
|
1465
|
+
disconnectedCallback() {
|
|
1466
|
+
var e;
|
|
1467
|
+
this.conectado = !1, (e = this.resizerController) == null || e.destruir(), this.listeners.cleanup();
|
|
1468
|
+
}
|
|
1469
|
+
attributeChangedCallback(e, t, i) {
|
|
1470
|
+
var o;
|
|
1471
|
+
t !== i && (e === "colapsado" ? this.salvarLembrancaEstado() : e === "camada-ativa" ? (this.sincronizarCamadaAtivaDOM(), this.salvarLembrancaEstado()) : e === "mapa-base-ativo" ? i && this.marcarMapaBaseAtivoNoDOM(i) : e === "mostrar-mapas-base" || e === "mostrar-rodape" || e === "mostrar-busca" || e === "colapsavel" || e === "flutuante" ? this.solicitarRenderizacao() : e === "altura" && ((o = this.resizerController) == null || o.definirAltura(i, !1)));
|
|
1472
|
+
}
|
|
1473
|
+
// --- Getters e Setters de Propriedades Reativas ---
|
|
1474
|
+
get titulo() {
|
|
1475
|
+
return this.getAttribute("titulo") || "Camadas";
|
|
1476
|
+
}
|
|
1477
|
+
set titulo(e) {
|
|
1478
|
+
this.setAttribute("titulo", e);
|
|
1479
|
+
}
|
|
1480
|
+
get camadaAtivaId() {
|
|
1481
|
+
var e;
|
|
1482
|
+
return this.getAttribute("camada-ativa") || (((e = this.camadas[0]) == null ? void 0 : e.id) ?? null);
|
|
1483
|
+
}
|
|
1484
|
+
set camadaAtivaId(e) {
|
|
1485
|
+
e ? this.setAttribute("camada-ativa", e) : this.removeAttribute("camada-ativa");
|
|
1486
|
+
}
|
|
1487
|
+
get mapaBaseAtivo() {
|
|
1488
|
+
return this.getAttribute("mapa-base-ativo") || "satelite";
|
|
1489
|
+
}
|
|
1490
|
+
set mapaBaseAtivo(e) {
|
|
1491
|
+
this.setAttribute("mapa-base-ativo", e);
|
|
1492
|
+
}
|
|
1493
|
+
selecionarMapaBase(e, t = !1) {
|
|
1494
|
+
!e || this.mapaBaseAtivo === e || (this.mapaBaseAtivo = e, this.marcarMapaBaseAtivoNoDOM(e), this.salvarLembrancaEstado(), t && this.dispararEvento("ui-mapa-base-alterado", { mapaBaseId: e }));
|
|
1495
|
+
}
|
|
1496
|
+
marcarMapaBaseAtivoNoDOM(e) {
|
|
1497
|
+
this.shadow.querySelectorAll("[data-basemap-id]").forEach((t) => {
|
|
1498
|
+
const i = t.getAttribute("data-basemap-id") === e;
|
|
1499
|
+
t.classList.toggle("active", i), t.setAttribute("aria-pressed", String(i));
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
get abaAtiva() {
|
|
1503
|
+
return this.getAttribute("aba-ativa") || "camadas";
|
|
1504
|
+
}
|
|
1505
|
+
set abaAtiva(e) {
|
|
1506
|
+
this.setAttribute("aba-ativa", e);
|
|
1507
|
+
}
|
|
1508
|
+
get colapsado() {
|
|
1509
|
+
return this.hasAttribute("colapsado");
|
|
1510
|
+
}
|
|
1511
|
+
set colapsado(e) {
|
|
1512
|
+
e ? this.setAttribute("colapsado", "") : this.removeAttribute("colapsado");
|
|
1513
|
+
}
|
|
1514
|
+
get colapsavel() {
|
|
1515
|
+
return this.getAttribute("colapsavel") !== "false";
|
|
1516
|
+
}
|
|
1517
|
+
set colapsavel(e) {
|
|
1518
|
+
this.setAttribute("colapsavel", String(e));
|
|
1519
|
+
}
|
|
1520
|
+
get flutuante() {
|
|
1521
|
+
return this.hasAttribute("flutuante");
|
|
1522
|
+
}
|
|
1523
|
+
set flutuante(e) {
|
|
1524
|
+
e ? this.setAttribute("flutuante", "") : this.removeAttribute("flutuante");
|
|
1525
|
+
}
|
|
1526
|
+
get densidade() {
|
|
1527
|
+
return this.getAttribute("densidade") || "normal";
|
|
1528
|
+
}
|
|
1529
|
+
set densidade(e) {
|
|
1530
|
+
this.setAttribute("densidade", e);
|
|
1531
|
+
}
|
|
1532
|
+
get mostrarMapasBase() {
|
|
1533
|
+
return this.getAttribute("mostrar-mapas-base") !== "false";
|
|
1534
|
+
}
|
|
1535
|
+
set mostrarMapasBase(e) {
|
|
1536
|
+
this.setAttribute("mostrar-mapas-base", String(e));
|
|
1537
|
+
}
|
|
1538
|
+
get mostrarRodape() {
|
|
1539
|
+
return this.getAttribute("mostrar-rodape") !== "false";
|
|
1540
|
+
}
|
|
1541
|
+
set mostrarRodape(e) {
|
|
1542
|
+
this.setAttribute("mostrar-rodape", String(e));
|
|
1543
|
+
}
|
|
1544
|
+
get mostrarBusca() {
|
|
1545
|
+
return this.getAttribute("mostrar-busca") !== "false";
|
|
1546
|
+
}
|
|
1547
|
+
set mostrarBusca(e) {
|
|
1548
|
+
this.setAttribute("mostrar-busca", String(e));
|
|
1549
|
+
}
|
|
1550
|
+
get persistir() {
|
|
1551
|
+
return this.getAttribute("persistir") !== "false";
|
|
1552
|
+
}
|
|
1553
|
+
set persistir(e) {
|
|
1554
|
+
this.setAttribute("persistir", String(e));
|
|
1555
|
+
}
|
|
1556
|
+
get storageKey() {
|
|
1557
|
+
return this.getAttribute("storage-key");
|
|
1558
|
+
}
|
|
1559
|
+
set storageKey(e) {
|
|
1560
|
+
e ? this.setAttribute("storage-key", e) : this.removeAttribute("storage-key");
|
|
1561
|
+
}
|
|
1562
|
+
get redimensionavel() {
|
|
1563
|
+
return this.hasAttribute("redimensionavel") || this.hasAttribute("redimensionavel-altura");
|
|
1564
|
+
}
|
|
1565
|
+
set redimensionavel(e) {
|
|
1566
|
+
e ? this.setAttribute("redimensionavel", "") : (this.removeAttribute("redimensionavel"), this.removeAttribute("redimensionavel-altura"));
|
|
1567
|
+
}
|
|
1568
|
+
get altura() {
|
|
1569
|
+
return this.getAttribute("altura") || this.style.height || null;
|
|
1570
|
+
}
|
|
1571
|
+
set altura(e) {
|
|
1572
|
+
e != null ? (this.setAttribute("altura", String(e)), this.definirAltura(e)) : (this.removeAttribute("altura"), this.definirAltura(null));
|
|
1573
|
+
}
|
|
1574
|
+
definirAltura(e, t = !0) {
|
|
1575
|
+
var o;
|
|
1576
|
+
(o = this.resizerController) == null || o.definirAltura(e, !1);
|
|
1577
|
+
const i = e !== null ? parseFloat(String(e)) : null;
|
|
1578
|
+
this.alturaCustomizada = isNaN(i) ? null : i, t && this.salvarLembrancaEstado();
|
|
1579
|
+
}
|
|
1580
|
+
// --- Gerenciamento de Persistência / Lembrança ---
|
|
1581
|
+
obterChaveStorageAtual() {
|
|
1582
|
+
return Be(this.storageKey, this.id);
|
|
1583
|
+
}
|
|
1584
|
+
/** Versão com debounce, para interações contínuas (seletor de cor, slider de opacidade). */
|
|
1585
|
+
agendarSalvarLembranca() {
|
|
1586
|
+
this.salvarLembrancaDebounced();
|
|
1587
|
+
}
|
|
1588
|
+
salvarLembrancaEstado() {
|
|
1589
|
+
if (!this.persistir || !this.conectado) return;
|
|
1590
|
+
const e = this.obterChaveStorageAtual(), t = Oe({
|
|
1591
|
+
estadoAnterior: U(e),
|
|
1592
|
+
origensCamadas: this.origensCamadas,
|
|
1593
|
+
camadas: this.camadas,
|
|
1594
|
+
expandedLayers: this.expandedLayers,
|
|
1595
|
+
camadaAtivaId: this.camadaAtivaId,
|
|
1596
|
+
painelColapsado: this.colapsado,
|
|
1597
|
+
mapaBaseAtivo: this.mapaBaseAtivo,
|
|
1598
|
+
densidade: this.densidade,
|
|
1599
|
+
altura: this.alturaCustomizada
|
|
1600
|
+
});
|
|
1601
|
+
qe(e, t);
|
|
1602
|
+
}
|
|
1603
|
+
limparLembranca() {
|
|
1604
|
+
Te(this.obterChaveStorageAtual());
|
|
1605
|
+
}
|
|
1606
|
+
// --- API Pública de Alta Ergonomia ---
|
|
1607
|
+
//
|
|
1608
|
+
// Contrato de eventos: toda mutação feita pelo aplicativo consumidor (propriedades,
|
|
1609
|
+
// atributos e métodos públicos) atualiza apenas o DOM interno, sem disparar eventos.
|
|
1610
|
+
// Eventos saem do componente somente em resposta a uma interação física do usuário
|
|
1611
|
+
// (clique, drag-and-drop, teclado). Métodos que aceitam `emitirEvento` permitem
|
|
1612
|
+
// optar explicitamente pela emissão quando necessário.
|
|
1613
|
+
/** Atalho reativo para `definirCamadas()` — não dispara eventos. */
|
|
1614
|
+
get layers() {
|
|
1615
|
+
return this.camadas;
|
|
1616
|
+
}
|
|
1617
|
+
set layers(e) {
|
|
1618
|
+
this.definirCamadas(e);
|
|
1619
|
+
}
|
|
1620
|
+
/** Atalho reativo para `definirFeicoes()` — não dispara eventos. */
|
|
1621
|
+
get features() {
|
|
1622
|
+
return this.feicoes;
|
|
1623
|
+
}
|
|
1624
|
+
set features(e) {
|
|
1625
|
+
this.definirFeicoes(e);
|
|
1626
|
+
}
|
|
1627
|
+
/** Atalho reativo para `definirMapasBase()` — não dispara eventos. */
|
|
1628
|
+
get basemaps() {
|
|
1629
|
+
return this.mapasBase;
|
|
1630
|
+
}
|
|
1631
|
+
set basemaps(e) {
|
|
1632
|
+
this.definirMapasBase(e);
|
|
1633
|
+
}
|
|
1634
|
+
definirCamadas(e, t) {
|
|
1635
|
+
if (this.camadas = Array.isArray(e) ? e.map((i) => ({ ...i })) : [], this.origensCamadas.clear(), this.persistir) {
|
|
1636
|
+
const i = U(this.obterChaveStorageAtual());
|
|
1637
|
+
De(this.camadas, i, this.expandedLayers, this.origensCamadas), i != null && i.camadaAtivaId && this.camadas.some((o) => o.id === i.camadaAtivaId) && (this.camadaAtivaId = i.camadaAtivaId);
|
|
1638
|
+
} else
|
|
1639
|
+
this.camadas.forEach((i) => {
|
|
1640
|
+
this.origensCamadas.set(i.id, _(i)), this.expandedLayers.has(i.id) || this.expandedLayers.add(i.id);
|
|
1641
|
+
});
|
|
1642
|
+
if (Array.isArray(t)) {
|
|
1643
|
+
this.feicoes = t.map((s) => ({ ...s }));
|
|
1644
|
+
const i = new Set(this.camadas.map((s) => s.id)), o = this.feicoes.filter((s) => s.layerId && !i.has(s.layerId));
|
|
1645
|
+
o.length > 0 && console.warn(
|
|
1646
|
+
`[UI-Camadas] ${o.length} feição(ões) possuem 'layerId' não cadastrado nas camadas:`,
|
|
1647
|
+
o.map((s) => ({ id: s.id, nome: s.name, layerId: s.layerId }))
|
|
1648
|
+
), this.sincronizarSelecoesComFeicoesValidas();
|
|
1649
|
+
}
|
|
1650
|
+
!this.getAttribute("camada-ativa") && this.camadas.length > 0 && (this.camadaAtivaId = this.camadas[0].id), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
1651
|
+
}
|
|
1652
|
+
definirFeicoes(e) {
|
|
1653
|
+
this.feicoes = Array.isArray(e) ? e.map((t) => ({ ...t })) : [], this.sincronizarSelecoesComFeicoesValidas(), this.solicitarRenderizacao();
|
|
1654
|
+
}
|
|
1655
|
+
definirMapasBase(e) {
|
|
1656
|
+
this.mapasBase = Array.isArray(e) ? [...e] : [], this.solicitarRenderizacao();
|
|
1657
|
+
}
|
|
1658
|
+
definirCamadaAtiva(e, t = !1) {
|
|
1659
|
+
!e || this.camadaAtivaId === e || (this.camadaAtivaId = e, this.sincronizarCamadaAtivaDOM(), this.salvarLembrancaEstado(), t && this.dispararEvento("ui-camada-selecionada", {
|
|
1660
|
+
camadaId: e,
|
|
1661
|
+
camada: this.camadas.find((i) => i.id === e)
|
|
1662
|
+
}));
|
|
1663
|
+
}
|
|
1664
|
+
obterCamada(e) {
|
|
1665
|
+
return this.camadas.find((t) => t.id === e);
|
|
1666
|
+
}
|
|
1667
|
+
obterCamadaAtiva() {
|
|
1668
|
+
return this.camadas.find((e) => e.id === this.camadaAtivaId);
|
|
1669
|
+
}
|
|
1670
|
+
obterFeicao(e) {
|
|
1671
|
+
return this.feicoes.find((t) => t.id === e);
|
|
1672
|
+
}
|
|
1673
|
+
obterFeicoesSelecionadas() {
|
|
1674
|
+
return this.feicoes.filter((e) => this.selectedFeatureIds.has(e.id));
|
|
1675
|
+
}
|
|
1676
|
+
adicionarCamada(e) {
|
|
1677
|
+
if (!e || !e.id) return;
|
|
1678
|
+
if (this.camadas.some((i) => i.id === e.id)) {
|
|
1679
|
+
console.warn(`[UI-Camadas] adicionarCamada ignorado: já existe uma camada com id '${e.id}'.`);
|
|
1680
|
+
return;
|
|
1681
|
+
}
|
|
1682
|
+
const t = { ...e };
|
|
1683
|
+
this.camadas.push(t), this.origensCamadas.set(t.id, _(t)), this.expandedLayers.add(t.id), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
1684
|
+
}
|
|
1685
|
+
removerCamada(e) {
|
|
1686
|
+
var t;
|
|
1687
|
+
this.camadas = this.camadas.filter((i) => i.id !== e), this.feicoes = this.feicoes.filter((i) => i.layerId !== e), this.origensCamadas.delete(e), this.expandedLayers.delete(e), this.activeSettingsLayerId === e && (this.activeSettingsLayerId = null), this.sincronizarSelecoesComFeicoesValidas(), this.selectedFeatureIds.size === 0 && (this.lastClickedFeatureId = null), this.camadaAtivaId === e && (this.camadaAtivaId = ((t = this.camadas[0]) == null ? void 0 : t.id) ?? null), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
1688
|
+
}
|
|
1689
|
+
adicionarFeicao(e) {
|
|
1690
|
+
if (!(!e || !e.id)) {
|
|
1691
|
+
if (this.feicoes.some((t) => t.id === e.id)) {
|
|
1692
|
+
console.warn(`[UI-Camadas] adicionarFeicao ignorado: já existe uma feição com id '${e.id}'.`);
|
|
1693
|
+
return;
|
|
1694
|
+
}
|
|
1695
|
+
this.feicoes.push({ ...e }), this.solicitarRenderizacao();
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
atualizarFeicao(e) {
|
|
1699
|
+
const t = this.feicoes.findIndex((i) => i.id === e.id);
|
|
1700
|
+
t !== -1 && (this.feicoes[t] = { ...this.feicoes[t], ...e }, this.solicitarRenderizacao());
|
|
1701
|
+
}
|
|
1702
|
+
removerFeicao(e) {
|
|
1703
|
+
this.feicoes = this.feicoes.filter((t) => t.id !== e), this.selectedFeatureIds.delete(e), this.solicitarRenderizacao();
|
|
1704
|
+
}
|
|
1705
|
+
selecionarFeicao(e, t = !1, i = !1, o = !1) {
|
|
1706
|
+
const s = Ce(
|
|
1707
|
+
Le(this.camadas, this.feicoes, this.expandedLayers, this.searchQuery),
|
|
1708
|
+
this.selectedFeatureIds,
|
|
1709
|
+
this.lastClickedFeatureId,
|
|
1710
|
+
e,
|
|
1711
|
+
t,
|
|
1712
|
+
i
|
|
1713
|
+
);
|
|
1714
|
+
s && (this.selectedFeatureIds = s.selecionados, this.lastClickedFeatureId = s.ultimoClicadoId, this.sincronizarSelecaoDOM(), o && this.notificarMudancaSelecao());
|
|
1715
|
+
}
|
|
1716
|
+
selecionarFeicoes(e, t = !1) {
|
|
1717
|
+
const i = e || [];
|
|
1718
|
+
i.length === this.selectedFeatureIds.size && i.every((d) => this.selectedFeatureIds.has(d)) || (this.selectedFeatureIds.clear(), i.forEach((d) => this.selectedFeatureIds.add(d)), this.sincronizarSelecaoDOM(), t && this.notificarMudancaSelecao());
|
|
1719
|
+
}
|
|
1720
|
+
limparSelecao(e = !1) {
|
|
1721
|
+
this.selectedFeatureIds.size !== 0 && (this.selectedFeatureIds.clear(), this.lastClickedFeatureId = null, this.sincronizarSelecaoDOM(), e && this.notificarMudancaSelecao());
|
|
1722
|
+
}
|
|
1723
|
+
expandirTodas() {
|
|
1724
|
+
this.expandedLayers = new Set(this.camadas.map((e) => e.id)), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
1725
|
+
}
|
|
1726
|
+
colapsarTodas() {
|
|
1727
|
+
this.expandedLayers.clear(), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
1728
|
+
}
|
|
1729
|
+
alternarVisibilidadeTodas(e = !1) {
|
|
1730
|
+
const i = !this.camadas.some((o) => o.visible !== !1);
|
|
1731
|
+
this.camadas.forEach((o) => {
|
|
1732
|
+
o.visible = i, e && this.dispararEvento("ui-camada-visibilidade", { camadaId: o.id, visivel: i });
|
|
1733
|
+
}), this.salvarLembrancaEstado(), this.solicitarRenderizacao();
|
|
1734
|
+
}
|
|
1735
|
+
colapsar(e = !1) {
|
|
1736
|
+
this.definirColapso(!0, e);
|
|
1737
|
+
}
|
|
1738
|
+
expandir(e = !1) {
|
|
1739
|
+
this.definirColapso(!1, e);
|
|
1740
|
+
}
|
|
1741
|
+
alternarColapso(e = !1) {
|
|
1742
|
+
this.definirColapso(!this.colapsado, e);
|
|
1743
|
+
}
|
|
1744
|
+
definirColapso(e, t) {
|
|
1745
|
+
this.colapsado !== e && (this.colapsado = e, t && this.dispararEvento("ui-colapso-alterado", { colapsado: e }));
|
|
1746
|
+
}
|
|
1747
|
+
// --- Renderização e Ciclo de Vida ---
|
|
1748
|
+
solicitarRenderizacao() {
|
|
1749
|
+
this.render();
|
|
1750
|
+
}
|
|
1751
|
+
dispararEvento(e, t) {
|
|
1752
|
+
this.dispatchEvent(
|
|
1753
|
+
new CustomEvent(e, {
|
|
1754
|
+
detail: t,
|
|
1755
|
+
bubbles: !0,
|
|
1756
|
+
composed: !0
|
|
1757
|
+
})
|
|
1758
|
+
);
|
|
1759
|
+
}
|
|
1760
|
+
render() {
|
|
1761
|
+
var u;
|
|
1762
|
+
if (!this.corpoElement) return;
|
|
1763
|
+
const e = ze({
|
|
1764
|
+
camadas: this.camadas,
|
|
1765
|
+
feicoes: this.feicoes,
|
|
1766
|
+
camadaAtivaId: this.camadaAtivaId,
|
|
1767
|
+
expandedLayers: this.expandedLayers,
|
|
1768
|
+
selectedFeatureIds: this.selectedFeatureIds,
|
|
1769
|
+
activeSettingsLayerId: this.activeSettingsLayerId,
|
|
1770
|
+
editingLayerId: this.editingLayerId,
|
|
1771
|
+
editingFeatureId: this.editingFeatureId,
|
|
1772
|
+
searchQuery: this.searchQuery,
|
|
1773
|
+
mostrarBotaoColapsar: this.flutuante && this.getAttribute("colapsavel") !== "false"
|
|
1774
|
+
}), t = this.mostrarMapasBase ? ke(this.mapasBase, this.mapaBaseAtivo) : "", i = this.mostrarRodape ? Ie(this.camadas, this.feicoes, this.selectedFeatureIds) : "", o = this.shadow.getElementById("ui-layer-tree-mount"), s = this.corpoElement.scrollTop, d = o ? o.scrollTop : 0, n = this.shadow.activeElement, l = n && this.corpoElement.contains(n) ? n.id : "", c = n && "selectionStart" in n ? n.selectionStart : null;
|
|
1775
|
+
this.corpoElement.innerHTML = `
|
|
1776
|
+
${e}
|
|
1777
|
+
${i}
|
|
1778
|
+
${t}
|
|
1779
|
+
`, this.corpoElement.scrollTop = s;
|
|
1780
|
+
const p = this.shadow.getElementById("ui-layer-tree-mount");
|
|
1781
|
+
if (p && (p.scrollTop = d), l) {
|
|
1782
|
+
const f = this.shadow.getElementById(l);
|
|
1783
|
+
if (f && (f.focus({ preventScroll: !0 }), c !== null && typeof f.setSelectionRange == "function"))
|
|
1784
|
+
try {
|
|
1785
|
+
f.setSelectionRange(c, c);
|
|
1786
|
+
} catch {
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
(u = this.shadow.querySelector("[data-layer-row], [data-feat-row]")) == null || u.setAttribute("tabindex", "0"), Ke(this, this.shadow), this.dragDropManager.bindAll();
|
|
1790
|
+
}
|
|
1791
|
+
// --- Conexão de Eventos ---
|
|
1792
|
+
conectarEventosGerais() {
|
|
1793
|
+
this.listeners.add(this.btnExpandirFlutuante, "click", () => this.expandir(!0));
|
|
1794
|
+
}
|
|
1795
|
+
// --- Sincronização de DOM (delegada) ---
|
|
1796
|
+
sincronizarCamadaAtivaDOM() {
|
|
1797
|
+
aa(this, this.shadow);
|
|
1798
|
+
}
|
|
1799
|
+
sincronizarSelecaoDOM() {
|
|
1800
|
+
ta(this, this.shadow);
|
|
1801
|
+
}
|
|
1802
|
+
// --- Auxiliares Internos ---
|
|
1803
|
+
sincronizarSelecoesComFeicoesValidas() {
|
|
1804
|
+
$e(this.selectedFeatureIds, this.feicoes);
|
|
1805
|
+
}
|
|
1806
|
+
notificarMudancaSelecao() {
|
|
1807
|
+
const e = this.feicoes.filter((t) => this.selectedFeatureIds.has(t.id));
|
|
1808
|
+
this.dispararEvento("ui-feicoes-selecionadas", {
|
|
1809
|
+
feicoesIds: Array.from(this.selectedFeatureIds),
|
|
1810
|
+
feicoes: e
|
|
1811
|
+
}), e.length === 1 ? this.dispararEvento("ui-feicao-selecionada", {
|
|
1812
|
+
feicaoId: e[0].id,
|
|
1813
|
+
feicao: e[0]
|
|
1814
|
+
}) : e.length === 0 && this.dispararEvento("ui-feicao-selecionada", {
|
|
1815
|
+
feicaoId: null,
|
|
1816
|
+
feicao: null
|
|
1817
|
+
});
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
class ra extends Q {
|
|
1821
|
+
}
|
|
1822
|
+
class oa extends Q {
|
|
1823
|
+
}
|
|
1824
|
+
G("ui-camadas", Q);
|
|
1825
|
+
G("ui-painel-camadas", ra);
|
|
1826
|
+
G("ui-layer-panel", oa);
|
|
1827
|
+
export {
|
|
1828
|
+
Me as CamadasDragDropManager,
|
|
1829
|
+
m as ICONES,
|
|
1830
|
+
ne as LIMITE_FEICOES_POR_CAMADA,
|
|
1831
|
+
se as MAPAS_BASE_PADRAO,
|
|
1832
|
+
Q as UICamadas,
|
|
1833
|
+
oa as UILayerPanel,
|
|
1834
|
+
pa as UIMapaBase,
|
|
1835
|
+
ra as UIPainelCamadas,
|
|
1836
|
+
fa as UISeletorMapaBase,
|
|
1837
|
+
ie as calcularAreaPoligono,
|
|
1838
|
+
te as calcularComprimentoLinha,
|
|
1839
|
+
xe as calcularDistanciaPontos,
|
|
1840
|
+
Ce as calcularSelecaoFeicao,
|
|
1841
|
+
U as carregarEstadoPersistido,
|
|
1842
|
+
k as escapeHtml,
|
|
1843
|
+
K as filtrarFeicoesPorBusca,
|
|
1844
|
+
re as formatarMetricaFeicoes,
|
|
1845
|
+
Be as gerarChaveStorage,
|
|
1846
|
+
Te as limparEstadoPersistido,
|
|
1847
|
+
Oe as montarEstadoPersistido,
|
|
1848
|
+
Le as obterIdsVisiveisFeicoes,
|
|
1849
|
+
De as reidratarCamadasComOverrides,
|
|
1850
|
+
$e as removerSelecoesInvalidas,
|
|
1851
|
+
ze as renderizarArvoreCamadas,
|
|
1852
|
+
ke as renderizarGridMapasBase,
|
|
1853
|
+
Ie as renderizarRodapeAcoes,
|
|
1854
|
+
Se as renderizarThumbGeometria,
|
|
1855
|
+
qe as salvarEstadoPersistido,
|
|
1856
|
+
_ as snapshotCamada
|
|
1857
|
+
};
|