@mapcomponents/ra-geospatial 1.6.0 → 1.6.2

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.
@@ -767,7 +767,7 @@ uniform ${G} ${X} u_${Y};
767
767
  `),bt=nt.concat(yt.prelude.vertexSource,I.vertexSource,s.vertexSource).join(`
768
768
  `);ao(G)||(dt=(function(Bt){return Bt.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D(")})(dt),bt=(function(Bt){return Bt.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")})(bt));const rt=G.createShader(G.FRAGMENT_SHADER);if(G.isContextLost())return void(this.failedToCreate=!0);if(G.shaderSource(rt,dt),G.compileShader(rt),!G.getShaderParameter(rt,G.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${G.getShaderInfoLog(rt)}`);G.attachShader(this.program,rt);const At=G.createShader(G.VERTEX_SHADER);if(G.isContextLost())return void(this.failedToCreate=!0);if(G.shaderSource(At,bt),G.compileShader(At),!G.getShaderParameter(At,G.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${G.getShaderInfoLog(At)}`);G.attachShader(this.program,At),this.attributes={};const qt={};this.numAttributes=ie.length;for(let Bt=0;Bt<this.numAttributes;Bt++)ie[Bt]&&(G.bindAttribLocation(this.program,Bt,ie[Bt]),this.attributes[ie[Bt]]=Bt);if(G.linkProgram(this.program),!G.getProgramParameter(this.program,G.LINK_STATUS))throw new Error(`Program failed to link: ${G.getProgramInfoLog(this.program)}`);G.deleteShader(At),G.deleteShader(rt);for(let Bt=0;Bt<lt.length;Bt++){const zt=lt[Bt];if(zt&&!qt[zt]){const Vt=G.getUniformLocation(this.program,zt);Vt&&(qt[zt]=Vt)}}this.fixedUniforms=m(r,qt),this.terrainUniforms=((Bt,zt)=>({u_depth:new o.bO(Bt,zt.u_depth),u_terrain:new o.bO(Bt,zt.u_terrain),u_terrain_dim:new o.bf(Bt,zt.u_terrain_dim),u_terrain_matrix:new o.bQ(Bt,zt.u_terrain_matrix),u_terrain_unpack:new o.bR(Bt,zt.u_terrain_unpack),u_terrain_exaggeration:new o.bf(Bt,zt.u_terrain_exaggeration)}))(r,qt),this.projectionUniforms=((Bt,zt)=>({u_projection_matrix:new o.bQ(Bt,zt.u_projection_matrix),u_projection_tile_mercator_coords:new o.bR(Bt,zt.u_projection_tile_mercator_coords),u_projection_clipping_plane:new o.bR(Bt,zt.u_projection_clipping_plane),u_projection_transition:new o.bf(Bt,zt.u_projection_transition),u_projection_fallback_matrix:new o.bQ(Bt,zt.u_projection_fallback_matrix)}))(r,qt),this.binderUniforms=p?p.getUniforms(r,qt):[]}draw(r,s,p,m,b,T,I,R,j,G,X,Y,ie,be,Ue,je,qe,Ke,lt){const nt=r.gl;if(this.failedToCreate)return;if(r.program.set(this.program),r.setDepthMode(p),r.setStencilMode(m),r.setColorMode(b),r.setCullFace(T),R){r.activeTexture.set(nt.TEXTURE2),nt.bindTexture(nt.TEXTURE_2D,R.depthTexture),r.activeTexture.set(nt.TEXTURE3),nt.bindTexture(nt.TEXTURE_2D,R.texture);for(const bt in this.terrainUniforms)this.terrainUniforms[bt].set(R[bt])}if(j)for(const bt in j)this.projectionUniforms[El[bt]].set(j[bt]);if(I)for(const bt in this.fixedUniforms)this.fixedUniforms[bt].set(I[bt]);je&&je.setUniforms(r,this.binderUniforms,be,{zoom:Ue});let dt=0;switch(s){case nt.LINES:dt=2;break;case nt.TRIANGLES:dt=3;break;case nt.LINE_STRIP:dt=1}for(const bt of ie.get()){const rt=bt.vaos||(bt.vaos={});(rt[G]||(rt[G]=new Sl)).bind(r,this,X,je?je.getPaintVertexBuffers():[],Y,bt.vertexOffset,qe,Ke,lt),nt.drawElements(s,bt.primitiveLength*dt,nt.UNSIGNED_SHORT,bt.primitiveOffset*dt*2)}}}function Us(_,r,s){const p=1/o.aB(s,1,r.transform.tileZoom),m=Math.pow(2,s.tileID.overscaledZ),b=s.tileSize*Math.pow(2,r.transform.tileZoom)/m,T=b*(s.tileID.canonical.x+s.tileID.wrap*m),I=b*s.tileID.canonical.y;return{u_image:0,u_texsize:s.imageAtlasTexture.size,u_scale:[p,_.fromScale,_.toScale],u_fade:_.t,u_pixel_coord_upper:[T>>16,I>>16],u_pixel_coord_lower:[65535&T,65535&I]}}const La=(_,r,s,p)=>{const m=_.style.light,b=m.properties.get("position"),T=[b.x,b.y,b.z],I=o.bU();m.properties.get("anchor")==="viewport"&&o.bV(I,_.transform.bearingInRadians),o.bW(T,T,I);const R=_.transform.transformLightDirection(T),j=m.properties.get("color");return{u_lightpos:T,u_lightpos_globe:R,u_lightintensity:m.properties.get("intensity"),u_lightcolor:[j.r,j.g,j.b],u_vertical_gradient:+r,u_opacity:s,u_fill_translate:p}},Xi=(_,r,s,p,m,b,T)=>o.e(La(_,r,s,p),Us(b,_,T),{u_height_factor:-Math.pow(2,m.overscaledZ)/T.tileSize/8}),Lo=(_,r,s,p)=>o.e(Us(r,_,s),{u_fill_translate:p}),Ai=(_,r)=>({u_world:_,u_fill_translate:r}),$a=(_,r,s,p,m)=>o.e(Lo(_,r,s,m),{u_world:p}),xs=(_,r,s,p,m)=>{const b=_.transform;let T,I,R=0;if(s.paint.get("circle-pitch-alignment")==="map"){const j=o.aB(r,1,b.zoom);T=!0,I=[j,j],R=j/(o.$*Math.pow(2,r.tileID.overscaledZ))*2*Math.PI*m}else T=!1,I=b.pixelsToGLUnits;return{u_camera_to_center_distance:b.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+T,u_device_pixel_ratio:_.pixelRatio,u_extrude_scale:I,u_globe_extrude_scale:R,u_translate:p}},Pi=_=>({u_pixel_extrude_scale:[1/_.width,1/_.height]}),tl=_=>({u_viewport_size:[_.width,_.height]}),ws=(_,r=1)=>({u_color:_,u_overlay:0,u_overlay_scale:r}),Va=(_,r,s,p)=>{const m=o.aB(_,1,r)/(o.$*Math.pow(2,_.tileID.overscaledZ))*2*Math.PI*p;return{u_extrude_scale:o.aB(_,1,r),u_intensity:s,u_globe_extrude_scale:m}},so=(_,r,s,p)=>{const m=o.L();o.bX(m,0,_.width,_.height,0,0,1);const b=_.context.gl;return{u_matrix:m,u_world:[b.drawingBufferWidth,b.drawingBufferHeight],u_image:s,u_color_ramp:p,u_opacity:r.paint.get("heatmap-opacity")}},Do=(_,r,s)=>{const p=s.paint.get("hillshade-accent-color");let m;switch(s.paint.get("hillshade-method")){case"basic":m=4;break;case"combined":m=1;break;case"igor":m=2;break;case"multidirectional":m=3;break;default:m=0}const b=s.getIlluminationProperties();for(let T=0;T<b.directionRadians.length;T++)s.paint.get("hillshade-illumination-anchor")==="viewport"&&(b.directionRadians[T]+=_.transform.bearingInRadians);return{u_image:0,u_latrange:Gl(0,r.tileID),u_exaggeration:s.paint.get("hillshade-exaggeration"),u_altitudes:b.altitudeRadians,u_azimuths:b.directionRadians,u_accent:p,u_method:m,u_highlights:b.highlightColor,u_shadows:b.shadowColor}},iu=(_,r)=>{const s=r.stride,p=o.L();return o.bX(p,0,o.$,-8192,0,0,1),o.M(p,p,[0,-8192,0]),{u_matrix:p,u_image:1,u_dimension:[s,s],u_zoom:_.overscaledZ,u_unpack:r.getUnpackVector()}};function Gl(_,r){const s=Math.pow(2,r.canonical.z),p=r.canonical.y;return[new o.a0(0,p/s).toLngLat().lat,new o.a0(0,(p+1)/s).toLngLat().lat]}const qs=(_,r)=>({u_image:0,u_unpack:r.getUnpackVector(),u_dimension:[r.stride,r.stride],u_elevation_stops:1,u_color_stops:4,u_opacity:_.paint.get("color-relief-opacity")}),Ss=(_,r,s,p)=>{const m=_.transform;return{u_translation:Es(_,r,s),u_ratio:p/o.aB(r,1,m.zoom),u_device_pixel_ratio:_.pixelRatio,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},xo=(_,r,s,p,m)=>o.e(Ss(_,r,s,p),{u_image:0,u_image_height:m}),mo=(_,r,s,p,m)=>{const b=_.transform,T=wo(r,b);return{u_translation:Es(_,r,s),u_texsize:r.imageAtlasTexture.size,u_ratio:p/o.aB(r,1,b.zoom),u_device_pixel_ratio:_.pixelRatio,u_image:0,u_scale:[T,m.fromScale,m.toScale],u_fade:m.t,u_units_to_pixels:[1/b.pixelsToGLUnits[0],1/b.pixelsToGLUnits[1]]}},rl=(_,r,s,p,m,b)=>{const T=_.lineAtlas,I=wo(r,_.transform),R=s.layout.get("line-cap")==="round",j=T.getDash(m.from,R),G=T.getDash(m.to,R),X=j.width*b.fromScale,Y=G.width*b.toScale;return o.e(Ss(_,r,s,p),{u_patternscale_a:[I/X,-j.height/2],u_patternscale_b:[I/Y,-G.height/2],u_sdfgamma:T.width/(256*Math.min(X,Y)*_.pixelRatio)/2,u_image:0,u_tex_y_a:j.y,u_tex_y_b:G.y,u_mix:b.t})};function wo(_,r){return 1/o.aB(_,1,r.tileZoom)}function Es(_,r,s){return o.aC(_.transform,r,s.paint.get("line-translate"),s.paint.get("line-translate-anchor"))}const Uo=(_,r,s,p,m)=>{return{u_tl_parent:_,u_scale_parent:r,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(T=p.paint.get("raster-saturation"),T>0?1-1/(1.001-T):-T),u_contrast_factor:(b=p.paint.get("raster-contrast"),b>0?1/(1-b):1+b),u_spin_weights:Ts(p.paint.get("raster-hue-rotate")),u_coords_top:[m[0].x,m[0].y,m[1].x,m[1].y],u_coords_bottom:[m[3].x,m[3].y,m[2].x,m[2].y]};var b,T};function Ts(_){_*=Math.PI/180;const r=Math.sin(_),s=Math.cos(_);return[(2*s+1)/3,(-Math.sqrt(3)*r-s+1)/3,(Math.sqrt(3)*r-s+1)/3]}const $i=(_,r,s,p,m,b,T,I,R,j,G,X,Y)=>{const ie=T.transform;return{u_is_size_zoom_constant:+(_==="constant"||_==="source"),u_is_size_feature_constant:+(_==="constant"||_==="camera"),u_size_t:r?r.uSizeT:0,u_size:r?r.uSize:0,u_camera_to_center_distance:ie.cameraToCenterDistance,u_pitch:ie.pitch/360*2*Math.PI,u_rotate_symbol:+s,u_aspect_ratio:ie.width/ie.height,u_fade_change:T.options.fadeDuration?T.symbolFadeChange:1,u_label_plane_matrix:I,u_coord_matrix:R,u_is_text:+G,u_pitch_with_map:+p,u_is_along_line:m,u_is_variable_anchor:b,u_texsize:X,u_texture:0,u_translation:j,u_pitched_scale:Y}},ns=(_,r,s,p,m,b,T,I,R,j,G,X,Y,ie)=>{const be=T.transform;return o.e($i(_,r,s,p,m,b,T,I,R,j,G,X,ie),{u_gamma_scale:p?Math.cos(be.pitch*Math.PI/180)*be.cameraToCenterDistance:1,u_device_pixel_ratio:T.pixelRatio,u_is_halo:1})},Ga=(_,r,s,p,m,b,T,I,R,j,G,X,Y)=>o.e(ns(_,r,s,p,m,b,T,I,R,j,!0,G,0,Y),{u_texsize_icon:X,u_texture_icon:1}),ga=(_,r)=>({u_opacity:_,u_color:r}),Tl=(_,r,s,p,m)=>o.e((function(b,T,I,R){const j=I.imageManager.getPattern(b.from.toString()),G=I.imageManager.getPattern(b.to.toString()),{width:X,height:Y}=I.imageManager.getPixelSize(),ie=Math.pow(2,R.tileID.overscaledZ),be=R.tileSize*Math.pow(2,I.transform.tileZoom)/ie,Ue=be*(R.tileID.canonical.x+R.tileID.wrap*ie),je=be*R.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:j.tl,u_pattern_br_a:j.br,u_pattern_tl_b:G.tl,u_pattern_br_b:G.br,u_texsize:[X,Y],u_mix:T.t,u_pattern_size_a:j.displaySize,u_pattern_size_b:G.displaySize,u_scale_a:T.fromScale,u_scale_b:T.toScale,u_tile_units_to_pixels:1/o.aB(R,1,I.transform.tileZoom),u_pixel_coord_upper:[Ue>>16,je>>16],u_pixel_coord_lower:[65535&Ue,65535&je]}})(s,m,r,p),{u_opacity:_}),Cl=(_,r)=>{},is={fillExtrusion:(_,r)=>({u_lightpos:new o.bS(_,r.u_lightpos),u_lightpos_globe:new o.bS(_,r.u_lightpos_globe),u_lightintensity:new o.bf(_,r.u_lightintensity),u_lightcolor:new o.bS(_,r.u_lightcolor),u_vertical_gradient:new o.bf(_,r.u_vertical_gradient),u_opacity:new o.bf(_,r.u_opacity),u_fill_translate:new o.bT(_,r.u_fill_translate)}),fillExtrusionPattern:(_,r)=>({u_lightpos:new o.bS(_,r.u_lightpos),u_lightpos_globe:new o.bS(_,r.u_lightpos_globe),u_lightintensity:new o.bf(_,r.u_lightintensity),u_lightcolor:new o.bS(_,r.u_lightcolor),u_vertical_gradient:new o.bf(_,r.u_vertical_gradient),u_height_factor:new o.bf(_,r.u_height_factor),u_opacity:new o.bf(_,r.u_opacity),u_fill_translate:new o.bT(_,r.u_fill_translate),u_image:new o.bO(_,r.u_image),u_texsize:new o.bT(_,r.u_texsize),u_pixel_coord_upper:new o.bT(_,r.u_pixel_coord_upper),u_pixel_coord_lower:new o.bT(_,r.u_pixel_coord_lower),u_scale:new o.bS(_,r.u_scale),u_fade:new o.bf(_,r.u_fade)}),fill:(_,r)=>({u_fill_translate:new o.bT(_,r.u_fill_translate)}),fillPattern:(_,r)=>({u_image:new o.bO(_,r.u_image),u_texsize:new o.bT(_,r.u_texsize),u_pixel_coord_upper:new o.bT(_,r.u_pixel_coord_upper),u_pixel_coord_lower:new o.bT(_,r.u_pixel_coord_lower),u_scale:new o.bS(_,r.u_scale),u_fade:new o.bf(_,r.u_fade),u_fill_translate:new o.bT(_,r.u_fill_translate)}),fillOutline:(_,r)=>({u_world:new o.bT(_,r.u_world),u_fill_translate:new o.bT(_,r.u_fill_translate)}),fillOutlinePattern:(_,r)=>({u_world:new o.bT(_,r.u_world),u_image:new o.bO(_,r.u_image),u_texsize:new o.bT(_,r.u_texsize),u_pixel_coord_upper:new o.bT(_,r.u_pixel_coord_upper),u_pixel_coord_lower:new o.bT(_,r.u_pixel_coord_lower),u_scale:new o.bS(_,r.u_scale),u_fade:new o.bf(_,r.u_fade),u_fill_translate:new o.bT(_,r.u_fill_translate)}),circle:(_,r)=>({u_camera_to_center_distance:new o.bf(_,r.u_camera_to_center_distance),u_scale_with_map:new o.bO(_,r.u_scale_with_map),u_pitch_with_map:new o.bO(_,r.u_pitch_with_map),u_extrude_scale:new o.bT(_,r.u_extrude_scale),u_device_pixel_ratio:new o.bf(_,r.u_device_pixel_ratio),u_globe_extrude_scale:new o.bf(_,r.u_globe_extrude_scale),u_translate:new o.bT(_,r.u_translate)}),collisionBox:(_,r)=>({u_pixel_extrude_scale:new o.bT(_,r.u_pixel_extrude_scale)}),collisionCircle:(_,r)=>({u_viewport_size:new o.bT(_,r.u_viewport_size)}),debug:(_,r)=>({u_color:new o.bP(_,r.u_color),u_overlay:new o.bO(_,r.u_overlay),u_overlay_scale:new o.bf(_,r.u_overlay_scale)}),depth:Cl,clippingMask:Cl,heatmap:(_,r)=>({u_extrude_scale:new o.bf(_,r.u_extrude_scale),u_intensity:new o.bf(_,r.u_intensity),u_globe_extrude_scale:new o.bf(_,r.u_globe_extrude_scale)}),heatmapTexture:(_,r)=>({u_matrix:new o.bQ(_,r.u_matrix),u_world:new o.bT(_,r.u_world),u_image:new o.bO(_,r.u_image),u_color_ramp:new o.bO(_,r.u_color_ramp),u_opacity:new o.bf(_,r.u_opacity)}),hillshade:(_,r)=>({u_image:new o.bO(_,r.u_image),u_latrange:new o.bT(_,r.u_latrange),u_exaggeration:new o.bf(_,r.u_exaggeration),u_altitudes:new o.bZ(_,r.u_altitudes),u_azimuths:new o.bZ(_,r.u_azimuths),u_accent:new o.bP(_,r.u_accent),u_method:new o.bO(_,r.u_method),u_shadows:new o.bY(_,r.u_shadows),u_highlights:new o.bY(_,r.u_highlights)}),hillshadePrepare:(_,r)=>({u_matrix:new o.bQ(_,r.u_matrix),u_image:new o.bO(_,r.u_image),u_dimension:new o.bT(_,r.u_dimension),u_zoom:new o.bf(_,r.u_zoom),u_unpack:new o.bR(_,r.u_unpack)}),colorRelief:(_,r)=>({u_image:new o.bO(_,r.u_image),u_unpack:new o.bR(_,r.u_unpack),u_dimension:new o.bT(_,r.u_dimension),u_elevation_stops:new o.bO(_,r.u_elevation_stops),u_color_stops:new o.bO(_,r.u_color_stops),u_opacity:new o.bf(_,r.u_opacity)}),line:(_,r)=>({u_translation:new o.bT(_,r.u_translation),u_ratio:new o.bf(_,r.u_ratio),u_device_pixel_ratio:new o.bf(_,r.u_device_pixel_ratio),u_units_to_pixels:new o.bT(_,r.u_units_to_pixels)}),lineGradient:(_,r)=>({u_translation:new o.bT(_,r.u_translation),u_ratio:new o.bf(_,r.u_ratio),u_device_pixel_ratio:new o.bf(_,r.u_device_pixel_ratio),u_units_to_pixels:new o.bT(_,r.u_units_to_pixels),u_image:new o.bO(_,r.u_image),u_image_height:new o.bf(_,r.u_image_height)}),linePattern:(_,r)=>({u_translation:new o.bT(_,r.u_translation),u_texsize:new o.bT(_,r.u_texsize),u_ratio:new o.bf(_,r.u_ratio),u_device_pixel_ratio:new o.bf(_,r.u_device_pixel_ratio),u_image:new o.bO(_,r.u_image),u_units_to_pixels:new o.bT(_,r.u_units_to_pixels),u_scale:new o.bS(_,r.u_scale),u_fade:new o.bf(_,r.u_fade)}),lineSDF:(_,r)=>({u_translation:new o.bT(_,r.u_translation),u_ratio:new o.bf(_,r.u_ratio),u_device_pixel_ratio:new o.bf(_,r.u_device_pixel_ratio),u_units_to_pixels:new o.bT(_,r.u_units_to_pixels),u_patternscale_a:new o.bT(_,r.u_patternscale_a),u_patternscale_b:new o.bT(_,r.u_patternscale_b),u_sdfgamma:new o.bf(_,r.u_sdfgamma),u_image:new o.bO(_,r.u_image),u_tex_y_a:new o.bf(_,r.u_tex_y_a),u_tex_y_b:new o.bf(_,r.u_tex_y_b),u_mix:new o.bf(_,r.u_mix)}),raster:(_,r)=>({u_tl_parent:new o.bT(_,r.u_tl_parent),u_scale_parent:new o.bf(_,r.u_scale_parent),u_buffer_scale:new o.bf(_,r.u_buffer_scale),u_fade_t:new o.bf(_,r.u_fade_t),u_opacity:new o.bf(_,r.u_opacity),u_image0:new o.bO(_,r.u_image0),u_image1:new o.bO(_,r.u_image1),u_brightness_low:new o.bf(_,r.u_brightness_low),u_brightness_high:new o.bf(_,r.u_brightness_high),u_saturation_factor:new o.bf(_,r.u_saturation_factor),u_contrast_factor:new o.bf(_,r.u_contrast_factor),u_spin_weights:new o.bS(_,r.u_spin_weights),u_coords_top:new o.bR(_,r.u_coords_top),u_coords_bottom:new o.bR(_,r.u_coords_bottom)}),symbolIcon:(_,r)=>({u_is_size_zoom_constant:new o.bO(_,r.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bO(_,r.u_is_size_feature_constant),u_size_t:new o.bf(_,r.u_size_t),u_size:new o.bf(_,r.u_size),u_camera_to_center_distance:new o.bf(_,r.u_camera_to_center_distance),u_pitch:new o.bf(_,r.u_pitch),u_rotate_symbol:new o.bO(_,r.u_rotate_symbol),u_aspect_ratio:new o.bf(_,r.u_aspect_ratio),u_fade_change:new o.bf(_,r.u_fade_change),u_label_plane_matrix:new o.bQ(_,r.u_label_plane_matrix),u_coord_matrix:new o.bQ(_,r.u_coord_matrix),u_is_text:new o.bO(_,r.u_is_text),u_pitch_with_map:new o.bO(_,r.u_pitch_with_map),u_is_along_line:new o.bO(_,r.u_is_along_line),u_is_variable_anchor:new o.bO(_,r.u_is_variable_anchor),u_texsize:new o.bT(_,r.u_texsize),u_texture:new o.bO(_,r.u_texture),u_translation:new o.bT(_,r.u_translation),u_pitched_scale:new o.bf(_,r.u_pitched_scale)}),symbolSDF:(_,r)=>({u_is_size_zoom_constant:new o.bO(_,r.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bO(_,r.u_is_size_feature_constant),u_size_t:new o.bf(_,r.u_size_t),u_size:new o.bf(_,r.u_size),u_camera_to_center_distance:new o.bf(_,r.u_camera_to_center_distance),u_pitch:new o.bf(_,r.u_pitch),u_rotate_symbol:new o.bO(_,r.u_rotate_symbol),u_aspect_ratio:new o.bf(_,r.u_aspect_ratio),u_fade_change:new o.bf(_,r.u_fade_change),u_label_plane_matrix:new o.bQ(_,r.u_label_plane_matrix),u_coord_matrix:new o.bQ(_,r.u_coord_matrix),u_is_text:new o.bO(_,r.u_is_text),u_pitch_with_map:new o.bO(_,r.u_pitch_with_map),u_is_along_line:new o.bO(_,r.u_is_along_line),u_is_variable_anchor:new o.bO(_,r.u_is_variable_anchor),u_texsize:new o.bT(_,r.u_texsize),u_texture:new o.bO(_,r.u_texture),u_gamma_scale:new o.bf(_,r.u_gamma_scale),u_device_pixel_ratio:new o.bf(_,r.u_device_pixel_ratio),u_is_halo:new o.bO(_,r.u_is_halo),u_translation:new o.bT(_,r.u_translation),u_pitched_scale:new o.bf(_,r.u_pitched_scale)}),symbolTextAndIcon:(_,r)=>({u_is_size_zoom_constant:new o.bO(_,r.u_is_size_zoom_constant),u_is_size_feature_constant:new o.bO(_,r.u_is_size_feature_constant),u_size_t:new o.bf(_,r.u_size_t),u_size:new o.bf(_,r.u_size),u_camera_to_center_distance:new o.bf(_,r.u_camera_to_center_distance),u_pitch:new o.bf(_,r.u_pitch),u_rotate_symbol:new o.bO(_,r.u_rotate_symbol),u_aspect_ratio:new o.bf(_,r.u_aspect_ratio),u_fade_change:new o.bf(_,r.u_fade_change),u_label_plane_matrix:new o.bQ(_,r.u_label_plane_matrix),u_coord_matrix:new o.bQ(_,r.u_coord_matrix),u_is_text:new o.bO(_,r.u_is_text),u_pitch_with_map:new o.bO(_,r.u_pitch_with_map),u_is_along_line:new o.bO(_,r.u_is_along_line),u_is_variable_anchor:new o.bO(_,r.u_is_variable_anchor),u_texsize:new o.bT(_,r.u_texsize),u_texsize_icon:new o.bT(_,r.u_texsize_icon),u_texture:new o.bO(_,r.u_texture),u_texture_icon:new o.bO(_,r.u_texture_icon),u_gamma_scale:new o.bf(_,r.u_gamma_scale),u_device_pixel_ratio:new o.bf(_,r.u_device_pixel_ratio),u_is_halo:new o.bO(_,r.u_is_halo),u_translation:new o.bT(_,r.u_translation),u_pitched_scale:new o.bf(_,r.u_pitched_scale)}),background:(_,r)=>({u_opacity:new o.bf(_,r.u_opacity),u_color:new o.bP(_,r.u_color)}),backgroundPattern:(_,r)=>({u_opacity:new o.bf(_,r.u_opacity),u_image:new o.bO(_,r.u_image),u_pattern_tl_a:new o.bT(_,r.u_pattern_tl_a),u_pattern_br_a:new o.bT(_,r.u_pattern_br_a),u_pattern_tl_b:new o.bT(_,r.u_pattern_tl_b),u_pattern_br_b:new o.bT(_,r.u_pattern_br_b),u_texsize:new o.bT(_,r.u_texsize),u_mix:new o.bf(_,r.u_mix),u_pattern_size_a:new o.bT(_,r.u_pattern_size_a),u_pattern_size_b:new o.bT(_,r.u_pattern_size_b),u_scale_a:new o.bf(_,r.u_scale_a),u_scale_b:new o.bf(_,r.u_scale_b),u_pixel_coord_upper:new o.bT(_,r.u_pixel_coord_upper),u_pixel_coord_lower:new o.bT(_,r.u_pixel_coord_lower),u_tile_units_to_pixels:new o.bf(_,r.u_tile_units_to_pixels)}),terrain:(_,r)=>({u_texture:new o.bO(_,r.u_texture),u_ele_delta:new o.bf(_,r.u_ele_delta),u_fog_matrix:new o.bQ(_,r.u_fog_matrix),u_fog_color:new o.bP(_,r.u_fog_color),u_fog_ground_blend:new o.bf(_,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new o.bf(_,r.u_fog_ground_blend_opacity),u_horizon_color:new o.bP(_,r.u_horizon_color),u_horizon_fog_blend:new o.bf(_,r.u_horizon_fog_blend),u_is_globe_mode:new o.bf(_,r.u_is_globe_mode)}),terrainDepth:(_,r)=>({u_ele_delta:new o.bf(_,r.u_ele_delta)}),terrainCoords:(_,r)=>({u_texture:new o.bO(_,r.u_texture),u_terrain_coords_id:new o.bf(_,r.u_terrain_coords_id),u_ele_delta:new o.bf(_,r.u_ele_delta)}),projectionErrorMeasurement:(_,r)=>({u_input:new o.bf(_,r.u_input),u_output_expected:new o.bf(_,r.u_output_expected)}),atmosphere:(_,r)=>({u_sun_pos:new o.bS(_,r.u_sun_pos),u_atmosphere_blend:new o.bf(_,r.u_atmosphere_blend),u_globe_position:new o.bS(_,r.u_globe_position),u_globe_radius:new o.bf(_,r.u_globe_radius),u_inv_proj_matrix:new o.bQ(_,r.u_inv_proj_matrix)}),sky:(_,r)=>({u_sky_color:new o.bP(_,r.u_sky_color),u_horizon_color:new o.bP(_,r.u_horizon_color),u_horizon:new o.bT(_,r.u_horizon),u_horizon_normal:new o.bT(_,r.u_horizon_normal),u_sky_horizon_blend:new o.bf(_,r.u_sky_horizon_blend),u_sky_blend:new o.bf(_,r.u_sky_blend)})};class nl{constructor(r,s,p){this.context=r;const m=r.gl;this.buffer=m.createBuffer(),this.dynamicDraw=!!p,this.context.unbindVAO(),r.bindElementBuffer.set(this.buffer),m.bufferData(m.ELEMENT_ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(r){const s=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),s.bufferSubData(s.ELEMENT_ARRAY_BUFFER,0,r.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const il={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Mt{constructor(r,s,p,m){this.length=s.length,this.attributes=p,this.itemSize=s.bytesPerElement,this.dynamicDraw=m,this.context=r;const b=r.gl;this.buffer=b.createBuffer(),r.bindVertexBuffer.set(this.buffer),b.bufferData(b.ARRAY_BUFFER,s.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete s.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(r){if(r.length!==this.length)throw new Error(`Length of new data is ${r.length}, which doesn't match current length of ${this.length}`);const s=this.context.gl;this.bind(),s.bufferSubData(s.ARRAY_BUFFER,0,r.arrayBuffer)}enableAttributes(r,s){for(let p=0;p<this.attributes.length;p++){const m=s.attributes[this.attributes[p].name];m!==void 0&&r.enableVertexAttribArray(m)}}setVertexAttribPointers(r,s,p){for(let m=0;m<this.attributes.length;m++){const b=this.attributes[m],T=s.attributes[b.name];T!==void 0&&r.vertexAttribPointer(T,b.components,r[il[b.type]],!1,this.itemSize,b.offset+this.itemSize*(p||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Nt{constructor(r){this.gl=r.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(r){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Rr extends Nt{getDefault(){return o.be.transparent}set(r){const s=this.current;(r.r!==s.r||r.g!==s.g||r.b!==s.b||r.a!==s.a||this.dirty)&&(this.gl.clearColor(r.r,r.g,r.b,r.a),this.current=r,this.dirty=!1)}}class Hr extends Nt{getDefault(){return 1}set(r){(r!==this.current||this.dirty)&&(this.gl.clearDepth(r),this.current=r,this.dirty=!1)}}class Vn extends Nt{getDefault(){return 0}set(r){(r!==this.current||this.dirty)&&(this.gl.clearStencil(r),this.current=r,this.dirty=!1)}}class on extends Nt{getDefault(){return[!0,!0,!0,!0]}set(r){const s=this.current;(r[0]!==s[0]||r[1]!==s[1]||r[2]!==s[2]||r[3]!==s[3]||this.dirty)&&(this.gl.colorMask(r[0],r[1],r[2],r[3]),this.current=r,this.dirty=!1)}}class In extends Nt{getDefault(){return!0}set(r){(r!==this.current||this.dirty)&&(this.gl.depthMask(r),this.current=r,this.dirty=!1)}}class Bn extends Nt{getDefault(){return 255}set(r){(r!==this.current||this.dirty)&&(this.gl.stencilMask(r),this.current=r,this.dirty=!1)}}class si extends Nt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(r){const s=this.current;(r.func!==s.func||r.ref!==s.ref||r.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(r.func,r.ref,r.mask),this.current=r,this.dirty=!1)}}class li extends Nt{getDefault(){const r=this.gl;return[r.KEEP,r.KEEP,r.KEEP]}set(r){const s=this.current;(r[0]!==s[0]||r[1]!==s[1]||r[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(r[0],r[1],r[2]),this.current=r,this.dirty=!1)}}class Ii extends Nt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;r?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=r,this.dirty=!1}}class So extends Nt{getDefault(){return[0,1]}set(r){const s=this.current;(r[0]!==s[0]||r[1]!==s[1]||this.dirty)&&(this.gl.depthRange(r[0],r[1]),this.current=r,this.dirty=!1)}}class Da extends Nt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;r?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=r,this.dirty=!1}}class Xo extends Nt{getDefault(){return this.gl.LESS}set(r){(r!==this.current||this.dirty)&&(this.gl.depthFunc(r),this.current=r,this.dirty=!1)}}class Cs extends Nt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;r?s.enable(s.BLEND):s.disable(s.BLEND),this.current=r,this.dirty=!1}}class ol extends Nt{getDefault(){const r=this.gl;return[r.ONE,r.ZERO]}set(r){const s=this.current;(r[0]!==s[0]||r[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(r[0],r[1]),this.current=r,this.dirty=!1)}}class ou extends Nt{getDefault(){return o.be.transparent}set(r){const s=this.current;(r.r!==s.r||r.g!==s.g||r.b!==s.b||r.a!==s.a||this.dirty)&&(this.gl.blendColor(r.r,r.g,r.b,r.a),this.current=r,this.dirty=!1)}}class al extends Nt{getDefault(){return this.gl.FUNC_ADD}set(r){(r!==this.current||this.dirty)&&(this.gl.blendEquation(r),this.current=r,this.dirty=!1)}}class $s extends Nt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;r?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=r,this.dirty=!1}}class Hl extends Nt{getDefault(){return this.gl.BACK}set(r){(r!==this.current||this.dirty)&&(this.gl.cullFace(r),this.current=r,this.dirty=!1)}}class au extends Nt{getDefault(){return this.gl.CCW}set(r){(r!==this.current||this.dirty)&&(this.gl.frontFace(r),this.current=r,this.dirty=!1)}}class Pu extends Nt{getDefault(){return null}set(r){(r!==this.current||this.dirty)&&(this.gl.useProgram(r),this.current=r,this.dirty=!1)}}class ri extends Nt{getDefault(){return this.gl.TEXTURE0}set(r){(r!==this.current||this.dirty)&&(this.gl.activeTexture(r),this.current=r,this.dirty=!1)}}class ni extends Nt{getDefault(){const r=this.gl;return[0,0,r.drawingBufferWidth,r.drawingBufferHeight]}set(r){const s=this.current;(r[0]!==s[0]||r[1]!==s[1]||r[2]!==s[2]||r[3]!==s[3]||this.dirty)&&(this.gl.viewport(r[0],r[1],r[2],r[3]),this.current=r,this.dirty=!1)}}class As extends Nt{getDefault(){return null}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,r),this.current=r,this.dirty=!1}}class Vi extends Nt{getDefault(){return null}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,r),this.current=r,this.dirty=!1}}class su extends Nt{getDefault(){return null}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;s.bindTexture(s.TEXTURE_2D,r),this.current=r,this.dirty=!1}}class ya extends Nt{getDefault(){return null}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,r),this.current=r,this.dirty=!1}}class Ha extends Nt{getDefault(){return null}set(r){const s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,r),this.current=r,this.dirty=!1}}class oa extends Nt{getDefault(){return null}set(r){var s;if(r===this.current&&!this.dirty)return;const p=this.gl;ao(p)?p.bindVertexArray(r):(s=p.getExtension("OES_vertex_array_object"))===null||s===void 0||s.bindVertexArrayOES(r),this.current=r,this.dirty=!1}}class Vs extends Nt{getDefault(){return 4}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,r),this.current=r,this.dirty=!1}}class sl extends Nt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r),this.current=r,this.dirty=!1}}class os extends Nt{getDefault(){return!1}set(r){if(r===this.current&&!this.dirty)return;const s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,r),this.current=r,this.dirty=!1}}class ka extends Nt{constructor(r,s){super(r),this.context=r,this.parent=s}getDefault(){return null}}class lu extends ka{setDirty(){this.dirty=!0}set(r){if(r===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,r,0),this.current=r,this.dirty=!1}}class Wa extends ka{set(r){if(r===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,r),this.current=r,this.dirty=!1}}class go extends ka{set(r){if(r===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_STENCIL_ATTACHMENT,s.RENDERBUFFER,r),this.current=r,this.dirty=!1}}const qo="Framebuffer is not complete";class Gs{constructor(r,s,p,m,b){this.context=r,this.width=s,this.height=p;const T=r.gl,I=this.framebuffer=T.createFramebuffer();if(this.colorAttachment=new lu(r,I),m)this.depthAttachment=b?new go(r,I):new Wa(r,I);else if(b)throw new Error("Stencil cannot be set without depth");if(T.checkFramebufferStatus(T.FRAMEBUFFER)!==T.FRAMEBUFFER_COMPLETE)throw new Error(qo)}destroy(){const r=this.context.gl,s=this.colorAttachment.get();if(s&&r.deleteTexture(s),this.depthAttachment){const p=this.depthAttachment.get();p&&r.deleteRenderbuffer(p)}r.deleteFramebuffer(this.framebuffer)}}class Dn{constructor(r){var s,p;if(this.gl=r,this.clearColor=new Rr(this),this.clearDepth=new Hr(this),this.clearStencil=new Vn(this),this.colorMask=new on(this),this.depthMask=new In(this),this.stencilMask=new Bn(this),this.stencilFunc=new si(this),this.stencilOp=new li(this),this.stencilTest=new Ii(this),this.depthRange=new So(this),this.depthTest=new Da(this),this.depthFunc=new Xo(this),this.blend=new Cs(this),this.blendFunc=new ol(this),this.blendColor=new ou(this),this.blendEquation=new al(this),this.cullFace=new $s(this),this.cullFaceSide=new Hl(this),this.frontFace=new au(this),this.program=new Pu(this),this.activeTexture=new ri(this),this.viewport=new ni(this),this.bindFramebuffer=new As(this),this.bindRenderbuffer=new Vi(this),this.bindTexture=new su(this),this.bindVertexBuffer=new ya(this),this.bindElementBuffer=new Ha(this),this.bindVertexArray=new oa(this),this.pixelStoreUnpack=new Vs(this),this.pixelStoreUnpackPremultiplyAlpha=new sl(this),this.pixelStoreUnpackFlipY=new os(this),this.extTextureFilterAnisotropic=r.getExtension("EXT_texture_filter_anisotropic")||r.getExtension("MOZ_EXT_texture_filter_anisotropic")||r.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=r.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=r.getParameter(r.MAX_TEXTURE_SIZE),ao(r)){this.HALF_FLOAT=r.HALF_FLOAT;const m=r.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(s=r.RGBA16F)!==null&&s!==void 0?s:m?.RGBA16F_EXT,this.RGB16F=(p=r.RGB16F)!==null&&p!==void 0?p:m?.RGB16F_EXT,r.getExtension("EXT_color_buffer_float")}else{r.getExtension("EXT_color_buffer_half_float"),r.getExtension("OES_texture_half_float_linear");const m=r.getExtension("OES_texture_half_float");this.HALF_FLOAT=m?.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(r,s){return new nl(this,r,s)}createVertexBuffer(r,s,p){return new Mt(this,r,s,p)}createRenderbuffer(r,s,p){const m=this.gl,b=m.createRenderbuffer();return this.bindRenderbuffer.set(b),m.renderbufferStorage(m.RENDERBUFFER,r,s,p),this.bindRenderbuffer.set(null),b}createFramebuffer(r,s,p,m){return new Gs(this,r,s,p,m)}clear({color:r,depth:s,stencil:p}){const m=this.gl;let b=0;r&&(b|=m.COLOR_BUFFER_BIT,this.clearColor.set(r),this.colorMask.set([!0,!0,!0,!0])),s!==void 0&&(b|=m.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(s),this.depthMask.set(!0)),p!==void 0&&(b|=m.STENCIL_BUFFER_BIT,this.clearStencil.set(p),this.stencilMask.set(255)),m.clear(b)}setCullFace(r){r.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(r.mode),this.frontFace.set(r.frontFace))}setDepthMode(r){r.func!==this.gl.ALWAYS||r.mask?(this.depthTest.set(!0),this.depthFunc.set(r.func),this.depthMask.set(r.mask),this.depthRange.set(r.range)):this.depthTest.set(!1)}setStencilMode(r){r.test.func!==this.gl.ALWAYS||r.mask?(this.stencilTest.set(!0),this.stencilMask.set(r.mask),this.stencilOp.set([r.fail,r.depthFail,r.pass]),this.stencilFunc.set({func:r.test.func,ref:r.ref,mask:r.test.mask})):this.stencilTest.set(!1)}setColorMode(r){o.bG(r.blendFunction,rn.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(r.blendFunction),this.blendColor.set(r.blendColor)),this.colorMask.set(r.mask)}createVertexArray(){var r;return ao(this.gl)?this.gl.createVertexArray():(r=this.gl.getExtension("OES_vertex_array_object"))===null||r===void 0?void 0:r.createVertexArrayOES()}deleteVertexArray(r){var s;return ao(this.gl)?this.gl.deleteVertexArray(r):(s=this.gl.getExtension("OES_vertex_array_object"))===null||s===void 0?void 0:s.deleteVertexArrayOES(r)}unbindVAO(){this.bindVertexArray.set(null)}}let as;function ll(_,r,s,p,m){const b=_.context,T=_.transform,I=b.gl,R=_.useProgram("collisionBox"),j=[];let G=0,X=0;for(let qe=0;qe<p.length;qe++){const Ke=p[qe],lt=r.getTile(Ke).getBucket(s);if(!lt)continue;const nt=m?lt.textCollisionBox:lt.iconCollisionBox,dt=lt.collisionCircleArray;dt.length>0&&(j.push({circleArray:dt,circleOffset:X,coord:Ke}),G+=dt.length/4,X=G),nt&&R.draw(b,I.LINES,pn.disabled,cn.disabled,_.colorModeForRenderPass(),En.disabled,Pi(_.transform),_.style.map.terrain&&_.style.map.terrain.getTerrainData(Ke),T.getProjectionData({overscaledTileID:Ke,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),s.id,nt.layoutVertexBuffer,nt.indexBuffer,nt.segments,null,_.transform.zoom,null,null,nt.collisionVertexBuffer)}if(!m||!j.length)return;const Y=_.useProgram("collisionCircle"),ie=new o.b_;ie.resize(4*G),ie._trim();let be=0;for(const qe of j)for(let Ke=0;Ke<qe.circleArray.length/4;Ke++){const lt=4*Ke,nt=qe.circleArray[lt+0],dt=qe.circleArray[lt+1],bt=qe.circleArray[lt+2],rt=qe.circleArray[lt+3];ie.emplace(be++,nt,dt,bt,rt,0),ie.emplace(be++,nt,dt,bt,rt,1),ie.emplace(be++,nt,dt,bt,rt,2),ie.emplace(be++,nt,dt,bt,rt,3)}(!as||as.length<2*G)&&(as=(function(qe){const Ke=2*qe,lt=new o.c0;lt.resize(Ke),lt._trim();for(let nt=0;nt<Ke;nt++){const dt=6*nt;lt.uint16[dt+0]=4*nt+0,lt.uint16[dt+1]=4*nt+1,lt.uint16[dt+2]=4*nt+2,lt.uint16[dt+3]=4*nt+2,lt.uint16[dt+4]=4*nt+3,lt.uint16[dt+5]=4*nt+0}return lt})(G));const Ue=b.createIndexBuffer(as,!0),je=b.createVertexBuffer(ie,o.b$.members,!0);for(const qe of j){const Ke=tl(_.transform);Y.draw(b,I.TRIANGLES,pn.disabled,cn.disabled,_.colorModeForRenderPass(),En.disabled,Ke,_.style.map.terrain&&_.style.map.terrain.getTerrainData(qe.coord),null,s.id,je,Ue,o.aL.simpleSegment(0,2*qe.circleOffset,qe.circleArray.length,qe.circleArray.length/2),null,_.transform.zoom,null,null,null)}je.destroy(),Ue.destroy()}const tc=o.af(new Float32Array(16));function uu(_,r,s,p,m,b){const{horizontalAlign:T,verticalAlign:I}=o.aG(_);return new o.P((-(T-.5)*r/m+p[0])*b,(-(I-.5)*s/m+p[1])*b)}function ef(_,r,s,p,m,b){const T=r.tileAnchorPoint.add(new o.P(r.translation[0],r.translation[1]));if(r.pitchWithMap){let I=p.mult(b);s||(I=I.rotate(-m));const R=T.add(I);return We(R.x,R.y,r.pitchedLabelPlaneMatrix,r.getElevation).point}if(s){const I=pr(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(_),R=Math.atan(I.y/I.x)+(I.x<0?Math.PI:0);return _.add(p.rotate(R))}return _.add(p)}function lh(_,r,s,p,m,b,T,I,R,j,G,X){const Y=_.text.placedSymbolArray,ie=_.text.dynamicLayoutVertexArray,be=_.icon.dynamicLayoutVertexArray,Ue={};ie.clear();for(let je=0;je<Y.length;je++){const qe=Y.get(je),Ke=qe.hidden||!qe.crossTileID||_.allowVerticalPlacement&&!qe.placedOrientation?null:p[qe.crossTileID];if(Ke){const lt=new o.P(qe.anchorX,qe.anchorY),nt={getElevation:X,width:m.width,height:m.height,pitchedLabelPlaneMatrix:b,pitchWithMap:s,transform:m,tileAnchorPoint:lt,translation:j,unwrappedTileID:G},dt=s?ln(lt.x,lt.y,nt):pr(lt.x,lt.y,nt),bt=ft(m.cameraToCenterDistance,dt.signedDistanceFromCamera);let rt=o.ao(_.textSizeData,I,qe)*bt/o.aA;s&&(rt*=_.tilePixelRatio/T);const{width:At,height:qt,anchor:Bt,textOffset:zt,textBoxScale:Vt}=Ke,Dr=uu(Bt,At,qt,zt,Vt,rt),Ar=m.getPitchedTextCorrection(lt.x+j[0],lt.y+j[1],G),sr=ef(dt.point,nt,r,Dr,-m.bearingInRadians,Ar),Xr=_.allowVerticalPlacement&&qe.placedOrientation===o.an.vertical?Math.PI/2:0;for(let On=0;On<qe.numGlyphs;On++)o.au(ie,sr,Xr);R&&qe.associatedIconIndex>=0&&(Ue[qe.associatedIconIndex]={shiftedAnchor:sr,angle:Xr})}else fo(qe.numGlyphs,ie)}if(R){be.clear();const je=_.icon.placedSymbolArray;for(let qe=0;qe<je.length;qe++){const Ke=je.get(qe);if(Ke.hidden)fo(Ke.numGlyphs,be);else{const lt=Ue[qe];if(lt)for(let nt=0;nt<Ke.numGlyphs;nt++)o.au(be,lt.shiftedAnchor,lt.angle);else fo(Ke.numGlyphs,be)}}_.icon.dynamicLayoutVertexBuffer.updateData(be)}_.text.dynamicLayoutVertexBuffer.updateData(ie)}function Pc(_,r,s){return s.iconsInText&&r?"symbolTextAndIcon":_?"symbolSDF":"symbolIcon"}function rc(_,r,s,p,m,b,T,I,R,j,G,X,Y){const ie=_.context,be=ie.gl,Ue=_.transform,je=I==="map",qe=R==="map",Ke=I!=="viewport"&&s.layout.get("symbol-placement")!=="point",lt=je&&!qe&&!Ke,nt=!s.layout.get("symbol-sort-key").isConstant();let dt=!1;const bt=_.getDepthModeForSublayer(0,pn.ReadOnly),rt=s._unevaluatedLayout.hasValue("text-variable-anchor")||s._unevaluatedLayout.hasValue("text-variable-anchor-offset"),At=[],qt=Ue.getCircleRadiusCorrection();for(const Bt of p){const zt=r.getTile(Bt),Vt=zt.getBucket(s);if(!Vt)continue;const Dr=m?Vt.text:Vt.icon;if(!Dr||!Dr.segments.get().length||!Dr.hasVisibleVertices)continue;const Ar=Dr.programConfigurations.get(s.id),sr=m||Vt.sdfIcons,Xr=m?Vt.textSizeData:Vt.iconSizeData,On=qe||Ue.pitch!==0,Kn=_.useProgram(Pc(sr,m,Vt),Ar),Bi=o.am(Xr,Ue.zoom),mi=_.style.map.terrain&&_.style.map.terrain.getTerrainData(Bt);let gi,ui,oi,vi,Wo=[0,0],Hn=null;if(m)ui=zt.glyphAtlasTexture,oi=be.LINEAR,gi=zt.glyphAtlasTexture.size,Vt.iconsInText&&(Wo=zt.imageAtlasTexture.size,Hn=zt.imageAtlasTexture,vi=On||_.options.rotating||_.options.zooming||Xr.kind==="composite"||Xr.kind==="camera"?be.LINEAR:be.NEAREST);else{const No=s.layout.get("icon-size").constantOr(0)!==1||Vt.iconsNeedLinear;ui=zt.imageAtlasTexture,oi=sr||_.options.rotating||_.options.zooming||No||On?be.LINEAR:be.NEAREST,gi=zt.imageAtlasTexture.size}const Ko=o.aB(zt,1,_.transform.zoom),Zo=sn(je,_.transform,Ko),hl=o.L();o.ap(hl,Zo);const Fu=Q(qe,je,_.transform,Ko),Bu=o.aC(Ue,zt,b,T),Wl=Ue.getProjectionData({overscaledTileID:Bt,applyGlobeMatrix:!Y,applyTerrainMatrix:!0}),fh=rt&&Vt.hasTextData(),dh=s.layout.get("icon-text-fit")!=="none"&&fh&&Vt.hasIconData();if(Ke){const No=_.style.map.terrain?(ss,aa)=>_.style.map.terrain.getElevation(Bt,ss,aa):null,Ji=s.layout.get("text-rotation-alignment")==="map";Sr(Vt,_,m,Zo,hl,qe,j,Ji,Bt.toUnwrapped(),Ue.width,Ue.height,Bu,No)}const Oc=m&&rt||dh,Ds=Ke||Oc?tc:qe?Zo:_.transform.clipSpaceToPixelsMatrix,Ml=sr&&s.paint.get(m?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let zu;zu=sr?Vt.iconsInText?Ga(Xr.kind,Bi,lt,qe,Ke,Oc,_,Ds,Fu,Bu,gi,Wo,qt):ns(Xr.kind,Bi,lt,qe,Ke,Oc,_,Ds,Fu,Bu,m,gi,0,qt):$i(Xr.kind,Bi,lt,qe,Ke,Oc,_,Ds,Fu,Bu,m,gi,qt);const cc={program:Kn,buffers:Dr,uniformValues:zu,projectionData:Wl,atlasTexture:ui,atlasTextureIcon:Hn,atlasInterpolation:oi,atlasInterpolationIcon:vi,isSDF:sr,hasHalo:Ml};if(nt&&Vt.canOverlap){dt=!0;const No=Dr.segments.get();for(const Ji of No)At.push({segments:new o.aL([Ji]),sortKey:Ji.sortKey,state:cc,terrainData:mi})}else At.push({segments:Dr.segments,sortKey:0,state:cc,terrainData:mi})}dt&&At.sort(((Bt,zt)=>Bt.sortKey-zt.sortKey));for(const Bt of At){const zt=Bt.state;if(ie.activeTexture.set(be.TEXTURE0),zt.atlasTexture.bind(zt.atlasInterpolation,be.CLAMP_TO_EDGE),zt.atlasTextureIcon&&(ie.activeTexture.set(be.TEXTURE1),zt.atlasTextureIcon&&zt.atlasTextureIcon.bind(zt.atlasInterpolationIcon,be.CLAMP_TO_EDGE)),zt.isSDF){const Vt=zt.uniformValues;zt.hasHalo&&(Vt.u_is_halo=1,Iu(zt.buffers,Bt.segments,s,_,zt.program,bt,G,X,Vt,zt.projectionData,Bt.terrainData)),Vt.u_is_halo=0}Iu(zt.buffers,Bt.segments,s,_,zt.program,bt,G,X,zt.uniformValues,zt.projectionData,Bt.terrainData)}}function Iu(_,r,s,p,m,b,T,I,R,j,G){const X=p.context;m.draw(X,X.gl.TRIANGLES,b,T,I,En.backCCW,R,G,j,s.id,_.layoutVertexBuffer,_.indexBuffer,r,s.paint,p.transform.zoom,_.programConfigurations.get(s.id),_.dynamicLayoutVertexBuffer,_.opacityVertexBuffer)}function Ic(_,r,s,p,m){const b=_.context,T=b.gl,I=cn.disabled,R=new rn([T.ONE,T.ONE],o.be.transparent,[!0,!0,!0,!0]),j=r.getBucket(s);if(!j)return;const G=p.key;let X=s.heatmapFbos.get(G);X||(X=Mu(b,r.tileSize,r.tileSize),s.heatmapFbos.set(G,X)),b.bindFramebuffer.set(X.framebuffer),b.viewport.set([0,0,r.tileSize,r.tileSize]),b.clear({color:o.be.transparent});const Y=j.programConfigurations.get(s.id),ie=_.useProgram("heatmap",Y,!m),be=_.transform.getProjectionData({overscaledTileID:r.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),Ue=_.style.map.terrain.getTerrainData(p);ie.draw(b,T.TRIANGLES,pn.disabled,I,R,En.disabled,Va(r,_.transform.zoom,s.paint.get("heatmap-intensity"),1),Ue,be,s.id,j.layoutVertexBuffer,j.indexBuffer,j.segments,s.paint,_.transform.zoom,Y)}function Mc(_,r,s,p,m){const b=_.context,T=b.gl,I=_.transform;b.setColorMode(_.colorModeForRenderPass());const R=Lc(b,r),j=s.key,G=r.heatmapFbos.get(j);if(!G)return;b.activeTexture.set(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,G.colorAttachment.get()),b.activeTexture.set(T.TEXTURE1),R.bind(T.LINEAR,T.CLAMP_TO_EDGE);const X=I.getProjectionData({overscaledTileID:s,applyTerrainMatrix:m,applyGlobeMatrix:!p});_.useProgram("heatmapTexture").draw(b,T.TRIANGLES,pn.disabled,cn.disabled,_.colorModeForRenderPass(),En.disabled,so(_,r,0,1),null,X,r.id,_.rasterBoundsBuffer,_.quadTriangleIndexBuffer,_.rasterBoundsSegments,r.paint,I.zoom),G.destroy(),r.heatmapFbos.delete(j)}function Mu(_,r,s){var p,m;const b=_.gl,T=b.createTexture();b.bindTexture(b.TEXTURE_2D,T),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MIN_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR);const I=(p=_.HALF_FLOAT)!==null&&p!==void 0?p:b.UNSIGNED_BYTE,R=(m=_.RGBA16F)!==null&&m!==void 0?m:b.RGBA;b.texImage2D(b.TEXTURE_2D,0,R,r,s,0,b.RGBA,I,null);const j=_.createFramebuffer(r,s,!1,!1);return j.colorAttachment.set(T),j}function Lc(_,r){return r.colorRampTexture||(r.colorRampTexture=new o.T(_,r.colorRamp,_.gl.RGBA)),r.colorRampTexture}function uh(_,r,s,p,m){if(!s||!p||!p.imageAtlas)return;const b=p.imageAtlas.patternPositions;let T=b[s.to.toString()],I=b[s.from.toString()];if(!T&&I&&(T=I),!I&&T&&(I=T),!T||!I){const R=m.getPaintProperty(r);T=b[R],I=b[R]}T&&I&&_.setConstantPatternPositions(T,I)}function nc(_,r,s,p,m,b,T,I){const R=_.context.gl,j="fill-pattern",G=s.paint.get(j),X=G&&G.constantOr(1),Y=s.getCrossfadeParameters();let ie,be,Ue,je,qe;const Ke=_.transform,lt=s.paint.get("fill-translate"),nt=s.paint.get("fill-translate-anchor");T?(be=X&&!s.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ie=R.LINES):(be=X?"fillPattern":"fill",ie=R.TRIANGLES);const dt=G.constantOr(null);for(const bt of p){const rt=r.getTile(bt);if(X&&!rt.patternsLoaded())continue;const At=rt.getBucket(s);if(!At)continue;const qt=At.programConfigurations.get(s.id),Bt=_.useProgram(be,qt),zt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(bt);X&&(_.context.activeTexture.set(R.TEXTURE0),rt.imageAtlasTexture.bind(R.LINEAR,R.CLAMP_TO_EDGE),qt.updatePaintBuffers(Y)),uh(qt,j,dt,rt,s);const Vt=Ke.getProjectionData({overscaledTileID:bt,applyGlobeMatrix:!I,applyTerrainMatrix:!0}),Dr=o.aC(Ke,rt,lt,nt);if(T){je=At.indexBuffer2,qe=At.segments2;const sr=[R.drawingBufferWidth,R.drawingBufferHeight];Ue=be==="fillOutlinePattern"&&X?$a(_,Y,rt,sr,Dr):Ai(sr,Dr)}else je=At.indexBuffer,qe=At.segments,Ue=X?Lo(_,Y,rt,Dr):{u_fill_translate:Dr};const Ar=_.stencilModeForClipping(bt);Bt.draw(_.context,ie,m,Ar,b,En.backCCW,Ue,zt,Vt,s.id,At.layoutVertexBuffer,je,qe,s.paint,_.transform.zoom,qt)}}function Lu(_,r,s,p,m,b,T,I){const R=_.context,j=R.gl,G="fill-extrusion-pattern",X=s.paint.get(G),Y=X.constantOr(1),ie=s.getCrossfadeParameters(),be=s.paint.get("fill-extrusion-opacity"),Ue=X.constantOr(null),je=_.transform;for(const qe of p){const Ke=r.getTile(qe),lt=Ke.getBucket(s);if(!lt)continue;const nt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(qe),dt=lt.programConfigurations.get(s.id),bt=_.useProgram(Y?"fillExtrusionPattern":"fillExtrusion",dt);Y&&(_.context.activeTexture.set(j.TEXTURE0),Ke.imageAtlasTexture.bind(j.LINEAR,j.CLAMP_TO_EDGE),dt.updatePaintBuffers(ie));const rt=je.getProjectionData({overscaledTileID:qe,applyGlobeMatrix:!I,applyTerrainMatrix:!0});uh(dt,G,Ue,Ke,s);const At=o.aC(je,Ke,s.paint.get("fill-extrusion-translate"),s.paint.get("fill-extrusion-translate-anchor")),qt=s.paint.get("fill-extrusion-vertical-gradient"),Bt=Y?Xi(_,qt,be,At,qe,ie,Ke):La(_,qt,be,At);bt.draw(R,R.gl.TRIANGLES,m,b,T,En.backCCW,Bt,nt,rt,s.id,lt.layoutVertexBuffer,lt.indexBuffer,lt.segments,s.paint,_.transform.zoom,dt,_.style.map.terrain&&lt.centroidVertexBuffer)}}function Du(_,r,s,p,m,b,T,I,R){var j;const G=_.style.projection,X=_.context,Y=_.transform,ie=X.gl,be=[`#define NUM_ILLUMINATION_SOURCES ${s.paint.get("hillshade-highlight-color").values.length}`],Ue=_.useProgram("hillshade",null,!1,be),je=!_.options.moving;for(const qe of p){const Ke=r.getTile(qe),lt=Ke.fbo;if(!lt)continue;const nt=G.getMeshFromTileID(X,qe.canonical,I,!0,"raster"),dt=(j=_.style.map.terrain)===null||j===void 0?void 0:j.getTerrainData(qe);X.activeTexture.set(ie.TEXTURE0),ie.bindTexture(ie.TEXTURE_2D,lt.colorAttachment.get());const bt=Y.getProjectionData({overscaledTileID:qe,aligned:je,applyGlobeMatrix:!R,applyTerrainMatrix:!0});Ue.draw(X,ie.TRIANGLES,b,m[qe.overscaledZ],T,En.backCCW,Do(_,Ke,s),dt,bt,s.id,nt.vertexBuffer,nt.indexBuffer,nt.segments)}}function cu(_,r,s,p,m,b,T,I,R){var j;const G=_.style.projection,X=_.context,Y=_.transform,ie=X.gl,be=_.useProgram("colorRelief"),Ue=!_.options.moving;let je=!0;for(const qe of p){const Ke=r.getTile(qe),lt=Ke.dem;if(je){const qt=ie.getParameter(ie.MAX_TEXTURE_SIZE),{elevationTexture:Bt,colorTexture:zt}=s.getColorRampTextures(X,qt,lt.getUnpackVector());X.activeTexture.set(ie.TEXTURE1),Bt.bind(ie.NEAREST,ie.CLAMP_TO_EDGE),X.activeTexture.set(ie.TEXTURE4),zt.bind(ie.LINEAR,ie.CLAMP_TO_EDGE),je=!1}if(!lt||!lt.data)continue;const nt=lt.stride,dt=lt.getPixels();if(X.activeTexture.set(ie.TEXTURE0),X.pixelStoreUnpackPremultiplyAlpha.set(!1),Ke.demTexture=Ke.demTexture||_.getTileTexture(nt),Ke.demTexture){const qt=Ke.demTexture;qt.update(dt,{premultiply:!1}),qt.bind(ie.LINEAR,ie.CLAMP_TO_EDGE)}else Ke.demTexture=new o.T(X,dt,ie.RGBA,{premultiply:!1}),Ke.demTexture.bind(ie.LINEAR,ie.CLAMP_TO_EDGE);const bt=G.getMeshFromTileID(X,qe.canonical,I,!0,"raster"),rt=(j=_.style.map.terrain)===null||j===void 0?void 0:j.getTerrainData(qe),At=Y.getProjectionData({overscaledTileID:qe,aligned:Ue,applyGlobeMatrix:!R,applyTerrainMatrix:!0});be.draw(X,ie.TRIANGLES,b,m[qe.overscaledZ],T,En.backCCW,qs(s,Ke.dem),rt,At,s.id,bt.vertexBuffer,bt.indexBuffer,bt.segments)}}const ic=[new o.P(0,0),new o.P(o.$,0),new o.P(o.$,o.$),new o.P(0,o.$)];function Ps(_,r,s,p,m,b,T,I,R=!1,j=!1){const G=p[p.length-1].overscaledZ,X=_.context,Y=X.gl,ie=_.useProgram("raster"),be=_.transform,Ue=_.style.projection,je=_.colorModeForRenderPass(),qe=!_.options.moving;for(const Ke of p){const lt=_.getDepthModeForSublayer(Ke.overscaledZ-G,s.paint.get("raster-opacity")===1?pn.ReadWrite:pn.ReadOnly,Y.LESS),nt=r.getTile(Ke);nt.registerFadeDuration(s.paint.get("raster-fade-duration"));const dt=r.findLoadedParent(Ke,0),bt=r.findLoadedSibling(Ke),rt=Sd(nt,dt||bt||null,r,s,_.transform,_.style.map.terrain);let At,qt;const Bt=s.paint.get("raster-resampling")==="nearest"?Y.NEAREST:Y.LINEAR;X.activeTexture.set(Y.TEXTURE0),nt.texture.bind(Bt,Y.CLAMP_TO_EDGE,Y.LINEAR_MIPMAP_NEAREST),X.activeTexture.set(Y.TEXTURE1),dt?(dt.texture.bind(Bt,Y.CLAMP_TO_EDGE,Y.LINEAR_MIPMAP_NEAREST),At=Math.pow(2,dt.tileID.overscaledZ-nt.tileID.overscaledZ),qt=[nt.tileID.canonical.x*At%1,nt.tileID.canonical.y*At%1]):nt.texture.bind(Bt,Y.CLAMP_TO_EDGE,Y.LINEAR_MIPMAP_NEAREST),nt.texture.useMipmap&&X.extTextureFilterAnisotropic&&_.transform.pitch>20&&Y.texParameterf(Y.TEXTURE_2D,X.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,X.extTextureFilterAnisotropicMax);const zt=_.style.map.terrain&&_.style.map.terrain.getTerrainData(Ke),Vt=be.getProjectionData({overscaledTileID:Ke,aligned:qe,applyGlobeMatrix:!j,applyTerrainMatrix:!0}),Dr=Uo(qt||[0,0],At||1,rt,s,I),Ar=Ue.getMeshFromTileID(X,Ke.canonical,b,T,"raster");ie.draw(X,Y.TRIANGLES,lt,m?m[Ke.overscaledZ]:cn.disabled,je,R?En.frontCCW:En.backCCW,Dr,zt,Vt,s.id,Ar.vertexBuffer,Ar.indexBuffer,Ar.segments)}}function Sd(_,r,s,p,m,b){const T=p.paint.get("raster-fade-duration");if(!b&&T>0){const I=M.now(),R=(I-_.timeAdded)/T,j=r?(I-r.timeAdded)/T:-1,G=s.getSource(),X=Ft(m,{tileSize:G.tileSize,roundZoom:G.roundZoom}),Y=!r||Math.abs(r.tileID.overscaledZ-X)>Math.abs(_.tileID.overscaledZ-X),ie=Y&&_.refreshedUponExpiration?1:o.ag(Y?R:1-j,0,1);return _.refreshedUponExpiration&&R>=1&&(_.refreshedUponExpiration=!1),r?{opacity:1,mix:1-ie}:{opacity:ie,mix:0}}return{opacity:1,mix:0}}const tf=new o.be(1,0,0,1),oc=new o.be(0,1,0,1),ch=new o.be(0,0,1,1),rf=new o.be(1,0,1,1),nf=new o.be(0,1,1,1);function ac(_,r,s,p){Za(_,0,r+s/2,_.transform.width,s,p)}function Hs(_,r,s,p){Za(_,r-s/2,0,s,_.transform.height,p)}function Za(_,r,s,p,m,b){const T=_.context,I=T.gl;I.enable(I.SCISSOR_TEST),I.scissor(r*_.pixelRatio,s*_.pixelRatio,p*_.pixelRatio,m*_.pixelRatio),T.clear({color:b}),I.disable(I.SCISSOR_TEST)}function ul(_,r,s){const p=_.context,m=p.gl,b=_.useProgram("debug"),T=pn.disabled,I=cn.disabled,R=_.colorModeForRenderPass(),j="$debug",G=_.style.map.terrain&&_.style.map.terrain.getTerrainData(s);p.activeTexture.set(m.TEXTURE0);const X=r.getTileByID(s.key).latestRawTileData,Y=Math.floor((X&&X.byteLength||0)/1024),ie=r.getTile(s).tileSize,be=512/Math.min(ie,512)*(s.overscaledZ/_.transform.zoom)*.5;let Ue=s.canonical.toString();s.overscaledZ!==s.canonical.z&&(Ue+=` => ${s.overscaledZ}`),(function(qe,Ke){qe.initDebugOverlayCanvas();const lt=qe.debugOverlayCanvas,nt=qe.context.gl,dt=qe.debugOverlayCanvas.getContext("2d");dt.clearRect(0,0,lt.width,lt.height),dt.shadowColor="white",dt.shadowBlur=2,dt.lineWidth=1.5,dt.strokeStyle="white",dt.textBaseline="top",dt.font="bold 36px Open Sans, sans-serif",dt.fillText(Ke,5,5),dt.strokeText(Ke,5,5),qe.debugOverlayTexture.update(lt),qe.debugOverlayTexture.bind(nt.LINEAR,nt.CLAMP_TO_EDGE)})(_,`${Ue} ${Y}kB`);const je=_.transform.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});b.draw(p,m.TRIANGLES,T,I,rn.alphaBlended,En.disabled,ws(o.be.transparent,be),null,je,j,_.debugBuffer,_.quadTriangleIndexBuffer,_.debugSegments),b.draw(p,m.LINE_STRIP,T,I,R,En.disabled,ws(o.be.red),G,je,j,_.debugBuffer,_.tileBorderIndexBuffer,_.debugSegments)}function lo(_,r,s,p){const{isRenderingGlobe:m}=p,b=_.context,T=b.gl,I=_.transform,R=_.colorModeForRenderPass(),j=_.getDepthModeFor3D(),G=_.useProgram("terrain");b.bindFramebuffer.set(null),b.viewport.set([0,0,_.width,_.height]);for(const X of s){const Y=r.getTerrainMesh(X.tileID),ie=_.renderToTexture.getTexture(X),be=r.getTerrainData(X.tileID);b.activeTexture.set(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,ie.texture);const Ue=r.getMeshFrameDelta(I.zoom),je=I.calculateFogMatrix(X.tileID.toUnwrapped()),qe=Au(Ue,je,_.style.sky,I.pitch,m),Ke=I.getProjectionData({overscaledTileID:X.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});G.draw(b,T.TRIANGLES,j,cn.disabled,R,En.backCCW,qe,be,Ke,"terrain",Y.vertexBuffer,Y.indexBuffer,Y.segments)}}function Al(_,r){if(!r.mesh){const s=new o.aK;s.emplaceBack(-1,-1),s.emplaceBack(1,-1),s.emplaceBack(1,1),s.emplaceBack(-1,1);const p=new o.aM;p.emplaceBack(0,1,2),p.emplaceBack(0,2,3),r.mesh=new Pt(_.createVertexBuffer(s,ur.members),_.createIndexBuffer(p),o.aL.simpleSegment(0,0,s.length,p.length))}return r.mesh}class $o{constructor(r,s){this.context=new Dn(r),this.transform=s,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:o.af(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=kt.maxUnderzooming+kt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Ee}resize(r,s,p){if(this.width=Math.floor(r*p),this.height=Math.floor(s*p),this.pixelRatio=p,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const m of this.style._order)this.style._layers[m].resize()}setup(){const r=this.context,s=new o.aK;s.emplaceBack(0,0),s.emplaceBack(o.$,0),s.emplaceBack(0,o.$),s.emplaceBack(o.$,o.$),this.tileExtentBuffer=r.createVertexBuffer(s,ur.members),this.tileExtentSegments=o.aL.simpleSegment(0,0,4,2);const p=new o.aK;p.emplaceBack(0,0),p.emplaceBack(o.$,0),p.emplaceBack(0,o.$),p.emplaceBack(o.$,o.$),this.debugBuffer=r.createVertexBuffer(p,ur.members),this.debugSegments=o.aL.simpleSegment(0,0,4,5);const m=new o.c5;m.emplaceBack(0,0,0,0),m.emplaceBack(o.$,0,o.$,0),m.emplaceBack(0,o.$,0,o.$),m.emplaceBack(o.$,o.$,o.$,o.$),this.rasterBoundsBuffer=r.createVertexBuffer(m,bs.members),this.rasterBoundsSegments=o.aL.simpleSegment(0,0,4,2);const b=new o.aK;b.emplaceBack(0,0),b.emplaceBack(o.$,0),b.emplaceBack(0,o.$),b.emplaceBack(o.$,o.$),this.rasterBoundsBufferPosOnly=r.createVertexBuffer(b,ur.members),this.rasterBoundsSegmentsPosOnly=o.aL.simpleSegment(0,0,4,5);const T=new o.aK;T.emplaceBack(0,0),T.emplaceBack(1,0),T.emplaceBack(0,1),T.emplaceBack(1,1),this.viewportBuffer=r.createVertexBuffer(T,ur.members),this.viewportSegments=o.aL.simpleSegment(0,0,4,2);const I=new o.c6;I.emplaceBack(0),I.emplaceBack(1),I.emplaceBack(3),I.emplaceBack(2),I.emplaceBack(0),this.tileBorderIndexBuffer=r.createIndexBuffer(I);const R=new o.aM;R.emplaceBack(1,0,2),R.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=r.createIndexBuffer(R);const j=this.context.gl;this.stencilClearMode=new cn({func:j.ALWAYS,mask:0},0,255,j.ZERO,j.ZERO,j.ZERO),this.tileExtentMesh=new Pt(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){const r=this.context,s=r.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const p=o.L();o.bX(p,0,this.width,this.height,0,0,1),o.N(p,p,[s.drawingBufferWidth,s.drawingBufferHeight,0]);const m={mainMatrix:p,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:p};this.useProgram("clippingMask",null,!0).draw(r,s.TRIANGLES,pn.disabled,this.stencilClearMode,rn.disabled,En.disabled,null,null,m,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(r,s,p){if(this.currentStencilSource===r.source||!r.isTileClipped()||!s||!s.length)return;this.currentStencilSource=r.source,this.nextStencilID+s.length>256&&this.clearStencil();const m=this.context;m.setColorMode(rn.disabled),m.setDepthMode(pn.disabled);const b={};for(const T of s)b[T.key]=this.nextStencilID++;this._renderTileMasks(b,s,p,!0),this._renderTileMasks(b,s,p,!1),this._tileClippingMaskIDs=b}_renderTileMasks(r,s,p,m){const b=this.context,T=b.gl,I=this.style.projection,R=this.transform,j=this.useProgram("clippingMask");for(const G of s){const X=r[G.key],Y=this.style.map.terrain&&this.style.map.terrain.getTerrainData(G),ie=I.getMeshFromTileID(this.context,G.canonical,m,!0,"stencil"),be=R.getProjectionData({overscaledTileID:G,applyGlobeMatrix:!p,applyTerrainMatrix:!0});j.draw(b,T.TRIANGLES,pn.disabled,new cn({func:T.ALWAYS,mask:0},X,255,T.KEEP,T.KEEP,T.REPLACE),rn.disabled,p?En.disabled:En.backCCW,null,Y,be,"$clipping",ie.vertexBuffer,ie.indexBuffer,ie.segments)}}_renderTilesDepthBuffer(){const r=this.context,s=r.gl,p=this.style.projection,m=this.transform,b=this.useProgram("depth"),T=this.getDepthModeFor3D(),I=It(m,{tileSize:m.tileSize});for(const R of I){const j=this.style.map.terrain&&this.style.map.terrain.getTerrainData(R),G=p.getMeshFromTileID(this.context,R.canonical,!0,!0,"raster"),X=m.getProjectionData({overscaledTileID:R,applyGlobeMatrix:!0,applyTerrainMatrix:!0});b.draw(r,s.TRIANGLES,T,cn.disabled,rn.disabled,En.backCCW,null,j,X,"$clipping",G.vertexBuffer,G.indexBuffer,G.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const r=this.nextStencilID++,s=this.context.gl;return new cn({func:s.NOTEQUAL,mask:255},r,255,s.KEEP,s.KEEP,s.REPLACE)}stencilModeForClipping(r){const s=this.context.gl;return new cn({func:s.EQUAL,mask:255},this._tileClippingMaskIDs[r.key],0,s.KEEP,s.KEEP,s.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(r){const s=this.context.gl,p=r.sort(((T,I)=>I.overscaledZ-T.overscaledZ)),m=p[p.length-1].overscaledZ,b=p[0].overscaledZ-m+1;if(b>1){this.currentStencilSource=void 0,this.nextStencilID+b>256&&this.clearStencil();const T={};for(let I=0;I<b;I++)T[I+m]=new cn({func:s.GEQUAL,mask:255},I+this.nextStencilID,255,s.KEEP,s.KEEP,s.REPLACE);return this.nextStencilID+=b,[T,p]}return[{[m]:cn.disabled},p]}stencilConfigForOverlapTwoPass(r){const s=this.context.gl,p=r.sort(((T,I)=>I.overscaledZ-T.overscaledZ)),m=p[p.length-1].overscaledZ,b=p[0].overscaledZ-m+1;if(this.clearStencil(),b>1){const T={},I={};for(let R=0;R<b;R++)T[R+m]=new cn({func:s.GREATER,mask:255},b+1+R,255,s.KEEP,s.KEEP,s.REPLACE),I[R+m]=new cn({func:s.GREATER,mask:255},1+R,255,s.KEEP,s.KEEP,s.REPLACE);return this.nextStencilID=2*b+1,[T,I,p]}return this.nextStencilID=3,[{[m]:new cn({func:s.GREATER,mask:255},2,255,s.KEEP,s.KEEP,s.REPLACE)},{[m]:new cn({func:s.GREATER,mask:255},1,255,s.KEEP,s.KEEP,s.REPLACE)},p]}colorModeForRenderPass(){const r=this.context.gl;return this._showOverdrawInspector?new rn([r.CONSTANT_COLOR,r.ONE],new o.be(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?rn.unblended:rn.alphaBlended}getDepthModeForSublayer(r,s,p){if(!this.opaquePassEnabledForLayer())return pn.disabled;const m=1-((1+this.currentLayer)*this.numSublayers+r)*this.depthEpsilon;return new pn(p||this.context.gl.LEQUAL,s,[m,m])}getDepthModeFor3D(){return new pn(this.context.gl.LEQUAL,pn.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(r,s){var p,m;this.style=r,this.options=s,this.lineAtlas=r.lineAtlas,this.imageManager=r.imageManager,this.glyphManager=r.glyphManager,this.symbolFadeChange=r.placement.symbolFadeChange(M.now()),this.imageManager.beginFrame();const b=this.style._order,T=this.style.sourceCaches,I={},R={},j={},G={isRenderingToTexture:!1,isRenderingGlobe:((p=r.projection)===null||p===void 0?void 0:p.transitionState)>0};for(const Y in T){const ie=T[Y];ie.used&&ie.prepare(this.context),I[Y]=ie.getVisibleCoordinates(!1),R[Y]=I[Y].slice().reverse(),j[Y]=ie.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let Y=0;Y<b.length;Y++)if(this.style._layers[b[Y]].is3D()){this.opaquePassCutoff=Y;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const Y of b){const ie=this.style._layers[Y];if(!ie.hasOffscreenPass()||ie.isHidden(this.transform.zoom))continue;const be=R[ie.source];(ie.type==="custom"||be.length)&&this.renderLayer(this,T[ie.source],ie,be,G)}if((m=this.style.projection)===null||m===void 0||m.updateGPUdependent({context:this.context,useProgram:Y=>this.useProgram(Y)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:s.showOverdrawInspector?o.be.black:o.be.transparent,depth:1}),this.clearStencil(),this.style.sky&&(function(Y,ie){const be=Y.context,Ue=be.gl,je=((bt,rt,At)=>{const qt=Math.cos(rt.rollInRadians),Bt=Math.sin(rt.rollInRadians),zt=ce(rt),Vt=rt.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:bt.properties.get("sky-color"),u_horizon_color:bt.properties.get("horizon-color"),u_horizon:[(rt.width/2-zt*Bt)*At,(rt.height/2+zt*qt)*At],u_horizon_normal:[-Bt,qt],u_sky_horizon_blend:bt.properties.get("sky-horizon-blend")*rt.height/2*At,u_sky_blend:Vt}})(ie,Y.style.map.transform,Y.pixelRatio),qe=new pn(Ue.LEQUAL,pn.ReadWrite,[0,1]),Ke=cn.disabled,lt=Y.colorModeForRenderPass(),nt=Y.useProgram("sky"),dt=Al(be,ie);nt.draw(be,Ue.TRIANGLES,qe,Ke,lt,En.disabled,je,null,void 0,"sky",dt.vertexBuffer,dt.indexBuffer,dt.segments)})(this,this.style.sky),this._showOverdrawInspector=s.showOverdrawInspector,this.depthRangeFor3D=[0,1-(r._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=b.length-1;this.currentLayer>=0;this.currentLayer--){const Y=this.style._layers[b[this.currentLayer]],ie=T[Y.source],be=I[Y.source];this._renderTileClippingMasks(Y,be,!1),this.renderLayer(this,ie,Y,be,G)}this.renderPass="translucent";let X=!1;for(this.currentLayer=0;this.currentLayer<b.length;this.currentLayer++){const Y=this.style._layers[b[this.currentLayer]],ie=T[Y.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(Y,G))continue;this.opaquePassEnabledForLayer()||X||(X=!0,G.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());const be=(Y.type==="symbol"?j:R)[Y.source];this._renderTileClippingMasks(Y,I[Y.source],!!this.renderToTexture),this.renderLayer(this,ie,Y,be,G)}if(G.isRenderingGlobe&&(function(Y,ie,be){const Ue=Y.context,je=Ue.gl,qe=Y.useProgram("atmosphere"),Ke=new pn(je.LEQUAL,pn.ReadOnly,[0,1]),lt=Y.transform,nt=(function(Vt,Dr){const Ar=Vt.properties.get("position"),sr=[-Ar.x,-Ar.y,-Ar.z],Xr=o.af(new Float64Array(16));return Vt.properties.get("anchor")==="map"&&(o.b5(Xr,Xr,Dr.rollInRadians),o.b6(Xr,Xr,-Dr.pitchInRadians),o.b5(Xr,Xr,Dr.bearingInRadians),o.b6(Xr,Xr,Dr.center.lat*Math.PI/180),o.by(Xr,Xr,-Dr.center.lng*Math.PI/180)),o.c4(sr,sr,Xr),sr})(be,Y.transform),dt=lt.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),bt=ie.properties.get("atmosphere-blend")*dt.projectionTransition;if(bt===0)return;const rt=Mo(lt.worldSize,lt.center.lat),At=lt.inverseProjectionMatrix,qt=new Float64Array(4);qt[3]=1,o.av(qt,qt,lt.modelViewProjectionMatrix),qt[0]/=qt[3],qt[1]/=qt[3],qt[2]/=qt[3],qt[3]=1,o.av(qt,qt,At),qt[0]/=qt[3],qt[1]/=qt[3],qt[2]/=qt[3],qt[3]=1;const Bt=((Vt,Dr,Ar,sr,Xr)=>({u_sun_pos:Vt,u_atmosphere_blend:Dr,u_globe_position:Ar,u_globe_radius:sr,u_inv_proj_matrix:Xr}))(nt,bt,[qt[0],qt[1],qt[2]],rt,At),zt=Al(Ue,ie);qe.draw(Ue,je.TRIANGLES,Ke,cn.disabled,rn.alphaBlended,En.disabled,Bt,null,null,"atmosphere",zt.vertexBuffer,zt.indexBuffer,zt.segments)})(this,this.style.sky,this.style.light),this.options.showTileBoundaries){const Y=(function(ie,be){let Ue=null;const je=Object.values(ie._layers).flatMap((nt=>nt.source&&!nt.isHidden(be)?[ie.sourceCaches[nt.source]]:[])),qe=je.filter((nt=>nt.getSource().type==="vector")),Ke=je.filter((nt=>nt.getSource().type!=="vector")),lt=nt=>{(!Ue||Ue.getSource().maxzoom<nt.getSource().maxzoom)&&(Ue=nt)};return qe.forEach((nt=>lt(nt))),Ue||Ke.forEach((nt=>lt(nt))),Ue})(this.style,this.transform.zoom);Y&&(function(ie,be,Ue){for(let je=0;je<Ue.length;je++)ul(ie,be,Ue[je])})(this,Y,Y.getVisibleCoordinates())}this.options.showPadding&&(function(Y){const ie=Y.transform.padding;ac(Y,Y.transform.height-(ie.top||0),3,tf),ac(Y,ie.bottom||0,3,oc),Hs(Y,ie.left||0,3,ch),Hs(Y,Y.transform.width-(ie.right||0),3,rf);const be=Y.transform.centerPoint;(function(Ue,je,qe,Ke){Za(Ue,je-1,qe-10,2,20,Ke),Za(Ue,je-10,qe-1,20,2,Ke)})(Y,be.x,Y.transform.height-be.y,nf)})(this),this.context.setDefault()}maybeDrawDepthAndCoords(r){if(!this.style||!this.style.map||!this.style.map.terrain)return;const s=this.terrainFacilitator.matrix,p=this.transform.modelViewProjectionMatrix;let m=this.terrainFacilitator.dirty;m||(m=r?!o.c7(s,p):!o.c8(s,p)),m||(m=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),m&&(o.c9(s,p),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,(function(b,T){const I=b.context,R=I.gl,j=b.transform,G=rn.unblended,X=new pn(R.LEQUAL,pn.ReadWrite,[0,1]),Y=T.sourceCache.getRenderableTiles(),ie=b.useProgram("terrainDepth");I.bindFramebuffer.set(T.getFramebuffer("depth").framebuffer),I.viewport.set([0,0,b.width/devicePixelRatio,b.height/devicePixelRatio]),I.clear({color:o.be.transparent,depth:1});for(const be of Y){const Ue=T.getTerrainMesh(be.tileID),je=T.getTerrainData(be.tileID),qe=j.getProjectionData({overscaledTileID:be.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),Ke={u_ele_delta:T.getMeshFrameDelta(j.zoom)};ie.draw(I,R.TRIANGLES,X,cn.disabled,G,En.backCCW,Ke,je,qe,"terrain",Ue.vertexBuffer,Ue.indexBuffer,Ue.segments)}I.bindFramebuffer.set(null),I.viewport.set([0,0,b.width,b.height])})(this,this.style.map.terrain),(function(b,T){const I=b.context,R=I.gl,j=b.transform,G=rn.unblended,X=new pn(R.LEQUAL,pn.ReadWrite,[0,1]),Y=T.getCoordsTexture(),ie=T.sourceCache.getRenderableTiles(),be=b.useProgram("terrainCoords");I.bindFramebuffer.set(T.getFramebuffer("coords").framebuffer),I.viewport.set([0,0,b.width/devicePixelRatio,b.height/devicePixelRatio]),I.clear({color:o.be.transparent,depth:1}),T.coordsIndex=[];for(const Ue of ie){const je=T.getTerrainMesh(Ue.tileID),qe=T.getTerrainData(Ue.tileID);I.activeTexture.set(R.TEXTURE0),R.bindTexture(R.TEXTURE_2D,Y.texture);const Ke={u_terrain_coords_id:(255-T.coordsIndex.length)/255,u_texture:0,u_ele_delta:T.getMeshFrameDelta(j.zoom)},lt=j.getProjectionData({overscaledTileID:Ue.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});be.draw(I,R.TRIANGLES,X,cn.disabled,G,En.backCCW,Ke,qe,lt,"terrain",je.vertexBuffer,je.indexBuffer,je.segments),T.coordsIndex.push(Ue.tileID.key)}I.bindFramebuffer.set(null),I.viewport.set([0,0,b.width,b.height])})(this,this.style.map.terrain))}renderLayer(r,s,p,m,b){p.isHidden(this.transform.zoom)||(p.type==="background"||p.type==="custom"||(m||[]).length)&&(this.id=p.id,o.ca(p)?(function(T,I,R,j,G,X){if(T.renderPass!=="translucent")return;const{isRenderingToTexture:Y}=X,ie=cn.disabled,be=T.colorModeForRenderPass();(R._unevaluatedLayout.hasValue("text-variable-anchor")||R._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&(function(Ue,je,qe,Ke,lt,nt,dt,bt,rt){const At=je.transform,qt=je.style.map.terrain,Bt=lt==="map",zt=nt==="map";for(const Vt of Ue){const Dr=Ke.getTile(Vt),Ar=Dr.getBucket(qe);if(!Ar||!Ar.text||!Ar.text.segments.get().length)continue;const sr=o.am(Ar.textSizeData,At.zoom),Xr=o.aB(Dr,1,je.transform.zoom),On=sn(Bt,je.transform,Xr),Kn=qe.layout.get("icon-text-fit")!=="none"&&Ar.hasIconData();if(sr){const Bi=Math.pow(2,At.zoom-Dr.tileID.overscaledZ),mi=qt?(gi,ui)=>qt.getElevation(Vt,gi,ui):null;lh(Ar,Bt,zt,rt,At,On,Bi,sr,Kn,o.aC(At,Dr,dt,bt),Vt.toUnwrapped(),mi)}}})(j,T,R,I,R.layout.get("text-rotation-alignment"),R.layout.get("text-pitch-alignment"),R.paint.get("text-translate"),R.paint.get("text-translate-anchor"),G),R.paint.get("icon-opacity").constantOr(1)!==0&&rc(T,I,R,j,!1,R.paint.get("icon-translate"),R.paint.get("icon-translate-anchor"),R.layout.get("icon-rotation-alignment"),R.layout.get("icon-pitch-alignment"),R.layout.get("icon-keep-upright"),ie,be,Y),R.paint.get("text-opacity").constantOr(1)!==0&&rc(T,I,R,j,!0,R.paint.get("text-translate"),R.paint.get("text-translate-anchor"),R.layout.get("text-rotation-alignment"),R.layout.get("text-pitch-alignment"),R.layout.get("text-keep-upright"),ie,be,Y),I.map.showCollisionBoxes&&(ll(T,I,R,j,!0),ll(T,I,R,j,!1))})(r,s,p,m,this.style.placement.variableOffsets,b):o.cb(p)?(function(T,I,R,j,G){if(T.renderPass!=="translucent")return;const{isRenderingToTexture:X}=G,Y=R.paint.get("circle-opacity"),ie=R.paint.get("circle-stroke-width"),be=R.paint.get("circle-stroke-opacity"),Ue=!R.layout.get("circle-sort-key").isConstant();if(Y.constantOr(1)===0&&(ie.constantOr(1)===0||be.constantOr(1)===0))return;const je=T.context,qe=je.gl,Ke=T.transform,lt=T.getDepthModeForSublayer(0,pn.ReadOnly),nt=cn.disabled,dt=T.colorModeForRenderPass(),bt=[],rt=Ke.getCircleRadiusCorrection();for(let At=0;At<j.length;At++){const qt=j[At],Bt=I.getTile(qt),zt=Bt.getBucket(R);if(!zt)continue;const Vt=R.paint.get("circle-translate"),Dr=R.paint.get("circle-translate-anchor"),Ar=o.aC(Ke,Bt,Vt,Dr),sr=zt.programConfigurations.get(R.id),Xr=T.useProgram("circle",sr),On=zt.layoutVertexBuffer,Kn=zt.indexBuffer,Bi=T.style.map.terrain&&T.style.map.terrain.getTerrainData(qt),mi={programConfiguration:sr,program:Xr,layoutVertexBuffer:On,indexBuffer:Kn,uniformValues:xs(T,Bt,R,Ar,rt),terrainData:Bi,projectionData:Ke.getProjectionData({overscaledTileID:qt,applyGlobeMatrix:!X,applyTerrainMatrix:!0})};if(Ue){const gi=zt.segments.get();for(const ui of gi)bt.push({segments:new o.aL([ui]),sortKey:ui.sortKey,state:mi})}else bt.push({segments:zt.segments,sortKey:0,state:mi})}Ue&&bt.sort(((At,qt)=>At.sortKey-qt.sortKey));for(const At of bt){const{programConfiguration:qt,program:Bt,layoutVertexBuffer:zt,indexBuffer:Vt,uniformValues:Dr,terrainData:Ar,projectionData:sr}=At.state;Bt.draw(je,qe.TRIANGLES,lt,nt,dt,En.backCCW,Dr,Ar,sr,R.id,zt,Vt,At.segments,R.paint,T.transform.zoom,qt)}})(r,s,p,m,b):o.cc(p)?(function(T,I,R,j,G){if(R.paint.get("heatmap-opacity")===0)return;const X=T.context,{isRenderingToTexture:Y,isRenderingGlobe:ie}=G;if(T.style.map.terrain){for(const be of j){const Ue=I.getTile(be);I.hasRenderableParent(be)||(T.renderPass==="offscreen"?Ic(T,Ue,R,be,ie):T.renderPass==="translucent"&&Mc(T,R,be,Y,ie))}X.viewport.set([0,0,T.width,T.height])}else T.renderPass==="offscreen"?(function(be,Ue,je,qe){const Ke=be.context,lt=Ke.gl,nt=be.transform,dt=cn.disabled,bt=new rn([lt.ONE,lt.ONE],o.be.transparent,[!0,!0,!0,!0]);(function(rt,At,qt){const Bt=rt.gl;rt.activeTexture.set(Bt.TEXTURE1),rt.viewport.set([0,0,At.width/4,At.height/4]);let zt=qt.heatmapFbos.get(o.c1);zt?(Bt.bindTexture(Bt.TEXTURE_2D,zt.colorAttachment.get()),rt.bindFramebuffer.set(zt.framebuffer)):(zt=Mu(rt,At.width/4,At.height/4),qt.heatmapFbos.set(o.c1,zt))})(Ke,be,je),Ke.clear({color:o.be.transparent});for(let rt=0;rt<qe.length;rt++){const At=qe[rt];if(Ue.hasRenderableParent(At))continue;const qt=Ue.getTile(At),Bt=qt.getBucket(je);if(!Bt)continue;const zt=Bt.programConfigurations.get(je.id),Vt=be.useProgram("heatmap",zt),Dr=nt.getProjectionData({overscaledTileID:At,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),Ar=nt.getCircleRadiusCorrection();Vt.draw(Ke,lt.TRIANGLES,pn.disabled,dt,bt,En.backCCW,Va(qt,nt.zoom,je.paint.get("heatmap-intensity"),Ar),null,Dr,je.id,Bt.layoutVertexBuffer,Bt.indexBuffer,Bt.segments,je.paint,nt.zoom,zt)}Ke.viewport.set([0,0,be.width,be.height])})(T,I,R,j):T.renderPass==="translucent"&&(function(be,Ue){const je=be.context,qe=je.gl;je.setColorMode(be.colorModeForRenderPass());const Ke=Ue.heatmapFbos.get(o.c1);Ke&&(je.activeTexture.set(qe.TEXTURE0),qe.bindTexture(qe.TEXTURE_2D,Ke.colorAttachment.get()),je.activeTexture.set(qe.TEXTURE1),Lc(je,Ue).bind(qe.LINEAR,qe.CLAMP_TO_EDGE),be.useProgram("heatmapTexture").draw(je,qe.TRIANGLES,pn.disabled,cn.disabled,be.colorModeForRenderPass(),En.disabled,so(be,Ue,0,1),null,null,Ue.id,be.viewportBuffer,be.quadTriangleIndexBuffer,be.viewportSegments,Ue.paint,be.transform.zoom))})(T,R)})(r,s,p,m,b):o.cd(p)?(function(T,I,R,j,G){if(T.renderPass!=="translucent")return;const{isRenderingToTexture:X}=G,Y=R.paint.get("line-opacity"),ie=R.paint.get("line-width");if(Y.constantOr(1)===0||ie.constantOr(1)===0)return;const be=T.getDepthModeForSublayer(0,pn.ReadOnly),Ue=T.colorModeForRenderPass(),je=R.paint.get("line-dasharray"),qe=R.paint.get("line-pattern"),Ke=qe.constantOr(1),lt=R.paint.get("line-gradient"),nt=R.getCrossfadeParameters(),dt=Ke?"linePattern":je?"lineSDF":lt?"lineGradient":"line",bt=T.context,rt=bt.gl,At=T.transform;let qt=!0;for(const Bt of j){const zt=I.getTile(Bt);if(Ke&&!zt.patternsLoaded())continue;const Vt=zt.getBucket(R);if(!Vt)continue;const Dr=Vt.programConfigurations.get(R.id),Ar=T.context.program.get(),sr=T.useProgram(dt,Dr),Xr=qt||sr.program!==Ar,On=T.style.map.terrain&&T.style.map.terrain.getTerrainData(Bt),Kn=qe.constantOr(null);if(Kn&&zt.imageAtlas){const oi=zt.imageAtlas,vi=oi.patternPositions[Kn.to.toString()],Wo=oi.patternPositions[Kn.from.toString()];vi&&Wo&&Dr.setConstantPatternPositions(vi,Wo)}const Bi=At.getProjectionData({overscaledTileID:Bt,applyGlobeMatrix:!X,applyTerrainMatrix:!0}),mi=At.getPixelScale(),gi=Ke?mo(T,zt,R,mi,nt):je?rl(T,zt,R,mi,je,nt):lt?xo(T,zt,R,mi,Vt.lineClipsArray.length):Ss(T,zt,R,mi);if(Ke)bt.activeTexture.set(rt.TEXTURE0),zt.imageAtlasTexture.bind(rt.LINEAR,rt.CLAMP_TO_EDGE),Dr.updatePaintBuffers(nt);else if(je&&(Xr||T.lineAtlas.dirty))bt.activeTexture.set(rt.TEXTURE0),T.lineAtlas.bind(bt);else if(lt){const oi=Vt.gradients[R.id];let vi=oi.texture;if(R.gradientVersion!==oi.version){let Wo=256;if(R.stepInterpolant){const Hn=I.getSource().maxzoom,Ko=Bt.canonical.z===Hn?Math.ceil(1<<T.transform.maxZoom-Bt.canonical.z):1;Wo=o.ag(o.c2(Vt.maxLineLength/o.$*1024*Ko),256,bt.maxTextureSize)}oi.gradient=o.c3({expression:R.gradientExpression(),evaluationKey:"lineProgress",resolution:Wo,image:oi.gradient||void 0,clips:Vt.lineClipsArray}),oi.texture?oi.texture.update(oi.gradient):oi.texture=new o.T(bt,oi.gradient,rt.RGBA),oi.version=R.gradientVersion,vi=oi.texture}bt.activeTexture.set(rt.TEXTURE0),vi.bind(R.stepInterpolant?rt.NEAREST:rt.LINEAR,rt.CLAMP_TO_EDGE)}const ui=T.stencilModeForClipping(Bt);sr.draw(bt,rt.TRIANGLES,be,ui,Ue,En.disabled,gi,On,Bi,R.id,Vt.layoutVertexBuffer,Vt.indexBuffer,Vt.segments,R.paint,T.transform.zoom,Dr,Vt.layoutVertexBuffer2),qt=!1}})(r,s,p,m,b):o.ce(p)?(function(T,I,R,j,G){const X=R.paint.get("fill-color"),Y=R.paint.get("fill-opacity");if(Y.constantOr(1)===0)return;const{isRenderingToTexture:ie}=G,be=T.colorModeForRenderPass(),Ue=R.paint.get("fill-pattern"),je=T.opaquePassEnabledForLayer()&&!Ue.constantOr(1)&&X.constantOr(o.be.transparent).a===1&&Y.constantOr(0)===1?"opaque":"translucent";if(T.renderPass===je){const qe=T.getDepthModeForSublayer(1,T.renderPass==="opaque"?pn.ReadWrite:pn.ReadOnly);nc(T,I,R,j,qe,be,!1,ie)}if(T.renderPass==="translucent"&&R.paint.get("fill-antialias")){const qe=T.getDepthModeForSublayer(R.getPaintProperty("fill-outline-color")?2:0,pn.ReadOnly);nc(T,I,R,j,qe,be,!0,ie)}})(r,s,p,m,b):o.cf(p)?(function(T,I,R,j,G){const X=R.paint.get("fill-extrusion-opacity");if(X===0)return;const{isRenderingToTexture:Y}=G;if(T.renderPass==="translucent"){const ie=new pn(T.context.gl.LEQUAL,pn.ReadWrite,T.depthRangeFor3D);if(X!==1||R.paint.get("fill-extrusion-pattern").constantOr(1))Lu(T,I,R,j,ie,cn.disabled,rn.disabled,Y),Lu(T,I,R,j,ie,T.stencilModeFor3D(),T.colorModeForRenderPass(),Y);else{const be=T.colorModeForRenderPass();Lu(T,I,R,j,ie,cn.disabled,be,Y)}}})(r,s,p,m,b):o.cg(p)?(function(T,I,R,j,G){if(T.renderPass!=="offscreen"&&T.renderPass!=="translucent")return;const{isRenderingToTexture:X}=G,Y=T.context,ie=T.style.projection.useSubdivision,be=T.getDepthModeForSublayer(0,pn.ReadOnly),Ue=T.colorModeForRenderPass();if(T.renderPass==="offscreen")(function(je,qe,Ke,lt,nt,dt,bt){const rt=je.context,At=rt.gl;for(const qt of Ke){const Bt=qe.getTile(qt),zt=Bt.dem;if(!zt||!zt.data||!Bt.needsHillshadePrepare)continue;const Vt=zt.dim,Dr=zt.stride,Ar=zt.getPixels();if(rt.activeTexture.set(At.TEXTURE1),rt.pixelStoreUnpackPremultiplyAlpha.set(!1),Bt.demTexture=Bt.demTexture||je.getTileTexture(Dr),Bt.demTexture){const Xr=Bt.demTexture;Xr.update(Ar,{premultiply:!1}),Xr.bind(At.NEAREST,At.CLAMP_TO_EDGE)}else Bt.demTexture=new o.T(rt,Ar,At.RGBA,{premultiply:!1}),Bt.demTexture.bind(At.NEAREST,At.CLAMP_TO_EDGE);rt.activeTexture.set(At.TEXTURE0);let sr=Bt.fbo;if(!sr){const Xr=new o.T(rt,{width:Vt,height:Vt,data:null},At.RGBA);Xr.bind(At.LINEAR,At.CLAMP_TO_EDGE),sr=Bt.fbo=rt.createFramebuffer(Vt,Vt,!0,!1),sr.colorAttachment.set(Xr.texture)}rt.bindFramebuffer.set(sr.framebuffer),rt.viewport.set([0,0,Vt,Vt]),je.useProgram("hillshadePrepare").draw(rt,At.TRIANGLES,nt,dt,bt,En.disabled,iu(Bt.tileID,zt),null,null,lt.id,je.rasterBoundsBuffer,je.quadTriangleIndexBuffer,je.rasterBoundsSegments),Bt.needsHillshadePrepare=!1}})(T,I,j,R,be,cn.disabled,Ue),Y.viewport.set([0,0,T.width,T.height]);else if(T.renderPass==="translucent")if(ie){const[je,qe,Ke]=T.stencilConfigForOverlapTwoPass(j);Du(T,I,R,Ke,je,be,Ue,!1,X),Du(T,I,R,Ke,qe,be,Ue,!0,X)}else{const[je,qe]=T.getStencilConfigForOverlapAndUpdateStencilID(j);Du(T,I,R,qe,je,be,Ue,!1,X)}})(r,s,p,m,b):o.ch(p)?(function(T,I,R,j,G){if(T.renderPass!=="translucent"||!j.length)return;const{isRenderingToTexture:X}=G,Y=T.style.projection.useSubdivision,ie=T.getDepthModeForSublayer(0,pn.ReadOnly),be=T.colorModeForRenderPass();if(Y){const[Ue,je,qe]=T.stencilConfigForOverlapTwoPass(j);cu(T,I,R,qe,Ue,ie,be,!1,X),cu(T,I,R,qe,je,ie,be,!0,X)}else{const[Ue,je]=T.getStencilConfigForOverlapAndUpdateStencilID(j);cu(T,I,R,je,Ue,ie,be,!1,X)}})(r,s,p,m,b):o.ci(p)?(function(T,I,R,j,G){if(T.renderPass!=="translucent"||R.paint.get("raster-opacity")===0||!j.length)return;const{isRenderingToTexture:X}=G,Y=I.getSource(),ie=T.style.projection.useSubdivision;if(Y instanceof Jt)Ps(T,I,R,j,null,!1,!1,Y.tileCoords,Y.flippedWindingOrder,X);else if(ie){const[be,Ue,je]=T.stencilConfigForOverlapTwoPass(j);Ps(T,I,R,je,be,!1,!0,ic,!1,X),Ps(T,I,R,je,Ue,!0,!0,ic,!1,X)}else{const[be,Ue]=T.getStencilConfigForOverlapAndUpdateStencilID(j);Ps(T,I,R,Ue,be,!1,!0,ic,!1,X)}})(r,s,p,m,b):o.cj(p)?(function(T,I,R,j,G){const X=R.paint.get("background-color"),Y=R.paint.get("background-opacity");if(Y===0)return;const{isRenderingToTexture:ie}=G,be=T.context,Ue=be.gl,je=T.style.projection,qe=T.transform,Ke=qe.tileSize,lt=R.paint.get("background-pattern");if(T.isPatternMissing(lt))return;const nt=!lt&&X.a===1&&Y===1&&T.opaquePassEnabledForLayer()?"opaque":"translucent";if(T.renderPass!==nt)return;const dt=cn.disabled,bt=T.getDepthModeForSublayer(0,nt==="opaque"?pn.ReadWrite:pn.ReadOnly),rt=T.colorModeForRenderPass(),At=T.useProgram(lt?"backgroundPattern":"background"),qt=j||It(qe,{tileSize:Ke,terrain:T.style.map.terrain});lt&&(be.activeTexture.set(Ue.TEXTURE0),T.imageManager.bind(T.context));const Bt=R.getCrossfadeParameters();for(const zt of qt){const Vt=qe.getProjectionData({overscaledTileID:zt,applyGlobeMatrix:!ie,applyTerrainMatrix:!0}),Dr=lt?Tl(Y,T,lt,{tileID:zt,tileSize:Ke},Bt):ga(Y,X),Ar=T.style.map.terrain&&T.style.map.terrain.getTerrainData(zt),sr=je.getMeshFromTileID(be,zt.canonical,!1,!0,"raster");At.draw(be,Ue.TRIANGLES,bt,dt,rt,En.backCCW,Dr,Ar,Vt,R.id,sr.vertexBuffer,sr.indexBuffer,sr.segments)}})(r,0,p,m,b):o.ck(p)&&(function(T,I,R,j){const{isRenderingGlobe:G}=j,X=T.context,Y=R.implementation,ie=T.style.projection,be=T.transform,Ue=be.getProjectionDataForCustomLayer(G),je={farZ:be.farZ,nearZ:be.nearZ,fov:be.fov*Math.PI/180,modelViewProjectionMatrix:be.modelViewProjectionMatrix,projectionMatrix:be.projectionMatrix,shaderData:{variantName:ie.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
769
769
  uniform mat4 u_projection_matrix;
770
- ${ie.shaderPreludeCode.vertexSource}`,define:ie.shaderDefine},defaultProjectionData:Ue},qe=Y.renderingMode?Y.renderingMode:"2d";if(T.renderPass==="offscreen"){const Ke=Y.prerender;Ke&&(T.setCustomLayerDefaults(),X.setColorMode(T.colorModeForRenderPass()),Ke.call(Y,X.gl,je),X.setDirty(),T.setBaseState())}else if(T.renderPass==="translucent"){T.setCustomLayerDefaults(),X.setColorMode(T.colorModeForRenderPass()),X.setStencilMode(cn.disabled);const Ke=qe==="3d"?T.getDepthModeFor3D():T.getDepthModeForSublayer(0,pn.ReadOnly);X.setDepthMode(Ke),Y.render(X.gl,je),X.setDirty(),T.setBaseState(),X.bindFramebuffer.set(null)}})(r,0,p,b))}saveTileTexture(r){const s=this._tileTextures[r.size[0]];s?s.push(r):this._tileTextures[r.size[0]]=[r]}getTileTexture(r){const s=this._tileTextures[r];return s&&s.length>0?s.pop():null}isPatternMissing(r){if(!r)return!1;if(!r.from||!r.to)return!0;const s=this.imageManager.getPattern(r.from.toString()),p=this.imageManager.getPattern(r.to.toString());return!s||!p}useProgram(r,s,p=!1,m=[]){this.cache=this.cache||{};const b=!!this.style.map.terrain,T=this.style.projection,I=p?yt.projectionMercator:T.shaderPreludeCode,R=p?xr:T.shaderDefine,j=r+(s?s.cacheKey:"")+`/${p?Fr:T.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(b?"/terrain":"")+(m?`/${m.join("/")}`:"");return this.cache[j]||(this.cache[j]=new el(this.context,yt[r],s,is[r],this._showOverdrawInspector,b,I,R,m)),this.cache[j]}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 r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new o.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:r,drawingBufferHeight:s}=this.context.gl;return this.width!==r||this.height!==s}}function Ra(_,r){let s,p=!1,m=null,b=null;const T=()=>{m=null,p&&(_.apply(b,s),m=setTimeout(T,r),p=!1)};return(...I)=>(p=!0,b=this,s=I,m||T(),m)}class sc{constructor(r){this._getCurrentHash=()=>{const s=window.location.hash.replace("#","");if(this._hashName){let p;return s.split("&").map((m=>m.split("="))).forEach((m=>{m[0]===this._hashName&&(p=m)})),(p&&p[1]||"").split("/")}return s.split("/")},this._onHashChange=()=>{const s=this._getCurrentHash();if(!this._isValidHash(s))return!1;const p=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:p,pitch:+(s[4]||0)}),!0},this._updateHashUnthrottled=()=>{const s=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,s)},this._removeHash=()=>{const s=this._getCurrentHash();if(s.length===0)return;const p=s.join("/");let m=p;m.split("&").length>0&&(m=m.split("&")[0]),this._hashName&&(m=`${this._hashName}=${p}`);let b=window.location.hash.replace(m,"");b.startsWith("#&")?b=b.slice(0,1)+b.slice(2):b==="#"&&(b="");let T=window.location.href.replace(/(#.+)?$/,b);T=T.replace("&&","&"),window.history.replaceState(window.history.state,null,T)},this._updateHash=Ra(this._updateHashUnthrottled,300),this._hashName=r&&encodeURIComponent(r)}addTo(r){return this._map=r,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(r){const s=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,m=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),b=Math.pow(10,m),T=Math.round(s.lng*b)/b,I=Math.round(s.lat*b)/b,R=this._map.getBearing(),j=this._map.getPitch();let G="";if(G+=r?`/${T}/${I}/${p}`:`${p}/${I}/${T}`,(R||j)&&(G+="/"+Math.round(10*R)/10),j&&(G+=`/${Math.round(j)}`),this._hashName){const X=this._hashName;let Y=!1;const ie=window.location.hash.slice(1).split("&").map((be=>{const Ue=be.split("=")[0];return Ue===X?(Y=!0,`${Ue}=${G}`):be})).filter((be=>be));return Y||ie.push(`${X}=${G}`),`#${ie.join("&")}`}return`#${G}`}_isValidHash(r){if(r.length<3||r.some(isNaN))return!1;try{new o.S(+r[2],+r[1])}catch{return!1}const s=+r[0],p=+(r[3]||0),m=+(r[4]||0);return s>=this._map.getMinZoom()&&s<=this._map.getMaxZoom()&&p>=-180&&p<=180&&m>=this._map.getMinPitch()&&m<=this._map.getMaxPitch()}}const ku={linearity:.3,easing:o.cl(0,0,.3,1)},hu=o.e({deceleration:2500,maxSpeed:1400},ku),Dc=o.e({deceleration:20,maxSpeed:1400},ku),Ru=o.e({deceleration:1e3,maxSpeed:360},ku),kc=o.e({deceleration:1e3,maxSpeed:90},ku),of=o.e({deceleration:1e3,maxSpeed:360},ku);class lc{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:M.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,s=M.now();for(;r.length>0&&s-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const s={zoom:0,bearing:0,pitch:0,roll:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:b}of this._inertiaBuffer)s.zoom+=b.zoomDelta||0,s.bearing+=b.bearingDelta||0,s.pitch+=b.pitchDelta||0,s.roll+=b.rollDelta||0,b.panDelta&&s.pan._add(b.panDelta),b.around&&(s.around=b.around),b.pinchAround&&(s.pinchAround=b.pinchAround);const p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,m={};if(s.pan.mag()){const b=cl(s.pan.mag(),p,o.e({},hu,r||{})),T=s.pan.mult(b.amount/s.pan.mag()),I=this._map.cameraHelper.handlePanInertia(T,this._map.transform);m.center=I.easingCenter,m.offset=I.easingOffset,Pl(m,b)}if(s.zoom){const b=cl(s.zoom,p,Dc);m.zoom=this._map.transform.zoom+b.amount,Pl(m,b)}if(s.bearing){const b=cl(s.bearing,p,Ru);m.bearing=this._map.transform.bearing+o.ag(b.amount,-179,179),Pl(m,b)}if(s.pitch){const b=cl(s.pitch,p,kc);m.pitch=this._map.transform.pitch+b.amount,Pl(m,b)}if(s.roll){const b=cl(s.roll,p,of);m.roll=this._map.transform.roll+o.ag(b.amount,-179,179),Pl(m,b)}if(m.zoom||m.bearing){const b=s.pinchAround===void 0?s.around:s.pinchAround;m.around=b?this._map.unproject(b):this._map.getCenter()}return this.clear(),o.e(m,{noMoveStart:!0})}}function Pl(_,r){(!_.duration||_.duration<r.duration)&&(_.duration=r.duration,_.easing=r.easing)}function cl(_,r,s){const{maxSpeed:p,linearity:m,deceleration:b}=s,T=o.ag(_*m/(r/1e3),-p,p),I=Math.abs(T)/(b*m);return{easing:s.easing,duration:1e3*I,amount:T*(I/2)}}class _a extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,s,p,m={}){p=p instanceof MouseEvent?p:new MouseEvent(r,p);const b=E.mousePos(s.getCanvas(),p),T=s.unproject(b);super(r,o.e({point:b,lngLat:T,originalEvent:p},m)),this._defaultPrevented=!1,this.target=s}}class Ws extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,s,p){const m=r==="touchend"?p.changedTouches:p.touches,b=E.touchPos(s.getCanvasContainer(),m),T=b.map((R=>s.unproject(R))),I=b.reduce(((R,j,G,X)=>R.add(j.div(X.length))),new o.P(0,0));super(r,{points:b,point:I,lngLats:T,lngLat:s.unproject(I),originalEvent:p}),this._defaultPrevented=!1}}class Rc extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,s,p){super(r,{originalEvent:p}),this._defaultPrevented=!1}}class af{constructor(r,s){this._map=r,this._clickTolerance=s.clickTolerance}reset(){delete this._mousedownPos}wheel(r){return this._firePreventable(new Rc(r.type,this._map,r))}mousedown(r,s){return this._mousedownPos=s,this._firePreventable(new _a(r.type,this._map,r))}mouseup(r){this._map.fire(new _a(r.type,this._map,r))}click(r,s){this._mousedownPos&&this._mousedownPos.dist(s)>=this._clickTolerance||this._map.fire(new _a(r.type,this._map,r))}dblclick(r){return this._firePreventable(new _a(r.type,this._map,r))}mouseover(r){this._map.fire(new _a(r.type,this._map,r))}mouseout(r){this._map.fire(new _a(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Ws(r.type,this._map,r))}touchmove(r){this._map.fire(new Ws(r.type,this._map,r))}touchend(r){this._map.fire(new Ws(r.type,this._map,r))}touchcancel(r){this._map.fire(new Ws(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class sf{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(r){this._map.fire(new _a(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new _a("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._ignoreContextMenu||this._map.fire(new _a(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nu{constructor(r){this._map=r}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(r){return this.transform.screenPointToLocation(o.P.convert(r),this._map.terrain)}}class hh{constructor(r,s){this._map=r,this._tr=new Nu(r),this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=s.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,s){this.isEnabled()&&r.shiftKey&&r.button===0&&(E.disableDrag(),this._startPos=this._lastPos=s,this._active=!0)}mousemoveWindow(r,s){if(!this._active)return;const p=s;if(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)<this._clickTolerance)return;const m=this._startPos;this._lastPos=p,this._box||(this._box=E.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",r));const b=Math.min(m.x,p.x),T=Math.max(m.x,p.x),I=Math.min(m.y,p.y),R=Math.max(m.y,p.y);E.setTransform(this._box,`translate(${b}px,${I}px)`),this._box.style.width=T-b+"px",this._box.style.height=R-I+"px"}mouseupWindow(r,s){if(!this._active||r.button!==0)return;const p=this._startPos,m=s;if(this.reset(),E.suppressClick(),p.x!==m.x||p.y!==m.y)return this._map.fire(new o.l("boxzoomend",{originalEvent:r})),{cameraAnimation:b=>b.fitScreenCoordinates(p,m,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",r)}keydown(r){this._active&&r.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",r))}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(r,s){return this._map.fire(new o.l(r,{originalEvent:s}))}}function Nc(_,r){if(_.length!==r.length)throw new Error(`The number of touches and points are not equal - touches ${_.length}, points ${r.length}`);const s={};for(let p=0;p<_.length;p++)s[_[p].identifier]=r[p];return s}class lf{constructor(r){this.reset(),this.numTouches=r.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(r,s,p){(this.centroid||p.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=r.timeStamp),p.length===this.numTouches&&(this.centroid=(function(m){const b=new o.P(0,0);for(const T of m)b._add(T);return b.div(m.length)})(s),this.touches=Nc(p,s)))}touchmove(r,s,p){if(this.aborted||!this.centroid)return;const m=Nc(p,s);for(const b in this.touches){const T=m[b];(!T||T.dist(this.touches[b])>30)&&(this.aborted=!0)}}touchend(r,s,p){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){const m=!this.aborted&&this.centroid;if(this.reset(),m)return m}}}class uc{constructor(r){this.singleTap=new lf(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(r,s,p){this.singleTap.touchstart(r,s,p)}touchmove(r,s,p){this.singleTap.touchmove(r,s,p)}touchend(r,s,p){const m=this.singleTap.touchend(r,s,p);if(m){const b=r.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(m)<30;if(b&&T||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=m,this.count===this.numTaps)return this.reset(),m}}}class fu{constructor(r){this._tr=new Nu(r),this._zoomIn=new uc({numTouches:1,numTaps:2}),this._zoomOut=new uc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,s,p){this._zoomIn.touchstart(r,s,p),this._zoomOut.touchstart(r,s,p)}touchmove(r,s,p){this._zoomIn.touchmove(r,s,p),this._zoomOut.touchmove(r,s,p)}touchend(r,s,p){const m=this._zoomIn.touchend(r,s,p),b=this._zoomOut.touchend(r,s,p),T=this._tr;return m?(this._active=!0,r.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:T.zoom+1,around:T.unproject(m)},{originalEvent:r})}):b?(this._active=!0,r.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:T.zoom-1,around:T.unproject(b)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ou{constructor(r){this._enabled=!!r.enable,this._moveStateManager=r.moveStateManager,this._clickTolerance=r.clickTolerance||1,this._moveFunction=r.move,this._activateOnStart=!!r.activateOnStart,r.assignEvents(this),this.reset()}reset(r){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(r)}_move(...r){const s=this._moveFunction(...r);if(s.bearingDelta||s.pitchDelta||s.rollDelta||s.around||s.panDelta)return this._active=!0,s}dragStart(r,s){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(r)&&(this._moveStateManager.startMove(r),this._lastPoint=Array.isArray(s)?s[0]:s,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(r,s){if(!this.isEnabled())return;const p=this._lastPoint;if(!p)return;if(r.preventDefault(),!this._moveStateManager.isValidMoveEvent(r))return void this.reset(r);const m=Array.isArray(s)?s[0]:s;return!this._moved&&m.dist(p)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=m,this._move(p,m))}dragEnd(r){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(r)&&(this._moved&&E.suppressClick(),this.reset(r))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Is=0,Ms=2,C={[Is]:1,[Ms]:2};class L{constructor(r){this._correctEvent=r.checkCorrectEvent}startMove(r){const s=E.mouseButton(r);this._eventButton=s}endMove(r){delete this._eventButton}isValidStartEvent(r){return this._correctEvent(r)}isValidMoveEvent(r){return!(function(s,p){const m=C[p];return s.buttons===void 0||(s.buttons&m)!==m})(r,this._eventButton)}isValidEndEvent(r){return E.mouseButton(r)===this._eventButton}}class ${constructor(){this._firstTouch=void 0}_isOneFingerTouch(r){return r.targetTouches.length===1}_isSameTouchEvent(r){return r.targetTouches[0].identifier===this._firstTouch}startMove(r){this._firstTouch=r.targetTouches[0].identifier}endMove(r){delete this._firstTouch}isValidStartEvent(r){return this._isOneFingerTouch(r)}isValidMoveEvent(r){return this._isOneFingerTouch(r)&&this._isSameTouchEvent(r)}isValidEndEvent(r){return this._isOneFingerTouch(r)&&this._isSameTouchEvent(r)}}class K{constructor(r=new L({checkCorrectEvent:()=>!0}),s=new $){this.mouseMoveStateManager=r,this.oneFingerTouchMoveStateManager=s}_executeRelevantHandler(r,s,p){return r instanceof MouseEvent?s(r):typeof TouchEvent<"u"&&r instanceof TouchEvent?p(r):void 0}startMove(r){this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.startMove(s)),(s=>this.oneFingerTouchMoveStateManager.startMove(s)))}endMove(r){this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.endMove(s)),(s=>this.oneFingerTouchMoveStateManager.endMove(s)))}isValidStartEvent(r){return this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.isValidStartEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidStartEvent(s)))}isValidMoveEvent(r){return this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.isValidMoveEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(s)))}isValidEndEvent(r){return this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.isValidEndEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidEndEvent(s)))}}const ve=_=>{_.mousedown=_.dragStart,_.mousemoveWindow=_.dragMove,_.mouseup=_.dragEnd,_.contextmenu=r=>{r.preventDefault()}};class Ce{constructor(r,s){this._clickTolerance=r.clickTolerance||1,this._map=s,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.P(0,0)}_shouldBePrevented(r){return r<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(r,s,p){return this._calculateTransform(r,s,p)}touchmove(r,s,p){if(this._active){if(!this._shouldBePrevented(p.length))return r.preventDefault(),this._calculateTransform(r,s,p);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",r)}}touchend(r,s,p){this._calculateTransform(r,s,p),this._active&&this._shouldBePrevented(p.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(r,s,p){p.length>0&&(this._active=!0);const m=Nc(p,s),b=new o.P(0,0),T=new o.P(0,0);let I=0;for(const j in m){const G=m[j],X=this._touches[j];X&&(b._add(G),T._add(G.sub(X)),I++,m[j]=G)}if(this._touches=m,this._shouldBePrevented(I)||!T.mag())return;const R=T.div(I);return this._sum._add(R),this._sum.mag()<this._clickTolerance?void 0:{around:b.div(I),panDelta:R}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class De{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(r,s,p){this._firstTwoTouches||p.length<2||(this._firstTwoTouches=[p[0].identifier,p[1].identifier],this._start([s[0],s[1]]))}touchmove(r,s,p){if(!this._firstTwoTouches)return;r.preventDefault();const[m,b]=this._firstTwoTouches,T=Oe(p,s,m),I=Oe(p,s,b);if(!T||!I)return;const R=this._aroundCenter?null:T.add(I).div(2);return this._move([T,I],R,r)}touchend(r,s,p){if(!this._firstTwoTouches)return;const[m,b]=this._firstTwoTouches,T=Oe(p,s,m),I=Oe(p,s,b);T&&I||(this._active&&E.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(r){this._enabled=!0,this._aroundCenter=!!r&&r.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Oe(_,r,s){for(let p=0;p<_.length;p++)if(_[p].identifier===s)return r[p]}function $e(_,r){return Math.log(_/r)/Math.LN2}class Je extends De{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(r){this._startDistance=this._distance=r[0].dist(r[1])}_move(r,s){const p=this._distance;if(this._distance=r[0].dist(r[1]),this._active||!(Math.abs($e(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:$e(this._distance,p),pinchAround:s}}}function Qe(_,r){return 180*_.angleWith(r)/Math.PI}class Gt extends De{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(r){this._startVector=this._vector=r[0].sub(r[1]),this._minDiameter=r[0].dist(r[1])}_move(r,s,p){const m=this._vector;if(this._vector=r[0].sub(r[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Qe(this._vector,m),pinchAround:s}}_isBelowThreshold(r){this._minDiameter=Math.min(this._minDiameter,r.mag());const s=25/(Math.PI*this._minDiameter)*360,p=Qe(r,this._startVector);return Math.abs(p)<s}}function et(_){return Math.abs(_.y)>Math.abs(_.x)}class Lt extends De{constructor(r){super(),this._currentTouchCount=0,this._map=r}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(r,s,p){super.touchstart(r,s,p),this._currentTouchCount=p.length}_start(r){this._lastPoints=r,et(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,s,p){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const m=r[0].sub(this._lastPoints[0]),b=r[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(m,b,p.timeStamp),this._valid?(this._lastPoints=r,this._active=!0,{pitchDelta:(m.y+b.y)/2*-.5}):void 0}gestureBeginsVertically(r,s,p){if(this._valid!==void 0)return this._valid;const m=r.mag()>=2,b=s.mag()>=2;if(!m&&!b)return;if(!m||!b)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;const T=r.y>0==s.y>0;return et(r)&&et(s)&&T}}const Ot={panStep:100,bearingStep:15,pitchStep:10};class tr{constructor(r){this._tr=new Nu(r);const s=Ot;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let s=0,p=0,m=0,b=0,T=0;switch(r.keyCode){case 61:case 107:case 171:case 187:s=1;break;case 189:case 109:case 173:s=-1;break;case 37:r.shiftKey?p=-1:(r.preventDefault(),b=-1);break;case 39:r.shiftKey?p=1:(r.preventDefault(),b=1);break;case 38:r.shiftKey?m=1:(r.preventDefault(),T=-1);break;case 40:r.shiftKey?m=-1:(r.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(p=0,m=0),{cameraAnimation:I=>{const R=this._tr;I.easeTo({duration:300,easeId:"keyboardHandler",easing:$t,zoom:s?Math.round(R.zoom)+s*(r.shiftKey?2:1):R.zoom,bearing:R.bearing+p*this._bearingStep,pitch:R.pitch+m*this._pitchStep,offset:[-b*this._panStep,-T*this._panStep],center:R.center},{originalEvent:r})}}}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 $t(_){return _*(2-_)}const jt=4.000244140625,ir=1/450;class Cr{constructor(r,s){this._onTimeout=p=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},this._map=r,this._tr=new Nu(r),this._triggerRenderFrame=s,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=ir}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&r.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(r){return!!this._map.cooperativeGestures.isEnabled()&&!(r.ctrlKey||this._map.cooperativeGestures.isBypassed(r))}wheel(r){if(!this.isEnabled())return;if(this._shouldBePrevented(r))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",r);let s=r.deltaMode===WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const p=M.now(),m=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,s!==0&&s%jt==0?this._type="wheel":s!==0&&Math.abs(s)<4?this._type="trackpad":m>400?(this._type=null,this._lastValue=s,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(m*s)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,s+=this._lastValue)),r.shiftKey&&s&&(s/=4),this._type&&(this._lastWheelEvent=r,this._delta-=s,this._active||this._start(r)),r.preventDefault()}_start(r){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 s=E.mousePos(this._map.getCanvas(),r),p=this._tr;this._aroundPoint=this._aroundCenter?p.transform.locationToScreenPoint(o.S.convert(p.center)):s,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const I=r.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=I),typeof this._targetZoom=="number"&&(this._targetZoom+=I)}if(this._delta!==0){const I=this._type==="wheel"&&Math.abs(this._delta)>jt?this._wheelZoomRate:this._defaultZoomRate;let R=2/(1+Math.exp(-Math.abs(this._delta*I)));this._delta<0&&R!==0&&(R=1/R);const j=typeof this._targetZoom!="number"?r.scale:o.ae(this._targetZoom);this._targetZoom=r.getConstrained(r.getCameraLngLat(),o.aj(j*R)).zoom,this._type==="wheel"&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const s=typeof this._targetZoom!="number"?r.zoom:this._targetZoom,p=this._startZoom,m=this._easing;let b,T=!1;if(this._type==="wheel"&&p&&m){const I=M.now()-this._lastWheelEventTime,R=Math.min((I+5)/200,1),j=m(R);b=o.C.number(p,s,j),R<1?this._frameId||(this._frameId=!0):T=!0}else b=s,T=!0;return this._active=!0,T&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=b,{noInertia:!0,needsRenderFrame:!T,zoomDelta:b-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let s=o.cn;if(this._prevEase){const p=this._prevEase,m=(M.now()-p.start)/p.duration,b=p.easing(m+.01)-p.easing(m),T=.27/Math.sqrt(b*b+1e-4)*.01,I=Math.sqrt(.0729-T*T);s=o.cl(T,I,.25,1)}return this._prevEase={start:M.now(),duration:r,easing:s},s}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class mr{constructor(r,s){this._clickZoom=r,this._tapZoom=s}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 yn{constructor(r){this._tr=new Nu(r),this.reset()}reset(){this._active=!1}dblclick(r,s){return r.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:this._tr.zoom+(r.shiftKey?-1:1),around:this._tr.unproject(s)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class an{constructor(){this._tap=new uc({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(r,s,p){if(!this._swipePoint)if(this._tapTime){const m=s[0],b=r.timeStamp-this._tapTime<500,T=this._tapPoint.dist(m)<30;b&&T?p.length>0&&(this._swipePoint=m,this._swipeTouch=p[0].identifier):this.reset()}else this._tap.touchstart(r,s,p)}touchmove(r,s,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;const m=s[0],b=m.y-this._swipePoint.y;return this._swipePoint=m,r.preventDefault(),this._active=!0,{zoomDelta:b/128}}}else this._tap.touchmove(r,s,p)}touchend(r,s,p){if(this._tapTime)this._swipePoint&&p.length===0&&this.reset();else{const m=this._tap.touchend(r,s,p);m&&(this._tapTime=r.timeStamp,this._tapPoint=m)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zn{constructor(r,s,p){this._el=r,this._mousePan=s,this._touchPan=p}enable(r){this._inertiaOptions=r||{},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 un{constructor(r,s,p,m){this._pitchWithRotate=r.pitchWithRotate,this._rollEnabled=r.rollEnabled,this._mouseRotate=s,this._mousePitch=p,this._mouseRoll=m}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 Yn{constructor(r,s,p,m){this._el=r,this._touchZoom=s,this._touchRotate=p,this._tapDragZoom=m,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),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 ko{constructor(r,s){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=r,this._options=s,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const r=this._map.getCanvasContainer();r.classList.add("maplibregl-cooperative-gestures"),this._container=E.create("div","maplibregl-cooperative-gesture-screen",r);let s=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(s=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const p=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),m=document.createElement("div");m.className="maplibregl-desktop-message",m.textContent=s,this._container.appendChild(m);const b=document.createElement("div");b.className="maplibregl-mobile-message",b.textContent=p,this._container.appendChild(b),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(r){return r[this._bypassKey]}notifyGestureBlocked(r,s){this._enabled&&(this._map.fire(new o.l("cooperativegestureprevented",{gestureType:r,originalEvent:s})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const kn=_=>_.zoom||_.drag||_.roll||_.pitch||_.rotate;class fn extends o.l{}function $r(_){return _.panDelta&&_.panDelta.mag()||_.zoomDelta||_.bearingDelta||_.pitchDelta||_.rollDelta}class Mi{constructor(r,s){this.handleWindowEvent=m=>{this.handleEvent(m,`${m.type}Window`)},this.handleEvent=(m,b)=>{if(m.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const T=m.type==="renderFrame"?void 0:m,I={needsRenderFrame:!1},R={},j={};for(const{handlerName:Y,handler:ie,allowed:be}of this._handlers){if(!ie.isEnabled())continue;let Ue;if(this._blockedByActive(j,be,Y))ie.reset();else if(ie[b||m.type]){if(o.co(m,b||m.type)){const je=E.mousePos(this._map.getCanvas(),m);Ue=ie[b||m.type](m,je)}else if(o.cp(m,b||m.type)){const je=this._getMapTouches(m.touches),qe=E.touchPos(this._map.getCanvas(),je);Ue=ie[b||m.type](m,qe,je)}else o.cq(b||m.type)||(Ue=ie[b||m.type](m));this.mergeHandlerResult(I,R,Ue,Y,T),Ue&&Ue.needsRenderFrame&&this._triggerRenderFrame()}(Ue||ie.isActive())&&(j[Y]=ie)}const G={};for(const Y in this._previousActiveHandlers)j[Y]||(G[Y]=T);this._previousActiveHandlers=j,(Object.keys(G).length||$r(I))&&(this._changes.push([I,R,G]),this._triggerRenderFrame()),(Object.keys(j).length||$r(I))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:X}=I;X&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],X(this._map))},this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new lc(r),this._bearingSnap=s.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(s);const p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[window,"blur",void 0]];for(const[m,b,T]of this._listeners)E.addEventListener(m,b,m===document?this.handleWindowEvent:this.handleEvent,T)}destroy(){for(const[r,s,p]of this._listeners)E.removeEventListener(r,s,r===document?this.handleWindowEvent:this.handleEvent,p)}_addDefaultHandlers(r){const s=this._map,p=s.getCanvasContainer();this._add("mapEvent",new af(s,r));const m=s.boxZoom=new hh(s,r);this._add("boxZoom",m),r.interactive&&r.boxZoom&&m.enable();const b=s.cooperativeGestures=new ko(s,r.cooperativeGestures);this._add("cooperativeGestures",b),r.cooperativeGestures&&b.enable();const T=new fu(s),I=new yn(s);s.doubleClickZoom=new mr(I,T),this._add("tapZoom",T),this._add("clickZoom",I),r.interactive&&r.doubleClickZoom&&s.doubleClickZoom.enable();const R=new an;this._add("tapDragZoom",R);const j=s.touchPitch=new Lt(s);this._add("touchPitch",j),r.interactive&&r.touchPitch&&s.touchPitch.enable(r.touchPitch);const G=()=>s.project(s.getCenter()),X=(function({enable:nt,clickTolerance:dt,aroundCenter:bt=!0,minPixelCenterThreshold:rt=100,rotateDegreesPerPixelMoved:At=.8},qt){const Bt=new L({checkCorrectEvent:zt=>E.mouseButton(zt)===0&&zt.ctrlKey||E.mouseButton(zt)===2&&!zt.ctrlKey});return new Ou({clickTolerance:dt,move:(zt,Vt)=>{const Dr=qt();if(bt&&Math.abs(Dr.y-zt.y)>rt)return{bearingDelta:o.cm(new o.P(zt.x,Vt.y),Vt,Dr)};let Ar=(Vt.x-zt.x)*At;return bt&&Vt.y<Dr.y&&(Ar=-Ar),{bearingDelta:Ar}},moveStateManager:Bt,enable:nt,assignEvents:ve})})(r,G),Y=(function({enable:nt,clickTolerance:dt,pitchDegreesPerPixelMoved:bt=-.5}){const rt=new L({checkCorrectEvent:At=>E.mouseButton(At)===0&&At.ctrlKey||E.mouseButton(At)===2});return new Ou({clickTolerance:dt,move:(At,qt)=>({pitchDelta:(qt.y-At.y)*bt}),moveStateManager:rt,enable:nt,assignEvents:ve})})(r),ie=(function({enable:nt,clickTolerance:dt,rollDegreesPerPixelMoved:bt=.3},rt){const At=new L({checkCorrectEvent:qt=>E.mouseButton(qt)===2&&qt.ctrlKey});return new Ou({clickTolerance:dt,move:(qt,Bt)=>{const zt=rt();let Vt=(Bt.x-qt.x)*bt;return Bt.y<zt.y&&(Vt=-Vt),{rollDelta:Vt}},moveStateManager:At,enable:nt,assignEvents:ve})})(r,G);s.dragRotate=new un(r,X,Y,ie),this._add("mouseRotate",X,["mousePitch"]),this._add("mousePitch",Y,["mouseRotate","mouseRoll"]),this._add("mouseRoll",ie,["mousePitch"]),r.interactive&&r.dragRotate&&s.dragRotate.enable();const be=(function({enable:nt,clickTolerance:dt}){const bt=new L({checkCorrectEvent:rt=>E.mouseButton(rt)===0&&!rt.ctrlKey});return new Ou({clickTolerance:dt,move:(rt,At)=>({around:At,panDelta:At.sub(rt)}),activateOnStart:!0,moveStateManager:bt,enable:nt,assignEvents:ve})})(r),Ue=new Ce(r,s);s.dragPan=new zn(p,be,Ue),this._add("mousePan",be),this._add("touchPan",Ue,["touchZoom","touchRotate"]),r.interactive&&r.dragPan&&s.dragPan.enable(r.dragPan);const je=new Gt,qe=new Je;s.touchZoomRotate=new Yn(p,qe,je,R),this._add("touchRotate",je,["touchPan","touchZoom"]),this._add("touchZoom",qe,["touchPan","touchRotate"]),r.interactive&&r.touchZoomRotate&&s.touchZoomRotate.enable(r.touchZoomRotate);const Ke=s.scrollZoom=new Cr(s,(()=>this._triggerRenderFrame()));this._add("scrollZoom",Ke,["mousePan"]),r.interactive&&r.scrollZoom&&s.scrollZoom.enable(r.scrollZoom);const lt=s.keyboard=new tr(s);this._add("keyboard",lt),r.interactive&&r.keyboard&&s.keyboard.enable(),this._add("blockableMapEvent",new sf(s))}_add(r,s,p){this._handlers.push({handlerName:r,handler:s,allowed:p}),this._handlersById[r]=s}stop(r){if(!this._updatingCamera){for(const{handler:s}of this._handlers)s.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!kn(this._eventsInProgress)||this.isZooming()}_blockedByActive(r,s,p){for(const m in r)if(m!==p&&(!s||s.indexOf(m)<0))return!0;return!1}_getMapTouches(r){const s=[];for(const p of r)this._el.contains(p.target)&&s.push(p);return s}mergeHandlerResult(r,s,p,m,b){if(!p)return;o.e(r,p);const T={handlerName:m,originalEvent:p.originalEvent||b};p.zoomDelta!==void 0&&(s.zoom=T),p.panDelta!==void 0&&(s.drag=T),p.rollDelta!==void 0&&(s.roll=T),p.pitchDelta!==void 0&&(s.pitch=T),p.bearingDelta!==void 0&&(s.rotate=T)}_applyChanges(){const r={},s={},p={};for(const[m,b,T]of this._changes)m.panDelta&&(r.panDelta=(r.panDelta||new o.P(0,0))._add(m.panDelta)),m.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+m.zoomDelta),m.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+m.bearingDelta),m.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+m.pitchDelta),m.rollDelta&&(r.rollDelta=(r.rollDelta||0)+m.rollDelta),m.around!==void 0&&(r.around=m.around),m.pinchAround!==void 0&&(r.pinchAround=m.pinchAround),m.noInertia&&(r.noInertia=m.noInertia),o.e(s,b),o.e(p,T);this._updateMapTransform(r,s,p),this._changes=[]}_updateMapTransform(r,s,p){const m=this._map,b=m._getTransformForUpdate(),T=m.terrain;if(!($r(r)||T&&this._terrainMovement))return this._fireEvents(s,p,!0);m._stop(!0);let{panDelta:I,zoomDelta:R,bearingDelta:j,pitchDelta:G,rollDelta:X,around:Y,pinchAround:ie}=r;ie!==void 0&&(Y=ie),Y=Y||m.transform.centerPoint,T&&!b.isPointOnMapSurface(Y)&&(Y=b.centerPoint);const be={panDelta:I,zoomDelta:R,rollDelta:X,pitchDelta:G,bearingDelta:j,around:Y};this._map.cameraHelper.useGlobeControls&&!b.isPointOnMapSurface(Y)&&(Y=b.centerPoint);const Ue=Y.distSqr(b.centerPoint)<.01?b.center:b.screenPointToLocation(I?Y.sub(I):Y);T?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(be,b),this._terrainMovement||!s.drag&&!s.zoom?s.drag&&this._terrainMovement?b.setCenter(b.screenPointToLocation(b.centerPoint.sub(I))):this._map.cameraHelper.handleMapControlsPan(be,b,Ue):(this._terrainMovement=!0,this._map._elevationFreeze=!0,this._map.cameraHelper.handleMapControlsPan(be,b,Ue))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(be,b),this._map.cameraHelper.handleMapControlsPan(be,b,Ue)),m._applyUpdatedTransform(b),this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(s,p,!0)}_fireEvents(r,s,p){const m=kn(this._eventsInProgress),b=kn(r),T={};for(const X in r){const{originalEvent:Y}=r[X];this._eventsInProgress[X]||(T[`${X}start`]=Y),this._eventsInProgress[X]=r[X]}!m&&b&&this._fireEvent("movestart",b.originalEvent);for(const X in T)this._fireEvent(X,T[X]);b&&this._fireEvent("move",b.originalEvent);for(const X in r){const{originalEvent:Y}=r[X];this._fireEvent(X,Y)}const I={};let R;for(const X in this._eventsInProgress){const{handlerName:Y,originalEvent:ie}=this._eventsInProgress[X];this._handlersById[Y].isActive()||(delete this._eventsInProgress[X],R=s[Y]||ie,I[`${X}end`]=R)}for(const X in I)this._fireEvent(X,I[X]);const j=kn(this._eventsInProgress),G=(m||b)&&!j;if(G&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const X=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&X.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(X)}if(p&&G){this._updatingCamera=!0;const X=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Y=ie=>ie!==0&&-this._bearingSnap<ie&&ie<this._bearingSnap;!X||!X.essential&&M.prefersReducedMotion?(this._map.fire(new o.l("moveend",{originalEvent:R})),Y(this._map.getBearing())&&this._map.resetNorth()):(Y(X.bearing||this._map.getBearing())&&(X.bearing=0),X.freezeElevation=!0,this._map.easeTo(X,{originalEvent:R})),this._updatingCamera=!1}}_fireEvent(r,s){this._map.fire(new o.l(r,s?{originalEvent:s}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((r=>{delete this._frameId,this.handleEvent(new fn("renderFrame",{timeStamp:r})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class en extends o.E{constructor(r,s,p){super(),this._renderFrameCallback=()=>{const m=Math.min((M.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(m)),m<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=p.bearingSnap,this.cameraHelper=s,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(r,s){r.apply(this.transform),this.transform=r,this.cameraHelper=s}getCenter(){return new o.S(this.transform.center.lng,this.transform.center.lat)}setCenter(r,s){return this.jumpTo({center:r},s)}getCenterElevation(){return this.transform.elevation}setCenterElevation(r,s){return this.jumpTo({elevation:r},s),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(r){this._centerClampedToGround=r}panBy(r,s,p){return r=o.P.convert(r).mult(-1),this.panTo(this.transform.center,o.e({offset:r},s),p)}panTo(r,s,p){return this.easeTo(o.e({center:r},s),p)}getZoom(){return this.transform.zoom}setZoom(r,s){return this.jumpTo({zoom:r},s),this}zoomTo(r,s,p){return this.easeTo(o.e({zoom:r},s),p)}zoomIn(r,s){return this.zoomTo(this.getZoom()+1,r,s),this}zoomOut(r,s){return this.zoomTo(this.getZoom()-1,r,s),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(r,s){return r!=this.transform.fov&&(this.transform.setFov(r),this.fire(new o.l("movestart",s)).fire(new o.l("move",s)).fire(new o.l("moveend",s))),this}getBearing(){return this.transform.bearing}setBearing(r,s){return this.jumpTo({bearing:r},s),this}getPadding(){return this.transform.padding}setPadding(r,s){return this.jumpTo({padding:r},s),this}rotateTo(r,s,p){return this.easeTo(o.e({bearing:r},s),p)}resetNorth(r,s){return this.rotateTo(0,o.e({duration:1e3},r),s),this}resetNorthPitch(r,s){return this.easeTo(o.e({bearing:0,pitch:0,roll:0,duration:1e3},r),s),this}snapToNorth(r,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(r,s):this}getPitch(){return this.transform.pitch}setPitch(r,s){return this.jumpTo({pitch:r},s),this}getRoll(){return this.transform.roll}setRoll(r,s){return this.jumpTo({roll:r},s),this}cameraForBounds(r,s){r=Kt.convert(r).adjustAntiMeridian();const p=s&&s.bearing||0;return this._cameraForBoxAndBearing(r.getNorthWest(),r.getSouthEast(),p,s)}_cameraForBoxAndBearing(r,s,p,m){const b={top:0,bottom:0,right:0,left:0};if(typeof(m=o.e({padding:b,offset:[0,0],maxZoom:this.transform.maxZoom},m)).padding=="number"){const j=m.padding;m.padding={top:j,bottom:j,right:j,left:j}}const T=o.e(b,m.padding);m.padding=T;const I=this.transform,R=new Kt(r,s);return this.cameraHelper.cameraForBoxAndBearing(m,T,R,p,I)}fitBounds(r,s,p){return this._fitInternal(this.cameraForBounds(r,s),s,p)}fitScreenCoordinates(r,s,p,m,b){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(o.P.convert(r)),this.transform.screenPointToLocation(o.P.convert(s)),p,m),m,b)}_fitInternal(r,s,p){return r?(delete(s=o.e(r,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this}jumpTo(r,s){this.stop();const p=this._getTransformForUpdate();let m=!1,b=!1,T=!1;const I=p.zoom;this.cameraHelper.handleJumpToCenterZoom(p,r);const R=p.zoom!==I;return"elevation"in r&&p.elevation!==+r.elevation&&p.setElevation(+r.elevation),"bearing"in r&&p.bearing!==+r.bearing&&(m=!0,p.setBearing(+r.bearing)),"pitch"in r&&p.pitch!==+r.pitch&&(b=!0,p.setPitch(+r.pitch)),"roll"in r&&p.roll!==+r.roll&&(T=!0,p.setRoll(+r.roll)),r.padding==null||p.isPaddingEqual(r.padding)||p.setPadding(r.padding),this._applyUpdatedTransform(p),this.fire(new o.l("movestart",s)).fire(new o.l("move",s)),R&&this.fire(new o.l("zoomstart",s)).fire(new o.l("zoom",s)).fire(new o.l("zoomend",s)),m&&this.fire(new o.l("rotatestart",s)).fire(new o.l("rotate",s)).fire(new o.l("rotateend",s)),b&&this.fire(new o.l("pitchstart",s)).fire(new o.l("pitch",s)).fire(new o.l("pitchend",s)),T&&this.fire(new o.l("rollstart",s)).fire(new o.l("roll",s)).fire(new o.l("rollend",s)),this.fire(new o.l("moveend",s))}calculateCameraOptionsFromTo(r,s,p,m=0){const b=o.a0.fromLngLat(r,s),T=o.a0.fromLngLat(p,m),I=T.x-b.x,R=T.y-b.y,j=T.z-b.z,G=Math.hypot(I,R,j);if(G===0)throw new Error("Can't calculate camera options with same From and To");const X=Math.hypot(I,R),Y=o.aj(this.transform.cameraToCenterDistance/G/this.transform.tileSize),ie=180*Math.atan2(I,-R)/Math.PI;let be=180*Math.acos(X/G)/Math.PI;return be=j<0?90-be:90+be,{center:T.toLngLat(),elevation:m,zoom:Y,pitch:be,bearing:ie}}calculateCameraOptionsFromCameraLngLatAltRotation(r,s,p,m,b){const T=this.transform.calculateCenterFromCameraLngLatAlt(r,s,p,m);return{center:T.center,elevation:T.elevation,zoom:T.zoom,bearing:p,pitch:m,roll:b}}easeTo(r,s){this._stop(!1,r.easeId),((r=o.e({offset:[0,0],duration:500,easing:o.cn},r)).animate===!1||!r.essential&&M.prefersReducedMotion)&&(r.duration=0);const p=this._getTransformForUpdate(),m=this.getBearing(),b=p.pitch,T=p.roll,I="bearing"in r?this._normalizeBearing(r.bearing,m):m,R="pitch"in r?+r.pitch:b,j="roll"in r?this._normalizeBearing(r.roll,T):T,G="padding"in r?r.padding:p.padding,X=o.P.convert(r.offset);let Y,ie;r.around&&(Y=o.S.convert(r.around),ie=p.locationToScreenPoint(Y));const be={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},Ue=this.cameraHelper.handleEaseTo(p,{bearing:I,pitch:R,roll:j,padding:G,around:Y,aroundPoint:ie,offsetAsPoint:X,offset:r.offset,zoom:r.zoom,center:r.center});return this._rotating=this._rotating||m!==I,this._pitching=this._pitching||R!==b,this._rolling=this._rolling||j!==T,this._padding=!p.isPaddingEqual(G),this._zooming=this._zooming||Ue.isZooming,this._easeId=r.easeId,this._prepareEase(s,r.noMoveStart,be),this.terrain&&this._prepareElevation(Ue.elevationCenter),this._ease((je=>{Ue.easeFunc(je),this.terrain&&!r.freezeElevation&&this._updateElevation(je),this._applyUpdatedTransform(p),this._fireMoveEvents(s)}),(je=>{this.terrain&&r.freezeElevation&&this._finalizeElevation(),this._afterEase(s,je)}),r),this}_prepareEase(r,s,p={}){this._moving=!0,s||p.moving||this.fire(new o.l("movestart",r)),this._zooming&&!p.zooming&&this.fire(new o.l("zoomstart",r)),this._rotating&&!p.rotating&&this.fire(new o.l("rotatestart",r)),this._pitching&&!p.pitching&&this.fire(new o.l("pitchstart",r)),this._rolling&&!p.rolling&&this.fire(new o.l("rollstart",r))}_prepareElevation(r){this._elevationCenter=r,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(r){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const s=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(r<1&&s!==this._elevationTarget){const p=this._elevationTarget-this._elevationStart;this._elevationStart+=r*(p-(s-(p*r+this._elevationStart))/(1-r)),this._elevationTarget=s}this.transform.setElevation(o.C.number(this._elevationStart,this._elevationTarget,r))}_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(r){if(!this.terrain&&r.elevation>=0&&r.pitch<=90)return{};const s=r.getCameraLngLat(),p=r.getCameraAltitude(),m=this.terrain?this.terrain.getElevationForLngLatZoom(s,r.zoom):0;if(p<m){const b=this.calculateCameraOptionsFromTo(s,m,r.center,r.elevation);return{pitch:b.pitch,zoom:b.zoom}}return{}}_applyUpdatedTransform(r){const s=[];if(s.push((m=>this._elevateCameraIfInsideTerrain(m))),this.transformCameraUpdate&&s.push((m=>this.transformCameraUpdate(m))),!s.length)return;const p=r.clone();for(const m of s){const b=p.clone(),{center:T,zoom:I,roll:R,pitch:j,bearing:G,elevation:X}=m(b);T&&b.setCenter(T),X!==void 0&&b.setElevation(X),I!==void 0&&b.setZoom(I),R!==void 0&&b.setRoll(R),j!==void 0&&b.setPitch(j),G!==void 0&&b.setBearing(G),p.apply(b)}this.transform.apply(p)}_fireMoveEvents(r){this.fire(new o.l("move",r)),this._zooming&&this.fire(new o.l("zoom",r)),this._rotating&&this.fire(new o.l("rotate",r)),this._pitching&&this.fire(new o.l("pitch",r)),this._rolling&&this.fire(new o.l("roll",r))}_afterEase(r,s){if(this._easeId&&s&&this._easeId===s)return;delete this._easeId;const p=this._zooming,m=this._rotating,b=this._pitching,T=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,p&&this.fire(new o.l("zoomend",r)),m&&this.fire(new o.l("rotateend",r)),b&&this.fire(new o.l("pitchend",r)),T&&this.fire(new o.l("rollend",r)),this.fire(new o.l("moveend",r))}flyTo(r,s){if(!r.essential&&M.prefersReducedMotion){const Vt=o.Q(r,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(Vt,s)}this.stop(),r=o.e({offset:[0,0],speed:1.2,curve:1.42,easing:o.cn},r);const p=this._getTransformForUpdate(),m=p.bearing,b=p.pitch,T=p.roll,I=p.padding,R="bearing"in r?this._normalizeBearing(r.bearing,m):m,j="pitch"in r?+r.pitch:b,G="roll"in r?this._normalizeBearing(r.roll,T):T,X="padding"in r?r.padding:p.padding,Y=o.P.convert(r.offset);let ie=p.centerPoint.add(Y);const be=p.screenPointToLocation(ie),Ue=this.cameraHelper.handleFlyTo(p,{bearing:R,pitch:j,roll:G,padding:X,locationAtOffset:be,offsetAsPoint:Y,center:r.center,minZoom:r.minZoom,zoom:r.zoom});let je=r.curve;const qe=Math.max(p.width,p.height),Ke=qe/Ue.scaleOfZoom,lt=Ue.pixelPathLength;typeof Ue.scaleOfMinZoom=="number"&&(je=Math.sqrt(qe/Ue.scaleOfMinZoom/lt*2));const nt=je*je;function dt(Vt){const Dr=(Ke*Ke-qe*qe+(Vt?-1:1)*nt*nt*lt*lt)/(2*(Vt?Ke:qe)*nt*lt);return Math.log(Math.sqrt(Dr*Dr+1)-Dr)}function bt(Vt){return(Math.exp(Vt)-Math.exp(-Vt))/2}function rt(Vt){return(Math.exp(Vt)+Math.exp(-Vt))/2}const At=dt(!1);let qt=function(Vt){return rt(At)/rt(At+je*Vt)},Bt=function(Vt){return qe*((rt(At)*(bt(Dr=At+je*Vt)/rt(Dr))-bt(At))/nt)/lt;var Dr},zt=(dt(!0)-At)/je;if(Math.abs(lt)<2e-6||!isFinite(zt)){if(Math.abs(qe-Ke)<1e-6)return this.easeTo(r,s);const Vt=Ke<qe?-1:1;zt=Math.abs(Math.log(Ke/qe))/je,Bt=()=>0,qt=Dr=>Math.exp(Vt*je*Dr)}return r.duration="duration"in r?+r.duration:1e3*zt/("screenSpeed"in r?+r.screenSpeed/je:+r.speed),r.maxDuration&&r.duration>r.maxDuration&&(r.duration=0),this._zooming=!0,this._rotating=m!==R,this._pitching=j!==b,this._rolling=G!==T,this._padding=!p.isPaddingEqual(X),this._prepareEase(s,!1),this.terrain&&this._prepareElevation(Ue.targetCenter),this._ease((Vt=>{const Dr=Vt*zt,Ar=1/qt(Dr),sr=Bt(Dr);this._rotating&&p.setBearing(o.C.number(m,R,Vt)),this._pitching&&p.setPitch(o.C.number(b,j,Vt)),this._rolling&&p.setRoll(o.C.number(T,G,Vt)),this._padding&&(p.interpolatePadding(I,X,Vt),ie=p.centerPoint.add(Y)),Ue.easeFunc(Vt,Ar,sr,ie),this.terrain&&!r.freezeElevation&&this._updateElevation(Vt),this._applyUpdatedTransform(p),this._fireMoveEvents(s)}),(()=>{this.terrain&&r.freezeElevation&&this._finalizeElevation(),this._afterEase(s)}),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,s){var p;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const m=this._onEaseEnd;delete this._onEaseEnd,m.call(this,s)}return r||(p=this.handlers)===null||p===void 0||p.stop(!1),this}_ease(r,s,p){p.animate===!1||p.duration===0?(r(1),s()):(this._easeStart=M.now(),this._easeOptions=p,this._onEaseFrame=r,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(r,s){r=o.aN(r,-180,180);const p=Math.abs(r-s);return Math.abs(r-360-s)<p&&(r-=360),Math.abs(r+360-s)<p&&(r+=360),r}queryTerrainElevation(r){return this.terrain?this.terrain.getElevationForLngLatZoom(o.S.convert(r),this.transform.tileZoom):null}}const Gn={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Li{constructor(r=Gn){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=s=>{!s||s.sourceDataType!=="metadata"&&s.sourceDataType!=="visibility"&&s.dataType!=="style"&&s.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=r}getDefaultPosition(){return"bottom-right"}onAdd(r){return this._map=r,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(r,s){const p=this._map._getUIString(`AttributionControl.${s}`);r.title=p,r.setAttribute("aria-label",p)}_updateAttributions(){if(!this._map.style)return;let r=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=r.concat(this.options.customAttribution.map((m=>typeof m!="string"?"":m))):typeof this.options.customAttribution=="string"&&r.push(this.options.customAttribution)),this._map.style.stylesheet){const m=this._map.style.stylesheet;this.styleOwner=m.owner,this.styleId=m.id}const s=this._map.style.sourceCaches;for(const m in s){const b=s[m];if(b.used||b.usedForTerrain){const T=b.getSource();T.attribution&&r.indexOf(T.attribution)<0&&r.push(T.attribution)}}r=r.filter((m=>String(m).trim())),r.sort(((m,b)=>m.length-b.length)),r=r.filter(((m,b)=>{for(let T=b+1;T<r.length;T++)if(r[T].indexOf(m)>=0)return!1;return!0}));const p=r.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,r.length?(this._innerContainer.innerHTML=E.sanitize(p),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Vo{constructor(r={}){this._updateCompact=()=>{const s=this._container.children;if(s.length){const p=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&p.classList.add("maplibregl-compact"):p.classList.remove("maplibregl-compact")}},this.options=r}getDefaultPosition(){return"bottom-left"}onAdd(r){this._map=r,this._compact=this.options&&this.options.compact,this._container=E.create("div","maplibregl-ctrl");const s=E.create("a","maplibregl-ctrl-logo");return s.target="_blank",s.rel="noopener nofollow",s.href="https://maplibre.org/",s.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),s.setAttribute("rel","noopener nofollow"),this._container.appendChild(s),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 va{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const s=++this._id;return this._queue.push({callback:r,id:s,cancelled:!1}),s}remove(r){const s=this._currentlyRunning,p=s?this._queue.concat(s):this._queue;for(const m of p)if(m.id===r)return void(m.cancelled=!0)}run(r=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const s=this._currentlyRunning=this._queue;this._queue=[];for(const p of s)if(!p.cancelled&&(p.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var uo=o.aI([{name:"a_pos3d",type:"Int16",components:3}]);class ba extends o.E{constructor(r){super(),this._lastTilesetChange=M.now(),this.sourceCache=r,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=r._source.tileSize*2**this.deltaZoom,r.usedForTerrain=!0,r.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(r,s){this.sourceCache.update(r,s),this._renderableTilesKeys=[];const p={};for(const m of It(r,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:s,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))p[m.key]=!0,this._renderableTilesKeys.push(m.key),this._tiles[m.key]||(m.terrainRttPosMatrix32f=new Float64Array(16),o.bX(m.terrainRttPosMatrix32f,0,o.$,o.$,0,0,1),this._tiles[m.key]=new Ur(m,this.tileSize),this._lastTilesetChange=M.now());for(const m in this._tiles)p[m]||delete this._tiles[m]}freeRtt(r){for(const s in this._tiles){const p=this._tiles[s];(!r||p.tileID.equals(r)||p.tileID.isChildOf(r)||r.isChildOf(p.tileID))&&(p.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((r=>this.getTileByID(r)))}getTileByID(r){return this._tiles[r]}getTerrainCoords(r,s){return s?this._getTerrainCoordsForTileRanges(r,s):this._getTerrainCoordsForRegularTile(r)}_getTerrainCoordsForRegularTile(r){const s={};for(const p of this._renderableTilesKeys){const m=this._tiles[p].tileID,b=r.clone(),T=o.b9();if(m.canonical.equals(r.canonical))o.bX(T,0,o.$,o.$,0,0,1);else if(m.canonical.isChildOf(r.canonical)){const I=m.canonical.z-r.canonical.z,R=m.canonical.x-(m.canonical.x>>I<<I),j=m.canonical.y-(m.canonical.y>>I<<I),G=o.$>>I;o.bX(T,0,G,G,0,0,1),o.M(T,T,[-R*G,-j*G,0])}else{if(!r.canonical.isChildOf(m.canonical))continue;{const I=r.canonical.z-m.canonical.z,R=r.canonical.x-(r.canonical.x>>I<<I),j=r.canonical.y-(r.canonical.y>>I<<I),G=o.$>>I;o.bX(T,0,o.$,o.$,0,0,1),o.M(T,T,[R*G,j*G,0]),o.N(T,T,[1/2**I,1/2**I,0])}}b.terrainRttPosMatrix32f=new Float32Array(T),s[p]=b}return s}_getTerrainCoordsForTileRanges(r,s){const p={};for(const m of this._renderableTilesKeys){const b=this._tiles[m].tileID;if(!this._isWithinTileRanges(b,s))continue;const T=r.clone(),I=o.b9();if(b.canonical.z===r.canonical.z){const R=r.canonical.x-b.canonical.x,j=r.canonical.y-b.canonical.y;o.bX(I,0,o.$,o.$,0,0,1),o.M(I,I,[R*o.$,j*o.$,0])}else if(b.canonical.z>r.canonical.z){const R=b.canonical.z-r.canonical.z,j=b.canonical.x-(b.canonical.x>>R<<R),G=b.canonical.y-(b.canonical.y>>R<<R),X=r.canonical.x-(b.canonical.x>>R),Y=r.canonical.y-(b.canonical.y>>R),ie=o.$>>R;o.bX(I,0,ie,ie,0,0,1),o.M(I,I,[-j*ie+X*o.$,-G*ie+Y*o.$,0])}else{const R=r.canonical.z-b.canonical.z,j=r.canonical.x-(r.canonical.x>>R<<R),G=r.canonical.y-(r.canonical.y>>R<<R),X=(r.canonical.x>>R)-b.canonical.x,Y=(r.canonical.y>>R)-b.canonical.y,ie=o.$<<R;o.bX(I,0,ie,ie,0,0,1),o.M(I,I,[j*o.$+X*ie,G*o.$+Y*ie,0])}T.terrainRttPosMatrix32f=new Float32Array(I),p[m]=T}return p}getSourceTile(r,s){const p=this.sourceCache._source;let m=r.overscaledZ-this.deltaZoom;if(m>p.maxzoom&&(m=p.maxzoom),m<p.minzoom)return null;this._sourceTileCache[r.key]||(this._sourceTileCache[r.key]=r.scaledTo(m).key);let b=this.sourceCache.getTileByID(this._sourceTileCache[r.key]);if((!b||!b.dem)&&s)for(;m>=p.minzoom&&(!b||!b.dem);)b=this.sourceCache.getTileByID(r.scaledTo(m--).key);return b}anyTilesAfterTime(r=Date.now()){return this._lastTilesetChange>=r}_isWithinTileRanges(r,s){return s[r.canonical.z]&&r.canonical.x>=s[r.canonical.z].minTileX&&r.canonical.x<=s[r.canonical.z].maxTileX&&r.canonical.y>=s[r.canonical.z].minTileY&&r.canonical.y<=s[r.canonical.z].maxTileY}}class Ki{constructor(r,s,p){this._meshCache={},this.painter=r,this.sourceCache=new ba(s),this.options=p,this.exaggeration=typeof p.exaggeration=="number"?p.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(r,s,p,m=o.$){var b;if(!(s>=0&&s<m&&p>=0&&p<m))return 0;const T=this.getTerrainData(r),I=(b=T.tile)===null||b===void 0?void 0:b.dem;if(!I)return 0;const R=o.cr([],[s/m*o.$,p/m*o.$],T.u_terrain_matrix),j=[R[0]*I.dim,R[1]*I.dim],G=Math.floor(j[0]),X=Math.floor(j[1]),Y=j[0]-G,ie=j[1]-X;return I.get(G,X)*(1-Y)*(1-ie)+I.get(G+1,X)*Y*(1-ie)+I.get(G,X+1)*(1-Y)*ie+I.get(G+1,X+1)*Y*ie}getElevationForLngLatZoom(r,s){if(!o.cs(s,r.wrap()))return 0;const{tileID:p,mercatorX:m,mercatorY:b}=this._getOverscaledTileIDFromLngLatZoom(r,s);return this.getElevation(p,m%o.$,b%o.$,o.$)}getElevation(r,s,p,m=o.$){return this.getDEMElevation(r,s,p,m)*this.exaggeration}getTerrainData(r){if(!this._emptyDemTexture){const m=this.painter.context,b=new o.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new o.T(m,b,m.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new o.T(m,new o.R({width:1,height:1}),m.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(m.gl.NEAREST,m.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=o.af([])}const s=this.sourceCache.getSourceTile(r,!0);if(s&&s.dem&&(!s.demTexture||s.needsTerrainPrepare)){const m=this.painter.context;s.demTexture=this.painter.getTileTexture(s.dem.stride),s.demTexture?s.demTexture.update(s.dem.getPixels(),{premultiply:!1}):s.demTexture=new o.T(m,s.dem.getPixels(),m.gl.RGBA,{premultiply:!1}),s.demTexture.bind(m.gl.NEAREST,m.gl.CLAMP_TO_EDGE),s.needsTerrainPrepare=!1}const p=s&&s+s.tileID.key+r.key;if(p&&!this._demMatrixCache[p]){const m=this.sourceCache.sourceCache._source.maxzoom;let b=r.canonical.z-s.tileID.canonical.z;r.overscaledZ>r.canonical.z&&(r.canonical.z>=m?b=r.canonical.z-m:o.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const T=r.canonical.x-(r.canonical.x>>b<<b),I=r.canonical.y-(r.canonical.y>>b<<b),R=o.ct(new Float64Array(16),[1/(o.$<<b),1/(o.$<<b),0]);o.M(R,R,[T*o.$,I*o.$,0]),this._demMatrixCache[r.key]={matrix:R,coord:r}}return{u_depth:2,u_terrain:3,u_terrain_dim:s&&s.dem&&s.dem.dim||1,u_terrain_matrix:p?this._demMatrixCache[r.key].matrix:this._emptyDemMatrix,u_terrain_unpack:s&&s.dem&&s.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(s&&s.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:s}}getFramebuffer(r){const s=this.painter,p=s.width/devicePixelRatio,m=s.height/devicePixelRatio;return!this._fbo||this._fbo.width===p&&this._fbo.height===m||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new o.T(s.context,{width:p,height:m,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new o.T(s.context,{width:p,height:m,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=s.context.createFramebuffer(p,m,!0,!1),this._fbo.depthAttachment.set(s.context.createRenderbuffer(s.context.gl.DEPTH_COMPONENT16,p,m))),this._fbo.colorAttachment.set(r==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const r=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const s=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let b=0,T=0;b<this._coordsTextureSize;b++)for(let I=0;I<this._coordsTextureSize;I++,T+=4)s[T+0]=255&I,s[T+1]=255&b,s[T+2]=I>>8<<4|b>>8,s[T+3]=0;const p=new o.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(s.buffer)),m=new o.T(r,p,r.gl.RGBA,{premultiply:!1});return m.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),this._coordsTexture=m,m}pointCoordinate(r){this.painter.maybeDrawDepthAndCoords(!0);const s=new Uint8Array(4),p=this.painter.context,m=p.gl,b=Math.round(r.x*this.painter.pixelRatio/devicePixelRatio),T=Math.round(r.y*this.painter.pixelRatio/devicePixelRatio),I=Math.round(this.painter.height/devicePixelRatio);p.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),m.readPixels(b,I-T-1,1,1,m.RGBA,m.UNSIGNED_BYTE,s),p.bindFramebuffer.set(null);const R=s[0]+(s[2]>>4<<8),j=s[1]+((15&s[2])<<8),G=this.coordsIndex[255-s[3]],X=G&&this.sourceCache.getTileByID(G);if(!X)return null;const Y=this._coordsTextureSize,ie=(1<<X.tileID.canonical.z)*Y;return new o.a0((X.tileID.canonical.x*Y+R)/ie+X.tileID.wrap,(X.tileID.canonical.y*Y+j)/ie,this.getElevation(X.tileID,R,j,Y))}depthAtPoint(r){const s=new Uint8Array(4),p=this.painter.context,m=p.gl;return p.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),m.readPixels(r.x,this.painter.height/devicePixelRatio-r.y-1,1,1,m.RGBA,m.UNSIGNED_BYTE,s),p.bindFramebuffer.set(null),(s[0]/16777216+s[1]/65536+s[2]/256+s[3])/256}getTerrainMesh(r){var s;const p=((s=this.painter.style.projection)===null||s===void 0?void 0:s.transitionState)>0,m=p&&r.canonical.y===0,b=p&&r.canonical.y===(1<<r.canonical.z)-1,T=`m_${m?"n":""}_${b?"s":""}`;if(this._meshCache[T])return this._meshCache[T];const I=this.painter.context,R=new o.cu,j=new o.aM,G=this.meshSize,X=o.$/G,Y=G*G;for(let rt=0;rt<=G;rt++)for(let At=0;At<=G;At++)R.emplaceBack(At*X,rt*X,0);for(let rt=0;rt<Y;rt+=G+1)for(let At=0;At<G;At++)j.emplaceBack(At+rt,G+At+rt+1,G+At+rt+2),j.emplaceBack(At+rt,G+At+rt+2,At+rt+1);const ie=R.length,be=ie+(G+1),Ue=(G+1)*G,je=m?o.bg:0,qe=m?0:1,Ke=b?o.bh:o.$,lt=b?0:1;for(let rt=0;rt<=G;rt++)R.emplaceBack(rt*X,je,qe);for(let rt=0;rt<=G;rt++)R.emplaceBack(rt*X,Ke,lt);for(let rt=0;rt<G;rt++)j.emplaceBack(Ue+rt,be+rt,be+rt+1),j.emplaceBack(Ue+rt,be+rt+1,Ue+rt+1),j.emplaceBack(0+rt,ie+rt+1,ie+rt),j.emplaceBack(0+rt,0+rt+1,ie+rt+1);const nt=R.length,dt=nt+2*(G+1);for(const rt of[0,1])for(let At=0;At<=G;At++)for(const qt of[0,1])R.emplaceBack(rt*o.$,At*X,qt);for(let rt=0;rt<2*G;rt+=2)j.emplaceBack(nt+rt,nt+rt+1,nt+rt+3),j.emplaceBack(nt+rt,nt+rt+3,nt+rt+2),j.emplaceBack(dt+rt,dt+rt+3,dt+rt+1),j.emplaceBack(dt+rt,dt+rt+2,dt+rt+3);const bt=new Pt(I.createVertexBuffer(R,uo.members),I.createIndexBuffer(j),o.aL.simpleSegment(0,0,R.length,j.length));return this._meshCache[T]=bt,bt}getMeshFrameDelta(r){return 2*Math.PI*o.bt/Math.pow(2,Math.max(r,0))/5}getMinTileElevationForLngLatZoom(r,s){var p;const{tileID:m}=this._getOverscaledTileIDFromLngLatZoom(r,s);return(p=this.getMinMaxElevation(m).minElevation)!==null&&p!==void 0?p:0}getMinMaxElevation(r){const s=this.getTerrainData(r).tile,p={minElevation:null,maxElevation:null};return s&&s.dem&&(p.minElevation=s.dem.min*this.exaggeration,p.maxElevation=s.dem.max*this.exaggeration),p}_getOverscaledTileIDFromLngLatZoom(r,s){const p=o.a0.fromLngLat(r.wrap()),m=(1<<s)*o.$,b=p.x*m,T=p.y*m,I=Math.floor(b/o.$),R=Math.floor(T/o.$);return{tileID:new o.Z(s,0,s,I,R),mercatorX:b,mercatorY:T}}}class yo{constructor(r,s,p){this._context=r,this._size=s,this._tileSize=p,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const r of this._objects)r.texture.destroy(),r.fbo.destroy()}_createObject(r){const s=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),p=new o.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return p.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),s.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),s.colorAttachment.set(p.texture),{id:r,fbo:s,texture:p,stamp:-1,inUse:!1}}getObjectForId(r){return this._objects[r]}useObject(r){r.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((s=>r.id!==s)),this._recentlyUsed.push(r.id)}stampObject(r){r.stamp=++this._stamp}getOrCreateFreeObject(){for(const s of this._recentlyUsed)if(!this._objects[s].inUse)return this._objects[s];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const r=this._createObject(this._objects.length);return this._objects.push(r),r}freeObject(r){r.inUse=!1}freeAllObjects(){for(const r of this._objects)this.freeObject(r)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((r=>!r.inUse))===!1}}const br={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class zr{constructor(r,s){this.painter=r,this.terrain=s,this.pool=new yo(r.context,30,s.sourceCache.tileSize*s.qualityFactor)}destruct(){this.pool.destruct()}getTexture(r){return this.pool.getObjectForId(r.rtt[this._stacks.length-1].id).texture}prepareForRender(r,s){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=r._order.filter((p=>!r._layers[p].isHidden(s))),this._coordsAscending={};for(const p in r.sourceCaches){this._coordsAscending[p]={};const m=r.sourceCaches[p].getVisibleCoordinates(),b=r.sourceCaches[p].getSource(),T=b instanceof Jt?b.terrainTileRanges:null;for(const I of m){const R=this.terrain.sourceCache.getTerrainCoords(I,T);for(const j in R)this._coordsAscending[p][j]||(this._coordsAscending[p][j]=[]),this._coordsAscending[p][j].push(R[j])}}this._coordsAscendingStr={};for(const p of r._order){const m=r._layers[p],b=m.source;if(br[m.type]&&!this._coordsAscendingStr[b]){this._coordsAscendingStr[b]={};for(const T in this._coordsAscending[b])this._coordsAscendingStr[b][T]=this._coordsAscending[b][T].map((I=>I.key)).sort().join()}}for(const p of this._renderableTiles)for(const m in this._coordsAscendingStr){const b=this._coordsAscendingStr[m][p.tileID.key];b&&b!==p.rttCoords[m]&&(p.rtt=[])}}renderLayer(r,s){if(r.isHidden(this.painter.transform.zoom))return!1;const p=Object.assign(Object.assign({},s),{isRenderingToTexture:!0}),m=r.type,b=this.painter,T=this._renderableLayerIds[this._renderableLayerIds.length-1]===r.id;if(br[m]&&(this._prevType&&br[this._prevType]||this._stacks.push([]),this._prevType=m,this._stacks[this._stacks.length-1].push(r.id),!T))return!0;if(br[this._prevType]||br[m]&&T){this._prevType=m;const I=this._stacks.length-1,R=this._stacks[I]||[];for(const j of this._renderableTiles){if(this.pool.isFull()&&(lo(this.painter,this.terrain,this._rttTiles,p),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(j),j.rtt[I]){const X=this.pool.getObjectForId(j.rtt[I].id);if(X.stamp===j.rtt[I].stamp){this.pool.useObject(X);continue}}const G=this.pool.getOrCreateFreeObject();this.pool.useObject(G),this.pool.stampObject(G),j.rtt[I]={id:G.id,stamp:G.stamp},b.context.bindFramebuffer.set(G.fbo.framebuffer),b.context.clear({color:o.be.transparent,stencil:0}),b.currentStencilSource=void 0;for(let X=0;X<R.length;X++){const Y=b.style._layers[R[X]],ie=Y.source?this._coordsAscending[Y.source][j.tileID.key]:[j.tileID];b.context.viewport.set([0,0,G.fbo.width,G.fbo.height]),b._renderTileClippingMasks(Y,ie,!0),b.renderLayer(b,b.style.sourceCaches[Y.source],Y,ie,p),Y.source&&(j.rttCoords[Y.source]=this._coordsAscendingStr[Y.source][j.tileID.key])}}return lo(this.painter,this.terrain,this._rttTiles,p),this._rttTiles=[],this.pool.freeAllObjects(),br[m]}return!1}}const Gi={"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"},_i=y,Eo={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Gn,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:o.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},Hi={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class _o{constructor(r,s,p=!1){this.mousedown=b=>{this.startMove(b,E.mousePos(this.element,b)),E.addEventListener(window,"mousemove",this.mousemove),E.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=b=>{this.move(b,E.mousePos(this.element,b))},this.mouseup=b=>{this._rotatePitchHanlder.dragEnd(b),this.offTemp()},this.touchstart=b=>{b.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=E.touchPos(this.element,b.targetTouches)[0],this.startMove(b,this._startPos),E.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.addEventListener(window,"touchend",this.touchend))},this.touchmove=b=>{b.targetTouches.length!==1?this.reset():(this._lastPos=E.touchPos(this.element,b.targetTouches)[0],this.move(b,this._lastPos))},this.touchend=b=>{b.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=s;const m=new K;this._rotatePitchHanlder=new Ou({clickTolerance:3,move:(b,T)=>{const I=s.getBoundingClientRect(),R=new o.P((I.bottom-I.top)/2,(I.right-I.left)/2);return{bearingDelta:o.cm(new o.P(b.x,T.y),T,R),pitchDelta:p?-.5*(T.y-b.y):void 0}},moveStateManager:m,enable:!0,assignEvents:()=>{}}),this.map=r,E.addEventListener(s,"mousedown",this.mousedown),E.addEventListener(s,"touchstart",this.touchstart,{passive:!1}),E.addEventListener(s,"touchcancel",this.reset)}startMove(r,s){this._rotatePitchHanlder.dragStart(r,s),E.disableDrag()}move(r,s){const p=this.map,{bearingDelta:m,pitchDelta:b}=this._rotatePitchHanlder.dragMove(r,s)||{};m&&p.setBearing(p.getBearing()+m),b&&p.setPitch(p.getPitch()+b)}off(){const r=this.element;E.removeEventListener(r,"mousedown",this.mousedown),E.removeEventListener(r,"touchstart",this.touchstart,{passive:!1}),E.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.removeEventListener(window,"touchend",this.touchend),E.removeEventListener(r,"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 Si;function Di(_,r,s,p=!1){if(p||!s.getCoveringTilesDetailsProvider().allowWorldCopies())return _?.wrap();const m=new o.S(_.lng,_.lat);if(_=new o.S(_.lng,_.lat),r){const b=new o.S(_.lng-360,_.lat),T=new o.S(_.lng+360,_.lat),I=s.locationToScreenPoint(_).distSqr(r);s.locationToScreenPoint(b).distSqr(r)<I?_=b:s.locationToScreenPoint(T).distSqr(r)<I&&(_=T)}for(;Math.abs(_.lng-s.center.lng)>180;){const b=s.locationToScreenPoint(_);if(b.x>=0&&b.y>=0&&b.x<=s.width&&b.y<=s.height)break;_.lng>s.center.lng?_.lng-=360:_.lng+=360}return _.lng!==m.lng&&s.isPointOnMapSurface(s.locationToScreenPoint(_))?_:m}const Wi={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 ii(_,r,s){const p=_.classList;for(const m in Wi)p.remove(`maplibregl-${s}-anchor-${m}`);p.add(`maplibregl-${s}-anchor-${r}`)}class Xn extends o.E{constructor(r){if(super(),this._onKeyPress=s=>{const p=s.code,m=s.charCode||s.keyCode;p!=="Space"&&p!=="Enter"&&m!==32&&m!==13||this.togglePopup()},this._onMapClick=s=>{const p=s.originalEvent.target,m=this._element;this._popup&&(p===m||m.contains(p))&&this.togglePopup()},this._update=s=>{if(!this._map)return;const p=this._map.loaded()&&!this._map.isMoving();(s?.type==="terrain"||s?.type==="render"&&!p)&&this._map.once("render",this._update),this._lngLat=Di(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 m="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?m=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(m=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let b="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?b="rotateX(0deg)":this._pitchAlignment==="map"&&(b=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||s&&s.type!=="moveend"||(this._pos=this._pos.round()),E.setTransform(this._element,`${Wi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${b} ${m}`),M.frameAsync(new AbortController).then((()=>{this._updateOpacity(s&&s.type==="moveend")})).catch((()=>{}))},this._onMove=s=>{if(!this._isDragging){const p=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=p}this._isDragging&&(this._pos=s.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 o.l("dragstart"))),this.fire(new o.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 o.l("dragend")),this._state="inactive"},this._addDragHandler=s=>{this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.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=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._subpixelPositioning=r&&r.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment!=="auto"?r.pitchAlignment:this._rotationAlignment,this.setOpacity(r?.opacity,r?.opacityWhenCovered),r&&r.element)this._element=r.element,this._offset=o.P.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=E.create("div");const s=E.createNS("http://www.w3.org/2000/svg","svg"),p=41,m=27;s.setAttributeNS(null,"display","block"),s.setAttributeNS(null,"height",`${p}px`),s.setAttributeNS(null,"width",`${m}px`),s.setAttributeNS(null,"viewBox",`0 0 ${m} ${p}`);const b=E.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"stroke","none"),b.setAttributeNS(null,"stroke-width","1"),b.setAttributeNS(null,"fill","none"),b.setAttributeNS(null,"fill-rule","evenodd");const T=E.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill-rule","nonzero");const I=E.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"transform","translate(3.0, 29.0)"),I.setAttributeNS(null,"fill","#000000");const R=[{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 qe of R){const Ke=E.createNS("http://www.w3.org/2000/svg","ellipse");Ke.setAttributeNS(null,"opacity","0.04"),Ke.setAttributeNS(null,"cx","10.5"),Ke.setAttributeNS(null,"cy","5.80029008"),Ke.setAttributeNS(null,"rx",qe.rx),Ke.setAttributeNS(null,"ry",qe.ry),I.appendChild(Ke)}const j=E.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"fill",this._color);const G=E.createNS("http://www.w3.org/2000/svg","path");G.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"),j.appendChild(G);const X=E.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"opacity","0.25"),X.setAttributeNS(null,"fill","#000000");const Y=E.createNS("http://www.w3.org/2000/svg","path");Y.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"),X.appendChild(Y);const ie=E.createNS("http://www.w3.org/2000/svg","g");ie.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ie.setAttributeNS(null,"fill","#FFFFFF");const be=E.createNS("http://www.w3.org/2000/svg","g");be.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Ue=E.createNS("http://www.w3.org/2000/svg","circle");Ue.setAttributeNS(null,"fill","#000000"),Ue.setAttributeNS(null,"opacity","0.25"),Ue.setAttributeNS(null,"cx","5.5"),Ue.setAttributeNS(null,"cy","5.5"),Ue.setAttributeNS(null,"r","5.4999962");const je=E.createNS("http://www.w3.org/2000/svg","circle");je.setAttributeNS(null,"fill","#FFFFFF"),je.setAttributeNS(null,"cx","5.5"),je.setAttributeNS(null,"cy","5.5"),je.setAttributeNS(null,"r","5.4999962"),be.appendChild(Ue),be.appendChild(je),T.appendChild(I),T.appendChild(j),T.appendChild(X),T.appendChild(ie),T.appendChild(be),s.appendChild(T),s.setAttributeNS(null,"height",p*this._scale+"px"),s.setAttributeNS(null,"width",m*this._scale+"px"),this._element.appendChild(s),this._offset=o.P.convert(r&&r.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(s=>{s.preventDefault()})),this._element.addEventListener("mousedown",(s=>{s.preventDefault()})),ii(this._element,this._anchor,"marker"),r&&r.className)for(const s of r.className.split(" "))this._element.classList.add(s);this._popup=null}addTo(r){return this.remove(),this._map=r,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",r._getUIString("Marker.Title")),r.getCanvasContainer().appendChild(this._element),r.on("move",this._update),r.on("moveend",this._update),r.on("terrain",this._update),r.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(r){return this._lngLat=o.S.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const m=Math.abs(13.5)/Math.SQRT2;r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(38.1-13.5+m)],"bottom-right":[-m,-1*(38.1-13.5+m)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=r,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(r){return this._subpixelPositioning=r,this}getPopup(){return this._popup}togglePopup(){const r=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:r?(r.isOpen()?r.remove():(r.setLngLat(this._lngLat),r.addTo(this._map)),this):this}_updateOpacity(r=!1){var s,p;const m=(s=this._map)===null||s===void 0?void 0:s.terrain,b=this._map.transform.isLocationOccluded(this._lngLat);if(!m||b){const ie=b?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==ie&&(this._element.style.opacity=ie))}if(r)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const T=this._map,I=T.terrain.depthAtPoint(this._pos),R=T.terrain.getElevationForLngLatZoom(this._lngLat,T.transform.tileZoom);if(T.transform.lngLatToCameraDepth(this._lngLat,R)-I<.006)return void(this._element.style.opacity=this._opacity);const j=-this._offset.y/T.transform.pixelsPerMeter,G=Math.sin(T.getPitch()*Math.PI/180)*j,X=T.terrain.depthAtPoint(new o.P(this._pos.x,this._pos.y-this._offset.y)),Y=T.transform.lngLatToCameraDepth(this._lngLat,R+G)-X>.006;!((p=this._popup)===null||p===void 0)&&p.isOpen()&&Y&&this._popup.remove(),this._element.style.opacity=Y?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(r){return this._offset=o.P.convert(r),this._update(),this}addClassName(r){this._element.classList.add(r)}removeClassName(r){this._element.classList.remove(r)}toggleClassName(r){return this._element.classList.toggle(r)}setDraggable(r){return this._draggable=!!r,this._map&&(r?(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(r){return this._rotation=r||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(r){return this._rotationAlignment=r||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(r){return this._pitchAlignment=r&&r!=="auto"?r:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(r,s){return(this._opacity===void 0||r===void 0&&s===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),r!==void 0&&(this._opacity=r),s!==void 0&&(this._opacityWhenCovered=s),this._map&&this._updateOpacity(!0),this}}const Ya={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ro=0,To=!1;const Na={maxWidth:100,unit:"metric"};function Ti(_,r,s){const p=s&&s.maxWidth||100,m=_._container.clientHeight/2,b=_._container.clientWidth/2,T=_.unproject([b-p/2,m]),I=_.unproject([b+p/2,m]),R=Math.round(_.project(I).x-_.project(T).x),j=Math.min(p,R,_._container.clientWidth),G=T.distanceTo(I);if(s&&s.unit==="imperial"){const X=3.2808*G;X>5280?Go(r,j,X/5280,_._getUIString("ScaleControl.Miles")):Go(r,j,X,_._getUIString("ScaleControl.Feet"))}else s&&s.unit==="nautical"?Go(r,j,G/1852,_._getUIString("ScaleControl.NauticalMiles")):G>=1e3?Go(r,j,G/1e3,_._getUIString("ScaleControl.Kilometers")):Go(r,j,G,_._getUIString("ScaleControl.Meters"))}function Go(_,r,s,p){const m=(function(b){const T=Math.pow(10,`${Math.floor(b)}`.length-1);let I=b/T;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:(function(R){const j=Math.pow(10,Math.ceil(-Math.log(R)/Math.LN10));return Math.round(R*j)/j})(I),T*I})(s);_.style.width=r*(m/s)+"px",_.innerHTML=`${m}&nbsp;${p}`}const Oa={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},Il=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ls(_){if(_){if(typeof _=="number"){const r=Math.round(Math.abs(_)/Math.SQRT2);return{center:new o.P(0,0),top:new o.P(0,_),"top-left":new o.P(r,r),"top-right":new o.P(-r,r),bottom:new o.P(0,-_),"bottom-left":new o.P(r,-r),"bottom-right":new o.P(-r,-r),left:new o.P(_,0),right:new o.P(-_,0)}}if(_ instanceof o.P||Array.isArray(_)){const r=o.P.convert(_);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:o.P.convert(_.center||[0,0]),top:o.P.convert(_.top||[0,0]),"top-left":o.P.convert(_["top-left"]||[0,0]),"top-right":o.P.convert(_["top-right"]||[0,0]),bottom:o.P.convert(_.bottom||[0,0]),"bottom-left":o.P.convert(_["bottom-left"]||[0,0]),"bottom-right":o.P.convert(_["bottom-right"]||[0,0]),left:o.P.convert(_.left||[0,0]),right:o.P.convert(_.right||[0,0])}}return Ls(new o.P(0,0))}const Ho=y;f.AJAXError=o.cy,f.Event=o.l,f.Evented=o.E,f.LngLat=o.S,f.MercatorCoordinate=o.a0,f.Point=o.P,f.addProtocol=o.cz,f.config=o.a,f.removeProtocol=o.cA,f.AttributionControl=Li,f.BoxZoomHandler=hh,f.CanvasSource=Er,f.CooperativeGesturesHandler=ko,f.DoubleClickZoomHandler=mr,f.DragPanHandler=zn,f.DragRotateHandler=un,f.EdgeInsets=_r,f.FullscreenControl=class extends o.E{constructor(_={}){super(),this._onFullscreenChange=()=>{var r;let s=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((r=s?.shadowRoot)===null||r===void 0)&&r.fullscreenElement;)s=s.shadowRoot.fullscreenElement;s===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,_&&_.container&&(_.container instanceof HTMLElement?this._container=_.container:o.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(_){return this._map=_,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 _=this._fullscreenButton=E.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);E.create("span","maplibregl-ctrl-icon",_).setAttribute("aria-hidden","true"),_.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const _=this._getTitle();this._fullscreenButton.setAttribute("aria-label",_),this._fullscreenButton.title=_}_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 o.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new o.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()}},f.GeoJSONSource=Mr,f.GeolocateControl=class extends o.E{constructor(_){super(),this._onSuccess=r=>{if(this._map){if(this._isOutOfMapMaxBounds(r))return this._setErrorState(),this.fire(new o.l("outofmaxbounds",r)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=r,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(r),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(r),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new o.l("geolocate",r)),this._finish()}},this._updateCamera=r=>{const s=new o.S(r.coords.longitude,r.coords.latitude),p=r.coords.accuracy,m=this._map.getBearing(),b=o.e({bearing:m},this.options.fitBoundsOptions),T=Kt.fromLngLat(s,p);this._map.fitBounds(T,b,{geolocateSource:!0})},this._updateMarker=r=>{if(r){const s=new o.S(r.coords.longitude,r.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=r.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=r=>{if(this._map){if(r.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 s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(r.code===3&&To)return;this.options.trackUserLocation&&this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new o.l("error",r)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(r=>r.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=r=>{if(this._map){if(r===!1){o.w("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}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 Xn({element:this._dotElement}),this._circleElement=E.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Xn({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",(s=>{s.geolocateSource||this._watchState!=="ACTIVE_LOCK"||s.originalEvent&&s.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 o.l("trackuserlocationend")),this.fire(new o.l("userlocationlostfocus")))}))}},this.options=o.e({},Ya,_)}onAdd(_){return this._map=_,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return o._(this,arguments,void 0,(function*(r=!1){if(Si!==void 0&&!r)return Si;if(window.navigator.permissions===void 0)return Si=!!window.navigator.geolocation,Si;try{Si=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Si=!!window.navigator.geolocation}return Si}))})().then((r=>this._finishSetupUI(r))),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,Ro=0,To=!1}_isOutOfMapMaxBounds(_){const r=this._map.getMaxBounds(),s=_.coords;return r&&(s.longitude<r.getWest()||s.longitude>r.getEast()||s.latitude<r.getSouth()||s.latitude>r.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 _=this._map.getBounds(),r=_.getSouthEast(),s=_.getNorthEast(),p=r.distanceTo(s),m=Math.ceil(this._accuracy/(p/this._map._container.clientHeight)*2);this._circleElement.style.width=`${m}px`,this._circleElement.style.height=`${m}px`}trigger(){if(!this._setup)return o.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 o.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ro--,To=!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 o.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 o.l("trackuserlocationstart")),this.fire(new o.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 _;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ro++,Ro>1?(_={maximumAge:6e5,timeout:0},To=!0):(_=this.options.positionOptions,To=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,_)}}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)}},f.GlobeControl=class{constructor(){this._toggleProjection=()=>{var _;const r=(_=this._map.getProjection())===null||_===void 0?void 0:_.type;this._map.setProjection(r!=="mercator"&&r?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var _;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((_=this._map.getProjection())===null||_===void 0?void 0:_.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(_){return this._map=_,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}},f.Hash=sc,f.ImageSource=Jt,f.KeyboardHandler=tr,f.LngLatBounds=Kt,f.LogoControl=Vo,f.Map=class extends en{constructor(_){var r,s;o.cv.mark(o.cw.create);const p=Object.assign(Object.assign(Object.assign({},Eo),_),{canvasContextAttributes:Object.assign(Object.assign({},Eo.canvasContextAttributes),_.canvasContextAttributes)});if(p.minZoom!=null&&p.maxZoom!=null&&p.minZoom>p.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(p.minPitch!=null&&p.maxPitch!=null&&p.minPitch>p.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(p.minPitch!=null&&p.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(p.maxPitch!=null&&p.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const m=new An,b=new Vl;if(p.minZoom!==void 0&&m.setMinZoom(p.minZoom),p.maxZoom!==void 0&&m.setMaxZoom(p.maxZoom),p.minPitch!==void 0&&m.setMinPitch(p.minPitch),p.maxPitch!==void 0&&m.setMaxPitch(p.maxPitch),p.renderWorldCopies!==void 0&&m.setRenderWorldCopies(p.renderWorldCopies),super(m,b,{bearingSnap:p.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new va,this._controls=[],this._mapId=o.a6(),this._contextLost=I=>{I.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new o.l("webglcontextlost",{originalEvent:I}))},this._contextRestored=I=>{this._setupPainter(),this.resize(),this._update(),this.fire(new o.l("webglcontextrestored",{originalEvent:I}))},this._onMapScroll=I=>{if(I.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=p.interactive,this._maxTileCacheSize=p.maxTileCacheSize,this._maxTileCacheZoomLevels=p.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},p.canvasContextAttributes),this._trackResize=p.trackResize===!0,this._bearingSnap=p.bearingSnap,this._centerClampedToGround=p.centerClampedToGround,this._refreshExpiredTiles=p.refreshExpiredTiles===!0,this._fadeDuration=p.fadeDuration,this._crossSourceCollisions=p.crossSourceCollisions===!0,this._collectResourceTiming=p.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Gi),p.locale),this._clickTolerance=p.clickTolerance,this._overridePixelRatio=p.pixelRatio,this._maxCanvasSize=p.maxCanvasSize,this.transformCameraUpdate=p.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=p.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=W.addThrottleControl((()=>this.isMoving())),this._requestManager=new le(p.transformRequest),typeof p.container=="string"){if(this._container=document.getElementById(p.container),!this._container)throw new Error(`Container '${p.container}' not found.`)}else{if(!(p.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=p.container}if(p.maxBounds&&this.setMaxBounds(p.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 I=!1;const R=Ra((j=>{this._trackResize&&!this._removed&&(this.resize(j),this.redraw())}),50);this._resizeObserver=new ResizeObserver((j=>{I?R(j):I=!0})),this._resizeObserver.observe(this._container)}this.handlers=new Mi(this,p),this._hash=p.hash&&new sc(typeof p.hash=="string"&&p.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:p.center,elevation:p.elevation,zoom:p.zoom,bearing:p.bearing,pitch:p.pitch,roll:p.roll}),p.bounds&&(this.resize(),this.fitBounds(p.bounds,o.e({},p.fitBoundsOptions,{duration:0}))));const T=typeof p.style=="string"||((s=(r=p.style)===null||r===void 0?void 0:r.projection)===null||s===void 0?void 0:s.type)!=="globe";this.resize(null,T),this._localIdeographFontFamily=p.localIdeographFontFamily,this._validateStyle=p.validateStyle,p.style&&this.setStyle(p.style,{localIdeographFontFamily:p.localIdeographFontFamily}),p.attributionControl&&this.addControl(new Li(typeof p.attributionControl=="boolean"?void 0:p.attributionControl)),p.maplibreLogo&&this.addControl(new Vo,p.logoPosition),this.on("style.load",(()=>{if(T||this._resizeTransform(),this.transform.unmodified){const I=o.Q(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(I)}})),this.on("data",(I=>{this._update(I.dataType==="style"),this.fire(new o.l(`${I.dataType}data`,I))})),this.on("dataloading",(I=>{this.fire(new o.l(`${I.dataType}dataloading`,I))})),this.on("dataabort",(I=>{this.fire(new o.l("sourcedataabort",I))}))}_getMapId(){return this._mapId}setGlobalStateProperty(_,r){return this.style.setGlobalStateProperty(_,r),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(_,r){if(r===void 0&&(r=_.getDefaultPosition?_.getDefaultPosition():"top-right"),!_||!_.onAdd)return this.fire(new o.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const s=_.onAdd(this);this._controls.push(_);const p=this._controlPositions[r];return r.indexOf("bottom")!==-1?p.insertBefore(s,p.firstChild):p.appendChild(s),this}removeControl(_){if(!_||!_.onRemove)return this.fire(new o.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(_);return r>-1&&this._controls.splice(r,1),_.onRemove(this),this}hasControl(_){return this._controls.indexOf(_)>-1}calculateCameraOptionsFromTo(_,r,s,p){return p==null&&this.terrain&&(p=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(_,r,s,p)}resize(_,r=!0){const[s,p]=this._containerDimensions(),m=this._getClampedPixelRatio(s,p);if(this._resizeCanvas(s,p,m),this.painter.resize(s,p,m),this.painter.overLimit()){const T=this.painter.context.gl;this._maxCanvasSize=[T.drawingBufferWidth,T.drawingBufferHeight];const I=this._getClampedPixelRatio(s,p);this._resizeCanvas(s,p,I),this.painter.resize(s,p,I)}this._resizeTransform(r);const b=!this._moving;return b&&(this.stop(),this.fire(new o.l("movestart",_)).fire(new o.l("move",_))),this.fire(new o.l("resize",_)),b&&this.fire(new o.l("moveend",_)),this}_resizeTransform(_=!0){var r;const[s,p]=this._containerDimensions();this.transform.resize(s,p,_),(r=this._requestedCameraState)===null||r===void 0||r.resize(s,p,_)}_getClampedPixelRatio(_,r){const{0:s,1:p}=this._maxCanvasSize,m=this.getPixelRatio(),b=_*m,T=r*m;return Math.min(b>s?s/b:1,T>p?p/T:1)*m}getPixelRatio(){var _;return(_=this._overridePixelRatio)!==null&&_!==void 0?_:devicePixelRatio}setPixelRatio(_){this._overridePixelRatio=_,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(_){return this.transform.setMaxBounds(Kt.convert(_)),this._update()}setMinZoom(_){if((_=_??-2)>=-2&&_<=this.transform.maxZoom)return this.transform.setMinZoom(_),this._update(),this.getZoom()<_&&this.setZoom(_),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(_){if((_=_??22)>=this.transform.minZoom)return this.transform.setMaxZoom(_),this._update(),this.getZoom()>_&&this.setZoom(_),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(_){if((_=_??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(_>=0&&_<=this.transform.maxPitch)return this.transform.setMinPitch(_),this._update(),this.getPitch()<_&&this.setPitch(_),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(_){if((_=_??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(_>=this.transform.minPitch)return this.transform.setMaxPitch(_),this._update(),this.getPitch()>_&&this.setPitch(_),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(_){return this.transform.setRenderWorldCopies(_),this._update()}project(_){return this.transform.locationToScreenPoint(o.S.convert(_),this.style&&this.terrain)}unproject(_){return this.transform.screenPointToLocation(o.P.convert(_),this.terrain)}isMoving(){var _;return this._moving||((_=this.handlers)===null||_===void 0?void 0:_.isMoving())}isZooming(){var _;return this._zooming||((_=this.handlers)===null||_===void 0?void 0:_.isZooming())}isRotating(){var _;return this._rotating||((_=this.handlers)===null||_===void 0?void 0:_.isRotating())}_createDelegatedListener(_,r,s){if(_==="mouseenter"||_==="mouseover"){let p=!1;return{layers:r,listener:s,delegates:{mousemove:b=>{const T=r.filter((R=>this.getLayer(R))),I=T.length!==0?this.queryRenderedFeatures(b.point,{layers:T}):[];I.length?p||(p=!0,s.call(this,new _a(_,this,b.originalEvent,{features:I}))):p=!1},mouseout:()=>{p=!1}}}}if(_==="mouseleave"||_==="mouseout"){let p=!1;return{layers:r,listener:s,delegates:{mousemove:T=>{const I=r.filter((R=>this.getLayer(R)));(I.length!==0?this.queryRenderedFeatures(T.point,{layers:I}):[]).length?p=!0:p&&(p=!1,s.call(this,new _a(_,this,T.originalEvent)))},mouseout:T=>{p&&(p=!1,s.call(this,new _a(_,this,T.originalEvent)))}}}}{const p=m=>{const b=r.filter((I=>this.getLayer(I))),T=b.length!==0?this.queryRenderedFeatures(m.point,{layers:b}):[];T.length&&(m.features=T,s.call(this,m),delete m.features)};return{layers:r,listener:s,delegates:{[_]:p}}}}_saveDelegatedListener(_,r){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[_]=this._delegatedListeners[_]||[],this._delegatedListeners[_].push(r)}_removeDelegatedListener(_,r,s){if(!this._delegatedListeners||!this._delegatedListeners[_])return;const p=this._delegatedListeners[_];for(let m=0;m<p.length;m++){const b=p[m];if(b.listener===s&&b.layers.length===r.length&&b.layers.every((T=>r.includes(T)))){for(const T in b.delegates)this.off(T,b.delegates[T]);return void p.splice(m,1)}}}on(_,r,s){if(s===void 0)return super.on(_,r);const p=typeof r=="string"?[r]:r,m=this._createDelegatedListener(_,p,s);this._saveDelegatedListener(_,m);for(const b in m.delegates)this.on(b,m.delegates[b]);return{unsubscribe:()=>{this._removeDelegatedListener(_,p,s)}}}once(_,r,s){if(s===void 0)return super.once(_,r);const p=typeof r=="string"?[r]:r,m=this._createDelegatedListener(_,p,s);for(const b in m.delegates){const T=m.delegates[b];m.delegates[b]=(...I)=>{this._removeDelegatedListener(_,p,s),T(...I)}}this._saveDelegatedListener(_,m);for(const b in m.delegates)this.once(b,m.delegates[b]);return this}off(_,r,s){return s===void 0?super.off(_,r):(this._removeDelegatedListener(_,typeof r=="string"?[r]:r,s),this)}queryRenderedFeatures(_,r){if(!this.style)return[];let s;const p=_ instanceof o.P||Array.isArray(_),m=p?_:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(p?{}:_)||{},m instanceof o.P||typeof m[0]=="number")s=[o.P.convert(m)];else{const b=o.P.convert(m[0]),T=o.P.convert(m[1]);s=[b,new o.P(T.x,b.y),T,new o.P(b.x,T.y),b]}return this.style.queryRenderedFeatures(s,r,this.transform)}querySourceFeatures(_,r){return this.style.querySourceFeatures(_,r)}setStyle(_,r){return(r=o.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff!==!1&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&_?(this._diffStyle(_,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(_,r))}setTransformRequest(_){return this._requestManager.setTransformRequest(_),this}_getUIString(_){const r=this._locale[_];if(r==null)throw new Error(`Missing UI string '${_}'`);return r}_updateStyle(_,r){var s,p;if(r.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(_,r)));const m=this.style&&r.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!_)),_?(this.style=new Ma(this,r||{}),this.style.setEventedParent(this,{style:this.style}),typeof _=="string"?this.style.loadURL(_,r,m):this.style.loadJSON(_,r,m),this):((p=(s=this.style)===null||s===void 0?void 0:s.projection)===null||p===void 0||p.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ma(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(_,r){if(typeof _=="string"){const s=this._requestManager.transformRequest(_,"Style");o.j(s,new AbortController).then((p=>{this._updateDiff(p.data,r)})).catch((p=>{p&&this.fire(new o.k(p))}))}else typeof _=="object"&&this._updateDiff(_,r)}_updateDiff(_,r){try{this.style.setState(_,r)&&this._update(!0)}catch(s){o.w(`Unable to perform style diff: ${s.message||s.error||s}. Rebuilding the style from scratch.`),this._updateStyle(_,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.w("There is no style added to the map.")}addSource(_,r){return this._lazyInitEmptyStyle(),this.style.addSource(_,r),this._update(!0)}isSourceLoaded(_){const r=this.style&&this.style.sourceCaches[_];if(r!==void 0)return r.loaded();this.fire(new o.k(new Error(`There is no source with ID '${_}'`)))}setTerrain(_){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),_){const r=this.style.sourceCaches[_.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${_.source}`);this.terrain===null&&r.reload();for(const s in this.style._layers){const p=this.style._layers[s];p.type==="hillshade"&&p.source===_.source&&o.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."),p.type==="color-relief"&&p.source===_.source&&o.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Ki(this.painter,r,_),this.painter.renderToTexture=new zr(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=s=>{var p;s.dataType==="style"?this.terrain.sourceCache.freeRtt():s.dataType==="source"&&s.tile&&(s.sourceId!==_.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))),((p=s.source)===null||p===void 0?void 0:p.type)==="image"?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(s.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 o.l("terrain",{terrain:_})),this}getTerrain(){var _,r;return(r=(_=this.terrain)===null||_===void 0?void 0:_.options)!==null&&r!==void 0?r:null}areTilesLoaded(){const _=this.style&&this.style.sourceCaches;for(const r in _){const s=_[r]._tiles;for(const p in s){const m=s[p];if(m.state!=="loaded"&&m.state!=="errored")return!1}}return!0}removeSource(_){return this.style.removeSource(_),this._update(!0)}getSource(_){return this.style.getSource(_)}setSourceTileLodParams(_,r,s){if(s){const p=this.getSource(s);if(!p)throw new Error(`There is no source with ID "${s}", cannot set LOD parameters`);p.calculateTileZoom=St(Math.max(1,_),Math.max(1,r))}else for(const p in this.style.sourceCaches)this.style.sourceCaches[p].getSource().calculateTileZoom=St(Math.max(1,_),Math.max(1,r));return this._update(!0),this}refreshTiles(_,r){const s=this.style.sourceCaches[_];if(!s)throw new Error(`There is no source cache with ID "${_}", cannot refresh tile`);r===void 0?s.reload(!0):s.refreshTiles(r.map((p=>new o.a3(p.z,p.x,p.y))))}addImage(_,r,s={}){const{pixelRatio:p=1,sdf:m=!1,stretchX:b,stretchY:T,content:I,textFitWidth:R,textFitHeight:j}=s;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||o.b(r))){if(r.width===void 0||r.height===void 0)return this.fire(new o.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:G,height:X,data:Y}=r,ie=r;return this.style.addImage(_,{data:new o.R({width:G,height:X},new Uint8Array(Y)),pixelRatio:p,stretchX:b,stretchY:T,content:I,textFitWidth:R,textFitHeight:j,sdf:m,version:0,userImage:ie}),ie.onAdd&&ie.onAdd(this,_),this}}{const{width:G,height:X,data:Y}=M.getImageData(r);this.style.addImage(_,{data:new o.R({width:G,height:X},Y),pixelRatio:p,stretchX:b,stretchY:T,content:I,textFitWidth:R,textFitHeight:j,sdf:m,version:0})}}updateImage(_,r){const s=this.style.getImage(_);if(!s)return this.fire(new o.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const p=r instanceof HTMLImageElement||o.b(r)?M.getImageData(r):r,{width:m,height:b,data:T}=p;if(m===void 0||b===void 0)return this.fire(new o.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(m!==s.data.width||b!==s.data.height)return this.fire(new o.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const I=!(r instanceof HTMLImageElement||o.b(r));return s.data.replace(T,I),this.style.updateImage(_,s),this}getImage(_){return this.style.getImage(_)}hasImage(_){return _?!!this.style.getImage(_):(this.fire(new o.k(new Error("Missing required image id"))),!1)}removeImage(_){this.style.removeImage(_)}loadImage(_){return W.getImage(this._requestManager.transformRequest(_,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(_,r){return this._lazyInitEmptyStyle(),this.style.addLayer(_,r),this._update(!0)}moveLayer(_,r){return this.style.moveLayer(_,r),this._update(!0)}removeLayer(_){return this.style.removeLayer(_),this._update(!0)}getLayer(_){return this.style.getLayer(_)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(_,r,s){return this.style.setLayerZoomRange(_,r,s),this._update(!0)}setFilter(_,r,s={}){return this.style.setFilter(_,r,s),this._update(!0)}getFilter(_){return this.style.getFilter(_)}setPaintProperty(_,r,s,p={}){return this.style.setPaintProperty(_,r,s,p),this._update(!0)}getPaintProperty(_,r){return this.style.getPaintProperty(_,r)}setLayoutProperty(_,r,s,p={}){return this.style.setLayoutProperty(_,r,s,p),this._update(!0)}getLayoutProperty(_,r){return this.style.getLayoutProperty(_,r)}setGlyphs(_,r={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(_,r),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(_,r,s={}){return this._lazyInitEmptyStyle(),this.style.addSprite(_,r,s,(p=>{p||this._update(!0)})),this}removeSprite(_){return this._lazyInitEmptyStyle(),this.style.removeSprite(_),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(_,r={}){return this._lazyInitEmptyStyle(),this.style.setSprite(_,r,(s=>{s||this._update(!0)})),this}setLight(_,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(_,r),this._update(!0)}getLight(){return this.style.getLight()}setSky(_,r={}){return this._lazyInitEmptyStyle(),this.style.setSky(_,r),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(_,r){return this.style.setFeatureState(_,r),this._update()}removeFeatureState(_,r){return this.style.removeFeatureState(_,r),this._update()}getFeatureState(_){return this.style.getFeatureState(_)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let _=0,r=0;return this._container&&(_=this._container.clientWidth||400,r=this._container.clientHeight||300),[_,r]}_setupContainer(){const _=this._container;_.classList.add("maplibregl-map");const r=this._canvasContainer=E.create("div","maplibregl-canvas-container",_);this._interactive&&r.classList.add("maplibregl-interactive"),this._canvas=E.create("canvas","maplibregl-canvas",r),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 s=this._containerDimensions(),p=this._getClampedPixelRatio(s[0],s[1]);this._resizeCanvas(s[0],s[1],p);const m=this._controlContainer=E.create("div","maplibregl-control-container",_),b=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((T=>{b[T]=E.create("div",`maplibregl-ctrl-${T} `,m)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(_,r,s){this._canvas.width=Math.floor(s*_),this._canvas.height=Math.floor(s*r),this._canvas.style.width=`${_}px`,this._canvas.style.height=`${r}px`}_setupPainter(){const _=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let r=null;this._canvas.addEventListener("webglcontextcreationerror",(p=>{r={requestedAttributes:_},p&&(r.statusMessage=p.statusMessage,r.type=p.type)}),{once:!0});let s=null;if(s=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,_):this._canvas.getContext("webgl2",_)||this._canvas.getContext("webgl",_),!s){const p="Failed to initialize WebGL";throw r?(r.message=p,new Error(JSON.stringify(r))):new Error(p)}this.painter=new $o(s,this.transform),O.testSupport(s)}migrateProjection(_,r){super.migrateProjection(_,r),this.painter.transform=_,this.fire(new o.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(_){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||_,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(_){return this._update(),this._renderTaskQueue.add(_)}_cancelRenderFrame(_){this._renderTaskQueue.remove(_)}_render(_){var r,s,p,m,b;const T=this._idleTriggered?this._fadeDuration:0,I=((r=this.style.projection)===null||r===void 0?void 0:r.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(_),this._removed)return;let R=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const X=this.transform.zoom,Y=M.now();this.style.zoomHistory.update(X,Y);const ie=new o.F(X,{now:Y,fadeDuration:T,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition(),globalState:this.style.getGlobalState()}),be=ie.crossFadingFactor();be===1&&be===this._crossFadingFactor||(R=!0,this._crossFadingFactor=be),this.style.update(ie)}const j=((s=this.style.projection)===null||s===void 0?void 0:s.transitionState)>0!==I;(p=this.style.projection)===null||p===void 0||p.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((m=this.style.projection)===null||m===void 0?void 0:m.transitionState,(b=this.style.projection)===null||b===void 0?void 0:b.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||j)&&(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,T,this._crossSourceCollisions,j),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:T,showPadding:this.showPadding}),this.fire(new o.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.cv.mark(o.cw.load),this.fire(new o.l("load"))),this.style&&(this.style.hasTransitions()||R)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const G=this._sourcesDirty||this._styleDirty||this._placementDirty;return G||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.l("idle")),!this._loaded||this._fullyLoaded||G||(this._fullyLoaded=!0,o.cv.mark(o.cw.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var _;this._hash&&this._hash.remove();for(const s of this._controls)s.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),W.removeThrottleControl(this._imageQueueHandle),(_=this._resizeObserver)===null||_===void 0||_.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");r?.loseContext&&r.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"),o.cv.clearMetrics(),this._removed=!0,this.fire(new o.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,M.frame(this._frameRequest,(_=>{o.cv.frame(_),this._frameRequest=null;try{this._render(_)}catch(r){if(!o.cx(r)&&!(function(s){return s.message===qo})(r))throw r}}),(()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(_){this._showTileBoundaries!==_&&(this._showTileBoundaries=_,this._update())}get showPadding(){return!!this._showPadding}set showPadding(_){this._showPadding!==_&&(this._showPadding=_,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(_){this._showCollisionBoxes!==_&&(this._showCollisionBoxes=_,_?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(_){this._showOverdrawInspector!==_&&(this._showOverdrawInspector=_,this._update())}get repaint(){return!!this._repaint}set repaint(_){this._repaint!==_&&(this._repaint=_,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(_){this._vertices=_,this._update()}get version(){return _i}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(_){return this._lazyInitEmptyStyle(),this.style.setProjection(_),this._update(!0)}},f.MapMouseEvent=_a,f.MapTouchEvent=Ws,f.MapWheelEvent=Rc,f.Marker=Xn,f.NavigationControl=class{constructor(_){this._updateZoomButtons=()=>{const r=this._map.getZoom(),s=r===this._map.getMaxZoom(),p=r===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.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=(r,s)=>{const p=this._map._getUIString(`NavigationControl.${s}`);r.title=p,r.setAttribute("aria-label",p)},this.options=o.e({},Hi,_),this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(r=>r.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(r=>this._map.zoomIn({},{originalEvent:r}))),E.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(r=>this._map.zoomOut({},{originalEvent:r}))),E.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(r=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:r}):this._map.resetNorth({},{originalEvent:r})})),this._compassIcon=E.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(_){return this._map=_,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 _o(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(_,r){const s=E.create("button",_,this._container);return s.type="button",s.addEventListener("click",r),s}},f.Popup=class extends o.E{constructor(_){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 o.l("close"))),this),this._onMouseUp=r=>{this._update(r.point)},this._onMouseMove=r=>{this._update(r.point)},this._onDrag=r=>{this._update(r.point)},this._update=r=>{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 T of this.options.className.split(" "))this._container.classList.add(T);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=Di(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!r)return;const s=this._flatPos=this._pos=this._trackPointer&&r?r:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&r?r:this._map.transform.locationToScreenPoint(this._lngLat));let p=this.options.anchor;const m=Ls(this.options.offset);if(!p){const T=this._container.offsetWidth,I=this._container.offsetHeight;let R;R=s.y+m.bottom.y<I?["top"]:s.y>this._map.transform.height-I?["bottom"]:[],s.x<T/2?R.push("left"):s.x>this._map.transform.width-T/2&&R.push("right"),p=R.length===0?"bottom":R.join("-")}let b=s.add(m[p]);this.options.subpixelPositioning||(b=b.round()),E.setTransform(this._container,`${Wi[p]} translate(${b.x}px,${b.y}px)`),ii(this._container,p,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=o.e(Object.create(Oa),_)}addTo(_){return this._map&&this.remove(),this._map=_,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 o.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(_){return this._lngLat=o.S.convert(_),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(_){return this.setDOMContent(document.createTextNode(_))}setHTML(_){const r=document.createDocumentFragment(),s=document.createElement("body");let p;for(s.innerHTML=_;p=s.firstChild,p;)r.appendChild(p);return this.setDOMContent(r)}getMaxWidth(){var _;return(_=this._container)===null||_===void 0?void 0:_.style.maxWidth}setMaxWidth(_){return this.options.maxWidth=_,this._update(),this}setDOMContent(_){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(_),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(_){return this._container&&this._container.classList.add(_),this}removeClassName(_){return this._container&&this._container.classList.remove(_),this}setOffset(_){return this.options.offset=_,this._update(),this}toggleClassName(_){if(this._container)return this._container.classList.toggle(_)}setSubpixelPositioning(_){this.options.subpixelPositioning=_}_createCloseButton(){this.options.closeButton&&(this._closeButton=E.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const _=this._container.querySelector(Il);_&&_.focus()}},f.RasterDEMTileSource=fr,f.RasterTileSource=Lr,f.ScaleControl=class{constructor(_){this._onMove=()=>{Ti(this._map,this._container,this.options)},this.setUnit=r=>{this.options.unit=r,Ti(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Na),_)}getDefaultPosition(){return"bottom-left"}onAdd(_){return this._map=_,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-scale",_.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}},f.ScrollZoomHandler=Cr,f.Style=Ma,f.TerrainControl=class{constructor(_){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=_}onAdd(_){return this._map=_,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}},f.TwoFingersTouchPitchHandler=Lt,f.TwoFingersTouchRotateHandler=Gt,f.TwoFingersTouchZoomHandler=Je,f.TwoFingersTouchZoomRotateHandler=Yn,f.VectorTileSource=Be,f.VideoSource=Or,f.addSourceType=(_,r)=>o._(void 0,void 0,void 0,(function*(){if(yr(_))throw new Error(`A source type called "${_}" already exists.`);((s,p)=>{lr[s]=p})(_,r)})),f.clearPrewarmedResources=function(){const _=fe;_&&(_.isPreloaded()&&_.numActive()===1?(_.release(ge),fe=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()"))},f.createTileMesh=js,f.getMaxParallelImageRequests=function(){return o.a.MAX_PARALLEL_IMAGE_REQUESTS},f.getRTLTextPluginStatus=function(){return Wr().getRTLTextPluginStatus()},f.getVersion=function(){return Ho},f.getWorkerCount=function(){return Re.workerCount},f.getWorkerUrl=function(){return o.a.WORKER_URL},f.importScriptInWorkers=function(_){return ot().broadcast("IS",_)},f.prewarm=function(){Ie().acquire(ge)},f.setMaxParallelImageRequests=function(_){o.a.MAX_PARALLEL_IMAGE_REQUESTS=_},f.setRTLTextPlugin=function(_,r){return Wr().setRTLTextPlugin(_,r)},f.setWorkerCount=function(_){Re.workerCount=_},f.setWorkerUrl=function(_){o.a.WORKER_URL=_}}));var h=n;return h}))})(Um)),Um.exports}var QD=JD();class ek{constructor(t){const n=this;this.registeredElements={},this.baseLayers=[],this.firstSymbolLayer=void 0,this.eventHandlers={layerchange:[],viewportchange:[],addsource:[],addlayer:[]},this.wrapper={on:(o,y,v,S)=>{if(!n.eventHandlers[o])return;typeof v=="string"&&(S=v,v={}),n.eventHandlers[o].push({handler:y,options:v});const P=[o,y];S&&typeof S=="string"&&(n.initRegisteredElements(S),n.registeredElements[S].wrapperEvents.push(P))},off:(o,y)=>{n.eventHandlers[o]&&(n.eventHandlers[o]=n.eventHandlers[o].filter(v=>Object.is(v.handler,y)?!1:v))},fire:(o,y)=>{if(!n.eventHandlers[o])return;const v=y||window,S=new Event(o);n.eventHandlers[o].forEach(function(P){P.handler.call(v,S,n,y)})},layerState:[],layerStateString:"",oldLayerStateStrings:{},buildLayerObject:o=>{if(o)return{id:o.id,type:o.type,visible:o.visibility!=="none",baseLayer:n.baseLayers.indexOf(o.id)!==-1}},buildLayerObjects:()=>n.map.style._order.map(o=>n.wrapper.buildLayerObject(n.map.style._layers[o])).filter(o=>typeof o<"u"),refreshLayerState:()=>{n.wrapper.layerState=n.wrapper.buildLayerObjects(),JSON.stringify(n.wrapper.layerState)!==n.wrapper.layerStateString&&(n.wrapper.fire("layerchange"),n.wrapper.layerStateString=JSON.stringify(n.wrapper.layerState))},viewportState:{center:{lng:0,lat:0},zoom:0,bearing:0,pitch:0},viewportStateString:"{}",oldViewportStateString:"{}",getViewport:()=>typeof n.map.getCenter=="function"?{center:(({lng:o,lat:y})=>({lng:o,lat:y}))(n.map.getCenter()),zoom:n.map.getZoom(),bearing:n.map.getBearing(),pitch:n.map.getPitch()}:{center:{lng:0,lat:0},zoom:0,bearing:0,pitch:0},refreshViewport:()=>{n.wrapper.viewportState=n.wrapper.getViewport()}},this.cancelled=!1,this.initRegisteredElements=(o,y)=>{(typeof n.registeredElements[o]>"u"||typeof y<"u"&&y)&&(n.registeredElements[o]={layers:[],sources:[],images:[],events:[],controls:[],wrapperEvents:[]})},this.addLayer=(o,y,v)=>n.map.style?(v&&typeof v=="string"&&typeof o.id<"u"&&(n.initRegisteredElements(v),n.registeredElements[v].layers.push(o.id),o?.source&&typeof o?.source!="string"&&n.registeredElements[v].sources.push(o.id)),n.map.addLayer(o,y),n.wrapper.fire("addlayer",{layer_id:o.id}),this):this,this.addSource=(o,y,v)=>n.map.style?(v&&typeof v=="string"&&typeof o<"u"&&(n.initRegisteredElements(v),n.registeredElements[v].sources.push(o)),n.map.addSource(o,y),n.wrapper.fire("addsource",{source_id:o}),this):this,this.addImage=(o,y,v,S)=>n.map.style?typeof v=="string"&&typeof S>"u"?n.addImage(o,y,void 0,v):(S&&typeof S=="string"&&typeof o<"u"&&(n.initRegisteredElements(S),n.registeredElements[S].images.push(o)),n.map.addImage(o,y,v),this):this,this.on=(o,y,v,S)=>{if(typeof v=="string"&&typeof y=="function")return n.on.call(n,o,void 0,y,v);let P=[o,y,v];return y||(P=[o,v]),S&&typeof S=="string"&&(n.initRegisteredElements(S),n.registeredElements[S].events.push(P)),n.map.on(...P),this},this.addControl=(o,y,v)=>(v&&typeof v=="string"&&(n.initRegisteredElements(v),n.registeredElements[v].controls.push(o)),n.map.addControl(o,y),this),this.cleanup=o=>{n.map.style&&typeof n.registeredElements[o]<"u"&&(n.registeredElements[o].layers.forEach(y=>{n.map.style.getLayer(y)&&n.map.style.removeLayer(y)}),n.registeredElements[o].sources.forEach(y=>{n.map.style.getSource(y)&&n.map.style.removeSource(y)}),n.registeredElements[o].images.forEach(y=>{n.map.hasImage(y)&&n.map.style.removeImage(y)}),n.registeredElements[o].events.forEach(y=>{n.map.off(...y)}),n.registeredElements[o].controls.forEach(y=>{n.map.removeControl(y)}),n.registeredElements[o].wrapperEvents.forEach(y=>{n.wrapper.off(...y)}),n.initRegisteredElements(o,!0))},["moveLayer","removeLayer","removeSource","setPaintProperty","setLayoutProperty"].forEach(o=>{this[o]=(...y)=>(n.map&&n.map.style&&typeof n.map.style[o]=="function"&&n.map.style[o](...y),n.map._update?n.map._update(!0):void 0)}),["getLayer","getSource","listImages","getPaintProperty","getLayoutProperty","removeImage"].forEach(o=>{this[o]=(...y)=>n.map&&n.map.style?n.map.style[o](...y):!1}),this.addNativeMaplibreFunctionsAndProps=()=>{Object.getOwnPropertyNames(Object.getPrototypeOf(this.map)).forEach(o=>{typeof this[o]>"u"&&(this[o]=(...y)=>n.map[o](...y))}),Object.keys(this.map).forEach(o=>{typeof this[o]>"u"&&(this[o]=n.map[o])})},["getZoom","setZoom","getCenter","setCenter","getBearing","setBearing","getPitch","setPitch","jumpTo","flyTo","panTo","panBy","panBy","zoomTo","zoomIn","zoomOut","getPadding","setPadding","rotateTo","resetNorth","resetNorthPitch","snapToNorth","cameraForBounds","fitBounds","fitScreenCoordinates","getFreeCameraOptions","setFreeCameraOptions","easeTo","stop"].forEach(o=>{this[o]=(...y)=>{if(typeof n.map[o]=="function")return n.map[o].call(n.map,...y)}}),(async()=>{typeof t.mapOptions.style=="string"&&t.mapOptions.style.indexOf("mapbox://")===-1&&await fetch(t.mapOptions.style).then(o=>{if(o.ok)return o.json();throw new Error("error loading map style.json")}).then(o=>{o.layers.forEach(y=>{n.baseLayers.push(y.id),!n.firstSymbolLayer&&y.type==="symbol"&&(n.firstSymbolLayer=y.id)}),n.styleJson=o,t.mapOptions.style=o}).catch(o=>{console.log(o)}),n.map=new QD.Map(t.mapOptions),n.addNativeMaplibreFunctionsAndProps(),n.wrapper.refreshViewport(),n.wrapper.fire("viewportchange"),n.map.on("load",()=>{n.addNativeMaplibreFunctionsAndProps()}),n.map.on("move",()=>{n.wrapper.viewportState=n.wrapper.getViewport(),n.wrapper.fire("viewportchange")}),n.map.on("idle",()=>{n.wrapper.refreshLayerState()}),n.map.on("data",()=>{n.wrapper.refreshLayerState()}),typeof t.onReady=="function"&&t.onReady(n.map,n)})()}}function Yc(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(a=>n.searchParams.append("args[]",a)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Yu="$$material";function rg(){return rg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},rg.apply(null,arguments)}function tk(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function rk(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var nk=(function(){function e(n){var a=this;this._insertTag=function(c){var h;a.tags.length===0?a.insertionPoint?h=a.insertionPoint.nextSibling:a.prepend?h=a.container.firstChild:h=a.before:h=a.tags[a.tags.length-1].nextSibling,a.container.insertBefore(c,h),a.tags.push(c)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(a){a.forEach(this._insertTag)},t.insert=function(a){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(rk(this));var c=this.tags[this.tags.length-1];if(this.isSpeedy){var h=tk(c);try{h.insertRule(a,h.cssRules.length)}catch{}}else c.appendChild(document.createTextNode(a));this.ctr++},t.flush=function(){this.tags.forEach(function(a){var c;return(c=a.parentNode)==null?void 0:c.removeChild(a)}),this.tags=[],this.ctr=0},e})(),Bs="-ms-",ng="-moz-",Ri="-webkit-",pP="comm",Hb="rule",Wb="decl",ik="@import",mP="@keyframes",ok="@layer",ak=Math.abs,Ag=String.fromCharCode,sk=Object.assign;function lk(e,t){return hs(e,0)^45?(((t<<2^hs(e,0))<<2^hs(e,1))<<2^hs(e,2))<<2^hs(e,3):0}function gP(e){return e.trim()}function uk(e,t){return(e=t.exec(e))?e[0]:e}function Ni(e,t,n){return e.replace(t,n)}function tb(e,t){return e.indexOf(t)}function hs(e,t){return e.charCodeAt(t)|0}function wp(e,t,n){return e.slice(t,n)}function Gu(e){return e.length}function Zb(e){return e.length}function _m(e,t){return t.push(e),e}function ck(e,t){return e.map(t).join("")}var Pg=1,hd=1,yP=0,gl=0,Ca=0,pd="";function Ig(e,t,n,a,c,h,f){return{value:e,root:t,parent:n,type:a,props:c,children:h,line:Pg,column:hd,length:f,return:""}}function Hd(e,t){return sk(Ig("",null,null,"",null,null,0),e,{length:-e.length},t)}function hk(){return Ca}function fk(){return Ca=gl>0?hs(pd,--gl):0,hd--,Ca===10&&(hd=1,Pg--),Ca}function zl(){return Ca=gl<yP?hs(pd,gl++):0,hd++,Ca===10&&(hd=1,Pg++),Ca}function Xu(){return hs(pd,gl)}function qm(){return gl}function Np(e,t){return wp(pd,e,t)}function Sp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _P(e){return Pg=hd=1,yP=Gu(pd=e),gl=0,[]}function vP(e){return pd="",e}function $m(e){return gP(Np(gl-1,rb(e===91?e+2:e===40?e+1:e)))}function dk(e){for(;(Ca=Xu())&&Ca<33;)zl();return Sp(e)>2||Sp(Ca)>3?"":" "}function pk(e,t){for(;--t&&zl()&&!(Ca<48||Ca>102||Ca>57&&Ca<65||Ca>70&&Ca<97););return Np(e,qm()+(t<6&&Xu()==32&&zl()==32))}function rb(e){for(;zl();)switch(Ca){case e:return gl;case 34:case 39:e!==34&&e!==39&&rb(Ca);break;case 40:e===41&&rb(e);break;case 92:zl();break}return gl}function mk(e,t){for(;zl()&&e+Ca!==57;)if(e+Ca===84&&Xu()===47)break;return"/*"+Np(t,gl-1)+"*"+Ag(e===47?e:zl())}function gk(e){for(;!Sp(Xu());)zl();return Np(e,gl)}function yk(e){return vP(Vm("",null,null,null,[""],e=_P(e),0,[0],e))}function Vm(e,t,n,a,c,h,f,o,y){for(var v=0,S=0,P=f,M=0,E=0,O=0,N=1,z=1,U=1,ee=0,ae="",W=c,le=h,te=a,we=ae;z;)switch(O=ee,ee=zl()){case 40:if(O!=108&&hs(we,P-1)==58){tb(we+=Ni($m(ee),"&","&\f"),"&\f")!=-1&&(U=-1);break}case 34:case 39:case 91:we+=$m(ee);break;case 9:case 10:case 13:case 32:we+=dk(O);break;case 92:we+=pk(qm()-1,7);continue;case 47:switch(Xu()){case 42:case 47:_m(_k(mk(zl(),qm()),t,n),y);break;default:we+="/"}break;case 123*N:o[v++]=Gu(we)*U;case 125*N:case 59:case 0:switch(ee){case 0:case 125:z=0;case 59+S:U==-1&&(we=Ni(we,/\f/g,"")),E>0&&Gu(we)-P&&_m(E>32?g5(we+";",a,n,P-1):g5(Ni(we," ","")+";",a,n,P-2),y);break;case 59:we+=";";default:if(_m(te=m5(we,t,n,v,S,c,o,ae,W=[],le=[],P),h),ee===123)if(S===0)Vm(we,t,te,te,W,h,P,o,le);else switch(M===99&&hs(we,3)===110?100:M){case 100:case 108:case 109:case 115:Vm(e,te,te,a&&_m(m5(e,te,te,0,0,c,o,ae,c,W=[],P),le),c,le,P,o,a?W:le);break;default:Vm(we,te,te,te,[""],le,0,o,le)}}v=S=E=0,N=U=1,ae=we="",P=f;break;case 58:P=1+Gu(we),E=O;default:if(N<1){if(ee==123)--N;else if(ee==125&&N++==0&&fk()==125)continue}switch(we+=Ag(ee),ee*N){case 38:U=S>0?1:(we+="\f",-1);break;case 44:o[v++]=(Gu(we)-1)*U,U=1;break;case 64:Xu()===45&&(we+=$m(zl())),M=Xu(),S=P=Gu(ae=we+=gk(qm())),ee++;break;case 45:O===45&&Gu(we)==2&&(N=0)}}return h}function m5(e,t,n,a,c,h,f,o,y,v,S){for(var P=c-1,M=c===0?h:[""],E=Zb(M),O=0,N=0,z=0;O<a;++O)for(var U=0,ee=wp(e,P+1,P=ak(N=f[O])),ae=e;U<E;++U)(ae=gP(N>0?M[U]+" "+ee:Ni(ee,/&\f/g,M[U])))&&(y[z++]=ae);return Ig(e,t,n,c===0?Hb:o,y,v,S)}function _k(e,t,n){return Ig(e,t,n,pP,Ag(hk()),wp(e,2,-2),0)}function g5(e,t,n,a){return Ig(e,t,n,Wb,wp(e,0,a),wp(e,a+1,-1),a)}function od(e,t){for(var n="",a=Zb(e),c=0;c<a;c++)n+=t(e[c],c,e,t)||"";return n}function vk(e,t,n,a){switch(e.type){case ok:if(e.children.length)break;case ik:case Wb:return e.return=e.return||e.value;case pP:return"";case mP:return e.return=e.value+"{"+od(e.children,a)+"}";case Hb:e.value=e.props.join(",")}return Gu(n=od(e.children,a))?e.return=e.value+"{"+n+"}":""}function bk(e){var t=Zb(e);return function(n,a,c,h){for(var f="",o=0;o<t;o++)f+=e[o](n,a,c,h)||"";return f}}function xk(e){return function(t){t.root||(t=t.return)&&e(t)}}function bP(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var wk=function(t,n,a){for(var c=0,h=0;c=h,h=Xu(),c===38&&h===12&&(n[a]=1),!Sp(h);)zl();return Np(t,gl)},Sk=function(t,n){var a=-1,c=44;do switch(Sp(c)){case 0:c===38&&Xu()===12&&(n[a]=1),t[a]+=wk(gl-1,n,a);break;case 2:t[a]+=$m(c);break;case 4:if(c===44){t[++a]=Xu()===58?"&\f":"",n[a]=t[a].length;break}default:t[a]+=Ag(c)}while(c=zl());return t},Ek=function(t,n){return vP(Sk(_P(t),n))},y5=new WeakMap,Tk=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,a=t.parent,c=t.column===a.column&&t.line===a.line;a.type!=="rule";)if(a=a.parent,!a)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!y5.get(a))&&!c){y5.set(t,!0);for(var h=[],f=Ek(n,h),o=a.props,y=0,v=0;y<f.length;y++)for(var S=0;S<o.length;S++,v++)t.props[v]=h[y]?f[y].replace(/&\f/g,o[S]):o[S]+" "+f[y]}}},Ck=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function xP(e,t){switch(lk(e,t)){case 5103:return Ri+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ri+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ri+e+ng+e+Bs+e+e;case 6828:case 4268:return Ri+e+Bs+e+e;case 6165:return Ri+e+Bs+"flex-"+e+e;case 5187:return Ri+e+Ni(e,/(\w+).+(:[^]+)/,Ri+"box-$1$2"+Bs+"flex-$1$2")+e;case 5443:return Ri+e+Bs+"flex-item-"+Ni(e,/flex-|-self/,"")+e;case 4675:return Ri+e+Bs+"flex-line-pack"+Ni(e,/align-content|flex-|-self/,"")+e;case 5548:return Ri+e+Bs+Ni(e,"shrink","negative")+e;case 5292:return Ri+e+Bs+Ni(e,"basis","preferred-size")+e;case 6060:return Ri+"box-"+Ni(e,"-grow","")+Ri+e+Bs+Ni(e,"grow","positive")+e;case 4554:return Ri+Ni(e,/([^-])(transform)/g,"$1"+Ri+"$2")+e;case 6187:return Ni(Ni(Ni(e,/(zoom-|grab)/,Ri+"$1"),/(image-set)/,Ri+"$1"),e,"")+e;case 5495:case 3959:return Ni(e,/(image-set\([^]*)/,Ri+"$1$`$1");case 4968:return Ni(Ni(e,/(.+:)(flex-)?(.*)/,Ri+"box-pack:$3"+Bs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ri+e+e;case 4095:case 3583:case 4068:case 2532:return Ni(e,/(.+)-inline(.+)/,Ri+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Gu(e)-1-t>6)switch(hs(e,t+1)){case 109:if(hs(e,t+4)!==45)break;case 102:return Ni(e,/(.+:)(.+)-([^]+)/,"$1"+Ri+"$2-$3$1"+ng+(hs(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~tb(e,"stretch")?xP(Ni(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(hs(e,t+1)!==115)break;case 6444:switch(hs(e,Gu(e)-3-(~tb(e,"!important")&&10))){case 107:return Ni(e,":",":"+Ri)+e;case 101:return Ni(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ri+(hs(e,14)===45?"inline-":"")+"box$3$1"+Ri+"$2$3$1"+Bs+"$2box$3")+e}break;case 5936:switch(hs(e,t+11)){case 114:return Ri+e+Bs+Ni(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ri+e+Bs+Ni(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ri+e+Bs+Ni(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ri+e+Bs+e+e}return e}var Ak=function(t,n,a,c){if(t.length>-1&&!t.return)switch(t.type){case Wb:t.return=xP(t.value,t.length);break;case mP:return od([Hd(t,{value:Ni(t.value,"@","@"+Ri)})],c);case Hb:if(t.length)return ck(t.props,function(h){switch(uk(h,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return od([Hd(t,{props:[Ni(h,/:(read-\w+)/,":"+ng+"$1")]})],c);case"::placeholder":return od([Hd(t,{props:[Ni(h,/:(plac\w+)/,":"+Ri+"input-$1")]}),Hd(t,{props:[Ni(h,/:(plac\w+)/,":"+ng+"$1")]}),Hd(t,{props:[Ni(h,/:(plac\w+)/,Bs+"input-$1")]})],c)}return""})}},Pk=[Ak],Ik=function(t){var n=t.key;if(n==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(N){var z=N.getAttribute("data-emotion");z.indexOf(" ")!==-1&&(document.head.appendChild(N),N.setAttribute("data-s",""))})}var c=t.stylisPlugins||Pk,h={},f,o=[];f=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(N){for(var z=N.getAttribute("data-emotion").split(" "),U=1;U<z.length;U++)h[z[U]]=!0;o.push(N)});var y,v=[Tk,Ck];{var S,P=[vk,xk(function(N){S.insert(N)})],M=bk(v.concat(c,P)),E=function(z){return od(yk(z),M)};y=function(z,U,ee,ae){S=ee,E(z?z+"{"+U.styles+"}":U.styles),ae&&(O.inserted[U.name]=!0)}}var O={key:n,sheet:new nk({key:n,container:f,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:h,registered:{},insert:y};return O.sheet.hydrate(o),O},vm={exports:{}},zi={};/** @license React v16.13.1
770
+ ${ie.shaderPreludeCode.vertexSource}`,define:ie.shaderDefine},defaultProjectionData:Ue},qe=Y.renderingMode?Y.renderingMode:"2d";if(T.renderPass==="offscreen"){const Ke=Y.prerender;Ke&&(T.setCustomLayerDefaults(),X.setColorMode(T.colorModeForRenderPass()),Ke.call(Y,X.gl,je),X.setDirty(),T.setBaseState())}else if(T.renderPass==="translucent"){T.setCustomLayerDefaults(),X.setColorMode(T.colorModeForRenderPass()),X.setStencilMode(cn.disabled);const Ke=qe==="3d"?T.getDepthModeFor3D():T.getDepthModeForSublayer(0,pn.ReadOnly);X.setDepthMode(Ke),Y.render(X.gl,je),X.setDirty(),T.setBaseState(),X.bindFramebuffer.set(null)}})(r,0,p,b))}saveTileTexture(r){const s=this._tileTextures[r.size[0]];s?s.push(r):this._tileTextures[r.size[0]]=[r]}getTileTexture(r){const s=this._tileTextures[r];return s&&s.length>0?s.pop():null}isPatternMissing(r){if(!r)return!1;if(!r.from||!r.to)return!0;const s=this.imageManager.getPattern(r.from.toString()),p=this.imageManager.getPattern(r.to.toString());return!s||!p}useProgram(r,s,p=!1,m=[]){this.cache=this.cache||{};const b=!!this.style.map.terrain,T=this.style.projection,I=p?yt.projectionMercator:T.shaderPreludeCode,R=p?xr:T.shaderDefine,j=r+(s?s.cacheKey:"")+`/${p?Fr:T.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(b?"/terrain":"")+(m?`/${m.join("/")}`:"");return this.cache[j]||(this.cache[j]=new el(this.context,yt[r],s,is[r],this._showOverdrawInspector,b,I,R,m)),this.cache[j]}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 r=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(r.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new o.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:r,drawingBufferHeight:s}=this.context.gl;return this.width!==r||this.height!==s}}function Ra(_,r){let s,p=!1,m=null,b=null;const T=()=>{m=null,p&&(_.apply(b,s),m=setTimeout(T,r),p=!1)};return(...I)=>(p=!0,b=this,s=I,m||T(),m)}class sc{constructor(r){this._getCurrentHash=()=>{const s=window.location.hash.replace("#","");if(this._hashName){let p;return s.split("&").map((m=>m.split("="))).forEach((m=>{m[0]===this._hashName&&(p=m)})),(p&&p[1]||"").split("/")}return s.split("/")},this._onHashChange=()=>{const s=this._getCurrentHash();if(!this._isValidHash(s))return!1;const p=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(s[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+s[2],+s[1]],zoom:+s[0],bearing:p,pitch:+(s[4]||0)}),!0},this._updateHashUnthrottled=()=>{const s=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,s)},this._removeHash=()=>{const s=this._getCurrentHash();if(s.length===0)return;const p=s.join("/");let m=p;m.split("&").length>0&&(m=m.split("&")[0]),this._hashName&&(m=`${this._hashName}=${p}`);let b=window.location.hash.replace(m,"");b.startsWith("#&")?b=b.slice(0,1)+b.slice(2):b==="#"&&(b="");let T=window.location.href.replace(/(#.+)?$/,b);T=T.replace("&&","&"),window.history.replaceState(window.history.state,null,T)},this._updateHash=Ra(this._updateHashUnthrottled,300),this._hashName=r&&encodeURIComponent(r)}addTo(r){return this._map=r,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(r){const s=this._map.getCenter(),p=Math.round(100*this._map.getZoom())/100,m=Math.ceil((p*Math.LN2+Math.log(512/360/.5))/Math.LN10),b=Math.pow(10,m),T=Math.round(s.lng*b)/b,I=Math.round(s.lat*b)/b,R=this._map.getBearing(),j=this._map.getPitch();let G="";if(G+=r?`/${T}/${I}/${p}`:`${p}/${I}/${T}`,(R||j)&&(G+="/"+Math.round(10*R)/10),j&&(G+=`/${Math.round(j)}`),this._hashName){const X=this._hashName;let Y=!1;const ie=window.location.hash.slice(1).split("&").map((be=>{const Ue=be.split("=")[0];return Ue===X?(Y=!0,`${Ue}=${G}`):be})).filter((be=>be));return Y||ie.push(`${X}=${G}`),`#${ie.join("&")}`}return`#${G}`}_isValidHash(r){if(r.length<3||r.some(isNaN))return!1;try{new o.S(+r[2],+r[1])}catch{return!1}const s=+r[0],p=+(r[3]||0),m=+(r[4]||0);return s>=this._map.getMinZoom()&&s<=this._map.getMaxZoom()&&p>=-180&&p<=180&&m>=this._map.getMinPitch()&&m<=this._map.getMaxPitch()}}const ku={linearity:.3,easing:o.cl(0,0,.3,1)},hu=o.e({deceleration:2500,maxSpeed:1400},ku),Dc=o.e({deceleration:20,maxSpeed:1400},ku),Ru=o.e({deceleration:1e3,maxSpeed:360},ku),kc=o.e({deceleration:1e3,maxSpeed:90},ku),of=o.e({deceleration:1e3,maxSpeed:360},ku);class lc{constructor(r){this._map=r,this.clear()}clear(){this._inertiaBuffer=[]}record(r){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:M.now(),settings:r})}_drainInertiaBuffer(){const r=this._inertiaBuffer,s=M.now();for(;r.length>0&&s-r[0].time>160;)r.shift()}_onMoveEnd(r){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const s={zoom:0,bearing:0,pitch:0,roll:0,pan:new o.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:b}of this._inertiaBuffer)s.zoom+=b.zoomDelta||0,s.bearing+=b.bearingDelta||0,s.pitch+=b.pitchDelta||0,s.roll+=b.rollDelta||0,b.panDelta&&s.pan._add(b.panDelta),b.around&&(s.around=b.around),b.pinchAround&&(s.pinchAround=b.pinchAround);const p=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,m={};if(s.pan.mag()){const b=cl(s.pan.mag(),p,o.e({},hu,r||{})),T=s.pan.mult(b.amount/s.pan.mag()),I=this._map.cameraHelper.handlePanInertia(T,this._map.transform);m.center=I.easingCenter,m.offset=I.easingOffset,Pl(m,b)}if(s.zoom){const b=cl(s.zoom,p,Dc);m.zoom=this._map.transform.zoom+b.amount,Pl(m,b)}if(s.bearing){const b=cl(s.bearing,p,Ru);m.bearing=this._map.transform.bearing+o.ag(b.amount,-179,179),Pl(m,b)}if(s.pitch){const b=cl(s.pitch,p,kc);m.pitch=this._map.transform.pitch+b.amount,Pl(m,b)}if(s.roll){const b=cl(s.roll,p,of);m.roll=this._map.transform.roll+o.ag(b.amount,-179,179),Pl(m,b)}if(m.zoom||m.bearing){const b=s.pinchAround===void 0?s.around:s.pinchAround;m.around=b?this._map.unproject(b):this._map.getCenter()}return this.clear(),o.e(m,{noMoveStart:!0})}}function Pl(_,r){(!_.duration||_.duration<r.duration)&&(_.duration=r.duration,_.easing=r.easing)}function cl(_,r,s){const{maxSpeed:p,linearity:m,deceleration:b}=s,T=o.ag(_*m/(r/1e3),-p,p),I=Math.abs(T)/(b*m);return{easing:s.easing,duration:1e3*I,amount:T*(I/2)}}class _a extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,s,p,m={}){p=p instanceof MouseEvent?p:new MouseEvent(r,p);const b=E.mousePos(s.getCanvas(),p),T=s.unproject(b);super(r,o.e({point:b,lngLat:T,originalEvent:p},m)),this._defaultPrevented=!1,this.target=s}}class Ws extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,s,p){const m=r==="touchend"?p.changedTouches:p.touches,b=E.touchPos(s.getCanvasContainer(),m),T=b.map((R=>s.unproject(R))),I=b.reduce(((R,j,G,X)=>R.add(j.div(X.length))),new o.P(0,0));super(r,{points:b,point:I,lngLats:T,lngLat:s.unproject(I),originalEvent:p}),this._defaultPrevented=!1}}class Rc extends o.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(r,s,p){super(r,{originalEvent:p}),this._defaultPrevented=!1}}class af{constructor(r,s){this._map=r,this._clickTolerance=s.clickTolerance}reset(){delete this._mousedownPos}wheel(r){return this._firePreventable(new Rc(r.type,this._map,r))}mousedown(r,s){return this._mousedownPos=s,this._firePreventable(new _a(r.type,this._map,r))}mouseup(r){this._map.fire(new _a(r.type,this._map,r))}click(r,s){this._mousedownPos&&this._mousedownPos.dist(s)>=this._clickTolerance||this._map.fire(new _a(r.type,this._map,r))}dblclick(r){return this._firePreventable(new _a(r.type,this._map,r))}mouseover(r){this._map.fire(new _a(r.type,this._map,r))}mouseout(r){this._map.fire(new _a(r.type,this._map,r))}touchstart(r){return this._firePreventable(new Ws(r.type,this._map,r))}touchmove(r){this._map.fire(new Ws(r.type,this._map,r))}touchend(r){this._map.fire(new Ws(r.type,this._map,r))}touchcancel(r){this._map.fire(new Ws(r.type,this._map,r))}_firePreventable(r){if(this._map.fire(r),r.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class sf{constructor(r){this._map=r}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(r){this._map.fire(new _a(r.type,this._map,r))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new _a("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(r){this._delayContextMenu?this._contextMenuEvent=r:this._ignoreContextMenu||this._map.fire(new _a(r.type,this._map,r)),this._map.listens("contextmenu")&&r.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Nu{constructor(r){this._map=r}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(r){return this.transform.screenPointToLocation(o.P.convert(r),this._map.terrain)}}class hh{constructor(r,s){this._map=r,this._tr=new Nu(r),this._el=r.getCanvasContainer(),this._container=r.getContainer(),this._clickTolerance=s.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(r,s){this.isEnabled()&&r.shiftKey&&r.button===0&&(E.disableDrag(),this._startPos=this._lastPos=s,this._active=!0)}mousemoveWindow(r,s){if(!this._active)return;const p=s;if(this._lastPos.equals(p)||!this._box&&p.dist(this._startPos)<this._clickTolerance)return;const m=this._startPos;this._lastPos=p,this._box||(this._box=E.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",r));const b=Math.min(m.x,p.x),T=Math.max(m.x,p.x),I=Math.min(m.y,p.y),R=Math.max(m.y,p.y);E.setTransform(this._box,`translate(${b}px,${I}px)`),this._box.style.width=T-b+"px",this._box.style.height=R-I+"px"}mouseupWindow(r,s){if(!this._active||r.button!==0)return;const p=this._startPos,m=s;if(this.reset(),E.suppressClick(),p.x!==m.x||p.y!==m.y)return this._map.fire(new o.l("boxzoomend",{originalEvent:r})),{cameraAnimation:b=>b.fitScreenCoordinates(p,m,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",r)}keydown(r){this._active&&r.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",r))}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(r,s){return this._map.fire(new o.l(r,{originalEvent:s}))}}function Nc(_,r){if(_.length!==r.length)throw new Error(`The number of touches and points are not equal - touches ${_.length}, points ${r.length}`);const s={};for(let p=0;p<_.length;p++)s[_[p].identifier]=r[p];return s}class lf{constructor(r){this.reset(),this.numTouches=r.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(r,s,p){(this.centroid||p.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=r.timeStamp),p.length===this.numTouches&&(this.centroid=(function(m){const b=new o.P(0,0);for(const T of m)b._add(T);return b.div(m.length)})(s),this.touches=Nc(p,s)))}touchmove(r,s,p){if(this.aborted||!this.centroid)return;const m=Nc(p,s);for(const b in this.touches){const T=m[b];(!T||T.dist(this.touches[b])>30)&&(this.aborted=!0)}}touchend(r,s,p){if((!this.centroid||r.timeStamp-this.startTime>500)&&(this.aborted=!0),p.length===0){const m=!this.aborted&&this.centroid;if(this.reset(),m)return m}}}class uc{constructor(r){this.singleTap=new lf(r),this.numTaps=r.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(r,s,p){this.singleTap.touchstart(r,s,p)}touchmove(r,s,p){this.singleTap.touchmove(r,s,p)}touchend(r,s,p){const m=this.singleTap.touchend(r,s,p);if(m){const b=r.timeStamp-this.lastTime<500,T=!this.lastTap||this.lastTap.dist(m)<30;if(b&&T||this.reset(),this.count++,this.lastTime=r.timeStamp,this.lastTap=m,this.count===this.numTaps)return this.reset(),m}}}class fu{constructor(r){this._tr=new Nu(r),this._zoomIn=new uc({numTouches:1,numTaps:2}),this._zoomOut=new uc({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(r,s,p){this._zoomIn.touchstart(r,s,p),this._zoomOut.touchstart(r,s,p)}touchmove(r,s,p){this._zoomIn.touchmove(r,s,p),this._zoomOut.touchmove(r,s,p)}touchend(r,s,p){const m=this._zoomIn.touchend(r,s,p),b=this._zoomOut.touchend(r,s,p),T=this._tr;return m?(this._active=!0,r.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:T.zoom+1,around:T.unproject(m)},{originalEvent:r})}):b?(this._active=!0,r.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:I=>I.easeTo({duration:300,zoom:T.zoom-1,around:T.unproject(b)},{originalEvent:r})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ou{constructor(r){this._enabled=!!r.enable,this._moveStateManager=r.moveStateManager,this._clickTolerance=r.clickTolerance||1,this._moveFunction=r.move,this._activateOnStart=!!r.activateOnStart,r.assignEvents(this),this.reset()}reset(r){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(r)}_move(...r){const s=this._moveFunction(...r);if(s.bearingDelta||s.pitchDelta||s.rollDelta||s.around||s.panDelta)return this._active=!0,s}dragStart(r,s){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(r)&&(this._moveStateManager.startMove(r),this._lastPoint=Array.isArray(s)?s[0]:s,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(r,s){if(!this.isEnabled())return;const p=this._lastPoint;if(!p)return;if(r.preventDefault(),!this._moveStateManager.isValidMoveEvent(r))return void this.reset(r);const m=Array.isArray(s)?s[0]:s;return!this._moved&&m.dist(p)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=m,this._move(p,m))}dragEnd(r){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(r)&&(this._moved&&E.suppressClick(),this.reset(r))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Is=0,Ms=2,C={[Is]:1,[Ms]:2};class L{constructor(r){this._correctEvent=r.checkCorrectEvent}startMove(r){const s=E.mouseButton(r);this._eventButton=s}endMove(r){delete this._eventButton}isValidStartEvent(r){return this._correctEvent(r)}isValidMoveEvent(r){return!(function(s,p){const m=C[p];return s.buttons===void 0||(s.buttons&m)!==m})(r,this._eventButton)}isValidEndEvent(r){return E.mouseButton(r)===this._eventButton}}class ${constructor(){this._firstTouch=void 0}_isOneFingerTouch(r){return r.targetTouches.length===1}_isSameTouchEvent(r){return r.targetTouches[0].identifier===this._firstTouch}startMove(r){this._firstTouch=r.targetTouches[0].identifier}endMove(r){delete this._firstTouch}isValidStartEvent(r){return this._isOneFingerTouch(r)}isValidMoveEvent(r){return this._isOneFingerTouch(r)&&this._isSameTouchEvent(r)}isValidEndEvent(r){return this._isOneFingerTouch(r)&&this._isSameTouchEvent(r)}}class K{constructor(r=new L({checkCorrectEvent:()=>!0}),s=new $){this.mouseMoveStateManager=r,this.oneFingerTouchMoveStateManager=s}_executeRelevantHandler(r,s,p){return r instanceof MouseEvent?s(r):typeof TouchEvent<"u"&&r instanceof TouchEvent?p(r):void 0}startMove(r){this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.startMove(s)),(s=>this.oneFingerTouchMoveStateManager.startMove(s)))}endMove(r){this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.endMove(s)),(s=>this.oneFingerTouchMoveStateManager.endMove(s)))}isValidStartEvent(r){return this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.isValidStartEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidStartEvent(s)))}isValidMoveEvent(r){return this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.isValidMoveEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(s)))}isValidEndEvent(r){return this._executeRelevantHandler(r,(s=>this.mouseMoveStateManager.isValidEndEvent(s)),(s=>this.oneFingerTouchMoveStateManager.isValidEndEvent(s)))}}const ve=_=>{_.mousedown=_.dragStart,_.mousemoveWindow=_.dragMove,_.mouseup=_.dragEnd,_.contextmenu=r=>{r.preventDefault()}};class Ce{constructor(r,s){this._clickTolerance=r.clickTolerance||1,this._map=s,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new o.P(0,0)}_shouldBePrevented(r){return r<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(r,s,p){return this._calculateTransform(r,s,p)}touchmove(r,s,p){if(this._active){if(!this._shouldBePrevented(p.length))return r.preventDefault(),this._calculateTransform(r,s,p);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",r)}}touchend(r,s,p){this._calculateTransform(r,s,p),this._active&&this._shouldBePrevented(p.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(r,s,p){p.length>0&&(this._active=!0);const m=Nc(p,s),b=new o.P(0,0),T=new o.P(0,0);let I=0;for(const j in m){const G=m[j],X=this._touches[j];X&&(b._add(G),T._add(G.sub(X)),I++,m[j]=G)}if(this._touches=m,this._shouldBePrevented(I)||!T.mag())return;const R=T.div(I);return this._sum._add(R),this._sum.mag()<this._clickTolerance?void 0:{around:b.div(I),panDelta:R}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class De{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(r,s,p){this._firstTwoTouches||p.length<2||(this._firstTwoTouches=[p[0].identifier,p[1].identifier],this._start([s[0],s[1]]))}touchmove(r,s,p){if(!this._firstTwoTouches)return;r.preventDefault();const[m,b]=this._firstTwoTouches,T=Oe(p,s,m),I=Oe(p,s,b);if(!T||!I)return;const R=this._aroundCenter?null:T.add(I).div(2);return this._move([T,I],R,r)}touchend(r,s,p){if(!this._firstTwoTouches)return;const[m,b]=this._firstTwoTouches,T=Oe(p,s,m),I=Oe(p,s,b);T&&I||(this._active&&E.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(r){this._enabled=!0,this._aroundCenter=!!r&&r.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function Oe(_,r,s){for(let p=0;p<_.length;p++)if(_[p].identifier===s)return r[p]}function $e(_,r){return Math.log(_/r)/Math.LN2}class Je extends De{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(r){this._startDistance=this._distance=r[0].dist(r[1])}_move(r,s){const p=this._distance;if(this._distance=r[0].dist(r[1]),this._active||!(Math.abs($e(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:$e(this._distance,p),pinchAround:s}}}function Qe(_,r){return 180*_.angleWith(r)/Math.PI}class Gt extends De{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(r){this._startVector=this._vector=r[0].sub(r[1]),this._minDiameter=r[0].dist(r[1])}_move(r,s,p){const m=this._vector;if(this._vector=r[0].sub(r[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Qe(this._vector,m),pinchAround:s}}_isBelowThreshold(r){this._minDiameter=Math.min(this._minDiameter,r.mag());const s=25/(Math.PI*this._minDiameter)*360,p=Qe(r,this._startVector);return Math.abs(p)<s}}function et(_){return Math.abs(_.y)>Math.abs(_.x)}class Lt extends De{constructor(r){super(),this._currentTouchCount=0,this._map=r}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(r,s,p){super.touchstart(r,s,p),this._currentTouchCount=p.length}_start(r){this._lastPoints=r,et(r[0].sub(r[1]))&&(this._valid=!1)}_move(r,s,p){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const m=r[0].sub(this._lastPoints[0]),b=r[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(m,b,p.timeStamp),this._valid?(this._lastPoints=r,this._active=!0,{pitchDelta:(m.y+b.y)/2*-.5}):void 0}gestureBeginsVertically(r,s,p){if(this._valid!==void 0)return this._valid;const m=r.mag()>=2,b=s.mag()>=2;if(!m&&!b)return;if(!m||!b)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;const T=r.y>0==s.y>0;return et(r)&&et(s)&&T}}const Ot={panStep:100,bearingStep:15,pitchStep:10};class tr{constructor(r){this._tr=new Nu(r);const s=Ot;this._panStep=s.panStep,this._bearingStep=s.bearingStep,this._pitchStep=s.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(r){if(r.altKey||r.ctrlKey||r.metaKey)return;let s=0,p=0,m=0,b=0,T=0;switch(r.keyCode){case 61:case 107:case 171:case 187:s=1;break;case 189:case 109:case 173:s=-1;break;case 37:r.shiftKey?p=-1:(r.preventDefault(),b=-1);break;case 39:r.shiftKey?p=1:(r.preventDefault(),b=1);break;case 38:r.shiftKey?m=1:(r.preventDefault(),T=-1);break;case 40:r.shiftKey?m=-1:(r.preventDefault(),T=1);break;default:return}return this._rotationDisabled&&(p=0,m=0),{cameraAnimation:I=>{const R=this._tr;I.easeTo({duration:300,easeId:"keyboardHandler",easing:$t,zoom:s?Math.round(R.zoom)+s*(r.shiftKey?2:1):R.zoom,bearing:R.bearing+p*this._bearingStep,pitch:R.pitch+m*this._pitchStep,offset:[-b*this._panStep,-T*this._panStep],center:R.center},{originalEvent:r})}}}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 $t(_){return _*(2-_)}const jt=4.000244140625,ir=1/450;class Cr{constructor(r,s){this._onTimeout=p=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(p)},this._map=r,this._tr=new Nu(r),this._triggerRenderFrame=s,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=ir}setZoomRate(r){this._defaultZoomRate=r}setWheelZoomRate(r){this._wheelZoomRate=r}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(r){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!r&&r.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(r){return!!this._map.cooperativeGestures.isEnabled()&&!(r.ctrlKey||this._map.cooperativeGestures.isBypassed(r))}wheel(r){if(!this.isEnabled())return;if(this._shouldBePrevented(r))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",r);let s=r.deltaMode===WheelEvent.DOM_DELTA_LINE?40*r.deltaY:r.deltaY;const p=M.now(),m=p-(this._lastWheelEventTime||0);this._lastWheelEventTime=p,s!==0&&s%jt==0?this._type="wheel":s!==0&&Math.abs(s)<4?this._type="trackpad":m>400?(this._type=null,this._lastValue=s,this._timeout=setTimeout(this._onTimeout,40,r)):this._type||(this._type=Math.abs(m*s)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,s+=this._lastValue)),r.shiftKey&&s&&(s/=4),this._type&&(this._lastWheelEvent=r,this._delta-=s,this._active||this._start(r)),r.preventDefault()}_start(r){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 s=E.mousePos(this._map.getCanvas(),r),p=this._tr;this._aroundPoint=this._aroundCenter?p.transform.locationToScreenPoint(o.S.convert(p.center)):s,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const r=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){const I=r.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=I),typeof this._targetZoom=="number"&&(this._targetZoom+=I)}if(this._delta!==0){const I=this._type==="wheel"&&Math.abs(this._delta)>jt?this._wheelZoomRate:this._defaultZoomRate;let R=2/(1+Math.exp(-Math.abs(this._delta*I)));this._delta<0&&R!==0&&(R=1/R);const j=typeof this._targetZoom!="number"?r.scale:o.ae(this._targetZoom);this._targetZoom=r.getConstrained(r.getCameraLngLat(),o.aj(j*R)).zoom,this._type==="wheel"&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const s=typeof this._targetZoom!="number"?r.zoom:this._targetZoom,p=this._startZoom,m=this._easing;let b,T=!1;if(this._type==="wheel"&&p&&m){const I=M.now()-this._lastWheelEventTime,R=Math.min((I+5)/200,1),j=m(R);b=o.C.number(p,s,j),R<1?this._frameId||(this._frameId=!0):T=!0}else b=s,T=!0;return this._active=!0,T&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=b,{noInertia:!0,needsRenderFrame:!T,zoomDelta:b-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(r){let s=o.cn;if(this._prevEase){const p=this._prevEase,m=(M.now()-p.start)/p.duration,b=p.easing(m+.01)-p.easing(m),T=.27/Math.sqrt(b*b+1e-4)*.01,I=Math.sqrt(.0729-T*T);s=o.cl(T,I,.25,1)}return this._prevEase={start:M.now(),duration:r,easing:s},s}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class mr{constructor(r,s){this._clickZoom=r,this._tapZoom=s}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 yn{constructor(r){this._tr=new Nu(r),this.reset()}reset(){this._active=!1}dblclick(r,s){return r.preventDefault(),{cameraAnimation:p=>{p.easeTo({duration:300,zoom:this._tr.zoom+(r.shiftKey?-1:1),around:this._tr.unproject(s)},{originalEvent:r})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class an{constructor(){this._tap=new uc({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(r,s,p){if(!this._swipePoint)if(this._tapTime){const m=s[0],b=r.timeStamp-this._tapTime<500,T=this._tapPoint.dist(m)<30;b&&T?p.length>0&&(this._swipePoint=m,this._swipeTouch=p[0].identifier):this.reset()}else this._tap.touchstart(r,s,p)}touchmove(r,s,p){if(this._tapTime){if(this._swipePoint){if(p[0].identifier!==this._swipeTouch)return;const m=s[0],b=m.y-this._swipePoint.y;return this._swipePoint=m,r.preventDefault(),this._active=!0,{zoomDelta:b/128}}}else this._tap.touchmove(r,s,p)}touchend(r,s,p){if(this._tapTime)this._swipePoint&&p.length===0&&this.reset();else{const m=this._tap.touchend(r,s,p);m&&(this._tapTime=r.timeStamp,this._tapPoint=m)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class zn{constructor(r,s,p){this._el=r,this._mousePan=s,this._touchPan=p}enable(r){this._inertiaOptions=r||{},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 un{constructor(r,s,p,m){this._pitchWithRotate=r.pitchWithRotate,this._rollEnabled=r.rollEnabled,this._mouseRotate=s,this._mousePitch=p,this._mouseRoll=m}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 Yn{constructor(r,s,p,m){this._el=r,this._touchZoom=s,this._touchRotate=p,this._tapDragZoom=m,this._rotationDisabled=!1,this._enabled=!0}enable(r){this._touchZoom.enable(r),this._rotationDisabled||this._touchRotate.enable(r),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 ko{constructor(r,s){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=r,this._options=s,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const r=this._map.getCanvasContainer();r.classList.add("maplibregl-cooperative-gestures"),this._container=E.create("div","maplibregl-cooperative-gesture-screen",r);let s=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(s=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const p=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),m=document.createElement("div");m.className="maplibregl-desktop-message",m.textContent=s,this._container.appendChild(m);const b=document.createElement("div");b.className="maplibregl-mobile-message",b.textContent=p,this._container.appendChild(b),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(r){return r[this._bypassKey]}notifyGestureBlocked(r,s){this._enabled&&(this._map.fire(new o.l("cooperativegestureprevented",{gestureType:r,originalEvent:s})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}const kn=_=>_.zoom||_.drag||_.roll||_.pitch||_.rotate;class fn extends o.l{}function $r(_){return _.panDelta&&_.panDelta.mag()||_.zoomDelta||_.bearingDelta||_.pitchDelta||_.rollDelta}class Mi{constructor(r,s){this.handleWindowEvent=m=>{this.handleEvent(m,`${m.type}Window`)},this.handleEvent=(m,b)=>{if(m.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const T=m.type==="renderFrame"?void 0:m,I={needsRenderFrame:!1},R={},j={};for(const{handlerName:Y,handler:ie,allowed:be}of this._handlers){if(!ie.isEnabled())continue;let Ue;if(this._blockedByActive(j,be,Y))ie.reset();else if(ie[b||m.type]){if(o.co(m,b||m.type)){const je=E.mousePos(this._map.getCanvas(),m);Ue=ie[b||m.type](m,je)}else if(o.cp(m,b||m.type)){const je=this._getMapTouches(m.touches),qe=E.touchPos(this._map.getCanvas(),je);Ue=ie[b||m.type](m,qe,je)}else o.cq(b||m.type)||(Ue=ie[b||m.type](m));this.mergeHandlerResult(I,R,Ue,Y,T),Ue&&Ue.needsRenderFrame&&this._triggerRenderFrame()}(Ue||ie.isActive())&&(j[Y]=ie)}const G={};for(const Y in this._previousActiveHandlers)j[Y]||(G[Y]=T);this._previousActiveHandlers=j,(Object.keys(G).length||$r(I))&&(this._changes.push([I,R,G]),this._triggerRenderFrame()),(Object.keys(j).length||$r(I))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:X}=I;X&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],X(this._map))},this._map=r,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new lc(r),this._bearingSnap=s.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(s);const p=this._el;this._listeners=[[p,"touchstart",{passive:!0}],[p,"touchmove",{passive:!1}],[p,"touchend",void 0],[p,"touchcancel",void 0],[p,"mousedown",void 0],[p,"mousemove",void 0],[p,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[p,"mouseover",void 0],[p,"mouseout",void 0],[p,"dblclick",void 0],[p,"click",void 0],[p,"keydown",{capture:!1}],[p,"keyup",void 0],[p,"wheel",{passive:!1}],[p,"contextmenu",void 0],[window,"blur",void 0]];for(const[m,b,T]of this._listeners)E.addEventListener(m,b,m===document?this.handleWindowEvent:this.handleEvent,T)}destroy(){for(const[r,s,p]of this._listeners)E.removeEventListener(r,s,r===document?this.handleWindowEvent:this.handleEvent,p)}_addDefaultHandlers(r){const s=this._map,p=s.getCanvasContainer();this._add("mapEvent",new af(s,r));const m=s.boxZoom=new hh(s,r);this._add("boxZoom",m),r.interactive&&r.boxZoom&&m.enable();const b=s.cooperativeGestures=new ko(s,r.cooperativeGestures);this._add("cooperativeGestures",b),r.cooperativeGestures&&b.enable();const T=new fu(s),I=new yn(s);s.doubleClickZoom=new mr(I,T),this._add("tapZoom",T),this._add("clickZoom",I),r.interactive&&r.doubleClickZoom&&s.doubleClickZoom.enable();const R=new an;this._add("tapDragZoom",R);const j=s.touchPitch=new Lt(s);this._add("touchPitch",j),r.interactive&&r.touchPitch&&s.touchPitch.enable(r.touchPitch);const G=()=>s.project(s.getCenter()),X=(function({enable:nt,clickTolerance:dt,aroundCenter:bt=!0,minPixelCenterThreshold:rt=100,rotateDegreesPerPixelMoved:At=.8},qt){const Bt=new L({checkCorrectEvent:zt=>E.mouseButton(zt)===0&&zt.ctrlKey||E.mouseButton(zt)===2&&!zt.ctrlKey});return new Ou({clickTolerance:dt,move:(zt,Vt)=>{const Dr=qt();if(bt&&Math.abs(Dr.y-zt.y)>rt)return{bearingDelta:o.cm(new o.P(zt.x,Vt.y),Vt,Dr)};let Ar=(Vt.x-zt.x)*At;return bt&&Vt.y<Dr.y&&(Ar=-Ar),{bearingDelta:Ar}},moveStateManager:Bt,enable:nt,assignEvents:ve})})(r,G),Y=(function({enable:nt,clickTolerance:dt,pitchDegreesPerPixelMoved:bt=-.5}){const rt=new L({checkCorrectEvent:At=>E.mouseButton(At)===0&&At.ctrlKey||E.mouseButton(At)===2});return new Ou({clickTolerance:dt,move:(At,qt)=>({pitchDelta:(qt.y-At.y)*bt}),moveStateManager:rt,enable:nt,assignEvents:ve})})(r),ie=(function({enable:nt,clickTolerance:dt,rollDegreesPerPixelMoved:bt=.3},rt){const At=new L({checkCorrectEvent:qt=>E.mouseButton(qt)===2&&qt.ctrlKey});return new Ou({clickTolerance:dt,move:(qt,Bt)=>{const zt=rt();let Vt=(Bt.x-qt.x)*bt;return Bt.y<zt.y&&(Vt=-Vt),{rollDelta:Vt}},moveStateManager:At,enable:nt,assignEvents:ve})})(r,G);s.dragRotate=new un(r,X,Y,ie),this._add("mouseRotate",X,["mousePitch"]),this._add("mousePitch",Y,["mouseRotate","mouseRoll"]),this._add("mouseRoll",ie,["mousePitch"]),r.interactive&&r.dragRotate&&s.dragRotate.enable();const be=(function({enable:nt,clickTolerance:dt}){const bt=new L({checkCorrectEvent:rt=>E.mouseButton(rt)===0&&!rt.ctrlKey});return new Ou({clickTolerance:dt,move:(rt,At)=>({around:At,panDelta:At.sub(rt)}),activateOnStart:!0,moveStateManager:bt,enable:nt,assignEvents:ve})})(r),Ue=new Ce(r,s);s.dragPan=new zn(p,be,Ue),this._add("mousePan",be),this._add("touchPan",Ue,["touchZoom","touchRotate"]),r.interactive&&r.dragPan&&s.dragPan.enable(r.dragPan);const je=new Gt,qe=new Je;s.touchZoomRotate=new Yn(p,qe,je,R),this._add("touchRotate",je,["touchPan","touchZoom"]),this._add("touchZoom",qe,["touchPan","touchRotate"]),r.interactive&&r.touchZoomRotate&&s.touchZoomRotate.enable(r.touchZoomRotate);const Ke=s.scrollZoom=new Cr(s,(()=>this._triggerRenderFrame()));this._add("scrollZoom",Ke,["mousePan"]),r.interactive&&r.scrollZoom&&s.scrollZoom.enable(r.scrollZoom);const lt=s.keyboard=new tr(s);this._add("keyboard",lt),r.interactive&&r.keyboard&&s.keyboard.enable(),this._add("blockableMapEvent",new sf(s))}_add(r,s,p){this._handlers.push({handlerName:r,handler:s,allowed:p}),this._handlersById[r]=s}stop(r){if(!this._updatingCamera){for(const{handler:s}of this._handlers)s.reset();this._inertia.clear(),this._fireEvents({},{},r),this._changes=[]}}isActive(){for(const{handler:r}of this._handlers)if(r.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!kn(this._eventsInProgress)||this.isZooming()}_blockedByActive(r,s,p){for(const m in r)if(m!==p&&(!s||s.indexOf(m)<0))return!0;return!1}_getMapTouches(r){const s=[];for(const p of r)this._el.contains(p.target)&&s.push(p);return s}mergeHandlerResult(r,s,p,m,b){if(!p)return;o.e(r,p);const T={handlerName:m,originalEvent:p.originalEvent||b};p.zoomDelta!==void 0&&(s.zoom=T),p.panDelta!==void 0&&(s.drag=T),p.rollDelta!==void 0&&(s.roll=T),p.pitchDelta!==void 0&&(s.pitch=T),p.bearingDelta!==void 0&&(s.rotate=T)}_applyChanges(){const r={},s={},p={};for(const[m,b,T]of this._changes)m.panDelta&&(r.panDelta=(r.panDelta||new o.P(0,0))._add(m.panDelta)),m.zoomDelta&&(r.zoomDelta=(r.zoomDelta||0)+m.zoomDelta),m.bearingDelta&&(r.bearingDelta=(r.bearingDelta||0)+m.bearingDelta),m.pitchDelta&&(r.pitchDelta=(r.pitchDelta||0)+m.pitchDelta),m.rollDelta&&(r.rollDelta=(r.rollDelta||0)+m.rollDelta),m.around!==void 0&&(r.around=m.around),m.pinchAround!==void 0&&(r.pinchAround=m.pinchAround),m.noInertia&&(r.noInertia=m.noInertia),o.e(s,b),o.e(p,T);this._updateMapTransform(r,s,p),this._changes=[]}_updateMapTransform(r,s,p){const m=this._map,b=m._getTransformForUpdate(),T=m.terrain;if(!($r(r)||T&&this._terrainMovement))return this._fireEvents(s,p,!0);m._stop(!0);let{panDelta:I,zoomDelta:R,bearingDelta:j,pitchDelta:G,rollDelta:X,around:Y,pinchAround:ie}=r;ie!==void 0&&(Y=ie),Y=Y||m.transform.centerPoint,T&&!b.isPointOnMapSurface(Y)&&(Y=b.centerPoint);const be={panDelta:I,zoomDelta:R,rollDelta:X,pitchDelta:G,bearingDelta:j,around:Y};this._map.cameraHelper.useGlobeControls&&!b.isPointOnMapSurface(Y)&&(Y=b.centerPoint);const Ue=Y.distSqr(b.centerPoint)<.01?b.center:b.screenPointToLocation(I?Y.sub(I):Y);T?(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(be,b),this._terrainMovement||!s.drag&&!s.zoom?s.drag&&this._terrainMovement?b.setCenter(b.screenPointToLocation(b.centerPoint.sub(I))):this._map.cameraHelper.handleMapControlsPan(be,b,Ue):(this._terrainMovement=!0,this._map._elevationFreeze=!0,this._map.cameraHelper.handleMapControlsPan(be,b,Ue))):(this._map.cameraHelper.handleMapControlsRollPitchBearingZoom(be,b),this._map.cameraHelper.handleMapControlsPan(be,b,Ue)),m._applyUpdatedTransform(b),this._map._update(),r.noInertia||this._inertia.record(r),this._fireEvents(s,p,!0)}_fireEvents(r,s,p){const m=kn(this._eventsInProgress),b=kn(r),T={};for(const X in r){const{originalEvent:Y}=r[X];this._eventsInProgress[X]||(T[`${X}start`]=Y),this._eventsInProgress[X]=r[X]}!m&&b&&this._fireEvent("movestart",b.originalEvent);for(const X in T)this._fireEvent(X,T[X]);b&&this._fireEvent("move",b.originalEvent);for(const X in r){const{originalEvent:Y}=r[X];this._fireEvent(X,Y)}const I={};let R;for(const X in this._eventsInProgress){const{handlerName:Y,originalEvent:ie}=this._eventsInProgress[X];this._handlersById[Y].isActive()||(delete this._eventsInProgress[X],R=s[Y]||ie,I[`${X}end`]=R)}for(const X in I)this._fireEvent(X,I[X]);const j=kn(this._eventsInProgress),G=(m||b)&&!j;if(G&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const X=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&X.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(X)}if(p&&G){this._updatingCamera=!0;const X=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),Y=ie=>ie!==0&&-this._bearingSnap<ie&&ie<this._bearingSnap;!X||!X.essential&&M.prefersReducedMotion?(this._map.fire(new o.l("moveend",{originalEvent:R})),Y(this._map.getBearing())&&this._map.resetNorth()):(Y(X.bearing||this._map.getBearing())&&(X.bearing=0),X.freezeElevation=!0,this._map.easeTo(X,{originalEvent:R})),this._updatingCamera=!1}}_fireEvent(r,s){this._map.fire(new o.l(r,s?{originalEvent:s}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((r=>{delete this._frameId,this.handleEvent(new fn("renderFrame",{timeStamp:r})),this._applyChanges()}))}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class en extends o.E{constructor(r,s,p){super(),this._renderFrameCallback=()=>{const m=Math.min((M.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(m)),m<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=r,this._bearingSnap=p.bearingSnap,this.cameraHelper=s,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(r,s){r.apply(this.transform),this.transform=r,this.cameraHelper=s}getCenter(){return new o.S(this.transform.center.lng,this.transform.center.lat)}setCenter(r,s){return this.jumpTo({center:r},s)}getCenterElevation(){return this.transform.elevation}setCenterElevation(r,s){return this.jumpTo({elevation:r},s),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(r){this._centerClampedToGround=r}panBy(r,s,p){return r=o.P.convert(r).mult(-1),this.panTo(this.transform.center,o.e({offset:r},s),p)}panTo(r,s,p){return this.easeTo(o.e({center:r},s),p)}getZoom(){return this.transform.zoom}setZoom(r,s){return this.jumpTo({zoom:r},s),this}zoomTo(r,s,p){return this.easeTo(o.e({zoom:r},s),p)}zoomIn(r,s){return this.zoomTo(this.getZoom()+1,r,s),this}zoomOut(r,s){return this.zoomTo(this.getZoom()-1,r,s),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(r,s){return r!=this.transform.fov&&(this.transform.setFov(r),this.fire(new o.l("movestart",s)).fire(new o.l("move",s)).fire(new o.l("moveend",s))),this}getBearing(){return this.transform.bearing}setBearing(r,s){return this.jumpTo({bearing:r},s),this}getPadding(){return this.transform.padding}setPadding(r,s){return this.jumpTo({padding:r},s),this}rotateTo(r,s,p){return this.easeTo(o.e({bearing:r},s),p)}resetNorth(r,s){return this.rotateTo(0,o.e({duration:1e3},r),s),this}resetNorthPitch(r,s){return this.easeTo(o.e({bearing:0,pitch:0,roll:0,duration:1e3},r),s),this}snapToNorth(r,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(r,s):this}getPitch(){return this.transform.pitch}setPitch(r,s){return this.jumpTo({pitch:r},s),this}getRoll(){return this.transform.roll}setRoll(r,s){return this.jumpTo({roll:r},s),this}cameraForBounds(r,s){r=Kt.convert(r).adjustAntiMeridian();const p=s&&s.bearing||0;return this._cameraForBoxAndBearing(r.getNorthWest(),r.getSouthEast(),p,s)}_cameraForBoxAndBearing(r,s,p,m){const b={top:0,bottom:0,right:0,left:0};if(typeof(m=o.e({padding:b,offset:[0,0],maxZoom:this.transform.maxZoom},m)).padding=="number"){const j=m.padding;m.padding={top:j,bottom:j,right:j,left:j}}const T=o.e(b,m.padding);m.padding=T;const I=this.transform,R=new Kt(r,s);return this.cameraHelper.cameraForBoxAndBearing(m,T,R,p,I)}fitBounds(r,s,p){return this._fitInternal(this.cameraForBounds(r,s),s,p)}fitScreenCoordinates(r,s,p,m,b){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(o.P.convert(r)),this.transform.screenPointToLocation(o.P.convert(s)),p,m),m,b)}_fitInternal(r,s,p){return r?(delete(s=o.e(r,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this}jumpTo(r,s){this.stop();const p=this._getTransformForUpdate();let m=!1,b=!1,T=!1;const I=p.zoom;this.cameraHelper.handleJumpToCenterZoom(p,r);const R=p.zoom!==I;return"elevation"in r&&p.elevation!==+r.elevation&&p.setElevation(+r.elevation),"bearing"in r&&p.bearing!==+r.bearing&&(m=!0,p.setBearing(+r.bearing)),"pitch"in r&&p.pitch!==+r.pitch&&(b=!0,p.setPitch(+r.pitch)),"roll"in r&&p.roll!==+r.roll&&(T=!0,p.setRoll(+r.roll)),r.padding==null||p.isPaddingEqual(r.padding)||p.setPadding(r.padding),this._applyUpdatedTransform(p),this.fire(new o.l("movestart",s)).fire(new o.l("move",s)),R&&this.fire(new o.l("zoomstart",s)).fire(new o.l("zoom",s)).fire(new o.l("zoomend",s)),m&&this.fire(new o.l("rotatestart",s)).fire(new o.l("rotate",s)).fire(new o.l("rotateend",s)),b&&this.fire(new o.l("pitchstart",s)).fire(new o.l("pitch",s)).fire(new o.l("pitchend",s)),T&&this.fire(new o.l("rollstart",s)).fire(new o.l("roll",s)).fire(new o.l("rollend",s)),this.fire(new o.l("moveend",s))}calculateCameraOptionsFromTo(r,s,p,m=0){const b=o.a0.fromLngLat(r,s),T=o.a0.fromLngLat(p,m),I=T.x-b.x,R=T.y-b.y,j=T.z-b.z,G=Math.hypot(I,R,j);if(G===0)throw new Error("Can't calculate camera options with same From and To");const X=Math.hypot(I,R),Y=o.aj(this.transform.cameraToCenterDistance/G/this.transform.tileSize),ie=180*Math.atan2(I,-R)/Math.PI;let be=180*Math.acos(X/G)/Math.PI;return be=j<0?90-be:90+be,{center:T.toLngLat(),elevation:m,zoom:Y,pitch:be,bearing:ie}}calculateCameraOptionsFromCameraLngLatAltRotation(r,s,p,m,b){const T=this.transform.calculateCenterFromCameraLngLatAlt(r,s,p,m);return{center:T.center,elevation:T.elevation,zoom:T.zoom,bearing:p,pitch:m,roll:b}}easeTo(r,s){this._stop(!1,r.easeId),((r=o.e({offset:[0,0],duration:500,easing:o.cn},r)).animate===!1||!r.essential&&M.prefersReducedMotion)&&(r.duration=0);const p=this._getTransformForUpdate(),m=this.getBearing(),b=p.pitch,T=p.roll,I="bearing"in r?this._normalizeBearing(r.bearing,m):m,R="pitch"in r?+r.pitch:b,j="roll"in r?this._normalizeBearing(r.roll,T):T,G="padding"in r?r.padding:p.padding,X=o.P.convert(r.offset);let Y,ie;r.around&&(Y=o.S.convert(r.around),ie=p.locationToScreenPoint(Y));const be={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},Ue=this.cameraHelper.handleEaseTo(p,{bearing:I,pitch:R,roll:j,padding:G,around:Y,aroundPoint:ie,offsetAsPoint:X,offset:r.offset,zoom:r.zoom,center:r.center});return this._rotating=this._rotating||m!==I,this._pitching=this._pitching||R!==b,this._rolling=this._rolling||j!==T,this._padding=!p.isPaddingEqual(G),this._zooming=this._zooming||Ue.isZooming,this._easeId=r.easeId,this._prepareEase(s,r.noMoveStart,be),this.terrain&&this._prepareElevation(Ue.elevationCenter),this._ease((je=>{Ue.easeFunc(je),this.terrain&&!r.freezeElevation&&this._updateElevation(je),this._applyUpdatedTransform(p),this._fireMoveEvents(s)}),(je=>{this.terrain&&r.freezeElevation&&this._finalizeElevation(),this._afterEase(s,je)}),r),this}_prepareEase(r,s,p={}){this._moving=!0,s||p.moving||this.fire(new o.l("movestart",r)),this._zooming&&!p.zooming&&this.fire(new o.l("zoomstart",r)),this._rotating&&!p.rotating&&this.fire(new o.l("rotatestart",r)),this._pitching&&!p.pitching&&this.fire(new o.l("pitchstart",r)),this._rolling&&!p.rolling&&this.fire(new o.l("rollstart",r))}_prepareElevation(r){this._elevationCenter=r,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(r){this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));const s=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(r<1&&s!==this._elevationTarget){const p=this._elevationTarget-this._elevationStart;this._elevationStart+=r*(p-(s-(p*r+this._elevationStart))/(1-r)),this._elevationTarget=s}this.transform.setElevation(o.C.number(this._elevationStart,this._elevationTarget,r))}_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(r){if(!this.terrain&&r.elevation>=0&&r.pitch<=90)return{};const s=r.getCameraLngLat(),p=r.getCameraAltitude(),m=this.terrain?this.terrain.getElevationForLngLatZoom(s,r.zoom):0;if(p<m){const b=this.calculateCameraOptionsFromTo(s,m,r.center,r.elevation);return{pitch:b.pitch,zoom:b.zoom}}return{}}_applyUpdatedTransform(r){const s=[];if(s.push((m=>this._elevateCameraIfInsideTerrain(m))),this.transformCameraUpdate&&s.push((m=>this.transformCameraUpdate(m))),!s.length)return;const p=r.clone();for(const m of s){const b=p.clone(),{center:T,zoom:I,roll:R,pitch:j,bearing:G,elevation:X}=m(b);T&&b.setCenter(T),X!==void 0&&b.setElevation(X),I!==void 0&&b.setZoom(I),R!==void 0&&b.setRoll(R),j!==void 0&&b.setPitch(j),G!==void 0&&b.setBearing(G),p.apply(b)}this.transform.apply(p)}_fireMoveEvents(r){this.fire(new o.l("move",r)),this._zooming&&this.fire(new o.l("zoom",r)),this._rotating&&this.fire(new o.l("rotate",r)),this._pitching&&this.fire(new o.l("pitch",r)),this._rolling&&this.fire(new o.l("roll",r))}_afterEase(r,s){if(this._easeId&&s&&this._easeId===s)return;delete this._easeId;const p=this._zooming,m=this._rotating,b=this._pitching,T=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,p&&this.fire(new o.l("zoomend",r)),m&&this.fire(new o.l("rotateend",r)),b&&this.fire(new o.l("pitchend",r)),T&&this.fire(new o.l("rollend",r)),this.fire(new o.l("moveend",r))}flyTo(r,s){if(!r.essential&&M.prefersReducedMotion){const Vt=o.Q(r,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(Vt,s)}this.stop(),r=o.e({offset:[0,0],speed:1.2,curve:1.42,easing:o.cn},r);const p=this._getTransformForUpdate(),m=p.bearing,b=p.pitch,T=p.roll,I=p.padding,R="bearing"in r?this._normalizeBearing(r.bearing,m):m,j="pitch"in r?+r.pitch:b,G="roll"in r?this._normalizeBearing(r.roll,T):T,X="padding"in r?r.padding:p.padding,Y=o.P.convert(r.offset);let ie=p.centerPoint.add(Y);const be=p.screenPointToLocation(ie),Ue=this.cameraHelper.handleFlyTo(p,{bearing:R,pitch:j,roll:G,padding:X,locationAtOffset:be,offsetAsPoint:Y,center:r.center,minZoom:r.minZoom,zoom:r.zoom});let je=r.curve;const qe=Math.max(p.width,p.height),Ke=qe/Ue.scaleOfZoom,lt=Ue.pixelPathLength;typeof Ue.scaleOfMinZoom=="number"&&(je=Math.sqrt(qe/Ue.scaleOfMinZoom/lt*2));const nt=je*je;function dt(Vt){const Dr=(Ke*Ke-qe*qe+(Vt?-1:1)*nt*nt*lt*lt)/(2*(Vt?Ke:qe)*nt*lt);return Math.log(Math.sqrt(Dr*Dr+1)-Dr)}function bt(Vt){return(Math.exp(Vt)-Math.exp(-Vt))/2}function rt(Vt){return(Math.exp(Vt)+Math.exp(-Vt))/2}const At=dt(!1);let qt=function(Vt){return rt(At)/rt(At+je*Vt)},Bt=function(Vt){return qe*((rt(At)*(bt(Dr=At+je*Vt)/rt(Dr))-bt(At))/nt)/lt;var Dr},zt=(dt(!0)-At)/je;if(Math.abs(lt)<2e-6||!isFinite(zt)){if(Math.abs(qe-Ke)<1e-6)return this.easeTo(r,s);const Vt=Ke<qe?-1:1;zt=Math.abs(Math.log(Ke/qe))/je,Bt=()=>0,qt=Dr=>Math.exp(Vt*je*Dr)}return r.duration="duration"in r?+r.duration:1e3*zt/("screenSpeed"in r?+r.screenSpeed/je:+r.speed),r.maxDuration&&r.duration>r.maxDuration&&(r.duration=0),this._zooming=!0,this._rotating=m!==R,this._pitching=j!==b,this._rolling=G!==T,this._padding=!p.isPaddingEqual(X),this._prepareEase(s,!1),this.terrain&&this._prepareElevation(Ue.targetCenter),this._ease((Vt=>{const Dr=Vt*zt,Ar=1/qt(Dr),sr=Bt(Dr);this._rotating&&p.setBearing(o.C.number(m,R,Vt)),this._pitching&&p.setPitch(o.C.number(b,j,Vt)),this._rolling&&p.setRoll(o.C.number(T,G,Vt)),this._padding&&(p.interpolatePadding(I,X,Vt),ie=p.centerPoint.add(Y)),Ue.easeFunc(Vt,Ar,sr,ie),this.terrain&&!r.freezeElevation&&this._updateElevation(Vt),this._applyUpdatedTransform(p),this._fireMoveEvents(s)}),(()=>{this.terrain&&r.freezeElevation&&this._finalizeElevation(),this._afterEase(s)}),r),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(r,s){var p;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const m=this._onEaseEnd;delete this._onEaseEnd,m.call(this,s)}return r||(p=this.handlers)===null||p===void 0||p.stop(!1),this}_ease(r,s,p){p.animate===!1||p.duration===0?(r(1),s()):(this._easeStart=M.now(),this._easeOptions=p,this._onEaseFrame=r,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(r,s){r=o.aN(r,-180,180);const p=Math.abs(r-s);return Math.abs(r-360-s)<p&&(r-=360),Math.abs(r+360-s)<p&&(r+=360),r}queryTerrainElevation(r){return this.terrain?this.terrain.getElevationForLngLatZoom(o.S.convert(r),this.transform.tileZoom):null}}const Gn={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Li{constructor(r=Gn){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=s=>{!s||s.sourceDataType!=="metadata"&&s.sourceDataType!=="visibility"&&s.dataType!=="style"&&s.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=r}getDefaultPosition(){return"bottom-right"}onAdd(r){return this._map=r,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(r,s){const p=this._map._getUIString(`AttributionControl.${s}`);r.title=p,r.setAttribute("aria-label",p)}_updateAttributions(){if(!this._map.style)return;let r=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?r=r.concat(this.options.customAttribution.map((m=>typeof m!="string"?"":m))):typeof this.options.customAttribution=="string"&&r.push(this.options.customAttribution)),this._map.style.stylesheet){const m=this._map.style.stylesheet;this.styleOwner=m.owner,this.styleId=m.id}const s=this._map.style.sourceCaches;for(const m in s){const b=s[m];if(b.used||b.usedForTerrain){const T=b.getSource();T.attribution&&r.indexOf(T.attribution)<0&&r.push(T.attribution)}}r=r.filter((m=>String(m).trim())),r.sort(((m,b)=>m.length-b.length)),r=r.filter(((m,b)=>{for(let T=b+1;T<r.length;T++)if(r[T].indexOf(m)>=0)return!1;return!0}));const p=r.join(" | ");p!==this._attribHTML&&(this._attribHTML=p,r.length?(this._innerContainer.innerHTML=E.sanitize(p),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Vo{constructor(r={}){this._updateCompact=()=>{const s=this._container.children;if(s.length){const p=s[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&p.classList.add("maplibregl-compact"):p.classList.remove("maplibregl-compact")}},this.options=r}getDefaultPosition(){return"bottom-left"}onAdd(r){this._map=r,this._compact=this.options&&this.options.compact,this._container=E.create("div","maplibregl-ctrl");const s=E.create("a","maplibregl-ctrl-logo");return s.target="_blank",s.rel="noopener nofollow",s.href="https://maplibre.org/",s.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),s.setAttribute("rel","noopener nofollow"),this._container.appendChild(s),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 va{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(r){const s=++this._id;return this._queue.push({callback:r,id:s,cancelled:!1}),s}remove(r){const s=this._currentlyRunning,p=s?this._queue.concat(s):this._queue;for(const m of p)if(m.id===r)return void(m.cancelled=!0)}run(r=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const s=this._currentlyRunning=this._queue;this._queue=[];for(const p of s)if(!p.cancelled&&(p.callback(r),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var uo=o.aI([{name:"a_pos3d",type:"Int16",components:3}]);class ba extends o.E{constructor(r){super(),this._lastTilesetChange=M.now(),this.sourceCache=r,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=r._source.tileSize*2**this.deltaZoom,r.usedForTerrain=!0,r.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(r,s){this.sourceCache.update(r,s),this._renderableTilesKeys=[];const p={};for(const m of It(r,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:s,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))p[m.key]=!0,this._renderableTilesKeys.push(m.key),this._tiles[m.key]||(m.terrainRttPosMatrix32f=new Float64Array(16),o.bX(m.terrainRttPosMatrix32f,0,o.$,o.$,0,0,1),this._tiles[m.key]=new Ur(m,this.tileSize),this._lastTilesetChange=M.now());for(const m in this._tiles)p[m]||delete this._tiles[m]}freeRtt(r){for(const s in this._tiles){const p=this._tiles[s];(!r||p.tileID.equals(r)||p.tileID.isChildOf(r)||r.isChildOf(p.tileID))&&(p.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((r=>this.getTileByID(r)))}getTileByID(r){return this._tiles[r]}getTerrainCoords(r,s){return s?this._getTerrainCoordsForTileRanges(r,s):this._getTerrainCoordsForRegularTile(r)}_getTerrainCoordsForRegularTile(r){const s={};for(const p of this._renderableTilesKeys){const m=this._tiles[p].tileID,b=r.clone(),T=o.b9();if(m.canonical.equals(r.canonical))o.bX(T,0,o.$,o.$,0,0,1);else if(m.canonical.isChildOf(r.canonical)){const I=m.canonical.z-r.canonical.z,R=m.canonical.x-(m.canonical.x>>I<<I),j=m.canonical.y-(m.canonical.y>>I<<I),G=o.$>>I;o.bX(T,0,G,G,0,0,1),o.M(T,T,[-R*G,-j*G,0])}else{if(!r.canonical.isChildOf(m.canonical))continue;{const I=r.canonical.z-m.canonical.z,R=r.canonical.x-(r.canonical.x>>I<<I),j=r.canonical.y-(r.canonical.y>>I<<I),G=o.$>>I;o.bX(T,0,o.$,o.$,0,0,1),o.M(T,T,[R*G,j*G,0]),o.N(T,T,[1/2**I,1/2**I,0])}}b.terrainRttPosMatrix32f=new Float32Array(T),s[p]=b}return s}_getTerrainCoordsForTileRanges(r,s){const p={};for(const m of this._renderableTilesKeys){const b=this._tiles[m].tileID;if(!this._isWithinTileRanges(b,s))continue;const T=r.clone(),I=o.b9();if(b.canonical.z===r.canonical.z){const R=r.canonical.x-b.canonical.x,j=r.canonical.y-b.canonical.y;o.bX(I,0,o.$,o.$,0,0,1),o.M(I,I,[R*o.$,j*o.$,0])}else if(b.canonical.z>r.canonical.z){const R=b.canonical.z-r.canonical.z,j=b.canonical.x-(b.canonical.x>>R<<R),G=b.canonical.y-(b.canonical.y>>R<<R),X=r.canonical.x-(b.canonical.x>>R),Y=r.canonical.y-(b.canonical.y>>R),ie=o.$>>R;o.bX(I,0,ie,ie,0,0,1),o.M(I,I,[-j*ie+X*o.$,-G*ie+Y*o.$,0])}else{const R=r.canonical.z-b.canonical.z,j=r.canonical.x-(r.canonical.x>>R<<R),G=r.canonical.y-(r.canonical.y>>R<<R),X=(r.canonical.x>>R)-b.canonical.x,Y=(r.canonical.y>>R)-b.canonical.y,ie=o.$<<R;o.bX(I,0,ie,ie,0,0,1),o.M(I,I,[j*o.$+X*ie,G*o.$+Y*ie,0])}T.terrainRttPosMatrix32f=new Float32Array(I),p[m]=T}return p}getSourceTile(r,s){const p=this.sourceCache._source;let m=r.overscaledZ-this.deltaZoom;if(m>p.maxzoom&&(m=p.maxzoom),m<p.minzoom)return null;this._sourceTileCache[r.key]||(this._sourceTileCache[r.key]=r.scaledTo(m).key);let b=this.sourceCache.getTileByID(this._sourceTileCache[r.key]);if((!b||!b.dem)&&s)for(;m>=p.minzoom&&(!b||!b.dem);)b=this.sourceCache.getTileByID(r.scaledTo(m--).key);return b}anyTilesAfterTime(r=Date.now()){return this._lastTilesetChange>=r}_isWithinTileRanges(r,s){return s[r.canonical.z]&&r.canonical.x>=s[r.canonical.z].minTileX&&r.canonical.x<=s[r.canonical.z].maxTileX&&r.canonical.y>=s[r.canonical.z].minTileY&&r.canonical.y<=s[r.canonical.z].maxTileY}}class Ki{constructor(r,s,p){this._meshCache={},this.painter=r,this.sourceCache=new ba(s),this.options=p,this.exaggeration=typeof p.exaggeration=="number"?p.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(r,s,p,m=o.$){var b;if(!(s>=0&&s<m&&p>=0&&p<m))return 0;const T=this.getTerrainData(r),I=(b=T.tile)===null||b===void 0?void 0:b.dem;if(!I)return 0;const R=o.cr([],[s/m*o.$,p/m*o.$],T.u_terrain_matrix),j=[R[0]*I.dim,R[1]*I.dim],G=Math.floor(j[0]),X=Math.floor(j[1]),Y=j[0]-G,ie=j[1]-X;return I.get(G,X)*(1-Y)*(1-ie)+I.get(G+1,X)*Y*(1-ie)+I.get(G,X+1)*(1-Y)*ie+I.get(G+1,X+1)*Y*ie}getElevationForLngLatZoom(r,s){if(!o.cs(s,r.wrap()))return 0;const{tileID:p,mercatorX:m,mercatorY:b}=this._getOverscaledTileIDFromLngLatZoom(r,s);return this.getElevation(p,m%o.$,b%o.$,o.$)}getElevation(r,s,p,m=o.$){return this.getDEMElevation(r,s,p,m)*this.exaggeration}getTerrainData(r){if(!this._emptyDemTexture){const m=this.painter.context,b=new o.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new o.T(m,b,m.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new o.T(m,new o.R({width:1,height:1}),m.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(m.gl.NEAREST,m.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=o.af([])}const s=this.sourceCache.getSourceTile(r,!0);if(s&&s.dem&&(!s.demTexture||s.needsTerrainPrepare)){const m=this.painter.context;s.demTexture=this.painter.getTileTexture(s.dem.stride),s.demTexture?s.demTexture.update(s.dem.getPixels(),{premultiply:!1}):s.demTexture=new o.T(m,s.dem.getPixels(),m.gl.RGBA,{premultiply:!1}),s.demTexture.bind(m.gl.NEAREST,m.gl.CLAMP_TO_EDGE),s.needsTerrainPrepare=!1}const p=s&&s+s.tileID.key+r.key;if(p&&!this._demMatrixCache[p]){const m=this.sourceCache.sourceCache._source.maxzoom;let b=r.canonical.z-s.tileID.canonical.z;r.overscaledZ>r.canonical.z&&(r.canonical.z>=m?b=r.canonical.z-m:o.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const T=r.canonical.x-(r.canonical.x>>b<<b),I=r.canonical.y-(r.canonical.y>>b<<b),R=o.ct(new Float64Array(16),[1/(o.$<<b),1/(o.$<<b),0]);o.M(R,R,[T*o.$,I*o.$,0]),this._demMatrixCache[r.key]={matrix:R,coord:r}}return{u_depth:2,u_terrain:3,u_terrain_dim:s&&s.dem&&s.dem.dim||1,u_terrain_matrix:p?this._demMatrixCache[r.key].matrix:this._emptyDemMatrix,u_terrain_unpack:s&&s.dem&&s.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(s&&s.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:s}}getFramebuffer(r){const s=this.painter,p=s.width/devicePixelRatio,m=s.height/devicePixelRatio;return!this._fbo||this._fbo.width===p&&this._fbo.height===m||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new o.T(s.context,{width:p,height:m,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new o.T(s.context,{width:p,height:m,data:null},s.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(s.context.gl.NEAREST,s.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=s.context.createFramebuffer(p,m,!0,!1),this._fbo.depthAttachment.set(s.context.createRenderbuffer(s.context.gl.DEPTH_COMPONENT16,p,m))),this._fbo.colorAttachment.set(r==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const r=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const s=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let b=0,T=0;b<this._coordsTextureSize;b++)for(let I=0;I<this._coordsTextureSize;I++,T+=4)s[T+0]=255&I,s[T+1]=255&b,s[T+2]=I>>8<<4|b>>8,s[T+3]=0;const p=new o.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(s.buffer)),m=new o.T(r,p,r.gl.RGBA,{premultiply:!1});return m.bind(r.gl.NEAREST,r.gl.CLAMP_TO_EDGE),this._coordsTexture=m,m}pointCoordinate(r){this.painter.maybeDrawDepthAndCoords(!0);const s=new Uint8Array(4),p=this.painter.context,m=p.gl,b=Math.round(r.x*this.painter.pixelRatio/devicePixelRatio),T=Math.round(r.y*this.painter.pixelRatio/devicePixelRatio),I=Math.round(this.painter.height/devicePixelRatio);p.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),m.readPixels(b,I-T-1,1,1,m.RGBA,m.UNSIGNED_BYTE,s),p.bindFramebuffer.set(null);const R=s[0]+(s[2]>>4<<8),j=s[1]+((15&s[2])<<8),G=this.coordsIndex[255-s[3]],X=G&&this.sourceCache.getTileByID(G);if(!X)return null;const Y=this._coordsTextureSize,ie=(1<<X.tileID.canonical.z)*Y;return new o.a0((X.tileID.canonical.x*Y+R)/ie+X.tileID.wrap,(X.tileID.canonical.y*Y+j)/ie,this.getElevation(X.tileID,R,j,Y))}depthAtPoint(r){const s=new Uint8Array(4),p=this.painter.context,m=p.gl;return p.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),m.readPixels(r.x,this.painter.height/devicePixelRatio-r.y-1,1,1,m.RGBA,m.UNSIGNED_BYTE,s),p.bindFramebuffer.set(null),(s[0]/16777216+s[1]/65536+s[2]/256+s[3])/256}getTerrainMesh(r){var s;const p=((s=this.painter.style.projection)===null||s===void 0?void 0:s.transitionState)>0,m=p&&r.canonical.y===0,b=p&&r.canonical.y===(1<<r.canonical.z)-1,T=`m_${m?"n":""}_${b?"s":""}`;if(this._meshCache[T])return this._meshCache[T];const I=this.painter.context,R=new o.cu,j=new o.aM,G=this.meshSize,X=o.$/G,Y=G*G;for(let rt=0;rt<=G;rt++)for(let At=0;At<=G;At++)R.emplaceBack(At*X,rt*X,0);for(let rt=0;rt<Y;rt+=G+1)for(let At=0;At<G;At++)j.emplaceBack(At+rt,G+At+rt+1,G+At+rt+2),j.emplaceBack(At+rt,G+At+rt+2,At+rt+1);const ie=R.length,be=ie+(G+1),Ue=(G+1)*G,je=m?o.bg:0,qe=m?0:1,Ke=b?o.bh:o.$,lt=b?0:1;for(let rt=0;rt<=G;rt++)R.emplaceBack(rt*X,je,qe);for(let rt=0;rt<=G;rt++)R.emplaceBack(rt*X,Ke,lt);for(let rt=0;rt<G;rt++)j.emplaceBack(Ue+rt,be+rt,be+rt+1),j.emplaceBack(Ue+rt,be+rt+1,Ue+rt+1),j.emplaceBack(0+rt,ie+rt+1,ie+rt),j.emplaceBack(0+rt,0+rt+1,ie+rt+1);const nt=R.length,dt=nt+2*(G+1);for(const rt of[0,1])for(let At=0;At<=G;At++)for(const qt of[0,1])R.emplaceBack(rt*o.$,At*X,qt);for(let rt=0;rt<2*G;rt+=2)j.emplaceBack(nt+rt,nt+rt+1,nt+rt+3),j.emplaceBack(nt+rt,nt+rt+3,nt+rt+2),j.emplaceBack(dt+rt,dt+rt+3,dt+rt+1),j.emplaceBack(dt+rt,dt+rt+2,dt+rt+3);const bt=new Pt(I.createVertexBuffer(R,uo.members),I.createIndexBuffer(j),o.aL.simpleSegment(0,0,R.length,j.length));return this._meshCache[T]=bt,bt}getMeshFrameDelta(r){return 2*Math.PI*o.bt/Math.pow(2,Math.max(r,0))/5}getMinTileElevationForLngLatZoom(r,s){var p;const{tileID:m}=this._getOverscaledTileIDFromLngLatZoom(r,s);return(p=this.getMinMaxElevation(m).minElevation)!==null&&p!==void 0?p:0}getMinMaxElevation(r){const s=this.getTerrainData(r).tile,p={minElevation:null,maxElevation:null};return s&&s.dem&&(p.minElevation=s.dem.min*this.exaggeration,p.maxElevation=s.dem.max*this.exaggeration),p}_getOverscaledTileIDFromLngLatZoom(r,s){const p=o.a0.fromLngLat(r.wrap()),m=(1<<s)*o.$,b=p.x*m,T=p.y*m,I=Math.floor(b/o.$),R=Math.floor(T/o.$);return{tileID:new o.Z(s,0,s,I,R),mercatorX:b,mercatorY:T}}}class yo{constructor(r,s,p){this._context=r,this._size=s,this._tileSize=p,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const r of this._objects)r.texture.destroy(),r.fbo.destroy()}_createObject(r){const s=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),p=new o.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return p.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),s.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),s.colorAttachment.set(p.texture),{id:r,fbo:s,texture:p,stamp:-1,inUse:!1}}getObjectForId(r){return this._objects[r]}useObject(r){r.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((s=>r.id!==s)),this._recentlyUsed.push(r.id)}stampObject(r){r.stamp=++this._stamp}getOrCreateFreeObject(){for(const s of this._recentlyUsed)if(!this._objects[s].inUse)return this._objects[s];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const r=this._createObject(this._objects.length);return this._objects.push(r),r}freeObject(r){r.inUse=!1}freeAllObjects(){for(const r of this._objects)this.freeObject(r)}isFull(){return!(this._objects.length<this._size)&&this._objects.some((r=>!r.inUse))===!1}}const br={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class zr{constructor(r,s){this.painter=r,this.terrain=s,this.pool=new yo(r.context,30,s.sourceCache.tileSize*s.qualityFactor)}destruct(){this.pool.destruct()}getTexture(r){return this.pool.getObjectForId(r.rtt[this._stacks.length-1].id).texture}prepareForRender(r,s){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=r._order.filter((p=>!r._layers[p].isHidden(s))),this._coordsAscending={};for(const p in r.sourceCaches){this._coordsAscending[p]={};const m=r.sourceCaches[p].getVisibleCoordinates(),b=r.sourceCaches[p].getSource(),T=b instanceof Jt?b.terrainTileRanges:null;for(const I of m){const R=this.terrain.sourceCache.getTerrainCoords(I,T);for(const j in R)this._coordsAscending[p][j]||(this._coordsAscending[p][j]=[]),this._coordsAscending[p][j].push(R[j])}}this._coordsAscendingStr={};for(const p of r._order){const m=r._layers[p],b=m.source;if(br[m.type]&&!this._coordsAscendingStr[b]){this._coordsAscendingStr[b]={};for(const T in this._coordsAscending[b])this._coordsAscendingStr[b][T]=this._coordsAscending[b][T].map((I=>I.key)).sort().join()}}for(const p of this._renderableTiles)for(const m in this._coordsAscendingStr){const b=this._coordsAscendingStr[m][p.tileID.key];b&&b!==p.rttCoords[m]&&(p.rtt=[])}}renderLayer(r,s){if(r.isHidden(this.painter.transform.zoom))return!1;const p=Object.assign(Object.assign({},s),{isRenderingToTexture:!0}),m=r.type,b=this.painter,T=this._renderableLayerIds[this._renderableLayerIds.length-1]===r.id;if(br[m]&&(this._prevType&&br[this._prevType]||this._stacks.push([]),this._prevType=m,this._stacks[this._stacks.length-1].push(r.id),!T))return!0;if(br[this._prevType]||br[m]&&T){this._prevType=m;const I=this._stacks.length-1,R=this._stacks[I]||[];for(const j of this._renderableTiles){if(this.pool.isFull()&&(lo(this.painter,this.terrain,this._rttTiles,p),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(j),j.rtt[I]){const X=this.pool.getObjectForId(j.rtt[I].id);if(X.stamp===j.rtt[I].stamp){this.pool.useObject(X);continue}}const G=this.pool.getOrCreateFreeObject();this.pool.useObject(G),this.pool.stampObject(G),j.rtt[I]={id:G.id,stamp:G.stamp},b.context.bindFramebuffer.set(G.fbo.framebuffer),b.context.clear({color:o.be.transparent,stencil:0}),b.currentStencilSource=void 0;for(let X=0;X<R.length;X++){const Y=b.style._layers[R[X]],ie=Y.source?this._coordsAscending[Y.source][j.tileID.key]:[j.tileID];b.context.viewport.set([0,0,G.fbo.width,G.fbo.height]),b._renderTileClippingMasks(Y,ie,!0),b.renderLayer(b,b.style.sourceCaches[Y.source],Y,ie,p),Y.source&&(j.rttCoords[Y.source]=this._coordsAscendingStr[Y.source][j.tileID.key])}}return lo(this.painter,this.terrain,this._rttTiles,p),this._rttTiles=[],this.pool.freeAllObjects(),br[m]}return!1}}const Gi={"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"},_i=y,Eo={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Gn,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:o.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},Hi={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class _o{constructor(r,s,p=!1){this.mousedown=b=>{this.startMove(b,E.mousePos(this.element,b)),E.addEventListener(window,"mousemove",this.mousemove),E.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=b=>{this.move(b,E.mousePos(this.element,b))},this.mouseup=b=>{this._rotatePitchHanlder.dragEnd(b),this.offTemp()},this.touchstart=b=>{b.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=E.touchPos(this.element,b.targetTouches)[0],this.startMove(b,this._startPos),E.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.addEventListener(window,"touchend",this.touchend))},this.touchmove=b=>{b.targetTouches.length!==1?this.reset():(this._lastPos=E.touchPos(this.element,b.targetTouches)[0],this.move(b,this._lastPos))},this.touchend=b=>{b.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=s;const m=new K;this._rotatePitchHanlder=new Ou({clickTolerance:3,move:(b,T)=>{const I=s.getBoundingClientRect(),R=new o.P((I.bottom-I.top)/2,(I.right-I.left)/2);return{bearingDelta:o.cm(new o.P(b.x,T.y),T,R),pitchDelta:p?-.5*(T.y-b.y):void 0}},moveStateManager:m,enable:!0,assignEvents:()=>{}}),this.map=r,E.addEventListener(s,"mousedown",this.mousedown),E.addEventListener(s,"touchstart",this.touchstart,{passive:!1}),E.addEventListener(s,"touchcancel",this.reset)}startMove(r,s){this._rotatePitchHanlder.dragStart(r,s),E.disableDrag()}move(r,s){const p=this.map,{bearingDelta:m,pitchDelta:b}=this._rotatePitchHanlder.dragMove(r,s)||{};m&&p.setBearing(p.getBearing()+m),b&&p.setPitch(p.getPitch()+b)}off(){const r=this.element;E.removeEventListener(r,"mousedown",this.mousedown),E.removeEventListener(r,"touchstart",this.touchstart,{passive:!1}),E.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),E.removeEventListener(window,"touchend",this.touchend),E.removeEventListener(r,"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 Si;function Di(_,r,s,p=!1){if(p||!s.getCoveringTilesDetailsProvider().allowWorldCopies())return _?.wrap();const m=new o.S(_.lng,_.lat);if(_=new o.S(_.lng,_.lat),r){const b=new o.S(_.lng-360,_.lat),T=new o.S(_.lng+360,_.lat),I=s.locationToScreenPoint(_).distSqr(r);s.locationToScreenPoint(b).distSqr(r)<I?_=b:s.locationToScreenPoint(T).distSqr(r)<I&&(_=T)}for(;Math.abs(_.lng-s.center.lng)>180;){const b=s.locationToScreenPoint(_);if(b.x>=0&&b.y>=0&&b.x<=s.width&&b.y<=s.height)break;_.lng>s.center.lng?_.lng-=360:_.lng+=360}return _.lng!==m.lng&&s.isPointOnMapSurface(s.locationToScreenPoint(_))?_:m}const Wi={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 ii(_,r,s){const p=_.classList;for(const m in Wi)p.remove(`maplibregl-${s}-anchor-${m}`);p.add(`maplibregl-${s}-anchor-${r}`)}class Xn extends o.E{constructor(r){if(super(),this._onKeyPress=s=>{const p=s.code,m=s.charCode||s.keyCode;p!=="Space"&&p!=="Enter"&&m!==32&&m!==13||this.togglePopup()},this._onMapClick=s=>{const p=s.originalEvent.target,m=this._element;this._popup&&(p===m||m.contains(p))&&this.togglePopup()},this._update=s=>{if(!this._map)return;const p=this._map.loaded()&&!this._map.isMoving();(s?.type==="terrain"||s?.type==="render"&&!p)&&this._map.once("render",this._update),this._lngLat=Di(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 m="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?m=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(m=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let b="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?b="rotateX(0deg)":this._pitchAlignment==="map"&&(b=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||s&&s.type!=="moveend"||(this._pos=this._pos.round()),E.setTransform(this._element,`${Wi[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${b} ${m}`),M.frameAsync(new AbortController).then((()=>{this._updateOpacity(s&&s.type==="moveend")})).catch((()=>{}))},this._onMove=s=>{if(!this._isDragging){const p=this._clickTolerance||this._map._clickTolerance;this._isDragging=s.point.dist(this._pointerdownPos)>=p}this._isDragging&&(this._pos=s.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 o.l("dragstart"))),this.fire(new o.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 o.l("dragend")),this._state="inactive"},this._addDragHandler=s=>{this._element.contains(s.originalEvent.target)&&(s.preventDefault(),this._positionDelta=s.point.sub(this._pos).add(this._offset),this._pointerdownPos=s.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=r&&r.anchor||"center",this._color=r&&r.color||"#3FB1CE",this._scale=r&&r.scale||1,this._draggable=r&&r.draggable||!1,this._clickTolerance=r&&r.clickTolerance||0,this._subpixelPositioning=r&&r.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=r&&r.rotation||0,this._rotationAlignment=r&&r.rotationAlignment||"auto",this._pitchAlignment=r&&r.pitchAlignment&&r.pitchAlignment!=="auto"?r.pitchAlignment:this._rotationAlignment,this.setOpacity(r?.opacity,r?.opacityWhenCovered),r&&r.element)this._element=r.element,this._offset=o.P.convert(r&&r.offset||[0,0]);else{this._defaultMarker=!0,this._element=E.create("div");const s=E.createNS("http://www.w3.org/2000/svg","svg"),p=41,m=27;s.setAttributeNS(null,"display","block"),s.setAttributeNS(null,"height",`${p}px`),s.setAttributeNS(null,"width",`${m}px`),s.setAttributeNS(null,"viewBox",`0 0 ${m} ${p}`);const b=E.createNS("http://www.w3.org/2000/svg","g");b.setAttributeNS(null,"stroke","none"),b.setAttributeNS(null,"stroke-width","1"),b.setAttributeNS(null,"fill","none"),b.setAttributeNS(null,"fill-rule","evenodd");const T=E.createNS("http://www.w3.org/2000/svg","g");T.setAttributeNS(null,"fill-rule","nonzero");const I=E.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"transform","translate(3.0, 29.0)"),I.setAttributeNS(null,"fill","#000000");const R=[{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 qe of R){const Ke=E.createNS("http://www.w3.org/2000/svg","ellipse");Ke.setAttributeNS(null,"opacity","0.04"),Ke.setAttributeNS(null,"cx","10.5"),Ke.setAttributeNS(null,"cy","5.80029008"),Ke.setAttributeNS(null,"rx",qe.rx),Ke.setAttributeNS(null,"ry",qe.ry),I.appendChild(Ke)}const j=E.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"fill",this._color);const G=E.createNS("http://www.w3.org/2000/svg","path");G.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"),j.appendChild(G);const X=E.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"opacity","0.25"),X.setAttributeNS(null,"fill","#000000");const Y=E.createNS("http://www.w3.org/2000/svg","path");Y.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"),X.appendChild(Y);const ie=E.createNS("http://www.w3.org/2000/svg","g");ie.setAttributeNS(null,"transform","translate(6.0, 7.0)"),ie.setAttributeNS(null,"fill","#FFFFFF");const be=E.createNS("http://www.w3.org/2000/svg","g");be.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Ue=E.createNS("http://www.w3.org/2000/svg","circle");Ue.setAttributeNS(null,"fill","#000000"),Ue.setAttributeNS(null,"opacity","0.25"),Ue.setAttributeNS(null,"cx","5.5"),Ue.setAttributeNS(null,"cy","5.5"),Ue.setAttributeNS(null,"r","5.4999962");const je=E.createNS("http://www.w3.org/2000/svg","circle");je.setAttributeNS(null,"fill","#FFFFFF"),je.setAttributeNS(null,"cx","5.5"),je.setAttributeNS(null,"cy","5.5"),je.setAttributeNS(null,"r","5.4999962"),be.appendChild(Ue),be.appendChild(je),T.appendChild(I),T.appendChild(j),T.appendChild(X),T.appendChild(ie),T.appendChild(be),s.appendChild(T),s.setAttributeNS(null,"height",p*this._scale+"px"),s.setAttributeNS(null,"width",m*this._scale+"px"),this._element.appendChild(s),this._offset=o.P.convert(r&&r.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(s=>{s.preventDefault()})),this._element.addEventListener("mousedown",(s=>{s.preventDefault()})),ii(this._element,this._anchor,"marker"),r&&r.className)for(const s of r.className.split(" "))this._element.classList.add(s);this._popup=null}addTo(r){return this.remove(),this._map=r,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",r._getUIString("Marker.Title")),r.getCanvasContainer().appendChild(this._element),r.on("move",this._update),r.on("moveend",this._update),r.on("terrain",this._update),r.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(r){return this._lngLat=o.S.convert(r),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(r){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),r){if(!("offset"in r.options)){const m=Math.abs(13.5)/Math.SQRT2;r.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[m,-1*(38.1-13.5+m)],"bottom-right":[-m,-1*(38.1-13.5+m)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=r,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(r){return this._subpixelPositioning=r,this}getPopup(){return this._popup}togglePopup(){const r=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:r?(r.isOpen()?r.remove():(r.setLngLat(this._lngLat),r.addTo(this._map)),this):this}_updateOpacity(r=!1){var s,p;const m=(s=this._map)===null||s===void 0?void 0:s.terrain,b=this._map.transform.isLocationOccluded(this._lngLat);if(!m||b){const ie=b?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==ie&&(this._element.style.opacity=ie))}if(r)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}const T=this._map,I=T.terrain.depthAtPoint(this._pos),R=T.terrain.getElevationForLngLatZoom(this._lngLat,T.transform.tileZoom);if(T.transform.lngLatToCameraDepth(this._lngLat,R)-I<.006)return void(this._element.style.opacity=this._opacity);const j=-this._offset.y/T.transform.pixelsPerMeter,G=Math.sin(T.getPitch()*Math.PI/180)*j,X=T.terrain.depthAtPoint(new o.P(this._pos.x,this._pos.y-this._offset.y)),Y=T.transform.lngLatToCameraDepth(this._lngLat,R+G)-X>.006;!((p=this._popup)===null||p===void 0)&&p.isOpen()&&Y&&this._popup.remove(),this._element.style.opacity=Y?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(r){return this._offset=o.P.convert(r),this._update(),this}addClassName(r){this._element.classList.add(r)}removeClassName(r){this._element.classList.remove(r)}toggleClassName(r){return this._element.classList.toggle(r)}setDraggable(r){return this._draggable=!!r,this._map&&(r?(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(r){return this._rotation=r||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(r){return this._rotationAlignment=r||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(r){return this._pitchAlignment=r&&r!=="auto"?r:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(r,s){return(this._opacity===void 0||r===void 0&&s===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),r!==void 0&&(this._opacity=r),s!==void 0&&(this._opacityWhenCovered=s),this._map&&this._updateOpacity(!0),this}}const Ya={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Ro=0,To=!1;const Na={maxWidth:100,unit:"metric"};function Ti(_,r,s){const p=s&&s.maxWidth||100,m=_._container.clientHeight/2,b=_._container.clientWidth/2,T=_.unproject([b-p/2,m]),I=_.unproject([b+p/2,m]),R=Math.round(_.project(I).x-_.project(T).x),j=Math.min(p,R,_._container.clientWidth),G=T.distanceTo(I);if(s&&s.unit==="imperial"){const X=3.2808*G;X>5280?Go(r,j,X/5280,_._getUIString("ScaleControl.Miles")):Go(r,j,X,_._getUIString("ScaleControl.Feet"))}else s&&s.unit==="nautical"?Go(r,j,G/1852,_._getUIString("ScaleControl.NauticalMiles")):G>=1e3?Go(r,j,G/1e3,_._getUIString("ScaleControl.Kilometers")):Go(r,j,G,_._getUIString("ScaleControl.Meters"))}function Go(_,r,s,p){const m=(function(b){const T=Math.pow(10,`${Math.floor(b)}`.length-1);let I=b/T;return I=I>=10?10:I>=5?5:I>=3?3:I>=2?2:I>=1?1:(function(R){const j=Math.pow(10,Math.ceil(-Math.log(R)/Math.LN10));return Math.round(R*j)/j})(I),T*I})(s);_.style.width=r*(m/s)+"px",_.innerHTML=`${m}&nbsp;${p}`}const Oa={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},Il=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Ls(_){if(_){if(typeof _=="number"){const r=Math.round(Math.abs(_)/Math.SQRT2);return{center:new o.P(0,0),top:new o.P(0,_),"top-left":new o.P(r,r),"top-right":new o.P(-r,r),bottom:new o.P(0,-_),"bottom-left":new o.P(r,-r),"bottom-right":new o.P(-r,-r),left:new o.P(_,0),right:new o.P(-_,0)}}if(_ instanceof o.P||Array.isArray(_)){const r=o.P.convert(_);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:o.P.convert(_.center||[0,0]),top:o.P.convert(_.top||[0,0]),"top-left":o.P.convert(_["top-left"]||[0,0]),"top-right":o.P.convert(_["top-right"]||[0,0]),bottom:o.P.convert(_.bottom||[0,0]),"bottom-left":o.P.convert(_["bottom-left"]||[0,0]),"bottom-right":o.P.convert(_["bottom-right"]||[0,0]),left:o.P.convert(_.left||[0,0]),right:o.P.convert(_.right||[0,0])}}return Ls(new o.P(0,0))}const Ho=y;f.AJAXError=o.cy,f.Event=o.l,f.Evented=o.E,f.LngLat=o.S,f.MercatorCoordinate=o.a0,f.Point=o.P,f.addProtocol=o.cz,f.config=o.a,f.removeProtocol=o.cA,f.AttributionControl=Li,f.BoxZoomHandler=hh,f.CanvasSource=Er,f.CooperativeGesturesHandler=ko,f.DoubleClickZoomHandler=mr,f.DragPanHandler=zn,f.DragRotateHandler=un,f.EdgeInsets=_r,f.FullscreenControl=class extends o.E{constructor(_={}){super(),this._onFullscreenChange=()=>{var r;let s=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((r=s?.shadowRoot)===null||r===void 0)&&r.fullscreenElement;)s=s.shadowRoot.fullscreenElement;s===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,_&&_.container&&(_.container instanceof HTMLElement?this._container=_.container:o.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(_){return this._map=_,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 _=this._fullscreenButton=E.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);E.create("span","maplibregl-ctrl-icon",_).setAttribute("aria-hidden","true"),_.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const _=this._getTitle();this._fullscreenButton.setAttribute("aria-label",_),this._fullscreenButton.title=_}_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 o.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new o.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()}},f.GeoJSONSource=Mr,f.GeolocateControl=class extends o.E{constructor(_){super(),this._onSuccess=r=>{if(this._map){if(this._isOutOfMapMaxBounds(r))return this._setErrorState(),this.fire(new o.l("outofmaxbounds",r)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=r,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(r),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(r),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new o.l("geolocate",r)),this._finish()}},this._updateCamera=r=>{const s=new o.S(r.coords.longitude,r.coords.latitude),p=r.coords.accuracy,m=this._map.getBearing(),b=o.e({bearing:m},this.options.fitBoundsOptions),T=Kt.fromLngLat(s,p);this._map.fitBounds(T,b,{geolocateSource:!0})},this._updateMarker=r=>{if(r){const s=new o.S(r.coords.longitude,r.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=r.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=r=>{if(this._map){if(r.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 s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(r.code===3&&To)return;this.options.trackUserLocation&&this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new o.l("error",r)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(r=>r.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=r=>{if(this._map){if(r===!1){o.w("Geolocation support is not available so the GeolocateControl will be disabled.");const s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}else{const s=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s)}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 Xn({element:this._dotElement}),this._circleElement=E.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Xn({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",(s=>{s.geolocateSource||this._watchState!=="ACTIVE_LOCK"||s.originalEvent&&s.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 o.l("trackuserlocationend")),this.fire(new o.l("userlocationlostfocus")))}))}},this.options=o.e({},Ya,_)}onAdd(_){return this._map=_,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),(function(){return o._(this,arguments,void 0,(function*(r=!1){if(Si!==void 0&&!r)return Si;if(window.navigator.permissions===void 0)return Si=!!window.navigator.geolocation,Si;try{Si=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Si=!!window.navigator.geolocation}return Si}))})().then((r=>this._finishSetupUI(r))),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,Ro=0,To=!1}_isOutOfMapMaxBounds(_){const r=this._map.getMaxBounds(),s=_.coords;return r&&(s.longitude<r.getWest()||s.longitude>r.getEast()||s.latitude<r.getSouth()||s.latitude>r.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 _=this._map.getBounds(),r=_.getSouthEast(),s=_.getNorthEast(),p=r.distanceTo(s),m=Math.ceil(this._accuracy/(p/this._map._container.clientHeight)*2);this._circleElement.style.width=`${m}px`,this._circleElement.style.height=`${m}px`}trigger(){if(!this._setup)return o.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 o.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ro--,To=!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 o.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 o.l("trackuserlocationstart")),this.fire(new o.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 _;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ro++,Ro>1?(_={maximumAge:6e5,timeout:0},To=!0):(_=this.options.positionOptions,To=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,_)}}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)}},f.GlobeControl=class{constructor(){this._toggleProjection=()=>{var _;const r=(_=this._map.getProjection())===null||_===void 0?void 0:_.type;this._map.setProjection(r!=="mercator"&&r?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var _;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),((_=this._map.getProjection())===null||_===void 0?void 0:_.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(_){return this._map=_,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}},f.Hash=sc,f.ImageSource=Jt,f.KeyboardHandler=tr,f.LngLatBounds=Kt,f.LogoControl=Vo,f.Map=class extends en{constructor(_){var r,s;o.cv.mark(o.cw.create);const p=Object.assign(Object.assign(Object.assign({},Eo),_),{canvasContextAttributes:Object.assign(Object.assign({},Eo.canvasContextAttributes),_.canvasContextAttributes)});if(p.minZoom!=null&&p.maxZoom!=null&&p.minZoom>p.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(p.minPitch!=null&&p.maxPitch!=null&&p.minPitch>p.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(p.minPitch!=null&&p.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(p.maxPitch!=null&&p.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");const m=new An,b=new Vl;if(p.minZoom!==void 0&&m.setMinZoom(p.minZoom),p.maxZoom!==void 0&&m.setMaxZoom(p.maxZoom),p.minPitch!==void 0&&m.setMinPitch(p.minPitch),p.maxPitch!==void 0&&m.setMaxPitch(p.maxPitch),p.renderWorldCopies!==void 0&&m.setRenderWorldCopies(p.renderWorldCopies),super(m,b,{bearingSnap:p.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new va,this._controls=[],this._mapId=o.a6(),this._contextLost=I=>{I.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new o.l("webglcontextlost",{originalEvent:I}))},this._contextRestored=I=>{this._setupPainter(),this.resize(),this._update(),this.fire(new o.l("webglcontextrestored",{originalEvent:I}))},this._onMapScroll=I=>{if(I.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=p.interactive,this._maxTileCacheSize=p.maxTileCacheSize,this._maxTileCacheZoomLevels=p.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},p.canvasContextAttributes),this._trackResize=p.trackResize===!0,this._bearingSnap=p.bearingSnap,this._centerClampedToGround=p.centerClampedToGround,this._refreshExpiredTiles=p.refreshExpiredTiles===!0,this._fadeDuration=p.fadeDuration,this._crossSourceCollisions=p.crossSourceCollisions===!0,this._collectResourceTiming=p.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Gi),p.locale),this._clickTolerance=p.clickTolerance,this._overridePixelRatio=p.pixelRatio,this._maxCanvasSize=p.maxCanvasSize,this.transformCameraUpdate=p.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=p.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=W.addThrottleControl((()=>this.isMoving())),this._requestManager=new le(p.transformRequest),typeof p.container=="string"){if(this._container=document.getElementById(p.container),!this._container)throw new Error(`Container '${p.container}' not found.`)}else{if(!(p.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=p.container}if(p.maxBounds&&this.setMaxBounds(p.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 I=!1;const R=Ra((j=>{this._trackResize&&!this._removed&&(this.resize(j),this.redraw())}),50);this._resizeObserver=new ResizeObserver((j=>{I?R(j):I=!0})),this._resizeObserver.observe(this._container)}this.handlers=new Mi(this,p),this._hash=p.hash&&new sc(typeof p.hash=="string"&&p.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:p.center,elevation:p.elevation,zoom:p.zoom,bearing:p.bearing,pitch:p.pitch,roll:p.roll}),p.bounds&&(this.resize(),this.fitBounds(p.bounds,o.e({},p.fitBoundsOptions,{duration:0}))));const T=typeof p.style=="string"||((s=(r=p.style)===null||r===void 0?void 0:r.projection)===null||s===void 0?void 0:s.type)!=="globe";this.resize(null,T),this._localIdeographFontFamily=p.localIdeographFontFamily,this._validateStyle=p.validateStyle,p.style&&this.setStyle(p.style,{localIdeographFontFamily:p.localIdeographFontFamily}),p.attributionControl&&this.addControl(new Li(typeof p.attributionControl=="boolean"?void 0:p.attributionControl)),p.maplibreLogo&&this.addControl(new Vo,p.logoPosition),this.on("style.load",(()=>{if(T||this._resizeTransform(),this.transform.unmodified){const I=o.Q(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(I)}})),this.on("data",(I=>{this._update(I.dataType==="style"),this.fire(new o.l(`${I.dataType}data`,I))})),this.on("dataloading",(I=>{this.fire(new o.l(`${I.dataType}dataloading`,I))})),this.on("dataabort",(I=>{this.fire(new o.l("sourcedataabort",I))}))}_getMapId(){return this._mapId}setGlobalStateProperty(_,r){return this.style.setGlobalStateProperty(_,r),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(_,r){if(r===void 0&&(r=_.getDefaultPosition?_.getDefaultPosition():"top-right"),!_||!_.onAdd)return this.fire(new o.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const s=_.onAdd(this);this._controls.push(_);const p=this._controlPositions[r];return r.indexOf("bottom")!==-1?p.insertBefore(s,p.firstChild):p.appendChild(s),this}removeControl(_){if(!_||!_.onRemove)return this.fire(new o.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(_);return r>-1&&this._controls.splice(r,1),_.onRemove(this),this}hasControl(_){return this._controls.indexOf(_)>-1}calculateCameraOptionsFromTo(_,r,s,p){return p==null&&this.terrain&&(p=this.terrain.getElevationForLngLatZoom(s,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(_,r,s,p)}resize(_,r=!0){const[s,p]=this._containerDimensions(),m=this._getClampedPixelRatio(s,p);if(this._resizeCanvas(s,p,m),this.painter.resize(s,p,m),this.painter.overLimit()){const T=this.painter.context.gl;this._maxCanvasSize=[T.drawingBufferWidth,T.drawingBufferHeight];const I=this._getClampedPixelRatio(s,p);this._resizeCanvas(s,p,I),this.painter.resize(s,p,I)}this._resizeTransform(r);const b=!this._moving;return b&&(this.stop(),this.fire(new o.l("movestart",_)).fire(new o.l("move",_))),this.fire(new o.l("resize",_)),b&&this.fire(new o.l("moveend",_)),this}_resizeTransform(_=!0){var r;const[s,p]=this._containerDimensions();this.transform.resize(s,p,_),(r=this._requestedCameraState)===null||r===void 0||r.resize(s,p,_)}_getClampedPixelRatio(_,r){const{0:s,1:p}=this._maxCanvasSize,m=this.getPixelRatio(),b=_*m,T=r*m;return Math.min(b>s?s/b:1,T>p?p/T:1)*m}getPixelRatio(){var _;return(_=this._overridePixelRatio)!==null&&_!==void 0?_:devicePixelRatio}setPixelRatio(_){this._overridePixelRatio=_,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(_){return this.transform.setMaxBounds(Kt.convert(_)),this._update()}setMinZoom(_){if((_=_??-2)>=-2&&_<=this.transform.maxZoom)return this.transform.setMinZoom(_),this._update(),this.getZoom()<_&&this.setZoom(_),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(_){if((_=_??22)>=this.transform.minZoom)return this.transform.setMaxZoom(_),this._update(),this.getZoom()>_&&this.setZoom(_),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(_){if((_=_??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(_>=0&&_<=this.transform.maxPitch)return this.transform.setMinPitch(_),this._update(),this.getPitch()<_&&this.setPitch(_),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(_){if((_=_??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(_>=this.transform.minPitch)return this.transform.setMaxPitch(_),this._update(),this.getPitch()>_&&this.setPitch(_),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(_){return this.transform.setRenderWorldCopies(_),this._update()}project(_){return this.transform.locationToScreenPoint(o.S.convert(_),this.style&&this.terrain)}unproject(_){return this.transform.screenPointToLocation(o.P.convert(_),this.terrain)}isMoving(){var _;return this._moving||((_=this.handlers)===null||_===void 0?void 0:_.isMoving())}isZooming(){var _;return this._zooming||((_=this.handlers)===null||_===void 0?void 0:_.isZooming())}isRotating(){var _;return this._rotating||((_=this.handlers)===null||_===void 0?void 0:_.isRotating())}_createDelegatedListener(_,r,s){if(_==="mouseenter"||_==="mouseover"){let p=!1;return{layers:r,listener:s,delegates:{mousemove:b=>{const T=r.filter((R=>this.getLayer(R))),I=T.length!==0?this.queryRenderedFeatures(b.point,{layers:T}):[];I.length?p||(p=!0,s.call(this,new _a(_,this,b.originalEvent,{features:I}))):p=!1},mouseout:()=>{p=!1}}}}if(_==="mouseleave"||_==="mouseout"){let p=!1;return{layers:r,listener:s,delegates:{mousemove:T=>{const I=r.filter((R=>this.getLayer(R)));(I.length!==0?this.queryRenderedFeatures(T.point,{layers:I}):[]).length?p=!0:p&&(p=!1,s.call(this,new _a(_,this,T.originalEvent)))},mouseout:T=>{p&&(p=!1,s.call(this,new _a(_,this,T.originalEvent)))}}}}{const p=m=>{const b=r.filter((I=>this.getLayer(I))),T=b.length!==0?this.queryRenderedFeatures(m.point,{layers:b}):[];T.length&&(m.features=T,s.call(this,m),delete m.features)};return{layers:r,listener:s,delegates:{[_]:p}}}}_saveDelegatedListener(_,r){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[_]=this._delegatedListeners[_]||[],this._delegatedListeners[_].push(r)}_removeDelegatedListener(_,r,s){if(!this._delegatedListeners||!this._delegatedListeners[_])return;const p=this._delegatedListeners[_];for(let m=0;m<p.length;m++){const b=p[m];if(b.listener===s&&b.layers.length===r.length&&b.layers.every((T=>r.includes(T)))){for(const T in b.delegates)this.off(T,b.delegates[T]);return void p.splice(m,1)}}}on(_,r,s){if(s===void 0)return super.on(_,r);const p=typeof r=="string"?[r]:r,m=this._createDelegatedListener(_,p,s);this._saveDelegatedListener(_,m);for(const b in m.delegates)this.on(b,m.delegates[b]);return{unsubscribe:()=>{this._removeDelegatedListener(_,p,s)}}}once(_,r,s){if(s===void 0)return super.once(_,r);const p=typeof r=="string"?[r]:r,m=this._createDelegatedListener(_,p,s);for(const b in m.delegates){const T=m.delegates[b];m.delegates[b]=(...I)=>{this._removeDelegatedListener(_,p,s),T(...I)}}this._saveDelegatedListener(_,m);for(const b in m.delegates)this.once(b,m.delegates[b]);return this}off(_,r,s){return s===void 0?super.off(_,r):(this._removeDelegatedListener(_,typeof r=="string"?[r]:r,s),this)}queryRenderedFeatures(_,r){if(!this.style)return[];let s;const p=_ instanceof o.P||Array.isArray(_),m=p?_:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(p?{}:_)||{},m instanceof o.P||typeof m[0]=="number")s=[o.P.convert(m)];else{const b=o.P.convert(m[0]),T=o.P.convert(m[1]);s=[b,new o.P(T.x,b.y),T,new o.P(b.x,T.y),b]}return this.style.queryRenderedFeatures(s,r,this.transform)}querySourceFeatures(_,r){return this.style.querySourceFeatures(_,r)}setStyle(_,r){return(r=o.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff!==!1&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&_?(this._diffStyle(_,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(_,r))}setTransformRequest(_){return this._requestManager.setTransformRequest(_),this}_getUIString(_){const r=this._locale[_];if(r==null)throw new Error(`Missing UI string '${_}'`);return r}_updateStyle(_,r){var s,p;if(r.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(_,r)));const m=this.style&&r.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!_)),_?(this.style=new Ma(this,r||{}),this.style.setEventedParent(this,{style:this.style}),typeof _=="string"?this.style.loadURL(_,r,m):this.style.loadJSON(_,r,m),this):((p=(s=this.style)===null||s===void 0?void 0:s.projection)===null||p===void 0||p.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Ma(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(_,r){if(typeof _=="string"){const s=this._requestManager.transformRequest(_,"Style");o.j(s,new AbortController).then((p=>{this._updateDiff(p.data,r)})).catch((p=>{p&&this.fire(new o.k(p))}))}else typeof _=="object"&&this._updateDiff(_,r)}_updateDiff(_,r){try{this.style.setState(_,r)&&this._update(!0)}catch(s){o.w(`Unable to perform style diff: ${s.message||s.error||s}. Rebuilding the style from scratch.`),this._updateStyle(_,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():o.w("There is no style added to the map.")}addSource(_,r){return this._lazyInitEmptyStyle(),this.style.addSource(_,r),this._update(!0)}isSourceLoaded(_){const r=this.style&&this.style.sourceCaches[_];if(r!==void 0)return r.loaded();this.fire(new o.k(new Error(`There is no source with ID '${_}'`)))}setTerrain(_){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),_){const r=this.style.sourceCaches[_.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${_.source}`);this.terrain===null&&r.reload();for(const s in this.style._layers){const p=this.style._layers[s];p.type==="hillshade"&&p.source===_.source&&o.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."),p.type==="color-relief"&&p.source===_.source&&o.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Ki(this.painter,r,_),this.painter.renderToTexture=new zr(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=s=>{var p;s.dataType==="style"?this.terrain.sourceCache.freeRtt():s.dataType==="source"&&s.tile&&(s.sourceId!==_.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))),((p=s.source)===null||p===void 0?void 0:p.type)==="image"?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(s.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 o.l("terrain",{terrain:_})),this}getTerrain(){var _,r;return(r=(_=this.terrain)===null||_===void 0?void 0:_.options)!==null&&r!==void 0?r:null}areTilesLoaded(){const _=this.style&&this.style.sourceCaches;for(const r in _){const s=_[r]._tiles;for(const p in s){const m=s[p];if(m.state!=="loaded"&&m.state!=="errored")return!1}}return!0}removeSource(_){return this.style.removeSource(_),this._update(!0)}getSource(_){return this.style.getSource(_)}setSourceTileLodParams(_,r,s){if(s){const p=this.getSource(s);if(!p)throw new Error(`There is no source with ID "${s}", cannot set LOD parameters`);p.calculateTileZoom=St(Math.max(1,_),Math.max(1,r))}else for(const p in this.style.sourceCaches)this.style.sourceCaches[p].getSource().calculateTileZoom=St(Math.max(1,_),Math.max(1,r));return this._update(!0),this}refreshTiles(_,r){const s=this.style.sourceCaches[_];if(!s)throw new Error(`There is no source cache with ID "${_}", cannot refresh tile`);r===void 0?s.reload(!0):s.refreshTiles(r.map((p=>new o.a3(p.z,p.x,p.y))))}addImage(_,r,s={}){const{pixelRatio:p=1,sdf:m=!1,stretchX:b,stretchY:T,content:I,textFitWidth:R,textFitHeight:j}=s;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||o.b(r))){if(r.width===void 0||r.height===void 0)return this.fire(new o.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:G,height:X,data:Y}=r,ie=r;return this.style.addImage(_,{data:new o.R({width:G,height:X},new Uint8Array(Y)),pixelRatio:p,stretchX:b,stretchY:T,content:I,textFitWidth:R,textFitHeight:j,sdf:m,version:0,userImage:ie}),ie.onAdd&&ie.onAdd(this,_),this}}{const{width:G,height:X,data:Y}=M.getImageData(r);this.style.addImage(_,{data:new o.R({width:G,height:X},Y),pixelRatio:p,stretchX:b,stretchY:T,content:I,textFitWidth:R,textFitHeight:j,sdf:m,version:0})}}updateImage(_,r){const s=this.style.getImage(_);if(!s)return this.fire(new o.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const p=r instanceof HTMLImageElement||o.b(r)?M.getImageData(r):r,{width:m,height:b,data:T}=p;if(m===void 0||b===void 0)return this.fire(new o.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(m!==s.data.width||b!==s.data.height)return this.fire(new o.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));const I=!(r instanceof HTMLImageElement||o.b(r));return s.data.replace(T,I),this.style.updateImage(_,s),this}getImage(_){return this.style.getImage(_)}hasImage(_){return _?!!this.style.getImage(_):(this.fire(new o.k(new Error("Missing required image id"))),!1)}removeImage(_){this.style.removeImage(_)}loadImage(_){return W.getImage(this._requestManager.transformRequest(_,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(_,r){return this._lazyInitEmptyStyle(),this.style.addLayer(_,r),this._update(!0)}moveLayer(_,r){return this.style.moveLayer(_,r),this._update(!0)}removeLayer(_){return this.style.removeLayer(_),this._update(!0)}getLayer(_){return this.style.getLayer(_)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(_,r,s){return this.style.setLayerZoomRange(_,r,s),this._update(!0)}setFilter(_,r,s={}){return this.style.setFilter(_,r,s),this._update(!0)}getFilter(_){return this.style.getFilter(_)}setPaintProperty(_,r,s,p={}){return this.style.setPaintProperty(_,r,s,p),this._update(!0)}getPaintProperty(_,r){return this.style.getPaintProperty(_,r)}setLayoutProperty(_,r,s,p={}){return this.style.setLayoutProperty(_,r,s,p),this._update(!0)}getLayoutProperty(_,r){return this.style.getLayoutProperty(_,r)}setGlyphs(_,r={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(_,r),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(_,r,s={}){return this._lazyInitEmptyStyle(),this.style.addSprite(_,r,s,(p=>{p||this._update(!0)})),this}removeSprite(_){return this._lazyInitEmptyStyle(),this.style.removeSprite(_),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(_,r={}){return this._lazyInitEmptyStyle(),this.style.setSprite(_,r,(s=>{s||this._update(!0)})),this}setLight(_,r={}){return this._lazyInitEmptyStyle(),this.style.setLight(_,r),this._update(!0)}getLight(){return this.style.getLight()}setSky(_,r={}){return this._lazyInitEmptyStyle(),this.style.setSky(_,r),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(_,r){return this.style.setFeatureState(_,r),this._update()}removeFeatureState(_,r){return this.style.removeFeatureState(_,r),this._update()}getFeatureState(_){return this.style.getFeatureState(_)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let _=0,r=0;return this._container&&(_=this._container.clientWidth||400,r=this._container.clientHeight||300),[_,r]}_setupContainer(){const _=this._container;_.classList.add("maplibregl-map");const r=this._canvasContainer=E.create("div","maplibregl-canvas-container",_);this._interactive&&r.classList.add("maplibregl-interactive"),this._canvas=E.create("canvas","maplibregl-canvas",r),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 s=this._containerDimensions(),p=this._getClampedPixelRatio(s[0],s[1]);this._resizeCanvas(s[0],s[1],p);const m=this._controlContainer=E.create("div","maplibregl-control-container",_),b=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((T=>{b[T]=E.create("div",`maplibregl-ctrl-${T} `,m)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(_,r,s){this._canvas.width=Math.floor(s*_),this._canvas.height=Math.floor(s*r),this._canvas.style.width=`${_}px`,this._canvas.style.height=`${r}px`}_setupPainter(){const _=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0});let r=null;this._canvas.addEventListener("webglcontextcreationerror",(p=>{r={requestedAttributes:_},p&&(r.statusMessage=p.statusMessage,r.type=p.type)}),{once:!0});let s=null;if(s=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,_):this._canvas.getContext("webgl2",_)||this._canvas.getContext("webgl",_),!s){const p="Failed to initialize WebGL";throw r?(r.message=p,new Error(JSON.stringify(r))):new Error(p)}this.painter=new $o(s,this.transform),O.testSupport(s)}migrateProjection(_,r){super.migrateProjection(_,r),this.painter.transform=_,this.fire(new o.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(_){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||_,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(_){return this._update(),this._renderTaskQueue.add(_)}_cancelRenderFrame(_){this._renderTaskQueue.remove(_)}_render(_){var r,s,p,m,b;const T=this._idleTriggered?this._fadeDuration:0,I=((r=this.style.projection)===null||r===void 0?void 0:r.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(_),this._removed)return;let R=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const X=this.transform.zoom,Y=M.now();this.style.zoomHistory.update(X,Y);const ie=new o.F(X,{now:Y,fadeDuration:T,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition(),globalState:this.style.getGlobalState()}),be=ie.crossFadingFactor();be===1&&be===this._crossFadingFactor||(R=!0,this._crossFadingFactor=be),this.style.update(ie)}const j=((s=this.style.projection)===null||s===void 0?void 0:s.transitionState)>0!==I;(p=this.style.projection)===null||p===void 0||p.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState((m=this.style.projection)===null||m===void 0?void 0:m.transitionState,(b=this.style.projection)===null||b===void 0?void 0:b.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||j)&&(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,T,this._crossSourceCollisions,j),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:T,showPadding:this.showPadding}),this.fire(new o.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,o.cv.mark(o.cw.load),this.fire(new o.l("load"))),this.style&&(this.style.hasTransitions()||R)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const G=this._sourcesDirty||this._styleDirty||this._placementDirty;return G||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new o.l("idle")),!this._loaded||this._fullyLoaded||G||(this._fullyLoaded=!0,o.cv.mark(o.cw.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var _;this._hash&&this._hash.remove();for(const s of this._controls)s.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),W.removeThrottleControl(this._imageQueueHandle),(_=this._resizeObserver)===null||_===void 0||_.disconnect();const r=this.painter.context.gl.getExtension("WEBGL_lose_context");r?.loseContext&&r.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"),o.cv.clearMetrics(),this._removed=!0,this.fire(new o.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,M.frame(this._frameRequest,(_=>{o.cv.frame(_),this._frameRequest=null;try{this._render(_)}catch(r){if(!o.cx(r)&&!(function(s){return s.message===qo})(r))throw r}}),(()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(_){this._showTileBoundaries!==_&&(this._showTileBoundaries=_,this._update())}get showPadding(){return!!this._showPadding}set showPadding(_){this._showPadding!==_&&(this._showPadding=_,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(_){this._showCollisionBoxes!==_&&(this._showCollisionBoxes=_,_?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(_){this._showOverdrawInspector!==_&&(this._showOverdrawInspector=_,this._update())}get repaint(){return!!this._repaint}set repaint(_){this._repaint!==_&&(this._repaint=_,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(_){this._vertices=_,this._update()}get version(){return _i}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(_){return this._lazyInitEmptyStyle(),this.style.setProjection(_),this._update(!0)}},f.MapMouseEvent=_a,f.MapTouchEvent=Ws,f.MapWheelEvent=Rc,f.Marker=Xn,f.NavigationControl=class{constructor(_){this._updateZoomButtons=()=>{const r=this._map.getZoom(),s=r===this._map.getMaxZoom(),p=r===this._map.getMinZoom();this._zoomInButton.disabled=s,this._zoomOutButton.disabled=p,this._zoomInButton.setAttribute("aria-disabled",s.toString()),this._zoomOutButton.setAttribute("aria-disabled",p.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=(r,s)=>{const p=this._map._getUIString(`NavigationControl.${s}`);r.title=p,r.setAttribute("aria-label",p)},this.options=o.e({},Hi,_),this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(r=>r.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(r=>this._map.zoomIn({},{originalEvent:r}))),E.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(r=>this._map.zoomOut({},{originalEvent:r}))),E.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(r=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:r}):this._map.resetNorth({},{originalEvent:r})})),this._compassIcon=E.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(_){return this._map=_,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 _o(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(_,r){const s=E.create("button",_,this._container);return s.type="button",s.addEventListener("click",r),s}},f.Popup=class extends o.E{constructor(_){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 o.l("close"))),this),this._onMouseUp=r=>{this._update(r.point)},this._onMouseMove=r=>{this._update(r.point)},this._onDrag=r=>{this._update(r.point)},this._update=r=>{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 T of this.options.className.split(" "))this._container.classList.add(T);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=Di(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!r)return;const s=this._flatPos=this._pos=this._trackPointer&&r?r:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&r?r:this._map.transform.locationToScreenPoint(this._lngLat));let p=this.options.anchor;const m=Ls(this.options.offset);if(!p){const T=this._container.offsetWidth,I=this._container.offsetHeight;let R;R=s.y+m.bottom.y<I?["top"]:s.y>this._map.transform.height-I?["bottom"]:[],s.x<T/2?R.push("left"):s.x>this._map.transform.width-T/2&&R.push("right"),p=R.length===0?"bottom":R.join("-")}let b=s.add(m[p]);this.options.subpixelPositioning||(b=b.round()),E.setTransform(this._container,`${Wi[p]} translate(${b.x}px,${b.y}px)`),ii(this._container,p,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=o.e(Object.create(Oa),_)}addTo(_){return this._map&&this.remove(),this._map=_,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 o.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(_){return this._lngLat=o.S.convert(_),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(_){return this.setDOMContent(document.createTextNode(_))}setHTML(_){const r=document.createDocumentFragment(),s=document.createElement("body");let p;for(s.innerHTML=_;p=s.firstChild,p;)r.appendChild(p);return this.setDOMContent(r)}getMaxWidth(){var _;return(_=this._container)===null||_===void 0?void 0:_.style.maxWidth}setMaxWidth(_){return this.options.maxWidth=_,this._update(),this}setDOMContent(_){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(_),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(_){return this._container&&this._container.classList.add(_),this}removeClassName(_){return this._container&&this._container.classList.remove(_),this}setOffset(_){return this.options.offset=_,this._update(),this}toggleClassName(_){if(this._container)return this._container.classList.toggle(_)}setSubpixelPositioning(_){this.options.subpixelPositioning=_}_createCloseButton(){this.options.closeButton&&(this._closeButton=E.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const _=this._container.querySelector(Il);_&&_.focus()}},f.RasterDEMTileSource=fr,f.RasterTileSource=Lr,f.ScaleControl=class{constructor(_){this._onMove=()=>{Ti(this._map,this._container,this.options)},this.setUnit=r=>{this.options.unit=r,Ti(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Na),_)}getDefaultPosition(){return"bottom-left"}onAdd(_){return this._map=_,this._container=E.create("div","maplibregl-ctrl maplibregl-ctrl-scale",_.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}},f.ScrollZoomHandler=Cr,f.Style=Ma,f.TerrainControl=class{constructor(_){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=_}onAdd(_){return this._map=_,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}},f.TwoFingersTouchPitchHandler=Lt,f.TwoFingersTouchRotateHandler=Gt,f.TwoFingersTouchZoomHandler=Je,f.TwoFingersTouchZoomRotateHandler=Yn,f.VectorTileSource=Be,f.VideoSource=Or,f.addSourceType=(_,r)=>o._(void 0,void 0,void 0,(function*(){if(yr(_))throw new Error(`A source type called "${_}" already exists.`);((s,p)=>{lr[s]=p})(_,r)})),f.clearPrewarmedResources=function(){const _=fe;_&&(_.isPreloaded()&&_.numActive()===1?(_.release(ge),fe=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()"))},f.createTileMesh=js,f.getMaxParallelImageRequests=function(){return o.a.MAX_PARALLEL_IMAGE_REQUESTS},f.getRTLTextPluginStatus=function(){return Wr().getRTLTextPluginStatus()},f.getVersion=function(){return Ho},f.getWorkerCount=function(){return Re.workerCount},f.getWorkerUrl=function(){return o.a.WORKER_URL},f.importScriptInWorkers=function(_){return ot().broadcast("IS",_)},f.prewarm=function(){Ie().acquire(ge)},f.setMaxParallelImageRequests=function(_){o.a.MAX_PARALLEL_IMAGE_REQUESTS=_},f.setRTLTextPlugin=function(_,r){return Wr().setRTLTextPlugin(_,r)},f.setWorkerCount=function(_){Re.workerCount=_},f.setWorkerUrl=function(_){o.a.WORKER_URL=_}}));var h=n;return h}))})(Um)),Um.exports}var QD=JD();class ek{registeredElements;baseLayers;firstSymbolLayer;eventHandlers;wrapper;initRegisteredElements;addNativeMaplibreFunctionsAndProps;map;style;styleJson;addSource;addControl;on;cleanup;constructor(t){const n=this;this.registeredElements={},this.baseLayers=[],this.firstSymbolLayer=void 0,this.eventHandlers={layerchange:[],viewportchange:[],addsource:[],addlayer:[]},this.wrapper={on:(o,y,v,S)=>{if(!n.eventHandlers[o])return;typeof v=="string"&&(S=v,v={}),n.eventHandlers[o].push({handler:y,options:v});const P=[o,y];S&&typeof S=="string"&&(n.initRegisteredElements(S),n.registeredElements[S].wrapperEvents.push(P))},off:(o,y)=>{n.eventHandlers[o]&&(n.eventHandlers[o]=n.eventHandlers[o].filter(v=>Object.is(v.handler,y)?!1:v))},fire:(o,y)=>{if(!n.eventHandlers[o])return;const v=y||window,S=new Event(o);n.eventHandlers[o].forEach(function(P){P.handler.call(v,S,n,y)})},layerState:[],layerStateString:"",oldLayerStateStrings:{},buildLayerObject:o=>{if(o)return{id:o.id,type:o.type,visible:o.visibility!=="none",baseLayer:n.baseLayers.indexOf(o.id)!==-1}},buildLayerObjects:()=>n.map.style._order.map(o=>n.wrapper.buildLayerObject(n.map.style._layers[o])).filter(o=>typeof o<"u"),refreshLayerState:()=>{n.wrapper.layerState=n.wrapper.buildLayerObjects(),JSON.stringify(n.wrapper.layerState)!==n.wrapper.layerStateString&&(n.wrapper.fire("layerchange"),n.wrapper.layerStateString=JSON.stringify(n.wrapper.layerState))},viewportState:{center:{lng:0,lat:0},zoom:0,bearing:0,pitch:0},viewportStateString:"{}",oldViewportStateString:"{}",getViewport:()=>typeof n.map.getCenter=="function"?{center:(({lng:o,lat:y})=>({lng:o,lat:y}))(n.map.getCenter()),zoom:n.map.getZoom(),bearing:n.map.getBearing(),pitch:n.map.getPitch()}:{center:{lng:0,lat:0},zoom:0,bearing:0,pitch:0},refreshViewport:()=>{n.wrapper.viewportState=n.wrapper.getViewport()}},this.cancelled=!1,this.initRegisteredElements=(o,y)=>{(typeof n.registeredElements[o]>"u"||typeof y<"u"&&y)&&(n.registeredElements[o]={layers:[],sources:[],images:[],events:[],controls:[],wrapperEvents:[]})},this.addLayer=(o,y,v)=>n.map.style?(v&&typeof v=="string"&&typeof o.id<"u"&&(n.initRegisteredElements(v),n.registeredElements[v].layers.push(o.id),o?.source&&typeof o?.source!="string"&&n.registeredElements[v].sources.push(o.id)),n.map.addLayer(o,y),n.wrapper.fire("addlayer",{layer_id:o.id}),this):this,this.addSource=(o,y,v)=>n.map.style?(v&&typeof v=="string"&&typeof o<"u"&&(n.initRegisteredElements(v),n.registeredElements[v].sources.push(o)),n.map.addSource(o,y),n.wrapper.fire("addsource",{source_id:o}),this):this,this.addImage=(o,y,v,S)=>n.map.style?typeof v=="string"&&typeof S>"u"?n.addImage(o,y,void 0,v):(S&&typeof S=="string"&&typeof o<"u"&&(n.initRegisteredElements(S),n.registeredElements[S].images.push(o)),n.map.addImage(o,y,v),this):this,this.on=(o,y,v,S)=>{if(typeof v=="string"&&typeof y=="function")return n.on.call(n,o,void 0,y,v);let P=[o,y,v];return y||(P=[o,v]),S&&typeof S=="string"&&(n.initRegisteredElements(S),n.registeredElements[S].events.push(P)),n.map.on(...P),this},this.addControl=(o,y,v)=>(v&&typeof v=="string"&&(n.initRegisteredElements(v),n.registeredElements[v].controls.push(o)),n.map.addControl(o,y),this),this.cleanup=o=>{n.map.style&&typeof n.registeredElements[o]<"u"&&(n.registeredElements[o].layers.forEach(y=>{n.map.style.getLayer(y)&&n.map.style.removeLayer(y)}),n.registeredElements[o].sources.forEach(y=>{n.map.style.getSource(y)&&n.map.style.removeSource(y)}),n.registeredElements[o].images.forEach(y=>{n.map.hasImage(y)&&n.map.style.removeImage(y)}),n.registeredElements[o].events.forEach(y=>{n.map.off(...y)}),n.registeredElements[o].controls.forEach(y=>{n.map.removeControl(y)}),n.registeredElements[o].wrapperEvents.forEach(y=>{n.wrapper.off(...y)}),n.initRegisteredElements(o,!0))},["moveLayer","removeLayer","removeSource","setPaintProperty","setLayoutProperty"].forEach(o=>{this[o]=(...y)=>(n.map&&n.map.style&&typeof n.map.style[o]=="function"&&n.map.style[o](...y),n.map._update?n.map._update(!0):void 0)}),["getLayer","getSource","listImages","getPaintProperty","getLayoutProperty","removeImage"].forEach(o=>{this[o]=(...y)=>n.map&&n.map.style?n.map.style[o](...y):!1}),this.addNativeMaplibreFunctionsAndProps=()=>{Object.getOwnPropertyNames(Object.getPrototypeOf(this.map)).forEach(o=>{typeof this[o]>"u"&&(this[o]=(...y)=>n.map[o](...y))}),Object.keys(this.map).forEach(o=>{typeof this[o]>"u"&&(this[o]=n.map[o])})},["getZoom","setZoom","getCenter","setCenter","getBearing","setBearing","getPitch","setPitch","jumpTo","flyTo","panTo","panBy","panBy","zoomTo","zoomIn","zoomOut","getPadding","setPadding","rotateTo","resetNorth","resetNorthPitch","snapToNorth","cameraForBounds","fitBounds","fitScreenCoordinates","getFreeCameraOptions","setFreeCameraOptions","easeTo","stop"].forEach(o=>{this[o]=(...y)=>{if(typeof n.map[o]=="function")return n.map[o].call(n.map,...y)}}),(async()=>{typeof t.mapOptions.style=="string"&&t.mapOptions.style.indexOf("mapbox://")===-1&&await fetch(t.mapOptions.style).then(o=>{if(o.ok)return o.json();throw new Error("error loading map style.json")}).then(o=>{o.layers.forEach(y=>{n.baseLayers.push(y.id),!n.firstSymbolLayer&&y.type==="symbol"&&(n.firstSymbolLayer=y.id)}),n.styleJson=o,t.mapOptions.style=o}).catch(o=>{console.log(o)}),n.map=new QD.Map(t.mapOptions),n.addNativeMaplibreFunctionsAndProps(),n.wrapper.refreshViewport(),n.wrapper.fire("viewportchange"),n.map.on("load",()=>{n.addNativeMaplibreFunctionsAndProps()}),n.map.on("move",()=>{n.wrapper.viewportState=n.wrapper.getViewport(),n.wrapper.fire("viewportchange")}),n.map.on("idle",()=>{n.wrapper.refreshLayerState()}),n.map.on("data",()=>{n.wrapper.refreshLayerState()}),typeof t.onReady=="function"&&t.onReady(n.map,n)})()}}function Yc(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(a=>n.searchParams.append("args[]",a)),`Minified MUI error #${e}; visit ${n} for the full message.`}const Yu="$$material";function rg(){return rg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},rg.apply(null,arguments)}function tk(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function rk(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var nk=(function(){function e(n){var a=this;this._insertTag=function(c){var h;a.tags.length===0?a.insertionPoint?h=a.insertionPoint.nextSibling:a.prepend?h=a.container.firstChild:h=a.before:h=a.tags[a.tags.length-1].nextSibling,a.container.insertBefore(c,h),a.tags.push(c)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(a){a.forEach(this._insertTag)},t.insert=function(a){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(rk(this));var c=this.tags[this.tags.length-1];if(this.isSpeedy){var h=tk(c);try{h.insertRule(a,h.cssRules.length)}catch{}}else c.appendChild(document.createTextNode(a));this.ctr++},t.flush=function(){this.tags.forEach(function(a){var c;return(c=a.parentNode)==null?void 0:c.removeChild(a)}),this.tags=[],this.ctr=0},e})(),Bs="-ms-",ng="-moz-",Ri="-webkit-",pP="comm",Hb="rule",Wb="decl",ik="@import",mP="@keyframes",ok="@layer",ak=Math.abs,Ag=String.fromCharCode,sk=Object.assign;function lk(e,t){return hs(e,0)^45?(((t<<2^hs(e,0))<<2^hs(e,1))<<2^hs(e,2))<<2^hs(e,3):0}function gP(e){return e.trim()}function uk(e,t){return(e=t.exec(e))?e[0]:e}function Ni(e,t,n){return e.replace(t,n)}function tb(e,t){return e.indexOf(t)}function hs(e,t){return e.charCodeAt(t)|0}function wp(e,t,n){return e.slice(t,n)}function Gu(e){return e.length}function Zb(e){return e.length}function _m(e,t){return t.push(e),e}function ck(e,t){return e.map(t).join("")}var Pg=1,hd=1,yP=0,gl=0,Ca=0,pd="";function Ig(e,t,n,a,c,h,f){return{value:e,root:t,parent:n,type:a,props:c,children:h,line:Pg,column:hd,length:f,return:""}}function Hd(e,t){return sk(Ig("",null,null,"",null,null,0),e,{length:-e.length},t)}function hk(){return Ca}function fk(){return Ca=gl>0?hs(pd,--gl):0,hd--,Ca===10&&(hd=1,Pg--),Ca}function zl(){return Ca=gl<yP?hs(pd,gl++):0,hd++,Ca===10&&(hd=1,Pg++),Ca}function Xu(){return hs(pd,gl)}function qm(){return gl}function Np(e,t){return wp(pd,e,t)}function Sp(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function _P(e){return Pg=hd=1,yP=Gu(pd=e),gl=0,[]}function vP(e){return pd="",e}function $m(e){return gP(Np(gl-1,rb(e===91?e+2:e===40?e+1:e)))}function dk(e){for(;(Ca=Xu())&&Ca<33;)zl();return Sp(e)>2||Sp(Ca)>3?"":" "}function pk(e,t){for(;--t&&zl()&&!(Ca<48||Ca>102||Ca>57&&Ca<65||Ca>70&&Ca<97););return Np(e,qm()+(t<6&&Xu()==32&&zl()==32))}function rb(e){for(;zl();)switch(Ca){case e:return gl;case 34:case 39:e!==34&&e!==39&&rb(Ca);break;case 40:e===41&&rb(e);break;case 92:zl();break}return gl}function mk(e,t){for(;zl()&&e+Ca!==57;)if(e+Ca===84&&Xu()===47)break;return"/*"+Np(t,gl-1)+"*"+Ag(e===47?e:zl())}function gk(e){for(;!Sp(Xu());)zl();return Np(e,gl)}function yk(e){return vP(Vm("",null,null,null,[""],e=_P(e),0,[0],e))}function Vm(e,t,n,a,c,h,f,o,y){for(var v=0,S=0,P=f,M=0,E=0,O=0,N=1,z=1,U=1,ee=0,ae="",W=c,le=h,te=a,we=ae;z;)switch(O=ee,ee=zl()){case 40:if(O!=108&&hs(we,P-1)==58){tb(we+=Ni($m(ee),"&","&\f"),"&\f")!=-1&&(U=-1);break}case 34:case 39:case 91:we+=$m(ee);break;case 9:case 10:case 13:case 32:we+=dk(O);break;case 92:we+=pk(qm()-1,7);continue;case 47:switch(Xu()){case 42:case 47:_m(_k(mk(zl(),qm()),t,n),y);break;default:we+="/"}break;case 123*N:o[v++]=Gu(we)*U;case 125*N:case 59:case 0:switch(ee){case 0:case 125:z=0;case 59+S:U==-1&&(we=Ni(we,/\f/g,"")),E>0&&Gu(we)-P&&_m(E>32?g5(we+";",a,n,P-1):g5(Ni(we," ","")+";",a,n,P-2),y);break;case 59:we+=";";default:if(_m(te=m5(we,t,n,v,S,c,o,ae,W=[],le=[],P),h),ee===123)if(S===0)Vm(we,t,te,te,W,h,P,o,le);else switch(M===99&&hs(we,3)===110?100:M){case 100:case 108:case 109:case 115:Vm(e,te,te,a&&_m(m5(e,te,te,0,0,c,o,ae,c,W=[],P),le),c,le,P,o,a?W:le);break;default:Vm(we,te,te,te,[""],le,0,o,le)}}v=S=E=0,N=U=1,ae=we="",P=f;break;case 58:P=1+Gu(we),E=O;default:if(N<1){if(ee==123)--N;else if(ee==125&&N++==0&&fk()==125)continue}switch(we+=Ag(ee),ee*N){case 38:U=S>0?1:(we+="\f",-1);break;case 44:o[v++]=(Gu(we)-1)*U,U=1;break;case 64:Xu()===45&&(we+=$m(zl())),M=Xu(),S=P=Gu(ae=we+=gk(qm())),ee++;break;case 45:O===45&&Gu(we)==2&&(N=0)}}return h}function m5(e,t,n,a,c,h,f,o,y,v,S){for(var P=c-1,M=c===0?h:[""],E=Zb(M),O=0,N=0,z=0;O<a;++O)for(var U=0,ee=wp(e,P+1,P=ak(N=f[O])),ae=e;U<E;++U)(ae=gP(N>0?M[U]+" "+ee:Ni(ee,/&\f/g,M[U])))&&(y[z++]=ae);return Ig(e,t,n,c===0?Hb:o,y,v,S)}function _k(e,t,n){return Ig(e,t,n,pP,Ag(hk()),wp(e,2,-2),0)}function g5(e,t,n,a){return Ig(e,t,n,Wb,wp(e,0,a),wp(e,a+1,-1),a)}function od(e,t){for(var n="",a=Zb(e),c=0;c<a;c++)n+=t(e[c],c,e,t)||"";return n}function vk(e,t,n,a){switch(e.type){case ok:if(e.children.length)break;case ik:case Wb:return e.return=e.return||e.value;case pP:return"";case mP:return e.return=e.value+"{"+od(e.children,a)+"}";case Hb:e.value=e.props.join(",")}return Gu(n=od(e.children,a))?e.return=e.value+"{"+n+"}":""}function bk(e){var t=Zb(e);return function(n,a,c,h){for(var f="",o=0;o<t;o++)f+=e[o](n,a,c,h)||"";return f}}function xk(e){return function(t){t.root||(t=t.return)&&e(t)}}function bP(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var wk=function(t,n,a){for(var c=0,h=0;c=h,h=Xu(),c===38&&h===12&&(n[a]=1),!Sp(h);)zl();return Np(t,gl)},Sk=function(t,n){var a=-1,c=44;do switch(Sp(c)){case 0:c===38&&Xu()===12&&(n[a]=1),t[a]+=wk(gl-1,n,a);break;case 2:t[a]+=$m(c);break;case 4:if(c===44){t[++a]=Xu()===58?"&\f":"",n[a]=t[a].length;break}default:t[a]+=Ag(c)}while(c=zl());return t},Ek=function(t,n){return vP(Sk(_P(t),n))},y5=new WeakMap,Tk=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,a=t.parent,c=t.column===a.column&&t.line===a.line;a.type!=="rule";)if(a=a.parent,!a)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!y5.get(a))&&!c){y5.set(t,!0);for(var h=[],f=Ek(n,h),o=a.props,y=0,v=0;y<f.length;y++)for(var S=0;S<o.length;S++,v++)t.props[v]=h[y]?f[y].replace(/&\f/g,o[S]):o[S]+" "+f[y]}}},Ck=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function xP(e,t){switch(lk(e,t)){case 5103:return Ri+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Ri+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Ri+e+ng+e+Bs+e+e;case 6828:case 4268:return Ri+e+Bs+e+e;case 6165:return Ri+e+Bs+"flex-"+e+e;case 5187:return Ri+e+Ni(e,/(\w+).+(:[^]+)/,Ri+"box-$1$2"+Bs+"flex-$1$2")+e;case 5443:return Ri+e+Bs+"flex-item-"+Ni(e,/flex-|-self/,"")+e;case 4675:return Ri+e+Bs+"flex-line-pack"+Ni(e,/align-content|flex-|-self/,"")+e;case 5548:return Ri+e+Bs+Ni(e,"shrink","negative")+e;case 5292:return Ri+e+Bs+Ni(e,"basis","preferred-size")+e;case 6060:return Ri+"box-"+Ni(e,"-grow","")+Ri+e+Bs+Ni(e,"grow","positive")+e;case 4554:return Ri+Ni(e,/([^-])(transform)/g,"$1"+Ri+"$2")+e;case 6187:return Ni(Ni(Ni(e,/(zoom-|grab)/,Ri+"$1"),/(image-set)/,Ri+"$1"),e,"")+e;case 5495:case 3959:return Ni(e,/(image-set\([^]*)/,Ri+"$1$`$1");case 4968:return Ni(Ni(e,/(.+:)(flex-)?(.*)/,Ri+"box-pack:$3"+Bs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ri+e+e;case 4095:case 3583:case 4068:case 2532:return Ni(e,/(.+)-inline(.+)/,Ri+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Gu(e)-1-t>6)switch(hs(e,t+1)){case 109:if(hs(e,t+4)!==45)break;case 102:return Ni(e,/(.+:)(.+)-([^]+)/,"$1"+Ri+"$2-$3$1"+ng+(hs(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~tb(e,"stretch")?xP(Ni(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(hs(e,t+1)!==115)break;case 6444:switch(hs(e,Gu(e)-3-(~tb(e,"!important")&&10))){case 107:return Ni(e,":",":"+Ri)+e;case 101:return Ni(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ri+(hs(e,14)===45?"inline-":"")+"box$3$1"+Ri+"$2$3$1"+Bs+"$2box$3")+e}break;case 5936:switch(hs(e,t+11)){case 114:return Ri+e+Bs+Ni(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ri+e+Bs+Ni(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ri+e+Bs+Ni(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ri+e+Bs+e+e}return e}var Ak=function(t,n,a,c){if(t.length>-1&&!t.return)switch(t.type){case Wb:t.return=xP(t.value,t.length);break;case mP:return od([Hd(t,{value:Ni(t.value,"@","@"+Ri)})],c);case Hb:if(t.length)return ck(t.props,function(h){switch(uk(h,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return od([Hd(t,{props:[Ni(h,/:(read-\w+)/,":"+ng+"$1")]})],c);case"::placeholder":return od([Hd(t,{props:[Ni(h,/:(plac\w+)/,":"+Ri+"input-$1")]}),Hd(t,{props:[Ni(h,/:(plac\w+)/,":"+ng+"$1")]}),Hd(t,{props:[Ni(h,/:(plac\w+)/,Bs+"input-$1")]})],c)}return""})}},Pk=[Ak],Ik=function(t){var n=t.key;if(n==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(N){var z=N.getAttribute("data-emotion");z.indexOf(" ")!==-1&&(document.head.appendChild(N),N.setAttribute("data-s",""))})}var c=t.stylisPlugins||Pk,h={},f,o=[];f=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(N){for(var z=N.getAttribute("data-emotion").split(" "),U=1;U<z.length;U++)h[z[U]]=!0;o.push(N)});var y,v=[Tk,Ck];{var S,P=[vk,xk(function(N){S.insert(N)})],M=bk(v.concat(c,P)),E=function(z){return od(yk(z),M)};y=function(z,U,ee,ae){S=ee,E(z?z+"{"+U.styles+"}":U.styles),ae&&(O.inserted[U.name]=!0)}}var O={key:n,sheet:new nk({key:n,container:f,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:h,registered:{},insert:y};return O.sheet.hydrate(o),O},vm={exports:{}},zi={};/** @license React v16.13.1
771
771
  * react-is.production.min.js
772
772
  *
773
773
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -874,7 +874,7 @@ theme.transitions = createTransitions(theme.transitions || {});
874
874
 
875
875
  export default theme;`}function oS(e){return typeof e=="number"?`${(e*100).toFixed(0)}%`:`calc((${e}) * 100%)`}const _N=e=>{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let n=0;for(let a=0;a<t.length;a+=1)n+=+t[a];return n};function vN(e){Object.assign(e,{alpha(t,n){const a=this||e;return a.colorSpace?`oklch(from ${t} l c h / ${typeof n=="string"?`calc(${n})`:n})`:a.vars?`rgba(${t.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof n=="string"?`calc(${n})`:n})`:ag(t,_N(n))},lighten(t,n){const a=this||e;return a.colorSpace?`color-mix(in ${a.colorSpace}, ${t}, #fff ${oS(n)})`:$g(t,n)},darken(t,n){const a=this||e;return a.colorSpace?`color-mix(in ${a.colorSpace}, ${t}, #000 ${oS(n)})`:qg(t,n)}})}function sb(e={},...t){const{breakpoints:n,mixins:a={},spacing:c,palette:h={},transitions:f={},typography:o={},shape:y,colorSpace:v,...S}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(process.env.NODE_ENV!=="production"?"MUI: `vars` is a private field used for CSS variables support.\nPlease use another name or follow the [docs](https://mui.com/material-ui/customization/css-theme-variables/usage/) to enable the feature.":Yc(20));const P=p2({...h,colorSpace:v}),M=o2(e);let E=jl(M,{mixins:aN(M.breakpoints,a),palette:P,shadows:hN.slice(),typography:QP(P,o),transitions:mN(f),zIndex:{...gN}});if(E=jl(E,S),E=t.reduce((O,N)=>jl(O,N),E),process.env.NODE_ENV!=="production"){const O=["active","checked","completed","disabled","error","expanded","focused","focusVisible","required","selected"],N=(z,U)=>{let ee;for(ee in z){const ae=z[ee];if(O.includes(ee)&&Object.keys(ae).length>0){if(process.env.NODE_ENV!=="production"){const W=yl("",ee);console.error([`MUI: The \`${U}\` component increases the CSS specificity of the \`${ee}\` internal state.`,"You can not override it like this: ",JSON.stringify(z,null,2),"",`Instead, you need to use the '&.${W}' syntax:`,JSON.stringify({root:{[`&.${W}`]:ae}},null,2),"","https://mui.com/r/state-classes-guide"].join(`
876
876
  `))}z[ee]={}}}};Object.keys(E.components).forEach(z=>{const U=E.components[z].styleOverrides;U&&z.startsWith("Mui")&&N(U,z)})}return E.unstable_sxConfig={...Up,...S?.unstable_sxConfig},E.unstable_sx=function(N){return Xc({sx:N,theme:this})},E.toRuntimeSource=eI,vN(E),E}function lb(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const bN=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=lb(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function tI(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function rI(e){return e==="dark"?bN:[]}function xN(e){const{palette:t={mode:"light"},opacity:n,overlays:a,colorSpace:c,...h}=e,f=p2({...t,colorSpace:c});return{palette:f,opacity:{...tI(f.mode),...n},overlays:a||rI(f.mode),...h}}function wN(e){return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!e[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const SN=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],EN=e=>(t,n)=>{const a=e.rootSelector||":root",c=e.colorSchemeSelector;let h=c;if(c==="class"&&(h=".%s"),c==="data"&&(h="[data-%s]"),c?.startsWith("data-")&&!c.includes("%s")&&(h=`[${c}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const f={};return SN(e.cssVarPrefix).forEach(o=>{f[o]=n[o],delete n[o]}),h==="media"?{[a]:n,"@media (prefers-color-scheme: dark)":{[a]:f}}:h?{[h.replace("%s",t)]:f,[`${a}, ${h.replace("%s",t)}`]:n}:{[a]:{...n,...f}}}if(h&&h!=="media")return`${a}, ${h.replace("%s",String(t))}`}else if(t){if(h==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[a]:n}};if(h)return h.replace("%s",String(t))}return a};function TN(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function or(e,t,n){!e[t]&&n&&(e[t]=n)}function up(e){return typeof e!="string"||!e.startsWith("hsl")?e:$P(e)}function dc(e,t){`${t}Channel`in e||(e[`${t}Channel`]=lp(up(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
877
- To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function CN(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const qu=e=>{try{return e()}catch{}},AN=(e="mui")=>H6(e);function w0(e,t,n,a,c){if(!n)return;n=n===!0?{}:n;const h=c==="dark"?"dark":"light";if(!a){t[c]=xN({...n,palette:{mode:h,...n?.palette},colorSpace:e});return}const{palette:f,...o}=sb({...a,palette:{mode:h,...n?.palette},colorSpace:e});return t[c]={...n,palette:f,opacity:{...tI(h),...n?.opacity},overlays:n?.overlays||rI(h)},o}function PN(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:a,disableCssColorScheme:c=!1,cssVarPrefix:h="mui",nativeColor:f=!1,shouldSkipGeneratingVar:o=wN,colorSchemeSelector:y=n.light&&n.dark?"media":void 0,rootSelector:v=":root",...S}=e,P=Object.keys(n)[0],M=a||(n.light&&P!=="light"?"light":P),E=AN(h),{[M]:O,light:N,dark:z,...U}=n,ee={...U};let ae=O;if((M==="dark"&&!("dark"in n)||M==="light"&&!("light"in n))&&(ae=!0),!ae)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${M}\` option is either missing or invalid.`:Yc(21,M));let W;f&&(W="oklch");const le=w0(W,ee,ae,S,M);N&&!ee.light&&w0(W,ee,N,void 0,"light"),z&&!ee.dark&&w0(W,ee,z,void 0,"dark");let te={defaultColorScheme:M,...le,cssVarPrefix:h,colorSchemeSelector:y,rootSelector:v,getCssVar:E,colorSchemes:ee,font:{...oN(le.typography),...le.font},spacing:CN(S.spacing)};Object.keys(te.colorSchemes).forEach(re=>{const H=te.colorSchemes[re].palette,Le=Me=>{const Ze=Me.split("-"),ut=Ze[1],ke=Ze[2];return E(Me,H[ut][ke])};H.mode==="light"&&(or(H.common,"background","#fff"),or(H.common,"onBackground","#000")),H.mode==="dark"&&(or(H.common,"background","#000"),or(H.common,"onBackground","#fff"));function Pe(Me,Ze,ut){if(W){let ke;return Me===Eh&&(ke=`transparent ${((1-ut)*100).toFixed(0)}%`),Me===Zi&&(ke=`#000 ${(ut*100).toFixed(0)}%`),Me===Yi&&(ke=`#fff ${(ut*100).toFixed(0)}%`),`color-mix(in ${W}, ${Ze}, ${ke})`}return Me(Ze,ut)}if(TN(H,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),H.mode==="light"){or(H.Alert,"errorColor",Pe(Zi,H.error.light,.6)),or(H.Alert,"infoColor",Pe(Zi,H.info.light,.6)),or(H.Alert,"successColor",Pe(Zi,H.success.light,.6)),or(H.Alert,"warningColor",Pe(Zi,H.warning.light,.6)),or(H.Alert,"errorFilledBg",Le("palette-error-main")),or(H.Alert,"infoFilledBg",Le("palette-info-main")),or(H.Alert,"successFilledBg",Le("palette-success-main")),or(H.Alert,"warningFilledBg",Le("palette-warning-main")),or(H.Alert,"errorFilledColor",qu(()=>H.getContrastText(H.error.main))),or(H.Alert,"infoFilledColor",qu(()=>H.getContrastText(H.info.main))),or(H.Alert,"successFilledColor",qu(()=>H.getContrastText(H.success.main))),or(H.Alert,"warningFilledColor",qu(()=>H.getContrastText(H.warning.main))),or(H.Alert,"errorStandardBg",Pe(Yi,H.error.light,.9)),or(H.Alert,"infoStandardBg",Pe(Yi,H.info.light,.9)),or(H.Alert,"successStandardBg",Pe(Yi,H.success.light,.9)),or(H.Alert,"warningStandardBg",Pe(Yi,H.warning.light,.9)),or(H.Alert,"errorIconColor",Le("palette-error-main")),or(H.Alert,"infoIconColor",Le("palette-info-main")),or(H.Alert,"successIconColor",Le("palette-success-main")),or(H.Alert,"warningIconColor",Le("palette-warning-main")),or(H.AppBar,"defaultBg",Le("palette-grey-100")),or(H.Avatar,"defaultBg",Le("palette-grey-400")),or(H.Button,"inheritContainedBg",Le("palette-grey-300")),or(H.Button,"inheritContainedHoverBg",Le("palette-grey-A100")),or(H.Chip,"defaultBorder",Le("palette-grey-400")),or(H.Chip,"defaultAvatarColor",Le("palette-grey-700")),or(H.Chip,"defaultIconColor",Le("palette-grey-700")),or(H.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),or(H.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),or(H.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),or(H.LinearProgress,"primaryBg",Pe(Yi,H.primary.main,.62)),or(H.LinearProgress,"secondaryBg",Pe(Yi,H.secondary.main,.62)),or(H.LinearProgress,"errorBg",Pe(Yi,H.error.main,.62)),or(H.LinearProgress,"infoBg",Pe(Yi,H.info.main,.62)),or(H.LinearProgress,"successBg",Pe(Yi,H.success.main,.62)),or(H.LinearProgress,"warningBg",Pe(Yi,H.warning.main,.62)),or(H.Skeleton,"bg",W?Pe(Eh,H.text.primary,.11):`rgba(${Le("palette-text-primaryChannel")} / 0.11)`),or(H.Slider,"primaryTrack",Pe(Yi,H.primary.main,.62)),or(H.Slider,"secondaryTrack",Pe(Yi,H.secondary.main,.62)),or(H.Slider,"errorTrack",Pe(Yi,H.error.main,.62)),or(H.Slider,"infoTrack",Pe(Yi,H.info.main,.62)),or(H.Slider,"successTrack",Pe(Yi,H.success.main,.62)),or(H.Slider,"warningTrack",Pe(Yi,H.warning.main,.62));const Me=W?Pe(Zi,H.background.default,.6825):wm(H.background.default,.8);or(H.SnackbarContent,"bg",Me),or(H.SnackbarContent,"color",qu(()=>W?ab.text.primary:H.getContrastText(Me))),or(H.SpeedDialAction,"fabHoverBg",wm(H.background.paper,.15)),or(H.StepConnector,"border",Le("palette-grey-400")),or(H.StepContent,"border",Le("palette-grey-400")),or(H.Switch,"defaultColor",Le("palette-common-white")),or(H.Switch,"defaultDisabledColor",Le("palette-grey-100")),or(H.Switch,"primaryDisabledColor",Pe(Yi,H.primary.main,.62)),or(H.Switch,"secondaryDisabledColor",Pe(Yi,H.secondary.main,.62)),or(H.Switch,"errorDisabledColor",Pe(Yi,H.error.main,.62)),or(H.Switch,"infoDisabledColor",Pe(Yi,H.info.main,.62)),or(H.Switch,"successDisabledColor",Pe(Yi,H.success.main,.62)),or(H.Switch,"warningDisabledColor",Pe(Yi,H.warning.main,.62)),or(H.TableCell,"border",Pe(Yi,Pe(Eh,H.divider,1),.88)),or(H.Tooltip,"bg",Pe(Eh,H.grey[700],.92))}if(H.mode==="dark"){or(H.Alert,"errorColor",Pe(Yi,H.error.light,.6)),or(H.Alert,"infoColor",Pe(Yi,H.info.light,.6)),or(H.Alert,"successColor",Pe(Yi,H.success.light,.6)),or(H.Alert,"warningColor",Pe(Yi,H.warning.light,.6)),or(H.Alert,"errorFilledBg",Le("palette-error-dark")),or(H.Alert,"infoFilledBg",Le("palette-info-dark")),or(H.Alert,"successFilledBg",Le("palette-success-dark")),or(H.Alert,"warningFilledBg",Le("palette-warning-dark")),or(H.Alert,"errorFilledColor",qu(()=>H.getContrastText(H.error.dark))),or(H.Alert,"infoFilledColor",qu(()=>H.getContrastText(H.info.dark))),or(H.Alert,"successFilledColor",qu(()=>H.getContrastText(H.success.dark))),or(H.Alert,"warningFilledColor",qu(()=>H.getContrastText(H.warning.dark))),or(H.Alert,"errorStandardBg",Pe(Zi,H.error.light,.9)),or(H.Alert,"infoStandardBg",Pe(Zi,H.info.light,.9)),or(H.Alert,"successStandardBg",Pe(Zi,H.success.light,.9)),or(H.Alert,"warningStandardBg",Pe(Zi,H.warning.light,.9)),or(H.Alert,"errorIconColor",Le("palette-error-main")),or(H.Alert,"infoIconColor",Le("palette-info-main")),or(H.Alert,"successIconColor",Le("palette-success-main")),or(H.Alert,"warningIconColor",Le("palette-warning-main")),or(H.AppBar,"defaultBg",Le("palette-grey-900")),or(H.AppBar,"darkBg",Le("palette-background-paper")),or(H.AppBar,"darkColor",Le("palette-text-primary")),or(H.Avatar,"defaultBg",Le("palette-grey-600")),or(H.Button,"inheritContainedBg",Le("palette-grey-800")),or(H.Button,"inheritContainedHoverBg",Le("palette-grey-700")),or(H.Chip,"defaultBorder",Le("palette-grey-700")),or(H.Chip,"defaultAvatarColor",Le("palette-grey-300")),or(H.Chip,"defaultIconColor",Le("palette-grey-300")),or(H.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),or(H.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),or(H.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),or(H.LinearProgress,"primaryBg",Pe(Zi,H.primary.main,.5)),or(H.LinearProgress,"secondaryBg",Pe(Zi,H.secondary.main,.5)),or(H.LinearProgress,"errorBg",Pe(Zi,H.error.main,.5)),or(H.LinearProgress,"infoBg",Pe(Zi,H.info.main,.5)),or(H.LinearProgress,"successBg",Pe(Zi,H.success.main,.5)),or(H.LinearProgress,"warningBg",Pe(Zi,H.warning.main,.5)),or(H.Skeleton,"bg",W?Pe(Eh,H.text.primary,.13):`rgba(${Le("palette-text-primaryChannel")} / 0.13)`),or(H.Slider,"primaryTrack",Pe(Zi,H.primary.main,.5)),or(H.Slider,"secondaryTrack",Pe(Zi,H.secondary.main,.5)),or(H.Slider,"errorTrack",Pe(Zi,H.error.main,.5)),or(H.Slider,"infoTrack",Pe(Zi,H.info.main,.5)),or(H.Slider,"successTrack",Pe(Zi,H.success.main,.5)),or(H.Slider,"warningTrack",Pe(Zi,H.warning.main,.5));const Me=W?Pe(Yi,H.background.default,.985):wm(H.background.default,.98);or(H.SnackbarContent,"bg",Me),or(H.SnackbarContent,"color",qu(()=>W?KP.text.primary:H.getContrastText(Me))),or(H.SpeedDialAction,"fabHoverBg",wm(H.background.paper,.15)),or(H.StepConnector,"border",Le("palette-grey-600")),or(H.StepContent,"border",Le("palette-grey-600")),or(H.Switch,"defaultColor",Le("palette-grey-300")),or(H.Switch,"defaultDisabledColor",Le("palette-grey-600")),or(H.Switch,"primaryDisabledColor",Pe(Zi,H.primary.main,.55)),or(H.Switch,"secondaryDisabledColor",Pe(Zi,H.secondary.main,.55)),or(H.Switch,"errorDisabledColor",Pe(Zi,H.error.main,.55)),or(H.Switch,"infoDisabledColor",Pe(Zi,H.info.main,.55)),or(H.Switch,"successDisabledColor",Pe(Zi,H.success.main,.55)),or(H.Switch,"warningDisabledColor",Pe(Zi,H.warning.main,.55)),or(H.TableCell,"border",Pe(Zi,Pe(Eh,H.divider,1),.68)),or(H.Tooltip,"bg",Pe(Eh,H.grey[700],.92))}dc(H.background,"default"),dc(H.background,"paper"),dc(H.common,"background"),dc(H.common,"onBackground"),dc(H,"divider"),Object.keys(H).forEach(Me=>{const Ze=H[Me];Me!=="tonalOffset"&&Ze&&typeof Ze=="object"&&(Ze.main&&or(H[Me],"mainChannel",lp(up(Ze.main))),Ze.light&&or(H[Me],"lightChannel",lp(up(Ze.light))),Ze.dark&&or(H[Me],"darkChannel",lp(up(Ze.dark))),Ze.contrastText&&or(H[Me],"contrastTextChannel",lp(up(Ze.contrastText))),Me==="text"&&(dc(H[Me],"primary"),dc(H[Me],"secondary")),Me==="action"&&(Ze.active&&dc(H[Me],"active"),Ze.selected&&dc(H[Me],"selected")))})}),te=t.reduce((re,H)=>jl(re,H),te);const we={prefix:h,disableCssColorScheme:c,shouldSkipGeneratingVar:o,getSelector:EN(te),enableContrastVars:f},{vars:Te,generateThemeVars:me,generateStyleSheets:Ve}=Y6(te,we);return te.vars=Te,Object.entries(te.colorSchemes[te.defaultColorScheme]).forEach(([re,H])=>{te[re]=H}),te.generateThemeVars=me,te.generateStyleSheets=Ve,te.generateSpacing=function(){return LP(S.spacing,n2(this))},te.getColorSchemeSelector=X6(y),te.spacing=te.generateSpacing(),te.shouldSkipGeneratingVar=o,te.unstable_sxConfig={...Up,...S?.unstable_sxConfig},te.unstable_sx=function(H){return Xc({sx:H,theme:this})},te.toRuntimeSource=eI,te}function aS(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:p2({...n===!0?{}:n.palette,mode:t})})}function gd(e={},...t){const{palette:n,cssVariables:a=!1,colorSchemes:c=n?void 0:{light:!0},defaultColorScheme:h=n?.mode,...f}=e,o=h||"light",y=c?.[o],v={...c,...n?{[o]:{...typeof y!="boolean"&&y,palette:n}}:void 0};if(a===!1){if(!("colorSchemes"in e))return sb(e,...t);let S=n;"palette"in e||v[o]&&(v[o]!==!0?S=v[o].palette:o==="dark"&&(S={mode:"dark"}));const P=sb({...e,palette:S},...t);return P.defaultColorScheme=o,P.colorSchemes=v,P.palette.mode==="light"&&(P.colorSchemes.light={...v.light!==!0&&v.light,palette:P.palette},aS(P,"dark",v.dark)),P.palette.mode==="dark"&&(P.colorSchemes.dark={...v.dark!==!0&&v.dark,palette:P.palette},aS(P,"light",v.light)),P}return!n&&!("light"in v)&&o==="light"&&(v.light=!0),PN({...f,colorSchemes:v,defaultColorScheme:o,...typeof a!="boolean"&&a},...t)}const nI=gd();function IN(){const e=a2(nI);return process.env.NODE_ENV!=="production"&&Qt.useDebugValue(e),e[Yu]||e}function MN(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Vg=e=>MN(e)&&e!=="classes",Rn=zP({themeId:Yu,defaultTheme:nI,rootShouldForwardProp:Vg});function LN({theme:e,...t}){const n=Yu in e?e[Yu]:void 0;return Pr.jsx(Cp,{...t,themeId:n?Yu:void 0,theme:n||e})}const Sm={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"};process.env.NODE_ENV!=="production"&&(ne.string,ne.string,ne.string,ne.string,ne.string,ne.oneOf(["dark","light","system"]),ne.string,ne.string);const{CssVarsProvider:DN}=G6({themeId:Yu,theme:()=>gd({cssVariables:!0}),colorSchemeStorageKey:Sm.colorSchemeStorageKey,modeStorageKey:Sm.modeStorageKey,defaultColorScheme:{light:Sm.defaultLightColorScheme,dark:Sm.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:QP(e.palette,e.typography)};return t.unstable_sx=function(a){return Xc({sx:a,theme:this})},t}}),kN=DN;function RN({theme:e,...t}){const n=Qt.useMemo(()=>{if(typeof e=="function")return e;const a=Yu in e?e[Yu]:e;return"colorSchemes"in a?null:"vars"in a?e:{...e,vars:null}},[e]);return n?Pr.jsx(LN,{theme:n,...t}):Pr.jsx(kN,{theme:e,...t})}const NN=gd({palette:{mode:"light"}});gd({palette:{mode:"dark"}});const ON=e=>({...NN,palette:{mode:e,primary:{main:"#009EE0"},secondary:{main:"#747577"},text:{primary:"#000",contrast:"#fff"},topToolbar:{barColor:"#fff"},navigation:{buttonColor:"#747577",navColor:"#fff",navHover:"#f5f5f5"},GPS:{GPSActiveColor:"#009EE0",GPSInactiveColor:"#747577",GPSActiveBackgroundColor:"#fff"},compass:{compColor:"#fff",compHover:"#f5f5f5",compStroke:"#009ee0",compNorth:"#cf003f",compSouth:"#d3dcf0"}}}),FN=e=>{const t=ON(["light","dark"].includes(e)?e:"light");return gd(t,{components:{MuiTypography:{styleOverrides:{root:{}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:t.palette.topToolbar.barColor}}},MuiButton:{variants:[{props:{variant:"navtools"},style:{minWidth:"20px",minHeight:"20px",fontWeight:600,[t.breakpoints.down("md")]:{width:"50px",height:"50px",fontSize:"1.4em"},[t.breakpoints.up("md")]:{width:"30px",height:"30px",fontSize:"1.2em"},color:t.palette.text.primary,backgroundColor:t.palette.navigation.navColor,borderRadius:"23%",margin:"0.15px",marginTop:"4px",":hover":{backgroundColor:t.palette.navigation.navHover}}}]},MuiListItemText:{styleOverrides:{primary:({ownerState:n})=>n?.variant==="layerlist"?{fontSize:"0.9rem"}:{},secondary:({ownerState:n})=>n?.variant==="layerlist"?{fontSize:"0.7rem"}:{}}}}})},BN={sourceOptions_tiles:["https://wms.wheregroup.com/tileserver/tile/world-0-14/{z}/{x}/{y}.pbf"]},us=[];for(let e=0;e<256;++e)us.push((e+256).toString(16).slice(1));function zN(e,t=0){return(us[e[t+0]]+us[e[t+1]]+us[e[t+2]]+us[e[t+3]]+"-"+us[e[t+4]]+us[e[t+5]]+"-"+us[e[t+6]]+us[e[t+7]]+"-"+us[e[t+8]]+us[e[t+9]]+"-"+us[e[t+10]]+us[e[t+11]]+us[e[t+12]]+us[e[t+13]]+us[e[t+14]]+us[e[t+15]]).toLowerCase()}let S0;const jN=new Uint8Array(16);function UN(){if(!S0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");S0=crypto.getRandomValues.bind(crypto)}return S0(jN)}const qN=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sS={randomUUID:qN};function Pp(e,t,n){if(sS.randomUUID&&!e)return sS.randomUUID();e=e||{};const a=e.random??e.rng?.()??UN();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,zN(a)}const $N=_e.createContext({});function VN(e){const[t,n]=_e.useState([]),[a,c]=_e.useState([]),[h,f]=_e.useState([]),[o,y]=_e.useState(BN.sourceOptions_tiles[0]),v=_e.useMemo(()=>({layerId:"openmaptiles",sourceOptions:{type:"vector",tiles:[o]}}),[o]),S=N=>{if(!N)return;const z=[],U=[];N.layers.forEach((ee,ae)=>{ee.type==="symbol"?U.push(ee):(ae===0&&(ee.id=N.name||"background"),z.push(ee))}),c(z),f(U)};_e.useEffect(()=>{if(t.filter(N=>!N?.id).length){const N=[...t];N.forEach(z=>{z?.id||(z.id=Pp())}),n(N)}},[t]);const P=_e.useCallback((N,z)=>{const U=t?.filter?.(ee=>ee.id===N);if(U.length>0){const ee=[...t],ae=U[0],W=t.indexOf(ae),le=z(W);le>=0&&le<=t.length-1&&(ee.splice(W,1),ee.splice(le,0,ae),n(ee))}},[t]),M=_e.useCallback(N=>{P(N,z=>z+1)},[P]),E=_e.useCallback(N=>{P(N,z=>z-1)},[P]),O={layers:t,setLayers:n,backgroundLayers:a,setBackgroundLayers:c,symbolLayers:h,setSymbolLayers:f,updateStyle:S,vtLayerConfig:v,tileUrl:o,setTileUrl:y,moveUp:E,moveDown:M,moveLayer:P};return Pr.jsx($N.Provider,{value:O,children:e.children})}const Gg=_e.createContext({}),iI=({children:e})=>{const[t,n]=_e.useState(void 0),[a,c]=_e.useState([]),h=_e.useRef([]),f=_e.useRef({}),o=S=>{if(S){typeof f.current[S]<"u"&&delete f.current[S];const P=h.current.indexOf(S);P>-1&&h.current.splice(P,1),c([...h.current]),h.current.length===0&&t&&n(void 0)}else o("anonymous_map")},v={map:t,setMap:S=>{if(n(S),a.length===0){const P="anonymous_map";c([...a,P]),f.current[P]=S}},maps:f.current,mapIds:a,registerMap:(S,P)=>{S&&P&&(f.current[S]=P,h.current.push(S),c([...h.current]),(!t||t?.cancelled===!0)&&n(P))},removeMap:o,mapExists:S=>S&&Object.keys(f.current).indexOf(S)===-1?!1:!(!S&&!t),getMap:S=>S&&a.indexOf(S)!==-1?f.current[S]:!S&&t?t:null};return Pr.jsx(Gg.Provider,{value:v,children:Pr.jsx(VN,{children:Pr.jsx(RN,{theme:FN("light"),children:e})})})},oI={mapId:void 0,options:{center:{lng:8.607,lat:53.1409349},zoom:11,container:"",style:{version:8,name:"blank",center:[0,0],zoom:0,sources:{},sprite:"https://wms.wheregroup.com/tileserver/sprites/osm-bright",glyphs:"https://wms.wheregroup.com/tileserver/fonts/{fontstack}/{range}.pbf",layers:[{id:"_background",type:"background",paint:{"background-color":"rgba(0,0,0,0)"}}]}}},m2=e=>{const t=_e.useRef(null),n=_e.useRef(null),a=_e.useContext(Gg),c=_e.useRef(e.mapId),h=_e.useRef(!1),f=_e.useRef(e.options?.style);return _e.useEffect(()=>{const o=c.current;return()=>{h.current=!1,a.removeMap(o),t.current&&(t.current.map?.remove?.(),t.current.cancelled=!0,t.current=null)}},[]),_e.useEffect(()=>{h.current||n.current&&(h.current=!0,t.current=new ek({mapOptions:{style:"",...e.options,...e?.options?.style?{}:{style:oI?.options?.style},container:n.current},onReady:(o,y)=>{o.once("load",()=>{y?.cancelled?o.remove():(window._map=o,e.mapId?a.registerMap(e.mapId,y):a.setMap(y))})}}))},[e.options,e.mapId]),_e.useEffect(()=>{t.current?.map&&e?.options?.style&&f.current!==e.options.style&&(f.current=e.options.style,t.current.map.setStyle(e.options.style))},[e?.options?.style]),Pr.jsx("div",{ref:n,className:"mapContainer",style:e.style})};m2.defaultProps=oI;function aI(e){const t=_e.useContext(Gg),n=_e.useRef(!1),a=_e.useRef(null),[c,h]=_e.useState(),f=_e.useRef(void 0),[o,y]=_e.useState([]),v=_e.useRef(""),S=_e.useRef(Pp()),P=_e.useCallback(E=>!e?.filter?.includeBaseLayers&&E?.baseLayer?!1:typeof e.filter?.matchLayerIds<"u"?e.filter.matchLayerIds instanceof RegExp?e.filter.matchLayerIds.test(E.id):E.id.includes(e.filter.matchLayerIds):!0,[e.filter]),M=_e.useCallback(()=>{if(!a.current)return;const E=a.current.wrapper.layerState.filter(P),O=JSON.stringify(E);v.current!==O&&(v.current=O,y(E))},[P]);return _e.useEffect(()=>{const E=S.current;return()=>{a.current&&(a.current.cleanup(E),a.current=null),n.current=!1}},[]),_e.useEffect(()=>{if(!(!t.mapExists(e.mapId)||n.current)){if(n.current=!0,a.current=t.getMap(e.mapId),!a.current){n.current=!1;return}e?.watch?.viewport&&(h(a.current.wrapper.viewportState),a.current.wrapper.on("viewportchange",()=>{f.current!==a.current?.wrapper.viewportStateString&&h(a.current?.wrapper.viewportState)},S.current)),e?.watch?.layers&&(M(),a.current.wrapper.on("layerchange",M,{includeBaseLayers:e?.filter?.includeBaseLayers,matchLayerIds:e?.filter?.matchLayerIds},S.current))}},[t.mapIds,t,e.mapId,M,e]),{layers:o,viewport:c}}aI.defaultProps={mapId:void 0,watch:{layers:!0,sources:!1,viewport:!1},filter:{includeBaseLayers:!1}};function qp(e){const t=_e.useContext(Gg),[n,a]=_e.useState({map:void 0,ready:!1}),c=aI({mapId:e?.mapId,watch:{viewport:!1,layers:!!e?.waitForLayer,sources:!1},filter:{includeBaseLayers:!0}}),h=_e.useRef(null),f=_e.useRef(Pp()),o=()=>{h.current&&h.current.cleanup(f.current)};return _e.useEffect(()=>()=>{o(),h.current=null},[]),_e.useEffect(()=>{if(h.current&&h.current.cancelled===!0&&(h.current=null,a({map:void 0,ready:!1})),!(h.current||!t.mapExists(e?.mapId))){if(e?.waitForLayer){let y=!1;if(c?.layers?.forEach(v=>{v.id===e?.waitForLayer&&(y=!0)}),!y)return}h.current=t.getMap(e?.mapId),a({map:h.current,ready:!0})}},[t.mapIds,c.layers,t,e]),{map:n.map,mapIsReady:n.ready,componentId:f.current,layers:c.layers,cleanup:o}}const Ju=F6;process.env.NODE_ENV!=="production"&&(ne.node,ne.object.isRequired);function tu(e){return k6(e)}function GN(e){return yl("MuiSvgIcon",e)}zs("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const HN=e=>{const{color:t,fontSize:n,classes:a}=e,c={root:["root",t!=="inherit"&&`color${Ei(t)}`,`fontSize${Ei(n)}`]};return eu(c,GN,a)},WN=Rn("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ei(n.color)}`],t[`fontSize${Ei(n.fontSize)}`]]}})(Ju(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),lg=Qt.forwardRef(function(t,n){const a=tu({props:t,name:"MuiSvgIcon"}),{children:c,className:h,color:f="inherit",component:o="svg",fontSize:y="medium",htmlColor:v,inheritViewBox:S=!1,titleAccess:P,viewBox:M="0 0 24 24",...E}=a,O=Qt.isValidElement(c)&&c.type==="svg",N={...a,color:f,component:o,fontSize:y,instanceFontSize:t.fontSize,inheritViewBox:S,viewBox:M,hasSvgAsChild:O},z={};S||(z.viewBox=M);const U=HN(N);return Pr.jsxs(WN,{as:o,className:ro(U.root,h),focusable:"false",color:v,"aria-hidden":P?void 0:!0,role:P?"img":void 0,ref:n,...z,...E,...O&&c.props,ownerState:N,children:[O?c.props.children:c,P?Pr.jsx("title",{children:P}):null]})});process.env.NODE_ENV!=="production"&&(lg.propTypes={children:ne.node,classes:ne.object,className:ne.string,color:ne.oneOfType([ne.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ne.string]),component:ne.elementType,fontSize:ne.oneOfType([ne.oneOf(["inherit","large","medium","small"]),ne.string]),htmlColor:ne.string,inheritViewBox:ne.bool,shapeRendering:ne.string,sx:ne.oneOfType([ne.arrayOf(ne.oneOfType([ne.func,ne.object,ne.bool])),ne.func,ne.object]),titleAccess:ne.string,viewBox:ne.string});lg.muiName="SvgIcon";function g2(e,t){function n(a,c){return Pr.jsx(lg,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:c,...a,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=lg.muiName,Qt.memo(Qt.forwardRef(n))}function ZN(e){const{controlled:t,default:n,name:a,state:c="value"}=e,{current:h}=Qt.useRef(t!==void 0),[f,o]=Qt.useState(n),y=h?t:f;if(process.env.NODE_ENV!=="production"){Qt.useEffect(()=>{h!==(t!==void 0)&&console.error([`MUI: A component is changing the ${h?"":"un"}controlled ${c} state of ${a} to be ${h?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${a} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
877
+ To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function CN(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const qu=e=>{try{return e()}catch{}},AN=(e="mui")=>H6(e);function w0(e,t,n,a,c){if(!n)return;n=n===!0?{}:n;const h=c==="dark"?"dark":"light";if(!a){t[c]=xN({...n,palette:{mode:h,...n?.palette},colorSpace:e});return}const{palette:f,...o}=sb({...a,palette:{mode:h,...n?.palette},colorSpace:e});return t[c]={...n,palette:f,opacity:{...tI(h),...n?.opacity},overlays:n?.overlays||rI(h)},o}function PN(e={},...t){const{colorSchemes:n={light:!0},defaultColorScheme:a,disableCssColorScheme:c=!1,cssVarPrefix:h="mui",nativeColor:f=!1,shouldSkipGeneratingVar:o=wN,colorSchemeSelector:y=n.light&&n.dark?"media":void 0,rootSelector:v=":root",...S}=e,P=Object.keys(n)[0],M=a||(n.light&&P!=="light"?"light":P),E=AN(h),{[M]:O,light:N,dark:z,...U}=n,ee={...U};let ae=O;if((M==="dark"&&!("dark"in n)||M==="light"&&!("light"in n))&&(ae=!0),!ae)throw new Error(process.env.NODE_ENV!=="production"?`MUI: The \`colorSchemes.${M}\` option is either missing or invalid.`:Yc(21,M));let W;f&&(W="oklch");const le=w0(W,ee,ae,S,M);N&&!ee.light&&w0(W,ee,N,void 0,"light"),z&&!ee.dark&&w0(W,ee,z,void 0,"dark");let te={defaultColorScheme:M,...le,cssVarPrefix:h,colorSchemeSelector:y,rootSelector:v,getCssVar:E,colorSchemes:ee,font:{...oN(le.typography),...le.font},spacing:CN(S.spacing)};Object.keys(te.colorSchemes).forEach(re=>{const H=te.colorSchemes[re].palette,Le=Me=>{const Ze=Me.split("-"),ut=Ze[1],ke=Ze[2];return E(Me,H[ut][ke])};H.mode==="light"&&(or(H.common,"background","#fff"),or(H.common,"onBackground","#000")),H.mode==="dark"&&(or(H.common,"background","#000"),or(H.common,"onBackground","#fff"));function Pe(Me,Ze,ut){if(W){let ke;return Me===Eh&&(ke=`transparent ${((1-ut)*100).toFixed(0)}%`),Me===Zi&&(ke=`#000 ${(ut*100).toFixed(0)}%`),Me===Yi&&(ke=`#fff ${(ut*100).toFixed(0)}%`),`color-mix(in ${W}, ${Ze}, ${ke})`}return Me(Ze,ut)}if(TN(H,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),H.mode==="light"){or(H.Alert,"errorColor",Pe(Zi,H.error.light,.6)),or(H.Alert,"infoColor",Pe(Zi,H.info.light,.6)),or(H.Alert,"successColor",Pe(Zi,H.success.light,.6)),or(H.Alert,"warningColor",Pe(Zi,H.warning.light,.6)),or(H.Alert,"errorFilledBg",Le("palette-error-main")),or(H.Alert,"infoFilledBg",Le("palette-info-main")),or(H.Alert,"successFilledBg",Le("palette-success-main")),or(H.Alert,"warningFilledBg",Le("palette-warning-main")),or(H.Alert,"errorFilledColor",qu(()=>H.getContrastText(H.error.main))),or(H.Alert,"infoFilledColor",qu(()=>H.getContrastText(H.info.main))),or(H.Alert,"successFilledColor",qu(()=>H.getContrastText(H.success.main))),or(H.Alert,"warningFilledColor",qu(()=>H.getContrastText(H.warning.main))),or(H.Alert,"errorStandardBg",Pe(Yi,H.error.light,.9)),or(H.Alert,"infoStandardBg",Pe(Yi,H.info.light,.9)),or(H.Alert,"successStandardBg",Pe(Yi,H.success.light,.9)),or(H.Alert,"warningStandardBg",Pe(Yi,H.warning.light,.9)),or(H.Alert,"errorIconColor",Le("palette-error-main")),or(H.Alert,"infoIconColor",Le("palette-info-main")),or(H.Alert,"successIconColor",Le("palette-success-main")),or(H.Alert,"warningIconColor",Le("palette-warning-main")),or(H.AppBar,"defaultBg",Le("palette-grey-100")),or(H.Avatar,"defaultBg",Le("palette-grey-400")),or(H.Button,"inheritContainedBg",Le("palette-grey-300")),or(H.Button,"inheritContainedHoverBg",Le("palette-grey-A100")),or(H.Chip,"defaultBorder",Le("palette-grey-400")),or(H.Chip,"defaultAvatarColor",Le("palette-grey-700")),or(H.Chip,"defaultIconColor",Le("palette-grey-700")),or(H.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),or(H.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),or(H.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),or(H.LinearProgress,"primaryBg",Pe(Yi,H.primary.main,.62)),or(H.LinearProgress,"secondaryBg",Pe(Yi,H.secondary.main,.62)),or(H.LinearProgress,"errorBg",Pe(Yi,H.error.main,.62)),or(H.LinearProgress,"infoBg",Pe(Yi,H.info.main,.62)),or(H.LinearProgress,"successBg",Pe(Yi,H.success.main,.62)),or(H.LinearProgress,"warningBg",Pe(Yi,H.warning.main,.62)),or(H.Skeleton,"bg",W?Pe(Eh,H.text.primary,.11):`rgba(${Le("palette-text-primaryChannel")} / 0.11)`),or(H.Slider,"primaryTrack",Pe(Yi,H.primary.main,.62)),or(H.Slider,"secondaryTrack",Pe(Yi,H.secondary.main,.62)),or(H.Slider,"errorTrack",Pe(Yi,H.error.main,.62)),or(H.Slider,"infoTrack",Pe(Yi,H.info.main,.62)),or(H.Slider,"successTrack",Pe(Yi,H.success.main,.62)),or(H.Slider,"warningTrack",Pe(Yi,H.warning.main,.62));const Me=W?Pe(Zi,H.background.default,.6825):wm(H.background.default,.8);or(H.SnackbarContent,"bg",Me),or(H.SnackbarContent,"color",qu(()=>W?ab.text.primary:H.getContrastText(Me))),or(H.SpeedDialAction,"fabHoverBg",wm(H.background.paper,.15)),or(H.StepConnector,"border",Le("palette-grey-400")),or(H.StepContent,"border",Le("palette-grey-400")),or(H.Switch,"defaultColor",Le("palette-common-white")),or(H.Switch,"defaultDisabledColor",Le("palette-grey-100")),or(H.Switch,"primaryDisabledColor",Pe(Yi,H.primary.main,.62)),or(H.Switch,"secondaryDisabledColor",Pe(Yi,H.secondary.main,.62)),or(H.Switch,"errorDisabledColor",Pe(Yi,H.error.main,.62)),or(H.Switch,"infoDisabledColor",Pe(Yi,H.info.main,.62)),or(H.Switch,"successDisabledColor",Pe(Yi,H.success.main,.62)),or(H.Switch,"warningDisabledColor",Pe(Yi,H.warning.main,.62)),or(H.TableCell,"border",Pe(Yi,Pe(Eh,H.divider,1),.88)),or(H.Tooltip,"bg",Pe(Eh,H.grey[700],.92))}if(H.mode==="dark"){or(H.Alert,"errorColor",Pe(Yi,H.error.light,.6)),or(H.Alert,"infoColor",Pe(Yi,H.info.light,.6)),or(H.Alert,"successColor",Pe(Yi,H.success.light,.6)),or(H.Alert,"warningColor",Pe(Yi,H.warning.light,.6)),or(H.Alert,"errorFilledBg",Le("palette-error-dark")),or(H.Alert,"infoFilledBg",Le("palette-info-dark")),or(H.Alert,"successFilledBg",Le("palette-success-dark")),or(H.Alert,"warningFilledBg",Le("palette-warning-dark")),or(H.Alert,"errorFilledColor",qu(()=>H.getContrastText(H.error.dark))),or(H.Alert,"infoFilledColor",qu(()=>H.getContrastText(H.info.dark))),or(H.Alert,"successFilledColor",qu(()=>H.getContrastText(H.success.dark))),or(H.Alert,"warningFilledColor",qu(()=>H.getContrastText(H.warning.dark))),or(H.Alert,"errorStandardBg",Pe(Zi,H.error.light,.9)),or(H.Alert,"infoStandardBg",Pe(Zi,H.info.light,.9)),or(H.Alert,"successStandardBg",Pe(Zi,H.success.light,.9)),or(H.Alert,"warningStandardBg",Pe(Zi,H.warning.light,.9)),or(H.Alert,"errorIconColor",Le("palette-error-main")),or(H.Alert,"infoIconColor",Le("palette-info-main")),or(H.Alert,"successIconColor",Le("palette-success-main")),or(H.Alert,"warningIconColor",Le("palette-warning-main")),or(H.AppBar,"defaultBg",Le("palette-grey-900")),or(H.AppBar,"darkBg",Le("palette-background-paper")),or(H.AppBar,"darkColor",Le("palette-text-primary")),or(H.Avatar,"defaultBg",Le("palette-grey-600")),or(H.Button,"inheritContainedBg",Le("palette-grey-800")),or(H.Button,"inheritContainedHoverBg",Le("palette-grey-700")),or(H.Chip,"defaultBorder",Le("palette-grey-700")),or(H.Chip,"defaultAvatarColor",Le("palette-grey-300")),or(H.Chip,"defaultIconColor",Le("palette-grey-300")),or(H.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),or(H.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),or(H.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),or(H.LinearProgress,"primaryBg",Pe(Zi,H.primary.main,.5)),or(H.LinearProgress,"secondaryBg",Pe(Zi,H.secondary.main,.5)),or(H.LinearProgress,"errorBg",Pe(Zi,H.error.main,.5)),or(H.LinearProgress,"infoBg",Pe(Zi,H.info.main,.5)),or(H.LinearProgress,"successBg",Pe(Zi,H.success.main,.5)),or(H.LinearProgress,"warningBg",Pe(Zi,H.warning.main,.5)),or(H.Skeleton,"bg",W?Pe(Eh,H.text.primary,.13):`rgba(${Le("palette-text-primaryChannel")} / 0.13)`),or(H.Slider,"primaryTrack",Pe(Zi,H.primary.main,.5)),or(H.Slider,"secondaryTrack",Pe(Zi,H.secondary.main,.5)),or(H.Slider,"errorTrack",Pe(Zi,H.error.main,.5)),or(H.Slider,"infoTrack",Pe(Zi,H.info.main,.5)),or(H.Slider,"successTrack",Pe(Zi,H.success.main,.5)),or(H.Slider,"warningTrack",Pe(Zi,H.warning.main,.5));const Me=W?Pe(Yi,H.background.default,.985):wm(H.background.default,.98);or(H.SnackbarContent,"bg",Me),or(H.SnackbarContent,"color",qu(()=>W?KP.text.primary:H.getContrastText(Me))),or(H.SpeedDialAction,"fabHoverBg",wm(H.background.paper,.15)),or(H.StepConnector,"border",Le("palette-grey-600")),or(H.StepContent,"border",Le("palette-grey-600")),or(H.Switch,"defaultColor",Le("palette-grey-300")),or(H.Switch,"defaultDisabledColor",Le("palette-grey-600")),or(H.Switch,"primaryDisabledColor",Pe(Zi,H.primary.main,.55)),or(H.Switch,"secondaryDisabledColor",Pe(Zi,H.secondary.main,.55)),or(H.Switch,"errorDisabledColor",Pe(Zi,H.error.main,.55)),or(H.Switch,"infoDisabledColor",Pe(Zi,H.info.main,.55)),or(H.Switch,"successDisabledColor",Pe(Zi,H.success.main,.55)),or(H.Switch,"warningDisabledColor",Pe(Zi,H.warning.main,.55)),or(H.TableCell,"border",Pe(Zi,Pe(Eh,H.divider,1),.68)),or(H.Tooltip,"bg",Pe(Eh,H.grey[700],.92))}dc(H.background,"default"),dc(H.background,"paper"),dc(H.common,"background"),dc(H.common,"onBackground"),dc(H,"divider"),Object.keys(H).forEach(Me=>{const Ze=H[Me];Me!=="tonalOffset"&&Ze&&typeof Ze=="object"&&(Ze.main&&or(H[Me],"mainChannel",lp(up(Ze.main))),Ze.light&&or(H[Me],"lightChannel",lp(up(Ze.light))),Ze.dark&&or(H[Me],"darkChannel",lp(up(Ze.dark))),Ze.contrastText&&or(H[Me],"contrastTextChannel",lp(up(Ze.contrastText))),Me==="text"&&(dc(H[Me],"primary"),dc(H[Me],"secondary")),Me==="action"&&(Ze.active&&dc(H[Me],"active"),Ze.selected&&dc(H[Me],"selected")))})}),te=t.reduce((re,H)=>jl(re,H),te);const we={prefix:h,disableCssColorScheme:c,shouldSkipGeneratingVar:o,getSelector:EN(te),enableContrastVars:f},{vars:Te,generateThemeVars:me,generateStyleSheets:Ve}=Y6(te,we);return te.vars=Te,Object.entries(te.colorSchemes[te.defaultColorScheme]).forEach(([re,H])=>{te[re]=H}),te.generateThemeVars=me,te.generateStyleSheets=Ve,te.generateSpacing=function(){return LP(S.spacing,n2(this))},te.getColorSchemeSelector=X6(y),te.spacing=te.generateSpacing(),te.shouldSkipGeneratingVar=o,te.unstable_sxConfig={...Up,...S?.unstable_sxConfig},te.unstable_sx=function(H){return Xc({sx:H,theme:this})},te.toRuntimeSource=eI,te}function aS(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]={...n!==!0&&n,palette:p2({...n===!0?{}:n.palette,mode:t})})}function gd(e={},...t){const{palette:n,cssVariables:a=!1,colorSchemes:c=n?void 0:{light:!0},defaultColorScheme:h=n?.mode,...f}=e,o=h||"light",y=c?.[o],v={...c,...n?{[o]:{...typeof y!="boolean"&&y,palette:n}}:void 0};if(a===!1){if(!("colorSchemes"in e))return sb(e,...t);let S=n;"palette"in e||v[o]&&(v[o]!==!0?S=v[o].palette:o==="dark"&&(S={mode:"dark"}));const P=sb({...e,palette:S},...t);return P.defaultColorScheme=o,P.colorSchemes=v,P.palette.mode==="light"&&(P.colorSchemes.light={...v.light!==!0&&v.light,palette:P.palette},aS(P,"dark",v.dark)),P.palette.mode==="dark"&&(P.colorSchemes.dark={...v.dark!==!0&&v.dark,palette:P.palette},aS(P,"light",v.light)),P}return!n&&!("light"in v)&&o==="light"&&(v.light=!0),PN({...f,colorSchemes:v,defaultColorScheme:o,...typeof a!="boolean"&&a},...t)}const nI=gd();function IN(){const e=a2(nI);return process.env.NODE_ENV!=="production"&&Qt.useDebugValue(e),e[Yu]||e}function MN(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Vg=e=>MN(e)&&e!=="classes",Rn=zP({themeId:Yu,defaultTheme:nI,rootShouldForwardProp:Vg});function LN({theme:e,...t}){const n=Yu in e?e[Yu]:void 0;return Pr.jsx(Cp,{...t,themeId:n?Yu:void 0,theme:n||e})}const Sm={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"};process.env.NODE_ENV!=="production"&&(ne.string,ne.string,ne.string,ne.string,ne.string,ne.oneOf(["dark","light","system"]),ne.string,ne.string);const{CssVarsProvider:DN}=G6({themeId:Yu,theme:()=>gd({cssVariables:!0}),colorSchemeStorageKey:Sm.colorSchemeStorageKey,modeStorageKey:Sm.modeStorageKey,defaultColorScheme:{light:Sm.defaultLightColorScheme,dark:Sm.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:QP(e.palette,e.typography)};return t.unstable_sx=function(a){return Xc({sx:a,theme:this})},t}}),kN=DN;function RN({theme:e,...t}){const n=Qt.useMemo(()=>{if(typeof e=="function")return e;const a=Yu in e?e[Yu]:e;return"colorSchemes"in a?null:"vars"in a?e:{...e,vars:null}},[e]);return n?Pr.jsx(LN,{theme:n,...t}):Pr.jsx(kN,{theme:e,...t})}const NN=gd({palette:{mode:"light"}});gd({palette:{mode:"dark"}});const ON=e=>({...NN,palette:{mode:e,primary:{main:"#009EE0"},secondary:{main:"#747577"},text:{primary:"#000",contrast:"#fff"},topToolbar:{barColor:"#fff"},navigation:{buttonColor:"#747577",navColor:"#fff",navHover:"#f5f5f5"},GPS:{GPSActiveColor:"#009EE0",GPSInactiveColor:"#747577",GPSActiveBackgroundColor:"#fff"},compass:{compColor:"#fff",compHover:"#f5f5f5",compStroke:"#009ee0",compNorth:"#cf003f",compSouth:"#d3dcf0"}}}),FN=e=>{const t=ON(["light","dark"].includes(e)?e:"light");return gd(t,{components:{MuiTypography:{styleOverrides:{root:{}}},MuiAppBar:{styleOverrides:{root:{backgroundColor:t.palette.topToolbar.barColor}}},MuiButton:{variants:[{props:{variant:"navtools"},style:{minWidth:"20px",minHeight:"20px",fontWeight:600,[t.breakpoints.down("md")]:{width:"50px",height:"50px",fontSize:"1.4em"},[t.breakpoints.up("md")]:{width:"30px",height:"30px",fontSize:"1.2em"},color:t.palette.text.primary,backgroundColor:t.palette.navigation.navColor,borderRadius:"23%",margin:"0.15px",marginTop:"4px",":hover":{backgroundColor:t.palette.navigation.navHover}}}]},MuiListItemText:{styleOverrides:{primary:({ownerState:n})=>n?.variant==="layerlist"?{fontSize:"0.9rem"}:{},secondary:({ownerState:n})=>n?.variant==="layerlist"?{fontSize:"0.7rem"}:{}}}}})},BN={sourceOptions_tiles:["https://wms.wheregroup.com/tileserver/tile/world-0-14/{z}/{x}/{y}.pbf"]},us=[];for(let e=0;e<256;++e)us.push((e+256).toString(16).slice(1));function zN(e,t=0){return(us[e[t+0]]+us[e[t+1]]+us[e[t+2]]+us[e[t+3]]+"-"+us[e[t+4]]+us[e[t+5]]+"-"+us[e[t+6]]+us[e[t+7]]+"-"+us[e[t+8]]+us[e[t+9]]+"-"+us[e[t+10]]+us[e[t+11]]+us[e[t+12]]+us[e[t+13]]+us[e[t+14]]+us[e[t+15]]).toLowerCase()}let S0;const jN=new Uint8Array(16);function UN(){if(!S0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");S0=crypto.getRandomValues.bind(crypto)}return S0(jN)}const qN=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sS={randomUUID:qN};function Pp(e,t,n){if(sS.randomUUID&&!e)return sS.randomUUID();e=e||{};const a=e.random??e.rng?.()??UN();if(a.length<16)throw new Error("Random bytes length must be >= 16");return a[6]=a[6]&15|64,a[8]=a[8]&63|128,zN(a)}const $N=_e.createContext({});function VN(e){const[t,n]=_e.useState([]),[a,c]=_e.useState([]),[h,f]=_e.useState([]),[o,y]=_e.useState(BN.sourceOptions_tiles[0]),v=_e.useMemo(()=>({layerId:"openmaptiles",sourceOptions:{type:"vector",tiles:[o]}}),[o]),S=N=>{if(!N)return;const z=[],U=[];N.layers.forEach((ee,ae)=>{ee.type==="symbol"?U.push(ee):(ae===0&&(ee.id=N.name||"background"),z.push(ee))}),c(z),f(U)};_e.useEffect(()=>{if(t.filter(N=>!N?.id).length){const N=[...t];N.forEach(z=>{z?.id||(z.id=Pp())}),n(N)}},[t]);const P=_e.useCallback((N,z)=>{const U=t?.filter?.(ee=>ee.id===N);if(U.length>0){const ee=[...t],ae=U[0],W=t.indexOf(ae),le=z(W);le>=0&&le<=t.length-1&&(ee.splice(W,1),ee.splice(le,0,ae),n(ee))}},[t]),M=_e.useCallback(N=>{P(N,z=>z+1)},[P]),E=_e.useCallback(N=>{P(N,z=>z-1)},[P]),O={layers:t,setLayers:n,backgroundLayers:a,setBackgroundLayers:c,symbolLayers:h,setSymbolLayers:f,updateStyle:S,vtLayerConfig:v,tileUrl:o,setTileUrl:y,moveUp:E,moveDown:M,moveLayer:P};return Pr.jsx($N.Provider,{value:O,children:e.children})}const Gg=_e.createContext({}),iI=({children:e})=>{const[t,n]=_e.useState(void 0),[a,c]=_e.useState([]),h=_e.useRef([]),f=_e.useRef({}),o=S=>{if(S){typeof f.current[S]<"u"&&delete f.current[S];const P=h.current.indexOf(S);P>-1&&h.current.splice(P,1),c([...h.current]),h.current.length===0&&t&&n(void 0)}else o("anonymous_map")},v={map:t,setMap:S=>{if(n(S),a.length===0){const P="anonymous_map";c([...a,P]),f.current[P]=S}},maps:f.current,mapIds:a,registerMap:(S,P)=>{S&&P&&(f.current[S]=P,h.current.push(S),c([...h.current]),(!t||t?.cancelled===!0)&&n(P))},removeMap:o,mapExists:S=>S&&Object.keys(f.current).indexOf(S)===-1?!1:!(!S&&!t),getMap:S=>S&&a.indexOf(S)!==-1?f.current[S]:!S&&t?t:null};return Pr.jsx(Gg.Provider,{value:v,children:Pr.jsx(VN,{children:Pr.jsx(RN,{theme:FN("light"),children:e})})})},oI={mapId:void 0,options:{center:{lng:8.607,lat:53.1409349},zoom:11,container:"",style:{version:8,name:"blank",center:[0,0],zoom:0,sources:{},sprite:"https://wms.wheregroup.com/tileserver/sprites/osm-bright",glyphs:"https://wms.wheregroup.com/tileserver/fonts/{fontstack}/{range}.pbf",layers:[{id:"_background",type:"background",paint:{"background-color":"rgba(0,0,0,0)"}}]}}},m2=e=>{const t=_e.useRef(null),n=_e.useRef(null),a=_e.useContext(Gg),c=_e.useRef(e.mapId),h=_e.useRef(!1),f=_e.useRef(e.options?.style);return _e.useEffect(()=>{const o=c.current;return()=>{h.current=!1,a.removeMap(o),t.current&&(t.current.map?.remove?.(),t.current.cancelled=!0,t.current=null)}},[]),_e.useEffect(()=>{h.current||n.current&&(h.current=!0,e?.options?.style&&(f.current=JSON.stringify(e.options.style)),t.current=new ek({mapOptions:{style:"",...e.options,...e?.options?.style?{}:{style:oI?.options?.style},container:n.current},onReady:(o,y)=>{o.once("load",()=>{y?.cancelled?o.remove():(window._map=o,e.mapId?a.registerMap(e.mapId,y):a.setMap(y))})}}))},[e.options,e.mapId]),_e.useEffect(()=>{if(t.current?.map&&e?.options?.style){const o=JSON.stringify(e.options.style);f.current!==o&&(f.current=o,t.current.map.setStyle(e.options.style))}},[e?.options?.style]),Pr.jsx("div",{ref:n,className:"mapContainer",style:e.style})};m2.defaultProps=oI;function aI(e){const t=_e.useContext(Gg),n=_e.useRef(!1),a=_e.useRef(null),[c,h]=_e.useState(),f=_e.useRef(void 0),[o,y]=_e.useState([]),v=_e.useRef(""),S=_e.useRef(Pp()),P=_e.useCallback(E=>!e?.filter?.includeBaseLayers&&E?.baseLayer?!1:typeof e.filter?.matchLayerIds<"u"?e.filter.matchLayerIds instanceof RegExp?e.filter.matchLayerIds.test(E.id):E.id.includes(e.filter.matchLayerIds):!0,[e.filter]),M=_e.useCallback(()=>{if(!a.current)return;const E=a.current.wrapper.layerState.filter(P),O=JSON.stringify(E);v.current!==O&&(v.current=O,y(E))},[P]);return _e.useEffect(()=>{const E=S.current;return()=>{a.current&&(a.current.cleanup(E),a.current=null),n.current=!1}},[]),_e.useEffect(()=>{if(!(!t.mapExists(e.mapId)||n.current)){if(n.current=!0,a.current=t.getMap(e.mapId),!a.current){n.current=!1;return}e?.watch?.viewport&&(h(a.current.wrapper.viewportState),a.current.wrapper.on("viewportchange",()=>{f.current!==a.current?.wrapper.viewportStateString&&h(a.current?.wrapper.viewportState)},S.current)),e?.watch?.layers&&(M(),a.current.wrapper.on("layerchange",M,{includeBaseLayers:e?.filter?.includeBaseLayers,matchLayerIds:e?.filter?.matchLayerIds},S.current))}},[t.mapIds,t,e.mapId,M,e]),{layers:o,viewport:c}}aI.defaultProps={mapId:void 0,watch:{layers:!0,sources:!1,viewport:!1},filter:{includeBaseLayers:!1}};function qp(e){const t=_e.useContext(Gg),[n,a]=_e.useState({map:void 0,ready:!1}),c=aI({mapId:e?.mapId,watch:{viewport:!1,layers:!!e?.waitForLayer,sources:!1},filter:{includeBaseLayers:!0}}),h=_e.useRef(null),f=_e.useRef(Pp()),o=()=>{h.current&&h.current.cleanup(f.current)};return _e.useEffect(()=>()=>{o(),h.current=null},[]),_e.useEffect(()=>{if(h.current&&h.current.cancelled===!0&&(h.current=null,a({map:void 0,ready:!1})),!(h.current||!t.mapExists(e?.mapId))){if(e?.waitForLayer){let y=!1;if(c?.layers?.forEach(v=>{v.id===e?.waitForLayer&&(y=!0)}),!y)return}h.current=t.getMap(e?.mapId),a({map:h.current,ready:!0})}},[t.mapIds,c.layers,t,e]),{map:n.map,mapIsReady:n.ready,componentId:f.current,layers:c.layers,cleanup:o}}const Ju=F6;process.env.NODE_ENV!=="production"&&(ne.node,ne.object.isRequired);function tu(e){return k6(e)}function GN(e){return yl("MuiSvgIcon",e)}zs("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const HN=e=>{const{color:t,fontSize:n,classes:a}=e,c={root:["root",t!=="inherit"&&`color${Ei(t)}`,`fontSize${Ei(n)}`]};return eu(c,GN,a)},WN=Rn("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Ei(n.color)}`],t[`fontSize${Ei(n.fontSize)}`]]}})(Ju(({theme:e})=>({userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:e.transitions?.create?.("fill",{duration:(e.vars??e).transitions?.duration?.shorter}),variants:[{props:t=>!t.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:e.typography?.pxToRem?.(20)||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:e.typography?.pxToRem?.(24)||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:e.typography?.pxToRem?.(35)||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,t])=>t&&t.main).map(([t])=>({props:{color:t},style:{color:(e.vars??e).palette?.[t]?.main}})),{props:{color:"action"},style:{color:(e.vars??e).palette?.action?.active}},{props:{color:"disabled"},style:{color:(e.vars??e).palette?.action?.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}))),lg=Qt.forwardRef(function(t,n){const a=tu({props:t,name:"MuiSvgIcon"}),{children:c,className:h,color:f="inherit",component:o="svg",fontSize:y="medium",htmlColor:v,inheritViewBox:S=!1,titleAccess:P,viewBox:M="0 0 24 24",...E}=a,O=Qt.isValidElement(c)&&c.type==="svg",N={...a,color:f,component:o,fontSize:y,instanceFontSize:t.fontSize,inheritViewBox:S,viewBox:M,hasSvgAsChild:O},z={};S||(z.viewBox=M);const U=HN(N);return Pr.jsxs(WN,{as:o,className:ro(U.root,h),focusable:"false",color:v,"aria-hidden":P?void 0:!0,role:P?"img":void 0,ref:n,...z,...E,...O&&c.props,ownerState:N,children:[O?c.props.children:c,P?Pr.jsx("title",{children:P}):null]})});process.env.NODE_ENV!=="production"&&(lg.propTypes={children:ne.node,classes:ne.object,className:ne.string,color:ne.oneOfType([ne.oneOf(["inherit","action","disabled","primary","secondary","error","info","success","warning"]),ne.string]),component:ne.elementType,fontSize:ne.oneOfType([ne.oneOf(["inherit","large","medium","small"]),ne.string]),htmlColor:ne.string,inheritViewBox:ne.bool,shapeRendering:ne.string,sx:ne.oneOfType([ne.arrayOf(ne.oneOfType([ne.func,ne.object,ne.bool])),ne.func,ne.object]),titleAccess:ne.string,viewBox:ne.string});lg.muiName="SvgIcon";function g2(e,t){function n(a,c){return Pr.jsx(lg,{"data-testid":process.env.NODE_ENV!=="production"?`${t}Icon`:void 0,ref:c,...a,children:e})}return process.env.NODE_ENV!=="production"&&(n.displayName=`${t}Icon`),n.muiName=lg.muiName,Qt.memo(Qt.forwardRef(n))}function ZN(e){const{controlled:t,default:n,name:a,state:c="value"}=e,{current:h}=Qt.useRef(t!==void 0),[f,o]=Qt.useState(n),y=h?t:f;if(process.env.NODE_ENV!=="production"){Qt.useEffect(()=>{h!==(t!==void 0)&&console.error([`MUI: A component is changing the ${h?"":"un"}controlled ${c} state of ${a} to be ${h?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${a} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
878
878
  `))},[c,a,t]);const{current:S}=Qt.useRef(n);Qt.useEffect(()=>{!h&&JSON.stringify(n)!==JSON.stringify(S)&&console.error([`MUI: A component is changing the default ${c} state of an uncontrolled ${a} after being initialized. To suppress this warning opt to use a controlled ${a}.`].join(`
879
879
  `))},[JSON.stringify(n)])}const v=Qt.useCallback(S=>{h||o(S)},[]);return[y,v]}function Hm(e){const t=Qt.useRef(e);return jg(()=>{t.current=e}),Qt.useRef((...n)=>(0,t.current)(...n)).current}function ug(...e){const t=Qt.useRef(void 0),n=Qt.useCallback(a=>{const c=e.map(h=>{if(h==null)return null;if(typeof h=="function"){const f=h,o=f(a);return typeof o=="function"?o:()=>{f(null)}}return h.current=a,()=>{h.current=null}});return()=>{c.forEach(h=>h?.())}},e);return Qt.useMemo(()=>e.every(a=>a==null)?null:a=>{t.current&&(t.current(),t.current=void 0),a!=null&&(t.current=n(a))},e)}function YN(e,t){const n=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&n>=65&&n<=90&&typeof t=="function"}function XN(e,t){if(!e)return t;function n(f,o){const y={};return Object.keys(o).forEach(v=>{YN(v,o[v])&&typeof f[v]=="function"&&(y[v]=(...S)=>{f[v](...S),o[v](...S)})}),y}if(typeof e=="function"||typeof t=="function")return f=>{const o=typeof t=="function"?t(f):t,y=typeof e=="function"?e({...f,...o}):e,v=ro(f?.className,o?.className,y?.className),S=n(y,o);return{...o,...y,...S,...!!v&&{className:v},...o?.style&&y?.style&&{style:{...o.style,...y.style}},...o?.sx&&y?.sx&&{sx:[...Array.isArray(o.sx)?o.sx:[o.sx],...Array.isArray(y.sx)?y.sx:[y.sx]]}}};const a=t,c=n(e,a),h=ro(a?.className,e?.className);return{...t,...e,...c,...!!h&&{className:h},...a?.style&&e?.style&&{style:{...a.style,...e.style}},...a?.sx&&e?.sx&&{sx:[...Array.isArray(a.sx)?a.sx:[a.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function $p(e,t){return process.env.NODE_ENV==="production"?()=>null:function(...a){return e(...a)||t(...a)}}function KN(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.indexOf(a)!==-1)continue;n[a]=e[a]}return n}function ub(e,t){return ub=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,a){return n.__proto__=a,n},ub(e,t)}function JN(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ub(e,t)}const lS=_e.createContext(null);function QN(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function y2(e,t){var n=function(h){return t&&_e.isValidElement(h)?t(h):h},a=Object.create(null);return e&&_e.Children.map(e,function(c){return c}).forEach(function(c){a[c.key]=n(c)}),a}function eO(e,t){e=e||{},t=t||{};function n(S){return S in t?t[S]:e[S]}var a=Object.create(null),c=[];for(var h in e)h in t?c.length&&(a[h]=c,c=[]):c.push(h);var f,o={};for(var y in t){if(a[y])for(f=0;f<a[y].length;f++){var v=a[y][f];o[a[y][f]]=n(v)}o[y]=n(y)}for(f=0;f<c.length;f++)o[c[f]]=n(c[f]);return o}function Rh(e,t,n){return n[t]!=null?n[t]:e.props[t]}function tO(e,t){return y2(e.children,function(n){return _e.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Rh(n,"appear",e),enter:Rh(n,"enter",e),exit:Rh(n,"exit",e)})})}function rO(e,t,n){var a=y2(e.children),c=eO(t,a);return Object.keys(c).forEach(function(h){var f=c[h];if(_e.isValidElement(f)){var o=h in t,y=h in a,v=t[h],S=_e.isValidElement(v)&&!v.props.in;y&&(!o||S)?c[h]=_e.cloneElement(f,{onExited:n.bind(null,f),in:!0,exit:Rh(f,"exit",e),enter:Rh(f,"enter",e)}):!y&&o&&!S?c[h]=_e.cloneElement(f,{in:!1}):y&&o&&_e.isValidElement(v)&&(c[h]=_e.cloneElement(f,{onExited:n.bind(null,f),in:v.props.in,exit:Rh(f,"exit",e),enter:Rh(f,"enter",e)}))}}),c}var nO=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},iO={component:"div",childFactory:function(t){return t}},_2=(function(e){JN(t,e);function t(a,c){var h;h=e.call(this,a,c)||this;var f=h.handleExited.bind(QN(h));return h.state={contextValue:{isMounting:!0},handleExited:f,firstRender:!0},h}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(c,h){var f=h.children,o=h.handleExited,y=h.firstRender;return{children:y?tO(c,o):rO(c,f,o),firstRender:!1}},n.handleExited=function(c,h){var f=y2(this.props.children);c.key in f||(c.props.onExited&&c.props.onExited(h),this.mounted&&this.setState(function(o){var y=rg({},o.children);return delete y[c.key],{children:y}}))},n.render=function(){var c=this.props,h=c.component,f=c.childFactory,o=KN(c,["component","childFactory"]),y=this.state.contextValue,v=nO(this.state.children).map(f);return delete o.appear,delete o.enter,delete o.exit,h===null?_e.createElement(lS.Provider,{value:y},v):_e.createElement(lS.Provider,{value:y},_e.createElement(h,o,v))},t})(_e.Component);_2.propTypes=process.env.NODE_ENV!=="production"?{component:ne.any,children:ne.node,appear:ne.bool,enter:ne.bool,exit:ne.bool,childFactory:ne.func}:{};_2.defaultProps=iO;const uS={};function sI(e,t){const n=Qt.useRef(uS);return n.current===uS&&(n.current=e(t)),n}const oO=[];function aO(e){Qt.useEffect(e,oO)}class v2{static create(){return new v2}currentId=null;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function sO(){const e=sI(v2.create).current;return aO(e.disposeEffect),e}function lO(e){const{prototype:t={}}=e;return!!t.isReactComponent}function uO(e,t,n,a,c){const h=e[t],f=c||t;if(h==null||typeof window>"u")return null;let o;return typeof h=="function"&&!lO(h)&&(o="Did you accidentally provide a plain function component instead?"),o!==void 0?new Error(`Invalid ${a} \`${f}\` supplied to \`${n}\`. Expected an element type that can hold a ref. ${o} For more information see https://mui.com/r/caveat-with-refs-guide`):null}const lI=$p(ne.elementType,uO);function cO(e){const t=typeof e;switch(t){case"number":return Number.isNaN(e)?"NaN":Number.isFinite(e)?e!==Math.floor(e)?"float":"number":"Infinity";case"object":return e===null?"null":e.constructor.name;default:return t}}function uI(e,t,n,a){const c=e[t];if(c==null||!Number.isInteger(c)){const h=cO(c);return new RangeError(`Invalid ${a} \`${t}\` of type \`${h}\` supplied to \`${n}\`, expected \`integer\`.`)}return null}function cI(e,t,n,a){return e[t]===void 0?null:uI(e,t,n,a)}function cb(){return null}cI.isRequired=uI;cb.isRequired=cb;const hO=process.env.NODE_ENV==="production"?cb:cI;function fO(e){return yl("MuiPaper",e)}zs("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const dO=e=>{const{square:t,elevation:n,variant:a,classes:c}=e,h={root:["root",a,!t&&"rounded",a==="elevation"&&`elevation${n}`]};return eu(h,fO,c)},pO=Rn("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(Ju(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),b2=Qt.forwardRef(function(t,n){const a=tu({props:t,name:"MuiPaper"}),c=IN(),{className:h,component:f="div",elevation:o=1,square:y=!1,variant:v="elevation",...S}=a,P={...a,component:f,elevation:o,square:y,variant:v},M=dO(P);return process.env.NODE_ENV!=="production"&&c.shadows[o]===void 0&&console.error([`MUI: The elevation provided <Paper elevation={${o}}> is not available in the theme.`,`Please make sure that \`theme.shadows[${o}]\` is defined.`].join(`
880
880
  `)),Pr.jsx(pO,{as:f,ownerState:P,className:ro(M.root,h),ref:n,...S,style:{...v==="elevation"&&{"--Paper-shadow":(c.vars||c).shadows[o],...c.vars&&{"--Paper-overlay":c.vars.overlays?.[o]},...!c.vars&&c.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${ag("#fff",lb(o))}, ${ag("#fff",lb(o))})`}},...S.style}})});process.env.NODE_ENV!=="production"&&(b2.propTypes={children:ne.node,classes:ne.object,className:ne.string,component:ne.elementType,elevation:$p(hO,e=>{const{elevation:t,variant:n}=e;return t>0&&n==="outlined"?new Error(`MUI: Combining \`elevation={${t}}\` with \`variant="${n}"\` has no effect. Either use \`elevation={0}\` or use a different \`variant\`.`):null}),square:ne.bool,style:ne.object,sx:ne.oneOfType([ne.arrayOf(ne.oneOfType([ne.func,ne.object,ne.bool])),ne.func,ne.object]),variant:ne.oneOfType([ne.oneOf(["elevation","outlined"]),ne.string])});function hb(e){return typeof e=="string"}function mO(e,t,n){return e===void 0||hb(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function gO(e,t,n){return typeof e=="function"?e(t,n):e}function yO(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(a=>a.match(/^on[A-Z]/)&&typeof e[a]=="function"&&!t.includes(a)).forEach(a=>{n[a]=e[a]}),n}function cS(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function _O(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:a,externalForwardedProps:c,className:h}=e;if(!t){const E=ro(n?.className,h,c?.className,a?.className),O={...n?.style,...c?.style,...a?.style},N={...n,...c,...a};return E.length>0&&(N.className=E),Object.keys(O).length>0&&(N.style=O),{props:N,internalRef:void 0}}const f=yO({...c,...a}),o=cS(a),y=cS(c),v=t(f),S=ro(v?.className,n?.className,h,c?.className,a?.className),P={...v?.style,...n?.style,...c?.style,...a?.style},M={...v,...n,...y,...o};return S.length>0&&(M.className=S),Object.keys(P).length>0&&(M.style=P),{props:M,internalRef:v.ref}}function fb(e,t){const{className:n,elementType:a,ownerState:c,externalForwardedProps:h,internalForwardedProps:f,shouldForwardComponentProp:o=!1,...y}=t,{component:v,slots:S={[e]:void 0},slotProps:P={[e]:void 0},...M}=h,E=S[e]||a,O=gO(P[e],c),{props:{component:N,...z},internalRef:U}=_O({className:n,...y,externalForwardedProps:e==="root"?M:void 0,externalSlotProps:O}),ee=ug(U,O?.ref,t.ref),ae=e==="root"?N||v:N,W=mO(E,{...e==="root"&&!v&&!S[e]&&f,...e!=="root"&&!S[e]&&f,...z,...ae&&!o&&{as:ae},...ae&&o&&{component:ae},ref:ee},c);return[E,W]}const hI=ne.oneOfType([ne.func,ne.object]);function hS(e){try{return e.matches(":focus-visible")}catch{process.env.NODE_ENV!=="production"&&!/jsdom/.test(window.navigator.userAgent)&&console.warn(["MUI: The `:focus-visible` pseudo class is not supported in this browser.","Some components rely on this feature to work properly."].join(`
@@ -1142,7 +1142,7 @@ T* `):B.join(` Tj
1142
1142
  endobj\r
1143
1143
  `},n.outline.count_r=function(a,c){for(var h=0;h<c.children.length;h++)a.count++,this.count_r(a,c.children[h]);return a.count}}])})(Cn.API),(function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(n,a,c,h,f,o){var y,v=this.decode.DCT_DECODE,S=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=f||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,y=(function(P){for(var M,E=256*P.charCodeAt(4)+P.charCodeAt(5),O=P.length,N={width:0,height:0,numcomponents:1},z=4;z<O;z+=2){if(z+=E,t.indexOf(P.charCodeAt(z+1))!==-1){M=256*P.charCodeAt(z+5)+P.charCodeAt(z+6),N={width:256*P.charCodeAt(z+7)+P.charCodeAt(z+8),height:M,numcomponents:P.charCodeAt(z+9)};break}E=256*P.charCodeAt(z+2)+P.charCodeAt(z+3)}return N})(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),y.numcomponents){case 1:o=this.color_spaces.DEVICE_GRAY;break;case 4:o=this.color_spaces.DEVICE_CMYK;break;case 3:o=this.color_spaces.DEVICE_RGB}S={data:n,width:y.width,height:y.height,colorSpace:o,bitsPerComponent:8,filter:v,index:a,alias:c}}return S}})(Cn.API),Cn.API.processPNG=function(e,t,n,a){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var c,h=kB(e,{checkCrc:!0}),f=h.width,o=h.height,y=h.channels,v=h.palette,S=h.depth;c=v&&y===1?(function(we){for(var Te=we.width,me=we.height,Ve=we.data,re=we.palette,H=we.depth,Le=!1,Pe=[],Me=[],Ze=void 0,ut=!1,ke=0,Xe=0;Xe<re.length;Xe++){var ge=vS(re[Xe],4),Re=ge[0],J=ge[1],fe=ge[2],xe=ge[3];Pe.push(Re,J,fe),xe!=null&&(xe===0?(ke++,Me.length<1&&Me.push(Xe)):xe<255&&(ut=!0))}if(ut||ke>1){Le=!0,Me=void 0;var Ie=Te*me;Ze=new Uint8Array(Ie);for(var Fe=new DataView(Ve.buffer),ot=0;ot<Ie;ot++){var Et=V0(Fe,ot,H),gt=vS(re[Et],4)[3];Ze[ot]=gt}}return{colorSpace:"Indexed",colorsPerPixel:1,colorBytes:Ve,alphaBytes:Ze,needSMask:Le,palette:Pe,mask:Me}})(h):y===2||y===4?(function(we){for(var Te=we.data,me=we.width,Ve=we.height,re=we.channels,H=we.depth,Le=re===2?"DeviceGray":"DeviceRGB",Pe=re-1,Me=me*Ve,Ze=Pe,ut=Me*Ze,ke=1*Me,Xe=Math.ceil(ut*H/8),ge=Math.ceil(ke*H/8),Re=new Uint8Array(Xe),J=new Uint8Array(ge),fe=new DataView(Te.buffer),xe=new DataView(Re.buffer),Ie=new DataView(J.buffer),Fe=!1,ot=0;ot<Me;ot++){for(var Et=ot*re,gt=0;gt<Ze;gt++)EE(xe,V0(fe,Et+gt,H),ot*Ze+gt,H);var wt=V0(fe,Et+Ze,H);wt<(1<<H)-1&&(Fe=!0),EE(Ie,wt,1*ot,H)}return{colorSpace:Le,colorsPerPixel:Pe,colorBytes:Re,alphaBytes:J,needSMask:Fe}})(h):(function(we){var Te=we.data,me=we.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:me,colorsPerPixel:me==="DeviceGray"?1:3,colorBytes:Te instanceof Uint8Array?Te:new Uint8Array(Te.buffer),needSMask:!1}})(h);var P,M,E,O=c,N=O.colorSpace,z=O.colorsPerPixel,U=O.colorBytes,ee=O.alphaBytes,ae=O.needSMask,W=O.palette,le=O.mask,te=null;return a!==Cn.API.image_compression.NONE&&typeof vb=="function"?(te=(function(we){var Te;switch(we){case Cn.API.image_compression.FAST:Te=11;break;case Cn.API.image_compression.MEDIUM:Te=13;break;case Cn.API.image_compression.SLOW:Te=14;break;default:Te=12}return Te})(a),P=this.decode.FLATE_DECODE,M="/Predictor ".concat(te," "),e=vE(U,f*z,z,a),ae&&(E=vE(ee,f,1,a))):(P=void 0,M="",e=U,ae&&(E=ee)),M+="/Colors ".concat(z," /BitsPerComponent ").concat(S," /Columns ").concat(f),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(E&&this.__addimage__.isArrayBuffer(E)||this.__addimage__.isArrayBufferView(E))&&(E=this.__addimage__.arrayBufferToBinaryString(E)),{alias:n,data:e,index:t,filter:P,decodeParameters:M,transparency:le,palette:W,sMask:E,predictor:te,width:f,height:o,bitsPerComponent:S,colorSpace:N}}},(function(e){e.processGIF89A=function(t,n,a,c){var h=new ez(t),f=h.width,o=h.height,y=[];h.decodeAndBlitFrameRGBA(0,y);var v={data:y,width:f,height:o},S=new G0(100).encode(v,100);return e.processJPEG.call(this,S,n,a,c)},e.processGIF87A=e.processGIF89A})(Cn.API),vu.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),c=this.datav.getUint8(this.pos++,!0),h=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:c,green:a,blue:n,quad:h}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},vu.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(n){co.log("bit decode error:"+n)}},vu.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),n=t%4;for(e=this.height-1;e>=0;e--){for(var a=this.bottom_up?e:this.height-1-e,c=0;c<t;c++)for(var h=this.datav.getUint8(this.pos++,!0),f=a*this.width*4+8*c*4,o=0;o<8&&8*c+o<this.width;o++){var y=this.palette[h>>7-o&1];this.data[f+4*o]=y.blue,this.data[f+4*o+1]=y.green,this.data[f+4*o+2]=y.red,this.data[f+4*o+3]=255}n!==0&&(this.pos+=4-n)}},vu.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,n=this.height-1;n>=0;n--){for(var a=this.bottom_up?n:this.height-1-n,c=0;c<e;c++){var h=this.datav.getUint8(this.pos++,!0),f=a*this.width*4+2*c*4,o=h>>4,y=15&h,v=this.palette[o];if(this.data[f]=v.blue,this.data[f+1]=v.green,this.data[f+2]=v.red,this.data[f+3]=255,2*c+1>=this.width)break;v=this.palette[y],this.data[f+4]=v.blue,this.data[f+4+1]=v.green,this.data[f+4+2]=v.red,this.data[f+4+3]=255}t!==0&&(this.pos+=4-t)}},vu.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var n=this.bottom_up?t:this.height-1-t,a=0;a<this.width;a++){var c=this.datav.getUint8(this.pos++,!0),h=n*this.width*4+4*a;if(c<this.palette.length){var f=this.palette[c];this.data[h]=f.red,this.data[h+1]=f.green,this.data[h+2]=f.blue,this.data[h+3]=255}else this.data[h]=255,this.data[h+1]=255,this.data[h+2]=255,this.data[h+3]=255}e!==0&&(this.pos+=4-e)}},vu.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var a=this.bottom_up?n:this.height-1-n,c=0;c<this.width;c++){var h=this.datav.getUint16(this.pos,!0);this.pos+=2;var f=(h&t)/t*255|0,o=(h>>5&t)/t*255|0,y=(h>>10&t)/t*255|0,v=h>>15?255:0,S=a*this.width*4+4*c;this.data[S]=y,this.data[S+1]=o,this.data[S+2]=f,this.data[S+3]=v}this.pos+=e}},vu.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),n=parseInt("111111",2),a=this.height-1;a>=0;a--){for(var c=this.bottom_up?a:this.height-1-a,h=0;h<this.width;h++){var f=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(f&t)/t*255|0,y=(f>>5&n)/n*255|0,v=(f>>11)/t*255|0,S=c*this.width*4+4*h;this.data[S]=v,this.data[S+1]=y,this.data[S+2]=o,this.data[S+3]=255}this.pos+=e}},vu.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var a=this.datav.getUint8(this.pos++,!0),c=this.datav.getUint8(this.pos++,!0),h=this.datav.getUint8(this.pos++,!0),f=t*this.width*4+4*n;this.data[f]=h,this.data[f+1]=c,this.data[f+2]=a,this.data[f+3]=255}this.pos+=this.width%4}},vu.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,n=0;n<this.width;n++){var a=this.datav.getUint8(this.pos++,!0),c=this.datav.getUint8(this.pos++,!0),h=this.datav.getUint8(this.pos++,!0),f=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*n;this.data[o]=h,this.data[o+1]=c,this.data[o+2]=a,this.data[o+3]=f}},vu.prototype.getData=function(){return this.data},(function(e){e.processBMP=function(t,n,a,c){var h=new vu(t,!1),f=h.width,o=h.height,y={data:h.getData(),width:f,height:o},v=new G0(100).encode(y,100);return e.processJPEG.call(this,v,n,a,c)}})(Cn.API),CE.prototype.getData=function(){return this.data},(function(e){e.processWEBP=function(t,n,a,c){var h=new CE(t),f=h.width,o=h.height,y={data:h.getData(),width:f,height:o},v=new G0(100).encode(y,100);return e.processJPEG.call(this,v,n,a,c)}})(Cn.API),Cn.API.processRGBA=function(e,t,n){for(var a=e.data,c=a.length,h=new Uint8Array(c/4*3),f=new Uint8Array(c/4),o=0,y=0,v=0;v<c;v+=4){var S=a[v],P=a[v+1],M=a[v+2],E=a[v+3];h[o++]=S,h[o++]=P,h[o++]=M,f[y++]=E}var O=this.__addimage__.arrayBufferToBinaryString(h);return{alpha:this.__addimage__.arrayBufferToBinaryString(f),data:O,index:t,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},Cn.API.setLanguage=function(e){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]!==void 0&&(this.internal.languageSettings.languageCode=e,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},If=Cn.API,Dm=If.getCharWidthsArray=function(e,t){var n,a,c=(t=t||{}).font||this.internal.getFont(),h=t.fontSize||this.internal.getFontSize(),f=t.charSpace||this.internal.getCharSpace(),o=t.widths?t.widths:c.metadata.Unicode.widths,y=o.fof?o.fof:1,v=t.kerning?t.kerning:c.metadata.Unicode.kerning,S=v.fof?v.fof:1,P=t.doKerning!==!1,M=0,E=e.length,O=0,N=o[0]||y,z=[];for(n=0;n<E;n++)a=e.charCodeAt(n),typeof c.metadata.widthOfString=="function"?z.push((c.metadata.widthOfGlyph(c.metadata.characterToGlyph(a))+f*(1e3/h)||0)/1e3):(M=P&&Ui(v[a])==="object"&&!isNaN(parseInt(v[a][O],10))?v[a][O]/S:0,z.push((o[a]||N)/y+M)),O=a;return z},gE=If.getStringUnitWidth=function(e,t){var n=(t=t||{}).fontSize||this.internal.getFontSize(),a=t.font||this.internal.getFont(),c=t.charSpace||this.internal.getCharSpace();return If.processArabic&&(e=If.processArabic(e)),typeof a.metadata.widthOfString=="function"?a.metadata.widthOfString(e,n,c)/n:Dm.apply(this,arguments).reduce(function(h,f){return h+f},0)},yE=function(e,t,n,a){for(var c=[],h=0,f=e.length,o=0;h!==f&&o+t[h]<n;)o+=t[h],h++;c.push(e.slice(0,h));var y=h;for(o=0;h!==f;)o+t[h]>a&&(c.push(e.slice(y,h)),o=0,y=h),o+=t[h],h++;return y!==h&&c.push(e.slice(y,h)),c},_E=function(e,t,n){n||(n={});var a,c,h,f,o,y,v,S=[],P=[S],M=n.textIndent||0,E=0,O=0,N=e.split(" "),z=Dm.apply(this,[" ",n])[0];if(y=n.lineIndent===-1?N[0].length+2:n.lineIndent||0){var U=Array(y).join(" "),ee=[];N.map(function(W){(W=W.split(/\s*\n/)).length>1?ee=ee.concat(W.map(function(le,te){return(te&&le.length?`
1144
1144
  `:"")+le})):ee.push(W[0])}),N=ee,y=gE.apply(this,[U,n])}for(h=0,f=N.length;h<f;h++){var ae=0;if(a=N[h],y&&a[0]==`
1145
- `&&(a=a.substr(1),ae=1),M+E+(O=(c=Dm.apply(this,[a,n])).reduce(function(W,le){return W+le},0))>t||ae){if(O>t){for(o=yE.apply(this,[a,c,t-(M+E),t]),S.push(o.shift()),S=[o.pop()];o.length;)P.push([o.shift()]);O=c.slice(a.length-(S[0]?S[0].length:0)).reduce(function(W,le){return W+le},0)}else S=[a];P.push(S),M=O+y,E=z}else S.push(a),M+=E+O,E=z}return v=y?function(W,le){return(le?U:"")+W.join(" ")}:function(W){return W.join(" ")},P.map(v)},If.splitTextToSize=function(e,t,n){var a,c=(n=n||{}).fontSize||this.internal.getFontSize(),h=(function(S){if(S.widths&&S.kerning)return{widths:S.widths,kerning:S.kerning};var P=this.internal.getFont(S.fontName,S.fontStyle),M="Unicode";return P.metadata[M]?{widths:P.metadata[M].widths||{0:1},kerning:P.metadata[M].kerning||{}}:{font:P.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);a=Array.isArray(e)?e:String(e).split(/\r?\n/);var f=1*this.internal.scaleFactor*t/c;h.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/c:0,h.lineIndent=n.lineIndent;var o,y,v=[];for(o=0,y=a.length;o<y;o++)v=v.concat(_E.apply(this,[a[o],f,h]));return v},(function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",a={},c={},h=0;h<16;h++)a[n[h]]=t[h],c[t[h]]=n[h];var f=function(M){return"0x"+parseInt(M,10).toString(16)},o=e.__fontmetrics__.compress=function(M){var E,O,N,z,U=["{"];for(var ee in M){if(E=M[ee],isNaN(parseInt(ee,10))?O="'"+ee+"'":(ee=parseInt(ee,10),O=(O=f(ee).slice(2)).slice(0,-1)+c[O.slice(-1)]),typeof E=="number")E<0?(N=f(E).slice(3),z="-"):(N=f(E).slice(2),z=""),N=z+N.slice(0,-1)+c[N.slice(-1)];else{if(Ui(E)!=="object")throw new Error("Don't know what to do with value type "+Ui(E)+".");N=o(E)}U.push(O+N)}return U.push("}"),U.join("")},y=e.__fontmetrics__.uncompress=function(M){if(typeof M!="string")throw new Error("Invalid argument passed to uncompress.");for(var E,O,N,z,U={},ee=1,ae=U,W=[],le="",te="",we=M.length-1,Te=1;Te<we;Te+=1)(z=M[Te])=="'"?E?(N=E.join(""),E=void 0):E=[]:E?E.push(z):z=="{"?(W.push([ae,N]),ae={},N=void 0):z=="}"?((O=W.pop())[0][O[1]]=ae,N=void 0,ae=O[0]):z=="-"?ee=-1:N===void 0?a.hasOwnProperty(z)?(le+=a[z],N=parseInt(le,16)*ee,ee=1,le=""):le+=z:a.hasOwnProperty(z)?(te+=a[z],ae[N]=parseInt(te,16)*ee,ee=1,N=void 0,te=""):te+=z;return U},v={codePages:["WinAnsiEncoding"],WinAnsiEncoding:y("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},S={Unicode:{Courier:v,"Courier-Bold":v,"Courier-BoldOblique":v,"Courier-Oblique":v,Helvetica:v,"Helvetica-Bold":v,"Helvetica-BoldOblique":v,"Helvetica-Oblique":v,"Times-Roman":v,"Times-Bold":v,"Times-BoldItalic":v,"Times-Italic":v}},P={Unicode:{"Courier-Oblique":y("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":y("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":y("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:y("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":y("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":y("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:y("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:y("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":y("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:y("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":y("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":y("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":y("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":y("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(M){var E=M.font,O=P.Unicode[E.postScriptName];O&&(E.metadata.Unicode={},E.metadata.Unicode.widths=O.widths,E.metadata.Unicode.kerning=O.kerning);var N=S.Unicode[E.postScriptName];N&&(E.metadata.Unicode.encoding=N,E.encoding=N.codePages[0])}])})(Cn.API),(function(e){var t=function(n){for(var a=n.length,c=new Uint8Array(a),h=0;h<a;h++)c[h]=n.charCodeAt(h);return c};e.API.events.push(["addFont",function(n){var a=void 0,c=n.font,h=n.instance;if(!c.isStandardFont){if(h===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+c.postScriptName+"').");if(typeof(a=h.existsFileInVFS(c.postScriptName)===!1?h.loadFile(c.postScriptName):h.getFileFromVFS(c.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+c.postScriptName+"').");(function(f,o){o=/^\x00\x01\x00\x00/.test(o)?t(o):t(Zm(o)),f.metadata=e.API.TTFFont.open(o),f.metadata.Unicode=f.metadata.Unicode||{encoding:{},kerning:{},widths:[]},f.metadata.glyIdsUsed=[0]})(c,a)}}])})(Cn),Cn.API.addSvgAsImage=function(e,t,n,a,c,h,f,o){if(isNaN(t)||isNaN(n))throw co.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(a)||isNaN(c))throw co.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var y=document.createElement("canvas");y.width=a,y.height=c;var v=y.getContext("2d");v.fillStyle="#fff",v.fillRect(0,0,y.width,y.height);var S={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},P=this;return(jn.canvg?Promise.resolve(jn.canvg):Promise.resolve().then(()=>require("./index.es-YxBXdzDQ.cjs"))).catch(function(M){return Promise.reject(new Error("Could not load canvg: "+M))}).then(function(M){return M.default?M.default:M}).then(function(M){return M.fromString(v,e,S)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(M){return M.render(S)}).then(function(){P.addImage(y.toDataURL("image/jpeg",1),t,n,a,c,f,o)})},Cn.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var a=1;a<=this.internal.getNumberOfPages();a++)for(var c=0;c<this.internal.pages[a].length;c++)this.internal.pages[a][c]=this.internal.pages[a][c].replace(t,n);return this},Cn.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var a,c,h,f={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},o=Object.keys(f),y=[],v=0,S=0,P=0;function M(O,N){var z,U=!1;for(z=0;z<O.length;z+=1)O[z]===N&&(U=!0);return U}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(f)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var E=o.length;for(P=0;P<E;P+=1)n[o[P]].value=n[o[P]].defaultValue,n[o[P]].explicitSet=!1}if(Ui(e)==="object"){for(c in e)if(h=e[c],M(o,c)&&h!==void 0){if(n[c].type==="boolean"&&typeof h=="boolean")n[c].value=h;else if(n[c].type==="name"&&M(n[c].valueSet,h))n[c].value=h;else if(n[c].type==="integer"&&Number.isInteger(h))n[c].value=h;else if(n[c].type==="array"){for(v=0;v<h.length;v+=1)if(a=!0,h[v].length===1&&typeof h[v][0]=="number")y.push(String(h[v]-1));else if(h[v].length>1){for(S=0;S<h[v].length;S+=1)typeof h[v][S]!="number"&&(a=!1);a===!0&&y.push([h[v][0]-1,h[v][1]-1].join(" "))}n[c].value="["+y.join(" ")+"]"}else n[c].value=n[c].defaultValue;n[c].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var O,N=[];for(O in n)n[O].explicitSet===!0&&(n[O].type==="name"?N.push("/"+O+" /"+n[O].value):N.push("/"+O+" "+n[O].value));N.length!==0&&this.internal.write(`/ViewerPreferences
1145
+ `&&(a=a.substr(1),ae=1),M+E+(O=(c=Dm.apply(this,[a,n])).reduce(function(W,le){return W+le},0))>t||ae){if(O>t){for(o=yE.apply(this,[a,c,t-(M+E),t]),S.push(o.shift()),S=[o.pop()];o.length;)P.push([o.shift()]);O=c.slice(a.length-(S[0]?S[0].length:0)).reduce(function(W,le){return W+le},0)}else S=[a];P.push(S),M=O+y,E=z}else S.push(a),M+=E+O,E=z}return v=y?function(W,le){return(le?U:"")+W.join(" ")}:function(W){return W.join(" ")},P.map(v)},If.splitTextToSize=function(e,t,n){var a,c=(n=n||{}).fontSize||this.internal.getFontSize(),h=(function(S){if(S.widths&&S.kerning)return{widths:S.widths,kerning:S.kerning};var P=this.internal.getFont(S.fontName,S.fontStyle),M="Unicode";return P.metadata[M]?{widths:P.metadata[M].widths||{0:1},kerning:P.metadata[M].kerning||{}}:{font:P.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);a=Array.isArray(e)?e:String(e).split(/\r?\n/);var f=1*this.internal.scaleFactor*t/c;h.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/c:0,h.lineIndent=n.lineIndent;var o,y,v=[];for(o=0,y=a.length;o<y;o++)v=v.concat(_E.apply(this,[a[o],f,h]));return v},(function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",n="klmnopqrstuvwxyz",a={},c={},h=0;h<16;h++)a[n[h]]=t[h],c[t[h]]=n[h];var f=function(M){return"0x"+parseInt(M,10).toString(16)},o=e.__fontmetrics__.compress=function(M){var E,O,N,z,U=["{"];for(var ee in M){if(E=M[ee],isNaN(parseInt(ee,10))?O="'"+ee+"'":(ee=parseInt(ee,10),O=(O=f(ee).slice(2)).slice(0,-1)+c[O.slice(-1)]),typeof E=="number")E<0?(N=f(E).slice(3),z="-"):(N=f(E).slice(2),z=""),N=z+N.slice(0,-1)+c[N.slice(-1)];else{if(Ui(E)!=="object")throw new Error("Don't know what to do with value type "+Ui(E)+".");N=o(E)}U.push(O+N)}return U.push("}"),U.join("")},y=e.__fontmetrics__.uncompress=function(M){if(typeof M!="string")throw new Error("Invalid argument passed to uncompress.");for(var E,O,N,z,U={},ee=1,ae=U,W=[],le="",te="",we=M.length-1,Te=1;Te<we;Te+=1)(z=M[Te])=="'"?E?(N=E.join(""),E=void 0):E=[]:E?E.push(z):z=="{"?(W.push([ae,N]),ae={},N=void 0):z=="}"?((O=W.pop())[0][O[1]]=ae,N=void 0,ae=O[0]):z=="-"?ee=-1:N===void 0?a.hasOwnProperty(z)?(le+=a[z],N=parseInt(le,16)*ee,ee=1,le=""):le+=z:a.hasOwnProperty(z)?(te+=a[z],ae[N]=parseInt(te,16)*ee,ee=1,N=void 0,te=""):te+=z;return U},v={codePages:["WinAnsiEncoding"],WinAnsiEncoding:y("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},S={Unicode:{Courier:v,"Courier-Bold":v,"Courier-BoldOblique":v,"Courier-Oblique":v,Helvetica:v,"Helvetica-Bold":v,"Helvetica-BoldOblique":v,"Helvetica-Oblique":v,"Times-Roman":v,"Times-Bold":v,"Times-BoldItalic":v,"Times-Italic":v}},P={Unicode:{"Courier-Oblique":y("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":y("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":y("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:y("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":y("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":y("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:y("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:y("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":y("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:y("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":y("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":y("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":y("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":y("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(M){var E=M.font,O=P.Unicode[E.postScriptName];O&&(E.metadata.Unicode={},E.metadata.Unicode.widths=O.widths,E.metadata.Unicode.kerning=O.kerning);var N=S.Unicode[E.postScriptName];N&&(E.metadata.Unicode.encoding=N,E.encoding=N.codePages[0])}])})(Cn.API),(function(e){var t=function(n){for(var a=n.length,c=new Uint8Array(a),h=0;h<a;h++)c[h]=n.charCodeAt(h);return c};e.API.events.push(["addFont",function(n){var a=void 0,c=n.font,h=n.instance;if(!c.isStandardFont){if(h===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+c.postScriptName+"').");if(typeof(a=h.existsFileInVFS(c.postScriptName)===!1?h.loadFile(c.postScriptName):h.getFileFromVFS(c.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+c.postScriptName+"').");(function(f,o){o=/^\x00\x01\x00\x00/.test(o)?t(o):t(Zm(o)),f.metadata=e.API.TTFFont.open(o),f.metadata.Unicode=f.metadata.Unicode||{encoding:{},kerning:{},widths:[]},f.metadata.glyIdsUsed=[0]})(c,a)}}])})(Cn),Cn.API.addSvgAsImage=function(e,t,n,a,c,h,f,o){if(isNaN(t)||isNaN(n))throw co.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(a)||isNaN(c))throw co.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var y=document.createElement("canvas");y.width=a,y.height=c;var v=y.getContext("2d");v.fillStyle="#fff",v.fillRect(0,0,y.width,y.height);var S={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},P=this;return(jn.canvg?Promise.resolve(jn.canvg):Promise.resolve().then(()=>require("./index.es-CITAORuQ.cjs"))).catch(function(M){return Promise.reject(new Error("Could not load canvg: "+M))}).then(function(M){return M.default?M.default:M}).then(function(M){return M.fromString(v,e,S)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(M){return M.render(S)}).then(function(){P.addImage(y.toDataURL("image/jpeg",1),t,n,a,c,f,o)})},Cn.API.putTotalPages=function(e){var t,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),n=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var a=1;a<=this.internal.getNumberOfPages();a++)for(var c=0;c<this.internal.pages[a].length;c++)this.internal.pages[a][c]=this.internal.pages[a][c].replace(t,n);return this},Cn.API.viewerPreferences=function(e,t){var n;e=e||{},t=t||!1;var a,c,h,f={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},o=Object.keys(f),y=[],v=0,S=0,P=0;function M(O,N){var z,U=!1;for(z=0;z<O.length;z+=1)O[z]===N&&(U=!0);return U}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(f)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,e==="reset"||t===!0){var E=o.length;for(P=0;P<E;P+=1)n[o[P]].value=n[o[P]].defaultValue,n[o[P]].explicitSet=!1}if(Ui(e)==="object"){for(c in e)if(h=e[c],M(o,c)&&h!==void 0){if(n[c].type==="boolean"&&typeof h=="boolean")n[c].value=h;else if(n[c].type==="name"&&M(n[c].valueSet,h))n[c].value=h;else if(n[c].type==="integer"&&Number.isInteger(h))n[c].value=h;else if(n[c].type==="array"){for(v=0;v<h.length;v+=1)if(a=!0,h[v].length===1&&typeof h[v][0]=="number")y.push(String(h[v]-1));else if(h[v].length>1){for(S=0;S<h[v].length;S+=1)typeof h[v][S]!="number"&&(a=!1);a===!0&&y.push([h[v][0]-1,h[v][1]-1].join(" "))}n[c].value="["+y.join(" ")+"]"}else n[c].value=n[c].defaultValue;n[c].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var O,N=[];for(O in n)n[O].explicitSet===!0&&(n[O].type==="name"?N.push("/"+O+" /"+n[O].value):N.push("/"+O+" "+n[O].value));N.length!==0&&this.internal.write(`/ViewerPreferences
1146
1146
  <<
1147
1147
  `+N.join(`
1148
1148
  `)+`
@@ -1171,7 +1171,7 @@ endbfchar
1171
1171
  CMapName currentdict /CMap defineresource pop
1172
1172
  end
1173
1173
  end`};t.events.push(["putFont",function(h){(function(f){var o=f.font,y=f.out,v=f.newObject,S=f.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="Identity-H"){for(var P=o.metadata.Unicode.widths,M=o.metadata.subset.encode(o.metadata.glyIdsUsed,1),E="",O=0;O<M.length;O++)E+=String.fromCharCode(M[O]);var N=v();S({data:E,addLength1:!0,objectId:N}),y("endobj");var z=v();S({data:a(o.metadata.toUnicode),addLength1:!0,objectId:z}),y("endobj");var U=v();y("<<"),y("/Type /FontDescriptor"),y("/FontName /"+Ff(o.fontName)),y("/FontFile2 "+N+" 0 R"),y("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),y("/Flags "+o.metadata.flags),y("/StemV "+o.metadata.stemV),y("/ItalicAngle "+o.metadata.italicAngle),y("/Ascent "+o.metadata.ascender),y("/Descent "+o.metadata.decender),y("/CapHeight "+o.metadata.capHeight),y(">>"),y("endobj");var ee=v();y("<<"),y("/Type /Font"),y("/BaseFont /"+Ff(o.fontName)),y("/FontDescriptor "+U+" 0 R"),y("/W "+e.API.PDFObject.convert(P)),y("/CIDToGIDMap /Identity"),y("/DW 1000"),y("/Subtype /CIDFontType2"),y("/CIDSystemInfo"),y("<<"),y("/Supplement 0"),y("/Registry (Adobe)"),y("/Ordering ("+o.encoding+")"),y(">>"),y(">>"),y("endobj"),o.objectNumber=v(),y("<<"),y("/Type /Font"),y("/Subtype /Type0"),y("/ToUnicode "+z+" 0 R"),y("/BaseFont /"+Ff(o.fontName)),y("/Encoding /"+o.encoding),y("/DescendantFonts ["+ee+" 0 R]"),y(">>"),y("endobj"),o.isAlreadyPutted=!0}})(h)}]),t.events.push(["putFont",function(h){(function(f){var o=f.font,y=f.out,v=f.newObject,S=f.putStream;if(o.metadata instanceof e.API.TTFFont&&o.encoding==="WinAnsiEncoding"){for(var P=o.metadata.rawData,M="",E=0;E<P.length;E++)M+=String.fromCharCode(P[E]);var O=v();S({data:M,addLength1:!0,objectId:O}),y("endobj");var N=v();S({data:a(o.metadata.toUnicode),addLength1:!0,objectId:N}),y("endobj");var z=v();y("<<"),y("/Descent "+o.metadata.decender),y("/CapHeight "+o.metadata.capHeight),y("/StemV "+o.metadata.stemV),y("/Type /FontDescriptor"),y("/FontFile2 "+O+" 0 R"),y("/Flags 96"),y("/FontBBox "+e.API.PDFObject.convert(o.metadata.bbox)),y("/FontName /"+Ff(o.fontName)),y("/ItalicAngle "+o.metadata.italicAngle),y("/Ascent "+o.metadata.ascender),y(">>"),y("endobj"),o.objectNumber=v();for(var U=0;U<o.metadata.hmtx.widths.length;U++)o.metadata.hmtx.widths[U]=parseInt(o.metadata.hmtx.widths[U]*(1e3/o.metadata.head.unitsPerEm));y("<</Subtype/TrueType/Type/Font/ToUnicode "+N+" 0 R/BaseFont/"+Ff(o.fontName)+"/FontDescriptor "+z+" 0 R/Encoding/"+o.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(o.metadata.hmtx.widths)+">>"),y("endobj"),o.isAlreadyPutted=!0}})(h)}]);var c=function(h){var f,o=h.text||"",y=h.x,v=h.y,S=h.options||{},P=h.mutex||{},M=P.pdfEscape,E=P.activeFontKey,O=P.fonts,N=E,z="",U=0,ee="",ae=O[N].encoding;if(O[N].encoding!=="Identity-H")return{text:o,x:y,y:v,options:S,mutex:P};for(ee=o,N=E,Array.isArray(o)&&(ee=o[0]),U=0;U<ee.length;U+=1)O[N].metadata.hasOwnProperty("cmap")&&(f=O[N].metadata.cmap.unicode.codeMap[ee[U].charCodeAt(0)]),f||ee[U].charCodeAt(0)<256&&O[N].metadata.hasOwnProperty("Unicode")?z+=ee[U]:z+="";var W="";return parseInt(N.slice(1))<14||ae==="WinAnsiEncoding"?W=M(z,N).split("").map(function(le){return le.charCodeAt(0).toString(16)}).join(""):ae==="Identity-H"&&(W=n(z,O[N])),P.isHex=!0,{text:W,x:y,y:v,options:S,mutex:P}};t.events.push(["postProcessText",function(h){var f=h.text||"",o=[],y={text:f,x:h.x,y:h.y,options:h.options,mutex:h.mutex};if(Array.isArray(f)){var v=0;for(v=0;v<f.length;v+=1)Array.isArray(f[v])&&f[v].length===3?o.push([c(Object.assign({},y,{text:f[v][0]})).text,f[v][1],f[v][2]]):o.push(c(Object.assign({},y,{text:f[v]})).text);h.text=o}else h.text=c(Object.assign({},y,{text:f})).text}])})(Cn),(function(e){var t=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0},e.addFileToVFS=function(n,a){return t.call(this),this.internal.vFS[n]=a,this},e.getFileFromVFS=function(n){return t.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}})(Cn.API),(function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(a){var c,h,f,o,y,v,S,P=t,M=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],E=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],O={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},N={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},z=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],U=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),ee=!1,ae=0;this.__bidiEngine__={};var W=function(re){var H=re.charCodeAt(),Le=H>>8,Pe=N[Le];return Pe!==void 0?P[256*Pe+(255&H)]:Le===252||Le===253?"AL":U.test(Le)?"L":Le===8?"R":"N"},le=function(re){for(var H,Le=0;Le<re.length;Le++){if((H=W(re.charAt(Le)))==="L")return!1;if(H==="R")return!0}return!1},te=function(re,H,Le,Pe){var Me,Ze,ut,ke,Xe=H[Pe];switch(Xe){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":ee=!1;break;case"N":case"AN":break;case"EN":ee&&(Xe="AN");break;case"AL":ee=!0,Xe="R";break;case"WS":case"BN":Xe="N";break;case"CS":Pe<1||Pe+1>=H.length||(Me=Le[Pe-1])!=="EN"&&Me!=="AN"||(Ze=H[Pe+1])!=="EN"&&Ze!=="AN"?Xe="N":ee&&(Ze="AN"),Xe=Ze===Me?Ze:"N";break;case"ES":Xe=(Me=Pe>0?Le[Pe-1]:"B")==="EN"&&Pe+1<H.length&&H[Pe+1]==="EN"?"EN":"N";break;case"ET":if(Pe>0&&Le[Pe-1]==="EN"){Xe="EN";break}if(ee){Xe="N";break}for(ut=Pe+1,ke=H.length;ut<ke&&H[ut]==="ET";)ut++;Xe=ut<ke&&H[ut]==="EN"?"EN":"N";break;case"NSM":if(f&&!o){for(ke=H.length,ut=Pe+1;ut<ke&&H[ut]==="NSM";)ut++;if(ut<ke){var ge=re[Pe],Re=ge>=1425&&ge<=2303||ge===64286;if(Me=H[ut],Re&&(Me==="R"||Me==="AL")){Xe="R";break}}}Xe=Pe<1||(Me=H[Pe-1])==="B"?"N":Le[Pe-1];break;case"B":ee=!1,c=!0,Xe=ae;break;case"S":h=!0,Xe="N"}return Xe},we=function(re,H,Le){var Pe=re.split("");return Le&&Te(Pe,Le,{hiLevel:ae}),Pe.reverse(),H&&H.reverse(),Pe.join("")},Te=function(re,H,Le){var Pe,Me,Ze,ut,ke,Xe=-1,ge=re.length,Re=0,J=[],fe=ae?E:M,xe=[];for(ee=!1,c=!1,h=!1,Me=0;Me<ge;Me++)xe[Me]=W(re[Me]);for(Ze=0;Ze<ge;Ze++){if(ke=Re,J[Ze]=te(re,xe,J,Ze),Pe=240&(Re=fe[ke][O[J[Ze]]]),Re&=15,H[Ze]=ut=fe[Re][5],Pe>0)if(Pe===16){for(Me=Xe;Me<Ze;Me++)H[Me]=1;Xe=-1}else Xe=-1;if(fe[Re][6])Xe===-1&&(Xe=Ze);else if(Xe>-1){for(Me=Xe;Me<Ze;Me++)H[Me]=ut;Xe=-1}xe[Ze]==="B"&&(H[Ze]=0),Le.hiLevel|=ut}h&&(function(Ie,Fe,ot){for(var Et=0;Et<ot;Et++)if(Ie[Et]==="S"){Fe[Et]=ae;for(var gt=Et-1;gt>=0&&Ie[gt]==="WS";gt--)Fe[gt]=ae}})(xe,H,ge)},me=function(re,H,Le,Pe,Me){if(!(Me.hiLevel<re)){if(re===1&&ae===1&&!c)return H.reverse(),void(Le&&Le.reverse());for(var Ze,ut,ke,Xe,ge=H.length,Re=0;Re<ge;){if(Pe[Re]>=re){for(ke=Re+1;ke<ge&&Pe[ke]>=re;)ke++;for(Xe=Re,ut=ke-1;Xe<ut;Xe++,ut--)Ze=H[Xe],H[Xe]=H[ut],H[ut]=Ze,Le&&(Ze=Le[Xe],Le[Xe]=Le[ut],Le[ut]=Ze);Re=ke}Re++}}},Ve=function(re,H,Le){var Pe=re.split(""),Me={hiLevel:ae};return Le||(Le=[]),Te(Pe,Le,Me),(function(Ze,ut,ke){if(ke.hiLevel!==0&&S)for(var Xe,ge=0;ge<Ze.length;ge++)ut[ge]===1&&(Xe=z.indexOf(Ze[ge]))>=0&&(Ze[ge]=z[Xe+1])})(Pe,Le,Me),me(2,Pe,H,Le,Me),me(1,Pe,H,Le,Me),Pe.join("")};return this.__bidiEngine__.doBidiReorder=function(re,H,Le){if((function(Me,Ze){if(Ze)for(var ut=0;ut<Me.length;ut++)Ze[ut]=ut;o===void 0&&(o=le(Me)),v===void 0&&(v=le(Me))})(re,H),f||!y||v)if(f&&y&&o^v)ae=o?1:0,re=we(re,H,Le);else if(!f&&y&&v)ae=o?1:0,re=Ve(re,H,Le),re=we(re,H);else if(!f||o||y||v){if(f&&!y&&o^v)re=we(re,H),o?(ae=0,re=Ve(re,H,Le)):(ae=1,re=Ve(re,H,Le),re=we(re,H));else if(f&&o&&!y&&v)ae=1,re=Ve(re,H,Le),re=we(re,H);else if(!f&&!y&&o^v){var Pe=S;o?(ae=1,re=Ve(re,H,Le),ae=0,S=!1,re=Ve(re,H,Le),S=Pe):(ae=0,re=Ve(re,H,Le),re=we(re,H),ae=1,S=!1,re=Ve(re,H,Le),S=Pe,re=we(re,H))}}else ae=0,re=Ve(re,H,Le);else ae=o?1:0,re=Ve(re,H,Le);return re},this.__bidiEngine__.setOptions=function(re){re&&(f=re.isInputVisual,y=re.isOutputVisual,o=re.isInputRtl,v=re.isOutputRtl,S=re.isSymmetricSwapping)},this.__bidiEngine__.setOptions(a),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(a){var c=a.text;a.x,a.y;var h=a.options||{};a.mutex,h.lang;var f=[];if(h.isInputVisual=typeof h.isInputVisual!="boolean"||h.isInputVisual,n.setOptions(h),Object.prototype.toString.call(c)==="[object Array]"){var o=0;for(f=[],o=0;o<c.length;o+=1)Object.prototype.toString.call(c[o])==="[object Array]"?f.push([n.doBidiReorder(c[o][0]),c[o][1],c[o][2]]):f.push([n.doBidiReorder(c[o])]);a.text=f}else a.text=n.doBidiReorder(c);n.setOptions({isInputVisual:!0})}])})(Cn),Cn.API.TTFFont=(function(){function e(t){var n;if(this.rawData=t,n=this.contents=new Jc(t),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new mz(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new tz(this.contents),this.head=new nz(this),this.name=new lz(this),this.cmap=new uM(this),this.toUnicode={},this.hhea=new iz(this),this.maxp=new uz(this),this.hmtx=new cz(this),this.post=new az(this),this.os2=new oz(this),this.loca=new pz(this),this.glyf=new hz(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var t,n,a,c,h;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var f,o,y,v;for(v=[],f=0,o=(y=this.bbox).length;f<o;f++)t=y[f],v.push(Math.round(t*this.scaleFactor));return v}).call(this),this.stemV=0,this.post.exists?(a=255&(c=this.post.italic_angle),32768&(n=c>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+a)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(h=this.familyClass)===1||h===2||h===3||h===4||h===5||h===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(t){var n;return((n=this.cmap.unicode)!=null?n.codeMap[t]:void 0)||0},e.prototype.widthOfGlyph=function(t){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(t).advance*n},e.prototype.widthOfString=function(t,n,a){var c,h,f,o;for(f=0,h=0,o=(t=""+t).length;0<=o?h<o:h>o;h=0<=o?++h:--h)c=t.charCodeAt(h),f+=this.widthOfGlyph(this.characterToGlyph(c))+a*(1e3/n)||0;return f*(n/1e3)},e.prototype.lineHeight=function(t,n){var a;return n==null&&(n=!1),a=n?this.lineGap:0,(this.ascender+a-this.decender)/1e3*t},e})();var Eu,Jc=(function(){function e(t){this.data=t??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(t){return this.data[this.pos++]=t},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(t){return this.writeByte(t>>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt32=function(){var t;return(t=this.readUInt32())>=2147483648?t-4294967296:t},e.prototype.writeInt32=function(t){return t<0&&(t+=4294967296),this.writeUInt32(t)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(t){return this.writeByte(t>>8&255),this.writeByte(255&t)},e.prototype.readInt16=function(){var t;return(t=this.readUInt16())>=32768?t-65536:t},e.prototype.writeInt16=function(t){return t<0&&(t+=65536),this.writeUInt16(t)},e.prototype.readString=function(t){var n,a;for(a=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)a[n]=String.fromCharCode(this.readByte());return a.join("")},e.prototype.writeString=function(t){var n,a,c;for(c=[],n=0,a=t.length;0<=a?n<a:n>a;n=0<=a?++n:--n)c.push(this.writeByte(t.charCodeAt(n)));return c},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(t){return this.writeInt16(t)},e.prototype.readLongLong=function(){var t,n,a,c,h,f,o,y;return t=this.readByte(),n=this.readByte(),a=this.readByte(),c=this.readByte(),h=this.readByte(),f=this.readByte(),o=this.readByte(),y=this.readByte(),128&t?-1*(72057594037927940*(255^t)+281474976710656*(255^n)+1099511627776*(255^a)+4294967296*(255^c)+16777216*(255^h)+65536*(255^f)+256*(255^o)+(255^y)+1):72057594037927940*t+281474976710656*n+1099511627776*a+4294967296*c+16777216*h+65536*f+256*o+y},e.prototype.writeLongLong=function(t){var n,a;return n=Math.floor(t/4294967296),a=4294967295&t,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(a>>24&255),this.writeByte(a>>16&255),this.writeByte(a>>8&255),this.writeByte(255&a)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(t){return this.writeInt32(t)},e.prototype.read=function(t){var n,a;for(n=[],a=0;0<=t?a<t:a>t;a=0<=t?++a:--a)n.push(this.readByte());return n},e.prototype.write=function(t){var n,a,c,h;for(h=[],a=0,c=t.length;a<c;a++)n=t[a],h.push(this.writeByte(n));return h},e})(),tz=(function(){var e;function t(n){var a,c,h;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},c=0,h=this.tableCount;0<=h?c<h:c>h;c=0<=h?++c:--c)a={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[a.tag]=a}return t.prototype.encode=function(n){var a,c,h,f,o,y,v,S,P,M,E,O,N;for(N in E=Object.keys(n).length,y=Math.log(2),P=16*Math.floor(Math.log(E)/y),f=Math.floor(P/y),S=16*E-P,(c=new Jc).writeInt(this.scalarType),c.writeShort(E),c.writeShort(P),c.writeShort(f),c.writeShort(S),h=16*E,v=c.pos+h,o=null,O=[],n)for(M=n[N],c.writeString(N),c.writeInt(e(M)),c.writeInt(v),c.writeInt(M.length),O=O.concat(M),N==="head"&&(o=v),v+=M.length;v%4;)O.push(0),v++;return c.write(O),a=2981146554-e(c.data),c.pos=o+8,c.writeUInt32(a),c.data},e=function(n){var a,c,h,f;for(n=cM.call(n);n.length%4;)n.push(0);for(h=new Jc(n),c=0,a=0,f=n.length;a<f;a=a+=4)c+=h.readUInt32();return 4294967295&c},t})(),rz={}.hasOwnProperty,Qu=function(e,t){for(var n in t)rz.call(t,n)&&(e[n]=t[n]);function a(){this.constructor=e}return a.prototype=t.prototype,e.prototype=new a,e.__super__=t.prototype,e};Eu=(function(){function e(t){var n;this.file=t,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e})();var nz=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="head",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.revision=t.readInt(),this.checkSumAdjustment=t.readInt(),this.magicNumber=t.readInt(),this.flags=t.readShort(),this.unitsPerEm=t.readShort(),this.created=t.readLongLong(),this.modified=t.readLongLong(),this.xMin=t.readShort(),this.yMin=t.readShort(),this.xMax=t.readShort(),this.yMax=t.readShort(),this.macStyle=t.readShort(),this.lowestRecPPEM=t.readShort(),this.fontDirectionHint=t.readShort(),this.indexToLocFormat=t.readShort(),this.glyphDataFormat=t.readShort()},e.prototype.encode=function(t){var n;return(n=new Jc).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(t),n.writeShort(this.glyphDataFormat),n.data},e})(),AE=(function(){function e(t,n){var a,c,h,f,o,y,v,S,P,M,E,O,N,z,U,ee,ae;switch(this.platformID=t.readUInt16(),this.encodingID=t.readShort(),this.offset=n+t.readInt(),P=t.pos,t.pos=this.offset,this.format=t.readUInt16(),this.length=t.readUInt16(),this.language=t.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(y=0;y<256;++y)this.codeMap[y]=t.readByte();break;case 4:for(E=t.readUInt16(),M=E/2,t.pos+=6,h=(function(){var W,le;for(le=[],y=W=0;0<=M?W<M:W>M;y=0<=M?++W:--W)le.push(t.readUInt16());return le})(),t.pos+=2,N=(function(){var W,le;for(le=[],y=W=0;0<=M?W<M:W>M;y=0<=M?++W:--W)le.push(t.readUInt16());return le})(),v=(function(){var W,le;for(le=[],y=W=0;0<=M?W<M:W>M;y=0<=M?++W:--W)le.push(t.readUInt16());return le})(),S=(function(){var W,le;for(le=[],y=W=0;0<=M?W<M:W>M;y=0<=M?++W:--W)le.push(t.readUInt16());return le})(),c=(this.length-t.pos+this.offset)/2,o=(function(){var W,le;for(le=[],y=W=0;0<=c?W<c:W>c;y=0<=c?++W:--W)le.push(t.readUInt16());return le})(),y=U=0,ae=h.length;U<ae;y=++U)for(z=h[y],a=ee=O=N[y];O<=z?ee<=z:ee>=z;a=O<=z?++ee:--ee)S[y]===0?f=a+v[y]:(f=o[S[y]/2+(a-O)-(M-y)]||0)!==0&&(f+=v[y]),this.codeMap[a]=65535&f}t.pos=P}return e.encode=function(t,n){var a,c,h,f,o,y,v,S,P,M,E,O,N,z,U,ee,ae,W,le,te,we,Te,me,Ve,re,H,Le,Pe,Me,Ze,ut,ke,Xe,ge,Re,J,fe,xe,Ie,Fe,ot,Et,gt,wt,Zt,Ct;switch(Pe=new Jc,f=Object.keys(t).sort(function(Kt,Dt){return Kt-Dt}),n){case"macroman":for(N=0,z=(function(){var Kt=[];for(O=0;O<256;++O)Kt.push(0);return Kt})(),ee={0:0},h={},Me=0,Xe=f.length;Me<Xe;Me++)ee[gt=t[c=f[Me]]]==null&&(ee[gt]=++N),h[c]={old:t[c],new:ee[t[c]]},z[c]=ee[t[c]];return Pe.writeUInt16(1),Pe.writeUInt16(0),Pe.writeUInt32(12),Pe.writeUInt16(0),Pe.writeUInt16(262),Pe.writeUInt16(0),Pe.write(z),{charMap:h,subtable:Pe.data,maxGlyphID:N+1};case"unicode":for(H=[],P=[],ae=0,ee={},a={},U=v=null,Ze=0,ge=f.length;Ze<ge;Ze++)ee[le=t[c=f[Ze]]]==null&&(ee[le]=++ae),a[c]={old:le,new:ee[le]},o=ee[le]-c,U!=null&&o===v||(U&&P.push(U),H.push(c),v=o),U=c;for(U&&P.push(U),P.push(65535),H.push(65535),Ve=2*(me=H.length),Te=2*Math.pow(Math.log(me)/Math.LN2,2),M=Math.log(Te/2)/Math.LN2,we=2*me-Te,y=[],te=[],E=[],O=ut=0,Re=H.length;ut<Re;O=++ut){if(re=H[O],S=P[O],re===65535){y.push(0),te.push(0);break}if(re-(Le=a[re].new)>=32768)for(y.push(0),te.push(2*(E.length+me-O)),c=ke=re;re<=S?ke<=S:ke>=S;c=re<=S?++ke:--ke)E.push(a[c].new);else y.push(Le-re),te.push(0)}for(Pe.writeUInt16(3),Pe.writeUInt16(1),Pe.writeUInt32(12),Pe.writeUInt16(4),Pe.writeUInt16(16+8*me+2*E.length),Pe.writeUInt16(0),Pe.writeUInt16(Ve),Pe.writeUInt16(Te),Pe.writeUInt16(M),Pe.writeUInt16(we),ot=0,J=P.length;ot<J;ot++)c=P[ot],Pe.writeUInt16(c);for(Pe.writeUInt16(0),Et=0,fe=H.length;Et<fe;Et++)c=H[Et],Pe.writeUInt16(c);for(wt=0,xe=y.length;wt<xe;wt++)o=y[wt],Pe.writeUInt16(o);for(Zt=0,Ie=te.length;Zt<Ie;Zt++)W=te[Zt],Pe.writeUInt16(W);for(Ct=0,Fe=E.length;Ct<Fe;Ct++)N=E[Ct],Pe.writeUInt16(N);return{charMap:a,subtable:Pe.data,maxGlyphID:ae+1}}},e})(),uM=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="cmap",e.prototype.parse=function(t){var n,a,c;for(t.pos=this.offset,this.version=t.readUInt16(),c=t.readUInt16(),this.tables=[],this.unicode=null,a=0;0<=c?a<c:a>c;a=0<=c?++a:--a)n=new AE(t,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},e.encode=function(t,n){var a,c;return n==null&&(n="macroman"),a=AE.encode(t,n),(c=new Jc).writeUInt16(0),c.writeUInt16(1),a.table=c.data.concat(a.subtable),a},e})(),iz=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="hhea",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.ascender=t.readShort(),this.decender=t.readShort(),this.lineGap=t.readShort(),this.advanceWidthMax=t.readShort(),this.minLeftSideBearing=t.readShort(),this.minRightSideBearing=t.readShort(),this.xMaxExtent=t.readShort(),this.caretSlopeRise=t.readShort(),this.caretSlopeRun=t.readShort(),this.caretOffset=t.readShort(),t.pos+=8,this.metricDataFormat=t.readShort(),this.numberOfMetrics=t.readUInt16()},e})(),oz=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="OS/2",e.prototype.parse=function(t){if(t.pos=this.offset,this.version=t.readUInt16(),this.averageCharWidth=t.readShort(),this.weightClass=t.readUInt16(),this.widthClass=t.readUInt16(),this.type=t.readShort(),this.ySubscriptXSize=t.readShort(),this.ySubscriptYSize=t.readShort(),this.ySubscriptXOffset=t.readShort(),this.ySubscriptYOffset=t.readShort(),this.ySuperscriptXSize=t.readShort(),this.ySuperscriptYSize=t.readShort(),this.ySuperscriptXOffset=t.readShort(),this.ySuperscriptYOffset=t.readShort(),this.yStrikeoutSize=t.readShort(),this.yStrikeoutPosition=t.readShort(),this.familyClass=t.readShort(),this.panose=(function(){var n,a;for(a=[],n=0;n<10;++n)a.push(t.readByte());return a})(),this.charRange=(function(){var n,a;for(a=[],n=0;n<4;++n)a.push(t.readInt());return a})(),this.vendorID=t.readString(4),this.selection=t.readShort(),this.firstCharIndex=t.readShort(),this.lastCharIndex=t.readShort(),this.version>0&&(this.ascent=t.readShort(),this.descent=t.readShort(),this.lineGap=t.readShort(),this.winAscent=t.readShort(),this.winDescent=t.readShort(),this.codePageRange=(function(){var n,a;for(a=[],n=0;n<2;n=++n)a.push(t.readInt());return a})(),this.version>1))return this.xHeight=t.readShort(),this.capHeight=t.readShort(),this.defaultChar=t.readShort(),this.breakChar=t.readShort(),this.maxContext=t.readShort()},e})(),az=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="post",e.prototype.parse=function(t){var n,a,c;switch(t.pos=this.offset,this.format=t.readInt(),this.italicAngle=t.readInt(),this.underlinePosition=t.readShort(),this.underlineThickness=t.readShort(),this.isFixedPitch=t.readInt(),this.minMemType42=t.readInt(),this.maxMemType42=t.readInt(),this.minMemType1=t.readInt(),this.maxMemType1=t.readInt(),this.format){case 65536:case 196608:break;case 131072:var h;for(a=t.readUInt16(),this.glyphNameIndex=[],h=0;0<=a?h<a:h>a;h=0<=a?++h:--h)this.glyphNameIndex.push(t.readUInt16());for(this.names=[],c=[];t.pos<this.offset+this.length;)n=t.readByte(),c.push(this.names.push(t.readString(n)));return c;case 151552:return a=t.readUInt16(),this.offsets=t.read(a);case 262144:return this.map=(function(){var f,o,y;for(y=[],h=f=0,o=this.file.maxp.numGlyphs;0<=o?f<o:f>o;h=0<=o?++f:--f)y.push(t.readUInt32());return y}).call(this)}},e})(),sz=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},lz=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="name",e.prototype.parse=function(t){var n,a,c,h,f,o,y,v,S,P,M;for(t.pos=this.offset,t.readShort(),n=t.readShort(),o=t.readShort(),a=[],h=0;0<=n?h<n:h>n;h=0<=n?++h:--h)a.push({platformID:t.readShort(),encodingID:t.readShort(),languageID:t.readShort(),nameID:t.readShort(),length:t.readShort(),offset:this.offset+o+t.readShort()});for(y={},h=S=0,P=a.length;S<P;h=++S)c=a[h],t.pos=c.offset,v=t.readString(c.length),f=new sz(v,c),y[M=c.nameID]==null&&(y[M]=[]),y[c.nameID].push(f);this.strings=y,this.copyright=y[0],this.fontFamily=y[1],this.fontSubfamily=y[2],this.uniqueSubfamily=y[3],this.fontName=y[4],this.version=y[5];try{this.postscriptName=y[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=y[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=y[7],this.manufacturer=y[8],this.designer=y[9],this.description=y[10],this.vendorUrl=y[11],this.designerUrl=y[12],this.license=y[13],this.licenseUrl=y[14],this.preferredFamily=y[15],this.preferredSubfamily=y[17],this.compatibleFull=y[18],this.sampleText=y[19]},e})(),uz=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="maxp",e.prototype.parse=function(t){return t.pos=this.offset,this.version=t.readInt(),this.numGlyphs=t.readUInt16(),this.maxPoints=t.readUInt16(),this.maxContours=t.readUInt16(),this.maxCompositePoints=t.readUInt16(),this.maxComponentContours=t.readUInt16(),this.maxZones=t.readUInt16(),this.maxTwilightPoints=t.readUInt16(),this.maxStorage=t.readUInt16(),this.maxFunctionDefs=t.readUInt16(),this.maxInstructionDefs=t.readUInt16(),this.maxStackElements=t.readUInt16(),this.maxSizeOfInstructions=t.readUInt16(),this.maxComponentElements=t.readUInt16(),this.maxComponentDepth=t.readUInt16()},e})(),cz=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="hmtx",e.prototype.parse=function(t){var n,a,c,h,f,o,y;for(t.pos=this.offset,this.metrics=[],n=0,o=this.file.hhea.numberOfMetrics;0<=o?n<o:n>o;n=0<=o?++n:--n)this.metrics.push({advance:t.readUInt16(),lsb:t.readInt16()});for(c=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=(function(){var v,S;for(S=[],n=v=0;0<=c?v<c:v>c;n=0<=c?++v:--v)S.push(t.readInt16());return S})(),this.widths=(function(){var v,S,P,M;for(M=[],v=0,S=(P=this.metrics).length;v<S;v++)h=P[v],M.push(h.advance);return M}).call(this),a=this.widths[this.widths.length-1],y=[],n=f=0;0<=c?f<c:f>c;n=0<=c?++f:--f)y.push(this.widths.push(a));return y},e.prototype.forGlyph=function(t){return t in this.metrics?this.metrics[t]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[t-this.metrics.length]}},e})(),cM=[].slice,hz=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(t){var n,a,c,h,f,o,y,v,S,P;return t in this.cache?this.cache[t]:(h=this.file.loca,n=this.file.contents,a=h.indexOf(t),(c=h.lengthOf(t))===0?this.cache[t]=null:(n.pos=this.offset+a,f=(o=new Jc(n.read(c))).readShort(),v=o.readShort(),P=o.readShort(),y=o.readShort(),S=o.readShort(),this.cache[t]=f===-1?new dz(o,v,P,y,S):new fz(o,f,v,P,y,S),this.cache[t]))},e.prototype.encode=function(t,n,a){var c,h,f,o,y;for(f=[],h=[],o=0,y=n.length;o<y;o++)c=t[n[o]],h.push(f.length),c&&(f=f.concat(c.encode(a)));return h.push(f.length),{table:f,offsets:h}},e})(),fz=(function(){function e(t,n,a,c,h,f){this.raw=t,this.numberOfContours=n,this.xMin=a,this.yMin=c,this.xMax=h,this.yMax=f,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e})(),dz=(function(){function e(t,n,a,c,h){var f,o;for(this.raw=t,this.xMin=n,this.yMin=a,this.xMax=c,this.yMax=h,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],f=this.raw;o=f.readShort(),this.glyphOffsets.push(f.pos),this.glyphIDs.push(f.readUInt16()),32&o;)f.pos+=1&o?4:2,128&o?f.pos+=8:64&o?f.pos+=4:8&o&&(f.pos+=2)}return e.prototype.encode=function(){var t,n,a;for(n=new Jc(cM.call(this.raw.data)),t=0,a=this.glyphIDs.length;t<a;++t)n.pos=this.glyphOffsets[t];return n.data},e})(),pz=(function(){function e(){return e.__super__.constructor.apply(this,arguments)}return Qu(e,Eu),e.prototype.tag="loca",e.prototype.parse=function(t){var n,a;return t.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var c,h;for(h=[],a=0,c=this.length;a<c;a+=2)h.push(2*t.readUInt16());return h}).call(this):(function(){var c,h;for(h=[],a=0,c=this.length;a<c;a+=4)h.push(t.readUInt32());return h}).call(this)},e.prototype.indexOf=function(t){return this.offsets[t]},e.prototype.lengthOf=function(t){return this.offsets[t+1]-this.offsets[t]},e.prototype.encode=function(t,n){for(var a=new Uint32Array(this.offsets.length),c=0,h=0,f=0;f<a.length;++f)if(a[f]=c,h<n.length&&n[h]==f){++h,a[f]=c;var o=this.offsets[f],y=this.offsets[f+1]-o;y>0&&(c+=y)}for(var v=new Array(4*a.length),S=0;S<a.length;++S)v[4*S+3]=255&a[S],v[4*S+2]=(65280&a[S])>>8,v[4*S+1]=(16711680&a[S])>>16,v[4*S]=(4278190080&a[S])>>24;return v},e})(),mz=(function(){function e(t){this.font=t,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var t,n,a,c,h;for(n in c=this.font.cmap.tables[0].codeMap,t={},h=this.subset)a=h[n],t[n]=c[a];return t},e.prototype.glyphsFor=function(t){var n,a,c,h,f,o,y;for(c={},f=0,o=t.length;f<o;f++)c[h=t[f]]=this.font.glyf.glyphFor(h);for(h in n=[],c)(a=c[h])!=null&&a.compound&&n.push.apply(n,a.glyphIDs);if(n.length>0)for(h in y=this.glyphsFor(n))a=y[h],c[h]=a;return c},e.prototype.encode=function(t,n){var a,c,h,f,o,y,v,S,P,M,E,O,N,z,U;for(c in a=uM.encode(this.generateCmap(),"unicode"),f=this.glyphsFor(t),E={0:0},U=a.charMap)E[(y=U[c]).old]=y.new;for(O in M=a.maxGlyphID,f)O in E||(E[O]=M++);return S=(function(ee){var ae,W;for(ae in W={},ee)W[ee[ae]]=ae;return W})(E),P=Object.keys(S).sort(function(ee,ae){return ee-ae}),N=(function(){var ee,ae,W;for(W=[],ee=0,ae=P.length;ee<ae;ee++)o=P[ee],W.push(S[o]);return W})(),h=this.font.glyf.encode(f,N,E),v=this.font.loca.encode(h.offsets,N),z={cmap:this.font.cmap.raw(),glyf:h.table,loca:v,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(z["OS/2"]=this.font.os2.raw()),this.font.directory.encode(z)},e})();Cn.API.PDFObject=(function(){var e;function t(){}return e=function(n,a){return(Array(a+1).join("0")+n).slice(-a)},t.convert=function(n){var a,c,h,f;if(Array.isArray(n))return"["+(function(){var o,y,v;for(v=[],o=0,y=n.length;o<y;o++)a=n[o],v.push(t.convert(a));return v})().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n?.isString)return"("+n+")";if(n instanceof Date)return"(D:"+e(n.getUTCFullYear(),4)+e(n.getUTCMonth(),2)+e(n.getUTCDate(),2)+e(n.getUTCHours(),2)+e(n.getUTCMinutes(),2)+e(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(c in h=["<<"],n)f=n[c],h.push("/"+c+" "+t.convert(f));return h.push(">>"),h.join(`
1174
- `)}return""+n},t})();_e.createContext({});function gz(e,t,n={}){const a={type:"Feature"};return(n.id===0||n.id)&&(a.id=n.id),n.bbox&&(a.bbox=n.bbox),a.properties=t||{},a.geometry=e,a}function yz(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!PE(e[0])||!PE(e[1]))throw new Error("coordinates must contain numbers");return gz({type:"Point",coordinates:e},t,n)}function PE(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function hM(e,t,n){if(e!==null)for(var a,c,h,f,o,y,v,S=0,P=0,M,E=e.type,O=E==="FeatureCollection",N=E==="Feature",z=O?e.features.length:1,U=0;U<z;U++){v=O?e.features[U].geometry:N?e.geometry:e,M=v?v.type==="GeometryCollection":!1,o=M?v.geometries.length:1;for(var ee=0;ee<o;ee++){var ae=0,W=0;if(f=M?v.geometries[ee]:v,f!==null){y=f.coordinates;var le=f.type;switch(S=le==="Polygon"||le==="MultiPolygon"?1:0,le){case null:break;case"Point":if(t(y,P,U,ae,W)===!1)return!1;P++,ae++;break;case"LineString":case"MultiPoint":for(a=0;a<y.length;a++){if(t(y[a],P,U,ae,W)===!1)return!1;P++,le==="MultiPoint"&&ae++}le==="LineString"&&ae++;break;case"Polygon":case"MultiLineString":for(a=0;a<y.length;a++){for(c=0;c<y[a].length-S;c++){if(t(y[a][c],P,U,ae,W)===!1)return!1;P++}le==="MultiLineString"&&ae++,le==="Polygon"&&W++}le==="Polygon"&&ae++;break;case"MultiPolygon":for(a=0;a<y.length;a++){for(W=0,c=0;c<y[a].length;c++){for(h=0;h<y[a][c].length-S;h++){if(t(y[a][c][h],P,U,ae,W)===!1)return!1;P++}W++}ae++}break;case"GeometryCollection":for(a=0;a<f.geometries.length;a++)if(hM(f.geometries[a],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function fM(e,t={}){let n=0,a=0,c=0;return hM(e,function(h){n+=h[0],a+=h[1],c++}),yz([n/c,a/c],t.properties)}var Qm={exports:{}},_z=Qm.exports,IE;function vz(){return IE||(IE=1,(function(e,t){(function(n,a){e.exports=a()})(_z,(function(){var n=function(D,V){var Ee={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},it={on:function(st,Pt,ur){if(Ee[st]===void 0)throw new Error("Invalid event type: "+st);Ee[st].push({selector:Pt,fn:ur})},render:function(st){V.store.featureChanged(st)}},yt=function(st,Pt){for(var ur=Ee[st],xr=ur.length;xr--;){var Fr=ur[xr];if(Fr.selector(Pt)){Fr.fn.call(it,Pt)||V.store.render(),V.ui.updateMapClasses();break}}};return D.start.call(it),{render:D.render,stop:function(){D.stop&&D.stop()},trash:function(){D.trash&&(D.trash(),V.store.render())},combineFeatures:function(){D.combineFeatures&&D.combineFeatures()},uncombineFeatures:function(){D.uncombineFeatures&&D.uncombineFeatures()},drag:function(st){yt("drag",st)},click:function(st){yt("click",st)},mousemove:function(st){yt("mousemove",st)},mousedown:function(st){yt("mousedown",st)},mouseup:function(st){yt("mouseup",st)},mouseout:function(st){yt("mouseout",st)},keydown:function(st){yt("keydown",st)},keyup:function(st){yt("keyup",st)},touchstart:function(st){yt("touchstart",st)},touchmove:function(st){yt("touchmove",st)},touchend:function(st){yt("touchend",st)},tap:function(st){yt("tap",st)}}};function a(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function c(D){if(D.__esModule)return D;var V=D.default;if(typeof V=="function"){var Ee=function it(){if(this instanceof it){var yt=[null];yt.push.apply(yt,arguments);var st=Function.bind.apply(V,yt);return new st}return V.apply(this,arguments)};Ee.prototype=V.prototype}else Ee={};return Object.defineProperty(Ee,"__esModule",{value:!0}),Object.keys(D).forEach((function(it){var yt=Object.getOwnPropertyDescriptor(D,it);Object.defineProperty(Ee,it,yt.get?yt:{enumerable:!0,get:function(){return D[it]}})})),Ee}var h={},f={RADIUS:6378137},o=f;function y(D){var V=0;if(D&&D.length>0){V+=Math.abs(v(D[0]));for(var Ee=1;Ee<D.length;Ee++)V-=Math.abs(v(D[Ee]))}return V}function v(D){var V,Ee,it,yt,st,Pt,ur=0,xr=D.length;if(xr>2){for(Pt=0;Pt<xr;Pt++)Pt===xr-2?(it=xr-2,yt=xr-1,st=0):Pt===xr-1?(it=xr-1,yt=0,st=1):(it=Pt,yt=Pt+1,st=Pt+2),V=D[it],Ee=D[yt],ur+=(S(D[st][0])-S(V[0]))*Math.sin(S(Ee[1]));ur=ur*o.RADIUS*o.RADIUS/2}return ur}function S(D){return D*Math.PI/180}h.geometry=function D(V){var Ee,it=0;switch(V.type){case"Polygon":return y(V.coordinates);case"MultiPolygon":for(Ee=0;Ee<V.coordinates.length;Ee++)it+=y(V.coordinates[Ee]);return it;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(Ee=0;Ee<V.geometries.length;Ee++)it+=D(V.geometries[Ee]);return it}},h.ring=v;var P={CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},M={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},E={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},O={POLYGON:"polygon",LINE:"line_string",POINT:"point"},N={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},z={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},U={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},ee={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},ae={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},W={ACTIVE:"true",INACTIVE:"false"},le=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],te=-85,we=Object.freeze({__proto__:null,classes:P,sources:M,cursors:E,types:O,geojsonTypes:N,modes:z,events:U,updateActions:ee,meta:ae,activeStates:W,interactions:le,LAT_MIN:-90,LAT_RENDERED_MIN:te,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}),Te={Point:0,LineString:1,MultiLineString:1,Polygon:2};function me(D,V){var Ee=Te[D.geometry.type]-Te[V.geometry.type];return Ee===0&&D.geometry.type===N.POLYGON?D.area-V.area:Ee}function Ve(D){return D.map((function(V){return V.geometry.type===N.POLYGON&&(V.area=h.geometry({type:N.FEATURE,property:{},geometry:V.geometry})),V})).sort(me).map((function(V){return delete V.area,V}))}function re(D,V){return V===void 0&&(V=0),[[D.point.x-V,D.point.y-V],[D.point.x+V,D.point.y+V]]}function H(D){if(this._items={},this._nums={},this._length=D?D.length:0,D)for(var V=0,Ee=D.length;V<Ee;V++)this.add(D[V]),D[V]!==void 0&&(typeof D[V]=="string"?this._items[D[V]]=V:this._nums[D[V]]=V)}H.prototype.add=function(D){return this.has(D)||(this._length++,typeof D=="string"?this._items[D]=this._length:this._nums[D]=this._length),this},H.prototype.delete=function(D){return this.has(D)===!1||(this._length--,delete this._items[D],delete this._nums[D]),this},H.prototype.has=function(D){return(typeof D=="string"||typeof D=="number")&&(this._items[D]!==void 0||this._nums[D]!==void 0)},H.prototype.values=function(){var D=this,V=[];return Object.keys(this._items).forEach((function(Ee){V.push({k:Ee,v:D._items[Ee]})})),Object.keys(this._nums).forEach((function(Ee){V.push({k:JSON.parse(Ee),v:D._nums[Ee]})})),V.sort((function(Ee,it){return Ee.v-it.v})).map((function(Ee){return Ee.k}))},H.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var Le=[ae.FEATURE,ae.MIDPOINT,ae.VERTEX],Pe={click:function(D,V,Ee){return Me(D,V,Ee,Ee.options.clickBuffer)},touch:function(D,V,Ee){return Me(D,V,Ee,Ee.options.touchBuffer)}};function Me(D,V,Ee,it){if(Ee.map===null)return[];var yt=D?re(D,it):V,st={};Ee.options.styles&&(st.layers=Ee.options.styles.map((function(Fr){return Fr.id})).filter((function(Fr){return Ee.map.getLayer(Fr)!=null})));var Pt=Ee.map.queryRenderedFeatures(yt,st).filter((function(Fr){return Le.indexOf(Fr.properties.meta)!==-1})),ur=new H,xr=[];return Pt.forEach((function(Fr){var Nr=Fr.properties.id;ur.has(Nr)||(ur.add(Nr),xr.push(Fr))})),Ve(xr)}function Ze(D,V){var Ee=Pe.click(D,null,V),it={mouse:E.NONE};return Ee[0]&&(it.mouse=Ee[0].properties.active===W.ACTIVE?E.MOVE:E.POINTER,it.feature=Ee[0].properties.meta),V.events.currentModeName().indexOf("draw")!==-1&&(it.mouse=E.ADD),V.ui.queueMapClasses(it),V.ui.updateMapClasses(),Ee[0]}function ut(D,V){var Ee=D.x-V.x,it=D.y-V.y;return Math.sqrt(Ee*Ee+it*it)}function ke(D,V,Ee){Ee===void 0&&(Ee={});var it=Ee.fineTolerance!=null?Ee.fineTolerance:4,yt=Ee.grossTolerance!=null?Ee.grossTolerance:12,st=Ee.interval!=null?Ee.interval:500;D.point=D.point||V.point,D.time=D.time||V.time;var Pt=ut(D.point,V.point);return Pt<it||Pt<yt&&V.time-D.time<st}function Xe(D,V,Ee){Ee===void 0&&(Ee={});var it=Ee.tolerance!=null?Ee.tolerance:25,yt=Ee.interval!=null?Ee.interval:250;return D.point=D.point||V.point,D.time=D.time||V.time,ut(D.point,V.point)<it&&V.time-D.time<yt}var ge={exports:{}},Re=ge.exports=function(D,V){if(V||(V=16),D===void 0&&(D=128),D<=0)return"0";for(var Ee=Math.log(Math.pow(2,D))/Math.log(V),it=2;Ee===1/0;it*=2)Ee=Math.log(Math.pow(2,D/it))/Math.log(V)*it;var yt=Ee-Math.floor(Ee),st="";for(it=0;it<Math.floor(Ee);it++)st=Math.floor(Math.random()*V).toString(V)+st;if(yt){var Pt=Math.pow(V,yt);st=Math.floor(Math.random()*Pt).toString(V)+st}var ur=parseInt(st,V);return ur!==1/0&&ur>=Math.pow(2,D)?Re(D,V):st};Re.rack=function(D,V,Ee){var it=function(st){var Pt=0;do{if(Pt++>10){if(!Ee)throw new Error("too many ID collisions, use more bits");D+=Ee}var ur=Re(D,V)}while(Object.hasOwnProperty.call(yt,ur));return yt[ur]=st,ur},yt=it.hats={};return it.get=function(st){return it.hats[st]},it.set=function(st,Pt){return it.hats[st]=Pt,it},it.bits=D||128,it.base=V||16,it};var J=a(ge.exports),fe=function(D,V){this.ctx=D,this.properties=V.properties||{},this.coordinates=V.geometry.coordinates,this.id=V.id||J(),this.type=V.geometry.type};fe.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},fe.prototype.incomingCoords=function(D){this.setCoordinates(D)},fe.prototype.setCoordinates=function(D){this.coordinates=D,this.changed()},fe.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},fe.prototype.setProperty=function(D,V){this.properties[D]=V},fe.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:N.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},fe.prototype.internal=function(D){var V={id:this.id,meta:ae.FEATURE,"meta:type":this.type,active:W.INACTIVE,mode:D};if(this.ctx.options.userProperties)for(var Ee in this.properties)V["user_"+Ee]=this.properties[Ee];return{type:N.FEATURE,properties:V,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var xe=function(D,V){fe.call(this,D,V)};(xe.prototype=Object.create(fe.prototype)).isValid=function(){return typeof this.coordinates[0]=="number"&&typeof this.coordinates[1]=="number"},xe.prototype.updateCoordinate=function(D,V,Ee){this.coordinates=arguments.length===3?[V,Ee]:[D,V],this.changed()},xe.prototype.getCoordinate=function(){return this.getCoordinates()};var Ie=function(D,V){fe.call(this,D,V)};(Ie.prototype=Object.create(fe.prototype)).isValid=function(){return this.coordinates.length>1},Ie.prototype.addCoordinate=function(D,V,Ee){this.changed();var it=parseInt(D,10);this.coordinates.splice(it,0,[V,Ee])},Ie.prototype.getCoordinate=function(D){var V=parseInt(D,10);return JSON.parse(JSON.stringify(this.coordinates[V]))},Ie.prototype.removeCoordinate=function(D){this.changed(),this.coordinates.splice(parseInt(D,10),1)},Ie.prototype.updateCoordinate=function(D,V,Ee){var it=parseInt(D,10);this.coordinates[it]=[V,Ee],this.changed()};var Fe=function(D,V){fe.call(this,D,V),this.coordinates=this.coordinates.map((function(Ee){return Ee.slice(0,-1)}))};(Fe.prototype=Object.create(fe.prototype)).isValid=function(){return this.coordinates.length!==0&&this.coordinates.every((function(D){return D.length>2}))},Fe.prototype.incomingCoords=function(D){this.coordinates=D.map((function(V){return V.slice(0,-1)})),this.changed()},Fe.prototype.setCoordinates=function(D){this.coordinates=D,this.changed()},Fe.prototype.addCoordinate=function(D,V,Ee){this.changed();var it=D.split(".").map((function(yt){return parseInt(yt,10)}));this.coordinates[it[0]].splice(it[1],0,[V,Ee])},Fe.prototype.removeCoordinate=function(D){this.changed();var V=D.split(".").map((function(it){return parseInt(it,10)})),Ee=this.coordinates[V[0]];Ee&&(Ee.splice(V[1],1),Ee.length<3&&this.coordinates.splice(V[0],1))},Fe.prototype.getCoordinate=function(D){var V=D.split(".").map((function(it){return parseInt(it,10)})),Ee=this.coordinates[V[0]];return JSON.parse(JSON.stringify(Ee[V[1]]))},Fe.prototype.getCoordinates=function(){return this.coordinates.map((function(D){return D.concat([D[0]])}))},Fe.prototype.updateCoordinate=function(D,V,Ee){this.changed();var it=D.split("."),yt=parseInt(it[0],10),st=parseInt(it[1],10);this.coordinates[yt]===void 0&&(this.coordinates[yt]=[]),this.coordinates[yt][st]=[V,Ee]};var ot={MultiPoint:xe,MultiLineString:Ie,MultiPolygon:Fe},Et=function(D,V,Ee,it,yt){var st=Ee.split("."),Pt=parseInt(st[0],10),ur=st[1]?st.slice(1).join("."):null;return D[Pt][V](ur,it,yt)},gt=function(D,V){if(fe.call(this,D,V),delete this.coordinates,this.model=ot[V.geometry.type],this.model===void 0)throw new TypeError(V.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(V.geometry.coordinates)};function wt(D){this.map=D.map,this.drawConfig=JSON.parse(JSON.stringify(D.options||{})),this._ctx=D}(gt.prototype=Object.create(fe.prototype))._coordinatesToFeatures=function(D){var V=this,Ee=this.model.bind(this);return D.map((function(it){return new Ee(V.ctx,{id:J(),type:N.FEATURE,properties:{},geometry:{coordinates:it,type:V.type.replace("Multi","")}})}))},gt.prototype.isValid=function(){return this.features.every((function(D){return D.isValid()}))},gt.prototype.setCoordinates=function(D){this.features=this._coordinatesToFeatures(D),this.changed()},gt.prototype.getCoordinate=function(D){return Et(this.features,"getCoordinate",D)},gt.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((function(D){return D.type===N.POLYGON?D.getCoordinates():D.coordinates}))))},gt.prototype.updateCoordinate=function(D,V,Ee){Et(this.features,"updateCoordinate",D,V,Ee),this.changed()},gt.prototype.addCoordinate=function(D,V,Ee){Et(this.features,"addCoordinate",D,V,Ee),this.changed()},gt.prototype.removeCoordinate=function(D){Et(this.features,"removeCoordinate",D),this.changed()},gt.prototype.getFeatures=function(){return this.features},wt.prototype.setSelected=function(D){return this._ctx.store.setSelected(D)},wt.prototype.setSelectedCoordinates=function(D){var V=this;this._ctx.store.setSelectedCoordinates(D),D.reduce((function(Ee,it){return Ee[it.feature_id]===void 0&&(Ee[it.feature_id]=!0,V._ctx.store.get(it.feature_id).changed()),Ee}),{})},wt.prototype.getSelected=function(){return this._ctx.store.getSelected()},wt.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},wt.prototype.isSelected=function(D){return this._ctx.store.isSelected(D)},wt.prototype.getFeature=function(D){return this._ctx.store.get(D)},wt.prototype.select=function(D){return this._ctx.store.select(D)},wt.prototype.deselect=function(D){return this._ctx.store.deselect(D)},wt.prototype.deleteFeature=function(D,V){return V===void 0&&(V={}),this._ctx.store.delete(D,V)},wt.prototype.addFeature=function(D){return this._ctx.store.add(D)},wt.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},wt.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},wt.prototype.setActionableState=function(D){D===void 0&&(D={});var V={trash:D.trash||!1,combineFeatures:D.combineFeatures||!1,uncombineFeatures:D.uncombineFeatures||!1};return this._ctx.events.actionable(V)},wt.prototype.changeMode=function(D,V,Ee){return V===void 0&&(V={}),Ee===void 0&&(Ee={}),this._ctx.events.changeMode(D,V,Ee)},wt.prototype.updateUIClasses=function(D){return this._ctx.ui.queueMapClasses(D)},wt.prototype.activateUIButton=function(D){return this._ctx.ui.setActiveButton(D)},wt.prototype.featuresAt=function(D,V,Ee){if(Ee===void 0&&(Ee="click"),Ee!=="click"&&Ee!=="touch")throw new Error("invalid buffer type");return Pe[Ee](D,V,this._ctx)},wt.prototype.newFeature=function(D){var V=D.geometry.type;return V===N.POINT?new xe(this._ctx,D):V===N.LINE_STRING?new Ie(this._ctx,D):V===N.POLYGON?new Fe(this._ctx,D):new gt(this._ctx,D)},wt.prototype.isInstanceOf=function(D,V){if(D===N.POINT)return V instanceof xe;if(D===N.LINE_STRING)return V instanceof Ie;if(D===N.POLYGON)return V instanceof Fe;if(D==="MultiFeature")return V instanceof gt;throw new Error("Unknown feature class: "+D)},wt.prototype.doRender=function(D){return this._ctx.store.featureChanged(D)},wt.prototype.onSetup=function(){},wt.prototype.onDrag=function(){},wt.prototype.onClick=function(){},wt.prototype.onMouseMove=function(){},wt.prototype.onMouseDown=function(){},wt.prototype.onMouseUp=function(){},wt.prototype.onMouseOut=function(){},wt.prototype.onKeyUp=function(){},wt.prototype.onKeyDown=function(){},wt.prototype.onTouchStart=function(){},wt.prototype.onTouchMove=function(){},wt.prototype.onTouchEnd=function(){},wt.prototype.onTap=function(){},wt.prototype.onStop=function(){},wt.prototype.onTrash=function(){},wt.prototype.onCombineFeature=function(){},wt.prototype.onUncombineFeature=function(){},wt.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var Zt={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},Ct=Object.keys(Zt);function Kt(D){var V=Object.keys(D);return function(Ee,it){it===void 0&&(it={});var yt={},st=V.reduce((function(Pt,ur){return Pt[ur]=D[ur],Pt}),new wt(Ee));return{start:function(){var Pt=this;yt=st.onSetup(it),Ct.forEach((function(ur){var xr,Fr=Zt[ur],Nr=function(){return!1};D[Fr]&&(Nr=function(){return!0}),Pt.on(ur,Nr,(xr=Fr,function(_r){return st[xr](yt,_r)}))}))},stop:function(){st.onStop(yt)},trash:function(){st.onTrash(yt)},combineFeatures:function(){st.onCombineFeatures(yt)},uncombineFeatures:function(){st.onUncombineFeatures(yt)},render:function(Pt,ur){st.toDisplayFeatures(yt,Pt,ur)}}}}function Dt(D){return[].concat(D).filter((function(V){return V!==void 0}))}function Be(){var D=this;if(!(D.ctx.map&&D.ctx.map.getSource(M.HOT)!==void 0))return xr();var V=D.ctx.events.currentModeName();D.ctx.ui.queueMapClasses({mode:V});var Ee=[],it=[];D.isDirty?it=D.getAllIds():(Ee=D.getChangedIds().filter((function(Fr){return D.get(Fr)!==void 0})),it=D.sources.hot.filter((function(Fr){return Fr.properties.id&&Ee.indexOf(Fr.properties.id)===-1&&D.get(Fr.properties.id)!==void 0})).map((function(Fr){return Fr.properties.id}))),D.sources.hot=[];var yt=D.sources.cold.length;D.sources.cold=D.isDirty?[]:D.sources.cold.filter((function(Fr){var Nr=Fr.properties.id||Fr.properties.parent;return Ee.indexOf(Nr)===-1}));var st=yt!==D.sources.cold.length||it.length>0;function Pt(Fr,Nr){var _r=D.get(Fr).internal(V);D.ctx.events.currentModeRender(_r,(function(dn){D.sources[Nr].push(dn)}))}if(Ee.forEach((function(Fr){return Pt(Fr,"hot")})),it.forEach((function(Fr){return Pt(Fr,"cold")})),st&&D.ctx.map.getSource(M.COLD).setData({type:N.FEATURE_COLLECTION,features:D.sources.cold}),D.ctx.map.getSource(M.HOT).setData({type:N.FEATURE_COLLECTION,features:D.sources.hot}),D._emitSelectionChange&&(D.ctx.map.fire(U.SELECTION_CHANGE,{features:D.getSelected().map((function(Fr){return Fr.toGeoJSON()})),points:D.getSelectedCoordinates().map((function(Fr){return{type:N.FEATURE,properties:{},geometry:{type:N.POINT,coordinates:Fr.coordinates}}}))}),D._emitSelectionChange=!1),D._deletedFeaturesToEmit.length){var ur=D._deletedFeaturesToEmit.map((function(Fr){return Fr.toGeoJSON()}));D._deletedFeaturesToEmit=[],D.ctx.map.fire(U.DELETE,{features:ur})}function xr(){D.isDirty=!1,D.clearChangedIds()}xr(),D.ctx.map.fire(U.RENDER,{})}function Lr(D){var V,Ee=this;this._features={},this._featureIds=new H,this._selectedFeatureIds=new H,this._selectedCoordinates=[],this._changedFeatureIds=new H,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=D,this.sources={hot:[],cold:[]},this.render=function(){V||(V=requestAnimationFrame((function(){V=null,Be.call(Ee)})))},this.isDirty=!1}function fr(D,V){var Ee=D._selectedCoordinates.filter((function(it){return D._selectedFeatureIds.has(it.feature_id)}));D._selectedCoordinates.length===Ee.length||V.silent||(D._emitSelectionChange=!0),D._selectedCoordinates=Ee}Lr.prototype.createRenderBatch=function(){var D=this,V=this.render,Ee=0;return this.render=function(){Ee++},function(){D.render=V,Ee>0&&D.render()}},Lr.prototype.setDirty=function(){return this.isDirty=!0,this},Lr.prototype.featureChanged=function(D){return this._changedFeatureIds.add(D),this},Lr.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},Lr.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},Lr.prototype.getAllIds=function(){return this._featureIds.values()},Lr.prototype.add=function(D){return this.featureChanged(D.id),this._features[D.id]=D,this._featureIds.add(D.id),this},Lr.prototype.delete=function(D,V){var Ee=this;return V===void 0&&(V={}),Dt(D).forEach((function(it){Ee._featureIds.has(it)&&(Ee._featureIds.delete(it),Ee._selectedFeatureIds.delete(it),V.silent||Ee._deletedFeaturesToEmit.indexOf(Ee._features[it])===-1&&Ee._deletedFeaturesToEmit.push(Ee._features[it]),delete Ee._features[it],Ee.isDirty=!0)})),fr(this,V),this},Lr.prototype.get=function(D){return this._features[D]},Lr.prototype.getAll=function(){var D=this;return Object.keys(this._features).map((function(V){return D._features[V]}))},Lr.prototype.select=function(D,V){var Ee=this;return V===void 0&&(V={}),Dt(D).forEach((function(it){Ee._selectedFeatureIds.has(it)||(Ee._selectedFeatureIds.add(it),Ee._changedFeatureIds.add(it),V.silent||(Ee._emitSelectionChange=!0))})),this},Lr.prototype.deselect=function(D,V){var Ee=this;return V===void 0&&(V={}),Dt(D).forEach((function(it){Ee._selectedFeatureIds.has(it)&&(Ee._selectedFeatureIds.delete(it),Ee._changedFeatureIds.add(it),V.silent||(Ee._emitSelectionChange=!0))})),fr(this,V),this},Lr.prototype.clearSelected=function(D){return D===void 0&&(D={}),this.deselect(this._selectedFeatureIds.values(),{silent:D.silent}),this},Lr.prototype.setSelected=function(D,V){var Ee=this;return V===void 0&&(V={}),D=Dt(D),this.deselect(this._selectedFeatureIds.values().filter((function(it){return D.indexOf(it)===-1})),{silent:V.silent}),this.select(D.filter((function(it){return!Ee._selectedFeatureIds.has(it)})),{silent:V.silent}),this},Lr.prototype.setSelectedCoordinates=function(D){return this._selectedCoordinates=D,this._emitSelectionChange=!0,this},Lr.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},Lr.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},Lr.prototype.getSelected=function(){var D=this;return this._selectedFeatureIds.values().map((function(V){return D.get(V)}))},Lr.prototype.getSelectedCoordinates=function(){var D=this;return this._selectedCoordinates.map((function(V){return{coordinates:D.get(V.feature_id).getCoordinate(V.coord_path)}}))},Lr.prototype.isSelected=function(D){return this._selectedFeatureIds.has(D)},Lr.prototype.setFeatureProperty=function(D,V,Ee){this.get(D).setProperty(V,Ee),this.featureChanged(D)},Lr.prototype.storeMapConfig=function(){var D=this;le.forEach((function(V){D.ctx.map[V]&&(D._mapInitialConfig[V]=D.ctx.map[V].isEnabled())}))},Lr.prototype.restoreMapConfig=function(){var D=this;Object.keys(this._mapInitialConfig).forEach((function(V){D._mapInitialConfig[V]?D.ctx.map[V].enable():D.ctx.map[V].disable()}))},Lr.prototype.getInitialConfigValue=function(D){return this._mapInitialConfig[D]===void 0||this._mapInitialConfig[D]};var Mr=function(){for(var D=arguments,V={},Ee=0;Ee<arguments.length;Ee++){var it=D[Ee];for(var yt in it)Jt.call(it,yt)&&(V[yt]=it[yt])}return V},Jt=Object.prototype.hasOwnProperty,Or=a(Mr),Er=["mode","feature","mouse"];function lr(D){var V=null,Ee=null,it={onRemove:function(){return D.map.off("load",it.connect),clearInterval(Ee),it.removeLayers(),D.store.restoreMapConfig(),D.ui.removeButtons(),D.events.removeEventListeners(),D.ui.clearMapClasses(),D.boxZoomInitial&&D.map.boxZoom.enable(),D.map=null,D.container=null,D.store=null,V&&V.parentNode&&V.parentNode.removeChild(V),V=null,this},connect:function(){D.map.off("load",it.connect),clearInterval(Ee),it.addLayers(),D.store.storeMapConfig(),D.events.addEventListeners()},onAdd:function(yt){var st=yt.fire;return yt.fire=function(Pt,ur){var xr=arguments;return st.length===1&&arguments.length!==1&&(xr=[Or({},{type:Pt},ur)]),st.apply(yt,xr)},D.map=yt,D.events=(function(Pt){var ur=Object.keys(Pt.options.modes).reduce((function(nr,qr){return nr[qr]=Kt(Pt.options.modes[qr]),nr}),{}),xr={},Fr={},Nr={},_r=null,dn=null;Nr.drag=function(nr,qr){qr({point:nr.point,time:new Date().getTime()})?(Pt.ui.queueMapClasses({mouse:E.DRAG}),dn.drag(nr)):nr.originalEvent.stopPropagation()},Nr.mousedrag=function(nr){Nr.drag(nr,(function(qr){return!ke(xr,qr)}))},Nr.touchdrag=function(nr){Nr.drag(nr,(function(qr){return!Xe(Fr,qr)}))},Nr.mousemove=function(nr){if((nr.originalEvent.buttons!==void 0?nr.originalEvent.buttons:nr.originalEvent.which)===1)return Nr.mousedrag(nr);var qr=Ze(nr,Pt);nr.featureTarget=qr,dn.mousemove(nr)},Nr.mousedown=function(nr){xr={time:new Date().getTime(),point:nr.point};var qr=Ze(nr,Pt);nr.featureTarget=qr,dn.mousedown(nr)},Nr.mouseup=function(nr){var qr=Ze(nr,Pt);nr.featureTarget=qr,ke(xr,{point:nr.point,time:new Date().getTime()})?dn.click(nr):dn.mouseup(nr)},Nr.mouseout=function(nr){dn.mouseout(nr)},Nr.touchstart=function(nr){if(Pt.options.touchEnabled){Fr={time:new Date().getTime(),point:nr.point};var qr=Pe.touch(nr,null,Pt)[0];nr.featureTarget=qr,dn.touchstart(nr)}},Nr.touchmove=function(nr){if(Pt.options.touchEnabled)return dn.touchmove(nr),Nr.touchdrag(nr)},Nr.touchend=function(nr){if(nr.originalEvent.preventDefault(),Pt.options.touchEnabled){var qr=Pe.touch(nr,null,Pt)[0];nr.featureTarget=qr,Xe(Fr,{time:new Date().getTime(),point:nr.point})?dn.tap(nr):dn.touchend(nr)}};var Jr=function(nr){return!(nr===8||nr===46||nr>=48&&nr<=57)};function Sn(nr,qr,An){An===void 0&&(An={}),dn.stop();var Zn=ur[nr];if(Zn===void 0)throw new Error(nr+" is not valid");_r=nr;var Mn=Zn(Pt,qr);dn=n(Mn,Pt),An.silent||Pt.map.fire(U.MODE_CHANGE,{mode:nr}),Pt.store.setDirty(),Pt.store.render()}Nr.keydown=function(nr){(nr.srcElement||nr.target).classList.contains("mapboxgl-canvas")&&(nr.keyCode!==8&&nr.keyCode!==46||!Pt.options.controls.trash?Jr(nr.keyCode)?dn.keydown(nr):nr.keyCode===49&&Pt.options.controls.point?Sn(z.DRAW_POINT):nr.keyCode===50&&Pt.options.controls.line_string?Sn(z.DRAW_LINE_STRING):nr.keyCode===51&&Pt.options.controls.polygon&&Sn(z.DRAW_POLYGON):(nr.preventDefault(),dn.trash()))},Nr.keyup=function(nr){Jr(nr.keyCode)&&dn.keyup(nr)},Nr.zoomend=function(){Pt.store.changeZoom()},Nr.data=function(nr){if(nr.dataType==="style"){var qr=Pt.setup,An=Pt.map,Zn=Pt.options,Mn=Pt.store;Zn.styles.some((function(ti){return An.getLayer(ti.id)}))||(qr.addLayers(),Mn.setDirty(),Mn.render())}};var Qr={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){_r=Pt.options.defaultMode,dn=n(ur[_r](Pt),Pt)},changeMode:Sn,actionable:function(nr){var qr=!1;Object.keys(nr).forEach((function(An){if(Qr[An]===void 0)throw new Error("Invalid action type");Qr[An]!==nr[An]&&(qr=!0),Qr[An]=nr[An]})),qr&&Pt.map.fire(U.ACTIONABLE,{actions:Qr})},currentModeName:function(){return _r},currentModeRender:function(nr,qr){return dn.render(nr,qr)},fire:function(nr,qr){Nr[nr]&&Nr[nr](qr)},addEventListeners:function(){Pt.map.on("mousemove",Nr.mousemove),Pt.map.on("mousedown",Nr.mousedown),Pt.map.on("mouseup",Nr.mouseup),Pt.map.on("data",Nr.data),Pt.map.on("touchmove",Nr.touchmove),Pt.map.on("touchstart",Nr.touchstart),Pt.map.on("touchend",Nr.touchend),Pt.container.addEventListener("mouseout",Nr.mouseout),Pt.options.keybindings&&(Pt.container.addEventListener("keydown",Nr.keydown),Pt.container.addEventListener("keyup",Nr.keyup))},removeEventListeners:function(){Pt.map.off("mousemove",Nr.mousemove),Pt.map.off("mousedown",Nr.mousedown),Pt.map.off("mouseup",Nr.mouseup),Pt.map.off("data",Nr.data),Pt.map.off("touchmove",Nr.touchmove),Pt.map.off("touchstart",Nr.touchstart),Pt.map.off("touchend",Nr.touchend),Pt.container.removeEventListener("mouseout",Nr.mouseout),Pt.options.keybindings&&(Pt.container.removeEventListener("keydown",Nr.keydown),Pt.container.removeEventListener("keyup",Nr.keyup))},trash:function(nr){dn.trash(nr)},combineFeatures:function(){dn.combineFeatures()},uncombineFeatures:function(){dn.uncombineFeatures()},getMode:function(){return _r}}})(D),D.ui=(function(Pt){var ur={},xr=null,Fr={mode:null,feature:null,mouse:null},Nr={mode:null,feature:null,mouse:null};function _r(nr){Nr=Or(Nr,nr)}function dn(){var nr,qr;if(Pt.container){var An=[],Zn=[];Er.forEach((function(Mn){Nr[Mn]!==Fr[Mn]&&(An.push(Mn+"-"+Fr[Mn]),Nr[Mn]!==null&&Zn.push(Mn+"-"+Nr[Mn]))})),An.length>0&&(nr=Pt.container.classList).remove.apply(nr,An),Zn.length>0&&(qr=Pt.container.classList).add.apply(qr,Zn),Fr=Or(Fr,Nr)}}function Jr(nr,qr){qr===void 0&&(qr={});var An=document.createElement("button");return An.className=P.CONTROL_BUTTON+" "+qr.className,An.setAttribute("title",qr.title),qr.container.appendChild(An),An.addEventListener("click",(function(Zn){if(Zn.preventDefault(),Zn.stopPropagation(),Zn.target===xr)return Sn(),void qr.onDeactivate();Qr(nr),qr.onActivate()}),!0),An}function Sn(){xr&&(xr.classList.remove(P.ACTIVE_BUTTON),xr=null)}function Qr(nr){Sn();var qr=ur[nr];qr&&qr&&nr!=="trash"&&(qr.classList.add(P.ACTIVE_BUTTON),xr=qr)}return{setActiveButton:Qr,queueMapClasses:_r,updateMapClasses:dn,clearMapClasses:function(){_r({mode:null,feature:null,mouse:null}),dn()},addButtons:function(){var nr=Pt.options.controls,qr=document.createElement("div");return qr.className=P.CONTROL_GROUP+" "+P.CONTROL_BASE,nr&&(nr[O.LINE]&&(ur[O.LINE]=Jr(O.LINE,{container:qr,className:P.CONTROL_BUTTON_LINE,title:"LineString tool "+(Pt.options.keybindings?"(l)":""),onActivate:function(){return Pt.events.changeMode(z.DRAW_LINE_STRING)},onDeactivate:function(){return Pt.events.trash()}})),nr[O.POLYGON]&&(ur[O.POLYGON]=Jr(O.POLYGON,{container:qr,className:P.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(Pt.options.keybindings?"(p)":""),onActivate:function(){return Pt.events.changeMode(z.DRAW_POLYGON)},onDeactivate:function(){return Pt.events.trash()}})),nr[O.POINT]&&(ur[O.POINT]=Jr(O.POINT,{container:qr,className:P.CONTROL_BUTTON_POINT,title:"Marker tool "+(Pt.options.keybindings?"(m)":""),onActivate:function(){return Pt.events.changeMode(z.DRAW_POINT)},onDeactivate:function(){return Pt.events.trash()}})),nr.trash&&(ur.trash=Jr("trash",{container:qr,className:P.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){Pt.events.trash()}})),nr.combine_features&&(ur.combine_features=Jr("combineFeatures",{container:qr,className:P.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){Pt.events.combineFeatures()}})),nr.uncombine_features&&(ur.uncombine_features=Jr("uncombineFeatures",{container:qr,className:P.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){Pt.events.uncombineFeatures()}}))),qr},removeButtons:function(){Object.keys(ur).forEach((function(nr){var qr=ur[nr];qr.parentNode&&qr.parentNode.removeChild(qr),delete ur[nr]}))}}})(D),D.container=yt.getContainer(),D.store=new Lr(D),V=D.ui.addButtons(),D.options.boxSelect&&(D.boxZoomInitial=yt.boxZoom.isEnabled(),yt.boxZoom.disable(),yt.dragPan.disable(),yt.dragPan.enable()),yt.loaded()?it.connect():(yt.on("load",it.connect),Ee=setInterval((function(){yt.loaded()&&it.connect()}),16)),D.events.start(),V},addLayers:function(){D.map.addSource(M.COLD,{data:{type:N.FEATURE_COLLECTION,features:[]},type:"geojson"}),D.map.addSource(M.HOT,{data:{type:N.FEATURE_COLLECTION,features:[]},type:"geojson"}),D.options.styles.forEach((function(yt){D.map.addLayer(yt)})),D.store.setDirty(!0),D.store.render()},removeLayers:function(){D.options.styles.forEach((function(yt){D.map.getLayer(yt.id)&&D.map.removeLayer(yt.id)})),D.map.getSource(M.COLD)&&D.map.removeSource(M.COLD),D.map.getSource(M.HOT)&&D.map.removeSource(M.HOT)}};return D.setup=it,it}var yr=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}];function hn(D){return function(V){var Ee=V.featureTarget;return!!Ee&&!!Ee.properties&&Ee.properties.meta===D}}function Gr(D){return!!D.originalEvent&&!!D.originalEvent.shiftKey&&D.originalEvent.button===0}function jr(D){return!!D.featureTarget&&!!D.featureTarget.properties&&D.featureTarget.properties.active===W.ACTIVE&&D.featureTarget.properties.meta===ae.FEATURE}function Wr(D){return!!D.featureTarget&&!!D.featureTarget.properties&&D.featureTarget.properties.active===W.INACTIVE&&D.featureTarget.properties.meta===ae.FEATURE}function Ur(D){return D.featureTarget===void 0}function Br(D){return!!D.featureTarget&&!!D.featureTarget.properties&&D.featureTarget.properties.meta===ae.FEATURE}function vr(D){var V=D.featureTarget;return!!V&&!!V.properties&&V.properties.meta===ae.VERTEX}function Ir(D){return!!D.originalEvent&&D.originalEvent.shiftKey===!0}function pt(D){return D.keyCode===27}function he(D){return D.keyCode===13}var ce=Object.freeze({__proto__:null,isOfMetaType:hn,isShiftMousedown:Gr,isActiveFeature:jr,isInactiveFeature:Wr,noTarget:Ur,isFeature:Br,isVertex:vr,isShiftDown:Ir,isEscapeKey:pt,isEnterKey:he,isTrue:function(){return!0}}),Ae=He;function He(D,V){this.x=D,this.y=V}He.prototype={clone:function(){return new He(this.x,this.y)},add:function(D){return this.clone()._add(D)},sub:function(D){return this.clone()._sub(D)},multByPoint:function(D){return this.clone()._multByPoint(D)},divByPoint:function(D){return this.clone()._divByPoint(D)},mult:function(D){return this.clone()._mult(D)},div:function(D){return this.clone()._div(D)},rotate:function(D){return this.clone()._rotate(D)},rotateAround:function(D,V){return this.clone()._rotateAround(D,V)},matMult:function(D){return this.clone()._matMult(D)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(D){return this.x===D.x&&this.y===D.y},dist:function(D){return Math.sqrt(this.distSqr(D))},distSqr:function(D){var V=D.x-this.x,Ee=D.y-this.y;return V*V+Ee*Ee},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(D){return Math.atan2(this.y-D.y,this.x-D.x)},angleWith:function(D){return this.angleWithSep(D.x,D.y)},angleWithSep:function(D,V){return Math.atan2(this.x*V-this.y*D,this.x*D+this.y*V)},_matMult:function(D){var V=D[0]*this.x+D[1]*this.y,Ee=D[2]*this.x+D[3]*this.y;return this.x=V,this.y=Ee,this},_add:function(D){return this.x+=D.x,this.y+=D.y,this},_sub:function(D){return this.x-=D.x,this.y-=D.y,this},_mult:function(D){return this.x*=D,this.y*=D,this},_div:function(D){return this.x/=D,this.y/=D,this},_multByPoint:function(D){return this.x*=D.x,this.y*=D.y,this},_divByPoint:function(D){return this.x/=D.x,this.y/=D.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var D=this.y;return this.y=this.x,this.x=-D,this},_rotate:function(D){var V=Math.cos(D),Ee=Math.sin(D),it=V*this.x-Ee*this.y,yt=Ee*this.x+V*this.y;return this.x=it,this.y=yt,this},_rotateAround:function(D,V){var Ee=Math.cos(D),it=Math.sin(D),yt=V.x+Ee*(this.x-V.x)-it*(this.y-V.y),st=V.y+it*(this.x-V.x)+Ee*(this.y-V.y);return this.x=yt,this.y=st,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},He.convert=function(D){return D instanceof He?D:Array.isArray(D)?new He(D[0],D[1]):D};var tt=a(Ae);function mt(D,V){var Ee=V.getBoundingClientRect();return new tt(D.clientX-Ee.left-(V.clientLeft||0),D.clientY-Ee.top-(V.clientTop||0))}function St(D,V,Ee,it){return{type:N.FEATURE,properties:{meta:ae.VERTEX,parent:D,coord_path:Ee,active:it?W.ACTIVE:W.INACTIVE},geometry:{type:N.POINT,coordinates:V}}}function vt(D,V,Ee){var it=V.geometry.coordinates,yt=Ee.geometry.coordinates;if(it[1]>85||it[1]<te||yt[1]>85||yt[1]<te)return null;var st={lng:(it[0]+yt[0])/2,lat:(it[1]+yt[1])/2};return{type:N.FEATURE,properties:{meta:ae.MIDPOINT,parent:D,lng:st.lng,lat:st.lat,coord_path:Ee.properties.coord_path},geometry:{type:N.POINT,coordinates:[st.lng,st.lat]}}}function Ft(D,V,Ee){V===void 0&&(V={}),Ee===void 0&&(Ee=null);var it,yt=D.geometry,st=yt.type,Pt=yt.coordinates,ur=D.properties&&D.properties.id,xr=[];function Fr(_r,dn){var Jr="",Sn=null;_r.forEach((function(Qr,nr){var qr=dn!=null?dn+"."+nr:String(nr),An=St(ur,Qr,qr,Nr(qr));if(V.midpoints&&Sn){var Zn=vt(ur,Sn,An);Zn&&xr.push(Zn)}Sn=An;var Mn=JSON.stringify(Qr);Jr!==Mn&&xr.push(An),nr===0&&(Jr=Mn)}))}function Nr(_r){return!!V.selectedPaths&&V.selectedPaths.indexOf(_r)!==-1}return st===N.POINT?xr.push(St(ur,Pt,Ee,Nr(Ee))):st===N.POLYGON?Pt.forEach((function(_r,dn){Fr(_r,Ee!==null?Ee+"."+dn:String(dn))})):st===N.LINE_STRING?Fr(Pt,Ee):st.indexOf(N.MULTI_PREFIX)===0&&(it=st.replace(N.MULTI_PREFIX,""),Pt.forEach((function(_r,dn){var Jr={type:N.FEATURE,properties:D.properties,geometry:{type:it,coordinates:_r}};xr=xr.concat(Ft(Jr,V,dn))}))),xr}var It={enable:function(D){setTimeout((function(){D.map&&D.map.doubleClickZoom&&D._ctx&&D._ctx.store&&D._ctx.store.getInitialConfigValue&&D._ctx.store.getInitialConfigValue("doubleClickZoom")&&D.map.doubleClickZoom.enable()}),0)},disable:function(D){setTimeout((function(){D.map&&D.map.doubleClickZoom&&D.map.doubleClickZoom.disable()}),0)}},_t={exports:{}},kt=function(D){if(!D||!D.type)return null;var V=ct[D.type];if(!V)return null;if(V==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:D}]};if(V==="feature")return{type:"FeatureCollection",features:[D]};if(V==="featurecollection")return D},ct={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"},dr=a(kt),Zr=Object.freeze({__proto__:null,default:function D(V){switch(V&&V.type||null){case"FeatureCollection":return V.features=V.features.reduce((function(Ee,it){return Ee.concat(D(it))}),[]),V;case"Feature":return V.geometry?D(V.geometry).map((function(Ee){var it={type:"Feature",properties:JSON.parse(JSON.stringify(V.properties)),geometry:Ee};return V.id!==void 0&&(it.id=V.id),it})):[V];case"MultiPoint":return V.coordinates.map((function(Ee){return{type:"Point",coordinates:Ee}}));case"MultiPolygon":return V.coordinates.map((function(Ee){return{type:"Polygon",coordinates:Ee}}));case"MultiLineString":return V.coordinates.map((function(Ee){return{type:"LineString",coordinates:Ee}}));case"GeometryCollection":return V.geometries.map(D).reduce((function(Ee,it){return Ee.concat(it)}),[]);case"Point":case"Polygon":case"LineString":return[V]}}}),kr=kt,ar=c(Zr),sn=function(D){return(function V(Ee){return Array.isArray(Ee)&&Ee.length&&typeof Ee[0]=="number"?[Ee]:Ee.reduce((function(it,yt){return Array.isArray(yt)&&Array.isArray(yt[0])?it.concat(V(yt)):(it.push(yt),it)}),[])})(D)};ar instanceof Function||(ar=ar.default);var Q={exports:{}},pe=Q.exports=function(D){return new We(D)};function We(D){this.value=D}function ft(D,V,Ee){var it=[],yt=[],st=!0;return(function Pt(ur){var xr=Ee?Ht(ur):ur,Fr={},Nr=!0,_r={node:xr,node_:ur,path:[].concat(it),parent:yt[yt.length-1],parents:yt,key:it.slice(-1)[0],isRoot:it.length===0,level:it.length,circular:null,update:function(Sn,Qr){_r.isRoot||(_r.parent.node[_r.key]=Sn),_r.node=Sn,Qr&&(Nr=!1)},delete:function(Sn){delete _r.parent.node[_r.key],Sn&&(Nr=!1)},remove:function(Sn){Ln(_r.parent.node)?_r.parent.node.splice(_r.key,1):delete _r.parent.node[_r.key],Sn&&(Nr=!1)},keys:null,before:function(Sn){Fr.before=Sn},after:function(Sn){Fr.after=Sn},pre:function(Sn){Fr.pre=Sn},post:function(Sn){Fr.post=Sn},stop:function(){st=!1},block:function(){Nr=!1}};if(!st)return _r;function dn(){if(typeof _r.node=="object"&&_r.node!==null){_r.keys&&_r.node_===_r.node||(_r.keys=Sr(_r.node)),_r.isLeaf=_r.keys.length==0;for(var Sn=0;Sn<yt.length;Sn++)if(yt[Sn].node_===ur){_r.circular=yt[Sn];break}}else _r.isLeaf=!0,_r.keys=null;_r.notLeaf=!_r.isLeaf,_r.notRoot=!_r.isRoot}dn();var Jr=V.call(_r,_r.node);return Jr!==void 0&&_r.update&&_r.update(Jr),Fr.before&&Fr.before.call(_r,_r.node),Nr&&(typeof _r.node!="object"||_r.node===null||_r.circular||(yt.push(_r),dn(),vn(_r.keys,(function(Sn,Qr){it.push(Sn),Fr.pre&&Fr.pre.call(_r,_r.node[Sn],Sn);var nr=Pt(_r.node[Sn]);Ee&&ei.call(_r.node,Sn)&&(_r.node[Sn]=nr.node),nr.isLast=Qr==_r.keys.length-1,nr.isFirst=Qr==0,Fr.post&&Fr.post.call(_r,nr),it.pop()})),yt.pop()),Fr.after&&Fr.after.call(_r,_r.node)),_r})(D).node}function Ht(D){if(typeof D=="object"&&D!==null){var V;if(Ln(D))V=[];else if(Yt(D)==="[object Date]")V=new Date(D.getTime?D.getTime():D);else if((function(yt){return Yt(yt)==="[object RegExp]"})(D))V=new RegExp(D);else if((function(yt){return Yt(yt)==="[object Error]"})(D))V={message:D.message};else if((function(yt){return Yt(yt)==="[object Boolean]"})(D))V=new Boolean(D);else if((function(yt){return Yt(yt)==="[object Number]"})(D))V=new Number(D);else if((function(yt){return Yt(yt)==="[object String]"})(D))V=new String(D);else if(Object.create&&Object.getPrototypeOf)V=Object.create(Object.getPrototypeOf(D));else if(D.constructor===Object)V={};else{var Ee=D.constructor&&D.constructor.prototype||D.__proto__||{},it=function(){};it.prototype=Ee,V=new it}return vn(Sr(D),(function(yt){V[yt]=D[yt]})),V}return D}We.prototype.get=function(D){for(var V=this.value,Ee=0;Ee<D.length;Ee++){var it=D[Ee];if(!V||!ei.call(V,it)){V=void 0;break}V=V[it]}return V},We.prototype.has=function(D){for(var V=this.value,Ee=0;Ee<D.length;Ee++){var it=D[Ee];if(!V||!ei.call(V,it))return!1;V=V[it]}return!0},We.prototype.set=function(D,V){for(var Ee=this.value,it=0;it<D.length-1;it++){var yt=D[it];ei.call(Ee,yt)||(Ee[yt]={}),Ee=Ee[yt]}return Ee[D[it]]=V,V},We.prototype.map=function(D){return ft(this.value,D,!0)},We.prototype.forEach=function(D){return this.value=ft(this.value,D,!1),this.value},We.prototype.reduce=function(D,V){var Ee=arguments.length===1,it=Ee?this.value:V;return this.forEach((function(yt){this.isRoot&&Ee||(it=D.call(this,it,yt))})),it},We.prototype.paths=function(){var D=[];return this.forEach((function(V){D.push(this.path)})),D},We.prototype.nodes=function(){var D=[];return this.forEach((function(V){D.push(this.node)})),D},We.prototype.clone=function(){var D=[],V=[];return(function Ee(it){for(var yt=0;yt<D.length;yt++)if(D[yt]===it)return V[yt];if(typeof it=="object"&&it!==null){var st=Ht(it);return D.push(it),V.push(st),vn(Sr(it),(function(Pt){st[Pt]=Ee(it[Pt])})),D.pop(),V.pop(),st}return it})(this.value)};var Sr=Object.keys||function(D){var V=[];for(var Ee in D)V.push(Ee);return V};function Yt(D){return Object.prototype.toString.call(D)}var Ln=Array.isArray||function(D){return Object.prototype.toString.call(D)==="[object Array]"},vn=function(D,V){if(D.forEach)return D.forEach(V);for(var Ee=0;Ee<D.length;Ee++)V(D[Ee],Ee,D)};vn(Sr(We.prototype),(function(D){pe[D]=function(V){var Ee=[].slice.call(arguments,1),it=new We(V);return it[D].apply(it,Ee)}}));var ei=Object.hasOwnProperty||function(D,V){return V in D},ai=Q.exports,pr=Vr;function Vr(D){if(!(this instanceof Vr))return new Vr(D);this._bbox=D||[1/0,1/0,-1/0,-1/0],this._valid=!!D}Vr.prototype.include=function(D){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],D[0]),this._bbox[1]=Math.min(this._bbox[1],D[1]),this._bbox[2]=Math.max(this._bbox[2],D[0]),this._bbox[3]=Math.max(this._bbox[3],D[1]),this},Vr.prototype.equals=function(D){var V;return V=D instanceof Vr?D.bbox():D,this._bbox[0]==V[0]&&this._bbox[1]==V[1]&&this._bbox[2]==V[2]&&this._bbox[3]==V[3]},Vr.prototype.center=function(D){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Vr.prototype.union=function(D){var V;return this._valid=!0,V=D instanceof Vr?D.bbox():D,this._bbox[0]=Math.min(this._bbox[0],V[0]),this._bbox[1]=Math.min(this._bbox[1],V[1]),this._bbox[2]=Math.max(this._bbox[2],V[2]),this._bbox[3]=Math.max(this._bbox[3],V[3]),this},Vr.prototype.bbox=function(){return this._valid?this._bbox:null},Vr.prototype.contains=function(D){if(!D)return this._fastContains();if(!this._valid)return null;var V=D[0],Ee=D[1];return this._bbox[0]<=V&&this._bbox[1]<=Ee&&this._bbox[2]>=V&&this._bbox[3]>=Ee},Vr.prototype.intersect=function(D){return this._valid?(V=D instanceof Vr?D.bbox():D,!(this._bbox[0]>V[2]||this._bbox[2]<V[0]||this._bbox[3]<V[1]||this._bbox[1]>V[3])):null;var V},Vr.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var D="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",D)},Vr.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var ln=function(D){if(!D)return[];var V=ar(kr(D)),Ee=[];return V.features.forEach((function(it){it.geometry&&(Ee=Ee.concat(sn(it.geometry.coordinates)))})),Ee},di=ai,no=pr,Oi={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},bn=Object.keys(Oi);function fo(D){for(var V=no(),Ee=ln(D),it=0;it<Ee.length;it++)V.include(Ee[it]);return V}_t.exports=function(D){return fo(D).bbox()},_t.exports.polygon=function(D){return fo(D).polygon()},_t.exports.bboxify=function(D){return di(D).map((function(V){V&&bn.some((function(Ee){return!!V[Ee]&&Oi[Ee].indexOf(V.type)!==-1}))&&(V.bbox=fo(V).bbox(),this.update(V))}))};var Ci=a(_t.exports),hi=-90;function zo(D,V){var Ee=hi,it=90,yt=hi,st=90,Pt=270,ur=-270;D.forEach((function(Fr){var Nr=Ci(Fr),_r=Nr[1],dn=Nr[3],Jr=Nr[0],Sn=Nr[2];_r>Ee&&(Ee=_r),dn<it&&(it=dn),dn>yt&&(yt=dn),_r<st&&(st=_r),Jr<Pt&&(Pt=Jr),Sn>ur&&(ur=Sn)}));var xr=V;return Ee+xr.lat>85&&(xr.lat=85-Ee),yt+xr.lat>90&&(xr.lat=90-yt),it+xr.lat<-85&&(xr.lat=-85-it),st+xr.lat<hi&&(xr.lat=hi-st),Pt+xr.lng<=-270&&(xr.lng+=360*Math.ceil(Math.abs(xr.lng)/360)),ur+xr.lng>=270&&(xr.lng-=360*Math.ceil(Math.abs(xr.lng)/360)),xr}function ms(D,V){var Ee=zo(D.map((function(it){return it.toGeoJSON()})),V);D.forEach((function(it){var yt,st=it.getCoordinates(),Pt=function(xr){var Fr={lng:xr[0]+Ee.lng,lat:xr[1]+Ee.lat};return[Fr.lng,Fr.lat]},ur=function(xr){return xr.map((function(Fr){return Pt(Fr)}))};it.type===N.POINT?yt=Pt(st):it.type===N.LINE_STRING||it.type===N.MULTI_POINT?yt=st.map(Pt):it.type===N.POLYGON||it.type===N.MULTI_LINE_STRING?yt=st.map(ur):it.type===N.MULTI_POLYGON&&(yt=st.map((function(xr){return xr.map((function(Fr){return ur(Fr)}))}))),it.incomingCoords(yt)}))}var qn={onSetup:function(D){var V=this,Ee={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:D.featureIds||[]};return this.setSelected(Ee.initiallySelectedFeatureIds.filter((function(it){return V.getFeature(it)!==void 0}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),Ee},fireUpdate:function(){this.map.fire(U.UPDATE,{action:ee.MOVE,features:this.getSelected().map((function(D){return D.toGeoJSON()}))})},fireActionable:function(){var D=this,V=this.getSelected(),Ee=V.filter((function(ur){return D.isInstanceOf("MultiFeature",ur)})),it=!1;if(V.length>1){it=!0;var yt=V[0].type.replace("Multi","");V.forEach((function(ur){ur.type.replace("Multi","")!==yt&&(it=!1)}))}var st=Ee.length>0,Pt=V.length>0;this.setActionableState({combineFeatures:it,uncombineFeatures:st,trash:Pt})},getUniqueIds:function(D){return D.length?D.map((function(V){return V.properties.id})).filter((function(V){return V!==void 0})).reduce((function(V,Ee){return V.add(Ee),V}),new H).values():[]},stopExtendedInteractions:function(D){D.boxSelectElement&&(D.boxSelectElement.parentNode&&D.boxSelectElement.parentNode.removeChild(D.boxSelectElement),D.boxSelectElement=null),this.map.dragPan.enable(),D.boxSelecting=!1,D.canBoxSelect=!1,D.dragMoving=!1,D.canDragMove=!1},onStop:function(){It.enable(this)},onMouseMove:function(D,V){return Br(V)&&D.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(D),!0},onMouseOut:function(D){return!D.dragMoving||this.fireUpdate()}};qn.onTap=qn.onClick=function(D,V){return Ur(V)?this.clickAnywhere(D,V):hn(ae.VERTEX)(V)?this.clickOnVertex(D,V):Br(V)?this.clickOnFeature(D,V):void 0},qn.clickAnywhere=function(D){var V=this,Ee=this.getSelectedIds();Ee.length&&(this.clearSelectedFeatures(),Ee.forEach((function(it){return V.doRender(it)}))),It.enable(this),this.stopExtendedInteractions(D)},qn.clickOnVertex=function(D,V){this.changeMode(z.DIRECT_SELECT,{featureId:V.featureTarget.properties.parent,coordPath:V.featureTarget.properties.coord_path,startPos:V.lngLat}),this.updateUIClasses({mouse:E.MOVE})},qn.startOnActiveFeature=function(D,V){this.stopExtendedInteractions(D),this.map.dragPan.disable(),this.doRender(V.featureTarget.properties.id),D.canDragMove=!0,D.dragMoveLocation=V.lngLat},qn.clickOnFeature=function(D,V){var Ee=this;It.disable(this),this.stopExtendedInteractions(D);var it=Ir(V),yt=this.getSelectedIds(),st=V.featureTarget.properties.id,Pt=this.isSelected(st);if(!it&&Pt&&this.getFeature(st).type!==N.POINT)return this.changeMode(z.DIRECT_SELECT,{featureId:st});Pt&&it?(this.deselect(st),this.updateUIClasses({mouse:E.POINTER}),yt.length===1&&It.enable(this)):!Pt&&it?(this.select(st),this.updateUIClasses({mouse:E.MOVE})):Pt||it||(yt.forEach((function(ur){return Ee.doRender(ur)})),this.setSelected(st),this.updateUIClasses({mouse:E.MOVE})),this.doRender(st)},qn.onMouseDown=function(D,V){return jr(V)?this.startOnActiveFeature(D,V):this.drawConfig.boxSelect&&Gr(V)?this.startBoxSelect(D,V):void 0},qn.startBoxSelect=function(D,V){this.stopExtendedInteractions(D),this.map.dragPan.disable(),D.boxSelectStartLocation=mt(V.originalEvent,this.map.getContainer()),D.canBoxSelect=!0},qn.onTouchStart=function(D,V){if(jr(V))return this.startOnActiveFeature(D,V)},qn.onDrag=function(D,V){return D.canDragMove?this.dragMove(D,V):this.drawConfig.boxSelect&&D.canBoxSelect?this.whileBoxSelect(D,V):void 0},qn.whileBoxSelect=function(D,V){D.boxSelecting=!0,this.updateUIClasses({mouse:E.ADD}),D.boxSelectElement||(D.boxSelectElement=document.createElement("div"),D.boxSelectElement.classList.add(P.BOX_SELECT),this.map.getContainer().appendChild(D.boxSelectElement));var Ee=mt(V.originalEvent,this.map.getContainer()),it=Math.min(D.boxSelectStartLocation.x,Ee.x),yt=Math.max(D.boxSelectStartLocation.x,Ee.x),st=Math.min(D.boxSelectStartLocation.y,Ee.y),Pt=Math.max(D.boxSelectStartLocation.y,Ee.y),ur="translate("+it+"px, "+st+"px)";D.boxSelectElement.style.transform=ur,D.boxSelectElement.style.WebkitTransform=ur,D.boxSelectElement.style.width=yt-it+"px",D.boxSelectElement.style.height=Pt-st+"px"},qn.dragMove=function(D,V){D.dragMoving=!0,V.originalEvent.stopPropagation();var Ee={lng:V.lngLat.lng-D.dragMoveLocation.lng,lat:V.lngLat.lat-D.dragMoveLocation.lat};ms(this.getSelected(),Ee),D.dragMoveLocation=V.lngLat},qn.onTouchEnd=qn.onMouseUp=function(D,V){var Ee=this;if(D.dragMoving)this.fireUpdate();else if(D.boxSelecting){var it=[D.boxSelectStartLocation,mt(V.originalEvent,this.map.getContainer())],yt=this.featuresAt(null,it,"click"),st=this.getUniqueIds(yt).filter((function(Pt){return!Ee.isSelected(Pt)}));st.length&&(this.select(st),st.forEach((function(Pt){return Ee.doRender(Pt)})),this.updateUIClasses({mouse:E.MOVE}))}this.stopExtendedInteractions(D)},qn.toDisplayFeatures=function(D,V,Ee){V.properties.active=this.isSelected(V.properties.id)?W.ACTIVE:W.INACTIVE,Ee(V),this.fireActionable(),V.properties.active===W.ACTIVE&&V.geometry.type!==N.POINT&&Ft(V).forEach(Ee)},qn.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},qn.onCombineFeatures=function(){var D=this.getSelected();if(!(D.length===0||D.length<2)){for(var V=[],Ee=[],it=D[0].type.replace("Multi",""),yt=0;yt<D.length;yt++){var st=D[yt];if(st.type.replace("Multi","")!==it)return;st.type.includes("Multi")?st.getCoordinates().forEach((function(ur){V.push(ur)})):V.push(st.getCoordinates()),Ee.push(st.toGeoJSON())}if(Ee.length>1){var Pt=this.newFeature({type:N.FEATURE,properties:Ee[0].properties,geometry:{type:"Multi"+it,coordinates:V}});this.addFeature(Pt),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([Pt.id]),this.map.fire(U.COMBINE_FEATURES,{createdFeatures:[Pt.toGeoJSON()],deletedFeatures:Ee})}this.fireActionable()}},qn.onUncombineFeatures=function(){var D=this,V=this.getSelected();if(V.length!==0){for(var Ee=[],it=[],yt=function(Pt){var ur=V[Pt];D.isInstanceOf("MultiFeature",ur)&&(ur.getFeatures().forEach((function(xr){D.addFeature(xr),xr.properties=ur.properties,Ee.push(xr.toGeoJSON()),D.select([xr.id])})),D.deleteFeature(ur.id,{silent:!0}),it.push(ur.toGeoJSON()))},st=0;st<V.length;st++)yt(st);Ee.length>1&&this.map.fire(U.UNCOMBINE_FEATURES,{createdFeatures:Ee,deletedFeatures:it}),this.fireActionable()}};var gs=hn(ae.VERTEX),jo=hn(ae.MIDPOINT),Wn={fireUpdate:function(){this.map.fire(U.UPDATE,{action:ee.CHANGE_COORDINATES,features:this.getSelected().map((function(D){return D.toGeoJSON()}))})},fireActionable:function(D){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:D.selectedCoordPaths.length>0})},startDragging:function(D,V){this.map.dragPan.disable(),D.canDragMove=!0,D.dragMoveLocation=V.lngLat},stopDragging:function(D){this.map.dragPan.enable(),D.dragMoving=!1,D.canDragMove=!1,D.dragMoveLocation=null},onVertex:function(D,V){this.startDragging(D,V);var Ee=V.featureTarget.properties,it=D.selectedCoordPaths.indexOf(Ee.coord_path);Ir(V)||it!==-1?Ir(V)&&it===-1&&D.selectedCoordPaths.push(Ee.coord_path):D.selectedCoordPaths=[Ee.coord_path];var yt=this.pathsToCoordinates(D.featureId,D.selectedCoordPaths);this.setSelectedCoordinates(yt)},onMidpoint:function(D,V){this.startDragging(D,V);var Ee=V.featureTarget.properties;D.feature.addCoordinate(Ee.coord_path,Ee.lng,Ee.lat),this.fireUpdate(),D.selectedCoordPaths=[Ee.coord_path]},pathsToCoordinates:function(D,V){return V.map((function(Ee){return{feature_id:D,coord_path:Ee}}))},onFeature:function(D,V){D.selectedCoordPaths.length===0?this.startDragging(D,V):this.stopDragging(D)},dragFeature:function(D,V,Ee){ms(this.getSelected(),Ee),D.dragMoveLocation=V.lngLat},dragVertex:function(D,V,Ee){for(var it=D.selectedCoordPaths.map((function(ur){return D.feature.getCoordinate(ur)})),yt=zo(it.map((function(ur){return{type:N.FEATURE,properties:{},geometry:{type:N.POINT,coordinates:ur}}})),Ee),st=0;st<it.length;st++){var Pt=it[st];D.feature.updateCoordinate(D.selectedCoordPaths[st],Pt[0]+yt.lng,Pt[1]+yt.lat)}},clickNoTarget:function(){this.changeMode(z.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(z.SIMPLE_SELECT)},clickActiveFeature:function(D){D.selectedCoordPaths=[],this.clearSelectedCoordinates(),D.feature.changed()},onSetup:function(D){var V=D.featureId,Ee=this.getFeature(V);if(!Ee)throw new Error("You must provide a featureId to enter direct_select mode");if(Ee.type===N.POINT)throw new TypeError("direct_select mode doesn't handle point features");var it={featureId:V,feature:Ee,dragMoveLocation:D.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:D.coordPath?[D.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(V,it.selectedCoordPaths)),this.setSelected(V),It.disable(this),this.setActionableState({trash:!0}),it},onStop:function(){It.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(D,V,Ee){D.featureId===V.properties.id?(V.properties.active=W.ACTIVE,Ee(V),Ft(V,{map:this.map,midpoints:!0,selectedPaths:D.selectedCoordPaths}).forEach(Ee)):(V.properties.active=W.INACTIVE,Ee(V)),this.fireActionable(D)},onTrash:function(D){D.selectedCoordPaths.sort((function(V,Ee){return Ee.localeCompare(V,"en",{numeric:!0})})).forEach((function(V){return D.feature.removeCoordinate(V)})),this.fireUpdate(),D.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(D),D.feature.isValid()===!1&&(this.deleteFeature([D.featureId]),this.changeMode(z.SIMPLE_SELECT,{}))},onMouseMove:function(D,V){var Ee=jr(V),it=gs(V),yt=jo(V),st=D.selectedCoordPaths.length===0;return Ee&&st||it&&!st?this.updateUIClasses({mouse:E.MOVE}):this.updateUIClasses({mouse:E.NONE}),(it||Ee||yt)&&D.dragMoving&&this.fireUpdate(),this.stopDragging(D),!0},onMouseOut:function(D){return D.dragMoving&&this.fireUpdate(),!0}};Wn.onTouchStart=Wn.onMouseDown=function(D,V){return gs(V)?this.onVertex(D,V):jr(V)?this.onFeature(D,V):jo(V)?this.onMidpoint(D,V):void 0},Wn.onDrag=function(D,V){if(D.canDragMove===!0){D.dragMoving=!0,V.originalEvent.stopPropagation();var Ee={lng:V.lngLat.lng-D.dragMoveLocation.lng,lat:V.lngLat.lat-D.dragMoveLocation.lat};D.selectedCoordPaths.length>0?this.dragVertex(D,V,Ee):this.dragFeature(D,V,Ee),D.dragMoveLocation=V.lngLat}},Wn.onClick=function(D,V){return Ur(V)?this.clickNoTarget(D,V):jr(V)?this.clickActiveFeature(D,V):Wr(V)?this.clickInactive(D,V):void this.stopDragging(D)},Wn.onTap=function(D,V){return Ur(V)?this.clickNoTarget(D,V):jr(V)?this.clickActiveFeature(D,V):Wr(V)?this.clickInactive(D,V):void 0},Wn.onTouchEnd=Wn.onMouseUp=function(D){D.dragMoving&&this.fireUpdate(),this.stopDragging(D)};var da={};function es(D,V){return!!D.lngLat&&D.lngLat.lng===V[0]&&D.lngLat.lat===V[1]}da.onSetup=function(){var D=this.newFeature({type:N.FEATURE,properties:{},geometry:{type:N.POINT,coordinates:[]}});return this.addFeature(D),this.clearSelectedFeatures(),this.updateUIClasses({mouse:E.ADD}),this.activateUIButton(O.POINT),this.setActionableState({trash:!0}),{point:D}},da.stopDrawingAndRemove=function(D){this.deleteFeature([D.point.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT)},da.onTap=da.onClick=function(D,V){this.updateUIClasses({mouse:E.MOVE}),D.point.updateCoordinate("",V.lngLat.lng,V.lngLat.lat),this.map.fire(U.CREATE,{features:[D.point.toGeoJSON()]}),this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.point.id]})},da.onStop=function(D){this.activateUIButton(),D.point.getCoordinate().length||this.deleteFeature([D.point.id],{silent:!0})},da.toDisplayFeatures=function(D,V,Ee){var it=V.properties.id===D.point.id;if(V.properties.active=it?W.ACTIVE:W.INACTIVE,!it)return Ee(V)},da.onTrash=da.stopDrawingAndRemove,da.onKeyUp=function(D,V){if(pt(V)||he(V))return this.stopDrawingAndRemove(D,V)};var Aa={onSetup:function(){var D=this.newFeature({type:N.FEATURE,properties:{},geometry:{type:N.POLYGON,coordinates:[[]]}});return this.addFeature(D),this.clearSelectedFeatures(),It.disable(this),this.updateUIClasses({mouse:E.ADD}),this.activateUIButton(O.POLYGON),this.setActionableState({trash:!0}),{polygon:D,currentVertexPosition:0}},clickAnywhere:function(D,V){if(D.currentVertexPosition>0&&es(V,D.polygon.coordinates[0][D.currentVertexPosition-1]))return this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.polygon.id]});this.updateUIClasses({mouse:E.ADD}),D.polygon.updateCoordinate("0."+D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat),D.currentVertexPosition++,D.polygon.updateCoordinate("0."+D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat)},clickOnVertex:function(D){return this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.polygon.id]})},onMouseMove:function(D,V){D.polygon.updateCoordinate("0."+D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat),vr(V)&&this.updateUIClasses({mouse:E.POINTER})}};Aa.onTap=Aa.onClick=function(D,V){return vr(V)?this.clickOnVertex(D,V):this.clickAnywhere(D,V)},Aa.onKeyUp=function(D,V){pt(V)?(this.deleteFeature([D.polygon.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT)):he(V)&&this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.polygon.id]})},Aa.onStop=function(D){this.updateUIClasses({mouse:E.NONE}),It.enable(this),this.activateUIButton(),this.getFeature(D.polygon.id)!==void 0&&(D.polygon.removeCoordinate("0."+D.currentVertexPosition),D.polygon.isValid()?this.map.fire(U.CREATE,{features:[D.polygon.toGeoJSON()]}):(this.deleteFeature([D.polygon.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT,{},{silent:!0})))},Aa.toDisplayFeatures=function(D,V,Ee){var it=V.properties.id===D.polygon.id;if(V.properties.active=it?W.ACTIVE:W.INACTIVE,!it)return Ee(V);if(V.geometry.coordinates.length!==0){var yt=V.geometry.coordinates[0].length;if(!(yt<3)){if(V.properties.meta=ae.FEATURE,Ee(St(D.polygon.id,V.geometry.coordinates[0][0],"0.0",!1)),yt>3){var st=V.geometry.coordinates[0].length-3;Ee(St(D.polygon.id,V.geometry.coordinates[0][st],"0."+st,!1))}if(yt<=4){var Pt=[[V.geometry.coordinates[0][0][0],V.geometry.coordinates[0][0][1]],[V.geometry.coordinates[0][1][0],V.geometry.coordinates[0][1][1]]];if(Ee({type:N.FEATURE,properties:V.properties,geometry:{coordinates:Pt,type:N.LINE_STRING}}),yt===3)return}return Ee(V)}}},Aa.onTrash=function(D){this.deleteFeature([D.polygon.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT)};var Io={onSetup:function(D){var V,Ee,it=(D=D||{}).featureId,yt="forward";if(it){if(!(V=this.getFeature(it)))throw new Error("Could not find a feature with the provided featureId");var st=D.from;if(st&&st.type==="Feature"&&st.geometry&&st.geometry.type==="Point"&&(st=st.geometry),st&&st.type==="Point"&&st.coordinates&&st.coordinates.length===2&&(st=st.coordinates),!st||!Array.isArray(st))throw new Error("Please use the `from` property to indicate which point to continue the line from");var Pt=V.coordinates.length-1;if(V.coordinates[Pt][0]===st[0]&&V.coordinates[Pt][1]===st[1])Ee=Pt+1,V.addCoordinate.apply(V,[Ee].concat(V.coordinates[Pt]));else{if(V.coordinates[0][0]!==st[0]||V.coordinates[0][1]!==st[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");yt="backwards",Ee=0,V.addCoordinate.apply(V,[Ee].concat(V.coordinates[0]))}}else V=this.newFeature({type:N.FEATURE,properties:{},geometry:{type:N.LINE_STRING,coordinates:[]}}),Ee=0,this.addFeature(V);return this.clearSelectedFeatures(),It.disable(this),this.updateUIClasses({mouse:E.ADD}),this.activateUIButton(O.LINE),this.setActionableState({trash:!0}),{line:V,currentVertexPosition:Ee,direction:yt}},clickAnywhere:function(D,V){if(D.currentVertexPosition>0&&es(V,D.line.coordinates[D.currentVertexPosition-1])||D.direction==="backwards"&&es(V,D.line.coordinates[D.currentVertexPosition+1]))return this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.line.id]});this.updateUIClasses({mouse:E.ADD}),D.line.updateCoordinate(D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat),D.direction==="forward"?(D.currentVertexPosition++,D.line.updateCoordinate(D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat)):D.line.addCoordinate(0,V.lngLat.lng,V.lngLat.lat)},clickOnVertex:function(D){return this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.line.id]})},onMouseMove:function(D,V){D.line.updateCoordinate(D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat),vr(V)&&this.updateUIClasses({mouse:E.POINTER})}};Io.onTap=Io.onClick=function(D,V){if(vr(V))return this.clickOnVertex(D,V);this.clickAnywhere(D,V)},Io.onKeyUp=function(D,V){he(V)?this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.line.id]}):pt(V)&&(this.deleteFeature([D.line.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT))},Io.onStop=function(D){It.enable(this),this.activateUIButton(),this.getFeature(D.line.id)!==void 0&&(D.line.removeCoordinate(""+D.currentVertexPosition),D.line.isValid()?this.map.fire(U.CREATE,{features:[D.line.toGeoJSON()]}):(this.deleteFeature([D.line.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT,{},{silent:!0})))},Io.onTrash=function(D){this.deleteFeature([D.line.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT)},Io.toDisplayFeatures=function(D,V,Ee){var it=V.properties.id===D.line.id;if(V.properties.active=it?W.ACTIVE:W.INACTIVE,!it)return Ee(V);V.geometry.coordinates.length<2||(V.properties.meta=ae.FEATURE,Ee(St(D.line.id,V.geometry.coordinates[D.direction==="forward"?V.geometry.coordinates.length-2:1],""+(D.direction==="forward"?V.geometry.coordinates.length-2:1),!1)),Ee(V))};var ts={simple_select:qn,direct_select:Wn,draw_point:da,draw_polygon:Aa,draw_line_string:Io},io={defaultMode:z.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:yr,modes:ts,controls:{},userProperties:!1},ru={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},nu={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function na(D,V){return D.map((function(Ee){return Ee.source?Ee:Or(Ee,{id:Ee.id+"."+V,source:V==="hot"?M.HOT:M.COLD})}))}var ys={exports:{}};(function(D,V){var Ee="__lodash_hash_undefined__",it=9007199254740991,yt="[object Arguments]",st="[object Array]",Pt="[object Boolean]",ur="[object Date]",xr="[object Error]",Fr="[object Function]",Nr="[object Map]",_r="[object Number]",dn="[object Object]",Jr="[object Promise]",Sn="[object RegExp]",Qr="[object Set]",nr="[object String]",qr="[object Symbol]",An="[object WeakMap]",Zn="[object ArrayBuffer]",Mn="[object DataView]",ti=/^\[object .+?Constructor\]$/,Vl=/^(?:0|[1-9]\d*)$/,rn={};rn["[object Float32Array]"]=rn["[object Float64Array]"]=rn["[object Int8Array]"]=rn["[object Int16Array]"]=rn["[object Int32Array]"]=rn["[object Uint8Array]"]=rn["[object Uint8ClampedArray]"]=rn["[object Uint16Array]"]=rn["[object Uint32Array]"]=!0,rn[yt]=rn[st]=rn[Zn]=rn[Pt]=rn[Mn]=rn[ur]=rn[xr]=rn[Fr]=rn[Nr]=rn[_r]=rn[dn]=rn[Sn]=rn[Qr]=rn[nr]=rn[An]=!1;var po=typeof vc=="object"&&vc&&vc.Object===Object&&vc,En=typeof self=="object"&&self&&self.Object===Object&&self,pn=po||En||Function("return this")(),Ia=V&&!V.nodeType&&V,cn=Ia&&D&&!D.nodeType&&D,_s=cn&&cn.exports===Ia,ao=_s&&po.process,rs=(function(){try{return ao&&ao.binding&&ao.binding("util")}catch{}})(),bo=rs&&rs.isTypedArray;function js(Mt,Nt){for(var Rr=-1,Hr=Mt==null?0:Mt.length;++Rr<Hr;)if(Nt(Mt[Rr],Rr,Mt))return!0;return!1}function pa(Mt){var Nt=-1,Rr=Array(Mt.size);return Mt.forEach((function(Hr,Vn){Rr[++Nt]=[Vn,Hr]})),Rr}function xl(Mt){var Nt=-1,Rr=Array(Mt.size);return Mt.forEach((function(Hr){Rr[++Nt]=Hr})),Rr}var wl,qa,vs,ia=Array.prototype,pi=Function.prototype,Mo=Object.prototype,B=pn["__core-js_shared__"],ye=pi.toString,Ge=Mo.hasOwnProperty,xt=(wl=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+wl:"",Rt=Mo.toString,rr=RegExp("^"+ye.call(Ge).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gr=_s?pn.Buffer:void 0,Yr=pn.Symbol,nn=pn.Uint8Array,Pn=Mo.propertyIsEnumerable,Nn=ia.splice,Tn=Yr?Yr.toStringTag:void 0,yi=Object.getOwnPropertySymbols,ci=gr?gr.isBuffer:void 0,Fn=(qa=Object.keys,vs=Object,function(Mt){return qa(vs(Mt))}),qi=mo(pn,"DataView"),wi=mo(pn,"Map"),Fi=mo(pn,"Promise"),Ma=mo(pn,"Set"),bs=mo(pn,"WeakMap"),Sl=mo(Object,"create"),Au=Uo(qi),El=Uo(wi),ma=Uo(Fi),el=Uo(Ma),Us=Uo(bs),La=Yr?Yr.prototype:void 0,Xi=La?La.valueOf:void 0;function Lo(Mt){var Nt=-1,Rr=Mt==null?0:Mt.length;for(this.clear();++Nt<Rr;){var Hr=Mt[Nt];this.set(Hr[0],Hr[1])}}function Ai(Mt){var Nt=-1,Rr=Mt==null?0:Mt.length;for(this.clear();++Nt<Rr;){var Hr=Mt[Nt];this.set(Hr[0],Hr[1])}}function $a(Mt){var Nt=-1,Rr=Mt==null?0:Mt.length;for(this.clear();++Nt<Rr;){var Hr=Mt[Nt];this.set(Hr[0],Hr[1])}}function xs(Mt){var Nt=-1,Rr=Mt==null?0:Mt.length;for(this.__data__=new $a;++Nt<Rr;)this.add(Mt[Nt])}function Pi(Mt){var Nt=this.__data__=new Ai(Mt);this.size=Nt.size}function tl(Mt,Nt){var Rr=ns(Mt),Hr=!Rr&&$i(Mt),Vn=!Rr&&!Hr&&Ga(Mt),on=!Rr&&!Hr&&!Vn&&nl(Mt),In=Rr||Hr||Vn||on,Bn=In?(function(Ii,So){for(var Da=-1,Xo=Array(Ii);++Da<Ii;)Xo[Da]=So(Da);return Xo})(Mt.length,String):[],si=Bn.length;for(var li in Mt)!Ge.call(Mt,li)||In&&(li=="length"||Vn&&(li=="offset"||li=="parent")||on&&(li=="buffer"||li=="byteLength"||li=="byteOffset")||Es(li,si))||Bn.push(li);return Bn}function ws(Mt,Nt){for(var Rr=Mt.length;Rr--;)if(Ts(Mt[Rr][0],Nt))return Rr;return-1}function Va(Mt){return Mt==null?Mt===void 0?"[object Undefined]":"[object Null]":Tn&&Tn in Object(Mt)?(function(Nt){var Rr=Ge.call(Nt,Tn),Hr=Nt[Tn];try{Nt[Tn]=void 0;var Vn=!0}catch{}var on=Rt.call(Nt);return Vn&&(Rr?Nt[Tn]=Hr:delete Nt[Tn]),on})(Mt):(function(Nt){return Rt.call(Nt)})(Mt)}function so(Mt){return is(Mt)&&Va(Mt)==yt}function Do(Mt,Nt,Rr,Hr,Vn){return Mt===Nt||(Mt==null||Nt==null||!is(Mt)&&!is(Nt)?Mt!=Mt&&Nt!=Nt:(function(on,In,Bn,si,li,Ii){var So=ns(on),Da=ns(In),Xo=So?st:wo(on),Cs=Da?st:wo(In),ol=(Xo=Xo==yt?dn:Xo)==dn,ou=(Cs=Cs==yt?dn:Cs)==dn,al=Xo==Cs;if(al&&Ga(on)){if(!Ga(In))return!1;So=!0,ol=!1}if(al&&!ol)return Ii||(Ii=new Pi),So||nl(on)?qs(on,In,Bn,si,li,Ii):(function(ri,ni,As,Vi,su,ya,Ha){switch(As){case Mn:if(ri.byteLength!=ni.byteLength||ri.byteOffset!=ni.byteOffset)return!1;ri=ri.buffer,ni=ni.buffer;case Zn:return!(ri.byteLength!=ni.byteLength||!ya(new nn(ri),new nn(ni)));case Pt:case ur:case _r:return Ts(+ri,+ni);case xr:return ri.name==ni.name&&ri.message==ni.message;case Sn:case nr:return ri==ni+"";case Nr:var oa=pa;case Qr:var Vs=1&Vi;if(oa||(oa=xl),ri.size!=ni.size&&!Vs)return!1;var sl=Ha.get(ri);if(sl)return sl==ni;Vi|=2,Ha.set(ri,ni);var os=qs(oa(ri),oa(ni),Vi,su,ya,Ha);return Ha.delete(ri),os;case qr:if(Xi)return Xi.call(ri)==Xi.call(ni)}return!1})(on,In,Xo,Bn,si,li,Ii);if(!(1&Bn)){var $s=ol&&Ge.call(on,"__wrapped__"),Hl=ou&&Ge.call(In,"__wrapped__");if($s||Hl){var au=$s?on.value():on,Pu=Hl?In.value():In;return Ii||(Ii=new Pi),li(au,Pu,Bn,si,Ii)}}return al?(Ii||(Ii=new Pi),(function(ri,ni,As,Vi,su,ya){var Ha=1&As,oa=Ss(ri),Vs=oa.length,sl=Ss(ni).length;if(Vs!=sl&&!Ha)return!1;for(var os=Vs;os--;){var ka=oa[os];if(!(Ha?ka in ni:Ge.call(ni,ka)))return!1}var lu=ya.get(ri);if(lu&&ya.get(ni))return lu==ni;var Wa=!0;ya.set(ri,ni),ya.set(ni,ri);for(var go=Ha;++os<Vs;){var qo=ri[ka=oa[os]],Gs=ni[ka];if(Vi)var Dn=Ha?Vi(Gs,qo,ka,ni,ri,ya):Vi(qo,Gs,ka,ri,ni,ya);if(!(Dn===void 0?qo===Gs||su(qo,Gs,As,Vi,ya):Dn)){Wa=!1;break}go||(go=ka=="constructor")}if(Wa&&!go){var as=ri.constructor,ll=ni.constructor;as==ll||!("constructor"in ri)||!("constructor"in ni)||typeof as=="function"&&as instanceof as&&typeof ll=="function"&&ll instanceof ll||(Wa=!1)}return ya.delete(ri),ya.delete(ni),Wa})(on,In,Bn,si,li,Ii)):!1})(Mt,Nt,Rr,Hr,Do,Vn))}function iu(Mt){return!(!Cl(Mt)||(function(Nt){return!!xt&&xt in Nt})(Mt))&&(ga(Mt)?rr:ti).test(Uo(Mt))}function Gl(Mt){if(Rr=(Nt=Mt)&&Nt.constructor,Hr=typeof Rr=="function"&&Rr.prototype||Mo,Nt!==Hr)return Fn(Mt);var Nt,Rr,Hr,Vn=[];for(var on in Object(Mt))Ge.call(Mt,on)&&on!="constructor"&&Vn.push(on);return Vn}function qs(Mt,Nt,Rr,Hr,Vn,on){var In=1&Rr,Bn=Mt.length,si=Nt.length;if(Bn!=si&&!(In&&si>Bn))return!1;var li=on.get(Mt);if(li&&on.get(Nt))return li==Nt;var Ii=-1,So=!0,Da=2&Rr?new xs:void 0;for(on.set(Mt,Nt),on.set(Nt,Mt);++Ii<Bn;){var Xo=Mt[Ii],Cs=Nt[Ii];if(Hr)var ol=In?Hr(Cs,Xo,Ii,Nt,Mt,on):Hr(Xo,Cs,Ii,Mt,Nt,on);if(ol!==void 0){if(ol)continue;So=!1;break}if(Da){if(!js(Nt,(function(ou,al){if($s=al,!Da.has($s)&&(Xo===ou||Vn(Xo,ou,Rr,Hr,on)))return Da.push(al);var $s}))){So=!1;break}}else if(Xo!==Cs&&!Vn(Xo,Cs,Rr,Hr,on)){So=!1;break}}return on.delete(Mt),on.delete(Nt),So}function Ss(Mt){return(function(Nt,Rr,Hr){var Vn=Rr(Nt);return ns(Nt)?Vn:(function(on,In){for(var Bn=-1,si=In.length,li=on.length;++Bn<si;)on[li+Bn]=In[Bn];return on})(Vn,Hr(Nt))})(Mt,il,rl)}function xo(Mt,Nt){var Rr,Hr,Vn=Mt.__data__;return((Hr=typeof(Rr=Nt))=="string"||Hr=="number"||Hr=="symbol"||Hr=="boolean"?Rr!=="__proto__":Rr===null)?Vn[typeof Nt=="string"?"string":"hash"]:Vn.map}function mo(Mt,Nt){var Rr=(function(Hr,Vn){return Hr?.[Vn]})(Mt,Nt);return iu(Rr)?Rr:void 0}Lo.prototype.clear=function(){this.__data__=Sl?Sl(null):{},this.size=0},Lo.prototype.delete=function(Mt){var Nt=this.has(Mt)&&delete this.__data__[Mt];return this.size-=Nt?1:0,Nt},Lo.prototype.get=function(Mt){var Nt=this.__data__;if(Sl){var Rr=Nt[Mt];return Rr===Ee?void 0:Rr}return Ge.call(Nt,Mt)?Nt[Mt]:void 0},Lo.prototype.has=function(Mt){var Nt=this.__data__;return Sl?Nt[Mt]!==void 0:Ge.call(Nt,Mt)},Lo.prototype.set=function(Mt,Nt){var Rr=this.__data__;return this.size+=this.has(Mt)?0:1,Rr[Mt]=Sl&&Nt===void 0?Ee:Nt,this},Ai.prototype.clear=function(){this.__data__=[],this.size=0},Ai.prototype.delete=function(Mt){var Nt=this.__data__,Rr=ws(Nt,Mt);return!(Rr<0)&&(Rr==Nt.length-1?Nt.pop():Nn.call(Nt,Rr,1),--this.size,!0)},Ai.prototype.get=function(Mt){var Nt=this.__data__,Rr=ws(Nt,Mt);return Rr<0?void 0:Nt[Rr][1]},Ai.prototype.has=function(Mt){return ws(this.__data__,Mt)>-1},Ai.prototype.set=function(Mt,Nt){var Rr=this.__data__,Hr=ws(Rr,Mt);return Hr<0?(++this.size,Rr.push([Mt,Nt])):Rr[Hr][1]=Nt,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new Lo,map:new(wi||Ai),string:new Lo}},$a.prototype.delete=function(Mt){var Nt=xo(this,Mt).delete(Mt);return this.size-=Nt?1:0,Nt},$a.prototype.get=function(Mt){return xo(this,Mt).get(Mt)},$a.prototype.has=function(Mt){return xo(this,Mt).has(Mt)},$a.prototype.set=function(Mt,Nt){var Rr=xo(this,Mt),Hr=Rr.size;return Rr.set(Mt,Nt),this.size+=Rr.size==Hr?0:1,this},xs.prototype.add=xs.prototype.push=function(Mt){return this.__data__.set(Mt,Ee),this},xs.prototype.has=function(Mt){return this.__data__.has(Mt)},Pi.prototype.clear=function(){this.__data__=new Ai,this.size=0},Pi.prototype.delete=function(Mt){var Nt=this.__data__,Rr=Nt.delete(Mt);return this.size=Nt.size,Rr},Pi.prototype.get=function(Mt){return this.__data__.get(Mt)},Pi.prototype.has=function(Mt){return this.__data__.has(Mt)},Pi.prototype.set=function(Mt,Nt){var Rr=this.__data__;if(Rr instanceof Ai){var Hr=Rr.__data__;if(!wi||Hr.length<199)return Hr.push([Mt,Nt]),this.size=++Rr.size,this;Rr=this.__data__=new $a(Hr)}return Rr.set(Mt,Nt),this.size=Rr.size,this};var rl=yi?function(Mt){return Mt==null?[]:(Mt=Object(Mt),(function(Nt,Rr){for(var Hr=-1,Vn=Nt==null?0:Nt.length,on=0,In=[];++Hr<Vn;){var Bn=Nt[Hr];Rr(Bn,Hr,Nt)&&(In[on++]=Bn)}return In})(yi(Mt),(function(Nt){return Pn.call(Mt,Nt)})))}:function(){return[]},wo=Va;function Es(Mt,Nt){return!!(Nt=Nt??it)&&(typeof Mt=="number"||Vl.test(Mt))&&Mt>-1&&Mt%1==0&&Mt<Nt}function Uo(Mt){if(Mt!=null){try{return ye.call(Mt)}catch{}try{return Mt+""}catch{}}return""}function Ts(Mt,Nt){return Mt===Nt||Mt!=Mt&&Nt!=Nt}(qi&&wo(new qi(new ArrayBuffer(1)))!=Mn||wi&&wo(new wi)!=Nr||Fi&&wo(Fi.resolve())!=Jr||Ma&&wo(new Ma)!=Qr||bs&&wo(new bs)!=An)&&(wo=function(Mt){var Nt=Va(Mt),Rr=Nt==dn?Mt.constructor:void 0,Hr=Rr?Uo(Rr):"";if(Hr)switch(Hr){case Au:return Mn;case El:return Nr;case ma:return Jr;case el:return Qr;case Us:return An}return Nt});var $i=so((function(){return arguments})())?so:function(Mt){return is(Mt)&&Ge.call(Mt,"callee")&&!Pn.call(Mt,"callee")},ns=Array.isArray,Ga=ci||function(){return!1};function ga(Mt){if(!Cl(Mt))return!1;var Nt=Va(Mt);return Nt==Fr||Nt=="[object GeneratorFunction]"||Nt=="[object AsyncFunction]"||Nt=="[object Proxy]"}function Tl(Mt){return typeof Mt=="number"&&Mt>-1&&Mt%1==0&&Mt<=it}function Cl(Mt){var Nt=typeof Mt;return Mt!=null&&(Nt=="object"||Nt=="function")}function is(Mt){return Mt!=null&&typeof Mt=="object"}var nl=bo?(function(Mt){return function(Nt){return Mt(Nt)}})(bo):function(Mt){return is(Mt)&&Tl(Mt.length)&&!!rn[Va(Mt)]};function il(Mt){return(Nt=Mt)!=null&&Tl(Nt.length)&&!ga(Nt)?tl(Mt):Gl(Mt);var Nt}D.exports=function(Mt,Nt){return Do(Mt,Nt)}})(ys,ys.exports);var Pa=a(ys.exports);function Ua(D,V){return D.length===V.length&&JSON.stringify(D.map((function(Ee){return Ee})).sort())===JSON.stringify(V.map((function(Ee){return Ee})).sort())}var oo={Polygon:Fe,LineString:Ie,Point:xe,MultiPolygon:gt,MultiLineString:gt,MultiPoint:gt},$l=Object.freeze({__proto__:null,CommonSelectors:ce,constrainFeatureMovement:zo,createMidPoint:vt,createSupplementaryPoints:Ft,createVertex:St,doubleClickZoom:It,euclideanDistance:ut,featuresAt:Pe,getFeatureAtAndSetCursors:Ze,isClick:ke,isEventAtCoordinates:es,isTap:Xe,mapEventToBoundingBox:re,ModeHandler:n,moveFeatures:ms,sortFeatures:Ve,stringSetsAreEqual:Ua,StringSet:H,theme:yr,toDenseArray:Dt}),Js=function(D,V){var Ee={options:D=(function(yt){yt===void 0&&(yt={});var st=Or(yt);return yt.controls||(st.controls={}),yt.displayControlsDefault===!1?st.controls=Or(nu,yt.controls):st.controls=Or(ru,yt.controls),(st=Or(io,st)).styles=na(st.styles,"cold").concat(na(st.styles,"hot")),st})(D)};V=(function(yt,st){return st.modes=z,st.getFeatureIdsAt=function(Pt){return Pe.click({point:Pt},null,yt).map((function(ur){return ur.properties.id}))},st.getSelectedIds=function(){return yt.store.getSelectedIds()},st.getSelected=function(){return{type:N.FEATURE_COLLECTION,features:yt.store.getSelectedIds().map((function(Pt){return yt.store.get(Pt)})).map((function(Pt){return Pt.toGeoJSON()}))}},st.getSelectedPoints=function(){return{type:N.FEATURE_COLLECTION,features:yt.store.getSelectedCoordinates().map((function(Pt){return{type:N.FEATURE,properties:{},geometry:{type:N.POINT,coordinates:Pt.coordinates}}}))}},st.set=function(Pt){if(Pt.type===void 0||Pt.type!==N.FEATURE_COLLECTION||!Array.isArray(Pt.features))throw new Error("Invalid FeatureCollection");var ur=yt.store.createRenderBatch(),xr=yt.store.getAllIds().slice(),Fr=st.add(Pt),Nr=new H(Fr);return(xr=xr.filter((function(_r){return!Nr.has(_r)}))).length&&st.delete(xr),ur(),Fr},st.add=function(Pt){var ur=JSON.parse(JSON.stringify(dr(Pt))).features.map((function(xr){if(xr.id=xr.id||J(),xr.geometry===null)throw new Error("Invalid geometry: null");if(yt.store.get(xr.id)===void 0||yt.store.get(xr.id).type!==xr.geometry.type){var Fr=oo[xr.geometry.type];if(Fr===void 0)throw new Error("Invalid geometry type: "+xr.geometry.type+".");var Nr=new Fr(yt,xr);yt.store.add(Nr)}else{var _r=yt.store.get(xr.id);_r.properties=xr.properties,Pa(_r.properties,xr.properties)||yt.store.featureChanged(_r.id),Pa(_r.getCoordinates(),xr.geometry.coordinates)||_r.incomingCoords(xr.geometry.coordinates)}return xr.id}));return yt.store.render(),ur},st.get=function(Pt){var ur=yt.store.get(Pt);if(ur)return ur.toGeoJSON()},st.getAll=function(){return{type:N.FEATURE_COLLECTION,features:yt.store.getAll().map((function(Pt){return Pt.toGeoJSON()}))}},st.delete=function(Pt){return yt.store.delete(Pt,{silent:!0}),st.getMode()!==z.DIRECT_SELECT||yt.store.getSelectedIds().length?yt.store.render():yt.events.changeMode(z.SIMPLE_SELECT,void 0,{silent:!0}),st},st.deleteAll=function(){return yt.store.delete(yt.store.getAllIds(),{silent:!0}),st.getMode()===z.DIRECT_SELECT?yt.events.changeMode(z.SIMPLE_SELECT,void 0,{silent:!0}):yt.store.render(),st},st.changeMode=function(Pt,ur){return ur===void 0&&(ur={}),Pt===z.SIMPLE_SELECT&&st.getMode()===z.SIMPLE_SELECT?(Ua(ur.featureIds||[],yt.store.getSelectedIds())||(yt.store.setSelected(ur.featureIds,{silent:!0}),yt.store.render()),st):(Pt===z.DIRECT_SELECT&&st.getMode()===z.DIRECT_SELECT&&ur.featureId===yt.store.getSelectedIds()[0]||yt.events.changeMode(Pt,ur,{silent:!0}),st)},st.getMode=function(){return yt.events.getMode()},st.trash=function(){return yt.events.trash({silent:!0}),st},st.combineFeatures=function(){return yt.events.combineFeatures({silent:!0}),st},st.uncombineFeatures=function(){return yt.events.uncombineFeatures({silent:!0}),st},st.setFeatureProperty=function(Pt,ur,xr){return yt.store.setFeatureProperty(Pt,ur,xr),st},st})(Ee,V),Ee.api=V;var it=lr(Ee);return V.onAdd=it.onAdd,V.onRemove=it.onRemove,V.types=O,V.options=D,V};function Qs(D){Js(D,this)}return Qs.modes=ts,Qs.constants=we,Qs.lib=$l,Qs}))})(Qm)),Qm.exports}var bz=vz();const ME=th(bz);function xz(){const e=A8(n=>n.breakpoints.down("md"));return[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#009EE0","fill-outline-color":"#009EE0","fill-opacity":.3}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#009EE0","fill-outline-color":"#009EE0","fill-opacity":.2}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#009EE0","line-width":3}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#009EE0","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#009EE0","line-width":4}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#009EE0","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":e?5:4,"circle-color":"#ffffff","circle-stroke-color":"#009EE0","circle-stroke-width":1}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":e?8:6,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":e?7:5,"circle-color":"#ffffff","circle-stroke-color":"#009EE0","circle-stroke-width":1}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":e?10:9,"circle-opacity":1,"circle-color":"#009EE0"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":e?7.5:6.5,"circle-color":"#009EE0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":e?11:10,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":e?8.5:7.5,"circle-color":"#009EE0"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":e?8.5:6.5,"circle-color":"#404040"}}]}const wz=e=>{const t=_e.useRef(null),n=qp({mapId:e.mapId,waitForLayer:e.insertBeforeLayer}),a=_e.useRef(!1),[c,h]=_e.useState(!1),[f,o]=_e.useState(),y=xz(),v=_e.useCallback(S=>{console.log("MlFeatureEditor mode change to "+S.mode),typeof e.onFinish=="function"&&S.mode==="simple_select"&&e.onFinish()},[e.onFinish]);return _e.useEffect(()=>{n.map&&!a.current&&(a.current=!0,n.map.map.style&&n.map.map.getSource("mapbox-gl-draw-cold")&&t.current&&t.current?.remove(),t.current=new ME({displayControlsDefault:!1,defaultMode:e.mode||"simple_select",modes:Object.assign({},ME.modes),userProperties:!0,styles:y}),n.map.addControl(t.current,"top-left",n.componentId),n.map.on("draw.modechange",v,n.componentId),h(!0))},[n.map,e,a,v]),_e.useEffect(()=>{if(!n.map||!c)return;const S=()=>{if(t.current){const P=t.current.getAll?.();o(P?.features),typeof e.onChange=="function"&&e.onChange(P?.features)}};return n.map.on("mouseup",S),n.map.on("touchend",S),()=>{n.map&&(n.map.map.off("mouseup",S),n.map.map.off("touchend",S))}},[c,n.map]),_e.useEffect(()=>{t.current&&e.geojson?.geometry&&t.current.set({type:"FeatureCollection",features:[e.geojson]})},[e.geojson,c]),_e.useEffect(()=>{e.mode&&t.current&&t.current?.getMode?.()!==e.mode&&(t.current?.changeMode?.(e.mode),e.mode!=="simple_select"&&e.mode!=="direct_select"&&t.current.set({type:"FeatureCollection",features:[]}))},[e.mode,n.map]),{feature:f,drawToolsReady:c,draw:t.current}},H0=e=>(wz({mode:e.mode,geojson:e.geojson,onChange:e.onChange,onFinish:e.onFinish,mapId:e.mapId}),Pr.jsx(Pr.Fragment,{})),LE=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","hillshade","background"];function Sz(e){return typeof e.options.source=="string"?{source:e.options.source}:e.geojson&&(!e.options?.source||typeof e?.options?.source!="string"&&e.options?.source?.attribution&&!e.options?.source?.type)?{source:{type:"geojson",data:e.geojson||"",attribution:typeof e?.options?.source!="string"&&e.options.source?.attribution?e.options.source?.attribution:""}}:{}}function Ez(e,t){if(e?.insertBeforeLayer)return e.insertBeforeLayer;if(e?.insertBeforeFirstSymbolLayer)return t?.map?.firstSymbolLayer}function Ab(e){const t=qp({mapId:e.mapId,waitForLayer:e.insertBeforeLayer}),n=_e.useRef(""),a=_e.useRef(""),c=_e.useRef(""),[h,f]=_e.useState(),o=_e.useRef(e.layerId||(e.idPrefix?e.idPrefix:"Layer-")+t.componentId),y=_e.useCallback(()=>{if(!t.map||t?.map.cancelled||(t.map.map.getLayer(o.current)&&t.cleanup(),typeof e?.options?.source!="string"&&t.map.map.getSource(o.current)&&t.map.map.removeSource(o.current),typeof e.options.source=="string"&&(e.options.source===""||!t.map.map.getSource(e.options.source)))||typeof e?.options?.source!="string"&&!e.geojson&&!e?.options?.source?.data&&e?.options?.type!=="background"||typeof e.options.type>"u")return;try{t.map.addLayer({...e.options,...Sz(e),id:o.current},Ez(e,t),t.componentId)}catch(P){console.error("Failed to add layer:",P)}f(()=>t.map?.map.getLayer(o.current));const v=()=>{t.map?.map.getLayer(o.current)||y()};t.map.on("styledata",v,t.componentId);const S=(P,M,{source_id:E})=>{t.map&&typeof e?.options?.source=="string"&&e.options.source===E&&y()};t.map.wrapper.on("addsource",S,t.componentId),a.current=JSON.stringify(e.options?.paint),c.current=JSON.stringify(e.options?.layout),n.current=e.options.type},[e,t]);return _e.useEffect(()=>{t.map&&(!e.geojson&&!e.options.source&&e?.options?.type!=="background"||t.map?.cancelled===!1&&t?.map?.map?.getLayer?.(o.current)&&(LE.indexOf(e.options.type)===-1||LE.indexOf(e.options.type)!==-1&&e.options.type===n.current)||y())},[t.map,t.mapIsReady,e,y]),_e.useEffect(()=>{t.map?.cancelled===!0||!t.map?.map?.getSource?.(o.current)||t.map.map.getSource(o.current)?.setData?.(e.geojson)},[e.geojson,t.map,e.options.type]),_e.useEffect(()=>{if(t.map?.cancelled===!0||!t.map||!t.map?.map?.getLayer?.(o.current)||e.options.type!==n.current)return;let v;const S=JSON.stringify(e.options.layout);if(e.options.layout&&S!==c.current){const M=JSON.parse(c.current);for(v in e.options.layout)e.options.layout?.[v]&&e.options.layout[v]!==M[v]&&t.map.map.setLayoutProperty(o.current,v,e.options.layout[v]);c.current=S}const P=JSON.stringify(e.options.paint);if(P!==a.current){const M=JSON.parse(a.current);for(v in e.options.paint)e.options.paint?.[v]&&e.options.paint[v]!==M[v]&&t.map.map.setPaintProperty(o.current,v,e.options.paint[v]);a.current=P}},[e.options,t.map]),_e.useEffect(()=>{!e.insertBeforeLayer||!t.map||!t.map.getLayer(e.insertBeforeLayer)||!t.map.getLayer(o.current)||t.map.moveLayer(o.current,e.insertBeforeLayer)},[t.map,e.insertBeforeLayer]),_e.useEffect(()=>()=>{t.cleanup()},[]),_e.useEffect(()=>{if(typeof e?.options?.source!="string"||!t.map)return;const v=()=>{typeof e?.options?.source=="string"&&t?.map?.getSource?.(e.options.source)&&!t.map.getLayer(o.current)&&y()};t.map.on("sourcedataloading",v);const S=(P,M,{source_id:E})=>{t.map&&typeof e?.options?.source=="string"&&e.options.source===E&&y()};return t.map.wrapper.on("addsource",S),()=>{t?.map&&(t.map.off("sourcedataloading",v),t.map.wrapper.off("addsource",S))}},[t.map,e.options?.source]),_e.useEffect(()=>{if(!e.onClick||!t?.map||!t?.map?.getLayer?.(o.current))return;const v=e.onClick;return t.map?.on("click",o.current,v),()=>{v&&t?.map&&t.map?.off("click",o.current,v)}},[t.map,e.onClick]),_e.useEffect(()=>{if(!e.onHover||!t?.map||!t?.map?.getLayer?.(o.current))return;const v=e.onHover;return t.map?.on("mousemove",o.current,v),()=>{v&&t?.map&&t.map?.off("mousemove",o.current,v)}},[t.map,e.onHover]),_e.useEffect(()=>{if(!e.onLeave||!t?.map||!t?.map?.getLayer?.(o.current))return;const v=e.onLeave;return t.map?.on("mouseleave",o.current,v),()=>{v&&t?.map&&t.map?.off("mouseleave",o.current,v)}},[t.map,e.onLeave]),{map:t.map,layer:h,layerId:o.current,componentId:t.componentId,mapHook:t}}Ab.defaultProps={};const Tz=(e,t)=>{switch(e){case"fill":return t?.fill?t.fill:{"fill-color":"#009EE0","fill-outline-color":"#009EE0"};case"line":return t?.line?(console.log(t.line),t.line):{"line-color":"#009EE0","line-width":4,"line-blur":0};case"circle":return t?.circle?t.circle:{"circle-color":"#009EE0","circle-stroke-color":"#fff","circle-stroke-width":2,"circle-radius":5};default:return{}}},DE={Position:"circle",Point:"circle",MultiPoint:"circle",LineString:"line",MultiLineString:"line",Polygon:"fill",MultiPolygon:"fill",GeometryCollection:"circle"},dM=e=>e?.type==="Feature"?DE?.[e?.geometry?.type]?DE[e.geometry.type]:"circle":e?.type==="FeatureCollection"?e.features.length?dM(e.features[0]):"circle":"fill";function Cz(e){const t=qp({mapId:e.mapId}),[n,a]=_e.useState(),c=_e.useRef(e.sourceId||(e.idPrefix?e.idPrefix:"Source-")+t.componentId),h=_e.useCallback(()=>{if(t.map&&t.map?.style?._layers){for(const[o,y]of Object.entries(t.map.style._layers))y.source===c.current&&t.map.removeLayer(o);t.map.getSource(c.current)&&t.map.removeSource(c.current)}},[t.map]),f=_e.useCallback(()=>{t.map&&(e.source.type==="geojson"&&!e.source.data||(t.map.map.getSource(c.current)&&h(),t.map?.addSource(c.current,{...e.source}),a(t.map.map.getSource(c.current))))},[e,t,h]);return _e.useEffect(()=>{t.map?.map?.getSource(c.current)&&t.map.map.getSource(c.current)?.setData?.(e.source.data)},[e.source?.data]),_e.useEffect(()=>{t?.map?.map?.getSource?.(e.sourceId)&&e.sourceId===c.current||(c.current=e.sourceId,f())},[t.map,e,f]),_e.useEffect(()=>{if(!t.map)return;const o=()=>{t?.map?.getSource?.(e.sourceId)||f()};return t.map.on("styledata",o),()=>{t?.map&&t.map.off("styledata",o)}},[t.map,f]),_e.useEffect(()=>()=>{h()},[h]),{map:t.map,source:n,componentId:t.componentId,mapHook:t}}const eg=e=>{const t=e.type||dM(e.geojson),n=_e.useRef(e.layerId||"MlGeoJsonLayer-"+Pp()),a=`label-${n.current}`;return _e.useEffect(()=>{e.layerId?n.current=e.layerId:n.current="MlGeoJsonLayer-"+Pp()},[e.layerId]),Cz({mapId:e.mapId,sourceId:"source-"+n.current,source:{type:"geojson",data:e.geojson,...typeof e?.options?.source<"u"&&typeof e?.options?.source!="string"?e.options.source:{}}}),Ab({mapId:e.mapId,layerId:n.current,options:{...typeof e?.options?.source<"u"&&typeof e?.options?.source=="string"?{source:e.options.source}:{source:"source-"+n.current},paint:{...e.paint||Tz(t,e.defaultPaintOverrides),...e?.options?.paint},layout:{...e?.layout||{},...e?.options?.layout},type:t},insertBeforeLayer:e.insertBeforeLayer,onHover:e.onHover,onClick:e.onClick,onLeave:e.onLeave}),Ab({mapId:e.mapId,options:{...typeof e?.options?.source<"u"&&typeof e?.options?.source=="string"?{source:e.options.source}:{source:"source-"+n.current},id:a,type:"symbol",maxzoom:24,minzoom:1,...e?.labelOptions?e.labelOptions:{},...e?.options?.filter?{filter:e.options.filter}:{},layout:{"text-font":["Open Sans Regular"],"text-field":`{${e.labelProp}}`,"text-size":12,"text-anchor":"top",...e?.labelOptions?.layout?e.labelOptions.layout:{},visibility:e?.layout?.visibility??e?.options?.layout?.visibility??"visible"},paint:{"text-halo-width":1,"text-halo-color":"#fefefe","text-color":"#121212",...e?.labelOptions?.paint?e.labelOptions.paint:{}}}}),Pr.jsx(Pr.Fragment,{})};Rn(Vp)({marginTop:"15px"});md(Wg)({paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:"4px"});md(Zg)({minWidth:"30px"});md(Ec)({marginRight:"0px",padding:"0px"});md(w2)({padding:0,marginRight:"5px"});md(NP)(({open:e})=>({display:e?"block":"none"}));md(Vp)({marginLeft:"50px"});var fl={},Mf={},W0,kE;function pM(){if(kE)return W0;kE=1;var e=typeof vc=="object"&&vc&&vc.Object===Object&&vc;return W0=e,W0}var Z0,RE;function ec(){if(RE)return Z0;RE=1;var e=pM(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Z0=n,Z0}var Y0,NE;function Hp(){if(NE)return Y0;NE=1;var e=ec(),t=e.Symbol;return Y0=t,Y0}var X0,OE;function Az(){if(OE)return X0;OE=1;var e=Hp(),t=Object.prototype,n=t.hasOwnProperty,a=t.toString,c=e?e.toStringTag:void 0;function h(f){var o=n.call(f,c),y=f[c];try{f[c]=void 0;var v=!0}catch{}var S=a.call(f);return v&&(o?f[c]=y:delete f[c]),S}return X0=h,X0}var K0,FE;function Pz(){if(FE)return K0;FE=1;var e=Object.prototype,t=e.toString;function n(a){return t.call(a)}return K0=n,K0}var J0,BE;function Wh(){if(BE)return J0;BE=1;var e=Hp(),t=Az(),n=Pz(),a="[object Null]",c="[object Undefined]",h=e?e.toStringTag:void 0;function f(o){return o==null?o===void 0?c:a:h&&h in Object(o)?t(o):n(o)}return J0=f,J0}var Q0,zE;function Tu(){if(zE)return Q0;zE=1;var e=Array.isArray;return Q0=e,Q0}var e_,jE;function Tc(){if(jE)return e_;jE=1;function e(t){return t!=null&&typeof t=="object"}return e_=e,e_}var t_,UE;function Iz(){if(UE)return t_;UE=1;var e=Wh(),t=Tu(),n=Tc(),a="[object String]";function c(h){return typeof h=="string"||!t(h)&&n(h)&&e(h)==a}return t_=c,t_}var r_,qE;function Mz(){if(qE)return r_;qE=1;function e(t){return function(n,a,c){for(var h=-1,f=Object(n),o=c(n),y=o.length;y--;){var v=o[t?y:++h];if(a(f[v],v,f)===!1)break}return n}}return r_=e,r_}var n_,$E;function Lz(){if($E)return n_;$E=1;var e=Mz(),t=e();return n_=t,n_}var i_,VE;function Dz(){if(VE)return i_;VE=1;function e(t,n){for(var a=-1,c=Array(t);++a<t;)c[a]=n(a);return c}return i_=e,i_}var o_,GE;function kz(){if(GE)return o_;GE=1;var e=Wh(),t=Tc(),n="[object Arguments]";function a(c){return t(c)&&e(c)==n}return o_=a,o_}var a_,HE;function mM(){if(HE)return a_;HE=1;var e=kz(),t=Tc(),n=Object.prototype,a=n.hasOwnProperty,c=n.propertyIsEnumerable,h=e((function(){return arguments})())?e:function(f){return t(f)&&a.call(f,"callee")&&!c.call(f,"callee")};return a_=h,a_}var cp={exports:{}},s_,WE;function Rz(){if(WE)return s_;WE=1;function e(){return!1}return s_=e,s_}cp.exports;var ZE;function I2(){return ZE||(ZE=1,(function(e,t){var n=ec(),a=Rz(),c=t&&!t.nodeType&&t,h=c&&!0&&e&&!e.nodeType&&e,f=h&&h.exports===c,o=f?n.Buffer:void 0,y=o?o.isBuffer:void 0,v=y||a;e.exports=v})(cp,cp.exports)),cp.exports}var l_,YE;function gM(){if(YE)return l_;YE=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(a,c){var h=typeof a;return c=c??e,!!c&&(h=="number"||h!="symbol"&&t.test(a))&&a>-1&&a%1==0&&a<c}return l_=n,l_}var u_,XE;function M2(){if(XE)return u_;XE=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return u_=t,u_}var c_,KE;function Nz(){if(KE)return c_;KE=1;var e=Wh(),t=M2(),n=Tc(),a="[object Arguments]",c="[object Array]",h="[object Boolean]",f="[object Date]",o="[object Error]",y="[object Function]",v="[object Map]",S="[object Number]",P="[object Object]",M="[object RegExp]",E="[object Set]",O="[object String]",N="[object WeakMap]",z="[object ArrayBuffer]",U="[object DataView]",ee="[object Float32Array]",ae="[object Float64Array]",W="[object Int8Array]",le="[object Int16Array]",te="[object Int32Array]",we="[object Uint8Array]",Te="[object Uint8ClampedArray]",me="[object Uint16Array]",Ve="[object Uint32Array]",re={};re[ee]=re[ae]=re[W]=re[le]=re[te]=re[we]=re[Te]=re[me]=re[Ve]=!0,re[a]=re[c]=re[z]=re[h]=re[U]=re[f]=re[o]=re[y]=re[v]=re[S]=re[P]=re[M]=re[E]=re[O]=re[N]=!1;function H(Le){return n(Le)&&t(Le.length)&&!!re[e(Le)]}return c_=H,c_}var h_,JE;function L2(){if(JE)return h_;JE=1;function e(t){return function(n){return t(n)}}return h_=e,h_}var hp={exports:{}};hp.exports;var QE;function D2(){return QE||(QE=1,(function(e,t){var n=pM(),a=t&&!t.nodeType&&t,c=a&&!0&&e&&!e.nodeType&&e,h=c&&c.exports===a,f=h&&n.process,o=(function(){try{var y=c&&c.require&&c.require("util").types;return y||f&&f.binding&&f.binding("util")}catch{}})();e.exports=o})(hp,hp.exports)),hp.exports}var f_,eT;function yM(){if(eT)return f_;eT=1;var e=Nz(),t=L2(),n=D2(),a=n&&n.isTypedArray,c=a?t(a):e;return f_=c,f_}var d_,tT;function _M(){if(tT)return d_;tT=1;var e=Dz(),t=mM(),n=Tu(),a=I2(),c=gM(),h=yM(),f=Object.prototype,o=f.hasOwnProperty;function y(v,S){var P=n(v),M=!P&&t(v),E=!P&&!M&&a(v),O=!P&&!M&&!E&&h(v),N=P||M||E||O,z=N?e(v.length,String):[],U=z.length;for(var ee in v)(S||o.call(v,ee))&&!(N&&(ee=="length"||E&&(ee=="offset"||ee=="parent")||O&&(ee=="buffer"||ee=="byteLength"||ee=="byteOffset")||c(ee,U)))&&z.push(ee);return z}return d_=y,d_}var p_,rT;function k2(){if(rT)return p_;rT=1;var e=Object.prototype;function t(n){var a=n&&n.constructor,c=typeof a=="function"&&a.prototype||e;return n===c}return p_=t,p_}var m_,nT;function vM(){if(nT)return m_;nT=1;function e(t,n){return function(a){return t(n(a))}}return m_=e,m_}var g_,iT;function Oz(){if(iT)return g_;iT=1;var e=vM(),t=e(Object.keys,Object);return g_=t,g_}var y_,oT;function Fz(){if(oT)return y_;oT=1;var e=k2(),t=Oz(),n=Object.prototype,a=n.hasOwnProperty;function c(h){if(!e(h))return t(h);var f=[];for(var o in Object(h))a.call(h,o)&&o!="constructor"&&f.push(o);return f}return y_=c,y_}var __,aT;function _d(){if(aT)return __;aT=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return __=e,__}var v_,sT;function bM(){if(sT)return v_;sT=1;var e=Wh(),t=_d(),n="[object AsyncFunction]",a="[object Function]",c="[object GeneratorFunction]",h="[object Proxy]";function f(o){if(!t(o))return!1;var y=e(o);return y==a||y==c||y==n||y==h}return v_=f,v_}var b_,lT;function Kg(){if(lT)return b_;lT=1;var e=bM(),t=M2();function n(a){return a!=null&&t(a.length)&&!e(a)}return b_=n,b_}var x_,uT;function Wp(){if(uT)return x_;uT=1;var e=_M(),t=Fz(),n=Kg();function a(c){return n(c)?e(c):t(c)}return x_=a,x_}var w_,cT;function xM(){if(cT)return w_;cT=1;var e=Lz(),t=Wp();function n(a,c){return a&&e(a,c,t)}return w_=n,w_}var S_,hT;function wM(){if(hT)return S_;hT=1;function e(t){return t}return S_=e,S_}var E_,fT;function Bz(){if(fT)return E_;fT=1;var e=wM();function t(n){return typeof n=="function"?n:e}return E_=t,E_}var T_,dT;function R2(){if(dT)return T_;dT=1;var e=xM(),t=Bz();function n(a,c){return a&&e(a,t(c))}return T_=n,T_}var C_,pT;function N2(){if(pT)return C_;pT=1;var e=vM(),t=e(Object.getPrototypeOf,Object);return C_=t,C_}var A_,mT;function zz(){if(mT)return A_;mT=1;var e=Wh(),t=N2(),n=Tc(),a="[object Object]",c=Function.prototype,h=Object.prototype,f=c.toString,o=h.hasOwnProperty,y=f.call(Object);function v(S){if(!n(S)||e(S)!=a)return!1;var P=t(S);if(P===null)return!0;var M=o.call(P,"constructor")&&P.constructor;return typeof M=="function"&&M instanceof M&&f.call(M)==y}return A_=v,A_}var P_,gT;function SM(){if(gT)return P_;gT=1;function e(t,n){for(var a=-1,c=t==null?0:t.length,h=Array(c);++a<c;)h[a]=n(t[a],a,t);return h}return P_=e,P_}var I_,yT;function jz(){if(yT)return I_;yT=1;function e(){this.__data__=[],this.size=0}return I_=e,I_}var M_,_T;function O2(){if(_T)return M_;_T=1;function e(t,n){return t===n||t!==t&&n!==n}return M_=e,M_}var L_,vT;function Jg(){if(vT)return L_;vT=1;var e=O2();function t(n,a){for(var c=n.length;c--;)if(e(n[c][0],a))return c;return-1}return L_=t,L_}var D_,bT;function Uz(){if(bT)return D_;bT=1;var e=Jg(),t=Array.prototype,n=t.splice;function a(c){var h=this.__data__,f=e(h,c);if(f<0)return!1;var o=h.length-1;return f==o?h.pop():n.call(h,f,1),--this.size,!0}return D_=a,D_}var k_,xT;function qz(){if(xT)return k_;xT=1;var e=Jg();function t(n){var a=this.__data__,c=e(a,n);return c<0?void 0:a[c][1]}return k_=t,k_}var R_,wT;function $z(){if(wT)return R_;wT=1;var e=Jg();function t(n){return e(this.__data__,n)>-1}return R_=t,R_}var N_,ST;function Vz(){if(ST)return N_;ST=1;var e=Jg();function t(n,a){var c=this.__data__,h=e(c,n);return h<0?(++this.size,c.push([n,a])):c[h][1]=a,this}return N_=t,N_}var O_,ET;function Qg(){if(ET)return O_;ET=1;var e=jz(),t=Uz(),n=qz(),a=$z(),c=Vz();function h(f){var o=-1,y=f==null?0:f.length;for(this.clear();++o<y;){var v=f[o];this.set(v[0],v[1])}}return h.prototype.clear=e,h.prototype.delete=t,h.prototype.get=n,h.prototype.has=a,h.prototype.set=c,O_=h,O_}var F_,TT;function Gz(){if(TT)return F_;TT=1;var e=Qg();function t(){this.__data__=new e,this.size=0}return F_=t,F_}var B_,CT;function Hz(){if(CT)return B_;CT=1;function e(t){var n=this.__data__,a=n.delete(t);return this.size=n.size,a}return B_=e,B_}var z_,AT;function Wz(){if(AT)return z_;AT=1;function e(t){return this.__data__.get(t)}return z_=e,z_}var j_,PT;function Zz(){if(PT)return j_;PT=1;function e(t){return this.__data__.has(t)}return j_=e,j_}var U_,IT;function Yz(){if(IT)return U_;IT=1;var e=ec(),t=e["__core-js_shared__"];return U_=t,U_}var q_,MT;function Xz(){if(MT)return q_;MT=1;var e=Yz(),t=(function(){var a=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function n(a){return!!t&&t in a}return q_=n,q_}var $_,LT;function EM(){if(LT)return $_;LT=1;var e=Function.prototype,t=e.toString;function n(a){if(a!=null){try{return t.call(a)}catch{}try{return a+""}catch{}}return""}return $_=n,$_}var V_,DT;function Kz(){if(DT)return V_;DT=1;var e=bM(),t=Xz(),n=_d(),a=EM(),c=/[\\^$.*+?()[\]{}|]/g,h=/^\[object .+?Constructor\]$/,f=Function.prototype,o=Object.prototype,y=f.toString,v=o.hasOwnProperty,S=RegExp("^"+y.call(v).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function P(M){if(!n(M)||t(M))return!1;var E=e(M)?S:h;return E.test(a(M))}return V_=P,V_}var G_,kT;function Jz(){if(kT)return G_;kT=1;function e(t,n){return t?.[n]}return G_=e,G_}var H_,RT;function Zh(){if(RT)return H_;RT=1;var e=Kz(),t=Jz();function n(a,c){var h=t(a,c);return e(h)?h:void 0}return H_=n,H_}var W_,NT;function F2(){if(NT)return W_;NT=1;var e=Zh(),t=ec(),n=e(t,"Map");return W_=n,W_}var Z_,OT;function ey(){if(OT)return Z_;OT=1;var e=Zh(),t=e(Object,"create");return Z_=t,Z_}var Y_,FT;function Qz(){if(FT)return Y_;FT=1;var e=ey();function t(){this.__data__=e?e(null):{},this.size=0}return Y_=t,Y_}var X_,BT;function e7(){if(BT)return X_;BT=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return X_=e,X_}var K_,zT;function t7(){if(zT)return K_;zT=1;var e=ey(),t="__lodash_hash_undefined__",n=Object.prototype,a=n.hasOwnProperty;function c(h){var f=this.__data__;if(e){var o=f[h];return o===t?void 0:o}return a.call(f,h)?f[h]:void 0}return K_=c,K_}var J_,jT;function r7(){if(jT)return J_;jT=1;var e=ey(),t=Object.prototype,n=t.hasOwnProperty;function a(c){var h=this.__data__;return e?h[c]!==void 0:n.call(h,c)}return J_=a,J_}var Q_,UT;function n7(){if(UT)return Q_;UT=1;var e=ey(),t="__lodash_hash_undefined__";function n(a,c){var h=this.__data__;return this.size+=this.has(a)?0:1,h[a]=e&&c===void 0?t:c,this}return Q_=n,Q_}var ev,qT;function i7(){if(qT)return ev;qT=1;var e=Qz(),t=e7(),n=t7(),a=r7(),c=n7();function h(f){var o=-1,y=f==null?0:f.length;for(this.clear();++o<y;){var v=f[o];this.set(v[0],v[1])}}return h.prototype.clear=e,h.prototype.delete=t,h.prototype.get=n,h.prototype.has=a,h.prototype.set=c,ev=h,ev}var tv,$T;function o7(){if($T)return tv;$T=1;var e=i7(),t=Qg(),n=F2();function a(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return tv=a,tv}var rv,VT;function a7(){if(VT)return rv;VT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return rv=e,rv}var nv,GT;function ty(){if(GT)return nv;GT=1;var e=a7();function t(n,a){var c=n.__data__;return e(a)?c[typeof a=="string"?"string":"hash"]:c.map}return nv=t,nv}var iv,HT;function s7(){if(HT)return iv;HT=1;var e=ty();function t(n){var a=e(this,n).delete(n);return this.size-=a?1:0,a}return iv=t,iv}var ov,WT;function l7(){if(WT)return ov;WT=1;var e=ty();function t(n){return e(this,n).get(n)}return ov=t,ov}var av,ZT;function u7(){if(ZT)return av;ZT=1;var e=ty();function t(n){return e(this,n).has(n)}return av=t,av}var sv,YT;function c7(){if(YT)return sv;YT=1;var e=ty();function t(n,a){var c=e(this,n),h=c.size;return c.set(n,a),this.size+=c.size==h?0:1,this}return sv=t,sv}var lv,XT;function B2(){if(XT)return lv;XT=1;var e=o7(),t=s7(),n=l7(),a=u7(),c=c7();function h(f){var o=-1,y=f==null?0:f.length;for(this.clear();++o<y;){var v=f[o];this.set(v[0],v[1])}}return h.prototype.clear=e,h.prototype.delete=t,h.prototype.get=n,h.prototype.has=a,h.prototype.set=c,lv=h,lv}var uv,KT;function h7(){if(KT)return uv;KT=1;var e=Qg(),t=F2(),n=B2(),a=200;function c(h,f){var o=this.__data__;if(o instanceof e){var y=o.__data__;if(!t||y.length<a-1)return y.push([h,f]),this.size=++o.size,this;o=this.__data__=new n(y)}return o.set(h,f),this.size=o.size,this}return uv=c,uv}var cv,JT;function z2(){if(JT)return cv;JT=1;var e=Qg(),t=Gz(),n=Hz(),a=Wz(),c=Zz(),h=h7();function f(o){var y=this.__data__=new e(o);this.size=y.size}return f.prototype.clear=t,f.prototype.delete=n,f.prototype.get=a,f.prototype.has=c,f.prototype.set=h,cv=f,cv}var hv,QT;function f7(){if(QT)return hv;QT=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return hv=t,hv}var fv,eC;function d7(){if(eC)return fv;eC=1;function e(t){return this.__data__.has(t)}return fv=e,fv}var dv,tC;function p7(){if(tC)return dv;tC=1;var e=B2(),t=f7(),n=d7();function a(c){var h=-1,f=c==null?0:c.length;for(this.__data__=new e;++h<f;)this.add(c[h])}return a.prototype.add=a.prototype.push=t,a.prototype.has=n,dv=a,dv}var pv,rC;function m7(){if(rC)return pv;rC=1;function e(t,n){for(var a=-1,c=t==null?0:t.length;++a<c;)if(n(t[a],a,t))return!0;return!1}return pv=e,pv}var mv,nC;function g7(){if(nC)return mv;nC=1;function e(t,n){return t.has(n)}return mv=e,mv}var gv,iC;function TM(){if(iC)return gv;iC=1;var e=p7(),t=m7(),n=g7(),a=1,c=2;function h(f,o,y,v,S,P){var M=y&a,E=f.length,O=o.length;if(E!=O&&!(M&&O>E))return!1;var N=P.get(f),z=P.get(o);if(N&&z)return N==o&&z==f;var U=-1,ee=!0,ae=y&c?new e:void 0;for(P.set(f,o),P.set(o,f);++U<E;){var W=f[U],le=o[U];if(v)var te=M?v(le,W,U,o,f,P):v(W,le,U,f,o,P);if(te!==void 0){if(te)continue;ee=!1;break}if(ae){if(!t(o,function(we,Te){if(!n(ae,Te)&&(W===we||S(W,we,y,v,P)))return ae.push(Te)})){ee=!1;break}}else if(!(W===le||S(W,le,y,v,P))){ee=!1;break}}return P.delete(f),P.delete(o),ee}return gv=h,gv}var yv,oC;function CM(){if(oC)return yv;oC=1;var e=ec(),t=e.Uint8Array;return yv=t,yv}var _v,aC;function y7(){if(aC)return _v;aC=1;function e(t){var n=-1,a=Array(t.size);return t.forEach(function(c,h){a[++n]=[h,c]}),a}return _v=e,_v}var vv,sC;function _7(){if(sC)return vv;sC=1;function e(t){var n=-1,a=Array(t.size);return t.forEach(function(c){a[++n]=c}),a}return vv=e,vv}var bv,lC;function v7(){if(lC)return bv;lC=1;var e=Hp(),t=CM(),n=O2(),a=TM(),c=y7(),h=_7(),f=1,o=2,y="[object Boolean]",v="[object Date]",S="[object Error]",P="[object Map]",M="[object Number]",E="[object RegExp]",O="[object Set]",N="[object String]",z="[object Symbol]",U="[object ArrayBuffer]",ee="[object DataView]",ae=e?e.prototype:void 0,W=ae?ae.valueOf:void 0;function le(te,we,Te,me,Ve,re,H){switch(Te){case ee:if(te.byteLength!=we.byteLength||te.byteOffset!=we.byteOffset)return!1;te=te.buffer,we=we.buffer;case U:return!(te.byteLength!=we.byteLength||!re(new t(te),new t(we)));case y:case v:case M:return n(+te,+we);case S:return te.name==we.name&&te.message==we.message;case E:case N:return te==we+"";case P:var Le=c;case O:var Pe=me&f;if(Le||(Le=h),te.size!=we.size&&!Pe)return!1;var Me=H.get(te);if(Me)return Me==we;me|=o,H.set(te,we);var Ze=a(Le(te),Le(we),me,Ve,re,H);return H.delete(te),Ze;case z:if(W)return W.call(te)==W.call(we)}return!1}return bv=le,bv}var xv,uC;function AM(){if(uC)return xv;uC=1;function e(t,n){for(var a=-1,c=n.length,h=t.length;++a<c;)t[h+a]=n[a];return t}return xv=e,xv}var wv,cC;function PM(){if(cC)return wv;cC=1;var e=AM(),t=Tu();function n(a,c,h){var f=c(a);return t(a)?f:e(f,h(a))}return wv=n,wv}var Sv,hC;function b7(){if(hC)return Sv;hC=1;function e(t,n){for(var a=-1,c=t==null?0:t.length,h=0,f=[];++a<c;){var o=t[a];n(o,a,t)&&(f[h++]=o)}return f}return Sv=e,Sv}var Ev,fC;function IM(){if(fC)return Ev;fC=1;function e(){return[]}return Ev=e,Ev}var Tv,dC;function j2(){if(dC)return Tv;dC=1;var e=b7(),t=IM(),n=Object.prototype,a=n.propertyIsEnumerable,c=Object.getOwnPropertySymbols,h=c?function(f){return f==null?[]:(f=Object(f),e(c(f),function(o){return a.call(f,o)}))}:t;return Tv=h,Tv}var Cv,pC;function MM(){if(pC)return Cv;pC=1;var e=PM(),t=j2(),n=Wp();function a(c){return e(c,n,t)}return Cv=a,Cv}var Av,mC;function x7(){if(mC)return Av;mC=1;var e=MM(),t=1,n=Object.prototype,a=n.hasOwnProperty;function c(h,f,o,y,v,S){var P=o&t,M=e(h),E=M.length,O=e(f),N=O.length;if(E!=N&&!P)return!1;for(var z=E;z--;){var U=M[z];if(!(P?U in f:a.call(f,U)))return!1}var ee=S.get(h),ae=S.get(f);if(ee&&ae)return ee==f&&ae==h;var W=!0;S.set(h,f),S.set(f,h);for(var le=P;++z<E;){U=M[z];var te=h[U],we=f[U];if(y)var Te=P?y(we,te,U,f,h,S):y(te,we,U,h,f,S);if(!(Te===void 0?te===we||v(te,we,o,y,S):Te)){W=!1;break}le||(le=U=="constructor")}if(W&&!le){var me=h.constructor,Ve=f.constructor;me!=Ve&&"constructor"in h&&"constructor"in f&&!(typeof me=="function"&&me instanceof me&&typeof Ve=="function"&&Ve instanceof Ve)&&(W=!1)}return S.delete(h),S.delete(f),W}return Av=c,Av}var Pv,gC;function w7(){if(gC)return Pv;gC=1;var e=Zh(),t=ec(),n=e(t,"DataView");return Pv=n,Pv}var Iv,yC;function S7(){if(yC)return Iv;yC=1;var e=Zh(),t=ec(),n=e(t,"Promise");return Iv=n,Iv}var Mv,_C;function E7(){if(_C)return Mv;_C=1;var e=Zh(),t=ec(),n=e(t,"Set");return Mv=n,Mv}var Lv,vC;function T7(){if(vC)return Lv;vC=1;var e=Zh(),t=ec(),n=e(t,"WeakMap");return Lv=n,Lv}var Dv,bC;function ry(){if(bC)return Dv;bC=1;var e=w7(),t=F2(),n=S7(),a=E7(),c=T7(),h=Wh(),f=EM(),o="[object Map]",y="[object Object]",v="[object Promise]",S="[object Set]",P="[object WeakMap]",M="[object DataView]",E=f(e),O=f(t),N=f(n),z=f(a),U=f(c),ee=h;return(e&&ee(new e(new ArrayBuffer(1)))!=M||t&&ee(new t)!=o||n&&ee(n.resolve())!=v||a&&ee(new a)!=S||c&&ee(new c)!=P)&&(ee=function(ae){var W=h(ae),le=W==y?ae.constructor:void 0,te=le?f(le):"";if(te)switch(te){case E:return M;case O:return o;case N:return v;case z:return S;case U:return P}return W}),Dv=ee,Dv}var kv,xC;function C7(){if(xC)return kv;xC=1;var e=z2(),t=TM(),n=v7(),a=x7(),c=ry(),h=Tu(),f=I2(),o=yM(),y=1,v="[object Arguments]",S="[object Array]",P="[object Object]",M=Object.prototype,E=M.hasOwnProperty;function O(N,z,U,ee,ae,W){var le=h(N),te=h(z),we=le?S:c(N),Te=te?S:c(z);we=we==v?P:we,Te=Te==v?P:Te;var me=we==P,Ve=Te==P,re=we==Te;if(re&&f(N)){if(!f(z))return!1;le=!0,me=!1}if(re&&!me)return W||(W=new e),le||o(N)?t(N,z,U,ee,ae,W):n(N,z,we,U,ee,ae,W);if(!(U&y)){var H=me&&E.call(N,"__wrapped__"),Le=Ve&&E.call(z,"__wrapped__");if(H||Le){var Pe=H?N.value():N,Me=Le?z.value():z;return W||(W=new e),ae(Pe,Me,U,ee,W)}}return re?(W||(W=new e),a(N,z,U,ee,ae,W)):!1}return kv=O,kv}var Rv,wC;function LM(){if(wC)return Rv;wC=1;var e=C7(),t=Tc();function n(a,c,h,f,o){return a===c?!0:a==null||c==null||!t(a)&&!t(c)?a!==a&&c!==c:e(a,c,h,f,n,o)}return Rv=n,Rv}var Nv,SC;function A7(){if(SC)return Nv;SC=1;var e=z2(),t=LM(),n=1,a=2;function c(h,f,o,y){var v=o.length,S=v,P=!y;if(h==null)return!S;for(h=Object(h);v--;){var M=o[v];if(P&&M[2]?M[1]!==h[M[0]]:!(M[0]in h))return!1}for(;++v<S;){M=o[v];var E=M[0],O=h[E],N=M[1];if(P&&M[2]){if(O===void 0&&!(E in h))return!1}else{var z=new e;if(y)var U=y(O,N,E,h,f,z);if(!(U===void 0?t(N,O,n|a,y,z):U))return!1}}return!0}return Nv=c,Nv}var Ov,EC;function DM(){if(EC)return Ov;EC=1;var e=_d();function t(n){return n===n&&!e(n)}return Ov=t,Ov}var Fv,TC;function P7(){if(TC)return Fv;TC=1;var e=DM(),t=Wp();function n(a){for(var c=t(a),h=c.length;h--;){var f=c[h],o=a[f];c[h]=[f,o,e(o)]}return c}return Fv=n,Fv}var Bv,CC;function kM(){if(CC)return Bv;CC=1;function e(t,n){return function(a){return a==null?!1:a[t]===n&&(n!==void 0||t in Object(a))}}return Bv=e,Bv}var zv,AC;function I7(){if(AC)return zv;AC=1;var e=A7(),t=P7(),n=kM();function a(c){var h=t(c);return h.length==1&&h[0][2]?n(h[0][0],h[0][1]):function(f){return f===c||e(f,c,h)}}return zv=a,zv}var jv,PC;function U2(){if(PC)return jv;PC=1;var e=Wh(),t=Tc(),n="[object Symbol]";function a(c){return typeof c=="symbol"||t(c)&&e(c)==n}return jv=a,jv}var Uv,IC;function q2(){if(IC)return Uv;IC=1;var e=Tu(),t=U2(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function c(h,f){if(e(h))return!1;var o=typeof h;return o=="number"||o=="symbol"||o=="boolean"||h==null||t(h)?!0:a.test(h)||!n.test(h)||f!=null&&h in Object(f)}return Uv=c,Uv}var qv,MC;function RM(){if(MC)return qv;MC=1;var e=B2(),t="Expected a function";function n(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new TypeError(t);var h=function(){var f=arguments,o=c?c.apply(this,f):f[0],y=h.cache;if(y.has(o))return y.get(o);var v=a.apply(this,f);return h.cache=y.set(o,v)||y,v};return h.cache=new(n.Cache||e),h}return n.Cache=e,qv=n,qv}var $v,LC;function M7(){if(LC)return $v;LC=1;var e=RM(),t=500;function n(a){var c=e(a,function(f){return h.size===t&&h.clear(),f}),h=c.cache;return c}return $v=n,$v}var Vv,DC;function L7(){if(DC)return Vv;DC=1;var e=M7(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,a=e(function(c){var h=[];return c.charCodeAt(0)===46&&h.push(""),c.replace(t,function(f,o,y,v){h.push(y?v.replace(n,"$1"):o||f)}),h});return Vv=a,Vv}var Gv,kC;function D7(){if(kC)return Gv;kC=1;var e=Hp(),t=SM(),n=Tu(),a=U2(),c=e?e.prototype:void 0,h=c?c.toString:void 0;function f(o){if(typeof o=="string")return o;if(n(o))return t(o,f)+"";if(a(o))return h?h.call(o):"";var y=o+"";return y=="0"&&1/o==-1/0?"-0":y}return Gv=f,Gv}var Hv,RC;function k7(){if(RC)return Hv;RC=1;var e=D7();function t(n){return n==null?"":e(n)}return Hv=t,Hv}var Wv,NC;function NM(){if(NC)return Wv;NC=1;var e=Tu(),t=q2(),n=L7(),a=k7();function c(h,f){return e(h)?h:t(h,f)?[h]:n(a(h))}return Wv=c,Wv}var Zv,OC;function ny(){if(OC)return Zv;OC=1;var e=U2();function t(n){if(typeof n=="string"||e(n))return n;var a=n+"";return a=="0"&&1/n==-1/0?"-0":a}return Zv=t,Zv}var Yv,FC;function OM(){if(FC)return Yv;FC=1;var e=NM(),t=ny();function n(a,c){c=e(c,a);for(var h=0,f=c.length;a!=null&&h<f;)a=a[t(c[h++])];return h&&h==f?a:void 0}return Yv=n,Yv}var Xv,BC;function FM(){if(BC)return Xv;BC=1;var e=OM();function t(n,a,c){var h=n==null?void 0:e(n,a);return h===void 0?c:h}return Xv=t,Xv}var Kv,zC;function R7(){if(zC)return Kv;zC=1;function e(t,n){return t!=null&&n in Object(t)}return Kv=e,Kv}var Jv,jC;function N7(){if(jC)return Jv;jC=1;var e=NM(),t=mM(),n=Tu(),a=gM(),c=M2(),h=ny();function f(o,y,v){y=e(y,o);for(var S=-1,P=y.length,M=!1;++S<P;){var E=h(y[S]);if(!(M=o!=null&&v(o,E)))break;o=o[E]}return M||++S!=P?M:(P=o==null?0:o.length,!!P&&c(P)&&a(E,P)&&(n(o)||t(o)))}return Jv=f,Jv}var Qv,UC;function O7(){if(UC)return Qv;UC=1;var e=R7(),t=N7();function n(a,c){return a!=null&&t(a,c,e)}return Qv=n,Qv}var e1,qC;function F7(){if(qC)return e1;qC=1;var e=LM(),t=FM(),n=O7(),a=q2(),c=DM(),h=kM(),f=ny(),o=1,y=2;function v(S,P){return a(S)&&c(P)?h(f(S),P):function(M){var E=t(M,S);return E===void 0&&E===P?n(M,S):e(P,E,o|y)}}return e1=v,e1}var t1,$C;function B7(){if($C)return t1;$C=1;function e(t){return function(n){return n?.[t]}}return t1=e,t1}var r1,VC;function z7(){if(VC)return r1;VC=1;var e=OM();function t(n){return function(a){return e(a,n)}}return r1=t,r1}var n1,GC;function j7(){if(GC)return n1;GC=1;var e=B7(),t=z7(),n=q2(),a=ny();function c(h){return n(h)?e(a(h)):t(h)}return n1=c,n1}var i1,HC;function U7(){if(HC)return i1;HC=1;var e=I7(),t=F7(),n=wM(),a=Tu(),c=j7();function h(f){return typeof f=="function"?f:f==null?n:typeof f=="object"?a(f)?t(f[0],f[1]):e(f):c(f)}return i1=h,i1}var o1,WC;function q7(){if(WC)return o1;WC=1;var e=Kg();function t(n,a){return function(c,h){if(c==null)return c;if(!e(c))return n(c,h);for(var f=c.length,o=a?f:-1,y=Object(c);(a?o--:++o<f)&&h(y[o],o,y)!==!1;);return c}}return o1=t,o1}var a1,ZC;function $7(){if(ZC)return a1;ZC=1;var e=xM(),t=q7(),n=t(e);return a1=n,a1}var s1,YC;function V7(){if(YC)return s1;YC=1;var e=$7(),t=Kg();function n(a,c){var h=-1,f=t(a)?Array(a.length):[];return e(a,function(o,y,v){f[++h]=c(o,y,v)}),f}return s1=n,s1}var l1,XC;function G7(){if(XC)return l1;XC=1;var e=SM(),t=U7(),n=V7(),a=Tu();function c(h,f){var o=a(h)?e:n;return o(h,t(f,3))}return l1=c,l1}var KC;function H7(){if(KC)return Mf;KC=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.flattenNames=void 0;var e=Iz(),t=y(e),n=R2(),a=y(n),c=zz(),h=y(c),f=G7(),o=y(f);function y(S){return S&&S.__esModule?S:{default:S}}var v=Mf.flattenNames=function S(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=[];return(0,o.default)(P,function(E){Array.isArray(E)?S(E).map(function(O){return M.push(O)}):(0,h.default)(E)?(0,a.default)(E,function(O,N){O===!0&&M.push(N),M.push(N+"-"+O)}):(0,t.default)(E)&&M.push(E)}),M};return Mf.default=v,Mf}var Lf={},u1,JC;function W7(){if(JC)return u1;JC=1;function e(t,n){for(var a=-1,c=t==null?0:t.length;++a<c&&n(t[a],a,t)!==!1;);return t}return u1=e,u1}var c1,QC;function Z7(){if(QC)return c1;QC=1;var e=Zh(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return c1=t,c1}var h1,eA;function BM(){if(eA)return h1;eA=1;var e=Z7();function t(n,a,c){a=="__proto__"&&e?e(n,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):n[a]=c}return h1=t,h1}var f1,tA;function zM(){if(tA)return f1;tA=1;var e=BM(),t=O2(),n=Object.prototype,a=n.hasOwnProperty;function c(h,f,o){var y=h[f];(!(a.call(h,f)&&t(y,o))||o===void 0&&!(f in h))&&e(h,f,o)}return f1=c,f1}var d1,rA;function iy(){if(rA)return d1;rA=1;var e=zM(),t=BM();function n(a,c,h,f){var o=!h;h||(h={});for(var y=-1,v=c.length;++y<v;){var S=c[y],P=f?f(h[S],a[S],S,h,a):void 0;P===void 0&&(P=a[S]),o?t(h,S,P):e(h,S,P)}return h}return d1=n,d1}var p1,nA;function Y7(){if(nA)return p1;nA=1;var e=iy(),t=Wp();function n(a,c){return a&&e(c,t(c),a)}return p1=n,p1}var m1,iA;function X7(){if(iA)return m1;iA=1;function e(t){var n=[];if(t!=null)for(var a in Object(t))n.push(a);return n}return m1=e,m1}var g1,oA;function K7(){if(oA)return g1;oA=1;var e=_d(),t=k2(),n=X7(),a=Object.prototype,c=a.hasOwnProperty;function h(f){if(!e(f))return n(f);var o=t(f),y=[];for(var v in f)v=="constructor"&&(o||!c.call(f,v))||y.push(v);return y}return g1=h,g1}var y1,aA;function $2(){if(aA)return y1;aA=1;var e=_M(),t=K7(),n=Kg();function a(c){return n(c)?e(c,!0):t(c)}return y1=a,y1}var _1,sA;function J7(){if(sA)return _1;sA=1;var e=iy(),t=$2();function n(a,c){return a&&e(c,t(c),a)}return _1=n,_1}var fp={exports:{}};fp.exports;var lA;function Q7(){return lA||(lA=1,(function(e,t){var n=ec(),a=t&&!t.nodeType&&t,c=a&&!0&&e&&!e.nodeType&&e,h=c&&c.exports===a,f=h?n.Buffer:void 0,o=f?f.allocUnsafe:void 0;function y(v,S){if(S)return v.slice();var P=v.length,M=o?o(P):new v.constructor(P);return v.copy(M),M}e.exports=y})(fp,fp.exports)),fp.exports}var v1,uA;function ej(){if(uA)return v1;uA=1;function e(t,n){var a=-1,c=t.length;for(n||(n=Array(c));++a<c;)n[a]=t[a];return n}return v1=e,v1}var b1,cA;function tj(){if(cA)return b1;cA=1;var e=iy(),t=j2();function n(a,c){return e(a,t(a),c)}return b1=n,b1}var x1,hA;function jM(){if(hA)return x1;hA=1;var e=AM(),t=N2(),n=j2(),a=IM(),c=Object.getOwnPropertySymbols,h=c?function(f){for(var o=[];f;)e(o,n(f)),f=t(f);return o}:a;return x1=h,x1}var w1,fA;function rj(){if(fA)return w1;fA=1;var e=iy(),t=jM();function n(a,c){return e(a,t(a),c)}return w1=n,w1}var S1,dA;function nj(){if(dA)return S1;dA=1;var e=PM(),t=jM(),n=$2();function a(c){return e(c,n,t)}return S1=a,S1}var E1,pA;function ij(){if(pA)return E1;pA=1;var e=Object.prototype,t=e.hasOwnProperty;function n(a){var c=a.length,h=new a.constructor(c);return c&&typeof a[0]=="string"&&t.call(a,"index")&&(h.index=a.index,h.input=a.input),h}return E1=n,E1}var T1,mA;function V2(){if(mA)return T1;mA=1;var e=CM();function t(n){var a=new n.constructor(n.byteLength);return new e(a).set(new e(n)),a}return T1=t,T1}var C1,gA;function oj(){if(gA)return C1;gA=1;var e=V2();function t(n,a){var c=a?e(n.buffer):n.buffer;return new n.constructor(c,n.byteOffset,n.byteLength)}return C1=t,C1}var A1,yA;function aj(){if(yA)return A1;yA=1;var e=/\w*$/;function t(n){var a=new n.constructor(n.source,e.exec(n));return a.lastIndex=n.lastIndex,a}return A1=t,A1}var P1,_A;function sj(){if(_A)return P1;_A=1;var e=Hp(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function a(c){return n?Object(n.call(c)):{}}return P1=a,P1}var I1,vA;function lj(){if(vA)return I1;vA=1;var e=V2();function t(n,a){var c=a?e(n.buffer):n.buffer;return new n.constructor(c,n.byteOffset,n.length)}return I1=t,I1}var M1,bA;function uj(){if(bA)return M1;bA=1;var e=V2(),t=oj(),n=aj(),a=sj(),c=lj(),h="[object Boolean]",f="[object Date]",o="[object Map]",y="[object Number]",v="[object RegExp]",S="[object Set]",P="[object String]",M="[object Symbol]",E="[object ArrayBuffer]",O="[object DataView]",N="[object Float32Array]",z="[object Float64Array]",U="[object Int8Array]",ee="[object Int16Array]",ae="[object Int32Array]",W="[object Uint8Array]",le="[object Uint8ClampedArray]",te="[object Uint16Array]",we="[object Uint32Array]";function Te(me,Ve,re){var H=me.constructor;switch(Ve){case E:return e(me);case h:case f:return new H(+me);case O:return t(me,re);case N:case z:case U:case ee:case ae:case W:case le:case te:case we:return c(me,re);case o:return new H;case y:case P:return new H(me);case v:return n(me);case S:return new H;case M:return a(me)}}return M1=Te,M1}var L1,xA;function cj(){if(xA)return L1;xA=1;var e=_d(),t=Object.create,n=(function(){function a(){}return function(c){if(!e(c))return{};if(t)return t(c);a.prototype=c;var h=new a;return a.prototype=void 0,h}})();return L1=n,L1}var D1,wA;function hj(){if(wA)return D1;wA=1;var e=cj(),t=N2(),n=k2();function a(c){return typeof c.constructor=="function"&&!n(c)?e(t(c)):{}}return D1=a,D1}var k1,SA;function fj(){if(SA)return k1;SA=1;var e=ry(),t=Tc(),n="[object Map]";function a(c){return t(c)&&e(c)==n}return k1=a,k1}var R1,EA;function dj(){if(EA)return R1;EA=1;var e=fj(),t=L2(),n=D2(),a=n&&n.isMap,c=a?t(a):e;return R1=c,R1}var N1,TA;function pj(){if(TA)return N1;TA=1;var e=ry(),t=Tc(),n="[object Set]";function a(c){return t(c)&&e(c)==n}return N1=a,N1}var O1,CA;function mj(){if(CA)return O1;CA=1;var e=pj(),t=L2(),n=D2(),a=n&&n.isSet,c=a?t(a):e;return O1=c,O1}var F1,AA;function gj(){if(AA)return F1;AA=1;var e=z2(),t=W7(),n=zM(),a=Y7(),c=J7(),h=Q7(),f=ej(),o=tj(),y=rj(),v=MM(),S=nj(),P=ry(),M=ij(),E=uj(),O=hj(),N=Tu(),z=I2(),U=dj(),ee=_d(),ae=mj(),W=Wp(),le=$2(),te=1,we=2,Te=4,me="[object Arguments]",Ve="[object Array]",re="[object Boolean]",H="[object Date]",Le="[object Error]",Pe="[object Function]",Me="[object GeneratorFunction]",Ze="[object Map]",ut="[object Number]",ke="[object Object]",Xe="[object RegExp]",ge="[object Set]",Re="[object String]",J="[object Symbol]",fe="[object WeakMap]",xe="[object ArrayBuffer]",Ie="[object DataView]",Fe="[object Float32Array]",ot="[object Float64Array]",Et="[object Int8Array]",gt="[object Int16Array]",wt="[object Int32Array]",Zt="[object Uint8Array]",Ct="[object Uint8ClampedArray]",Kt="[object Uint16Array]",Dt="[object Uint32Array]",Be={};Be[me]=Be[Ve]=Be[xe]=Be[Ie]=Be[re]=Be[H]=Be[Fe]=Be[ot]=Be[Et]=Be[gt]=Be[wt]=Be[Ze]=Be[ut]=Be[ke]=Be[Xe]=Be[ge]=Be[Re]=Be[J]=Be[Zt]=Be[Ct]=Be[Kt]=Be[Dt]=!0,Be[Le]=Be[Pe]=Be[fe]=!1;function Lr(fr,Mr,Jt,Or,Er,lr){var yr,hn=Mr&te,Gr=Mr&we,jr=Mr&Te;if(Jt&&(yr=Er?Jt(fr,Or,Er,lr):Jt(fr)),yr!==void 0)return yr;if(!ee(fr))return fr;var Wr=N(fr);if(Wr){if(yr=M(fr),!hn)return f(fr,yr)}else{var Ur=P(fr),Br=Ur==Pe||Ur==Me;if(z(fr))return h(fr,hn);if(Ur==ke||Ur==me||Br&&!Er){if(yr=Gr||Br?{}:O(fr),!hn)return Gr?y(fr,c(yr,fr)):o(fr,a(yr,fr))}else{if(!Be[Ur])return Er?fr:{};yr=E(fr,Ur,hn)}}lr||(lr=new e);var vr=lr.get(fr);if(vr)return vr;lr.set(fr,yr),ae(fr)?fr.forEach(function(he){yr.add(Lr(he,Mr,Jt,he,fr,lr))}):U(fr)&&fr.forEach(function(he,ce){yr.set(ce,Lr(he,Mr,Jt,ce,fr,lr))});var Ir=jr?Gr?S:v:Gr?le:W,pt=Wr?void 0:Ir(fr);return t(pt||fr,function(he,ce){pt&&(ce=he,he=fr[ce]),n(yr,ce,Lr(he,Mr,Jt,ce,fr,lr))}),yr}return F1=Lr,F1}var B1,PA;function yj(){if(PA)return B1;PA=1;var e=gj(),t=1,n=4;function a(c){return e(c,t|n)}return B1=a,B1}var IA;function _j(){if(IA)return Lf;IA=1,Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.mergeClasses=void 0;var e=R2(),t=h(e),n=yj(),a=h(n),c=Object.assign||function(o){for(var y=1;y<arguments.length;y++){var v=arguments[y];for(var S in v)Object.prototype.hasOwnProperty.call(v,S)&&(o[S]=v[S])}return o};function h(o){return o&&o.__esModule?o:{default:o}}var f=Lf.mergeClasses=function(y){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],S=y.default&&(0,a.default)(y.default)||{};return v.map(function(P){var M=y[P];return M&&(0,t.default)(M,function(E,O){S[O]||(S[O]={}),S[O]=c({},S[O],M[O])}),P}),S};return Lf.default=f,Lf}var Df={},MA;function vj(){if(MA)return Df;MA=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.autoprefix=void 0;var e=R2(),t=a(e),n=Object.assign||function(f){for(var o=1;o<arguments.length;o++){var y=arguments[o];for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(f[v]=y[v])}return f};function a(f){return f&&f.__esModule?f:{default:f}}var c={borderRadius:function(o){return{msBorderRadius:o,MozBorderRadius:o,OBorderRadius:o,WebkitBorderRadius:o,borderRadius:o}},boxShadow:function(o){return{msBoxShadow:o,MozBoxShadow:o,OBoxShadow:o,WebkitBoxShadow:o,boxShadow:o}},userSelect:function(o){return{WebkitTouchCallout:o,KhtmlUserSelect:o,MozUserSelect:o,msUserSelect:o,WebkitUserSelect:o,userSelect:o}},flex:function(o){return{WebkitBoxFlex:o,MozBoxFlex:o,WebkitFlex:o,msFlex:o,flex:o}},flexBasis:function(o){return{WebkitFlexBasis:o,flexBasis:o}},justifyContent:function(o){return{WebkitJustifyContent:o,justifyContent:o}},transition:function(o){return{msTransition:o,MozTransition:o,OTransition:o,WebkitTransition:o,transition:o}},transform:function(o){return{msTransform:o,MozTransform:o,OTransform:o,WebkitTransform:o,transform:o}},absolute:function(o){var y=o&&o.split(" ");return{position:"absolute",top:y&&y[0],right:y&&y[1],bottom:y&&y[2],left:y&&y[3]}},extend:function(o,y){var v=y[o];return v||{extend:o}}},h=Df.autoprefix=function(o){var y={};return(0,t.default)(o,function(v,S){var P={};(0,t.default)(v,function(M,E){var O=c[E];O?P=n({},P,O(M)):P[E]=M}),y[S]=P}),y};return Df.default=h,Df}var kf={},LA;function bj(){if(LA)return kf;LA=1,Object.defineProperty(kf,"__esModule",{value:!0}),kf.hover=void 0;var e=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var S=arguments[v];for(var P in S)Object.prototype.hasOwnProperty.call(S,P)&&(y[P]=S[P])}return y},t=_e,n=a(t);function a(y){return y&&y.__esModule?y:{default:y}}function c(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function h(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function f(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var o=kf.hover=function(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(P){f(M,P);function M(){var E,O,N,z;c(this,M);for(var U=arguments.length,ee=Array(U),ae=0;ae<U;ae++)ee[ae]=arguments[ae];return z=(O=(N=h(this,(E=M.__proto__||Object.getPrototypeOf(M)).call.apply(E,[this].concat(ee))),N),N.state={hover:!1},N.handleMouseOver=function(){return N.setState({hover:!0})},N.handleMouseOut=function(){return N.setState({hover:!1})},N.render=function(){return n.default.createElement(S,{onMouseOver:N.handleMouseOver,onMouseOut:N.handleMouseOut},n.default.createElement(v,e({},N.props,N.state)))},O),h(N,z)}return M})(n.default.Component)};return kf.default=o,kf}var Rf={},DA;function xj(){if(DA)return Rf;DA=1,Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.active=void 0;var e=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var S=arguments[v];for(var P in S)Object.prototype.hasOwnProperty.call(S,P)&&(y[P]=S[P])}return y},t=_e,n=a(t);function a(y){return y&&y.__esModule?y:{default:y}}function c(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function h(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function f(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var o=Rf.active=function(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(P){f(M,P);function M(){var E,O,N,z;c(this,M);for(var U=arguments.length,ee=Array(U),ae=0;ae<U;ae++)ee[ae]=arguments[ae];return z=(O=(N=h(this,(E=M.__proto__||Object.getPrototypeOf(M)).call.apply(E,[this].concat(ee))),N),N.state={active:!1},N.handleMouseDown=function(){return N.setState({active:!0})},N.handleMouseUp=function(){return N.setState({active:!1})},N.render=function(){return n.default.createElement(S,{onMouseDown:N.handleMouseDown,onMouseUp:N.handleMouseUp},n.default.createElement(v,e({},N.props,N.state)))},O),h(N,z)}return M})(n.default.Component)};return Rf.default=o,Rf}var km={},kA;function wj(){if(kA)return km;kA=1,Object.defineProperty(km,"__esModule",{value:!0});var e=function(n,a){var c={},h=function(o){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c[o]=y};return n===0&&h("first-child"),n===a-1&&h("last-child"),(n===0||n%2===0)&&h("even"),Math.abs(n%2)===1&&h("odd"),h("nth-child",n),c};return km.default=e,km}var RA;function Sj(){if(RA)return fl;RA=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.ReactCSS=fl.loop=fl.handleActive=fl.handleHover=fl.hover=void 0;var e=H7(),t=M(e),n=_j(),a=M(n),c=vj(),h=M(c),f=bj(),o=M(f),y=xj(),v=M(y),S=wj(),P=M(S);function M(O){return O&&O.__esModule?O:{default:O}}fl.hover=o.default,fl.handleHover=o.default,fl.handleActive=v.default,fl.loop=P.default;var E=fl.ReactCSS=function(N){for(var z=arguments.length,U=Array(z>1?z-1:0),ee=1;ee<z;ee++)U[ee-1]=arguments[ee];var ae=(0,t.default)(U),W=(0,a.default)(N,ae);return(0,h.default)(W)};return fl.default=E,fl}var G2=Sj();const Un=th(G2);var Ej=function(t,n,a,c,h){var f=h.clientWidth,o=h.clientHeight,y=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,v=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,S=y-(h.getBoundingClientRect().left+window.pageXOffset),P=v-(h.getBoundingClientRect().top+window.pageYOffset);if(a==="vertical"){var M=void 0;if(P<0?M=0:P>o?M=1:M=Math.round(P*100/o)/100,n.a!==M)return{h:n.h,s:n.s,l:n.l,a:M,source:"rgb"}}else{var E=void 0;if(S<0?E=0:S>f?E=1:E=Math.round(S*100/f)/100,c!==E)return{h:n.h,s:n.s,l:n.l,a:E,source:"rgb"}}return null},z1={},Tj=function(t,n,a,c){if(typeof document>"u"&&!c)return null;var h=c?new c:document.createElement("canvas");h.width=a*2,h.height=a*2;var f=h.getContext("2d");return f?(f.fillStyle=t,f.fillRect(0,0,h.width,h.height),f.fillStyle=n,f.fillRect(0,0,a,a),f.translate(a,a),f.fillRect(0,0,a,a),h.toDataURL()):null},Cj=function(t,n,a,c){var h=t+"-"+n+"-"+a+(c?"-server":"");if(z1[h])return z1[h];var f=Tj(t,n,a,c);return z1[h]=f,f},NA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},vd=function(t){var n=t.white,a=t.grey,c=t.size,h=t.renderers,f=t.borderRadius,o=t.boxShadow,y=t.children,v=Un({default:{grid:{borderRadius:f,boxShadow:o,absolute:"0px 0px 0px 0px",background:"url("+Cj(n,a,c,h.canvas)+") center left"}}});return _e.isValidElement(y)?_e.cloneElement(y,NA({},y.props,{style:NA({},y.props.style,v.grid)})):_e.createElement("div",{style:v.grid})};vd.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var Aj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Pj=(function(){function e(t,n){for(var a=0;a<n.length;a++){var c=n[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}})();function Ij(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OA(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Mj(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var H2=(function(e){Mj(t,e);function t(){var n,a,c,h;Ij(this,t);for(var f=arguments.length,o=Array(f),y=0;y<f;y++)o[y]=arguments[y];return h=(a=(c=OA(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(o))),c),c.handleChange=function(v){var S=Ej(v,c.props.hsl,c.props.direction,c.props.a,c.container);S&&typeof c.props.onChange=="function"&&c.props.onChange(S,v)},c.handleMouseDown=function(v){c.handleChange(v),window.addEventListener("mousemove",c.handleChange),window.addEventListener("mouseup",c.handleMouseUp)},c.handleMouseUp=function(){c.unbindEventListeners()},c.unbindEventListeners=function(){window.removeEventListener("mousemove",c.handleChange),window.removeEventListener("mouseup",c.handleMouseUp)},a),OA(c,h)}return Pj(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var a=this,c=this.props.rgb,h=Un({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+c.r+","+c.g+","+c.b+`, 0) 0%,
1174
+ `)}return""+n},t})();_e.createContext({});function gz(e,t,n={}){const a={type:"Feature"};return(n.id===0||n.id)&&(a.id=n.id),n.bbox&&(a.bbox=n.bbox),a.properties=t||{},a.geometry=e,a}function yz(e,t,n={}){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!PE(e[0])||!PE(e[1]))throw new Error("coordinates must contain numbers");return gz({type:"Point",coordinates:e},t,n)}function PE(e){return!isNaN(e)&&e!==null&&!Array.isArray(e)}function hM(e,t,n){if(e!==null)for(var a,c,h,f,o,y,v,S=0,P=0,M,E=e.type,O=E==="FeatureCollection",N=E==="Feature",z=O?e.features.length:1,U=0;U<z;U++){v=O?e.features[U].geometry:N?e.geometry:e,M=v?v.type==="GeometryCollection":!1,o=M?v.geometries.length:1;for(var ee=0;ee<o;ee++){var ae=0,W=0;if(f=M?v.geometries[ee]:v,f!==null){y=f.coordinates;var le=f.type;switch(S=le==="Polygon"||le==="MultiPolygon"?1:0,le){case null:break;case"Point":if(t(y,P,U,ae,W)===!1)return!1;P++,ae++;break;case"LineString":case"MultiPoint":for(a=0;a<y.length;a++){if(t(y[a],P,U,ae,W)===!1)return!1;P++,le==="MultiPoint"&&ae++}le==="LineString"&&ae++;break;case"Polygon":case"MultiLineString":for(a=0;a<y.length;a++){for(c=0;c<y[a].length-S;c++){if(t(y[a][c],P,U,ae,W)===!1)return!1;P++}le==="MultiLineString"&&ae++,le==="Polygon"&&W++}le==="Polygon"&&ae++;break;case"MultiPolygon":for(a=0;a<y.length;a++){for(W=0,c=0;c<y[a].length;c++){for(h=0;h<y[a][c].length-S;h++){if(t(y[a][c][h],P,U,ae,W)===!1)return!1;P++}W++}ae++}break;case"GeometryCollection":for(a=0;a<f.geometries.length;a++)if(hM(f.geometries[a],t)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function fM(e,t={}){let n=0,a=0,c=0;return hM(e,function(h){n+=h[0],a+=h[1],c++}),yz([n/c,a/c],t.properties)}var Qm={exports:{}},_z=Qm.exports,IE;function vz(){return IE||(IE=1,(function(e,t){(function(n,a){e.exports=a()})(_z,(function(){var n=function(D,V){var Ee={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},it={on:function(st,Pt,ur){if(Ee[st]===void 0)throw new Error("Invalid event type: "+st);Ee[st].push({selector:Pt,fn:ur})},render:function(st){V.store.featureChanged(st)}},yt=function(st,Pt){for(var ur=Ee[st],xr=ur.length;xr--;){var Fr=ur[xr];if(Fr.selector(Pt)){Fr.fn.call(it,Pt)||V.store.render(),V.ui.updateMapClasses();break}}};return D.start.call(it),{render:D.render,stop:function(){D.stop&&D.stop()},trash:function(){D.trash&&(D.trash(),V.store.render())},combineFeatures:function(){D.combineFeatures&&D.combineFeatures()},uncombineFeatures:function(){D.uncombineFeatures&&D.uncombineFeatures()},drag:function(st){yt("drag",st)},click:function(st){yt("click",st)},mousemove:function(st){yt("mousemove",st)},mousedown:function(st){yt("mousedown",st)},mouseup:function(st){yt("mouseup",st)},mouseout:function(st){yt("mouseout",st)},keydown:function(st){yt("keydown",st)},keyup:function(st){yt("keyup",st)},touchstart:function(st){yt("touchstart",st)},touchmove:function(st){yt("touchmove",st)},touchend:function(st){yt("touchend",st)},tap:function(st){yt("tap",st)}}};function a(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function c(D){if(D.__esModule)return D;var V=D.default;if(typeof V=="function"){var Ee=function it(){if(this instanceof it){var yt=[null];yt.push.apply(yt,arguments);var st=Function.bind.apply(V,yt);return new st}return V.apply(this,arguments)};Ee.prototype=V.prototype}else Ee={};return Object.defineProperty(Ee,"__esModule",{value:!0}),Object.keys(D).forEach((function(it){var yt=Object.getOwnPropertyDescriptor(D,it);Object.defineProperty(Ee,it,yt.get?yt:{enumerable:!0,get:function(){return D[it]}})})),Ee}var h={},f={RADIUS:6378137},o=f;function y(D){var V=0;if(D&&D.length>0){V+=Math.abs(v(D[0]));for(var Ee=1;Ee<D.length;Ee++)V-=Math.abs(v(D[Ee]))}return V}function v(D){var V,Ee,it,yt,st,Pt,ur=0,xr=D.length;if(xr>2){for(Pt=0;Pt<xr;Pt++)Pt===xr-2?(it=xr-2,yt=xr-1,st=0):Pt===xr-1?(it=xr-1,yt=0,st=1):(it=Pt,yt=Pt+1,st=Pt+2),V=D[it],Ee=D[yt],ur+=(S(D[st][0])-S(V[0]))*Math.sin(S(Ee[1]));ur=ur*o.RADIUS*o.RADIUS/2}return ur}function S(D){return D*Math.PI/180}h.geometry=function D(V){var Ee,it=0;switch(V.type){case"Polygon":return y(V.coordinates);case"MultiPolygon":for(Ee=0;Ee<V.coordinates.length;Ee++)it+=y(V.coordinates[Ee]);return it;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(Ee=0;Ee<V.geometries.length;Ee++)it+=D(V.geometries[Ee]);return it}},h.ring=v;var P={CONTROL_BASE:"mapboxgl-ctrl",CONTROL_PREFIX:"mapboxgl-ctrl-",CONTROL_BUTTON:"mapbox-gl-draw_ctrl-draw-btn",CONTROL_BUTTON_LINE:"mapbox-gl-draw_line",CONTROL_BUTTON_POLYGON:"mapbox-gl-draw_polygon",CONTROL_BUTTON_POINT:"mapbox-gl-draw_point",CONTROL_BUTTON_TRASH:"mapbox-gl-draw_trash",CONTROL_BUTTON_COMBINE_FEATURES:"mapbox-gl-draw_combine",CONTROL_BUTTON_UNCOMBINE_FEATURES:"mapbox-gl-draw_uncombine",CONTROL_GROUP:"mapboxgl-ctrl-group",ATTRIBUTION:"mapboxgl-ctrl-attrib",ACTIVE_BUTTON:"active",BOX_SELECT:"mapbox-gl-draw_boxselect"},M={HOT:"mapbox-gl-draw-hot",COLD:"mapbox-gl-draw-cold"},E={ADD:"add",MOVE:"move",DRAG:"drag",POINTER:"pointer",NONE:"none"},O={POLYGON:"polygon",LINE:"line_string",POINT:"point"},N={FEATURE:"Feature",POLYGON:"Polygon",LINE_STRING:"LineString",POINT:"Point",FEATURE_COLLECTION:"FeatureCollection",MULTI_PREFIX:"Multi",MULTI_POINT:"MultiPoint",MULTI_LINE_STRING:"MultiLineString",MULTI_POLYGON:"MultiPolygon"},z={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},U={CREATE:"draw.create",DELETE:"draw.delete",UPDATE:"draw.update",SELECTION_CHANGE:"draw.selectionchange",MODE_CHANGE:"draw.modechange",ACTIONABLE:"draw.actionable",RENDER:"draw.render",COMBINE_FEATURES:"draw.combine",UNCOMBINE_FEATURES:"draw.uncombine"},ee={MOVE:"move",CHANGE_COORDINATES:"change_coordinates"},ae={FEATURE:"feature",MIDPOINT:"midpoint",VERTEX:"vertex"},W={ACTIVE:"true",INACTIVE:"false"},le=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],te=-85,we=Object.freeze({__proto__:null,classes:P,sources:M,cursors:E,types:O,geojsonTypes:N,modes:z,events:U,updateActions:ee,meta:ae,activeStates:W,interactions:le,LAT_MIN:-90,LAT_RENDERED_MIN:te,LAT_MAX:90,LAT_RENDERED_MAX:85,LNG_MIN:-270,LNG_MAX:270}),Te={Point:0,LineString:1,MultiLineString:1,Polygon:2};function me(D,V){var Ee=Te[D.geometry.type]-Te[V.geometry.type];return Ee===0&&D.geometry.type===N.POLYGON?D.area-V.area:Ee}function Ve(D){return D.map((function(V){return V.geometry.type===N.POLYGON&&(V.area=h.geometry({type:N.FEATURE,property:{},geometry:V.geometry})),V})).sort(me).map((function(V){return delete V.area,V}))}function re(D,V){return V===void 0&&(V=0),[[D.point.x-V,D.point.y-V],[D.point.x+V,D.point.y+V]]}function H(D){if(this._items={},this._nums={},this._length=D?D.length:0,D)for(var V=0,Ee=D.length;V<Ee;V++)this.add(D[V]),D[V]!==void 0&&(typeof D[V]=="string"?this._items[D[V]]=V:this._nums[D[V]]=V)}H.prototype.add=function(D){return this.has(D)||(this._length++,typeof D=="string"?this._items[D]=this._length:this._nums[D]=this._length),this},H.prototype.delete=function(D){return this.has(D)===!1||(this._length--,delete this._items[D],delete this._nums[D]),this},H.prototype.has=function(D){return(typeof D=="string"||typeof D=="number")&&(this._items[D]!==void 0||this._nums[D]!==void 0)},H.prototype.values=function(){var D=this,V=[];return Object.keys(this._items).forEach((function(Ee){V.push({k:Ee,v:D._items[Ee]})})),Object.keys(this._nums).forEach((function(Ee){V.push({k:JSON.parse(Ee),v:D._nums[Ee]})})),V.sort((function(Ee,it){return Ee.v-it.v})).map((function(Ee){return Ee.k}))},H.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var Le=[ae.FEATURE,ae.MIDPOINT,ae.VERTEX],Pe={click:function(D,V,Ee){return Me(D,V,Ee,Ee.options.clickBuffer)},touch:function(D,V,Ee){return Me(D,V,Ee,Ee.options.touchBuffer)}};function Me(D,V,Ee,it){if(Ee.map===null)return[];var yt=D?re(D,it):V,st={};Ee.options.styles&&(st.layers=Ee.options.styles.map((function(Fr){return Fr.id})).filter((function(Fr){return Ee.map.getLayer(Fr)!=null})));var Pt=Ee.map.queryRenderedFeatures(yt,st).filter((function(Fr){return Le.indexOf(Fr.properties.meta)!==-1})),ur=new H,xr=[];return Pt.forEach((function(Fr){var Nr=Fr.properties.id;ur.has(Nr)||(ur.add(Nr),xr.push(Fr))})),Ve(xr)}function Ze(D,V){var Ee=Pe.click(D,null,V),it={mouse:E.NONE};return Ee[0]&&(it.mouse=Ee[0].properties.active===W.ACTIVE?E.MOVE:E.POINTER,it.feature=Ee[0].properties.meta),V.events.currentModeName().indexOf("draw")!==-1&&(it.mouse=E.ADD),V.ui.queueMapClasses(it),V.ui.updateMapClasses(),Ee[0]}function ut(D,V){var Ee=D.x-V.x,it=D.y-V.y;return Math.sqrt(Ee*Ee+it*it)}function ke(D,V,Ee){Ee===void 0&&(Ee={});var it=Ee.fineTolerance!=null?Ee.fineTolerance:4,yt=Ee.grossTolerance!=null?Ee.grossTolerance:12,st=Ee.interval!=null?Ee.interval:500;D.point=D.point||V.point,D.time=D.time||V.time;var Pt=ut(D.point,V.point);return Pt<it||Pt<yt&&V.time-D.time<st}function Xe(D,V,Ee){Ee===void 0&&(Ee={});var it=Ee.tolerance!=null?Ee.tolerance:25,yt=Ee.interval!=null?Ee.interval:250;return D.point=D.point||V.point,D.time=D.time||V.time,ut(D.point,V.point)<it&&V.time-D.time<yt}var ge={exports:{}},Re=ge.exports=function(D,V){if(V||(V=16),D===void 0&&(D=128),D<=0)return"0";for(var Ee=Math.log(Math.pow(2,D))/Math.log(V),it=2;Ee===1/0;it*=2)Ee=Math.log(Math.pow(2,D/it))/Math.log(V)*it;var yt=Ee-Math.floor(Ee),st="";for(it=0;it<Math.floor(Ee);it++)st=Math.floor(Math.random()*V).toString(V)+st;if(yt){var Pt=Math.pow(V,yt);st=Math.floor(Math.random()*Pt).toString(V)+st}var ur=parseInt(st,V);return ur!==1/0&&ur>=Math.pow(2,D)?Re(D,V):st};Re.rack=function(D,V,Ee){var it=function(st){var Pt=0;do{if(Pt++>10){if(!Ee)throw new Error("too many ID collisions, use more bits");D+=Ee}var ur=Re(D,V)}while(Object.hasOwnProperty.call(yt,ur));return yt[ur]=st,ur},yt=it.hats={};return it.get=function(st){return it.hats[st]},it.set=function(st,Pt){return it.hats[st]=Pt,it},it.bits=D||128,it.base=V||16,it};var J=a(ge.exports),fe=function(D,V){this.ctx=D,this.properties=V.properties||{},this.coordinates=V.geometry.coordinates,this.id=V.id||J(),this.type=V.geometry.type};fe.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},fe.prototype.incomingCoords=function(D){this.setCoordinates(D)},fe.prototype.setCoordinates=function(D){this.coordinates=D,this.changed()},fe.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},fe.prototype.setProperty=function(D,V){this.properties[D]=V},fe.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:N.FEATURE,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},fe.prototype.internal=function(D){var V={id:this.id,meta:ae.FEATURE,"meta:type":this.type,active:W.INACTIVE,mode:D};if(this.ctx.options.userProperties)for(var Ee in this.properties)V["user_"+Ee]=this.properties[Ee];return{type:N.FEATURE,properties:V,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var xe=function(D,V){fe.call(this,D,V)};(xe.prototype=Object.create(fe.prototype)).isValid=function(){return typeof this.coordinates[0]=="number"&&typeof this.coordinates[1]=="number"},xe.prototype.updateCoordinate=function(D,V,Ee){this.coordinates=arguments.length===3?[V,Ee]:[D,V],this.changed()},xe.prototype.getCoordinate=function(){return this.getCoordinates()};var Ie=function(D,V){fe.call(this,D,V)};(Ie.prototype=Object.create(fe.prototype)).isValid=function(){return this.coordinates.length>1},Ie.prototype.addCoordinate=function(D,V,Ee){this.changed();var it=parseInt(D,10);this.coordinates.splice(it,0,[V,Ee])},Ie.prototype.getCoordinate=function(D){var V=parseInt(D,10);return JSON.parse(JSON.stringify(this.coordinates[V]))},Ie.prototype.removeCoordinate=function(D){this.changed(),this.coordinates.splice(parseInt(D,10),1)},Ie.prototype.updateCoordinate=function(D,V,Ee){var it=parseInt(D,10);this.coordinates[it]=[V,Ee],this.changed()};var Fe=function(D,V){fe.call(this,D,V),this.coordinates=this.coordinates.map((function(Ee){return Ee.slice(0,-1)}))};(Fe.prototype=Object.create(fe.prototype)).isValid=function(){return this.coordinates.length!==0&&this.coordinates.every((function(D){return D.length>2}))},Fe.prototype.incomingCoords=function(D){this.coordinates=D.map((function(V){return V.slice(0,-1)})),this.changed()},Fe.prototype.setCoordinates=function(D){this.coordinates=D,this.changed()},Fe.prototype.addCoordinate=function(D,V,Ee){this.changed();var it=D.split(".").map((function(yt){return parseInt(yt,10)}));this.coordinates[it[0]].splice(it[1],0,[V,Ee])},Fe.prototype.removeCoordinate=function(D){this.changed();var V=D.split(".").map((function(it){return parseInt(it,10)})),Ee=this.coordinates[V[0]];Ee&&(Ee.splice(V[1],1),Ee.length<3&&this.coordinates.splice(V[0],1))},Fe.prototype.getCoordinate=function(D){var V=D.split(".").map((function(it){return parseInt(it,10)})),Ee=this.coordinates[V[0]];return JSON.parse(JSON.stringify(Ee[V[1]]))},Fe.prototype.getCoordinates=function(){return this.coordinates.map((function(D){return D.concat([D[0]])}))},Fe.prototype.updateCoordinate=function(D,V,Ee){this.changed();var it=D.split("."),yt=parseInt(it[0],10),st=parseInt(it[1],10);this.coordinates[yt]===void 0&&(this.coordinates[yt]=[]),this.coordinates[yt][st]=[V,Ee]};var ot={MultiPoint:xe,MultiLineString:Ie,MultiPolygon:Fe},Et=function(D,V,Ee,it,yt){var st=Ee.split("."),Pt=parseInt(st[0],10),ur=st[1]?st.slice(1).join("."):null;return D[Pt][V](ur,it,yt)},gt=function(D,V){if(fe.call(this,D,V),delete this.coordinates,this.model=ot[V.geometry.type],this.model===void 0)throw new TypeError(V.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(V.geometry.coordinates)};function wt(D){this.map=D.map,this.drawConfig=JSON.parse(JSON.stringify(D.options||{})),this._ctx=D}(gt.prototype=Object.create(fe.prototype))._coordinatesToFeatures=function(D){var V=this,Ee=this.model.bind(this);return D.map((function(it){return new Ee(V.ctx,{id:J(),type:N.FEATURE,properties:{},geometry:{coordinates:it,type:V.type.replace("Multi","")}})}))},gt.prototype.isValid=function(){return this.features.every((function(D){return D.isValid()}))},gt.prototype.setCoordinates=function(D){this.features=this._coordinatesToFeatures(D),this.changed()},gt.prototype.getCoordinate=function(D){return Et(this.features,"getCoordinate",D)},gt.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((function(D){return D.type===N.POLYGON?D.getCoordinates():D.coordinates}))))},gt.prototype.updateCoordinate=function(D,V,Ee){Et(this.features,"updateCoordinate",D,V,Ee),this.changed()},gt.prototype.addCoordinate=function(D,V,Ee){Et(this.features,"addCoordinate",D,V,Ee),this.changed()},gt.prototype.removeCoordinate=function(D){Et(this.features,"removeCoordinate",D),this.changed()},gt.prototype.getFeatures=function(){return this.features},wt.prototype.setSelected=function(D){return this._ctx.store.setSelected(D)},wt.prototype.setSelectedCoordinates=function(D){var V=this;this._ctx.store.setSelectedCoordinates(D),D.reduce((function(Ee,it){return Ee[it.feature_id]===void 0&&(Ee[it.feature_id]=!0,V._ctx.store.get(it.feature_id).changed()),Ee}),{})},wt.prototype.getSelected=function(){return this._ctx.store.getSelected()},wt.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},wt.prototype.isSelected=function(D){return this._ctx.store.isSelected(D)},wt.prototype.getFeature=function(D){return this._ctx.store.get(D)},wt.prototype.select=function(D){return this._ctx.store.select(D)},wt.prototype.deselect=function(D){return this._ctx.store.deselect(D)},wt.prototype.deleteFeature=function(D,V){return V===void 0&&(V={}),this._ctx.store.delete(D,V)},wt.prototype.addFeature=function(D){return this._ctx.store.add(D)},wt.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},wt.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},wt.prototype.setActionableState=function(D){D===void 0&&(D={});var V={trash:D.trash||!1,combineFeatures:D.combineFeatures||!1,uncombineFeatures:D.uncombineFeatures||!1};return this._ctx.events.actionable(V)},wt.prototype.changeMode=function(D,V,Ee){return V===void 0&&(V={}),Ee===void 0&&(Ee={}),this._ctx.events.changeMode(D,V,Ee)},wt.prototype.updateUIClasses=function(D){return this._ctx.ui.queueMapClasses(D)},wt.prototype.activateUIButton=function(D){return this._ctx.ui.setActiveButton(D)},wt.prototype.featuresAt=function(D,V,Ee){if(Ee===void 0&&(Ee="click"),Ee!=="click"&&Ee!=="touch")throw new Error("invalid buffer type");return Pe[Ee](D,V,this._ctx)},wt.prototype.newFeature=function(D){var V=D.geometry.type;return V===N.POINT?new xe(this._ctx,D):V===N.LINE_STRING?new Ie(this._ctx,D):V===N.POLYGON?new Fe(this._ctx,D):new gt(this._ctx,D)},wt.prototype.isInstanceOf=function(D,V){if(D===N.POINT)return V instanceof xe;if(D===N.LINE_STRING)return V instanceof Ie;if(D===N.POLYGON)return V instanceof Fe;if(D==="MultiFeature")return V instanceof gt;throw new Error("Unknown feature class: "+D)},wt.prototype.doRender=function(D){return this._ctx.store.featureChanged(D)},wt.prototype.onSetup=function(){},wt.prototype.onDrag=function(){},wt.prototype.onClick=function(){},wt.prototype.onMouseMove=function(){},wt.prototype.onMouseDown=function(){},wt.prototype.onMouseUp=function(){},wt.prototype.onMouseOut=function(){},wt.prototype.onKeyUp=function(){},wt.prototype.onKeyDown=function(){},wt.prototype.onTouchStart=function(){},wt.prototype.onTouchMove=function(){},wt.prototype.onTouchEnd=function(){},wt.prototype.onTap=function(){},wt.prototype.onStop=function(){},wt.prototype.onTrash=function(){},wt.prototype.onCombineFeature=function(){},wt.prototype.onUncombineFeature=function(){},wt.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var Zt={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},Ct=Object.keys(Zt);function Kt(D){var V=Object.keys(D);return function(Ee,it){it===void 0&&(it={});var yt={},st=V.reduce((function(Pt,ur){return Pt[ur]=D[ur],Pt}),new wt(Ee));return{start:function(){var Pt=this;yt=st.onSetup(it),Ct.forEach((function(ur){var xr,Fr=Zt[ur],Nr=function(){return!1};D[Fr]&&(Nr=function(){return!0}),Pt.on(ur,Nr,(xr=Fr,function(_r){return st[xr](yt,_r)}))}))},stop:function(){st.onStop(yt)},trash:function(){st.onTrash(yt)},combineFeatures:function(){st.onCombineFeatures(yt)},uncombineFeatures:function(){st.onUncombineFeatures(yt)},render:function(Pt,ur){st.toDisplayFeatures(yt,Pt,ur)}}}}function Dt(D){return[].concat(D).filter((function(V){return V!==void 0}))}function Be(){var D=this;if(!(D.ctx.map&&D.ctx.map.getSource(M.HOT)!==void 0))return xr();var V=D.ctx.events.currentModeName();D.ctx.ui.queueMapClasses({mode:V});var Ee=[],it=[];D.isDirty?it=D.getAllIds():(Ee=D.getChangedIds().filter((function(Fr){return D.get(Fr)!==void 0})),it=D.sources.hot.filter((function(Fr){return Fr.properties.id&&Ee.indexOf(Fr.properties.id)===-1&&D.get(Fr.properties.id)!==void 0})).map((function(Fr){return Fr.properties.id}))),D.sources.hot=[];var yt=D.sources.cold.length;D.sources.cold=D.isDirty?[]:D.sources.cold.filter((function(Fr){var Nr=Fr.properties.id||Fr.properties.parent;return Ee.indexOf(Nr)===-1}));var st=yt!==D.sources.cold.length||it.length>0;function Pt(Fr,Nr){var _r=D.get(Fr).internal(V);D.ctx.events.currentModeRender(_r,(function(dn){D.sources[Nr].push(dn)}))}if(Ee.forEach((function(Fr){return Pt(Fr,"hot")})),it.forEach((function(Fr){return Pt(Fr,"cold")})),st&&D.ctx.map.getSource(M.COLD).setData({type:N.FEATURE_COLLECTION,features:D.sources.cold}),D.ctx.map.getSource(M.HOT).setData({type:N.FEATURE_COLLECTION,features:D.sources.hot}),D._emitSelectionChange&&(D.ctx.map.fire(U.SELECTION_CHANGE,{features:D.getSelected().map((function(Fr){return Fr.toGeoJSON()})),points:D.getSelectedCoordinates().map((function(Fr){return{type:N.FEATURE,properties:{},geometry:{type:N.POINT,coordinates:Fr.coordinates}}}))}),D._emitSelectionChange=!1),D._deletedFeaturesToEmit.length){var ur=D._deletedFeaturesToEmit.map((function(Fr){return Fr.toGeoJSON()}));D._deletedFeaturesToEmit=[],D.ctx.map.fire(U.DELETE,{features:ur})}function xr(){D.isDirty=!1,D.clearChangedIds()}xr(),D.ctx.map.fire(U.RENDER,{})}function Lr(D){var V,Ee=this;this._features={},this._featureIds=new H,this._selectedFeatureIds=new H,this._selectedCoordinates=[],this._changedFeatureIds=new H,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=D,this.sources={hot:[],cold:[]},this.render=function(){V||(V=requestAnimationFrame((function(){V=null,Be.call(Ee)})))},this.isDirty=!1}function fr(D,V){var Ee=D._selectedCoordinates.filter((function(it){return D._selectedFeatureIds.has(it.feature_id)}));D._selectedCoordinates.length===Ee.length||V.silent||(D._emitSelectionChange=!0),D._selectedCoordinates=Ee}Lr.prototype.createRenderBatch=function(){var D=this,V=this.render,Ee=0;return this.render=function(){Ee++},function(){D.render=V,Ee>0&&D.render()}},Lr.prototype.setDirty=function(){return this.isDirty=!0,this},Lr.prototype.featureChanged=function(D){return this._changedFeatureIds.add(D),this},Lr.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},Lr.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},Lr.prototype.getAllIds=function(){return this._featureIds.values()},Lr.prototype.add=function(D){return this.featureChanged(D.id),this._features[D.id]=D,this._featureIds.add(D.id),this},Lr.prototype.delete=function(D,V){var Ee=this;return V===void 0&&(V={}),Dt(D).forEach((function(it){Ee._featureIds.has(it)&&(Ee._featureIds.delete(it),Ee._selectedFeatureIds.delete(it),V.silent||Ee._deletedFeaturesToEmit.indexOf(Ee._features[it])===-1&&Ee._deletedFeaturesToEmit.push(Ee._features[it]),delete Ee._features[it],Ee.isDirty=!0)})),fr(this,V),this},Lr.prototype.get=function(D){return this._features[D]},Lr.prototype.getAll=function(){var D=this;return Object.keys(this._features).map((function(V){return D._features[V]}))},Lr.prototype.select=function(D,V){var Ee=this;return V===void 0&&(V={}),Dt(D).forEach((function(it){Ee._selectedFeatureIds.has(it)||(Ee._selectedFeatureIds.add(it),Ee._changedFeatureIds.add(it),V.silent||(Ee._emitSelectionChange=!0))})),this},Lr.prototype.deselect=function(D,V){var Ee=this;return V===void 0&&(V={}),Dt(D).forEach((function(it){Ee._selectedFeatureIds.has(it)&&(Ee._selectedFeatureIds.delete(it),Ee._changedFeatureIds.add(it),V.silent||(Ee._emitSelectionChange=!0))})),fr(this,V),this},Lr.prototype.clearSelected=function(D){return D===void 0&&(D={}),this.deselect(this._selectedFeatureIds.values(),{silent:D.silent}),this},Lr.prototype.setSelected=function(D,V){var Ee=this;return V===void 0&&(V={}),D=Dt(D),this.deselect(this._selectedFeatureIds.values().filter((function(it){return D.indexOf(it)===-1})),{silent:V.silent}),this.select(D.filter((function(it){return!Ee._selectedFeatureIds.has(it)})),{silent:V.silent}),this},Lr.prototype.setSelectedCoordinates=function(D){return this._selectedCoordinates=D,this._emitSelectionChange=!0,this},Lr.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},Lr.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},Lr.prototype.getSelected=function(){var D=this;return this._selectedFeatureIds.values().map((function(V){return D.get(V)}))},Lr.prototype.getSelectedCoordinates=function(){var D=this;return this._selectedCoordinates.map((function(V){return{coordinates:D.get(V.feature_id).getCoordinate(V.coord_path)}}))},Lr.prototype.isSelected=function(D){return this._selectedFeatureIds.has(D)},Lr.prototype.setFeatureProperty=function(D,V,Ee){this.get(D).setProperty(V,Ee),this.featureChanged(D)},Lr.prototype.storeMapConfig=function(){var D=this;le.forEach((function(V){D.ctx.map[V]&&(D._mapInitialConfig[V]=D.ctx.map[V].isEnabled())}))},Lr.prototype.restoreMapConfig=function(){var D=this;Object.keys(this._mapInitialConfig).forEach((function(V){D._mapInitialConfig[V]?D.ctx.map[V].enable():D.ctx.map[V].disable()}))},Lr.prototype.getInitialConfigValue=function(D){return this._mapInitialConfig[D]===void 0||this._mapInitialConfig[D]};var Mr=function(){for(var D=arguments,V={},Ee=0;Ee<arguments.length;Ee++){var it=D[Ee];for(var yt in it)Jt.call(it,yt)&&(V[yt]=it[yt])}return V},Jt=Object.prototype.hasOwnProperty,Or=a(Mr),Er=["mode","feature","mouse"];function lr(D){var V=null,Ee=null,it={onRemove:function(){return D.map.off("load",it.connect),clearInterval(Ee),it.removeLayers(),D.store.restoreMapConfig(),D.ui.removeButtons(),D.events.removeEventListeners(),D.ui.clearMapClasses(),D.boxZoomInitial&&D.map.boxZoom.enable(),D.map=null,D.container=null,D.store=null,V&&V.parentNode&&V.parentNode.removeChild(V),V=null,this},connect:function(){D.map.off("load",it.connect),clearInterval(Ee),it.addLayers(),D.store.storeMapConfig(),D.events.addEventListeners()},onAdd:function(yt){var st=yt.fire;return yt.fire=function(Pt,ur){var xr=arguments;return st.length===1&&arguments.length!==1&&(xr=[Or({},{type:Pt},ur)]),st.apply(yt,xr)},D.map=yt,D.events=(function(Pt){var ur=Object.keys(Pt.options.modes).reduce((function(nr,qr){return nr[qr]=Kt(Pt.options.modes[qr]),nr}),{}),xr={},Fr={},Nr={},_r=null,dn=null;Nr.drag=function(nr,qr){qr({point:nr.point,time:new Date().getTime()})?(Pt.ui.queueMapClasses({mouse:E.DRAG}),dn.drag(nr)):nr.originalEvent.stopPropagation()},Nr.mousedrag=function(nr){Nr.drag(nr,(function(qr){return!ke(xr,qr)}))},Nr.touchdrag=function(nr){Nr.drag(nr,(function(qr){return!Xe(Fr,qr)}))},Nr.mousemove=function(nr){if((nr.originalEvent.buttons!==void 0?nr.originalEvent.buttons:nr.originalEvent.which)===1)return Nr.mousedrag(nr);var qr=Ze(nr,Pt);nr.featureTarget=qr,dn.mousemove(nr)},Nr.mousedown=function(nr){xr={time:new Date().getTime(),point:nr.point};var qr=Ze(nr,Pt);nr.featureTarget=qr,dn.mousedown(nr)},Nr.mouseup=function(nr){var qr=Ze(nr,Pt);nr.featureTarget=qr,ke(xr,{point:nr.point,time:new Date().getTime()})?dn.click(nr):dn.mouseup(nr)},Nr.mouseout=function(nr){dn.mouseout(nr)},Nr.touchstart=function(nr){if(Pt.options.touchEnabled){Fr={time:new Date().getTime(),point:nr.point};var qr=Pe.touch(nr,null,Pt)[0];nr.featureTarget=qr,dn.touchstart(nr)}},Nr.touchmove=function(nr){if(Pt.options.touchEnabled)return dn.touchmove(nr),Nr.touchdrag(nr)},Nr.touchend=function(nr){if(nr.originalEvent.preventDefault(),Pt.options.touchEnabled){var qr=Pe.touch(nr,null,Pt)[0];nr.featureTarget=qr,Xe(Fr,{time:new Date().getTime(),point:nr.point})?dn.tap(nr):dn.touchend(nr)}};var Jr=function(nr){return!(nr===8||nr===46||nr>=48&&nr<=57)};function Sn(nr,qr,An){An===void 0&&(An={}),dn.stop();var Zn=ur[nr];if(Zn===void 0)throw new Error(nr+" is not valid");_r=nr;var Mn=Zn(Pt,qr);dn=n(Mn,Pt),An.silent||Pt.map.fire(U.MODE_CHANGE,{mode:nr}),Pt.store.setDirty(),Pt.store.render()}Nr.keydown=function(nr){(nr.srcElement||nr.target).classList.contains("mapboxgl-canvas")&&(nr.keyCode!==8&&nr.keyCode!==46||!Pt.options.controls.trash?Jr(nr.keyCode)?dn.keydown(nr):nr.keyCode===49&&Pt.options.controls.point?Sn(z.DRAW_POINT):nr.keyCode===50&&Pt.options.controls.line_string?Sn(z.DRAW_LINE_STRING):nr.keyCode===51&&Pt.options.controls.polygon&&Sn(z.DRAW_POLYGON):(nr.preventDefault(),dn.trash()))},Nr.keyup=function(nr){Jr(nr.keyCode)&&dn.keyup(nr)},Nr.zoomend=function(){Pt.store.changeZoom()},Nr.data=function(nr){if(nr.dataType==="style"){var qr=Pt.setup,An=Pt.map,Zn=Pt.options,Mn=Pt.store;Zn.styles.some((function(ti){return An.getLayer(ti.id)}))||(qr.addLayers(),Mn.setDirty(),Mn.render())}};var Qr={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){_r=Pt.options.defaultMode,dn=n(ur[_r](Pt),Pt)},changeMode:Sn,actionable:function(nr){var qr=!1;Object.keys(nr).forEach((function(An){if(Qr[An]===void 0)throw new Error("Invalid action type");Qr[An]!==nr[An]&&(qr=!0),Qr[An]=nr[An]})),qr&&Pt.map.fire(U.ACTIONABLE,{actions:Qr})},currentModeName:function(){return _r},currentModeRender:function(nr,qr){return dn.render(nr,qr)},fire:function(nr,qr){Nr[nr]&&Nr[nr](qr)},addEventListeners:function(){Pt.map.on("mousemove",Nr.mousemove),Pt.map.on("mousedown",Nr.mousedown),Pt.map.on("mouseup",Nr.mouseup),Pt.map.on("data",Nr.data),Pt.map.on("touchmove",Nr.touchmove),Pt.map.on("touchstart",Nr.touchstart),Pt.map.on("touchend",Nr.touchend),Pt.container.addEventListener("mouseout",Nr.mouseout),Pt.options.keybindings&&(Pt.container.addEventListener("keydown",Nr.keydown),Pt.container.addEventListener("keyup",Nr.keyup))},removeEventListeners:function(){Pt.map.off("mousemove",Nr.mousemove),Pt.map.off("mousedown",Nr.mousedown),Pt.map.off("mouseup",Nr.mouseup),Pt.map.off("data",Nr.data),Pt.map.off("touchmove",Nr.touchmove),Pt.map.off("touchstart",Nr.touchstart),Pt.map.off("touchend",Nr.touchend),Pt.container.removeEventListener("mouseout",Nr.mouseout),Pt.options.keybindings&&(Pt.container.removeEventListener("keydown",Nr.keydown),Pt.container.removeEventListener("keyup",Nr.keyup))},trash:function(nr){dn.trash(nr)},combineFeatures:function(){dn.combineFeatures()},uncombineFeatures:function(){dn.uncombineFeatures()},getMode:function(){return _r}}})(D),D.ui=(function(Pt){var ur={},xr=null,Fr={mode:null,feature:null,mouse:null},Nr={mode:null,feature:null,mouse:null};function _r(nr){Nr=Or(Nr,nr)}function dn(){var nr,qr;if(Pt.container){var An=[],Zn=[];Er.forEach((function(Mn){Nr[Mn]!==Fr[Mn]&&(An.push(Mn+"-"+Fr[Mn]),Nr[Mn]!==null&&Zn.push(Mn+"-"+Nr[Mn]))})),An.length>0&&(nr=Pt.container.classList).remove.apply(nr,An),Zn.length>0&&(qr=Pt.container.classList).add.apply(qr,Zn),Fr=Or(Fr,Nr)}}function Jr(nr,qr){qr===void 0&&(qr={});var An=document.createElement("button");return An.className=P.CONTROL_BUTTON+" "+qr.className,An.setAttribute("title",qr.title),qr.container.appendChild(An),An.addEventListener("click",(function(Zn){if(Zn.preventDefault(),Zn.stopPropagation(),Zn.target===xr)return Sn(),void qr.onDeactivate();Qr(nr),qr.onActivate()}),!0),An}function Sn(){xr&&(xr.classList.remove(P.ACTIVE_BUTTON),xr=null)}function Qr(nr){Sn();var qr=ur[nr];qr&&qr&&nr!=="trash"&&(qr.classList.add(P.ACTIVE_BUTTON),xr=qr)}return{setActiveButton:Qr,queueMapClasses:_r,updateMapClasses:dn,clearMapClasses:function(){_r({mode:null,feature:null,mouse:null}),dn()},addButtons:function(){var nr=Pt.options.controls,qr=document.createElement("div");return qr.className=P.CONTROL_GROUP+" "+P.CONTROL_BASE,nr&&(nr[O.LINE]&&(ur[O.LINE]=Jr(O.LINE,{container:qr,className:P.CONTROL_BUTTON_LINE,title:"LineString tool "+(Pt.options.keybindings?"(l)":""),onActivate:function(){return Pt.events.changeMode(z.DRAW_LINE_STRING)},onDeactivate:function(){return Pt.events.trash()}})),nr[O.POLYGON]&&(ur[O.POLYGON]=Jr(O.POLYGON,{container:qr,className:P.CONTROL_BUTTON_POLYGON,title:"Polygon tool "+(Pt.options.keybindings?"(p)":""),onActivate:function(){return Pt.events.changeMode(z.DRAW_POLYGON)},onDeactivate:function(){return Pt.events.trash()}})),nr[O.POINT]&&(ur[O.POINT]=Jr(O.POINT,{container:qr,className:P.CONTROL_BUTTON_POINT,title:"Marker tool "+(Pt.options.keybindings?"(m)":""),onActivate:function(){return Pt.events.changeMode(z.DRAW_POINT)},onDeactivate:function(){return Pt.events.trash()}})),nr.trash&&(ur.trash=Jr("trash",{container:qr,className:P.CONTROL_BUTTON_TRASH,title:"Delete",onActivate:function(){Pt.events.trash()}})),nr.combine_features&&(ur.combine_features=Jr("combineFeatures",{container:qr,className:P.CONTROL_BUTTON_COMBINE_FEATURES,title:"Combine",onActivate:function(){Pt.events.combineFeatures()}})),nr.uncombine_features&&(ur.uncombine_features=Jr("uncombineFeatures",{container:qr,className:P.CONTROL_BUTTON_UNCOMBINE_FEATURES,title:"Uncombine",onActivate:function(){Pt.events.uncombineFeatures()}}))),qr},removeButtons:function(){Object.keys(ur).forEach((function(nr){var qr=ur[nr];qr.parentNode&&qr.parentNode.removeChild(qr),delete ur[nr]}))}}})(D),D.container=yt.getContainer(),D.store=new Lr(D),V=D.ui.addButtons(),D.options.boxSelect&&(D.boxZoomInitial=yt.boxZoom.isEnabled(),yt.boxZoom.disable(),yt.dragPan.disable(),yt.dragPan.enable()),yt.loaded()?it.connect():(yt.on("load",it.connect),Ee=setInterval((function(){yt.loaded()&&it.connect()}),16)),D.events.start(),V},addLayers:function(){D.map.addSource(M.COLD,{data:{type:N.FEATURE_COLLECTION,features:[]},type:"geojson"}),D.map.addSource(M.HOT,{data:{type:N.FEATURE_COLLECTION,features:[]},type:"geojson"}),D.options.styles.forEach((function(yt){D.map.addLayer(yt)})),D.store.setDirty(!0),D.store.render()},removeLayers:function(){D.options.styles.forEach((function(yt){D.map.getLayer(yt.id)&&D.map.removeLayer(yt.id)})),D.map.getSource(M.COLD)&&D.map.removeSource(M.COLD),D.map.getSource(M.HOT)&&D.map.removeSource(M.HOT)}};return D.setup=it,it}var yr=[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}];function hn(D){return function(V){var Ee=V.featureTarget;return!!Ee&&!!Ee.properties&&Ee.properties.meta===D}}function Gr(D){return!!D.originalEvent&&!!D.originalEvent.shiftKey&&D.originalEvent.button===0}function jr(D){return!!D.featureTarget&&!!D.featureTarget.properties&&D.featureTarget.properties.active===W.ACTIVE&&D.featureTarget.properties.meta===ae.FEATURE}function Wr(D){return!!D.featureTarget&&!!D.featureTarget.properties&&D.featureTarget.properties.active===W.INACTIVE&&D.featureTarget.properties.meta===ae.FEATURE}function Ur(D){return D.featureTarget===void 0}function Br(D){return!!D.featureTarget&&!!D.featureTarget.properties&&D.featureTarget.properties.meta===ae.FEATURE}function vr(D){var V=D.featureTarget;return!!V&&!!V.properties&&V.properties.meta===ae.VERTEX}function Ir(D){return!!D.originalEvent&&D.originalEvent.shiftKey===!0}function pt(D){return D.keyCode===27}function he(D){return D.keyCode===13}var ce=Object.freeze({__proto__:null,isOfMetaType:hn,isShiftMousedown:Gr,isActiveFeature:jr,isInactiveFeature:Wr,noTarget:Ur,isFeature:Br,isVertex:vr,isShiftDown:Ir,isEscapeKey:pt,isEnterKey:he,isTrue:function(){return!0}}),Ae=He;function He(D,V){this.x=D,this.y=V}He.prototype={clone:function(){return new He(this.x,this.y)},add:function(D){return this.clone()._add(D)},sub:function(D){return this.clone()._sub(D)},multByPoint:function(D){return this.clone()._multByPoint(D)},divByPoint:function(D){return this.clone()._divByPoint(D)},mult:function(D){return this.clone()._mult(D)},div:function(D){return this.clone()._div(D)},rotate:function(D){return this.clone()._rotate(D)},rotateAround:function(D,V){return this.clone()._rotateAround(D,V)},matMult:function(D){return this.clone()._matMult(D)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(D){return this.x===D.x&&this.y===D.y},dist:function(D){return Math.sqrt(this.distSqr(D))},distSqr:function(D){var V=D.x-this.x,Ee=D.y-this.y;return V*V+Ee*Ee},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(D){return Math.atan2(this.y-D.y,this.x-D.x)},angleWith:function(D){return this.angleWithSep(D.x,D.y)},angleWithSep:function(D,V){return Math.atan2(this.x*V-this.y*D,this.x*D+this.y*V)},_matMult:function(D){var V=D[0]*this.x+D[1]*this.y,Ee=D[2]*this.x+D[3]*this.y;return this.x=V,this.y=Ee,this},_add:function(D){return this.x+=D.x,this.y+=D.y,this},_sub:function(D){return this.x-=D.x,this.y-=D.y,this},_mult:function(D){return this.x*=D,this.y*=D,this},_div:function(D){return this.x/=D,this.y/=D,this},_multByPoint:function(D){return this.x*=D.x,this.y*=D.y,this},_divByPoint:function(D){return this.x/=D.x,this.y/=D.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var D=this.y;return this.y=this.x,this.x=-D,this},_rotate:function(D){var V=Math.cos(D),Ee=Math.sin(D),it=V*this.x-Ee*this.y,yt=Ee*this.x+V*this.y;return this.x=it,this.y=yt,this},_rotateAround:function(D,V){var Ee=Math.cos(D),it=Math.sin(D),yt=V.x+Ee*(this.x-V.x)-it*(this.y-V.y),st=V.y+it*(this.x-V.x)+Ee*(this.y-V.y);return this.x=yt,this.y=st,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},He.convert=function(D){return D instanceof He?D:Array.isArray(D)?new He(D[0],D[1]):D};var tt=a(Ae);function mt(D,V){var Ee=V.getBoundingClientRect();return new tt(D.clientX-Ee.left-(V.clientLeft||0),D.clientY-Ee.top-(V.clientTop||0))}function St(D,V,Ee,it){return{type:N.FEATURE,properties:{meta:ae.VERTEX,parent:D,coord_path:Ee,active:it?W.ACTIVE:W.INACTIVE},geometry:{type:N.POINT,coordinates:V}}}function vt(D,V,Ee){var it=V.geometry.coordinates,yt=Ee.geometry.coordinates;if(it[1]>85||it[1]<te||yt[1]>85||yt[1]<te)return null;var st={lng:(it[0]+yt[0])/2,lat:(it[1]+yt[1])/2};return{type:N.FEATURE,properties:{meta:ae.MIDPOINT,parent:D,lng:st.lng,lat:st.lat,coord_path:Ee.properties.coord_path},geometry:{type:N.POINT,coordinates:[st.lng,st.lat]}}}function Ft(D,V,Ee){V===void 0&&(V={}),Ee===void 0&&(Ee=null);var it,yt=D.geometry,st=yt.type,Pt=yt.coordinates,ur=D.properties&&D.properties.id,xr=[];function Fr(_r,dn){var Jr="",Sn=null;_r.forEach((function(Qr,nr){var qr=dn!=null?dn+"."+nr:String(nr),An=St(ur,Qr,qr,Nr(qr));if(V.midpoints&&Sn){var Zn=vt(ur,Sn,An);Zn&&xr.push(Zn)}Sn=An;var Mn=JSON.stringify(Qr);Jr!==Mn&&xr.push(An),nr===0&&(Jr=Mn)}))}function Nr(_r){return!!V.selectedPaths&&V.selectedPaths.indexOf(_r)!==-1}return st===N.POINT?xr.push(St(ur,Pt,Ee,Nr(Ee))):st===N.POLYGON?Pt.forEach((function(_r,dn){Fr(_r,Ee!==null?Ee+"."+dn:String(dn))})):st===N.LINE_STRING?Fr(Pt,Ee):st.indexOf(N.MULTI_PREFIX)===0&&(it=st.replace(N.MULTI_PREFIX,""),Pt.forEach((function(_r,dn){var Jr={type:N.FEATURE,properties:D.properties,geometry:{type:it,coordinates:_r}};xr=xr.concat(Ft(Jr,V,dn))}))),xr}var It={enable:function(D){setTimeout((function(){D.map&&D.map.doubleClickZoom&&D._ctx&&D._ctx.store&&D._ctx.store.getInitialConfigValue&&D._ctx.store.getInitialConfigValue("doubleClickZoom")&&D.map.doubleClickZoom.enable()}),0)},disable:function(D){setTimeout((function(){D.map&&D.map.doubleClickZoom&&D.map.doubleClickZoom.disable()}),0)}},_t={exports:{}},kt=function(D){if(!D||!D.type)return null;var V=ct[D.type];if(!V)return null;if(V==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:D}]};if(V==="feature")return{type:"FeatureCollection",features:[D]};if(V==="featurecollection")return D},ct={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"},dr=a(kt),Zr=Object.freeze({__proto__:null,default:function D(V){switch(V&&V.type||null){case"FeatureCollection":return V.features=V.features.reduce((function(Ee,it){return Ee.concat(D(it))}),[]),V;case"Feature":return V.geometry?D(V.geometry).map((function(Ee){var it={type:"Feature",properties:JSON.parse(JSON.stringify(V.properties)),geometry:Ee};return V.id!==void 0&&(it.id=V.id),it})):[V];case"MultiPoint":return V.coordinates.map((function(Ee){return{type:"Point",coordinates:Ee}}));case"MultiPolygon":return V.coordinates.map((function(Ee){return{type:"Polygon",coordinates:Ee}}));case"MultiLineString":return V.coordinates.map((function(Ee){return{type:"LineString",coordinates:Ee}}));case"GeometryCollection":return V.geometries.map(D).reduce((function(Ee,it){return Ee.concat(it)}),[]);case"Point":case"Polygon":case"LineString":return[V]}}}),kr=kt,ar=c(Zr),sn=function(D){return(function V(Ee){return Array.isArray(Ee)&&Ee.length&&typeof Ee[0]=="number"?[Ee]:Ee.reduce((function(it,yt){return Array.isArray(yt)&&Array.isArray(yt[0])?it.concat(V(yt)):(it.push(yt),it)}),[])})(D)};ar instanceof Function||(ar=ar.default);var Q={exports:{}},pe=Q.exports=function(D){return new We(D)};function We(D){this.value=D}function ft(D,V,Ee){var it=[],yt=[],st=!0;return(function Pt(ur){var xr=Ee?Ht(ur):ur,Fr={},Nr=!0,_r={node:xr,node_:ur,path:[].concat(it),parent:yt[yt.length-1],parents:yt,key:it.slice(-1)[0],isRoot:it.length===0,level:it.length,circular:null,update:function(Sn,Qr){_r.isRoot||(_r.parent.node[_r.key]=Sn),_r.node=Sn,Qr&&(Nr=!1)},delete:function(Sn){delete _r.parent.node[_r.key],Sn&&(Nr=!1)},remove:function(Sn){Ln(_r.parent.node)?_r.parent.node.splice(_r.key,1):delete _r.parent.node[_r.key],Sn&&(Nr=!1)},keys:null,before:function(Sn){Fr.before=Sn},after:function(Sn){Fr.after=Sn},pre:function(Sn){Fr.pre=Sn},post:function(Sn){Fr.post=Sn},stop:function(){st=!1},block:function(){Nr=!1}};if(!st)return _r;function dn(){if(typeof _r.node=="object"&&_r.node!==null){_r.keys&&_r.node_===_r.node||(_r.keys=Sr(_r.node)),_r.isLeaf=_r.keys.length==0;for(var Sn=0;Sn<yt.length;Sn++)if(yt[Sn].node_===ur){_r.circular=yt[Sn];break}}else _r.isLeaf=!0,_r.keys=null;_r.notLeaf=!_r.isLeaf,_r.notRoot=!_r.isRoot}dn();var Jr=V.call(_r,_r.node);return Jr!==void 0&&_r.update&&_r.update(Jr),Fr.before&&Fr.before.call(_r,_r.node),Nr&&(typeof _r.node!="object"||_r.node===null||_r.circular||(yt.push(_r),dn(),vn(_r.keys,(function(Sn,Qr){it.push(Sn),Fr.pre&&Fr.pre.call(_r,_r.node[Sn],Sn);var nr=Pt(_r.node[Sn]);Ee&&ei.call(_r.node,Sn)&&(_r.node[Sn]=nr.node),nr.isLast=Qr==_r.keys.length-1,nr.isFirst=Qr==0,Fr.post&&Fr.post.call(_r,nr),it.pop()})),yt.pop()),Fr.after&&Fr.after.call(_r,_r.node)),_r})(D).node}function Ht(D){if(typeof D=="object"&&D!==null){var V;if(Ln(D))V=[];else if(Yt(D)==="[object Date]")V=new Date(D.getTime?D.getTime():D);else if((function(yt){return Yt(yt)==="[object RegExp]"})(D))V=new RegExp(D);else if((function(yt){return Yt(yt)==="[object Error]"})(D))V={message:D.message};else if((function(yt){return Yt(yt)==="[object Boolean]"})(D))V=new Boolean(D);else if((function(yt){return Yt(yt)==="[object Number]"})(D))V=new Number(D);else if((function(yt){return Yt(yt)==="[object String]"})(D))V=new String(D);else if(Object.create&&Object.getPrototypeOf)V=Object.create(Object.getPrototypeOf(D));else if(D.constructor===Object)V={};else{var Ee=D.constructor&&D.constructor.prototype||D.__proto__||{},it=function(){};it.prototype=Ee,V=new it}return vn(Sr(D),(function(yt){V[yt]=D[yt]})),V}return D}We.prototype.get=function(D){for(var V=this.value,Ee=0;Ee<D.length;Ee++){var it=D[Ee];if(!V||!ei.call(V,it)){V=void 0;break}V=V[it]}return V},We.prototype.has=function(D){for(var V=this.value,Ee=0;Ee<D.length;Ee++){var it=D[Ee];if(!V||!ei.call(V,it))return!1;V=V[it]}return!0},We.prototype.set=function(D,V){for(var Ee=this.value,it=0;it<D.length-1;it++){var yt=D[it];ei.call(Ee,yt)||(Ee[yt]={}),Ee=Ee[yt]}return Ee[D[it]]=V,V},We.prototype.map=function(D){return ft(this.value,D,!0)},We.prototype.forEach=function(D){return this.value=ft(this.value,D,!1),this.value},We.prototype.reduce=function(D,V){var Ee=arguments.length===1,it=Ee?this.value:V;return this.forEach((function(yt){this.isRoot&&Ee||(it=D.call(this,it,yt))})),it},We.prototype.paths=function(){var D=[];return this.forEach((function(V){D.push(this.path)})),D},We.prototype.nodes=function(){var D=[];return this.forEach((function(V){D.push(this.node)})),D},We.prototype.clone=function(){var D=[],V=[];return(function Ee(it){for(var yt=0;yt<D.length;yt++)if(D[yt]===it)return V[yt];if(typeof it=="object"&&it!==null){var st=Ht(it);return D.push(it),V.push(st),vn(Sr(it),(function(Pt){st[Pt]=Ee(it[Pt])})),D.pop(),V.pop(),st}return it})(this.value)};var Sr=Object.keys||function(D){var V=[];for(var Ee in D)V.push(Ee);return V};function Yt(D){return Object.prototype.toString.call(D)}var Ln=Array.isArray||function(D){return Object.prototype.toString.call(D)==="[object Array]"},vn=function(D,V){if(D.forEach)return D.forEach(V);for(var Ee=0;Ee<D.length;Ee++)V(D[Ee],Ee,D)};vn(Sr(We.prototype),(function(D){pe[D]=function(V){var Ee=[].slice.call(arguments,1),it=new We(V);return it[D].apply(it,Ee)}}));var ei=Object.hasOwnProperty||function(D,V){return V in D},ai=Q.exports,pr=Vr;function Vr(D){if(!(this instanceof Vr))return new Vr(D);this._bbox=D||[1/0,1/0,-1/0,-1/0],this._valid=!!D}Vr.prototype.include=function(D){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],D[0]),this._bbox[1]=Math.min(this._bbox[1],D[1]),this._bbox[2]=Math.max(this._bbox[2],D[0]),this._bbox[3]=Math.max(this._bbox[3],D[1]),this},Vr.prototype.equals=function(D){var V;return V=D instanceof Vr?D.bbox():D,this._bbox[0]==V[0]&&this._bbox[1]==V[1]&&this._bbox[2]==V[2]&&this._bbox[3]==V[3]},Vr.prototype.center=function(D){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Vr.prototype.union=function(D){var V;return this._valid=!0,V=D instanceof Vr?D.bbox():D,this._bbox[0]=Math.min(this._bbox[0],V[0]),this._bbox[1]=Math.min(this._bbox[1],V[1]),this._bbox[2]=Math.max(this._bbox[2],V[2]),this._bbox[3]=Math.max(this._bbox[3],V[3]),this},Vr.prototype.bbox=function(){return this._valid?this._bbox:null},Vr.prototype.contains=function(D){if(!D)return this._fastContains();if(!this._valid)return null;var V=D[0],Ee=D[1];return this._bbox[0]<=V&&this._bbox[1]<=Ee&&this._bbox[2]>=V&&this._bbox[3]>=Ee},Vr.prototype.intersect=function(D){return this._valid?(V=D instanceof Vr?D.bbox():D,!(this._bbox[0]>V[2]||this._bbox[2]<V[0]||this._bbox[3]<V[1]||this._bbox[1]>V[3])):null;var V},Vr.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var D="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",D)},Vr.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var ln=function(D){if(!D)return[];var V=ar(kr(D)),Ee=[];return V.features.forEach((function(it){it.geometry&&(Ee=Ee.concat(sn(it.geometry.coordinates)))})),Ee},di=ai,no=pr,Oi={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},bn=Object.keys(Oi);function fo(D){for(var V=no(),Ee=ln(D),it=0;it<Ee.length;it++)V.include(Ee[it]);return V}_t.exports=function(D){return fo(D).bbox()},_t.exports.polygon=function(D){return fo(D).polygon()},_t.exports.bboxify=function(D){return di(D).map((function(V){V&&bn.some((function(Ee){return!!V[Ee]&&Oi[Ee].indexOf(V.type)!==-1}))&&(V.bbox=fo(V).bbox(),this.update(V))}))};var Ci=a(_t.exports),hi=-90;function zo(D,V){var Ee=hi,it=90,yt=hi,st=90,Pt=270,ur=-270;D.forEach((function(Fr){var Nr=Ci(Fr),_r=Nr[1],dn=Nr[3],Jr=Nr[0],Sn=Nr[2];_r>Ee&&(Ee=_r),dn<it&&(it=dn),dn>yt&&(yt=dn),_r<st&&(st=_r),Jr<Pt&&(Pt=Jr),Sn>ur&&(ur=Sn)}));var xr=V;return Ee+xr.lat>85&&(xr.lat=85-Ee),yt+xr.lat>90&&(xr.lat=90-yt),it+xr.lat<-85&&(xr.lat=-85-it),st+xr.lat<hi&&(xr.lat=hi-st),Pt+xr.lng<=-270&&(xr.lng+=360*Math.ceil(Math.abs(xr.lng)/360)),ur+xr.lng>=270&&(xr.lng-=360*Math.ceil(Math.abs(xr.lng)/360)),xr}function ms(D,V){var Ee=zo(D.map((function(it){return it.toGeoJSON()})),V);D.forEach((function(it){var yt,st=it.getCoordinates(),Pt=function(xr){var Fr={lng:xr[0]+Ee.lng,lat:xr[1]+Ee.lat};return[Fr.lng,Fr.lat]},ur=function(xr){return xr.map((function(Fr){return Pt(Fr)}))};it.type===N.POINT?yt=Pt(st):it.type===N.LINE_STRING||it.type===N.MULTI_POINT?yt=st.map(Pt):it.type===N.POLYGON||it.type===N.MULTI_LINE_STRING?yt=st.map(ur):it.type===N.MULTI_POLYGON&&(yt=st.map((function(xr){return xr.map((function(Fr){return ur(Fr)}))}))),it.incomingCoords(yt)}))}var qn={onSetup:function(D){var V=this,Ee={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:D.featureIds||[]};return this.setSelected(Ee.initiallySelectedFeatureIds.filter((function(it){return V.getFeature(it)!==void 0}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),Ee},fireUpdate:function(){this.map.fire(U.UPDATE,{action:ee.MOVE,features:this.getSelected().map((function(D){return D.toGeoJSON()}))})},fireActionable:function(){var D=this,V=this.getSelected(),Ee=V.filter((function(ur){return D.isInstanceOf("MultiFeature",ur)})),it=!1;if(V.length>1){it=!0;var yt=V[0].type.replace("Multi","");V.forEach((function(ur){ur.type.replace("Multi","")!==yt&&(it=!1)}))}var st=Ee.length>0,Pt=V.length>0;this.setActionableState({combineFeatures:it,uncombineFeatures:st,trash:Pt})},getUniqueIds:function(D){return D.length?D.map((function(V){return V.properties.id})).filter((function(V){return V!==void 0})).reduce((function(V,Ee){return V.add(Ee),V}),new H).values():[]},stopExtendedInteractions:function(D){D.boxSelectElement&&(D.boxSelectElement.parentNode&&D.boxSelectElement.parentNode.removeChild(D.boxSelectElement),D.boxSelectElement=null),this.map.dragPan.enable(),D.boxSelecting=!1,D.canBoxSelect=!1,D.dragMoving=!1,D.canDragMove=!1},onStop:function(){It.enable(this)},onMouseMove:function(D,V){return Br(V)&&D.dragMoving&&this.fireUpdate(),this.stopExtendedInteractions(D),!0},onMouseOut:function(D){return!D.dragMoving||this.fireUpdate()}};qn.onTap=qn.onClick=function(D,V){return Ur(V)?this.clickAnywhere(D,V):hn(ae.VERTEX)(V)?this.clickOnVertex(D,V):Br(V)?this.clickOnFeature(D,V):void 0},qn.clickAnywhere=function(D){var V=this,Ee=this.getSelectedIds();Ee.length&&(this.clearSelectedFeatures(),Ee.forEach((function(it){return V.doRender(it)}))),It.enable(this),this.stopExtendedInteractions(D)},qn.clickOnVertex=function(D,V){this.changeMode(z.DIRECT_SELECT,{featureId:V.featureTarget.properties.parent,coordPath:V.featureTarget.properties.coord_path,startPos:V.lngLat}),this.updateUIClasses({mouse:E.MOVE})},qn.startOnActiveFeature=function(D,V){this.stopExtendedInteractions(D),this.map.dragPan.disable(),this.doRender(V.featureTarget.properties.id),D.canDragMove=!0,D.dragMoveLocation=V.lngLat},qn.clickOnFeature=function(D,V){var Ee=this;It.disable(this),this.stopExtendedInteractions(D);var it=Ir(V),yt=this.getSelectedIds(),st=V.featureTarget.properties.id,Pt=this.isSelected(st);if(!it&&Pt&&this.getFeature(st).type!==N.POINT)return this.changeMode(z.DIRECT_SELECT,{featureId:st});Pt&&it?(this.deselect(st),this.updateUIClasses({mouse:E.POINTER}),yt.length===1&&It.enable(this)):!Pt&&it?(this.select(st),this.updateUIClasses({mouse:E.MOVE})):Pt||it||(yt.forEach((function(ur){return Ee.doRender(ur)})),this.setSelected(st),this.updateUIClasses({mouse:E.MOVE})),this.doRender(st)},qn.onMouseDown=function(D,V){return jr(V)?this.startOnActiveFeature(D,V):this.drawConfig.boxSelect&&Gr(V)?this.startBoxSelect(D,V):void 0},qn.startBoxSelect=function(D,V){this.stopExtendedInteractions(D),this.map.dragPan.disable(),D.boxSelectStartLocation=mt(V.originalEvent,this.map.getContainer()),D.canBoxSelect=!0},qn.onTouchStart=function(D,V){if(jr(V))return this.startOnActiveFeature(D,V)},qn.onDrag=function(D,V){return D.canDragMove?this.dragMove(D,V):this.drawConfig.boxSelect&&D.canBoxSelect?this.whileBoxSelect(D,V):void 0},qn.whileBoxSelect=function(D,V){D.boxSelecting=!0,this.updateUIClasses({mouse:E.ADD}),D.boxSelectElement||(D.boxSelectElement=document.createElement("div"),D.boxSelectElement.classList.add(P.BOX_SELECT),this.map.getContainer().appendChild(D.boxSelectElement));var Ee=mt(V.originalEvent,this.map.getContainer()),it=Math.min(D.boxSelectStartLocation.x,Ee.x),yt=Math.max(D.boxSelectStartLocation.x,Ee.x),st=Math.min(D.boxSelectStartLocation.y,Ee.y),Pt=Math.max(D.boxSelectStartLocation.y,Ee.y),ur="translate("+it+"px, "+st+"px)";D.boxSelectElement.style.transform=ur,D.boxSelectElement.style.WebkitTransform=ur,D.boxSelectElement.style.width=yt-it+"px",D.boxSelectElement.style.height=Pt-st+"px"},qn.dragMove=function(D,V){D.dragMoving=!0,V.originalEvent.stopPropagation();var Ee={lng:V.lngLat.lng-D.dragMoveLocation.lng,lat:V.lngLat.lat-D.dragMoveLocation.lat};ms(this.getSelected(),Ee),D.dragMoveLocation=V.lngLat},qn.onTouchEnd=qn.onMouseUp=function(D,V){var Ee=this;if(D.dragMoving)this.fireUpdate();else if(D.boxSelecting){var it=[D.boxSelectStartLocation,mt(V.originalEvent,this.map.getContainer())],yt=this.featuresAt(null,it,"click"),st=this.getUniqueIds(yt).filter((function(Pt){return!Ee.isSelected(Pt)}));st.length&&(this.select(st),st.forEach((function(Pt){return Ee.doRender(Pt)})),this.updateUIClasses({mouse:E.MOVE}))}this.stopExtendedInteractions(D)},qn.toDisplayFeatures=function(D,V,Ee){V.properties.active=this.isSelected(V.properties.id)?W.ACTIVE:W.INACTIVE,Ee(V),this.fireActionable(),V.properties.active===W.ACTIVE&&V.geometry.type!==N.POINT&&Ft(V).forEach(Ee)},qn.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},qn.onCombineFeatures=function(){var D=this.getSelected();if(!(D.length===0||D.length<2)){for(var V=[],Ee=[],it=D[0].type.replace("Multi",""),yt=0;yt<D.length;yt++){var st=D[yt];if(st.type.replace("Multi","")!==it)return;st.type.includes("Multi")?st.getCoordinates().forEach((function(ur){V.push(ur)})):V.push(st.getCoordinates()),Ee.push(st.toGeoJSON())}if(Ee.length>1){var Pt=this.newFeature({type:N.FEATURE,properties:Ee[0].properties,geometry:{type:"Multi"+it,coordinates:V}});this.addFeature(Pt),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([Pt.id]),this.map.fire(U.COMBINE_FEATURES,{createdFeatures:[Pt.toGeoJSON()],deletedFeatures:Ee})}this.fireActionable()}},qn.onUncombineFeatures=function(){var D=this,V=this.getSelected();if(V.length!==0){for(var Ee=[],it=[],yt=function(Pt){var ur=V[Pt];D.isInstanceOf("MultiFeature",ur)&&(ur.getFeatures().forEach((function(xr){D.addFeature(xr),xr.properties=ur.properties,Ee.push(xr.toGeoJSON()),D.select([xr.id])})),D.deleteFeature(ur.id,{silent:!0}),it.push(ur.toGeoJSON()))},st=0;st<V.length;st++)yt(st);Ee.length>1&&this.map.fire(U.UNCOMBINE_FEATURES,{createdFeatures:Ee,deletedFeatures:it}),this.fireActionable()}};var gs=hn(ae.VERTEX),jo=hn(ae.MIDPOINT),Wn={fireUpdate:function(){this.map.fire(U.UPDATE,{action:ee.CHANGE_COORDINATES,features:this.getSelected().map((function(D){return D.toGeoJSON()}))})},fireActionable:function(D){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:D.selectedCoordPaths.length>0})},startDragging:function(D,V){this.map.dragPan.disable(),D.canDragMove=!0,D.dragMoveLocation=V.lngLat},stopDragging:function(D){this.map.dragPan.enable(),D.dragMoving=!1,D.canDragMove=!1,D.dragMoveLocation=null},onVertex:function(D,V){this.startDragging(D,V);var Ee=V.featureTarget.properties,it=D.selectedCoordPaths.indexOf(Ee.coord_path);Ir(V)||it!==-1?Ir(V)&&it===-1&&D.selectedCoordPaths.push(Ee.coord_path):D.selectedCoordPaths=[Ee.coord_path];var yt=this.pathsToCoordinates(D.featureId,D.selectedCoordPaths);this.setSelectedCoordinates(yt)},onMidpoint:function(D,V){this.startDragging(D,V);var Ee=V.featureTarget.properties;D.feature.addCoordinate(Ee.coord_path,Ee.lng,Ee.lat),this.fireUpdate(),D.selectedCoordPaths=[Ee.coord_path]},pathsToCoordinates:function(D,V){return V.map((function(Ee){return{feature_id:D,coord_path:Ee}}))},onFeature:function(D,V){D.selectedCoordPaths.length===0?this.startDragging(D,V):this.stopDragging(D)},dragFeature:function(D,V,Ee){ms(this.getSelected(),Ee),D.dragMoveLocation=V.lngLat},dragVertex:function(D,V,Ee){for(var it=D.selectedCoordPaths.map((function(ur){return D.feature.getCoordinate(ur)})),yt=zo(it.map((function(ur){return{type:N.FEATURE,properties:{},geometry:{type:N.POINT,coordinates:ur}}})),Ee),st=0;st<it.length;st++){var Pt=it[st];D.feature.updateCoordinate(D.selectedCoordPaths[st],Pt[0]+yt.lng,Pt[1]+yt.lat)}},clickNoTarget:function(){this.changeMode(z.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(z.SIMPLE_SELECT)},clickActiveFeature:function(D){D.selectedCoordPaths=[],this.clearSelectedCoordinates(),D.feature.changed()},onSetup:function(D){var V=D.featureId,Ee=this.getFeature(V);if(!Ee)throw new Error("You must provide a featureId to enter direct_select mode");if(Ee.type===N.POINT)throw new TypeError("direct_select mode doesn't handle point features");var it={featureId:V,feature:Ee,dragMoveLocation:D.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:D.coordPath?[D.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(V,it.selectedCoordPaths)),this.setSelected(V),It.disable(this),this.setActionableState({trash:!0}),it},onStop:function(){It.enable(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(D,V,Ee){D.featureId===V.properties.id?(V.properties.active=W.ACTIVE,Ee(V),Ft(V,{map:this.map,midpoints:!0,selectedPaths:D.selectedCoordPaths}).forEach(Ee)):(V.properties.active=W.INACTIVE,Ee(V)),this.fireActionable(D)},onTrash:function(D){D.selectedCoordPaths.sort((function(V,Ee){return Ee.localeCompare(V,"en",{numeric:!0})})).forEach((function(V){return D.feature.removeCoordinate(V)})),this.fireUpdate(),D.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(D),D.feature.isValid()===!1&&(this.deleteFeature([D.featureId]),this.changeMode(z.SIMPLE_SELECT,{}))},onMouseMove:function(D,V){var Ee=jr(V),it=gs(V),yt=jo(V),st=D.selectedCoordPaths.length===0;return Ee&&st||it&&!st?this.updateUIClasses({mouse:E.MOVE}):this.updateUIClasses({mouse:E.NONE}),(it||Ee||yt)&&D.dragMoving&&this.fireUpdate(),this.stopDragging(D),!0},onMouseOut:function(D){return D.dragMoving&&this.fireUpdate(),!0}};Wn.onTouchStart=Wn.onMouseDown=function(D,V){return gs(V)?this.onVertex(D,V):jr(V)?this.onFeature(D,V):jo(V)?this.onMidpoint(D,V):void 0},Wn.onDrag=function(D,V){if(D.canDragMove===!0){D.dragMoving=!0,V.originalEvent.stopPropagation();var Ee={lng:V.lngLat.lng-D.dragMoveLocation.lng,lat:V.lngLat.lat-D.dragMoveLocation.lat};D.selectedCoordPaths.length>0?this.dragVertex(D,V,Ee):this.dragFeature(D,V,Ee),D.dragMoveLocation=V.lngLat}},Wn.onClick=function(D,V){return Ur(V)?this.clickNoTarget(D,V):jr(V)?this.clickActiveFeature(D,V):Wr(V)?this.clickInactive(D,V):void this.stopDragging(D)},Wn.onTap=function(D,V){return Ur(V)?this.clickNoTarget(D,V):jr(V)?this.clickActiveFeature(D,V):Wr(V)?this.clickInactive(D,V):void 0},Wn.onTouchEnd=Wn.onMouseUp=function(D){D.dragMoving&&this.fireUpdate(),this.stopDragging(D)};var da={};function es(D,V){return!!D.lngLat&&D.lngLat.lng===V[0]&&D.lngLat.lat===V[1]}da.onSetup=function(){var D=this.newFeature({type:N.FEATURE,properties:{},geometry:{type:N.POINT,coordinates:[]}});return this.addFeature(D),this.clearSelectedFeatures(),this.updateUIClasses({mouse:E.ADD}),this.activateUIButton(O.POINT),this.setActionableState({trash:!0}),{point:D}},da.stopDrawingAndRemove=function(D){this.deleteFeature([D.point.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT)},da.onTap=da.onClick=function(D,V){this.updateUIClasses({mouse:E.MOVE}),D.point.updateCoordinate("",V.lngLat.lng,V.lngLat.lat),this.map.fire(U.CREATE,{features:[D.point.toGeoJSON()]}),this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.point.id]})},da.onStop=function(D){this.activateUIButton(),D.point.getCoordinate().length||this.deleteFeature([D.point.id],{silent:!0})},da.toDisplayFeatures=function(D,V,Ee){var it=V.properties.id===D.point.id;if(V.properties.active=it?W.ACTIVE:W.INACTIVE,!it)return Ee(V)},da.onTrash=da.stopDrawingAndRemove,da.onKeyUp=function(D,V){if(pt(V)||he(V))return this.stopDrawingAndRemove(D,V)};var Aa={onSetup:function(){var D=this.newFeature({type:N.FEATURE,properties:{},geometry:{type:N.POLYGON,coordinates:[[]]}});return this.addFeature(D),this.clearSelectedFeatures(),It.disable(this),this.updateUIClasses({mouse:E.ADD}),this.activateUIButton(O.POLYGON),this.setActionableState({trash:!0}),{polygon:D,currentVertexPosition:0}},clickAnywhere:function(D,V){if(D.currentVertexPosition>0&&es(V,D.polygon.coordinates[0][D.currentVertexPosition-1]))return this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.polygon.id]});this.updateUIClasses({mouse:E.ADD}),D.polygon.updateCoordinate("0."+D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat),D.currentVertexPosition++,D.polygon.updateCoordinate("0."+D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat)},clickOnVertex:function(D){return this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.polygon.id]})},onMouseMove:function(D,V){D.polygon.updateCoordinate("0."+D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat),vr(V)&&this.updateUIClasses({mouse:E.POINTER})}};Aa.onTap=Aa.onClick=function(D,V){return vr(V)?this.clickOnVertex(D,V):this.clickAnywhere(D,V)},Aa.onKeyUp=function(D,V){pt(V)?(this.deleteFeature([D.polygon.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT)):he(V)&&this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.polygon.id]})},Aa.onStop=function(D){this.updateUIClasses({mouse:E.NONE}),It.enable(this),this.activateUIButton(),this.getFeature(D.polygon.id)!==void 0&&(D.polygon.removeCoordinate("0."+D.currentVertexPosition),D.polygon.isValid()?this.map.fire(U.CREATE,{features:[D.polygon.toGeoJSON()]}):(this.deleteFeature([D.polygon.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT,{},{silent:!0})))},Aa.toDisplayFeatures=function(D,V,Ee){var it=V.properties.id===D.polygon.id;if(V.properties.active=it?W.ACTIVE:W.INACTIVE,!it)return Ee(V);if(V.geometry.coordinates.length!==0){var yt=V.geometry.coordinates[0].length;if(!(yt<3)){if(V.properties.meta=ae.FEATURE,Ee(St(D.polygon.id,V.geometry.coordinates[0][0],"0.0",!1)),yt>3){var st=V.geometry.coordinates[0].length-3;Ee(St(D.polygon.id,V.geometry.coordinates[0][st],"0."+st,!1))}if(yt<=4){var Pt=[[V.geometry.coordinates[0][0][0],V.geometry.coordinates[0][0][1]],[V.geometry.coordinates[0][1][0],V.geometry.coordinates[0][1][1]]];if(Ee({type:N.FEATURE,properties:V.properties,geometry:{coordinates:Pt,type:N.LINE_STRING}}),yt===3)return}return Ee(V)}}},Aa.onTrash=function(D){this.deleteFeature([D.polygon.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT)};var Io={onSetup:function(D){var V,Ee,it=(D=D||{}).featureId,yt="forward";if(it){if(!(V=this.getFeature(it)))throw new Error("Could not find a feature with the provided featureId");var st=D.from;if(st&&st.type==="Feature"&&st.geometry&&st.geometry.type==="Point"&&(st=st.geometry),st&&st.type==="Point"&&st.coordinates&&st.coordinates.length===2&&(st=st.coordinates),!st||!Array.isArray(st))throw new Error("Please use the `from` property to indicate which point to continue the line from");var Pt=V.coordinates.length-1;if(V.coordinates[Pt][0]===st[0]&&V.coordinates[Pt][1]===st[1])Ee=Pt+1,V.addCoordinate.apply(V,[Ee].concat(V.coordinates[Pt]));else{if(V.coordinates[0][0]!==st[0]||V.coordinates[0][1]!==st[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");yt="backwards",Ee=0,V.addCoordinate.apply(V,[Ee].concat(V.coordinates[0]))}}else V=this.newFeature({type:N.FEATURE,properties:{},geometry:{type:N.LINE_STRING,coordinates:[]}}),Ee=0,this.addFeature(V);return this.clearSelectedFeatures(),It.disable(this),this.updateUIClasses({mouse:E.ADD}),this.activateUIButton(O.LINE),this.setActionableState({trash:!0}),{line:V,currentVertexPosition:Ee,direction:yt}},clickAnywhere:function(D,V){if(D.currentVertexPosition>0&&es(V,D.line.coordinates[D.currentVertexPosition-1])||D.direction==="backwards"&&es(V,D.line.coordinates[D.currentVertexPosition+1]))return this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.line.id]});this.updateUIClasses({mouse:E.ADD}),D.line.updateCoordinate(D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat),D.direction==="forward"?(D.currentVertexPosition++,D.line.updateCoordinate(D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat)):D.line.addCoordinate(0,V.lngLat.lng,V.lngLat.lat)},clickOnVertex:function(D){return this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.line.id]})},onMouseMove:function(D,V){D.line.updateCoordinate(D.currentVertexPosition,V.lngLat.lng,V.lngLat.lat),vr(V)&&this.updateUIClasses({mouse:E.POINTER})}};Io.onTap=Io.onClick=function(D,V){if(vr(V))return this.clickOnVertex(D,V);this.clickAnywhere(D,V)},Io.onKeyUp=function(D,V){he(V)?this.changeMode(z.SIMPLE_SELECT,{featureIds:[D.line.id]}):pt(V)&&(this.deleteFeature([D.line.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT))},Io.onStop=function(D){It.enable(this),this.activateUIButton(),this.getFeature(D.line.id)!==void 0&&(D.line.removeCoordinate(""+D.currentVertexPosition),D.line.isValid()?this.map.fire(U.CREATE,{features:[D.line.toGeoJSON()]}):(this.deleteFeature([D.line.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT,{},{silent:!0})))},Io.onTrash=function(D){this.deleteFeature([D.line.id],{silent:!0}),this.changeMode(z.SIMPLE_SELECT)},Io.toDisplayFeatures=function(D,V,Ee){var it=V.properties.id===D.line.id;if(V.properties.active=it?W.ACTIVE:W.INACTIVE,!it)return Ee(V);V.geometry.coordinates.length<2||(V.properties.meta=ae.FEATURE,Ee(St(D.line.id,V.geometry.coordinates[D.direction==="forward"?V.geometry.coordinates.length-2:1],""+(D.direction==="forward"?V.geometry.coordinates.length-2:1),!1)),Ee(V))};var ts={simple_select:qn,direct_select:Wn,draw_point:da,draw_polygon:Aa,draw_line_string:Io},io={defaultMode:z.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:yr,modes:ts,controls:{},userProperties:!1},ru={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},nu={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function na(D,V){return D.map((function(Ee){return Ee.source?Ee:Or(Ee,{id:Ee.id+"."+V,source:V==="hot"?M.HOT:M.COLD})}))}var ys={exports:{}};(function(D,V){var Ee="__lodash_hash_undefined__",it=9007199254740991,yt="[object Arguments]",st="[object Array]",Pt="[object Boolean]",ur="[object Date]",xr="[object Error]",Fr="[object Function]",Nr="[object Map]",_r="[object Number]",dn="[object Object]",Jr="[object Promise]",Sn="[object RegExp]",Qr="[object Set]",nr="[object String]",qr="[object Symbol]",An="[object WeakMap]",Zn="[object ArrayBuffer]",Mn="[object DataView]",ti=/^\[object .+?Constructor\]$/,Vl=/^(?:0|[1-9]\d*)$/,rn={};rn["[object Float32Array]"]=rn["[object Float64Array]"]=rn["[object Int8Array]"]=rn["[object Int16Array]"]=rn["[object Int32Array]"]=rn["[object Uint8Array]"]=rn["[object Uint8ClampedArray]"]=rn["[object Uint16Array]"]=rn["[object Uint32Array]"]=!0,rn[yt]=rn[st]=rn[Zn]=rn[Pt]=rn[Mn]=rn[ur]=rn[xr]=rn[Fr]=rn[Nr]=rn[_r]=rn[dn]=rn[Sn]=rn[Qr]=rn[nr]=rn[An]=!1;var po=typeof vc=="object"&&vc&&vc.Object===Object&&vc,En=typeof self=="object"&&self&&self.Object===Object&&self,pn=po||En||Function("return this")(),Ia=V&&!V.nodeType&&V,cn=Ia&&D&&!D.nodeType&&D,_s=cn&&cn.exports===Ia,ao=_s&&po.process,rs=(function(){try{return ao&&ao.binding&&ao.binding("util")}catch{}})(),bo=rs&&rs.isTypedArray;function js(Mt,Nt){for(var Rr=-1,Hr=Mt==null?0:Mt.length;++Rr<Hr;)if(Nt(Mt[Rr],Rr,Mt))return!0;return!1}function pa(Mt){var Nt=-1,Rr=Array(Mt.size);return Mt.forEach((function(Hr,Vn){Rr[++Nt]=[Vn,Hr]})),Rr}function xl(Mt){var Nt=-1,Rr=Array(Mt.size);return Mt.forEach((function(Hr){Rr[++Nt]=Hr})),Rr}var wl,qa,vs,ia=Array.prototype,pi=Function.prototype,Mo=Object.prototype,B=pn["__core-js_shared__"],ye=pi.toString,Ge=Mo.hasOwnProperty,xt=(wl=/[^.]+$/.exec(B&&B.keys&&B.keys.IE_PROTO||""))?"Symbol(src)_1."+wl:"",Rt=Mo.toString,rr=RegExp("^"+ye.call(Ge).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),gr=_s?pn.Buffer:void 0,Yr=pn.Symbol,nn=pn.Uint8Array,Pn=Mo.propertyIsEnumerable,Nn=ia.splice,Tn=Yr?Yr.toStringTag:void 0,yi=Object.getOwnPropertySymbols,ci=gr?gr.isBuffer:void 0,Fn=(qa=Object.keys,vs=Object,function(Mt){return qa(vs(Mt))}),qi=mo(pn,"DataView"),wi=mo(pn,"Map"),Fi=mo(pn,"Promise"),Ma=mo(pn,"Set"),bs=mo(pn,"WeakMap"),Sl=mo(Object,"create"),Au=Uo(qi),El=Uo(wi),ma=Uo(Fi),el=Uo(Ma),Us=Uo(bs),La=Yr?Yr.prototype:void 0,Xi=La?La.valueOf:void 0;function Lo(Mt){var Nt=-1,Rr=Mt==null?0:Mt.length;for(this.clear();++Nt<Rr;){var Hr=Mt[Nt];this.set(Hr[0],Hr[1])}}function Ai(Mt){var Nt=-1,Rr=Mt==null?0:Mt.length;for(this.clear();++Nt<Rr;){var Hr=Mt[Nt];this.set(Hr[0],Hr[1])}}function $a(Mt){var Nt=-1,Rr=Mt==null?0:Mt.length;for(this.clear();++Nt<Rr;){var Hr=Mt[Nt];this.set(Hr[0],Hr[1])}}function xs(Mt){var Nt=-1,Rr=Mt==null?0:Mt.length;for(this.__data__=new $a;++Nt<Rr;)this.add(Mt[Nt])}function Pi(Mt){var Nt=this.__data__=new Ai(Mt);this.size=Nt.size}function tl(Mt,Nt){var Rr=ns(Mt),Hr=!Rr&&$i(Mt),Vn=!Rr&&!Hr&&Ga(Mt),on=!Rr&&!Hr&&!Vn&&nl(Mt),In=Rr||Hr||Vn||on,Bn=In?(function(Ii,So){for(var Da=-1,Xo=Array(Ii);++Da<Ii;)Xo[Da]=So(Da);return Xo})(Mt.length,String):[],si=Bn.length;for(var li in Mt)!Ge.call(Mt,li)||In&&(li=="length"||Vn&&(li=="offset"||li=="parent")||on&&(li=="buffer"||li=="byteLength"||li=="byteOffset")||Es(li,si))||Bn.push(li);return Bn}function ws(Mt,Nt){for(var Rr=Mt.length;Rr--;)if(Ts(Mt[Rr][0],Nt))return Rr;return-1}function Va(Mt){return Mt==null?Mt===void 0?"[object Undefined]":"[object Null]":Tn&&Tn in Object(Mt)?(function(Nt){var Rr=Ge.call(Nt,Tn),Hr=Nt[Tn];try{Nt[Tn]=void 0;var Vn=!0}catch{}var on=Rt.call(Nt);return Vn&&(Rr?Nt[Tn]=Hr:delete Nt[Tn]),on})(Mt):(function(Nt){return Rt.call(Nt)})(Mt)}function so(Mt){return is(Mt)&&Va(Mt)==yt}function Do(Mt,Nt,Rr,Hr,Vn){return Mt===Nt||(Mt==null||Nt==null||!is(Mt)&&!is(Nt)?Mt!=Mt&&Nt!=Nt:(function(on,In,Bn,si,li,Ii){var So=ns(on),Da=ns(In),Xo=So?st:wo(on),Cs=Da?st:wo(In),ol=(Xo=Xo==yt?dn:Xo)==dn,ou=(Cs=Cs==yt?dn:Cs)==dn,al=Xo==Cs;if(al&&Ga(on)){if(!Ga(In))return!1;So=!0,ol=!1}if(al&&!ol)return Ii||(Ii=new Pi),So||nl(on)?qs(on,In,Bn,si,li,Ii):(function(ri,ni,As,Vi,su,ya,Ha){switch(As){case Mn:if(ri.byteLength!=ni.byteLength||ri.byteOffset!=ni.byteOffset)return!1;ri=ri.buffer,ni=ni.buffer;case Zn:return!(ri.byteLength!=ni.byteLength||!ya(new nn(ri),new nn(ni)));case Pt:case ur:case _r:return Ts(+ri,+ni);case xr:return ri.name==ni.name&&ri.message==ni.message;case Sn:case nr:return ri==ni+"";case Nr:var oa=pa;case Qr:var Vs=1&Vi;if(oa||(oa=xl),ri.size!=ni.size&&!Vs)return!1;var sl=Ha.get(ri);if(sl)return sl==ni;Vi|=2,Ha.set(ri,ni);var os=qs(oa(ri),oa(ni),Vi,su,ya,Ha);return Ha.delete(ri),os;case qr:if(Xi)return Xi.call(ri)==Xi.call(ni)}return!1})(on,In,Xo,Bn,si,li,Ii);if(!(1&Bn)){var $s=ol&&Ge.call(on,"__wrapped__"),Hl=ou&&Ge.call(In,"__wrapped__");if($s||Hl){var au=$s?on.value():on,Pu=Hl?In.value():In;return Ii||(Ii=new Pi),li(au,Pu,Bn,si,Ii)}}return al?(Ii||(Ii=new Pi),(function(ri,ni,As,Vi,su,ya){var Ha=1&As,oa=Ss(ri),Vs=oa.length,sl=Ss(ni).length;if(Vs!=sl&&!Ha)return!1;for(var os=Vs;os--;){var ka=oa[os];if(!(Ha?ka in ni:Ge.call(ni,ka)))return!1}var lu=ya.get(ri);if(lu&&ya.get(ni))return lu==ni;var Wa=!0;ya.set(ri,ni),ya.set(ni,ri);for(var go=Ha;++os<Vs;){var qo=ri[ka=oa[os]],Gs=ni[ka];if(Vi)var Dn=Ha?Vi(Gs,qo,ka,ni,ri,ya):Vi(qo,Gs,ka,ri,ni,ya);if(!(Dn===void 0?qo===Gs||su(qo,Gs,As,Vi,ya):Dn)){Wa=!1;break}go||(go=ka=="constructor")}if(Wa&&!go){var as=ri.constructor,ll=ni.constructor;as==ll||!("constructor"in ri)||!("constructor"in ni)||typeof as=="function"&&as instanceof as&&typeof ll=="function"&&ll instanceof ll||(Wa=!1)}return ya.delete(ri),ya.delete(ni),Wa})(on,In,Bn,si,li,Ii)):!1})(Mt,Nt,Rr,Hr,Do,Vn))}function iu(Mt){return!(!Cl(Mt)||(function(Nt){return!!xt&&xt in Nt})(Mt))&&(ga(Mt)?rr:ti).test(Uo(Mt))}function Gl(Mt){if(Rr=(Nt=Mt)&&Nt.constructor,Hr=typeof Rr=="function"&&Rr.prototype||Mo,Nt!==Hr)return Fn(Mt);var Nt,Rr,Hr,Vn=[];for(var on in Object(Mt))Ge.call(Mt,on)&&on!="constructor"&&Vn.push(on);return Vn}function qs(Mt,Nt,Rr,Hr,Vn,on){var In=1&Rr,Bn=Mt.length,si=Nt.length;if(Bn!=si&&!(In&&si>Bn))return!1;var li=on.get(Mt);if(li&&on.get(Nt))return li==Nt;var Ii=-1,So=!0,Da=2&Rr?new xs:void 0;for(on.set(Mt,Nt),on.set(Nt,Mt);++Ii<Bn;){var Xo=Mt[Ii],Cs=Nt[Ii];if(Hr)var ol=In?Hr(Cs,Xo,Ii,Nt,Mt,on):Hr(Xo,Cs,Ii,Mt,Nt,on);if(ol!==void 0){if(ol)continue;So=!1;break}if(Da){if(!js(Nt,(function(ou,al){if($s=al,!Da.has($s)&&(Xo===ou||Vn(Xo,ou,Rr,Hr,on)))return Da.push(al);var $s}))){So=!1;break}}else if(Xo!==Cs&&!Vn(Xo,Cs,Rr,Hr,on)){So=!1;break}}return on.delete(Mt),on.delete(Nt),So}function Ss(Mt){return(function(Nt,Rr,Hr){var Vn=Rr(Nt);return ns(Nt)?Vn:(function(on,In){for(var Bn=-1,si=In.length,li=on.length;++Bn<si;)on[li+Bn]=In[Bn];return on})(Vn,Hr(Nt))})(Mt,il,rl)}function xo(Mt,Nt){var Rr,Hr,Vn=Mt.__data__;return((Hr=typeof(Rr=Nt))=="string"||Hr=="number"||Hr=="symbol"||Hr=="boolean"?Rr!=="__proto__":Rr===null)?Vn[typeof Nt=="string"?"string":"hash"]:Vn.map}function mo(Mt,Nt){var Rr=(function(Hr,Vn){return Hr?.[Vn]})(Mt,Nt);return iu(Rr)?Rr:void 0}Lo.prototype.clear=function(){this.__data__=Sl?Sl(null):{},this.size=0},Lo.prototype.delete=function(Mt){var Nt=this.has(Mt)&&delete this.__data__[Mt];return this.size-=Nt?1:0,Nt},Lo.prototype.get=function(Mt){var Nt=this.__data__;if(Sl){var Rr=Nt[Mt];return Rr===Ee?void 0:Rr}return Ge.call(Nt,Mt)?Nt[Mt]:void 0},Lo.prototype.has=function(Mt){var Nt=this.__data__;return Sl?Nt[Mt]!==void 0:Ge.call(Nt,Mt)},Lo.prototype.set=function(Mt,Nt){var Rr=this.__data__;return this.size+=this.has(Mt)?0:1,Rr[Mt]=Sl&&Nt===void 0?Ee:Nt,this},Ai.prototype.clear=function(){this.__data__=[],this.size=0},Ai.prototype.delete=function(Mt){var Nt=this.__data__,Rr=ws(Nt,Mt);return!(Rr<0)&&(Rr==Nt.length-1?Nt.pop():Nn.call(Nt,Rr,1),--this.size,!0)},Ai.prototype.get=function(Mt){var Nt=this.__data__,Rr=ws(Nt,Mt);return Rr<0?void 0:Nt[Rr][1]},Ai.prototype.has=function(Mt){return ws(this.__data__,Mt)>-1},Ai.prototype.set=function(Mt,Nt){var Rr=this.__data__,Hr=ws(Rr,Mt);return Hr<0?(++this.size,Rr.push([Mt,Nt])):Rr[Hr][1]=Nt,this},$a.prototype.clear=function(){this.size=0,this.__data__={hash:new Lo,map:new(wi||Ai),string:new Lo}},$a.prototype.delete=function(Mt){var Nt=xo(this,Mt).delete(Mt);return this.size-=Nt?1:0,Nt},$a.prototype.get=function(Mt){return xo(this,Mt).get(Mt)},$a.prototype.has=function(Mt){return xo(this,Mt).has(Mt)},$a.prototype.set=function(Mt,Nt){var Rr=xo(this,Mt),Hr=Rr.size;return Rr.set(Mt,Nt),this.size+=Rr.size==Hr?0:1,this},xs.prototype.add=xs.prototype.push=function(Mt){return this.__data__.set(Mt,Ee),this},xs.prototype.has=function(Mt){return this.__data__.has(Mt)},Pi.prototype.clear=function(){this.__data__=new Ai,this.size=0},Pi.prototype.delete=function(Mt){var Nt=this.__data__,Rr=Nt.delete(Mt);return this.size=Nt.size,Rr},Pi.prototype.get=function(Mt){return this.__data__.get(Mt)},Pi.prototype.has=function(Mt){return this.__data__.has(Mt)},Pi.prototype.set=function(Mt,Nt){var Rr=this.__data__;if(Rr instanceof Ai){var Hr=Rr.__data__;if(!wi||Hr.length<199)return Hr.push([Mt,Nt]),this.size=++Rr.size,this;Rr=this.__data__=new $a(Hr)}return Rr.set(Mt,Nt),this.size=Rr.size,this};var rl=yi?function(Mt){return Mt==null?[]:(Mt=Object(Mt),(function(Nt,Rr){for(var Hr=-1,Vn=Nt==null?0:Nt.length,on=0,In=[];++Hr<Vn;){var Bn=Nt[Hr];Rr(Bn,Hr,Nt)&&(In[on++]=Bn)}return In})(yi(Mt),(function(Nt){return Pn.call(Mt,Nt)})))}:function(){return[]},wo=Va;function Es(Mt,Nt){return!!(Nt=Nt??it)&&(typeof Mt=="number"||Vl.test(Mt))&&Mt>-1&&Mt%1==0&&Mt<Nt}function Uo(Mt){if(Mt!=null){try{return ye.call(Mt)}catch{}try{return Mt+""}catch{}}return""}function Ts(Mt,Nt){return Mt===Nt||Mt!=Mt&&Nt!=Nt}(qi&&wo(new qi(new ArrayBuffer(1)))!=Mn||wi&&wo(new wi)!=Nr||Fi&&wo(Fi.resolve())!=Jr||Ma&&wo(new Ma)!=Qr||bs&&wo(new bs)!=An)&&(wo=function(Mt){var Nt=Va(Mt),Rr=Nt==dn?Mt.constructor:void 0,Hr=Rr?Uo(Rr):"";if(Hr)switch(Hr){case Au:return Mn;case El:return Nr;case ma:return Jr;case el:return Qr;case Us:return An}return Nt});var $i=so((function(){return arguments})())?so:function(Mt){return is(Mt)&&Ge.call(Mt,"callee")&&!Pn.call(Mt,"callee")},ns=Array.isArray,Ga=ci||function(){return!1};function ga(Mt){if(!Cl(Mt))return!1;var Nt=Va(Mt);return Nt==Fr||Nt=="[object GeneratorFunction]"||Nt=="[object AsyncFunction]"||Nt=="[object Proxy]"}function Tl(Mt){return typeof Mt=="number"&&Mt>-1&&Mt%1==0&&Mt<=it}function Cl(Mt){var Nt=typeof Mt;return Mt!=null&&(Nt=="object"||Nt=="function")}function is(Mt){return Mt!=null&&typeof Mt=="object"}var nl=bo?(function(Mt){return function(Nt){return Mt(Nt)}})(bo):function(Mt){return is(Mt)&&Tl(Mt.length)&&!!rn[Va(Mt)]};function il(Mt){return(Nt=Mt)!=null&&Tl(Nt.length)&&!ga(Nt)?tl(Mt):Gl(Mt);var Nt}D.exports=function(Mt,Nt){return Do(Mt,Nt)}})(ys,ys.exports);var Pa=a(ys.exports);function Ua(D,V){return D.length===V.length&&JSON.stringify(D.map((function(Ee){return Ee})).sort())===JSON.stringify(V.map((function(Ee){return Ee})).sort())}var oo={Polygon:Fe,LineString:Ie,Point:xe,MultiPolygon:gt,MultiLineString:gt,MultiPoint:gt},$l=Object.freeze({__proto__:null,CommonSelectors:ce,constrainFeatureMovement:zo,createMidPoint:vt,createSupplementaryPoints:Ft,createVertex:St,doubleClickZoom:It,euclideanDistance:ut,featuresAt:Pe,getFeatureAtAndSetCursors:Ze,isClick:ke,isEventAtCoordinates:es,isTap:Xe,mapEventToBoundingBox:re,ModeHandler:n,moveFeatures:ms,sortFeatures:Ve,stringSetsAreEqual:Ua,StringSet:H,theme:yr,toDenseArray:Dt}),Js=function(D,V){var Ee={options:D=(function(yt){yt===void 0&&(yt={});var st=Or(yt);return yt.controls||(st.controls={}),yt.displayControlsDefault===!1?st.controls=Or(nu,yt.controls):st.controls=Or(ru,yt.controls),(st=Or(io,st)).styles=na(st.styles,"cold").concat(na(st.styles,"hot")),st})(D)};V=(function(yt,st){return st.modes=z,st.getFeatureIdsAt=function(Pt){return Pe.click({point:Pt},null,yt).map((function(ur){return ur.properties.id}))},st.getSelectedIds=function(){return yt.store.getSelectedIds()},st.getSelected=function(){return{type:N.FEATURE_COLLECTION,features:yt.store.getSelectedIds().map((function(Pt){return yt.store.get(Pt)})).map((function(Pt){return Pt.toGeoJSON()}))}},st.getSelectedPoints=function(){return{type:N.FEATURE_COLLECTION,features:yt.store.getSelectedCoordinates().map((function(Pt){return{type:N.FEATURE,properties:{},geometry:{type:N.POINT,coordinates:Pt.coordinates}}}))}},st.set=function(Pt){if(Pt.type===void 0||Pt.type!==N.FEATURE_COLLECTION||!Array.isArray(Pt.features))throw new Error("Invalid FeatureCollection");var ur=yt.store.createRenderBatch(),xr=yt.store.getAllIds().slice(),Fr=st.add(Pt),Nr=new H(Fr);return(xr=xr.filter((function(_r){return!Nr.has(_r)}))).length&&st.delete(xr),ur(),Fr},st.add=function(Pt){var ur=JSON.parse(JSON.stringify(dr(Pt))).features.map((function(xr){if(xr.id=xr.id||J(),xr.geometry===null)throw new Error("Invalid geometry: null");if(yt.store.get(xr.id)===void 0||yt.store.get(xr.id).type!==xr.geometry.type){var Fr=oo[xr.geometry.type];if(Fr===void 0)throw new Error("Invalid geometry type: "+xr.geometry.type+".");var Nr=new Fr(yt,xr);yt.store.add(Nr)}else{var _r=yt.store.get(xr.id);_r.properties=xr.properties,Pa(_r.properties,xr.properties)||yt.store.featureChanged(_r.id),Pa(_r.getCoordinates(),xr.geometry.coordinates)||_r.incomingCoords(xr.geometry.coordinates)}return xr.id}));return yt.store.render(),ur},st.get=function(Pt){var ur=yt.store.get(Pt);if(ur)return ur.toGeoJSON()},st.getAll=function(){return{type:N.FEATURE_COLLECTION,features:yt.store.getAll().map((function(Pt){return Pt.toGeoJSON()}))}},st.delete=function(Pt){return yt.store.delete(Pt,{silent:!0}),st.getMode()!==z.DIRECT_SELECT||yt.store.getSelectedIds().length?yt.store.render():yt.events.changeMode(z.SIMPLE_SELECT,void 0,{silent:!0}),st},st.deleteAll=function(){return yt.store.delete(yt.store.getAllIds(),{silent:!0}),st.getMode()===z.DIRECT_SELECT?yt.events.changeMode(z.SIMPLE_SELECT,void 0,{silent:!0}):yt.store.render(),st},st.changeMode=function(Pt,ur){return ur===void 0&&(ur={}),Pt===z.SIMPLE_SELECT&&st.getMode()===z.SIMPLE_SELECT?(Ua(ur.featureIds||[],yt.store.getSelectedIds())||(yt.store.setSelected(ur.featureIds,{silent:!0}),yt.store.render()),st):(Pt===z.DIRECT_SELECT&&st.getMode()===z.DIRECT_SELECT&&ur.featureId===yt.store.getSelectedIds()[0]||yt.events.changeMode(Pt,ur,{silent:!0}),st)},st.getMode=function(){return yt.events.getMode()},st.trash=function(){return yt.events.trash({silent:!0}),st},st.combineFeatures=function(){return yt.events.combineFeatures({silent:!0}),st},st.uncombineFeatures=function(){return yt.events.uncombineFeatures({silent:!0}),st},st.setFeatureProperty=function(Pt,ur,xr){return yt.store.setFeatureProperty(Pt,ur,xr),st},st})(Ee,V),Ee.api=V;var it=lr(Ee);return V.onAdd=it.onAdd,V.onRemove=it.onRemove,V.types=O,V.options=D,V};function Qs(D){Js(D,this)}return Qs.modes=ts,Qs.constants=we,Qs.lib=$l,Qs}))})(Qm)),Qm.exports}var bz=vz();const ME=th(bz);function xz(){const e=A8(n=>n.breakpoints.down("md"));return[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#009EE0","fill-outline-color":"#009EE0","fill-opacity":.3}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#009EE0","fill-outline-color":"#009EE0","fill-opacity":.2}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#009EE0","line-width":3}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#009EE0","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#009EE0","line-width":4}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#009EE0","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":e?5:4,"circle-color":"#ffffff","circle-stroke-color":"#009EE0","circle-stroke-width":1}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":e?8:6,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":e?7:5,"circle-color":"#ffffff","circle-stroke-color":"#009EE0","circle-stroke-width":1}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":e?10:9,"circle-opacity":1,"circle-color":"#009EE0"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":e?7.5:6.5,"circle-color":"#009EE0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":e?11:10,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":e?8.5:7.5,"circle-color":"#009EE0"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":e?8.5:6.5,"circle-color":"#404040"}}]}const wz=e=>{const t=_e.useRef(null),n=qp({mapId:e.mapId,waitForLayer:e.insertBeforeLayer}),a=_e.useRef(!1),[c,h]=_e.useState(!1),[f,o]=_e.useState(),y=xz(),v=_e.useCallback(S=>{console.log("MlFeatureEditor mode change to "+S.mode),typeof e.onFinish=="function"&&S.mode==="simple_select"&&e.onFinish()},[e.onFinish]);return _e.useEffect(()=>{n.map&&!a.current&&(a.current=!0,n.map.map.style&&n.map.map.getSource("mapbox-gl-draw-cold")&&t.current&&t.current?.remove(),t.current=new ME({displayControlsDefault:!1,defaultMode:e.mode||"simple_select",modes:Object.assign({},ME.modes),userProperties:!0,styles:y}),n.map.addControl(t.current,"top-left",n.componentId),n.map.on("draw.modechange",v,n.componentId),h(!0))},[n.map,e,a,v]),_e.useEffect(()=>{if(!n.map||!c)return;const S=P=>{let M=[];P&&typeof P=="object"&&"features"in P&&P.features&&(M=P.features),o(M),e.onChange&&e.onChange(M)};return n.map.on("mouseup",S),n.map.on("touchend",S),()=>{n.map&&(n.map.map.off("mouseup",S),n.map.map.off("touchend",S))}},[c,n.map]),_e.useEffect(()=>{t.current&&e.geojson?.geometry&&t.current.set({type:"FeatureCollection",features:[e.geojson]})},[e.geojson,c]),_e.useEffect(()=>{e.mode&&t.current&&t.current?.getMode?.()!==e.mode&&(t.current?.changeMode?.(e.mode),e.mode!=="simple_select"&&e.mode!=="direct_select"&&t.current.set({type:"FeatureCollection",features:[]}))},[e.mode,n.map]),{feature:f,drawToolsReady:c,draw:t.current}},H0=e=>(wz({mode:e.mode,geojson:e.geojson,onChange:e.onChange,onFinish:e.onFinish,mapId:e.mapId}),Pr.jsx(Pr.Fragment,{})),LE=["fill","line","symbol","circle","heatmap","fill-extrusion","raster","hillshade","background"];function Sz(e){return typeof e.options.source=="string"?{source:e.options.source}:e.geojson&&(!e.options?.source||typeof e?.options?.source!="string"&&e.options?.source?.attribution&&!e.options?.source?.type)?{source:{type:"geojson",data:e.geojson||"",attribution:typeof e?.options?.source!="string"&&e.options.source?.attribution?e.options.source?.attribution:""}}:{}}function Ez(e,t){if(e?.insertBeforeLayer)return e.insertBeforeLayer;if(e?.insertBeforeFirstSymbolLayer)return t?.map?.firstSymbolLayer}function Ab(e){const t=qp({mapId:e.mapId,waitForLayer:e.insertBeforeLayer}),n=_e.useRef(""),a=_e.useRef(""),c=_e.useRef(""),[h,f]=_e.useState(),o=_e.useRef(e.layerId||(e.idPrefix?e.idPrefix:"Layer-")+t.componentId),y=_e.useCallback(()=>{if(!t.map||t?.map.cancelled||(t.map.map.getLayer(o.current)&&t.cleanup(),typeof e?.options?.source!="string"&&t.map.map.getSource(o.current)&&t.map.map.removeSource(o.current),typeof e.options.source=="string"&&(e.options.source===""||!t.map.map.getSource(e.options.source)))||typeof e?.options?.source!="string"&&!e.geojson&&!e?.options?.source?.data&&e?.options?.type!=="background"||typeof e.options.type>"u")return;try{t.map.addLayer({...e.options,...Sz(e),id:o.current},Ez(e,t),t.componentId)}catch(P){console.error("Failed to add layer:",P)}f(()=>t.map?.map.getLayer(o.current));const v=()=>{t.map?.map.getLayer(o.current)||y()};t.map.on("styledata",v,t.componentId);const S=(P,M,{source_id:E})=>{t.map&&typeof e?.options?.source=="string"&&e.options.source===E&&y()};t.map.wrapper.on("addsource",S,t.componentId),a.current=JSON.stringify(e.options?.paint),c.current=JSON.stringify(e.options?.layout),n.current=e.options.type},[e,t]);return _e.useEffect(()=>{t.map&&(!e.geojson&&!e.options.source&&e?.options?.type!=="background"||t.map?.cancelled===!1&&t?.map?.map?.getLayer?.(o.current)&&(LE.indexOf(e.options.type)===-1||LE.indexOf(e.options.type)!==-1&&e.options.type===n.current)||y())},[t.map,t.mapIsReady,e,y]),_e.useEffect(()=>{t.map?.cancelled===!0||!t.map?.map?.getSource?.(o.current)||t.map.map.getSource(o.current)?.setData?.(e.geojson)},[e.geojson,t.map,e.options.type]),_e.useEffect(()=>{if(t.map?.cancelled===!0||!t.map||!t.map?.map?.getLayer?.(o.current)||e.options.type!==n.current)return;let v;const S=JSON.stringify(e.options.layout);if(e.options.layout&&S!==c.current){const M=JSON.parse(c.current);for(v in e.options.layout)e.options.layout?.[v]&&e.options.layout[v]!==M[v]&&t.map.map.setLayoutProperty(o.current,v,e.options.layout[v]);c.current=S}const P=JSON.stringify(e.options.paint);if(P!==a.current){const M=JSON.parse(a.current);for(v in e.options.paint)e.options.paint?.[v]&&e.options.paint[v]!==M[v]&&t.map.map.setPaintProperty(o.current,v,e.options.paint[v]);a.current=P}},[e.options,t.map]),_e.useEffect(()=>{!e.insertBeforeLayer||!t.map||!t.map.getLayer(e.insertBeforeLayer)||!t.map.getLayer(o.current)||t.map.moveLayer(o.current,e.insertBeforeLayer)},[t.map,e.insertBeforeLayer]),_e.useEffect(()=>()=>{t.cleanup()},[]),_e.useEffect(()=>{if(typeof e?.options?.source!="string"||!t.map)return;const v=()=>{typeof e?.options?.source=="string"&&t?.map?.getSource?.(e.options.source)&&!t.map.getLayer(o.current)&&y()};t.map.on("sourcedataloading",v);const S=(P,M,{source_id:E})=>{t.map&&typeof e?.options?.source=="string"&&e.options.source===E&&y()};return t.map.wrapper.on("addsource",S),()=>{t?.map&&(t.map.off("sourcedataloading",v),t.map.wrapper.off("addsource",S))}},[t.map,e.options?.source]),_e.useEffect(()=>{if(!e.onClick||!t?.map||!t?.map?.getLayer?.(o.current))return;const v=e.onClick;return t.map?.on("click",o.current,v),()=>{v&&t?.map&&t.map?.off("click",o.current,v)}},[t.map,e.onClick]),_e.useEffect(()=>{if(!e.onHover||!t?.map||!t?.map?.getLayer?.(o.current))return;const v=e.onHover;return t.map?.on("mousemove",o.current,v),()=>{v&&t?.map&&t.map?.off("mousemove",o.current,v)}},[t.map,e.onHover]),_e.useEffect(()=>{if(!e.onLeave||!t?.map||!t?.map?.getLayer?.(o.current))return;const v=e.onLeave;return t.map?.on("mouseleave",o.current,v),()=>{v&&t?.map&&t.map?.off("mouseleave",o.current,v)}},[t.map,e.onLeave]),{map:t.map,layer:h,layerId:o.current,componentId:t.componentId,mapHook:t}}Ab.defaultProps={};const Tz=(e,t)=>{switch(e){case"fill":return t?.fill?t.fill:{"fill-color":"#009EE0","fill-outline-color":"#009EE0"};case"line":return t?.line?(console.log(t.line),t.line):{"line-color":"#009EE0","line-width":4,"line-blur":0};case"circle":return t?.circle?t.circle:{"circle-color":"#009EE0","circle-stroke-color":"#fff","circle-stroke-width":2,"circle-radius":5};default:return{}}},DE={Position:"circle",Point:"circle",MultiPoint:"circle",LineString:"line",MultiLineString:"line",Polygon:"fill",MultiPolygon:"fill",GeometryCollection:"circle"},dM=e=>e?.type==="Feature"?DE?.[e?.geometry?.type]?DE[e.geometry.type]:"circle":e?.type==="FeatureCollection"?e.features.length?dM(e.features[0]):"circle":"fill";function Cz(e){const t=qp({mapId:e.mapId}),[n,a]=_e.useState(),c=_e.useRef(e.sourceId||(e.idPrefix?e.idPrefix:"Source-")+t.componentId),h=_e.useCallback(()=>{if(t.map&&t.map?.style?._layers){for(const[o,y]of Object.entries(t.map.style._layers))y.source===c.current&&t.map.removeLayer(o);t.map.getSource(c.current)&&t.map.removeSource(c.current)}},[t.map]),f=_e.useCallback(()=>{t.map&&(e.source.type==="geojson"&&!e.source.data||(t.map.map.getSource(c.current)&&h(),t.map?.addSource(c.current,{...e.source}),a(t.map.map.getSource(c.current))))},[e,t,h]);return _e.useEffect(()=>{t.map?.map?.getSource(c.current)&&t.map.map.getSource(c.current)?.setData?.(e.source.data)},[e.source?.data]),_e.useEffect(()=>{t?.map?.map?.getSource?.(e.sourceId)&&e.sourceId===c.current||(c.current=e.sourceId,f())},[t.map,e,f]),_e.useEffect(()=>{if(!t.map)return;const o=()=>{t?.map?.getSource?.(e.sourceId)||f()};return t.map.on("styledata",o),()=>{t?.map&&t.map.off("styledata",o)}},[t.map,f]),_e.useEffect(()=>()=>{h()},[h]),{map:t.map,source:n,componentId:t.componentId,mapHook:t}}const eg=e=>{const t=e.type||dM(e.geojson),n=_e.useRef(e.layerId||"MlGeoJsonLayer-"+Pp()),a=`label-${n.current}`;return _e.useEffect(()=>{e.layerId?n.current=e.layerId:n.current="MlGeoJsonLayer-"+Pp()},[e.layerId]),Cz({mapId:e.mapId,sourceId:"source-"+n.current,source:{type:"geojson",data:e.geojson,...typeof e?.options?.source<"u"&&typeof e?.options?.source!="string"?e.options.source:{}}}),Ab({mapId:e.mapId,layerId:n.current,options:{...typeof e?.options?.source<"u"&&typeof e?.options?.source=="string"?{source:e.options.source}:{source:"source-"+n.current},paint:{...e.paint||Tz(t,e.defaultPaintOverrides),...e?.options?.paint},layout:{...e?.layout||{},...e?.options?.layout},type:t},insertBeforeLayer:e.insertBeforeLayer,onHover:e.onHover,onClick:e.onClick,onLeave:e.onLeave}),Ab({mapId:e.mapId,options:{...typeof e?.options?.source<"u"&&typeof e?.options?.source=="string"?{source:e.options.source}:{source:"source-"+n.current},id:a,type:"symbol",maxzoom:24,minzoom:1,...e?.labelOptions?e.labelOptions:{},...e?.options?.filter?{filter:e.options.filter}:{},layout:{"text-font":["Open Sans Regular"],"text-field":`{${e.labelProp}}`,"text-size":12,"text-anchor":"top",...e?.labelOptions?.layout?e.labelOptions.layout:{},visibility:e?.layout?.visibility??e?.options?.layout?.visibility??"visible"},paint:{"text-halo-width":1,"text-halo-color":"#fefefe","text-color":"#121212",...e?.labelOptions?.paint?e.labelOptions.paint:{}}}}),Pr.jsx(Pr.Fragment,{})};Rn(Vp)({marginTop:"15px"});md(Wg)({paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:"4px"});md(Zg)({minWidth:"30px"});md(Ec)({marginRight:"0px",padding:"0px"});md(w2)({padding:0,marginRight:"5px"});md(NP)(({open:e})=>({display:e?"block":"none"}));md(Vp)({marginLeft:"50px"});var fl={},Mf={},W0,kE;function pM(){if(kE)return W0;kE=1;var e=typeof vc=="object"&&vc&&vc.Object===Object&&vc;return W0=e,W0}var Z0,RE;function ec(){if(RE)return Z0;RE=1;var e=pM(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return Z0=n,Z0}var Y0,NE;function Hp(){if(NE)return Y0;NE=1;var e=ec(),t=e.Symbol;return Y0=t,Y0}var X0,OE;function Az(){if(OE)return X0;OE=1;var e=Hp(),t=Object.prototype,n=t.hasOwnProperty,a=t.toString,c=e?e.toStringTag:void 0;function h(f){var o=n.call(f,c),y=f[c];try{f[c]=void 0;var v=!0}catch{}var S=a.call(f);return v&&(o?f[c]=y:delete f[c]),S}return X0=h,X0}var K0,FE;function Pz(){if(FE)return K0;FE=1;var e=Object.prototype,t=e.toString;function n(a){return t.call(a)}return K0=n,K0}var J0,BE;function Wh(){if(BE)return J0;BE=1;var e=Hp(),t=Az(),n=Pz(),a="[object Null]",c="[object Undefined]",h=e?e.toStringTag:void 0;function f(o){return o==null?o===void 0?c:a:h&&h in Object(o)?t(o):n(o)}return J0=f,J0}var Q0,zE;function Tu(){if(zE)return Q0;zE=1;var e=Array.isArray;return Q0=e,Q0}var e_,jE;function Tc(){if(jE)return e_;jE=1;function e(t){return t!=null&&typeof t=="object"}return e_=e,e_}var t_,UE;function Iz(){if(UE)return t_;UE=1;var e=Wh(),t=Tu(),n=Tc(),a="[object String]";function c(h){return typeof h=="string"||!t(h)&&n(h)&&e(h)==a}return t_=c,t_}var r_,qE;function Mz(){if(qE)return r_;qE=1;function e(t){return function(n,a,c){for(var h=-1,f=Object(n),o=c(n),y=o.length;y--;){var v=o[t?y:++h];if(a(f[v],v,f)===!1)break}return n}}return r_=e,r_}var n_,$E;function Lz(){if($E)return n_;$E=1;var e=Mz(),t=e();return n_=t,n_}var i_,VE;function Dz(){if(VE)return i_;VE=1;function e(t,n){for(var a=-1,c=Array(t);++a<t;)c[a]=n(a);return c}return i_=e,i_}var o_,GE;function kz(){if(GE)return o_;GE=1;var e=Wh(),t=Tc(),n="[object Arguments]";function a(c){return t(c)&&e(c)==n}return o_=a,o_}var a_,HE;function mM(){if(HE)return a_;HE=1;var e=kz(),t=Tc(),n=Object.prototype,a=n.hasOwnProperty,c=n.propertyIsEnumerable,h=e((function(){return arguments})())?e:function(f){return t(f)&&a.call(f,"callee")&&!c.call(f,"callee")};return a_=h,a_}var cp={exports:{}},s_,WE;function Rz(){if(WE)return s_;WE=1;function e(){return!1}return s_=e,s_}cp.exports;var ZE;function I2(){return ZE||(ZE=1,(function(e,t){var n=ec(),a=Rz(),c=t&&!t.nodeType&&t,h=c&&!0&&e&&!e.nodeType&&e,f=h&&h.exports===c,o=f?n.Buffer:void 0,y=o?o.isBuffer:void 0,v=y||a;e.exports=v})(cp,cp.exports)),cp.exports}var l_,YE;function gM(){if(YE)return l_;YE=1;var e=9007199254740991,t=/^(?:0|[1-9]\d*)$/;function n(a,c){var h=typeof a;return c=c??e,!!c&&(h=="number"||h!="symbol"&&t.test(a))&&a>-1&&a%1==0&&a<c}return l_=n,l_}var u_,XE;function M2(){if(XE)return u_;XE=1;var e=9007199254740991;function t(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=e}return u_=t,u_}var c_,KE;function Nz(){if(KE)return c_;KE=1;var e=Wh(),t=M2(),n=Tc(),a="[object Arguments]",c="[object Array]",h="[object Boolean]",f="[object Date]",o="[object Error]",y="[object Function]",v="[object Map]",S="[object Number]",P="[object Object]",M="[object RegExp]",E="[object Set]",O="[object String]",N="[object WeakMap]",z="[object ArrayBuffer]",U="[object DataView]",ee="[object Float32Array]",ae="[object Float64Array]",W="[object Int8Array]",le="[object Int16Array]",te="[object Int32Array]",we="[object Uint8Array]",Te="[object Uint8ClampedArray]",me="[object Uint16Array]",Ve="[object Uint32Array]",re={};re[ee]=re[ae]=re[W]=re[le]=re[te]=re[we]=re[Te]=re[me]=re[Ve]=!0,re[a]=re[c]=re[z]=re[h]=re[U]=re[f]=re[o]=re[y]=re[v]=re[S]=re[P]=re[M]=re[E]=re[O]=re[N]=!1;function H(Le){return n(Le)&&t(Le.length)&&!!re[e(Le)]}return c_=H,c_}var h_,JE;function L2(){if(JE)return h_;JE=1;function e(t){return function(n){return t(n)}}return h_=e,h_}var hp={exports:{}};hp.exports;var QE;function D2(){return QE||(QE=1,(function(e,t){var n=pM(),a=t&&!t.nodeType&&t,c=a&&!0&&e&&!e.nodeType&&e,h=c&&c.exports===a,f=h&&n.process,o=(function(){try{var y=c&&c.require&&c.require("util").types;return y||f&&f.binding&&f.binding("util")}catch{}})();e.exports=o})(hp,hp.exports)),hp.exports}var f_,eT;function yM(){if(eT)return f_;eT=1;var e=Nz(),t=L2(),n=D2(),a=n&&n.isTypedArray,c=a?t(a):e;return f_=c,f_}var d_,tT;function _M(){if(tT)return d_;tT=1;var e=Dz(),t=mM(),n=Tu(),a=I2(),c=gM(),h=yM(),f=Object.prototype,o=f.hasOwnProperty;function y(v,S){var P=n(v),M=!P&&t(v),E=!P&&!M&&a(v),O=!P&&!M&&!E&&h(v),N=P||M||E||O,z=N?e(v.length,String):[],U=z.length;for(var ee in v)(S||o.call(v,ee))&&!(N&&(ee=="length"||E&&(ee=="offset"||ee=="parent")||O&&(ee=="buffer"||ee=="byteLength"||ee=="byteOffset")||c(ee,U)))&&z.push(ee);return z}return d_=y,d_}var p_,rT;function k2(){if(rT)return p_;rT=1;var e=Object.prototype;function t(n){var a=n&&n.constructor,c=typeof a=="function"&&a.prototype||e;return n===c}return p_=t,p_}var m_,nT;function vM(){if(nT)return m_;nT=1;function e(t,n){return function(a){return t(n(a))}}return m_=e,m_}var g_,iT;function Oz(){if(iT)return g_;iT=1;var e=vM(),t=e(Object.keys,Object);return g_=t,g_}var y_,oT;function Fz(){if(oT)return y_;oT=1;var e=k2(),t=Oz(),n=Object.prototype,a=n.hasOwnProperty;function c(h){if(!e(h))return t(h);var f=[];for(var o in Object(h))a.call(h,o)&&o!="constructor"&&f.push(o);return f}return y_=c,y_}var __,aT;function _d(){if(aT)return __;aT=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return __=e,__}var v_,sT;function bM(){if(sT)return v_;sT=1;var e=Wh(),t=_d(),n="[object AsyncFunction]",a="[object Function]",c="[object GeneratorFunction]",h="[object Proxy]";function f(o){if(!t(o))return!1;var y=e(o);return y==a||y==c||y==n||y==h}return v_=f,v_}var b_,lT;function Kg(){if(lT)return b_;lT=1;var e=bM(),t=M2();function n(a){return a!=null&&t(a.length)&&!e(a)}return b_=n,b_}var x_,uT;function Wp(){if(uT)return x_;uT=1;var e=_M(),t=Fz(),n=Kg();function a(c){return n(c)?e(c):t(c)}return x_=a,x_}var w_,cT;function xM(){if(cT)return w_;cT=1;var e=Lz(),t=Wp();function n(a,c){return a&&e(a,c,t)}return w_=n,w_}var S_,hT;function wM(){if(hT)return S_;hT=1;function e(t){return t}return S_=e,S_}var E_,fT;function Bz(){if(fT)return E_;fT=1;var e=wM();function t(n){return typeof n=="function"?n:e}return E_=t,E_}var T_,dT;function R2(){if(dT)return T_;dT=1;var e=xM(),t=Bz();function n(a,c){return a&&e(a,t(c))}return T_=n,T_}var C_,pT;function N2(){if(pT)return C_;pT=1;var e=vM(),t=e(Object.getPrototypeOf,Object);return C_=t,C_}var A_,mT;function zz(){if(mT)return A_;mT=1;var e=Wh(),t=N2(),n=Tc(),a="[object Object]",c=Function.prototype,h=Object.prototype,f=c.toString,o=h.hasOwnProperty,y=f.call(Object);function v(S){if(!n(S)||e(S)!=a)return!1;var P=t(S);if(P===null)return!0;var M=o.call(P,"constructor")&&P.constructor;return typeof M=="function"&&M instanceof M&&f.call(M)==y}return A_=v,A_}var P_,gT;function SM(){if(gT)return P_;gT=1;function e(t,n){for(var a=-1,c=t==null?0:t.length,h=Array(c);++a<c;)h[a]=n(t[a],a,t);return h}return P_=e,P_}var I_,yT;function jz(){if(yT)return I_;yT=1;function e(){this.__data__=[],this.size=0}return I_=e,I_}var M_,_T;function O2(){if(_T)return M_;_T=1;function e(t,n){return t===n||t!==t&&n!==n}return M_=e,M_}var L_,vT;function Jg(){if(vT)return L_;vT=1;var e=O2();function t(n,a){for(var c=n.length;c--;)if(e(n[c][0],a))return c;return-1}return L_=t,L_}var D_,bT;function Uz(){if(bT)return D_;bT=1;var e=Jg(),t=Array.prototype,n=t.splice;function a(c){var h=this.__data__,f=e(h,c);if(f<0)return!1;var o=h.length-1;return f==o?h.pop():n.call(h,f,1),--this.size,!0}return D_=a,D_}var k_,xT;function qz(){if(xT)return k_;xT=1;var e=Jg();function t(n){var a=this.__data__,c=e(a,n);return c<0?void 0:a[c][1]}return k_=t,k_}var R_,wT;function $z(){if(wT)return R_;wT=1;var e=Jg();function t(n){return e(this.__data__,n)>-1}return R_=t,R_}var N_,ST;function Vz(){if(ST)return N_;ST=1;var e=Jg();function t(n,a){var c=this.__data__,h=e(c,n);return h<0?(++this.size,c.push([n,a])):c[h][1]=a,this}return N_=t,N_}var O_,ET;function Qg(){if(ET)return O_;ET=1;var e=jz(),t=Uz(),n=qz(),a=$z(),c=Vz();function h(f){var o=-1,y=f==null?0:f.length;for(this.clear();++o<y;){var v=f[o];this.set(v[0],v[1])}}return h.prototype.clear=e,h.prototype.delete=t,h.prototype.get=n,h.prototype.has=a,h.prototype.set=c,O_=h,O_}var F_,TT;function Gz(){if(TT)return F_;TT=1;var e=Qg();function t(){this.__data__=new e,this.size=0}return F_=t,F_}var B_,CT;function Hz(){if(CT)return B_;CT=1;function e(t){var n=this.__data__,a=n.delete(t);return this.size=n.size,a}return B_=e,B_}var z_,AT;function Wz(){if(AT)return z_;AT=1;function e(t){return this.__data__.get(t)}return z_=e,z_}var j_,PT;function Zz(){if(PT)return j_;PT=1;function e(t){return this.__data__.has(t)}return j_=e,j_}var U_,IT;function Yz(){if(IT)return U_;IT=1;var e=ec(),t=e["__core-js_shared__"];return U_=t,U_}var q_,MT;function Xz(){if(MT)return q_;MT=1;var e=Yz(),t=(function(){var a=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""})();function n(a){return!!t&&t in a}return q_=n,q_}var $_,LT;function EM(){if(LT)return $_;LT=1;var e=Function.prototype,t=e.toString;function n(a){if(a!=null){try{return t.call(a)}catch{}try{return a+""}catch{}}return""}return $_=n,$_}var V_,DT;function Kz(){if(DT)return V_;DT=1;var e=bM(),t=Xz(),n=_d(),a=EM(),c=/[\\^$.*+?()[\]{}|]/g,h=/^\[object .+?Constructor\]$/,f=Function.prototype,o=Object.prototype,y=f.toString,v=o.hasOwnProperty,S=RegExp("^"+y.call(v).replace(c,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function P(M){if(!n(M)||t(M))return!1;var E=e(M)?S:h;return E.test(a(M))}return V_=P,V_}var G_,kT;function Jz(){if(kT)return G_;kT=1;function e(t,n){return t?.[n]}return G_=e,G_}var H_,RT;function Zh(){if(RT)return H_;RT=1;var e=Kz(),t=Jz();function n(a,c){var h=t(a,c);return e(h)?h:void 0}return H_=n,H_}var W_,NT;function F2(){if(NT)return W_;NT=1;var e=Zh(),t=ec(),n=e(t,"Map");return W_=n,W_}var Z_,OT;function ey(){if(OT)return Z_;OT=1;var e=Zh(),t=e(Object,"create");return Z_=t,Z_}var Y_,FT;function Qz(){if(FT)return Y_;FT=1;var e=ey();function t(){this.__data__=e?e(null):{},this.size=0}return Y_=t,Y_}var X_,BT;function e7(){if(BT)return X_;BT=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return X_=e,X_}var K_,zT;function t7(){if(zT)return K_;zT=1;var e=ey(),t="__lodash_hash_undefined__",n=Object.prototype,a=n.hasOwnProperty;function c(h){var f=this.__data__;if(e){var o=f[h];return o===t?void 0:o}return a.call(f,h)?f[h]:void 0}return K_=c,K_}var J_,jT;function r7(){if(jT)return J_;jT=1;var e=ey(),t=Object.prototype,n=t.hasOwnProperty;function a(c){var h=this.__data__;return e?h[c]!==void 0:n.call(h,c)}return J_=a,J_}var Q_,UT;function n7(){if(UT)return Q_;UT=1;var e=ey(),t="__lodash_hash_undefined__";function n(a,c){var h=this.__data__;return this.size+=this.has(a)?0:1,h[a]=e&&c===void 0?t:c,this}return Q_=n,Q_}var ev,qT;function i7(){if(qT)return ev;qT=1;var e=Qz(),t=e7(),n=t7(),a=r7(),c=n7();function h(f){var o=-1,y=f==null?0:f.length;for(this.clear();++o<y;){var v=f[o];this.set(v[0],v[1])}}return h.prototype.clear=e,h.prototype.delete=t,h.prototype.get=n,h.prototype.has=a,h.prototype.set=c,ev=h,ev}var tv,$T;function o7(){if($T)return tv;$T=1;var e=i7(),t=Qg(),n=F2();function a(){this.size=0,this.__data__={hash:new e,map:new(n||t),string:new e}}return tv=a,tv}var rv,VT;function a7(){if(VT)return rv;VT=1;function e(t){var n=typeof t;return n=="string"||n=="number"||n=="symbol"||n=="boolean"?t!=="__proto__":t===null}return rv=e,rv}var nv,GT;function ty(){if(GT)return nv;GT=1;var e=a7();function t(n,a){var c=n.__data__;return e(a)?c[typeof a=="string"?"string":"hash"]:c.map}return nv=t,nv}var iv,HT;function s7(){if(HT)return iv;HT=1;var e=ty();function t(n){var a=e(this,n).delete(n);return this.size-=a?1:0,a}return iv=t,iv}var ov,WT;function l7(){if(WT)return ov;WT=1;var e=ty();function t(n){return e(this,n).get(n)}return ov=t,ov}var av,ZT;function u7(){if(ZT)return av;ZT=1;var e=ty();function t(n){return e(this,n).has(n)}return av=t,av}var sv,YT;function c7(){if(YT)return sv;YT=1;var e=ty();function t(n,a){var c=e(this,n),h=c.size;return c.set(n,a),this.size+=c.size==h?0:1,this}return sv=t,sv}var lv,XT;function B2(){if(XT)return lv;XT=1;var e=o7(),t=s7(),n=l7(),a=u7(),c=c7();function h(f){var o=-1,y=f==null?0:f.length;for(this.clear();++o<y;){var v=f[o];this.set(v[0],v[1])}}return h.prototype.clear=e,h.prototype.delete=t,h.prototype.get=n,h.prototype.has=a,h.prototype.set=c,lv=h,lv}var uv,KT;function h7(){if(KT)return uv;KT=1;var e=Qg(),t=F2(),n=B2(),a=200;function c(h,f){var o=this.__data__;if(o instanceof e){var y=o.__data__;if(!t||y.length<a-1)return y.push([h,f]),this.size=++o.size,this;o=this.__data__=new n(y)}return o.set(h,f),this.size=o.size,this}return uv=c,uv}var cv,JT;function z2(){if(JT)return cv;JT=1;var e=Qg(),t=Gz(),n=Hz(),a=Wz(),c=Zz(),h=h7();function f(o){var y=this.__data__=new e(o);this.size=y.size}return f.prototype.clear=t,f.prototype.delete=n,f.prototype.get=a,f.prototype.has=c,f.prototype.set=h,cv=f,cv}var hv,QT;function f7(){if(QT)return hv;QT=1;var e="__lodash_hash_undefined__";function t(n){return this.__data__.set(n,e),this}return hv=t,hv}var fv,eC;function d7(){if(eC)return fv;eC=1;function e(t){return this.__data__.has(t)}return fv=e,fv}var dv,tC;function p7(){if(tC)return dv;tC=1;var e=B2(),t=f7(),n=d7();function a(c){var h=-1,f=c==null?0:c.length;for(this.__data__=new e;++h<f;)this.add(c[h])}return a.prototype.add=a.prototype.push=t,a.prototype.has=n,dv=a,dv}var pv,rC;function m7(){if(rC)return pv;rC=1;function e(t,n){for(var a=-1,c=t==null?0:t.length;++a<c;)if(n(t[a],a,t))return!0;return!1}return pv=e,pv}var mv,nC;function g7(){if(nC)return mv;nC=1;function e(t,n){return t.has(n)}return mv=e,mv}var gv,iC;function TM(){if(iC)return gv;iC=1;var e=p7(),t=m7(),n=g7(),a=1,c=2;function h(f,o,y,v,S,P){var M=y&a,E=f.length,O=o.length;if(E!=O&&!(M&&O>E))return!1;var N=P.get(f),z=P.get(o);if(N&&z)return N==o&&z==f;var U=-1,ee=!0,ae=y&c?new e:void 0;for(P.set(f,o),P.set(o,f);++U<E;){var W=f[U],le=o[U];if(v)var te=M?v(le,W,U,o,f,P):v(W,le,U,f,o,P);if(te!==void 0){if(te)continue;ee=!1;break}if(ae){if(!t(o,function(we,Te){if(!n(ae,Te)&&(W===we||S(W,we,y,v,P)))return ae.push(Te)})){ee=!1;break}}else if(!(W===le||S(W,le,y,v,P))){ee=!1;break}}return P.delete(f),P.delete(o),ee}return gv=h,gv}var yv,oC;function CM(){if(oC)return yv;oC=1;var e=ec(),t=e.Uint8Array;return yv=t,yv}var _v,aC;function y7(){if(aC)return _v;aC=1;function e(t){var n=-1,a=Array(t.size);return t.forEach(function(c,h){a[++n]=[h,c]}),a}return _v=e,_v}var vv,sC;function _7(){if(sC)return vv;sC=1;function e(t){var n=-1,a=Array(t.size);return t.forEach(function(c){a[++n]=c}),a}return vv=e,vv}var bv,lC;function v7(){if(lC)return bv;lC=1;var e=Hp(),t=CM(),n=O2(),a=TM(),c=y7(),h=_7(),f=1,o=2,y="[object Boolean]",v="[object Date]",S="[object Error]",P="[object Map]",M="[object Number]",E="[object RegExp]",O="[object Set]",N="[object String]",z="[object Symbol]",U="[object ArrayBuffer]",ee="[object DataView]",ae=e?e.prototype:void 0,W=ae?ae.valueOf:void 0;function le(te,we,Te,me,Ve,re,H){switch(Te){case ee:if(te.byteLength!=we.byteLength||te.byteOffset!=we.byteOffset)return!1;te=te.buffer,we=we.buffer;case U:return!(te.byteLength!=we.byteLength||!re(new t(te),new t(we)));case y:case v:case M:return n(+te,+we);case S:return te.name==we.name&&te.message==we.message;case E:case N:return te==we+"";case P:var Le=c;case O:var Pe=me&f;if(Le||(Le=h),te.size!=we.size&&!Pe)return!1;var Me=H.get(te);if(Me)return Me==we;me|=o,H.set(te,we);var Ze=a(Le(te),Le(we),me,Ve,re,H);return H.delete(te),Ze;case z:if(W)return W.call(te)==W.call(we)}return!1}return bv=le,bv}var xv,uC;function AM(){if(uC)return xv;uC=1;function e(t,n){for(var a=-1,c=n.length,h=t.length;++a<c;)t[h+a]=n[a];return t}return xv=e,xv}var wv,cC;function PM(){if(cC)return wv;cC=1;var e=AM(),t=Tu();function n(a,c,h){var f=c(a);return t(a)?f:e(f,h(a))}return wv=n,wv}var Sv,hC;function b7(){if(hC)return Sv;hC=1;function e(t,n){for(var a=-1,c=t==null?0:t.length,h=0,f=[];++a<c;){var o=t[a];n(o,a,t)&&(f[h++]=o)}return f}return Sv=e,Sv}var Ev,fC;function IM(){if(fC)return Ev;fC=1;function e(){return[]}return Ev=e,Ev}var Tv,dC;function j2(){if(dC)return Tv;dC=1;var e=b7(),t=IM(),n=Object.prototype,a=n.propertyIsEnumerable,c=Object.getOwnPropertySymbols,h=c?function(f){return f==null?[]:(f=Object(f),e(c(f),function(o){return a.call(f,o)}))}:t;return Tv=h,Tv}var Cv,pC;function MM(){if(pC)return Cv;pC=1;var e=PM(),t=j2(),n=Wp();function a(c){return e(c,n,t)}return Cv=a,Cv}var Av,mC;function x7(){if(mC)return Av;mC=1;var e=MM(),t=1,n=Object.prototype,a=n.hasOwnProperty;function c(h,f,o,y,v,S){var P=o&t,M=e(h),E=M.length,O=e(f),N=O.length;if(E!=N&&!P)return!1;for(var z=E;z--;){var U=M[z];if(!(P?U in f:a.call(f,U)))return!1}var ee=S.get(h),ae=S.get(f);if(ee&&ae)return ee==f&&ae==h;var W=!0;S.set(h,f),S.set(f,h);for(var le=P;++z<E;){U=M[z];var te=h[U],we=f[U];if(y)var Te=P?y(we,te,U,f,h,S):y(te,we,U,h,f,S);if(!(Te===void 0?te===we||v(te,we,o,y,S):Te)){W=!1;break}le||(le=U=="constructor")}if(W&&!le){var me=h.constructor,Ve=f.constructor;me!=Ve&&"constructor"in h&&"constructor"in f&&!(typeof me=="function"&&me instanceof me&&typeof Ve=="function"&&Ve instanceof Ve)&&(W=!1)}return S.delete(h),S.delete(f),W}return Av=c,Av}var Pv,gC;function w7(){if(gC)return Pv;gC=1;var e=Zh(),t=ec(),n=e(t,"DataView");return Pv=n,Pv}var Iv,yC;function S7(){if(yC)return Iv;yC=1;var e=Zh(),t=ec(),n=e(t,"Promise");return Iv=n,Iv}var Mv,_C;function E7(){if(_C)return Mv;_C=1;var e=Zh(),t=ec(),n=e(t,"Set");return Mv=n,Mv}var Lv,vC;function T7(){if(vC)return Lv;vC=1;var e=Zh(),t=ec(),n=e(t,"WeakMap");return Lv=n,Lv}var Dv,bC;function ry(){if(bC)return Dv;bC=1;var e=w7(),t=F2(),n=S7(),a=E7(),c=T7(),h=Wh(),f=EM(),o="[object Map]",y="[object Object]",v="[object Promise]",S="[object Set]",P="[object WeakMap]",M="[object DataView]",E=f(e),O=f(t),N=f(n),z=f(a),U=f(c),ee=h;return(e&&ee(new e(new ArrayBuffer(1)))!=M||t&&ee(new t)!=o||n&&ee(n.resolve())!=v||a&&ee(new a)!=S||c&&ee(new c)!=P)&&(ee=function(ae){var W=h(ae),le=W==y?ae.constructor:void 0,te=le?f(le):"";if(te)switch(te){case E:return M;case O:return o;case N:return v;case z:return S;case U:return P}return W}),Dv=ee,Dv}var kv,xC;function C7(){if(xC)return kv;xC=1;var e=z2(),t=TM(),n=v7(),a=x7(),c=ry(),h=Tu(),f=I2(),o=yM(),y=1,v="[object Arguments]",S="[object Array]",P="[object Object]",M=Object.prototype,E=M.hasOwnProperty;function O(N,z,U,ee,ae,W){var le=h(N),te=h(z),we=le?S:c(N),Te=te?S:c(z);we=we==v?P:we,Te=Te==v?P:Te;var me=we==P,Ve=Te==P,re=we==Te;if(re&&f(N)){if(!f(z))return!1;le=!0,me=!1}if(re&&!me)return W||(W=new e),le||o(N)?t(N,z,U,ee,ae,W):n(N,z,we,U,ee,ae,W);if(!(U&y)){var H=me&&E.call(N,"__wrapped__"),Le=Ve&&E.call(z,"__wrapped__");if(H||Le){var Pe=H?N.value():N,Me=Le?z.value():z;return W||(W=new e),ae(Pe,Me,U,ee,W)}}return re?(W||(W=new e),a(N,z,U,ee,ae,W)):!1}return kv=O,kv}var Rv,wC;function LM(){if(wC)return Rv;wC=1;var e=C7(),t=Tc();function n(a,c,h,f,o){return a===c?!0:a==null||c==null||!t(a)&&!t(c)?a!==a&&c!==c:e(a,c,h,f,n,o)}return Rv=n,Rv}var Nv,SC;function A7(){if(SC)return Nv;SC=1;var e=z2(),t=LM(),n=1,a=2;function c(h,f,o,y){var v=o.length,S=v,P=!y;if(h==null)return!S;for(h=Object(h);v--;){var M=o[v];if(P&&M[2]?M[1]!==h[M[0]]:!(M[0]in h))return!1}for(;++v<S;){M=o[v];var E=M[0],O=h[E],N=M[1];if(P&&M[2]){if(O===void 0&&!(E in h))return!1}else{var z=new e;if(y)var U=y(O,N,E,h,f,z);if(!(U===void 0?t(N,O,n|a,y,z):U))return!1}}return!0}return Nv=c,Nv}var Ov,EC;function DM(){if(EC)return Ov;EC=1;var e=_d();function t(n){return n===n&&!e(n)}return Ov=t,Ov}var Fv,TC;function P7(){if(TC)return Fv;TC=1;var e=DM(),t=Wp();function n(a){for(var c=t(a),h=c.length;h--;){var f=c[h],o=a[f];c[h]=[f,o,e(o)]}return c}return Fv=n,Fv}var Bv,CC;function kM(){if(CC)return Bv;CC=1;function e(t,n){return function(a){return a==null?!1:a[t]===n&&(n!==void 0||t in Object(a))}}return Bv=e,Bv}var zv,AC;function I7(){if(AC)return zv;AC=1;var e=A7(),t=P7(),n=kM();function a(c){var h=t(c);return h.length==1&&h[0][2]?n(h[0][0],h[0][1]):function(f){return f===c||e(f,c,h)}}return zv=a,zv}var jv,PC;function U2(){if(PC)return jv;PC=1;var e=Wh(),t=Tc(),n="[object Symbol]";function a(c){return typeof c=="symbol"||t(c)&&e(c)==n}return jv=a,jv}var Uv,IC;function q2(){if(IC)return Uv;IC=1;var e=Tu(),t=U2(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function c(h,f){if(e(h))return!1;var o=typeof h;return o=="number"||o=="symbol"||o=="boolean"||h==null||t(h)?!0:a.test(h)||!n.test(h)||f!=null&&h in Object(f)}return Uv=c,Uv}var qv,MC;function RM(){if(MC)return qv;MC=1;var e=B2(),t="Expected a function";function n(a,c){if(typeof a!="function"||c!=null&&typeof c!="function")throw new TypeError(t);var h=function(){var f=arguments,o=c?c.apply(this,f):f[0],y=h.cache;if(y.has(o))return y.get(o);var v=a.apply(this,f);return h.cache=y.set(o,v)||y,v};return h.cache=new(n.Cache||e),h}return n.Cache=e,qv=n,qv}var $v,LC;function M7(){if(LC)return $v;LC=1;var e=RM(),t=500;function n(a){var c=e(a,function(f){return h.size===t&&h.clear(),f}),h=c.cache;return c}return $v=n,$v}var Vv,DC;function L7(){if(DC)return Vv;DC=1;var e=M7(),t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,n=/\\(\\)?/g,a=e(function(c){var h=[];return c.charCodeAt(0)===46&&h.push(""),c.replace(t,function(f,o,y,v){h.push(y?v.replace(n,"$1"):o||f)}),h});return Vv=a,Vv}var Gv,kC;function D7(){if(kC)return Gv;kC=1;var e=Hp(),t=SM(),n=Tu(),a=U2(),c=e?e.prototype:void 0,h=c?c.toString:void 0;function f(o){if(typeof o=="string")return o;if(n(o))return t(o,f)+"";if(a(o))return h?h.call(o):"";var y=o+"";return y=="0"&&1/o==-1/0?"-0":y}return Gv=f,Gv}var Hv,RC;function k7(){if(RC)return Hv;RC=1;var e=D7();function t(n){return n==null?"":e(n)}return Hv=t,Hv}var Wv,NC;function NM(){if(NC)return Wv;NC=1;var e=Tu(),t=q2(),n=L7(),a=k7();function c(h,f){return e(h)?h:t(h,f)?[h]:n(a(h))}return Wv=c,Wv}var Zv,OC;function ny(){if(OC)return Zv;OC=1;var e=U2();function t(n){if(typeof n=="string"||e(n))return n;var a=n+"";return a=="0"&&1/n==-1/0?"-0":a}return Zv=t,Zv}var Yv,FC;function OM(){if(FC)return Yv;FC=1;var e=NM(),t=ny();function n(a,c){c=e(c,a);for(var h=0,f=c.length;a!=null&&h<f;)a=a[t(c[h++])];return h&&h==f?a:void 0}return Yv=n,Yv}var Xv,BC;function FM(){if(BC)return Xv;BC=1;var e=OM();function t(n,a,c){var h=n==null?void 0:e(n,a);return h===void 0?c:h}return Xv=t,Xv}var Kv,zC;function R7(){if(zC)return Kv;zC=1;function e(t,n){return t!=null&&n in Object(t)}return Kv=e,Kv}var Jv,jC;function N7(){if(jC)return Jv;jC=1;var e=NM(),t=mM(),n=Tu(),a=gM(),c=M2(),h=ny();function f(o,y,v){y=e(y,o);for(var S=-1,P=y.length,M=!1;++S<P;){var E=h(y[S]);if(!(M=o!=null&&v(o,E)))break;o=o[E]}return M||++S!=P?M:(P=o==null?0:o.length,!!P&&c(P)&&a(E,P)&&(n(o)||t(o)))}return Jv=f,Jv}var Qv,UC;function O7(){if(UC)return Qv;UC=1;var e=R7(),t=N7();function n(a,c){return a!=null&&t(a,c,e)}return Qv=n,Qv}var e1,qC;function F7(){if(qC)return e1;qC=1;var e=LM(),t=FM(),n=O7(),a=q2(),c=DM(),h=kM(),f=ny(),o=1,y=2;function v(S,P){return a(S)&&c(P)?h(f(S),P):function(M){var E=t(M,S);return E===void 0&&E===P?n(M,S):e(P,E,o|y)}}return e1=v,e1}var t1,$C;function B7(){if($C)return t1;$C=1;function e(t){return function(n){return n?.[t]}}return t1=e,t1}var r1,VC;function z7(){if(VC)return r1;VC=1;var e=OM();function t(n){return function(a){return e(a,n)}}return r1=t,r1}var n1,GC;function j7(){if(GC)return n1;GC=1;var e=B7(),t=z7(),n=q2(),a=ny();function c(h){return n(h)?e(a(h)):t(h)}return n1=c,n1}var i1,HC;function U7(){if(HC)return i1;HC=1;var e=I7(),t=F7(),n=wM(),a=Tu(),c=j7();function h(f){return typeof f=="function"?f:f==null?n:typeof f=="object"?a(f)?t(f[0],f[1]):e(f):c(f)}return i1=h,i1}var o1,WC;function q7(){if(WC)return o1;WC=1;var e=Kg();function t(n,a){return function(c,h){if(c==null)return c;if(!e(c))return n(c,h);for(var f=c.length,o=a?f:-1,y=Object(c);(a?o--:++o<f)&&h(y[o],o,y)!==!1;);return c}}return o1=t,o1}var a1,ZC;function $7(){if(ZC)return a1;ZC=1;var e=xM(),t=q7(),n=t(e);return a1=n,a1}var s1,YC;function V7(){if(YC)return s1;YC=1;var e=$7(),t=Kg();function n(a,c){var h=-1,f=t(a)?Array(a.length):[];return e(a,function(o,y,v){f[++h]=c(o,y,v)}),f}return s1=n,s1}var l1,XC;function G7(){if(XC)return l1;XC=1;var e=SM(),t=U7(),n=V7(),a=Tu();function c(h,f){var o=a(h)?e:n;return o(h,t(f,3))}return l1=c,l1}var KC;function H7(){if(KC)return Mf;KC=1,Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.flattenNames=void 0;var e=Iz(),t=y(e),n=R2(),a=y(n),c=zz(),h=y(c),f=G7(),o=y(f);function y(S){return S&&S.__esModule?S:{default:S}}var v=Mf.flattenNames=function S(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],M=[];return(0,o.default)(P,function(E){Array.isArray(E)?S(E).map(function(O){return M.push(O)}):(0,h.default)(E)?(0,a.default)(E,function(O,N){O===!0&&M.push(N),M.push(N+"-"+O)}):(0,t.default)(E)&&M.push(E)}),M};return Mf.default=v,Mf}var Lf={},u1,JC;function W7(){if(JC)return u1;JC=1;function e(t,n){for(var a=-1,c=t==null?0:t.length;++a<c&&n(t[a],a,t)!==!1;);return t}return u1=e,u1}var c1,QC;function Z7(){if(QC)return c1;QC=1;var e=Zh(),t=(function(){try{var n=e(Object,"defineProperty");return n({},"",{}),n}catch{}})();return c1=t,c1}var h1,eA;function BM(){if(eA)return h1;eA=1;var e=Z7();function t(n,a,c){a=="__proto__"&&e?e(n,a,{configurable:!0,enumerable:!0,value:c,writable:!0}):n[a]=c}return h1=t,h1}var f1,tA;function zM(){if(tA)return f1;tA=1;var e=BM(),t=O2(),n=Object.prototype,a=n.hasOwnProperty;function c(h,f,o){var y=h[f];(!(a.call(h,f)&&t(y,o))||o===void 0&&!(f in h))&&e(h,f,o)}return f1=c,f1}var d1,rA;function iy(){if(rA)return d1;rA=1;var e=zM(),t=BM();function n(a,c,h,f){var o=!h;h||(h={});for(var y=-1,v=c.length;++y<v;){var S=c[y],P=f?f(h[S],a[S],S,h,a):void 0;P===void 0&&(P=a[S]),o?t(h,S,P):e(h,S,P)}return h}return d1=n,d1}var p1,nA;function Y7(){if(nA)return p1;nA=1;var e=iy(),t=Wp();function n(a,c){return a&&e(c,t(c),a)}return p1=n,p1}var m1,iA;function X7(){if(iA)return m1;iA=1;function e(t){var n=[];if(t!=null)for(var a in Object(t))n.push(a);return n}return m1=e,m1}var g1,oA;function K7(){if(oA)return g1;oA=1;var e=_d(),t=k2(),n=X7(),a=Object.prototype,c=a.hasOwnProperty;function h(f){if(!e(f))return n(f);var o=t(f),y=[];for(var v in f)v=="constructor"&&(o||!c.call(f,v))||y.push(v);return y}return g1=h,g1}var y1,aA;function $2(){if(aA)return y1;aA=1;var e=_M(),t=K7(),n=Kg();function a(c){return n(c)?e(c,!0):t(c)}return y1=a,y1}var _1,sA;function J7(){if(sA)return _1;sA=1;var e=iy(),t=$2();function n(a,c){return a&&e(c,t(c),a)}return _1=n,_1}var fp={exports:{}};fp.exports;var lA;function Q7(){return lA||(lA=1,(function(e,t){var n=ec(),a=t&&!t.nodeType&&t,c=a&&!0&&e&&!e.nodeType&&e,h=c&&c.exports===a,f=h?n.Buffer:void 0,o=f?f.allocUnsafe:void 0;function y(v,S){if(S)return v.slice();var P=v.length,M=o?o(P):new v.constructor(P);return v.copy(M),M}e.exports=y})(fp,fp.exports)),fp.exports}var v1,uA;function ej(){if(uA)return v1;uA=1;function e(t,n){var a=-1,c=t.length;for(n||(n=Array(c));++a<c;)n[a]=t[a];return n}return v1=e,v1}var b1,cA;function tj(){if(cA)return b1;cA=1;var e=iy(),t=j2();function n(a,c){return e(a,t(a),c)}return b1=n,b1}var x1,hA;function jM(){if(hA)return x1;hA=1;var e=AM(),t=N2(),n=j2(),a=IM(),c=Object.getOwnPropertySymbols,h=c?function(f){for(var o=[];f;)e(o,n(f)),f=t(f);return o}:a;return x1=h,x1}var w1,fA;function rj(){if(fA)return w1;fA=1;var e=iy(),t=jM();function n(a,c){return e(a,t(a),c)}return w1=n,w1}var S1,dA;function nj(){if(dA)return S1;dA=1;var e=PM(),t=jM(),n=$2();function a(c){return e(c,n,t)}return S1=a,S1}var E1,pA;function ij(){if(pA)return E1;pA=1;var e=Object.prototype,t=e.hasOwnProperty;function n(a){var c=a.length,h=new a.constructor(c);return c&&typeof a[0]=="string"&&t.call(a,"index")&&(h.index=a.index,h.input=a.input),h}return E1=n,E1}var T1,mA;function V2(){if(mA)return T1;mA=1;var e=CM();function t(n){var a=new n.constructor(n.byteLength);return new e(a).set(new e(n)),a}return T1=t,T1}var C1,gA;function oj(){if(gA)return C1;gA=1;var e=V2();function t(n,a){var c=a?e(n.buffer):n.buffer;return new n.constructor(c,n.byteOffset,n.byteLength)}return C1=t,C1}var A1,yA;function aj(){if(yA)return A1;yA=1;var e=/\w*$/;function t(n){var a=new n.constructor(n.source,e.exec(n));return a.lastIndex=n.lastIndex,a}return A1=t,A1}var P1,_A;function sj(){if(_A)return P1;_A=1;var e=Hp(),t=e?e.prototype:void 0,n=t?t.valueOf:void 0;function a(c){return n?Object(n.call(c)):{}}return P1=a,P1}var I1,vA;function lj(){if(vA)return I1;vA=1;var e=V2();function t(n,a){var c=a?e(n.buffer):n.buffer;return new n.constructor(c,n.byteOffset,n.length)}return I1=t,I1}var M1,bA;function uj(){if(bA)return M1;bA=1;var e=V2(),t=oj(),n=aj(),a=sj(),c=lj(),h="[object Boolean]",f="[object Date]",o="[object Map]",y="[object Number]",v="[object RegExp]",S="[object Set]",P="[object String]",M="[object Symbol]",E="[object ArrayBuffer]",O="[object DataView]",N="[object Float32Array]",z="[object Float64Array]",U="[object Int8Array]",ee="[object Int16Array]",ae="[object Int32Array]",W="[object Uint8Array]",le="[object Uint8ClampedArray]",te="[object Uint16Array]",we="[object Uint32Array]";function Te(me,Ve,re){var H=me.constructor;switch(Ve){case E:return e(me);case h:case f:return new H(+me);case O:return t(me,re);case N:case z:case U:case ee:case ae:case W:case le:case te:case we:return c(me,re);case o:return new H;case y:case P:return new H(me);case v:return n(me);case S:return new H;case M:return a(me)}}return M1=Te,M1}var L1,xA;function cj(){if(xA)return L1;xA=1;var e=_d(),t=Object.create,n=(function(){function a(){}return function(c){if(!e(c))return{};if(t)return t(c);a.prototype=c;var h=new a;return a.prototype=void 0,h}})();return L1=n,L1}var D1,wA;function hj(){if(wA)return D1;wA=1;var e=cj(),t=N2(),n=k2();function a(c){return typeof c.constructor=="function"&&!n(c)?e(t(c)):{}}return D1=a,D1}var k1,SA;function fj(){if(SA)return k1;SA=1;var e=ry(),t=Tc(),n="[object Map]";function a(c){return t(c)&&e(c)==n}return k1=a,k1}var R1,EA;function dj(){if(EA)return R1;EA=1;var e=fj(),t=L2(),n=D2(),a=n&&n.isMap,c=a?t(a):e;return R1=c,R1}var N1,TA;function pj(){if(TA)return N1;TA=1;var e=ry(),t=Tc(),n="[object Set]";function a(c){return t(c)&&e(c)==n}return N1=a,N1}var O1,CA;function mj(){if(CA)return O1;CA=1;var e=pj(),t=L2(),n=D2(),a=n&&n.isSet,c=a?t(a):e;return O1=c,O1}var F1,AA;function gj(){if(AA)return F1;AA=1;var e=z2(),t=W7(),n=zM(),a=Y7(),c=J7(),h=Q7(),f=ej(),o=tj(),y=rj(),v=MM(),S=nj(),P=ry(),M=ij(),E=uj(),O=hj(),N=Tu(),z=I2(),U=dj(),ee=_d(),ae=mj(),W=Wp(),le=$2(),te=1,we=2,Te=4,me="[object Arguments]",Ve="[object Array]",re="[object Boolean]",H="[object Date]",Le="[object Error]",Pe="[object Function]",Me="[object GeneratorFunction]",Ze="[object Map]",ut="[object Number]",ke="[object Object]",Xe="[object RegExp]",ge="[object Set]",Re="[object String]",J="[object Symbol]",fe="[object WeakMap]",xe="[object ArrayBuffer]",Ie="[object DataView]",Fe="[object Float32Array]",ot="[object Float64Array]",Et="[object Int8Array]",gt="[object Int16Array]",wt="[object Int32Array]",Zt="[object Uint8Array]",Ct="[object Uint8ClampedArray]",Kt="[object Uint16Array]",Dt="[object Uint32Array]",Be={};Be[me]=Be[Ve]=Be[xe]=Be[Ie]=Be[re]=Be[H]=Be[Fe]=Be[ot]=Be[Et]=Be[gt]=Be[wt]=Be[Ze]=Be[ut]=Be[ke]=Be[Xe]=Be[ge]=Be[Re]=Be[J]=Be[Zt]=Be[Ct]=Be[Kt]=Be[Dt]=!0,Be[Le]=Be[Pe]=Be[fe]=!1;function Lr(fr,Mr,Jt,Or,Er,lr){var yr,hn=Mr&te,Gr=Mr&we,jr=Mr&Te;if(Jt&&(yr=Er?Jt(fr,Or,Er,lr):Jt(fr)),yr!==void 0)return yr;if(!ee(fr))return fr;var Wr=N(fr);if(Wr){if(yr=M(fr),!hn)return f(fr,yr)}else{var Ur=P(fr),Br=Ur==Pe||Ur==Me;if(z(fr))return h(fr,hn);if(Ur==ke||Ur==me||Br&&!Er){if(yr=Gr||Br?{}:O(fr),!hn)return Gr?y(fr,c(yr,fr)):o(fr,a(yr,fr))}else{if(!Be[Ur])return Er?fr:{};yr=E(fr,Ur,hn)}}lr||(lr=new e);var vr=lr.get(fr);if(vr)return vr;lr.set(fr,yr),ae(fr)?fr.forEach(function(he){yr.add(Lr(he,Mr,Jt,he,fr,lr))}):U(fr)&&fr.forEach(function(he,ce){yr.set(ce,Lr(he,Mr,Jt,ce,fr,lr))});var Ir=jr?Gr?S:v:Gr?le:W,pt=Wr?void 0:Ir(fr);return t(pt||fr,function(he,ce){pt&&(ce=he,he=fr[ce]),n(yr,ce,Lr(he,Mr,Jt,ce,fr,lr))}),yr}return F1=Lr,F1}var B1,PA;function yj(){if(PA)return B1;PA=1;var e=gj(),t=1,n=4;function a(c){return e(c,t|n)}return B1=a,B1}var IA;function _j(){if(IA)return Lf;IA=1,Object.defineProperty(Lf,"__esModule",{value:!0}),Lf.mergeClasses=void 0;var e=R2(),t=h(e),n=yj(),a=h(n),c=Object.assign||function(o){for(var y=1;y<arguments.length;y++){var v=arguments[y];for(var S in v)Object.prototype.hasOwnProperty.call(v,S)&&(o[S]=v[S])}return o};function h(o){return o&&o.__esModule?o:{default:o}}var f=Lf.mergeClasses=function(y){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],S=y.default&&(0,a.default)(y.default)||{};return v.map(function(P){var M=y[P];return M&&(0,t.default)(M,function(E,O){S[O]||(S[O]={}),S[O]=c({},S[O],M[O])}),P}),S};return Lf.default=f,Lf}var Df={},MA;function vj(){if(MA)return Df;MA=1,Object.defineProperty(Df,"__esModule",{value:!0}),Df.autoprefix=void 0;var e=R2(),t=a(e),n=Object.assign||function(f){for(var o=1;o<arguments.length;o++){var y=arguments[o];for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(f[v]=y[v])}return f};function a(f){return f&&f.__esModule?f:{default:f}}var c={borderRadius:function(o){return{msBorderRadius:o,MozBorderRadius:o,OBorderRadius:o,WebkitBorderRadius:o,borderRadius:o}},boxShadow:function(o){return{msBoxShadow:o,MozBoxShadow:o,OBoxShadow:o,WebkitBoxShadow:o,boxShadow:o}},userSelect:function(o){return{WebkitTouchCallout:o,KhtmlUserSelect:o,MozUserSelect:o,msUserSelect:o,WebkitUserSelect:o,userSelect:o}},flex:function(o){return{WebkitBoxFlex:o,MozBoxFlex:o,WebkitFlex:o,msFlex:o,flex:o}},flexBasis:function(o){return{WebkitFlexBasis:o,flexBasis:o}},justifyContent:function(o){return{WebkitJustifyContent:o,justifyContent:o}},transition:function(o){return{msTransition:o,MozTransition:o,OTransition:o,WebkitTransition:o,transition:o}},transform:function(o){return{msTransform:o,MozTransform:o,OTransform:o,WebkitTransform:o,transform:o}},absolute:function(o){var y=o&&o.split(" ");return{position:"absolute",top:y&&y[0],right:y&&y[1],bottom:y&&y[2],left:y&&y[3]}},extend:function(o,y){var v=y[o];return v||{extend:o}}},h=Df.autoprefix=function(o){var y={};return(0,t.default)(o,function(v,S){var P={};(0,t.default)(v,function(M,E){var O=c[E];O?P=n({},P,O(M)):P[E]=M}),y[S]=P}),y};return Df.default=h,Df}var kf={},LA;function bj(){if(LA)return kf;LA=1,Object.defineProperty(kf,"__esModule",{value:!0}),kf.hover=void 0;var e=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var S=arguments[v];for(var P in S)Object.prototype.hasOwnProperty.call(S,P)&&(y[P]=S[P])}return y},t=_e,n=a(t);function a(y){return y&&y.__esModule?y:{default:y}}function c(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function h(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function f(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var o=kf.hover=function(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(P){f(M,P);function M(){var E,O,N,z;c(this,M);for(var U=arguments.length,ee=Array(U),ae=0;ae<U;ae++)ee[ae]=arguments[ae];return z=(O=(N=h(this,(E=M.__proto__||Object.getPrototypeOf(M)).call.apply(E,[this].concat(ee))),N),N.state={hover:!1},N.handleMouseOver=function(){return N.setState({hover:!0})},N.handleMouseOut=function(){return N.setState({hover:!1})},N.render=function(){return n.default.createElement(S,{onMouseOver:N.handleMouseOver,onMouseOut:N.handleMouseOut},n.default.createElement(v,e({},N.props,N.state)))},O),h(N,z)}return M})(n.default.Component)};return kf.default=o,kf}var Rf={},DA;function xj(){if(DA)return Rf;DA=1,Object.defineProperty(Rf,"__esModule",{value:!0}),Rf.active=void 0;var e=Object.assign||function(y){for(var v=1;v<arguments.length;v++){var S=arguments[v];for(var P in S)Object.prototype.hasOwnProperty.call(S,P)&&(y[P]=S[P])}return y},t=_e,n=a(t);function a(y){return y&&y.__esModule?y:{default:y}}function c(y,v){if(!(y instanceof v))throw new TypeError("Cannot call a class as a function")}function h(y,v){if(!y)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return v&&(typeof v=="object"||typeof v=="function")?v:y}function f(y,v){if(typeof v!="function"&&v!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof v);y.prototype=Object.create(v&&v.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),v&&(Object.setPrototypeOf?Object.setPrototypeOf(y,v):y.__proto__=v)}var o=Rf.active=function(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return(function(P){f(M,P);function M(){var E,O,N,z;c(this,M);for(var U=arguments.length,ee=Array(U),ae=0;ae<U;ae++)ee[ae]=arguments[ae];return z=(O=(N=h(this,(E=M.__proto__||Object.getPrototypeOf(M)).call.apply(E,[this].concat(ee))),N),N.state={active:!1},N.handleMouseDown=function(){return N.setState({active:!0})},N.handleMouseUp=function(){return N.setState({active:!1})},N.render=function(){return n.default.createElement(S,{onMouseDown:N.handleMouseDown,onMouseUp:N.handleMouseUp},n.default.createElement(v,e({},N.props,N.state)))},O),h(N,z)}return M})(n.default.Component)};return Rf.default=o,Rf}var km={},kA;function wj(){if(kA)return km;kA=1,Object.defineProperty(km,"__esModule",{value:!0});var e=function(n,a){var c={},h=function(o){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;c[o]=y};return n===0&&h("first-child"),n===a-1&&h("last-child"),(n===0||n%2===0)&&h("even"),Math.abs(n%2)===1&&h("odd"),h("nth-child",n),c};return km.default=e,km}var RA;function Sj(){if(RA)return fl;RA=1,Object.defineProperty(fl,"__esModule",{value:!0}),fl.ReactCSS=fl.loop=fl.handleActive=fl.handleHover=fl.hover=void 0;var e=H7(),t=M(e),n=_j(),a=M(n),c=vj(),h=M(c),f=bj(),o=M(f),y=xj(),v=M(y),S=wj(),P=M(S);function M(O){return O&&O.__esModule?O:{default:O}}fl.hover=o.default,fl.handleHover=o.default,fl.handleActive=v.default,fl.loop=P.default;var E=fl.ReactCSS=function(N){for(var z=arguments.length,U=Array(z>1?z-1:0),ee=1;ee<z;ee++)U[ee-1]=arguments[ee];var ae=(0,t.default)(U),W=(0,a.default)(N,ae);return(0,h.default)(W)};return fl.default=E,fl}var G2=Sj();const Un=th(G2);var Ej=function(t,n,a,c,h){var f=h.clientWidth,o=h.clientHeight,y=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,v=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,S=y-(h.getBoundingClientRect().left+window.pageXOffset),P=v-(h.getBoundingClientRect().top+window.pageYOffset);if(a==="vertical"){var M=void 0;if(P<0?M=0:P>o?M=1:M=Math.round(P*100/o)/100,n.a!==M)return{h:n.h,s:n.s,l:n.l,a:M,source:"rgb"}}else{var E=void 0;if(S<0?E=0:S>f?E=1:E=Math.round(S*100/f)/100,c!==E)return{h:n.h,s:n.s,l:n.l,a:E,source:"rgb"}}return null},z1={},Tj=function(t,n,a,c){if(typeof document>"u"&&!c)return null;var h=c?new c:document.createElement("canvas");h.width=a*2,h.height=a*2;var f=h.getContext("2d");return f?(f.fillStyle=t,f.fillRect(0,0,h.width,h.height),f.fillStyle=n,f.fillRect(0,0,a,a),f.translate(a,a),f.fillRect(0,0,a,a),h.toDataURL()):null},Cj=function(t,n,a,c){var h=t+"-"+n+"-"+a+(c?"-server":"");if(z1[h])return z1[h];var f=Tj(t,n,a,c);return z1[h]=f,f},NA=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},vd=function(t){var n=t.white,a=t.grey,c=t.size,h=t.renderers,f=t.borderRadius,o=t.boxShadow,y=t.children,v=Un({default:{grid:{borderRadius:f,boxShadow:o,absolute:"0px 0px 0px 0px",background:"url("+Cj(n,a,c,h.canvas)+") center left"}}});return _e.isValidElement(y)?_e.cloneElement(y,NA({},y.props,{style:NA({},y.props.style,v.grid)})):_e.createElement("div",{style:v.grid})};vd.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}};var Aj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},Pj=(function(){function e(t,n){for(var a=0;a<n.length;a++){var c=n[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}})();function Ij(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OA(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Mj(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var H2=(function(e){Mj(t,e);function t(){var n,a,c,h;Ij(this,t);for(var f=arguments.length,o=Array(f),y=0;y<f;y++)o[y]=arguments[y];return h=(a=(c=OA(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(o))),c),c.handleChange=function(v){var S=Ej(v,c.props.hsl,c.props.direction,c.props.a,c.container);S&&typeof c.props.onChange=="function"&&c.props.onChange(S,v)},c.handleMouseDown=function(v){c.handleChange(v),window.addEventListener("mousemove",c.handleChange),window.addEventListener("mouseup",c.handleMouseUp)},c.handleMouseUp=function(){c.unbindEventListeners()},c.unbindEventListeners=function(){window.removeEventListener("mousemove",c.handleChange),window.removeEventListener("mouseup",c.handleMouseUp)},a),OA(c,h)}return Pj(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var a=this,c=this.props.rgb,h=Un({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+c.r+","+c.g+","+c.b+`, 0) 0%,
1175
1175
  rgba(`+c.r+","+c.g+","+c.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:c.a*100+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+c.r+","+c.g+","+c.b+`, 0) 0%,
1176
1176
  rgba(`+c.r+","+c.g+","+c.b+", 1) 100%)"},pointer:{left:0,top:c.a*100+"%"}},overwrite:Aj({},this.props.style)},{vertical:this.props.direction==="vertical",overwrite:!0});return _e.createElement("div",{style:h.alpha},_e.createElement("div",{style:h.checkboard},_e.createElement(vd,{renderers:this.props.renderers})),_e.createElement("div",{style:h.gradient}),_e.createElement("div",{style:h.container,ref:function(o){return a.container=o},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},_e.createElement("div",{style:h.pointer},this.props.pointer?_e.createElement(this.props.pointer,this.props):_e.createElement("div",{style:h.slider}))))}}]),t})(_e.PureComponent||_e.Component),Lj=(function(){function e(t,n){for(var a=0;a<n.length;a++){var c=n[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}})();function Dj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rj(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Nj(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Oj=1,UM=38,Fj=40,Bj=[UM,Fj],zj=function(t){return Bj.indexOf(t)>-1},jj=function(t){return Number(String(t).replace(/%/g,""))},Uj=1,xi=(function(e){Nj(t,e);function t(n){kj(this,t);var a=Rj(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return a.handleBlur=function(){a.state.blurValue&&a.setState({value:a.state.blurValue,blurValue:null})},a.handleChange=function(c){a.setUpdatedValue(c.target.value,c)},a.handleKeyDown=function(c){var h=jj(c.target.value);if(!isNaN(h)&&zj(c.keyCode)){var f=a.getArrowOffset(),o=c.keyCode===UM?h+f:h-f;a.setUpdatedValue(o,c)}},a.handleDrag=function(c){if(a.props.dragLabel){var h=Math.round(a.props.value+c.movementX);h>=0&&h<=a.props.dragMax&&a.props.onChange&&a.props.onChange(a.getValueObjectWithLabel(h),c)}},a.handleMouseDown=function(c){a.props.dragLabel&&(c.preventDefault(),a.handleDrag(c),window.addEventListener("mousemove",a.handleDrag),window.addEventListener("mouseup",a.handleMouseUp))},a.handleMouseUp=function(){a.unbindEventListeners()},a.unbindEventListeners=function(){window.removeEventListener("mousemove",a.handleDrag),window.removeEventListener("mouseup",a.handleMouseUp)},a.state={value:String(n.value).toUpperCase(),blurValue:String(n.value).toUpperCase()},a.inputId="rc-editable-input-"+Uj++,a}return Lj(t,[{key:"componentDidUpdate",value:function(a,c){this.props.value!==this.state.value&&(a.value!==this.props.value||c.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(a){return Dj({},this.props.label,a)}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||Oj}},{key:"setUpdatedValue",value:function(a,c){var h=this.props.label?this.getValueObjectWithLabel(a):a;this.props.onChange&&this.props.onChange(h,c),this.setState({value:a})}},{key:"render",value:function(){var a=this,c=Un({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return _e.createElement("div",{style:c.wrap},_e.createElement("input",{id:this.inputId,style:c.input,ref:function(f){return a.input=f},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?_e.createElement("label",{htmlFor:this.inputId,style:c.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t})(_e.PureComponent||_e.Component),qj=function(t,n,a,c){var h=c.clientWidth,f=c.clientHeight,o=typeof t.pageX=="number"?t.pageX:t.touches[0].pageX,y=typeof t.pageY=="number"?t.pageY:t.touches[0].pageY,v=o-(c.getBoundingClientRect().left+window.pageXOffset),S=y-(c.getBoundingClientRect().top+window.pageYOffset);if(n==="vertical"){var P=void 0;if(S<0)P=359;else if(S>f)P=0;else{var M=-(S*100/f)+100;P=360*M/100}if(a.h!==P)return{h:P,s:a.s,l:a.l,a:a.a,source:"hsl"}}else{var E=void 0;if(v<0)E=0;else if(v>h)E=359;else{var O=v*100/h;E=360*O/100}if(a.h!==E)return{h:E,s:a.s,l:a.l,a:a.a,source:"hsl"}}return null},$j=(function(){function e(t,n){for(var a=0;a<n.length;a++){var c=n[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}return function(t,n,a){return n&&e(t.prototype,n),a&&e(t,a),t}})();function Vj(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FA(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function Gj(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var bd=(function(e){Gj(t,e);function t(){var n,a,c,h;Vj(this,t);for(var f=arguments.length,o=Array(f),y=0;y<f;y++)o[y]=arguments[y];return h=(a=(c=FA(this,(n=t.__proto__||Object.getPrototypeOf(t)).call.apply(n,[this].concat(o))),c),c.handleChange=function(v){var S=qj(v,c.props.direction,c.props.hsl,c.container);S&&typeof c.props.onChange=="function"&&c.props.onChange(S,v)},c.handleMouseDown=function(v){c.handleChange(v),window.addEventListener("mousemove",c.handleChange),window.addEventListener("mouseup",c.handleMouseUp)},c.handleMouseUp=function(){c.unbindEventListeners()},a),FA(c,h)}return $j(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var a=this,c=this.props.direction,h=c===void 0?"horizontal":c,f=Un({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:this.props.hsl.h*100/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(this.props.hsl.h*100/360)+100+"%"}}},{vertical:h==="vertical"});return _e.createElement("div",{style:f.hue},_e.createElement("div",{className:"hue-"+h,style:f.container,ref:function(y){return a.container=y},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},_e.createElement("style",null,`
1177
1177
  .hue-horizontal {
@@ -1219,4 +1219,4 @@ Take a look at the logic that dispatched this action: `,E,`
1219
1219
  (To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`)}}),o||(N.measureTime(()=>{const z=P.getState(),U=$b(z,"",t,n,h,S);if(U){const{keyPath:ee,value:ae}=U;console.error(`A non-serializable value was detected in the state, in the path: \`${ee}\`. Value:`,ae,`
1220
1220
  Take a look at the reducer(s) handling this action type: ${E.type}.
1221
1221
  (See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`)}}),N.warnIfExceeded()),O}}}function zm(e){return typeof e=="boolean"}var VW=()=>function(t){const{thunk:n=!0,immutableCheck:a=!0,serializableCheck:c=!0,actionCreatorCheck:h=!0}=t??{};let f=new j4;if(n&&(zm(n)?f.push(kW):f.push(RW(n.extraArgument))),process.env.NODE_ENV!=="production"){if(a){let o={};zm(a)||(o=a),f.unshift(qW(o))}if(c){let o={};zm(c)||(o=c),f.push($W(o))}if(h){let o={};zm(h)||(o=h),f.unshift(zW(o))}}return f},GW="RTK_autoBatch",aP=e=>t=>{setTimeout(t,e)},HW=(e={type:"raf"})=>t=>(...n)=>{const a=t(...n);let c=!0,h=!1,f=!1;const o=new Set,y=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:aP(10):e.type==="callback"?e.queueNotification:aP(e.timeout),v=()=>{f=!1,h&&(h=!1,o.forEach(S=>S()))};return Object.assign({},a,{subscribe(S){const P=()=>c&&S(),M=a.subscribe(P);return o.add(S),()=>{M(),o.delete(S)}},dispatch(S){try{return c=!S?.meta?.[GW],h=!c,h&&(f||(f=!0,y(v))),a.dispatch(S)}finally{c=!0}}})},WW=e=>function(n){const{autoBatch:a=!0}=n??{};let c=new j4(e);return a&&c.push(HW(typeof a=="object"?a:void 0)),c};function ZW(e){const t=VW(),{reducer:n=void 0,middleware:a,devTools:c=!0,duplicateMiddlewareCheck:h=!0,preloadedState:f=void 0,enhancers:o=void 0}=e||{};let y;if(typeof n=="function")y=n;else if(Kp(n))y=bW(n);else throw new Error(process.env.NODE_ENV==="production"?ho(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");if(process.env.NODE_ENV!=="production"&&a&&typeof a!="function")throw new Error(process.env.NODE_ENV==="production"?ho(2):"`middleware` field must be a callback");let v;if(typeof a=="function"){if(v=a(t),process.env.NODE_ENV!=="production"&&!Array.isArray(v))throw new Error(process.env.NODE_ENV==="production"?ho(3):"when using a middleware builder function, an array of middleware must be returned")}else v=t();if(process.env.NODE_ENV!=="production"&&v.some(N=>typeof N!="function"))throw new Error(process.env.NODE_ENV==="production"?ho(4):"each middleware provided to configureStore must be a function");if(process.env.NODE_ENV!=="production"&&h){let N=new Set;v.forEach(z=>{if(N.has(z))throw new Error(process.env.NODE_ENV==="production"?ho(42):"Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");N.add(z)})}let S=Sg;c&&(S=NW({trace:process.env.NODE_ENV!=="production",...typeof c=="object"&&c}));const P=xW(...v),M=WW(P);if(process.env.NODE_ENV!=="production"&&o&&typeof o!="function")throw new Error(process.env.NODE_ENV==="production"?ho(5):"`enhancers` field must be a callback");let E=typeof o=="function"?o(M):M();if(process.env.NODE_ENV!=="production"&&!Array.isArray(E))throw new Error(process.env.NODE_ENV==="production"?ho(6):"`enhancers` callback must return an array");if(process.env.NODE_ENV!=="production"&&E.some(N=>typeof N!="function"))throw new Error(process.env.NODE_ENV==="production"?ho(7):"each enhancer provided to configureStore must be a function");process.env.NODE_ENV!=="production"&&v.length&&!E.includes(P)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");const O=S(...E);return I4(y,f,O)}function G4(e){const t={},n=[];let a;const c={addCase(h,f){if(process.env.NODE_ENV!=="production"){if(n.length>0)throw new Error(process.env.NODE_ENV==="production"?ho(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(a)throw new Error(process.env.NODE_ENV==="production"?ho(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}const o=typeof h=="string"?h:h.type;if(!o)throw new Error(process.env.NODE_ENV==="production"?ho(28):"`builder.addCase` cannot be called with an empty action type");if(o in t)throw new Error(process.env.NODE_ENV==="production"?ho(29):`\`builder.addCase\` cannot be called with two reducers for the same action type '${o}'`);return t[o]=f,c},addAsyncThunk(h,f){if(process.env.NODE_ENV!=="production"&&a)throw new Error(process.env.NODE_ENV==="production"?ho(43):"`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");return f.pending&&(t[h.pending.type]=f.pending),f.rejected&&(t[h.rejected.type]=f.rejected),f.fulfilled&&(t[h.fulfilled.type]=f.fulfilled),f.settled&&n.push({matcher:h.settled,reducer:f.settled}),c},addMatcher(h,f){if(process.env.NODE_ENV!=="production"&&a)throw new Error(process.env.NODE_ENV==="production"?ho(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return n.push({matcher:h,reducer:f}),c},addDefaultCase(h){if(process.env.NODE_ENV!=="production"&&a)throw new Error(process.env.NODE_ENV==="production"?ho(31):"`builder.addDefaultCase` can only be called once");return a=h,c}};return e(c),[t,n,a]}function YW(e){return typeof e=="function"}function XW(e,t){if(process.env.NODE_ENV!=="production"&&typeof t=="object")throw new Error(process.env.NODE_ENV==="production"?ho(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");let[n,a,c]=G4(t),h;if(YW(e))h=()=>oP(e());else{const o=oP(e);h=()=>o}function f(o=h(),y){let v=[n[y.type],...a.filter(({matcher:S})=>S(y)).map(({reducer:S})=>S)];return v.filter(S=>!!S).length===0&&(v=[c]),v.reduce((S,P)=>{if(P)if(qh(S)){const E=P(S,y);return E===void 0?S:E}else{if(Sc(S))return F4(S,M=>P(M,y));{const M=P(S,y);if(M===void 0){if(S===null)return S;throw Error("A case reducer on a non-draftable value must not return undefined")}return M}}return S},o)}return f.getInitialState=h,f}var KW=Symbol.for("rtk-slice-createasyncthunk");function JW(e,t){return`${e}/${t}`}function QW({creators:e}={}){const t=e?.asyncThunk?.[KW];return function(a){const{name:c,reducerPath:h=c}=a;if(!c)throw new Error(process.env.NODE_ENV==="production"?ho(11):"`name` is a required option for createSlice");typeof process<"u"&&process.env.NODE_ENV==="development"&&a.initialState===void 0&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");const f=(typeof a.reducers=="function"?a.reducers(rZ()):a.reducers)||{},o=Object.keys(f),y={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},v={addCase(ae,W){const le=typeof ae=="string"?ae:ae.type;if(!le)throw new Error(process.env.NODE_ENV==="production"?ho(12):"`context.addCase` cannot be called with an empty action type");if(le in y.sliceCaseReducersByType)throw new Error(process.env.NODE_ENV==="production"?ho(13):"`context.addCase` cannot be called with two reducers for the same action type: "+le);return y.sliceCaseReducersByType[le]=W,v},addMatcher(ae,W){return y.sliceMatchers.push({matcher:ae,reducer:W}),v},exposeAction(ae,W){return y.actionCreators[ae]=W,v},exposeCaseReducer(ae,W){return y.sliceCaseReducersByName[ae]=W,v}};o.forEach(ae=>{const W=f[ae],le={reducerName:ae,type:JW(c,ae),createNotation:typeof a.reducers=="function"};iZ(W)?aZ(le,W,v,t):nZ(le,W,v)});function S(){if(process.env.NODE_ENV!=="production"&&typeof a.extraReducers=="object")throw new Error(process.env.NODE_ENV==="production"?ho(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");const[ae={},W=[],le=void 0]=typeof a.extraReducers=="function"?G4(a.extraReducers):[a.extraReducers],te={...ae,...y.sliceCaseReducersByType};return XW(a.initialState,we=>{for(let Te in te)we.addCase(Te,te[Te]);for(let Te of y.sliceMatchers)we.addMatcher(Te.matcher,Te.reducer);for(let Te of W)we.addMatcher(Te.matcher,Te.reducer);le&&we.addDefaultCase(le)})}const P=ae=>ae,M=new Map,E=new WeakMap;let O;function N(ae,W){return O||(O=S()),O(ae,W)}function z(){return O||(O=S()),O.getInitialState()}function U(ae,W=!1){function le(we){let Te=we[ae];if(typeof Te>"u"){if(W)Te=Bm(E,le,z);else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?ho(15):"selectSlice returned undefined for an uninjected slice reducer")}return Te}function te(we=P){const Te=Bm(M,W,()=>new WeakMap);return Bm(Te,we,()=>{const me={};for(const[Ve,re]of Object.entries(a.selectors??{}))me[Ve]=eZ(re,we,()=>Bm(E,we,z),W);return me})}return{reducerPath:ae,getSelectors:te,get selectors(){return te(le)},selectSlice:le}}const ee={name:c,reducer:N,actions:y.actionCreators,caseReducers:y.sliceCaseReducersByName,getInitialState:z,...U(h),injectInto(ae,{reducerPath:W,...le}={}){const te=W??h;return ae.inject({reducerPath:te,reducer:N},le),{...ee,...U(te,!0)}}};return ee}}function eZ(e,t,n,a){function c(h,...f){let o=t(h);if(typeof o>"u"){if(a)o=n();else if(process.env.NODE_ENV!=="production")throw new Error(process.env.NODE_ENV==="production"?ho(16):"selectState returned undefined for an uninjected slice reducer")}return e(o,...f)}return c.unwrapped=e,c}var tZ=QW();function rZ(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function nZ({type:e,reducerName:t,createNotation:n},a,c){let h,f;if("reducer"in a){if(n&&!oZ(a))throw new Error(process.env.NODE_ENV==="production"?ho(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");h=a.reducer,f=a.prepare}else h=a;c.addCase(e,h).exposeCaseReducer(t,h).exposeAction(t,f?iP(e,f):iP(e))}function iZ(e){return e._reducerDefinitionType==="asyncThunk"}function oZ(e){return e._reducerDefinitionType==="reducerWithPrepare"}function aZ({type:e,reducerName:t},n,a,c){if(!c)throw new Error(process.env.NODE_ENV==="production"?ho(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");const{payloadCreator:h,fulfilled:f,pending:o,rejected:y,settled:v,options:S}=n,P=c(e,h,S);a.exposeAction(t,P),f&&a.addCase(P.fulfilled,f),o&&a.addCase(P.pending,o),y&&a.addCase(P.rejected,y),v&&a.addMatcher(P.settled,v),a.exposeCaseReducer(t,{fulfilled:f||jm,pending:o||jm,rejected:y||jm,settled:v||jm})}function jm(){}function ho(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}function H4(e,t,n){t.forEach(a=>{e(a,n),a.layers&&a.layers.length>0&&H4(e,a.layers,a)})}const sZ={mapConfigs:{}},W4=tZ({name:"mapConfig",initialState:sZ,reducers:{setMapConfig:(e,t)=>{const n=t.payload.mapConfig,a=t.payload.key;e.mapConfigs[a]=n},removeMapConfig:(e,t)=>{delete e.mapConfigs[t.payload.key]},setLayerInMapConfig:(e,t)=>{const{mapConfigKey:n,layer:a}=t.payload,c=e.mapConfigs[n];if(c){for(let h=0;h<c.layers.length;h++)if(c.layers[h].uuid===a.uuid){c.layers[h]=a;break}}},removeLayerFromMapConfig:(e,t)=>{const{mapConfigKey:n,layerUuid:a}=t.payload,c=e.mapConfigs[n];if(c){const h=c.layers.findIndex(f=>f.uuid===a);h!==-1&&(delete c.layers[h],H4(function(f,o){o&&o.layers&&(o.layers=o.layers.filter(y=>y.uuid!==a))},c.layerOrder))}},updateLayerOrder:(e,t)=>{const{mapConfigKey:n,newOrder:a}=t.payload,c=e.mapConfigs[n];c&&(c.layerOrder=a)},setMasterVisible(e,t){const{mapConfigKey:n,layerId:a,masterVisible:c}=t.payload,h=e.mapConfigs[n];if(h){const f=h.layers.findIndex(o=>o.uuid===a);if(f!==-1){const o=h.layers[f];if(o){const y=[...h.layers];o.type==="folder"&&h.layerOrder.forEach(v=>{v.uuid===a&&v.layers?.forEach(S=>{const P=h.layers.findIndex(E=>E.uuid===S.uuid),M=y[P];y[P]={...M,masterVisible:c},M?.type==="vt"&&M?.config?.layers&&(M.config.layers=M.config.layers.map(E=>({...E,masterVisible:c})))})}),o.type==="vt"&&o?.config?.layers&&(o.config.layers=o.config.layers.map(v=>({...v,masterVisible:c}))),e.mapConfigs[n].layers=y}}}}}});ZW({reducer:{mapConfig:W4.reducer}});const{setMapConfig:WZ,removeMapConfig:ZZ,setLayerInMapConfig:YZ,removeLayerFromMapConfig:XZ,updateLayerOrder:KZ,setMasterVisible:JZ}=W4.actions;Rn(b2)({marginLeft:"-100px",marginRight:"-21px",paddingLeft:"53px",borderRadius:"0px",boxShadow:"none",backgroundColor:"rgb(0, 0, 0, 0)"});Rn(nh)({marginLeft:"61px"});Rn(Ec)({padding:"4px",marginTop:"-3px"});Rn(Ec)({marginLeft:"20px"});Rn(Wg)({paddingRight:0,paddingLeft:0,paddingTop:0,paddingBottom:"4px"});Rn(Zg)({minWidth:"30px"});Rn(Ec)({marginRight:"0px",padding:"0px"});Rn(nh)(({open:e})=>({display:e?"block":"none"}));Rn(Vp)({marginLeft:"50px"});Rn(Vp)({marginTop:"15px"});var lZ=FM();const tg=th(lZ);var Z4=_e.createContext(void 0);Z4.displayName="RecordContext";var _y=function(e){var t=_e.useContext(Z4);return e&&e.record||t},uZ=e=>e.type==="checkbox",yp=e=>e instanceof Date,Ex=e=>e==null;const Y4=e=>typeof e=="object";var Vh=e=>!Ex(e)&&!Array.isArray(e)&&Y4(e)&&!yp(e),cZ=e=>Vh(e)&&e.target?uZ(e.target)?e.target.checked:e.target.value:e,hZ=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,fZ=(e,t)=>e.has(hZ(t)),dZ=e=>{const t=e.constructor&&e.constructor.prototype;return Vh(t)&&t.hasOwnProperty("isPrototypeOf")},pZ=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function X4(e){let t;const n=Array.isArray(e),a=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)t=new Date(e);else if(!(pZ&&(e instanceof Blob||a))&&(n||Vh(e)))if(t=n?[]:Object.create(Object.getPrototypeOf(e)),!n&&!dZ(e))t=e;else for(const c in e)e.hasOwnProperty(c)&&(t[c]=X4(e[c]));else return e;return t}var K4=e=>/^\w*$/.test(e),Vb=e=>e===void 0,mZ=e=>Array.isArray(e)?e.filter(Boolean):[],J4=e=>mZ(e.replace(/["|']|\]/g,"").split(/\.|\[/)),dl=(e,t,n)=>{if(!t||!Vh(e))return n;const a=(K4(t)?[t]:J4(t)).reduce((c,h)=>Ex(c)?c:c[h],e);return Vb(a)||a===e?Vb(e[t])?n:e[t]:a},Q1=e=>typeof e=="boolean",sP=(e,t,n)=>{let a=-1;const c=K4(t)?[t]:J4(t),h=c.length,f=h-1;for(;++a<h;){const o=c[a];let y=n;if(a!==f){const v=e[o];y=Vh(v)||Array.isArray(v)?v:isNaN(+c[a+1])?{}:[]}if(o==="__proto__"||o==="constructor"||o==="prototype")return;e[o]=y,e=e[o]}};const lP={BLUR:"blur",CHANGE:"change"},uP={all:"all"},Q4=_e.createContext(null);Q4.displayName="HookFormContext";const vy=()=>_e.useContext(Q4);var gZ=(e,t,n,a=!0)=>{const c={defaultValues:t._defaultValues};for(const h in e)Object.defineProperty(c,h,{get:()=>{const f=h;return t._proxyFormState[f]!==uP.all&&(t._proxyFormState[f]=!a||uP.all),n&&(n[f]=!0),e[f]}});return c};const eL=typeof window<"u"?_e.useLayoutEffect:_e.useEffect;function yZ(e){const t=vy(),{control:n=t.control,disabled:a,name:c,exact:h}=e||{},[f,o]=_e.useState(n._formState),y=_e.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return eL(()=>n._subscribe({name:c,formState:y.current,exact:h,callback:v=>{!a&&o({...n._formState,...v})}}),[c,a,h]),_e.useEffect(()=>{y.current.isValid&&n._setValid(!0)},[n]),_e.useMemo(()=>gZ(f,n,y.current,!1),[f,n])}var _Z=e=>typeof e=="string",vZ=(e,t,n,a,c)=>_Z(e)?dl(n,e,c):Array.isArray(e)?e.map(h=>dl(n,h)):n,cP=e=>Ex(e)||!Y4(e);function tL(e,t,n=new WeakSet){if(cP(e)||cP(t))return e===t;if(yp(e)&&yp(t))return e.getTime()===t.getTime();const a=Object.keys(e),c=Object.keys(t);if(a.length!==c.length)return!1;if(n.has(e)||n.has(t))return!0;n.add(e),n.add(t);for(const h of a){const f=e[h];if(!c.includes(h))return!1;if(h!=="ref"){const o=t[h];if(yp(f)&&yp(o)||Vh(f)&&Vh(o)||Array.isArray(f)&&Array.isArray(o)?!tL(f,o,n):f!==o)return!1}}return!0}function bZ(e){const t=vy(),{control:n=t.control,name:a,defaultValue:c,disabled:h,exact:f,compute:o}=e||{},y=_e.useRef(c),v=_e.useRef(o),S=_e.useRef(void 0);v.current=o;const P=_e.useMemo(()=>n._getWatch(a,y.current),[n,a]),[M,E]=_e.useState(v.current?v.current(P):P);return eL(()=>n._subscribe({name:a,formState:{values:!0},exact:f,callback:O=>{if(!h){const N=vZ(a,n._names,O.values||n._formValues,!1,y.current);if(v.current){const z=v.current(N);tL(z,S.current)||(E(z),S.current=z)}else E(N)}}}),[n,h,a,f]),_e.useEffect(()=>n._removeUnmounted()),M}function xZ(e){const t=vy(),{name:n,disabled:a,control:c=t.control,shouldUnregister:h,defaultValue:f}=e,o=fZ(c._names.array,n),y=_e.useMemo(()=>dl(c._formValues,n,dl(c._defaultValues,n,f)),[c,n,f]),v=bZ({control:c,name:n,defaultValue:y,exact:!0}),S=yZ({control:c,name:n,exact:!0}),P=_e.useRef(e),M=_e.useRef(c.register(n,{...e.rules,value:v,...Q1(e.disabled)?{disabled:e.disabled}:{}}));P.current=e;const E=_e.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!dl(S.errors,n)},isDirty:{enumerable:!0,get:()=>!!dl(S.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!dl(S.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!dl(S.validatingFields,n)},error:{enumerable:!0,get:()=>dl(S.errors,n)}}),[S,n]),O=_e.useCallback(ee=>M.current.onChange({target:{value:cZ(ee),name:n},type:lP.CHANGE}),[n]),N=_e.useCallback(()=>M.current.onBlur({target:{value:dl(c._formValues,n),name:n},type:lP.BLUR}),[n,c._formValues]),z=_e.useCallback(ee=>{const ae=dl(c._fields,n);ae&&ee&&(ae._f.ref={focus:()=>ee.focus&&ee.focus(),select:()=>ee.select&&ee.select(),setCustomValidity:W=>ee.setCustomValidity(W),reportValidity:()=>ee.reportValidity()})},[c._fields,n]),U=_e.useMemo(()=>({name:n,value:v,...Q1(a)||S.disabled?{disabled:S.disabled||a}:{},onChange:O,onBlur:N,ref:z}),[n,a,S.disabled,O,N,z,v]);return _e.useEffect(()=>{const ee=c._options.shouldUnregister||h;c.register(n,{...P.current.rules,...Q1(P.current.disabled)?{disabled:P.current.disabled}:{}});const ae=(W,le)=>{const te=dl(c._fields,W);te&&te._f&&(te._f.mount=le)};if(ae(n,!0),ee){const W=X4(dl(c._options.defaultValues,n));sP(c._defaultValues,n,W),Vb(dl(c._formValues,n))&&sP(c._formValues,n,W)}return!o&&c.register(n),()=>{(o?ee&&!c._state.action:ee)?c.unregister(n):ae(n,!1)}},[n,c,o,h]),_e.useEffect(()=>{c._setDisabledField({disabled:a,name:n})},[a,n,c]),_e.useMemo(()=>({field:U,formState:S,fieldState:E}),[U,S,E])}var wZ=_e.createContext(void 0),SZ=_e.createContext(null),EZ=function(){var e=_e.useContext(wZ);return e},TZ=function(){var e=_e.useContext(SZ);return e},CZ=function(e){var t=e.inputProps,n=e.isArrayInput,a=e.fieldArrayInputControl,c=t.defaultValue,h=t.source,f=t.disabled,o=iL(h),y=_y(t),v=vy(),S=v.getValues,P=v.resetField,M=v.formState,E=v.reset,O=tg(y,o),N=tg(S(),o),z=M.dirtyFields,U=Object.keys(z).includes(o);_e.useEffect(function(){if(!(c==null||N!=null||f||O!==void 0||U)){var ee=o.split(".").some(function(le){return AZ.test(le)});if(ee){var ae=o.split(".").slice(0,-1).join("."),W=tg(S(),ae);if(W==null)return}if(n){if(!a)throw new Error("useApplyInputDefaultValues: No fieldArrayInputControl passed in props for array input usage");a.replace(c),E({},{keepValues:!0});return}P(o,{defaultValue:c})}})},AZ=/^\d+$/,PZ=RM();const rL=th(PZ);var IZ=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,oh=function(e){return typeof e>"u"||e===null||e===""||Array.isArray(e)&&e.length===0};function MZ(e){return e?e.hasOwnProperty("message"):!1}var ah=function(e,t,n,a){return typeof e=="function"?e({args:t,value:n,values:a}):t?{message:e,args:t}:e},sh=function(e){return rL(e,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return JSON.stringify(t)})},LZ=function(e){return typeof e=="function"},DZ=function(e,t){return function(n,a,c){var h=e(n,a,c);return h?typeof h=="string"||MZ(h)?h:h.then(function(f){return f||t(n,a,c)}):t(n,a,c)}},kZ=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=(Array.isArray(e[0])?e[0]:e).filter(LZ);return n.reduce(DZ,function(){return null})};sh(function(e){return e===void 0&&(e="ra.validation.required"),Object.assign(function(t,n){return oh(t)?ah(e,void 0,t,n):void 0},{isRequired:!0})});sh(function(e,t){return t===void 0&&(t="ra.validation.minLength"),function(n,a){return!oh(n)&&n.length<e?ah(t,{min:e},n,a):void 0}});sh(function(e,t){return t===void 0&&(t="ra.validation.maxLength"),function(n,a){return!oh(n)&&n.length>e?ah(t,{max:e},n,a):void 0}});sh(function(e,t){return t===void 0&&(t="ra.validation.minValue"),function(n,a){return!oh(n)&&n<e?ah(t,{min:e},n,a):void 0}});sh(function(e,t){return t===void 0&&(t="ra.validation.maxValue"),function(n,a){return!oh(n)&&n>e?ah(t,{max:e},n,a):void 0}});sh(function(e){return e===void 0&&(e="ra.validation.number"),function(t,n){return!oh(t)&&isNaN(Number(t))?ah(e,void 0,t,n):void 0}});var RZ=rL(function(e,t){return t===void 0&&(t="ra.validation.regex"),function(n,a){return!oh(n)&&typeof n=="string"&&!e.test(n)?ah(t,{pattern:e},n,a):void 0}},function(e,t){return e.toString()+t});sh(function(e){return e===void 0&&(e="ra.validation.email"),RZ(IZ,e)});var NZ=function(e){var t=e.args;return{message:"ra.validation.oneOf",args:t}};sh(function(e,t){return t===void 0&&(t=NZ),function(n,a){return!oh(n)&&e.indexOf(n)===-1?ah(t,{list:e},n,a):void 0}});var OZ=function(e){return e&&e.isRequired?!0:Array.isArray(e)?!!e.find(function(t){return t.isRequired}):!1},Dh=function(){return Dh=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++){t=arguments[n];for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&(e[c]=t[c])}return e},Dh.apply(this,arguments)},FZ=function(e,t,n,a){function c(h){return h instanceof n?h:new n(function(f){f(h)})}return new(n||(n=Promise))(function(h,f){function o(S){try{v(a.next(S))}catch(P){f(P)}}function y(S){try{v(a.throw(S))}catch(P){f(P)}}function v(S){S.done?h(S.value):c(S.value).then(o,y)}v((a=a.apply(e,t||[])).next())})},BZ=function(e,t){var n={label:0,sent:function(){if(h[0]&1)throw h[1];return h[1]},trys:[],ops:[]},a,c,h,f=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return f.next=o(0),f.throw=o(1),f.return=o(2),typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function o(v){return function(S){return y([v,S])}}function y(v){if(a)throw new TypeError("Generator is already executing.");for(;f&&(f=0,v[0]&&(n=0)),n;)try{if(a=1,c&&(h=v[0]&2?c.return:v[0]?c.throw||((h=c.return)&&h.call(c),0):c.next)&&!(h=h.call(c,v[1])).done)return h;switch(c=0,h&&(v=[v[0]&2,h.value]),v[0]){case 0:case 1:h=v;break;case 4:return n.label++,{value:v[1],done:!1};case 5:n.label++,c=v[1],v=[0];continue;case 7:v=n.ops.pop(),n.trys.pop();continue;default:if(h=n.trys,!(h=h.length>0&&h[h.length-1])&&(v[0]===6||v[0]===2)){n=0;continue}if(v[0]===3&&(!h||v[1]>h[0]&&v[1]<h[3])){n.label=v[1];break}if(v[0]===6&&n.label<h[1]){n.label=h[1],h=v;break}if(h&&n.label<h[2]){n.label=h[2],n.ops.push(v);break}h[2]&&n.ops.pop(),n.trys.pop();continue}v=t.call(e,n)}catch(S){v=[6,S],c=0}finally{a=h=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}},zZ=function(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,a=Object.getOwnPropertySymbols(e);c<a.length;c++)t.indexOf(a[c])<0&&Object.prototype.propertyIsEnumerable.call(e,a[c])&&(n[a[c]]=e[a[c]]);return n},jZ=function(e){return e??""},UZ=function(e){return e===""?null:e},qZ=function(e){var t=e.defaultValue,n=e.format,a=n===void 0?jZ:n,c=e.id,h=e.isRequired,f=e.name,o=e.onBlur,y=e.onChange,v=e.parse,S=v===void 0?UZ:v,P=e.source,M=e.validate,E=zZ(e,["defaultValue","format","id","isRequired","name","onBlur","onChange","parse","source","validate"]),O=iL(P),N=f||O,z=TZ(),U=EZ(),ee=_y(),ae=eb(S),W=_e.useId();!N&&process.env.NODE_ENV==="development"&&console.warn("Input components require either a source or a name prop."),_e.useEffect(function(){if(!(!U||z==null))return U.registerField(O,z),function(){U.unregisterField(O,z)}},[U,z,O]);var le=Array.isArray(M)?kZ(M):M,te=xZ(Dh({name:N,defaultValue:tg(ee,O,t),rules:{validate:function(Le,Pe){return FZ(void 0,void 0,void 0,function(){var Me;return BZ(this,function(Ze){switch(Ze.label){case 0:return le?[4,le(Le,Pe,Dh(Dh({},e),{finalSource:O}))]:[2,!0];case 1:return Me=Ze.sent(),Me?[2,"@@react-admin@@".concat(JSON.stringify(Me))]:[2,!0]}})})}}},E)),we=te.field,Te=te.fieldState,me=te.formState;CZ({inputProps:e});var Ve=eb(function(){for(var Le=[],Pe=0;Pe<arguments.length;Pe++)Le[Pe]=arguments[Pe];we.onBlur(),o&&o.apply(void 0,Le)}),re=eb(function(){for(var Le,Pe,Me,Ze,ut,ke=[],Xe=0;Xe<arguments.length;Xe++)ke[Xe]=arguments[Xe];var ge=e.type==="checkbox"&&((Pe=(Le=ke[0])===null||Le===void 0?void 0:Le.target)===null||Pe===void 0?void 0:Pe.value)==="on"?ke[0].target.checked:(ut=(Ze=(Me=ke[0])===null||Me===void 0?void 0:Me.target)===null||Ze===void 0?void 0:Ze.value)!==null&&ut!==void 0?ut:ke[0];we.onChange(ae?ae(ge):ge),y&&y.apply(void 0,ke)}),H=Dh(Dh({},we),{value:a?a(we.value):we.value,onBlur:Ve,onChange:re});return{id:c||W,field:H,fieldState:Te,formState:me,isRequired:h||OZ(M)}},nL=_e.createContext(void 0),$Z={getSource:function(e){return e},getLabel:function(e){return e}};nL.Provider;var VZ=function(){var e=_e.useContext(nL);return e||$Z},iL=function(e){var t=VZ();return t.getSource(e)},GZ=typeof window<"u"?Qt.useLayoutEffect:Qt.useEffect,eb=function(e){var t=Qt.useRef(function(){throw new Error("Cannot call an event handler while rendering.")});return GZ(function(){t.current=e}),_e.useCallback(function(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];return t.current.apply(t,n)},[])},sp={exports:{}},hP;function HZ(){if(hP)return sp.exports;hP=1,sp.exports=n,sp.exports.parse=n,sp.exports.stringify=a;var e=/[-+]?([0-9]*\.[0-9]+|[0-9]+)([eE][-+]?[0-9]+)?/,t=new RegExp("^"+e.source+"(\\s"+e.source+"){1,}");function n(c){var h=c.split(";"),f=h.pop(),o=(h.shift()||"").split("=").pop(),y=0;function v(te){var we=f.substring(y).match(te);return we?(y+=we[0].length,we[0]):null}function S(te){return te&&o.match(/\d+/)&&(te.crs={type:"name",properties:{name:"urn:ogc:def:crs:EPSG::"+o}}),te}function P(){v(/^\s*/)}function M(){P();for(var te=0,we=[],Te=[we],me=we,Ve;Ve=v(/^(\()/)||v(/^(\))/)||v(/^(,)/)||v(t);){if(Ve==="(")Te.push(me),me=[],Te[Te.length-1].push(me),te++;else if(Ve===")"){if(me.length===0||(me=Te.pop(),!me))return null;if(te--,te===0)break}else if(Ve===",")me=[],Te[Te.length-1].push(me);else if(!Ve.split(/\s/g).some(isNaN))Array.prototype.push.apply(me,Ve.split(/\s/g).map(parseFloat));else return null;P()}return te!==0?null:we}function E(){for(var te=[],we,Te;Te=v(t)||v(/^(,)/);)Te===","?(te.push(we),we=[]):Te.split(/\s/g).some(isNaN)||(we||(we=[]),Array.prototype.push.apply(we,Te.split(/\s/g).map(parseFloat))),P();if(we)te.push(we);else return null;return te.length?te:null}function O(){if(!v(/^(point(\sz)?)/i)||(P(),!v(/^(\()/)))return null;var te=E();return!te||(P(),!v(/^(\))/))?null:{type:"Point",coordinates:te[0]}}function N(){if(!v(/^(multipoint)/i))return null;P();var te=f.substring(f.indexOf("(")+1,f.length-1).replace(/\(/g,"").replace(/\)/g,"");f="MULTIPOINT ("+te+")";var we=M();return we?(P(),{type:"MultiPoint",coordinates:we}):null}function z(){if(!v(/^(multilinestring)/i))return null;P();var te=M();return te?(P(),{type:"MultiLineString",coordinates:te}):null}function U(){if(!v(/^(linestring(\sz)?)/i)||(P(),!v(/^(\()/)))return null;var te=E();return!te||!v(/^(\))/)?null:{type:"LineString",coordinates:te}}function ee(){if(!v(/^(polygon(\sz)?)/i))return null;P();var te=M();return te?{type:"Polygon",coordinates:te}:null}function ae(){if(!v(/^(multipolygon)/i))return null;P();var te=M();return te?{type:"MultiPolygon",coordinates:te}:null}function W(){var te=[],we;if(!v(/^(geometrycollection)/i)||(P(),!v(/^(\()/)))return null;for(;we=le();)te.push(we),P(),v(/^(,)/),P();return v(/^(\))/)?{type:"GeometryCollection",geometries:te}:null}function le(){return O()||U()||ee()||N()||z()||ae()||W()}return S(le())}function a(c){c.type==="Feature"&&(c=c.geometry);function h(S){return S.join(" ")}function f(S){return S.map(h).join(", ")}function o(S){return S.map(f).map(v).join(", ")}function y(S){return S.map(o).map(v).join(", ")}function v(S){return"("+S+")"}switch(c.type){case"Point":return"POINT ("+h(c.coordinates)+")";case"LineString":return"LINESTRING ("+f(c.coordinates)+")";case"Polygon":return"POLYGON ("+o(c.coordinates)+")";case"MultiPoint":return"MULTIPOINT ("+f(c.coordinates)+")";case"MultiPolygon":return"MULTIPOLYGON ("+y(c.coordinates)+")";case"MultiLineString":return"MULTILINESTRING ("+o(c.coordinates)+")";case"GeometryCollection":return"GEOMETRYCOLLECTION ("+c.geometries.map(a).join(", ")+")";default:throw new Error("stringify requires a valid GeoJSON Feature or geometry object as input")}}return sp.exports}var td=HZ();function Gb(e){const t=e?.source,n=_y(),a=qp({mapId:e?.mapId}),[c,h]=_e.useState(),[f,o]=_e.useState(),y=qZ(e),{field:{onChange:v}}=y;return _e.useEffect(()=>{if(typeof n>"u"||!n[t])return;const S={type:"Feature",properties:{},geometry:td.parse(n[t])};h(S),o(S)},[n,e.source]),_e.useEffect(()=>{if(a.map&&typeof n<"u"&&n[t]){const S=fM(td.parse(n[t]));S?.geometry?.coordinates&&a.map.setCenter(S.geometry.coordinates)}},[a.map]),Pr.jsxs(Pr.Fragment,{children:[e.embeddedMap&&Pr.jsx(m2,{...e?.MapLibreMapProps,options:{zoom:14,style:"https://wms.wheregroup.com/tileserver/style/klokantech-basic.json",center:Array.isArray(e?.MapLibreMapProps?.options?.center)&&e.MapLibreMapProps.options.center.length===2?[e.MapLibreMapProps.options.center[0],e.MapLibreMapProps.options.center[1]]:[0,0],...e?.MapLibreMapProps?.options},style:{width:"100%",height:"400px",...e?.MapLibreMapProps?.style}}),e.type==="point"&&Pr.jsxs(Pr.Fragment,{children:[f&&Pr.jsx(eg,{mapId:e?.mapId,geojson:f,options:{paint:{"circle-radius":8,"circle-color":"#6f6f96","circle-stroke-color":"white","circle-stroke-width":3,"circle-opacity":.8}},type:"circle",insertBeforeLayer:"gl-draw-polygon-fill-inactive.cold"}),Pr.jsx(H0,{mapId:e?.mapId,geojson:c,mode:c?"simple_select":"draw_point",onChange:S=>{typeof S[0]<"u"&&v(td.stringify(S[0]))}})]}),e.type==="polygon"&&Pr.jsxs(Pr.Fragment,{children:[f&&Pr.jsx(eg,{mapId:e?.mapId,geojson:f,options:{paint:{"fill-color":"#6f6f96","fill-opacity":.6}},type:"fill",insertBeforeLayer:"gl-draw-polygon-fill-inactive.cold"}),Pr.jsx(H0,{mapId:e?.mapId,geojson:c,mode:c?"simple_select":"draw_polygon",onChange:S=>{typeof S[0]<"u"&&v(td.stringify(S[0]))}})]}),e.type==="line"&&Pr.jsxs(Pr.Fragment,{children:[f&&Pr.jsx(eg,{mapId:e?.mapId,geojson:f,options:{paint:{"line-width":6,"line-color":"#6f6f96","line-opacity":.6}},type:"line",insertBeforeLayer:"gl-draw-polygon-fill-inactive.cold"}),Pr.jsx(H0,{mapId:e?.mapId,geojson:c,mode:c?"simple_select":"draw_line_string",onChange:S=>{typeof S[0]<"u"&&v(td.stringify(S[0]))}})]})]})}Gb.defaultProps={type:"point",embeddedMap:!0};function oL(e){return Pr.jsx(Pr.Fragment,{children:e.embeddedMap?Pr.jsx(iI,{children:Pr.jsx(Gb,{...e})}):Pr.jsx(Gb,{...e})})}oL.defaultProps={embeddedMap:!0};function fP(e){const t=e.source,n=_y(),a=qp(),[c,h]=_e.useState();return _e.useEffect(()=>{if(!n?.[t])return;const f=td.parse(n[t]);f&&h({type:"Feature",properties:{},geometry:f})},[n]),_e.useEffect(()=>{if(!a.map||!c)return;const f=fM(c);f?.geometry?.coordinates&&a.map.setCenter(f.geometry.coordinates)},[a.map,c]),Pr.jsxs(Pr.Fragment,{children:[e.embeddedMap&&Pr.jsx(m2,{...e?.MapLibreMapProps,options:{zoom:14,style:"https://wms.wheregroup.com/tileserver/style/klokantech-basic.json",center:[0,0],...e?.MapLibreMapProps?.options},style:{width:"100%",height:"400px",...e?.MapLibreMapProps?.style}}),c&&Pr.jsx(eg,{geojson:c})]})}function aL(e){return Pr.jsx(Pr.Fragment,{children:e.embeddedMap?Pr.jsx(iI,{children:Pr.jsx(fP,{...e})}):Pr.jsx(fP,{...e})})}aL.defaultProps={embeddedMap:!0};exports.GeospatialInput=oL;exports.GeospatialShow=aL;exports._typeof=Ui;exports.commonjsGlobal=vc;exports.getDefaultExportFromCjs=th;
1222
- //# sourceMappingURL=index-DD78QbMh.cjs.map
1222
+ //# sourceMappingURL=index-LFDbxU2K.cjs.map