@opengis/gis 0.1.55 → 0.1.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/import-file.cjs
CHANGED
|
@@ -798,7 +798,7 @@ uniform ${D} ${N} u_${O};
|
|
|
798
798
|
`),xe=fe.concat(fi.prelude.vertexSource,w.vertexSource,r.vertexSource).join(`
|
|
799
799
|
`);ci(D)||(ge=function(Le){return Le.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")}(ge),xe=function(Le){return Le.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(xe));const ye=D.createShader(D.FRAGMENT_SHADER);if(D.isContextLost())return void(this.failedToCreate=!0);if(D.shaderSource(ye,ge),D.compileShader(ye),!D.getShaderParameter(ye,D.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${D.getShaderInfoLog(ye)}`);D.attachShader(this.program,ye);const Te=D.createShader(D.VERTEX_SHADER);if(D.isContextLost())return void(this.failedToCreate=!0);if(D.shaderSource(Te,xe),D.compileShader(Te),!D.getShaderParameter(Te,D.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${D.getShaderInfoLog(Te)}`);D.attachShader(this.program,Te),this.attributes={};const Fe={};this.numAttributes=Z.length;for(let Le=0;Le<this.numAttributes;Le++)Z[Le]&&(D.bindAttribLocation(this.program,Le,Z[Le]),this.attributes[Z[Le]]=Le);if(D.linkProgram(this.program),!D.getProgramParameter(this.program,D.LINK_STATUS))throw new Error(`Program failed to link: ${D.getProgramInfoLog(this.program)}`);D.deleteShader(Te),D.deleteShader(ye);for(let Le=0;Le<me.length;Le++){const Be=me[Le];if(Be&&!Fe[Be]){const De=D.getUniformLocation(this.program,Be);De&&(Fe[Be]=De)}}this.fixedUniforms=l(e,Fe),this.terrainUniforms=((Le,Be)=>({u_depth:new s.bH(Le,Be.u_depth),u_terrain:new s.bH(Le,Be.u_terrain),u_terrain_dim:new s.b8(Le,Be.u_terrain_dim),u_terrain_matrix:new s.bJ(Le,Be.u_terrain_matrix),u_terrain_unpack:new s.bK(Le,Be.u_terrain_unpack),u_terrain_exaggeration:new s.b8(Le,Be.u_terrain_exaggeration)}))(e,Fe),this.projectionUniforms=((Le,Be)=>({u_projection_matrix:new s.bJ(Le,Be.u_projection_matrix),u_projection_tile_mercator_coords:new s.bK(Le,Be.u_projection_tile_mercator_coords),u_projection_clipping_plane:new s.bK(Le,Be.u_projection_clipping_plane),u_projection_transition:new s.b8(Le,Be.u_projection_transition),u_projection_fallback_matrix:new s.bJ(Le,Be.u_projection_fallback_matrix)}))(e,Fe),this.binderUniforms=a?a.getUniforms(e,Fe):[]}draw(e,r,a,l,p,y,w,A,R,D,N,O,Z,K,ne,ie,ae,ue,me){const fe=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(a),e.setStencilMode(l),e.setColorMode(p),e.setCullFace(y),A){e.activeTexture.set(fe.TEXTURE2),fe.bindTexture(fe.TEXTURE_2D,A.depthTexture),e.activeTexture.set(fe.TEXTURE3),fe.bindTexture(fe.TEXTURE_2D,A.texture);for(const xe in this.terrainUniforms)this.terrainUniforms[xe].set(A[xe])}if(R)for(const xe in R)this.projectionUniforms[Fo[xe]].set(R[xe]);if(w)for(const xe in this.fixedUniforms)this.fixedUniforms[xe].set(w[xe]);ie&&ie.setUniforms(e,this.binderUniforms,K,{zoom:ne});let ge=0;switch(r){case fe.LINES:ge=2;break;case fe.TRIANGLES:ge=3;break;case fe.LINE_STRIP:ge=1}for(const xe of Z.get()){const ye=xe.vaos||(xe.vaos={});(ye[D]||(ye[D]=new bh)).bind(e,this,N,ie?ie.getPaintVertexBuffers():[],O,xe.vertexOffset,ae,ue,me),fe.drawElements(r,xe.primitiveLength*ge,fe.UNSIGNED_SHORT,xe.primitiveOffset*ge*2)}}}function No(h,e,r){const a=1/s.az(r,1,e.transform.tileZoom),l=Math.pow(2,r.tileID.overscaledZ),p=r.tileSize*Math.pow(2,e.transform.tileZoom)/l,y=p*(r.tileID.canonical.x+r.tileID.wrap*l),w=p*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[a,h.fromScale,h.toScale],u_fade:h.t,u_pixel_coord_upper:[y>>16,w>>16],u_pixel_coord_lower:[65535&y,65535&w]}}const qo=(h,e,r,a)=>{const l=h.style.light,p=l.properties.get("position"),y=[p.x,p.y,p.z],w=s.bN();l.properties.get("anchor")==="viewport"&&s.bO(w,h.transform.bearingInRadians),s.bP(y,y,w);const A=h.transform.transformLightDirection(y),R=l.properties.get("color");return{u_lightpos:y,u_lightpos_globe:A,u_lightintensity:l.properties.get("intensity"),u_lightcolor:[R.r,R.g,R.b],u_vertical_gradient:+e,u_opacity:r,u_fill_translate:a}},on=(h,e,r,a,l,p,y)=>s.e(qo(h,e,r,a),No(p,h,y),{u_height_factor:-Math.pow(2,l.overscaledZ)/y.tileSize/8}),dc=(h,e,r,a)=>s.e(No(e,h,r),{u_fill_translate:a}),Ga=(h,e)=>({u_world:h,u_fill_translate:e}),Qs=(h,e,r,a,l)=>s.e(dc(h,e,r,l),{u_world:a}),Ys=(h,e,r,a,l)=>{const p=h.transform;let y,w,A=0;if(r.paint.get("circle-pitch-alignment")==="map"){const R=s.az(e,1,p.zoom);y=!0,w=[R,R],A=R/(s.Z*Math.pow(2,e.tileID.overscaledZ))*2*Math.PI*l}else y=!1,w=p.pixelsToGLUnits;return{u_camera_to_center_distance:p.cameraToCenterDistance,u_scale_with_map:+(r.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+y,u_device_pixel_ratio:h.pixelRatio,u_extrude_scale:w,u_globe_extrude_scale:A,u_translate:a}},Sh=h=>({u_pixel_extrude_scale:[1/h.width,1/h.height]}),Uo=h=>({u_viewport_size:[h.width,h.height]}),fc=(h,e=1)=>({u_color:h,u_overlay:0,u_overlay_scale:e}),Gn=(h,e,r,a)=>{const l=s.az(h,1,e)/(s.Z*Math.pow(2,h.tileID.overscaledZ))*2*Math.PI*a;return{u_extrude_scale:s.az(h,1,e),u_intensity:r,u_globe_extrude_scale:l}},mc=(h,e,r,a)=>{const l=s.K();s.bQ(l,0,h.width,h.height,0,0,1);const p=h.context.gl;return{u_matrix:l,u_world:[p.drawingBufferWidth,p.drawingBufferHeight],u_image:r,u_color_ramp:a,u_opacity:e.paint.get("heatmap-opacity")}},gc=(h,e,r)=>{const a=r.paint.get("hillshade-accent-color");let l;switch(r.paint.get("hillshade-method")){case"basic":l=4;break;case"combined":l=1;break;case"igor":l=2;break;case"multidirectional":l=3;break;default:l=0}const p=r.getIlluminationProperties();for(let y=0;y<p.directionRadians.length;y++)r.paint.get("hillshade-illumination-anchor")==="viewport"&&(p.directionRadians[y]+=h.transform.bearingInRadians);return{u_image:0,u_latrange:yc(0,e.tileID),u_exaggeration:r.paint.get("hillshade-exaggeration"),u_altitudes:p.altitudeRadians,u_azimuths:p.directionRadians,u_accent:a,u_method:l,u_highlights:p.highlightColor,u_shadows:p.shadowColor}},Ah=(h,e)=>{const r=e.stride,a=s.K();return s.bQ(a,0,s.Z,-8192,0,0,1),s.L(a,a,[0,-8192,0]),{u_matrix:a,u_image:1,u_dimension:[r,r],u_zoom:h.overscaledZ,u_unpack:e.getUnpackVector()}};function yc(h,e){const r=Math.pow(2,e.canonical.z),a=e.canonical.y;return[new s.$(0,a/r).toLngLat().lat,new s.$(0,(a+1)/r).toLngLat().lat]}const $s=(h,e,r,a)=>{const l=h.transform;return{u_translation:Cn(h,e,r),u_ratio:a/s.az(e,1,l.zoom),u_device_pixel_ratio:h.pixelRatio,u_units_to_pixels:[1/l.pixelsToGLUnits[0],1/l.pixelsToGLUnits[1]]}},_c=(h,e,r,a,l)=>s.e($s(h,e,r,a),{u_image:0,u_image_height:l}),vc=(h,e,r,a,l)=>{const p=h.transform,y=Ja(e,p);return{u_translation:Cn(h,e,r),u_texsize:e.imageAtlasTexture.size,u_ratio:a/s.az(e,1,p.zoom),u_device_pixel_ratio:h.pixelRatio,u_image:0,u_scale:[y,l.fromScale,l.toScale],u_fade:l.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},xc=(h,e,r,a,l,p)=>{const y=h.lineAtlas,w=Ja(e,h.transform),A=r.layout.get("line-cap")==="round",R=y.getDash(l.from,A),D=y.getDash(l.to,A),N=R.width*p.fromScale,O=D.width*p.toScale;return s.e($s(h,e,r,a),{u_patternscale_a:[w/N,-R.height/2],u_patternscale_b:[w/O,-D.height/2],u_sdfgamma:y.width/(256*Math.min(N,O)*h.pixelRatio)/2,u_image:0,u_tex_y_a:R.y,u_tex_y_b:D.y,u_mix:p.t})};function Ja(h,e){return 1/s.az(h,1,e.tileZoom)}function Cn(h,e,r){return s.aA(h.transform,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const bc=(h,e,r,a,l)=>{return{u_tl_parent:h,u_scale_parent:e,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*a.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:a.paint.get("raster-brightness-min"),u_brightness_high:a.paint.get("raster-brightness-max"),u_saturation_factor:(y=a.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(p=a.paint.get("raster-contrast"),p>0?1/(1-p):1+p),u_spin_weights:wc(a.paint.get("raster-hue-rotate")),u_coords_top:[l[0].x,l[0].y,l[1].x,l[1].y],u_coords_bottom:[l[3].x,l[3].y,l[2].x,l[2].y]};var p,y};function wc(h){h*=Math.PI/180;const e=Math.sin(h),r=Math.cos(h);return[(2*r+1)/3,(-Math.sqrt(3)*e-r+1)/3,(Math.sqrt(3)*e-r+1)/3]}const ys=(h,e,r,a,l,p,y,w,A,R,D,N,O)=>{const Z=y.transform;return{u_is_size_zoom_constant:+(h==="constant"||h==="source"),u_is_size_feature_constant:+(h==="constant"||h==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:Z.cameraToCenterDistance,u_pitch:Z.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:Z.width/Z.height,u_fade_change:y.options.fadeDuration?y.symbolFadeChange:1,u_label_plane_matrix:w,u_coord_matrix:A,u_is_text:+D,u_pitch_with_map:+a,u_is_along_line:l,u_is_variable_anchor:p,u_texsize:N,u_texture:0,u_translation:R,u_pitched_scale:O}},Sc=(h,e,r,a,l,p,y,w,A,R,D,N,O,Z)=>{const K=y.transform;return s.e(ys(h,e,r,a,l,p,y,w,A,R,D,N,Z),{u_gamma_scale:a?Math.cos(K.pitch*Math.PI/180)*K.cameraToCenterDistance:1,u_device_pixel_ratio:y.pixelRatio,u_is_halo:1})},jo=(h,e,r,a,l,p,y,w,A,R,D,N,O)=>s.e(Sc(h,e,r,a,l,p,y,w,A,R,!0,D,0,O),{u_texsize_icon:N,u_texture_icon:1}),kh=(h,e)=>({u_opacity:h,u_color:e}),Ch=(h,e,r,a,l)=>s.e(function(p,y,w,A){const R=w.imageManager.getPattern(p.from.toString()),D=w.imageManager.getPattern(p.to.toString()),{width:N,height:O}=w.imageManager.getPixelSize(),Z=Math.pow(2,A.tileID.overscaledZ),K=A.tileSize*Math.pow(2,w.transform.tileZoom)/Z,ne=K*(A.tileID.canonical.x+A.tileID.wrap*Z),ie=K*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:R.tl,u_pattern_br_a:R.br,u_pattern_tl_b:D.tl,u_pattern_br_b:D.br,u_texsize:[N,O],u_mix:y.t,u_pattern_size_a:R.displaySize,u_pattern_size_b:D.displaySize,u_scale_a:y.fromScale,u_scale_b:y.toScale,u_tile_units_to_pixels:1/s.az(A,1,w.transform.tileZoom),u_pixel_coord_upper:[ne>>16,ie>>16],u_pixel_coord_lower:[65535&ne,65535&ie]}}(r,l,e,a),{u_opacity:h}),Xa=(h,e)=>{},Ac={fillExtrusion:(h,e)=>({u_lightpos:new s.bL(h,e.u_lightpos),u_lightpos_globe:new s.bL(h,e.u_lightpos_globe),u_lightintensity:new s.b8(h,e.u_lightintensity),u_lightcolor:new s.bL(h,e.u_lightcolor),u_vertical_gradient:new s.b8(h,e.u_vertical_gradient),u_opacity:new s.b8(h,e.u_opacity),u_fill_translate:new s.bM(h,e.u_fill_translate)}),fillExtrusionPattern:(h,e)=>({u_lightpos:new s.bL(h,e.u_lightpos),u_lightpos_globe:new s.bL(h,e.u_lightpos_globe),u_lightintensity:new s.b8(h,e.u_lightintensity),u_lightcolor:new s.bL(h,e.u_lightcolor),u_vertical_gradient:new s.b8(h,e.u_vertical_gradient),u_height_factor:new s.b8(h,e.u_height_factor),u_opacity:new s.b8(h,e.u_opacity),u_fill_translate:new s.bM(h,e.u_fill_translate),u_image:new s.bH(h,e.u_image),u_texsize:new s.bM(h,e.u_texsize),u_pixel_coord_upper:new s.bM(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new s.bM(h,e.u_pixel_coord_lower),u_scale:new s.bL(h,e.u_scale),u_fade:new s.b8(h,e.u_fade)}),fill:(h,e)=>({u_fill_translate:new s.bM(h,e.u_fill_translate)}),fillPattern:(h,e)=>({u_image:new s.bH(h,e.u_image),u_texsize:new s.bM(h,e.u_texsize),u_pixel_coord_upper:new s.bM(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new s.bM(h,e.u_pixel_coord_lower),u_scale:new s.bL(h,e.u_scale),u_fade:new s.b8(h,e.u_fade),u_fill_translate:new s.bM(h,e.u_fill_translate)}),fillOutline:(h,e)=>({u_world:new s.bM(h,e.u_world),u_fill_translate:new s.bM(h,e.u_fill_translate)}),fillOutlinePattern:(h,e)=>({u_world:new s.bM(h,e.u_world),u_image:new s.bH(h,e.u_image),u_texsize:new s.bM(h,e.u_texsize),u_pixel_coord_upper:new s.bM(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new s.bM(h,e.u_pixel_coord_lower),u_scale:new s.bL(h,e.u_scale),u_fade:new s.b8(h,e.u_fade),u_fill_translate:new s.bM(h,e.u_fill_translate)}),circle:(h,e)=>({u_camera_to_center_distance:new s.b8(h,e.u_camera_to_center_distance),u_scale_with_map:new s.bH(h,e.u_scale_with_map),u_pitch_with_map:new s.bH(h,e.u_pitch_with_map),u_extrude_scale:new s.bM(h,e.u_extrude_scale),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_globe_extrude_scale:new s.b8(h,e.u_globe_extrude_scale),u_translate:new s.bM(h,e.u_translate)}),collisionBox:(h,e)=>({u_pixel_extrude_scale:new s.bM(h,e.u_pixel_extrude_scale)}),collisionCircle:(h,e)=>({u_viewport_size:new s.bM(h,e.u_viewport_size)}),debug:(h,e)=>({u_color:new s.bI(h,e.u_color),u_overlay:new s.bH(h,e.u_overlay),u_overlay_scale:new s.b8(h,e.u_overlay_scale)}),depth:Xa,clippingMask:Xa,heatmap:(h,e)=>({u_extrude_scale:new s.b8(h,e.u_extrude_scale),u_intensity:new s.b8(h,e.u_intensity),u_globe_extrude_scale:new s.b8(h,e.u_globe_extrude_scale)}),heatmapTexture:(h,e)=>({u_matrix:new s.bJ(h,e.u_matrix),u_world:new s.bM(h,e.u_world),u_image:new s.bH(h,e.u_image),u_color_ramp:new s.bH(h,e.u_color_ramp),u_opacity:new s.b8(h,e.u_opacity)}),hillshade:(h,e)=>({u_image:new s.bH(h,e.u_image),u_latrange:new s.bM(h,e.u_latrange),u_exaggeration:new s.b8(h,e.u_exaggeration),u_altitudes:new s.bS(h,e.u_altitudes),u_azimuths:new s.bS(h,e.u_azimuths),u_accent:new s.bI(h,e.u_accent),u_method:new s.bH(h,e.u_method),u_shadows:new s.bR(h,e.u_shadows),u_highlights:new s.bR(h,e.u_highlights)}),hillshadePrepare:(h,e)=>({u_matrix:new s.bJ(h,e.u_matrix),u_image:new s.bH(h,e.u_image),u_dimension:new s.bM(h,e.u_dimension),u_zoom:new s.b8(h,e.u_zoom),u_unpack:new s.bK(h,e.u_unpack)}),line:(h,e)=>({u_translation:new s.bM(h,e.u_translation),u_ratio:new s.b8(h,e.u_ratio),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_units_to_pixels:new s.bM(h,e.u_units_to_pixels)}),lineGradient:(h,e)=>({u_translation:new s.bM(h,e.u_translation),u_ratio:new s.b8(h,e.u_ratio),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_units_to_pixels:new s.bM(h,e.u_units_to_pixels),u_image:new s.bH(h,e.u_image),u_image_height:new s.b8(h,e.u_image_height)}),linePattern:(h,e)=>({u_translation:new s.bM(h,e.u_translation),u_texsize:new s.bM(h,e.u_texsize),u_ratio:new s.b8(h,e.u_ratio),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_image:new s.bH(h,e.u_image),u_units_to_pixels:new s.bM(h,e.u_units_to_pixels),u_scale:new s.bL(h,e.u_scale),u_fade:new s.b8(h,e.u_fade)}),lineSDF:(h,e)=>({u_translation:new s.bM(h,e.u_translation),u_ratio:new s.b8(h,e.u_ratio),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_units_to_pixels:new s.bM(h,e.u_units_to_pixels),u_patternscale_a:new s.bM(h,e.u_patternscale_a),u_patternscale_b:new s.bM(h,e.u_patternscale_b),u_sdfgamma:new s.b8(h,e.u_sdfgamma),u_image:new s.bH(h,e.u_image),u_tex_y_a:new s.b8(h,e.u_tex_y_a),u_tex_y_b:new s.b8(h,e.u_tex_y_b),u_mix:new s.b8(h,e.u_mix)}),raster:(h,e)=>({u_tl_parent:new s.bM(h,e.u_tl_parent),u_scale_parent:new s.b8(h,e.u_scale_parent),u_buffer_scale:new s.b8(h,e.u_buffer_scale),u_fade_t:new s.b8(h,e.u_fade_t),u_opacity:new s.b8(h,e.u_opacity),u_image0:new s.bH(h,e.u_image0),u_image1:new s.bH(h,e.u_image1),u_brightness_low:new s.b8(h,e.u_brightness_low),u_brightness_high:new s.b8(h,e.u_brightness_high),u_saturation_factor:new s.b8(h,e.u_saturation_factor),u_contrast_factor:new s.b8(h,e.u_contrast_factor),u_spin_weights:new s.bL(h,e.u_spin_weights),u_coords_top:new s.bK(h,e.u_coords_top),u_coords_bottom:new s.bK(h,e.u_coords_bottom)}),symbolIcon:(h,e)=>({u_is_size_zoom_constant:new s.bH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new s.bH(h,e.u_is_size_feature_constant),u_size_t:new s.b8(h,e.u_size_t),u_size:new s.b8(h,e.u_size),u_camera_to_center_distance:new s.b8(h,e.u_camera_to_center_distance),u_pitch:new s.b8(h,e.u_pitch),u_rotate_symbol:new s.bH(h,e.u_rotate_symbol),u_aspect_ratio:new s.b8(h,e.u_aspect_ratio),u_fade_change:new s.b8(h,e.u_fade_change),u_label_plane_matrix:new s.bJ(h,e.u_label_plane_matrix),u_coord_matrix:new s.bJ(h,e.u_coord_matrix),u_is_text:new s.bH(h,e.u_is_text),u_pitch_with_map:new s.bH(h,e.u_pitch_with_map),u_is_along_line:new s.bH(h,e.u_is_along_line),u_is_variable_anchor:new s.bH(h,e.u_is_variable_anchor),u_texsize:new s.bM(h,e.u_texsize),u_texture:new s.bH(h,e.u_texture),u_translation:new s.bM(h,e.u_translation),u_pitched_scale:new s.b8(h,e.u_pitched_scale)}),symbolSDF:(h,e)=>({u_is_size_zoom_constant:new s.bH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new s.bH(h,e.u_is_size_feature_constant),u_size_t:new s.b8(h,e.u_size_t),u_size:new s.b8(h,e.u_size),u_camera_to_center_distance:new s.b8(h,e.u_camera_to_center_distance),u_pitch:new s.b8(h,e.u_pitch),u_rotate_symbol:new s.bH(h,e.u_rotate_symbol),u_aspect_ratio:new s.b8(h,e.u_aspect_ratio),u_fade_change:new s.b8(h,e.u_fade_change),u_label_plane_matrix:new s.bJ(h,e.u_label_plane_matrix),u_coord_matrix:new s.bJ(h,e.u_coord_matrix),u_is_text:new s.bH(h,e.u_is_text),u_pitch_with_map:new s.bH(h,e.u_pitch_with_map),u_is_along_line:new s.bH(h,e.u_is_along_line),u_is_variable_anchor:new s.bH(h,e.u_is_variable_anchor),u_texsize:new s.bM(h,e.u_texsize),u_texture:new s.bH(h,e.u_texture),u_gamma_scale:new s.b8(h,e.u_gamma_scale),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_is_halo:new s.bH(h,e.u_is_halo),u_translation:new s.bM(h,e.u_translation),u_pitched_scale:new s.b8(h,e.u_pitched_scale)}),symbolTextAndIcon:(h,e)=>({u_is_size_zoom_constant:new s.bH(h,e.u_is_size_zoom_constant),u_is_size_feature_constant:new s.bH(h,e.u_is_size_feature_constant),u_size_t:new s.b8(h,e.u_size_t),u_size:new s.b8(h,e.u_size),u_camera_to_center_distance:new s.b8(h,e.u_camera_to_center_distance),u_pitch:new s.b8(h,e.u_pitch),u_rotate_symbol:new s.bH(h,e.u_rotate_symbol),u_aspect_ratio:new s.b8(h,e.u_aspect_ratio),u_fade_change:new s.b8(h,e.u_fade_change),u_label_plane_matrix:new s.bJ(h,e.u_label_plane_matrix),u_coord_matrix:new s.bJ(h,e.u_coord_matrix),u_is_text:new s.bH(h,e.u_is_text),u_pitch_with_map:new s.bH(h,e.u_pitch_with_map),u_is_along_line:new s.bH(h,e.u_is_along_line),u_is_variable_anchor:new s.bH(h,e.u_is_variable_anchor),u_texsize:new s.bM(h,e.u_texsize),u_texsize_icon:new s.bM(h,e.u_texsize_icon),u_texture:new s.bH(h,e.u_texture),u_texture_icon:new s.bH(h,e.u_texture_icon),u_gamma_scale:new s.b8(h,e.u_gamma_scale),u_device_pixel_ratio:new s.b8(h,e.u_device_pixel_ratio),u_is_halo:new s.bH(h,e.u_is_halo),u_translation:new s.bM(h,e.u_translation),u_pitched_scale:new s.b8(h,e.u_pitched_scale)}),background:(h,e)=>({u_opacity:new s.b8(h,e.u_opacity),u_color:new s.bI(h,e.u_color)}),backgroundPattern:(h,e)=>({u_opacity:new s.b8(h,e.u_opacity),u_image:new s.bH(h,e.u_image),u_pattern_tl_a:new s.bM(h,e.u_pattern_tl_a),u_pattern_br_a:new s.bM(h,e.u_pattern_br_a),u_pattern_tl_b:new s.bM(h,e.u_pattern_tl_b),u_pattern_br_b:new s.bM(h,e.u_pattern_br_b),u_texsize:new s.bM(h,e.u_texsize),u_mix:new s.b8(h,e.u_mix),u_pattern_size_a:new s.bM(h,e.u_pattern_size_a),u_pattern_size_b:new s.bM(h,e.u_pattern_size_b),u_scale_a:new s.b8(h,e.u_scale_a),u_scale_b:new s.b8(h,e.u_scale_b),u_pixel_coord_upper:new s.bM(h,e.u_pixel_coord_upper),u_pixel_coord_lower:new s.bM(h,e.u_pixel_coord_lower),u_tile_units_to_pixels:new s.b8(h,e.u_tile_units_to_pixels)}),terrain:(h,e)=>({u_texture:new s.bH(h,e.u_texture),u_ele_delta:new s.b8(h,e.u_ele_delta),u_fog_matrix:new s.bJ(h,e.u_fog_matrix),u_fog_color:new s.bI(h,e.u_fog_color),u_fog_ground_blend:new s.b8(h,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new s.b8(h,e.u_fog_ground_blend_opacity),u_horizon_color:new s.bI(h,e.u_horizon_color),u_horizon_fog_blend:new s.b8(h,e.u_horizon_fog_blend),u_is_globe_mode:new s.b8(h,e.u_is_globe_mode)}),terrainDepth:(h,e)=>({u_ele_delta:new s.b8(h,e.u_ele_delta)}),terrainCoords:(h,e)=>({u_texture:new s.bH(h,e.u_texture),u_terrain_coords_id:new s.b8(h,e.u_terrain_coords_id),u_ele_delta:new s.b8(h,e.u_ele_delta)}),projectionErrorMeasurement:(h,e)=>({u_input:new s.b8(h,e.u_input),u_output_expected:new s.b8(h,e.u_output_expected)}),atmosphere:(h,e)=>({u_sun_pos:new s.bL(h,e.u_sun_pos),u_atmosphere_blend:new s.b8(h,e.u_atmosphere_blend),u_globe_position:new s.bL(h,e.u_globe_position),u_globe_radius:new s.b8(h,e.u_globe_radius),u_inv_proj_matrix:new s.bJ(h,e.u_inv_proj_matrix)}),sky:(h,e)=>({u_sky_color:new s.bI(h,e.u_sky_color),u_horizon_color:new s.bI(h,e.u_horizon_color),u_horizon:new s.bM(h,e.u_horizon),u_horizon_normal:new s.bM(h,e.u_horizon_normal),u_sky_horizon_blend:new s.b8(h,e.u_sky_horizon_blend),u_sky_blend:new s.b8(h,e.u_sky_blend)})};class kc{constructor(e,r,a){this.context=e;const l=e.gl;this.buffer=l.createBuffer(),this.dynamicDraw=!!a,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),l.bufferData(l.ELEMENT_ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?l.DYNAMIC_DRAW:l.STATIC_DRAW),this.dynamicDraw||delete r.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const r=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),r.bufferSubData(r.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Qa={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Cc{constructor(e,r,a,l){this.length=r.length,this.attributes=a,this.itemSize=r.bytesPerElement,this.dynamicDraw=l,this.context=e;const p=e.gl;this.buffer=p.createBuffer(),e.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,r.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete r.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const r=this.context.gl;this.bind(),r.bufferSubData(r.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,r){for(let a=0;a<this.attributes.length;a++){const l=r.attributes[this.attributes[a].name];l!==void 0&&e.enableVertexAttribArray(l)}}setVertexAttribPointers(e,r,a){for(let l=0;l<this.attributes.length;l++){const p=this.attributes[l],y=r.attributes[p.name];y!==void 0&&e.vertexAttribPointer(y,p.components,e[Qa[p.type]],!1,this.itemSize,p.offset+this.itemSize*(a||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class jt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class dn extends jt{getDefault(){return s.b7.transparent}set(e){const r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Ya extends jt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class $a extends jt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class el extends jt{getDefault(){return[!0,!0,!0,!0]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Tc extends jt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class tl extends jt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class Jn extends jt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const r=this.current;(e.func!==r.func||e.ref!==r.ref||e.mask!==r.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class rl extends jt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class Th extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.STENCIL_TEST):r.disable(r.STENCIL_TEST),this.current=e,this.dirty=!1}}class Eh extends jt{getDefault(){return[0,1]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Ph extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.DEPTH_TEST):r.disable(r.DEPTH_TEST),this.current=e,this.dirty=!1}}class Ih extends jt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Ec extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.BLEND):r.disable(r.BLEND),this.current=e,this.dirty=!1}}class Mh extends jt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class Pc extends jt{getDefault(){return s.b7.transparent}set(e){const r=this.current;(e.r!==r.r||e.g!==r.g||e.b!==r.b||e.a!==r.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Wo extends jt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class Ho extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;e?r.enable(r.CULL_FACE):r.disable(r.CULL_FACE),this.current=e,this.dirty=!1}}class Zo extends jt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class il extends jt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class Xn extends jt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class Ko extends jt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class _s extends jt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const r=this.current;(e[0]!==r[0]||e[1]!==r[1]||e[2]!==r[2]||e[3]!==r[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Ni extends jt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindFramebuffer(r.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Ic extends jt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindRenderbuffer(r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Mc extends jt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindTexture(r.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class nl extends jt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.bindBuffer(r.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Qn extends jt{getDefault(){return null}set(e){const r=this.gl;r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Go extends jt{getDefault(){return null}set(e){var r;if(e===this.current&&!this.dirty)return;const a=this.gl;ci(a)?a.bindVertexArray(e):(r=a.getExtension("OES_vertex_array_object"))===null||r===void 0||r.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Jo extends jt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class eo extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Xo extends jt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const r=this.gl;r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class Qo extends jt{constructor(e,r){super(e),this.context=e,this.parent=r}getDefault(){return null}}class vs extends Qo{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class xs extends Qo{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Lc extends Qo{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const r=this.gl;r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,e),this.current=e,this.dirty=!1}}const Yo="Framebuffer is not complete";class Rt{constructor(e,r,a,l,p){this.context=e,this.width=r,this.height=a;const y=e.gl,w=this.framebuffer=y.createFramebuffer();if(this.colorAttachment=new vs(e,w),l)this.depthAttachment=p?new Lc(e,w):new xs(e,w);else if(p)throw new Error("Stencil cannot be set without depth");if(y.checkFramebufferStatus(y.FRAMEBUFFER)!==y.FRAMEBUFFER_COMPLETE)throw new Error(Yo)}destroy(){const e=this.context.gl,r=this.colorAttachment.get();if(r&&e.deleteTexture(r),this.depthAttachment){const a=this.depthAttachment.get();a&&e.deleteRenderbuffer(a)}e.deleteFramebuffer(this.framebuffer)}}class $o{constructor(e){var r,a;if(this.gl=e,this.clearColor=new dn(this),this.clearDepth=new Ya(this),this.clearStencil=new $a(this),this.colorMask=new el(this),this.depthMask=new Tc(this),this.stencilMask=new tl(this),this.stencilFunc=new Jn(this),this.stencilOp=new rl(this),this.stencilTest=new Th(this),this.depthRange=new Eh(this),this.depthTest=new Ph(this),this.depthFunc=new Ih(this),this.blend=new Ec(this),this.blendFunc=new Mh(this),this.blendColor=new Pc(this),this.blendEquation=new Wo(this),this.cullFace=new Ho(this),this.cullFaceSide=new Zo(this),this.frontFace=new il(this),this.program=new Xn(this),this.activeTexture=new Ko(this),this.viewport=new _s(this),this.bindFramebuffer=new Ni(this),this.bindRenderbuffer=new Ic(this),this.bindTexture=new Mc(this),this.bindVertexBuffer=new nl(this),this.bindElementBuffer=new Qn(this),this.bindVertexArray=new Go(this),this.pixelStoreUnpack=new Jo(this),this.pixelStoreUnpackPremultiplyAlpha=new eo(this),this.pixelStoreUnpackFlipY=new Xo(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),ci(e)){this.HALF_FLOAT=e.HALF_FLOAT;const l=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(r=e.RGBA16F)!==null&&r!==void 0?r:l==null?void 0:l.RGBA16F_EXT,this.RGB16F=(a=e.RGB16F)!==null&&a!==void 0?a:l==null?void 0:l.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const l=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=l==null?void 0:l.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,r){return new kc(this,e,r)}createVertexBuffer(e,r,a){return new Cc(this,e,r,a)}createRenderbuffer(e,r,a){const l=this.gl,p=l.createRenderbuffer();return this.bindRenderbuffer.set(p),l.renderbufferStorage(l.RENDERBUFFER,e,r,a),this.bindRenderbuffer.set(null),p}createFramebuffer(e,r,a,l){return new Rt(this,e,r,a,l)}clear({color:e,depth:r,stencil:a}){const l=this.gl;let p=0;e&&(p|=l.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),r!==void 0&&(p|=l.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),a!==void 0&&(p|=l.STENCIL_BUFFER_BIT,this.clearStencil.set(a),this.stencilMask.set(255)),l.clear(p)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){s.bE(e.blendFunction,$t.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return ci(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))===null||e===void 0?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var r;return ci(this.gl)?this.gl.deleteVertexArray(e):(r=this.gl.getExtension("OES_vertex_array_object"))===null||r===void 0?void 0:r.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}let ea;function sl(h,e,r,a,l){const p=h.context,y=h.transform,w=p.gl,A=h.useProgram("collisionBox"),R=[];let D=0,N=0;for(let ae=0;ae<a.length;ae++){const ue=a[ae],me=e.getTile(ue).getBucket(r);if(!me)continue;const fe=l?me.textCollisionBox:me.iconCollisionBox,ge=me.collisionCircleArray;ge.length>0&&(R.push({circleArray:ge,circleOffset:N,coord:ue}),D+=ge.length/4,N=D),fe&&A.draw(p,w.LINES,kt.disabled,It.disabled,h.colorModeForRenderPass(),Nt.disabled,Sh(h.transform),h.style.map.terrain&&h.style.map.terrain.getTerrainData(ue),y.getProjectionData({overscaledTileID:ue,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),r.id,fe.layoutVertexBuffer,fe.indexBuffer,fe.segments,null,h.transform.zoom,null,null,fe.collisionVertexBuffer)}if(!l||!R.length)return;const O=h.useProgram("collisionCircle"),Z=new s.bT;Z.resize(4*D),Z._trim();let K=0;for(const ae of R)for(let ue=0;ue<ae.circleArray.length/4;ue++){const me=4*ue,fe=ae.circleArray[me+0],ge=ae.circleArray[me+1],xe=ae.circleArray[me+2],ye=ae.circleArray[me+3];Z.emplace(K++,fe,ge,xe,ye,0),Z.emplace(K++,fe,ge,xe,ye,1),Z.emplace(K++,fe,ge,xe,ye,2),Z.emplace(K++,fe,ge,xe,ye,3)}(!ea||ea.length<2*D)&&(ea=function(ae){const ue=2*ae,me=new s.bV;me.resize(ue),me._trim();for(let fe=0;fe<ue;fe++){const ge=6*fe;me.uint16[ge+0]=4*fe+0,me.uint16[ge+1]=4*fe+1,me.uint16[ge+2]=4*fe+2,me.uint16[ge+3]=4*fe+2,me.uint16[ge+4]=4*fe+3,me.uint16[ge+5]=4*fe+0}return me}(D));const ne=p.createIndexBuffer(ea,!0),ie=p.createVertexBuffer(Z,s.bU.members,!0);for(const ae of R){const ue=Uo(h.transform);O.draw(p,w.TRIANGLES,kt.disabled,It.disabled,h.colorModeForRenderPass(),Nt.disabled,ue,h.style.map.terrain&&h.style.map.terrain.getTerrainData(ae.coord),null,r.id,ie,ne,s.aJ.simpleSegment(0,2*ae.circleOffset,ae.circleArray.length,ae.circleArray.length/2),null,h.transform.zoom,null,null,null)}ie.destroy(),ne.destroy()}const to=s.ad(new Float32Array(16));function Lh(h,e,r,a,l,p){const{horizontalAlign:y,verticalAlign:w}=s.aE(h);return new s.P((-(y-.5)*e/l+a[0])*p,(-(w-.5)*r/l+a[1])*p)}function Rh(h,e,r,a,l,p){const y=e.tileAnchorPoint.add(new s.P(e.translation[0],e.translation[1]));if(e.pitchWithMap){let w=a.mult(p);r||(w=w.rotate(-l));const A=y.add(w);return Ve(A.x,A.y,e.pitchedLabelPlaneMatrix,e.getElevation).point}if(r){const w=xr(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(h),A=Math.atan(w.y/w.x)+(w.x<0?Math.PI:0);return h.add(a.rotate(A))}return h.add(a)}function Rc(h,e,r,a,l,p,y,w,A,R,D,N){const O=h.text.placedSymbolArray,Z=h.text.dynamicLayoutVertexArray,K=h.icon.dynamicLayoutVertexArray,ne={};Z.clear();for(let ie=0;ie<O.length;ie++){const ae=O.get(ie),ue=ae.hidden||!ae.crossTileID||h.allowVerticalPlacement&&!ae.placedOrientation?null:a[ae.crossTileID];if(ue){const me=new s.P(ae.anchorX,ae.anchorY),fe={getElevation:N,width:l.width,height:l.height,pitchedLabelPlaneMatrix:p,pitchWithMap:r,transform:l,tileAnchorPoint:me,translation:R,unwrappedTileID:D},ge=r?Pt(me.x,me.y,fe):xr(me.x,me.y,fe),xe=Kt(l.cameraToCenterDistance,ge.signedDistanceFromCamera);let ye=s.am(h.textSizeData,w,ae)*xe/s.ay;r&&(ye*=h.tilePixelRatio/y);const{width:Te,height:Fe,anchor:Le,textOffset:Be,textBoxScale:De}=ue,Ye=Lh(Le,Te,Fe,Be,De,ye),Xe=l.getPitchedTextCorrection(me.x+R[0],me.y+R[1],D),He=Rh(ge.point,fe,e,Ye,-l.bearingInRadians,Xe),at=h.allowVerticalPlacement&&ae.placedOrientation===s.al.vertical?Math.PI/2:0;for(let Mt=0;Mt<ae.numGlyphs;Mt++)s.as(Z,He,at);A&&ae.associatedIconIndex>=0&&(ne[ae.associatedIconIndex]={shiftedAnchor:He,angle:at})}else hn(ae.numGlyphs,Z)}if(A){K.clear();const ie=h.icon.placedSymbolArray;for(let ae=0;ae<ie.length;ae++){const ue=ie.get(ae);if(ue.hidden)hn(ue.numGlyphs,K);else{const me=ne[ae];if(me)for(let fe=0;fe<ue.numGlyphs;fe++)s.as(K,me.shiftedAnchor,me.angle);else hn(ue.numGlyphs,K)}}h.icon.dynamicLayoutVertexBuffer.updateData(K)}h.text.dynamicLayoutVertexBuffer.updateData(Z)}function Bh(h,e,r){return r.iconsInText&&e?"symbolTextAndIcon":h?"symbolSDF":"symbolIcon"}function ta(h,e,r,a,l,p,y,w,A,R,D,N,O){const Z=h.context,K=Z.gl,ne=h.transform,ie=w==="map",ae=A==="map",ue=w!=="viewport"&&r.layout.get("symbol-placement")!=="point",me=ie&&!ae&&!ue,fe=!r.layout.get("symbol-sort-key").isConstant();let ge=!1;const xe=h.getDepthModeForSublayer(0,kt.ReadOnly),ye=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),Te=[],Fe=ne.getCircleRadiusCorrection();for(const Le of a){const Be=e.getTile(Le),De=Be.getBucket(r);if(!De)continue;const Ye=l?De.text:De.icon;if(!Ye||!Ye.segments.get().length||!Ye.hasVisibleVertices)continue;const Xe=Ye.programConfigurations.get(r.id),He=l||De.sdfIcons,at=l?De.textSizeData:De.iconSizeData,Mt=ae||ne.pitch!==0,qt=h.useProgram(Bh(He,l,De),Xe),mr=s.ak(at,ne.zoom),tr=h.style.map.terrain&&h.style.map.terrain.getTerrainData(Le);let gr,yr,sr,Ht,jr=[0,0],Xr=null;if(l)yr=Be.glyphAtlasTexture,sr=K.LINEAR,gr=Be.glyphAtlasTexture.size,De.iconsInText&&(jr=Be.imageAtlasTexture.size,Xr=Be.imageAtlasTexture,Ht=Mt||h.options.rotating||h.options.zooming||at.kind==="composite"||at.kind==="camera"?K.LINEAR:K.NEAREST);else{const Fr=r.layout.get("icon-size").constantOr(0)!==1||De.iconsNeedLinear;yr=Be.imageAtlasTexture,sr=He||h.options.rotating||h.options.zooming||Fr||Mt?K.LINEAR:K.NEAREST,gr=Be.imageAtlasTexture.size}const ii=s.az(Be,1,h.transform.zoom),Zt=ft(ie,h.transform,ii),En=s.K();s.an(En,Zt);const cn=Tt(ae,ie,h.transform,ii),Pn=s.aA(ne,Be,p,y),es=ne.getProjectionData({overscaledTileID:Le,applyGlobeMatrix:!O,applyTerrainMatrix:!0}),yo=ye&&De.hasTextData(),In=r.layout.get("icon-text-fit")!=="none"&&yo&&De.hasIconData();if(ue){const Fr=h.style.map.terrain?(_i,cr)=>h.style.map.terrain.getElevation(Le,_i,cr):null,Or=r.layout.get("text-rotation-alignment")==="map";Wt(De,h,l,Zt,En,ae,R,Or,Le.toUnwrapped(),ne.width,ne.height,Pn,Fr)}const ts=l&&ye||In,Ri=ue||ts?to:ae?Zt:h.transform.clipSpaceToPixelsMatrix,Mn=He&&r.paint.get(l?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let mn;mn=He?De.iconsInText?jo(at.kind,mr,me,ae,ue,ts,h,Ri,cn,Pn,gr,jr,Fe):Sc(at.kind,mr,me,ae,ue,ts,h,Ri,cn,Pn,l,gr,0,Fe):ys(at.kind,mr,me,ae,ue,ts,h,Ri,cn,Pn,l,gr,Fe);const Ln={program:qt,buffers:Ye,uniformValues:mn,projectionData:es,atlasTexture:yr,atlasTextureIcon:Xr,atlasInterpolation:sr,atlasInterpolationIcon:Ht,isSDF:He,hasHalo:Mn};if(fe&&De.canOverlap){ge=!0;const Fr=Ye.segments.get();for(const Or of Fr)Te.push({segments:new s.aJ([Or]),sortKey:Or.sortKey,state:Ln,terrainData:tr})}else Te.push({segments:Ye.segments,sortKey:0,state:Ln,terrainData:tr})}ge&&Te.sort((Le,Be)=>Le.sortKey-Be.sortKey);for(const Le of Te){const Be=Le.state;if(Z.activeTexture.set(K.TEXTURE0),Be.atlasTexture.bind(Be.atlasInterpolation,K.CLAMP_TO_EDGE),Be.atlasTextureIcon&&(Z.activeTexture.set(K.TEXTURE1),Be.atlasTextureIcon&&Be.atlasTextureIcon.bind(Be.atlasInterpolationIcon,K.CLAMP_TO_EDGE)),Be.isSDF){const De=Be.uniformValues;Be.hasHalo&&(De.u_is_halo=1,ro(Be.buffers,Le.segments,r,h,Be.program,xe,D,N,De,Be.projectionData,Le.terrainData)),De.u_is_halo=0}ro(Be.buffers,Le.segments,r,h,Be.program,xe,D,N,Be.uniformValues,Be.projectionData,Le.terrainData)}}function ro(h,e,r,a,l,p,y,w,A,R,D){const N=a.context;l.draw(N,N.gl.TRIANGLES,p,y,w,Nt.backCCW,A,D,R,r.id,h.layoutVertexBuffer,h.indexBuffer,e,r.paint,a.transform.zoom,h.programConfigurations.get(r.id),h.dynamicLayoutVertexBuffer,h.opacityVertexBuffer)}function ra(h,e,r,a,l){const p=h.context,y=p.gl,w=It.disabled,A=new $t([y.ONE,y.ONE],s.b7.transparent,[!0,!0,!0,!0]),R=e.getBucket(r);if(!R)return;const D=a.key;let N=r.heatmapFbos.get(D);N||(N=ia(p,e.tileSize,e.tileSize),r.heatmapFbos.set(D,N)),p.bindFramebuffer.set(N.framebuffer),p.viewport.set([0,0,e.tileSize,e.tileSize]),p.clear({color:s.b7.transparent});const O=R.programConfigurations.get(r.id),Z=h.useProgram("heatmap",O,!l),K=h.transform.getProjectionData({overscaledTileID:e.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),ne=h.style.map.terrain.getTerrainData(a);Z.draw(p,y.TRIANGLES,kt.disabled,w,A,Nt.disabled,Gn(e,h.transform.zoom,r.paint.get("heatmap-intensity"),1),ne,K,r.id,R.layoutVertexBuffer,R.indexBuffer,R.segments,r.paint,h.transform.zoom,O)}function ol(h,e,r,a,l){const p=h.context,y=p.gl,w=h.transform;p.setColorMode(h.colorModeForRenderPass());const A=al(p,e),R=r.key,D=e.heatmapFbos.get(R);if(!D)return;p.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,D.colorAttachment.get()),p.activeTexture.set(y.TEXTURE1),A.bind(y.LINEAR,y.CLAMP_TO_EDGE);const N=w.getProjectionData({overscaledTileID:r,applyTerrainMatrix:l,applyGlobeMatrix:!a});h.useProgram("heatmapTexture").draw(p,y.TRIANGLES,kt.disabled,It.disabled,h.colorModeForRenderPass(),Nt.disabled,mc(h,e,0,1),null,N,e.id,h.rasterBoundsBuffer,h.quadTriangleIndexBuffer,h.rasterBoundsSegments,e.paint,w.zoom),D.destroy(),e.heatmapFbos.delete(R)}function ia(h,e,r){var a,l;const p=h.gl,y=p.createTexture();p.bindTexture(p.TEXTURE_2D,y),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_S,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_WRAP_T,p.CLAMP_TO_EDGE),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MIN_FILTER,p.LINEAR),p.texParameteri(p.TEXTURE_2D,p.TEXTURE_MAG_FILTER,p.LINEAR);const w=(a=h.HALF_FLOAT)!==null&&a!==void 0?a:p.UNSIGNED_BYTE,A=(l=h.RGBA16F)!==null&&l!==void 0?l:p.RGBA;p.texImage2D(p.TEXTURE_2D,0,A,e,r,0,p.RGBA,w,null);const R=h.createFramebuffer(e,r,!1,!1);return R.colorAttachment.set(y),R}function al(h,e){return e.colorRampTexture||(e.colorRampTexture=new Ze(h,e.colorRamp,h.gl.RGBA)),e.colorRampTexture}function io(h,e,r,a,l){if(!r||!a||!a.imageAtlas)return;const p=a.imageAtlas.patternPositions;let y=p[r.to.toString()],w=p[r.from.toString()];if(!y&&w&&(y=w),!w&&y&&(w=y),!y||!w){const A=l.getPaintProperty(e);y=p[A],w=p[A]}y&&w&&h.setConstantPatternPositions(y,w)}function no(h,e,r,a,l,p,y,w){const A=h.context.gl,R="fill-pattern",D=r.paint.get(R),N=D&&D.constantOr(1),O=r.getCrossfadeParameters();let Z,K,ne,ie,ae;const ue=h.transform,me=r.paint.get("fill-translate"),fe=r.paint.get("fill-translate-anchor");y?(K=N&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",Z=A.LINES):(K=N?"fillPattern":"fill",Z=A.TRIANGLES);const ge=D.constantOr(null);for(const xe of a){const ye=e.getTile(xe);if(N&&!ye.patternsLoaded())continue;const Te=ye.getBucket(r);if(!Te)continue;const Fe=Te.programConfigurations.get(r.id),Le=h.useProgram(K,Fe),Be=h.style.map.terrain&&h.style.map.terrain.getTerrainData(xe);N&&(h.context.activeTexture.set(A.TEXTURE0),ye.imageAtlasTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),Fe.updatePaintBuffers(O)),io(Fe,R,ge,ye,r);const De=ue.getProjectionData({overscaledTileID:xe,applyGlobeMatrix:!w,applyTerrainMatrix:!0}),Ye=s.aA(ue,ye,me,fe);if(y){ie=Te.indexBuffer2,ae=Te.segments2;const He=[A.drawingBufferWidth,A.drawingBufferHeight];ne=K==="fillOutlinePattern"&&N?Qs(h,O,ye,He,Ye):Ga(He,Ye)}else ie=Te.indexBuffer,ae=Te.segments,ne=N?dc(h,O,ye,Ye):{u_fill_translate:Ye};const Xe=h.stencilModeForClipping(xe);Le.draw(h.context,Z,l,Xe,p,Nt.backCCW,ne,Be,De,r.id,Te.layoutVertexBuffer,ie,ae,r.paint,h.transform.zoom,Fe)}}function so(h,e,r,a,l,p,y,w){const A=h.context,R=A.gl,D="fill-extrusion-pattern",N=r.paint.get(D),O=N.constantOr(1),Z=r.getCrossfadeParameters(),K=r.paint.get("fill-extrusion-opacity"),ne=N.constantOr(null),ie=h.transform;for(const ae of a){const ue=e.getTile(ae),me=ue.getBucket(r);if(!me)continue;const fe=h.style.map.terrain&&h.style.map.terrain.getTerrainData(ae),ge=me.programConfigurations.get(r.id),xe=h.useProgram(O?"fillExtrusionPattern":"fillExtrusion",ge);O&&(h.context.activeTexture.set(R.TEXTURE0),ue.imageAtlasTexture.bind(R.LINEAR,R.CLAMP_TO_EDGE),ge.updatePaintBuffers(Z));const ye=ie.getProjectionData({overscaledTileID:ae,applyGlobeMatrix:!w,applyTerrainMatrix:!0});io(ge,D,ne,ue,r);const Te=s.aA(ie,ue,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),Fe=r.paint.get("fill-extrusion-vertical-gradient"),Le=O?on(h,Fe,K,Te,ae,Z,ue):qo(h,Fe,K,Te);xe.draw(A,A.gl.TRIANGLES,l,p,y,Nt.backCCW,Le,fe,ye,r.id,me.layoutVertexBuffer,me.indexBuffer,me.segments,r.paint,h.transform.zoom,ge,h.style.map.terrain&&me.centroidVertexBuffer)}}function ll(h,e,r,a,l,p,y,w,A){var R;const D=h.style.projection,N=h.context,O=h.transform,Z=N.gl,K=[`#define NUM_ILLUMINATION_SOURCES ${r.paint.get("hillshade-highlight-color").values.length}`],ne=h.useProgram("hillshade",null,!1,K),ie=!h.options.moving;for(const ae of a){const ue=e.getTile(ae),me=ue.fbo;if(!me)continue;const fe=D.getMeshFromTileID(N,ae.canonical,w,!0,"raster"),ge=(R=h.style.map.terrain)===null||R===void 0?void 0:R.getTerrainData(ae);N.activeTexture.set(Z.TEXTURE0),Z.bindTexture(Z.TEXTURE_2D,me.colorAttachment.get());const xe=O.getProjectionData({overscaledTileID:ae,aligned:ie,applyGlobeMatrix:!A,applyTerrainMatrix:!0});ne.draw(N,Z.TRIANGLES,p,l[ae.overscaledZ],y,Nt.backCCW,gc(h,ue,r),ge,xe,r.id,fe.vertexBuffer,fe.indexBuffer,fe.segments)}}const oo=[new s.P(0,0),new s.P(s.Z,0),new s.P(s.Z,s.Z),new s.P(0,s.Z)];function na(h,e,r,a,l,p,y,w,A=!1,R=!1){const D=a[a.length-1].overscaledZ,N=h.context,O=N.gl,Z=h.useProgram("raster"),K=h.transform,ne=h.style.projection,ie=h.colorModeForRenderPass(),ae=!h.options.moving;for(const ue of a){const me=h.getDepthModeForSublayer(ue.overscaledZ-D,r.paint.get("raster-opacity")===1?kt.ReadWrite:kt.ReadOnly,O.LESS),fe=e.getTile(ue);fe.registerFadeDuration(r.paint.get("raster-fade-duration"));const ge=e.findLoadedParent(ue,0),xe=e.findLoadedSibling(ue),ye=Bc(fe,ge||xe||null,e,r,h.transform,h.style.map.terrain);let Te,Fe;const Le=r.paint.get("raster-resampling")==="nearest"?O.NEAREST:O.LINEAR;N.activeTexture.set(O.TEXTURE0),fe.texture.bind(Le,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),N.activeTexture.set(O.TEXTURE1),ge?(ge.texture.bind(Le,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),Te=Math.pow(2,ge.tileID.overscaledZ-fe.tileID.overscaledZ),Fe=[fe.tileID.canonical.x*Te%1,fe.tileID.canonical.y*Te%1]):fe.texture.bind(Le,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),fe.texture.useMipmap&&N.extTextureFilterAnisotropic&&h.transform.pitch>20&&O.texParameterf(O.TEXTURE_2D,N.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,N.extTextureFilterAnisotropicMax);const Be=h.style.map.terrain&&h.style.map.terrain.getTerrainData(ue),De=K.getProjectionData({overscaledTileID:ue,aligned:ae,applyGlobeMatrix:!R,applyTerrainMatrix:!0}),Ye=bc(Fe||[0,0],Te||1,ye,r,w),Xe=ne.getMeshFromTileID(N,ue.canonical,p,y,"raster");Z.draw(N,O.TRIANGLES,me,l?l[ue.overscaledZ]:It.disabled,ie,A?Nt.frontCCW:Nt.backCCW,Ye,Be,De,r.id,Xe.vertexBuffer,Xe.indexBuffer,Xe.segments)}}function Bc(h,e,r,a,l,p){const y=a.paint.get("raster-fade-duration");if(!p&&y>0){const w=M.now(),A=(w-h.timeAdded)/y,R=e?(w-e.timeAdded)/y:-1,D=r.getSource(),N=Pe(l,{tileSize:D.tileSize,roundZoom:D.roundZoom}),O=!e||Math.abs(e.tileID.overscaledZ-N)>Math.abs(h.tileID.overscaledZ-N),Z=O&&h.refreshedUponExpiration?1:s.ae(O?A:1-R,0,1);return h.refreshedUponExpiration&&A>=1&&(h.refreshedUponExpiration=!1),e?{opacity:1,mix:1-Z}:{opacity:Z,mix:0}}return{opacity:1,mix:0}}const sa=new s.b7(1,0,0,1),cl=new s.b7(0,1,0,1),Dc=new s.b7(0,0,1,1),Vc=new s.b7(1,0,1,1),oa=new s.b7(0,1,1,1);function aa(h,e,r,a){ao(h,0,e+r/2,h.transform.width,r,a)}function zc(h,e,r,a){ao(h,e-r/2,0,r,h.transform.height,a)}function ao(h,e,r,a,l,p){const y=h.context,w=y.gl;w.enable(w.SCISSOR_TEST),w.scissor(e*h.pixelRatio,r*h.pixelRatio,a*h.pixelRatio,l*h.pixelRatio),y.clear({color:p}),w.disable(w.SCISSOR_TEST)}function Tr(h,e,r){const a=h.context,l=a.gl,p=h.useProgram("debug"),y=kt.disabled,w=It.disabled,A=h.colorModeForRenderPass(),R="$debug",D=h.style.map.terrain&&h.style.map.terrain.getTerrainData(r);a.activeTexture.set(l.TEXTURE0);const N=e.getTileByID(r.key).latestRawTileData,O=Math.floor((N&&N.byteLength||0)/1024),Z=e.getTile(r).tileSize,K=512/Math.min(Z,512)*(r.overscaledZ/h.transform.zoom)*.5;let ne=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(ne+=` => ${r.overscaledZ}`),function(ae,ue){ae.initDebugOverlayCanvas();const me=ae.debugOverlayCanvas,fe=ae.context.gl,ge=ae.debugOverlayCanvas.getContext("2d");ge.clearRect(0,0,me.width,me.height),ge.shadowColor="white",ge.shadowBlur=2,ge.lineWidth=1.5,ge.strokeStyle="white",ge.textBaseline="top",ge.font="bold 36px Open Sans, sans-serif",ge.fillText(ue,5,5),ge.strokeText(ue,5,5),ae.debugOverlayTexture.update(me),ae.debugOverlayTexture.bind(fe.LINEAR,fe.CLAMP_TO_EDGE)}(h,`${ne} ${O}kB`);const ie=h.transform.getProjectionData({overscaledTileID:r,applyGlobeMatrix:!0,applyTerrainMatrix:!0});p.draw(a,l.TRIANGLES,y,w,$t.alphaBlended,Nt.disabled,fc(s.b7.transparent,K),null,ie,R,h.debugBuffer,h.quadTriangleIndexBuffer,h.debugSegments),p.draw(a,l.LINE_STRIP,y,w,A,Nt.disabled,fc(s.b7.red),D,ie,R,h.debugBuffer,h.tileBorderIndexBuffer,h.debugSegments)}function Tn(h,e,r,a){const{isRenderingGlobe:l}=a,p=h.context,y=p.gl,w=h.transform,A=h.colorModeForRenderPass(),R=h.getDepthModeFor3D(),D=h.useProgram("terrain");p.bindFramebuffer.set(null),p.viewport.set([0,0,h.width,h.height]);for(const N of r){const O=e.getTerrainMesh(N.tileID),Z=h.renderToTexture.getTexture(N),K=e.getTerrainData(N.tileID);p.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,Z.texture);const ne=e.getMeshFrameDelta(w.zoom),ie=w.calculateFogMatrix(N.tileID.toUnwrapped()),ae=wh(ne,ie,h.style.sky,w.pitch,l),ue=w.getProjectionData({overscaledTileID:N.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});D.draw(p,y.TRIANGLES,R,It.disabled,A,Nt.backCCW,ae,K,ue,"terrain",O.vertexBuffer,O.indexBuffer,O.segments)}}function Li(h,e){if(!e.mesh){const r=new s.aI;r.emplaceBack(-1,-1),r.emplaceBack(1,-1),r.emplaceBack(1,1),r.emplaceBack(-1,1);const a=new s.aK;a.emplaceBack(0,1,2),a.emplaceBack(0,2,3),e.mesh=new hs(h.createVertexBuffer(r,mi.members),h.createIndexBuffer(a),s.aJ.simpleSegment(0,0,r.length,a.length))}return e.mesh}class ul{constructor(e,r){this.context=new $o(e),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:s.ad(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ke.maxUnderzooming+ke.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new qs}resize(e,r,a){if(this.width=Math.floor(e*a),this.height=Math.floor(r*a),this.pixelRatio=a,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const l of this.style._order)this.style._layers[l].resize()}setup(){const e=this.context,r=new s.aI;r.emplaceBack(0,0),r.emplaceBack(s.Z,0),r.emplaceBack(0,s.Z),r.emplaceBack(s.Z,s.Z),this.tileExtentBuffer=e.createVertexBuffer(r,mi.members),this.tileExtentSegments=s.aJ.simpleSegment(0,0,4,2);const a=new s.aI;a.emplaceBack(0,0),a.emplaceBack(s.Z,0),a.emplaceBack(0,s.Z),a.emplaceBack(s.Z,s.Z),this.debugBuffer=e.createVertexBuffer(a,mi.members),this.debugSegments=s.aJ.simpleSegment(0,0,4,5);const l=new s.b_;l.emplaceBack(0,0,0,0),l.emplaceBack(s.Z,0,s.Z,0),l.emplaceBack(0,s.Z,0,s.Z),l.emplaceBack(s.Z,s.Z,s.Z,s.Z),this.rasterBoundsBuffer=e.createVertexBuffer(l,xh.members),this.rasterBoundsSegments=s.aJ.simpleSegment(0,0,4,2);const p=new s.aI;p.emplaceBack(0,0),p.emplaceBack(s.Z,0),p.emplaceBack(0,s.Z),p.emplaceBack(s.Z,s.Z),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(p,mi.members),this.rasterBoundsSegmentsPosOnly=s.aJ.simpleSegment(0,0,4,5);const y=new s.aI;y.emplaceBack(0,0),y.emplaceBack(1,0),y.emplaceBack(0,1),y.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(y,mi.members),this.viewportSegments=s.aJ.simpleSegment(0,0,4,2);const w=new s.b$;w.emplaceBack(0),w.emplaceBack(1),w.emplaceBack(3),w.emplaceBack(2),w.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(w);const A=new s.aK;A.emplaceBack(1,0,2),A.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(A);const R=this.context.gl;this.stencilClearMode=new It({func:R.ALWAYS,mask:0},0,255,R.ZERO,R.ZERO,R.ZERO),this.tileExtentMesh=new hs(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const a=s.K();s.bQ(a,0,this.width,this.height,0,0,1),s.M(a,a,[r.drawingBufferWidth,r.drawingBufferHeight,0]);const l={mainMatrix:a,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:a};this.useProgram("clippingMask",null,!0).draw(e,r.TRIANGLES,kt.disabled,this.stencilClearMode,$t.disabled,Nt.disabled,null,null,l,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,r,a){if(this.currentStencilSource===e.source||!e.isTileClipped()||!r||!r.length)return;this.currentStencilSource=e.source,this.nextStencilID+r.length>256&&this.clearStencil();const l=this.context;l.setColorMode($t.disabled),l.setDepthMode(kt.disabled);const p={};for(const y of r)p[y.key]=this.nextStencilID++;this._renderTileMasks(p,r,a,!0),this._renderTileMasks(p,r,a,!1),this._tileClippingMaskIDs=p}_renderTileMasks(e,r,a,l){const p=this.context,y=p.gl,w=this.style.projection,A=this.transform,R=this.useProgram("clippingMask");for(const D of r){const N=e[D.key],O=this.style.map.terrain&&this.style.map.terrain.getTerrainData(D),Z=w.getMeshFromTileID(this.context,D.canonical,l,!0,"stencil"),K=A.getProjectionData({overscaledTileID:D,applyGlobeMatrix:!a,applyTerrainMatrix:!0});R.draw(p,y.TRIANGLES,kt.disabled,new It({func:y.ALWAYS,mask:0},N,255,y.KEEP,y.KEEP,y.REPLACE),$t.disabled,a?Nt.disabled:Nt.backCCW,null,O,K,"$clipping",Z.vertexBuffer,Z.indexBuffer,Z.segments)}}_renderTilesDepthBuffer(){const e=this.context,r=e.gl,a=this.style.projection,l=this.transform,p=this.useProgram("depth"),y=this.getDepthModeFor3D(),w=be(l,{tileSize:l.tileSize});for(const A of w){const R=this.style.map.terrain&&this.style.map.terrain.getTerrainData(A),D=a.getMeshFromTileID(this.context,A.canonical,!0,!0,"raster"),N=l.getProjectionData({overscaledTileID:A,applyGlobeMatrix:!0,applyTerrainMatrix:!0});p.draw(e,r.TRIANGLES,y,It.disabled,$t.disabled,Nt.backCCW,null,R,N,"$clipping",D.vertexBuffer,D.indexBuffer,D.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,r=this.context.gl;return new It({func:r.NOTEQUAL,mask:255},e,255,r.KEEP,r.KEEP,r.REPLACE)}stencilModeForClipping(e){const r=this.context.gl;return new It({func:r.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,r.KEEP,r.KEEP,r.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){const r=this.context.gl,a=e.sort((y,w)=>w.overscaledZ-y.overscaledZ),l=a[a.length-1].overscaledZ,p=a[0].overscaledZ-l+1;if(p>1){this.currentStencilSource=void 0,this.nextStencilID+p>256&&this.clearStencil();const y={};for(let w=0;w<p;w++)y[w+l]=new It({func:r.GEQUAL,mask:255},w+this.nextStencilID,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID+=p,[y,a]}return[{[l]:It.disabled},a]}stencilConfigForOverlapTwoPass(e){const r=this.context.gl,a=e.sort((y,w)=>w.overscaledZ-y.overscaledZ),l=a[a.length-1].overscaledZ,p=a[0].overscaledZ-l+1;if(this.clearStencil(),p>1){const y={},w={};for(let A=0;A<p;A++)y[A+l]=new It({func:r.GREATER,mask:255},p+1+A,255,r.KEEP,r.KEEP,r.REPLACE),w[A+l]=new It({func:r.GREATER,mask:255},1+A,255,r.KEEP,r.KEEP,r.REPLACE);return this.nextStencilID=2*p+1,[y,w,a]}return this.nextStencilID=3,[{[l]:new It({func:r.GREATER,mask:255},2,255,r.KEEP,r.KEEP,r.REPLACE)},{[l]:new It({func:r.GREATER,mask:255},1,255,r.KEEP,r.KEEP,r.REPLACE)},a]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new $t([e.CONSTANT_COLOR,e.ONE],new s.b7(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?$t.unblended:$t.alphaBlended}getDepthModeForSublayer(e,r,a){if(!this.opaquePassEnabledForLayer())return kt.disabled;const l=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new kt(a||this.context.gl.LEQUAL,r,[l,l])}getDepthModeFor3D(){return new kt(this.context.gl.LEQUAL,kt.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,r){var a,l;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(M.now()),this.imageManager.beginFrame();const p=this.style._order,y=this.style.sourceCaches,w={},A={},R={},D={isRenderingToTexture:!1,isRenderingGlobe:((a=e.projection)===null||a===void 0?void 0:a.transitionState)>0};for(const O in y){const Z=y[O];Z.used&&Z.prepare(this.context),w[O]=Z.getVisibleCoordinates(!1),A[O]=w[O].slice().reverse(),R[O]=Z.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let O=0;O<p.length;O++)if(this.style._layers[p[O]].is3D()){this.opaquePassCutoff=O;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const O of p){const Z=this.style._layers[O];if(!Z.hasOffscreenPass()||Z.isHidden(this.transform.zoom))continue;const K=A[Z.source];(Z.type==="custom"||K.length)&&this.renderLayer(this,y[Z.source],Z,K,D)}if((l=this.style.projection)===null||l===void 0||l.updateGPUdependent({context:this.context,useProgram:O=>this.useProgram(O)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?s.b7.black:s.b7.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(O,Z){const K=O.context,ne=K.gl,ie=((xe,ye,Te)=>{const Fe=Math.cos(ye.rollInRadians),Le=Math.sin(ye.rollInRadians),Be=we(ye),De=ye.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:xe.properties.get("sky-color"),u_horizon_color:xe.properties.get("horizon-color"),u_horizon:[(ye.width/2-Be*Le)*Te,(ye.height/2+Be*Fe)*Te],u_horizon_normal:[-Le,Fe],u_sky_horizon_blend:xe.properties.get("sky-horizon-blend")*ye.height/2*Te,u_sky_blend:De}})(Z,O.style.map.transform,O.pixelRatio),ae=new kt(ne.LEQUAL,kt.ReadWrite,[0,1]),ue=It.disabled,me=O.colorModeForRenderPass(),fe=O.useProgram("sky"),ge=Li(K,Z);fe.draw(K,ne.TRIANGLES,ae,ue,me,Nt.disabled,ie,null,void 0,"sky",ge.vertexBuffer,ge.indexBuffer,ge.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=p.length-1;this.currentLayer>=0;this.currentLayer--){const O=this.style._layers[p[this.currentLayer]],Z=y[O.source],K=w[O.source];this._renderTileClippingMasks(O,K,!1),this.renderLayer(this,Z,O,K,D)}this.renderPass="translucent";let N=!1;for(this.currentLayer=0;this.currentLayer<p.length;this.currentLayer++){const O=this.style._layers[p[this.currentLayer]],Z=y[O.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(O,D))continue;this.opaquePassEnabledForLayer()||N||(N=!0,D.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const K=(O.type==="symbol"?R:A)[O.source];this._renderTileClippingMasks(O,w[O.source],!!this.renderToTexture),this.renderLayer(this,Z,O,K,D)}if(D.isRenderingGlobe&&function(O,Z,K){const ne=O.context,ie=ne.gl,ae=O.useProgram("atmosphere"),ue=new kt(ie.LEQUAL,kt.ReadOnly,[0,1]),me=O.transform,fe=function(De,Ye){const Xe=De.properties.get("position"),He=[-Xe.x,-Xe.y,-Xe.z],at=s.ad(new Float64Array(16));return De.properties.get("anchor")==="map"&&(s.a_(at,at,Ye.rollInRadians),s.a$(at,at,-Ye.pitchInRadians),s.a_(at,at,Ye.bearingInRadians),s.a$(at,at,Ye.center.lat*Math.PI/180),s.bp(at,at,-Ye.center.lng*Math.PI/180)),s.bZ(He,He,at),He}(K,O.transform),ge=me.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),xe=Z.properties.get("atmosphere-blend")*ge.projectionTransition;if(xe===0)return;const ye=Hn(me.worldSize,me.center.lat),Te=me.inverseProjectionMatrix,Fe=new Float64Array(4);Fe[3]=1,s.at(Fe,Fe,me.modelViewProjectionMatrix),Fe[0]/=Fe[3],Fe[1]/=Fe[3],Fe[2]/=Fe[3],Fe[3]=1,s.at(Fe,Fe,Te),Fe[0]/=Fe[3],Fe[1]/=Fe[3],Fe[2]/=Fe[3],Fe[3]=1;const Le=((De,Ye,Xe,He,at)=>({u_sun_pos:De,u_atmosphere_blend:Ye,u_globe_position:Xe,u_globe_radius:He,u_inv_proj_matrix:at}))(fe,xe,[Fe[0],Fe[1],Fe[2]],ye,Te),Be=Li(ne,Z);ae.draw(ne,ie.TRIANGLES,ue,It.disabled,$t.alphaBlended,Nt.disabled,Le,null,null,"atmosphere",Be.vertexBuffer,Be.indexBuffer,Be.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const O=function(Z,K){let ne=null;const ie=Object.values(Z._layers).flatMap(fe=>fe.source&&!fe.isHidden(K)?[Z.sourceCaches[fe.source]]:[]),ae=ie.filter(fe=>fe.getSource().type==="vector"),ue=ie.filter(fe=>fe.getSource().type!=="vector"),me=fe=>{(!ne||ne.getSource().maxzoom<fe.getSource().maxzoom)&&(ne=fe)};return ae.forEach(fe=>me(fe)),ne||ue.forEach(fe=>me(fe)),ne}(this.style,this.transform.zoom);O&&function(Z,K,ne){for(let ie=0;ie<ne.length;ie++)Tr(Z,K,ne[ie])}(this,O,O.getVisibleCoordinates())}this.options.showPadding&&function(O){const Z=O.transform.padding;aa(O,O.transform.height-(Z.top||0),3,sa),aa(O,Z.bottom||0,3,cl),zc(O,Z.left||0,3,Dc),zc(O,O.transform.width-(Z.right||0),3,Vc);const K=O.transform.centerPoint;(function(ne,ie,ae,ue){ao(ne,ie-1,ae-10,2,20,ue),ao(ne,ie-10,ae-1,20,2,ue)})(O,K.x,O.transform.height-K.y,oa)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const r=this.terrainFacilitator.matrix,a=this.transform.modelViewProjectionMatrix;let l=this.terrainFacilitator.dirty;l||(l=e?!s.c0(r,a):!s.c1(r,a)),l||(l=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),l&&(s.c2(r,a),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(p,y){const w=p.context,A=w.gl,R=p.transform,D=$t.unblended,N=new kt(A.LEQUAL,kt.ReadWrite,[0,1]),O=y.sourceCache.getRenderableTiles(),Z=p.useProgram("terrainDepth");w.bindFramebuffer.set(y.getFramebuffer("depth").framebuffer),w.viewport.set([0,0,p.width/devicePixelRatio,p.height/devicePixelRatio]),w.clear({color:s.b7.transparent,depth:1});for(const K of O){const ne=y.getTerrainMesh(K.tileID),ie=y.getTerrainData(K.tileID),ae=R.getProjectionData({overscaledTileID:K.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),ue={u_ele_delta:y.getMeshFrameDelta(R.zoom)};Z.draw(w,A.TRIANGLES,N,It.disabled,D,Nt.backCCW,ue,ie,ae,"terrain",ne.vertexBuffer,ne.indexBuffer,ne.segments)}w.bindFramebuffer.set(null),w.viewport.set([0,0,p.width,p.height])}(this,this.style.map.terrain),function(p,y){const w=p.context,A=w.gl,R=p.transform,D=$t.unblended,N=new kt(A.LEQUAL,kt.ReadWrite,[0,1]),O=y.getCoordsTexture(),Z=y.sourceCache.getRenderableTiles(),K=p.useProgram("terrainCoords");w.bindFramebuffer.set(y.getFramebuffer("coords").framebuffer),w.viewport.set([0,0,p.width/devicePixelRatio,p.height/devicePixelRatio]),w.clear({color:s.b7.transparent,depth:1}),y.coordsIndex=[];for(const ne of Z){const ie=y.getTerrainMesh(ne.tileID),ae=y.getTerrainData(ne.tileID);w.activeTexture.set(A.TEXTURE0),A.bindTexture(A.TEXTURE_2D,O.texture);const ue={u_terrain_coords_id:(255-y.coordsIndex.length)/255,u_texture:0,u_ele_delta:y.getMeshFrameDelta(R.zoom)},me=R.getProjectionData({overscaledTileID:ne.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});K.draw(w,A.TRIANGLES,N,It.disabled,D,Nt.backCCW,ue,ae,me,"terrain",ie.vertexBuffer,ie.indexBuffer,ie.segments),y.coordsIndex.push(ne.tileID.key)}w.bindFramebuffer.set(null),w.viewport.set([0,0,p.width,p.height])}(this,this.style.map.terrain))}renderLayer(e,r,a,l,p){a.isHidden(this.transform.zoom)||(a.type==="background"||a.type==="custom"||(l||[]).length)&&(this.id=a.id,s.c3(a)?function(y,w,A,R,D,N){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:O}=N,Z=It.disabled,K=y.colorModeForRenderPass();(A._unevaluatedLayout.hasValue("text-variable-anchor")||A._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(ne,ie,ae,ue,me,fe,ge,xe,ye){const Te=ie.transform,Fe=ie.style.map.terrain,Le=me==="map",Be=fe==="map";for(const De of ne){const Ye=ue.getTile(De),Xe=Ye.getBucket(ae);if(!Xe||!Xe.text||!Xe.text.segments.get().length)continue;const He=s.ak(Xe.textSizeData,Te.zoom),at=s.az(Ye,1,ie.transform.zoom),Mt=ft(Le,ie.transform,at),qt=ae.layout.get("icon-text-fit")!=="none"&&Xe.hasIconData();if(He){const mr=Math.pow(2,Te.zoom-Ye.tileID.overscaledZ),tr=Fe?(gr,yr)=>Fe.getElevation(De,gr,yr):null;Rc(Xe,Le,Be,ye,Te,Mt,mr,He,qt,s.aA(Te,Ye,ge,xe),De.toUnwrapped(),tr)}}}(R,y,A,w,A.layout.get("text-rotation-alignment"),A.layout.get("text-pitch-alignment"),A.paint.get("text-translate"),A.paint.get("text-translate-anchor"),D),A.paint.get("icon-opacity").constantOr(1)!==0&&ta(y,w,A,R,!1,A.paint.get("icon-translate"),A.paint.get("icon-translate-anchor"),A.layout.get("icon-rotation-alignment"),A.layout.get("icon-pitch-alignment"),A.layout.get("icon-keep-upright"),Z,K,O),A.paint.get("text-opacity").constantOr(1)!==0&&ta(y,w,A,R,!0,A.paint.get("text-translate"),A.paint.get("text-translate-anchor"),A.layout.get("text-rotation-alignment"),A.layout.get("text-pitch-alignment"),A.layout.get("text-keep-upright"),Z,K,O),w.map.showCollisionBoxes&&(sl(y,w,A,R,!0),sl(y,w,A,R,!1))}(e,r,a,l,this.style.placement.variableOffsets,p):s.c4(a)?function(y,w,A,R,D){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:N}=D,O=A.paint.get("circle-opacity"),Z=A.paint.get("circle-stroke-width"),K=A.paint.get("circle-stroke-opacity"),ne=!A.layout.get("circle-sort-key").isConstant();if(O.constantOr(1)===0&&(Z.constantOr(1)===0||K.constantOr(1)===0))return;const ie=y.context,ae=ie.gl,ue=y.transform,me=y.getDepthModeForSublayer(0,kt.ReadOnly),fe=It.disabled,ge=y.colorModeForRenderPass(),xe=[],ye=ue.getCircleRadiusCorrection();for(let Te=0;Te<R.length;Te++){const Fe=R[Te],Le=w.getTile(Fe),Be=Le.getBucket(A);if(!Be)continue;const De=A.paint.get("circle-translate"),Ye=A.paint.get("circle-translate-anchor"),Xe=s.aA(ue,Le,De,Ye),He=Be.programConfigurations.get(A.id),at=y.useProgram("circle",He),Mt=Be.layoutVertexBuffer,qt=Be.indexBuffer,mr=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Fe),tr={programConfiguration:He,program:at,layoutVertexBuffer:Mt,indexBuffer:qt,uniformValues:Ys(y,Le,A,Xe,ye),terrainData:mr,projectionData:ue.getProjectionData({overscaledTileID:Fe,applyGlobeMatrix:!N,applyTerrainMatrix:!0})};if(ne){const gr=Be.segments.get();for(const yr of gr)xe.push({segments:new s.aJ([yr]),sortKey:yr.sortKey,state:tr})}else xe.push({segments:Be.segments,sortKey:0,state:tr})}ne&&xe.sort((Te,Fe)=>Te.sortKey-Fe.sortKey);for(const Te of xe){const{programConfiguration:Fe,program:Le,layoutVertexBuffer:Be,indexBuffer:De,uniformValues:Ye,terrainData:Xe,projectionData:He}=Te.state;Le.draw(ie,ae.TRIANGLES,me,fe,ge,Nt.backCCW,Ye,Xe,He,A.id,Be,De,Te.segments,A.paint,y.transform.zoom,Fe)}}(e,r,a,l,p):s.c5(a)?function(y,w,A,R,D){if(A.paint.get("heatmap-opacity")===0)return;const N=y.context,{isRenderingToTexture:O,isRenderingGlobe:Z}=D;if(y.style.map.terrain){for(const K of R){const ne=w.getTile(K);w.hasRenderableParent(K)||(y.renderPass==="offscreen"?ra(y,ne,A,K,Z):y.renderPass==="translucent"&&ol(y,A,K,O,Z))}N.viewport.set([0,0,y.width,y.height])}else y.renderPass==="offscreen"?function(K,ne,ie,ae){const ue=K.context,me=ue.gl,fe=K.transform,ge=It.disabled,xe=new $t([me.ONE,me.ONE],s.b7.transparent,[!0,!0,!0,!0]);(function(ye,Te,Fe){const Le=ye.gl;ye.activeTexture.set(Le.TEXTURE1),ye.viewport.set([0,0,Te.width/4,Te.height/4]);let Be=Fe.heatmapFbos.get(s.bW);Be?(Le.bindTexture(Le.TEXTURE_2D,Be.colorAttachment.get()),ye.bindFramebuffer.set(Be.framebuffer)):(Be=ia(ye,Te.width/4,Te.height/4),Fe.heatmapFbos.set(s.bW,Be))})(ue,K,ie),ue.clear({color:s.b7.transparent});for(let ye=0;ye<ae.length;ye++){const Te=ae[ye];if(ne.hasRenderableParent(Te))continue;const Fe=ne.getTile(Te),Le=Fe.getBucket(ie);if(!Le)continue;const Be=Le.programConfigurations.get(ie.id),De=K.useProgram("heatmap",Be),Ye=fe.getProjectionData({overscaledTileID:Te,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Xe=fe.getCircleRadiusCorrection();De.draw(ue,me.TRIANGLES,kt.disabled,ge,xe,Nt.backCCW,Gn(Fe,fe.zoom,ie.paint.get("heatmap-intensity"),Xe),null,Ye,ie.id,Le.layoutVertexBuffer,Le.indexBuffer,Le.segments,ie.paint,fe.zoom,Be)}ue.viewport.set([0,0,K.width,K.height])}(y,w,A,R):y.renderPass==="translucent"&&function(K,ne){const ie=K.context,ae=ie.gl;ie.setColorMode(K.colorModeForRenderPass());const ue=ne.heatmapFbos.get(s.bW);ue&&(ie.activeTexture.set(ae.TEXTURE0),ae.bindTexture(ae.TEXTURE_2D,ue.colorAttachment.get()),ie.activeTexture.set(ae.TEXTURE1),al(ie,ne).bind(ae.LINEAR,ae.CLAMP_TO_EDGE),K.useProgram("heatmapTexture").draw(ie,ae.TRIANGLES,kt.disabled,It.disabled,K.colorModeForRenderPass(),Nt.disabled,mc(K,ne,0,1),null,null,ne.id,K.viewportBuffer,K.quadTriangleIndexBuffer,K.viewportSegments,ne.paint,K.transform.zoom))}(y,A)}(e,r,a,l,p):s.c6(a)?function(y,w,A,R,D){if(y.renderPass!=="translucent")return;const{isRenderingToTexture:N}=D,O=A.paint.get("line-opacity"),Z=A.paint.get("line-width");if(O.constantOr(1)===0||Z.constantOr(1)===0)return;const K=y.getDepthModeForSublayer(0,kt.ReadOnly),ne=y.colorModeForRenderPass(),ie=A.paint.get("line-dasharray"),ae=A.paint.get("line-pattern"),ue=ae.constantOr(1),me=A.paint.get("line-gradient"),fe=A.getCrossfadeParameters(),ge=ue?"linePattern":ie?"lineSDF":me?"lineGradient":"line",xe=y.context,ye=xe.gl,Te=y.transform;let Fe=!0;for(const Le of R){const Be=w.getTile(Le);if(ue&&!Be.patternsLoaded())continue;const De=Be.getBucket(A);if(!De)continue;const Ye=De.programConfigurations.get(A.id),Xe=y.context.program.get(),He=y.useProgram(ge,Ye),at=Fe||He.program!==Xe,Mt=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Le),qt=ae.constantOr(null);if(qt&&Be.imageAtlas){const sr=Be.imageAtlas,Ht=sr.patternPositions[qt.to.toString()],jr=sr.patternPositions[qt.from.toString()];Ht&&jr&&Ye.setConstantPatternPositions(Ht,jr)}const mr=Te.getProjectionData({overscaledTileID:Le,applyGlobeMatrix:!N,applyTerrainMatrix:!0}),tr=Te.getPixelScale(),gr=ue?vc(y,Be,A,tr,fe):ie?xc(y,Be,A,tr,ie,fe):me?_c(y,Be,A,tr,De.lineClipsArray.length):$s(y,Be,A,tr);if(ue)xe.activeTexture.set(ye.TEXTURE0),Be.imageAtlasTexture.bind(ye.LINEAR,ye.CLAMP_TO_EDGE),Ye.updatePaintBuffers(fe);else if(ie&&(at||y.lineAtlas.dirty))xe.activeTexture.set(ye.TEXTURE0),y.lineAtlas.bind(xe);else if(me){const sr=De.gradients[A.id];let Ht=sr.texture;if(A.gradientVersion!==sr.version){let jr=256;if(A.stepInterpolant){const Xr=w.getSource().maxzoom,ii=Le.canonical.z===Xr?Math.ceil(1<<y.transform.maxZoom-Le.canonical.z):1;jr=s.ae(s.bX(De.maxLineLength/s.Z*1024*ii),256,xe.maxTextureSize)}sr.gradient=s.bY({expression:A.gradientExpression(),evaluationKey:"lineProgress",resolution:jr,image:sr.gradient||void 0,clips:De.lineClipsArray}),sr.texture?sr.texture.update(sr.gradient):sr.texture=new Ze(xe,sr.gradient,ye.RGBA),sr.version=A.gradientVersion,Ht=sr.texture}xe.activeTexture.set(ye.TEXTURE0),Ht.bind(A.stepInterpolant?ye.NEAREST:ye.LINEAR,ye.CLAMP_TO_EDGE)}const yr=y.stencilModeForClipping(Le);He.draw(xe,ye.TRIANGLES,K,yr,ne,Nt.disabled,gr,Mt,mr,A.id,De.layoutVertexBuffer,De.indexBuffer,De.segments,A.paint,y.transform.zoom,Ye,De.layoutVertexBuffer2),Fe=!1}}(e,r,a,l,p):s.c7(a)?function(y,w,A,R,D){const N=A.paint.get("fill-color"),O=A.paint.get("fill-opacity");if(O.constantOr(1)===0)return;const{isRenderingToTexture:Z}=D,K=y.colorModeForRenderPass(),ne=A.paint.get("fill-pattern"),ie=y.opaquePassEnabledForLayer()&&!ne.constantOr(1)&&N.constantOr(s.b7.transparent).a===1&&O.constantOr(0)===1?"opaque":"translucent";if(y.renderPass===ie){const ae=y.getDepthModeForSublayer(1,y.renderPass==="opaque"?kt.ReadWrite:kt.ReadOnly);no(y,w,A,R,ae,K,!1,Z)}if(y.renderPass==="translucent"&&A.paint.get("fill-antialias")){const ae=y.getDepthModeForSublayer(A.getPaintProperty("fill-outline-color")?2:0,kt.ReadOnly);no(y,w,A,R,ae,K,!0,Z)}}(e,r,a,l,p):s.c8(a)?function(y,w,A,R,D){const N=A.paint.get("fill-extrusion-opacity");if(N===0)return;const{isRenderingToTexture:O}=D;if(y.renderPass==="translucent"){const Z=new kt(y.context.gl.LEQUAL,kt.ReadWrite,y.depthRangeFor3D);if(N!==1||A.paint.get("fill-extrusion-pattern").constantOr(1))so(y,w,A,R,Z,It.disabled,$t.disabled,O),so(y,w,A,R,Z,y.stencilModeFor3D(),y.colorModeForRenderPass(),O);else{const K=y.colorModeForRenderPass();so(y,w,A,R,Z,It.disabled,K,O)}}}(e,r,a,l,p):s.c9(a)?function(y,w,A,R,D){if(y.renderPass!=="offscreen"&&y.renderPass!=="translucent")return;const{isRenderingToTexture:N}=D,O=y.context,Z=y.style.projection.useSubdivision,K=y.getDepthModeForSublayer(0,kt.ReadOnly),ne=y.colorModeForRenderPass();if(y.renderPass==="offscreen")(function(ie,ae,ue,me,fe,ge,xe){const ye=ie.context,Te=ye.gl;for(const Fe of ue){const Le=ae.getTile(Fe),Be=Le.dem;if(!Be||!Be.data||!Le.needsHillshadePrepare)continue;const De=Be.dim,Ye=Be.stride,Xe=Be.getPixels();if(ye.activeTexture.set(Te.TEXTURE1),ye.pixelStoreUnpackPremultiplyAlpha.set(!1),Le.demTexture=Le.demTexture||ie.getTileTexture(Ye),Le.demTexture){const at=Le.demTexture;at.update(Xe,{premultiply:!1}),at.bind(Te.NEAREST,Te.CLAMP_TO_EDGE)}else Le.demTexture=new Ze(ye,Xe,Te.RGBA,{premultiply:!1}),Le.demTexture.bind(Te.NEAREST,Te.CLAMP_TO_EDGE);ye.activeTexture.set(Te.TEXTURE0);let He=Le.fbo;if(!He){const at=new Ze(ye,{width:De,height:De,data:null},Te.RGBA);at.bind(Te.LINEAR,Te.CLAMP_TO_EDGE),He=Le.fbo=ye.createFramebuffer(De,De,!0,!1),He.colorAttachment.set(at.texture)}ye.bindFramebuffer.set(He.framebuffer),ye.viewport.set([0,0,De,De]),ie.useProgram("hillshadePrepare").draw(ye,Te.TRIANGLES,fe,ge,xe,Nt.disabled,Ah(Le.tileID,Be),null,null,me.id,ie.rasterBoundsBuffer,ie.quadTriangleIndexBuffer,ie.rasterBoundsSegments),Le.needsHillshadePrepare=!1}})(y,w,R,A,K,It.disabled,ne),O.viewport.set([0,0,y.width,y.height]);else if(y.renderPass==="translucent")if(Z){const[ie,ae,ue]=y.stencilConfigForOverlapTwoPass(R);ll(y,w,A,ue,ie,K,ne,!1,N),ll(y,w,A,ue,ae,K,ne,!0,N)}else{const[ie,ae]=y.getStencilConfigForOverlapAndUpdateStencilID(R);ll(y,w,A,ae,ie,K,ne,!1,N)}}(e,r,a,l,p):s.ca(a)?function(y,w,A,R,D){if(y.renderPass!=="translucent"||A.paint.get("raster-opacity")===0||!R.length)return;const{isRenderingToTexture:N}=D,O=w.getSource(),Z=y.style.projection.useSubdivision;if(O instanceof Rr)na(y,w,A,R,null,!1,!1,O.tileCoords,O.flippedWindingOrder,N);else if(Z){const[K,ne,ie]=y.stencilConfigForOverlapTwoPass(R);na(y,w,A,ie,K,!1,!0,oo,!1,N),na(y,w,A,ie,ne,!0,!0,oo,!1,N)}else{const[K,ne]=y.getStencilConfigForOverlapAndUpdateStencilID(R);na(y,w,A,ne,K,!1,!0,oo,!1,N)}}(e,r,a,l,p):s.cb(a)?function(y,w,A,R,D){const N=A.paint.get("background-color"),O=A.paint.get("background-opacity");if(O===0)return;const{isRenderingToTexture:Z}=D,K=y.context,ne=K.gl,ie=y.style.projection,ae=y.transform,ue=ae.tileSize,me=A.paint.get("background-pattern");if(y.isPatternMissing(me))return;const fe=!me&&N.a===1&&O===1&&y.opaquePassEnabledForLayer()?"opaque":"translucent";if(y.renderPass!==fe)return;const ge=It.disabled,xe=y.getDepthModeForSublayer(0,fe==="opaque"?kt.ReadWrite:kt.ReadOnly),ye=y.colorModeForRenderPass(),Te=y.useProgram(me?"backgroundPattern":"background"),Fe=R||be(ae,{tileSize:ue,terrain:y.style.map.terrain});me&&(K.activeTexture.set(ne.TEXTURE0),y.imageManager.bind(y.context));const Le=A.getCrossfadeParameters();for(const Be of Fe){const De=ae.getProjectionData({overscaledTileID:Be,applyGlobeMatrix:!Z,applyTerrainMatrix:!0}),Ye=me?Ch(O,y,me,{tileID:Be,tileSize:ue},Le):kh(O,N),Xe=y.style.map.terrain&&y.style.map.terrain.getTerrainData(Be),He=ie.getMeshFromTileID(K,Be.canonical,!1,!0,"raster");Te.draw(K,ne.TRIANGLES,xe,ge,ye,Nt.backCCW,Ye,Xe,De,A.id,He.vertexBuffer,He.indexBuffer,He.segments)}}(e,0,a,l,p):s.cc(a)&&function(y,w,A,R){const{isRenderingGlobe:D}=R,N=y.context,O=A.implementation,Z=y.style.projection,K=y.transform,ne=K.getProjectionDataForCustomLayer(D),ie={farZ:K.farZ,nearZ:K.nearZ,fov:K.fov*Math.PI/180,modelViewProjectionMatrix:K.modelViewProjectionMatrix,projectionMatrix:K.projectionMatrix,shaderData:{variantName:Z.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
|
|
800
800
|
uniform mat4 u_projection_matrix;
|
|
801
|
-
${Z.shaderPreludeCode.vertexSource}`,define:Z.shaderDefine},defaultProjectionData:ne},ae=O.renderingMode?O.renderingMode:"2d";if(y.renderPass==="offscreen"){const ue=O.prerender;ue&&(y.setCustomLayerDefaults(),N.setColorMode(y.colorModeForRenderPass()),ue.call(O,N.gl,ie),N.setDirty(),y.setBaseState())}else if(y.renderPass==="translucent"){y.setCustomLayerDefaults(),N.setColorMode(y.colorModeForRenderPass()),N.setStencilMode(It.disabled);const ue=ae==="3d"?y.getDepthModeFor3D():y.getDepthModeForSublayer(0,kt.ReadOnly);N.setDepthMode(ue),O.render(N.gl,ie),N.setDirty(),y.setBaseState(),N.bindFramebuffer.set(null)}}(e,0,a,p))}saveTileTexture(e){const r=this._tileTextures[e.size[0]];r?r.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const r=this._tileTextures[e];return r&&r.length>0?r.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const r=this.imageManager.getPattern(e.from.toString()),a=this.imageManager.getPattern(e.to.toString());return!r||!a}useProgram(e,r,a=!1,l=[]){this.cache=this.cache||{};const p=!!this.style.map.terrain,y=this.style.projection,w=a?fi.projectionMercator:y.shaderPreludeCode,A=a?jn:y.shaderDefine,R=e+(r?r.cacheKey:"")+`/${a?Ot:y.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(p?"/terrain":"")+(l?`/${l.join("/")}`:"");return this.cache[R]||(this.cache[R]=new Oo(this.context,fi[e],r,Ac[e],this._showOverdrawInspector,p,w,A,l)),this.cache[R]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ze(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:r}=this.context.gl;return this.width!==e||this.height!==r}}function lo(h,e){let r,a=!1,l=null,p=null;const y=()=>{l=null,a&&(h.apply(p,r),l=setTimeout(y,e),a=!1)};return(...w)=>(a=!0,p=this,r=w,l||y(),l)}class hl{constructor(e){this._getCurrentHash=()=>{const r=window.location.hash.replace("#","");if(this._hashName){let a;return r.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(a=l)}),(a&&a[1]||"").split("/")}return r.split("/")},this._onHashChange=()=>{const r=this._getCurrentHash();if(!this._isValidHash(r))return!1;const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(r[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:a,pitch:+(r[4]||0)}),!0},this._updateHashUnthrottled=()=>{const r=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,r)},this._removeHash=()=>{const r=this._getCurrentHash();if(r.length===0)return;const a=r.join("/");let l=a;l.split("&").length>0&&(l=l.split("&")[0]),this._hashName&&(l=`${this._hashName}=${a}`);let p=window.location.hash.replace(l,"");p.startsWith("#&")?p=p.slice(0,1)+p.slice(2):p==="#"&&(p="");let y=window.location.href.replace(/(#.+)?$/,p);y=y.replace("&&","&"),window.history.replaceState(window.history.state,null,y)},this._updateHash=lo(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const r=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,l=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,l),y=Math.round(r.lng*p)/p,w=Math.round(r.lat*p)/p,A=this._map.getBearing(),R=this._map.getPitch();let D="";if(D+=e?`/${y}/${w}/${a}`:`${a}/${w}/${y}`,(A||R)&&(D+="/"+Math.round(10*A)/10),R&&(D+=`/${Math.round(R)}`),this._hashName){const N=this._hashName;let O=!1;const Z=window.location.hash.slice(1).split("&").map(K=>{const ne=K.split("=")[0];return ne===N?(O=!0,`${ne}=${D}`):K}).filter(K=>K);return O||Z.push(`${N}=${D}`),`#${Z.join("&")}`}return`#${D}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new s.Q(+e[2],+e[1])}catch{return!1}const r=+e[0],a=+(e[3]||0),l=+(e[4]||0);return r>=this._map.getMinZoom()&&r<=this._map.getMaxZoom()&&a>=-180&&a<=180&&l>=this._map.getMinPitch()&&l<=this._map.getMaxPitch()}}const an={linearity:.3,easing:s.cd(0,0,.3,1)},pl=s.e({deceleration:2500,maxSpeed:1400},an),co=s.e({deceleration:20,maxSpeed:1400},an),dl=s.e({deceleration:1e3,maxSpeed:360},an),Fc=s.e({deceleration:1e3,maxSpeed:90},an),Oc=s.e({deceleration:1e3,maxSpeed:360},an);class Nc{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:M.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,r=M.now();for(;e.length>0&&r-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,roll:0,pan:new s.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:p}of this._inertiaBuffer)r.zoom+=p.zoomDelta||0,r.bearing+=p.bearingDelta||0,r.pitch+=p.pitchDelta||0,r.roll+=p.rollDelta||0,p.panDelta&&r.pan._add(p.panDelta),p.around&&(r.around=p.around),p.pinchAround&&(r.pinchAround=p.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(r.pan.mag()){const p=ws(r.pan.mag(),a,s.e({},pl,e||{})),y=r.pan.mult(p.amount/r.pan.mag()),w=this._map.cameraHelper.handlePanInertia(y,this._map.transform);l.center=w.easingCenter,l.offset=w.easingOffset,bs(l,p)}if(r.zoom){const p=ws(r.zoom,a,co);l.zoom=this._map.transform.zoom+p.amount,bs(l,p)}if(r.bearing){const p=ws(r.bearing,a,dl);l.bearing=this._map.transform.bearing+s.ae(p.amount,-179,179),bs(l,p)}if(r.pitch){const p=ws(r.pitch,a,Fc);l.pitch=this._map.transform.pitch+p.amount,bs(l,p)}if(r.roll){const p=ws(r.roll,a,Oc);l.roll=this._map.transform.roll+s.ae(p.amount,-179,179),bs(l,p)}if(l.zoom||l.bearing){const p=r.pinchAround===void 0?r.around:r.pinchAround;l.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),s.e(l,{noMoveStart:!0})}}function bs(h,e){(!h.duration||h.duration<e.duration)&&(h.duration=e.duration,h.easing=e.easing)}function ws(h,e,r){const{maxSpeed:a,linearity:l,deceleration:p}=r,y=s.ae(h*l/(e/1e3),-a,a),w=Math.abs(y)/(p*l);return{easing:r.easing,duration:1e3*w,amount:y*(w/2)}}class Ur extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a,l={}){a=a instanceof MouseEvent?a:new MouseEvent(e,a);const p=E.mousePos(r.getCanvas(),a),y=r.unproject(p);super(e,s.e({point:p,lngLat:y,originalEvent:a},l)),this._defaultPrevented=!1,this.target=r}}class Ss extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a){const l=e==="touchend"?a.changedTouches:a.touches,p=E.touchPos(r.getCanvasContainer(),l),y=p.map(A=>r.unproject(A)),w=p.reduce((A,R,D,N)=>A.add(R.div(N.length)),new s.P(0,0));super(e,{points:p,point:w,lngLats:y,lngLat:r.unproject(w),originalEvent:a}),this._defaultPrevented=!1}}class fl extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a){super(e,{originalEvent:a}),this._defaultPrevented=!1}}class qc{constructor(e,r){this._map=e,this._clickTolerance=r.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new fl(e.type,this._map,e))}mousedown(e,r){return this._mousedownPos=r,this._firePreventable(new Ur(e.type,this._map,e))}mouseup(e){this._map.fire(new Ur(e.type,this._map,e))}click(e,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||this._map.fire(new Ur(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Ur(e.type,this._map,e))}mouseover(e){this._map.fire(new Ur(e.type,this._map,e))}mouseout(e){this._map.fire(new Ur(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Ss(e.type,this._map,e))}touchmove(e){this._map.fire(new Ss(e.type,this._map,e))}touchend(e){this._map.fire(new Ss(e.type,this._map,e))}touchcancel(e){this._map.fire(new Ss(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Uc{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Ur(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ur("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Ur(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class As{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(s.P.convert(e),this._map.terrain)}}class ml{constructor(e,r){this._map=e,this._tr=new As(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&e.button===0&&(E.disableDrag(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(e,r){if(!this._active)return;const a=r;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=a,this._box||(this._box=E.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const p=Math.min(l.x,a.x),y=Math.max(l.x,a.x),w=Math.min(l.y,a.y),A=Math.max(l.y,a.y);E.setTransform(this._box,`translate(${p}px,${w}px)`),this._box.style.width=y-p+"px",this._box.style.height=A-w+"px"}mouseupWindow(e,r){if(!this._active||e.button!==0)return;const a=this._startPos,l=r;if(this.reset(),E.suppressClick(),a.x!==l.x||a.y!==l.y)return this._map.fire(new s.l("boxzoomend",{originalEvent:e})),{cameraAnimation:p=>p.fitScreenCoordinates(a,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(E.remove(this._box),this._box=null),E.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new s.l(e,{originalEvent:r}))}}function la(h,e){if(h.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${e.length}`);const r={};for(let a=0;a<h.length;a++)r[h[a].identifier]=e[a];return r}class jc{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,a){(this.centroid||a.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),a.length===this.numTouches&&(this.centroid=function(l){const p=new s.P(0,0);for(const y of l)p._add(y);return p.div(l.length)}(r),this.touches=la(a,r)))}touchmove(e,r,a){if(this.aborted||!this.centroid)return;const l=la(a,r);for(const p in this.touches){const y=l[p];(!y||y.dist(this.touches[p])>30)&&(this.aborted=!0)}}touchend(e,r,a){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class ks{constructor(e){this.singleTap=new jc(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,r,a){this.singleTap.touchstart(e,r,a)}touchmove(e,r,a){this.singleTap.touchmove(e,r,a)}touchend(e,r,a){const l=this.singleTap.touchend(e,r,a);if(l){const p=e.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(l)<30;if(p&&y||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class Wc{constructor(e){this._tr=new As(e),this._zoomIn=new ks({numTouches:1,numTaps:2}),this._zoomOut=new ks({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,r,a){this._zoomIn.touchstart(e,r,a),this._zoomOut.touchstart(e,r,a)}touchmove(e,r,a){this._zoomIn.touchmove(e,r,a),this._zoomOut.touchmove(e,r,a)}touchend(e,r,a){const l=this._zoomIn.touchend(e,r,a),p=this._zoomOut.touchend(e,r,a),y=this._tr;return l?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:y.zoom+1,around:y.unproject(l)},{originalEvent:e})}):p?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:y.zoom-1,around:y.unproject(p)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hi{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const r=this._moveFunction(...e);if(r.bearingDelta||r.pitchDelta||r.rollDelta||r.around||r.panDelta)return this._active=!0,r}dragStart(e,r){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(r)?r[0]:r,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,r){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const l=Array.isArray(r)?r[0]:r;return!this._moved&&l.dist(a)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(a,l))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&E.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Gi={0:1,2:2};class Cs{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const r=E.mouseButton(e);this._eventButton=r}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(r,a){const l=Gi[a];return r.buttons===void 0||(r.buttons&l)!==l}(e,this._eventButton)}isValidEndEvent(e){return E.mouseButton(e)===this._eventButton}}class Ji{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class Ts{constructor(e=new Cs({checkCorrectEvent:()=>!0}),r=new Ji){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=r}_executeRelevantHandler(e,r,a){return e instanceof MouseEvent?r(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?a(e):void 0}startMove(e){this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.startMove(r),r=>this.oneFingerTouchMoveStateManager.startMove(r))}endMove(e){this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.endMove(r),r=>this.oneFingerTouchMoveStateManager.endMove(r))}isValidStartEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidStartEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidStartEvent(r))}isValidMoveEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidMoveEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(r))}isValidEndEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidEndEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidEndEvent(r))}}const ca=h=>{h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=e=>{e.preventDefault()}};class Dh{constructor(e,r){this._clickTolerance=e.clickTolerance||1,this._map=r,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new s.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,r,a){return this._calculateTransform(e,r,a)}touchmove(e,r,a){if(this._active){if(!this._shouldBePrevented(a.length))return e.preventDefault(),this._calculateTransform(e,r,a);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,r,a){this._calculateTransform(e,r,a),this._active&&this._shouldBePrevented(a.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,a){a.length>0&&(this._active=!0);const l=la(a,r),p=new s.P(0,0),y=new s.P(0,0);let w=0;for(const R in l){const D=l[R],N=this._touches[R];N&&(p._add(D),y._add(D.sub(N)),w++,l[R]=D)}if(this._touches=l,this._shouldBePrevented(w)||!y.mag())return;const A=y.div(w);return this._sum._add(A),this._sum.mag()<this._clickTolerance?void 0:{around:p.div(w),panDelta:A}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gl{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,r,a){this._firstTwoTouches||a.length<2||(this._firstTwoTouches=[a[0].identifier,a[1].identifier],this._start([r[0],r[1]]))}touchmove(e,r,a){if(!this._firstTwoTouches)return;e.preventDefault();const[l,p]=this._firstTwoTouches,y=ua(a,r,l),w=ua(a,r,p);if(!y||!w)return;const A=this._aroundCenter?null:y.add(w).div(2);return this._move([y,w],A,e)}touchend(e,r,a){if(!this._firstTwoTouches)return;const[l,p]=this._firstTwoTouches,y=ua(a,r,l),w=ua(a,r,p);y&&w||(this._active&&E.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ua(h,e,r){for(let a=0;a<h.length;a++)if(h[a].identifier===r)return e[a]}function yl(h,e){return Math.log(h/e)/Math.LN2}class Es extends gl{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,r){const a=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(yl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:yl(this._distance,a),pinchAround:r}}}function ln(h,e){return 180*h.angleWith(e)/Math.PI}class nt extends gl{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,r,a){const l=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ln(this._vector,l),pinchAround:r}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const r=25/(Math.PI*this._minDiameter)*360,a=ln(e,this._startVector);return Math.abs(a)<r}}function ha(h){return Math.abs(h.y)>Math.abs(h.x)}class pa extends gl{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,r,a){super.touchstart(e,r,a),this._currentTouchCount=a.length}_start(e){this._lastPoints=e,ha(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,r,a){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const l=e[0].sub(this._lastPoints[0]),p=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,p,a.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(l.y+p.y)/2*-.5}):void 0}gestureBeginsVertically(e,r,a){if(this._valid!==void 0)return this._valid;const l=e.mag()>=2,p=r.mag()>=2;if(!l&&!p)return;if(!l||!p)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const y=e.y>0==r.y>0;return ha(e)&&ha(r)&&y}}const Hc={panStep:100,bearingStep:15,pitchStep:10};class Ps{constructor(e){this._tr=new As(e);const r=Hc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let r=0,a=0,l=0,p=0,y=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?a=-1:(e.preventDefault(),p=-1);break;case 39:e.shiftKey?a=1:(e.preventDefault(),p=1);break;case 38:e.shiftKey?l=1:(e.preventDefault(),y=-1);break;case 40:e.shiftKey?l=-1:(e.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(a=0,l=0),{cameraAnimation:w=>{const A=this._tr;w.easeTo({duration:300,easeId:"keyboardHandler",easing:uo,zoom:r?Math.round(A.zoom)+r*(e.shiftKey?2:1):A.zoom,bearing:A.bearing+a*this._bearingStep,pitch:A.pitch+l*this._pitchStep,offset:[-p*this._panStep,-y*this._panStep],center:A.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function uo(h){return h*(2-h)}const _l=4.000244140625;class Bt{constructor(e,r){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=e,this._tr=new As(e),this._triggerRenderFrame=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let r=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const a=M.now(),l=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,r!==0&&r%_l==0?this._type="wheel":r!==0&&Math.abs(r)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(l*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const r=E.mousePos(this._map.getCanvas(),e),a=this._tr;this._aroundPoint=this._aroundCenter?a.transform.locationToScreenPoint(s.Q.convert(a.center)):r,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const w=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=w),typeof this._targetZoom=="number"&&(this._targetZoom+=w)}if(this._delta!==0){const w=this._type==="wheel"&&Math.abs(this._delta)>_l?this._wheelZoomRate:this._defaultZoomRate;let A=2/(1+Math.exp(-Math.abs(this._delta*w)));this._delta<0&&A!==0&&(A=1/A);const R=typeof this._targetZoom!="number"?e.scale:s.ac(this._targetZoom);this._targetZoom=e.getConstrained(e.getCameraLngLat(),s.ah(R*A)).zoom,this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r=typeof this._targetZoom!="number"?e.zoom:this._targetZoom,a=this._startZoom,l=this._easing;let p,y=!1;if(this._type==="wheel"&&a&&l){const w=M.now()-this._lastWheelEventTime,A=Math.min((w+5)/200,1),R=l(A);p=s.B.number(a,r,R),A<1?this._frameId||(this._frameId=!0):y=!0}else p=r,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=p,{noInertia:!0,needsRenderFrame:!y,zoomDelta:p-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=s.cf;if(this._prevEase){const a=this._prevEase,l=(M.now()-a.start)/a.duration,p=a.easing(l+.01)-a.easing(l),y=.27/Math.sqrt(p*p+1e-4)*.01,w=Math.sqrt(.0729-y*y);r=s.cd(y,w,.25,1)}return this._prevEase={start:M.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class da{constructor(e,r){this._clickZoom=e,this._tapZoom=r}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Vh{constructor(e){this._tr=new As(e),this.reset()}reset(){this._active=!1}dblclick(e,r){return e.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(r)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vl{constructor(){this._tap=new ks({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,r,a){if(!this._swipePoint)if(this._tapTime){const l=r[0],p=e.timeStamp-this._tapTime<500,y=this._tapPoint.dist(l)<30;p&&y?a.length>0&&(this._swipePoint=l,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(e,r,a)}touchmove(e,r,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const l=r[0],p=l.y-this._swipePoint.y;return this._swipePoint=l,e.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(e,r,a)}touchend(e,r,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const l=this._tap.touchend(e,r,a);l&&(this._tapTime=e.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Zc{constructor(e,r,a){this._el=e,this._mousePan=r,this._touchPan=a}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Kc{constructor(e,r,a,l){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=r,this._mousePitch=a,this._mouseRoll=l}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class xl{constructor(e,r,a,l){this._el=e,this._touchZoom=r,this._touchRotate=a,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class fa{constructor(e,r){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=r,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=E.create("div","maplibregl-cooperative-gesture-screen",e);let r=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(r=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const a=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=r,this._container.appendChild(l);const p=document.createElement("div");p.className="maplibregl-mobile-message",p.textContent=a,this._container.appendChild(p),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(E.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new s.l("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const ho=h=>h.zoom||h.drag||h.roll||h.pitch||h.rotate;class zh extends s.l{}function ma(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta||h.rollDelta}class Fh{constructor(e,r){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,p)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const y=l.type==="renderFrame"?void 0:l,w={needsRenderFrame:!1},A={},R={};for(const{handlerName:O,handler:Z,allowed:K}of this._handlers){if(!Z.isEnabled())continue;let ne;if(this._blockedByActive(R,K,O))Z.reset();else if(Z[p||l.type]){if(s.cg(l,p||l.type)){const ie=E.mousePos(this._map.getCanvas(),l);ne=Z[p||l.type](l,ie)}else if(s.ch(l,p||l.type)){const ie=this._getMapTouches(l.touches),ae=E.touchPos(this._map.getCanvas(),ie);ne=Z[p||l.type](l,ae,ie)}else s.ci(p||l.type)||(ne=Z[p||l.type](l));this.mergeHandlerResult(w,A,ne,O,y),ne&&ne.needsRenderFrame&&this._triggerRenderFrame()}(ne||Z.isActive())&&(R[O]=Z)}const D={};for(const O in this._previousActiveHandlers)R[O]||(D[O]=y);this._previousActiveHandlers=R,(Object.keys(D).length||ma(w))&&(this._changes.push([w,A,D]),this._triggerRenderFrame()),(Object.keys(R).length||ma(w))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:N}=w;N&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],N(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Nc(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,p,y]of this._listeners)E.addEventListener(l,p,l===document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[e,r,a]of this._listeners)E.removeEventListener(e,r,e===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(e){const r=this._map,a=r.getCanvasContainer();this._add("mapEvent",new qc(r,e));const l=r.boxZoom=new ml(r,e);this._add("boxZoom",l),e.interactive&&e.boxZoom&&l.enable();const p=r.cooperativeGestures=new fa(r,e.cooperativeGestures);this._add("cooperativeGestures",p),e.cooperativeGestures&&p.enable();const y=new Wc(r),w=new Vh(r);r.doubleClickZoom=new da(w,y),this._add("tapZoom",y),this._add("clickZoom",w),e.interactive&&e.doubleClickZoom&&r.doubleClickZoom.enable();const A=new vl;this._add("tapDragZoom",A);const R=r.touchPitch=new pa(r);this._add("touchPitch",R),e.interactive&&e.touchPitch&&r.touchPitch.enable(e.touchPitch);const D=()=>r.project(r.getCenter()),N=function({enable:fe,clickTolerance:ge,aroundCenter:xe=!0,minPixelCenterThreshold:ye=100,rotateDegreesPerPixelMoved:Te=.8},Fe){const Le=new Cs({checkCorrectEvent:Be=>E.mouseButton(Be)===0&&Be.ctrlKey||E.mouseButton(Be)===2&&!Be.ctrlKey});return new hi({clickTolerance:ge,move:(Be,De)=>{const Ye=Fe();if(xe&&Math.abs(Ye.y-Be.y)>ye)return{bearingDelta:s.ce(new s.P(Be.x,De.y),De,Ye)};let Xe=(De.x-Be.x)*Te;return xe&&De.y<Ye.y&&(Xe=-Xe),{bearingDelta:Xe}},moveStateManager:Le,enable:fe,assignEvents:ca})}(e,D),O=function({enable:fe,clickTolerance:ge,pitchDegreesPerPixelMoved:xe=-.5}){const ye=new Cs({checkCorrectEvent:Te=>E.mouseButton(Te)===0&&Te.ctrlKey||E.mouseButton(Te)===2});return new hi({clickTolerance:ge,move:(Te,Fe)=>({pitchDelta:(Fe.y-Te.y)*xe}),moveStateManager:ye,enable:fe,assignEvents:ca})}(e),Z=function({enable:fe,clickTolerance:ge,rollDegreesPerPixelMoved:xe=.3},ye){const Te=new Cs({checkCorrectEvent:Fe=>E.mouseButton(Fe)===2&&Fe.ctrlKey});return new hi({clickTolerance:ge,move:(Fe,Le)=>{const Be=ye();let De=(Le.x-Fe.x)*xe;return Le.y<Be.y&&(De=-De),{rollDelta:De}},moveStateManager:Te,enable:fe,assignEvents:ca})}(e,D);r.dragRotate=new Kc(e,N,O,Z),this._add("mouseRotate",N,["mousePitch"]),this._add("mousePitch",O,["mouseRotate","mouseRoll"]),this._add("mouseRoll",Z,["mousePitch"]),e.interactive&&e.dragRotate&&r.dragRotate.enable();const K=function({enable:fe,clickTolerance:ge}){const xe=new Cs({checkCorrectEvent:ye=>E.mouseButton(ye)===0&&!ye.ctrlKey});return new hi({clickTolerance:ge,move:(ye,Te)=>({around:Te,panDelta:Te.sub(ye)}),activateOnStart:!0,moveStateManager:xe,enable:fe,assignEvents:ca})}(e),ne=new Dh(e,r);r.dragPan=new Zc(a,K,ne),this._add("mousePan",K),this._add("touchPan",ne,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&r.dragPan.enable(e.dragPan);const ie=new nt,ae=new Es;r.touchZoomRotate=new xl(a,ae,ie,A),this._add("touchRotate",ie,["touchPan","touchZoom"]),this._add("touchZoom",ae,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&r.touchZoomRotate.enable(e.touchZoomRotate);const ue=r.scrollZoom=new Bt(r,()=>this._triggerRenderFrame());this._add("scrollZoom",ue,["mousePan"]),e.interactive&&e.scrollZoom&&r.scrollZoom.enable(e.scrollZoom);const me=r.keyboard=new Ps(r);this._add("keyboard",me),e.interactive&&e.keyboard&&r.keyboard.enable(),this._add("blockableMapEvent",new Uc(r))}_add(e,r,a){this._handlers.push({handlerName:e,handler:r,allowed:a}),this._handlersById[e]=r}stop(e){if(!this._updatingCamera){for(const{handler:r}of this._handlers)r.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ho(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,r,a){for(const l in e)if(l!==a&&(!r||r.indexOf(l)<0))return!0;return!1}_getMapTouches(e){const r=[];for(const a of e)this._el.contains(a.target)&&r.push(a);return r}mergeHandlerResult(e,r,a,l,p){if(!a)return;s.e(e,a);const y={handlerName:l,originalEvent:a.originalEvent||p};a.zoomDelta!==void 0&&(r.zoom=y),a.panDelta!==void 0&&(r.drag=y),a.rollDelta!==void 0&&(r.roll=y),a.pitchDelta!==void 0&&(r.pitch=y),a.bearingDelta!==void 0&&(r.rotate=y)}_applyChanges(){const e={},r={},a={};for(const[l,p,y]of this._changes)l.panDelta&&(e.panDelta=(e.panDelta||new s.P(0,0))._add(l.panDelta)),l.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+l.pitchDelta),l.rollDelta&&(e.rollDelta=(e.rollDelta||0)+l.rollDelta),l.around!==void 0&&(e.around=l.around),l.pinchAround!==void 0&&(e.pinchAround=l.pinchAround),l.noInertia&&(e.noInertia=l.noInertia),s.e(r,p),s.e(a,y);this._updateMapTransform(e,r,a),this._changes=[]}_updateMapTransform(e,r,a){const l=this._map,p=l._getTransformForUpdate(),y=l.terrain;if(!(ma(e)||y&&this._terrainMovement))return this._fireEvents(r,a,!0);l._stop(!0);let{panDelta:w,zoomDelta:A,bearingDelta:R,pitchDelta:D,rollDelta:N,around:O,pinchAround:Z}=e;Z!==void 0&&(O=Z),O=O||l.transform.centerPoint,y&&!p.isPointOnMapSurface(O)&&(O=p.centerPoint);const K={panDelta:w,zoomDelta:A,rollDelta:N,pitchDelta:D,bearingDelta:R,around:O};this._map.cameraHelper.useGlobeControls&&!p.isPointOnMapSurface(O)&&(O=p.centerPoint);const ne=O.distSqr(p.centerPoint)<.01?p.center:p.screenPointToLocation(w?O.sub(w):O);y?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(K,p),this._terrainMovement||!r.drag&&!r.zoom?r.drag&&this._terrainMovement?p.setCenter(p.screenPointToLocation(p.centerPoint.sub(w))):this._map.cameraHelper.handleMapControlsPan(K,p,ne):(this._terrainMovement=!0,this._map._elevationFreeze=!0,this._map.cameraHelper.handleMapControlsPan(K,p,ne))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(K,p),this._map.cameraHelper.handleMapControlsPan(K,p,ne)),l._applyUpdatedTransform(p),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(r,a,!0)}_fireEvents(e,r,a){const l=ho(this._eventsInProgress),p=ho(e),y={};for(const N in e){const{originalEvent:O}=e[N];this._eventsInProgress[N]||(y[`${N}start`]=O),this._eventsInProgress[N]=e[N]}!l&&p&&this._fireEvent("movestart",p.originalEvent);for(const N in y)this._fireEvent(N,y[N]);p&&this._fireEvent("move",p.originalEvent);for(const N in e){const{originalEvent:O}=e[N];this._fireEvent(N,O)}const w={};let A;for(const N in this._eventsInProgress){const{handlerName:O,originalEvent:Z}=this._eventsInProgress[N];this._handlersById[O].isActive()||(delete this._eventsInProgress[N],A=r[O]||Z,w[`${N}end`]=A)}for(const N in w)this._fireEvent(N,w[N]);const R=ho(this._eventsInProgress),D=(l||p)&&!R;if(D&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const N=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&N.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(N)}if(a&&D){this._updatingCamera=!0;const N=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=Z=>Z!==0&&-this._bearingSnap<Z&&Z<this._bearingSnap;!N||!N.essential&&M.prefersReducedMotion?(this._map.fire(new s.l("moveend",{originalEvent:A})),O(this._map.getBearing())&&this._map.resetNorth()):(O(N.bearing||this._map.getBearing())&&(N.bearing=0),N.freezeElevation=!0,this._map.easeTo(N,{originalEvent:A})),this._updatingCamera=!1}}_fireEvent(e,r){this._map.fire(new s.l(e,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new zh("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Oh extends s.E{constructor(e,r,a){super(),this._renderFrameCallback=()=>{const l=Math.min((M.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=a.bearingSnap,this.cameraHelper=r,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,r){e.apply(this.transform),this.transform=e,this.cameraHelper=r}getCenter(){return new s.Q(this.transform.center.lng,this.transform.center.lat)}setCenter(e,r){return this.jumpTo({center:e},r)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,r){return this.jumpTo({elevation:e},r),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,r,a){return e=s.P.convert(e).mult(-1),this.panTo(this.transform.center,s.e({offset:e},r),a)}panTo(e,r,a){return this.easeTo(s.e({center:e},r),a)}getZoom(){return this.transform.zoom}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomTo(e,r,a){return this.easeTo(s.e({zoom:e},r),a)}zoomIn(e,r){return this.zoomTo(this.getZoom()+1,e,r),this}zoomOut(e,r){return this.zoomTo(this.getZoom()-1,e,r),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,r){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new s.l("movestart",r)).fire(new s.l("move",r)).fire(new s.l("moveend",r))),this}getBearing(){return this.transform.bearing}setBearing(e,r){return this.jumpTo({bearing:e},r),this}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(e,r,a){return this.easeTo(s.e({bearing:e},r),a)}resetNorth(e,r){return this.rotateTo(0,s.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(s.e({bearing:0,pitch:0,roll:0,duration:1e3},e),r),this}snapToNorth(e,r){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,r):this}getPitch(){return this.transform.pitch}setPitch(e,r){return this.jumpTo({pitch:e},r),this}getRoll(){return this.transform.roll}setRoll(e,r){return this.jumpTo({roll:e},r),this}cameraForBounds(e,r){e=dt.convert(e).adjustAntiMeridian();const a=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),a,r)}_cameraForBoxAndBearing(e,r,a,l){const p={top:0,bottom:0,right:0,left:0};if(typeof(l=s.e({padding:p,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const R=l.padding;l.padding={top:R,bottom:R,right:R,left:R}}const y=s.e(p,l.padding);l.padding=y;const w=this.transform,A=new dt(e,r);return this.cameraHelper.cameraForBoxAndBearing(l,y,A,a,w)}fitBounds(e,r,a){return this._fitInternal(this.cameraForBounds(e,r),r,a)}fitScreenCoordinates(e,r,a,l,p){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(s.P.convert(e)),this.transform.screenPointToLocation(s.P.convert(r)),a,l),l,p)}_fitInternal(e,r,a){return e?(delete(r=s.e(e,r)).padding,r.linear?this.easeTo(r,a):this.flyTo(r,a)):this}jumpTo(e,r){this.stop();const a=this._getTransformForUpdate();let l=!1,p=!1,y=!1;const w=a.zoom;this.cameraHelper.handleJumpToCenterZoom(a,e);const A=a.zoom!==w;return"elevation"in e&&a.elevation!==+e.elevation&&a.setElevation(+e.elevation),"bearing"in e&&a.bearing!==+e.bearing&&(l=!0,a.setBearing(+e.bearing)),"pitch"in e&&a.pitch!==+e.pitch&&(p=!0,a.setPitch(+e.pitch)),"roll"in e&&a.roll!==+e.roll&&(y=!0,a.setRoll(+e.roll)),e.padding==null||a.isPaddingEqual(e.padding)||a.setPadding(e.padding),this._applyUpdatedTransform(a),this.fire(new s.l("movestart",r)).fire(new s.l("move",r)),A&&this.fire(new s.l("zoomstart",r)).fire(new s.l("zoom",r)).fire(new s.l("zoomend",r)),l&&this.fire(new s.l("rotatestart",r)).fire(new s.l("rotate",r)).fire(new s.l("rotateend",r)),p&&this.fire(new s.l("pitchstart",r)).fire(new s.l("pitch",r)).fire(new s.l("pitchend",r)),y&&this.fire(new s.l("rollstart",r)).fire(new s.l("roll",r)).fire(new s.l("rollend",r)),this.fire(new s.l("moveend",r))}calculateCameraOptionsFromTo(e,r,a,l=0){const p=s.$.fromLngLat(e,r),y=s.$.fromLngLat(a,l),w=y.x-p.x,A=y.y-p.y,R=y.z-p.z,D=Math.hypot(w,A,R);if(D===0)throw new Error("Can't calculate camera options with same From and To");const N=Math.hypot(w,A),O=s.ah(this.transform.cameraToCenterDistance/D/this.transform.tileSize),Z=180*Math.atan2(w,-A)/Math.PI;let K=180*Math.acos(N/D)/Math.PI;return K=R<0?90-K:90+K,{center:y.toLngLat(),elevation:l,zoom:O,pitch:K,bearing:Z}}calculateCameraOptionsFromCameraLngLatAltRotation(e,r,a,l,p){const y=this.transform.calculateCenterFromCameraLngLatAlt(e,r,a,l);return{center:y.center,elevation:y.elevation,zoom:y.zoom,bearing:a,pitch:l,roll:p}}easeTo(e,r){this._stop(!1,e.easeId),((e=s.e({offset:[0,0],duration:500,easing:s.cf},e)).animate===!1||!e.essential&&M.prefersReducedMotion)&&(e.duration=0);const a=this._getTransformForUpdate(),l=this.getBearing(),p=a.pitch,y=a.roll,w="bearing"in e?this._normalizeBearing(e.bearing,l):l,A="pitch"in e?+e.pitch:p,R="roll"in e?this._normalizeBearing(e.roll,y):y,D="padding"in e?e.padding:a.padding,N=s.P.convert(e.offset);let O,Z;e.around&&(O=s.Q.convert(e.around),Z=a.locationToScreenPoint(O));const K={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},ne=this.cameraHelper.handleEaseTo(a,{bearing:w,pitch:A,roll:R,padding:D,around:O,aroundPoint:Z,offsetAsPoint:N,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||l!==w,this._pitching=this._pitching||A!==p,this._rolling=this._rolling||R!==y,this._padding=!a.isPaddingEqual(D),this._zooming=this._zooming||ne.isZooming,this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,K),this.terrain&&this._prepareElevation(ne.elevationCenter),this._ease(ie=>{ne.easeFunc(ie),this.terrain&&!e.freezeElevation&&this._updateElevation(ie),this._applyUpdatedTransform(a),this._fireMoveEvents(r)},ie=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,ie)},e),this}_prepareEase(e,r,a={}){this._moving=!0,r||a.moving||this.fire(new s.l("movestart",e)),this._zooming&&!a.zooming&&this.fire(new s.l("zoomstart",e)),this._rotating&&!a.rotating&&this.fire(new s.l("rotatestart",e)),this._pitching&&!a.pitching&&this.fire(new s.l("pitchstart",e)),this._rolling&&!a.rolling&&this.fire(new s.l("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(a-(r-(a*e+this._elevationStart))/(1-e)),this._elevationTarget=r}this.transform.setElevation(s.B.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};const r=e.getCameraLngLat(),a=e.getCameraAltitude(),l=this.terrain?this.terrain.getElevationForLngLatZoom(r,e.zoom):0;if(a<l){const p=this.calculateCameraOptionsFromTo(r,l,e.center,e.elevation);return{pitch:p.pitch,zoom:p.zoom}}return{}}_applyUpdatedTransform(e){const r=[];if(r.push(l=>this._elevateCameraIfInsideTerrain(l)),this.transformCameraUpdate&&r.push(l=>this.transformCameraUpdate(l)),!r.length)return;const a=e.clone();for(const l of r){const p=a.clone(),{center:y,zoom:w,roll:A,pitch:R,bearing:D,elevation:N}=l(p);y&&p.setCenter(y),N!==void 0&&p.setElevation(N),w!==void 0&&p.setZoom(w),A!==void 0&&p.setRoll(A),R!==void 0&&p.setPitch(R),D!==void 0&&p.setBearing(D),a.apply(p)}this.transform.apply(a)}_fireMoveEvents(e){this.fire(new s.l("move",e)),this._zooming&&this.fire(new s.l("zoom",e)),this._rotating&&this.fire(new s.l("rotate",e)),this._pitching&&this.fire(new s.l("pitch",e)),this._rolling&&this.fire(new s.l("roll",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const a=this._zooming,l=this._rotating,p=this._pitching,y=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,a&&this.fire(new s.l("zoomend",e)),l&&this.fire(new s.l("rotateend",e)),p&&this.fire(new s.l("pitchend",e)),y&&this.fire(new s.l("rollend",e)),this.fire(new s.l("moveend",e))}flyTo(e,r){if(!e.essential&&M.prefersReducedMotion){const De=s.O(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(De,r)}this.stop(),e=s.e({offset:[0,0],speed:1.2,curve:1.42,easing:s.cf},e);const a=this._getTransformForUpdate(),l=a.bearing,p=a.pitch,y=a.roll,w=a.padding,A="bearing"in e?this._normalizeBearing(e.bearing,l):l,R="pitch"in e?+e.pitch:p,D="roll"in e?this._normalizeBearing(e.roll,y):y,N="padding"in e?e.padding:a.padding,O=s.P.convert(e.offset);let Z=a.centerPoint.add(O);const K=a.screenPointToLocation(Z),ne=this.cameraHelper.handleFlyTo(a,{bearing:A,pitch:R,roll:D,padding:N,locationAtOffset:K,offsetAsPoint:O,center:e.center,minZoom:e.minZoom,zoom:e.zoom});let ie=e.curve;const ae=Math.max(a.width,a.height),ue=ae/ne.scaleOfZoom,me=ne.pixelPathLength;typeof ne.scaleOfMinZoom=="number"&&(ie=Math.sqrt(ae/ne.scaleOfMinZoom/me*2));const fe=ie*ie;function ge(De){const Ye=(ue*ue-ae*ae+(De?-1:1)*fe*fe*me*me)/(2*(De?ue:ae)*fe*me);return Math.log(Math.sqrt(Ye*Ye+1)-Ye)}function xe(De){return(Math.exp(De)-Math.exp(-De))/2}function ye(De){return(Math.exp(De)+Math.exp(-De))/2}const Te=ge(!1);let Fe=function(De){return ye(Te)/ye(Te+ie*De)},Le=function(De){return ae*((ye(Te)*(xe(Ye=Te+ie*De)/ye(Ye))-xe(Te))/fe)/me;var Ye},Be=(ge(!0)-Te)/ie;if(Math.abs(me)<2e-6||!isFinite(Be)){if(Math.abs(ae-ue)<1e-6)return this.easeTo(e,r);const De=ue<ae?-1:1;Be=Math.abs(Math.log(ue/ae))/ie,Le=()=>0,Fe=Ye=>Math.exp(De*ie*Ye)}return e.duration="duration"in e?+e.duration:1e3*Be/("screenSpeed"in e?+e.screenSpeed/ie:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=l!==A,this._pitching=R!==p,this._rolling=D!==y,this._padding=!a.isPaddingEqual(N),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(ne.targetCenter),this._ease(De=>{const Ye=De*Be,Xe=1/Fe(Ye),He=Le(Ye);this._rotating&&a.setBearing(s.B.number(l,A,De)),this._pitching&&a.setPitch(s.B.number(p,R,De)),this._rolling&&a.setRoll(s.B.number(y,D,De)),this._padding&&(a.interpolatePadding(w,N,De),Z=a.centerPoint.add(O)),ne.easeFunc(De,Xe,He,Z),this.terrain&&!e.freezeElevation&&this._updateElevation(De),this._applyUpdatedTransform(a),this._fireMoveEvents(r)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,r){var a;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const l=this._onEaseEnd;delete this._onEaseEnd,l.call(this,r)}return e||(a=this.handlers)===null||a===void 0||a.stop(!1),this}_ease(e,r,a){a.animate===!1||a.duration===0?(e(1),r()):(this._easeStart=M.now(),this._easeOptions=a,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=s.aL(e,-180,180);const a=Math.abs(e-r);return Math.abs(e-360-r)<a&&(e-=360),Math.abs(e+360-r)<a&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(s.Q.convert(e),this.transform.tileZoom):null}}const fn={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class lr{constructor(e=fn){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=r=>{!r||r.sourceDataType!=="metadata"&&r.sourceDataType!=="visibility"&&r.dataType!=="style"&&r.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=E.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=E.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=E.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){E.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,r){const a=this._map._getUIString(`AttributionControl.${r}`);e.title=a,e.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const r=this._map.style.sourceCaches;for(const l in r){const p=r[l];if(p.used||p.usedForTerrain){const y=p.getSource();y.attribution&&e.indexOf(y.attribution)<0&&e.push(y.attribution)}}e=e.filter(l=>String(l).trim()),e.sort((l,p)=>l.length-p.length),e=e.filter((l,p)=>{for(let y=p+1;y<e.length;y++)if(e[y].indexOf(l)>=0)return!1;return!0});const a=e.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,e.length?(this._innerContainer.innerHTML=E.sanitize(a),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class po{constructor(e={}){this._updateCompact=()=>{const r=this._container.children;if(r.length){const a=r[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=E.create("div","maplibregl-ctrl");const r=E.create("a","maplibregl-ctrl-logo");return r.target="_blank",r.rel="noopener nofollow",r.href="https://maplibre.org/",r.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),r.setAttribute("rel","noopener nofollow"),this._container.appendChild(r),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){E.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class bl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const r=++this._id;return this._queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){const r=this._currentlyRunning,a=r?this._queue.concat(r):this._queue;for(const l of a)if(l.id===e)return void(l.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const r=this._currentlyRunning=this._queue;this._queue=[];for(const a of r)if(!a.cancelled&&(a.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Gc=s.aG([{name:"a_pos3d",type:"Int16",components:3}]);class Jc extends s.E{constructor(e){super(),this._lastTilesetChange=M.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];const a={};for(const l of be(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))a[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.terrainRttPosMatrix32f=new Float64Array(16),s.bQ(l.terrainRttPosMatrix32f,0,s.Z,s.Z,0,0,1),this._tiles[l.key]=new qr(l,this.tileSize),this._lastTilesetChange=M.now());for(const l in this._tiles)a[l]||delete this._tiles[l]}freeRtt(e){for(const r in this._tiles){const a=this._tiles[r];(!e||a.tileID.equals(e)||a.tileID.isChildOf(e)||e.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,r){return r?this._getTerrainCoordsForTileRanges(e,r):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){const r={};for(const a of this._renderableTilesKeys){const l=this._tiles[a].tileID,p=e.clone(),y=s.b2();if(l.canonical.equals(e.canonical))s.bQ(y,0,s.Z,s.Z,0,0,1);else if(l.canonical.isChildOf(e.canonical)){const w=l.canonical.z-e.canonical.z,A=l.canonical.x-(l.canonical.x>>w<<w),R=l.canonical.y-(l.canonical.y>>w<<w),D=s.Z>>w;s.bQ(y,0,D,D,0,0,1),s.L(y,y,[-A*D,-R*D,0])}else{if(!e.canonical.isChildOf(l.canonical))continue;{const w=e.canonical.z-l.canonical.z,A=e.canonical.x-(e.canonical.x>>w<<w),R=e.canonical.y-(e.canonical.y>>w<<w),D=s.Z>>w;s.bQ(y,0,s.Z,s.Z,0,0,1),s.L(y,y,[A*D,R*D,0]),s.M(y,y,[1/2**w,1/2**w,0])}}p.terrainRttPosMatrix32f=new Float32Array(y),r[a]=p}return r}_getTerrainCoordsForTileRanges(e,r){const a={};for(const l of this._renderableTilesKeys){const p=this._tiles[l].tileID;if(!this._isWithinTileRanges(p,r))continue;const y=e.clone(),w=s.b2();if(p.canonical.z===e.canonical.z){const A=e.canonical.x-p.canonical.x,R=e.canonical.y-p.canonical.y;s.bQ(w,0,s.Z,s.Z,0,0,1),s.L(w,w,[A*s.Z,R*s.Z,0])}else if(p.canonical.z>e.canonical.z){const A=p.canonical.z-e.canonical.z,R=p.canonical.x-(p.canonical.x>>A<<A),D=p.canonical.y-(p.canonical.y>>A<<A),N=e.canonical.x-(p.canonical.x>>A),O=e.canonical.y-(p.canonical.y>>A),Z=s.Z>>A;s.bQ(w,0,Z,Z,0,0,1),s.L(w,w,[-R*Z+N*s.Z,-D*Z+O*s.Z,0])}else{const A=e.canonical.z-p.canonical.z,R=e.canonical.x-(e.canonical.x>>A<<A),D=e.canonical.y-(e.canonical.y>>A<<A),N=(e.canonical.x>>A)-p.canonical.x,O=(e.canonical.y>>A)-p.canonical.y,Z=s.Z<<A;s.bQ(w,0,Z,Z,0,0,1),s.L(w,w,[R*s.Z+N*Z,D*s.Z+O*Z,0])}y.terrainRttPosMatrix32f=new Float32Array(w),a[l]=y}return a}getSourceTile(e,r){const a=this.sourceCache._source;let l=e.overscaledZ-this.deltaZoom;if(l>a.maxzoom&&(l=a.maxzoom),l<a.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(l).key);let p=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!p||!p.dem)&&r)for(;l>=a.minzoom&&(!p||!p.dem);)p=this.sourceCache.getTileByID(e.scaledTo(l--).key);return p}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,r){return r[e.canonical.z]&&e.canonical.x>=r[e.canonical.z].minTileX&&e.canonical.x<=r[e.canonical.z].maxTileX&&e.canonical.y>=r[e.canonical.z].minTileY&&e.canonical.y<=r[e.canonical.z].maxTileY}}class Xc{constructor(e,r,a){this._meshCache={},this.painter=e,this.sourceCache=new Jc(r),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,a,l=s.Z){var p;if(!(r>=0&&r<l&&a>=0&&a<l))return 0;const y=this.getTerrainData(e),w=(p=y.tile)===null||p===void 0?void 0:p.dem;if(!w)return 0;const A=s.cj([],[r/l*s.Z,a/l*s.Z],y.u_terrain_matrix),R=[A[0]*w.dim,A[1]*w.dim],D=Math.floor(R[0]),N=Math.floor(R[1]),O=R[0]-D,Z=R[1]-N;return w.get(D,N)*(1-O)*(1-Z)+w.get(D+1,N)*O*(1-Z)+w.get(D,N+1)*(1-O)*Z+w.get(D+1,N+1)*O*Z}getElevationForLngLatZoom(e,r){if(!s.ck(r,e.wrap()))return 0;const{tileID:a,mercatorX:l,mercatorY:p}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(a,l%s.Z,p%s.Z,s.Z)}getElevation(e,r,a,l=s.Z){return this.getDEMElevation(e,r,a,l)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const l=this.painter.context,p=new s.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ze(l,p,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ze(l,new s.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=s.ad([])}const r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const l=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new Ze(l,r.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),r.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const a=r&&r+r.tileID.key+e.key;if(a&&!this._demMatrixCache[a]){const l=this.sourceCache.sourceCache._source.maxzoom;let p=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=l?p=e.canonical.z-l:s.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const y=e.canonical.x-(e.canonical.x>>p<<p),w=e.canonical.y-(e.canonical.y>>p<<p),A=s.cl(new Float64Array(16),[1/(s.Z<<p),1/(s.Z<<p),0]);s.L(A,A,[y*s.Z,w*s.Z,0]),this._demMatrixCache[e.key]={matrix:A,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:a?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(e){const r=this.painter,a=r.width/devicePixelRatio,l=r.height/devicePixelRatio;return!this._fbo||this._fbo.width===a&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Ze(r.context,{width:a,height:l,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Ze(r.context,{width:a,height:l,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=r.context.createFramebuffer(a,l,!0,!1),this._fbo.depthAttachment.set(r.context.createRenderbuffer(r.context.gl.DEPTH_COMPONENT16,a,l))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let p=0,y=0;p<this._coordsTextureSize;p++)for(let w=0;w<this._coordsTextureSize;w++,y+=4)r[y+0]=255&w,r[y+1]=255&p,r[y+2]=w>>8<<4|p>>8,r[y+3]=0;const a=new s.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),l=new Ze(e,a,e.gl.RGBA,{premultiply:!1});return l.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),a=this.painter.context,l=a.gl,p=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),y=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),w=Math.round(this.painter.height/devicePixelRatio);a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(p,w-y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,r),a.bindFramebuffer.set(null);const A=r[0]+(r[2]>>4<<8),R=r[1]+((15&r[2])<<8),D=this.coordsIndex[255-r[3]],N=D&&this.sourceCache.getTileByID(D);if(!N)return null;const O=this._coordsTextureSize,Z=(1<<N.tileID.canonical.z)*O;return new s.$((N.tileID.canonical.x*O+A)/Z+N.tileID.wrap,(N.tileID.canonical.y*O+R)/Z,this.getElevation(N.tileID,A,R,O))}depthAtPoint(e){const r=new Uint8Array(4),a=this.painter.context,l=a.gl;return a.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),l.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,r),a.bindFramebuffer.set(null),(r[0]/16777216+r[1]/65536+r[2]/256+r[3])/256}getTerrainMesh(e){var r;const a=((r=this.painter.style.projection)===null||r===void 0?void 0:r.transitionState)>0,l=a&&e.canonical.y===0,p=a&&e.canonical.y===(1<<e.canonical.z)-1,y=`m_${l?"n":""}_${p?"s":""}`;if(this._meshCache[y])return this._meshCache[y];const w=this.painter.context,A=new s.cm,R=new s.aK,D=this.meshSize,N=s.Z/D,O=D*D;for(let ye=0;ye<=D;ye++)for(let Te=0;Te<=D;Te++)A.emplaceBack(Te*N,ye*N,0);for(let ye=0;ye<O;ye+=D+1)for(let Te=0;Te<D;Te++)R.emplaceBack(Te+ye,D+Te+ye+1,D+Te+ye+2),R.emplaceBack(Te+ye,D+Te+ye+2,Te+ye+1);const Z=A.length,K=Z+(D+1),ne=(D+1)*D,ie=l?s.b9:0,ae=l?0:1,ue=p?s.ba:s.Z,me=p?0:1;for(let ye=0;ye<=D;ye++)A.emplaceBack(ye*N,ie,ae);for(let ye=0;ye<=D;ye++)A.emplaceBack(ye*N,ue,me);for(let ye=0;ye<D;ye++)R.emplaceBack(ne+ye,K+ye,K+ye+1),R.emplaceBack(ne+ye,K+ye+1,ne+ye+1),R.emplaceBack(0+ye,Z+ye+1,Z+ye),R.emplaceBack(0+ye,0+ye+1,Z+ye+1);const fe=A.length,ge=fe+2*(D+1);for(const ye of[0,1])for(let Te=0;Te<=D;Te++)for(const Fe of[0,1])A.emplaceBack(ye*s.Z,Te*N,Fe);for(let ye=0;ye<2*D;ye+=2)R.emplaceBack(fe+ye,fe+ye+1,fe+ye+3),R.emplaceBack(fe+ye,fe+ye+3,fe+ye+2),R.emplaceBack(ge+ye,ge+ye+3,ge+ye+1),R.emplaceBack(ge+ye,ge+ye+2,ge+ye+3);const xe=new hs(w.createVertexBuffer(A,Gc.members),w.createIndexBuffer(R),s.aJ.simpleSegment(0,0,A.length,R.length));return this._meshCache[y]=xe,xe}getMeshFrameDelta(e){return 2*Math.PI*s.bu/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,r){var a;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(e,r);return(a=this.getMinMaxElevation(l).minElevation)!==null&&a!==void 0?a:0}getMinMaxElevation(e){const r=this.getTerrainData(e).tile,a={minElevation:null,maxElevation:null};return r&&r.dem&&(a.minElevation=r.dem.min*this.exaggeration,a.maxElevation=r.dem.max*this.exaggeration),a}_getOverscaledTileIDFromLngLatZoom(e,r){const a=s.$.fromLngLat(e.wrap()),l=(1<<r)*s.Z,p=a.x*l,y=a.y*l,w=Math.floor(p/s.Z),A=Math.floor(y/s.Z);return{tileID:new s.Y(r,0,r,w,A),mercatorX:p,mercatorY:y}}}class Nh{constructor(e,r,a){this._context=e,this._size=r,this._tileSize=a,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const r=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),a=new Ze(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return a.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),r.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),r.colorAttachment.set(a.texture),{id:e,fbo:r,texture:a,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(r=>e.id!==r),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const r of this._recentlyUsed)if(!this._objects[r].inUse)return this._objects[r];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}const yi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ga{constructor(e,r){this.painter=e,this.terrain=r,this.pool=new Nh(e.context,30,r.sourceCache.tileSize*r.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,r){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(a=>!e._layers[a].isHidden(r)),this._coordsAscending={};for(const a in e.sourceCaches){this._coordsAscending[a]={};const l=e.sourceCaches[a].getVisibleCoordinates(),p=e.sourceCaches[a].getSource(),y=p instanceof Rr?p.terrainTileRanges:null;for(const w of l){const A=this.terrain.sourceCache.getTerrainCoords(w,y);for(const R in A)this._coordsAscending[a][R]||(this._coordsAscending[a][R]=[]),this._coordsAscending[a][R].push(A[R])}}this._coordsAscendingStr={};for(const a of e._order){const l=e._layers[a],p=l.source;if(yi[l.type]&&!this._coordsAscendingStr[p]){this._coordsAscendingStr[p]={};for(const y in this._coordsAscending[p])this._coordsAscendingStr[p][y]=this._coordsAscending[p][y].map(w=>w.key).sort().join()}}for(const a of this._renderableTiles)for(const l in this._coordsAscendingStr){const p=this._coordsAscendingStr[l][a.tileID.key];p&&p!==a.rttCoords[l]&&(a.rtt=[])}}renderLayer(e,r){if(e.isHidden(this.painter.transform.zoom))return!1;const a=Object.assign(Object.assign({},r),{isRenderingToTexture:!0}),l=e.type,p=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(yi[l]&&(this._prevType&&yi[this._prevType]||this._stacks.push([]),this._prevType=l,this._stacks[this._stacks.length-1].push(e.id),!y))return!0;if(yi[this._prevType]||yi[l]&&y){this._prevType=l;const w=this._stacks.length-1,A=this._stacks[w]||[];for(const R of this._renderableTiles){if(this.pool.isFull()&&(Tn(this.painter,this.terrain,this._rttTiles,a),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(R),R.rtt[w]){const N=this.pool.getObjectForId(R.rtt[w].id);if(N.stamp===R.rtt[w].stamp){this.pool.useObject(N);continue}}const D=this.pool.getOrCreateFreeObject();this.pool.useObject(D),this.pool.stampObject(D),R.rtt[w]={id:D.id,stamp:D.stamp},p.context.bindFramebuffer.set(D.fbo.framebuffer),p.context.clear({color:s.b7.transparent,stencil:0}),p.currentStencilSource=void 0;for(let N=0;N<A.length;N++){const O=p.style._layers[A[N]],Z=O.source?this._coordsAscending[O.source][R.tileID.key]:[R.tileID];p.context.viewport.set([0,0,D.fbo.width,D.fbo.height]),p._renderTileClippingMasks(O,Z,!0),p.renderLayer(p,p.style.sourceCaches[O.source],O,Z,a),O.source&&(R.rttCoords[O.source]=this._coordsAscendingStr[O.source][R.tileID.key])}}return Tn(this.painter,this.terrain,this._rttTiles,a),this._rttTiles=[],this.pool.freeAllObjects(),yi[l]}return!1}}const ct={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},yt=V,fo={hash:!1,interactive:!0,bearingSnap:7,attributionControl:fn,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:s.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},wl={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class Sl{constructor(e,r,a=!1){this.mousedown=p=>{this.startMove(p,E.mousePos(this.element,p)),E.addEventListener(window,"mousemove",this.mousemove),E.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=p=>{this.move(p,E.mousePos(this.element,p))},this.mouseup=p=>{this._rotatePitchHanlder.dragEnd(p),this.offTemp()},this.touchstart=p=>{p.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=E.touchPos(this.element,p.targetTouches)[0],this.startMove(p,this._startPos),E.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.addEventListener(window,"touchend",this.touchend))},this.touchmove=p=>{p.targetTouches.length!==1?this.reset():(this._lastPos=E.touchPos(this.element,p.targetTouches)[0],this.move(p,this._lastPos))},this.touchend=p=>{p.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHanlder.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=r;const l=new Ts;this._rotatePitchHanlder=new hi({clickTolerance:3,move:(p,y)=>{const w=r.getBoundingClientRect(),A=new s.P((w.bottom-w.top)/2,(w.right-w.left)/2);return{bearingDelta:s.ce(new s.P(p.x,y.y),y,A),pitchDelta:a?-.5*(y.y-p.y):void 0}},moveStateManager:l,enable:!0,assignEvents:()=>{}}),this.map=e,E.addEventListener(r,"mousedown",this.mousedown),E.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),E.addEventListener(r,"touchcancel",this.reset)}startMove(e,r){this._rotatePitchHanlder.dragStart(e,r),E.disableDrag()}move(e,r){const a=this.map,{bearingDelta:l,pitchDelta:p}=this._rotatePitchHanlder.dragMove(e,r)||{};l&&a.setBearing(a.getBearing()+l),p&&a.setPitch(a.getPitch()+p)}off(){const e=this.element;E.removeEventListener(e,"mousedown",this.mousedown),E.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),E.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.removeEventListener(window,"touchend",this.touchend),E.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){E.enableDrag(),E.removeEventListener(window,"mousemove",this.mousemove),E.removeEventListener(window,"mouseup",this.mouseup),E.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.removeEventListener(window,"touchend",this.touchend)}}let zr;function Al(h,e,r,a=!1){if(a||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return h==null?void 0:h.wrap();const l=new s.Q(h.lng,h.lat);if(h=new s.Q(h.lng,h.lat),e){const p=new s.Q(h.lng-360,h.lat),y=new s.Q(h.lng+360,h.lat),w=r.locationToScreenPoint(h).distSqr(e);r.locationToScreenPoint(p).distSqr(e)<w?h=p:r.locationToScreenPoint(y).distSqr(e)<w&&(h=y)}for(;Math.abs(h.lng-r.center.lng)>180;){const p=r.locationToScreenPoint(h);if(p.x>=0&&p.y>=0&&p.x<=r.width&&p.y<=r.height)break;h.lng>r.center.lng?h.lng-=360:h.lng+=360}return h.lng!==l.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(h))?h:l}const qi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Qc(h,e,r){const a=h.classList;for(const l in qi)a.remove(`maplibregl-${r}-anchor-${l}`);a.add(`maplibregl-${r}-anchor-${e}`)}class Yn extends s.E{constructor(e){if(super(),this._onKeyPress=r=>{const a=r.code,l=r.charCode||r.keyCode;a!=="Space"&&a!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=r=>{const a=r.originalEvent.target,l=this._element;this._popup&&(a===l||l.contains(a))&&this.togglePopup()},this._update=r=>{if(!this._map)return;const a=this._map.loaded()&&!this._map.isMoving();((r==null?void 0:r.type)==="terrain"||(r==null?void 0:r.type)==="render"&&!a)&&this._map.once("render",this._update),this._lngLat=Al(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||r&&r.type!=="moveend"||(this._pos=this._pos.round()),E.setTransform(this._element,`${qi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${p} ${l}`),M.frameAsync(new AbortController).then(()=>{this._updateOpacity(r&&r.type==="moveend")}).catch(()=>{})},this._onMove=r=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=r.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=r.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new s.l("dragstart"))),this.fire(new s.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new s.l("dragend")),this._state="inactive"},this._addDragHandler=r=>{this._element.contains(r.originalEvent.target)&&(r.preventDefault(),this._positionDelta=r.point.sub(this._pos).add(this._offset),this._pointerdownPos=r.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=s.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=E.create("div");const r=E.createNS("http://www.w3.org/2000/svg","svg"),a=41,l=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${a}px`),r.setAttributeNS(null,"width",`${l}px`),r.setAttributeNS(null,"viewBox",`0 0 ${l} ${a}`);const p=E.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"stroke","none"),p.setAttributeNS(null,"stroke-width","1"),p.setAttributeNS(null,"fill","none"),p.setAttributeNS(null,"fill-rule","evenodd");const y=E.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const w=E.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"transform","translate(3.0, 29.0)"),w.setAttributeNS(null,"fill","#000000");const A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ae of A){const ue=E.createNS("http://www.w3.org/2000/svg","ellipse");ue.setAttributeNS(null,"opacity","0.04"),ue.setAttributeNS(null,"cx","10.5"),ue.setAttributeNS(null,"cy","5.80029008"),ue.setAttributeNS(null,"rx",ae.rx),ue.setAttributeNS(null,"ry",ae.ry),w.appendChild(ue)}const R=E.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"fill",this._color);const D=E.createNS("http://www.w3.org/2000/svg","path");D.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),R.appendChild(D);const N=E.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"opacity","0.25"),N.setAttributeNS(null,"fill","#000000");const O=E.createNS("http://www.w3.org/2000/svg","path");O.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),N.appendChild(O);const Z=E.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Z.setAttributeNS(null,"fill","#FFFFFF");const K=E.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ne=E.createNS("http://www.w3.org/2000/svg","circle");ne.setAttributeNS(null,"fill","#000000"),ne.setAttributeNS(null,"opacity","0.25"),ne.setAttributeNS(null,"cx","5.5"),ne.setAttributeNS(null,"cy","5.5"),ne.setAttributeNS(null,"r","5.4999962");const ie=E.createNS("http://www.w3.org/2000/svg","circle");ie.setAttributeNS(null,"fill","#FFFFFF"),ie.setAttributeNS(null,"cx","5.5"),ie.setAttributeNS(null,"cy","5.5"),ie.setAttributeNS(null,"r","5.4999962"),K.appendChild(ne),K.appendChild(ie),y.appendChild(w),y.appendChild(R),y.appendChild(N),y.appendChild(Z),y.appendChild(K),r.appendChild(y),r.setAttributeNS(null,"height",a*this._scale+"px"),r.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(r),this._offset=s.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",r=>{r.preventDefault()}),this._element.addEventListener("mousedown",r=>{r.preventDefault()}),Qc(this._element,this._anchor,"marker"),e&&e.className)for(const r of e.className.split(" "))this._element.classList.add(r);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),E.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=s.Q.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const l=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var r,a;const l=(r=this._map)===null||r===void 0?void 0:r.terrain,p=this._map.transform.isLocationOccluded(this._lngLat);if(!l||p){const Z=p?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==Z&&(this._element.style.opacity=Z))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const y=this._map,w=y.terrain.depthAtPoint(this._pos),A=y.terrain.getElevationForLngLatZoom(this._lngLat,y.transform.tileZoom);if(y.transform.lngLatToCameraDepth(this._lngLat,A)-w<.006)return void(this._element.style.opacity=this._opacity);const R=-this._offset.y/y.transform.pixelsPerMeter,D=Math.sin(y.getPitch()*Math.PI/180)*R,N=y.terrain.depthAtPoint(new s.P(this._pos.x,this._pos.y-this._offset.y)),O=y.transform.lngLatToCameraDepth(this._lngLat,A+D)-N>.006;!((a=this._popup)===null||a===void 0)&&a.isOpen()&&O&&this._popup.remove(),this._element.style.opacity=O?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=s.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,r){return(this._opacity===void 0||e===void 0&&r===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),r!==void 0&&(this._opacityWhenCovered=r),this._map&&this._updateOpacity(!0),this}}const wr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let fr=0,Is=!1;const mo={maxWidth:100,unit:"metric"};function go(h,e,r){const a=r&&r.maxWidth||100,l=h._container.clientHeight/2,p=h._container.clientWidth/2,y=h.unproject([p-a/2,l]),w=h.unproject([p+a/2,l]),A=Math.round(h.project(w).x-h.project(y).x),R=Math.min(a,A,h._container.clientWidth),D=y.distanceTo(w);if(r&&r.unit==="imperial"){const N=3.2808*D;N>5280?$n(e,R,N/5280,h._getUIString("ScaleControl.Miles")):$n(e,R,N,h._getUIString("ScaleControl.Feet"))}else r&&r.unit==="nautical"?$n(e,R,D/1852,h._getUIString("ScaleControl.NauticalMiles")):D>=1e3?$n(e,R,D/1e3,h._getUIString("ScaleControl.Kilometers")):$n(e,R,D,h._getUIString("ScaleControl.Meters"))}function $n(h,e,r,a){const l=function(p){const y=Math.pow(10,`${Math.floor(p)}`.length-1);let w=p/y;return w=w>=10?10:w>=5?5:w>=3?3:w>=2?2:w>=1?1:function(A){const R=Math.pow(10,Math.ceil(-Math.log(A)/Math.LN10));return Math.round(A*R)/R}(w),y*w}(r);h.style.width=e*(l/r)+"px",h.innerHTML=`${l} ${a}`}const kl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},Cl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ms(h){if(h){if(typeof h=="number"){const e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new s.P(0,0),top:new s.P(0,h),"top-left":new s.P(e,e),"top-right":new s.P(-e,e),bottom:new s.P(0,-h),"bottom-left":new s.P(e,-e),"bottom-right":new s.P(-e,-e),left:new s.P(h,0),right:new s.P(-h,0)}}if(h instanceof s.P||Array.isArray(h)){const e=s.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:s.P.convert(h.center||[0,0]),top:s.P.convert(h.top||[0,0]),"top-left":s.P.convert(h["top-left"]||[0,0]),"top-right":s.P.convert(h["top-right"]||[0,0]),bottom:s.P.convert(h.bottom||[0,0]),"bottom-left":s.P.convert(h["bottom-left"]||[0,0]),"bottom-right":s.P.convert(h["bottom-right"]||[0,0]),left:s.P.convert(h.left||[0,0]),right:s.P.convert(h.right||[0,0])}}return Ms(new s.P(0,0))}const Tl=V;x.AJAXError=s.cq,x.Event=s.l,x.Evented=s.E,x.LngLat=s.Q,x.MercatorCoordinate=s.$,x.Point=s.P,x.addProtocol=s.cr,x.config=s.a,x.removeProtocol=s.cs,x.AttributionControl=lr,x.BoxZoomHandler=ml,x.CanvasSource=ir,x.CooperativeGesturesHandler=fa,x.DoubleClickZoomHandler=da,x.DragPanHandler=Zc,x.DragRotateHandler=Kc,x.EdgeInsets=js,x.FullscreenControl=class extends s.E{constructor(h={}){super(),this._onFullscreenChange=()=>{var e;let r=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=r==null?void 0:r.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)r=r.shadowRoot.fullscreenElement;r===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:s.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){E.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const h=this._fullscreenButton=E.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);E.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new s.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new s.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},x.GeoJSONSource=Qt,x.GeolocateControl=class extends s.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new s.l("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new s.l("geolocate",e)),this._finish()}},this._updateCamera=e=>{const r=new s.Q(e.coords.longitude,e.coords.latitude),a=e.coords.accuracy,l=this._map.getBearing(),p=s.e({bearing:l},this.options.fitBoundsOptions),y=dt.fromLngLat(r,a);this._map.fitBounds(y,p,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const r=new s.Q(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Is)return;this.options.trackUserLocation&&this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new s.l("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=E.create("button","maplibregl-ctrl-geolocate",this._container),E.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){s.w("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=E.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Yn({element:this._dotElement}),this._circleElement=E.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Yn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||this._watchState!=="ACTIVE_LOCK"||r.originalEvent&&r.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new s.l("trackuserlocationend")),this.fire(new s.l("userlocationlostfocus")))})}},this.options=s.e({},wr,h)}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return s._(this,arguments,void 0,function*(e=!1){if(zr!==void 0&&!e)return zr;if(window.navigator.permissions===void 0)return zr=!!window.navigator.geolocation,zr;try{zr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{zr=!!window.navigator.geolocation}return zr})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),E.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,fr=0,Is=!1}_isOutOfMapMaxBounds(h){const e=this._map.getMaxBounds(),r=h.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const h=this._map.getBounds(),e=h.getSouthEast(),r=h.getNorthEast(),a=e.distanceTo(r),l=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return s.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new s.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":fr--,Is=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new s.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.l("trackuserlocationstart")),this.fire(new s.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),fr++,fr>1?(h={maximumAge:6e5,timeout:0},Is=!0):(h=this.options.positionOptions,Is=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},x.GlobeControl=class{constructor(){this._toggleProjection=()=>{var h;const e=(h=this._map.getProjection())===null||h===void 0?void 0:h.type;this._map.setProjection(e!=="mercator"&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var h;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((h=this._map.getProjection())===null||h===void 0?void 0:h.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=E.create("button","maplibregl-ctrl-globe",this._container),E.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){E.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},x.Hash=hl,x.ImageSource=Rr,x.KeyboardHandler=Ps,x.LngLatBounds=dt,x.LogoControl=po,x.Map=class extends Oh{constructor(h){var e,r;s.cn.mark(s.co.create);const a=Object.assign(Object.assign(Object.assign({},fo),h),{canvasContextAttributes:Object.assign(Object.assign({},fo.canvasContextAttributes),h.canvasContextAttributes)});if(a.minZoom!=null&&a.maxZoom!=null&&a.minZoom>a.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(a.minPitch!=null&&a.maxPitch!=null&&a.minPitch>a.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(a.minPitch!=null&&a.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(a.maxPitch!=null&&a.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const l=new ds,p=new Ws;if(a.minZoom!==void 0&&l.setMinZoom(a.minZoom),a.maxZoom!==void 0&&l.setMaxZoom(a.maxZoom),a.minPitch!==void 0&&l.setMinPitch(a.minPitch),a.maxPitch!==void 0&&l.setMaxPitch(a.maxPitch),a.renderWorldCopies!==void 0&&l.setRenderWorldCopies(a.renderWorldCopies),super(l,p,{bearingSnap:a.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new bl,this._controls=[],this._mapId=s.a4(),this._contextLost=w=>{w.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new s.l("webglcontextlost",{originalEvent:w}))},this._contextRestored=w=>{this._setupPainter(),this.resize(),this._update(),this.fire(new s.l("webglcontextrestored",{originalEvent:w}))},this._onMapScroll=w=>{if(w.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=a.interactive,this._maxTileCacheSize=a.maxTileCacheSize,this._maxTileCacheZoomLevels=a.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},a.canvasContextAttributes),this._trackResize=a.trackResize===!0,this._bearingSnap=a.bearingSnap,this._centerClampedToGround=a.centerClampedToGround,this._refreshExpiredTiles=a.refreshExpiredTiles===!0,this._fadeDuration=a.fadeDuration,this._crossSourceCollisions=a.crossSourceCollisions===!0,this._collectResourceTiming=a.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ct),a.locale),this._clickTolerance=a.clickTolerance,this._overridePixelRatio=a.pixelRatio,this._maxCanvasSize=a.maxCanvasSize,this.transformCameraUpdate=a.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=a.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=$.addThrottleControl(()=>this.isMoving()),this._requestManager=new de(a.transformRequest),typeof a.container=="string"){if(this._container=document.getElementById(a.container),!this._container)throw new Error(`Container '${a.container}' not found.`)}else{if(!(a.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=a.container}if(a.maxBounds&&this.setMaxBounds(a.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let w=!1;const A=lo(R=>{this._trackResize&&!this._removed&&(this.resize(R),this.redraw())},50);this._resizeObserver=new ResizeObserver(R=>{w?A(R):w=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Fh(this,a),this._hash=a.hash&&new hl(typeof a.hash=="string"&&a.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,roll:a.roll}),a.bounds&&(this.resize(),this.fitBounds(a.bounds,s.e({},a.fitBoundsOptions,{duration:0}))));const y=typeof a.style=="string"||((r=(e=a.style)===null||e===void 0?void 0:e.projection)===null||r===void 0?void 0:r.type)!=="globe";this.resize(null,y),this._localIdeographFontFamily=a.localIdeographFontFamily,this._validateStyle=a.validateStyle,a.style&&this.setStyle(a.style,{localIdeographFontFamily:a.localIdeographFontFamily}),a.attributionControl&&this.addControl(new lr(typeof a.attributionControl=="boolean"?void 0:a.attributionControl)),a.maplibreLogo&&this.addControl(new po,a.logoPosition),this.on("style.load",()=>{if(y||this._resizeTransform(),this.transform.unmodified){const w=s.O(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(w)}}),this.on("data",w=>{this._update(w.dataType==="style"),this.fire(new s.l(`${w.dataType}data`,w))}),this.on("dataloading",w=>{this.fire(new s.l(`${w.dataType}dataloading`,w))}),this.on("dataabort",w=>{this.fire(new s.l("sourcedataabort",w))})}_getMapId(){return this._mapId}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new s.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=h.onAdd(this);this._controls.push(h);const a=this._controlPositions[e];return e.indexOf("bottom")!==-1?a.insertBefore(r,a.firstChild):a.appendChild(r),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new s.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,e,r,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,r,a)}resize(h,e=!0){const[r,a]=this._containerDimensions(),l=this._getClampedPixelRatio(r,a);if(this._resizeCanvas(r,a,l),this.painter.resize(r,a,l),this.painter.overLimit()){const y=this.painter.context.gl;this._maxCanvasSize=[y.drawingBufferWidth,y.drawingBufferHeight];const w=this._getClampedPixelRatio(r,a);this._resizeCanvas(r,a,w),this.painter.resize(r,a,w)}this._resizeTransform(e);const p=!this._moving;return p&&(this.stop(),this.fire(new s.l("movestart",h)).fire(new s.l("move",h))),this.fire(new s.l("resize",h)),p&&this.fire(new s.l("moveend",h)),this}_resizeTransform(h=!0){var e;const[r,a]=this._containerDimensions();this.transform.resize(r,a,h),(e=this._requestedCameraState)===null||e===void 0||e.resize(r,a,h)}_getClampedPixelRatio(h,e){const{0:r,1:a}=this._maxCanvasSize,l=this.getPixelRatio(),p=h*l,y=e*l;return Math.min(p>r?r/p:1,y>a?a/y:1)*l}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(dt.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.setMinZoom(h),this._update(),this.getZoom()<h&&this.setZoom(h),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(h){if((h=h??22)>=this.transform.minZoom)return this.transform.setMaxZoom(h),this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.setMinPitch(h),this._update(),this.getPitch()<h&&this.setPitch(h),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(h){if((h=h??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(h>=this.transform.minPitch)return this.transform.setMaxPitch(h),this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.setRenderWorldCopies(h),this._update()}project(h){return this.transform.locationToScreenPoint(s.Q.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.screenPointToLocation(s.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,r){if(h==="mouseenter"||h==="mouseover"){let a=!1;return{layers:e,listener:r,delegates:{mousemove:p=>{const y=e.filter(A=>this.getLayer(A)),w=y.length!==0?this.queryRenderedFeatures(p.point,{layers:y}):[];w.length?a||(a=!0,r.call(this,new Ur(h,this,p.originalEvent,{features:w}))):a=!1},mouseout:()=>{a=!1}}}}if(h==="mouseleave"||h==="mouseout"){let a=!1;return{layers:e,listener:r,delegates:{mousemove:y=>{const w=e.filter(A=>this.getLayer(A));(w.length!==0?this.queryRenderedFeatures(y.point,{layers:w}):[]).length?a=!0:a&&(a=!1,r.call(this,new Ur(h,this,y.originalEvent)))},mouseout:y=>{a&&(a=!1,r.call(this,new Ur(h,this,y.originalEvent)))}}}}{const a=l=>{const p=e.filter(w=>this.getLayer(w)),y=p.length!==0?this.queryRenderedFeatures(l.point,{layers:p}):[];y.length&&(l.features=y,r.call(this,l),delete l.features)};return{layers:e,listener:r,delegates:{[h]:a}}}}_saveDelegatedListener(h,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(e)}_removeDelegatedListener(h,e,r){if(!this._delegatedListeners||!this._delegatedListeners[h])return;const a=this._delegatedListeners[h];for(let l=0;l<a.length;l++){const p=a[l];if(p.listener===r&&p.layers.length===e.length&&p.layers.every(y=>e.includes(y))){for(const y in p.delegates)this.off(y,p.delegates[y]);return void a.splice(l,1)}}}on(h,e,r){if(r===void 0)return super.on(h,e);const a=typeof e=="string"?[e]:e,l=this._createDelegatedListener(h,a,r);this._saveDelegatedListener(h,l);for(const p in l.delegates)this.on(p,l.delegates[p]);return{unsubscribe:()=>{this._removeDelegatedListener(h,a,r)}}}once(h,e,r){if(r===void 0)return super.once(h,e);const a=typeof e=="string"?[e]:e,l=this._createDelegatedListener(h,a,r);for(const p in l.delegates){const y=l.delegates[p];l.delegates[p]=(...w)=>{this._removeDelegatedListener(h,a,r),y(...w)}}this._saveDelegatedListener(h,l);for(const p in l.delegates)this.once(p,l.delegates[p]);return this}off(h,e,r){return r===void 0?super.off(h,e):(this._removeDelegatedListener(h,typeof e=="string"?[e]:e,r),this)}queryRenderedFeatures(h,e){if(!this.style)return[];let r;const a=h instanceof s.P||Array.isArray(h),l=a?h:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(a?{}:h)||{},l instanceof s.P||typeof l[0]=="number")r=[s.P.convert(l)];else{const p=s.P.convert(l[0]),y=s.P.convert(l[1]);r=[p,new s.P(y.x,p.y),y,new s.P(p.x,y.y),p]}return this.style.queryRenderedFeatures(r,e,this.transform)}querySourceFeatures(h,e){return this.style.querySourceFeatures(h,e)}setStyle(h,e){return(e=s.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&h?(this._diffStyle(h,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(h,e))}setTransformRequest(h){return this._requestManager.setTransformRequest(h),this}_getUIString(h){const e=this._locale[h];if(e==null)throw new Error(`Missing UI string '${h}'`);return e}_updateStyle(h,e){var r,a;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(h,e));const l=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new Ka(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,l):this.style.loadJSON(h,e,l),this):((a=(r=this.style)===null||r===void 0?void 0:r.projection)===null||a===void 0||a.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ka(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){const r=this._requestManager.transformRequest(h,"Style");s.j(r,new AbortController).then(a=>{this._updateDiff(a.data,e)}).catch(a=>{a&&this.fire(new s.k(a))})}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(r){s.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():s.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){const e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new s.k(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){const e=this.style.sourceCaches[h.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);this.terrain===null&&e.reload();for(const r in this.style._layers){const a=this.style._layers[r];a.type==="hillshade"&&a.source===h.source&&s.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Xc(this.painter,e,h),this.painter.renderToTexture=new ga(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=r=>{var a;r.dataType==="style"?this.terrain.sourceCache.freeRtt():r.dataType==="source"&&r.tile&&(r.sourceId!==h.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((a=r.source)===null||a===void 0?void 0:a.type)==="image"?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(r.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new s.l("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const h=this.style&&this.style.sourceCaches;for(const e in h){const r=h[e]._tiles;for(const a in r){const l=r[a];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}setSourceTileLodParams(h,e,r){if(r){const a=this.getSource(r);if(!a)throw new Error(`There is no source with ID "${r}", cannot set LOD parameters`);a.calculateTileZoom=_e(Math.max(1,h),Math.max(1,e))}else for(const a in this.style.sourceCaches)this.style.sourceCaches[a].getSource().calculateTileZoom=_e(Math.max(1,h),Math.max(1,e));return this._update(!0),this}refreshTiles(h,e){const r=this.style.sourceCaches[h];if(!r)throw new Error(`There is no source cache with ID "${h}", cannot refresh tile`);e===void 0?r.reload():r.refreshTiles(e.map(a=>new s.a1(a.z,a.x,a.y)))}addImage(h,e,r={}){const{pixelRatio:a=1,sdf:l=!1,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R}=r;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||s.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new s.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:D,height:N,data:O}=e,Z=e;return this.style.addImage(h,{data:new s.R({width:D,height:N},new Uint8Array(O)),pixelRatio:a,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R,sdf:l,version:0,userImage:Z}),Z.onAdd&&Z.onAdd(this,h),this}}{const{width:D,height:N,data:O}=M.getImageData(e);this.style.addImage(h,{data:new s.R({width:D,height:N},O),pixelRatio:a,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R,sdf:l,version:0})}}updateImage(h,e){const r=this.style.getImage(h);if(!r)return this.fire(new s.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=e instanceof HTMLImageElement||s.b(e)?M.getImageData(e):e,{width:l,height:p,data:y}=a;if(l===void 0||p===void 0)return this.fire(new s.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==r.data.width||p!==r.data.height)return this.fire(new s.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const w=!(e instanceof HTMLImageElement||s.b(e));return r.data.replace(y,w),this.style.updateImage(h,r),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new s.k(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h){return $.getImage(this._requestManager.transformRequest(h,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,r){return this.style.setLayerZoomRange(h,e,r),this._update(!0)}setFilter(h,e,r={}){return this.style.setFilter(h,e,r),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,r,a={}){return this.style.setPaintProperty(h,e,r,a),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,r,a={}){return this.style.setLayoutProperty(h,e,r,a),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,r,a=>{a||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,r=>{r||this._update(!0)}),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(h,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){const h=this._container;h.classList.add("maplibregl-map");const e=this._canvasContainer=E.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=E.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const r=this._containerDimensions(),a=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],a);const l=this._controlContainer=E.create("div","maplibregl-control-container",h),p=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(y=>{p[y]=E.create("div",`maplibregl-ctrl-${y} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(h,e,r){this._canvas.width=Math.floor(r*h),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const h=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{e={requestedAttributes:h},a&&(e.statusMessage=a.statusMessage,e.type=a.type)},{once:!0});let r=null;if(r=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,h):this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h),!r){const a="Failed to initialize WebGL";throw e?(e.message=a,new Error(JSON.stringify(e))):new Error(a)}this.painter=new ul(r,this.transform),C.testSupport(r)}migrateProjection(h,e){super.migrateProjection(h,e),this.painter.transform=h,this.fire(new s.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){var e,r,a,l,p;const y=this._idleTriggered?this._fadeDuration:0,w=((e=this.style.projection)===null||e===void 0?void 0:e.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let A=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const N=this.transform.zoom,O=M.now();this.style.zoomHistory.update(N,O);const Z=new s.C(N,{now:O,fadeDuration:y,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),K=Z.crossFadingFactor();K===1&&K===this._crossFadingFactor||(A=!0,this._crossFadingFactor=K),this.style.update(Z)}const R=((r=this.style.projection)===null||r===void 0?void 0:r.transitionState)>0!==w;(a=this.style.projection)===null||a===void 0||a.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((l=this.style.projection)===null||l===void 0?void 0:l.transitionState,(p=this.style.projection)===null||p===void 0?void 0:p.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||R)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,y,this._crossSourceCollisions,R),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:y,showPadding:this.showPadding}),this.fire(new s.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,s.cn.mark(s.co.load),this.fire(new s.l("load"))),this.style&&(this.style.hasTransitions()||A)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const D=this._sourcesDirty||this._styleDirty||this._placementDirty;return D||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new s.l("idle")),!this._loaded||this._fullyLoaded||D||(this._fullyLoaded=!0,s.cn.mark(s.co.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(const r of this._controls)r.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),$.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),E.remove(this._canvasContainer),E.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),s.cn.clearMetrics(),this._removed=!0,this.fire(new s.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,M.frame(this._frameRequest,h=>{s.cn.frame(h),this._frameRequest=null;try{this._render(h)}catch(e){if(!s.cp(e)&&!function(r){return r.message===Yo}(e))throw e}},()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return yt}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(h){return this._lazyInitEmptyStyle(),this.style.setProjection(h),this._update(!0)}},x.MapMouseEvent=Ur,x.MapTouchEvent=Ss,x.MapWheelEvent=fl,x.Marker=Yn,x.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{const e=this._map.getZoom(),r=e===this._map.getMaxZoom(),a=e===this._map.getMinZoom();this._zoomInButton.disabled=r,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",r.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(e,r)=>{const a=this._map._getUIString(`NavigationControl.${r}`);e.title=a,e.setAttribute("aria-label",a)},this.options=s.e({},wl,h),this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),E.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),E.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=E.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Sl(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){E.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){const r=E.create("button",h,this._container);return r.type="button",r.addEventListener("click",e),r}},x.Popup=class extends s.E{constructor(h){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:void 0)},this.remove=()=>(this._content&&E.remove(this._content),this._container&&(E.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new s.l("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=E.create("div","maplibregl-popup",this._map.getContainer()),this._tip=E.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const y of this.options.className.split(" "))this._container.classList.add(y);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Al(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!e)return;const r=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let a=this.options.anchor;const l=Ms(this.options.offset);if(!a){const y=this._container.offsetWidth,w=this._container.offsetHeight;let A;A=r.y+l.bottom.y<w?["top"]:r.y>this._map.transform.height-w?["bottom"]:[],r.x<y/2?A.push("left"):r.x>this._map.transform.width-y/2&&A.push("right"),a=A.length===0?"bottom":A.join("-")}let p=r.add(l[a]);this.options.subpixelPositioning||(p=p.round()),E.setTransform(this._container,`${qi[a]} translate(${p.x}px,${p.y}px)`),Qc(this._container,a,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=s.e(Object.create(kl),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new s.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=s.Q.convert(h),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){const e=document.createDocumentFragment(),r=document.createElement("body");let a;for(r.innerHTML=h;a=r.firstChild,a;)e.appendChild(a);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=E.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){return this._container&&this._container.classList.add(h),this}removeClassName(h){return this._container&&this._container.classList.remove(h),this}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}setSubpixelPositioning(h){this.options.subpixelPositioning=h}_createCloseButton(){this.options.closeButton&&(this._closeButton=E.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const h=this._container.querySelector(Cl);h&&h.focus()}},x.RasterDEMTileSource=Fi,x.RasterTileSource=Yt,x.ScaleControl=class{constructor(h){this._onMove=()=>{go(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,go(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},mo),h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){E.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},x.ScrollZoomHandler=Bt,x.Style=Ka,x.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=h}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=E.create("button","maplibregl-ctrl-terrain",this._container),E.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){E.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},x.TwoFingersTouchPitchHandler=pa,x.TwoFingersTouchRotateHandler=nt,x.TwoFingersTouchZoomHandler=Es,x.TwoFingersTouchZoomRotateHandler=xl,x.VectorTileSource=bi,x.VideoSource=ai,x.addSourceType=(h,e)=>s._(void 0,void 0,void 0,function*(){if(bt(h))throw new Error(`A source type called "${h}" already exists.`);((r,a)=>{Xt[r]=a})(h,e)}),x.clearPrewarmedResources=function(){const h=Pi;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(An),Pi=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},x.createTileMesh=Hs,x.getMaxParallelImageRequests=function(){return s.a.MAX_PARALLEL_IMAGE_REQUESTS},x.getRTLTextPluginStatus=function(){return zt().getRTLTextPluginStatus()},x.getVersion=function(){return Tl},x.getWorkerCount=function(){return Kr.workerCount},x.getWorkerUrl=function(){return s.a.WORKER_URL},x.importScriptInWorkers=function(h){return ut().broadcast("IS",h)},x.prewarm=function(){et().acquire(An)},x.setMaxParallelImageRequests=function(h){s.a.MAX_PARALLEL_IMAGE_REQUESTS=h},x.setRTLTextPlugin=function(h,e){return zt().setRTLTextPlugin(h,e)},x.setWorkerCount=function(h){Kr.workerCount=h},x.setWorkerUrl=function(h){s.a.WORKER_URL=h}});var T=_;return T})}(Qu)),Qu.exports}var fx=dx();const $p=Jg(fx),Gt=(u,f)=>{const _=u.__vccOpts||u;for(const[b,k]of f)_[b]=k;return _},mx={key:0,class:"p-5 pb-0 flex justify-between items-center"},gx={class:"inline-block font-semibold text-lg text-gray-800"},yx={class:"flex flex-col gap-1 p-5"},_x={class:"flex items-center justify-between w-full text-sm text-gray-800"},vx={key:0,class:"ms-2 text-xs text-gray-500"},xx={__name:"vs-legend-widget",props:{config:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var k;return((k=f.config)==null?void 0:k.items)||[]}),b=g.computed(()=>{var k;return((k=f.config)==null?void 0:k.title)||""});return(k,T)=>(g.openBlock(),g.createElementBlock("div",{class:"legend-widget flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative",style:g.normalizeStyle({width:u.config.width||"100%"})},[b.value?(g.openBlock(),g.createElementBlock("div",mx,[g.createElementVNode("h2",gx,g.toDisplayString(b.value),1)])):g.createCommentVNode("",!0),g.createElementVNode("div",yx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.value,x=>(g.openBlock(),g.createElementBlock("div",{class:"flex items-center",key:x.label},[g.createElementVNode("span",{class:g.normalizeClass(["shrink-0 size-2.5 inline-block me-2.5",[x.shape==="square"?"rounded-sm":"",x.shape==="circle"?"rounded-full":"",x.shape==="line"?"w-6 h-0.5":"",x.shape==="dashed-line"?"w-6 h-0.5 dashed-line":""]]),style:g.normalizeStyle({backgroundColor:x.color})},null,6),g.createElementVNode("span",_x,[g.createElementVNode("span",null,g.toDisplayString(x.label),1),x.count!==void 0?(g.openBlock(),g.createElementBlock("span",vx," ("+g.toDisplayString(x.count)+") ",1)):g.createCommentVNode("",!0)])]))),128))])],4))}},bx=Gt(xx,[["__scopeId","data-v-c521b2f4"]]),wx="data:image/png;base64,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",Sx={class:"flex flex-row gap-x-3 z-10 relative"},Ax=["onClick"],kx=["src","alt"],Cx={__name:"vs-basemaps-widget",props:{map:{type:Object,required:!0},config:{type:Object,default:()=>({})},position:{type:String,default:"bottom-left"}},setup(u){const f=u,_=g.ref("voyager"),b=g.computed(()=>{var V;if(!((V=f.config)!=null&&V.layers))return[];const s=f.config.layers.map(I=>({id:I.id,title:I.label||I.title,url:I.url,service:I.type,category:"Базові карти",attribution:I.attribution,image:I.image,enabled:!0,owner:I.owner||"Unknown"}));return s.push({id:"__none__",title:"Без підложки",url:"",service:"",category:"Базові карти",attribution:"",image:wx,enabled:!0,owner:""}),s});function k(s){return{version:8,sources:{[s.id]:{type:"raster",tiles:[s.url],tileSize:256,attribution:s.attribution||""}},layers:[{id:s.id,type:"raster",source:s.id}]}}const T=s=>{if(!f.map)return;const V=f.map.getStyle(),I=b.value.map(E=>E.id),L=V.layers.filter(E=>!I.includes(E.id)),F={};for(const E in V.sources)I.includes(E)||(F[E]=V.sources[E]);if(s.id==="__none__"){const E={version:8,sources:{...F},layers:[...L]};f.map.setStyle(E);return}const M=k(s);f.map.setStyle(M),f.map.once("styledata",()=>{for(const[E,C]of Object.entries(F))f.map.getSource(E)||f.map.addSource(E,C);for(const E of L)f.map.getLayer(E.id)||f.map.addLayer(E)})},x=s=>{_.value=s;const V=b.value.find(I=>I.id===s);V&&f.map&&T(V)};return g.onMounted(()=>{var s;(s=f.config)!=null&&s.default&&(_.value=f.config.default),x(_.value)}),(s,V)=>{const I=g.resolveComponent("VsPopover");return g.openBlock(),g.createElementBlock("div",Sx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(b.value,L=>(g.openBlock(),g.createBlock(I,{trigger:"hover",placement:"top",key:L.id},{reference:g.withCtx(()=>[g.createElementVNode("div",{class:g.normalizeClass(["w-14 h-14 flex items-center justify-center bg-white rounded-xl shadow-2xs cursor-pointer transition-all border-4",_.value===L.id?"border-blue-400":"border-transparent"]),onClick:F=>x(L.id)},[g.createElementVNode("img",{src:L.image,alt:L.title,class:g.normalizeClass(["object-cover rounded-lg",L.id==="__none__"?"w-10 h-10":"w-12 h-12"])},null,10,kx)],10,Ax)]),default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(L.title)+" ",1)]),_:2},1024))),128))])}}};function Da(u){if(!u.attrType||!u.attribute||!u.rules)return u.color||"#ccc";const f=u.rules.map(_=>[["==",["get",u.attribute],_.id||_.value],_.color]);return f.push(u.color||"#ccc"),["case",...f.flat()]}function Tx(u){if(!u.attrType||u.attrType!=="icon-by-attribute"||!u.attribute||!u.rules)return u.default_icon||null;const f=u.rules.map(_=>[["==",["get",u.attribute],_.value],_.icon]);return f.push(u.default_icon||"marker.svg"),["case",...f.flat()]}function Qg(u){if(!u.attrType||u.attrType!=="attribute-pattern"||!u.attribute||!u.rules)return u.fillPattern||"";const f=u.rules.map(_=>[["==",["get",u.attribute],_.value],_.fillPattern||""]);return f.push(u.fillPattern||""),["case",...f.flat()]}function os(u,f="stroke",_="#ccc"){return["case",["boolean",["feature-state","hovered"],!1],"#ff0000",["boolean",["feature-state","selected"],!1],"#ff0000",u[f]||_]}function Ex(u){const f=[{type:"fill",minzoom:u.pointZoom||0,paint:{"fill-color":Da(u),"fill-outline-color":os(u,"stroke","#ccc"),"fill-opacity":u.opacity||1,...u.attrType==="attribute-pattern"&&{"fill-pattern":Qg(u)},...u.fillPattern&&!u.attrType&&{"fill-pattern":u.fillPattern}}},{type:"line",paint:{"line-color":os(u,"stroke","#ccc"),"line-width":u.width||2,"line-opacity":u.lineOpacity||u.opacity||1}}];return u.pointZoom&&f.push({type:"circle",maxzoom:u.pointZoom,paint:{"circle-color":u.color||"#ccc","circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-opacity":u.opacity||1}}),f}function Px(u){return[{type:"line",paint:{"line-color":os(u,"color",Da(u)),"line-width":u.width||2,"line-opacity":u.opacity||1,...u.dashArray&&{"line-dasharray":u.dashArray}},layout:{...u.lineCap&&{"line-cap":u.lineCap},...u.lineJoin&&{"line-join":u.lineJoin}}}]}function Ix(u){const f=[{type:"circle",maxzoom:u.icon&&+u.iconZoom||22,paint:{"circle-radius":u.radius||6,"circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-color":Da(u),"circle-opacity":u.opacity||1}}];return u!=null&&u.clusterZoom?(f.push({type:"circle",filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],"#51bbd6",100,"#f1f075",750,"#f28cb1"],"circle-radius":["step",["get","point_count"],20,100,30,750,40]}}),f.push({type:"symbol",filter:["has","point_count"],layout:{"text-field":["get","point_count"],"text-font":["Open Sans Regular"],"text-size":12}})):u.icon&&f.push({type:"symbol",minzoom:+u.iconZoom||16,layout:{"icon-image":u.icon,"icon-allow-overlap":!0}}),f}function Mx(u,f,_){const b=u.type||"point";return b==="polygon"?[{type:"fill",..._!==void 0?{maxzoom:_}:{},paint:{"fill-color":Da(u),"fill-outline-color":os(u,"stroke","#ccc"),"fill-opacity":u.opacity||1,...u.attrType==="attribute-pattern"&&{"fill-pattern":Qg(u)},...u.fillPattern&&!u.attrType&&{"fill-pattern":u.fillPattern}}},{type:"line",..._!==void 0?{maxzoom:_}:{},paint:{"line-color":os(u,"stroke","#ccc"),"line-width":u.width||2,"line-opacity":u.lineOpacity||u.opacity||1}}]:b==="line"?[{type:"line",..._!==void 0?{maxzoom:_}:{},paint:{"line-color":os(u,"color",Da(u)),"line-width":u.width||2,"line-opacity":u.opacity||1,...u.dashArray&&{"line-dasharray":u.dashArray}},layout:{...u.lineCap&&{"line-cap":u.lineCap},...u.lineJoin&&{"line-join":u.lineJoin}}}]:[{type:"circle",..._!==void 0?{maxzoom:_}:{},paint:{"circle-radius":u.radius||6,"circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-color":Da(u),"circle-opacity":u.opacity||1}}]}function Yg(u){var _,b;if(!u)return null;if(u.attrType==="icon-by-attribute"&&u.iconZoom){const k=Tx(u),T=Array.isArray(k)&&k[0]==="case"?k:["case",["==",["get",u.attribute],((b=(_=u.rules)==null?void 0:_[0])==null?void 0:b.value)||""],k,k],x=Mx(u,void 0,+u.iconZoom),s={type:"symbol",minzoom:+u.iconZoom,layout:{"icon-image":T,"icon-size":(u==null?void 0:u.icon_size)||1,"icon-allow-overlap":!0,"icon-anchor":(u==null?void 0:u.icon_anchor)||"bottom"},paint:{"icon-opacity":u.opacity||1}};return[...x,s]}const f=u.type||"point";return f==="polygon"?Ex(u):f==="line"?Px(u):Ix(u)}function Lx(u){return u.startsWith("http")?u:`${window.location.origin}${u}`}function Rx(u){const{id:f,sourceLayer:_,url:b,bounds:k,title:T,style:x,service:s,service_type:V,source_type:I,data:L}=u,F=Lx(b),M=V||s||I||"vector";switch(M){case"vtile":case"vector":return Dx(f,_,F,k,T,x);case"raster":return Vx(f,F,k,T,x);case"geojson":return zx(f,L||F,k,T,x);default:throw new Error(`Unsupported layer service type: ${M}`)}}function Bx(u){switch(u){case"polygon":return{type:"polygon",color:"#3388ff",opacity:.5};case"line":return{type:"line",color:"#3388ff",opacity:1};case"point":default:return{type:"point",color:"#3388ff",radius:6,opacity:1}}}function Dx(u,f,_,b,k,T){const x=f||(_.match(/\/vtile\/([^/]+)/)||[])[1]||u,s={type:"vector",tiles:[_],...b&&{bounds:b}},L=Yg(T||{}).map((F,M)=>({...F,id:`${u}-${M}`,"source-layer":x,source:u}));return{id:u,title:k,source:s,layers:L,visible:!0}}function Vx(u,f,_,b,k){const T={type:"raster",tiles:[f],tileSize:256,..._&&{bounds:_}},x=k||{},s={id:u,type:"raster",source:u,layout:{visibility:"visible"},...x&&{paint:x}};return{id:u,title:b,source:T,layers:[s],visible:!0}}function zx(u,f,_,b,k){var L;const T={type:"geojson",data:f,..._&&{bounds:_}};let x="point";if(f&&f.features&&f.features.length>0){const F=(L=f.features[0].geometry)==null?void 0:L.type;F==="Polygon"||F==="MultiPolygon"?x="polygon":F==="LineString"||F==="MultiLineString"?x="line":x="point"}const s=k||Bx(x),I=Yg(s).map((F,M)=>({...F,id:`${u}-${M}`,source:u}));return{id:u,title:b,source:T,layers:I,visible:!0}}function Fx(u){if(!u||u.attrType!=="icon-by-attribute")return[];const f=new Set;return u.default_icon&&f.add(u.default_icon),Array.isArray(u.rules)&&u.rules.forEach(_=>{_.icon&&f.add(_.icon)}),Array.from(f).map(_=>({name:_,url:(u.icon_base_url||"")+_}))}function Ox(u){const f=new Set;function _(b){typeof b=="string"?f.add(b):Array.isArray(b)&&b.forEach(_)}return u&&u["icon-image"]&&_(u["icon-image"]),Array.from(f)}async function $g(u,f){const _=f.map(async({name:b,url:k})=>{const T=await u.loadImage(k);return{name:b,data:T.data}});try{const b=await Promise.all(_);for(const{name:k,data:T}of b)u.hasImage(k)||u.addImage(k,T)}catch(b){console.error("Failed to load icons:",b)}}function Nx(u,f,_="/icons/"){const k=Ox(f).map(T=>({name:T,url:_+T}));return $g(u,k)}async function Po(u,f){const _=Rx(f),b=Fx(f.style);b.length>0&&await $g(u,b),f.layout&&f.layout["icon-image"]&&await Nx(u,f.layout),u.getSource(_.id)||u.addSource(_.id,_.source);for(const k of _.layers)f.visible!==void 0&&(k.layout={...k.layout,visibility:f.visible?"visible":"none"}),u.getLayer(k.id)?u.setLayoutProperty(k.id,"visibility",f.visible?"visible":"none"):await u.addLayer(k);return _}function Ba(u,f){u.getStyle().layers.filter(k=>k.source===f).forEach(k=>{u.removeLayer(k.id)}),u.getSource(f)&&u.removeSource(f)}const qx={class:"w-full flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative"},Ux={class:"flex flex-col justify-between h-full pb-5 px-5"},jx={key:0,class:"relative mb-[10px]"},Wx={width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0px, -50%)"}},Hx={key:1,class:"mb-4"},Zx={class:""},Kx={class:"space-y-2"},Gx={class:"flex items-center gap-[10px] text-gray-500"},Jx={class:"dataset-checkbox-container flex"},Xx=["onUpdate:modelValue","onChange"],Qx={class:"text-sm"},Yx=["onClick"],$x=["innerHTML"],eb={key:0,class:"text-sm text-gray-500 text-center py-2"},tb={__name:"vs-layers-widget",props:{map:{type:Object,required:!0},history:{type:Boolean,default:!1},config:{type:Object,default:()=>({layers:[],search:!1,allow_toggle_all:!1})},position:{type:String,default:"bottom-left"},hasFilters:{type:Boolean,default:!1}},emits:["set-filter-layer","update:enabledLayerIds"],setup(u,{emit:f}){const _=u,b=f,k=g.ref(""),T=g.ref([]);function x(){const C=new URLSearchParams(window.location.search).get("layers");return C?C.split(","):[]}function s(E){const C=new URLSearchParams(window.location.search);E.length>0?C.set("layers",E.join(",")):C.delete("layers");const W=`${window.location.pathname}?${C.toString()}`;window.history.replaceState({},"",W)}g.onMounted(()=>{let E=[];_.history&&(E=x()),E.length>0?T.value=_.config.layers.map(C=>({...C,visible:E.includes(String(C.id))})):T.value=_.config.layers.map(C=>({...C,visible:C.visible??!1})),T.value.forEach(C=>{C.visible&&Po(_.map,C)}),b("update:enabledLayerIds",L())});const V=g.computed(()=>{if(!k.value)return T.value;const E=k.value.toLowerCase();return T.value.filter(C=>(C.title||C.name||C.label||"").toLowerCase().includes(E))}),I=g.computed(()=>T.value.every(E=>E.visible)),L=()=>T.value.filter(E=>E.visible).map(E=>E.id),F=E=>{E.visible?Po(_.map,E):(Ba(_.map,E.id),b("set-filter-layer",null)),_.map.getStyle().layers.filter(J=>J.source===E.id).forEach(J=>{_.map.setLayoutProperty(J.id,"visibility",E.visible?"visible":"none")}),b("update:enabledLayerIds",L())},M=()=>{const E=!I.value;T.value.forEach(C=>{C.visible=E,E?Po(_.map,C):Ba(_.map,C.id)}),E||b("set-filter-layer",null),b("update:enabledLayerIds",L())};return g.watch(()=>L(),E=>{_.history&&s(E)},{deep:!0}),(E,C)=>(g.openBlock(),g.createElementBlock("div",qx,[C[2]||(C[2]=g.createElementVNode("div",{class:"p-5 pb-3 flex justify-between items-center"},[g.createElementVNode("h2",{class:"inline-block font-semibold text-lg text-gray-800"},"Шари")],-1)),g.createElementVNode("div",Ux,[u.config.search?(g.openBlock(),g.createElementBlock("div",jx,[g.withDirectives(g.createElementVNode("input",{type:"text","onUpdate:modelValue":C[0]||(C[0]=W=>k.value=W),placeholder:"Введіть назву шару...",class:"py-[7px] ps-8 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:bg-white focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none"},null,512),[[g.vModelText,k.value]]),(g.openBlock(),g.createElementBlock("svg",Wx,C[1]||(C[1]=[g.createElementVNode("path",{d:"M7.33333 13.1667C10.2789 13.1667 12.6667 10.7789 12.6667 7.83333C12.6667 4.88781 10.2789 2.5 7.33333 2.5C4.38781 2.5 2 4.88781 2 7.83333C2 10.7789 4.38781 13.1667 7.33333 13.1667Z",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M13.9995 14.5L11.1328 11.6333",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])))])):g.createCommentVNode("",!0),u.config.allow_toggle_all?(g.openBlock(),g.createElementBlock("div",Hx,[g.createElementVNode("button",{onClick:M,class:"w-full py-[7px] bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors"},g.toDisplayString(I.value?"Вимкнути всі":"Увімкнути всі"),1)])):g.createCommentVNode("",!0),g.createElementVNode("div",Zx,[g.createElementVNode("ul",Kx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(V.value,W=>(g.openBlock(),g.createElementBlock("li",{key:W.id,class:"flex flex-wrap justify-between items-center gap-x-2"},[g.createElementVNode("label",Gx,[g.createElementVNode("span",Jx,[g.withDirectives(g.createElementVNode("input",{class:"dataset-checkbox",type:"checkbox","onUpdate:modelValue":J=>W.visible=J,onChange:()=>F(W)},null,40,Xx),[[g.vModelCheckbox,W.visible]])]),g.createElementVNode("span",Qx,g.toDisplayString(W.title||W.name||W.label),1)]),W.actions&&W.visible?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(W.actions,J=>(g.openBlock(),g.createElementBlock("div",{key:J.id},[g.createElementVNode("button",{class:"text-sm text-gray-500",onClick:se=>E.$emit("show-widget",J.widget)},[g.createElementVNode("div",{innerHTML:J.icon},null,8,$x)],8,Yx)]))),128)):g.createCommentVNode("",!0)]))),128)),k.value&&V.value.length===0?(g.openBlock(),g.createElementBlock("li",eb," Шарів не знайдено ")):g.createCommentVNode("",!0)])])])]))}},rb={class:"legend-widget flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative"},ib={key:0,class:"p-5 pb-3 flex justify-between items-start gap-[30px]"},nb={class:"inline-block font-semibold text-lg text-gray-800 dark:text-neutral-200"},sb={class:"flex flex-col gap-1"},ob={class:"flex flex-col gap-1 p-5 pt-0"},ab=["innerHTML"],lb={__name:"vs-info-widget",props:{config:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.title)||""}),b=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.content)||""}),k=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.goTo)||[]});return(T,x)=>{var I,L;const s=g.resolveComponent("VsPopover"),V=g.resolveComponent("router-link");return g.openBlock(),g.createElementBlock("div",rb,[_.value||(I=k.value)!=null&&I.length?(g.openBlock(),g.createElementBlock("div",ib,[g.createElementVNode("h2",nb,g.toDisplayString(_.value),1),(L=k.value)!=null&&L.length?(g.openBlock(),g.createBlock(s,{key:0,placement:"bottom"},{reference:g.withCtx(()=>[g.createVNode(s,{trigger:"hover",placement:"right"},{reference:g.withCtx(()=>x[0]||(x[0]=[g.createElementVNode("div",{class:"flex items-center justify-center h-8 w-8 transition-colors rounded-full hover:bg-gray-100 cursor-pointer"},[g.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[g.createElementVNode("path",{d:"M4 12H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"}),g.createElementVNode("path",{d:"M4 6H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"}),g.createElementVNode("path",{d:"M4 18H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)])),default:g.withCtx(()=>[x[1]||(x[1]=g.createTextVNode(" Перейти на карту "))]),_:1,__:[1]})]),default:g.withCtx(()=>[g.createElementVNode("div",sb,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.value,F=>(g.openBlock(),g.createElementBlock("div",{key:F.label},[F.url?(g.openBlock(),g.createBlock(V,{key:0,to:F.url,class:"text-sm text-gray-800 dark:text-neutral-200 hover:bg-gray-100 hover:text-blue-600 transition-colors rounded px-2 py-1 block"},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(F.label),1)]),_:2},1032,["to"])):g.createCommentVNode("",!0)]))),128))])]),_:1})):g.createCommentVNode("",!0)])):g.createCommentVNode("",!0),g.createElementVNode("div",ob,[g.createElementVNode("div",{innerHTML:b.value},null,8,ab)])])}}},cb=Gt(lb,[["__scopeId","data-v-187a97ca"]]),ub={class:"w-full flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative overflow-hidden"},hb={key:0,class:"p-5 pb-3 flex justify-between items-center"},pb={class:"inline-block font-semibold text-lg text-gray-800"},db={key:1,class:"flex"},fb={class:"flex items-center mx-[8px]"},mb={class:"min-h-[34px] max-h-[34px] overflow-hidden min-w-[34px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 text-sm rounded-lg"},gb={class:"min-h-[34px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},yb={class:"flex flex-col justify-between pb-5 px-5 h-full overflow-y-auto flex-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},_b={key:0,class:"text-center"},vb={key:1,class:"text-red-500"},xb={key:2},bb=["innerHTML"],wb={key:1,class:"flow-root"},Sb={class:"-my-3 divide-y divide-gray-100 text-sm"},Ab={class:"font-medium text-gray-900"},kb={class:"text-gray-700 sm:col-span-2"},Cb={key:2,class:"vs-map-card-info__nodata"},Tb={key:3,class:"pt-4 flex justify-end"},Eb=["href"],ey={__name:"vs-card-widget",props:{config:{type:Object,required:!0},cardValues:{type:Object,required:!0}},emits:["close","content-resize"],setup(u,{emit:f}){const _=u,b=f,k=g.computed(()=>{var se;return((se=_.config)==null?void 0:se.title)||""}),T=g.computed(()=>!!(typeof window.app=="object"&&window.app&&window.app.config)),x=g.ref([]),s=g.ref(!1),V=g.ref(null),I=g.ref(0),L=g.computed(()=>I.value+1),F=g.computed(()=>{var se;return((se=_.info)==null?void 0:se.length)||0}),M=g.computed(()=>x.value[I.value]),E=g.computed(()=>{if(!M.value)return{};const{rows:se,columns:oe}=M.value;return!se||!oe?{}:oe.reduce((Se,$)=>(!$.hide&&!["geom","geodata","id"].includes($.name)&&(Se[$.ua]=se[$.name]??"-"),Se),{})});async function C(){var se,oe,Se,$,de,Ce;s.value=!0,V.value=null;try{const Re={id:(se=_.cardValues)==null?void 0:se.id,layer:typeof((oe=_.cardValues)==null?void 0:oe.layer)=="object"?($=(Se=_.cardValues)==null?void 0:Se.layer)==null?void 0:$.id:(de=_.cardValues)==null?void 0:de.layer,map:(Ce=_.cardValues)==null?void 0:Ce.map},Ze=await Ar.get("/api/map-format",{params:Re});x.value[I.value]=Ze.data}catch(Re){V.value=(Re==null?void 0:Re.message)||"Помилка запиту"}finally{s.value=!1,await g.nextTick(),b("content-resize")}}function W(){I.value<_.info.length-1&&(I.value+=1,x.value[I.value]||C())}function J(){I.value>0&&(I.value-=1,x.value[I.value]||C())}return g.onMounted(async()=>{await g.nextTick(),C()}),g.watch(()=>_.info,()=>{I.value=0,C(),b("content-resize")},{deep:!0}),g.watch([()=>_.cardValues,()=>_.config],async()=>{await g.nextTick(),C(),b("content-resize")}),(se,oe)=>{var Se,$;return g.openBlock(),g.createElementBlock("div",ub,[k.value?(g.openBlock(),g.createElementBlock("div",hb,[g.createElementVNode("h2",pb,g.toDisplayString(k.value),1),g.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600 ml-2",onClick:oe[0]||(oe[0]=de=>b("close"))},oe[1]||(oe[1]=[g.createElementVNode("svg",{class:"shrink-0 size-4 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[g.createElementVNode("path",{d:"M18 6 6 18"}),g.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))])):g.createCommentVNode("",!0),F.value>1?(g.openBlock(),g.createElementBlock("div",db,[g.createElementVNode("button",{type:"button",class:g.normalizeClass([{"opacity-flex items-center justify-between border-b px-[16px] py-[8px]50 pointer-events-none":L.value===1},"min-h-[34px] min-w-[34px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"]),onClick:J}," ◀ ",2),g.createElementVNode("div",fb,[g.createElementVNode("span",mb,g.toDisplayString(L.value),1),oe[2]||(oe[2]=g.createElementVNode("span",{class:"min-h-[34px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),g.createElementVNode("span",gb,g.toDisplayString(F.value),1)]),g.createElementVNode("button",{type:"button",onClick:W,class:g.normalizeClass([{"opacity-50 pointer-events-none":L.value===F.value},"min-h-[34px] min-w-[34px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])}," ▶ ",2)])):g.createCommentVNode("",!0),g.createElementVNode("div",yb,[s.value?(g.openBlock(),g.createElementBlock("div",_b,"Завантаження даних...")):V.value?(g.openBlock(),g.createElementBlock("div",vb," Помилка завантаження даних ")):(g.openBlock(),g.createElementBlock("div",xb,[(Se=M.value)!=null&&Se.html?(g.openBlock(),g.createElementBlock("div",{key:0,innerHTML:M.value.html,class:"custom-table-html border-b"},null,8,bb)):Object.keys(E.value).length?(g.openBlock(),g.createElementBlock("div",wb,[g.createElementVNode("dl",Sb,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(E.value,(de,Ce)=>(g.openBlock(),g.createElementBlock("div",{key:Ce,class:"grid grid-cols-1 gap-1 py-3 even:bg-gray-50 sm:grid-cols-3 sm:gap-4"},[g.createElementVNode("dt",Ab,g.toDisplayString(Ce),1),g.createElementVNode("dd",kb,g.toDisplayString(de),1)]))),128))])])):(g.openBlock(),g.createElementBlock("div",Cb,"Даних не знайдено."))])),($=M.value)!=null&&$.cardInterface&&T.value?(g.openBlock(),g.createElementBlock("div",Tb,[g.createElementVNode("a",{href:`/card/${M.value.cardInterface}/${M.value.id}`,target:"_blank",class:"w-full !cursor-pointer text-center gap-2 px-3 py-1.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition text-sm font-medium"}," Перейти в реєстр ",8,Eb)])):g.createCommentVNode("",!0)])])}}},Pb={class:"size-full flex flex-col bg-white border border-gray-200 shadow-2xs rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},Ib={key:0,class:"p-5 pb-0 items-center"},Mb={class:"inline-block font-semibold text-lg text-gray-800 dark:text-neutral-200"},Lb={class:"h-full p-5"},Rb={class:"h-full flex flex-col justify-between space-y-4"},Bb={class:"space-y-4"},Db={key:0,class:"flex gap-x-1 w-full h-2.5 rounded-full overflow-hidden"},Vb=["aria-valuenow"],zb={class:"text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center rounded-lg group hover:bg-gray-100"},Fb=["for"],Ob={key:0,width:"16",height:"auto",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="},Nb=["id","onUpdate:modelValue"],qb={class:"ms-2 text-gray-800 dark:text-neutral-200"},Ub={key:0,class:"ms-auto text-xs text-gray-500 dark:text-neutral-500"},jb={__name:"vs-attributre-widget",props:{config:{type:Object,required:!0},map:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var V;return((V=f.config)==null?void 0:V.title)||""}),b=g.ref([]),k=g.computed(()=>f.config.layer.style.rules.some(V=>V.count!==void 0)),T=g.computed(()=>f.config.layer.style.rules.reduce((V,I)=>V+(I.count||0),0)),x=V=>!V||T.value===0?0:Math.round(V/T.value*100),s=()=>{const I=f.config.layer.style.rules.filter((L,F)=>b.value[F]).map(L=>L.id||L.value).join(",");if(f.config.layer.id){const L=f.map.getSource(f.config.layer.id);if(L){const M=L.tiles[0].split("?filter=")[0],E=I?`${M}?filter=${f.config.layer.style.attribute}=${I}`:M;L.setTiles([E])}}};return g.onMounted(()=>{var V;(V=f.config)!=null&&V.layer&&(Po(f.map,f.config.layer),b.value=new Array(f.config.layer.style.rules.length).fill(!1))}),(V,I)=>(g.openBlock(),g.createElementBlock("div",Pb,[_.value?(g.openBlock(),g.createElementBlock("div",Ib,[g.createElementVNode("div",null,[g.createElementVNode("h2",Mb,g.toDisplayString(_.value),1)])])):g.createCommentVNode("",!0),g.createElementVNode("div",Lb,[g.createElementVNode("div",Rb,[g.createElementVNode("div",Bb,[k.value?(g.openBlock(),g.createElementBlock("div",Db,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(u.config.layer.style.rules,(L,F)=>(g.openBlock(),g.createElementBlock("div",{key:F,class:"flex flex-col justify-center overflow-hidden text-xs text-white text-center whitespace-nowrap",style:g.normalizeStyle({width:`${x(L.count)}%`,backgroundColor:L.color}),role:"progressbar","aria-valuenow":x(L.count),"aria-valuemin":"0","aria-valuemax":"100"},null,12,Vb))),128))])):g.createCommentVNode("",!0),g.createElementVNode("ul",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(u.config.layer.style.rules,(L,F)=>(g.openBlock(),g.createElementBlock("li",{key:F},[g.createElementVNode("div",zb,[g.createElementVNode("label",{for:`filter-${F}`,class:"flex items-center w-full cursor-pointer"},[g.createElementVNode("div",{class:"w-[18px] h-[18px] border rounded-[4px] flex items-center justify-center",style:g.normalizeStyle({background:b.value[F]?L.color||"#2563eb":"#fff",borderColor:b.value[F]?L.color||"#2563eb":L.color||"#d9d9d9"})},[b.value[F]?(g.openBlock(),g.createElementBlock("img",Ob)):g.createCommentVNode("",!0)],4),g.withDirectives(g.createElementVNode("input",{type:"checkbox",id:`filter-${F}`,"onUpdate:modelValue":M=>b.value[F]=M,onChange:s,class:"hidden",disabled:!1},null,40,Nb),[[g.vModelCheckbox,b.value[F]]]),g.createElementVNode("span",qb,g.toDisplayString(L.label||L.text),1),k.value?(g.openBlock(),g.createElementBlock("span",Ub,"("+g.toDisplayString(L.count)+")",1)):g.createCommentVNode("",!0)],8,Fb)])]))),128))])])])])]))}},Wb={class:"hover:bg-gray-100 rounded-lg flex items-center ml-[20px] py-[8px] px-[8px]"},Hb=["for"],Zb={class:"custom-checkbox-wrapper"},Kb=["id","checked"],Gb={class:"custom-checkbox"},Jb={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},Xb={class:"flex items-center justify-between ml-2 w-full"},Qb=["title"],Yb={key:0,class:"text-xs opacity-60 text-[#4b5563]"},$b={__name:"vs-map-catalog-item",props:{layer:{type:Object,required:!0},map:{type:Object,default:()=>null},selectedLayers:{type:Array,default:()=>[]}},emits:["select","remove"],setup(u,{emit:f}){const _=u,b=f,k=g.computed(()=>_.selectedLayers.some(s=>s.id===_.layer.id)),T=s=>Intl.NumberFormat("uk",{notation:"compact"}).format(s),x=s=>{b(s?"select":"remove",_.layer)};return(s,V)=>{var I,L,F,M,E;return g.openBlock(),g.createElementBlock("div",Wb,[g.createElementVNode("label",{class:"flex items-center w-full cursor-pointer",for:u.layer.id},[g.createElementVNode("div",Zb,[g.createElementVNode("input",{id:u.layer.id,type:"checkbox",checked:k.value,onChange:V[0]||(V[0]=C=>x(C.target.checked)),class:"custom-checkbox-input"},null,40,Kb),g.createElementVNode("div",Gb,[k.value?(g.openBlock(),g.createElementBlock("svg",Jb,V[1]||(V[1]=[g.createElementVNode("path",{d:"M10.6663 1L4.24967 7.41667L1.33301 4.5",stroke:"#fff","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):g.createCommentVNode("",!0)])]),g.createElementVNode("div",Xb,[g.createElementVNode("div",{class:"whitespace-nowrap text text-ellipsis max-w-[260px] overflow-hidden text-[13px] text-[#4b5563]",title:(I=u.layer)==null?void 0:I.name},g.toDisplayString(((L=u.layer)==null?void 0:L.name)||((F=u.layer)==null?void 0:F.title)),9,Qb),isNaN(T((M=u.layer)==null?void 0:M.count))?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("div",Yb,g.toDisplayString(T((E=u.layer)==null?void 0:E.count)),1))])],8,Hb)])}}},e1=Gt($b,[["__scopeId","data-v-b96f3537"]]),t1={},r1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-zoom-in"};function i1(u,f){return g.openBlock(),g.createElementBlock("svg",r1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),g.createElementVNode("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"},null,-1),g.createElementVNode("line",{x1:"11",x2:"11",y1:"8",y2:"14"},null,-1),g.createElementVNode("line",{x1:"8",x2:"14",y1:"11",y2:"11"},null,-1)]))}const n1=Gt(t1,[["render",i1]]),s1={},o1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-info"};function a1(u,f){return g.openBlock(),g.createElementBlock("svg",o1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),g.createElementVNode("path",{d:"M12 16v-4"},null,-1),g.createElementVNode("path",{d:"M12 8h.01"},null,-1)]))}const l1=Gt(s1,[["render",a1]]),c1={},u1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-table"};function h1(u,f){return g.openBlock(),g.createElementBlock("svg",u1,f[0]||(f[0]=[g.createElementVNode("path",{d:"M12 3v18"},null,-1),g.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),g.createElementVNode("path",{d:"M3 9h18"},null,-1),g.createElementVNode("path",{d:"M3 15h18"},null,-1)]))}const p1=Gt(c1,[["render",h1]]),d1={},f1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-trash2"};function m1(u,f){return g.openBlock(),g.createElementBlock("svg",f1,f[0]||(f[0]=[g.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const g1=Gt(d1,[["render",m1]]),y1={},_1={xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-more-vertical text-gray-600"};function v1(u,f){return g.openBlock(),g.createElementBlock("svg",_1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"12",cy:"12",r:"1"},null,-1),g.createElementVNode("circle",{cx:"12",cy:"5",r:"1"},null,-1),g.createElementVNode("circle",{cx:"12",cy:"19",r:"1"},null,-1)]))}const x1=Gt(y1,[["render",v1]]),b1={},w1={width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function S1(u,f){return g.openBlock(),g.createElementBlock("svg",w1,f[0]||(f[0]=[g.createElementVNode("path",{d:"M1 9L5 5L1 1",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const A1=Gt(b1,[["render",S1]]),k1={},C1={width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function T1(u,f){return g.openBlock(),g.createElementBlock("svg",C1,f[0]||(f[0]=[g.createStaticVNode('<g clip-path="url(#clip0_231_103)"><path d="M12 20L9 21V12.5L4.52 7.572C4.18545 7.20393 4.00005 6.7244 4 6.227V4H20V6.172C19.9999 6.70239 19.7891 7.21101 19.414 7.586L15 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M21.121 20.1209C21.5406 19.7014 21.8265 19.1668 21.9423 18.5849C22.0581 18.0029 21.9988 17.3997 21.7717 16.8514C21.5447 16.3032 21.1602 15.8346 20.6668 15.5049C20.1734 15.1752 19.5934 14.9993 19 14.9993C18.4066 14.9993 17.8266 15.1752 17.3332 15.5049C16.8398 15.8346 16.4553 16.3032 16.2283 16.8514C16.0012 17.3997 15.9419 18.0029 16.0577 18.5849C16.1735 19.1668 16.4594 19.7014 16.879 20.1209C17.297 20.5399 18.004 21.1659 19 21.9999C20.051 21.1099 20.759 20.4839 21.121 20.1209Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M19 18V18.01" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></g><defs><clipPath id="clip0_231_103"><rect width="24" height="24" fill="white"></rect></clipPath></defs>',2)]))}const E1=Gt(k1,[["render",T1]]);function P1(){const f=new URLSearchParams(window.location.search).get("layers");return f?f.split(","):[]}function I1(u){const f=new URLSearchParams(window.location.search);u.length>0?f.set("layers",u.join(",")):f.delete("layers");const _=`${window.location.pathname}?${f.toString()}`;window.history.replaceState({},"",_)}const M1={components:{VsLayersItem:e1,ZoomInIcon:n1,InfoIcon:l1,TableIcon:p1,TrashIcon:g1,DotsIcon:x1,ChevronRightIcon:A1,FilterIcon:E1},props:{center:{type:Array,default:()=>[26.2516,50.6199]},zoom:{type:Number,default:12},map:{type:Object,default:()=>null},history:{type:Boolean,default:!1}},emits:["content-resize"],data(){return{layers:null,rawCatalog:null,categories:null,selectedCategory:"",search:"",activeView:"catalog",selectedLayers:[],mounted:!1,draggedLayerIndex:null,filterType:"",filterCategory:""}},computed:{searchedLayers(){return this.layers.filter(({name:u})=>u==null?void 0:u.toLowerCase().match(this.search.toLowerCase()))}},async mounted(){if(this.mounted=!0,await this.getLayers(),this.categories=this.layersCategories(),this.history){const u=P1();u.length>0&&this.layers&&(u.forEach(f=>{const _=this.layers.find(b=>String(b.id)===f);if(_&&!this.selectedLayers.find(b=>b.id===_.id)){const b={..._,visible:!0,opacity:100,showFilters:!1};this.selectedLayers.push(b),Po(this.map,b)}}),this.activeView="selected")}this._resizeObserver=new window.ResizeObserver(()=>{this.$emit("content-resize")}),this.$nextTick(()=>{const u=this.$el;u&&this._resizeObserver.observe(u)})},beforeUnmount(){this._resizeObserver&&this._resizeObserver.disconnect()},watch:{selectedLayers:{handler(u){this.history&&I1(u.map(f=>f.id))},deep:!0}},methods:{async getLayers(){try{const u=await Ar.get("/api/map-catalog"),f=(u.data.services||[]).filter(_=>_.service_type!=="other");this.layers=[...f,...u.data.rasters||[]],this.$emit("catalog-layers",this.layers),this.rawCatalog={...u.data,services:f}}catch(u){console.error("Помилка завантаження шарів:",u)}},layersCategories(){return this.rawCatalog?{Сервіси:this.rawCatalog.services||[],Растри:this.rawCatalog.rasters||[]}:{}},selectCategory(u){this.selectedCategory=this.selectedCategory===u?"":u},formatNumber(u){return Intl.NumberFormat("uk",{notation:"compact"}).format(u)},onEnter(){this.layers.filter(({name:u})=>u==null?void 0:u.toLowerCase().match(this.search.toLowerCase()))},clearSearch(){this.search=""},addToSelected(u){if(!this.selectedLayers.find(f=>f.id===u.id)){const f={...u,visible:!0,opacity:100,showFilters:!1};this.selectedLayers.unshift(f),Po(this.map,f)}},deleteLayer(u){const f=this.selectedLayers.findIndex(_=>_.id===u.id);f!==-1&&this.selectedLayers.splice(f,1),Ba(this.map,u.id)},async toggleLayerVisibility(u){try{u.visible?(await Po(this.map,u),this.updateLayerOpacity(u)):await Ba(this.map,u.id)}catch(f){console.error("Error toggling layer visibility:",f),u.visible=!u.visible}},onLayerOpacityChange(u){this.updateLayerOpacity(u)},updateLayerOpacity(u){if(this.map){const f=this.map.getStyle().layers.filter(b=>b.id.includes(u.id)),_=u.opacity/100;f.forEach(b=>{b.type==="fill"?(u.originalFillOpacity||(u.originalFillOpacity=this.map.getPaintProperty(b.id,"fill-opacity")||1),this.map.setPaintProperty(b.id,"fill-opacity",u.originalFillOpacity*_)):b.type==="raster"?this.map.setPaintProperty(b.id,"raster-opacity",_):b.type==="line"?this.map.setPaintProperty(b.id,"line-opacity",_):b.type==="circle"?(this.map.setPaintProperty(b.id,"circle-opacity",_),this.map.setPaintProperty(b.id,"circle-stroke-opacity",_)):b.type==="symbol"&&(this.map.setPaintProperty(b.id,"icon-opacity",_),this.map.setPaintProperty(b.id,"text-opacity",_))})}},async handleRemoveFromCatalog(u){const f=this.selectedLayers.find(_=>_.id===u.id);f!=null&&f.visible&&await Ba(this.map,u.id),this.deleteLayer(u)},clearSelectedLayers(){this.selectedLayers.forEach(async u=>{u.visible&&await Ba(this.map,u.id)}),this.selectedLayers=[]},zoomToLayer(u){this.fitBoundsByLayer(u)},showLayerInfo(u){},showLayerTable(u){},showLayerFilter(u){u.showFilters=!u.showFilters},fitBoundsByLayer(u){u&&u.bbox&&Array.isArray(u.bbox)&&u.bbox.length===4&&this.map&&this.map.fitBounds([[u.bbox[0],u.bbox[1]],[u.bbox[2],u.bbox[3]]],{padding:50,duration:0})},async handleFilterChange({url:u},f){const _=this.map.getSource(f.id);if(_){const k=_.tiles[0].split("?filter=")[0],T=u?`${k}?filter=${u}`:k;_.setTiles([T])}},popoverActions(u){var f;return[{label:"Збільшити до шару",icon:"ZoomInIcon",class:Array.isArray(u.bbox)&&u.bbox.length===4?"text-gray-700 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"zoomToLayer"},{label:"Фільтри",icon:"FilterIcon",class:[(f=u.filters)!=null&&f.length?"text-gray-700 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",u.showFilters?"bg-blue-100 text-blue-700":""].join(" "),handler:"showLayerFilter"},{label:"Інформація про шар",icon:"InfoIcon",class:"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"showLayerInfo"},{label:"Таблиця шару",icon:"TableIcon",class:"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"showLayerTable"},{divider:!0},{label:"Видалити шар",icon:"TrashIcon",class:"text-red-600 hover:bg-red-50",handler:"deleteLayer"}]},onDragStart(u){this.draggedLayerIndex=u},onDragOver(u){},onDrop(u){if(this.draggedLayerIndex===null||this.draggedLayerIndex===u)return;const f=this.selectedLayers[this.draggedLayerIndex];if(this.selectedLayers.splice(this.draggedLayerIndex,1),this.selectedLayers.splice(u,0,f),this.draggedLayerIndex=null,this.map&&this.selectedLayers.length>1)for(let _=this.selectedLayers.length-1;_>=0;_--){const b=this.selectedLayers[_];b.visible&&this.map.getStyle().layers.find(k=>k.id.includes(b.id))&&this.map.getStyle().layers.forEach(k=>{k.id.includes(b.id)&&this.map.moveLayer(k.id)})}},onDragEnd(){this.draggedLayerIndex=null}}},L1={class:"w-full max-w-md mx-auto p-4 bg-white border border-gray-200 rounded-lg shadow-sm"},R1={class:"flex items-center justify-between mb-4"},B1={class:"flex items-center gap-2"},D1={class:"text-lg font-semibold text-gray-800"},V1={key:0},z1={key:1},F1={class:"flex mb-4 border-b border-gray-200"},O1={key:0},N1={class:"mb-4"},q1={key:0,class:"space-y-2 max-h-[400px] overflow-y-auto pr-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},U1=["onDragstart","onDragover","onDrop"],j1={class:"flex items-center justify-between"},W1={class:"flex items-center gap-2 cursor-move"},H1=["onUpdate:modelValue","onChange"],Z1={class:"text-gray-800"},K1={class:"flex items-center gap-2"},G1={class:"relative"},J1={class:"flex items-center gap-2"},X1=["onUpdate:modelValue","onInput"],Q1={class:"text-xs text-gray-600 whitespace-nowrap"},Y1=["onClick"],$1={class:"relative"},e2={class:"w-48"},t2={key:0,class:"my-1 border-gray-200"},r2=["disabled","onClick"],i2={class:"p-1 rounded-full hover:bg-gray-100 transition-colors","aria-label":"Layer actions"},n2={key:0,class:"bg-blue-50 rounded-md mt-2"},s2={class:"px-2 pt-2 text-blue-600 hover:text-blue-700 transition-colors"},o2={key:0,class:"text-center text-[14px] text-[#4b5563]"},a2={class:"relative mt-[10px]"},l2={class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0, -50%)"},width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c2={key:0,class:"vs-layers-catalog__list flex-1 scrollable-container overflow-auto mt-2 catalog-list"},u2={key:0,class:"text-center text-[14px] text-[#4b5563]"},h2={key:0,class:"text-center text-[14px] text-[#4b5563]"},p2=["onClick"],d2={class:"flex items-center gap-x-3"},f2=["title"],m2={class:"text-xs opacity-60 text-[#4b5563]"};function g2(u,f,_,b,k,T){var E;const x=g.resolveComponent("VsPopover"),s=g.resolveComponent("DotsIcon"),V=g.resolveComponent("VsFilter"),I=g.resolveComponent("searchIcon"),L=g.resolveComponent("closeIcon"),F=g.resolveComponent("VsLayersItem"),M=g.resolveComponent("chevronRightIcon");return g.openBlock(),g.createElementBlock("div",L1,[g.createElementVNode("div",R1,[g.createElementVNode("div",B1,[f[7]||(f[7]=g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-layers text-blue-600"},[g.createElementVNode("path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"}),g.createElementVNode("path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"}),g.createElementVNode("path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"})],-1)),g.createElementVNode("h2",D1,[g.createTextVNode(g.toDisplayString(k.activeView==="catalog"?"Каталог":"Вибрані шари")+" ",1),k.activeView==="catalog"?(g.openBlock(),g.createElementBlock("span",V1,"("+g.toDisplayString(((E=k.layers)==null?void 0:E.length)||0)+")",1)):(g.openBlock(),g.createElementBlock("span",z1,"("+g.toDisplayString(k.selectedLayers.length)+")",1))])]),g.createElementVNode("button",{class:"p-1 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Reset layers",onClick:f[0]||(f[0]=(...C)=>T.clearSelectedLayers&&T.clearSelectedLayers(...C))},f[8]||(f[8]=[g.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw text-gray-600" data-v-8a801e40><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" data-v-8a801e40></path><path d="M21 3v5h-5" data-v-8a801e40></path><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" data-v-8a801e40></path><path d="M8 16H3v5" data-v-8a801e40></path></svg>',1)]))]),g.createElementVNode("div",F1,[g.createElementVNode("button",{class:g.normalizeClass(["px-4 py-2 text-sm font-medium",k.activeView==="catalog"?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-gray-800"]),onClick:f[1]||(f[1]=C=>k.activeView="catalog")}," Каталог ",2),g.createElementVNode("button",{class:g.normalizeClass(["px-4 py-2 text-sm font-medium",k.activeView==="selected"?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-gray-800"]),onClick:f[2]||(f[2]=C=>k.activeView="selected")}," Вибрані шари ",2)]),k.activeView==="selected"?(g.openBlock(),g.createElementBlock("div",O1,[g.createElementVNode("div",N1,[g.createElementVNode("button",{class:"flex items-center gap-2 text-blue-600 hover:text-blue-700 transition-colors px-3 py-2 rounded-md bg-blue-50 hover:bg-blue-100 w-full justify-center",onClick:f[3]||(f[3]=C=>k.activeView="catalog")},f[9]||(f[9]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-plus"},[g.createElementVNode("path",{d:"M5 12h14"}),g.createElementVNode("path",{d:"M12 5v14"})],-1),g.createElementVNode("span",null,"Вибрати шар",-1)]))]),k.mounted?(g.openBlock(),g.createElementBlock("div",q1,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.selectedLayers,(C,W)=>{var J,se;return g.openBlock(),g.createElementBlock("div",{key:C.id||W,class:g.normalizeClass(["border border-gray-200 rounded-md p-3 mb-2 bg-white shadow-sm text-[13px] text-[#4b5563]",{dragging:k.draggedLayerIndex===W}]),draggable:"true",onDragstart:oe=>T.onDragStart(W),onDragover:g.withModifiers(oe=>T.onDragOver(W),["prevent"]),onDrop:oe=>T.onDrop(W),onDragend:f[4]||(f[4]=(...oe)=>T.onDragEnd&&T.onDragEnd(...oe))},[g.createElementVNode("div",j1,[g.createElementVNode("div",W1,[f[10]||(f[10]=g.createStaticVNode('<svg width="16" height="16" fill="none" stroke="#9ca3af" stroke-width="2" viewBox="0 0 24 24" class="mr-1 shrink-0" data-v-8a801e40><circle cx="5" cy="5" r="1.5" data-v-8a801e40></circle><circle cx="5" cy="12" r="1.5" data-v-8a801e40></circle><circle cx="5" cy="19" r="1.5" data-v-8a801e40></circle><circle cx="12" cy="5" r="1.5" data-v-8a801e40></circle><circle cx="12" cy="12" r="1.5" data-v-8a801e40></circle><circle cx="12" cy="19" r="1.5" data-v-8a801e40></circle><circle cx="19" cy="5" r="1.5" data-v-8a801e40></circle><circle cx="19" cy="12" r="1.5" data-v-8a801e40></circle><circle cx="19" cy="19" r="1.5" data-v-8a801e40></circle></svg>',1)),g.withDirectives(g.createElementVNode("input",{type:"checkbox",class:"w-4 h-4 text-blue-600 rounded focus:ring-blue-500","onUpdate:modelValue":oe=>C.visible=oe,onChange:oe=>T.toggleLayerVisibility(C)},null,40,H1),[[g.vModelCheckbox,C.visible]]),g.createElementVNode("span",Z1,g.toDisplayString(C.name||C.title||C.label),1)]),g.createElementVNode("div",K1,[g.createElementVNode("div",G1,[g.createVNode(x,{placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("div",{class:"text-sm text-gray-600 hover:text-gray-800 transition-colors px-2 py-1 rounded hover:bg-gray-100 cursor-pointer",onClick:oe=>T.updateLayerOpacity(C)},g.toDisplayString(C.opacity||100)+"% ",9,Y1)]),default:g.withCtx(()=>[g.createElementVNode("div",J1,[f[11]||(f[11]=g.createElementVNode("label",{class:"text-gray-600 whitespace-nowrap"},"Прозорість:",-1)),g.withDirectives(g.createElementVNode("input",{type:"range",min:"0",max:"100",step:"1","onUpdate:modelValue":oe=>C.opacity=oe,onInput:oe=>T.onLayerOpacityChange(C),class:"h-2 w-full accent-blue-600 rounded-lg cursor-pointer bg-gray-200"},null,40,X1),[[g.vModelText,C.opacity]]),g.createElementVNode("span",Q1,g.toDisplayString(Math.round(C.opacity))+"% ",1)])]),_:2},1024)]),g.createElementVNode("div",$1,[g.createVNode(x,{placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("div",i2,[g.createVNode(s)])]),default:g.withCtx(()=>[g.createElementVNode("div",e2,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.popoverActions(C),(oe,Se)=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:Se},[oe.divider?(g.openBlock(),g.createElementBlock("hr",t2)):(g.openBlock(),g.createElementBlock("button",{key:1,class:g.normalizeClass("w-full p-2 text-left text-sm flex items-center gap-2 "+(oe.class||"")),disabled:oe.disabled,onClick:$=>!oe.disabled&&u.$options.methods[oe.handler].call(this,C)},[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(oe.icon),{class:"lucide"})),g.createTextVNode(" "+g.toDisplayString(oe.label),1)],10,r2))],64))),128))])]),_:2},1024)])])]),C.showFilters?(g.openBlock(),g.createElementBlock("div",n2,[g.createElementVNode("div",s2," Фільтри для шару: "+g.toDisplayString(C.name||C.title||C.label),1),g.withDirectives(g.createVNode(V,{ref_for:!0,ref:"filter",scheme:C.filters,header:!1,urlSeparator:"true",view:"plain",name:"filter",onFilterChange:oe=>T.handleFilterChange(oe,C)},null,8,["scheme","onFilterChange"]),[[g.vShow,(J=C.filters)==null?void 0:J.length]]),g.withDirectives(g.createElementVNode("div",null,f[12]||(f[12]=[g.createElementVNode("div",{class:"px-2 text-[14px] text-[#4b5563]"}," Фільтри для шару відсутні ",-1)]),512),[[g.vShow,!((se=C.filters)!=null&&se.length)]])])):g.createCommentVNode("",!0)],42,U1)}),128)),k.selectedLayers.length===0?(g.openBlock(),g.createElementBlock("div",o2,f[13]||(f[13]=[g.createElementVNode("p",null,'Щоб додати шар, натисніть на кнопку "Вибрати шар".',-1)]))):g.createCommentVNode("",!0)])):g.createCommentVNode("",!0)])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createElementVNode("div",a2,[(g.openBlock(),g.createElementBlock("svg",l2,f[14]||(f[14]=[g.createElementVNode("path",{d:"M7.33333 13.1667C10.2789 13.1667 12.6667 10.7789 12.6667 7.83333C12.6667 4.88781 10.2789 2.5 7.33333 2.5C4.38781 2.5 2 4.88781 2 7.83333C2 10.7789 4.38781 13.1667 7.33333 13.1667Z",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M13.9995 14.5L11.1328 11.6333",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))),g.withDirectives(g.createElementVNode("input",{title:"value",placeholder:"Введіть назву шару...","onUpdate:modelValue":f[5]||(f[5]=C=>k.search=C),type:"text",class:"py-[7px] ps-8 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:bg-white focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",onKeyup:f[6]||(f[6]=g.withKeys((...C)=>T.onEnter&&T.onEnter(...C),["enter"]))},null,544),[[g.vModelText,k.search]]),g.createVNode(I,{class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0, -50%)"}}),k.search?(g.openBlock(),g.createBlock(L,{key:0,class:"absolute top-1/2 right-[10px] w-[16px] h-[16px] cursor-pointer",style:{transform:"translate(0, -50%)"},onClick:T.clearSearch},null,8,["onClick"])):g.createCommentVNode("",!0)]),k.categories?(g.openBlock(),g.createElementBlock("div",c2,[k.search?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.searchedLayers,(C,W)=>(g.openBlock(),g.createBlock(F,{key:W,layer:C,map:_.map,selectedLayers:k.selectedLayers,onSelect:T.addToSelected,onRemove:T.handleRemoveFromCatalog},null,8,["layer","map","selectedLayers","onSelect","onRemove"]))),128)),T.searchedLayers.length===0?(g.openBlock(),g.createElementBlock("div",u2," Нічого не знайдено ")):g.createCommentVNode("",!0)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[!k.categories||Object.keys(k.categories).length===0?(g.openBlock(),g.createElementBlock("div",h2," Каталог порожній ")):(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:1},g.renderList(Object.keys(k.categories),C=>(g.openBlock(),g.createElementBlock("div",{key:C},[g.createElementVNode("div",{class:"hover:bg-gray-100 focus:bg-gray-100 px-2.5 cursor-pointer p-[8px] rounded-lg flex justify-between items-center",onClick:W=>T.selectCategory(C)},[g.createElementVNode("div",d2,[g.createVNode(M,{class:g.normalizeClass({"rotate-up":C===k.selectedCategory,"rotate-down":C!==k.selectedCategory})},null,8,["class"]),g.createElementVNode("div",{class:"max-w-[260px] text-[14px] text-[#4b5563]",title:C},g.toDisplayString(C),9,f2)]),g.createElementVNode("div",m2,g.toDisplayString(T.formatNumber(k.categories[C].length)),1)],8,p2),g.withDirectives(g.createElementVNode("div",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.categories[C],(W,J)=>(g.openBlock(),g.createBlock(F,{key:J,layer:W,map:_.map,selectedLayers:k.selectedLayers,onSelect:T.addToSelected,onRemove:T.handleRemoveFromCatalog},null,8,["layer","map","selectedLayers","onSelect","onRemove"]))),128))],512),[[g.vShow,C===k.selectedCategory]])]))),128))],64))])):g.createCommentVNode("",!0)],64))])}const y2=Gt(M1,[["render",g2],["__scopeId","data-v-8a801e40"]]);var vu={exports:{}},xu={exports:{}},bn={},Wi={},bm;function Ki(){if(bm)return Wi;bm=1,Wi.__esModule=!0,Wi.extend=k,Wi.indexOf=V,Wi.escapeExpression=I,Wi.isEmpty=L,Wi.createFrame=F,Wi.blockParams=M,Wi.appendContextPath=E;var u={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},f=/[&<>"'`=]/g,_=/[&<>"'`=]/;function b(C){return u[C]}function k(C){for(var W=1;W<arguments.length;W++)for(var J in arguments[W])Object.prototype.hasOwnProperty.call(arguments[W],J)&&(C[J]=arguments[W][J]);return C}var T=Object.prototype.toString;Wi.toString=T;var x=function(W){return typeof W=="function"};x(/x/)&&(Wi.isFunction=x=function(C){return typeof C=="function"&&T.call(C)==="[object Function]"}),Wi.isFunction=x;var s=Array.isArray||function(C){return C&&typeof C=="object"?T.call(C)==="[object Array]":!1};Wi.isArray=s;function V(C,W){for(var J=0,se=C.length;J<se;J++)if(C[J]===W)return J;return-1}function I(C){if(typeof C!="string"){if(C&&C.toHTML)return C.toHTML();if(C==null)return"";if(!C)return C+"";C=""+C}return _.test(C)?C.replace(f,b):C}function L(C){return!C&&C!==0?!0:!!(s(C)&&C.length===0)}function F(C){var W=k({},C);return W._parent=C,W}function M(C,W){return C.path=W,C}function E(C,W){return(C?C+".":"")+W}return Wi}var bu={exports:{}},wm;function Sn(){return wm||(wm=1,function(u,f){f.__esModule=!0;var _=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function b(k,T){var x=T&&T.loc,s=void 0,V=void 0,I=void 0,L=void 0;x&&(s=x.start.line,V=x.end.line,I=x.start.column,L=x.end.column,k+=" - "+s+":"+I);for(var F=Error.prototype.constructor.call(this,k),M=0;M<_.length;M++)this[_[M]]=F[_[M]];Error.captureStackTrace&&Error.captureStackTrace(this,b);try{x&&(this.lineNumber=s,this.endLineNumber=V,Object.defineProperty?(Object.defineProperty(this,"column",{value:I,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:L,enumerable:!0})):(this.column=I,this.endColumn=L))}catch{}}b.prototype=new Error,f.default=b,u.exports=f.default}(bu,bu.exports)),bu.exports}var Ql={},wu={exports:{}},Sm;function _2(){return Sm||(Sm=1,function(u,f){f.__esModule=!0;var _=Ki();f.default=function(b){b.registerHelper("blockHelperMissing",function(k,T){var x=T.inverse,s=T.fn;if(k===!0)return s(this);if(k===!1||k==null)return x(this);if(_.isArray(k))return k.length>0?(T.ids&&(T.ids=[T.name]),b.helpers.each(k,T)):x(this);if(T.data&&T.ids){var V=_.createFrame(T.data);V.contextPath=_.appendContextPath(T.data.contextPath,T.name),T={data:V}}return s(k,T)})},u.exports=f.default}(wu,wu.exports)),wu.exports}var Su={exports:{}},Am;function v2(){return Am||(Am=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("each",function(s,V){if(!V)throw new T.default("Must pass iterator to #each");var I=V.fn,L=V.inverse,F=0,M="",E=void 0,C=void 0;V.data&&V.ids&&(C=b.appendContextPath(V.data.contextPath,V.ids[0])+"."),b.isFunction(s)&&(s=s.call(this)),V.data&&(E=b.createFrame(V.data));function W($,de,Ce){E&&(E.key=$,E.index=de,E.first=de===0,E.last=!!Ce,C&&(E.contextPath=C+$)),M=M+I(s[$],{data:E,blockParams:b.blockParams([s[$],$],[C+$,null])})}if(s&&typeof s=="object")if(b.isArray(s))for(var J=s.length;F<J;F++)F in s&&W(F,F,F===s.length-1);else if(typeof Symbol=="function"&&s[Symbol.iterator]){for(var se=[],oe=s[Symbol.iterator](),Se=oe.next();!Se.done;Se=oe.next())se.push(Se.value);s=se;for(var J=s.length;F<J;F++)W(F,F,F===s.length-1)}else(function(){var $=void 0;Object.keys(s).forEach(function(de){$!==void 0&&W($,F-1),$=de,F++}),$!==void 0&&W($,F-1,!0)})();return F===0&&(M=L(this)),M})},u.exports=f.default}(Su,Su.exports)),Su.exports}var Au={exports:{}},km;function x2(){return km||(km=1,function(u,f){f.__esModule=!0;function _(T){return T&&T.__esModule?T:{default:T}}var b=Sn(),k=_(b);f.default=function(T){T.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new k.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},u.exports=f.default}(Au,Au.exports)),Au.exports}var ku={exports:{}},Cm;function b2(){return Cm||(Cm=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("if",function(s,V){if(arguments.length!=2)throw new T.default("#if requires exactly one argument");return b.isFunction(s)&&(s=s.call(this)),!V.hash.includeZero&&!s||b.isEmpty(s)?V.inverse(this):V.fn(this)}),x.registerHelper("unless",function(s,V){if(arguments.length!=2)throw new T.default("#unless requires exactly one argument");return x.helpers.if.call(this,s,{fn:V.inverse,inverse:V.fn,hash:V.hash})})},u.exports=f.default}(ku,ku.exports)),ku.exports}var Cu={exports:{}},Tm;function w2(){return Tm||(Tm=1,function(u,f){f.__esModule=!0,f.default=function(_){_.registerHelper("log",function(){for(var b=[void 0],k=arguments[arguments.length-1],T=0;T<arguments.length-1;T++)b.push(arguments[T]);var x=1;k.hash.level!=null?x=k.hash.level:k.data&&k.data.level!=null&&(x=k.data.level),b[0]=x,_.log.apply(_,b)})},u.exports=f.default}(Cu,Cu.exports)),Cu.exports}var Tu={exports:{}},Em;function S2(){return Em||(Em=1,function(u,f){f.__esModule=!0,f.default=function(_){_.registerHelper("lookup",function(b,k,T){return b&&T.lookupProperty(b,k)})},u.exports=f.default}(Tu,Tu.exports)),Tu.exports}var Eu={exports:{}},Pm;function A2(){return Pm||(Pm=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("with",function(s,V){if(arguments.length!=2)throw new T.default("#with requires exactly one argument");b.isFunction(s)&&(s=s.call(this));var I=V.fn;if(b.isEmpty(s))return V.inverse(this);var L=V.data;return V.data&&V.ids&&(L=b.createFrame(V.data),L.contextPath=b.appendContextPath(V.data.contextPath,V.ids[0])),I(s,{data:L,blockParams:b.blockParams([s],[L&&L.contextPath])})})},u.exports=f.default}(Eu,Eu.exports)),Eu.exports}var Im;function ty(){if(Im)return Ql;Im=1,Ql.__esModule=!0,Ql.registerDefaultHelpers=W,Ql.moveHelperToHooks=J;function u(se){return se&&se.__esModule?se:{default:se}}var f=_2(),_=u(f),b=v2(),k=u(b),T=x2(),x=u(T),s=b2(),V=u(s),I=w2(),L=u(I),F=S2(),M=u(F),E=A2(),C=u(E);function W(se){_.default(se),k.default(se),x.default(se),V.default(se),L.default(se),M.default(se),C.default(se)}function J(se,oe,Se){se.helpers[oe]&&(se.hooks[oe]=se.helpers[oe],Se||delete se.helpers[oe])}return Ql}var Pu={},Iu={exports:{}},Mm;function k2(){return Mm||(Mm=1,function(u,f){f.__esModule=!0;var _=Ki();f.default=function(b){b.registerDecorator("inline",function(k,T,x,s){var V=k;return T.partials||(T.partials={},V=function(I,L){var F=x.partials;x.partials=_.extend({},F,T.partials);var M=k(I,L);return x.partials=F,M}),T.partials[s.args[0]]=s.fn,V})},u.exports=f.default}(Iu,Iu.exports)),Iu.exports}var Lm;function C2(){if(Lm)return Pu;Lm=1,Pu.__esModule=!0,Pu.registerDefaultDecorators=b;function u(k){return k&&k.__esModule?k:{default:k}}var f=k2(),_=u(f);function b(k){_.default(k)}return Pu}var Mu={exports:{}},Rm;function ry(){return Rm||(Rm=1,function(u,f){f.__esModule=!0;var _=Ki(),b={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(T){if(typeof T=="string"){var x=_.indexOf(b.methodMap,T.toLowerCase());x>=0?T=x:T=parseInt(T,10)}return T},log:function(T){if(T=b.lookupLevel(T),typeof console<"u"&&b.lookupLevel(b.level)<=T){var x=b.methodMap[T];console[x]||(x="log");for(var s=arguments.length,V=Array(s>1?s-1:0),I=1;I<s;I++)V[I-1]=arguments[I];console[x].apply(console,V)}}};f.default=b,u.exports=f.default}(Mu,Mu.exports)),Mu.exports}var Ma={},Lu={},Bm;function T2(){if(Bm)return Lu;Bm=1,Lu.__esModule=!0,Lu.createNewLookupObject=f;var u=Ki();function f(){for(var _=arguments.length,b=Array(_),k=0;k<_;k++)b[k]=arguments[k];return u.extend.apply(void 0,[Object.create(null)].concat(b))}return Lu}var Dm;function iy(){if(Dm)return Ma;Dm=1,Ma.__esModule=!0,Ma.createProtoAccessControl=T,Ma.resultIsAllowed=x,Ma.resetLoggedProperties=I;function u(L){return L&&L.__esModule?L:{default:L}}var f=T2(),_=ry(),b=u(_),k=Object.create(null);function T(L){var F=Object.create(null);F.constructor=!1,F.__defineGetter__=!1,F.__defineSetter__=!1,F.__lookupGetter__=!1;var M=Object.create(null);return M.__proto__=!1,{properties:{whitelist:f.createNewLookupObject(M,L.allowedProtoProperties),defaultValue:L.allowProtoPropertiesByDefault},methods:{whitelist:f.createNewLookupObject(F,L.allowedProtoMethods),defaultValue:L.allowProtoMethodsByDefault}}}function x(L,F,M){return s(typeof L=="function"?F.methods:F.properties,M)}function s(L,F){return L.whitelist[F]!==void 0?L.whitelist[F]===!0:L.defaultValue!==void 0?L.defaultValue:(V(F),!1)}function V(L){k[L]!==!0&&(k[L]=!0,b.default.log("error",'Handlebars: Access has been denied to resolve the property "'+L+`" because it is not an "own property" of its parent.
|
|
801
|
+
${Z.shaderPreludeCode.vertexSource}`,define:Z.shaderDefine},defaultProjectionData:ne},ae=O.renderingMode?O.renderingMode:"2d";if(y.renderPass==="offscreen"){const ue=O.prerender;ue&&(y.setCustomLayerDefaults(),N.setColorMode(y.colorModeForRenderPass()),ue.call(O,N.gl,ie),N.setDirty(),y.setBaseState())}else if(y.renderPass==="translucent"){y.setCustomLayerDefaults(),N.setColorMode(y.colorModeForRenderPass()),N.setStencilMode(It.disabled);const ue=ae==="3d"?y.getDepthModeFor3D():y.getDepthModeForSublayer(0,kt.ReadOnly);N.setDepthMode(ue),O.render(N.gl,ie),N.setDirty(),y.setBaseState(),N.bindFramebuffer.set(null)}}(e,0,a,p))}saveTileTexture(e){const r=this._tileTextures[e.size[0]];r?r.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const r=this._tileTextures[e];return r&&r.length>0?r.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const r=this.imageManager.getPattern(e.from.toString()),a=this.imageManager.getPattern(e.to.toString());return!r||!a}useProgram(e,r,a=!1,l=[]){this.cache=this.cache||{};const p=!!this.style.map.terrain,y=this.style.projection,w=a?fi.projectionMercator:y.shaderPreludeCode,A=a?jn:y.shaderDefine,R=e+(r?r.cacheKey:"")+`/${a?Ot:y.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(p?"/terrain":"")+(l?`/${l.join("/")}`:"");return this.cache[R]||(this.cache[R]=new Oo(this.context,fi[e],r,Ac[e],this._showOverdrawInspector,p,w,A,l)),this.cache[R]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ze(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:r}=this.context.gl;return this.width!==e||this.height!==r}}function lo(h,e){let r,a=!1,l=null,p=null;const y=()=>{l=null,a&&(h.apply(p,r),l=setTimeout(y,e),a=!1)};return(...w)=>(a=!0,p=this,r=w,l||y(),l)}class hl{constructor(e){this._getCurrentHash=()=>{const r=window.location.hash.replace("#","");if(this._hashName){let a;return r.split("&").map(l=>l.split("=")).forEach(l=>{l[0]===this._hashName&&(a=l)}),(a&&a[1]||"").split("/")}return r.split("/")},this._onHashChange=()=>{const r=this._getCurrentHash();if(!this._isValidHash(r))return!1;const a=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(r[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+r[2],+r[1]],zoom:+r[0],bearing:a,pitch:+(r[4]||0)}),!0},this._updateHashUnthrottled=()=>{const r=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,r)},this._removeHash=()=>{const r=this._getCurrentHash();if(r.length===0)return;const a=r.join("/");let l=a;l.split("&").length>0&&(l=l.split("&")[0]),this._hashName&&(l=`${this._hashName}=${a}`);let p=window.location.hash.replace(l,"");p.startsWith("#&")?p=p.slice(0,1)+p.slice(2):p==="#"&&(p="");let y=window.location.href.replace(/(#.+)?$/,p);y=y.replace("&&","&"),window.history.replaceState(window.history.state,null,y)},this._updateHash=lo(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const r=this._map.getCenter(),a=Math.round(100*this._map.getZoom())/100,l=Math.ceil((a*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,l),y=Math.round(r.lng*p)/p,w=Math.round(r.lat*p)/p,A=this._map.getBearing(),R=this._map.getPitch();let D="";if(D+=e?`/${y}/${w}/${a}`:`${a}/${w}/${y}`,(A||R)&&(D+="/"+Math.round(10*A)/10),R&&(D+=`/${Math.round(R)}`),this._hashName){const N=this._hashName;let O=!1;const Z=window.location.hash.slice(1).split("&").map(K=>{const ne=K.split("=")[0];return ne===N?(O=!0,`${ne}=${D}`):K}).filter(K=>K);return O||Z.push(`${N}=${D}`),`#${Z.join("&")}`}return`#${D}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new s.Q(+e[2],+e[1])}catch{return!1}const r=+e[0],a=+(e[3]||0),l=+(e[4]||0);return r>=this._map.getMinZoom()&&r<=this._map.getMaxZoom()&&a>=-180&&a<=180&&l>=this._map.getMinPitch()&&l<=this._map.getMaxPitch()}}const an={linearity:.3,easing:s.cd(0,0,.3,1)},pl=s.e({deceleration:2500,maxSpeed:1400},an),co=s.e({deceleration:20,maxSpeed:1400},an),dl=s.e({deceleration:1e3,maxSpeed:360},an),Fc=s.e({deceleration:1e3,maxSpeed:90},an),Oc=s.e({deceleration:1e3,maxSpeed:360},an);class Nc{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:M.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,r=M.now();for(;e.length>0&&r-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,roll:0,pan:new s.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:p}of this._inertiaBuffer)r.zoom+=p.zoomDelta||0,r.bearing+=p.bearingDelta||0,r.pitch+=p.pitchDelta||0,r.roll+=p.rollDelta||0,p.panDelta&&r.pan._add(p.panDelta),p.around&&(r.around=p.around),p.pinchAround&&(r.pinchAround=p.pinchAround);const a=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};if(r.pan.mag()){const p=ws(r.pan.mag(),a,s.e({},pl,e||{})),y=r.pan.mult(p.amount/r.pan.mag()),w=this._map.cameraHelper.handlePanInertia(y,this._map.transform);l.center=w.easingCenter,l.offset=w.easingOffset,bs(l,p)}if(r.zoom){const p=ws(r.zoom,a,co);l.zoom=this._map.transform.zoom+p.amount,bs(l,p)}if(r.bearing){const p=ws(r.bearing,a,dl);l.bearing=this._map.transform.bearing+s.ae(p.amount,-179,179),bs(l,p)}if(r.pitch){const p=ws(r.pitch,a,Fc);l.pitch=this._map.transform.pitch+p.amount,bs(l,p)}if(r.roll){const p=ws(r.roll,a,Oc);l.roll=this._map.transform.roll+s.ae(p.amount,-179,179),bs(l,p)}if(l.zoom||l.bearing){const p=r.pinchAround===void 0?r.around:r.pinchAround;l.around=p?this._map.unproject(p):this._map.getCenter()}return this.clear(),s.e(l,{noMoveStart:!0})}}function bs(h,e){(!h.duration||h.duration<e.duration)&&(h.duration=e.duration,h.easing=e.easing)}function ws(h,e,r){const{maxSpeed:a,linearity:l,deceleration:p}=r,y=s.ae(h*l/(e/1e3),-a,a),w=Math.abs(y)/(p*l);return{easing:r.easing,duration:1e3*w,amount:y*(w/2)}}class Ur extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a,l={}){a=a instanceof MouseEvent?a:new MouseEvent(e,a);const p=E.mousePos(r.getCanvas(),a),y=r.unproject(p);super(e,s.e({point:p,lngLat:y,originalEvent:a},l)),this._defaultPrevented=!1,this.target=r}}class Ss extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a){const l=e==="touchend"?a.changedTouches:a.touches,p=E.touchPos(r.getCanvasContainer(),l),y=p.map(A=>r.unproject(A)),w=p.reduce((A,R,D,N)=>A.add(R.div(N.length)),new s.P(0,0));super(e,{points:p,point:w,lngLats:y,lngLat:r.unproject(w),originalEvent:a}),this._defaultPrevented=!1}}class fl extends s.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,a){super(e,{originalEvent:a}),this._defaultPrevented=!1}}class qc{constructor(e,r){this._map=e,this._clickTolerance=r.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new fl(e.type,this._map,e))}mousedown(e,r){return this._mousedownPos=r,this._firePreventable(new Ur(e.type,this._map,e))}mouseup(e){this._map.fire(new Ur(e.type,this._map,e))}click(e,r){this._mousedownPos&&this._mousedownPos.dist(r)>=this._clickTolerance||this._map.fire(new Ur(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Ur(e.type,this._map,e))}mouseover(e){this._map.fire(new Ur(e.type,this._map,e))}mouseout(e){this._map.fire(new Ur(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Ss(e.type,this._map,e))}touchmove(e){this._map.fire(new Ss(e.type,this._map,e))}touchend(e){this._map.fire(new Ss(e.type,this._map,e))}touchcancel(e){this._map.fire(new Ss(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Uc{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Ur(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Ur("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Ur(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class As{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(s.P.convert(e),this._map.terrain)}}class ml{constructor(e,r){this._map=e,this._tr=new As(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=r.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,r){this.isEnabled()&&e.shiftKey&&e.button===0&&(E.disableDrag(),this._startPos=this._lastPos=r,this._active=!0)}mousemoveWindow(e,r){if(!this._active)return;const a=r;if(this._lastPos.equals(a)||!this._box&&a.dist(this._startPos)<this._clickTolerance)return;const l=this._startPos;this._lastPos=a,this._box||(this._box=E.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const p=Math.min(l.x,a.x),y=Math.max(l.x,a.x),w=Math.min(l.y,a.y),A=Math.max(l.y,a.y);E.setTransform(this._box,`translate(${p}px,${w}px)`),this._box.style.width=y-p+"px",this._box.style.height=A-w+"px"}mouseupWindow(e,r){if(!this._active||e.button!==0)return;const a=this._startPos,l=r;if(this.reset(),E.suppressClick(),a.x!==l.x||a.y!==l.y)return this._map.fire(new s.l("boxzoomend",{originalEvent:e})),{cameraAnimation:p=>p.fitScreenCoordinates(a,l,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(E.remove(this._box),this._box=null),E.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new s.l(e,{originalEvent:r}))}}function la(h,e){if(h.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${h.length}, points ${e.length}`);const r={};for(let a=0;a<h.length;a++)r[h[a].identifier]=e[a];return r}class jc{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,a){(this.centroid||a.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),a.length===this.numTouches&&(this.centroid=function(l){const p=new s.P(0,0);for(const y of l)p._add(y);return p.div(l.length)}(r),this.touches=la(a,r)))}touchmove(e,r,a){if(this.aborted||!this.centroid)return;const l=la(a,r);for(const p in this.touches){const y=l[p];(!y||y.dist(this.touches[p])>30)&&(this.aborted=!0)}}touchend(e,r,a){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),a.length===0){const l=!this.aborted&&this.centroid;if(this.reset(),l)return l}}}class ks{constructor(e){this.singleTap=new jc(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,r,a){this.singleTap.touchstart(e,r,a)}touchmove(e,r,a){this.singleTap.touchmove(e,r,a)}touchend(e,r,a){const l=this.singleTap.touchend(e,r,a);if(l){const p=e.timeStamp-this.lastTime<500,y=!this.lastTap||this.lastTap.dist(l)<30;if(p&&y||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=l,this.count===this.numTaps)return this.reset(),l}}}class Wc{constructor(e){this._tr=new As(e),this._zoomIn=new ks({numTouches:1,numTaps:2}),this._zoomOut=new ks({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,r,a){this._zoomIn.touchstart(e,r,a),this._zoomOut.touchstart(e,r,a)}touchmove(e,r,a){this._zoomIn.touchmove(e,r,a),this._zoomOut.touchmove(e,r,a)}touchend(e,r,a){const l=this._zoomIn.touchend(e,r,a),p=this._zoomOut.touchend(e,r,a),y=this._tr;return l?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:y.zoom+1,around:y.unproject(l)},{originalEvent:e})}):p?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:w=>w.easeTo({duration:300,zoom:y.zoom-1,around:y.unproject(p)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class hi{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const r=this._moveFunction(...e);if(r.bearingDelta||r.pitchDelta||r.rollDelta||r.around||r.panDelta)return this._active=!0,r}dragStart(e,r){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(r)?r[0]:r,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,r){if(!this.isEnabled())return;const a=this._lastPoint;if(!a)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const l=Array.isArray(r)?r[0]:r;return!this._moved&&l.dist(a)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=l,this._move(a,l))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&E.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Gi={0:1,2:2};class Cs{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const r=E.mouseButton(e);this._eventButton=r}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(r,a){const l=Gi[a];return r.buttons===void 0||(r.buttons&l)!==l}(e,this._eventButton)}isValidEndEvent(e){return E.mouseButton(e)===this._eventButton}}class Ji{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class Ts{constructor(e=new Cs({checkCorrectEvent:()=>!0}),r=new Ji){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=r}_executeRelevantHandler(e,r,a){return e instanceof MouseEvent?r(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?a(e):void 0}startMove(e){this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.startMove(r),r=>this.oneFingerTouchMoveStateManager.startMove(r))}endMove(e){this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.endMove(r),r=>this.oneFingerTouchMoveStateManager.endMove(r))}isValidStartEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidStartEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidStartEvent(r))}isValidMoveEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidMoveEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(r))}isValidEndEvent(e){return this._executeRelevantHandler(e,r=>this.mouseMoveStateManager.isValidEndEvent(r),r=>this.oneFingerTouchMoveStateManager.isValidEndEvent(r))}}const ca=h=>{h.mousedown=h.dragStart,h.mousemoveWindow=h.dragMove,h.mouseup=h.dragEnd,h.contextmenu=e=>{e.preventDefault()}};class Dh{constructor(e,r){this._clickTolerance=e.clickTolerance||1,this._map=r,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new s.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,r,a){return this._calculateTransform(e,r,a)}touchmove(e,r,a){if(this._active){if(!this._shouldBePrevented(a.length))return e.preventDefault(),this._calculateTransform(e,r,a);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,r,a){this._calculateTransform(e,r,a),this._active&&this._shouldBePrevented(a.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,a){a.length>0&&(this._active=!0);const l=la(a,r),p=new s.P(0,0),y=new s.P(0,0);let w=0;for(const R in l){const D=l[R],N=this._touches[R];N&&(p._add(D),y._add(D.sub(N)),w++,l[R]=D)}if(this._touches=l,this._shouldBePrevented(w)||!y.mag())return;const A=y.div(w);return this._sum._add(A),this._sum.mag()<this._clickTolerance?void 0:{around:p.div(w),panDelta:A}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class gl{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,r,a){this._firstTwoTouches||a.length<2||(this._firstTwoTouches=[a[0].identifier,a[1].identifier],this._start([r[0],r[1]]))}touchmove(e,r,a){if(!this._firstTwoTouches)return;e.preventDefault();const[l,p]=this._firstTwoTouches,y=ua(a,r,l),w=ua(a,r,p);if(!y||!w)return;const A=this._aroundCenter?null:y.add(w).div(2);return this._move([y,w],A,e)}touchend(e,r,a){if(!this._firstTwoTouches)return;const[l,p]=this._firstTwoTouches,y=ua(a,r,l),w=ua(a,r,p);y&&w||(this._active&&E.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function ua(h,e,r){for(let a=0;a<h.length;a++)if(h[a].identifier===r)return e[a]}function yl(h,e){return Math.log(h/e)/Math.LN2}class Es extends gl{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,r){const a=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(yl(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:yl(this._distance,a),pinchAround:r}}}function ln(h,e){return 180*h.angleWith(e)/Math.PI}class nt extends gl{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,r,a){const l=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ln(this._vector,l),pinchAround:r}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const r=25/(Math.PI*this._minDiameter)*360,a=ln(e,this._startVector);return Math.abs(a)<r}}function ha(h){return Math.abs(h.y)>Math.abs(h.x)}class pa extends gl{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,r,a){super.touchstart(e,r,a),this._currentTouchCount=a.length}_start(e){this._lastPoints=e,ha(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,r,a){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const l=e[0].sub(this._lastPoints[0]),p=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(l,p,a.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(l.y+p.y)/2*-.5}):void 0}gestureBeginsVertically(e,r,a){if(this._valid!==void 0)return this._valid;const l=e.mag()>=2,p=r.mag()>=2;if(!l&&!p)return;if(!l||!p)return this._firstMove===void 0&&(this._firstMove=a),a-this._firstMove<100&&void 0;const y=e.y>0==r.y>0;return ha(e)&&ha(r)&&y}}const Hc={panStep:100,bearingStep:15,pitchStep:10};class Ps{constructor(e){this._tr=new As(e);const r=Hc;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let r=0,a=0,l=0,p=0,y=0;switch(e.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:e.shiftKey?a=-1:(e.preventDefault(),p=-1);break;case 39:e.shiftKey?a=1:(e.preventDefault(),p=1);break;case 38:e.shiftKey?l=1:(e.preventDefault(),y=-1);break;case 40:e.shiftKey?l=-1:(e.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(a=0,l=0),{cameraAnimation:w=>{const A=this._tr;w.easeTo({duration:300,easeId:"keyboardHandler",easing:uo,zoom:r?Math.round(A.zoom)+r*(e.shiftKey?2:1):A.zoom,bearing:A.bearing+a*this._bearingStep,pitch:A.pitch+l*this._pitchStep,offset:[-p*this._panStep,-y*this._panStep],center:A.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function uo(h){return h*(2-h)}const _l=4.000244140625;class Bt{constructor(e,r){this._onTimeout=a=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(a)},this._map=e,this._tr=new As(e),this._triggerRenderFrame=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let r=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const a=M.now(),l=a-(this._lastWheelEventTime||0);this._lastWheelEventTime=a,r!==0&&r%_l==0?this._type="wheel":r!==0&&Math.abs(r)<4?this._type="trackpad":l>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(l*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const r=E.mousePos(this._map.getCanvas(),e),a=this._tr;this._aroundPoint=this._aroundCenter?a.transform.locationToScreenPoint(s.Q.convert(a.center)):r,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const w=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=w),typeof this._targetZoom=="number"&&(this._targetZoom+=w)}if(this._delta!==0){const w=this._type==="wheel"&&Math.abs(this._delta)>_l?this._wheelZoomRate:this._defaultZoomRate;let A=2/(1+Math.exp(-Math.abs(this._delta*w)));this._delta<0&&A!==0&&(A=1/A);const R=typeof this._targetZoom!="number"?e.scale:s.ac(this._targetZoom);this._targetZoom=e.getConstrained(e.getCameraLngLat(),s.ah(R*A)).zoom,this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r=typeof this._targetZoom!="number"?e.zoom:this._targetZoom,a=this._startZoom,l=this._easing;let p,y=!1;if(this._type==="wheel"&&a&&l){const w=M.now()-this._lastWheelEventTime,A=Math.min((w+5)/200,1),R=l(A);p=s.B.number(a,r,R),A<1?this._frameId||(this._frameId=!0):y=!0}else p=r,y=!0;return this._active=!0,y&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=p,{noInertia:!0,needsRenderFrame:!y,zoomDelta:p-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=s.cf;if(this._prevEase){const a=this._prevEase,l=(M.now()-a.start)/a.duration,p=a.easing(l+.01)-a.easing(l),y=.27/Math.sqrt(p*p+1e-4)*.01,w=Math.sqrt(.0729-y*y);r=s.cd(y,w,.25,1)}return this._prevEase={start:M.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class da{constructor(e,r){this._clickZoom=e,this._tapZoom=r}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Vh{constructor(e){this._tr=new As(e),this.reset()}reset(){this._active=!1}dblclick(e,r){return e.preventDefault(),{cameraAnimation:a=>{a.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(r)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class vl{constructor(){this._tap=new ks({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,r,a){if(!this._swipePoint)if(this._tapTime){const l=r[0],p=e.timeStamp-this._tapTime<500,y=this._tapPoint.dist(l)<30;p&&y?a.length>0&&(this._swipePoint=l,this._swipeTouch=a[0].identifier):this.reset()}else this._tap.touchstart(e,r,a)}touchmove(e,r,a){if(this._tapTime){if(this._swipePoint){if(a[0].identifier!==this._swipeTouch)return;const l=r[0],p=l.y-this._swipePoint.y;return this._swipePoint=l,e.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(e,r,a)}touchend(e,r,a){if(this._tapTime)this._swipePoint&&a.length===0&&this.reset();else{const l=this._tap.touchend(e,r,a);l&&(this._tapTime=e.timeStamp,this._tapPoint=l)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Zc{constructor(e,r,a){this._el=e,this._mousePan=r,this._touchPan=a}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Kc{constructor(e,r,a,l){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=r,this._mousePitch=a,this._mouseRoll=l}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class xl{constructor(e,r,a,l){this._el=e,this._touchZoom=r,this._touchRotate=a,this._tapDragZoom=l,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class fa{constructor(e,r){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=r,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=E.create("div","maplibregl-cooperative-gesture-screen",e);let r=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(r=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const a=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),l=document.createElement("div");l.className="maplibregl-desktop-message",l.textContent=r,this._container.appendChild(l);const p=document.createElement("div");p.className="maplibregl-mobile-message",p.textContent=a,this._container.appendChild(p),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(E.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new s.l("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const ho=h=>h.zoom||h.drag||h.roll||h.pitch||h.rotate;class zh extends s.l{}function ma(h){return h.panDelta&&h.panDelta.mag()||h.zoomDelta||h.bearingDelta||h.pitchDelta||h.rollDelta}class Fh{constructor(e,r){this.handleWindowEvent=l=>{this.handleEvent(l,`${l.type}Window`)},this.handleEvent=(l,p)=>{if(l.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const y=l.type==="renderFrame"?void 0:l,w={needsRenderFrame:!1},A={},R={};for(const{handlerName:O,handler:Z,allowed:K}of this._handlers){if(!Z.isEnabled())continue;let ne;if(this._blockedByActive(R,K,O))Z.reset();else if(Z[p||l.type]){if(s.cg(l,p||l.type)){const ie=E.mousePos(this._map.getCanvas(),l);ne=Z[p||l.type](l,ie)}else if(s.ch(l,p||l.type)){const ie=this._getMapTouches(l.touches),ae=E.touchPos(this._map.getCanvas(),ie);ne=Z[p||l.type](l,ae,ie)}else s.ci(p||l.type)||(ne=Z[p||l.type](l));this.mergeHandlerResult(w,A,ne,O,y),ne&&ne.needsRenderFrame&&this._triggerRenderFrame()}(ne||Z.isActive())&&(R[O]=Z)}const D={};for(const O in this._previousActiveHandlers)R[O]||(D[O]=y);this._previousActiveHandlers=R,(Object.keys(D).length||ma(w))&&(this._changes.push([w,A,D]),this._triggerRenderFrame()),(Object.keys(R).length||ma(w))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:N}=w;N&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],N(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Nc(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);const a=this._el;this._listeners=[[a,"touchstart",{passive:!0}],[a,"touchmove",{passive:!1}],[a,"touchend",void 0],[a,"touchcancel",void 0],[a,"mousedown",void 0],[a,"mousemove",void 0],[a,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[a,"mouseover",void 0],[a,"mouseout",void 0],[a,"dblclick",void 0],[a,"click",void 0],[a,"keydown",{capture:!1}],[a,"keyup",void 0],[a,"wheel",{passive:!1}],[a,"contextmenu",void 0],[window,"blur",void 0]];for(const[l,p,y]of this._listeners)E.addEventListener(l,p,l===document?this.handleWindowEvent:this.handleEvent,y)}destroy(){for(const[e,r,a]of this._listeners)E.removeEventListener(e,r,e===document?this.handleWindowEvent:this.handleEvent,a)}_addDefaultHandlers(e){const r=this._map,a=r.getCanvasContainer();this._add("mapEvent",new qc(r,e));const l=r.boxZoom=new ml(r,e);this._add("boxZoom",l),e.interactive&&e.boxZoom&&l.enable();const p=r.cooperativeGestures=new fa(r,e.cooperativeGestures);this._add("cooperativeGestures",p),e.cooperativeGestures&&p.enable();const y=new Wc(r),w=new Vh(r);r.doubleClickZoom=new da(w,y),this._add("tapZoom",y),this._add("clickZoom",w),e.interactive&&e.doubleClickZoom&&r.doubleClickZoom.enable();const A=new vl;this._add("tapDragZoom",A);const R=r.touchPitch=new pa(r);this._add("touchPitch",R),e.interactive&&e.touchPitch&&r.touchPitch.enable(e.touchPitch);const D=()=>r.project(r.getCenter()),N=function({enable:fe,clickTolerance:ge,aroundCenter:xe=!0,minPixelCenterThreshold:ye=100,rotateDegreesPerPixelMoved:Te=.8},Fe){const Le=new Cs({checkCorrectEvent:Be=>E.mouseButton(Be)===0&&Be.ctrlKey||E.mouseButton(Be)===2&&!Be.ctrlKey});return new hi({clickTolerance:ge,move:(Be,De)=>{const Ye=Fe();if(xe&&Math.abs(Ye.y-Be.y)>ye)return{bearingDelta:s.ce(new s.P(Be.x,De.y),De,Ye)};let Xe=(De.x-Be.x)*Te;return xe&&De.y<Ye.y&&(Xe=-Xe),{bearingDelta:Xe}},moveStateManager:Le,enable:fe,assignEvents:ca})}(e,D),O=function({enable:fe,clickTolerance:ge,pitchDegreesPerPixelMoved:xe=-.5}){const ye=new Cs({checkCorrectEvent:Te=>E.mouseButton(Te)===0&&Te.ctrlKey||E.mouseButton(Te)===2});return new hi({clickTolerance:ge,move:(Te,Fe)=>({pitchDelta:(Fe.y-Te.y)*xe}),moveStateManager:ye,enable:fe,assignEvents:ca})}(e),Z=function({enable:fe,clickTolerance:ge,rollDegreesPerPixelMoved:xe=.3},ye){const Te=new Cs({checkCorrectEvent:Fe=>E.mouseButton(Fe)===2&&Fe.ctrlKey});return new hi({clickTolerance:ge,move:(Fe,Le)=>{const Be=ye();let De=(Le.x-Fe.x)*xe;return Le.y<Be.y&&(De=-De),{rollDelta:De}},moveStateManager:Te,enable:fe,assignEvents:ca})}(e,D);r.dragRotate=new Kc(e,N,O,Z),this._add("mouseRotate",N,["mousePitch"]),this._add("mousePitch",O,["mouseRotate","mouseRoll"]),this._add("mouseRoll",Z,["mousePitch"]),e.interactive&&e.dragRotate&&r.dragRotate.enable();const K=function({enable:fe,clickTolerance:ge}){const xe=new Cs({checkCorrectEvent:ye=>E.mouseButton(ye)===0&&!ye.ctrlKey});return new hi({clickTolerance:ge,move:(ye,Te)=>({around:Te,panDelta:Te.sub(ye)}),activateOnStart:!0,moveStateManager:xe,enable:fe,assignEvents:ca})}(e),ne=new Dh(e,r);r.dragPan=new Zc(a,K,ne),this._add("mousePan",K),this._add("touchPan",ne,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&r.dragPan.enable(e.dragPan);const ie=new nt,ae=new Es;r.touchZoomRotate=new xl(a,ae,ie,A),this._add("touchRotate",ie,["touchPan","touchZoom"]),this._add("touchZoom",ae,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&r.touchZoomRotate.enable(e.touchZoomRotate);const ue=r.scrollZoom=new Bt(r,()=>this._triggerRenderFrame());this._add("scrollZoom",ue,["mousePan"]),e.interactive&&e.scrollZoom&&r.scrollZoom.enable(e.scrollZoom);const me=r.keyboard=new Ps(r);this._add("keyboard",me),e.interactive&&e.keyboard&&r.keyboard.enable(),this._add("blockableMapEvent",new Uc(r))}_add(e,r,a){this._handlers.push({handlerName:e,handler:r,allowed:a}),this._handlersById[e]=r}stop(e){if(!this._updatingCamera){for(const{handler:r}of this._handlers)r.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!ho(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,r,a){for(const l in e)if(l!==a&&(!r||r.indexOf(l)<0))return!0;return!1}_getMapTouches(e){const r=[];for(const a of e)this._el.contains(a.target)&&r.push(a);return r}mergeHandlerResult(e,r,a,l,p){if(!a)return;s.e(e,a);const y={handlerName:l,originalEvent:a.originalEvent||p};a.zoomDelta!==void 0&&(r.zoom=y),a.panDelta!==void 0&&(r.drag=y),a.rollDelta!==void 0&&(r.roll=y),a.pitchDelta!==void 0&&(r.pitch=y),a.bearingDelta!==void 0&&(r.rotate=y)}_applyChanges(){const e={},r={},a={};for(const[l,p,y]of this._changes)l.panDelta&&(e.panDelta=(e.panDelta||new s.P(0,0))._add(l.panDelta)),l.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+l.zoomDelta),l.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+l.bearingDelta),l.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+l.pitchDelta),l.rollDelta&&(e.rollDelta=(e.rollDelta||0)+l.rollDelta),l.around!==void 0&&(e.around=l.around),l.pinchAround!==void 0&&(e.pinchAround=l.pinchAround),l.noInertia&&(e.noInertia=l.noInertia),s.e(r,p),s.e(a,y);this._updateMapTransform(e,r,a),this._changes=[]}_updateMapTransform(e,r,a){const l=this._map,p=l._getTransformForUpdate(),y=l.terrain;if(!(ma(e)||y&&this._terrainMovement))return this._fireEvents(r,a,!0);l._stop(!0);let{panDelta:w,zoomDelta:A,bearingDelta:R,pitchDelta:D,rollDelta:N,around:O,pinchAround:Z}=e;Z!==void 0&&(O=Z),O=O||l.transform.centerPoint,y&&!p.isPointOnMapSurface(O)&&(O=p.centerPoint);const K={panDelta:w,zoomDelta:A,rollDelta:N,pitchDelta:D,bearingDelta:R,around:O};this._map.cameraHelper.useGlobeControls&&!p.isPointOnMapSurface(O)&&(O=p.centerPoint);const ne=O.distSqr(p.centerPoint)<.01?p.center:p.screenPointToLocation(w?O.sub(w):O);y?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(K,p),this._terrainMovement||!r.drag&&!r.zoom?r.drag&&this._terrainMovement?p.setCenter(p.screenPointToLocation(p.centerPoint.sub(w))):this._map.cameraHelper.handleMapControlsPan(K,p,ne):(this._terrainMovement=!0,this._map._elevationFreeze=!0,this._map.cameraHelper.handleMapControlsPan(K,p,ne))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(K,p),this._map.cameraHelper.handleMapControlsPan(K,p,ne)),l._applyUpdatedTransform(p),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(r,a,!0)}_fireEvents(e,r,a){const l=ho(this._eventsInProgress),p=ho(e),y={};for(const N in e){const{originalEvent:O}=e[N];this._eventsInProgress[N]||(y[`${N}start`]=O),this._eventsInProgress[N]=e[N]}!l&&p&&this._fireEvent("movestart",p.originalEvent);for(const N in y)this._fireEvent(N,y[N]);p&&this._fireEvent("move",p.originalEvent);for(const N in e){const{originalEvent:O}=e[N];this._fireEvent(N,O)}const w={};let A;for(const N in this._eventsInProgress){const{handlerName:O,originalEvent:Z}=this._eventsInProgress[N];this._handlersById[O].isActive()||(delete this._eventsInProgress[N],A=r[O]||Z,w[`${N}end`]=A)}for(const N in w)this._fireEvent(N,w[N]);const R=ho(this._eventsInProgress),D=(l||p)&&!R;if(D&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const N=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&N.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(N)}if(a&&D){this._updatingCamera=!0;const N=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),O=Z=>Z!==0&&-this._bearingSnap<Z&&Z<this._bearingSnap;!N||!N.essential&&M.prefersReducedMotion?(this._map.fire(new s.l("moveend",{originalEvent:A})),O(this._map.getBearing())&&this._map.resetNorth()):(O(N.bearing||this._map.getBearing())&&(N.bearing=0),N.freezeElevation=!0,this._map.easeTo(N,{originalEvent:A})),this._updatingCamera=!1}}_fireEvent(e,r){this._map.fire(new s.l(e,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new zh("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Oh extends s.E{constructor(e,r,a){super(),this._renderFrameCallback=()=>{const l=Math.min((M.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(l)),l<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=a.bearingSnap,this.cameraHelper=r,this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(e,r){e.apply(this.transform),this.transform=e,this.cameraHelper=r}getCenter(){return new s.Q(this.transform.center.lng,this.transform.center.lat)}setCenter(e,r){return this.jumpTo({center:e},r)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,r){return this.jumpTo({elevation:e},r),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,r,a){return e=s.P.convert(e).mult(-1),this.panTo(this.transform.center,s.e({offset:e},r),a)}panTo(e,r,a){return this.easeTo(s.e({center:e},r),a)}getZoom(){return this.transform.zoom}setZoom(e,r){return this.jumpTo({zoom:e},r),this}zoomTo(e,r,a){return this.easeTo(s.e({zoom:e},r),a)}zoomIn(e,r){return this.zoomTo(this.getZoom()+1,e,r),this}zoomOut(e,r){return this.zoomTo(this.getZoom()-1,e,r),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,r){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new s.l("movestart",r)).fire(new s.l("move",r)).fire(new s.l("moveend",r))),this}getBearing(){return this.transform.bearing}setBearing(e,r){return this.jumpTo({bearing:e},r),this}getPadding(){return this.transform.padding}setPadding(e,r){return this.jumpTo({padding:e},r),this}rotateTo(e,r,a){return this.easeTo(s.e({bearing:e},r),a)}resetNorth(e,r){return this.rotateTo(0,s.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(s.e({bearing:0,pitch:0,roll:0,duration:1e3},e),r),this}snapToNorth(e,r){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,r):this}getPitch(){return this.transform.pitch}setPitch(e,r){return this.jumpTo({pitch:e},r),this}getRoll(){return this.transform.roll}setRoll(e,r){return this.jumpTo({roll:e},r),this}cameraForBounds(e,r){e=dt.convert(e).adjustAntiMeridian();const a=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),a,r)}_cameraForBoxAndBearing(e,r,a,l){const p={top:0,bottom:0,right:0,left:0};if(typeof(l=s.e({padding:p,offset:[0,0],maxZoom:this.transform.maxZoom},l)).padding=="number"){const R=l.padding;l.padding={top:R,bottom:R,right:R,left:R}}const y=s.e(p,l.padding);l.padding=y;const w=this.transform,A=new dt(e,r);return this.cameraHelper.cameraForBoxAndBearing(l,y,A,a,w)}fitBounds(e,r,a){return this._fitInternal(this.cameraForBounds(e,r),r,a)}fitScreenCoordinates(e,r,a,l,p){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(s.P.convert(e)),this.transform.screenPointToLocation(s.P.convert(r)),a,l),l,p)}_fitInternal(e,r,a){return e?(delete(r=s.e(e,r)).padding,r.linear?this.easeTo(r,a):this.flyTo(r,a)):this}jumpTo(e,r){this.stop();const a=this._getTransformForUpdate();let l=!1,p=!1,y=!1;const w=a.zoom;this.cameraHelper.handleJumpToCenterZoom(a,e);const A=a.zoom!==w;return"elevation"in e&&a.elevation!==+e.elevation&&a.setElevation(+e.elevation),"bearing"in e&&a.bearing!==+e.bearing&&(l=!0,a.setBearing(+e.bearing)),"pitch"in e&&a.pitch!==+e.pitch&&(p=!0,a.setPitch(+e.pitch)),"roll"in e&&a.roll!==+e.roll&&(y=!0,a.setRoll(+e.roll)),e.padding==null||a.isPaddingEqual(e.padding)||a.setPadding(e.padding),this._applyUpdatedTransform(a),this.fire(new s.l("movestart",r)).fire(new s.l("move",r)),A&&this.fire(new s.l("zoomstart",r)).fire(new s.l("zoom",r)).fire(new s.l("zoomend",r)),l&&this.fire(new s.l("rotatestart",r)).fire(new s.l("rotate",r)).fire(new s.l("rotateend",r)),p&&this.fire(new s.l("pitchstart",r)).fire(new s.l("pitch",r)).fire(new s.l("pitchend",r)),y&&this.fire(new s.l("rollstart",r)).fire(new s.l("roll",r)).fire(new s.l("rollend",r)),this.fire(new s.l("moveend",r))}calculateCameraOptionsFromTo(e,r,a,l=0){const p=s.$.fromLngLat(e,r),y=s.$.fromLngLat(a,l),w=y.x-p.x,A=y.y-p.y,R=y.z-p.z,D=Math.hypot(w,A,R);if(D===0)throw new Error("Can't calculate camera options with same From and To");const N=Math.hypot(w,A),O=s.ah(this.transform.cameraToCenterDistance/D/this.transform.tileSize),Z=180*Math.atan2(w,-A)/Math.PI;let K=180*Math.acos(N/D)/Math.PI;return K=R<0?90-K:90+K,{center:y.toLngLat(),elevation:l,zoom:O,pitch:K,bearing:Z}}calculateCameraOptionsFromCameraLngLatAltRotation(e,r,a,l,p){const y=this.transform.calculateCenterFromCameraLngLatAlt(e,r,a,l);return{center:y.center,elevation:y.elevation,zoom:y.zoom,bearing:a,pitch:l,roll:p}}easeTo(e,r){this._stop(!1,e.easeId),((e=s.e({offset:[0,0],duration:500,easing:s.cf},e)).animate===!1||!e.essential&&M.prefersReducedMotion)&&(e.duration=0);const a=this._getTransformForUpdate(),l=this.getBearing(),p=a.pitch,y=a.roll,w="bearing"in e?this._normalizeBearing(e.bearing,l):l,A="pitch"in e?+e.pitch:p,R="roll"in e?this._normalizeBearing(e.roll,y):y,D="padding"in e?e.padding:a.padding,N=s.P.convert(e.offset);let O,Z;e.around&&(O=s.Q.convert(e.around),Z=a.locationToScreenPoint(O));const K={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},ne=this.cameraHelper.handleEaseTo(a,{bearing:w,pitch:A,roll:R,padding:D,around:O,aroundPoint:Z,offsetAsPoint:N,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||l!==w,this._pitching=this._pitching||A!==p,this._rolling=this._rolling||R!==y,this._padding=!a.isPaddingEqual(D),this._zooming=this._zooming||ne.isZooming,this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,K),this.terrain&&this._prepareElevation(ne.elevationCenter),this._ease(ie=>{ne.easeFunc(ie),this.terrain&&!e.freezeElevation&&this._updateElevation(ie),this._applyUpdatedTransform(a),this._fireMoveEvents(r)},ie=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,ie)},e),this}_prepareEase(e,r,a={}){this._moving=!0,r||a.moving||this.fire(new s.l("movestart",e)),this._zooming&&!a.zooming&&this.fire(new s.l("zoomstart",e)),this._rotating&&!a.rotating&&this.fire(new s.l("rotatestart",e)),this._pitching&&!a.pitching&&this.fire(new s.l("pitchstart",e)),this._rolling&&!a.rolling&&this.fire(new s.l("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){const a=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(a-(r-(a*e+this._elevationStart))/(1-e)),this._elevationTarget=r}this.transform.setElevation(s.B.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};const r=e.getCameraLngLat(),a=e.getCameraAltitude(),l=this.terrain?this.terrain.getElevationForLngLatZoom(r,e.zoom):0;if(a<l){const p=this.calculateCameraOptionsFromTo(r,l,e.center,e.elevation);return{pitch:p.pitch,zoom:p.zoom}}return{}}_applyUpdatedTransform(e){const r=[];if(r.push(l=>this._elevateCameraIfInsideTerrain(l)),this.transformCameraUpdate&&r.push(l=>this.transformCameraUpdate(l)),!r.length)return;const a=e.clone();for(const l of r){const p=a.clone(),{center:y,zoom:w,roll:A,pitch:R,bearing:D,elevation:N}=l(p);y&&p.setCenter(y),N!==void 0&&p.setElevation(N),w!==void 0&&p.setZoom(w),A!==void 0&&p.setRoll(A),R!==void 0&&p.setPitch(R),D!==void 0&&p.setBearing(D),a.apply(p)}this.transform.apply(a)}_fireMoveEvents(e){this.fire(new s.l("move",e)),this._zooming&&this.fire(new s.l("zoom",e)),this._rotating&&this.fire(new s.l("rotate",e)),this._pitching&&this.fire(new s.l("pitch",e)),this._rolling&&this.fire(new s.l("roll",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;const a=this._zooming,l=this._rotating,p=this._pitching,y=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,a&&this.fire(new s.l("zoomend",e)),l&&this.fire(new s.l("rotateend",e)),p&&this.fire(new s.l("pitchend",e)),y&&this.fire(new s.l("rollend",e)),this.fire(new s.l("moveend",e))}flyTo(e,r){if(!e.essential&&M.prefersReducedMotion){const De=s.O(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(De,r)}this.stop(),e=s.e({offset:[0,0],speed:1.2,curve:1.42,easing:s.cf},e);const a=this._getTransformForUpdate(),l=a.bearing,p=a.pitch,y=a.roll,w=a.padding,A="bearing"in e?this._normalizeBearing(e.bearing,l):l,R="pitch"in e?+e.pitch:p,D="roll"in e?this._normalizeBearing(e.roll,y):y,N="padding"in e?e.padding:a.padding,O=s.P.convert(e.offset);let Z=a.centerPoint.add(O);const K=a.screenPointToLocation(Z),ne=this.cameraHelper.handleFlyTo(a,{bearing:A,pitch:R,roll:D,padding:N,locationAtOffset:K,offsetAsPoint:O,center:e.center,minZoom:e.minZoom,zoom:e.zoom});let ie=e.curve;const ae=Math.max(a.width,a.height),ue=ae/ne.scaleOfZoom,me=ne.pixelPathLength;typeof ne.scaleOfMinZoom=="number"&&(ie=Math.sqrt(ae/ne.scaleOfMinZoom/me*2));const fe=ie*ie;function ge(De){const Ye=(ue*ue-ae*ae+(De?-1:1)*fe*fe*me*me)/(2*(De?ue:ae)*fe*me);return Math.log(Math.sqrt(Ye*Ye+1)-Ye)}function xe(De){return(Math.exp(De)-Math.exp(-De))/2}function ye(De){return(Math.exp(De)+Math.exp(-De))/2}const Te=ge(!1);let Fe=function(De){return ye(Te)/ye(Te+ie*De)},Le=function(De){return ae*((ye(Te)*(xe(Ye=Te+ie*De)/ye(Ye))-xe(Te))/fe)/me;var Ye},Be=(ge(!0)-Te)/ie;if(Math.abs(me)<2e-6||!isFinite(Be)){if(Math.abs(ae-ue)<1e-6)return this.easeTo(e,r);const De=ue<ae?-1:1;Be=Math.abs(Math.log(ue/ae))/ie,Le=()=>0,Fe=Ye=>Math.exp(De*ie*Ye)}return e.duration="duration"in e?+e.duration:1e3*Be/("screenSpeed"in e?+e.screenSpeed/ie:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=l!==A,this._pitching=R!==p,this._rolling=D!==y,this._padding=!a.isPaddingEqual(N),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(ne.targetCenter),this._ease(De=>{const Ye=De*Be,Xe=1/Fe(Ye),He=Le(Ye);this._rotating&&a.setBearing(s.B.number(l,A,De)),this._pitching&&a.setPitch(s.B.number(p,R,De)),this._rolling&&a.setRoll(s.B.number(y,D,De)),this._padding&&(a.interpolatePadding(w,N,De),Z=a.centerPoint.add(O)),ne.easeFunc(De,Xe,He,Z),this.terrain&&!e.freezeElevation&&this._updateElevation(De),this._applyUpdatedTransform(a),this._fireMoveEvents(r)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,r){var a;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const l=this._onEaseEnd;delete this._onEaseEnd,l.call(this,r)}return e||(a=this.handlers)===null||a===void 0||a.stop(!1),this}_ease(e,r,a){a.animate===!1||a.duration===0?(e(1),r()):(this._easeStart=M.now(),this._easeOptions=a,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=s.aL(e,-180,180);const a=Math.abs(e-r);return Math.abs(e-360-r)<a&&(e-=360),Math.abs(e+360-r)<a&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(s.Q.convert(e),this.transform.tileZoom):null}}const fn={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class lr{constructor(e=fn){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=r=>{!r||r.sourceDataType!=="metadata"&&r.sourceDataType!=="visibility"&&r.dataType!=="style"&&r.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=E.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=E.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=E.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){E.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,r){const a=this._map._getUIString(`AttributionControl.${r}`);e.title=a,e.setAttribute("aria-label",a)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(l=>typeof l!="string"?"":l)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const l=this._map.style.stylesheet;this.styleOwner=l.owner,this.styleId=l.id}const r=this._map.style.sourceCaches;for(const l in r){const p=r[l];if(p.used||p.usedForTerrain){const y=p.getSource();y.attribution&&e.indexOf(y.attribution)<0&&e.push(y.attribution)}}e=e.filter(l=>String(l).trim()),e.sort((l,p)=>l.length-p.length),e=e.filter((l,p)=>{for(let y=p+1;y<e.length;y++)if(e[y].indexOf(l)>=0)return!1;return!0});const a=e.join(" | ");a!==this._attribHTML&&(this._attribHTML=a,e.length?(this._innerContainer.innerHTML=E.sanitize(a),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class po{constructor(e={}){this._updateCompact=()=>{const r=this._container.children;if(r.length){const a=r[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&a.classList.add("maplibregl-compact"):a.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=E.create("div","maplibregl-ctrl");const r=E.create("a","maplibregl-ctrl-logo");return r.target="_blank",r.rel="noopener nofollow",r.href="https://maplibre.org/",r.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),r.setAttribute("rel","noopener nofollow"),this._container.appendChild(r),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){E.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class bl{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const r=++this._id;return this._queue.push({callback:e,id:r,cancelled:!1}),r}remove(e){const r=this._currentlyRunning,a=r?this._queue.concat(r):this._queue;for(const l of a)if(l.id===e)return void(l.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const r=this._currentlyRunning=this._queue;this._queue=[];for(const a of r)if(!a.cancelled&&(a.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Gc=s.aG([{name:"a_pos3d",type:"Int16",components:3}]);class Jc extends s.E{constructor(e){super(),this._lastTilesetChange=M.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];const a={};for(const l of be(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))a[l.key]=!0,this._renderableTilesKeys.push(l.key),this._tiles[l.key]||(l.terrainRttPosMatrix32f=new Float64Array(16),s.bQ(l.terrainRttPosMatrix32f,0,s.Z,s.Z,0,0,1),this._tiles[l.key]=new qr(l,this.tileSize),this._lastTilesetChange=M.now());for(const l in this._tiles)a[l]||delete this._tiles[l]}freeRtt(e){for(const r in this._tiles){const a=this._tiles[r];(!e||a.tileID.equals(e)||a.tileID.isChildOf(e)||e.isChildOf(a.tileID))&&(a.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,r){return r?this._getTerrainCoordsForTileRanges(e,r):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){const r={};for(const a of this._renderableTilesKeys){const l=this._tiles[a].tileID,p=e.clone(),y=s.b2();if(l.canonical.equals(e.canonical))s.bQ(y,0,s.Z,s.Z,0,0,1);else if(l.canonical.isChildOf(e.canonical)){const w=l.canonical.z-e.canonical.z,A=l.canonical.x-(l.canonical.x>>w<<w),R=l.canonical.y-(l.canonical.y>>w<<w),D=s.Z>>w;s.bQ(y,0,D,D,0,0,1),s.L(y,y,[-A*D,-R*D,0])}else{if(!e.canonical.isChildOf(l.canonical))continue;{const w=e.canonical.z-l.canonical.z,A=e.canonical.x-(e.canonical.x>>w<<w),R=e.canonical.y-(e.canonical.y>>w<<w),D=s.Z>>w;s.bQ(y,0,s.Z,s.Z,0,0,1),s.L(y,y,[A*D,R*D,0]),s.M(y,y,[1/2**w,1/2**w,0])}}p.terrainRttPosMatrix32f=new Float32Array(y),r[a]=p}return r}_getTerrainCoordsForTileRanges(e,r){const a={};for(const l of this._renderableTilesKeys){const p=this._tiles[l].tileID;if(!this._isWithinTileRanges(p,r))continue;const y=e.clone(),w=s.b2();if(p.canonical.z===e.canonical.z){const A=e.canonical.x-p.canonical.x,R=e.canonical.y-p.canonical.y;s.bQ(w,0,s.Z,s.Z,0,0,1),s.L(w,w,[A*s.Z,R*s.Z,0])}else if(p.canonical.z>e.canonical.z){const A=p.canonical.z-e.canonical.z,R=p.canonical.x-(p.canonical.x>>A<<A),D=p.canonical.y-(p.canonical.y>>A<<A),N=e.canonical.x-(p.canonical.x>>A),O=e.canonical.y-(p.canonical.y>>A),Z=s.Z>>A;s.bQ(w,0,Z,Z,0,0,1),s.L(w,w,[-R*Z+N*s.Z,-D*Z+O*s.Z,0])}else{const A=e.canonical.z-p.canonical.z,R=e.canonical.x-(e.canonical.x>>A<<A),D=e.canonical.y-(e.canonical.y>>A<<A),N=(e.canonical.x>>A)-p.canonical.x,O=(e.canonical.y>>A)-p.canonical.y,Z=s.Z<<A;s.bQ(w,0,Z,Z,0,0,1),s.L(w,w,[R*s.Z+N*Z,D*s.Z+O*Z,0])}y.terrainRttPosMatrix32f=new Float32Array(w),a[l]=y}return a}getSourceTile(e,r){const a=this.sourceCache._source;let l=e.overscaledZ-this.deltaZoom;if(l>a.maxzoom&&(l=a.maxzoom),l<a.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(l).key);let p=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!p||!p.dem)&&r)for(;l>=a.minzoom&&(!p||!p.dem);)p=this.sourceCache.getTileByID(e.scaledTo(l--).key);return p}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,r){return r[e.canonical.z]&&e.canonical.x>=r[e.canonical.z].minTileX&&e.canonical.x<=r[e.canonical.z].maxTileX&&e.canonical.y>=r[e.canonical.z].minTileY&&e.canonical.y<=r[e.canonical.z].maxTileY}}class Xc{constructor(e,r,a){this._meshCache={},this.painter=e,this.sourceCache=new Jc(r),this.options=a,this.exaggeration=typeof a.exaggeration=="number"?a.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,a,l=s.Z){var p;if(!(r>=0&&r<l&&a>=0&&a<l))return 0;const y=this.getTerrainData(e),w=(p=y.tile)===null||p===void 0?void 0:p.dem;if(!w)return 0;const A=s.cj([],[r/l*s.Z,a/l*s.Z],y.u_terrain_matrix),R=[A[0]*w.dim,A[1]*w.dim],D=Math.floor(R[0]),N=Math.floor(R[1]),O=R[0]-D,Z=R[1]-N;return w.get(D,N)*(1-O)*(1-Z)+w.get(D+1,N)*O*(1-Z)+w.get(D,N+1)*(1-O)*Z+w.get(D+1,N+1)*O*Z}getElevationForLngLatZoom(e,r){if(!s.ck(r,e.wrap()))return 0;const{tileID:a,mercatorX:l,mercatorY:p}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(a,l%s.Z,p%s.Z,s.Z)}getElevation(e,r,a,l=s.Z){return this.getDEMElevation(e,r,a,l)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const l=this.painter.context,p=new s.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ze(l,p,l.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ze(l,new s.R({width:1,height:1}),l.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=s.ad([])}const r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const l=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new Ze(l,r.dem.getPixels(),l.gl.RGBA,{premultiply:!1}),r.demTexture.bind(l.gl.NEAREST,l.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const a=r&&r+r.tileID.key+e.key;if(a&&!this._demMatrixCache[a]){const l=this.sourceCache.sourceCache._source.maxzoom;let p=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=l?p=e.canonical.z-l:s.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const y=e.canonical.x-(e.canonical.x>>p<<p),w=e.canonical.y-(e.canonical.y>>p<<p),A=s.cl(new Float64Array(16),[1/(s.Z<<p),1/(s.Z<<p),0]);s.L(A,A,[y*s.Z,w*s.Z,0]),this._demMatrixCache[e.key]={matrix:A,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:a?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(e){const r=this.painter,a=r.width/devicePixelRatio,l=r.height/devicePixelRatio;return!this._fbo||this._fbo.width===a&&this._fbo.height===l||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Ze(r.context,{width:a,height:l,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Ze(r.context,{width:a,height:l,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=r.context.createFramebuffer(a,l,!0,!1),this._fbo.depthAttachment.set(r.context.createRenderbuffer(r.context.gl.DEPTH_COMPONENT16,a,l))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let p=0,y=0;p<this._coordsTextureSize;p++)for(let w=0;w<this._coordsTextureSize;w++,y+=4)r[y+0]=255&w,r[y+1]=255&p,r[y+2]=w>>8<<4|p>>8,r[y+3]=0;const a=new s.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),l=new Ze(e,a,e.gl.RGBA,{premultiply:!1});return l.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=l,l}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const r=new Uint8Array(4),a=this.painter.context,l=a.gl,p=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),y=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),w=Math.round(this.painter.height/devicePixelRatio);a.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),l.readPixels(p,w-y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,r),a.bindFramebuffer.set(null);const A=r[0]+(r[2]>>4<<8),R=r[1]+((15&r[2])<<8),D=this.coordsIndex[255-r[3]],N=D&&this.sourceCache.getTileByID(D);if(!N)return null;const O=this._coordsTextureSize,Z=(1<<N.tileID.canonical.z)*O;return new s.$((N.tileID.canonical.x*O+A)/Z+N.tileID.wrap,(N.tileID.canonical.y*O+R)/Z,this.getElevation(N.tileID,A,R,O))}depthAtPoint(e){const r=new Uint8Array(4),a=this.painter.context,l=a.gl;return a.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),l.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,l.RGBA,l.UNSIGNED_BYTE,r),a.bindFramebuffer.set(null),(r[0]/16777216+r[1]/65536+r[2]/256+r[3])/256}getTerrainMesh(e){var r;const a=((r=this.painter.style.projection)===null||r===void 0?void 0:r.transitionState)>0,l=a&&e.canonical.y===0,p=a&&e.canonical.y===(1<<e.canonical.z)-1,y=`m_${l?"n":""}_${p?"s":""}`;if(this._meshCache[y])return this._meshCache[y];const w=this.painter.context,A=new s.cm,R=new s.aK,D=this.meshSize,N=s.Z/D,O=D*D;for(let ye=0;ye<=D;ye++)for(let Te=0;Te<=D;Te++)A.emplaceBack(Te*N,ye*N,0);for(let ye=0;ye<O;ye+=D+1)for(let Te=0;Te<D;Te++)R.emplaceBack(Te+ye,D+Te+ye+1,D+Te+ye+2),R.emplaceBack(Te+ye,D+Te+ye+2,Te+ye+1);const Z=A.length,K=Z+(D+1),ne=(D+1)*D,ie=l?s.b9:0,ae=l?0:1,ue=p?s.ba:s.Z,me=p?0:1;for(let ye=0;ye<=D;ye++)A.emplaceBack(ye*N,ie,ae);for(let ye=0;ye<=D;ye++)A.emplaceBack(ye*N,ue,me);for(let ye=0;ye<D;ye++)R.emplaceBack(ne+ye,K+ye,K+ye+1),R.emplaceBack(ne+ye,K+ye+1,ne+ye+1),R.emplaceBack(0+ye,Z+ye+1,Z+ye),R.emplaceBack(0+ye,0+ye+1,Z+ye+1);const fe=A.length,ge=fe+2*(D+1);for(const ye of[0,1])for(let Te=0;Te<=D;Te++)for(const Fe of[0,1])A.emplaceBack(ye*s.Z,Te*N,Fe);for(let ye=0;ye<2*D;ye+=2)R.emplaceBack(fe+ye,fe+ye+1,fe+ye+3),R.emplaceBack(fe+ye,fe+ye+3,fe+ye+2),R.emplaceBack(ge+ye,ge+ye+3,ge+ye+1),R.emplaceBack(ge+ye,ge+ye+2,ge+ye+3);const xe=new hs(w.createVertexBuffer(A,Gc.members),w.createIndexBuffer(R),s.aJ.simpleSegment(0,0,A.length,R.length));return this._meshCache[y]=xe,xe}getMeshFrameDelta(e){return 2*Math.PI*s.bu/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,r){var a;const{tileID:l}=this._getOverscaledTileIDFromLngLatZoom(e,r);return(a=this.getMinMaxElevation(l).minElevation)!==null&&a!==void 0?a:0}getMinMaxElevation(e){const r=this.getTerrainData(e).tile,a={minElevation:null,maxElevation:null};return r&&r.dem&&(a.minElevation=r.dem.min*this.exaggeration,a.maxElevation=r.dem.max*this.exaggeration),a}_getOverscaledTileIDFromLngLatZoom(e,r){const a=s.$.fromLngLat(e.wrap()),l=(1<<r)*s.Z,p=a.x*l,y=a.y*l,w=Math.floor(p/s.Z),A=Math.floor(y/s.Z);return{tileID:new s.Y(r,0,r,w,A),mercatorX:p,mercatorY:y}}}class Nh{constructor(e,r,a){this._context=e,this._size=r,this._tileSize=a,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const r=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),a=new Ze(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return a.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),r.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),r.colorAttachment.set(a.texture),{id:e,fbo:r,texture:a,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(r=>e.id!==r),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const r of this._recentlyUsed)if(!this._objects[r].inUse)return this._objects[r];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}const yi={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class ga{constructor(e,r){this.painter=e,this.terrain=r,this.pool=new Nh(e.context,30,r.sourceCache.tileSize*r.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,r){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(a=>!e._layers[a].isHidden(r)),this._coordsAscending={};for(const a in e.sourceCaches){this._coordsAscending[a]={};const l=e.sourceCaches[a].getVisibleCoordinates(),p=e.sourceCaches[a].getSource(),y=p instanceof Rr?p.terrainTileRanges:null;for(const w of l){const A=this.terrain.sourceCache.getTerrainCoords(w,y);for(const R in A)this._coordsAscending[a][R]||(this._coordsAscending[a][R]=[]),this._coordsAscending[a][R].push(A[R])}}this._coordsAscendingStr={};for(const a of e._order){const l=e._layers[a],p=l.source;if(yi[l.type]&&!this._coordsAscendingStr[p]){this._coordsAscendingStr[p]={};for(const y in this._coordsAscending[p])this._coordsAscendingStr[p][y]=this._coordsAscending[p][y].map(w=>w.key).sort().join()}}for(const a of this._renderableTiles)for(const l in this._coordsAscendingStr){const p=this._coordsAscendingStr[l][a.tileID.key];p&&p!==a.rttCoords[l]&&(a.rtt=[])}}renderLayer(e,r){if(e.isHidden(this.painter.transform.zoom))return!1;const a=Object.assign(Object.assign({},r),{isRenderingToTexture:!0}),l=e.type,p=this.painter,y=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(yi[l]&&(this._prevType&&yi[this._prevType]||this._stacks.push([]),this._prevType=l,this._stacks[this._stacks.length-1].push(e.id),!y))return!0;if(yi[this._prevType]||yi[l]&&y){this._prevType=l;const w=this._stacks.length-1,A=this._stacks[w]||[];for(const R of this._renderableTiles){if(this.pool.isFull()&&(Tn(this.painter,this.terrain,this._rttTiles,a),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(R),R.rtt[w]){const N=this.pool.getObjectForId(R.rtt[w].id);if(N.stamp===R.rtt[w].stamp){this.pool.useObject(N);continue}}const D=this.pool.getOrCreateFreeObject();this.pool.useObject(D),this.pool.stampObject(D),R.rtt[w]={id:D.id,stamp:D.stamp},p.context.bindFramebuffer.set(D.fbo.framebuffer),p.context.clear({color:s.b7.transparent,stencil:0}),p.currentStencilSource=void 0;for(let N=0;N<A.length;N++){const O=p.style._layers[A[N]],Z=O.source?this._coordsAscending[O.source][R.tileID.key]:[R.tileID];p.context.viewport.set([0,0,D.fbo.width,D.fbo.height]),p._renderTileClippingMasks(O,Z,!0),p.renderLayer(p,p.style.sourceCaches[O.source],O,Z,a),O.source&&(R.rttCoords[O.source]=this._coordsAscendingStr[O.source][R.tileID.key])}}return Tn(this.painter,this.terrain,this._rttTiles,a),this._rttTiles=[],this.pool.freeAllObjects(),yi[l]}return!1}}const ct={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},yt=V,fo={hash:!1,interactive:!0,bearingSnap:7,attributionControl:fn,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:s.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},wl={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class Sl{constructor(e,r,a=!1){this.mousedown=p=>{this.startMove(p,E.mousePos(this.element,p)),E.addEventListener(window,"mousemove",this.mousemove),E.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=p=>{this.move(p,E.mousePos(this.element,p))},this.mouseup=p=>{this._rotatePitchHanlder.dragEnd(p),this.offTemp()},this.touchstart=p=>{p.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=E.touchPos(this.element,p.targetTouches)[0],this.startMove(p,this._startPos),E.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.addEventListener(window,"touchend",this.touchend))},this.touchmove=p=>{p.targetTouches.length!==1?this.reset():(this._lastPos=E.touchPos(this.element,p.targetTouches)[0],this.move(p,this._lastPos))},this.touchend=p=>{p.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHanlder.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=r;const l=new Ts;this._rotatePitchHanlder=new hi({clickTolerance:3,move:(p,y)=>{const w=r.getBoundingClientRect(),A=new s.P((w.bottom-w.top)/2,(w.right-w.left)/2);return{bearingDelta:s.ce(new s.P(p.x,y.y),y,A),pitchDelta:a?-.5*(y.y-p.y):void 0}},moveStateManager:l,enable:!0,assignEvents:()=>{}}),this.map=e,E.addEventListener(r,"mousedown",this.mousedown),E.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),E.addEventListener(r,"touchcancel",this.reset)}startMove(e,r){this._rotatePitchHanlder.dragStart(e,r),E.disableDrag()}move(e,r){const a=this.map,{bearingDelta:l,pitchDelta:p}=this._rotatePitchHanlder.dragMove(e,r)||{};l&&a.setBearing(a.getBearing()+l),p&&a.setPitch(a.getPitch()+p)}off(){const e=this.element;E.removeEventListener(e,"mousedown",this.mousedown),E.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),E.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.removeEventListener(window,"touchend",this.touchend),E.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){E.enableDrag(),E.removeEventListener(window,"mousemove",this.mousemove),E.removeEventListener(window,"mouseup",this.mouseup),E.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.removeEventListener(window,"touchend",this.touchend)}}let zr;function Al(h,e,r,a=!1){if(a||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return h==null?void 0:h.wrap();const l=new s.Q(h.lng,h.lat);if(h=new s.Q(h.lng,h.lat),e){const p=new s.Q(h.lng-360,h.lat),y=new s.Q(h.lng+360,h.lat),w=r.locationToScreenPoint(h).distSqr(e);r.locationToScreenPoint(p).distSqr(e)<w?h=p:r.locationToScreenPoint(y).distSqr(e)<w&&(h=y)}for(;Math.abs(h.lng-r.center.lng)>180;){const p=r.locationToScreenPoint(h);if(p.x>=0&&p.y>=0&&p.x<=r.width&&p.y<=r.height)break;h.lng>r.center.lng?h.lng-=360:h.lng+=360}return h.lng!==l.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(h))?h:l}const qi={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Qc(h,e,r){const a=h.classList;for(const l in qi)a.remove(`maplibregl-${r}-anchor-${l}`);a.add(`maplibregl-${r}-anchor-${e}`)}class Yn extends s.E{constructor(e){if(super(),this._onKeyPress=r=>{const a=r.code,l=r.charCode||r.keyCode;a!=="Space"&&a!=="Enter"&&l!==32&&l!==13||this.togglePopup()},this._onMapClick=r=>{const a=r.originalEvent.target,l=this._element;this._popup&&(a===l||l.contains(a))&&this.togglePopup()},this._update=r=>{if(!this._map)return;const a=this._map.loaded()&&!this._map.isMoving();((r==null?void 0:r.type)==="terrain"||(r==null?void 0:r.type)==="render"&&!a)&&this._map.once("render",this._update),this._lngLat=Al(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let l="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?l=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(l=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||r&&r.type!=="moveend"||(this._pos=this._pos.round()),E.setTransform(this._element,`${qi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${p} ${l}`),M.frameAsync(new AbortController).then(()=>{this._updateOpacity(r&&r.type==="moveend")}).catch(()=>{})},this._onMove=r=>{if(!this._isDragging){const a=this._clickTolerance||this._map._clickTolerance;this._isDragging=r.point.dist(this._pointerdownPos)>=a}this._isDragging&&(this._pos=r.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new s.l("dragstart"))),this.fire(new s.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new s.l("dragend")),this._state="inactive"},this._addDragHandler=r=>{this._element.contains(r.originalEvent.target)&&(r.preventDefault(),this._positionDelta=r.point.sub(this._pos).add(this._offset),this._pointerdownPos=r.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=s.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=E.create("div");const r=E.createNS("http://www.w3.org/2000/svg","svg"),a=41,l=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${a}px`),r.setAttributeNS(null,"width",`${l}px`),r.setAttributeNS(null,"viewBox",`0 0 ${l} ${a}`);const p=E.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"stroke","none"),p.setAttributeNS(null,"stroke-width","1"),p.setAttributeNS(null,"fill","none"),p.setAttributeNS(null,"fill-rule","evenodd");const y=E.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");const w=E.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"transform","translate(3.0, 29.0)"),w.setAttributeNS(null,"fill","#000000");const A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const ae of A){const ue=E.createNS("http://www.w3.org/2000/svg","ellipse");ue.setAttributeNS(null,"opacity","0.04"),ue.setAttributeNS(null,"cx","10.5"),ue.setAttributeNS(null,"cy","5.80029008"),ue.setAttributeNS(null,"rx",ae.rx),ue.setAttributeNS(null,"ry",ae.ry),w.appendChild(ue)}const R=E.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"fill",this._color);const D=E.createNS("http://www.w3.org/2000/svg","path");D.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),R.appendChild(D);const N=E.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"opacity","0.25"),N.setAttributeNS(null,"fill","#000000");const O=E.createNS("http://www.w3.org/2000/svg","path");O.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),N.appendChild(O);const Z=E.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Z.setAttributeNS(null,"fill","#FFFFFF");const K=E.createNS("http://www.w3.org/2000/svg","g");K.setAttributeNS(null,"transform","translate(8.0, 8.0)");const ne=E.createNS("http://www.w3.org/2000/svg","circle");ne.setAttributeNS(null,"fill","#000000"),ne.setAttributeNS(null,"opacity","0.25"),ne.setAttributeNS(null,"cx","5.5"),ne.setAttributeNS(null,"cy","5.5"),ne.setAttributeNS(null,"r","5.4999962");const ie=E.createNS("http://www.w3.org/2000/svg","circle");ie.setAttributeNS(null,"fill","#FFFFFF"),ie.setAttributeNS(null,"cx","5.5"),ie.setAttributeNS(null,"cy","5.5"),ie.setAttributeNS(null,"r","5.4999962"),K.appendChild(ne),K.appendChild(ie),y.appendChild(w),y.appendChild(R),y.appendChild(N),y.appendChild(Z),y.appendChild(K),r.appendChild(y),r.setAttributeNS(null,"height",a*this._scale+"px"),r.setAttributeNS(null,"width",l*this._scale+"px"),this._element.appendChild(r),this._offset=s.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",r=>{r.preventDefault()}),this._element.addEventListener("mousedown",r=>{r.preventDefault()}),Qc(this._element,this._anchor,"marker"),e&&e.className)for(const r of e.className.split(" "))this._element.classList.add(r);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),E.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=s.Q.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const l=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[l,-1*(38.1-13.5+l)],"bottom-right":[-l,-1*(38.1-13.5+l)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var r,a;const l=(r=this._map)===null||r===void 0?void 0:r.terrain,p=this._map.transform.isLocationOccluded(this._lngLat);if(!l||p){const Z=p?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==Z&&(this._element.style.opacity=Z))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const y=this._map,w=y.terrain.depthAtPoint(this._pos),A=y.terrain.getElevationForLngLatZoom(this._lngLat,y.transform.tileZoom);if(y.transform.lngLatToCameraDepth(this._lngLat,A)-w<.006)return void(this._element.style.opacity=this._opacity);const R=-this._offset.y/y.transform.pixelsPerMeter,D=Math.sin(y.getPitch()*Math.PI/180)*R,N=y.terrain.depthAtPoint(new s.P(this._pos.x,this._pos.y-this._offset.y)),O=y.transform.lngLatToCameraDepth(this._lngLat,A+D)-N>.006;!((a=this._popup)===null||a===void 0)&&a.isOpen()&&O&&this._popup.remove(),this._element.style.opacity=O?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=s.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,r){return(this._opacity===void 0||e===void 0&&r===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),r!==void 0&&(this._opacityWhenCovered=r),this._map&&this._updateOpacity(!0),this}}const wr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let fr=0,Is=!1;const mo={maxWidth:100,unit:"metric"};function go(h,e,r){const a=r&&r.maxWidth||100,l=h._container.clientHeight/2,p=h._container.clientWidth/2,y=h.unproject([p-a/2,l]),w=h.unproject([p+a/2,l]),A=Math.round(h.project(w).x-h.project(y).x),R=Math.min(a,A,h._container.clientWidth),D=y.distanceTo(w);if(r&&r.unit==="imperial"){const N=3.2808*D;N>5280?$n(e,R,N/5280,h._getUIString("ScaleControl.Miles")):$n(e,R,N,h._getUIString("ScaleControl.Feet"))}else r&&r.unit==="nautical"?$n(e,R,D/1852,h._getUIString("ScaleControl.NauticalMiles")):D>=1e3?$n(e,R,D/1e3,h._getUIString("ScaleControl.Kilometers")):$n(e,R,D,h._getUIString("ScaleControl.Meters"))}function $n(h,e,r,a){const l=function(p){const y=Math.pow(10,`${Math.floor(p)}`.length-1);let w=p/y;return w=w>=10?10:w>=5?5:w>=3?3:w>=2?2:w>=1?1:function(A){const R=Math.pow(10,Math.ceil(-Math.log(A)/Math.LN10));return Math.round(A*R)/R}(w),y*w}(r);h.style.width=e*(l/r)+"px",h.innerHTML=`${l} ${a}`}const kl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},Cl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ms(h){if(h){if(typeof h=="number"){const e=Math.round(Math.abs(h)/Math.SQRT2);return{center:new s.P(0,0),top:new s.P(0,h),"top-left":new s.P(e,e),"top-right":new s.P(-e,e),bottom:new s.P(0,-h),"bottom-left":new s.P(e,-e),"bottom-right":new s.P(-e,-e),left:new s.P(h,0),right:new s.P(-h,0)}}if(h instanceof s.P||Array.isArray(h)){const e=s.P.convert(h);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:s.P.convert(h.center||[0,0]),top:s.P.convert(h.top||[0,0]),"top-left":s.P.convert(h["top-left"]||[0,0]),"top-right":s.P.convert(h["top-right"]||[0,0]),bottom:s.P.convert(h.bottom||[0,0]),"bottom-left":s.P.convert(h["bottom-left"]||[0,0]),"bottom-right":s.P.convert(h["bottom-right"]||[0,0]),left:s.P.convert(h.left||[0,0]),right:s.P.convert(h.right||[0,0])}}return Ms(new s.P(0,0))}const Tl=V;x.AJAXError=s.cq,x.Event=s.l,x.Evented=s.E,x.LngLat=s.Q,x.MercatorCoordinate=s.$,x.Point=s.P,x.addProtocol=s.cr,x.config=s.a,x.removeProtocol=s.cs,x.AttributionControl=lr,x.BoxZoomHandler=ml,x.CanvasSource=ir,x.CooperativeGesturesHandler=fa,x.DoubleClickZoomHandler=da,x.DragPanHandler=Zc,x.DragRotateHandler=Kc,x.EdgeInsets=js,x.FullscreenControl=class extends s.E{constructor(h={}){super(),this._onFullscreenChange=()=>{var e;let r=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=r==null?void 0:r.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)r=r.shadowRoot.fullscreenElement;r===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,h&&h.container&&(h.container instanceof HTMLElement?this._container=h.container:s.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(h){return this._map=h,this._container||(this._container=this._map.getContainer()),this._controlContainer=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){E.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const h=this._fullscreenButton=E.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);E.create("span","maplibregl-ctrl-icon",h).setAttribute("aria-hidden","true"),h.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const h=this._getTitle();this._fullscreenButton.setAttribute("aria-label",h),this._fullscreenButton.title=h}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new s.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new s.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},x.GeoJSONSource=Qt,x.GeolocateControl=class extends s.E{constructor(h){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new s.l("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new s.l("geolocate",e)),this._finish()}},this._updateCamera=e=>{const r=new s.Q(e.coords.longitude,e.coords.latitude),a=e.coords.accuracy,l=this._map.getBearing(),p=s.e({bearing:l},this.options.fitBoundsOptions),y=dt.fromLngLat(r,a);this._map.fitBounds(y,p,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const r=new s.Q(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=e=>{if(this._map){if(e.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&Is)return;this.options.trackUserLocation&&this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new s.l("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=E.create("button","maplibregl-ctrl-geolocate",this._container),E.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){s.w("Geolocation support is not available so the GeolocateControl will be disabled.");const r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}else{const r=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=E.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Yn({element:this._dotElement}),this._circleElement=E.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Yn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",r=>{r.geolocateSource||this._watchState!=="ACTIVE_LOCK"||r.originalEvent&&r.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new s.l("trackuserlocationend")),this.fire(new s.l("userlocationlostfocus")))})}},this.options=s.e({},wr,h)}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return s._(this,arguments,void 0,function*(e=!1){if(zr!==void 0&&!e)return zr;if(window.navigator.permissions===void 0)return zr=!!window.navigator.geolocation,zr;try{zr=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{zr=!!window.navigator.geolocation}return zr})}().then(e=>this._finishSetupUI(e)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),E.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,fr=0,Is=!1}_isOutOfMapMaxBounds(h){const e=this._map.getMaxBounds(),r=h.coords;return e&&(r.longitude<e.getWest()||r.longitude>e.getEast()||r.latitude<e.getSouth()||r.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const h=this._map.getBounds(),e=h.getSouthEast(),r=h.getNorthEast(),a=e.distanceTo(r),l=Math.ceil(this._accuracy/(a/this._map._container.clientHeight)*2);this._circleElement.style.width=`${l}px`,this._circleElement.style.height=`${l}px`}trigger(){if(!this._setup)return s.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new s.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":fr--,Is=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new s.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new s.l("trackuserlocationstart")),this.fire(new s.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let h;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),fr++,fr>1?(h={maximumAge:6e5,timeout:0},Is=!0):(h=this.options.positionOptions,Is=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,h)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},x.GlobeControl=class{constructor(){this._toggleProjection=()=>{var h;const e=(h=this._map.getProjection())===null||h===void 0?void 0:h.type;this._map.setProjection(e!=="mercator"&&e?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var h;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((h=this._map.getProjection())===null||h===void 0?void 0:h.type)==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=E.create("button","maplibregl-ctrl-globe",this._container),E.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){E.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},x.Hash=hl,x.ImageSource=Rr,x.KeyboardHandler=Ps,x.LngLatBounds=dt,x.LogoControl=po,x.Map=class extends Oh{constructor(h){var e,r;s.cn.mark(s.co.create);const a=Object.assign(Object.assign(Object.assign({},fo),h),{canvasContextAttributes:Object.assign(Object.assign({},fo.canvasContextAttributes),h.canvasContextAttributes)});if(a.minZoom!=null&&a.maxZoom!=null&&a.minZoom>a.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(a.minPitch!=null&&a.maxPitch!=null&&a.minPitch>a.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(a.minPitch!=null&&a.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(a.maxPitch!=null&&a.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const l=new ds,p=new Ws;if(a.minZoom!==void 0&&l.setMinZoom(a.minZoom),a.maxZoom!==void 0&&l.setMaxZoom(a.maxZoom),a.minPitch!==void 0&&l.setMinPitch(a.minPitch),a.maxPitch!==void 0&&l.setMaxPitch(a.maxPitch),a.renderWorldCopies!==void 0&&l.setRenderWorldCopies(a.renderWorldCopies),super(l,p,{bearingSnap:a.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new bl,this._controls=[],this._mapId=s.a4(),this._contextLost=w=>{w.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new s.l("webglcontextlost",{originalEvent:w}))},this._contextRestored=w=>{this._setupPainter(),this.resize(),this._update(),this.fire(new s.l("webglcontextrestored",{originalEvent:w}))},this._onMapScroll=w=>{if(w.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=a.interactive,this._maxTileCacheSize=a.maxTileCacheSize,this._maxTileCacheZoomLevels=a.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},a.canvasContextAttributes),this._trackResize=a.trackResize===!0,this._bearingSnap=a.bearingSnap,this._centerClampedToGround=a.centerClampedToGround,this._refreshExpiredTiles=a.refreshExpiredTiles===!0,this._fadeDuration=a.fadeDuration,this._crossSourceCollisions=a.crossSourceCollisions===!0,this._collectResourceTiming=a.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},ct),a.locale),this._clickTolerance=a.clickTolerance,this._overridePixelRatio=a.pixelRatio,this._maxCanvasSize=a.maxCanvasSize,this.transformCameraUpdate=a.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=a.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=$.addThrottleControl(()=>this.isMoving()),this._requestManager=new de(a.transformRequest),typeof a.container=="string"){if(this._container=document.getElementById(a.container),!this._container)throw new Error(`Container '${a.container}' not found.`)}else{if(!(a.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=a.container}if(a.maxBounds&&this.setMaxBounds(a.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let w=!1;const A=lo(R=>{this._trackResize&&!this._removed&&(this.resize(R),this.redraw())},50);this._resizeObserver=new ResizeObserver(R=>{w?A(R):w=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Fh(this,a),this._hash=a.hash&&new hl(typeof a.hash=="string"&&a.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:a.bearing,pitch:a.pitch,roll:a.roll}),a.bounds&&(this.resize(),this.fitBounds(a.bounds,s.e({},a.fitBoundsOptions,{duration:0}))));const y=typeof a.style=="string"||((r=(e=a.style)===null||e===void 0?void 0:e.projection)===null||r===void 0?void 0:r.type)!=="globe";this.resize(null,y),this._localIdeographFontFamily=a.localIdeographFontFamily,this._validateStyle=a.validateStyle,a.style&&this.setStyle(a.style,{localIdeographFontFamily:a.localIdeographFontFamily}),a.attributionControl&&this.addControl(new lr(typeof a.attributionControl=="boolean"?void 0:a.attributionControl)),a.maplibreLogo&&this.addControl(new po,a.logoPosition),this.on("style.load",()=>{if(y||this._resizeTransform(),this.transform.unmodified){const w=s.O(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(w)}}),this.on("data",w=>{this._update(w.dataType==="style"),this.fire(new s.l(`${w.dataType}data`,w))}),this.on("dataloading",w=>{this.fire(new s.l(`${w.dataType}dataloading`,w))}),this.on("dataabort",w=>{this.fire(new s.l("sourcedataabort",w))})}_getMapId(){return this._mapId}addControl(h,e){if(e===void 0&&(e=h.getDefaultPosition?h.getDefaultPosition():"top-right"),!h||!h.onAdd)return this.fire(new s.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=h.onAdd(this);this._controls.push(h);const a=this._controlPositions[e];return e.indexOf("bottom")!==-1?a.insertBefore(r,a.firstChild):a.appendChild(r),this}removeControl(h){if(!h||!h.onRemove)return this.fire(new s.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(h);return e>-1&&this._controls.splice(e,1),h.onRemove(this),this}hasControl(h){return this._controls.indexOf(h)>-1}calculateCameraOptionsFromTo(h,e,r,a){return a==null&&this.terrain&&(a=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(h,e,r,a)}resize(h,e=!0){const[r,a]=this._containerDimensions(),l=this._getClampedPixelRatio(r,a);if(this._resizeCanvas(r,a,l),this.painter.resize(r,a,l),this.painter.overLimit()){const y=this.painter.context.gl;this._maxCanvasSize=[y.drawingBufferWidth,y.drawingBufferHeight];const w=this._getClampedPixelRatio(r,a);this._resizeCanvas(r,a,w),this.painter.resize(r,a,w)}this._resizeTransform(e);const p=!this._moving;return p&&(this.stop(),this.fire(new s.l("movestart",h)).fire(new s.l("move",h))),this.fire(new s.l("resize",h)),p&&this.fire(new s.l("moveend",h)),this}_resizeTransform(h=!0){var e;const[r,a]=this._containerDimensions();this.transform.resize(r,a,h),(e=this._requestedCameraState)===null||e===void 0||e.resize(r,a,h)}_getClampedPixelRatio(h,e){const{0:r,1:a}=this._maxCanvasSize,l=this.getPixelRatio(),p=h*l,y=e*l;return Math.min(p>r?r/p:1,y>a?a/y:1)*l}getPixelRatio(){var h;return(h=this._overridePixelRatio)!==null&&h!==void 0?h:devicePixelRatio}setPixelRatio(h){this._overridePixelRatio=h,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(h){return this.transform.setMaxBounds(dt.convert(h)),this._update()}setMinZoom(h){if((h=h??-2)>=-2&&h<=this.transform.maxZoom)return this.transform.setMinZoom(h),this._update(),this.getZoom()<h&&this.setZoom(h),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(h){if((h=h??22)>=this.transform.minZoom)return this.transform.setMaxZoom(h),this._update(),this.getZoom()>h&&this.setZoom(h),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(h){if((h=h??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(h>=0&&h<=this.transform.maxPitch)return this.transform.setMinPitch(h),this._update(),this.getPitch()<h&&this.setPitch(h),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(h){if((h=h??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(h>=this.transform.minPitch)return this.transform.setMaxPitch(h),this._update(),this.getPitch()>h&&this.setPitch(h),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(h){return this.transform.setRenderWorldCopies(h),this._update()}project(h){return this.transform.locationToScreenPoint(s.Q.convert(h),this.style&&this.terrain)}unproject(h){return this.transform.screenPointToLocation(s.P.convert(h),this.terrain)}isMoving(){var h;return this._moving||((h=this.handlers)===null||h===void 0?void 0:h.isMoving())}isZooming(){var h;return this._zooming||((h=this.handlers)===null||h===void 0?void 0:h.isZooming())}isRotating(){var h;return this._rotating||((h=this.handlers)===null||h===void 0?void 0:h.isRotating())}_createDelegatedListener(h,e,r){if(h==="mouseenter"||h==="mouseover"){let a=!1;return{layers:e,listener:r,delegates:{mousemove:p=>{const y=e.filter(A=>this.getLayer(A)),w=y.length!==0?this.queryRenderedFeatures(p.point,{layers:y}):[];w.length?a||(a=!0,r.call(this,new Ur(h,this,p.originalEvent,{features:w}))):a=!1},mouseout:()=>{a=!1}}}}if(h==="mouseleave"||h==="mouseout"){let a=!1;return{layers:e,listener:r,delegates:{mousemove:y=>{const w=e.filter(A=>this.getLayer(A));(w.length!==0?this.queryRenderedFeatures(y.point,{layers:w}):[]).length?a=!0:a&&(a=!1,r.call(this,new Ur(h,this,y.originalEvent)))},mouseout:y=>{a&&(a=!1,r.call(this,new Ur(h,this,y.originalEvent)))}}}}{const a=l=>{const p=e.filter(w=>this.getLayer(w)),y=p.length!==0?this.queryRenderedFeatures(l.point,{layers:p}):[];y.length&&(l.features=y,r.call(this,l),delete l.features)};return{layers:e,listener:r,delegates:{[h]:a}}}}_saveDelegatedListener(h,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[h]=this._delegatedListeners[h]||[],this._delegatedListeners[h].push(e)}_removeDelegatedListener(h,e,r){if(!this._delegatedListeners||!this._delegatedListeners[h])return;const a=this._delegatedListeners[h];for(let l=0;l<a.length;l++){const p=a[l];if(p.listener===r&&p.layers.length===e.length&&p.layers.every(y=>e.includes(y))){for(const y in p.delegates)this.off(y,p.delegates[y]);return void a.splice(l,1)}}}on(h,e,r){if(r===void 0)return super.on(h,e);const a=typeof e=="string"?[e]:e,l=this._createDelegatedListener(h,a,r);this._saveDelegatedListener(h,l);for(const p in l.delegates)this.on(p,l.delegates[p]);return{unsubscribe:()=>{this._removeDelegatedListener(h,a,r)}}}once(h,e,r){if(r===void 0)return super.once(h,e);const a=typeof e=="string"?[e]:e,l=this._createDelegatedListener(h,a,r);for(const p in l.delegates){const y=l.delegates[p];l.delegates[p]=(...w)=>{this._removeDelegatedListener(h,a,r),y(...w)}}this._saveDelegatedListener(h,l);for(const p in l.delegates)this.once(p,l.delegates[p]);return this}off(h,e,r){return r===void 0?super.off(h,e):(this._removeDelegatedListener(h,typeof e=="string"?[e]:e,r),this)}queryRenderedFeatures(h,e){if(!this.style)return[];let r;const a=h instanceof s.P||Array.isArray(h),l=a?h:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(a?{}:h)||{},l instanceof s.P||typeof l[0]=="number")r=[s.P.convert(l)];else{const p=s.P.convert(l[0]),y=s.P.convert(l[1]);r=[p,new s.P(y.x,p.y),y,new s.P(p.x,y.y),p]}return this.style.queryRenderedFeatures(r,e,this.transform)}querySourceFeatures(h,e){return this.style.querySourceFeatures(h,e)}setStyle(h,e){return(e=s.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&h?(this._diffStyle(h,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(h,e))}setTransformRequest(h){return this._requestManager.setTransformRequest(h),this}_getUIString(h){const e=this._locale[h];if(e==null)throw new Error(`Missing UI string '${h}'`);return e}_updateStyle(h,e){var r,a;if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(h,e));const l=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!h)),h?(this.style=new Ka(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof h=="string"?this.style.loadURL(h,e,l):this.style.loadJSON(h,e,l),this):((a=(r=this.style)===null||r===void 0?void 0:r.projection)===null||a===void 0||a.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ka(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(h,e){if(typeof h=="string"){const r=this._requestManager.transformRequest(h,"Style");s.j(r,new AbortController).then(a=>{this._updateDiff(a.data,e)}).catch(a=>{a&&this.fire(new s.k(a))})}else typeof h=="object"&&this._updateDiff(h,e)}_updateDiff(h,e){try{this.style.setState(h,e)&&this._update(!0)}catch(r){s.w(`Unable to perform style diff: ${r.message||r.error||r}. Rebuilding the style from scratch.`),this._updateStyle(h,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():s.w("There is no style added to the map.")}addSource(h,e){return this._lazyInitEmptyStyle(),this.style.addSource(h,e),this._update(!0)}isSourceLoaded(h){const e=this.style&&this.style.sourceCaches[h];if(e!==void 0)return e.loaded();this.fire(new s.k(new Error(`There is no source with ID '${h}'`)))}setTerrain(h){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),h){const e=this.style.sourceCaches[h.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${h.source}`);this.terrain===null&&e.reload();for(const r in this.style._layers){const a=this.style._layers[r];a.type==="hillshade"&&a.source===h.source&&s.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Xc(this.painter,e,h),this.painter.renderToTexture=new ga(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=r=>{var a;r.dataType==="style"?this.terrain.sourceCache.freeRtt():r.dataType==="source"&&r.tile&&(r.sourceId!==h.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),((a=r.source)===null||a===void 0?void 0:a.type)==="image"?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(r.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new s.l("terrain",{terrain:h})),this}getTerrain(){var h,e;return(e=(h=this.terrain)===null||h===void 0?void 0:h.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const h=this.style&&this.style.sourceCaches;for(const e in h){const r=h[e]._tiles;for(const a in r){const l=r[a];if(l.state!=="loaded"&&l.state!=="errored")return!1}}return!0}removeSource(h){return this.style.removeSource(h),this._update(!0)}getSource(h){return this.style.getSource(h)}setSourceTileLodParams(h,e,r){if(r){const a=this.getSource(r);if(!a)throw new Error(`There is no source with ID "${r}", cannot set LOD parameters`);a.calculateTileZoom=_e(Math.max(1,h),Math.max(1,e))}else for(const a in this.style.sourceCaches)this.style.sourceCaches[a].getSource().calculateTileZoom=_e(Math.max(1,h),Math.max(1,e));return this._update(!0),this}refreshTiles(h,e){const r=this.style.sourceCaches[h];if(!r)throw new Error(`There is no source cache with ID "${h}", cannot refresh tile`);e===void 0?r.reload():r.refreshTiles(e.map(a=>new s.a1(a.z,a.x,a.y)))}addImage(h,e,r={}){const{pixelRatio:a=1,sdf:l=!1,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R}=r;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||s.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new s.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:D,height:N,data:O}=e,Z=e;return this.style.addImage(h,{data:new s.R({width:D,height:N},new Uint8Array(O)),pixelRatio:a,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R,sdf:l,version:0,userImage:Z}),Z.onAdd&&Z.onAdd(this,h),this}}{const{width:D,height:N,data:O}=M.getImageData(e);this.style.addImage(h,{data:new s.R({width:D,height:N},O),pixelRatio:a,stretchX:p,stretchY:y,content:w,textFitWidth:A,textFitHeight:R,sdf:l,version:0})}}updateImage(h,e){const r=this.style.getImage(h);if(!r)return this.fire(new s.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const a=e instanceof HTMLImageElement||s.b(e)?M.getImageData(e):e,{width:l,height:p,data:y}=a;if(l===void 0||p===void 0)return this.fire(new s.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(l!==r.data.width||p!==r.data.height)return this.fire(new s.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const w=!(e instanceof HTMLImageElement||s.b(e));return r.data.replace(y,w),this.style.updateImage(h,r),this}getImage(h){return this.style.getImage(h)}hasImage(h){return h?!!this.style.getImage(h):(this.fire(new s.k(new Error("Missing required image id"))),!1)}removeImage(h){this.style.removeImage(h)}loadImage(h){return $.getImage(this._requestManager.transformRequest(h,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(h,e){return this._lazyInitEmptyStyle(),this.style.addLayer(h,e),this._update(!0)}moveLayer(h,e){return this.style.moveLayer(h,e),this._update(!0)}removeLayer(h){return this.style.removeLayer(h),this._update(!0)}getLayer(h){return this.style.getLayer(h)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(h,e,r){return this.style.setLayerZoomRange(h,e,r),this._update(!0)}setFilter(h,e,r={}){return this.style.setFilter(h,e,r),this._update(!0)}getFilter(h){return this.style.getFilter(h)}setPaintProperty(h,e,r,a={}){return this.style.setPaintProperty(h,e,r,a),this._update(!0)}getPaintProperty(h,e){return this.style.getPaintProperty(h,e)}setLayoutProperty(h,e,r,a={}){return this.style.setLayoutProperty(h,e,r,a),this._update(!0)}getLayoutProperty(h,e){return this.style.getLayoutProperty(h,e)}setGlyphs(h,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(h,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(h,e,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(h,e,r,a=>{a||this._update(!0)}),this}removeSprite(h){return this._lazyInitEmptyStyle(),this.style.removeSprite(h),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(h,e,r=>{r||this._update(!0)}),this}setLight(h,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(h,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(h,e={}){return this._lazyInitEmptyStyle(),this.style.setSky(h,e),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(h,e){return this.style.setFeatureState(h,e),this._update()}removeFeatureState(h,e){return this.style.removeFeatureState(h,e),this._update()}getFeatureState(h){return this.style.getFeatureState(h)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let h=0,e=0;return this._container&&(h=this._container.clientWidth||400,e=this._container.clientHeight||300),[h,e]}_setupContainer(){const h=this._container;h.classList.add("maplibregl-map");const e=this._canvasContainer=E.create("div","maplibregl-canvas-container",h);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=E.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");const r=this._containerDimensions(),a=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],a);const l=this._controlContainer=E.create("div","maplibregl-control-container",h),p=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(y=>{p[y]=E.create("div",`maplibregl-ctrl-${y} `,l)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(h,e,r){this._canvas.width=Math.floor(r*h),this._canvas.height=Math.floor(r*e),this._canvas.style.width=`${h}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const h=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let e=null;this._canvas.addEventListener("webglcontextcreationerror",a=>{e={requestedAttributes:h},a&&(e.statusMessage=a.statusMessage,e.type=a.type)},{once:!0});let r=null;if(r=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,h):this._canvas.getContext("webgl2",h)||this._canvas.getContext("webgl",h),!r){const a="Failed to initialize WebGL";throw e?(e.message=a,new Error(JSON.stringify(e))):new Error(a)}this.painter=new ul(r,this.transform),C.testSupport(r)}migrateProjection(h,e){super.migrateProjection(h,e),this.painter.transform=h,this.fire(new s.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(h){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||h,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(h){return this._update(),this._renderTaskQueue.add(h)}_cancelRenderFrame(h){this._renderTaskQueue.remove(h)}_render(h){var e,r,a,l,p;const y=this._idleTriggered?this._fadeDuration:0,w=((e=this.style.projection)===null||e===void 0?void 0:e.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(h),this._removed)return;let A=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const N=this.transform.zoom,O=M.now();this.style.zoomHistory.update(N,O);const Z=new s.C(N,{now:O,fadeDuration:y,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),K=Z.crossFadingFactor();K===1&&K===this._crossFadingFactor||(A=!0,this._crossFadingFactor=K),this.style.update(Z)}const R=((r=this.style.projection)===null||r===void 0?void 0:r.transitionState)>0!==w;(a=this.style.projection)===null||a===void 0||a.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((l=this.style.projection)===null||l===void 0?void 0:l.transitionState,(p=this.style.projection)===null||p===void 0?void 0:p.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||R)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,y,this._crossSourceCollisions,R),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:y,showPadding:this.showPadding}),this.fire(new s.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,s.cn.mark(s.co.load),this.fire(new s.l("load"))),this.style&&(this.style.hasTransitions()||A)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const D=this._sourcesDirty||this._styleDirty||this._placementDirty;return D||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new s.l("idle")),!this._loaded||this._fullyLoaded||D||(this._fullyLoaded=!0,s.cn.mark(s.co.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var h;this._hash&&this._hash.remove();for(const r of this._controls)r.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),$.removeThrottleControl(this._imageQueueHandle),(h=this._resizeObserver)===null||h===void 0||h.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),E.remove(this._canvasContainer),E.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),s.cn.clearMetrics(),this._removed=!0,this.fire(new s.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,M.frame(this._frameRequest,h=>{s.cn.frame(h),this._frameRequest=null;try{this._render(h)}catch(e){if(!s.cp(e)&&!function(r){return r.message===Yo}(e))throw e}},()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(h){this._showTileBoundaries!==h&&(this._showTileBoundaries=h,this._update())}get showPadding(){return!!this._showPadding}set showPadding(h){this._showPadding!==h&&(this._showPadding=h,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(h){this._showCollisionBoxes!==h&&(this._showCollisionBoxes=h,h?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(h){this._showOverdrawInspector!==h&&(this._showOverdrawInspector=h,this._update())}get repaint(){return!!this._repaint}set repaint(h){this._repaint!==h&&(this._repaint=h,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(h){this._vertices=h,this._update()}get version(){return yt}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(h){return this._lazyInitEmptyStyle(),this.style.setProjection(h),this._update(!0)}},x.MapMouseEvent=Ur,x.MapTouchEvent=Ss,x.MapWheelEvent=fl,x.Marker=Yn,x.NavigationControl=class{constructor(h){this._updateZoomButtons=()=>{const e=this._map.getZoom(),r=e===this._map.getMaxZoom(),a=e===this._map.getMinZoom();this._zoomInButton.disabled=r,this._zoomOutButton.disabled=a,this._zoomInButton.setAttribute("aria-disabled",r.toString()),this._zoomOutButton.setAttribute("aria-disabled",a.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(e,r)=>{const a=this._map._getUIString(`NavigationControl.${r}`);e.title=a,e.setAttribute("aria-label",a)},this.options=s.e({},wl,h),this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),E.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),E.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=E.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(h){return this._map=h,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Sl(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){E.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(h,e){const r=E.create("button",h,this._container);return r.type="button",r.addEventListener("click",e),r}},x.Popup=class extends s.E{constructor(h){super(),this._updateOpacity=()=>{this.options.locationOccludedOpacity!==void 0&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:void 0)},this.remove=()=>(this._content&&E.remove(this._content),this._container&&(E.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new s.l("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=E.create("div","maplibregl-popup",this._map.getContainer()),this._tip=E.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const y of this.options.className.split(" "))this._container.classList.add(y);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=Al(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!e)return;const r=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let a=this.options.anchor;const l=Ms(this.options.offset);if(!a){const y=this._container.offsetWidth,w=this._container.offsetHeight;let A;A=r.y+l.bottom.y<w?["top"]:r.y>this._map.transform.height-w?["bottom"]:[],r.x<y/2?A.push("left"):r.x>this._map.transform.width-y/2&&A.push("right"),a=A.length===0?"bottom":A.join("-")}let p=r.add(l[a]);this.options.subpixelPositioning||(p=p.round()),E.setTransform(this._container,`${qi[a]} translate(${p.x}px,${p.y}px)`),Qc(this._container,a,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=s.e(Object.create(kl),h)}addTo(h){return this._map&&this.remove(),this._map=h,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new s.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(h){return this._lngLat=s.Q.convert(h),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(h){return this.setDOMContent(document.createTextNode(h))}setHTML(h){const e=document.createDocumentFragment(),r=document.createElement("body");let a;for(r.innerHTML=h;a=r.firstChild,a;)e.appendChild(a);return this.setDOMContent(e)}getMaxWidth(){var h;return(h=this._container)===null||h===void 0?void 0:h.style.maxWidth}setMaxWidth(h){return this.options.maxWidth=h,this._update(),this}setDOMContent(h){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=E.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(h),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(h){return this._container&&this._container.classList.add(h),this}removeClassName(h){return this._container&&this._container.classList.remove(h),this}setOffset(h){return this.options.offset=h,this._update(),this}toggleClassName(h){if(this._container)return this._container.classList.toggle(h)}setSubpixelPositioning(h){this.options.subpixelPositioning=h}_createCloseButton(){this.options.closeButton&&(this._closeButton=E.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const h=this._container.querySelector(Cl);h&&h.focus()}},x.RasterDEMTileSource=Fi,x.RasterTileSource=Yt,x.ScaleControl=class{constructor(h){this._onMove=()=>{go(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,go(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},mo),h)}getDefaultPosition(){return"bottom-left"}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-scale",h.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){E.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},x.ScrollZoomHandler=Bt,x.Style=Ka,x.TerrainControl=class{constructor(h){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=h}onAdd(h){return this._map=h,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=E.create("button","maplibregl-ctrl-terrain",this._container),E.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){E.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},x.TwoFingersTouchPitchHandler=pa,x.TwoFingersTouchRotateHandler=nt,x.TwoFingersTouchZoomHandler=Es,x.TwoFingersTouchZoomRotateHandler=xl,x.VectorTileSource=bi,x.VideoSource=ai,x.addSourceType=(h,e)=>s._(void 0,void 0,void 0,function*(){if(bt(h))throw new Error(`A source type called "${h}" already exists.`);((r,a)=>{Xt[r]=a})(h,e)}),x.clearPrewarmedResources=function(){const h=Pi;h&&(h.isPreloaded()&&h.numActive()===1?(h.release(An),Pi=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},x.createTileMesh=Hs,x.getMaxParallelImageRequests=function(){return s.a.MAX_PARALLEL_IMAGE_REQUESTS},x.getRTLTextPluginStatus=function(){return zt().getRTLTextPluginStatus()},x.getVersion=function(){return Tl},x.getWorkerCount=function(){return Kr.workerCount},x.getWorkerUrl=function(){return s.a.WORKER_URL},x.importScriptInWorkers=function(h){return ut().broadcast("IS",h)},x.prewarm=function(){et().acquire(An)},x.setMaxParallelImageRequests=function(h){s.a.MAX_PARALLEL_IMAGE_REQUESTS=h},x.setRTLTextPlugin=function(h,e){return zt().setRTLTextPlugin(h,e)},x.setWorkerCount=function(h){Kr.workerCount=h},x.setWorkerUrl=function(h){s.a.WORKER_URL=h}});var T=_;return T})}(Qu)),Qu.exports}var fx=dx();const $p=Jg(fx),Gt=(u,f)=>{const _=u.__vccOpts||u;for(const[b,k]of f)_[b]=k;return _},mx={key:0,class:"p-5 pb-0 flex justify-between items-center"},gx={class:"inline-block font-semibold text-lg text-gray-800"},yx={class:"flex flex-col gap-1 p-5"},_x={class:"flex items-center justify-between w-full text-sm text-gray-800"},vx={key:0,class:"ms-2 text-xs text-gray-500"},xx={__name:"vs-legend-widget",props:{config:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var k;return((k=f.config)==null?void 0:k.items)||[]}),b=g.computed(()=>{var k;return((k=f.config)==null?void 0:k.title)||""});return(k,T)=>(g.openBlock(),g.createElementBlock("div",{class:"legend-widget flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative",style:g.normalizeStyle({width:u.config.width||"100%"})},[b.value?(g.openBlock(),g.createElementBlock("div",mx,[g.createElementVNode("h2",gx,g.toDisplayString(b.value),1)])):g.createCommentVNode("",!0),g.createElementVNode("div",yx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.value,x=>(g.openBlock(),g.createElementBlock("div",{class:"flex items-center",key:x.label},[g.createElementVNode("span",{class:g.normalizeClass(["shrink-0 size-2.5 inline-block me-2.5",[x.shape==="square"?"rounded-sm":"",x.shape==="circle"?"rounded-full":"",x.shape==="line"?"w-6 h-0.5":"",x.shape==="dashed-line"?"w-6 h-0.5 dashed-line":""]]),style:g.normalizeStyle({backgroundColor:x.color})},null,6),g.createElementVNode("span",_x,[g.createElementVNode("span",null,g.toDisplayString(x.label),1),x.count!==void 0?(g.openBlock(),g.createElementBlock("span",vx," ("+g.toDisplayString(x.count)+") ",1)):g.createCommentVNode("",!0)])]))),128))])],4))}},bx=Gt(xx,[["__scopeId","data-v-c521b2f4"]]),wx="data:image/png;base64,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",Sx={class:"flex flex-row gap-x-3 z-10 relative"},Ax=["onClick"],kx=["src","alt"],Cx={__name:"vs-basemaps-widget",props:{map:{type:Object,required:!0},config:{type:Object,default:()=>({})},position:{type:String,default:"bottom-left"}},setup(u){const f=u,_=g.ref("voyager"),b=g.computed(()=>{var V;if(!((V=f.config)!=null&&V.layers))return[];const s=f.config.layers.map(I=>({id:I.id,title:I.label||I.title,url:I.url,service:I.type,category:"Базові карти",attribution:I.attribution,image:I.image,enabled:!0,owner:I.owner||"Unknown"}));return s.push({id:"__none__",title:"Без підложки",url:"",service:"",category:"Базові карти",attribution:"",image:wx,enabled:!0,owner:""}),s});function k(s){return{version:8,sources:{[s.id]:{type:"raster",tiles:[s.url],tileSize:256,attribution:s.attribution||""}},layers:[{id:s.id,type:"raster",source:s.id}]}}const T=s=>{if(!f.map)return;const V=f.map.getStyle(),I=b.value.map(E=>E.id),L=V.layers.filter(E=>!I.includes(E.id)),F={};for(const E in V.sources)I.includes(E)||(F[E]=V.sources[E]);if(s.id==="__none__"){const E={version:8,sources:{...F},layers:[...L]};f.map.setStyle(E);return}const M=k(s);f.map.setStyle(M),f.map.once("styledata",()=>{for(const[E,C]of Object.entries(F))f.map.getSource(E)||f.map.addSource(E,C);for(const E of L)f.map.getLayer(E.id)||f.map.addLayer(E)})},x=s=>{_.value=s;const V=b.value.find(I=>I.id===s);V&&f.map&&T(V)};return g.onMounted(()=>{var s;(s=f.config)!=null&&s.default&&(_.value=f.config.default),x(_.value)}),(s,V)=>{const I=g.resolveComponent("VsPopover");return g.openBlock(),g.createElementBlock("div",Sx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(b.value,L=>(g.openBlock(),g.createBlock(I,{trigger:"hover",placement:"top",key:L.id},{reference:g.withCtx(()=>[g.createElementVNode("div",{class:g.normalizeClass(["w-14 h-14 flex items-center justify-center bg-white rounded-xl shadow-2xs cursor-pointer transition-all border-4",_.value===L.id?"border-blue-400":"border-transparent"]),onClick:F=>x(L.id)},[g.createElementVNode("img",{src:L.image,alt:L.title,class:g.normalizeClass(["object-cover rounded-lg",L.id==="__none__"?"w-10 h-10":"w-12 h-12"])},null,10,kx)],10,Ax)]),default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(L.title)+" ",1)]),_:2},1024))),128))])}}};function Da(u){if(!u.attrType||!u.attribute||!u.rules)return u.color||"#ccc";const f=u.rules.map(_=>[["==",["get",u.attribute],_.id||_.value],_.color]);return f.push(u.color||"#ccc"),["case",...f.flat()]}function Tx(u){if(!u.attrType||u.attrType!=="icon-by-attribute"||!u.attribute||!u.rules)return u.default_icon||null;const f=u.rules.map(_=>[["==",["get",u.attribute],_.value],_.icon]);return f.push(u.default_icon||"marker.svg"),["case",...f.flat()]}function Qg(u){if(!u.attrType||u.attrType!=="attribute-pattern"||!u.attribute||!u.rules)return u.fillPattern||"";const f=u.rules.map(_=>[["==",["get",u.attribute],_.value],_.fillPattern||""]);return f.push(u.fillPattern||""),["case",...f.flat()]}function os(u,f="stroke",_="#ccc"){return["case",["boolean",["feature-state","hovered"],!1],"#ff0000",["boolean",["feature-state","selected"],!1],"#ff0000",u[f]||_]}function Ex(u){const f=[{type:"fill",minzoom:u.pointZoom||0,paint:{"fill-color":Da(u),"fill-outline-color":os(u,"stroke","#ccc"),"fill-opacity":u.opacity||1,...u.attrType==="attribute-pattern"&&{"fill-pattern":Qg(u)},...u.fillPattern&&!u.attrType&&{"fill-pattern":u.fillPattern}}},{type:"line",paint:{"line-color":os(u,"stroke","#ccc"),"line-width":u.width||2,"line-opacity":u.lineOpacity||u.opacity||1}}];return u.pointZoom&&f.push({type:"circle",maxzoom:u.pointZoom,paint:{"circle-color":u.color||"#ccc","circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-opacity":u.opacity||1}}),f}function Px(u){return[{type:"line",paint:{"line-color":os(u,"color",Da(u)),"line-width":u.width||2,"line-opacity":u.opacity||1,...u.dashArray&&{"line-dasharray":u.dashArray}},layout:{...u.lineCap&&{"line-cap":u.lineCap},...u.lineJoin&&{"line-join":u.lineJoin}}}]}function Ix(u){const f=[{type:"circle",maxzoom:u.icon&&+u.iconZoom||22,paint:{"circle-radius":u.radius||6,"circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-color":Da(u),"circle-opacity":u.opacity||1}}];return u!=null&&u.clusterZoom?(f.push({type:"circle",filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],"#51bbd6",100,"#f1f075",750,"#f28cb1"],"circle-radius":["step",["get","point_count"],20,100,30,750,40]}}),f.push({type:"symbol",filter:["has","point_count"],layout:{"text-field":["get","point_count"],"text-font":["Open Sans Regular"],"text-size":12}})):u.icon&&f.push({type:"symbol",minzoom:+u.iconZoom||16,layout:{"icon-image":u.icon,"icon-allow-overlap":!0}}),f}function Mx(u,f,_){const b=u.type||"point";return b==="polygon"?[{type:"fill",..._!==void 0?{maxzoom:_}:{},paint:{"fill-color":Da(u),"fill-outline-color":os(u,"stroke","#ccc"),"fill-opacity":u.opacity||1,...u.attrType==="attribute-pattern"&&{"fill-pattern":Qg(u)},...u.fillPattern&&!u.attrType&&{"fill-pattern":u.fillPattern}}},{type:"line",..._!==void 0?{maxzoom:_}:{},paint:{"line-color":os(u,"stroke","#ccc"),"line-width":u.width||2,"line-opacity":u.lineOpacity||u.opacity||1}}]:b==="line"?[{type:"line",..._!==void 0?{maxzoom:_}:{},paint:{"line-color":os(u,"color",Da(u)),"line-width":u.width||2,"line-opacity":u.opacity||1,...u.dashArray&&{"line-dasharray":u.dashArray}},layout:{...u.lineCap&&{"line-cap":u.lineCap},...u.lineJoin&&{"line-join":u.lineJoin}}}]:[{type:"circle",..._!==void 0?{maxzoom:_}:{},paint:{"circle-radius":u.radius||6,"circle-stroke-color":os(u,"stroke","#ccc"),"circle-stroke-width":u.width||2,"circle-color":Da(u),"circle-opacity":u.opacity||1}}]}function Yg(u){var _,b;if(!u)return null;if(u.attrType==="icon-by-attribute"&&u.iconZoom){const k=Tx(u),T=Array.isArray(k)&&k[0]==="case"?k:["case",["==",["get",u.attribute],((b=(_=u.rules)==null?void 0:_[0])==null?void 0:b.value)||""],k,k],x=Mx(u,void 0,+u.iconZoom),s={type:"symbol",minzoom:+u.iconZoom,layout:{"icon-image":T,"icon-size":(u==null?void 0:u.icon_size)||1,"icon-allow-overlap":!0,"icon-anchor":(u==null?void 0:u.icon_anchor)||"bottom"},paint:{"icon-opacity":u.opacity||1}};return[...x,s]}const f=u.type||"point";return f==="polygon"?Ex(u):f==="line"?Px(u):Ix(u)}function Lx(u){return u.startsWith("http")?u:`${window.location.origin}${u}`}function Rx(u){const{id:f,sourceLayer:_,url:b,bounds:k,title:T,style:x,service:s,service_type:V,source_type:I,data:L}=u,F=Lx(b),M=V||s||I||"vector";switch(M){case"vtile":case"vector":return Dx(f,_,F,k,T,x);case"raster":return Vx(f,F,k,T,x);case"geojson":return zx(f,L||F,k,T,x);default:throw new Error(`Unsupported layer service type: ${M}`)}}function Bx(u){switch(u){case"polygon":return{type:"polygon",color:"#3388ff",opacity:.5};case"line":return{type:"line",color:"#3388ff",opacity:1};case"point":default:return{type:"point",color:"#3388ff",radius:6,opacity:1}}}function Dx(u,f,_,b,k,T){const x=f||(_.match(/\/vtile\/([^/]+)/)||[])[1]||u,s={type:"vector",tiles:[_],...b&&{bounds:b}},L=Yg(T||{}).map((F,M)=>({...F,id:`${u}-${M}`,"source-layer":x,source:u}));return{id:u,title:k,source:s,layers:L,visible:!0}}function Vx(u,f,_,b,k){const T={type:"raster",tiles:[f],tileSize:256,..._&&{bounds:_}},x=k||{},s={id:u,type:"raster",source:u,layout:{visibility:"visible"},...x&&{paint:x}};return{id:u,title:b,source:T,layers:[s],visible:!0}}function zx(u,f,_,b,k){var L;const T={type:"geojson",data:f,..._&&{bounds:_}};let x="point";if(f&&f.features&&f.features.length>0){const F=(L=f.features[0].geometry)==null?void 0:L.type;F==="Polygon"||F==="MultiPolygon"?x="polygon":F==="LineString"||F==="MultiLineString"?x="line":x="point"}const s=k||Bx(x),I=Yg(s).map((F,M)=>({...F,id:`${u}-${M}`,source:u}));return{id:u,title:b,source:T,layers:I,visible:!0}}function Fx(u){if(!u||u.attrType!=="icon-by-attribute")return[];const f=new Set;return u.default_icon&&f.add(u.default_icon),Array.isArray(u.rules)&&u.rules.forEach(_=>{_.icon&&f.add(_.icon)}),Array.from(f).map(_=>({name:_,url:(u.icon_base_url||"")+_}))}function Ox(u){const f=new Set;function _(b){typeof b=="string"?f.add(b):Array.isArray(b)&&b.forEach(_)}return u&&u["icon-image"]&&_(u["icon-image"]),Array.from(f)}async function $g(u,f){const _=f.map(async({name:b,url:k})=>{const T=await u.loadImage(k);return{name:b,data:T.data}});try{const b=await Promise.all(_);for(const{name:k,data:T}of b)u.hasImage(k)||u.addImage(k,T)}catch(b){console.error("Failed to load icons:",b)}}function Nx(u,f,_="/icons/"){const k=Ox(f).map(T=>({name:T,url:_+T}));return $g(u,k)}async function Po(u,f){const _=Rx(f),b=Fx(f.style);b.length>0&&await $g(u,b),f.layout&&f.layout["icon-image"]&&await Nx(u,f.layout),u.getSource(_.id)||u.addSource(_.id,_.source);for(const k of _.layers)f.visible!==void 0&&(k.layout={...k.layout,visibility:f.visible?"visible":"none"}),u.getLayer(k.id)?u.setLayoutProperty(k.id,"visibility",f.visible?"visible":"none"):await u.addLayer(k);return _}function Ba(u,f){u.getStyle().layers.filter(k=>k.source===f).forEach(k=>{u.removeLayer(k.id)}),u.getSource(f)&&u.removeSource(f)}const qx={class:"w-full flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative"},Ux={class:"flex flex-col justify-between h-full pb-5 px-5"},jx={key:0,class:"relative mb-[10px]"},Wx={width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0px, -50%)"}},Hx={key:1,class:"mb-4"},Zx={class:""},Kx={class:"space-y-2"},Gx={class:"flex items-center gap-[10px] text-gray-500"},Jx={class:"dataset-checkbox-container flex"},Xx=["onUpdate:modelValue","onChange"],Qx={class:"text-sm"},Yx=["onClick"],$x=["innerHTML"],eb={key:0,class:"text-sm text-gray-500 text-center py-2"},tb={__name:"vs-layers-widget",props:{map:{type:Object,required:!0},history:{type:Boolean,default:!1},config:{type:Object,default:()=>({layers:[],search:!1,allow_toggle_all:!1})},position:{type:String,default:"bottom-left"},hasFilters:{type:Boolean,default:!1}},emits:["set-filter-layer","update:enabledLayerIds"],setup(u,{emit:f}){const _=u,b=f,k=g.ref(""),T=g.ref([]);function x(){const C=new URLSearchParams(window.location.search).get("layers");return C?C.split(","):[]}function s(E){const C=new URLSearchParams(window.location.search);E.length>0?C.set("layers",E.join(",")):C.delete("layers");const W=`${window.location.pathname}?${C.toString()}`;window.history.replaceState({},"",W)}g.onMounted(()=>{let E=[];_.history&&(E=x()),E.length>0?T.value=_.config.layers.map(C=>({...C,visible:E.includes(String(C.id))})):T.value=_.config.layers.map(C=>({...C,visible:C.visible??!1})),T.value.forEach(C=>{C.visible&&Po(_.map,C)}),b("update:enabledLayerIds",L())});const V=g.computed(()=>{if(!k.value)return T.value;const E=k.value.toLowerCase();return T.value.filter(C=>(C.title||C.name||C.label||"").toLowerCase().includes(E))}),I=g.computed(()=>T.value.every(E=>E.visible)),L=()=>T.value.filter(E=>E.visible).map(E=>E.id),F=E=>{E.visible?Po(_.map,E):(Ba(_.map,E.id),b("set-filter-layer",null)),_.map.getStyle().layers.filter(J=>J.source===E.id).forEach(J=>{_.map.setLayoutProperty(J.id,"visibility",E.visible?"visible":"none")}),b("update:enabledLayerIds",L())},M=()=>{const E=!I.value;T.value.forEach(C=>{C.visible=E,E?Po(_.map,C):Ba(_.map,C.id)}),E||b("set-filter-layer",null),b("update:enabledLayerIds",L())};return g.watch(()=>L(),E=>{_.history&&s(E)},{deep:!0}),(E,C)=>(g.openBlock(),g.createElementBlock("div",qx,[C[2]||(C[2]=g.createElementVNode("div",{class:"p-5 pb-3 flex justify-between items-center"},[g.createElementVNode("h2",{class:"inline-block font-semibold text-lg text-gray-800"},"Шари")],-1)),g.createElementVNode("div",Ux,[u.config.search?(g.openBlock(),g.createElementBlock("div",jx,[g.withDirectives(g.createElementVNode("input",{type:"text","onUpdate:modelValue":C[0]||(C[0]=W=>k.value=W),placeholder:"Введіть назву шару...",class:"py-[7px] ps-8 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:bg-white focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none"},null,512),[[g.vModelText,k.value]]),(g.openBlock(),g.createElementBlock("svg",Wx,C[1]||(C[1]=[g.createElementVNode("path",{d:"M7.33333 13.1667C10.2789 13.1667 12.6667 10.7789 12.6667 7.83333C12.6667 4.88781 10.2789 2.5 7.33333 2.5C4.38781 2.5 2 4.88781 2 7.83333C2 10.7789 4.38781 13.1667 7.33333 13.1667Z",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M13.9995 14.5L11.1328 11.6333",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)])))])):g.createCommentVNode("",!0),u.config.allow_toggle_all?(g.openBlock(),g.createElementBlock("div",Hx,[g.createElementVNode("button",{onClick:M,class:"w-full py-[7px] bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors"},g.toDisplayString(I.value?"Вимкнути всі":"Увімкнути всі"),1)])):g.createCommentVNode("",!0),g.createElementVNode("div",Zx,[g.createElementVNode("ul",Kx,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(V.value,W=>(g.openBlock(),g.createElementBlock("li",{key:W.id,class:"flex flex-wrap justify-between items-center gap-x-2"},[g.createElementVNode("label",Gx,[g.createElementVNode("span",Jx,[g.withDirectives(g.createElementVNode("input",{class:"dataset-checkbox",type:"checkbox","onUpdate:modelValue":J=>W.visible=J,onChange:()=>F(W)},null,40,Xx),[[g.vModelCheckbox,W.visible]])]),g.createElementVNode("span",Qx,g.toDisplayString(W.title||W.name||W.label),1)]),W.actions&&W.visible?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(W.actions,J=>(g.openBlock(),g.createElementBlock("div",{key:J.id},[g.createElementVNode("button",{class:"text-sm text-gray-500",onClick:se=>E.$emit("show-widget",J.widget)},[g.createElementVNode("div",{innerHTML:J.icon},null,8,$x)],8,Yx)]))),128)):g.createCommentVNode("",!0)]))),128)),k.value&&V.value.length===0?(g.openBlock(),g.createElementBlock("li",eb," Шарів не знайдено ")):g.createCommentVNode("",!0)])])])]))}},rb={class:"legend-widget flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative"},ib={key:0,class:"p-5 pb-3 flex justify-between items-start gap-[30px]"},nb={class:"inline-block font-semibold text-lg text-gray-800 dark:text-neutral-200"},sb={class:"flex flex-col gap-1"},ob={class:"flex flex-col gap-1 p-5 pt-0"},ab=["innerHTML"],lb={__name:"vs-info-widget",props:{config:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.title)||""}),b=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.content)||""}),k=g.computed(()=>{var T;return((T=f.config)==null?void 0:T.goTo)||[]});return(T,x)=>{var I,L;const s=g.resolveComponent("VsPopover"),V=g.resolveComponent("router-link");return g.openBlock(),g.createElementBlock("div",rb,[_.value||(I=k.value)!=null&&I.length?(g.openBlock(),g.createElementBlock("div",ib,[g.createElementVNode("h2",nb,g.toDisplayString(_.value),1),(L=k.value)!=null&&L.length?(g.openBlock(),g.createBlock(s,{key:0,placement:"bottom"},{reference:g.withCtx(()=>[g.createVNode(s,{trigger:"hover",placement:"right"},{reference:g.withCtx(()=>x[0]||(x[0]=[g.createElementVNode("div",{class:"flex items-center justify-center h-8 w-8 transition-colors rounded-full hover:bg-gray-100 cursor-pointer"},[g.createElementVNode("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[g.createElementVNode("path",{d:"M4 12H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"}),g.createElementVNode("path",{d:"M4 6H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"}),g.createElementVNode("path",{d:"M4 18H20",stroke:"#000000","stroke-linecap":"round","stroke-linejoin":"round"})])],-1)])),default:g.withCtx(()=>[x[1]||(x[1]=g.createTextVNode(" Перейти на карту "))]),_:1,__:[1]})]),default:g.withCtx(()=>[g.createElementVNode("div",sb,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.value,F=>(g.openBlock(),g.createElementBlock("div",{key:F.label},[F.url?(g.openBlock(),g.createBlock(V,{key:0,to:F.url,class:"text-sm text-gray-800 dark:text-neutral-200 hover:bg-gray-100 hover:text-blue-600 transition-colors rounded px-2 py-1 block"},{default:g.withCtx(()=>[g.createTextVNode(g.toDisplayString(F.label),1)]),_:2},1032,["to"])):g.createCommentVNode("",!0)]))),128))])]),_:1})):g.createCommentVNode("",!0)])):g.createCommentVNode("",!0),g.createElementVNode("div",ob,[g.createElementVNode("div",{innerHTML:b.value},null,8,ab)])])}}},cb=Gt(lb,[["__scopeId","data-v-187a97ca"]]),ub={class:"w-full flex flex-col bg-white border border-stone-200 shadow-2xs rounded-xl z-10 relative overflow-hidden"},hb={key:0,class:"p-5 pb-3 flex justify-between items-center"},pb={class:"inline-block font-semibold text-lg text-gray-800"},db={key:1,class:"flex"},fb={class:"flex items-center mx-[8px]"},mb={class:"min-h-[34px] max-h-[34px] overflow-hidden min-w-[34px] flex justify-center items-center bg-stone-100 text-stone-800 py-2 px-3 text-sm rounded-lg"},gb={class:"min-h-[34px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},yb={class:"flex flex-col justify-between pb-5 px-5 h-full overflow-y-auto flex-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},_b={key:0,class:"text-center"},vb={key:1,class:"text-red-500"},xb={key:2},bb=["innerHTML"],wb={key:1,class:"flow-root"},Sb={class:"-my-3 divide-y divide-gray-100 text-sm"},Ab={class:"font-medium text-gray-900"},kb={class:"text-gray-700 sm:col-span-2"},Cb={key:2,class:"vs-map-card-info__nodata"},Tb={key:3,class:"pt-4 flex justify-end"},Eb=["href"],ey={__name:"vs-card-widget",props:{config:{type:Object,required:!0},cardValues:{type:Object,required:!0}},emits:["close","content-resize"],setup(u,{emit:f}){const _=u,b=f,k=g.computed(()=>{var se;return((se=_.config)==null?void 0:se.title)||""}),T=g.computed(()=>!!(typeof window.app=="object"&&window.app&&window.app.config)),x=g.ref([]),s=g.ref(!1),V=g.ref(null),I=g.ref(0),L=g.computed(()=>I.value+1),F=g.computed(()=>{var se;return((se=_.info)==null?void 0:se.length)||0}),M=g.computed(()=>x.value[I.value]),E=g.computed(()=>{if(!M.value)return{};const{rows:se,columns:oe}=M.value;return!se||!oe?{}:oe.reduce((Se,$)=>(!$.hide&&!["geom","geodata","id"].includes($.name)&&(Se[$.ua]=se[$.name]??"-"),Se),{})});async function C(){var se,oe,Se,$,de,Ce;s.value=!0,V.value=null;try{const Re={id:(se=_.cardValues)==null?void 0:se.id,layer:typeof((oe=_.cardValues)==null?void 0:oe.layer)=="object"?($=(Se=_.cardValues)==null?void 0:Se.layer)==null?void 0:$.id:(de=_.cardValues)==null?void 0:de.layer,map:(Ce=_.cardValues)==null?void 0:Ce.map},Ze=await Ar.get("/api/map-format",{params:Re});x.value[I.value]=Ze.data}catch(Re){V.value=(Re==null?void 0:Re.message)||"Помилка запиту"}finally{s.value=!1,await g.nextTick(),b("content-resize")}}function W(){I.value<_.info.length-1&&(I.value+=1,x.value[I.value]||C())}function J(){I.value>0&&(I.value-=1,x.value[I.value]||C())}return g.onMounted(async()=>{await g.nextTick(),C()}),g.watch(()=>_.info,()=>{I.value=0,C(),b("content-resize")},{deep:!0}),g.watch([()=>_.cardValues,()=>_.config],async()=>{await g.nextTick(),C(),b("content-resize")}),(se,oe)=>{var Se,$;return g.openBlock(),g.createElementBlock("div",ub,[k.value?(g.openBlock(),g.createElementBlock("div",hb,[g.createElementVNode("h2",pb,g.toDisplayString(k.value),1),g.createElementVNode("button",{type:"button",class:"size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600 ml-2",onClick:oe[0]||(oe[0]=de=>b("close"))},oe[1]||(oe[1]=[g.createElementVNode("svg",{class:"shrink-0 size-4 cursor-pointer",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[g.createElementVNode("path",{d:"M18 6 6 18"}),g.createElementVNode("path",{d:"m6 6 12 12"})],-1)]))])):g.createCommentVNode("",!0),F.value>1?(g.openBlock(),g.createElementBlock("div",db,[g.createElementVNode("button",{type:"button",class:g.normalizeClass([{"opacity-flex items-center justify-between border-b px-[16px] py-[8px]50 pointer-events-none":L.value===1},"min-h-[34px] min-w-[34px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"]),onClick:J}," ◀ ",2),g.createElementVNode("div",fb,[g.createElementVNode("span",mb,g.toDisplayString(L.value),1),oe[2]||(oe[2]=g.createElementVNode("span",{class:"min-h-[34px] flex justify-center items-center text-stone-500 py-2 px-1.5 text-sm"},"з",-1)),g.createElementVNode("span",gb,g.toDisplayString(F.value),1)]),g.createElementVNode("button",{type:"button",onClick:W,class:g.normalizeClass([{"opacity-50 pointer-events-none":L.value===F.value},"min-h-[34px] min-w-[34px] py-2 px-2.5 inline-flex justify-center items-center gap-x-2 text-sm rounded-lg text-stone-800 hover:bg-stone-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-stone-100"])}," ▶ ",2)])):g.createCommentVNode("",!0),g.createElementVNode("div",yb,[s.value?(g.openBlock(),g.createElementBlock("div",_b,"Завантаження даних...")):V.value?(g.openBlock(),g.createElementBlock("div",vb," Помилка завантаження даних ")):(g.openBlock(),g.createElementBlock("div",xb,[(Se=M.value)!=null&&Se.html?(g.openBlock(),g.createElementBlock("div",{key:0,innerHTML:M.value.html,class:"custom-table-html border-b"},null,8,bb)):Object.keys(E.value).length?(g.openBlock(),g.createElementBlock("div",wb,[g.createElementVNode("dl",Sb,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(E.value,(de,Ce)=>(g.openBlock(),g.createElementBlock("div",{key:Ce,class:"grid grid-cols-1 gap-1 py-3 even:bg-gray-50 sm:grid-cols-3 sm:gap-4"},[g.createElementVNode("dt",Ab,g.toDisplayString(Ce),1),g.createElementVNode("dd",kb,g.toDisplayString(de),1)]))),128))])])):(g.openBlock(),g.createElementBlock("div",Cb,"Даних не знайдено."))])),($=M.value)!=null&&$.cardInterface&&T.value?(g.openBlock(),g.createElementBlock("div",Tb,[g.createElementVNode("a",{href:`/card/${M.value.cardInterface}/${M.value.id}`,target:"_blank",class:"w-full !cursor-pointer text-center gap-2 px-3 py-1.5 bg-blue-600 text-white rounded hover:bg-blue-700 transition text-sm font-medium"}," Перейти в реєстр ",8,Eb)])):g.createCommentVNode("",!0)])])}}},Pb={class:"size-full flex flex-col bg-white border border-gray-200 shadow-2xs rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},Ib={key:0,class:"p-5 pb-0 items-center"},Mb={class:"inline-block font-semibold text-lg text-gray-800 dark:text-neutral-200"},Lb={class:"h-full p-5"},Rb={class:"h-full flex flex-col justify-between space-y-4"},Bb={class:"space-y-4"},Db={key:0,class:"flex gap-x-1 w-full h-2.5 rounded-full overflow-hidden"},Vb=["aria-valuenow"],zb={class:"text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center rounded-lg group hover:bg-gray-100"},Fb=["for"],Ob={key:0,width:"16",height:"auto",src:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="},Nb=["id","onUpdate:modelValue"],qb={class:"ms-2 text-gray-800 dark:text-neutral-200"},Ub={key:0,class:"ms-auto text-xs text-gray-500 dark:text-neutral-500"},jb={__name:"vs-attributre-widget",props:{config:{type:Object,required:!0},map:{type:Object,required:!0}},setup(u){const f=u,_=g.computed(()=>{var V;return((V=f.config)==null?void 0:V.title)||""}),b=g.ref([]),k=g.computed(()=>f.config.layer.style.rules.some(V=>V.count!==void 0)),T=g.computed(()=>f.config.layer.style.rules.reduce((V,I)=>V+(I.count||0),0)),x=V=>!V||T.value===0?0:Math.round(V/T.value*100),s=()=>{const I=f.config.layer.style.rules.filter((L,F)=>b.value[F]).map(L=>L.id||L.value).join(",");if(f.config.layer.id){const L=f.map.getSource(f.config.layer.id);if(L){const M=L.tiles[0].split("?filter=")[0],E=I?`${M}?filter=${f.config.layer.style.attribute}=${I}`:M;L.setTiles([E])}}};return g.onMounted(()=>{var V;(V=f.config)!=null&&V.layer&&(Po(f.map,f.config.layer),b.value=new Array(f.config.layer.style.rules.length).fill(!1))}),(V,I)=>(g.openBlock(),g.createElementBlock("div",Pb,[_.value?(g.openBlock(),g.createElementBlock("div",Ib,[g.createElementVNode("div",null,[g.createElementVNode("h2",Mb,g.toDisplayString(_.value),1)])])):g.createCommentVNode("",!0),g.createElementVNode("div",Lb,[g.createElementVNode("div",Rb,[g.createElementVNode("div",Bb,[k.value?(g.openBlock(),g.createElementBlock("div",Db,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(u.config.layer.style.rules,(L,F)=>(g.openBlock(),g.createElementBlock("div",{key:F,class:"flex flex-col justify-center overflow-hidden text-xs text-white text-center whitespace-nowrap",style:g.normalizeStyle({width:`${x(L.count)}%`,backgroundColor:L.color}),role:"progressbar","aria-valuenow":x(L.count),"aria-valuemin":"0","aria-valuemax":"100"},null,12,Vb))),128))])):g.createCommentVNode("",!0),g.createElementVNode("ul",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(u.config.layer.style.rules,(L,F)=>(g.openBlock(),g.createElementBlock("li",{key:F},[g.createElementVNode("div",zb,[g.createElementVNode("label",{for:`filter-${F}`,class:"flex items-center w-full cursor-pointer"},[g.createElementVNode("div",{class:"w-[18px] h-[18px] border rounded-[4px] flex items-center justify-center",style:g.normalizeStyle({background:b.value[F]?L.color||"#2563eb":"#fff",borderColor:b.value[F]?L.color||"#2563eb":L.color||"#d9d9d9"})},[b.value[F]?(g.openBlock(),g.createElementBlock("img",Ob)):g.createCommentVNode("",!0)],4),g.withDirectives(g.createElementVNode("input",{type:"checkbox",id:`filter-${F}`,"onUpdate:modelValue":M=>b.value[F]=M,onChange:s,class:"hidden",disabled:!1},null,40,Nb),[[g.vModelCheckbox,b.value[F]]]),g.createElementVNode("span",qb,g.toDisplayString(L.label||L.text),1),k.value?(g.openBlock(),g.createElementBlock("span",Ub,"("+g.toDisplayString(L.count)+")",1)):g.createCommentVNode("",!0)],8,Fb)])]))),128))])])])])]))}},Wb={class:"hover:bg-gray-100 rounded-lg flex items-center ml-[20px] py-[8px] px-[8px]"},Hb=["for"],Zb={class:"custom-checkbox-wrapper"},Kb=["id","checked"],Gb={class:"custom-checkbox"},Jb={key:0,xmlns:"http://www.w3.org/2000/svg",width:"12",height:"8",viewBox:"0 0 12 8",fill:"none"},Xb={class:"flex items-center justify-between ml-2 w-full"},Qb=["title"],Yb={key:0,class:"text-xs opacity-60 text-[#4b5563]"},$b={__name:"vs-map-catalog-item",props:{layer:{type:Object,required:!0},map:{type:Object,default:()=>null},selectedLayers:{type:Array,default:()=>[]}},emits:["select","remove"],setup(u,{emit:f}){const _=u,b=f,k=g.computed(()=>_.selectedLayers.some(s=>s.id===_.layer.id)),T=s=>Intl.NumberFormat("uk",{notation:"compact"}).format(s),x=s=>{b(s?"select":"remove",_.layer)};return(s,V)=>{var I,L,F,M,E;return g.openBlock(),g.createElementBlock("div",Wb,[g.createElementVNode("label",{class:"flex items-center w-full cursor-pointer",for:u.layer.id},[g.createElementVNode("div",Zb,[g.createElementVNode("input",{id:u.layer.id,type:"checkbox",checked:k.value,onChange:V[0]||(V[0]=C=>x(C.target.checked)),class:"custom-checkbox-input"},null,40,Kb),g.createElementVNode("div",Gb,[k.value?(g.openBlock(),g.createElementBlock("svg",Jb,V[1]||(V[1]=[g.createElementVNode("path",{d:"M10.6663 1L4.24967 7.41667L1.33301 4.5",stroke:"#fff","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))):g.createCommentVNode("",!0)])]),g.createElementVNode("div",Xb,[g.createElementVNode("div",{class:"whitespace-nowrap text text-ellipsis max-w-[260px] overflow-hidden text-[13px] text-[#4b5563]",title:(I=u.layer)==null?void 0:I.name},g.toDisplayString(((L=u.layer)==null?void 0:L.name)||((F=u.layer)==null?void 0:F.title)),9,Qb),isNaN(T((M=u.layer)==null?void 0:M.count))?g.createCommentVNode("",!0):(g.openBlock(),g.createElementBlock("div",Yb,g.toDisplayString(T((E=u.layer)==null?void 0:E.count)),1))])],8,Hb)])}}},e1=Gt($b,[["__scopeId","data-v-b96f3537"]]),t1={},r1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-zoom-in"};function i1(u,f){return g.openBlock(),g.createElementBlock("svg",r1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"11",cy:"11",r:"8"},null,-1),g.createElementVNode("line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65"},null,-1),g.createElementVNode("line",{x1:"11",x2:"11",y1:"8",y2:"14"},null,-1),g.createElementVNode("line",{x1:"8",x2:"14",y1:"11",y2:"11"},null,-1)]))}const n1=Gt(t1,[["render",i1]]),s1={},o1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-info"};function a1(u,f){return g.openBlock(),g.createElementBlock("svg",o1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"12",cy:"12",r:"10"},null,-1),g.createElementVNode("path",{d:"M12 16v-4"},null,-1),g.createElementVNode("path",{d:"M12 8h.01"},null,-1)]))}const l1=Gt(s1,[["render",a1]]),c1={},u1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-table"};function h1(u,f){return g.openBlock(),g.createElementBlock("svg",u1,f[0]||(f[0]=[g.createElementVNode("path",{d:"M12 3v18"},null,-1),g.createElementVNode("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"},null,-1),g.createElementVNode("path",{d:"M3 9h18"},null,-1),g.createElementVNode("path",{d:"M3 15h18"},null,-1)]))}const p1=Gt(c1,[["render",h1]]),d1={},f1={xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-trash2"};function m1(u,f){return g.openBlock(),g.createElementBlock("svg",f1,f[0]||(f[0]=[g.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const g1=Gt(d1,[["render",m1]]),y1={},_1={xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-more-vertical text-gray-600"};function v1(u,f){return g.openBlock(),g.createElementBlock("svg",_1,f[0]||(f[0]=[g.createElementVNode("circle",{cx:"12",cy:"12",r:"1"},null,-1),g.createElementVNode("circle",{cx:"12",cy:"5",r:"1"},null,-1),g.createElementVNode("circle",{cx:"12",cy:"19",r:"1"},null,-1)]))}const x1=Gt(y1,[["render",v1]]),b1={},w1={width:"6",height:"10",viewBox:"0 0 6 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function S1(u,f){return g.openBlock(),g.createElementBlock("svg",w1,f[0]||(f[0]=[g.createElementVNode("path",{d:"M1 9L5 5L1 1",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const A1=Gt(b1,[["render",S1]]),k1={},C1={width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function T1(u,f){return g.openBlock(),g.createElementBlock("svg",C1,f[0]||(f[0]=[g.createStaticVNode('<g clip-path="url(#clip0_231_103)"><path d="M12 20L9 21V12.5L4.52 7.572C4.18545 7.20393 4.00005 6.7244 4 6.227V4H20V6.172C19.9999 6.70239 19.7891 7.21101 19.414 7.586L15 12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M21.121 20.1209C21.5406 19.7014 21.8265 19.1668 21.9423 18.5849C22.0581 18.0029 21.9988 17.3997 21.7717 16.8514C21.5447 16.3032 21.1602 15.8346 20.6668 15.5049C20.1734 15.1752 19.5934 14.9993 19 14.9993C18.4066 14.9993 17.8266 15.1752 17.3332 15.5049C16.8398 15.8346 16.4553 16.3032 16.2283 16.8514C16.0012 17.3997 15.9419 18.0029 16.0577 18.5849C16.1735 19.1668 16.4594 19.7014 16.879 20.1209C17.297 20.5399 18.004 21.1659 19 21.9999C20.051 21.1099 20.759 20.4839 21.121 20.1209Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path><path d="M19 18V18.01" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"></path></g><defs><clipPath id="clip0_231_103"><rect width="24" height="24" fill="white"></rect></clipPath></defs>',2)]))}const E1=Gt(k1,[["render",T1]]);function P1(){const f=new URLSearchParams(window.location.search).get("layers");return f?f.split(","):[]}function I1(u){const f=new URLSearchParams(window.location.search);u.length>0?f.set("layers",u.join(",")):f.delete("layers");const _=`${window.location.pathname}?${f.toString()}`;window.history.replaceState({},"",_)}const M1={components:{VsLayersItem:e1,ZoomInIcon:n1,InfoIcon:l1,TableIcon:p1,TrashIcon:g1,DotsIcon:x1,ChevronRightIcon:A1,FilterIcon:E1},props:{center:{type:Array,default:()=>[26.2516,50.6199]},zoom:{type:Number,default:12},map:{type:Object,default:()=>null},history:{type:Boolean,default:!1}},emits:["content-resize"],data(){return{layers:null,rawCatalog:null,categories:null,selectedCategory:"",search:"",activeView:"catalog",selectedLayers:[],mounted:!1,draggedLayerIndex:null,filterType:"",filterCategory:""}},computed:{searchedLayers(){return this.layers.filter(({name:u})=>u==null?void 0:u.toLowerCase().match(this.search.toLowerCase()))}},async mounted(){if(this.mounted=!0,await this.getLayers(),this.categories=this.layersCategories(),this.history){const u=P1();u.length>0&&this.layers&&(u.forEach(f=>{const _=this.layers.find(b=>String(b.id)===f);if(_&&!this.selectedLayers.find(b=>b.id===_.id)){const b={..._,visible:!0,opacity:100,showFilters:!1};this.selectedLayers.push(b),Po(this.map,b)}}),this.activeView="selected")}this._resizeObserver=new window.ResizeObserver(()=>{this.$emit("content-resize")}),this.$nextTick(()=>{const u=this.$el;u&&this._resizeObserver.observe(u)})},beforeUnmount(){this._resizeObserver&&this._resizeObserver.disconnect()},watch:{selectedLayers:{handler(u){this.history&&I1(u.map(f=>f.id))},deep:!0}},methods:{async getLayers(){try{const u=await Ar.get("/api/map-catalog"),f=(u.data.services||[]).filter(_=>_.service_type!=="other");this.layers=[...f,...u.data.rasters||[]],this.$emit("catalog-layers",this.layers),this.rawCatalog={...u.data,services:f}}catch(u){console.error("Помилка завантаження шарів:",u)}},layersCategories(){return this.rawCatalog?{Сервіси:this.rawCatalog.services||[],Растри:this.rawCatalog.rasters||[]}:{}},selectCategory(u){this.selectedCategory=this.selectedCategory===u?"":u},formatNumber(u){return Intl.NumberFormat("uk",{notation:"compact"}).format(u)},onEnter(){this.layers.filter(({name:u})=>u==null?void 0:u.toLowerCase().match(this.search.toLowerCase()))},clearSearch(){this.search=""},addToSelected(u){if(!this.selectedLayers.find(f=>f.id===u.id)){const f={...u,visible:!0,opacity:100,showFilters:!1};this.selectedLayers.unshift(f),Po(this.map,f)}},deleteLayer(u){const f=this.selectedLayers.findIndex(_=>_.id===u.id);f!==-1&&this.selectedLayers.splice(f,1),Ba(this.map,u.id)},async toggleLayerVisibility(u){try{u.visible?(await Po(this.map,u),this.updateLayerOpacity(u)):await Ba(this.map,u.id)}catch(f){console.error("Error toggling layer visibility:",f),u.visible=!u.visible}},onLayerOpacityChange(u){this.updateLayerOpacity(u)},updateLayerOpacity(u){if(this.map){const f=this.map.getStyle().layers.filter(b=>b.id.includes(u.id)),_=u.opacity/100;f.forEach(b=>{b.type==="fill"?(u.originalFillOpacity||(u.originalFillOpacity=this.map.getPaintProperty(b.id,"fill-opacity")||1),this.map.setPaintProperty(b.id,"fill-opacity",u.originalFillOpacity*_)):b.type==="raster"?this.map.setPaintProperty(b.id,"raster-opacity",_):b.type==="line"?this.map.setPaintProperty(b.id,"line-opacity",_):b.type==="circle"?(this.map.setPaintProperty(b.id,"circle-opacity",_),this.map.setPaintProperty(b.id,"circle-stroke-opacity",_)):b.type==="symbol"&&(this.map.setPaintProperty(b.id,"icon-opacity",_),this.map.setPaintProperty(b.id,"text-opacity",_))})}},async handleRemoveFromCatalog(u){const f=this.selectedLayers.find(_=>_.id===u.id);f!=null&&f.visible&&await Ba(this.map,u.id),this.deleteLayer(u)},clearSelectedLayers(){this.selectedLayers.forEach(async u=>{u.visible&&await Ba(this.map,u.id)}),this.selectedLayers=[]},zoomToLayer(u){this.fitBoundsByLayer(u)},showLayerInfo(u){},showLayerTable(u){},showLayerFilter(u){u.showFilters=!u.showFilters},fitBoundsByLayer(u){u&&u.bbox&&Array.isArray(u.bbox)&&u.bbox.length===4&&this.map&&this.map.fitBounds([[u.bbox[0],u.bbox[1]],[u.bbox[2],u.bbox[3]]],{padding:50,duration:0})},async handleFilterChange({url:u},f){const _=this.map.getSource(f.id);if(_){const k=_.tiles[0].split("?filter=")[0],T=u?`${k}?filter=${u}`:k;_.setTiles([T])}},popoverActions(u){return[{label:"Збільшити до шару",icon:"ZoomInIcon",class:Array.isArray(u.bbox)&&u.bbox.length===4?"text-gray-700 hover:bg-gray-100":"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"zoomToLayer"},{label:"Інформація про шар",icon:"InfoIcon",class:"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"showLayerInfo"},{label:"Таблиця шару",icon:"TableIcon",class:"text-gray-700 hover:bg-gray-100 opacity-50 cursor-not-allowed",handler:"showLayerTable"},{divider:!0},{label:"Видалити шар",icon:"TrashIcon",class:"text-red-600 hover:bg-red-50",handler:"deleteLayer"}]},onDragStart(u){this.draggedLayerIndex=u},onDragOver(u){},onDrop(u){if(this.draggedLayerIndex===null||this.draggedLayerIndex===u)return;const f=this.selectedLayers[this.draggedLayerIndex];if(this.selectedLayers.splice(this.draggedLayerIndex,1),this.selectedLayers.splice(u,0,f),this.draggedLayerIndex=null,this.map&&this.selectedLayers.length>1)for(let _=this.selectedLayers.length-1;_>=0;_--){const b=this.selectedLayers[_];b.visible&&this.map.getStyle().layers.find(k=>k.id.includes(b.id))&&this.map.getStyle().layers.forEach(k=>{k.id.includes(b.id)&&this.map.moveLayer(k.id)})}},onDragEnd(){this.draggedLayerIndex=null}}},L1={class:"w-full max-w-md mx-auto p-4 bg-white border border-gray-200 rounded-lg shadow-sm"},R1={class:"flex items-center justify-between mb-4"},B1={class:"flex items-center gap-2"},D1={class:"text-lg font-semibold text-gray-800"},V1={key:0},z1={key:1},F1={class:"flex mb-4 border-b border-gray-200"},O1={key:0},N1={class:"mb-4"},q1={key:0,class:"space-y-2 max-h-[400px] overflow-y-auto pr-1 [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},U1=["onDragstart","onDragover","onDrop"],j1={class:"flex items-center justify-between"},W1={class:"flex items-center gap-2 cursor-move"},H1=["onUpdate:modelValue","onChange"],Z1={class:"text-gray-800"},K1={class:"flex items-center gap-2"},G1={class:"relative"},J1={class:"flex items-center gap-2"},X1=["onUpdate:modelValue","onInput"],Q1={class:"text-xs text-gray-600 whitespace-nowrap"},Y1=["onClick"],$1={class:"relative"},e2={class:"w-48"},t2={key:0,class:"my-1 border-gray-200"},r2=["disabled","onClick"],i2={class:"p-1 rounded-full hover:bg-gray-100 transition-colors","aria-label":"Layer actions"},n2={key:0,class:"bg-blue-50 rounded-md mt-2"},s2={class:"px-2 pt-2 text-blue-600 hover:text-blue-700 transition-colors"},o2={key:0,class:"text-center text-[14px] text-[#4b5563]"},a2={class:"relative mt-[10px]"},l2={class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0, -50%)"},width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},c2={key:0,class:"vs-layers-catalog__list flex-1 scrollable-container overflow-auto mt-2 catalog-list"},u2={key:0,class:"text-center text-[14px] text-[#4b5563]"},h2={key:0,class:"text-center text-[14px] text-[#4b5563]"},p2=["onClick"],d2={class:"flex items-center gap-x-3"},f2=["title"],m2={class:"text-xs opacity-60 text-[#4b5563]"};function g2(u,f,_,b,k,T){var E;const x=g.resolveComponent("VsPopover"),s=g.resolveComponent("DotsIcon"),V=g.resolveComponent("VsFilter"),I=g.resolveComponent("searchIcon"),L=g.resolveComponent("closeIcon"),F=g.resolveComponent("VsLayersItem"),M=g.resolveComponent("chevronRightIcon");return g.openBlock(),g.createElementBlock("div",L1,[g.createElementVNode("div",R1,[g.createElementVNode("div",B1,[f[7]||(f[7]=g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-layers text-blue-600"},[g.createElementVNode("path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"}),g.createElementVNode("path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"}),g.createElementVNode("path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"})],-1)),g.createElementVNode("h2",D1,[g.createTextVNode(g.toDisplayString(k.activeView==="catalog"?"Каталог":"Вибрані шари")+" ",1),k.activeView==="catalog"?(g.openBlock(),g.createElementBlock("span",V1,"("+g.toDisplayString(((E=k.layers)==null?void 0:E.length)||0)+")",1)):(g.openBlock(),g.createElementBlock("span",z1,"("+g.toDisplayString(k.selectedLayers.length)+")",1))])]),g.createElementVNode("button",{class:"p-1 rounded-full hover:bg-gray-200 transition-colors","aria-label":"Reset layers",onClick:f[0]||(f[0]=(...C)=>T.clearSelectedLayers&&T.clearSelectedLayers(...C))},f[8]||(f[8]=[g.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-refresh-cw text-gray-600" data-v-7480b2b6><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" data-v-7480b2b6></path><path d="M21 3v5h-5" data-v-7480b2b6></path><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" data-v-7480b2b6></path><path d="M8 16H3v5" data-v-7480b2b6></path></svg>',1)]))]),g.createElementVNode("div",F1,[g.createElementVNode("button",{class:g.normalizeClass(["px-4 py-2 text-sm font-medium",k.activeView==="catalog"?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-gray-800"]),onClick:f[1]||(f[1]=C=>k.activeView="catalog")}," Каталог ",2),g.createElementVNode("button",{class:g.normalizeClass(["px-4 py-2 text-sm font-medium",k.activeView==="selected"?"text-blue-600 border-b-2 border-blue-600":"text-gray-600 hover:text-gray-800"]),onClick:f[2]||(f[2]=C=>k.activeView="selected")}," Вибрані шари ",2)]),k.activeView==="selected"?(g.openBlock(),g.createElementBlock("div",O1,[g.createElementVNode("div",N1,[g.createElementVNode("button",{class:"flex items-center gap-2 text-blue-600 hover:text-blue-700 transition-colors px-3 py-2 rounded-md bg-blue-50 hover:bg-blue-100 w-full justify-center",onClick:f[3]||(f[3]=C=>k.activeView="catalog")},f[9]||(f[9]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-plus"},[g.createElementVNode("path",{d:"M5 12h14"}),g.createElementVNode("path",{d:"M12 5v14"})],-1),g.createElementVNode("span",null,"Вибрати шар",-1)]))]),k.mounted?(g.openBlock(),g.createElementBlock("div",q1,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.selectedLayers,(C,W)=>{var J,se;return g.openBlock(),g.createElementBlock("div",{key:C.id||W,class:g.normalizeClass(["border border-gray-200 rounded-md p-3 mb-2 bg-white shadow-sm text-[13px] text-[#4b5563]",{dragging:k.draggedLayerIndex===W}]),draggable:"true",onDragstart:oe=>T.onDragStart(W),onDragover:g.withModifiers(oe=>T.onDragOver(W),["prevent"]),onDrop:oe=>T.onDrop(W),onDragend:f[4]||(f[4]=(...oe)=>T.onDragEnd&&T.onDragEnd(...oe))},[g.createElementVNode("div",j1,[g.createElementVNode("div",W1,[f[10]||(f[10]=g.createStaticVNode('<svg width="16" height="16" fill="none" stroke="#9ca3af" stroke-width="2" viewBox="0 0 24 24" class="mr-1 shrink-0" data-v-7480b2b6><circle cx="5" cy="5" r="1.5" data-v-7480b2b6></circle><circle cx="5" cy="12" r="1.5" data-v-7480b2b6></circle><circle cx="5" cy="19" r="1.5" data-v-7480b2b6></circle><circle cx="12" cy="5" r="1.5" data-v-7480b2b6></circle><circle cx="12" cy="12" r="1.5" data-v-7480b2b6></circle><circle cx="12" cy="19" r="1.5" data-v-7480b2b6></circle><circle cx="19" cy="5" r="1.5" data-v-7480b2b6></circle><circle cx="19" cy="12" r="1.5" data-v-7480b2b6></circle><circle cx="19" cy="19" r="1.5" data-v-7480b2b6></circle></svg>',1)),g.withDirectives(g.createElementVNode("input",{type:"checkbox",class:"w-4 h-4 text-blue-600 rounded focus:ring-blue-500","onUpdate:modelValue":oe=>C.visible=oe,onChange:oe=>T.toggleLayerVisibility(C)},null,40,H1),[[g.vModelCheckbox,C.visible]]),g.createElementVNode("span",Z1,g.toDisplayString(C.name||C.title||C.label),1)]),g.createElementVNode("div",K1,[g.createElementVNode("div",G1,[g.createVNode(x,{placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("div",{class:"text-sm text-gray-600 hover:text-gray-800 transition-colors px-2 py-1 rounded hover:bg-gray-100 cursor-pointer",onClick:oe=>T.updateLayerOpacity(C)},g.toDisplayString(C.opacity||100)+"% ",9,Y1)]),default:g.withCtx(()=>[g.createElementVNode("div",J1,[f[11]||(f[11]=g.createElementVNode("label",{class:"text-gray-600 whitespace-nowrap"},"Прозорість:",-1)),g.withDirectives(g.createElementVNode("input",{type:"range",min:"0",max:"100",step:"1","onUpdate:modelValue":oe=>C.opacity=oe,onInput:oe=>T.onLayerOpacityChange(C),class:"h-2 w-full accent-blue-600 rounded-lg cursor-pointer bg-gray-200"},null,40,X1),[[g.vModelText,C.opacity]]),g.createElementVNode("span",Q1,g.toDisplayString(Math.round(C.opacity))+"% ",1)])]),_:2},1024)]),g.createElementVNode("div",$1,[g.createVNode(x,{placement:"bottom"},{reference:g.withCtx(()=>[g.createElementVNode("div",i2,[g.createVNode(s)])]),default:g.withCtx(()=>[g.createElementVNode("div",e2,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.popoverActions(C),(oe,Se)=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:Se},[oe.divider?(g.openBlock(),g.createElementBlock("hr",t2)):(g.openBlock(),g.createElementBlock("button",{key:1,class:g.normalizeClass("w-full p-2 text-left text-sm flex items-center gap-2 "+(oe.class||"")),disabled:oe.disabled,onClick:$=>!oe.disabled&&u.$options.methods[oe.handler].call(this,C)},[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(oe.icon),{class:"lucide"})),g.createTextVNode(" "+g.toDisplayString(oe.label),1)],10,r2))],64))),128))])]),_:2},1024)])])]),C.showFilters?(g.openBlock(),g.createElementBlock("div",n2,[g.createElementVNode("div",s2," Фільтри для шару: "+g.toDisplayString(C.name||C.title||C.label),1),g.withDirectives(g.createVNode(V,{ref_for:!0,ref:"filter",scheme:C.filters,header:!1,urlSeparator:"true",view:"plain",name:"filter",onFilterChange:oe=>T.handleFilterChange(oe,C)},null,8,["scheme","onFilterChange"]),[[g.vShow,(J=C.filters)==null?void 0:J.length]]),g.withDirectives(g.createElementVNode("div",null,f[12]||(f[12]=[g.createElementVNode("div",{class:"px-2 text-[14px] text-[#4b5563]"}," Фільтри для шару відсутні ",-1)]),512),[[g.vShow,!((se=C.filters)!=null&&se.length)]])])):g.createCommentVNode("",!0)],42,U1)}),128)),k.selectedLayers.length===0?(g.openBlock(),g.createElementBlock("div",o2,f[13]||(f[13]=[g.createElementVNode("p",null,'Щоб додати шар, натисніть на кнопку "Вибрати шар".',-1)]))):g.createCommentVNode("",!0)])):g.createCommentVNode("",!0)])):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createElementVNode("div",a2,[(g.openBlock(),g.createElementBlock("svg",l2,f[14]||(f[14]=[g.createElementVNode("path",{d:"M7.33333 13.1667C10.2789 13.1667 12.6667 10.7789 12.6667 7.83333C12.6667 4.88781 10.2789 2.5 7.33333 2.5C4.38781 2.5 2 4.88781 2 7.83333C2 10.7789 4.38781 13.1667 7.33333 13.1667Z",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),g.createElementVNode("path",{d:"M13.9995 14.5L11.1328 11.6333",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))),g.withDirectives(g.createElementVNode("input",{title:"value",placeholder:"Введіть назву шару...","onUpdate:modelValue":f[5]||(f[5]=C=>k.search=C),type:"text",class:"py-[7px] ps-8 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:bg-white focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",onKeyup:f[6]||(f[6]=g.withKeys((...C)=>T.onEnter&&T.onEnter(...C),["enter"]))},null,544),[[g.vModelText,k.search]]),g.createVNode(I,{class:"absolute top-1/2 left-[8px] w-[16px] h-[16px]",style:{transform:"translate(0, -50%)"}}),k.search?(g.openBlock(),g.createBlock(L,{key:0,class:"absolute top-1/2 right-[10px] w-[16px] h-[16px] cursor-pointer",style:{transform:"translate(0, -50%)"},onClick:T.clearSearch},null,8,["onClick"])):g.createCommentVNode("",!0)]),k.categories?(g.openBlock(),g.createElementBlock("div",c2,[k.search?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.searchedLayers,(C,W)=>(g.openBlock(),g.createBlock(F,{key:W,layer:C,map:_.map,selectedLayers:k.selectedLayers,onSelect:T.addToSelected,onRemove:T.handleRemoveFromCatalog},null,8,["layer","map","selectedLayers","onSelect","onRemove"]))),128)),T.searchedLayers.length===0?(g.openBlock(),g.createElementBlock("div",u2," Нічого не знайдено ")):g.createCommentVNode("",!0)],64)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[!k.categories||Object.keys(k.categories).length===0?(g.openBlock(),g.createElementBlock("div",h2," Каталог порожній ")):(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:1},g.renderList(Object.keys(k.categories),C=>(g.openBlock(),g.createElementBlock("div",{key:C},[g.createElementVNode("div",{class:"hover:bg-gray-100 focus:bg-gray-100 px-2.5 cursor-pointer p-[8px] rounded-lg flex justify-between items-center",onClick:W=>T.selectCategory(C)},[g.createElementVNode("div",d2,[g.createVNode(M,{class:g.normalizeClass({"rotate-up":C===k.selectedCategory,"rotate-down":C!==k.selectedCategory})},null,8,["class"]),g.createElementVNode("div",{class:"max-w-[260px] text-[14px] text-[#4b5563]",title:C},g.toDisplayString(C),9,f2)]),g.createElementVNode("div",m2,g.toDisplayString(T.formatNumber(k.categories[C].length)),1)],8,p2),g.withDirectives(g.createElementVNode("div",null,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(k.categories[C],(W,J)=>(g.openBlock(),g.createBlock(F,{key:J,layer:W,map:_.map,selectedLayers:k.selectedLayers,onSelect:T.addToSelected,onRemove:T.handleRemoveFromCatalog},null,8,["layer","map","selectedLayers","onSelect","onRemove"]))),128))],512),[[g.vShow,C===k.selectedCategory]])]))),128))],64))])):g.createCommentVNode("",!0)],64))])}const y2=Gt(M1,[["render",g2],["__scopeId","data-v-7480b2b6"]]);var vu={exports:{}},xu={exports:{}},bn={},Wi={},bm;function Ki(){if(bm)return Wi;bm=1,Wi.__esModule=!0,Wi.extend=k,Wi.indexOf=V,Wi.escapeExpression=I,Wi.isEmpty=L,Wi.createFrame=F,Wi.blockParams=M,Wi.appendContextPath=E;var u={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","=":"="},f=/[&<>"'`=]/g,_=/[&<>"'`=]/;function b(C){return u[C]}function k(C){for(var W=1;W<arguments.length;W++)for(var J in arguments[W])Object.prototype.hasOwnProperty.call(arguments[W],J)&&(C[J]=arguments[W][J]);return C}var T=Object.prototype.toString;Wi.toString=T;var x=function(W){return typeof W=="function"};x(/x/)&&(Wi.isFunction=x=function(C){return typeof C=="function"&&T.call(C)==="[object Function]"}),Wi.isFunction=x;var s=Array.isArray||function(C){return C&&typeof C=="object"?T.call(C)==="[object Array]":!1};Wi.isArray=s;function V(C,W){for(var J=0,se=C.length;J<se;J++)if(C[J]===W)return J;return-1}function I(C){if(typeof C!="string"){if(C&&C.toHTML)return C.toHTML();if(C==null)return"";if(!C)return C+"";C=""+C}return _.test(C)?C.replace(f,b):C}function L(C){return!C&&C!==0?!0:!!(s(C)&&C.length===0)}function F(C){var W=k({},C);return W._parent=C,W}function M(C,W){return C.path=W,C}function E(C,W){return(C?C+".":"")+W}return Wi}var bu={exports:{}},wm;function Sn(){return wm||(wm=1,function(u,f){f.__esModule=!0;var _=["description","fileName","lineNumber","endLineNumber","message","name","number","stack"];function b(k,T){var x=T&&T.loc,s=void 0,V=void 0,I=void 0,L=void 0;x&&(s=x.start.line,V=x.end.line,I=x.start.column,L=x.end.column,k+=" - "+s+":"+I);for(var F=Error.prototype.constructor.call(this,k),M=0;M<_.length;M++)this[_[M]]=F[_[M]];Error.captureStackTrace&&Error.captureStackTrace(this,b);try{x&&(this.lineNumber=s,this.endLineNumber=V,Object.defineProperty?(Object.defineProperty(this,"column",{value:I,enumerable:!0}),Object.defineProperty(this,"endColumn",{value:L,enumerable:!0})):(this.column=I,this.endColumn=L))}catch{}}b.prototype=new Error,f.default=b,u.exports=f.default}(bu,bu.exports)),bu.exports}var Ql={},wu={exports:{}},Sm;function _2(){return Sm||(Sm=1,function(u,f){f.__esModule=!0;var _=Ki();f.default=function(b){b.registerHelper("blockHelperMissing",function(k,T){var x=T.inverse,s=T.fn;if(k===!0)return s(this);if(k===!1||k==null)return x(this);if(_.isArray(k))return k.length>0?(T.ids&&(T.ids=[T.name]),b.helpers.each(k,T)):x(this);if(T.data&&T.ids){var V=_.createFrame(T.data);V.contextPath=_.appendContextPath(T.data.contextPath,T.name),T={data:V}}return s(k,T)})},u.exports=f.default}(wu,wu.exports)),wu.exports}var Su={exports:{}},Am;function v2(){return Am||(Am=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("each",function(s,V){if(!V)throw new T.default("Must pass iterator to #each");var I=V.fn,L=V.inverse,F=0,M="",E=void 0,C=void 0;V.data&&V.ids&&(C=b.appendContextPath(V.data.contextPath,V.ids[0])+"."),b.isFunction(s)&&(s=s.call(this)),V.data&&(E=b.createFrame(V.data));function W($,de,Ce){E&&(E.key=$,E.index=de,E.first=de===0,E.last=!!Ce,C&&(E.contextPath=C+$)),M=M+I(s[$],{data:E,blockParams:b.blockParams([s[$],$],[C+$,null])})}if(s&&typeof s=="object")if(b.isArray(s))for(var J=s.length;F<J;F++)F in s&&W(F,F,F===s.length-1);else if(typeof Symbol=="function"&&s[Symbol.iterator]){for(var se=[],oe=s[Symbol.iterator](),Se=oe.next();!Se.done;Se=oe.next())se.push(Se.value);s=se;for(var J=s.length;F<J;F++)W(F,F,F===s.length-1)}else(function(){var $=void 0;Object.keys(s).forEach(function(de){$!==void 0&&W($,F-1),$=de,F++}),$!==void 0&&W($,F-1,!0)})();return F===0&&(M=L(this)),M})},u.exports=f.default}(Su,Su.exports)),Su.exports}var Au={exports:{}},km;function x2(){return km||(km=1,function(u,f){f.__esModule=!0;function _(T){return T&&T.__esModule?T:{default:T}}var b=Sn(),k=_(b);f.default=function(T){T.registerHelper("helperMissing",function(){if(arguments.length!==1)throw new k.default('Missing helper: "'+arguments[arguments.length-1].name+'"')})},u.exports=f.default}(Au,Au.exports)),Au.exports}var ku={exports:{}},Cm;function b2(){return Cm||(Cm=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("if",function(s,V){if(arguments.length!=2)throw new T.default("#if requires exactly one argument");return b.isFunction(s)&&(s=s.call(this)),!V.hash.includeZero&&!s||b.isEmpty(s)?V.inverse(this):V.fn(this)}),x.registerHelper("unless",function(s,V){if(arguments.length!=2)throw new T.default("#unless requires exactly one argument");return x.helpers.if.call(this,s,{fn:V.inverse,inverse:V.fn,hash:V.hash})})},u.exports=f.default}(ku,ku.exports)),ku.exports}var Cu={exports:{}},Tm;function w2(){return Tm||(Tm=1,function(u,f){f.__esModule=!0,f.default=function(_){_.registerHelper("log",function(){for(var b=[void 0],k=arguments[arguments.length-1],T=0;T<arguments.length-1;T++)b.push(arguments[T]);var x=1;k.hash.level!=null?x=k.hash.level:k.data&&k.data.level!=null&&(x=k.data.level),b[0]=x,_.log.apply(_,b)})},u.exports=f.default}(Cu,Cu.exports)),Cu.exports}var Tu={exports:{}},Em;function S2(){return Em||(Em=1,function(u,f){f.__esModule=!0,f.default=function(_){_.registerHelper("lookup",function(b,k,T){return b&&T.lookupProperty(b,k)})},u.exports=f.default}(Tu,Tu.exports)),Tu.exports}var Eu={exports:{}},Pm;function A2(){return Pm||(Pm=1,function(u,f){f.__esModule=!0;function _(x){return x&&x.__esModule?x:{default:x}}var b=Ki(),k=Sn(),T=_(k);f.default=function(x){x.registerHelper("with",function(s,V){if(arguments.length!=2)throw new T.default("#with requires exactly one argument");b.isFunction(s)&&(s=s.call(this));var I=V.fn;if(b.isEmpty(s))return V.inverse(this);var L=V.data;return V.data&&V.ids&&(L=b.createFrame(V.data),L.contextPath=b.appendContextPath(V.data.contextPath,V.ids[0])),I(s,{data:L,blockParams:b.blockParams([s],[L&&L.contextPath])})})},u.exports=f.default}(Eu,Eu.exports)),Eu.exports}var Im;function ty(){if(Im)return Ql;Im=1,Ql.__esModule=!0,Ql.registerDefaultHelpers=W,Ql.moveHelperToHooks=J;function u(se){return se&&se.__esModule?se:{default:se}}var f=_2(),_=u(f),b=v2(),k=u(b),T=x2(),x=u(T),s=b2(),V=u(s),I=w2(),L=u(I),F=S2(),M=u(F),E=A2(),C=u(E);function W(se){_.default(se),k.default(se),x.default(se),V.default(se),L.default(se),M.default(se),C.default(se)}function J(se,oe,Se){se.helpers[oe]&&(se.hooks[oe]=se.helpers[oe],Se||delete se.helpers[oe])}return Ql}var Pu={},Iu={exports:{}},Mm;function k2(){return Mm||(Mm=1,function(u,f){f.__esModule=!0;var _=Ki();f.default=function(b){b.registerDecorator("inline",function(k,T,x,s){var V=k;return T.partials||(T.partials={},V=function(I,L){var F=x.partials;x.partials=_.extend({},F,T.partials);var M=k(I,L);return x.partials=F,M}),T.partials[s.args[0]]=s.fn,V})},u.exports=f.default}(Iu,Iu.exports)),Iu.exports}var Lm;function C2(){if(Lm)return Pu;Lm=1,Pu.__esModule=!0,Pu.registerDefaultDecorators=b;function u(k){return k&&k.__esModule?k:{default:k}}var f=k2(),_=u(f);function b(k){_.default(k)}return Pu}var Mu={exports:{}},Rm;function ry(){return Rm||(Rm=1,function(u,f){f.__esModule=!0;var _=Ki(),b={methodMap:["debug","info","warn","error"],level:"info",lookupLevel:function(T){if(typeof T=="string"){var x=_.indexOf(b.methodMap,T.toLowerCase());x>=0?T=x:T=parseInt(T,10)}return T},log:function(T){if(T=b.lookupLevel(T),typeof console<"u"&&b.lookupLevel(b.level)<=T){var x=b.methodMap[T];console[x]||(x="log");for(var s=arguments.length,V=Array(s>1?s-1:0),I=1;I<s;I++)V[I-1]=arguments[I];console[x].apply(console,V)}}};f.default=b,u.exports=f.default}(Mu,Mu.exports)),Mu.exports}var Ma={},Lu={},Bm;function T2(){if(Bm)return Lu;Bm=1,Lu.__esModule=!0,Lu.createNewLookupObject=f;var u=Ki();function f(){for(var _=arguments.length,b=Array(_),k=0;k<_;k++)b[k]=arguments[k];return u.extend.apply(void 0,[Object.create(null)].concat(b))}return Lu}var Dm;function iy(){if(Dm)return Ma;Dm=1,Ma.__esModule=!0,Ma.createProtoAccessControl=T,Ma.resultIsAllowed=x,Ma.resetLoggedProperties=I;function u(L){return L&&L.__esModule?L:{default:L}}var f=T2(),_=ry(),b=u(_),k=Object.create(null);function T(L){var F=Object.create(null);F.constructor=!1,F.__defineGetter__=!1,F.__defineSetter__=!1,F.__lookupGetter__=!1;var M=Object.create(null);return M.__proto__=!1,{properties:{whitelist:f.createNewLookupObject(M,L.allowedProtoProperties),defaultValue:L.allowProtoPropertiesByDefault},methods:{whitelist:f.createNewLookupObject(F,L.allowedProtoMethods),defaultValue:L.allowProtoMethodsByDefault}}}function x(L,F,M){return s(typeof L=="function"?F.methods:F.properties,M)}function s(L,F){return L.whitelist[F]!==void 0?L.whitelist[F]===!0:L.defaultValue!==void 0?L.defaultValue:(V(F),!1)}function V(L){k[L]!==!0&&(k[L]=!0,b.default.log("error",'Handlebars: Access has been denied to resolve the property "'+L+`" because it is not an "own property" of its parent.
|
|
802
802
|
You can add a runtime option to disable the check or this warning:
|
|
803
803
|
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details`))}function I(){Object.keys(k).forEach(function(L){delete k[L]})}return Ma}var Vm;function dd(){if(Vm)return bn;Vm=1,bn.__esModule=!0,bn.HandlebarsEnvironment=C;function u(J){return J&&J.__esModule?J:{default:J}}var f=Ki(),_=Sn(),b=u(_),k=ty(),T=C2(),x=ry(),s=u(x),V=iy(),I="4.7.8";bn.VERSION=I;var L=8;bn.COMPILER_REVISION=L;var F=7;bn.LAST_COMPATIBLE_COMPILER_REVISION=F;var M={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:"== 1.x.x",5:"== 2.0.0-alpha.x",6:">= 2.0.0-beta.1",7:">= 4.0.0 <4.3.0",8:">= 4.3.0"};bn.REVISION_CHANGES=M;var E="[object Object]";function C(J,se,oe){this.helpers=J||{},this.partials=se||{},this.decorators=oe||{},k.registerDefaultHelpers(this),T.registerDefaultDecorators(this)}C.prototype={constructor:C,logger:s.default,log:s.default.log,registerHelper:function(se,oe){if(f.toString.call(se)===E){if(oe)throw new b.default("Arg not supported with multiple helpers");f.extend(this.helpers,se)}else this.helpers[se]=oe},unregisterHelper:function(se){delete this.helpers[se]},registerPartial:function(se,oe){if(f.toString.call(se)===E)f.extend(this.partials,se);else{if(typeof oe>"u")throw new b.default('Attempting to register a partial called "'+se+'" as undefined');this.partials[se]=oe}},unregisterPartial:function(se){delete this.partials[se]},registerDecorator:function(se,oe){if(f.toString.call(se)===E){if(oe)throw new b.default("Arg not supported with multiple decorators");f.extend(this.decorators,se)}else this.decorators[se]=oe},unregisterDecorator:function(se){delete this.decorators[se]},resetLoggedPropertyAccesses:function(){V.resetLoggedProperties()}};var W=s.default.log;return bn.log=W,bn.createFrame=f.createFrame,bn.logger=s.default,bn}var Ru={exports:{}},zm;function E2(){return zm||(zm=1,function(u,f){f.__esModule=!0;function _(b){this.string=b}_.prototype.toString=_.prototype.toHTML=function(){return""+this.string},f.default=_,u.exports=f.default}(Ru,Ru.exports)),Ru.exports}var is={},Bu={},Fm;function P2(){if(Fm)return Bu;Fm=1,Bu.__esModule=!0,Bu.wrapHelper=u;function u(f,_){if(typeof f!="function")return f;var b=function(){var T=arguments[arguments.length-1];return arguments[arguments.length-1]=_(T),f.apply(this,arguments)};return b}return Bu}var Om;function I2(){if(Om)return is;Om=1,is.__esModule=!0,is.checkRevision=L,is.template=F,is.wrapProgram=M,is.resolvePartial=E,is.invokePartial=C,is.noop=W;function u($){return $&&$.__esModule?$:{default:$}}function f($){if($&&$.__esModule)return $;var de={};if($!=null)for(var Ce in $)Object.prototype.hasOwnProperty.call($,Ce)&&(de[Ce]=$[Ce]);return de.default=$,de}var _=Ki(),b=f(_),k=Sn(),T=u(k),x=dd(),s=ty(),V=P2(),I=iy();function L($){var de=$&&$[0]||1,Ce=x.COMPILER_REVISION;if(!(de>=x.LAST_COMPATIBLE_COMPILER_REVISION&&de<=x.COMPILER_REVISION))if(de<x.LAST_COMPATIBLE_COMPILER_REVISION){var Re=x.REVISION_CHANGES[Ce],Ze=x.REVISION_CHANGES[de];throw new T.default("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+Re+") or downgrade your runtime to an older version ("+Ze+").")}else throw new T.default("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+$[1]+").")}function F($,de){if(!de)throw new T.default("No environment passed to template");if(!$||!$.main)throw new T.default("Unknown template object: "+typeof $);$.main.decorator=$.main_d,de.VM.checkRevision($.compiler);var Ce=$.compiler&&$.compiler[0]===7;function Re(tt,Ge,it){it.hash&&(Ge=b.extend({},Ge,it.hash),it.ids&&(it.ids[0]=!0)),tt=de.VM.resolvePartial.call(this,tt,Ge,it);var vt=b.extend({},it,{hooks:this.hooks,protoAccessControl:this.protoAccessControl}),Lt=de.VM.invokePartial.call(this,tt,Ge,vt);if(Lt==null&&de.compile&&(it.partials[it.name]=de.compile(tt,$.compilerOptions,de),Lt=it.partials[it.name](Ge,vt)),Lt!=null){if(it.indent){for(var kr=Lt.split(`
|
|
804
804
|
`),hr=0,xi=kr.length;hr<xi&&!(!kr[hr]&&hr+1===xi);hr++)kr[hr]=it.indent+kr[hr];Lt=kr.join(`
|
|
@@ -857,7 +857,7 @@ Expecting `+Ge.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":it="Parse erro
|
|
|
857
857
|
<td style="display: table-cell; padding: 2px 0 2px 8px; vertical-align: middle; width: 50%; text-align: right;">${xt[Qt]||"-"}</td>
|
|
858
858
|
</tr>
|
|
859
859
|
`).join(""));const Fi=`
|
|
860
|
-
<div class="absolute min-w-
|
|
860
|
+
<div class="absolute min-w-[250px] max-w-[300px] bg-white/90 border border-gray-200 rounded-lg shadow-md text-gray-800 pointer-events-none" style="display: flex; flex-direction: column; justify-content: center;">
|
|
861
861
|
${dt}
|
|
862
862
|
${bi?`<div class="font-semibold text-sm border-b border-solid border-gray-200 text-gray-800 px-2 py-1">${bi}</div>`:""}
|
|
863
863
|
<div class="text-xs px-2 py-0.5 text-gray-500" style="display: flex; justify-content: center; align-items: center; flex: 1;">
|
|
@@ -866,4 +866,4 @@ Expecting `+Ge.join(", ")+", got '"+(this.terminals_[Se]||Se)+"'":it="Parse erro
|
|
|
866
866
|
</table>
|
|
867
867
|
</div>
|
|
868
868
|
</div>
|
|
869
|
-
`;return ut||(ut=document.createElement("div"),ut.className="custom-popup absolute z-50",document.body.appendChild(ut)),ut.innerHTML=Fi,Lr(ut,Qe),ut}function Lr(et,Qe){const ut=et.offsetWidth,xt=et.offsetHeight,ot=document.getElementById("maplibre-demo-map"),ht=ot.getBoundingClientRect(),Ct=Qe.originalEvent.clientX-ht.left,_t=Qe.originalEvent.clientY-ht.top;let dt=Ct-ut/2;dt=Math.max(10,Math.min(dt,ht.width-ut-10));let er;_t-xt-10>0?er=_t-xt-5:_t+xt+10<ht.height?er=_t+10:er=Math.max(10,ht.height-xt-10),et.style.position="absolute",et.style.left=`${dt+20}px`,et.style.top=`${er+10}px`,et.parentNode!==ot&&ot.appendChild(et)}return(et,Qe)=>{var ut,xt;return g.openBlock(),g.createElementBlock("div",{class:"maplibre-demo-map-container",style:g.normalizeStyle(Ze.value)},[Qe[10]||(Qe[10]=g.createElementVNode("div",{id:"maplibre-demo-map"},null,-1)),b.value?(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createElementVNode("div",eA,[g.createElementVNode("div",tA,[g.createElementVNode("div",rA,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["top-left"],ot=>{var ht,Ct;return g.createVNode(Zu,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:I.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[0]||(Qe[0]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[1]||(Qe[1]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))]),g.createElementVNode("div",iA,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["bottom-left"],ot=>{var ht,Ct;return g.createVNode(Zu,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:I.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[2]||(Qe[2]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[3]||(Qe[3]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))])]),g.createElementVNode("div",nA,[g.createElementVNode("div",sA,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["top-right"],ot=>{var ht,Ct;return g.createVNode(Zu,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:I.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[4]||(Qe[4]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[5]||(Qe[5]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))]),g.createElementVNode("div",oA,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["bottom-right"],ot=>{var ht,Ct;return g.createVNode(Zu,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:I.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[6]||(Qe[6]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[7]||(Qe[7]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))])])]),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(as.value,(ot,ht)=>(g.openBlock(),g.createElementBlock("div",{key:"abs-"+(ot.id||ot.type||ht),class:"absolute z-20",style:g.normalizeStyle(ot.style)},[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(se(ot.type)),{map:_.value,config:ot.config,hasFilters:oe.value,currentFilterLayer:T.value,enabledLayerIds:Ge.value,cardValues:I.value,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[8]||(Qe[8]=Ct=>Ge.value=Ct),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[9]||(Qe[9]=Ct=>M.value=Ct)},null,40,["map","config","hasFilters","currentFilterLayer","enabledLayerIds","cardValues"]))],4))),128)),g.createElementVNode("div",aA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList((xt=(ut=F.value)==null?void 0:ut.value)==null?void 0:xt.tools,ot=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:ot},[b.value&&Ei[ot]?(g.openBlock(),g.createBlock(g.resolveDynamicComponent(Ei[ot]),g.mergeProps({key:0,map:_.value,activeTool:L.value,setActiveTool:An},{ref_for:!0},ot==="home"?{initialView:nn.value}:{},{onCardValuesId:Kr}),null,16,["map","activeTool"])):g.createCommentVNode("",!0)],64))),128))])],64)):(g.openBlock(),g.createBlock(Aw,{key:0}))],4)}}},py=Gt(lA,[["__scopeId","data-v-b8c7a0d4"]]),cA={props:{title:{type:String,required:!0},description:{type:String,required:!0}}},uA={class:"text-center mb-12"},hA={class:"text-3xl font-bold mb-4"},pA={class:"text-slate-600 max-w-2xl mx-auto"};function dA(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("div",uA,[g.createElementVNode("h2",hA,g.toDisplayString(_.title),1),g.createElementVNode("p",pA,g.toDisplayString(_.description),1)])}const fA=Gt(cA,[["render",dA]]),mA={name:"Template1",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns.filter(u=>u.meta==="category")},tagsCol(){return this.columns.filter(u=>u.meta==="tags")},featuresCols(){return this.columns.filter(u=>u.meta==="features")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},gA={class:"flex justify-between p-4 pb-2 bg-slate-50 gap-4"},yA={class:"flex items-center justify-between"},_A={class:"text-lg font-bold line-clamp-2"},vA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground ml-2 whitespace-nowrap","data-v0-t":"badge"},xA={key:0,class:"flex"},bA={key:0,class:"h-fit inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground ml-2 whitespace-nowrap"},wA={class:"p-4 pt-2"},SA={class:"grid grid-cols-2 gap-3 text-sm"},AA={class:"text-gray-500"},kA={class:"font-medium"},CA={class:"items-center p-3 bg-slate-50 flex justify-end"},TA=["href"];function EA(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground overflow-hidden border-none shadow-md relative","data-v0-t":"card"},[g.createElementVNode("div",gA,[g.createElementVNode("div",yA,[g.createElementVNode("h2",_A,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,I=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:I.name},[x[I.name]?(g.openBlock(),g.createElementBlock("div",vA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0)]),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",xA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"mt-2 flex flex-wrap gap-1"},[x[I.name]?(g.openBlock(),g.createElementBlock("span",bA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",wA,[g.createElementVNode("div",SA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"flex items-center gap-1.5"},[g.createElementVNode("span",AA,g.toDisplayString(I.ua)+": ",1),g.createElementVNode("span",kA,[Array.isArray(x[I==null?void 0:I.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[I==null?void 0:I.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[I==null?void 0:I.name]||"Немає даних"),1)],64))])]))),128))])]),g.createElementVNode("div",CA,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 rounded-md px-3"},f[0]||(f[0]=[g.createTextVNode(" Детальніше "),g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-arrow-right ml-1 h-3.5 w-3.5"},[g.createElementVNode("path",{d:"M5 12h14"}),g.createElementVNode("path",{d:"m12 5 7 7-7 7"})],-1)]),8,TA)])])}),128)}const PA=Gt(mA,[["render",EA]]),IA={name:"Template2",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},MA={class:"p-0"},LA={class:"border-l-4 border-l-slate-400"},RA={class:"p-4"},BA={class:"flex flex-wrap items-center gap-2 mb-3"},DA={class:"text-lg font-bold"},VA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-green-100 text-green-800 hover:bg-green-100","data-v0-t":"badge"},zA={key:1,class:"flex"},FA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},OA={class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3 text-sm border-t pt-3"},NA={class:"text-xs text-gray-500 mb-1"},qA={class:"font-medium"},UA={class:"flex justify-end mt-3 border-t pt-3"},jA=["href"];function WA(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden","data-v0-t":"card"},[g.createElementVNode("div",MA,[g.createElementVNode("div",LA,[g.createElementVNode("div",RA,[g.createElementVNode("div",BA,[g.createElementVNode("h2",DA,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,I=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:I.name},[x[I.name]?(g.openBlock(),g.createElementBlock("div",VA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",zA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"flex flex-wrap gap-1 ml-2"},[x[I.name]?(g.openBlock(),g.createElementBlock("span",FA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",OA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name},[g.createElementVNode("p",NA,g.toDisplayString(I.ua),1),g.createElementVNode("p",qA,[Array.isArray(x[I==null?void 0:I.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[I==null?void 0:I.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[I==null?void 0:I.name]||"Немає даних"),1)],64))])]))),128))]),g.createElementVNode("div",UA,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 hover:bg-accent hover:text-accent-foreground h-9 rounded-md px-3"},f[0]||(f[0]=[g.createTextVNode(" Детальніше "),g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-external-link ml-1 h-3.5 w-3.5"},[g.createElementVNode("path",{d:"M15 3h6v6"}),g.createElementVNode("path",{d:"M10 14 21 3"}),g.createElementVNode("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})],-1)]),8,jA)])])])])])}),128)}const HA=Gt(IA,[["render",WA]]),ZA={name:"Template3",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")},colorClass(){return"bg-blue-500"},titleCol(){return this.columns.find(u=>u.meta==="title")}},methods:{featureColClass(u,f){return"col-span-2"},getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},KA={class:"space-y-4"},GA={class:"flex items-center py-2 px-3"},JA={class:"flex-1"},XA={class:"grid grid-cols-12 gap-2 w-full text-xs"},QA={class:"col-span-5"},YA={key:0,class:"inline-flex items-center rounded-full border transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 mt-1 text-[10px] font-normal px-1.5 py-0","data-v0-t":"badge"},$A={key:1,class:"flex flex-wrap gap-1 mt-1"},ek={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},tk={class:"col-span-7"},rk={class:"grid grid-cols-3 gap-3"},ik={class:"text-[10px] text-gray-500 mb-1"},nk={class:"truncate font-medium"},sk=["href"];function ok(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("div",KA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"border-b border-slate-200 hover:bg-slate-50 transition-colors"},[g.createElementVNode("div",GA,[g.createElementVNode("div",{class:g.normalizeClass(["w-1 h-8 rounded-full mr-3",T.colorClass])},null,2),g.createElementVNode("div",JA,[g.createElementVNode("div",XA,[g.createElementVNode("div",QA,[g.createElementVNode("p",{class:g.normalizeClass(["font-bold text-sm text-left",{"w-full h-full flex items-center":!Array.isArray(T.tagsCol)||!T.tagsCol.length}])},g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||x[Object.keys(x)[0]]||"Не вказано"),3),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,I=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:I.name},[x[I.name]?(g.openBlock(),g.createElementBlock("div",YA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",$A,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"flex flex-wrap gap-1 mt-1"},[x[I.name]?(g.openBlock(),g.createElementBlock("span",ek,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",tk,[g.createElementVNode("div",rk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name},[g.createElementVNode("p",ik,g.toDisplayString(I.ua),1),g.createElementVNode("p",nk,[Array.isArray(x[I==null?void 0:I.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[I==null?void 0:I.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[I==null?void 0:I.name]||"Немає даних"),1)],64))])]))),128))])])])]),g.createElementVNode("a",{href:T.getItemLink(x),class:"ml-auto flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 hover:bg-accent hover:text-accent-foreground rounded-md h-7 w-7 p-0",style:{"min-width":"2.5rem"}},f[0]||(f[0]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-chevron-right h-4 w-4"},[g.createElementVNode("path",{d:"m9 18 6-6-6-6"})],-1)]),8,sk)])])}),128))])}const ak=Gt(ZA,[["render",ok]]),lk={name:"Template4",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{featuresCols(){return this.columns.filter(u=>u.meta==="features")},titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},ck={class:"flex flex-col space-y-1.5 p-6 pb-2"},uk={class:"flex items-center gap-2"},hk={class:"tracking-tight text-lg font-medium"},pk={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-blue-100 text-blue-800 ml-2","data-v0-t":"badge"},dk={key:1,class:"flex"},fk={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},mk={class:"p-6 pt-0 pb-4"},gk={class:"grid grid-cols-2 gap-4"},yk={class:"text-sm text-gray-500"},_k={class:"font-medium"},vk={class:"flex items-center p-6 pt-0"},xk=["href"];function bk(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground shadow-sm border-l-4 border-l-blue-600","data-v0-t":"card"},[g.createElementVNode("div",ck,[g.createElementVNode("div",uk,[g.createElementVNode("h3",hk,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||Object.keys(x)[0]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,I=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:I.name},[x[I.name]?(g.openBlock(),g.createElementBlock("div",pk,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",dk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"flex flex-wrap gap-1 ml-2"},[x[I.name]?(g.openBlock(),g.createElementBlock("span",fk,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)])]),g.createElementVNode("div",mk,[g.createElementVNode("div",gk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name},[g.createElementVNode("p",yk,g.toDisplayString(I.ua),1),g.createElementVNode("p",_k,[Array.isArray(x[I==null?void 0:I.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[I==null?void 0:I.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[I==null?void 0:I.name]||"Немає даних"),1)],64))])]))),128))])]),g.createElementVNode("div",vk,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 border bg-background h-10 px-4 py-2 rounded-md text-black border-black hover:bg-gray-100 hover:text-black"}," Детальніше ",8,xk)])])}),128)}const wk=Gt(lk,[["render",bk]]),Sk={name:"Template5",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{imageCol(){return this.columns.find(u=>u.meta==="image")},descCol(){return this.columns.find(u=>u.meta==="desc")||this.columns.find(u=>u.name==="description")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")},titleCol(){return this.columns.find(u=>u.meta==="title")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},Ak={class:"grid grid-cols-12 divide-x divide-gray-100"},kk={key:0},Ck=["src"],Tk={key:1,class:"col-span-1 flex items-center justify-center"},Ek={class:"col-span-7 p-4"},Pk={class:"flex items-center mb-1 col-span-7 p-4"},Ik={class:"text-base font-bold text-gray-900 mr-2"},Mk={key:0,class:"inline-flex items-center rounded-full px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-primary/80 bg-blue-100 text-blue-800 border-0 text-xs ml-2"},Lk={class:"text-sm text-gray-600 line-clamp-1 mb-2"},Rk={class:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm"},Bk={class:"text-gray-500 mr-1"},Dk=["innerHTML"],Vk={class:"text-gray-600 truncate"},zk={class:"col-span-2 p-3 bg-gray-50 flex flex-col justify-center"},Fk={class:"text-xs text-gray-500 mb-1.5"},Ok={key:0,class:"flex flex-wrap gap-1"},Nk={key:0,class:"inline-flex items-center rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 bg-white border border-gray-200 text-gray-700 text-xs px-1.5 py-0"},qk={class:"col-span-2 flex flex-col justify-center items-center bg-gray-50 border-l p-2"},Uk={class:"w-full space-y-2"},jk=["href"];function Wk(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V,I,L,F;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"bg-white border border-gray-200 rounded-lg overflow-hidden transition-all duration-200 hover:shadow-md"},[g.createElementVNode("div",Ak,[T.imageCol?(g.openBlock(),g.createElementBlock("div",kk,[x[(s=T.imageCol)==null?void 0:s.name]?(g.openBlock(),g.createElementBlock("img",{key:0,src:x[(V=T.imageCol)==null?void 0:V.name],alt:"image",class:"object-cover h-full"},null,8,Ck)):g.createCommentVNode("",!0)])):(g.openBlock(),g.createElementBlock("div",Tk,f[0]||(f[0]=[g.createElementVNode("div",{class:"w-3 h-12 rounded-sm bg-blue-500",title:"Пріоритет: Високий","aria-hidden":"true"},null,-1)]))),g.createElementVNode("div",Ek,[g.createElementVNode("div",Pk,[g.createElementVNode("h3",Ik,g.toDisplayString(x[`${(I=T.titleCol)==null?void 0:I.name}_text`]||x[(L=T.titleCol)==null?void 0:L.name]||Object.keys(x)[0]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,M=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:M.name},[x[M.name]?(g.openBlock(),g.createElementBlock("div",Mk,g.toDisplayString(x[`${M.name}_text`]||x[M.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0)]),g.createElementVNode("p",Lk,g.toDisplayString(x[(F=T.descCol)==null?void 0:F.name]),1),g.createElementVNode("div",Rk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,M=>(g.openBlock(),g.createElementBlock("div",{key:M.name,class:"flex items-center"},[g.createElementVNode("span",Bk,g.toDisplayString((M==null?void 0:M.ua)||M.label||M.name)+":",1),M.icon?(g.openBlock(),g.createElementBlock("span",{key:0,class:"mr-1 flex-shrink-0",innerHTML:M.icon},null,8,Dk)):g.createCommentVNode("",!0),g.createElementVNode("span",Vk,[Array.isArray(x[M==null?void 0:M.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[M==null?void 0:M.name],(E,C)=>(g.openBlock(),g.createElementBlock("span",{key:C,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(E),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[M==null?void 0:M.name]||"Немає даних"),1)],64))])]))),128))])]),g.createElementVNode("div",zk,[g.createElementVNode("p",Fk," Теги: "+g.toDisplayString(T.tagsCol.length&&x[T.tagsCol[0].name]?"":"відсутні"),1),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",Ok,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,M=>(g.openBlock(),g.createElementBlock("div",{key:M.name,class:"flex flex-wrap gap-1"},[x[M.name]?(g.openBlock(),g.createElementBlock("span",Nk,g.toDisplayString(x[`${M.name}_text`]||x[M.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",qk,[g.createElementVNode("div",Uk,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-md px-3 w-full bg-blue-600 hover:bg-blue-700 text-white text-xs h-8"}," Детальніше ",8,jk)])])])])}),128)}const Hk=Gt(Sk,[["render",Wk]]),Zk={template1:PA,template2:HA,template3:ak,template4:wk,template5:Hk},Kk={name:"RegistryList",components:{HeroBlock:fA,...Zk},props:{title:{type:String,required:!0},description:{type:String,default:""},type:{type:String,default:"data"},items:{type:Array,default:()=>[]},total:{type:Number,default:0},filters:{type:Array,default:()=>null},emptyStateText:{type:String,default:"Немає даних"},breadcrumbs:{type:Array,default:()=>[]},dialog:{type:Boolean,default:!0},token:{type:String,default:""},table:{type:String,default:""},slug:{type:String,default:""},view:{type:String,default:""},path:{type:String,default:""},id_key:{type:String,default:""},columns:{type:Array,default:()=>[]},query_params:{type:Array,default:()=>[]}},data(){return{filterUrl:"",mounted:!1,tableData:[],currentPage:1,limit:16,localTotal:0}},created(){this.tableData=this.items,this.localTotal=this.total},mounted(){this.mounted=!0},methods:{handleFilterChange({url:u}){this.currentPage=1,this.filterUrl=u,this.getData()},handlePageChange(u){this.currentPage=u,this.getData()},changeLimit(u){this.limit=u,this.currentPage=1,this.getData()},async getData(){try{const u=this.type==="registry"?`/api/gis-registry/${this.slug}`:`/api/data/${this.table}`,{data:f}=await Ar.get(`${u}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`);f&&(this.tableData=f==null?void 0:f.rows,this.localTotal=this.type==="registry"?f==null?void 0:f.total:f==null?void 0:f.filtered)}catch(u){console.error(u.message)}}}},Gk={class:"py-16 md:py-24"},Jk={class:"py-6"},Xk={class:"container"},Qk={key:0,class:"flex items-center text-sm text-muted-foreground mb-6"},Yk=["href"],$k={key:1,class:"text-foreground font-medium truncate"},eC={class:"flex flex-col md:flex-row gap-4 justify-start"},tC={class:"container"},rC={key:0,class:"space-y-4"},iC={class:"my-5 pr-2"},nC={class:"paginationWrapper relative flex justify-center"},sC={key:1,class:"text-center text-slate-400"};function oC(u,f,_,b,k,T){var I,L;const x=g.resolveComponent("HeroBlock"),s=g.resolveComponent("VsFilterList"),V=g.resolveComponent("VsPagination");return g.openBlock(),g.createElementBlock("div",Gk,[g.createElementVNode("section",null,[g.createVNode(x,{title:_.title,description:_.description},null,8,["title","description"])]),g.createElementVNode("section",Jk,[g.createElementVNode("div",Xk,[(I=_.breadcrumbs)!=null&&I.length?(g.openBlock(),g.createElementBlock("div",Qk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.breadcrumbs,(F,M)=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:M},[M<_.breadcrumbs.length-1?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createElementVNode("a",{href:F.link,class:"hover:text-foreground"},g.toDisplayString(F.name),9,Yk),f[0]||(f[0]=g.createElementVNode("span",{class:"mx-2"},"/",-1))],64)):(g.openBlock(),g.createElementBlock("span",$k,g.toDisplayString(F.name),1))],64))),128))])):g.createCommentVNode("",!0),g.createElementVNode("div",eC,[_.filters&&k.mounted?(g.openBlock(),g.createBlock(s,{key:0,ref:"filter",scheme:_.filters,isDialog:_.dialog,urlSeparator:"true",view:"plain",token:_.token,name:"filter",onFilterChange:T.handleFilterChange},{button:g.withCtx(()=>f[1]||(f[1]=[g.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground px-3 py-2",type:"button"}," Фільтри ",-1)])),_:1},8,["scheme","isDialog","token","onFilterChange"])):g.createCommentVNode("",!0)])])]),g.createElementVNode("section",null,[g.createElementVNode("div",tC,[((L=k.tableData)==null?void 0:L.length)>0?(g.openBlock(),g.createElementBlock("div",rC,[u.$slots.default?g.renderSlot(u.$slots,"default",{key:0,items:k.tableData}):_.view?(g.openBlock(),g.createBlock(g.resolveDynamicComponent(_.view),{key:1,items:k.tableData,path:_.path,id_key:_.id_key,columns:_.columns,query_params:_.query_params},null,8,["items","path","id_key","columns","query_params"])):g.createCommentVNode("",!0),g.createElementVNode("div",iC,[g.createElementVNode("div",nC,[g.createVNode(V,{total:k.localTotal,maxPages:4,defaultPage:k.currentPage,pageSize:k.limit,goTo:!1,size:"medium",backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[16,32,48,64],onPageChange:T.handlePageChange,onPageSizeChange:T.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])])):(g.openBlock(),g.createElementBlock("div",sC,g.toDisplayString(_.emptyStateText),1))])])])}const dy=Gt(Kk,[["render",oC]]),aC={class:"pt-[10px]"},lC={__name:"vs-editor-style-ace",props:{yamlValue:{type:null,default:()=>""}},setup(u){const f=u,_=g.ref(f.yamlValue);return(b,k)=>{const T=g.resolveComponent("VsFormAce");return g.openBlock(),g.createElementBlock("div",aC,[g.createVNode(T,{modelValue:_.value,"onUpdate:modelValue":k[0]||(k[0]=x=>_.value=x),value:_.value,fontSize:"12px"},null,8,["modelValue","value"])])}}},cC={components:{VsEditorStyleAce:lC},props:{data:Object,value:null,name:String},data(){var u,f,_;return{style:((_=(f=(u=this.data)==null?void 0:u.rows)==null?void 0:f[0])==null?void 0:_.style)||""}}};function uC(u,f,_,b,k,T){const x=g.resolveComponent("VsEditorStyleAce");return g.openBlock(),g.createBlock(x,{yamlValue:k.style,onChangeData:u.onChange,height:500,onUpdate:u.getData},null,8,["yamlValue","onChangeData","onUpdate"])}const hC=Gt(cC,[["render",uC]]);function pC(u){u.component("MapCustom",py),u.component("RegistryList",dy),u.component("vs-style-yml",hC)}const dC={MapCustom:py,RegistryList:dy,install:pC};module.exports=dC;
|
|
869
|
+
`;return ut||(ut=document.createElement("div"),ut.className="custom-popup absolute z-50",document.body.appendChild(ut)),ut.innerHTML=Fi,Lr(ut,Qe),ut}function Lr(et,Qe){const ut=et.offsetWidth,xt=et.offsetHeight,ot=document.getElementById("maplibre-demo-map"),ht=ot.getBoundingClientRect(),Ct=Qe.originalEvent.clientX-ht.left,_t=Qe.originalEvent.clientY-ht.top;let dt=Ct-ut/2;dt=Math.max(10,Math.min(dt,ht.width-ut-10));let er;_t-xt-10>0?er=_t-xt-5:_t+xt+10<ht.height?er=_t+10:er=Math.max(10,ht.height-xt-10),et.style.position="absolute",et.style.left=`${dt+20}px`,et.style.top=`${er+10}px`,et.parentNode!==ot&&ot.appendChild(et)}return(et,Qe)=>{var ut,xt;return g.openBlock(),g.createElementBlock("div",{class:"maplibre-demo-map-container",style:g.normalizeStyle(Ze.value)},[Qe[10]||(Qe[10]=g.createElementVNode("div",{id:"maplibre-demo-map"},null,-1)),b.value?(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createElementVNode("div",eA,[g.createElementVNode("div",tA,[g.createElementVNode("div",rA,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["top-left"],ot=>{var ht,Ct;return g.createVNode(Zu,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:I.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[0]||(Qe[0]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[1]||(Qe[1]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))]),g.createElementVNode("div",iA,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["bottom-left"],ot=>{var ht,Ct;return g.createVNode(Zu,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:I.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[2]||(Qe[2]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[3]||(Qe[3]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))])]),g.createElementVNode("div",nA,[g.createElementVNode("div",sA,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["top-right"],ot=>{var ht,Ct;return g.createVNode(Zu,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:I.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[4]||(Qe[4]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[5]||(Qe[5]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))]),g.createElementVNode("div",oA,[(g.openBlock(),g.createElementBlock(g.Fragment,null,g.renderList(["bottom-right"],ot=>{var ht,Ct;return g.createVNode(Zu,{key:ot,position:ot,widgets:C(ot),map:_.value,mapLoaded:b.value,cardValues:I.value,hasFilters:oe.value,history:(Ct=(ht=F.value)==null?void 0:ht.value)==null?void 0:Ct.history,currentFilterLayer:T.value,enabledLayerIds:Ge.value,getWidgetComponent:se,getColumnWidth:tt,rightColumnOffset:ot==="top-right"?hr.value:void 0,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[6]||(Qe[6]=_t=>Ge.value=_t),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[7]||(Qe[7]=_t=>M.value=_t)},null,8,["position","widgets","map","mapLoaded","cardValues","hasFilters","history","currentFilterLayer","enabledLayerIds","rightColumnOffset"])}),64))])])]),(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(as.value,(ot,ht)=>(g.openBlock(),g.createElementBlock("div",{key:"abs-"+(ot.id||ot.type||ht),class:"absolute z-20",style:g.normalizeStyle(ot.style)},[(g.openBlock(),g.createBlock(g.resolveDynamicComponent(se(ot.type)),{map:_.value,config:ot.config,hasFilters:oe.value,currentFilterLayer:T.value,enabledLayerIds:Ge.value,cardValues:I.value,onSetFilterLayer:Se,"onUpdate:enabledLayerIds":Qe[8]||(Qe[8]=Ct=>Ge.value=Ct),onCardValuesId:Kr,onCloseCard:Re,onCatalogLayers:Qe[9]||(Qe[9]=Ct=>M.value=Ct)},null,40,["map","config","hasFilters","currentFilterLayer","enabledLayerIds","cardValues"]))],4))),128)),g.createElementVNode("div",aA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList((xt=(ut=F.value)==null?void 0:ut.value)==null?void 0:xt.tools,ot=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:ot},[b.value&&Ei[ot]?(g.openBlock(),g.createBlock(g.resolveDynamicComponent(Ei[ot]),g.mergeProps({key:0,map:_.value,activeTool:L.value,setActiveTool:An},{ref_for:!0},ot==="home"?{initialView:nn.value}:{},{onCardValuesId:Kr}),null,16,["map","activeTool"])):g.createCommentVNode("",!0)],64))),128))])],64)):(g.openBlock(),g.createBlock(Aw,{key:0}))],4)}}},py=Gt(lA,[["__scopeId","data-v-cf56a87d"]]),cA={props:{title:{type:String,required:!0},description:{type:String,required:!0}}},uA={class:"text-center mb-12"},hA={class:"text-3xl font-bold mb-4"},pA={class:"text-slate-600 max-w-2xl mx-auto"};function dA(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("div",uA,[g.createElementVNode("h2",hA,g.toDisplayString(_.title),1),g.createElementVNode("p",pA,g.toDisplayString(_.description),1)])}const fA=Gt(cA,[["render",dA]]),mA={name:"Template1",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns.filter(u=>u.meta==="category")},tagsCol(){return this.columns.filter(u=>u.meta==="tags")},featuresCols(){return this.columns.filter(u=>u.meta==="features")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},gA={class:"flex justify-between p-4 pb-2 bg-slate-50 gap-4"},yA={class:"flex items-center justify-between"},_A={class:"text-lg font-bold line-clamp-2"},vA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground ml-2 whitespace-nowrap","data-v0-t":"badge"},xA={key:0,class:"flex"},bA={key:0,class:"h-fit inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 text-foreground ml-2 whitespace-nowrap"},wA={class:"p-4 pt-2"},SA={class:"grid grid-cols-2 gap-3 text-sm"},AA={class:"text-gray-500"},kA={class:"font-medium"},CA={class:"items-center p-3 bg-slate-50 flex justify-end"},TA=["href"];function EA(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground overflow-hidden border-none shadow-md relative","data-v0-t":"card"},[g.createElementVNode("div",gA,[g.createElementVNode("div",yA,[g.createElementVNode("h2",_A,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,I=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:I.name},[x[I.name]?(g.openBlock(),g.createElementBlock("div",vA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0)]),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",xA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"mt-2 flex flex-wrap gap-1"},[x[I.name]?(g.openBlock(),g.createElementBlock("span",bA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",wA,[g.createElementVNode("div",SA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"flex items-center gap-1.5"},[g.createElementVNode("span",AA,g.toDisplayString(I.ua)+": ",1),g.createElementVNode("span",kA,[Array.isArray(x[I==null?void 0:I.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[I==null?void 0:I.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[I==null?void 0:I.name]||"Немає даних"),1)],64))])]))),128))])]),g.createElementVNode("div",CA,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-9 rounded-md px-3"},f[0]||(f[0]=[g.createTextVNode(" Детальніше "),g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-arrow-right ml-1 h-3.5 w-3.5"},[g.createElementVNode("path",{d:"M5 12h14"}),g.createElementVNode("path",{d:"m12 5 7 7-7 7"})],-1)]),8,TA)])])}),128)}const PA=Gt(mA,[["render",EA]]),IA={name:"Template2",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},MA={class:"p-0"},LA={class:"border-l-4 border-l-slate-400"},RA={class:"p-4"},BA={class:"flex flex-wrap items-center gap-2 mb-3"},DA={class:"text-lg font-bold"},VA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-green-100 text-green-800 hover:bg-green-100","data-v0-t":"badge"},zA={key:1,class:"flex"},FA={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},OA={class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-3 text-sm border-t pt-3"},NA={class:"text-xs text-gray-500 mb-1"},qA={class:"font-medium"},UA={class:"flex justify-end mt-3 border-t pt-3"},jA=["href"];function WA(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden","data-v0-t":"card"},[g.createElementVNode("div",MA,[g.createElementVNode("div",LA,[g.createElementVNode("div",RA,[g.createElementVNode("div",BA,[g.createElementVNode("h2",DA,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,I=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:I.name},[x[I.name]?(g.openBlock(),g.createElementBlock("div",VA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",zA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"flex flex-wrap gap-1 ml-2"},[x[I.name]?(g.openBlock(),g.createElementBlock("span",FA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",OA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name},[g.createElementVNode("p",NA,g.toDisplayString(I.ua),1),g.createElementVNode("p",qA,[Array.isArray(x[I==null?void 0:I.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[I==null?void 0:I.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[I==null?void 0:I.name]||"Немає даних"),1)],64))])]))),128))]),g.createElementVNode("div",UA,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 hover:bg-accent hover:text-accent-foreground h-9 rounded-md px-3"},f[0]||(f[0]=[g.createTextVNode(" Детальніше "),g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-external-link ml-1 h-3.5 w-3.5"},[g.createElementVNode("path",{d:"M15 3h6v6"}),g.createElementVNode("path",{d:"M10 14 21 3"}),g.createElementVNode("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})],-1)]),8,jA)])])])])])}),128)}const HA=Gt(IA,[["render",WA]]),ZA={name:"Template3",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")},colorClass(){return"bg-blue-500"},titleCol(){return this.columns.find(u=>u.meta==="title")}},methods:{featureColClass(u,f){return"col-span-2"},getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},KA={class:"space-y-4"},GA={class:"flex items-center py-2 px-3"},JA={class:"flex-1"},XA={class:"grid grid-cols-12 gap-2 w-full text-xs"},QA={class:"col-span-5"},YA={key:0,class:"inline-flex items-center rounded-full border transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80 mt-1 text-[10px] font-normal px-1.5 py-0","data-v0-t":"badge"},$A={key:1,class:"flex flex-wrap gap-1 mt-1"},ek={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},tk={class:"col-span-7"},rk={class:"grid grid-cols-3 gap-3"},ik={class:"text-[10px] text-gray-500 mb-1"},nk={class:"truncate font-medium"},sk=["href"];function ok(u,f,_,b,k,T){return g.openBlock(),g.createElementBlock("div",KA,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"border-b border-slate-200 hover:bg-slate-50 transition-colors"},[g.createElementVNode("div",GA,[g.createElementVNode("div",{class:g.normalizeClass(["w-1 h-8 rounded-full mr-3",T.colorClass])},null,2),g.createElementVNode("div",JA,[g.createElementVNode("div",XA,[g.createElementVNode("div",QA,[g.createElementVNode("p",{class:g.normalizeClass(["font-bold text-sm text-left",{"w-full h-full flex items-center":!Array.isArray(T.tagsCol)||!T.tagsCol.length}])},g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||x[Object.keys(x)[0]]||"Не вказано"),3),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,I=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:I.name},[x[I.name]?(g.openBlock(),g.createElementBlock("div",YA,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",$A,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"flex flex-wrap gap-1 mt-1"},[x[I.name]?(g.openBlock(),g.createElementBlock("span",ek,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",tk,[g.createElementVNode("div",rk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name},[g.createElementVNode("p",ik,g.toDisplayString(I.ua),1),g.createElementVNode("p",nk,[Array.isArray(x[I==null?void 0:I.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[I==null?void 0:I.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[I==null?void 0:I.name]||"Немає даних"),1)],64))])]))),128))])])])]),g.createElementVNode("a",{href:T.getItemLink(x),class:"ml-auto flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 hover:bg-accent hover:text-accent-foreground rounded-md h-7 w-7 p-0",style:{"min-width":"2.5rem"}},f[0]||(f[0]=[g.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-chevron-right h-4 w-4"},[g.createElementVNode("path",{d:"m9 18 6-6-6-6"})],-1)]),8,sk)])])}),128))])}const ak=Gt(ZA,[["render",ok]]),lk={name:"Template4",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{featuresCols(){return this.columns.filter(u=>u.meta==="features")},titleCol(){return this.columns.find(u=>u.meta==="title")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},ck={class:"flex flex-col space-y-1.5 p-6 pb-2"},uk={class:"flex items-center gap-2"},hk={class:"tracking-tight text-lg font-medium"},pk={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-blue-100 text-blue-800 ml-2","data-v0-t":"badge"},dk={key:1,class:"flex"},fk={key:0,class:"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold border-transparent bg-gray-100 text-gray-800"},mk={class:"p-6 pt-0 pb-4"},gk={class:"grid grid-cols-2 gap-4"},yk={class:"text-sm text-gray-500"},_k={class:"font-medium"},vk={class:"flex items-center p-6 pt-0"},xk=["href"];function bk(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"rounded-lg border bg-card text-card-foreground shadow-sm border-l-4 border-l-blue-600","data-v0-t":"card"},[g.createElementVNode("div",ck,[g.createElementVNode("div",uk,[g.createElementVNode("h3",hk,g.toDisplayString(x[`${(s=T.titleCol)==null?void 0:s.name}_text`]||x[(V=T.titleCol)==null?void 0:V.name]||Object.keys(x)[0]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,I=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:I.name},[x[I.name]?(g.openBlock(),g.createElementBlock("div",pk,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",dk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name,class:"flex flex-wrap gap-1 ml-2"},[x[I.name]?(g.openBlock(),g.createElementBlock("span",fk,g.toDisplayString(x[`${I.name}_text`]||x[I.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)])]),g.createElementVNode("div",mk,[g.createElementVNode("div",gk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,I=>(g.openBlock(),g.createElementBlock("div",{key:I.name},[g.createElementVNode("p",yk,g.toDisplayString(I.ua),1),g.createElementVNode("p",_k,[Array.isArray(x[I==null?void 0:I.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[I==null?void 0:I.name],(L,F)=>(g.openBlock(),g.createElementBlock("span",{key:F,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(L),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[I==null?void 0:I.name]||"Немає даних"),1)],64))])]))),128))])]),g.createElementVNode("div",vk,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 border bg-background h-10 px-4 py-2 rounded-md text-black border-black hover:bg-gray-100 hover:text-black"}," Детальніше ",8,xk)])])}),128)}const wk=Gt(lk,[["render",bk]]),Sk={name:"Template5",props:{items:Array,columns:Array,path:String,id_key:String,query_params:{type:Array,default:()=>[]}},computed:{imageCol(){return this.columns.find(u=>u.meta==="image")},descCol(){return this.columns.find(u=>u.meta==="desc")||this.columns.find(u=>u.name==="description")},categoryCol(){return this.columns?this.columns.filter(u=>u.meta==="category"):[]},tagsCol(){return this.columns?this.columns.filter(u=>u.meta==="tags"):[]},featuresCols(){return this.columns.filter(u=>u.meta==="features")},titleCol(){return this.columns.find(u=>u.meta==="title")}},methods:{getItemLink(u){if(!this.id_key||!u[this.id_key]){if(!this.query_params||!this.query_params.length)return this.path;const _=this.query_params.map(b=>{const k=Object.keys(b)[0],T=b[k];return`${k}=${encodeURIComponent(u[T])}`}).join("&");return`${this.path}?${_}`}if(!this.query_params||!this.query_params.length)return`${this.path}/${u[this.id_key]}`;const f=this.query_params.map(_=>{const b=Object.keys(_)[0],k=_[b];return`${b}=${encodeURIComponent(u[k])}`}).join("&");return`${this.path}/${u[this.id_key]}?${f}`}}},Ak={class:"grid grid-cols-12 divide-x divide-gray-100"},kk={key:0},Ck=["src"],Tk={key:1,class:"col-span-1 flex items-center justify-center"},Ek={class:"col-span-7 p-4"},Pk={class:"flex items-center mb-1 col-span-7 p-4"},Ik={class:"text-base font-bold text-gray-900 mr-2"},Mk={key:0,class:"inline-flex items-center rounded-full px-2.5 py-0.5 font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-primary/80 bg-blue-100 text-blue-800 border-0 text-xs ml-2"},Lk={class:"text-sm text-gray-600 line-clamp-1 mb-2"},Rk={class:"grid grid-cols-2 gap-x-4 gap-y-1 text-sm"},Bk={class:"text-gray-500 mr-1"},Dk=["innerHTML"],Vk={class:"text-gray-600 truncate"},zk={class:"col-span-2 p-3 bg-gray-50 flex flex-col justify-center"},Fk={class:"text-xs text-gray-500 mb-1.5"},Ok={key:0,class:"flex flex-wrap gap-1"},Nk={key:0,class:"inline-flex items-center rounded-full font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 hover:bg-secondary/80 bg-white border border-gray-200 text-gray-700 text-xs px-1.5 py-0"},qk={class:"col-span-2 flex flex-col justify-center items-center bg-gray-50 border-l p-2"},Uk={class:"w-full space-y-2"},jk=["href"];function Wk(u,f,_,b,k,T){return g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.items,x=>{var s,V,I,L,F;return g.openBlock(),g.createElementBlock("div",{key:x.id,class:"bg-white border border-gray-200 rounded-lg overflow-hidden transition-all duration-200 hover:shadow-md"},[g.createElementVNode("div",Ak,[T.imageCol?(g.openBlock(),g.createElementBlock("div",kk,[x[(s=T.imageCol)==null?void 0:s.name]?(g.openBlock(),g.createElementBlock("img",{key:0,src:x[(V=T.imageCol)==null?void 0:V.name],alt:"image",class:"object-cover h-full"},null,8,Ck)):g.createCommentVNode("",!0)])):(g.openBlock(),g.createElementBlock("div",Tk,f[0]||(f[0]=[g.createElementVNode("div",{class:"w-3 h-12 rounded-sm bg-blue-500",title:"Пріоритет: Високий","aria-hidden":"true"},null,-1)]))),g.createElementVNode("div",Ek,[g.createElementVNode("div",Pk,[g.createElementVNode("h3",Ik,g.toDisplayString(x[`${(I=T.titleCol)==null?void 0:I.name}_text`]||x[(L=T.titleCol)==null?void 0:L.name]||Object.keys(x)[0]||"Не вказано"),1),Array.isArray(T.categoryCol)&&T.categoryCol.length?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(T.categoryCol,M=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:M.name},[x[M.name]?(g.openBlock(),g.createElementBlock("div",Mk,g.toDisplayString(x[`${M.name}_text`]||x[M.name]),1)):g.createCommentVNode("",!0)],64))),128)):g.createCommentVNode("",!0)]),g.createElementVNode("p",Lk,g.toDisplayString(x[(F=T.descCol)==null?void 0:F.name]),1),g.createElementVNode("div",Rk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.featuresCols,M=>(g.openBlock(),g.createElementBlock("div",{key:M.name,class:"flex items-center"},[g.createElementVNode("span",Bk,g.toDisplayString((M==null?void 0:M.ua)||M.label||M.name)+":",1),M.icon?(g.openBlock(),g.createElementBlock("span",{key:0,class:"mr-1 flex-shrink-0",innerHTML:M.icon},null,8,Dk)):g.createCommentVNode("",!0),g.createElementVNode("span",Vk,[Array.isArray(x[M==null?void 0:M.name])?(g.openBlock(!0),g.createElementBlock(g.Fragment,{key:0},g.renderList(x[M==null?void 0:M.name],(E,C)=>(g.openBlock(),g.createElementBlock("span",{key:C,class:"bg-gray-200 px-1 py-0.5 rounded-lg mr-1"},g.toDisplayString(E),1))),128)):(g.openBlock(),g.createElementBlock(g.Fragment,{key:1},[g.createTextVNode(g.toDisplayString(x[M==null?void 0:M.name]||"Немає даних"),1)],64))])]))),128))])]),g.createElementVNode("div",zk,[g.createElementVNode("p",Fk," Теги: "+g.toDisplayString(T.tagsCol.length&&x[T.tagsCol[0].name]?"":"відсутні"),1),Array.isArray(T.tagsCol)&&T.tagsCol.length?(g.openBlock(),g.createElementBlock("div",Ok,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(T.tagsCol,M=>(g.openBlock(),g.createElementBlock("div",{key:M.name,class:"flex flex-wrap gap-1"},[x[M.name]?(g.openBlock(),g.createElementBlock("span",Nk,g.toDisplayString(x[`${M.name}_text`]||x[M.name]),1)):g.createCommentVNode("",!0)]))),128))])):g.createCommentVNode("",!0)]),g.createElementVNode("div",qk,[g.createElementVNode("div",Uk,[g.createElementVNode("a",{href:T.getItemLink(x),class:"inline-flex items-center justify-center gap-2 whitespace-nowrap font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 rounded-md px-3 w-full bg-blue-600 hover:bg-blue-700 text-white text-xs h-8"}," Детальніше ",8,jk)])])])])}),128)}const Hk=Gt(Sk,[["render",Wk]]),Zk={template1:PA,template2:HA,template3:ak,template4:wk,template5:Hk},Kk={name:"RegistryList",components:{HeroBlock:fA,...Zk},props:{title:{type:String,required:!0},description:{type:String,default:""},type:{type:String,default:"data"},items:{type:Array,default:()=>[]},total:{type:Number,default:0},filters:{type:Array,default:()=>null},emptyStateText:{type:String,default:"Немає даних"},breadcrumbs:{type:Array,default:()=>[]},dialog:{type:Boolean,default:!0},token:{type:String,default:""},table:{type:String,default:""},slug:{type:String,default:""},view:{type:String,default:""},path:{type:String,default:""},id_key:{type:String,default:""},columns:{type:Array,default:()=>[]},query_params:{type:Array,default:()=>[]}},data(){return{filterUrl:"",mounted:!1,tableData:[],currentPage:1,limit:16,localTotal:0}},created(){this.tableData=this.items,this.localTotal=this.total},mounted(){this.mounted=!0},methods:{handleFilterChange({url:u}){this.currentPage=1,this.filterUrl=u,this.getData()},handlePageChange(u){this.currentPage=u,this.getData()},changeLimit(u){this.limit=u,this.currentPage=1,this.getData()},async getData(){try{const u=this.type==="registry"?`/api/gis-registry/${this.slug}`:`/api/data/${this.table}`,{data:f}=await Ar.get(`${u}?filter=${this.filterUrl}&page=${this.currentPage}&limit=${this.limit}`);f&&(this.tableData=f==null?void 0:f.rows,this.localTotal=this.type==="registry"?f==null?void 0:f.total:f==null?void 0:f.filtered)}catch(u){console.error(u.message)}}}},Gk={class:"py-16 md:py-24"},Jk={class:"py-6"},Xk={class:"container"},Qk={key:0,class:"flex items-center text-sm text-muted-foreground mb-6"},Yk=["href"],$k={key:1,class:"text-foreground font-medium truncate"},eC={class:"flex flex-col md:flex-row gap-4 justify-start"},tC={class:"container"},rC={key:0,class:"space-y-4"},iC={class:"my-5 pr-2"},nC={class:"paginationWrapper relative flex justify-center"},sC={key:1,class:"text-center text-slate-400"};function oC(u,f,_,b,k,T){var I,L;const x=g.resolveComponent("HeroBlock"),s=g.resolveComponent("VsFilterList"),V=g.resolveComponent("VsPagination");return g.openBlock(),g.createElementBlock("div",Gk,[g.createElementVNode("section",null,[g.createVNode(x,{title:_.title,description:_.description},null,8,["title","description"])]),g.createElementVNode("section",Jk,[g.createElementVNode("div",Xk,[(I=_.breadcrumbs)!=null&&I.length?(g.openBlock(),g.createElementBlock("div",Qk,[(g.openBlock(!0),g.createElementBlock(g.Fragment,null,g.renderList(_.breadcrumbs,(F,M)=>(g.openBlock(),g.createElementBlock(g.Fragment,{key:M},[M<_.breadcrumbs.length-1?(g.openBlock(),g.createElementBlock(g.Fragment,{key:0},[g.createElementVNode("a",{href:F.link,class:"hover:text-foreground"},g.toDisplayString(F.name),9,Yk),f[0]||(f[0]=g.createElementVNode("span",{class:"mx-2"},"/",-1))],64)):(g.openBlock(),g.createElementBlock("span",$k,g.toDisplayString(F.name),1))],64))),128))])):g.createCommentVNode("",!0),g.createElementVNode("div",eC,[_.filters&&k.mounted?(g.openBlock(),g.createBlock(s,{key:0,ref:"filter",scheme:_.filters,isDialog:_.dialog,urlSeparator:"true",view:"plain",token:_.token,name:"filter",onFilterChange:T.handleFilterChange},{button:g.withCtx(()=>f[1]||(f[1]=[g.createElementVNode("button",{class:"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 border border-input bg-background hover:bg-accent hover:text-accent-foreground px-3 py-2",type:"button"}," Фільтри ",-1)])),_:1},8,["scheme","isDialog","token","onFilterChange"])):g.createCommentVNode("",!0)])])]),g.createElementVNode("section",null,[g.createElementVNode("div",tC,[((L=k.tableData)==null?void 0:L.length)>0?(g.openBlock(),g.createElementBlock("div",rC,[u.$slots.default?g.renderSlot(u.$slots,"default",{key:0,items:k.tableData}):_.view?(g.openBlock(),g.createBlock(g.resolveDynamicComponent(_.view),{key:1,items:k.tableData,path:_.path,id_key:_.id_key,columns:_.columns,query_params:_.query_params},null,8,["items","path","id_key","columns","query_params"])):g.createCommentVNode("",!0),g.createElementVNode("div",iC,[g.createElementVNode("div",nC,[g.createVNode(V,{total:k.localTotal,maxPages:4,defaultPage:k.currentPage,pageSize:k.limit,goTo:!1,size:"medium",backgroundColor:"#e5e7eb",borderedCellSelected:!0,pageSizes:[16,32,48,64],onPageChange:T.handlePageChange,onPageSizeChange:T.changeLimit},null,8,["total","defaultPage","pageSize","onPageChange","onPageSizeChange"])])])])):(g.openBlock(),g.createElementBlock("div",sC,g.toDisplayString(_.emptyStateText),1))])])])}const dy=Gt(Kk,[["render",oC]]),aC={class:"pt-[10px]"},lC={__name:"vs-editor-style-ace",props:{yamlValue:{type:null,default:()=>""}},setup(u){const f=u,_=g.ref(f.yamlValue);return(b,k)=>{const T=g.resolveComponent("VsFormAce");return g.openBlock(),g.createElementBlock("div",aC,[g.createVNode(T,{modelValue:_.value,"onUpdate:modelValue":k[0]||(k[0]=x=>_.value=x),value:_.value,fontSize:"12px"},null,8,["modelValue","value"])])}}},cC={components:{VsEditorStyleAce:lC},props:{data:Object,value:null,name:String},data(){var u,f,_;return{style:((_=(f=(u=this.data)==null?void 0:u.rows)==null?void 0:f[0])==null?void 0:_.style)||""}}};function uC(u,f,_,b,k,T){const x=g.resolveComponent("VsEditorStyleAce");return g.openBlock(),g.createBlock(x,{yamlValue:k.style,onChangeData:u.onChange,height:500,onUpdate:u.getData},null,8,["yamlValue","onChangeData","onUpdate"])}const hC=Gt(cC,[["render",uC]]);function pC(u){u.component("MapCustom",py),u.component("RegistryList",dy),u.component("vs-style-yml",hC)}const dC={MapCustom:py,RegistryList:dy,install:pC};module.exports=dC;
|