@thibezer/ui-components-kit 2.8.2 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/CHANGELOG.md +233 -0
  2. package/README.md +37 -10
  3. package/dist/acessibilidade-CSzX-DkG.cjs +1 -0
  4. package/dist/acessibilidade-CUlSXc2X.js +38 -0
  5. package/dist/altura-controle-ukMRPckR.cjs +1 -0
  6. package/dist/altura-controle-vxQiXG4q.js +62 -0
  7. package/dist/botao.cjs +1 -1
  8. package/dist/botao.js +1 -1
  9. package/dist/camadas.cjs +111 -109
  10. package/dist/camadas.js +1360 -1182
  11. package/dist/campo-texto.cjs +1 -1
  12. package/dist/campo-texto.js +1 -1
  13. package/dist/canvas.cjs +88 -86
  14. package/dist/canvas.js +4695 -3395
  15. package/dist/card.cjs +1 -1
  16. package/dist/card.js +1 -1
  17. package/dist/components/ui-area-texto/area-texto-altura.d.ts +16 -0
  18. package/dist/components/ui-area-texto/area-texto-contador.d.ts +6 -0
  19. package/dist/components/ui-area-texto/area-texto-template.d.ts +2 -0
  20. package/dist/components/ui-area-texto/index.d.ts +3 -0
  21. package/dist/components/ui-area-texto/tipos.d.ts +19 -0
  22. package/dist/components/ui-area-texto/ui-area-texto.d.ts +100 -0
  23. package/dist/components/ui-avatar/ui-avatar.d.ts +11 -0
  24. package/dist/components/ui-badge/ui-badge.d.ts +2 -0
  25. package/dist/components/ui-barra-ferramentas/ferramentas-comum.d.ts +3 -1
  26. package/dist/components/ui-barra-ferramentas/paleta-atalhos.d.ts +23 -0
  27. package/dist/components/ui-barra-ferramentas/paleta-pressao-longa.d.ts +24 -0
  28. package/dist/components/ui-barra-ferramentas/ribbon-render.d.ts +22 -0
  29. package/dist/components/ui-barra-ferramentas/ribbon-teclado.d.ts +24 -0
  30. package/dist/components/ui-barra-ferramentas/ui-paleta-ferramentas.d.ts +3 -7
  31. package/dist/components/ui-barra-ferramentas/ui-ribbon.d.ts +0 -1
  32. package/dist/components/ui-camadas/camadas-arraste-controles.d.ts +2 -0
  33. package/dist/components/ui-camadas/camadas-arvore-renderer.d.ts +4 -11
  34. package/dist/components/ui-camadas/camadas-colecao.d.ts +27 -0
  35. package/dist/components/ui-camadas/camadas-drag-drop.d.ts +13 -1
  36. package/dist/components/ui-camadas/camadas-drop-ops.d.ts +31 -0
  37. package/dist/components/ui-camadas/camadas-hierarquia.d.ts +10 -0
  38. package/dist/components/ui-camadas/camadas-host.d.ts +1 -0
  39. package/dist/components/ui-camadas/camadas-lembranca.d.ts +34 -0
  40. package/dist/components/ui-camadas/camadas-mapas-base.d.ts +3 -1
  41. package/dist/components/ui-camadas/camadas-render.d.ts +15 -0
  42. package/dist/components/ui-camadas/camadas-renomear.d.ts +12 -0
  43. package/dist/components/ui-camadas/camadas-selecao-api.d.ts +17 -0
  44. package/dist/components/ui-camadas/camadas-selecao.d.ts +12 -0
  45. package/dist/components/ui-camadas/camadas-thumb.d.ts +1 -0
  46. package/dist/components/ui-camadas/ui-camadas.d.ts +8 -5
  47. package/dist/components/ui-campo-texto/campo-texto-estados.d.ts +5 -1
  48. package/dist/components/ui-campo-texto/ui-campo-texto.d.ts +1 -0
  49. package/dist/components/ui-canvas-cad/cad-acessibilidade.d.ts +21 -0
  50. package/dist/components/ui-canvas-cad/cad-atributos-sync.d.ts +2 -1
  51. package/dist/components/ui-canvas-cad/cad-broadcast.d.ts +1 -1
  52. package/dist/components/ui-canvas-cad/cad-evento-coordenadas.d.ts +22 -0
  53. package/dist/components/ui-canvas-cad/cad-eventos-canvas.d.ts +3 -8
  54. package/dist/components/ui-canvas-cad/cad-feicoes-camera.d.ts +26 -0
  55. package/dist/components/ui-canvas-cad/cad-feicoes-consulta.d.ts +21 -0
  56. package/dist/components/ui-canvas-cad/cad-feicoes-dados.d.ts +39 -0
  57. package/dist/components/ui-canvas-cad/cad-feicoes-desenho.d.ts +68 -0
  58. package/dist/components/ui-canvas-cad/cad-feicoes-edicao.d.ts +37 -0
  59. package/dist/components/ui-canvas-cad/cad-feicoes-operacoes.d.ts +48 -0
  60. package/dist/components/ui-canvas-cad/cad-feicoes-ponteiro.d.ts +28 -0
  61. package/dist/components/ui-canvas-cad/cad-feicoes-selecao-regiao.d.ts +22 -0
  62. package/dist/components/ui-canvas-cad/cad-feicoes-tipos.d.ts +53 -0
  63. package/dist/components/ui-canvas-cad/cad-feicoes-versoes.d.ts +33 -0
  64. package/dist/components/ui-canvas-cad/cad-feicoes.d.ts +39 -106
  65. package/dist/components/ui-canvas-cad/cad-inicializador.d.ts +3 -1
  66. package/dist/components/ui-canvas-cad/cad-leaflet-adaptador.d.ts +5 -0
  67. package/dist/components/ui-canvas-cad/cad-recusas.d.ts +6 -0
  68. package/dist/components/ui-canvas-cad/cad-selecao-pontos.d.ts +5 -0
  69. package/dist/components/ui-canvas-cad/tipos.d.ts +37 -0
  70. package/dist/components/ui-canvas-cad/ui-canvas-cad.d.ts +30 -1
  71. package/dist/components/ui-card/card-interacao.d.ts +17 -0
  72. package/dist/components/ui-card/card-secoes.d.ts +10 -0
  73. package/dist/components/ui-card/ui-card.d.ts +23 -0
  74. package/dist/components/ui-checkbox/ui-checkbox.d.ts +4 -1
  75. package/dist/components/ui-cores/tipos.d.ts +2 -0
  76. package/dist/components/ui-cores/ui-controle-cores.d.ts +8 -3
  77. package/dist/components/ui-cores/ui-seletor-cor.d.ts +3 -1
  78. package/dist/components/ui-linha/index.d.ts +1 -0
  79. package/dist/components/ui-linha/ui-linha.d.ts +48 -0
  80. package/dist/components/ui-mapa/mapa-atributos.d.ts +14 -0
  81. package/dist/components/ui-mapa/mapa-basemaps.d.ts +7 -0
  82. package/dist/components/ui-mapa/mapa-icones.d.ts +4 -0
  83. package/dist/components/ui-mapa/mapa-leaflet.d.ts +5 -0
  84. package/dist/components/ui-mapa/mapa-vinculo-pai.d.ts +22 -0
  85. package/dist/components/ui-mapa/tipos.d.ts +13 -0
  86. package/dist/components/ui-mapa/ui-mapa-linha.d.ts +12 -5
  87. package/dist/components/ui-mapa/ui-mapa-marcador.d.ts +15 -6
  88. package/dist/components/ui-mapa/ui-mapa.d.ts +14 -1
  89. package/dist/components/ui-modal/modal-acessibilidade.d.ts +5 -5
  90. package/dist/components/ui-modal/modal-foco.d.ts +28 -0
  91. package/dist/components/ui-modal/ui-modal.d.ts +1 -11
  92. package/dist/components/ui-radio/radio-grupo-registry.d.ts +10 -0
  93. package/dist/components/ui-radio/ui-radio.d.ts +9 -2
  94. package/dist/components/ui-skeleton/ui-skeleton.d.ts +9 -0
  95. package/dist/components/ui-switch/ui-switch.d.ts +3 -1
  96. package/dist/components/ui-tabela/tabela-estados.d.ts +16 -0
  97. package/dist/components/ui-tabela/tabela-rolagem.d.ts +44 -0
  98. package/dist/components/ui-tabela/tabela-teclado.d.ts +16 -0
  99. package/dist/components/ui-tabela/ui-tabela.d.ts +1 -19
  100. package/dist/components/ui-texto/ui-texto.d.ts +16 -0
  101. package/dist/components/ui-tooltip/tooltip-popover.d.ts +7 -0
  102. package/dist/components/ui-tooltip/tooltip-posicionamento.d.ts +29 -0
  103. package/dist/components/ui-tooltip/ui-tooltip.d.ts +24 -1
  104. package/dist/core/altura-controle.d.ts +34 -0
  105. package/dist/core/alvo-digitavel.d.ts +5 -0
  106. package/dist/core/index.d.ts +1 -0
  107. package/dist/core/opcoes.d.ts +16 -0
  108. package/dist/core/rotulo-controle.d.ts +13 -0
  109. package/dist/core.cjs +1 -1
  110. package/dist/core.js +28 -18
  111. package/dist/cores.cjs +1 -1
  112. package/dist/cores.js +9 -8
  113. package/dist/custom-elements.json +28294 -20127
  114. package/dist/data.cjs +1 -1
  115. package/dist/data.js +2 -2
  116. package/dist/feedback.cjs +1 -1
  117. package/dist/feedback.js +2 -2
  118. package/dist/form-validacao-BlQFxUVj.js +104 -0
  119. package/dist/form-validacao-DIeyQVH5.cjs +1 -0
  120. package/dist/forms.cjs +1 -1
  121. package/dist/forms.d.ts +4 -0
  122. package/dist/forms.js +15 -12
  123. package/dist/gerencigeo-canvas/canvas_interacao.d.ts +2 -1
  124. package/dist/gerencigeo-canvas/curva_leaflet.d.ts +2 -2
  125. package/dist/gerencigeo-canvas/feature_curvas.d.ts +3 -1
  126. package/dist/gerencigeo-canvas/feature_desenho.d.ts +13 -1
  127. package/dist/gerencigeo-canvas/feature_desenho_controle.d.ts +3 -0
  128. package/dist/gerencigeo-canvas/feature_edicao_ops.d.ts +9 -0
  129. package/dist/gerencigeo-canvas/feature_editor_vertices.d.ts +13 -2
  130. package/dist/gerencigeo-canvas/feature_lod.d.ts +38 -0
  131. package/dist/gerencigeo-canvas/feature_popup.d.ts +2 -0
  132. package/dist/gerencigeo-canvas/feature_simplificacao.d.ts +16 -8
  133. package/dist/gerencigeo-canvas/index.d.ts +7 -0
  134. package/dist/gerencigeo-canvas/layer_hit_test.d.ts +22 -0
  135. package/dist/gerencigeo-canvas/layer_manager.d.ts +5 -0
  136. package/dist/gerencigeo-canvas/mapa_core.d.ts +10 -0
  137. package/dist/gerencigeo-canvas/motor/dados-camada.d.ts +39 -0
  138. package/dist/gerencigeo-canvas/motor/estilo.d.ts +28 -0
  139. package/dist/gerencigeo-canvas/motor/geometria-px.d.ts +27 -0
  140. package/dist/gerencigeo-canvas/motor/index.d.ts +5 -0
  141. package/dist/gerencigeo-canvas/motor/motor-formas.d.ts +107 -0
  142. package/dist/gerencigeo-canvas/motor/tipos.d.ts +100 -0
  143. package/dist/gerencigeo-canvas/popup_gate.d.ts +30 -0
  144. package/dist/gerencigeo-canvas/popup_residual.d.ts +5 -0
  145. package/dist/gerencigeo-canvas/renderers/canvas_formas_leaflet.d.ts +87 -0
  146. package/dist/gerencigeo-canvas/renderers/feicoes_canvas_renderer.d.ts +58 -0
  147. package/dist/gerencigeo-canvas/renderers/feicoes_despachante.d.ts +31 -0
  148. package/dist/gerencigeo-canvas/renderers/feicoes_renderer.d.ts +48 -9
  149. package/dist/gerencigeo-canvas/renderers/marcadores_feicoes.d.ts +11 -0
  150. package/dist/gerencigeo-canvas/renderers/marcas_lod_layer.d.ts +19 -0
  151. package/dist/gerencigeo-canvas/renderers/renderizador_feicoes_tipos.d.ts +44 -0
  152. package/dist/gerencigeo-canvas/renderers/renderizador_formas.d.ts +95 -0
  153. package/dist/gerencigeo-canvas/renderers/selecao_visual.d.ts +6 -0
  154. package/dist/gerencigeo-canvas/types.d.ts +2 -0
  155. package/dist/gerencigeo-canvas/zoom_opcoes.d.ts +10 -0
  156. package/dist/index.cjs +1 -1
  157. package/dist/index.d.ts +7 -0
  158. package/dist/index.js +196 -189
  159. package/dist/mapa.cjs +11 -16
  160. package/dist/mapa.js +242 -170
  161. package/dist/modal.cjs +1 -1
  162. package/dist/modal.js +1 -1
  163. package/dist/motor-BB6tB6U-.cjs +1 -0
  164. package/dist/motor-CFI84lM2.js +1301 -0
  165. package/dist/motor.cjs +1 -0
  166. package/dist/motor.d.ts +7 -0
  167. package/dist/motor.js +52 -0
  168. package/dist/opcoes-CupvWVIm.js +24 -0
  169. package/dist/opcoes-vdAUY5OI.cjs +1 -0
  170. package/dist/register.cjs +1 -1
  171. package/dist/register.js +14 -13
  172. package/dist/tabela.cjs +1 -1
  173. package/dist/tabela.js +1 -1
  174. package/dist/tipos-elementos.d.ts +123 -8
  175. package/dist/tipos-react.d.ts +6 -0
  176. package/dist/tipos-vue.d.ts +119 -8
  177. package/dist/tools.cjs +1 -1
  178. package/dist/tools.js +1 -1
  179. package/dist/ui-badge-B5J_c5P5.js +197 -0
  180. package/dist/ui-badge-DC4y6Dik.cjs +28 -0
  181. package/dist/ui-botao-D24oXySA.cjs +12 -0
  182. package/dist/ui-botao-Dsj08jjw.js +165 -0
  183. package/dist/ui-campo-texto-19tIrmBK.js +377 -0
  184. package/dist/ui-campo-texto-CH8mzX61.cjs +16 -0
  185. package/dist/ui-card-0wu4rjEX.cjs +20 -0
  186. package/dist/ui-card-DRtpOo3l.js +143 -0
  187. package/dist/ui-controle-cores-BEUKOq4n.js +275 -0
  188. package/dist/ui-controle-cores-BLhrZHMh.cjs +32 -0
  189. package/dist/ui-kit.css +1 -1
  190. package/dist/ui-linha-C306zxWG.cjs +19 -0
  191. package/dist/ui-linha-C_azWkcG.js +517 -0
  192. package/dist/{ui-modal-DBOtSTbR.js → ui-modal-BkYvNP0G.js} +116 -140
  193. package/dist/ui-modal-CUNbpbZ1.cjs +18 -0
  194. package/dist/{ui-paleta-ferramentas-DbwdWVtT.js → ui-paleta-ferramentas-BXXrI1Y7.js} +491 -431
  195. package/dist/ui-paleta-ferramentas-CsPMTY0G.cjs +21 -0
  196. package/dist/ui-seletor-cor-2yGryC_Z.cjs +86 -0
  197. package/dist/ui-seletor-cor-BuyhoDZz.js +345 -0
  198. package/dist/{ui-skeleton-W9uwIceA.js → ui-skeleton-B2Rgrv8o.js} +254 -191
  199. package/dist/{ui-skeleton-SPYqku8P.cjs → ui-skeleton-DiOxTBZK.cjs} +10 -10
  200. package/dist/ui-switch-BL-x_-SM.js +1202 -0
  201. package/dist/ui-switch-C0i_3QXu.cjs +66 -0
  202. package/dist/{ui-tabela-propriedades-C-PeuW1i.cjs → ui-tabela-propriedades-CjK2gG14.cjs} +10 -10
  203. package/dist/{ui-tabela-propriedades-BokvDD3b.js → ui-tabela-propriedades-DoL4SE0r.js} +845 -826
  204. package/package.json +8 -3
  205. package/dist/form-validacao-BIOXxt-1.js +0 -140
  206. package/dist/form-validacao-ytRYSF3E.cjs +0 -1
  207. package/dist/svg-seguro-BsbNQqpd.js +0 -50
  208. package/dist/svg-seguro-C76iLlAZ.cjs +0 -1
  209. package/dist/ui-badge-BxT-sDmV.cjs +0 -28
  210. package/dist/ui-badge-C0eKBI8E.js +0 -183
  211. package/dist/ui-botao-BOOnP8ds.cjs +0 -12
  212. package/dist/ui-botao-DfqSivHl.js +0 -165
  213. package/dist/ui-botao-OGJV6Vfk.js +0 -165
  214. package/dist/ui-botao-psS1juof.cjs +0 -12
  215. package/dist/ui-campo-texto-Cnn2UAkS.cjs +0 -16
  216. package/dist/ui-campo-texto-Uu2dJE_0.js +0 -379
  217. package/dist/ui-card-B86lJXTP.cjs +0 -20
  218. package/dist/ui-card-C_o5_0cB.js +0 -111
  219. package/dist/ui-controle-cores-BS0WYPdi.js +0 -572
  220. package/dist/ui-controle-cores-Er6ZcQ7U.cjs +0 -111
  221. package/dist/ui-modal-CvGFGh1h.cjs +0 -18
  222. package/dist/ui-paleta-ferramentas-CEZYcN4J.js +0 -624
  223. package/dist/ui-paleta-ferramentas-CU4icLl0.js +0 -1171
  224. package/dist/ui-paleta-ferramentas-Ccmo-rB5.cjs +0 -21
  225. package/dist/ui-paleta-ferramentas-DLwZHIDv.cjs +0 -21
  226. package/dist/ui-paleta-ferramentas-DNN5i6nL.js +0 -860
  227. package/dist/ui-paleta-ferramentas-Dbj1kBS9.cjs +0 -18
  228. package/dist/ui-paleta-ferramentas-bvqxj1Yd.cjs +0 -21
  229. package/dist/ui-segmented-D6b6zxVs.cjs +0 -19
  230. package/dist/ui-segmented-DyF5YLsV.js +0 -418
  231. package/dist/ui-segmented-rn9RxRGM.cjs +0 -19
  232. package/dist/ui-segmented-wUraId2e.js +0 -412
  233. package/dist/ui-skeleton-DI4_9WOX.js +0 -428
  234. package/dist/ui-skeleton-elhKIh2B.cjs +0 -33
  235. package/dist/ui-switch-BcOqOkiV.js +0 -856
  236. package/dist/ui-switch-D7iPKDj-.cjs +0 -53
  237. package/dist/ui-tabela-propriedades-BBr5sqki.cjs +0 -145
  238. package/dist/ui-tabela-propriedades-BecPqC-e.cjs +0 -141
  239. package/dist/ui-tabela-propriedades-Boy7I5yW.js +0 -2412
  240. package/dist/ui-tabela-propriedades-Df9ajC6M.js +0 -2648
  241. package/dist/ui-toast-Bp_NlM5G.js +0 -156
  242. package/dist/ui-toast-DGTZKne5.cjs +0 -20
  243. package/dist/zero-js-triggers-C_KrvFOQ.js +0 -244
  244. package/dist/zero-js-triggers-C_gtaojZ.cjs +0 -1
package/dist/mapa.cjs CHANGED
@@ -1,19 +1,14 @@
1
- "use strict";var M=Object.defineProperty;var _=(n,o,t)=>o in n?M(n,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[o]=t;var a=(n,o,t)=>_(n,typeof o!="symbol"?o+"":o,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const h=require("./leaflet-loader-94z5VsdY.cjs"),d=require("./leaflet-DcO7uRC-.cjs"),m=require("./ssr-safe-CiHD1adl.cjs"),C=":host{display:block;width:100%;height:400px;position:relative;border-radius:var(--ui-raio-lg, 10px);overflow:hidden;box-shadow:var(--shadow-sm, 0 1px 3px rgba(0,0,0,.1))}.ui-mapa-container{width:100%;height:100%;z-index:1}.leaflet-top,.leaflet-bottom{z-index:1000}.ui-mapa-popup{font-family:inherit;font-size:13px;font-weight:500;color:#111827;padding:2px 4px}.ui-mapa-svg-pin,.ui-mapa-div-marker{background:transparent!important;border:none!important;cursor:pointer;transition:transform .15s ease,filter .15s ease}.ui-mapa-svg-pin:hover,.ui-mapa-div-marker:hover{transform:scale(1.15);filter:brightness(1.2)}";function I(n){return{osm:{nome:"OpenStreetMap",layer:()=>n.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'})},satelite:{nome:"Satélite (Esri)",layer:()=>n.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"})},topografia:{nome:"Topografia",layer:()=>n.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",{attribution:'Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'})},ruas:{nome:"Ruas (Esri)",layer:()=>n.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles &copy; Esri &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"})}}}class y extends m.SafeHTMLElement{constructor(){super();a(this,"mapContainer");a(this,"mapInstance",null);a(this,"_initTimer",null);a(this,"_resizeObserver");a(this,"_resizeTimer");const t=this.attachShadow({mode:"open"});t.innerHTML=`
1
+ "use strict";var I=Object.defineProperty;var z=(r,e,t)=>e in r?I(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var s=(r,e,t)=>z(r,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const m=require("./leaflet-DcO7uRC-.cjs"),p=require("./ssr-safe-CiHD1adl.cjs"),y=require("./leaflet-loader-94z5VsdY.cjs"),_=":host{display:block;width:100%;height:400px;position:relative;border-radius:var(--ui-raio-lg, 10px);overflow:hidden;box-shadow:var(--shadow-sm, 0 1px 3px rgba(0,0,0,.1))}.ui-mapa-container{width:100%;height:100%;z-index:1}.leaflet-top,.leaflet-bottom{z-index:1000}.ui-mapa-popup{font-family:inherit;font-size:13px;font-weight:500;color:#111827;padding:2px 4px}.ui-mapa-svg-pin,.ui-mapa-div-marker{background:transparent!important;border:none!important;cursor:pointer;transition:transform .15s ease,filter .15s ease}.ui-mapa-svg-pin:hover,.ui-mapa-div-marker:hover{transform:scale(1.15);filter:brightness(1.2)}";function d(){return y.obterLeafletSincrono()??null}async function E(){return await y.carregarLeaflet()??null}function L(r){return{osm:{nome:"OpenStreetMap",layer:()=>r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'})},satelite:{nome:"Satélite (Esri)",layer:()=>r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"})},topografia:{nome:"Topografia",layer:()=>r.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",{attribution:'Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'})},ruas:{nome:"Ruas (Esri)",layer:()=>r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}",{attribution:"Tiles &copy; Esri &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"})}}}const u={lat:-23.55052,lng:-46.633308,zoom:13},w="#00f5a0",O="#3388ff",k=3,c=r=>Number.isFinite(r);function v(r,e,t){const i=parseFloat(r??""),o=parseFloat(e??""),a=parseInt(t??"",10);return{lat:c(i)&&Math.abs(i)<=90?i:u.lat,lng:c(o)&&Math.abs(o)<=180?o:u.lng,zoom:c(a)&&a>=0&&a<=22?a:u.zoom}}function P(r,e){const t=parseInt(r??"",10);return c(t)&&t>0?t:e}const R=/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i,N=/^(?:rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/deg-]+\)$/i,U=/^[a-z]{3,30}$/i;function T(r,e){const t=(r??"").trim();return R.test(t)||N.test(t)||U.test(t)?t:e}function D(r,e){const t=(r??"").split(",").map(i=>i.trim().toLowerCase()).filter(i=>e.includes(i));return t.length>0?t:["osm"]}function A(r){if(!r)return[];let e;try{e=JSON.parse(r)}catch(i){return console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"',i),[]}if(!Array.isArray(e))return[];const t=[];for(const i of e){if(!Array.isArray(i)||i.length<2)continue;const[o,a]=i;typeof o=="number"&&typeof a=="number"&&c(o)&&c(a)&&Math.abs(o)<=90&&Math.abs(a)<=180&&t.push([o,a])}return t}const G="Mapa",H=`
2
+ <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 140px; padding: 16px; box-sizing: border-box; text-align: center; color: var(--ui-cor-texto-secundario, #888899); font-family: var(--ui-fonte-base, 'Inter', sans-serif); font-size: 12px; background: var(--ui-cor-superficie, #141417); border-radius: var(--ui-raio-borda, 6px); border: 1px dashed var(--ui-cor-borda, rgba(255,255,255,0.15));">
3
+ <span style="font-size: 20px; margin-bottom: 6px;" aria-hidden="true">🗺️</span>
4
+ <strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
5
+ <span style="max-width: 320px; line-height: 1.4;">Para utilizar o componente <code>&lt;ui-mapa&gt;</code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code>&lt;script src=".../leaflet.js"&gt;&lt;/script&gt;</code>.</span>
6
+ </div>
7
+ `;class M extends p.SafeHTMLElement{constructor(){super();s(this,"mapContainer");s(this,"mapInstance",null);s(this,"_initTimer",null);s(this,"_resizeObserver");s(this,"_resizeTimer");s(this,"_invalidarTimer");const t=this.attachShadow({mode:"open"});t.innerHTML=`
2
8
  <style>
3
- ${d.leafletCss}
4
- ${C}
9
+ ${m.leafletCss}
10
+ ${_}
5
11
  </style>
6
- <div class="ui-mapa-container" id="map-container"></div>
12
+ <div class="ui-mapa-container" id="map-container" role="region"></div>
7
13
  <div style="display: none;"><slot></slot></div>
8
- `,this.mapContainer=t.getElementById("map-container")}static get observedAttributes(){return["lat","lng","zoom"]}connectedCallback(){this._initTimer=window.setTimeout(()=>{this.initMap()},0)}disconnectedCallback(){this._initTimer&&(window.clearTimeout(this._initTimer),this._initTimer=null),this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=void 0),this._resizeTimer&&(window.clearTimeout(this._resizeTimer),this._resizeTimer=null),this.mapInstance&&(this.mapInstance.remove(),this.mapInstance=null)}attributeChangedCallback(t,e,r){if(e!==r&&this.mapInstance){const i=parseFloat(this.getAttribute("lat")||"-23.550520"),s=parseFloat(this.getAttribute("lng")||"-46.633308"),c=parseInt(this.getAttribute("zoom")||"13",10);!isNaN(i)&&!isNaN(s)&&this.mapInstance.setView([i,s],c)}}async initMap(){var g;if(this.mapInstance)return;const t=await h.carregarLeaflet();if(!t){this.mapContainer.innerHTML=`
9
- <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 140px; padding: 16px; box-sizing: border-box; text-align: center; color: var(--ui-cor-texto-secundario, #888899); font-family: var(--ui-fonte-base, 'Inter', sans-serif); font-size: 12px; background: var(--ui-cor-superficie, #141417); border-radius: var(--ui-raio-borda, 6px); border: 1px dashed var(--ui-cor-borda, rgba(255,255,255,0.15));">
10
- <span style="font-size: 20px; margin-bottom: 6px;">🗺️</span>
11
- <strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
12
- <span style="max-width: 320px; line-height: 1.4;">Para utilizar o componente <code>&lt;ui-mapa&gt;</code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code>&lt;script src=".../leaflet.js"&gt;&lt;/script&gt;</code>.</span>
13
- </div>
14
- `;return}const e=I(t),r=parseFloat(this.getAttribute("lat")||"-23.550520"),i=parseFloat(this.getAttribute("lng")||"-46.633308"),s=parseInt(this.getAttribute("zoom")||"13",10);this.mapInstance=t.map(this.mapContainer).setView([r,i],s);const c=this.getAttribute("camadas");let l=["osm"];c&&(l=c.split(",").map(p=>p.trim().toLowerCase()).filter(p=>e[p]),l.length===0&&(l=["osm"]));const f=e[l[0]].layer();if(f.addTo(this.mapInstance),l.length>1){const p={};p[e[l[0]].nome]=f;for(let u=1;u<l.length;u++){const b=l[u];p[e[b].nome]=e[b].layer()}t.control.layers(p,void 0,{position:"topright"}).addTo(this.mapInstance)}(g=t.Icon)!=null&&g.Default&&(t.Icon.Default.imagePath="https://unpkg.com/leaflet@1.9.4/dist/images/"),typeof ResizeObserver<"u"&&this.mapContainer&&(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>{this.mapInstance&&this.mapInstance.invalidateSize()},60)}),this._resizeObserver.observe(this.mapContainer)),setTimeout(()=>{this.mapInstance&&this.mapInstance.invalidateSize()},100),this.dispatchEvent(new CustomEvent("ui-mapa-pronto",{detail:{map:this.mapInstance},bubbles:!0,composed:!0}))}getMap(){return this.mapInstance}}m.definirCustomElement("ui-mapa",y);class v extends m.SafeHTMLElement{constructor(){super(...arguments);a(this,"marker",null);a(this,"_initTimer",null);a(this,"_retryCount",0);a(this,"_parentMap",null);a(this,"handleMapReady",()=>{this.marker&&(this.marker.remove(),this.marker=null),this.initMarker()})}static get observedAttributes(){return["lat","lng","titulo","cor","formato"]}connectedCallback(){this._parentMap=this.closest("ui-mapa"),this._parentMap&&this._parentMap.addEventListener("ui-mapa-pronto",this.handleMapReady),this._initTimer=setTimeout(()=>this.initMarker(),0)}disconnectedCallback(){this._initTimer&&(clearTimeout(this._initTimer),this._initTimer=null),this._parentMap&&(this._parentMap.removeEventListener("ui-mapa-pronto",this.handleMapReady),this._parentMap=null),this.marker&&(this.marker.remove(),this.marker=null)}attributeChangedCallback(t,e,r){if(e!==r&&this.marker){if(t==="lat"||t==="lng"){const i=d.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));i&&this.marker.setLatLng([i.lat,i.lon])}if(t==="titulo"&&(this.marker.unbindPopup(),r&&this.marker.bindPopup(this.createPopupContent(r))),t==="cor"||t==="formato"){const i=h.obterLeafletSincrono()||window.L;i&&this.marker.setIcon(this.createIcon(i))}}}createPopupContent(t){const e=document.createElement("div");return e.className="ui-mapa-popup",e.textContent=t,e}createIcon(t){const e=this.getAttribute("cor")||"#00f5a0";if((this.getAttribute("formato")||"pin")==="circle"){const s=`<div style="width:14px; height:14px; background-color:${e}; border-radius:50%; border:2px solid #ffffff; box-shadow:0 1px 4px rgba(0,0,0,0.6);"></div>`;return t.divIcon({className:"ui-mapa-div-marker",html:s,iconSize:[14,14],iconAnchor:[7,7]})}const i=`
15
- <svg width="24" height="32" viewBox="0 0 24 32" fill="none" xmlns="http://www.w3.org/2000/svg" style="filter: drop-shadow(0 2px 4px rgba(0,0,0,0.45));">
16
- <path d="M12 0C5.372 0 0 5.372 0 12C0 21 12 32 12 32C12 32 24 21 24 12C24 5.372 18.628 0 12 0Z" fill="${e}"/>
17
- <circle cx="12" cy="11" r="4.5" fill="#ffffff"/>
18
- </svg>
19
- `;return t.divIcon({className:"ui-mapa-svg-pin",html:i,iconSize:[24,32],iconAnchor:[12,32],popupAnchor:[0,-30]})}initMarker(){const t=this._parentMap||this.closest("ui-mapa");if(!t){console.warn("<ui-mapa-marcador> deve estar dentro de um elemento <ui-mapa>");return}const e=t.getMap();if(!e){if(this._retryCount>=30){console.warn("<ui-mapa-marcador> Tempo limite esgotado aguardando inicialização do mapa pai.");return}this._retryCount++,this._initTimer=setTimeout(()=>this.initMarker(),50);return}this._retryCount=0;const r=d.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));if(!r)return;const i=this.getAttribute("titulo"),s=h.obterLeafletSincrono()||window.L;s&&(this.marker=s.marker([r.lat,r.lon],{icon:this.createIcon(s)}),this.marker&&(i&&this.marker.bindPopup(this.createPopupContent(i)),this.marker.addTo(e)))}}m.definirCustomElement("ui-mapa-marcador",v);class T extends m.SafeHTMLElement{constructor(){super(...arguments);a(this,"polyline",null);a(this,"_initTimer",null);a(this,"_retryCount",0)}static get observedAttributes(){return["pontos","cor","espessura"]}connectedCallback(){this._initTimer=setTimeout(()=>this.initLinha(),0)}disconnectedCallback(){this._initTimer&&(clearTimeout(this._initTimer),this._initTimer=null),this.polyline&&(this.polyline.remove(),this.polyline=null)}attributeChangedCallback(t,e,r){e!==r&&this.polyline&&(t==="pontos"?this.polyline.setLatLngs(this.getPontos()):(t==="cor"||t==="espessura")&&this.polyline.setStyle({color:this.getAttribute("cor")||"#3388ff",weight:parseInt(this.getAttribute("espessura")||"3",10)}))}getPontos(){try{const t=this.getAttribute("pontos");if(t)return JSON.parse(t)}catch(t){console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"',t)}return[]}initLinha(){const t=this.closest("ui-mapa");if(!t){console.warn("<ui-mapa-linha> deve estar dentro de um elemento <ui-mapa>");return}const e=t.getMap();if(!e){if(this._retryCount>=30){console.warn("<ui-mapa-linha> Tempo limite esgotado aguardando inicialização do mapa pai.");return}this._retryCount++,this._initTimer=setTimeout(()=>this.initLinha(),50);return}this._retryCount=0;const r=this.getAttribute("cor")||"#3388ff",i=parseInt(this.getAttribute("espessura")||"3",10),s=h.obterLeafletSincrono()||window.L;s&&(this.polyline=s.polyline(this.getPontos(),{color:r,weight:i}),this.polyline&&this.polyline.addTo(e))}}m.definirCustomElement("ui-mapa-linha",T);exports.UIMapa=y;exports.UIMapaLinha=T;exports.UIMapaMarcador=v;
14
+ `,this.mapContainer=t.getElementById("map-container"),this.sincronizarRotulo()}static get observedAttributes(){return["lat","lng","zoom","aria-label"]}connectedCallback(){this.sincronizarRotulo(),this._initTimer=setTimeout(()=>{this._initTimer=null,this.initMap()},0)}disconnectedCallback(){var t;this._initTimer&&(clearTimeout(this._initTimer),this._initTimer=null),(t=this._resizeObserver)==null||t.disconnect(),this._resizeObserver=void 0,this._resizeTimer&&clearTimeout(this._resizeTimer),this._invalidarTimer&&clearTimeout(this._invalidarTimer),this._resizeTimer=void 0,this._invalidarTimer=void 0,this.mapInstance&&(this.mapInstance.remove(),this.mapInstance=null)}attributeChangedCallback(t,i,o){if(i!==o){if(t==="aria-label"){this.sincronizarRotulo();return}if(this.mapInstance){const a=v(this.getAttribute("lat"),this.getAttribute("lng"),this.getAttribute("zoom"));this.mapInstance.setView([a.lat,a.lng],a.zoom)}}}sincronizarRotulo(){var t;(t=this.mapContainer)==null||t.setAttribute("aria-label",this.getAttribute("aria-label")||G)}async initMap(){var b;if(this.mapInstance)return;const t=await E();if(!this.isConnected||this.mapInstance)return;if(!t){this.mapContainer.innerHTML=H;return}const i=L(t),o=v(this.getAttribute("lat"),this.getAttribute("lng"),this.getAttribute("zoom")),a=t.map(this.mapContainer).setView([o.lat,o.lng],o.zoom);this.mapInstance=a;const n=D(this.getAttribute("camadas"),Object.keys(i)),f=i[n[0]].layer();if(f.addTo(a),n.length>1){const l={[i[n[0]].nome]:f};for(const g of n.slice(1))l[i[g].nome]=i[g].layer();t.control.layers(l,void 0,{position:"topright"}).addTo(a)}(b=t.Icon)!=null&&b.Default&&(t.Icon.Default.imagePath="https://unpkg.com/leaflet@1.9.4/dist/images/"),typeof ResizeObserver<"u"&&(this._resizeObserver=new ResizeObserver(()=>{this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>{var l;return(l=this.mapInstance)==null?void 0:l.invalidateSize()},60)}),this._resizeObserver.observe(this.mapContainer)),this._invalidarTimer=setTimeout(()=>{var l;return(l=this.mapInstance)==null?void 0:l.invalidateSize()},100),this.dispatchEvent(new CustomEvent("ui-mapa-pronto",{detail:{map:a},bubbles:!0,composed:!0}))}getMap(){return this.mapInstance}}p.definirCustomElement("ui-mapa",M);const h="http://www.w3.org/2000/svg";function V(r){const e=document.createElement("div");return e.style.cssText="width:14px;height:14px;border-radius:50%;border:2px solid #ffffff;box-shadow:0 1px 4px rgba(0,0,0,0.6);",e.style.backgroundColor=r,e}function $(r){const e=document.createElementNS(h,"svg");e.setAttribute("width","24"),e.setAttribute("height","32"),e.setAttribute("viewBox","0 0 24 32"),e.setAttribute("fill","none"),e.setAttribute("aria-hidden","true"),e.style.filter="drop-shadow(0 2px 4px rgba(0,0,0,0.45))";const t=document.createElementNS(h,"path");t.setAttribute("d","M12 0C5.372 0 0 5.372 0 12C0 21 12 32 12 32C12 32 24 21 24 12C24 5.372 18.628 0 12 0Z"),t.setAttribute("fill",r);const i=document.createElementNS(h,"circle");return i.setAttribute("cx","12"),i.setAttribute("cy","11"),i.setAttribute("r","4.5"),i.setAttribute("fill","#ffffff"),e.append(t,i),e}function F(r,e,t){return t==="circle"?r.divIcon({className:"ui-mapa-div-marker",html:V(e),iconSize:[14,14],iconAnchor:[7,7]}):r.divIcon({className:"ui-mapa-svg-pin",html:$(e),iconSize:[24,32],iconAnchor:[12,32],popupAnchor:[0,-30]})}const j=30,q=50;class C{constructor(e,t){s(this,"pai",null);s(this,"timer",null);s(this,"tentativas",0);s(this,"aoPronto",()=>{this.opcoes.aoPerderMapa(),this.tentativas=0,this.tentar()});this.host=e,this.opcoes=t}conectar(){var e;this.desconectar(),this.pai=this.host.closest("ui-mapa"),(e=this.pai)==null||e.addEventListener("ui-mapa-pronto",this.aoPronto),this.agendar(0)}desconectar(){var e;this.timer&&clearTimeout(this.timer),this.timer=null,(e=this.pai)==null||e.removeEventListener("ui-mapa-pronto",this.aoPronto),this.pai=null,this.tentativas=0}agendar(e){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(()=>this.tentar(),e)}tentar(){this.timer=null;const e=this.pai??this.host.closest("ui-mapa");if(!e){console.warn(`<${this.opcoes.rotulo}> deve estar dentro de um elemento <ui-mapa>`);return}const t=e.getMap();if(!t){if(this.tentativas>=j){console.warn(`<${this.opcoes.rotulo}> Tempo limite esgotado aguardando inicialização do mapa pai.`);return}this.tentativas++,this.agendar(q);return}this.tentativas=0,this.opcoes.aoMapa(t)}}class S extends p.SafeHTMLElement{constructor(){super(...arguments);s(this,"marker",null);s(this,"vinculo",new C(this,{rotulo:"ui-mapa-marcador",aoMapa:t=>this.criarMarcador(t),aoPerderMapa:()=>this.removerMarcador()}))}static get observedAttributes(){return["lat","lng","titulo","cor","formato"]}connectedCallback(){this.vinculo.conectar()}disconnectedCallback(){this.vinculo.desconectar(),this.removerMarcador()}attributeChangedCallback(t,i,o){if(!(i===o||!this.marker)){if(t==="lat"||t==="lng"){const a=m.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));a&&this.marker.setLatLng([a.lat,a.lon])}else if(t==="titulo")this.marker.unbindPopup(),o&&this.marker.bindPopup(this.createPopupContent(o)),this.aplicarNomeAcessivel();else if(t==="cor"||t==="formato"){const a=d();a&&this.marker.setIcon(this.createIcon(a))}}}removerMarcador(){var t;(t=this.marker)==null||t.remove(),this.marker=null}createPopupContent(t){const i=document.createElement("div");return i.className="ui-mapa-popup",i.textContent=t,i}createIcon(t){const i=this.getAttribute("formato")==="circle"?"circle":"pin";return F(t,T(this.getAttribute("cor"),w),i)}aplicarNomeAcessivel(){var o;const t=(o=this.marker)==null?void 0:o.getElement();if(!t)return;const i=this.getAttribute("titulo");i?(t.setAttribute("aria-label",i),t.setAttribute("title",i)):(t.removeAttribute("aria-label"),t.removeAttribute("title"))}criarMarcador(t){this.removerMarcador();const i=m.parseCoordenada(this.getAttribute("lat"),this.getAttribute("lng"));if(!i)return;const o=d();if(!o)return;const a=this.getAttribute("titulo"),n=o.marker([i.lat,i.lon],{icon:this.createIcon(o),keyboard:!0,title:a||void 0});a&&n.bindPopup(this.createPopupContent(a)),n.addTo(t),this.marker=n,this.aplicarNomeAcessivel()}}p.definirCustomElement("ui-mapa-marcador",S);class x extends p.SafeHTMLElement{constructor(){super(...arguments);s(this,"polyline",null);s(this,"vinculo",new C(this,{rotulo:"ui-mapa-linha",aoMapa:t=>this.criarLinha(t),aoPerderMapa:()=>this.removerLinha()}))}static get observedAttributes(){return["pontos","cor","espessura"]}connectedCallback(){this.vinculo.conectar()}disconnectedCallback(){this.vinculo.desconectar(),this.removerLinha()}attributeChangedCallback(t,i,o){i===o||!this.polyline||(t==="pontos"?this.polyline.setLatLngs(A(this.getAttribute("pontos"))):this.polyline.setStyle(this.estilo()))}estilo(){return{color:T(this.getAttribute("cor"),O),weight:P(this.getAttribute("espessura"),k)}}removerLinha(){var t;(t=this.polyline)==null||t.remove(),this.polyline=null}criarLinha(t){this.removerLinha();const i=d();i&&(this.polyline=i.polyline(A(this.getAttribute("pontos")),this.estilo()).addTo(t))}}p.definirCustomElement("ui-mapa-linha",x);exports.UIMapa=M;exports.UIMapaLinha=x;exports.UIMapaMarcador=S;
package/dist/mapa.js CHANGED
@@ -1,111 +1,166 @@
1
- var v = Object.defineProperty;
2
- var T = (s, n, t) => n in s ? v(s, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[n] = t;
3
- var a = (s, n, t) => T(s, typeof n != "symbol" ? n + "" : n, t);
1
+ var C = Object.defineProperty;
2
+ var x = (r, e, t) => e in r ? C(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var s = (r, e, t) => x(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  /* empty css */
5
- import { c as _, o as h } from "./leaflet-loader-Cjcdgj5R.js";
6
- import { l as x, p as y } from "./leaflet-PPDKB6Dd.js";
7
- import { d as u, S as d } from "./ssr-safe-5cWfJP-s.js";
8
- const M = ":host{display:block;width:100%;height:400px;position:relative;border-radius:var(--ui-raio-lg, 10px);overflow:hidden;box-shadow:var(--shadow-sm, 0 1px 3px rgba(0,0,0,.1))}.ui-mapa-container{width:100%;height:100%;z-index:1}.leaflet-top,.leaflet-bottom{z-index:1000}.ui-mapa-popup{font-family:inherit;font-size:13px;font-weight:500;color:#111827;padding:2px 4px}.ui-mapa-svg-pin,.ui-mapa-div-marker{background:transparent!important;border:none!important;cursor:pointer;transition:transform .15s ease,filter .15s ease}.ui-mapa-svg-pin:hover,.ui-mapa-div-marker:hover{transform:scale(1.15);filter:brightness(1.2)}";
9
- function w(s) {
5
+ import { l as z, p as v } from "./leaflet-PPDKB6Dd.js";
6
+ import { d as m, S as d } from "./ssr-safe-5cWfJP-s.js";
7
+ import { c as S, o as I } from "./leaflet-loader-Cjcdgj5R.js";
8
+ const _ = ":host{display:block;width:100%;height:400px;position:relative;border-radius:var(--ui-raio-lg, 10px);overflow:hidden;box-shadow:var(--shadow-sm, 0 1px 3px rgba(0,0,0,.1))}.ui-mapa-container{width:100%;height:100%;z-index:1}.leaflet-top,.leaflet-bottom{z-index:1000}.ui-mapa-popup{font-family:inherit;font-size:13px;font-weight:500;color:#111827;padding:2px 4px}.ui-mapa-svg-pin,.ui-mapa-div-marker{background:transparent!important;border:none!important;cursor:pointer;transition:transform .15s ease,filter .15s ease}.ui-mapa-svg-pin:hover,.ui-mapa-div-marker:hover{transform:scale(1.15);filter:brightness(1.2)}";
9
+ function h() {
10
+ return I() ?? null;
11
+ }
12
+ async function E() {
13
+ return await S() ?? null;
14
+ }
15
+ function w(r) {
10
16
  return {
11
17
  osm: {
12
18
  nome: "OpenStreetMap",
13
- layer: () => s.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
19
+ layer: () => r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
14
20
  attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
15
21
  })
16
22
  },
17
23
  satelite: {
18
24
  nome: "Satélite (Esri)",
19
- layer: () => s.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {
25
+ layer: () => r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}", {
20
26
  attribution: "Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community"
21
27
  })
22
28
  },
23
29
  topografia: {
24
30
  nome: "Topografia",
25
- layer: () => s.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
31
+ layer: () => r.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
26
32
  attribution: 'Map data: &copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors, <a href="http://viewfinderpanoramas.org">SRTM</a> | Map style: &copy; <a href="https://opentopomap.org">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/">CC-BY-SA</a>)'
27
33
  })
28
34
  },
29
35
  ruas: {
30
36
  nome: "Ruas (Esri)",
31
- layer: () => s.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}", {
37
+ layer: () => r.tileLayer("https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}", {
32
38
  attribution: "Tiles &copy; Esri &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"
33
39
  })
34
40
  }
35
41
  };
36
42
  }
37
- class C extends d {
43
+ const p = { lat: -23.55052, lng: -46.633308, zoom: 13 }, L = "#00f5a0", O = "#3388ff", k = 3, l = (r) => Number.isFinite(r);
44
+ function A(r, e, t) {
45
+ const i = parseFloat(r ?? ""), o = parseFloat(e ?? ""), a = parseInt(t ?? "", 10);
46
+ return {
47
+ lat: l(i) && Math.abs(i) <= 90 ? i : p.lat,
48
+ lng: l(o) && Math.abs(o) <= 180 ? o : p.lng,
49
+ zoom: l(a) && a >= 0 && a <= 22 ? a : p.zoom
50
+ };
51
+ }
52
+ function P(r, e) {
53
+ const t = parseInt(r ?? "", 10);
54
+ return l(t) && t > 0 ? t : e;
55
+ }
56
+ const R = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, N = /^(?:rgb|rgba|hsl|hsla)\(\s*[\d.,%\s/deg-]+\)$/i, D = /^[a-z]{3,30}$/i;
57
+ function T(r, e) {
58
+ const t = (r ?? "").trim();
59
+ return R.test(t) || N.test(t) || D.test(t) ? t : e;
60
+ }
61
+ function G(r, e) {
62
+ const t = (r ?? "").split(",").map((i) => i.trim().toLowerCase()).filter((i) => e.includes(i));
63
+ return t.length > 0 ? t : ["osm"];
64
+ }
65
+ function y(r) {
66
+ if (!r) return [];
67
+ let e;
68
+ try {
69
+ e = JSON.parse(r);
70
+ } catch (i) {
71
+ return console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"', i), [];
72
+ }
73
+ if (!Array.isArray(e)) return [];
74
+ const t = [];
75
+ for (const i of e) {
76
+ if (!Array.isArray(i) || i.length < 2) continue;
77
+ const [o, a] = i;
78
+ typeof o == "number" && typeof a == "number" && l(o) && l(a) && Math.abs(o) <= 90 && Math.abs(a) <= 180 && t.push([o, a]);
79
+ }
80
+ return t;
81
+ }
82
+ const U = "Mapa", V = `
83
+ <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 140px; padding: 16px; box-sizing: border-box; text-align: center; color: var(--ui-cor-texto-secundario, #888899); font-family: var(--ui-fonte-base, 'Inter', sans-serif); font-size: 12px; background: var(--ui-cor-superficie, #141417); border-radius: var(--ui-raio-borda, 6px); border: 1px dashed var(--ui-cor-borda, rgba(255,255,255,0.15));">
84
+ <span style="font-size: 20px; margin-bottom: 6px;" aria-hidden="true">🗺️</span>
85
+ <strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
86
+ <span style="max-width: 320px; line-height: 1.4;">Para utilizar o componente <code>&lt;ui-mapa&gt;</code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code>&lt;script src=".../leaflet.js"&gt;&lt;/script&gt;</code>.</span>
87
+ </div>
88
+ `;
89
+ class H extends d {
38
90
  constructor() {
39
91
  super();
40
- a(this, "mapContainer");
41
- a(this, "mapInstance", null);
42
- a(this, "_initTimer", null);
43
- a(this, "_resizeObserver");
44
- a(this, "_resizeTimer");
92
+ s(this, "mapContainer");
93
+ s(this, "mapInstance", null);
94
+ s(this, "_initTimer", null);
95
+ s(this, "_resizeObserver");
96
+ s(this, "_resizeTimer");
97
+ s(this, "_invalidarTimer");
45
98
  const t = this.attachShadow({ mode: "open" });
46
99
  t.innerHTML = `
47
100
  <style>
48
- ${x}
49
- ${M}
101
+ ${z}
102
+ ${_}
50
103
  </style>
51
- <div class="ui-mapa-container" id="map-container"></div>
104
+ <div class="ui-mapa-container" id="map-container" role="region"></div>
52
105
  <div style="display: none;"><slot></slot></div>
53
- `, this.mapContainer = t.getElementById("map-container");
106
+ `, this.mapContainer = t.getElementById("map-container"), this.sincronizarRotulo();
54
107
  }
55
108
  static get observedAttributes() {
56
- return ["lat", "lng", "zoom"];
109
+ return ["lat", "lng", "zoom", "aria-label"];
57
110
  }
58
111
  connectedCallback() {
59
- this._initTimer = window.setTimeout(() => {
60
- this.initMap();
112
+ this.sincronizarRotulo(), this._initTimer = setTimeout(() => {
113
+ this._initTimer = null, this.initMap();
61
114
  }, 0);
62
115
  }
63
116
  disconnectedCallback() {
64
- this._initTimer && (window.clearTimeout(this._initTimer), this._initTimer = null), this._resizeObserver && (this._resizeObserver.disconnect(), this._resizeObserver = void 0), this._resizeTimer && (window.clearTimeout(this._resizeTimer), this._resizeTimer = null), this.mapInstance && (this.mapInstance.remove(), this.mapInstance = null);
117
+ var t;
118
+ this._initTimer && (clearTimeout(this._initTimer), this._initTimer = null), (t = this._resizeObserver) == null || t.disconnect(), this._resizeObserver = void 0, this._resizeTimer && clearTimeout(this._resizeTimer), this._invalidarTimer && clearTimeout(this._invalidarTimer), this._resizeTimer = void 0, this._invalidarTimer = void 0, this.mapInstance && (this.mapInstance.remove(), this.mapInstance = null);
65
119
  }
66
- attributeChangedCallback(t, e, r) {
67
- if (e !== r && this.mapInstance) {
68
- const i = parseFloat(this.getAttribute("lat") || "-23.550520"), o = parseFloat(this.getAttribute("lng") || "-46.633308"), c = parseInt(this.getAttribute("zoom") || "13", 10);
69
- !isNaN(i) && !isNaN(o) && this.mapInstance.setView([i, o], c);
120
+ attributeChangedCallback(t, i, o) {
121
+ if (i !== o) {
122
+ if (t === "aria-label") {
123
+ this.sincronizarRotulo();
124
+ return;
125
+ }
126
+ if (this.mapInstance) {
127
+ const a = A(this.getAttribute("lat"), this.getAttribute("lng"), this.getAttribute("zoom"));
128
+ this.mapInstance.setView([a.lat, a.lng], a.zoom);
129
+ }
70
130
  }
71
131
  }
132
+ /** Nome acessível da região: o `aria-label` do host ou "Mapa". */
133
+ sincronizarRotulo() {
134
+ var t;
135
+ (t = this.mapContainer) == null || t.setAttribute("aria-label", this.getAttribute("aria-label") || U);
136
+ }
72
137
  async initMap() {
73
- var g;
138
+ var b;
74
139
  if (this.mapInstance) return;
75
- const t = await _();
140
+ const t = await E();
141
+ if (!this.isConnected || this.mapInstance) return;
76
142
  if (!t) {
77
- this.mapContainer.innerHTML = `
78
- <div style="display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; min-height: 140px; padding: 16px; box-sizing: border-box; text-align: center; color: var(--ui-cor-texto-secundario, #888899); font-family: var(--ui-fonte-base, 'Inter', sans-serif); font-size: 12px; background: var(--ui-cor-superficie, #141417); border-radius: var(--ui-raio-borda, 6px); border: 1px dashed var(--ui-cor-borda, rgba(255,255,255,0.15));">
79
- <span style="font-size: 20px; margin-bottom: 6px;">🗺️</span>
80
- <strong style="color: var(--ui-cor-texto, #e1e1e6); margin-bottom: 4px;">Leaflet não encontrado</strong>
81
- <span style="max-width: 320px; line-height: 1.4;">Para utilizar o componente <code>&lt;ui-mapa&gt;</code>, instale a biblioteca <code>leaflet</code> ou inclua seu script no HTML: <code>&lt;script src=".../leaflet.js"&gt;&lt;/script&gt;</code>.</span>
82
- </div>
83
- `;
143
+ this.mapContainer.innerHTML = V;
84
144
  return;
85
145
  }
86
- const e = w(t), r = parseFloat(this.getAttribute("lat") || "-23.550520"), i = parseFloat(this.getAttribute("lng") || "-46.633308"), o = parseInt(this.getAttribute("zoom") || "13", 10);
87
- this.mapInstance = t.map(this.mapContainer).setView([r, i], o);
88
- const c = this.getAttribute("camadas");
89
- let p = ["osm"];
90
- c && (p = c.split(",").map((l) => l.trim().toLowerCase()).filter((l) => e[l]), p.length === 0 && (p = ["osm"]));
91
- const f = e[p[0]].layer();
92
- if (f.addTo(this.mapInstance), p.length > 1) {
93
- const l = {};
94
- l[e[p[0]].nome] = f;
95
- for (let m = 1; m < p.length; m++) {
96
- const b = p[m];
97
- l[e[b].nome] = e[b].layer();
98
- }
99
- t.control.layers(l, void 0, { position: "topright" }).addTo(this.mapInstance);
146
+ const i = w(t), o = A(this.getAttribute("lat"), this.getAttribute("lng"), this.getAttribute("zoom")), a = t.map(this.mapContainer).setView([o.lat, o.lng], o.zoom);
147
+ this.mapInstance = a;
148
+ const n = G(this.getAttribute("camadas"), Object.keys(i)), f = i[n[0]].layer();
149
+ if (f.addTo(a), n.length > 1) {
150
+ const c = { [i[n[0]].nome]: f };
151
+ for (const g of n.slice(1)) c[i[g].nome] = i[g].layer();
152
+ t.control.layers(c, void 0, { position: "topright" }).addTo(a);
100
153
  }
101
- (g = t.Icon) != null && g.Default && (t.Icon.Default.imagePath = "https://unpkg.com/leaflet@1.9.4/dist/images/"), typeof ResizeObserver < "u" && this.mapContainer && (this._resizeObserver = new ResizeObserver(() => {
154
+ (b = t.Icon) != null && b.Default && (t.Icon.Default.imagePath = "https://unpkg.com/leaflet@1.9.4/dist/images/"), typeof ResizeObserver < "u" && (this._resizeObserver = new ResizeObserver(() => {
102
155
  this._resizeTimer && clearTimeout(this._resizeTimer), this._resizeTimer = setTimeout(() => {
103
- this.mapInstance && this.mapInstance.invalidateSize();
156
+ var c;
157
+ return (c = this.mapInstance) == null ? void 0 : c.invalidateSize();
104
158
  }, 60);
105
- }), this._resizeObserver.observe(this.mapContainer)), setTimeout(() => {
106
- this.mapInstance && this.mapInstance.invalidateSize();
159
+ }), this._resizeObserver.observe(this.mapContainer)), this._invalidarTimer = setTimeout(() => {
160
+ var c;
161
+ return (c = this.mapInstance) == null ? void 0 : c.invalidateSize();
107
162
  }, 100), this.dispatchEvent(new CustomEvent("ui-mapa-pronto", {
108
- detail: { map: this.mapInstance },
163
+ detail: { map: a },
109
164
  bubbles: !0,
110
165
  composed: !0
111
166
  }));
@@ -114,151 +169,168 @@ class C extends d {
114
169
  return this.mapInstance;
115
170
  }
116
171
  }
117
- u("ui-mapa", C);
118
- class I extends d {
172
+ m("ui-mapa", H);
173
+ const u = "http://www.w3.org/2000/svg";
174
+ function $(r) {
175
+ const e = document.createElement("div");
176
+ return e.style.cssText = "width:14px;height:14px;border-radius:50%;border:2px solid #ffffff;box-shadow:0 1px 4px rgba(0,0,0,0.6);", e.style.backgroundColor = r, e;
177
+ }
178
+ function F(r) {
179
+ const e = document.createElementNS(u, "svg");
180
+ e.setAttribute("width", "24"), e.setAttribute("height", "32"), e.setAttribute("viewBox", "0 0 24 32"), e.setAttribute("fill", "none"), e.setAttribute("aria-hidden", "true"), e.style.filter = "drop-shadow(0 2px 4px rgba(0,0,0,0.45))";
181
+ const t = document.createElementNS(u, "path");
182
+ t.setAttribute("d", "M12 0C5.372 0 0 5.372 0 12C0 21 12 32 12 32C12 32 24 21 24 12C24 5.372 18.628 0 12 0Z"), t.setAttribute("fill", r);
183
+ const i = document.createElementNS(u, "circle");
184
+ return i.setAttribute("cx", "12"), i.setAttribute("cy", "11"), i.setAttribute("r", "4.5"), i.setAttribute("fill", "#ffffff"), e.append(t, i), e;
185
+ }
186
+ function B(r, e, t) {
187
+ return t === "circle" ? r.divIcon({ className: "ui-mapa-div-marker", html: $(e), iconSize: [14, 14], iconAnchor: [7, 7] }) : r.divIcon({ className: "ui-mapa-svg-pin", html: F(e), iconSize: [24, 32], iconAnchor: [12, 32], popupAnchor: [0, -30] });
188
+ }
189
+ const j = 30, J = 50;
190
+ class M {
191
+ constructor(e, t) {
192
+ s(this, "pai", null);
193
+ s(this, "timer", null);
194
+ s(this, "tentativas", 0);
195
+ s(this, "aoPronto", () => {
196
+ this.opcoes.aoPerderMapa(), this.tentativas = 0, this.tentar();
197
+ });
198
+ this.host = e, this.opcoes = t;
199
+ }
200
+ conectar() {
201
+ var e;
202
+ this.desconectar(), this.pai = this.host.closest("ui-mapa"), (e = this.pai) == null || e.addEventListener("ui-mapa-pronto", this.aoPronto), this.agendar(0);
203
+ }
204
+ desconectar() {
205
+ var e;
206
+ this.timer && clearTimeout(this.timer), this.timer = null, (e = this.pai) == null || e.removeEventListener("ui-mapa-pronto", this.aoPronto), this.pai = null, this.tentativas = 0;
207
+ }
208
+ agendar(e) {
209
+ this.timer && clearTimeout(this.timer), this.timer = setTimeout(() => this.tentar(), e);
210
+ }
211
+ tentar() {
212
+ this.timer = null;
213
+ const e = this.pai ?? this.host.closest("ui-mapa");
214
+ if (!e) {
215
+ console.warn(`<${this.opcoes.rotulo}> deve estar dentro de um elemento <ui-mapa>`);
216
+ return;
217
+ }
218
+ const t = e.getMap();
219
+ if (!t) {
220
+ if (this.tentativas >= j) {
221
+ console.warn(`<${this.opcoes.rotulo}> Tempo limite esgotado aguardando inicialização do mapa pai.`);
222
+ return;
223
+ }
224
+ this.tentativas++, this.agendar(J);
225
+ return;
226
+ }
227
+ this.tentativas = 0, this.opcoes.aoMapa(t);
228
+ }
229
+ }
230
+ class X extends d {
119
231
  constructor() {
120
232
  super(...arguments);
121
- a(this, "marker", null);
122
- a(this, "_initTimer", null);
123
- a(this, "_retryCount", 0);
124
- a(this, "_parentMap", null);
125
- a(this, "handleMapReady", () => {
126
- this.marker && (this.marker.remove(), this.marker = null), this.initMarker();
127
- });
233
+ s(this, "marker", null);
234
+ s(this, "vinculo", new M(this, {
235
+ rotulo: "ui-mapa-marcador",
236
+ aoMapa: (t) => this.criarMarcador(t),
237
+ aoPerderMapa: () => this.removerMarcador()
238
+ }));
128
239
  }
129
240
  static get observedAttributes() {
130
241
  return ["lat", "lng", "titulo", "cor", "formato"];
131
242
  }
132
243
  connectedCallback() {
133
- this._parentMap = this.closest("ui-mapa"), this._parentMap && this._parentMap.addEventListener("ui-mapa-pronto", this.handleMapReady), this._initTimer = setTimeout(() => this.initMarker(), 0);
244
+ this.vinculo.conectar();
134
245
  }
135
246
  disconnectedCallback() {
136
- this._initTimer && (clearTimeout(this._initTimer), this._initTimer = null), this._parentMap && (this._parentMap.removeEventListener("ui-mapa-pronto", this.handleMapReady), this._parentMap = null), this.marker && (this.marker.remove(), this.marker = null);
247
+ this.vinculo.desconectar(), this.removerMarcador();
137
248
  }
138
- attributeChangedCallback(t, e, r) {
139
- if (e !== r && this.marker) {
249
+ attributeChangedCallback(t, i, o) {
250
+ if (!(i === o || !this.marker)) {
140
251
  if (t === "lat" || t === "lng") {
141
- const i = y(this.getAttribute("lat"), this.getAttribute("lng"));
142
- i && this.marker.setLatLng([i.lat, i.lon]);
143
- }
144
- if (t === "titulo" && (this.marker.unbindPopup(), r && this.marker.bindPopup(this.createPopupContent(r))), t === "cor" || t === "formato") {
145
- const i = h() || window.L;
146
- i && this.marker.setIcon(this.createIcon(i));
252
+ const a = v(this.getAttribute("lat"), this.getAttribute("lng"));
253
+ a && this.marker.setLatLng([a.lat, a.lon]);
254
+ } else if (t === "titulo")
255
+ this.marker.unbindPopup(), o && this.marker.bindPopup(this.createPopupContent(o)), this.aplicarNomeAcessivel();
256
+ else if (t === "cor" || t === "formato") {
257
+ const a = h();
258
+ a && this.marker.setIcon(this.createIcon(a));
147
259
  }
148
260
  }
149
261
  }
262
+ removerMarcador() {
263
+ var t;
264
+ (t = this.marker) == null || t.remove(), this.marker = null;
265
+ }
150
266
  createPopupContent(t) {
151
- const e = document.createElement("div");
152
- return e.className = "ui-mapa-popup", e.textContent = t, e;
267
+ const i = document.createElement("div");
268
+ return i.className = "ui-mapa-popup", i.textContent = t, i;
153
269
  }
154
270
  createIcon(t) {
155
- const e = this.getAttribute("cor") || "#00f5a0";
156
- if ((this.getAttribute("formato") || "pin") === "circle") {
157
- const o = `<div style="width:14px; height:14px; background-color:${e}; border-radius:50%; border:2px solid #ffffff; box-shadow:0 1px 4px rgba(0,0,0,0.6);"></div>`;
158
- return t.divIcon({
159
- className: "ui-mapa-div-marker",
160
- html: o,
161
- iconSize: [14, 14],
162
- iconAnchor: [7, 7]
163
- });
164
- }
165
- const i = `
166
- <svg width="24" height="32" viewBox="0 0 24 32" fill="none" xmlns="http://www.w3.org/2000/svg" style="filter: drop-shadow(0 2px 4px rgba(0,0,0,0.45));">
167
- <path d="M12 0C5.372 0 0 5.372 0 12C0 21 12 32 12 32C12 32 24 21 24 12C24 5.372 18.628 0 12 0Z" fill="${e}"/>
168
- <circle cx="12" cy="11" r="4.5" fill="#ffffff"/>
169
- </svg>
170
- `;
171
- return t.divIcon({
172
- className: "ui-mapa-svg-pin",
173
- html: i,
174
- iconSize: [24, 32],
175
- iconAnchor: [12, 32],
176
- popupAnchor: [0, -30]
177
- });
271
+ const i = this.getAttribute("formato") === "circle" ? "circle" : "pin";
272
+ return B(t, T(this.getAttribute("cor"), L), i);
178
273
  }
179
- initMarker() {
180
- const t = this._parentMap || this.closest("ui-mapa");
181
- if (!t) {
182
- console.warn("<ui-mapa-marcador> deve estar dentro de um elemento <ui-mapa>");
183
- return;
184
- }
185
- const e = t.getMap();
186
- if (!e) {
187
- if (this._retryCount >= 30) {
188
- console.warn("<ui-mapa-marcador> Tempo limite esgotado aguardando inicialização do mapa pai.");
189
- return;
190
- }
191
- this._retryCount++, this._initTimer = setTimeout(() => this.initMarker(), 50);
192
- return;
193
- }
194
- this._retryCount = 0;
195
- const r = y(this.getAttribute("lat"), this.getAttribute("lng"));
196
- if (!r) return;
197
- const i = this.getAttribute("titulo"), o = h() || window.L;
198
- o && (this.marker = o.marker([r.lat, r.lon], {
199
- icon: this.createIcon(o)
200
- }), this.marker && (i && this.marker.bindPopup(this.createPopupContent(i)), this.marker.addTo(e)));
274
+ /** O ícone é um `div`: o nome acessível vai em `aria-label` (o Leaflet já põe `role=button` e `tabindex=0`). */
275
+ aplicarNomeAcessivel() {
276
+ var o;
277
+ const t = (o = this.marker) == null ? void 0 : o.getElement();
278
+ if (!t) return;
279
+ const i = this.getAttribute("titulo");
280
+ i ? (t.setAttribute("aria-label", i), t.setAttribute("title", i)) : (t.removeAttribute("aria-label"), t.removeAttribute("title"));
281
+ }
282
+ criarMarcador(t) {
283
+ this.removerMarcador();
284
+ const i = v(this.getAttribute("lat"), this.getAttribute("lng"));
285
+ if (!i) return;
286
+ const o = h();
287
+ if (!o) return;
288
+ const a = this.getAttribute("titulo"), n = o.marker([i.lat, i.lon], { icon: this.createIcon(o), keyboard: !0, title: a || void 0 });
289
+ a && n.bindPopup(this.createPopupContent(a)), n.addTo(t), this.marker = n, this.aplicarNomeAcessivel();
201
290
  }
202
291
  }
203
- u("ui-mapa-marcador", I);
204
- class A extends d {
292
+ m("ui-mapa-marcador", X);
293
+ class W extends d {
205
294
  constructor() {
206
295
  super(...arguments);
207
- a(this, "polyline", null);
208
- a(this, "_initTimer", null);
209
- a(this, "_retryCount", 0);
296
+ s(this, "polyline", null);
297
+ s(this, "vinculo", new M(this, {
298
+ rotulo: "ui-mapa-linha",
299
+ aoMapa: (t) => this.criarLinha(t),
300
+ aoPerderMapa: () => this.removerLinha()
301
+ }));
210
302
  }
211
303
  static get observedAttributes() {
212
304
  return ["pontos", "cor", "espessura"];
213
305
  }
214
306
  connectedCallback() {
215
- this._initTimer = setTimeout(() => this.initLinha(), 0);
307
+ this.vinculo.conectar();
216
308
  }
217
309
  disconnectedCallback() {
218
- this._initTimer && (clearTimeout(this._initTimer), this._initTimer = null), this.polyline && (this.polyline.remove(), this.polyline = null);
310
+ this.vinculo.desconectar(), this.removerLinha();
219
311
  }
220
- attributeChangedCallback(t, e, r) {
221
- e !== r && this.polyline && (t === "pontos" ? this.polyline.setLatLngs(this.getPontos()) : (t === "cor" || t === "espessura") && this.polyline.setStyle({
222
- color: this.getAttribute("cor") || "#3388ff",
223
- weight: parseInt(this.getAttribute("espessura") || "3", 10)
224
- }));
312
+ attributeChangedCallback(t, i, o) {
313
+ i === o || !this.polyline || (t === "pontos" ? this.polyline.setLatLngs(y(this.getAttribute("pontos"))) : this.polyline.setStyle(this.estilo()));
225
314
  }
226
- getPontos() {
227
- try {
228
- const t = this.getAttribute("pontos");
229
- if (t)
230
- return JSON.parse(t);
231
- } catch (t) {
232
- console.error('Formato inválido para atributo pontos no <ui-mapa-linha>. Deve ser um JSON array, ex: "[[lat, lng], ...]"', t);
233
- }
234
- return [];
315
+ estilo() {
316
+ return {
317
+ color: T(this.getAttribute("cor"), O),
318
+ weight: P(this.getAttribute("espessura"), k)
319
+ };
235
320
  }
236
- initLinha() {
237
- const t = this.closest("ui-mapa");
238
- if (!t) {
239
- console.warn("<ui-mapa-linha> deve estar dentro de um elemento <ui-mapa>");
240
- return;
241
- }
242
- const e = t.getMap();
243
- if (!e) {
244
- if (this._retryCount >= 30) {
245
- console.warn("<ui-mapa-linha> Tempo limite esgotado aguardando inicialização do mapa pai.");
246
- return;
247
- }
248
- this._retryCount++, this._initTimer = setTimeout(() => this.initLinha(), 50);
249
- return;
250
- }
251
- this._retryCount = 0;
252
- const r = this.getAttribute("cor") || "#3388ff", i = parseInt(this.getAttribute("espessura") || "3", 10), o = h() || window.L;
253
- o && (this.polyline = o.polyline(this.getPontos(), {
254
- color: r,
255
- weight: i
256
- }), this.polyline && this.polyline.addTo(e));
321
+ removerLinha() {
322
+ var t;
323
+ (t = this.polyline) == null || t.remove(), this.polyline = null;
324
+ }
325
+ criarLinha(t) {
326
+ this.removerLinha();
327
+ const i = h();
328
+ i && (this.polyline = i.polyline(y(this.getAttribute("pontos")), this.estilo()).addTo(t));
257
329
  }
258
330
  }
259
- u("ui-mapa-linha", A);
331
+ m("ui-mapa-linha", W);
260
332
  export {
261
- C as UIMapa,
262
- A as UIMapaLinha,
263
- I as UIMapaMarcador
333
+ H as UIMapa,
334
+ W as UIMapaLinha,
335
+ X as UIMapaMarcador
264
336
  };
package/dist/modal.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const o=require("./ui-modal-CvGFGh1h.cjs");exports.UIDialog=o.UIDialog;exports.UIModal=o.UIModal;exports.aplicarInertForaDoModal=o.aplicarInertForaDoModal;exports.removerInertForaDoModal=o.removerInertForaDoModal;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});;/* empty css */const o=require("./ui-modal-CUNbpbZ1.cjs");exports.UIDialog=o.UIDialog;exports.UIModal=o.UIModal;exports.aplicarInertForaDoModal=o.aplicarInertForaDoModal;exports.removerInertForaDoModal=o.removerInertForaDoModal;
package/dist/modal.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* empty css */
2
- import { U as e, a as l, b as s, r as t } from "./ui-modal-DBOtSTbR.js";
2
+ import { U as e, a as l, b as s, r as t } from "./ui-modal-BkYvNP0G.js";
3
3
  export {
4
4
  e as UIDialog,
5
5
  l as UIModal,