@gramps-connect/story 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -4
- package/dist/editor.js +1710 -121
- package/dist/editor.js.map +4 -4
- package/dist/embed.js +1 -1
- package/dist/map-edit.js +361 -0
- package/dist/map-edit.js.map +7 -0
- package/dist/player.js +3 -1
- package/dist/player.js.map +2 -2
- package/dist/types/editor/MapEditor.d.ts +89 -0
- package/dist/types/editor/PlaceField.d.ts +4 -1
- package/dist/types/editor/PlaceMapDialog.d.ts +18 -0
- package/dist/types/editor/StoryEditor.d.ts +4 -1
- package/dist/types/editor/index.d.ts +4 -0
- package/dist/types/editor/mapEditorStrings.d.ts +50 -0
- package/dist/types/editor/placeShapes.d.ts +13 -0
- package/dist/types/editor/strings.d.ts +13 -0
- package/dist/types/mapEdit/geometry.d.ts +91 -0
- package/dist/types/mapEdit/index.d.ts +3 -0
- package/dist/types/mapEdit/mapFile.d.ts +77 -0
- package/dist/types/mapEdit/model.d.ts +55 -0
- package/package.json +18 -2
- package/src/editor/MapEditor.tsx +1545 -0
- package/src/editor/PlaceField.tsx +12 -2
- package/src/editor/PlaceMapDialog.tsx +228 -0
- package/src/editor/StoryEditor.tsx +24 -1
- package/src/editor/index.ts +6 -0
- package/src/editor/mapEditorStrings.ts +109 -0
- package/src/editor/placeShapes.ts +63 -0
- package/src/editor/strings.ts +27 -1
- package/src/mapEdit/geometry.ts +211 -0
- package/src/mapEdit/index.ts +15 -0
- package/src/mapEdit/mapFile.ts +199 -0
- package/src/mapEdit/model.ts +250 -0
- package/src/player/MapBackground.tsx +3 -1
package/dist/embed.js
CHANGED
|
@@ -821,7 +821,7 @@ uniform ${h} ${p} u_${d};
|
|
|
821
821
|
`),x=y.concat(dn.prelude.vertexSource,o.vertexSource,t.vertexSource).join(`
|
|
822
822
|
`),b=u.createShader(u.FRAGMENT_SHADER);if(u.isContextLost()){this.failedToCreate=!0;return}u.shaderSource(b,v),u.compileShader(b),u.attachShader(this.program,b);let w=u.createShader(u.VERTEX_SHADER);if(u.isContextLost()){this.failedToCreate=!0;return}u.shaderSource(w,x),u.compileShader(w),u.attachShader(this.program,w),this.attributes={};let T={};if(this.numAttributes=p.length,u.linkProgram(this.program),!u.getProgramParameter(this.program,u.LINK_STATUS)){if(u.isContextLost()||u.getProgramParameter(this.program,u.ATTACHED_SHADERS)===0){this.failedToCreate=!0;return}throw u.getShaderParameter(b,u.COMPILE_STATUS)?u.getShaderParameter(w,u.COMPILE_STATUS)?Error(`Program failed to link: ${u.getProgramInfoLog(this.program)}`):Error(`Could not compile vertex shader: ${u.getShaderInfoLog(w)}`):Error(`Could not compile fragment shader: ${u.getShaderInfoLog(b)}`)}RU(u,this.program);let S=JU(u,this.program);for(let E of p){if(!E)continue;let P=u.getAttribLocation(this.program,E);P>=0&&(this.attributes[E]={location:P,isInteger:S.has(E)})}u.deleteShader(w),u.deleteShader(b);for(let E of g)if(E&&!T[E]){let P=u.getUniformLocation(this.program,E);P&&(T[E]=P)}this.fixedUniforms=i(e,T),this.terrainUniforms=ZU(e,T),this.binderUniforms=r?r.getUniforms(e,T):[]}draw(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m,_,g,y){var b;let v=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.terrainUniformBuffer.bind(),e.frameUniformBuffer.bind(),e.setDepthMode(r),e.setStencilMode(i),e.setColorMode(n),e.setCullFace(a),s){e.activeTexture.set(v.TEXTURE2),v.bindTexture(v.TEXTURE_2D,s.depthTexture),e.activeTexture.set(v.TEXTURE3),v.bindTexture(v.TEXTURE_2D,s.texture);for(let w in this.terrainUniforms)this.terrainUniforms[w].set(s[w]);$U(e.terrainUniformBuffer,s)}if(BU(e,l),o)for(let w in this.fixedUniforms)this.fixedUniforms[w].set(o[w]);m&&m.setUniforms(e,this.binderUniforms,d,{zoom:f});let x=0;switch(t){case v.LINES:x=2;break;case v.TRIANGLES:x=3;break;case v.LINE_STRIP:x=1}for(let w of p.get())w.vaos||(w.vaos={}),(b=w.vaos)[u]||(b[u]=new GU),w.vaos[u].bind(e,this,c,m?m.getPaintVertexBuffers():[],h,w.vertexOffset,_,g,y),v.drawElements(t,w.primitiveLength*x,v.UNSIGNED_SHORT,w.primitiveOffset*x*2)}};function qP(e,t,r){let i=1/ii(r,1,t.tileZoom),n=2**r.tileID.overscaledZ,a=r.tileSize*2**t.tileZoom/n,o=a*(r.tileID.canonical.x+r.tileID.wrap*n),s=a*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[o&65535,s&65535]}}function t$(e,t,r,i,n){let a=r.getPattern(e.from.toString()),o=r.getPattern(e.to.toString()),{width:s,height:l}=r.getPixelSize(),u=2**n.tileID.overscaledZ,c=n.tileSize*2**i.tileZoom/u,h=c*(n.tileID.canonical.x+n.tileID.wrap*u),p=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[s,l],u_mix:t.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/ii(n,1,i.tileZoom),u_pixel_coord_upper:[h>>16,p>>16],u_pixel_coord_lower:[h&65535,p&65535]}}var r$=(e,t)=>({u_lightpos:new Pr(e,t.u_lightpos),u_lightpos_globe:new Pr(e,t.u_lightpos_globe),u_lightintensity:new q(e,t.u_lightintensity),u_lightcolor:new Pr(e,t.u_lightcolor),u_vertical_gradient:new q(e,t.u_vertical_gradient),u_opacity:new q(e,t.u_opacity),u_fill_translate:new _e(e,t.u_fill_translate)}),i$=(e,t)=>({u_lightpos:new Pr(e,t.u_lightpos),u_lightpos_globe:new Pr(e,t.u_lightpos_globe),u_lightintensity:new q(e,t.u_lightintensity),u_lightcolor:new Pr(e,t.u_lightcolor),u_vertical_gradient:new q(e,t.u_vertical_gradient),u_height_factor:new q(e,t.u_height_factor),u_opacity:new q(e,t.u_opacity),u_fill_translate:new _e(e,t.u_fill_translate),u_image:new te(e,t.u_image),u_texsize:new _e(e,t.u_texsize),u_pixel_coord_upper:new _e(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _e(e,t.u_pixel_coord_lower),u_scale:new Pr(e,t.u_scale),u_fade:new q(e,t.u_fade)}),GP=(e,t,r,i,n)=>{let a=bT(t.position),o=mT();t.anchor==="viewport"&&HM(o,e.bearingInRadians),nI(a,a,o);let s=e.transformLightDirection(a),l=t.color;return{u_lightpos:a,u_lightpos_globe:s,u_lightintensity:t.intensity,u_lightcolor:[l.r,l.g,l.b],u_vertical_gradient:+r,u_opacity:i,u_fill_translate:n}},n$=(e,t,r,i,n,a,o,s)=>J(GP(e,t,r,i,n),qP(o,e,s),{u_height_factor:-(2**a.overscaledZ)/s.tileSize/8}),a$=(e,t)=>({u_fill_translate:new _e(e,t.u_fill_translate)}),o$=(e,t)=>({u_image:new te(e,t.u_image),u_texsize:new _e(e,t.u_texsize),u_pixel_coord_upper:new _e(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _e(e,t.u_pixel_coord_lower),u_scale:new Pr(e,t.u_scale),u_fade:new q(e,t.u_fade),u_sdf_pattern:new te(e,t.u_sdf_pattern),u_fill_translate:new _e(e,t.u_fill_translate)}),s$=(e,t)=>({u_fill_translate:new _e(e,t.u_fill_translate)}),l$=(e,t)=>({u_image:new te(e,t.u_image),u_texsize:new _e(e,t.u_texsize),u_pixel_coord_upper:new _e(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _e(e,t.u_pixel_coord_lower),u_scale:new Pr(e,t.u_scale),u_fade:new q(e,t.u_fade),u_sdf_pattern:new te(e,t.u_sdf_pattern),u_fill_translate:new _e(e,t.u_fill_translate)}),ZP=(e,t,r,i,n)=>J(qP(t,e,r),{u_fill_translate:i,u_sdf_pattern:+!!n}),u$=e=>({u_fill_translate:e}),c$=e=>({u_fill_translate:e}),h$=(e,t,r,i,n)=>ZP(e,t,r,i,n),p$=(e,t)=>({u_scale_with_map:new te(e,t.u_scale_with_map),u_pitch_with_map:new te(e,t.u_pitch_with_map),u_extrude_scale:new _e(e,t.u_extrude_scale),u_globe_extrude_scale:new q(e,t.u_globe_extrude_scale),u_translate:new _e(e,t.u_translate)}),d$=(e,t,r,i,n)=>{let a,o,s=0;if(r.paint.get("circle-pitch-alignment")==="map"){let l=ii(t,1,e.zoom);a=!0,o=[l,l],s=l/(R*2**t.tileID.overscaledZ)*2*Math.PI*n}else a=!1,o=e.pixelsToGLUnits;return{u_scale_with_map:+(r.paint.get("circle-pitch-scale")==="map"),u_pitch_with_map:+a,u_extrude_scale:o,u_globe_extrude_scale:s,u_translate:i}},f$=(e,t)=>({u_color:new Ba(e,t.u_color),u_overlay:new te(e,t.u_overlay),u_overlay_scale:new q(e,t.u_overlay_scale)}),V6=(e,t=1)=>({u_color:e,u_overlay:0,u_overlay_scale:t}),m$=(e,t)=>({u_extrude_scale:new q(e,t.u_extrude_scale),u_intensity:new q(e,t.u_intensity),u_globe_extrude_scale:new q(e,t.u_globe_extrude_scale)}),g$=(e,t)=>({u_matrix:new Hi(e,t.u_matrix),u_image:new te(e,t.u_image),u_color_ramp:new te(e,t.u_color_ramp),u_opacity:new q(e,t.u_opacity)}),HP=(e,t,r,i)=>{let n=ii(e,1,t)/(R*2**e.tileID.overscaledZ)*2*Math.PI*i;return{u_extrude_scale:ii(e,1,t),u_intensity:r,u_globe_extrude_scale:n}},WP=(e,t,r,i)=>{let n=Do();return Ln(n,0,e.width,e.height,0,0,1),{u_matrix:n,u_image:r,u_color_ramp:i,u_opacity:t.paint.get("heatmap-opacity")}},y$=(e,t)=>({u_image:new te(e,t.u_image),u_latrange:new _e(e,t.u_latrange),u_exaggeration:new q(e,t.u_exaggeration),u_altitudes:new L5(e,t.u_altitudes),u_azimuths:new L5(e,t.u_azimuths),u_accent:new Ba(e,t.u_accent),u_method:new te(e,t.u_method),u_shadows:new R5(e,t.u_shadows),u_highlights:new R5(e,t.u_highlights)}),_$=(e,t)=>({u_matrix:new Hi(e,t.u_matrix),u_image:new te(e,t.u_image),u_dimension:new _e(e,t.u_dimension),u_zoom:new q(e,t.u_zoom),u_unpack:new Qs(e,t.u_unpack),u_log2_world_width:new q(e,t.u_log2_world_width)}),v$=(e,t,r)=>{let i=r.paint.get("hillshade-accent-color"),n;switch(r.paint.get("hillshade-method")){case"basic":n=4;break;case"combined":n=1;break;case"igor":n=2;break;case"multidirectional":n=3;break;default:n=0}let a=r.getIlluminationProperties();for(let o=0;o<a.directionRadians.length;o++)r.paint.get("hillshade-illumination-anchor")==="viewport"&&(a.directionRadians[o]+=e.bearingInRadians);return{u_image:0,u_latrange:w$(e,t.tileID),u_exaggeration:r.paint.get("hillshade-exaggeration"),u_altitudes:a.altitudeRadians,u_azimuths:a.directionRadians,u_accent:i,u_method:n,u_highlights:a.highlightColor,u_shadows:a.shadowColor}},x$=(e,t,r)=>{let i=r.stride,n=Do();return Ln(n,0,R,-8192,0,0,1),At(n,n,[0,-8192,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector(),u_log2_world_width:b$(e)}};function b$(e){let t=e.worldCoordinateHelper;return t.wraps?25.2562:Math.log2(t.metersPerWorldUnit(.5,.5))}function w$(e,t){let r=e.worldCoordinateHelper;if(!r.wraps)return[0,0];let i=2**t.canonical.z,n=t.canonical.y;return[r.lngLatFromWorld(0,n/i).lat,r.lngLatFromWorld(0,(n+1)/i).lat]}var T$=(e,t)=>({u_image:new te(e,t.u_image),u_unpack:new Qs(e,t.u_unpack),u_dimension:new _e(e,t.u_dimension),u_elevation_stops:new te(e,t.u_elevation_stops),u_color_stops:new te(e,t.u_color_stops),u_color_ramp_size:new te(e,t.u_color_ramp_size),u_opacity:new q(e,t.u_opacity)}),S$=(e,t,r=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:r,u_opacity:e.paint.get("color-relief-opacity")}),E$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_ratio:new q(e,t.u_ratio)}),C$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_ratio:new q(e,t.u_ratio),u_image:new te(e,t.u_image),u_image_height:new q(e,t.u_image_height)}),P$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_texsize:new _e(e,t.u_texsize),u_ratio:new q(e,t.u_ratio),u_image:new te(e,t.u_image),u_scale:new Pr(e,t.u_scale),u_fade:new q(e,t.u_fade)}),D$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_ratio:new q(e,t.u_ratio),u_image:new te(e,t.u_image),u_mix:new q(e,t.u_mix),u_tileratio:new q(e,t.u_tileratio),u_crossfade_from:new q(e,t.u_crossfade_from),u_crossfade_to:new q(e,t.u_crossfade_to),u_lineatlas_width:new q(e,t.u_lineatlas_width),u_lineatlas_height:new q(e,t.u_lineatlas_height)}),A$=(e,t)=>({u_translation:new _e(e,t.u_translation),u_ratio:new q(e,t.u_ratio),u_image:new te(e,t.u_image),u_image_height:new q(e,t.u_image_height),u_tileratio:new q(e,t.u_tileratio),u_crossfade_from:new q(e,t.u_crossfade_from),u_crossfade_to:new q(e,t.u_crossfade_to),u_image_dash:new te(e,t.u_image_dash),u_mix:new q(e,t.u_mix),u_lineatlas_width:new q(e,t.u_lineatlas_width),u_lineatlas_height:new q(e,t.u_lineatlas_height)}),If=(e,t,r,i)=>({u_translation:YP(e,t,r),u_ratio:i/ii(t,1,e.zoom)}),M$=(e,t,r,i,n)=>J(If(e,t,r,i),{u_image:0,u_image_height:n}),I$=(e,t,r,i,n)=>{let a=Wv(t,e);return{u_translation:YP(e,t,r),u_texsize:t.imageAtlasTexture.size,u_ratio:i/ii(t,1,e.zoom),u_image:0,u_scale:[a,n.fromScale,n.toScale],u_fade:n.t}},k$=(e,t,r,i,n,a)=>{let o=Wv(r,e);return J(If(e,r,i,n),{u_tileratio:o,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:t.width,u_lineatlas_height:t.height})},z$=(e,t,r,i,n,a,o)=>{let s=Wv(r,e);return J(If(e,r,i,n),{u_image:0,u_image_height:o,u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image_dash:1,u_mix:a.t,u_lineatlas_width:t.width,u_lineatlas_height:t.height})};function Wv(e,t){return 1/ii(e,1,t.tileZoom)}function YP(e,t,r){return Fa(e,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}var F$=(e,t)=>({u_image:new te(e,t.u_image),u_opacity:new q(e,t.u_opacity)}),R$=(e,t)=>({u_image:t,u_opacity:e}),L$=(e,t)=>({u_is_size_zoom_constant:new te(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new te(e,t.u_is_size_feature_constant),u_size_t:new q(e,t.u_size_t),u_size:new q(e,t.u_size),u_rotate_symbol:new te(e,t.u_rotate_symbol),u_label_plane_matrix:new Hi(e,t.u_label_plane_matrix),u_coord_matrix:new Hi(e,t.u_coord_matrix),u_is_text:new te(e,t.u_is_text),u_pitch_with_map:new te(e,t.u_pitch_with_map),u_is_along_line:new te(e,t.u_is_along_line),u_is_variable_anchor:new te(e,t.u_is_variable_anchor),u_texsize:new _e(e,t.u_texsize),u_texture:new te(e,t.u_texture),u_translation:new _e(e,t.u_translation),u_pitched_scale:new q(e,t.u_pitched_scale),u_is_offset:new te(e,t.u_is_offset),u_height_anchor_ground:new te(e,t.u_height_anchor_ground)}),B$=(e,t)=>({u_is_size_zoom_constant:new te(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new te(e,t.u_is_size_feature_constant),u_size_t:new q(e,t.u_size_t),u_size:new q(e,t.u_size),u_rotate_symbol:new te(e,t.u_rotate_symbol),u_label_plane_matrix:new Hi(e,t.u_label_plane_matrix),u_coord_matrix:new Hi(e,t.u_coord_matrix),u_is_text:new te(e,t.u_is_text),u_pitch_with_map:new te(e,t.u_pitch_with_map),u_is_along_line:new te(e,t.u_is_along_line),u_is_variable_anchor:new te(e,t.u_is_variable_anchor),u_texsize:new _e(e,t.u_texsize),u_texture:new te(e,t.u_texture),u_gamma_scale:new q(e,t.u_gamma_scale),u_is_halo:new te(e,t.u_is_halo),u_is_plain:new te(e,t.u_is_plain),u_translation:new _e(e,t.u_translation),u_pitched_scale:new q(e,t.u_pitched_scale),u_is_offset:new te(e,t.u_is_offset),u_height_anchor_ground:new te(e,t.u_height_anchor_ground)}),O$=(e,t)=>({u_is_size_zoom_constant:new te(e,t.u_is_size_zoom_constant),u_is_size_feature_constant:new te(e,t.u_is_size_feature_constant),u_size_t:new q(e,t.u_size_t),u_size:new q(e,t.u_size),u_rotate_symbol:new te(e,t.u_rotate_symbol),u_label_plane_matrix:new Hi(e,t.u_label_plane_matrix),u_coord_matrix:new Hi(e,t.u_coord_matrix),u_is_text:new te(e,t.u_is_text),u_pitch_with_map:new te(e,t.u_pitch_with_map),u_is_along_line:new te(e,t.u_is_along_line),u_is_variable_anchor:new te(e,t.u_is_variable_anchor),u_texsize:new _e(e,t.u_texsize),u_texsize_icon:new _e(e,t.u_texsize_icon),u_texture:new te(e,t.u_texture),u_texture_icon:new te(e,t.u_texture_icon),u_gamma_scale:new q(e,t.u_gamma_scale),u_is_halo:new te(e,t.u_is_halo),u_translation:new _e(e,t.u_translation),u_pitched_scale:new q(e,t.u_pitched_scale),u_is_offset:new te(e,t.u_is_offset),u_height_anchor_ground:new te(e,t.u_height_anchor_ground)}),XP=(e,t,r,i,n,a,o,s,l,u,c,h,p,d)=>({u_is_size_zoom_constant:+(e==="constant"||e==="source"),u_is_size_feature_constant:+(e==="constant"||e==="camera"),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_rotate_symbol:+r,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+i,u_is_along_line:n,u_is_variable_anchor:a,u_texsize:c,u_texture:0,u_translation:l,u_pitched_scale:h,u_is_offset:p,u_height_anchor_ground:+d}),KP=(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f,m)=>J(XP(e,t,r,i,n,a,s,l,u,c,h,d,f,m),{u_gamma_scale:i?Math.cos(o.pitch*Math.PI/180)*o.cameraToCenterDistance:1,u_is_halo:+!!p,u_is_plain:1}),j$=(e,t,r,i,n,a,o,s,l,u,c,h,p,d,f)=>J(KP(e,t,r,i,n,a,o,s,l,u,!0,c,!0,p,d,f),{u_texsize_icon:h,u_texture_icon:1}),N$=(e,t)=>({u_opacity:new q(e,t.u_opacity),u_color:new Ba(e,t.u_color)}),V$=(e,t)=>({u_opacity:new q(e,t.u_opacity),u_image:new te(e,t.u_image),u_pattern_tl_a:new _e(e,t.u_pattern_tl_a),u_pattern_br_a:new _e(e,t.u_pattern_br_a),u_pattern_tl_b:new _e(e,t.u_pattern_tl_b),u_pattern_br_b:new _e(e,t.u_pattern_br_b),u_texsize:new _e(e,t.u_texsize),u_mix:new q(e,t.u_mix),u_pattern_size_a:new _e(e,t.u_pattern_size_a),u_pattern_size_b:new _e(e,t.u_pattern_size_b),u_scale_a:new q(e,t.u_scale_a),u_scale_b:new q(e,t.u_scale_b),u_pixel_coord_upper:new _e(e,t.u_pixel_coord_upper),u_pixel_coord_lower:new _e(e,t.u_pixel_coord_lower),u_tile_units_to_pixels:new q(e,t.u_tile_units_to_pixels)}),U$=(e,t)=>({u_opacity:e,u_color:t}),$$=(e,t,r,i,n,a)=>J(t$(i,a,t,r,n),{u_opacity:e}),q$=(e,t)=>({u_sun_pos:new Pr(e,t.u_sun_pos),u_atmosphere_blend:new q(e,t.u_atmosphere_blend),u_globe_position:new Pr(e,t.u_globe_position),u_globe_radius:new q(e,t.u_globe_radius),u_inv_proj_matrix:new Hi(e,t.u_inv_proj_matrix)}),G$=(e,t,r,i,n)=>({u_sun_pos:e,u_atmosphere_blend:t,u_globe_position:r,u_globe_radius:i,u_inv_proj_matrix:n}),Z$=(e,t)=>({u_sky_color:new Ba(e,t.u_sky_color),u_horizon_color:new Ba(e,t.u_horizon_color),u_horizon:new _e(e,t.u_horizon),u_horizon_normal:new _e(e,t.u_horizon_normal),u_sky_horizon_blend:new q(e,t.u_sky_horizon_blend),u_sky_blend:new q(e,t.u_sky_blend),u_inv_proj_matrix:new Hi(e,t.u_inv_proj_matrix),u_globe_position:new Pr(e,t.u_globe_position),u_globe_radius:new q(e,t.u_globe_radius),u_atmosphere_blend:new q(e,t.u_atmosphere_blend)}),H$=(e,t,r)=>{let i=Math.cos(t.rollInRadians),n=Math.sin(t.rollInRadians),a=$u(t),o=t.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition,s=zP(t),l=yo(t.worldSize,t.center.lat);return{u_sky_color:e["sky-color"],u_horizon_color:e["horizon-color"],u_horizon:[(t.width/2-a*n)*r,(t.height/2+a*i)*r],u_horizon_normal:[-n,i],u_sky_horizon_blend:e["sky-horizon-blend"]*t.height/2*r,u_sky_blend:o,u_inv_proj_matrix:t.inverseProjectionMatrix,u_globe_position:s,u_globe_radius:l,u_atmosphere_blend:e["atmosphere-blend"]*FP(Ui(s)-l,l)}},Kp=(e,t)=>({}),W$={fillExtrusion:r$,fillExtrusionPattern:i$,fill:a$,fillPattern:o$,fillOutline:s$,fillOutlinePattern:l$,circle:p$,collisionBox:Kp,collisionCircle:Kp,debug:f$,depth:Kp,clippingMask:Kp,heatmap:m$,heatmapTexture:g$,hillshade:y$,hillshadePrepare:_$,colorRelief:T$,line:E$,lineGradient:C$,linePattern:P$,lineSDF:D$,lineGradientSDF:A$,layerOpacity:F$,raster:MB,symbolIcon:L$,symbolSDF:B$,symbolTextAndIcon:O$,background:N$,backgroundPattern:V$,terrain:HU,terrainDepth:WU,terrainHeight:YU,atmosphere:q$,sky:Z$},Y$=class{constructor(e){this.programs={},this.context=e}getProgram(e){var s;let t=e.programConfiguration?e.programConfiguration.cacheKey:"",r=`/${e.projectionShaderVariant.name}`,i=e.showOverdrawInspector?"/overdraw":"",n=e.useTerrain?"/terrain":"",a=e.defines?`/${e.defines.join("/")}`:"",o=e.name+t+r+i+n+a;return(s=this.programs)[o]||(s[o]=new e$(this.context,dn[e.name],e.programConfiguration,W$[e.name],e.showOverdrawInspector,e.useTerrain,e.projectionShaderVariant.prelude,e.projectionShaderVariant.define,e.defines)),this.programs[o]}destroy(){for(let e of Object.values(this.programs))e.program&&this.context.gl.deleteProgram(e.program);this.programs={}}},L1=7680,Ie=class{constructor(e,t,r,i,n,a){this.test=e,this.ref=t,this.mask=r,this.fail=i,this.depthFail=n,this.pass=a}};Ie.disabled=new Ie({func:519,mask:0},0,0,L1,L1,L1);var U6=1029,B1=2305,ke=class{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}};ke.disabled=new ke(!1,U6,B1),ke.backCCW=new ke(!0,U6,B1),ke.frontCCW=new ke(!0,1028,B1);var be=class{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}};be.ReadOnly=!1,be.ReadWrite=!0,be.disabled=new be(519,be.ReadOnly,[0,1]);var Qp;function $6(e,t,r,i,n){let a=n.context,o=a.gl,s=n.useProgram("collisionBox"),l=[],u=0,c=0;for(let _ of r){let g=e.getTile(_).getBucket(t);if(!g)continue;let y=i?g.textCollisionBox:g.iconCollisionBox,v=g.collisionCircleArray;v.length>0&&(l.push({circleArray:v,circleOffset:c,coord:_}),u+=v.length/4,c=u),y&&s.draw(a,o.LINES,be.disabled,Ie.disabled,n.colorModeForRenderPass(),ke.disabled,null,n.getTerrainDataForTile(_),n.getProjectionDataForTile(_),t.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,n.transform.zoom,null,null,y.collisionVertexBuffer)}if(!i||!l.length)return;let h=n.useProgram("collisionCircle"),p=new Tz;p.resize(u*4),p._trim();let d=0;for(let _ of l)for(let g=0;g<_.circleArray.length/4;g++){let y=g*4,v=_.circleArray[y+0],x=_.circleArray[y+1],b=_.circleArray[y+2],w=_.circleArray[y+3];p.emplace(d++,v,x,b,w,0),p.emplace(d++,v,x,b,w,1),p.emplace(d++,v,x,b,w,2),p.emplace(d++,v,x,b,w,3)}(!Qp||Qp.length<u*2)&&(Qp=X$(u));let f=a.createIndexBuffer(Qp,!0),m=a.createVertexBuffer(p,IF.members,!0);for(let _ of l)h.draw(a,o.TRIANGLES,be.disabled,Ie.disabled,n.colorModeForRenderPass(),ke.disabled,null,n.getTerrainDataForTile(_.coord),null,t.id,m,f,ct.simpleSegment(0,_.circleOffset*2,_.circleArray.length,_.circleArray.length/2),null,n.transform.zoom,null,null,null);m.destroy(),f.destroy()}function X$(e){let t=e*2,r=new Ez;r.resize(t),r._trim();for(let i=0;i<t;i++){let n=i*6;r.uint16[n+0]=i*4+0,r.uint16[n+1]=i*4+1,r.uint16[n+2]=i*4+2,r.uint16[n+3]=i*4+2,r.uint16[n+4]=i*4+3,r.uint16[n+5]=i*4+0}return r}var K$=Gi(new Float32Array(16));function Q$(e,t,r,i,n){if(n.currentPass!=="translucent")return;let a=Ie.disabled,o=n.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&eq(i,r,t,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),n),r.paint.get("icon-opacity").constantOr(1)!==0&&q6(e,t,r,i,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment").constantOr("viewport"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,o,n),r.paint.get("text-opacity").constantOr(1)!==0&&q6(e,t,r,i,!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"),a,o,n),t.map.showCollisionBoxes&&($6(t,r,i,!0,n),$6(t,r,i,!1,n))}function J$(e,t,r,i,n,a){let{horizontalAlign:o,verticalAlign:s}=Tf(e),l=-(o-.5)*t,u=-(s-.5)*r;return new k((l/n+i[0])*a,(u/n+i[1])*a)}function eq(e,t,r,i,n,a,o,s){let l=s.transform,u=s.terrain,c=s.data.variableOffsets,h=i==="map",p=n==="map";for(let d of e){let f=r.getTile(d),m=f.getBucket(t);if(!m?.text?.segments.get().length)continue;let _=m.textSizeData,g=Sf(_,l.zoom),y=jv(h,l,ii(f,1,l.zoom)),v=t.layout.get("icon-text-fit")!=="none"&&m.hasIconData();if(g){let x=2**(l.zoom-f.tileID.overscaledZ),b=u?(w,T)=>u.getElevation(d,w,T):void 0;rq(m,h,p,c,l,y,x,g,v,Fa(l,f,a,o),d.toUnwrapped(),b,t.layout.get("symbol-height-anchor")==="ground")}}}function tq(e,t,r,i,n,a){let o=t.tileAnchorPoint.add(new k(t.translation[0],t.translation[1]));if(t.pitchWithMap){let s=i.mult(a);r||(s=s.rotate(-n));let l=o.add(s);return Vv(l.x,l.y,t.pitchedLabelPlaneMatrix,Eo(t,l.x,l.y)).point}if(r){let s=Co(t.tileAnchorPoint.x+1,t.tileAnchorPoint.y,t).point.sub(e),l=Math.atan(s.y/s.x)+(s.x<0?Math.PI:0);return e.add(i.rotate(l))}return e.add(i)}function rq(e,t,r,i,n,a,o,s,l,u,c,h,p){let d=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,m=e.icon.dynamicLayoutVertexArray,_={};f.clear();for(let g=0;g<d.length;g++){let y=d.get(g),v=e.allowVerticalPlacement&&!y.placedOrientation,x=!y.hidden&&y.crossTileID&&!v?i[y.crossTileID]:null;if(!x)$s(y.numGlyphs,f);else{let b=new k(y.anchorX,y.anchorY),w={getElevation:h,heightOffset:y.heightOffset,heightAnchorGround:p,width:n.width,height:n.height,pitchedLabelPlaneMatrix:a,lineVertexArray:null,pitchWithMap:r,transform:n,projectionCache:null,tileAnchorPoint:b,translation:u,unwrappedTileID:c},T=r?vP(b.x,b.y,w):Co(b.x,b.y,w),S=gP(n.cameraToCenterDistance,T.signedDistanceFromCamera),E=yv(e.textSizeData,s,y)*S/24;r&&(E*=e.tilePixelRatio/o);let{width:P,height:D,anchor:F,textOffset:I,textBoxScale:C}=x,A=J$(F,P,D,I,C,E),M=n.getPitchedTextCorrection(b.x+u[0],b.y+u[1],c),L=tq(T.point,w,t,A,-n.bearingInRadians,M),j=e.allowVerticalPlacement&&y.placedOrientation===2?Math.PI/2:0;for(let O=0;O<y.numGlyphs;O++)$d(f,L,j);l&&y.associatedIconIndex>=0&&(_[y.associatedIconIndex]={shiftedAnchor:L,angle:j})}}if(l){m.clear();let g=e.icon.placedSymbolArray;for(let y=0;y<g.length;y++){let v=g.get(y);if(v.hidden)$s(v.numGlyphs,m);else{let x=_[y];if(!x)$s(v.numGlyphs,m);else for(let b=0;b<v.numGlyphs;b++)$d(m,x.shiftedAnchor,x.angle)}}e.icon.dynamicLayoutVertexBuffer.updateData(m)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function iq(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function q6(e,t,r,i,n,a,o,s,l,u,c,h,p){let d=p.context,f=d.gl,m=p.transform,_=s==="map",g=l==="map",y=s!=="viewport"&&r.layout.get("symbol-placement")!=="point",v=_&&!g&&!y,x=!r.layout.get("symbol-sort-key").isConstant(),b=!1,w=p.getDepthModeForSublayer(0,be.ReadOnly),T=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),S=[],E=m.getCircleRadiusCorrection();for(let F of i){let I=t.getTile(F),C=I.getBucket(r);if(!C)continue;let A=n?C.text:C.icon;if(!A?.segments.get().length||!A.hasVisibleVertices)continue;let M=A.programConfigurations.get(r.id),L=n||C.sdfIcons,j=n?C.textSizeData:C.iconSizeData,O=g||m.pitch!==0,Y=p.useProgram(iq(L,n,C),M),ue=Sf(j,m.zoom),pe=p.getTerrainDataForTile(F),de,je=[0,0],Se,ae,oe=null,$e;if(n){if(Se=I.glyphAtlasTexture,ae=f.LINEAR,de=I.glyphAtlasTexture.size,C.iconsInText){je=I.imageAtlasTexture.size,oe=I.imageAtlasTexture;let Z=j.kind==="composite"||j.kind==="camera";$e=O||p.data.rotating||p.data.zooming||Z?f.LINEAR:f.NEAREST}}else{let Z=r.layout.get("icon-size").constantOr(0)!==1||C.iconsNeedLinear;Se=I.imageAtlasTexture,ae=L||p.data.rotating||p.data.zooming||Z||O?f.LINEAR:f.NEAREST,de=I.imageAtlasTexture.size}let qe=ii(I,1,p.transform.zoom),mt=jv(_,p.transform,qe),Et=QN(g,_,p.transform,qe),kt=Fa(m,I,a,o),st=p.getProjectionDataForTile(F),Ur=T&&C.hasTextData(),Di=r.layout.get("icon-text-fit")!=="none"&&Ur&&C.hasIconData(),ni=r._unevaluatedLayout.hasValue("icon-offset"),W=r.layout.get("symbol-height-anchor")==="ground";if(y){let Z=Do();WN(Z,mt);let Ee=p.terrain?(Ze,Ae)=>p.terrain.getElevation(F,Ze,Ae):void 0;eV(C,e,m,n,mt,Z,g,u,r.layout.get("text-rotation-alignment")==="map",F.toUnwrapped(),kt,Ee)}let ye=n&&T||Di,se=g?mt:p.transform.clipSpaceToPixelsMatrix,N=y||ye?K$:se,De=L&&r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(1)!==0,X;X=L?C.iconsInText?j$(j.kind,ue,v,g,y,ye,m,N,Et,kt,de,je,E,ni,W):KP(j.kind,ue,v,g,y,ye,m,N,Et,kt,n,de,De,E,ni,W):XP(j.kind,ue,v,g,y,ye,N,Et,kt,n,de,E,ni,W);let ie={program:Y,buffers:A,uniformValues:X,projectionData:st,atlasTexture:Se,atlasTextureIcon:oe,atlasInterpolation:ae,atlasInterpolationIcon:$e,isSDF:L,hasHalo:De};if(x&&C.canOverlap){b=!0;let Z=A.segments.get();for(let Ee of Z)S.push({segments:new ct([Ee]),sortKey:Ee.sortKey,state:ie,terrainData:pe})}else S.push({segments:A.segments,sortKey:0,state:ie,terrainData:pe})}b&&S.sort((F,I)=>F.sortKey-I.sortKey);let P=r.paint.get(n?"text-halo-width":"icon-halo-width").constantOr(null)??1/0,D=r.layout.get("text-letter-spacing").constantOr(0)*24<0||P>1;for(let F of S){let I=F.state;d.activeTexture.set(f.TEXTURE0),I.atlasTexture.bind(I.atlasInterpolation,f.CLAMP_TO_EDGE),I.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),I.atlasTextureIcon&&I.atlasTextureIcon.bind(I.atlasInterpolationIcon,f.CLAMP_TO_EDGE));let C=I.isSDF&&I.hasHalo;if(C){let A=I.uniformValues;A.u_is_halo=1,D&&(A.u_is_plain=0,G6(I.buffers,F.segments,r,p,I.program,w,c,h,A,I.projectionData,F.terrainData),A.u_is_halo=0,A.u_is_plain=1)}G6(I.buffers,F.segments,r,p,I.program,w,c,h,I.uniformValues,I.projectionData,F.terrainData),C&&!D&&(I.uniformValues.u_is_halo=0)}}function G6(e,t,r,i,n,a,o,s,l,u,c){let h=i.context,p=h.gl;n.draw(h,p.TRIANGLES,a,o,s,ke.backCCW,l,c,u,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,i.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function nq(e,t,r,i){if(i.currentPass!=="translucent")return;let n=t.paint.get("circle-opacity"),a=t.paint.get("circle-stroke-width"),o=t.paint.get("circle-stroke-opacity"),s=!t.layout.get("circle-sort-key").isConstant();if(n.constantOr(1)===0&&(a.constantOr(1)===0||o.constantOr(1)===0))return;let l=i.context,u=l.gl,c=i.transform,h=i.getDepthModeForSublayer(0,be.ReadOnly),p=Ie.disabled,d=i.colorModeForRenderPass(),f=[],m=c.getCircleRadiusCorrection();for(let _ of r){let g=e.getTile(_),y=g.getBucket(t);if(!y)continue;let v=Fa(c,g,t.paint.get("circle-translate"),t.paint.get("circle-translate-anchor")),x=y.programConfigurations.get(t.id),b=i.useProgram("circle",x),w=y.layoutVertexBuffer,T=y.indexBuffer,S=i.getTerrainDataForTile(_),E={programConfiguration:x,program:b,layoutVertexBuffer:w,indexBuffer:T,uniformValues:d$(c,g,t,v,m),terrainData:S,projectionData:i.getProjectionDataForTile(_)};if(s){let P=y.segments.get();for(let D of P)f.push({segments:new ct([D]),sortKey:D.sortKey,state:E})}else f.push({segments:y.segments,sortKey:0,state:E})}s&&f.sort((_,g)=>_.sortKey-g.sortKey);for(let _ of f){let{programConfiguration:g,program:y,layoutVertexBuffer:v,indexBuffer:x,uniformValues:b,terrainData:w,projectionData:T}=_.state,S=_.segments;y.draw(l,u.TRIANGLES,h,p,d,ke.backCCW,b,w,T,t.id,v,x,S,t.paint,i.transform.zoom,g)}}function aq(e,t,r,i,n){if(r.paint.get("heatmap-opacity")===0)return;let a=n.context;if(n.terrain){for(let o of i){let s=t.getTile(o);t.hasRenderableParent(o)||(n.currentPass==="offscreen"?lq(s,r,o,n):n.currentPass==="translucent"&&uq(e,r,o,n))}a.viewport.set([0,0,e.width,e.height])}else n.currentPass==="offscreen"?oq(e,t,r,i,n):n.currentPass==="translucent"&&sq(e,r,n)}function oq(e,t,r,i,n){let a=n.context,o=a.gl,s=n.transform,l=Ie.disabled,u=new vt([o.ONE,o.ONE],he.transparent,[!0,!0,!0,!0]);cq(a,e,r),a.clear({color:he.transparent});for(let c of i){if(t.hasRenderableParent(c))continue;let h=t.getTile(c),p=h.getBucket(r);if(!p)continue;let d=p.programConfigurations.get(r.id),f=n.useProgram("heatmap",d),m=n.getProjectionDataForTile(c,{applyTerrainMatrix:!1}),_=s.getCircleRadiusCorrection();f.draw(a,o.TRIANGLES,be.disabled,l,u,ke.backCCW,HP(h,s.zoom,r.paint.get("heatmap-intensity"),_),null,m,r.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,r.paint,s.zoom,d)}a.viewport.set([0,0,e.width,e.height])}function sq(e,t,r){let i=r.context,n=i.gl;i.setColorMode(r.colorModeForRenderPass());let a=t.heatmapFbos.get(Fd);a&&(i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1),JP(i,t).bind(n.LINEAR,n.CLAMP_TO_EDGE),r.useProgram("heatmapTexture").draw(i,n.TRIANGLES,be.disabled,Ie.disabled,r.colorModeForRenderPass(),ke.disabled,WP(e,t,0,1),null,null,t.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,t.paint,r.transform.zoom))}function lq(e,t,r,i){let n=i.context,a=n.gl,o=Ie.disabled,s=new vt([a.ONE,a.ONE],he.transparent,[!0,!0,!0,!0]),l=e.getBucket(t);if(!l)return;let u=r.key,c=t.heatmapFbos.get(u);c||(c=QP(n,e.tileSize,e.tileSize),t.heatmapFbos.set(u,c)),n.bindFramebuffer.set(c.framebuffer),n.viewport.set([0,0,e.tileSize,e.tileSize]),n.clear({color:he.transparent});let h=l.programConfigurations.get(t.id),p=i.useProgram("heatmap",h,!i.data.isRenderingGlobe),d=i.getProjectionDataForTile(e.tileID),f=i.getTerrainDataForTile(r);p.draw(n,a.TRIANGLES,be.disabled,o,s,ke.disabled,HP(e,i.transform.zoom,t.paint.get("heatmap-intensity"),1),f,d,t.id,l.layoutVertexBuffer,l.indexBuffer,l.segments,t.paint,i.transform.zoom,h)}function uq(e,t,r,i){let n=i.context,a=n.gl,o=i.transform;n.setColorMode(i.colorModeForRenderPass());let s=JP(n,t),l=r.key,u=t.heatmapFbos.get(l);if(!u)return;n.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,u.colorAttachment.get()),n.activeTexture.set(a.TEXTURE1),s.bind(a.LINEAR,a.CLAMP_TO_EDGE);let c=i.getProjectionDataForTile(r,{applyTerrainMatrix:i.data.isRenderingGlobe});i.useProgram("heatmapTexture").draw(n,a.TRIANGLES,be.disabled,Ie.disabled,i.colorModeForRenderPass(),ke.disabled,WP(e,t,0,1),null,c,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,o.zoom),u.destroy(),t.heatmapFbos.delete(l)}function cq(e,t,r){let i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);let n=r.heatmapFbos.get(Fd);n?(i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),e.bindFramebuffer.set(n.framebuffer)):(n=QP(e,t.width/4,t.height/4),r.heatmapFbos.set(Fd,n))}function QP(e,t,r){let i=e.gl,n=i.createTexture();i.bindTexture(i.TEXTURE_2D,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texStorage2D(i.TEXTURE_2D,1,i.RGBA16F,t,r);let a=e.createFramebuffer(t,r,!1,!1);return a.colorAttachment.set(n),a}function JP(e,t){return t.colorRampTexture||(t.colorRampTexture=new Ot(e,t.colorRamp,e.gl.RGBA)),t.colorRampTexture}function eD(e,t,r,i){let n=i.context,a=n.bindFramebuffer.get(),o=n.viewport.get(),[,,s,l]=o;return hq(e,s,l),n.viewport.set([0,0,s,l]),n.clear({color:he.transparent,depth:1,stencil:0}),i.invalidateTileClippingMasks(),i.renderTileClippingMasks(t,r),{compositeTarget:a,compositeViewport:o}}function hq(e,t,r){let i=e.context.gl;if(!e.layerOpacityFbo){let a=e.context.createFramebuffer(t,r,!0,!0),o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,r,0,i.RGBA,i.UNSIGNED_BYTE,null),a.colorAttachment.set(o),a.depthAttachment.set(e.context.createRenderbuffer(i.DEPTH_STENCIL,t,r)),e.layerOpacityFbo=a,e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}if(e.layerOpacityFbo.width===t&&e.layerOpacityFbo.height===r){e.context.bindFramebuffer.set(e.layerOpacityFbo.framebuffer);return}let n=e.layerOpacityFbo;i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),i.texImage2D(i.TEXTURE_2D,0,i.RGBA,t,r,0,i.RGBA,i.UNSIGNED_BYTE,null),e.context.bindRenderbuffer.set(n.depthAttachment.get()),i.renderbufferStorage(i.RENDERBUFFER,i.DEPTH_STENCIL,t,r),e.context.bindRenderbuffer.set(null),n.width=t,n.height=r,e.context.bindFramebuffer.set(n.framebuffer)}function tD(e,t,r,i,n){let a=n.context,o=a.gl;a.bindFramebuffer.set(r.compositeTarget),a.viewport.set(r.compositeViewport),a.activeTexture.set(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,e.layerOpacityFbo.colorAttachment.get()),n.useProgram("layerOpacity").draw(a,o.TRIANGLES,be.disabled,Ie.disabled,n.colorModeForRenderPass(),ke.disabled,R$(t,0),null,null,i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,n.transform.zoom),n.invalidateTileClippingMasks()}function rD(e,t,r,i,n,a,o,s){let l=256;if(i.stepInterpolant){let u=e.getSource().maxzoom,c=a.canonical.z===u?Math.ceil(1<<s.transform.maxZoom-a.canonical.z):1;l=Q(CI(n.maxLineLength/R*1024*c),256,t.maxTextureSize)}return o.gradient=EE({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:o.gradient||void 0,clips:n.lineClipsArray}),o.texture?o.texture.update(o.gradient):o.texture=new Ot(t,o.gradient,r.RGBA),o.version=i.gradientVersion,o.texture}function pq(e,t,r,i,n){e.activeTexture.set(t.TEXTURE0),r.imageAtlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE),i.updatePaintBuffers(n)}function dq(e,t,r,i,n,a){(n||e.lineAtlas.dirty)&&(t.activeTexture.set(r.TEXTURE0),e.lineAtlas.bind(t)),i.updatePaintBuffers(a)}function fq(e,t,r,i,n,a,o){let s=n.gradients[i.id],l=s.texture;i.gradientVersion!==s.version&&(l=rD(e,t,r,i,n,a,s,o)),t.activeTexture.set(r.TEXTURE0),l.bind(i.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}function mq(e,t,r,i,n,a,o,s,l,u){let c=a.gradients[n.id],h=c.texture;n.gradientVersion!==c.version&&(h=rD(t,r,i,n,a,o,c,u)),r.activeTexture.set(i.TEXTURE0),h.bind(n.stepInterpolant?i.NEAREST:i.LINEAR,i.CLAMP_TO_EDGE),r.activeTexture.set(i.TEXTURE1),e.lineAtlas.bind(r),s.updatePaintBuffers(l)}function gq(e,t,r,i,n){if(n.currentPass!=="translucent")return;let a=r.paint.get("line-opacity"),o=r.paint.get("line-width"),s=r.paint.get("line-layer-opacity");if(a.constantOr(1)!==0&&o.constantOr(1)!==0&&s!==0)if(s<1){let l=eD(e,r,i,n);Z6(e,t,r,i,n),tD(e,s,l,r,n)}else Z6(e,t,r,i,n)}function Z6(e,t,r,i,n){let a=n.getDepthModeForSublayer(0,be.ReadOnly),o=n.colorModeForRenderPass(),s=r.paint.get("line-dasharray"),l=s.constantOr(1),u=r.paint.get("line-pattern"),c=u.constantOr(1),h=r.paint.get("line-gradient"),p=r.getCrossfadeParameters(),d;d=c?"linePattern":l&&h?"lineGradientSDF":l?"lineSDF":h?"lineGradient":"line";let f=n.context,m=f.gl,_=n.transform,g=!0;for(let y of i){let v=t.getTile(y);if(c&&!v.patternsLoaded())continue;let x=v.getBucket(r);if(!x)continue;let b=x.programConfigurations.get(r.id),w=f.program.get(),T=n.useProgram(d,b),S=g||T.program!==w,E=n.getTerrainDataForTile(y),P=u.constantOr(null),D=s?.constantOr(null);if(P&&v.imageAtlas){let M=v.imageAtlas,L=M.patternPositions[P.to.toString()],j=M.patternPositions[P.from.toString()];L&&j&&b.setConstantPatternPositions(L,j)}else if(D){let M=r.layout.get("line-cap").constantOr(null)==="round",L=e.lineAtlas.getDash(D.to,M),j=e.lineAtlas.getDash(D.from,M);b.setConstantDashPositions(L,j)}let F=n.getProjectionDataForTile(y),I=_.getPixelScale(),C;c?(C=I$(_,v,r,I,p),pq(f,m,v,b,p)):l&&h?(C=z$(_,e.lineAtlas,v,r,I,p,x.lineClipsArray.length),mq(e,t,f,m,r,x,y,b,p,n)):l?(C=k$(_,e.lineAtlas,v,r,I,p),dq(e,f,m,b,S,p)):h?(C=M$(_,v,r,I,x.lineClipsArray.length),fq(t,f,m,r,x,y,n)):C=If(_,v,r,I);let A=n.stencilModeForClipping(y);T.draw(f,m.TRIANGLES,a,A,o,ke.disabled,C,E,F,r.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,r.paint,n.transform.zoom,b,x.layoutVertexBuffer2),g=!1}}function iD(e,t,r,i,n){if(!r||!i?.imageAtlas)return;let a=i.imageAtlas.patternPositions,o=a[r.to.toString()],s=a[r.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let l=n.getPaintProperty(t);o=a[l],s=a[l]}o&&s&&e.setConstantPatternPositions(o,s)}function yq(e,t,r,i,n){let a=r.paint.get("fill-color"),o=r.paint.get("fill-opacity"),s=r.paint.get("fill-layer-opacity");if(o.constantOr(1)===0||s===0)return;if(s<1){if(n.currentPass!=="translucent")return;let c=eD(e,r,i,n);H6(t,r,i,n),tD(e,s,c,r,n);return}let l=r.paint.get("fill-pattern"),u=n.opaquePassEnabledForLayer()&&!l.constantOr(1)&&a.constantOr(he.transparent).a===1&&o.constantOr(0)===1;if(u&&n.currentPass==="opaque"){let c=n.colorModeForRenderPass();Yv(t,r,i,n.getDepthModeForSublayer(1,be.ReadWrite),c,!1,n)}else u&&n.currentPass==="translucent"?nD(t,r,i,n):n.currentPass==="translucent"&&H6(t,r,i,n)}function H6(e,t,r,i){let n=i.colorModeForRenderPass();Yv(e,t,r,i.getDepthModeForSublayer(1,be.ReadOnly),n,!1,i),nD(e,t,r,i)}function nD(e,t,r,i){if(!t.paint.get("fill-antialias"))return;let n=i.colorModeForRenderPass();Yv(e,t,r,i.getDepthModeForSublayer(t.getPaintProperty("fill-outline-color")?2:0,be.ReadOnly),n,!0,i)}function Yv(e,t,r,i,n,a,o){let s=o.context,l=s.gl,u="fill-pattern",c=t.paint.get(u),h=c?.constantOr(1),p=t.getCrossfadeParameters(),d,f,m,_,g,y=o.transform,v=t.paint.get("fill-translate"),x=t.paint.get("fill-translate-anchor");a?(f=h&&!t.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=l.LINES):(f=h?"fillPattern":"fill",d=l.TRIANGLES);let b=c.constantOr(null);for(let w of r){let T=e.getTile(w);if(h&&!T.patternsLoaded())continue;let S=T.getBucket(t);if(!S)continue;let E=S.sdfPatterns[t.id]??!1,P=S.programConfigurations.get(t.id),D=o.useProgram(f,P),F=o.getTerrainDataForTile(w);h&&(s.activeTexture.set(l.TEXTURE0),T.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),P.updatePaintBuffers(p)),iD(P,u,b,T,t);let I=o.getProjectionDataForTile(w),C=Fa(y,T,v,x);a?(_=S.indexBuffer2,g=S.segments2,m=f==="fillOutlinePattern"&&h?h$(y,p,T,C,E):c$(C)):(_=S.indexBuffer,g=S.segments,m=h?ZP(y,p,T,C,E):u$(C));let A=o.stencilModeForClipping(w);D.draw(s,d,i,A,n,ke.backCCW,m,F,I,t.id,S.layoutVertexBuffer,_,g,t.paint,o.transform.zoom,P)}}function _q(e,t,r,i){let n=t.paint.get("fill-extrusion-opacity");if(n!==0&&i.currentPass==="translucent"){let a=new be(i.context.gl.LEQUAL,be.ReadWrite,i.depthRangeFor3D);if(n===1&&!t.paint.get("fill-extrusion-pattern").constantOr(1)){let o=i.colorModeForRenderPass();O1(e,t,r,a,Ie.disabled,o,i)}else O1(e,t,r,a,Ie.disabled,vt.disabled,i),O1(e,t,r,a,i.stencilModeFor3D(),i.colorModeForRenderPass(),i)}}function O1(e,t,r,i,n,a,o){let s=o.context,l=s.gl,u="fill-extrusion-pattern",c=t.paint.get(u),h=c.constantOr(1),p=t.getCrossfadeParameters(),d=t.paint.get("fill-extrusion-opacity"),f=c.constantOr(null),m=o.transform;for(let _ of r){let g=e.getTile(_),y=g.getBucket(t);if(!y)continue;let v=o.getTerrainDataForTile(_),x=y.programConfigurations.get(t.id),b=o.useProgram(h?"fillExtrusionPattern":"fillExtrusion",x);h&&(s.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),x.updatePaintBuffers(p));let w=o.getProjectionDataForTile(_);iD(x,u,f,g,t);let T=Fa(m,g,t.paint.get("fill-extrusion-translate"),t.paint.get("fill-extrusion-translate-anchor")),S=t.paint.get("fill-extrusion-vertical-gradient"),E=h?n$(m,o.data.light,S,d,T,_,p,g):GP(m,o.data.light,S,d,T);b.draw(s,s.gl.TRIANGLES,i,n,a,ke.backCCW,E,v,w,t.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,t.paint,o.transform.zoom,x,o.terrain&&y.centroidVertexBuffer)}}function vq(e,t,r,i,n){if(n.currentPass!=="offscreen"&&n.currentPass!=="translucent")return;let a=n.context,{useSubdivision:o}=n.data,s=n.getDepthModeForSublayer(0,be.ReadOnly),l=n.colorModeForRenderPass();if(n.currentPass==="offscreen")xq(e,t,i,r,s,Ie.disabled,l,n),a.viewport.set([0,0,e.width,e.height]);else if(n.currentPass==="translucent")if(o){let[u,c,h]=n.stencilConfigForOverlapTwoPass(i);j1(t,r,h,u,s,l,!1,n),j1(t,r,h,c,s,l,!0,n)}else{let[u,c]=n.getStencilConfigForOverlapAndUpdateStencilID(i);j1(t,r,c,u,s,l,!1,n)}}function j1(e,t,r,i,n,a,o,s){let l=s.context,u=l.gl,c=[`#define NUM_ILLUMINATION_SOURCES ${t.paint.get("hillshade-highlight-color").values.length}`],h=s.useProgram("hillshade",null,!1,c),p=!s.data.moving;for(let d of r){let f=e.getTile(d),m=f.fbo;if(!m)continue;let _=s.getMeshFromTileID(d.canonical,o,!0,"raster"),g=s.getTerrainDataForTile(d);l.activeTexture.set(u.TEXTURE0),u.bindTexture(u.TEXTURE_2D,m.colorAttachment.get());let y=s.getProjectionDataForTile(d,{aligned:p});h.draw(l,u.TRIANGLES,n,i[d.overscaledZ],a,ke.backCCW,v$(s.transform,f,t),g,y,t.id,_.vertexBuffer,_.indexBuffer,_.segments)}}function xq(e,t,r,i,n,a,o,s){let l=s.context,u=l.gl,c=i.paint.get("resampling")==="nearest"?u.NEAREST:u.LINEAR;for(let h of r){let p=t.getTile(h),d=p.dem;if(!d?.data||!p.needsHillshadePrepare)continue;let f=d.dim+2,m=d.stride,_=d.getPixels();if(l.activeTexture.set(u.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),p.demTexture||(p.demTexture=e.getTileTexture(m)),p.demTexture){let y=p.demTexture;y.update(_,{premultiply:!1}),y.bind(u.NEAREST,u.CLAMP_TO_EDGE)}else p.demTexture=new Ot(l,_,u.RGBA,{premultiply:!1}),p.demTexture.bind(u.NEAREST,u.CLAMP_TO_EDGE);l.activeTexture.set(u.TEXTURE0);let g=p.fbo;if(!g){let y=new Ot(l,{width:f,height:f,data:null},u.RGBA);y.bind(c,u.CLAMP_TO_EDGE),g=p.fbo=l.createFramebuffer(f,f,!0,!1),g.colorAttachment.set(y.texture)}l.bindFramebuffer.set(g.framebuffer),l.viewport.set([0,0,f,f]),s.useProgram("hillshadePrepare").draw(l,u.TRIANGLES,n,a,o,ke.disabled,x$(s.transform,p.tileID,d),null,null,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),p.needsHillshadePrepare=!1}}function bq(e,t,r,i,n){if(n.currentPass!=="translucent"||!i.length)return;let{useSubdivision:a}=n.data,o=n.getDepthModeForSublayer(0,be.ReadOnly),s=n.colorModeForRenderPass();if(a){let[l,u,c]=n.stencilConfigForOverlapTwoPass(i);V1(e,t,r,c,l,o,s,!1,n),V1(e,t,r,c,u,o,s,!0,n)}else{let[l,u]=n.getStencilConfigForOverlapAndUpdateStencilID(i);V1(e,t,r,u,l,o,s,!1,n)}}var N1=0;function V1(e,t,r,i,n,a,o,s,l){let u=l.context,c=u.gl,h=l.useProgram("colorRelief"),p=!l.data.moving,d=r.paint.get("resampling")==="nearest"?c.NEAREST:c.LINEAR,f=!0,m=0;for(let _ of i){let g=t.getTile(_),y=g.dem;if(!y?.data)continue;if(f){N1||(N1=c.getParameter(c.MAX_TEXTURE_SIZE));let T=N1,{elevationTexture:S,colorTexture:E}=r.getColorRampTextures(u,T,y.getUnpackVector());u.activeTexture.set(c.TEXTURE1),S.bind(c.NEAREST,c.CLAMP_TO_EDGE),u.activeTexture.set(c.TEXTURE4),E.bind(c.LINEAR,c.CLAMP_TO_EDGE),f=!1,m=S.size[0]}let v=y.stride;u.activeTexture.set(c.TEXTURE0),(!g.demTexture||g.needsColorReliefPrepare)&&(u.pixelStoreUnpackPremultiplyAlpha.set(!1),g.demTexture||(g.demTexture=e.getTileTexture(v)??new Ot(u,{width:v,height:v,data:null},c.RGBA)),g.demTexture.update(y.getPixels(),{premultiply:!1}),g.needsColorReliefPrepare=!1),g.demTexture.bind(d,c.CLAMP_TO_EDGE);let x=l.getMeshFromTileID(_.canonical,s,!0,"raster"),b=l.getTerrainDataForTile(_),w=l.getProjectionDataForTile(_,{aligned:p});h.draw(u,c.TRIANGLES,a,n[_.overscaledZ],o,ke.backCCW,S$(r,g.dem,m),b,w,r.id,x.vertexBuffer,x.indexBuffer,x.segments)}}var U1=[new k(0,0),new k(R,0),new k(R,R),new k(0,R)];function wq(e,t,r,i){if(i.currentPass!=="translucent"||t.paint.get("raster-opacity")===0||!r.length)return;let n=e.getSource(),{useSubdivision:a}=i.data;if(n instanceof Tc)Jp(e,t,r,null,!1,!1,n.tileCoords,n.imageWarp,n.flippedWindingOrder,i,n.getMesh(i.context,a));else if(a){let[o,s,l]=i.stencilConfigForOverlapTwoPass(r);Jp(e,t,l,o,!1,!0,U1,Vs,!1,i),Jp(e,t,l,s,!0,!0,U1,Vs,!1,i)}else{let[o,s]=i.getStencilConfigForOverlapAndUpdateStencilID(r);Jp(e,t,s,o,!1,!0,U1,Vs,!1,i)}}function Jp(e,t,r,i,n,a,o,s,l=!1,u,c=null){let h=r[r.length-1].overscaledZ,p=u.context,d=p.gl,f=u.useProgram("raster"),m=u.colorModeForRenderPass(),_=!u.data.moving,g=t.paint.get("raster-opacity"),y=t.paint.get("resampling")==="nearest"||t.paint.get("raster-resampling")==="nearest"?d.NEAREST:d.LINEAR,v=t.paint.get("raster-fade-duration"),x=!!u.terrain;for(let b of r){let w=u.getDepthModeForSublayer(b.overscaledZ-h,g===1?be.ReadWrite:be.ReadOnly,d.LESS),T=e.getTile(b);p.activeTexture.set(d.TEXTURE0),T.texture.bind(y,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(d.TEXTURE1);let{parentTile:S,parentScaleBy:E,parentTopLeft:P,fadeValues:D}=Tq(T,e,v,x);T.fadeOpacity=D.tileOpacity,S?(S.fadeOpacity=D.parentTileOpacity,S.texture.bind(y,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST)):T.texture.bind(y,d.CLAMP_TO_EDGE,d.LINEAR_MIPMAP_NEAREST),T.texture.useMipmap&&p.extTextureFilterAnisotropic&&u.transform.pitch>u.data.anisotropicFilterPitch&&d.texParameterf(d.TEXTURE_2D,p.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,p.extTextureFilterAnisotropicMax);let F=u.getTerrainDataForTile(b),I=u.getProjectionDataForTile(b,{aligned:_}),C=IB(P,E,D.fadeMix,t,o,s),A=c??u.getMeshFromTileID(b.canonical,n,a,"raster"),M=i?i[b.overscaledZ]:Ie.disabled;f.draw(p,d.TRIANGLES,w,M,m,l?ke.frontCCW:ke.backCCW,C,F,I,t.id,A.vertexBuffer,A.indexBuffer,A.segments)}}function Tq(e,t,r,i){let n={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(r===0||i)return n;if(e.fadingParentID){let a=t.getLoadedTile(e.fadingParentID);if(!a)return n;let o=2**(a.tileID.overscaledZ-e.tileID.overscaledZ);return{parentTile:a,parentScaleBy:o,parentTopLeft:[e.tileID.canonical.x*o%1,e.tileID.canonical.y*o%1],fadeValues:Sq(e,a,r)}}return e.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:Eq(e,r)}:n}function Sq(e,t,r){let i=Be(),n=(i-e.timeAdded)/r,a=(i-t.timeAdded)/r,o=e.fadingDirection===1,s=Q(n,0,1),l=Q(1-a,0,1),u=o?s:l;return{tileOpacity:u,parentTileOpacity:o?l:s,fadeMix:{opacity:1,mix:1-u}}}function Eq(e,t){let r=Q((Be()-e.timeAdded)/t,0,1);return{tileOpacity:r,fadeMix:{opacity:r,mix:0}}}function Cq(e,t,r,i,n){let a=r.paint.get("background-color"),o=r.paint.get("background-opacity");if(o===0)return;let s=n.context,l=s.gl,u=n.transform,c=u.tileSize,h=r.paint.get("background-pattern");if(e.patternAtlas.isPatternMissing(h))return;let p=!h&&a.a===1&&o===1&&n.opaquePassEnabledForLayer()?"opaque":"translucent";if(n.currentPass!==p)return;let d=Ie.disabled,f=n.getDepthModeForSublayer(0,p==="opaque"?be.ReadWrite:be.ReadOnly),m=n.colorModeForRenderPass(),_=n.useProgram(h?"backgroundPattern":"background"),g=i||Cc(u,{tileSize:c,terrain:n.terrain});h&&(s.activeTexture.set(l.TEXTURE0),e.patternAtlas.bind(s));let y=r.getCrossfadeParameters();for(let v of g){let x=n.getProjectionDataForTile(v),b=h?$$(o,e.patternAtlas,u,h,{tileID:v,tileSize:c},y):U$(o,a),w=n.getTerrainDataForTile(v),T=n.getMeshFromTileID(v.canonical,!1,!0,"raster");_.draw(s,l.TRIANGLES,f,d,m,ke.backCCW,b,w,x,r.id,T.vertexBuffer,T.indexBuffer,T.segments)}}var Pq=new he(1,0,0,1),Dq=new he(0,1,0,1),Aq=new he(0,0,1,1),Mq=new he(1,0,1,1),Iq=new he(0,1,1,1);function kq(e){let t=e.transform.padding;W6(e,e.transform.height-(t.top||0),3,Pq),W6(e,t.bottom||0,3,Dq),Y6(e,t.left||0,3,Aq),Y6(e,e.transform.width-(t.right||0),3,Mq);let r=e.transform.centerPoint;zq(e,r.x,e.transform.height-r.y,Iq)}function zq(e,t,r,i){Xd(e,t-1,r-10,2,20,i),Xd(e,t-10,r-1,20,2,i)}function W6(e,t,r,i){Xd(e,0,t+r/2,e.transform.width,r,i)}function Y6(e,t,r,i){Xd(e,t-r/2,0,r,e.transform.height,i)}function Xd(e,t,r,i,n,a){let o=e.context,s=o.gl,l=e.data.pixelRatio;s.enable(s.SCISSOR_TEST),s.scissor(t*l,r*l,i*l,n*l),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function Fq(e,t,r,i){for(let n of r)Rq(e,t,n,i)}function Rq(e,t,r,i){let n=i.context,a=n.gl,o=i.useProgram("debug"),s=be.disabled,l=Ie.disabled,u=i.colorModeForRenderPass(),c="$debug",h=i.getTerrainDataForTile(r);n.activeTexture.set(a.TEXTURE0);let p=t.getTileByID(r.key).latestRawTileData?.byteLength||0,d=Math.floor(p/1024),f=t.getTile(r).tileSize,m=512/Math.min(f,512)*(r.overscaledZ/i.transform.zoom)*.5,_=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(_+=` => ${r.overscaledZ}`),Lq(e,`${_} ${d}kB`);let g=i.getProjectionDataForTile(r);o.draw(n,a.TRIANGLES,s,l,vt.alphaBlended,ke.disabled,V6(he.transparent,m),null,g,c,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),o.draw(n,a.LINE_STRIP,s,l,u,ke.disabled,V6(he.red),h,g,c,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function Lq(e,t){e.initDebugOverlayCanvas();let r=e.debugOverlayCanvas,i=e.context.gl,n=e.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(t,5,5),n.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}function Bq(e,t){let r=null,i=Object.values(e._layers).flatMap(s=>s.source&&!s.isHidden(t)?[e.tileManagers[s.source]]:[]),n=i.filter(s=>s.getSource().type==="vector"),a=i.filter(s=>s.getSource().type!=="vector"),o=s=>{(!r||r.getSource().maxzoom<s.getSource().maxzoom)&&(r=s)};for(let s of n)o(s);if(!r)for(let s of a)o(s);return r}function Oq(e,t,r){let i=r.context,n=i.gl,a=r.transform,o=vt.unblended,s=new be(n.LEQUAL,be.ReadWrite,[0,1]),l=t.tileManager.getRenderableTiles(),u=r.useProgram("terrainDepth");i.bindFramebuffer.set(t.getFramebuffer().framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:he.white,depth:1});for(let c of l){let h=t.getTerrainMesh(c.tileID,r.data.isRenderingGlobe),p=t.getTerrainData(c.tileID),d=a.getProjectionData({overscaledTileID:c.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),f=KU(t.getSkirtLength(a.zoom));u.draw(i,n.TRIANGLES,s,Ie.disabled,o,ke.backCCW,f,p,d,"terrain",h.vertexBuffer,h.indexBuffer,h.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}function jq(e,t,r,i){let{isRenderingGlobe:n}=i.data,a=i.context,o=a.gl,s=i.transform,l=i.colorModeForRenderPass(),u=i.getDepthModeFor3D(),c=i.useProgram("terrain");a.bindFramebuffer.set(null),a.viewport.set([0,0,e.width,e.height]);for(let h of r){let p=t.getTerrainMesh(h.tileID,n),d=e.renderToTexture.getTexture(h),f=t.getTerrainData(h.tileID);a.activeTexture.set(o.TEXTURE0),d.bind(o.LINEAR,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_LINEAR);let m=t.getSkirtLength(s.zoom),_=s.calculateFogMatrix(h.tileID.toUnwrapped()),g=XU(m,_,i.data.sky,s.pitch,n),y=i.getProjectionDataForTile(h.tileID,{applyTerrainMatrix:!1});c.draw(a,o.TRIANGLES,u,Ie.disabled,l,ke.backCCW,g,f,y,"terrain",p.vertexBuffer,p.indexBuffer,p.segments)}}function Nq(e,t,r){let i=e.context,n=i.gl,[a,o,s,l]=r.bounds;i.setDirty();let u=t.getHeightMapFramebuffer(r.texture);i.viewport.set([0,0,r.width,r.height]),i.clear({color:he.transparent});let c=e.useProgram("terrainHeight",null,!0);for(let h of t.tileManager.getRenderableTiles()){let p=t.getTerrainData(h.tileID);if(!p.tile?.dem)continue;let{canonical:d,wrap:f}=h.tileID,m=1/(1<<d.z),_=QU([(d.x*m+f-a)/(s-a),(d.y*m-o)/(l-o),m/(s-a),m/(l-o)]),g=t.getTerrainMesh(h.tileID,e.data.isRenderingGlobe);c.draw(i,n.TRIANGLES,be.disabled,Ie.disabled,vt.unblended,ke.disabled,_,p,null,"terrain",g.vertexBuffer,g.indexBuffer,g.segments)}u.colorAttachment.set(null)}function Vq(e,t,r,i,n){if(n.isRenderingToTexture){Uq(e,r,i[0],n);return}let{isRenderingGlobe:a,projectionShaderVariant:o}=n.data,{terrain:s}=n,l=n.context,u=r.implementation,c=n.transform,h=c.getProjectionDataForCustomLayer(a),p={farZ:c.farZ,nearZ:c.nearZ,fov:c.fov*Math.PI/180,modelViewProjectionMatrix:c.modelViewProjectionMatrix,projectionMatrix:c.projectionMatrix,shaderData:{variantName:o.name,vertexShaderPrelude:`const float PI = 3.141592653589793;
|
|
823
823
|
uniform mat4 u_projection_matrix;
|
|
824
|
-
${o.prelude.vertexSource}`,define:o.define},defaultProjectionData:h,getProjectionData:f=>c.getProjectionData({overscaledTileID:new ir(f.tileID.canonical.z,f.tileID.wrap??0,f.tileID.canonical.z,f.tileID.canonical.x,f.tileID.canonical.y),aligned:f.aligned,applyGlobeMatrix:f.applyGlobeMatrix,applyTerrainMatrix:f.applyTerrainMatrix}),renderTerrainHeightMap:s&&n.currentPass==="offscreen"?f=>Nq(n,s,f):void 0},d=u.renderingMode?u.renderingMode:"2d";if(n.currentPass==="offscreen"){let f=u.prerender;f&&(l.setCustomLayerDefaults(),l.setColorMode(n.colorModeForRenderPass()),f.call(u,l.gl,p),l.setDirty(),e.setBaseState())}else if(n.currentPass==="translucent"){l.setCustomLayerDefaults(),l.setColorMode(n.colorModeForRenderPass()),l.setStencilMode(Ie.disabled);let f=d==="3d"?n.getDepthModeFor3D():n.getDepthModeForSublayer(0,be.ReadOnly);l.setDepthMode(f),u.render(l.gl,p),l.setDirty(),e.setBaseState(),l.bindFramebuffer.set(null)}}function Uq(e,t,r,i){let n=i.context,a=n.bindFramebuffer.get(),o=n.viewport.get();n.setCustomLayerDefaults(),n.setColorMode(i.colorModeForRenderPass()),n.setDepthMode(be.disabled),n.setStencilMode(Ie.disabled),t.implementation.renderToTerrainTile(n.gl,{tileID:{canonical:r.canonical,wrap:r.wrap},width:o[2],height:o[3]}),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(a),n.viewport.set(o)}function $q(e,t){let r=t.context,i=r.gl,{sky:n,pixelRatio:a}=t.data,o=H$(n,t.transform,a),s=new be(i.LEQUAL,be.ReadWrite,[0,1]),l=Ie.disabled,u=t.colorModeForRenderPass();t.useProgram("sky").draw(r,i.TRIANGLES,s,l,u,ke.disabled,o,null,void 0,"sky",e.vertexBuffer,e.indexBuffer,e.segments)}function qq(e,t){let r=bT(e.position);tI(r,r);let i=Gi(new Float64Array(16));return e.anchor==="map"&&(Pa(i,i,t.rollInRadians),qs(i,i,-t.pitchInRadians),Pa(i,i,t.bearingInRadians),qs(i,i,t.center.lat*Math.PI/180),gT(i,i,-t.center.lng*Math.PI/180)),iI(r,r,i),r}function Gq(e,t){let r=t.context,i=r.gl,{sky:n,light:a}=t.data,o=t.useProgram("atmosphere"),s=new be(i.LEQUAL,be.ReadOnly,[0,1]),l=t.transform,u=qq(a,l),c=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),h=yo(l.worldSize,l.center.lat),p=zP(l),d=FP(Ui(p)-h,h),f=n["atmosphere-blend"]*c.projectionTransition*d;if(f===0)return;let m=G$(u,f,p,h,l.inverseProjectionMatrix);o.draw(r,i.TRIANGLES,s,Ie.disabled,vt.alphaBlended,ke.disabled,m,null,null,"atmosphere",e.vertexBuffer,e.indexBuffer,e.segments)}var Zq={symbol:Q$,circle:nq,heatmap:aq,line:gq,fill:yq,fillExtrusion:_q,hillshade:vq,colorRelief:bq,raster:wq,background:Cq,sky:$q,atmosphere:Gq,custom:Vq,debug:Fq,debugPadding:kq,terrainDepth:Oq},X6=b_.maxOverzooming+b_.maxUnderzooming+1,K6=1/2**16,Hq={name:TP,define:wP,prelude:dn.projectionMercator},Wq=class{constructor(e){this.currentLayer=0,this.opaquePassCutoff=1/0,this.depthRangeFor3D=[0,1],this.isRenderingToTexture=!1,this.nextStencilID=1,this.tileClippingMaskIDs={},this.transform=e.transform,this.terrain=e.terrain,this.data=e.data,this.context=e.context,this.programCache=e.programCache,this.currentPass=e.currentPass,this.projection=e.projection}getProjectionDataForTile(e,t={}){let r=this.transform.getProjectionData({overscaledTileID:e,aligned:t.aligned,applyGlobeMatrix:!this.isRenderingToTexture,applyTerrainMatrix:t.applyTerrainMatrix??!0});return this.isRenderingToTexture||(r.uniformBufferKey=t.aligned?`${e.key}/aligned`:e.key),r}getTerrainDataForTile(e){return this.isRenderingToTexture?null:this.terrain?.getTerrainData(e)??null}getMeshFromTileID(e,t,r,i){return this.projection.getMeshFromTileID(this.context,e,t,r,i)}useProgram(e,t,r=!1,i=[]){return this.programCache.getProgram({name:e,programConfiguration:t,projectionShaderVariant:r?Hq:this.data.projectionShaderVariant,showOverdrawInspector:this.data.showOverdrawInspector,useTerrain:this.terrain!==null,defines:i})}colorModeForRenderPass(){let e=this.context.gl;if(this.data.showOverdrawInspector){let t=.125;return new vt([e.CONSTANT_COLOR,e.ONE],new he(t,t,t,0),[!0,!0,!0,!0])}return this.currentPass==="opaque"?vt.unblended:vt.alphaBlended}getDepthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return be.disabled;let i=1-((1+this.currentLayer)*X6+e)*K6;return new be(r||this.context.gl.LEQUAL,t,[i,i])}getDepthModeFor3D(){return new be(this.context.gl.LEQUAL,be.ReadWrite,this.depthRangeFor3D)}setDepthRangeFor3D(e){this.depthRangeFor3D=[0,1-(e+2)*X6*K6]}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}clearStencil(){this.nextStencilID=1,this.currentStencilSource=void 0,this.context.clear({stencil:0})}invalidateTileClippingMasks(){this.currentStencilSource=void 0}renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t?.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let r=this.context;r.setColorMode(vt.disabled),r.setDepthMode(be.disabled);let i={};for(let n of t)i[n.key]=this.nextStencilID++;this.data.useSubdivision&&this.renderTileMasks(i,t,!0),this.renderTileMasks(i,t,!1),this.tileClippingMaskIDs=i}renderTileMasks(e,t,r){let i=this.context,n=i.gl,a=this.useProgram("clippingMask");for(let o of t){let s=e[o.key],l=this.getTerrainDataForTile(o),u=this.getMeshFromTileID(o.canonical,r,!0,"stencil"),c=this.getProjectionDataForTile(o);a.draw(i,n.TRIANGLES,be.disabled,new Ie({func:n.ALWAYS,mask:0},s,255,n.KEEP,n.KEEP,n.REPLACE),vt.disabled,this.isRenderingToTexture?ke.disabled:ke.backCCW,null,l,c,"$clipping",u.vertexBuffer,u.indexBuffer,u.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new Ie({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new Ie({func:t.EQUAL,mask:255},this.tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,r=e.sort((a,o)=>o.overscaledZ-a.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();let a={};for(let o=0;o<n;o++)a[o+i]=new Ie({func:t.GEQUAL,mask:255},o+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=n,[a,r]}return[{[i]:Ie.disabled},r]}stencilConfigForOverlapTwoPass(e){let t=this.context.gl,r=e.sort((a,o)=>o.overscaledZ-a.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(this.clearStencil(),n>1){let a={},o={};for(let s=0;s<n;s++)a[s+i]=new Ie({func:t.GREATER,mask:255},n+1+s,255,t.KEEP,t.KEEP,t.REPLACE),o[s+i]=new Ie({func:t.GREATER,mask:255},1+s,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID=n*2+1,[a,o,r]}return this.nextStencilID=3,[{[i]:new Ie({func:t.GREATER,mask:255},2,255,t.KEEP,t.KEEP,t.REPLACE)},{[i]:new Ie({func:t.GREATER,mask:255},1,255,t.KEEP,t.KEEP,t.REPLACE)},r]}},vo,Yq=(vo=class{constructor(t){this.drawFunctions=Zq,this.context=new qU(t),this.programCache=new Y$(this.context),this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:Gi(new Float64Array(16)),renderTime:0},this.setup()}resize(t,r,i){this.width=Math.round(t*i),this.height=Math.round(r*i),this.context.viewport.set([0,0,this.width,this.height])}setup(){let t=this.context,r=new ho;r.emplaceBack(0,0),r.emplaceBack(R,0),r.emplaceBack(0,R),r.emplaceBack(R,R),this.tileExtentBuffer=t.createVertexBuffer(r,Fs.members),this.tileExtentSegments=ct.simpleSegment(0,0,4,2);let i=new ho;i.emplaceBack(0,0),i.emplaceBack(R,0),i.emplaceBack(0,R),i.emplaceBack(R,R),this.debugBuffer=t.createVertexBuffer(i,Fs.members),this.debugSegments=ct.simpleSegment(0,0,4,5);let n=new fz;n.emplaceBack(0,0,0,0),n.emplaceBack(R,0,R,0),n.emplaceBack(0,R,0,R),n.emplaceBack(R,R,R,R),this.rasterBoundsBuffer=t.createVertexBuffer(n,KV.members),this.rasterBoundsSegments=ct.simpleSegment(0,0,4,2);let a=new ho;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,Fs.members),this.viewportSegments=ct.simpleSegment(0,0,4,2);let o=new Cz;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);let s=new yn;s.emplaceBack(1,0,2),s.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.tileExtentMesh=new hc(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);let l=new ho;l.emplaceBack(-1,-1),l.emplaceBack(1,-1),l.emplaceBack(1,1),l.emplaceBack(-1,1);let u=new yn;u.emplaceBack(0,1,2),u.emplaceBack(0,2,3),this.skyMesh=new hc(t.createVertexBuffer(l,Fs.members),t.createIndexBuffer(u),ct.simpleSegment(0,0,l.length,u.length))}_renderTilesDepthBuffer(t){let r=this.context,i=r.gl,n=t.transform,a=t.useProgram("depth"),o=t.getDepthModeFor3D(),s=Cc(n,{tileSize:n.tileSize});for(let l of s){let u=t.getTerrainDataForTile(l),c=t.getMeshFromTileID(l.canonical,!0,!0,"raster"),h=t.getProjectionDataForTile(l);a.draw(r,i.TRIANGLES,o,Ie.disabled,vt.disabled,ke.backCCW,null,u,h,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}render(t,r,i){if(this.context.gl.isContextLost())return;let n=new Wq({transform:r,terrain:t.map.terrain??null,data:i,context:this.context,programCache:this.programCache,currentPass:"offscreen",projection:t.projection});this.lineAtlas=t.lineAtlas,this.patternAtlas=t.patternAtlas,VU(this.context.frameUniformBuffer,r,i),t.imageManager.beginFrame(),OU(this.context);let a=t._order,o=t.tileManagers,s={},l={},u={};for(let h in o){let p=o[h];p.used&&p.prepare(this.context),s[h]=p.getVisibleCoordinates(!1),l[h]=s[h].slice().reverse(),u[h]=p.getVisibleCoordinates(!0).reverse()}n.opaquePassCutoff=1/0;for(let h=0;h<a.length;h++){let p=a[h];if(t._layers[p].is3D()){n.opaquePassCutoff=h;break}}this.maybeDrawDepth(n),this.renderToTexture&&(this.renderToTexture.prepareForRender(t,r.zoom,i.moving),n.opaquePassCutoff=0),n.currentPass="offscreen";for(let h of a){let p=t._layers[h];if(!p.hasOffscreenPass()||p.isHidden(r.zoom))continue;let d=l[p.source];(p.type==="custom"||d.length)&&this.renderLayer(this,o[p.source],p,d,n)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?he.black:he.transparent,depth:1}),n.clearStencil(),i.sky&&this.drawFunctions.sky(this.skyMesh,n),n.setDepthRangeFor3D(t._order.length),!this.renderToTexture)for(n.currentPass="opaque",n.currentLayer=a.length-1;n.currentLayer>=0;n.currentLayer--){let h=t._layers[a[n.currentLayer]];if(h.isHidden(r.zoom))continue;let p=o[h.source],d=s[h.source];n.renderTileClippingMasks(h,d),this.renderLayer(this,p,h,d,n)}n.currentPass="translucent";let c=!1;for(n.currentLayer=0;n.currentLayer<a.length;n.currentLayer++){let h=t._layers[a[n.currentLayer]];if(h.isHidden(r.zoom))continue;let p=o[h.source];if(this.renderToTexture?.renderLayer(h,t,n))continue;!n.opaquePassEnabledForLayer()&&!c&&(c=!0,i.isRenderingGlobe&&!n.terrain&&this._renderTilesDepthBuffer(n));let d=(h.type==="symbol"?u:l)[h.source];n.renderTileClippingMasks(h,s[h.source]),this.renderLayer(this,p,h,d,n)}if(i.isRenderingGlobe&&this.drawFunctions.atmosphere(this.skyMesh,n),i.showTileBoundaries){let h=Bq(t,r.zoom);h&&this.drawFunctions.debug(this,h,h.getVisibleCoordinates(),n)}i.showPadding&&this.drawFunctions.debugPadding(n),this.renderToTexture&&!i.moving&&this.clearRTTPool(),this.context.setDefault()}markTerrainDepthDirty(){this.terrainFacilitator.depthDirty=!0}maybeDrawDepth(t){if(!t.data.projectionShaderVariant||!t.terrain)return;let r=this.terrainFacilitator.matrix,i=t.transform.modelViewProjectionMatrix,n=this.terrainFacilitator.depthDirty;n||(n=!eI(r,i)),n||(n=t.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),n&&(YM(r,i),this.terrainFacilitator.renderTime=Be(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,t.terrain,t))}renderLayer(t,r,i,n,a){if(i.isHidden(a.transform.zoom)||i.type!=="background"&&i.type!=="custom"&&!(n||[]).length)return;let o=this.drawFunctions;wC(i)?o.symbol(t,r,i,n,a):Qz(i)?o.circle(r,i,n,a):r9(i)?o.heatmap(t,r,i,n,a):CF(i)?o.line(t,r,i,n,a):$9(i)?o.fill(t,r,i,n,a):dF(i)?o.fillExtrusion(r,i,n,a):o9(i)?o.hillshade(t,r,i,n,a):h9(i)?o.colorRelief(t,r,i,n,a):my(i)?o.raster(r,i,n,a):SL(i)?o.background(t,r,i,n,a):Ef(i)&&o.custom(t,r,i,n,a)}saveTileTexture(t){let r=this._tileTextures[t.size[0]];r?r.length<vo.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?r.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let r=this._tileTextures[t];return r&&r.length>0?r.pop():null}acquireRTT(t){let r=this.context.gl,i=this._rttObjectRecyclePool.pop();if(i)return i.size!==t&&(i.texture.update({width:t,height:t,data:null},{premultiply:!1,useMipmap:!0}),i.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),i.size=t),i;let n=new Ot(this.context,{width:t,height:t,data:null},r.RGBA,{premultiply:!1,useMipmap:!0});return n.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:n,size:t}}bindRTT(t){let r=this.context.gl,i=t.size;if(!this._rttSharedFbo){let n=this.context.createFramebuffer(i,i,!0,!0),a=this.context.createRenderbuffer(r.DEPTH_STENCIL,i,i);n.depthAttachment.set(a),this._rttSharedFbo={fbo:n,depthRenderbuffer:a,size:i}}this._rttSharedFbo.size!==i&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,i,i),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=i,this._rttSharedFbo.fbo.height=i,this._rttSharedFbo.size=i),this._rttSharedFbo.fbo.colorAttachment.set(t.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(t){this._rttObjectRecyclePool.push(t)}clearRTTPool(){for(let t of this._rttObjectRecyclePool)t.texture.destroy();this._rttObjectRecyclePool.length=0}destroyRTTResources(){if(this.clearRTTPool(),!this._rttSharedFbo)return;this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let t=this.context.gl;t.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),t.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new Ot(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let r=this._tileTextures[t];if(r)for(let i of r)i.destroy()}this._tileTextures={}}this.destroyRTTResources(),this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.skyMesh?.destroy(),this.skyMesh=null,this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.destroy(),this.programCache.destroy(),this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:r}=this.context.gl;return this.width!==t||this.height!==r}},vo.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,vo),Xq=class extends Error{constructor(e,t){super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=e,this.statusMessage=t?.statusMessage??null}};function Xv(e,t){let r=!1,i=null,n,a=()=>{i=null,r&&(r=(e(...n),i=setTimeout(a,t),!1))};return(...o)=>(r=!0,n=o,i||a(),i)}var Kq=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):([...t.keys()][0]??"").split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let r=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:r,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getHashParams();if(this._hashName)t.delete(this._hashName);else{let a=Array.from(t.keys());a.length>0&&t.delete(a[0])}let r=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=r?`#${r}`:"",n=window.location.href.replace(/(#.+)?$/,i);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=Xv(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let t=this._map.getCenter(),r=Math.round(this._map.getZoom()*100)/100,i=tF(this._map._camera.transform.worldCoordinateHelper,t),n=10**Math.ceil((r*Math.LN2+Math.log(512/i/.5))/Math.LN10),a=Math.round(t.lng*n)/n,o=Math.round(t.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=e?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(u+=`/${Math.round(s*10)/10}`),l&&(u+=`/${Math.round(l)}`),this._hashName){let c=this._getHashParams();return c.set(this._hashName,u),`#${decodeURIComponent(c.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${u}`}_isValidHash(e){if(e.length<3||e.some(n=>isNaN(+n)))return!1;try{new H(+e[2],+e[1])}catch{return!1}let t=+e[0],r=+(e[3]||0),i=+(e[4]||0);return t>=this._map.getMinZoom()&&t<=this._map.getMaxZoom()&&r>=-180&&r<=180&&i>=this._map.getMinPitch()&&i<=this._map.getMaxPitch()}},Pc={linearity:.3,easing:F_(0,0,.3,1)},Qq=J({deceleration:2500,maxSpeed:1400},Pc),Jq=J({deceleration:20,maxSpeed:1400},Pc),eG=J({deceleration:1e3,maxSpeed:360},Pc),tG=J({deceleration:1e3,maxSpeed:90},Pc),rG=J({deceleration:1e3,maxSpeed:360},Pc),iG=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Be(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=Be();for(;e.length>0&&t-e[0].time>160;)e.shift()}_getVelocityEntries(){let e=this._inertiaBuffer,t=Be()-60,r=Math.max(0,e.length-2);for(;r>0&&e[r-1].time>=t;)r--;return e.slice(r)}_onMoveEnd(e){this._drainInertiaBuffer();let t=this._getVelocityEntries();if(t.length<2){this.clear();return}let r={zoom:0,bearing:0,pitch:0,roll:0,pan:new k(0,0),pinchAround:void 0,around:void 0};for(let{settings:a}of t)a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround);for(let{settings:a}of t.slice(1))r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,r.roll+=a.rollDelta||0,a.panDelta&&r.pan._add(a.panDelta);if(!r.pan.mag()&&!r.zoom&&!r.bearing&&!r.pitch&&!r.roll){this.clear();return}let i=Be()-t[0].time,n={};if(r.pan.mag()){let a=Cu(r.pan.mag(),i,J({},Qq,e||{})),o=r.pan.mult(a.amount/r.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(o,this._map._camera.transform);n.center=s.easingCenter,n.offset=s.easingOffset,Eu(n,a)}if(r.zoom){let a=Cu(r.zoom,i,Jq);n.zoom=Jr(this._map.getZoom()+a.amount,this._map.getZoomSnap(),a.amount),Eu(n,a)}if(r.bearing){let a=Cu(r.bearing,i,eG);n.bearing=this._map.getBearing()+Q(a.amount,-179,179),Eu(n,a)}if(r.pitch){let a=Cu(r.pitch,i,tG);n.pitch=this._map.getPitch()+a.amount,Eu(n,a)}if(r.roll){let a=Cu(r.roll,i,rG);n.roll=this._map.getRoll()+Q(a.amount,-179,179),Eu(n,a)}if(n.zoom||n.bearing){let a=r.pinchAround===void 0?r.around:r.pinchAround;n.around=a?this._map.unproject(a):this._map.getCenter()}return this.clear(),J(n,{noMoveStart:!0})}};function Eu(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Cu(e,t,r){let{maxSpeed:i,linearity:n,deceleration:a}=r,o=Q(e*n/(t/1e3),-i,i),s=Math.abs(o)/(a*n);return{easing:r.easing,duration:s*1e3,amount:s/2*o}}var nG=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new YI(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new ei(e.type,this._map,e))}mouseup(e){this._map.fire(new ei(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new ei(e.type,this._map,e))}dblclick(e){return this._firePreventable(new ei(e.type,this._map,e))}mouseover(e){this._map.fire(new ei(e.type,this._map,e))}mouseout(e){this._map.fire(new ei(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Dp(e.type,this._map,e))}touchmove(e){this._map.fire(new Dp(e.type,this._map,e))}touchend(e){this._map.fire(new Dp(e.type,this._map,e))}touchcancel(e){this._map.fire(new Dp(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},aG=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent,this._clearLongPress(),this._touchActive=!1}mousemove(e){this._map.fire(new ei(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ei("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}touchstart(e,t,r){if(this._clearLongPress(),this._touchActive=r.length>0,r.length!==1)return;this._longPressStart=t[0];let i=r[0];this._longPressTimer=setTimeout(()=>{this._longPressTimer=void 0;let n=new MouseEvent("contextmenu",{clientX:i.clientX,clientY:i.clientY,button:2,bubbles:!0,cancelable:!0});this._map.fire(new ei("contextmenu",this._map,n))},500)}touchmove(e,t,r){this._longPressTimer&&(r.length!==1||!this._longPressStart||t[0].dist(this._longPressStart)>this._clickTolerance)&&this._clearLongPress()}touchend(){this._touchActive=!1,this._clearLongPress()}touchcancel(){this._touchActive=!1,this._clearLongPress()}_clearLongPress(){this._longPressTimer&&(this._longPressTimer=(clearTimeout(this._longPressTimer),void 0)),this._longPressStart=void 0}contextmenu(e){this._touchActive?e.preventDefault():(this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new ei(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault())}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},oG=class{constructor(e,t,r){this._map=e,this._tr=r,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1,t.boxZoom&&typeof t.boxZoom=="object"&&(this._boxZoomEnd=t.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(ht.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=r,this._box||(this._box=ht.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let n=Math.min(i.x,r.x),a=Math.max(i.x,r.x),o=Math.min(i.y,r.y),s=Math.max(i.y,r.y);this._box.style.transform=`translate(${n}px,${o}px)`,this._box.style.width=`${a-n}px`,this._box.style.height=`${s-o}px`}mouseupWindow(e,t){if(!this._active||e.button!==0)return;let r=this._startPos,i=t;if(this.reset(),ht.suppressClick(),r.x===i.x&&r.y===i.y)this._fireEvent("boxzoomcancel",e);else{if(this._map.fire(new e5("boxzoomend",{originalEvent:e})),this._boxZoomEnd){this._boxZoomEnd(this._map,r,i,e);return}return{cameraAnimation:n=>n.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})}}}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box=(this._box.remove(),null)),ht.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new e5(e,{originalEvent:t}))}};function C_(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let r={};for(let i=0;i<e.length;i++)r[e[i].identifier]=t[i];return r}function sG(e){let t=new k(0,0);for(let r of e)t._add(r);return t.div(e.length)}var lG=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,t,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=sG(t),this.touches=C_(r,t)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;let i=C_(r,t);for(let n in this.touches){let a=this.touches[n],o=i[n];(!o||o.dist(a)>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),r.length===0){let i=!this.aborted&&this.centroid;if(this.reset(),i)return i}}},P_=class{constructor(e){this.singleTap=new lG(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){let i=this.singleTap.touchend(e,t,r);if(i){let n=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(i)<30;if((!n||!a)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}},uG=class{constructor(e,t){this._tr=t,this._zoomIn=new P_({numTouches:1,numTaps:2}),this._zoomOut=new P_({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){let i=this._zoomIn.touchend(e,t,r),n=this._zoomOut.touchend(e,t,r),a=this._tr;if(i)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:Jr(a.zoom+1,o.getZoomSnap()),around:a.transform.isPointOnMapSurface(i)?a.unproject(i):void 0},{originalEvent:e})};if(n)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:Jr(a.zoom-1,o.getZoomSnap()),around:a.transform.isPointOnMapSurface(n)?a.unproject(n):void 0},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},kf=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._startPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._startPoint=Array.isArray(t)?t[0]:t,this._lastPoint=this._startPoint,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let i=Array.isArray(t)?t[0]:t;if(!(!this._moved&&i.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=i,this._move(r,i,this._startPoint)}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&ht.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}},cG={0:1,2:2};function hG(e,t){let r=cG[t];return e.buttons===void 0||(e.buttons&r)!==r}var zf=class{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){this._eventButton=e.button}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!hG(e,this._eventButton)}isValidEndEvent(e){return e.button===this._eventButton}};function Kv(e,t,r){return t==="center"||!(e.bearingDelta||e.pitchDelta||e.rollDelta)?e:{...e,around:r}}var Ff=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=t=>{t.preventDefault()}};function pG({enable:e,clickTolerance:t}){return new kf({clickTolerance:t,move:(r,i)=>({around:i,panDelta:i.sub(r)}),activateOnStart:!0,moveStateManager:new zf({checkCorrectEvent:r=>r.button===0&&!r.ctrlKey}),enable:e,assignEvents:Ff})}function dG({enable:e,clickTolerance:t,minPixelCenterThreshold:r=100,rotateSpeed:i=.8},n,a,o){return new kf({clickTolerance:t,move:(s,l,u)=>{if(a?.()==="pointer")return Kv({bearingDelta:(l.x-s.x)*i},"pointer",u);let c=n(),h=(o?.()??"circular")==="circular";if(h&&Math.abs(c.y-s.y)>r)return{bearingDelta:RI(new k(s.x,l.y),l,c)};let p=(l.x-s.x)*i;return h&&l.y<c.y&&(p=-p),{bearingDelta:p}},moveStateManager:new zf({checkCorrectEvent:s=>s.button===0&&s.ctrlKey||s.button===2&&!s.ctrlKey}),enable:e,assignEvents:Ff})}function fG({enable:e,clickTolerance:t,pitchSpeed:r=-.5},i){return new kf({clickTolerance:t,move:(n,a,o)=>Kv({pitchDelta:(a.y-n.y)*r},i?.()??"center",o),moveStateManager:new zf({checkCorrectEvent:n=>n.button===0&&n.ctrlKey||n.button===2}),enable:e,assignEvents:Ff})}function mG({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:r=.3},i,n){return new kf({clickTolerance:t,move:(a,o,s)=>{let l=i(),u=(o.x-a.x)*r;return o.y<l.y&&(u=-u),Kv({rollDelta:u},n?.()??"center",s)},moveStateManager:new zf({checkCorrectEvent:a=>a.button===2&&a.ctrlKey}),enable:e,assignEvents:Ff})}var gG=class{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new k(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active)if(this._shouldBePrevented(r.length))this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e);else return e.preventDefault(),this._calculateTransform(e,t,r)}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,t,r){r.length>0&&(this._active=!0);let i=C_(r,t),n=new k(0,0),a=new k(0,0),o=0;for(let l in i){let u=i[l],c=this._touches[l];c&&(n._add(u),a._add(u.sub(c)),o++,i[l]=u)}if(this._touches=i,this._shouldBePrevented(o)||!a.mag())return;let s=a.div(o);if(this._sum._add(s),!(this._sum.mag()<this._clickTolerance))return{around:n.div(o),panDelta:s}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},Qv=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){if(!this._firstTwoTouches)return;e.preventDefault();let[i,n]=this._firstTwoTouches,a=ed(r,t,i),o=ed(r,t,n);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;let[i,n]=this._firstTwoTouches,a=ed(r,t,i),o=ed(r,t,n);a&&o||(this._active&&ht.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function ed(e,t,r){for(let i=0;i<e.length;i++)if(e[i].identifier===r)return t[i]}var Q6=.1;function J6(e,t){return Math.log(e/t)/Math.LN2}var yG=class extends Qv{constructor(){super(),this._zoomRate=1,this._zoomThreshold=Q6}setZoomRate(e){this._zoomRate=e??1}setZoomThreshold(e){this._zoomThreshold=e??Q6}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let r=this._distance;if(this._distance=e[0].dist(e[1]),!(!this._active&&Math.abs(J6(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:J6(this._distance,r)*this._zoomRate,pinchAround:t}}};function eT(e,t){return e.angleWith(t)*180/Math.PI}var _G=class extends Qv{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,r){let i=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:eT(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,r=eT(e,this._startVector);return Math.abs(r)<t}};function $1(e){return Math.abs(e.y)>Math.abs(e.x)}var vG=class extends Qv{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,$1(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let i=e[0].sub(this._lastPoints[0]),n=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}}gestureBeginsVertically(e,t,r){if(this._valid!==void 0)return this._valid;let i=e.mag()>=2,n=t.mag()>=2;if(!i&&!n)return;if(!i||!n)return this._firstMove===void 0&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return $1(e)&&$1(t)&&a}},xG={panStep:100,bearingStep:15,pitchStep:10},bG=class{constructor(e,t){this._tr=t;let r=xG;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,i=0,n=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:wG,zoom:t?Jr(s.zoom+t*(e.shiftKey?2:1),o.getZoomSnap()):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+i*this._pitchStep,offset:[-n*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}};function wG(e){return e*(2-e)}var tT=4.000244140625,TG=class{constructor(e,t,r){this._onTimeout=i=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},this._map=e,this._tr=r,this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return this._map.cooperativeGestures.isEnabled()?!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e)):!1}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e)){this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);return}let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY,r=Be(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,t!==0&&t%tT==0?this._type="wheel":t!==0&&Math.abs(t)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let t=ht.mousePos(this._map.getCanvas(),e),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(H.convert(r.center)):t,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let o=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=o),typeof this._targetZoom=="number"&&(this._targetZoom+=o)}if(this._delta!==0){let o=this._type==="wheel"&&Math.abs(this._delta)>tT?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*o)));this._delta<0&&s!==0&&(s=1/s);let l=typeof this._targetZoom=="number"?Bt(this._targetZoom):e.scale,u=e.applyConstrain(e.getCameraLngLat(),Ut(l*s)).zoom,c=this._map.getZoomSnap();if(this._type==="wheel"&&c>0){let h=Jr(e.zoom,c);this._targetZoom=Jr(u,c,u-h)}else this._targetZoom=u;this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let t=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,r=this._startZoom,i=this._easing,n=!1,a;if(this._type==="wheel"&&r&&i){let o=Be()-this._lastWheelEventTime,s=Math.min((o+5)/200,1),l=i(s);a=ot.number(r,t,l),s<1?this._needsRerender=!0:n=!0}else a=t,n=!0;return this._active=!0,n&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!n,zoomDelta:a-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=Q1;if(this._prevEase){let r=this._prevEase,i=(Be()-r.start)/r.duration,n=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(n*n+1e-4)*.01;t=F_(a,Math.sqrt(.0729-a*a),.25,1)}return this._prevEase={start:Be(),duration:e,easing:t},t}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},SG=class{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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()}},EG=class{constructor(e,t){this._tr=t,this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:Jr(this._tr.zoom+(e.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.transform.isPointOnMapSurface(t)?this._tr.unproject(t):void 0},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},CG=class{constructor(){this._tap=new P_({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,r){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(e,t,r);else{let i=t[0],n=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(i)<30;!n||!a?this.reset():r.length>0&&(this._swipePoint=i,this._swipeTouch=r[0].identifier)}}touchmove(e,t,r){if(!this._tapTime)this._tap.touchmove(e,t,r);else if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let i=t[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:n/128*this._zoomRate}}}touchend(e,t,r){if(this._tapTime)this._swipePoint&&r.length===0&&this.reset();else{let i=this._tap.touchend(e,t,r);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},PG=class{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},DG=class{constructor(e,t,r,i){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=r,this._mouseRoll=i;let{aroundCenter:n=!0}=e;this._defaultMovement=n?"circular":"linear",this.around="center",this.movement=this._defaultMovement}enable(e){let t=typeof e=="object"?e:{};this.around=t.around??"center",this.movement=t.around==="pointer"?"linear":t.movement??this._defaultMovement,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()}},AG=class{constructor(e,t,r,i){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},MG=class{constructor(e,t){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=ht.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=t,this._container.appendChild(i);let n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=r,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,t){this._enabled&&(this._map.fire(new Wt("cooperativegestureprevented",{gestureType:e,originalEvent:t})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},IG=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(k.convert(e),this._camera.terrain)}},td=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate,kG=class extends Ao{};function q1(e){return e.panDelta?.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}var zG=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(e,t,r){this._terrainGesture={inFlight:!1,anchorElevation:null,anchorCenterElevation:null},this._rotationPivot=null,this.handleWindowEvent=n=>{this.handleEvent(n,`${n.type}Window`)},this.handleEvent=(n,a)=>{if(n.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let o=n.type==="renderFrame"?void 0:n,s={needsRenderFrame:!1},l={},u={};for(let{handlerName:p,handler:d,allowed:f}of this._handlers){if(!d.isEnabled())continue;let m;if(this._blockedByActive(u,f,p))d.reset();else if(d[a||n.type]){if(BI(n,a||n.type)){let _=ht.mousePos(this._map.getCanvas(),n);m=d[a||n.type](n,_)}else if(LI(n,a||n.type)){let _=n.touches,g=this._getMapTouches(_),y=ht.touchPos(this._map.getCanvas(),g);m=d[a||n.type](n,y,g)}else OI(a||n.type)||(m=d[a||n.type](n));this.mergeHandlerResult(s,l,m,p,o),m?.needsRenderFrame&&this._triggerRenderFrame()}(m||d.isActive())&&(u[p]=d)}let c={};for(let p in this._previousActiveHandlers)u[p]||(c[p]=o);this._previousActiveHandlers=u,(Object.keys(c).length||q1(s))&&(this._changes.push([s,l,c]),this._triggerRenderFrame()),(Object.keys(u).length||q1(s))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=s;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=e,this._camera=t,this._transformProvider=new IG(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iG(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);let i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[n,a,o]of this._listeners)n.addEventListener(a,n===this._ownerDocument?this.handleWindowEvent:this.handleEvent,o)}destroy(){for(let[e,t,r]of this._listeners)e.removeEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){let t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new nG(t,e));let i=t.boxZoom=new oG(t,e,this._transformProvider);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let n=t.cooperativeGestures=new MG(t,e.cooperativeGestures);this._add("cooperativeGestures",n),e.cooperativeGestures&&n.enable();let a=new uG(t,this._transformProvider),o=new EG(t,this._transformProvider);t.doubleClickZoom=new SG(o,a),this._add("tapZoom",a),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new CG;this._add("tapDragZoom",s);let l=t.touchPitch=new vG(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let u=()=>this._camera.transform.centerPoint,c=()=>t.dragRotate.around,h=dG(e,u,c,()=>t.dragRotate.movement),p=fG(e,c),d=mG(e,u,c);t.dragRotate=new DG(e,h,p,d),this._add("mouseRotate",h,["mousePitch"]),this._add("mousePitch",p,["mouseRotate","mouseRoll"]),this._add("mouseRoll",d,["mousePitch"]),e.interactive&&e.dragRotate&&t.dragRotate.enable(e.dragRotate);let f=pG(e),m=new gG(e,t);t.dragPan=new PG(r,f,m),this._add("mousePan",f),this._add("touchPan",m,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let _=new _G,g=new yG;t.touchZoomRotate=new AG(r,g,_,s),this._add("touchRotate",_,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new aG(t,e),["touchPan"]);let y=t.scrollZoom=new TG(t,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",y,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let v=t.keyboard=new bG(t,this._transformProvider);this._add("keyboard",v),e.interactive&&e.keyboard&&t.keyboard.enable()}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!td(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,r){for(let i in e)if(i!==r&&!t?.includes(i))return!0;return!1}_getMapTouches(e){let t=[];for(let r of e){let i=r.target;this._el.contains(i)&&t.push(r)}return t}mergeHandlerResult(e,t,r,i,n){if(!r)return;J(e,r);let a={handlerName:i,originalEvent:r.originalEvent||n};r.zoomDelta!==void 0&&(t.zoom=a),r.panDelta!==void 0&&(t.drag=a),r.rollDelta!==void 0&&(t.roll=a),r.pitchDelta!==void 0&&(t.pitch=a),r.bearingDelta!==void 0&&(t.rotate=a)}_applyChanges(){let e={},t={},r={};for(let[i,n,a]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new k(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.rollDelta&&(e.rollDelta=(e.rollDelta||0)+i.rollDelta),i.around!==void 0&&(e.around=i.around),i.pinchAround!==void 0&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),J(t,n),J(r,a);this._updateMapTransform(e,t,r),this._changes=[]}_updateMapTransform(e,t,r){let i=this._map.terrain;if(!q1(e)){this._fireEvents(t,r,!0);return}let n=this._camera.getTransformForUpdate();if(this._camera.stop(!0),this._turnsAroundPivot(e,t)){this._orbitRotationPivot(n,e,i),this._commitFrame(n,e,t,r);return}let{panDelta:a,zoomDelta:o,bearingDelta:s,pitchDelta:l,rollDelta:u}=e;o>0&&this._terrainGesture.inFlight&&this._camera.moveCenterOntoTerrain(n,o);let{around:c,aroundOnSurface:h}=this._resolveAround(e,i,n),p=i?this._terrainGestureElevation(i,c,h,n,t):void 0,d={panDelta:a,zoomDelta:o,rollDelta:u,pitchDelta:l,bearingDelta:s,around:c,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!n.isPointOnMapSurface(c)&&(c=n.centerPoint);let f=this._computePreZoomAroundLoc(n,c,a,p);this._handleMapControls({terrain:i,tr:n,deltasForHelper:d,preZoomAroundLoc:f,combinedEventsInProgress:t,panDelta:a}),this._commitFrame(n,e,t,r)}_commitFrame(e,t,r,i){this._camera.applyUpdatedTransform(e),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,i,!0)}_turnsAroundPivot(e,t){return e.around?!t.drag&&!t.zoom:!1}_orbitRotationPivot(e,t,r){r&&!this._terrainGesture.inFlight&&(this._terrainGesture.inFlight=!0,this._camera.holdElevation(e,"gesture"));let{panDelta:i,zoomDelta:n,bearingDelta:a,pitchDelta:o,rollDelta:s,around:l}=t;this._rotationPivot??(this._rotationPivot=this._camera.captureRotationPivot(e,l)),this._camera.orbitRotationPivot(e,this._rotationPivot,{panDelta:i,zoomDelta:n,bearingDelta:a,pitchDelta:o,rollDelta:s,around:l})||(this._rotationPivot=null)}_resolveAround(e,t,r){let i=e.pinchAround===void 0?e.around:e.pinchAround;return i||(i=this._camera.transform.centerPoint),t&&!r.isPointOnMapSurface(i)?{around:r.centerPoint,aroundOnSurface:!1}:{around:i,aroundOnSurface:!0}}_terrainGestureElevation(e,t,r,i,n){if(!r)return;if(this._terrainGesture.anchorCenterElevation!==i.elevation&&(n.drag||n.zoom)){let o=i.screenTerrainPointToMercatorCoordinate(t,e);this._terrainGesture.anchorElevation=o?o.z:void 0,this._terrainGesture.anchorCenterElevation=i.elevation}let a=this._terrainGesture.anchorElevation;if(a!=null&&!(t.distSqr(i.centerPoint)<.01)&&!(a-i.elevation>=.9*(i.getCameraAltitude()-i.elevation)))return a}_computePreZoomAroundLoc(e,t,r,i){if(t.distSqr(e.centerPoint)<.01)return e.center;let n=r?t.sub(r):t;return i===void 0?e.screenPointToLocation(n):e.screenPointToLocationAtElevation(n,i)}_handleMapControls({terrain:e,tr:t,deltasForHelper:r,preZoomAroundLoc:i,combinedEventsInProgress:n,panDelta:a}){let o=this._camera.cameraHelper;o.handleMapControlsRollPitchBearingZoom(r,t),!e&&!o.useGlobeControls&&!t.isPointOnMapSurface(r.around)?a&&t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):e?this._terrainGesture.inFlight?!o.useGlobeControls&&r.aroundElevation===void 0&&n.drag&&a?t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):o.handleMapControlsPan(r,t,i):(this._terrainGesture.inFlight=!0,this._camera.holdElevation(t,"gesture"),o.handleMapControlsPan(r,t,i)):o.handleMapControlsPan(r,t,i)}_fireEvents(e,t,r){let i=td(this._eventsInProgress),n=td(e),a={};for(let c in e){let{originalEvent:h}=e[c];this._eventsInProgress[c]||(a[`${c}start`]=h),this._eventsInProgress[c]=e[c]}!i&&n&&this._fireEvent("movestart",n.originalEvent);for(let c in a)this._fireEvent(c,a[c]);n&&this._fireEvent("move",n.originalEvent);for(let c in e){let{originalEvent:h}=e[c];this._fireEvent(c,h)}let o={},s;for(let c in this._eventsInProgress){let{handlerName:h,originalEvent:p}=this._eventsInProgress[c];this._handlersById[h].isActive()||(delete this._eventsInProgress[c],s=t[h]||p,o[`${c}end`]=s)}for(let c in o)this._fireEvent(c,o[c]);let l=td(this._eventsInProgress),u=(i||n)&&!l;if(u&&this._terrainGesture.inFlight){let c=this._camera.releaseElevation();this._terrainGesture={inFlight:!1,anchorElevation:null,anchorCenterElevation:null},this._camera.applyTransformChange(h=>{this._map.getCenterClampedToGround()&&(this._map.terrain?this._camera.putCenterBackOnTerrain(h,this._map.terrain,c):h.setElevation(0))})}if(r&&u){this._updatingCamera=!0;let c=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),h=p=>p!==0&&-this._bearingSnap<p&&p<this._bearingSnap;c&&(c.essential||!Nr.prefersReducedMotion)?(h(c.bearing||this._map.getBearing())&&(c.bearing=0),c.freezeElevation=!0,this._map.easeTo(c,{originalEvent:s})):(this._fireEvent("moveend",s),h(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}u&&(this._rotationPivot=null)}_fireEvent(e,t){this._camera.fire(new ne(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new kG("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},FG=class{constructor(e,t,r){this.holder=e,this.lift=null,this._terrainChanged=!1,this._dem=t?"awaiting":"loaded",this.keepsTerrainBelowMaxZoomForCenter=r}get tookDem(){return this._dem==="taken"}noteTerrainChange(){this._terrainChanged=!0}take(e,t){let r=!1;if(this._terrainChanged&&(this._terrainChanged=!1,t.getElevationAndDEMStateForLngLat(e.center,e).demState!=="loaded"&&(e.setElevation(0),this._dem="awaiting",r=!0)),this._dem!=="awaiting")return r;let i=t.getDrawnElevationForLngLat(e.center,!0);if(i!==void 0)return e.setElevation(i),this._dem="taken",!0;let n=t.getDrawnElevationForLngLat(e.center);return n===void 0||n===e.elevation?r:(e.setElevation(n),!0)}},rT=.01,RG=class extends lr{constructor(e){super(),this._elevationHold=null,this._renderFrameCallback=()=>{let t=Math.min((Be()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=fd(),this.cameraHelper=new qu,e.minZoom!==void 0&&this.transform.setMinZoom(e.minZoom),e.maxZoom!==void 0&&this.transform.setMaxZoom(e.maxZoom),e.minPitch!==void 0&&this.transform.setMinPitch(e.minPitch),e.maxPitch!==void 0&&this.transform.setMaxPitch(e.maxPitch),e.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(e.renderWorldCopies),e.transformConstrain!==null&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=e.centerClampedToGround??!0,this.transformCameraUpdate=e.transformCameraUpdate??null,this._stopHandlers=e.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}setTerrain(e){this.terrain=e,e&&this._elevationHold?.noteTerrainChange(),this.applyTerrainChange()}migrateProjection(e,t){if(e.apply(this.transform,!0),this.transform=e,this.cameraHelper=t,this._requestedCameraState){let r=e.clone();r.apply(this._requestedCameraState,!0),this._requestedCameraState=r}}getCenter(){return new H(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,t,r){return e=k.convert(e).mult(-1),this.panTo(this.transform.center,J({offset:e},t),r)}panTo(e,t,r){return this.easeTo(J({center:e},t),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,r){return this.easeTo(J({zoom:e},t),r)}zoomIn(e,t){return this.zoomTo(Jr(this.getZoom()+1,this._zoomSnap),e,t),this}zoomOut(e,t){return this.zoomTo(Jr(this.getZoom()-1,this._zoomSnap),e,t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,t){return e!=this.transform.fov&&(this.applyTransformChange(r=>r.setFov(e)),this.fire(new ne("movestart",t)).fire(new ne("move",t)).fire(new ne("moveend",t))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,r){return this.easeTo(J({bearing:e},t),r)}resetNorth(e,t){return this.rotateTo(0,J({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(J({bearing:0,pitch:0,roll:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getRoll(){return this.transform.roll}setRoll(e,t){return this.jumpTo({roll:e},t),this}cameraForBounds(e,t){e=Zn.convert(e).adjustAntiMeridian();let r=t?.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,t)}_cameraForBoxAndBearing(e,t,r,i){let n={top:0,bottom:0,right:0,left:0};if(i=J({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},i),typeof i.padding=="number"){let p=i.padding;i.padding={top:p,bottom:p,right:p,left:p}}let a=J(n,i.padding);i.padding=a;let o=this.transform,s=new Zn(e,t),l={top:0,bottom:0,right:0,left:0},u=i.absolutePadding?l:a,c=i.absolutePadding?a:J(l,o.padding),h=this.cameraHelper.cameraForBoxAndBearing(i,u,c,s,r,o);if(h)return this._zoomSnap&&(h.zoom=Jr(h.zoom,this._zoomSnap,-1)),i.absolutePadding?{...h,padding:a}:h}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(e,t,r,i,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(k.convert(e)),this.transform.screenPointToLocation(k.convert(t)),r,i),i,n)}_fitInternal(e,t,r){return e?(t=J(e,t),t.absolutePadding?(t.padding=e.padding,delete t.absolutePadding):delete t.padding,t.linear?this.easeTo(t,r):this.flyTo(t,r)):this}jumpTo(e,t){this.stop(),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=!1,n=!1,a=!1,o=r.zoom;if(this.terrain&&this.getCenterClampedToGround()){let{elevation:l,demState:u}=this.terrain.getElevationAndDEMStateForLngLat(e.center?H.convert(e.center):r.center,r);u!=="loading"&&r.setElevation(l)}this.cameraHelper.handleJumpToCenterZoom(r,e);let s=r.zoom!==o;return e.elevation!==void 0&&r.elevation!==+e.elevation&&r.setElevation(+e.elevation),e.bearing!==void 0&&r.bearing!==+e.bearing&&(i=!0,r.setBearing(+e.bearing)),e.pitch!==void 0&&r.pitch!==+e.pitch&&(n=!0,r.setPitch(+e.pitch)),e.roll!==void 0&&r.roll!==+e.roll&&(a=!0,r.setRoll(+e.roll)),e.padding!=null&&!r.isPaddingEqual(e.padding)&&r.setPadding(e.padding),this.applyUpdatedTransform(r),this.fire(new ne("movestart",t)).fire(new ne("move",t)),s&&this.fire(new ne("zoomstart",t)).fire(new ne("zoom",t)).fire(new ne("zoomend",t)),i&&this.fire(new ne("rotatestart",t)).fire(new ne("rotate",t)).fire(new ne("rotateend",t)),n&&this.fire(new ne("pitchstart",t)).fire(new ne("pitch",t)).fire(new ne("pitchend",t)),a&&this.fire(new ne("rollstart",t)).fire(new ne("roll",t)).fire(new ne("rollend",t)),this.fire(new ne("moveend",t))}calculateAnchoredCameraOptions(e){let t=this.transform.clone(),r=H.convert(e.anchorLocation),i=k.convert(e.anchorScreenPoint),n={panDelta:i.sub(this.transform.locationToScreenPoint(r,this.terrain)),zoomDelta:e.zoom===void 0?0:e.zoom-t.zoom,bearingDelta:0,pitchDelta:0,rollDelta:0,around:i,aroundElevation:this.terrain?.getElevationForLngLat(r,t)};return this.cameraHelper.handleMapControlsRollPitchBearingZoom(n,t),this.cameraHelper.handleMapControlsPan(n,t,r),{center:t.center,zoom:t.zoom}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){let a=this.transform.calculateCenterFromCameraLngLatAlt(e,t,r,i);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:r,pitch:i,roll:n}}easeTo(e,t){this._stop(!1,e.easeId),e=J({offset:[0,0],duration:500,easing:Q1},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap)),(e.animate===!1||!e.essential&&Nr.prefersReducedMotion)&&(e.duration=0);let r=this.getTransformForUpdate(),i=this.getBearing(),n=r.pitch,a=r.roll,o=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),s=e.pitch===void 0?n:+e.pitch,l=e.roll===void 0?a:this._normalizeBearing(e.roll,a),u=e.padding===void 0?r.padding:e.padding,c=k.convert(e.offset),h,p;e.around&&(h=H.convert(e.around),p=r.locationToScreenPoint(h));let d={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},f=this.cameraHelper.handleEaseTo(r,{bearing:o,pitch:s,roll:l,padding:u,around:h,aroundPoint:p,offsetAsPoint:c,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating||(this._rotating=i!==o),this._pitching||(this._pitching=s!==n),this._rolling||(this._rolling=l!==a),this._padding=!r.isPaddingEqual(u),this._zooming||(this._zooming=f.isZooming),this._easeId=e.easeId,this._prepareEase(t,e.noMoveStart,d,{tr:r,center:f.elevationCenter,freeze:e.freezeElevation}),this._ease(m=>{f.easeFunc(m),this.terrain&&!e.freezeElevation&&this._updateElevation(m,r),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},m=>{this._afterEase(t,m,e.freezeElevation)},e),this}_prepareEase(e,t,r={},i){this._moving=!0,this.terrain&&i&&(this._prepareElevation(i.center,i.tr),i.freeze&&this.holdElevation(i.tr,"animation")),!t&&!r.moving&&this.fire(new ne("movestart",e)),this._zooming&&!r.zooming&&this.fire(new ne("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new ne("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new ne("pitchstart",e)),this._rolling&&!r.rolling&&this.fire(new ne("rollstart",e))}_prepareElevation(e,t){this._elevationCenter=e,this._elevationStart=t.elevation;let{elevation:r,demState:i}=this.terrain.getElevationAndDEMStateForLngLat(e,t);this._elevationTarget=i==="loading"?t.elevation:r,this.elevationFreeze=!0}_updateElevation(e,t){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(t.center,t),t.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,t.tileZoom));let{elevation:r,demState:i}=this.terrain.getElevationAndDEMStateForLngLat(this._elevationCenter,t),n=i==="loading"?this._elevationTarget:r;if(e<1&&n!==this._elevationTarget){let a=this._elevationTarget-this._elevationStart,o=(n-(a*e+this._elevationStart))/(1-e);this._elevationStart+=e*(a-o),this._elevationTarget=n}this.getCenterClampedToGround()&&t.setElevation(ot.number(this._elevationStart,this._elevationTarget,e))}holdElevation(e,t){this.elevationFreeze=!0;let r=!!this.terrain&&this.getCenterClampedToGround()&&this.terrain.getElevationAndDEMStateForLngLat(e.center,e).demState!=="loaded",i=this.terrain?this._terrainHeightAboveMaxZoomForCenter(e):void 0;this._elevationHold=new FG(t,r,i!==void 0&&i<=rT)}releaseElevation(){let e=this._elevationHold?.tookDem??!1;return this.elevationFreeze=!1,this._elevationHold=null,e}putCenterBackOnTerrain(e,t,r){if(r&&t.getDrawnElevationForLngLat(e.center,!0)===void 0){e.setElevation(t.getElevationForLngLat(e.center,e));let i=this._raiseCameraByPitchAndZoom(e);i!==e&&e.apply(i,!1)}else e.recalculateZoomAndCenter(t)}_takeLandedElevation(e){return!this._elevationHold||!this.terrain||!this.getCenterClampedToGround()?!1:this._elevationHold.take(e,this.terrain)}applyTerrainChange(){if(this.elevationFreeze){let i=this._requestedCameraState;this._elevationHold?.holder==="gesture"&&i&&this._takeLandedElevation(i)&&this.applyUpdatedTransform(i);return}let e=this.transform;if(e.setMinElevationForCurrentTile(this.terrain?this.terrain.getMinTileElevationForLngLatZoom(e.center,e.tileZoom):0),!this.getCenterClampedToGround())return;if(!this.terrain){e.setElevation(0);return}let{elevation:t,demState:r}=this.terrain.getElevationAndDEMStateForLngLat(e.center,e);r!=="loading"&&e.setElevation(t)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState)}_keepCameraAboveTerrain(e){let t=this._elevationHold;if(!this.terrain||!t||e.pitch>=90||!this.getCenterClampedToGround()||e.getClippingPlane())return this._raiseCameraByPitchAndZoom(e);let r=t.holder==="gesture",i=t.lift&&t.lift.heldElevation+t.lift.height===e.elevation?t.lift:{heldElevation:e.elevation,height:0},n=this._terrainHeightAboveMaxZoomForCenter(e);n!==void 0&&n<=rT&&(t.keepsTerrainBelowMaxZoomForCenter=!0);let a=t.keepsTerrainBelowMaxZoomForCenter&&n!==void 0?n:-1/0,o=r?this._terrainHeightAboveCamera(e):-1/0,s=Math.max(0,Math.max(o,a)+i.height);return s!==i.height&&e.setElevation(i.heldElevation+s),t.lift=s>0?{heldElevation:i.heldElevation,height:s}:null,r?e:this._raiseCameraByPitchAndZoom(e)}_raiseCameraByPitchAndZoom(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90||e.getClippingPlane())return e;let t=e.getCameraLngLat(),r=this.terrain?this._terrainHeightAboveCamera(e):-e.getCameraAltitude();if(r<=0)return e;let i=e.clone();for(let n=0;n<3&&r>0;n++){let{zoom:a,pitch:o}=i.calculateCameraOptionsFromTo(t,i.getCameraAltitude()+r,i.center,i.elevation);i.setZoom(a),i.setPitch(o),r=this.terrain?this._terrainHeightAboveCamera(i):-i.getCameraAltitude()}return i}_terrainHeightAboveCamera(e){let t=this.terrain.getElevationForLngLat(e.getCameraLngLat(),e)-e.getCameraAltitude(),r=e.getClippingPlane()?null:this.terrain.getCoverageIndex();if(!r)return t;let[i,n,a,o]=e.getCameraFrustum().points;for(let s=0;s<=2;s++){let l=s/2;for(let u=0;u<=2;u++){let c=u/2,h=(1-c)*(1-l),p=c*(1-l),d=c*l,f=(1-c)*l,m=h*i[0]+p*n[0]+d*a[0]+f*o[0],_=h*i[1]+p*n[1]+d*a[1]+f*o[1],g=h*i[2]+p*n[2]+d*a[2]+f*o[2],y=tl(r,this.terrain.exaggeration,m,_,e.worldCoordinateHelper.wraps);y.covered&&(t=Math.max(t,y.elevation-g))}}return t}_terrainHeightAboveMaxZoomForCenter(e){let t=this.terrain.getCoverageIndex();if(!t)return;let r=e.worldCoordinateHelper,i=e.getCameraLngLat(),n=r.worldFromLngLat(i.lng,i.lat),a=r.worldFromLngLat(e.center.lng,e.center.lat),o=Bt(e.zoom-e.maxZoom),s=tl(t,this.terrain.exaggeration,Ma(n.x,a.x,o),Ma(n.y,a.y,o),r.wraps);return s.covered?s.elevation-Ma(e.getCameraAltitude(),e.elevation,o):void 0}moveCenterOntoTerrain(e,t){if(!this.terrain||!this.getCenterClampedToGround()||e.getClippingPlane())return;let{center:r,elevation:i,zoom:n}=e;e.recalculateZoomAndCenter(this.terrain),(!(e.zoom>n-t&&e.zoom<e.maxZoom)||Math.abs(this.terrain.getElevationForLngLat(e.center,e)-e.elevation)>=1)&&(e.setZoom(n),e.setCenter(r),e.setElevation(i))}captureRotationPivot(e,t){if(!aT(e,t))return{point:e.centerPoint,location:e.center,distance:yd(e,e.center)};let r=this.terrain?e.screenTerrainPointToMercatorCoordinate(t,this.terrain):null,i=r?r.toLngLat():e.screenPointToLocation(t);return r&&this.cameraHelper.useGlobeControls?{point:e.locationToScreenPoint(i),location:i,distance:yd(e,i)}:{point:t,location:i,elevation:r?.z,distance:yd(e,i,r?.z)}}orbitRotationPivot(e,t,r){if(t.point.equals(e.centerPoint))return this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,e),!0;let i=this._turnAroundPivot(e,t,r)??this._turnAroundPivot(e,t,{...r,pitchDelta:0,rollDelta:0});return i?(e.apply(i,!1),!0):(this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,e),!1)}_turnAroundPivot(e,t,r){let i=e.clone();return this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,i),i.pitch>=90||!aT(i,t.point)?null:LG(i,t)&&BG(i,t)?i:null}applyUpdatedTransform(e){this._takeLandedElevation(e);let t=this._keepCameraAboveTerrain(e);if(!this.transformCameraUpdate){t!==this.transform&&this.transform.apply(t,!1);return}let r=t.clone(),{center:i,zoom:n,roll:a,pitch:o,bearing:s,elevation:l}=this.transformCameraUpdate(r);i&&r.setCenter(i),l!==void 0&&r.setElevation(l),n!==void 0&&r.setZoom(n),a!==void 0&&r.setRoll(a),o!==void 0&&r.setPitch(o),s!==void 0&&r.setBearing(s),this.transform.apply(l===void 0?r:this._raiseCameraByPitchAndZoom(r),!1)}applyTransformChange(e){let t=this._requestedCameraState!==void 0,r=this.getTransformForUpdate();e(r),this.applyUpdatedTransform(r),t||delete this._requestedCameraState}_fireMoveEvents(e){this.fire(new ne("move",e)),this._zooming&&this.fire(new ne("zoom",e)),this._rotating&&this.fire(new ne("rotate",e)),this._pitching&&this.fire(new ne("pitch",e)),this._rolling&&this.fire(new ne("roll",e))}_afterEase(e,t,r=!1){this._takeLandedElevation(this.transform);let i=this.releaseElevation();if(this.terrain&&r&&this.getCenterClampedToGround()&&this.putCenterBackOnTerrain(this.transform,this.terrain,i),this._easeId&&t&&this._easeId===t)return;delete this._easeId;let n=this._zooming,a=this._rotating,o=this._pitching,s=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,n&&this.fire(new ne("zoomend",e)),a&&this.fire(new ne("rotateend",e)),o&&this.fire(new ne("pitchend",e)),s&&this.fire(new ne("rollend",e)),this.fire(new ne("moveend",e))}flyTo(e,t){if(!e.essential&&Nr.prefersReducedMotion)return this.easeTo(e,t);this.stop(),e=J({offset:[0,0],speed:1.2,curve:1.42,easing:Q1},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=r.bearing,n=r.pitch,a=r.roll,o=r.padding,s=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),l=e.pitch===void 0?n:+e.pitch,u=e.roll===void 0?a:this._normalizeBearing(e.roll,a),c=e.padding===void 0?r.padding:e.padding,h=k.convert(e.offset),p=r.centerPoint.add(h),d=r.screenPointToLocation(p),f=this.cameraHelper.handleFlyTo(r,{bearing:s,pitch:l,roll:u,padding:c,locationAtOffset:d,offsetAsPoint:h,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),m=e.curve,_=Math.max(r.width,r.height),g=_/f.scaleOfZoom,y=f.pixelPathLength,v=_/f.scaleOfMinZoom;m=Math.min(m,Math.sqrt(v/y*2));let x=m*m;function b(I){let C=(g*g-_*_+(I?-1:1)*x*x*y*y)/(2*(I?g:_)*x*y);return Math.log(Math.sqrt(C*C+1)-C)}function w(I){return(Math.exp(I)-Math.exp(-I))/2}function T(I){return(Math.exp(I)+Math.exp(-I))/2}function S(I){return w(I)/T(I)}let E=b(!1),P=function(I){return T(E)/T(E+m*I)},D=function(I){return _*((T(E)*S(E+m*I)-w(E))/x)/y},F=(b(!0)-E)/m;if(Math.abs(y)<2e-6||!isFinite(F)){if(Math.abs(_-g)<1e-6)return this.easeTo(e,t);let I=g<_?-1:1;F=Math.abs(Math.log(g/_))/m,D=()=>0,P=C=>Math.exp(I*m*C)}if(e.duration!==void 0)e.duration=+e.duration;else{let I=e.screenSpeed===void 0?+e.speed:+e.screenSpeed/m;e.duration=1e3*F/I}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=i!==s,this._pitching=l!==n,this._rolling=u!==a,this._padding=!r.isPaddingEqual(c),this._prepareEase(t,!1,{},{tr:r,center:f.targetCenter,freeze:e.freezeElevation}),this._ease(I=>{let C=I*F,A=1/P(C),M=D(C);this._rotating&&r.setBearing(ot.number(i,s,I)),this._pitching&&r.setPitch(ot.number(n,l,I)),this._rolling&&r.setRoll(ot.number(a,u,I)),this._padding&&(r.interpolatePadding(o,c,I),p=r.centerPoint.add(h)),f.easeFunc(I,A,M,p),this.terrain&&!e.freezeElevation&&this._updateElevation(I,r),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},()=>{this._afterEase(t,void 0,e.freezeElevation)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}return e||this._stopHandlers(),this}_ease(e,t,r){r.animate===!1||r.duration===0?(e(1),t()):(this._easeStart=Be(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){e=xi(e,-180,180);let r=Math.abs(e-t);return Math.abs(e-360-t)<r&&(e-=360),Math.abs(e+360-t)<r&&(e+=360),e}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};function LG(e,t){let r=1,i=iT(e,t),n=t.distance/i;for(let a=0;a<5&&!nT(i,t);a++){if(!Number.isFinite(n)||n<=0)return!1;let o=e.zoom;e.setZoom(o+Ut(r/n));let s=r*Bt(o-e.zoom);if(s===r)return!0;let l=iT(e,t);n=s+(t.distance-l)*(s-r)/(l-i),r=s,i=l}return nT(i,t)}function iT(e,t){return e.setLocationAtPoint(t.location,t.point,t.elevation),yd(e,t.location,t.elevation)}function nT(e,t){return Math.abs(e/t.distance-1)<1e-7}function BG(e,t){return t.elevation!==void 0||k_(Kd(e.screenPointToLocation(t.point),0),Kd(t.location,0))<t.distance*1e-4}function aT(e,t){return e.isPointOnMapSurface(new k(t.x,t.y-16))}function yd(e,t,r=e.elevation){return k_(Kd(e.getCameraLngLat(),e.getCameraAltitude()),Kd(t,r))}function Kd(e,t){let r=Ft(e);return Xe(r,r,Er+t)}var aD={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'},OG=class{constructor(e=aD){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=t=>{t&&(t.type==="terrain"||t.dataType==="style"||t.dataType==="source"&&(t.sourceDataType==="metadata"||t.sourceDataType==="visibility"))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):!this._container.classList.contains("maplibregl-compact")&&!this._container.classList.contains("maplibregl-attrib-empty")&&(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=ht.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ht.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ht.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(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(i=>typeof i=="string"?i:"")):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let i=this._map.style.stylesheet;this.styleOwner=i.owner,this.styleId=i.id}let t=this._map.style.tileManagers;for(let i in t){let n=t[i];if(n.used||n.usedForTerrain){let a=n.getSource();a.attribution&&!e.includes(a.attribution)&&e.push(a.attribution)}}e=e.filter(i=>String(i).trim()),e.sort((i,n)=>i.length-n.length),e=e.filter((i,n)=>{for(let a=n+1;a<e.length;a++)if(e[a].includes(i))return!1;return!0});let r=e.join(" | ");if(r!==this._attribHTML){if(this._attribHTML=r,e.length){let i=document.createDocumentFragment(),n=!0;for(let a of e){let o=ht.sanitize(a);o.hasChildNodes()&&(n||i.append(" | "),i.append(o),n=!1)}this._innerContainer.replaceChildren(i),this._container.classList.remove("maplibregl-attrib-empty")}else this._container.classList.add("maplibregl-attrib-empty");this._updateCompact(),this._editLink=null}}},jG=class{constructor(e={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let r=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&r.classList.add("maplibregl-compact"):r.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options?.compact,this._container=ht.create("div","maplibregl-ctrl");let t=ht.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},NG=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(let i of r)if(i.id===e){i.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];let r=!1,i;for(let n of t)if(!n.cancelled){try{n.callback(e)}catch(a){r||(r=!0,i=a)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,r)throw i}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},VG=dt([{name:"a_pos3d",type:"Int16",components:3}]),UG=class extends lr{constructor(e){super(),this._lastTilesetChange=Be(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,t){this.tileManager.update(e,t),this._renderableTilesKeys=[];let r={},i=!1;for(let n of Cc(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:t}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.terrainRttPosMatrix32f=new Float32Array(16),Ln(n.terrainRttPosMatrix32f,0,R,R,0,0,1),this._tiles[n.key]=new dP(n,this.tileSize),this._lastTilesetChange=Be(),i=!0);for(let n in this._tiles)r[n]||(this._tiles[n].releaseRTT(this.tileManager.map.painter),delete this._tiles[n],i=!0);return i}releaseRTT(e){for(let t in this._tiles){let r=this._tiles[t];(r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&r.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let t={};for(let r of this._renderableTilesKeys){let i=this._tiles[r].tileID,n=e.clone(),a=uo();if(i.canonical.equals(e.canonical))Ln(a,0,R,R,0,0,1);else if(i.canonical.isChildOf(e.canonical)){let o=i.canonical.z-e.canonical.z,s=i.canonical.x-(i.canonical.x>>o<<o),l=i.canonical.y-(i.canonical.y>>o<<o),u=R>>o;Ln(a,0,u,u,0,0,1),At(a,a,[-s*u,-l*u,0])}else if(e.canonical.isChildOf(i.canonical)){let o=e.canonical.z-i.canonical.z,s=e.canonical.x-(e.canonical.x>>o<<o),l=e.canonical.y-(e.canonical.y>>o<<o),u=R>>o;Ln(a,0,R,R,0,0,1),At(a,a,[s*u,l*u,0]),gr(a,a,[1/2**o,1/2**o,0])}else continue;n.terrainRttPosMatrix32f=new Float32Array(a),t[r]=n}return t}_getTerrainCoordsForTileRanges(e,t){let r={};for(let i of this._renderableTilesKeys){let n=this._tiles[i].tileID;if(!this._isWithinTileRanges(n,t))continue;let a=e.clone(),o=uo();if(n.canonical.z===e.canonical.z){let s=e.canonical.x-n.canonical.x+e.wrap*(1<<e.canonical.z),l=e.canonical.y-n.canonical.y;Ln(o,0,R,R,0,0,1),At(o,o,[s*R,l*R,0])}else if(n.canonical.z>e.canonical.z){let s=n.canonical.z-e.canonical.z,l=n.canonical.x-(n.canonical.x>>s<<s)+e.wrap*(1<<n.canonical.z),u=n.canonical.y-(n.canonical.y>>s<<s),c=e.canonical.x-(n.canonical.x>>s),h=e.canonical.y-(n.canonical.y>>s),p=R>>s;Ln(o,0,p,p,0,0,1),At(o,o,[-l*p+c*R,-u*p+h*R,0])}else{let s=e.canonical.z-n.canonical.z,l=e.canonical.x-(e.canonical.x>>s<<s)+e.wrap*(1<<e.canonical.z),u=e.canonical.y-(e.canonical.y>>s<<s),c=(e.canonical.x>>s)-n.canonical.x,h=(e.canonical.y>>s)-n.canonical.y,p=R<<s;Ln(o,0,p,p,0,0,1),At(o,o,[l*R+c*p,u*R+h*p,0])}a.terrainRttPosMatrix32f=new Float32Array(o),r[i]=a}return r}getSourceTile(e,t){let r=this.tileManager._source,i=e.overscaledZ-this.deltaZoom;if(i>r.maxzoom&&(i=r.maxzoom),i<r.minzoom)return;this._sourceTileCache[e.key]?.zoom!==i&&(this._sourceTileCache[e.key]={zoom:i,key:e.scaledTo(i).key});let n=this.findTileInCaches(this._sourceTileCache[e.key].key);if(!n?.dem&&t)for(;i>=r.minzoom&&!n?.dem;)n=this.findTileInCaches(e.scaledTo(i--).key);return n}isStillWaitingForDEM(e){let t=this.tileManager._source,r=Math.min(e.overscaledZ-this.deltaZoom,t.maxzoom);if(r<t.minzoom)return!1;let i=e.scaledTo(r);return t.hasTile&&!t.hasTile(i)?!1:this.findTileInCaches(i.key)?.state!=="errored"}findTileInCaches(e){let t=this.tileManager.getTileByID(e);return t||(t=this.tileManager._outOfViewCache.getByKey(e),t)}anyTilesAfterTime(e=Be()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){let r=t[e.canonical.z];return!!r&&(e.wrap>r.minWrap||e.wrap<r.maxWrap||e.canonical.x>=r.minTileXWrapped&&e.canonical.x<=r.maxTileXWrapped&&e.canonical.y>=r.minTileY&&e.canonical.y<=r.maxTileY)}},$G=class{constructor(e,t,r,i="auto",n=()=>nl){this._meshCache={},this.painter=e,this._getWorldCoordinateHelper=n,this.tileManager=new UG(t),this.options=r,this.exaggeration=typeof r.exaggeration=="number"?r.exaggeration:1,this._terrainSkirtLength=i,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this.coverage=new IV(this.tileManager,this.exaggeration,()=>this._worldCoordinateHelper)}destroy(){this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._heightMapFbo&&(this._heightMapFbo=(this._heightMapFbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null));for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,t,r,i=R){let n=e.normalizeCoordinates(t,r,i);if(!n)return 0;let a=this.coverage.getSampler(n.tileID);return a?a(n.x,n.y,i):0}getElevationForLngLatZoom(e,t){let r=this._worldCoordinateHelper;if(!E1(t,r.wraps?e.wrap():e,r))return 0;let{tileID:i,worldX:n,worldY:a}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getElevation(i,n%R,a%R,R)}getElevationForLngLat(e,t){let r=this.getDrawnElevationForLngLat(e);return r===void 0?this.getElevationForLngLatZoom(e,this._getFallbackZoom(t)):r}getDrawnElevationForLngLat(e,t=!1){return this.coverage.sample(e,t)}getElevationAndDEMStateForLngLat(e,t){let r=this.getElevationForLngLat(e,t);if(r!==0||this.getDrawnElevationForLngLat(e)!==void 0)return{elevation:r,demState:"loaded"};let i=this._getFallbackZoom(t),n=this._worldCoordinateHelper;if(!E1(i,n.wraps?e.wrap():e,n))return{elevation:r,demState:"none"};let{tileID:a}=this._getOverscaledTileIDFromLngLatZoom(e,i);return this.tileManager.getSourceTile(a,!0)?.dem?{elevation:r,demState:"loaded"}:{elevation:r,demState:this.tileManager.isStillWaitingForDEM(a)?"loading":"none"}}_getFallbackZoom(e){return Math.min(e.tileZoom,this.tileManager.maxzoom)}getElevation(e,t,r,i=R){return this.getDEMElevation(e,t,r,i)*this.exaggeration}resetElevationCache(){this.coverage.reset()}getCoverageIndex(){return this.coverage.getIndex()}_getDEMTileMatrix(e,t){let r=`${t.tileID.key}/${e.key}`,i=this._demMatrixCache.get(r);if(i)return i;let n=e.canonical.z-t.tileID.canonical.z,a=e.canonical.x-(e.canonical.x>>n<<n),o=e.canonical.y-(e.canonical.y>>n<<n),s=XM(new Float64Array(16),[1/(R<<n),1/(R<<n),0]);return At(s,s,[a*R,o*R,0]),this._demMatrixCache.set(r,s),s}getTerrainData(e){if(!this._emptyDemTexture){let i=this.painter.context,n=new Ye({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ot(i,n,i.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ot(i,new Ye({width:1,height:1}),i.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=Gi([])}let t=this.tileManager.getSourceTile(e,!0);if(t?.dem&&(!t.demTexture||t.needsTerrainPrepare)){let i=this.painter.context;t.demTexture||(t.demTexture=this.painter.getTileTexture(t.dem.stride)),t.demTexture?t.demTexture.update(t.dem.getPixels(),{premultiply:!1}):t.demTexture=new Ot(i,t.dem.getPixels(),i.gl.RGBA,{premultiply:!1}),t.demTexture.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),t.needsTerrainPrepare=!1}let r=t?this._getDEMTileMatrix(e,t):this._emptyDemMatrix;return{u_depth:2,u_terrain:3,u_terrain_dim:t?.dem?.dim||1,u_terrain_matrix:r,u_terrain_unpack:t?.dem?.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(t?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:t}}getFramebuffer(){let e=this.painter,t=e.width/devicePixelRatio,r=e.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==t||this._fbo.height!==r)&&(this._fbo.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture),this._fboDepthTexture||(this._fboDepthTexture=new Ot(e.context,{width:t,height:r,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(t,r,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,t,r))),this._fbo.colorAttachment.set(this._fboDepthTexture.texture),this._fbo}getHeightMapFramebuffer(e){return this._heightMapFbo||(this._heightMapFbo=this.painter.context.createFramebuffer(1,1,!1,!1)),this._heightMapFbo.colorAttachment.set(e),this._heightMapFbo}getTerrainMesh(e,t){let r=t&&e.canonical.y===0,i=t&&e.canonical.y===(1<<e.canonical.z)-1,n=`m_${r?"n":""}_${i?"s":""}`;if(this._meshCache[n])return this._meshCache[n];let a=this.painter.context,o=new dz,s=new yn,l=this.meshSize,u=R/l,c=l*l;for(let p=0;p<=l;p++)for(let d=0;d<=l;d++)o.emplaceBack(d*u,p*u,0);for(let p=0;p<c;p+=l+1)for(let d=0;d<l;d++)s.emplaceBack(d+p,l+d+p+1,l+d+p+2),s.emplaceBack(d+p,l+d+p+2,d+p+1);this._terrainSkirtLength!=="none"&&this._buildSkirts(o,s,l,u,r,i);let h=new hc(a.createVertexBuffer(o,VG.members),a.createIndexBuffer(s),ct.simpleSegment(0,0,o.length,s.length));return this._meshCache[n]=h,h}getSkirtLength(e){return this._worldCoordinateHelper.metersPerWorldUnit(.5,.5)/2**Math.max(e,0)/5}getMinTileElevationForLngLatZoom(e,t){let r=this._worldCoordinateHelper;if(!E1(t,r.wraps?e.wrap():e,r))return 0;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getMinMaxElevation(i).minElevation??0}getMinMaxElevation(e){let t=this.tileManager.getSourceTile(e,!0),r={minElevation:null,maxElevation:null};return t?.dem&&(r.minElevation=t.dem.min*this.exaggeration,r.maxElevation=t.dem.max*this.exaggeration),r}get _worldCoordinateHelper(){return this._getWorldCoordinateHelper()}_getOverscaledTileIDFromLngLatZoom(e,t){let r=this._worldCoordinateHelper,i=r.wraps?e.wrap():e,n=r.worldFromLngLat(i.lng,i.lat),a=(1<<t)*R,o=n.x*a,s=n.y*a;return{tileID:new ir(t,0,t,Math.floor(o/R),Math.floor(s/R)),worldX:o,worldY:s}}_buildSkirts(e,t,r,i,n,a){let o=e.length,s=o+(r+1),l=(r+1)*r,u=n?Nu:0,c=+!n,h=a?Vu:R,p=+!a;for(let m=0;m<=r;m++)e.emplaceBack(m*i,u,c);for(let m=0;m<=r;m++)e.emplaceBack(m*i,h,p);for(let m=0;m<r;m++)t.emplaceBack(l+m,s+m,s+m+1),t.emplaceBack(l+m,s+m+1,l+m+1),t.emplaceBack(0+m,o+m+1,o+m),t.emplaceBack(0+m,0+m+1,o+m+1);let d=e.length,f=d+(r+1)*2;for(let m of[0,1])for(let _=0;_<=r;_++)for(let g of[0,1])e.emplaceBack(m*R,_*i,g);for(let m=0;m<r*2;m+=2)t.emplaceBack(d+m,d+m+1,d+m+3),t.emplaceBack(d+m,d+m+3,d+m+2),t.emplaceBack(f+m,f+m+3,f+m+1),t.emplaceBack(f+m,f+m+2,f+m+3)}},oT=["none","zoom","sourceTiles","visibleLayers","revision"],sT=class{constructor(e,t,r,i){this._tileKeys=e.map(n=>n.key).sort().join(),this._revision=t,this._zoom=r,this._visibleLayerIds=i}difference(e){return this._revision===e?._revision?this._visibleLayerIds===e._visibleLayerIds?this._tileKeys===e._tileKeys?this._zoom===e._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},oD={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};function G1(e){return Ef(e)?`custom-layer:${e.id}`:e.source}function D_(e){return Ef(e)?e.implementation.renderToTerrainTile!==void 0:oD[e.type]===!0}function qG(e,t){let r=[],i=!1;for(let n of t){let a=D_(e._layers[n]);a&&!i&&r.push([]),a&&r[r.length-1].push(n),i=a}return r}var GG=class{constructor(e,t){this.needsFollowUpFrame=!1,this.painter=e,this.terrain=t,this.rttSize=t.tileManager.tileSize*t.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}prepareForRender(e,t,r){let i=t!==this._lastPrepareZoom;this._lastPrepareZoom=t,this._stacks=[],this._prevRenderedToTexture=!1,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(u=>!e._layers[u].isHidden(t));let n=qG(e,this._renderableLayerIds),a=this._renderableLayerIds.join(),o=new Set;for(let u of this._renderableLayerIds){let c=e._layers[u],h=c.source;h&&oD[c.type]&&o.add(h)}this._coordsAscending={},this._rttFingerprints={};for(let u of o){let c=e.tileManagers[u];if(!c)continue;this._coordsAscending[u]={};let h=this._coordsAscending[u],p=c.getSource(),d=p instanceof Tc?p.terrainTileRanges:null;for(let _ of c.getVisibleCoordinates()){let g=this.terrain.tileManager.getTerrainCoords(_,d);for(let y in g)h[y]||(h[y]=[]),h[y].push(g[y])}this._rttFingerprints[u]={};let f=this._rttFingerprints[u],m=c.getState().revision;for(let _ in h)f[_]=new sT(h[_],m,t,a)}for(let u of this._renderableLayerIds){let c=e._layers[u];if(!Ef(c)||!D_(c))continue;let h=c.implementation.terrainTileRevision??0,p={};for(let d of this._renderableTiles)p[d.tileID.key]=new sT([d.tileID],h,t,a);this._rttFingerprints[G1(c)]=p}this.needsFollowUpFrame=!1;let s=i||r,l=!1;for(let u of this._renderableTiles){let c=this._textureDifference(u);c!=="none"&&(c==="zoom"&&s||c==="visibleLayers"&&i?this.needsFollowUpFrame=!0:c==="zoom"||c==="sourceTiles"?(l?this.needsFollowUpFrame=!0:this._releaseChangedTextures(u,e,n),l=!0):this._releaseChangedTextures(u,e,n))}}_releaseChangedTextures(e,t,r){let i=r.map(n=>this._hasStackChanged(e,t,n));if(!i.includes(!1))e.releaseRTT(this.painter);else for(let[n,a]of i.entries())a&&e.releaseRTTStack(this.painter,n)}_hasStackChanged(e,t,r){let i=!1;for(let n of r){let a=G1(t._layers[n]),o=this._rttFingerprints[a]?.[e.tileID.key],s=e.rttFingerprint[a];if(o||s){if(o?.difference(s)!=="none")return!0;i=!0}}return!i}_textureDifference(e){let t="none";for(let r in this._rttFingerprints){let i=this._rttFingerprints[r][e.tileID.key];if(!i)continue;let n=i.difference(e.rttFingerprint[r]);oT.indexOf(n)>oT.indexOf(t)&&(t=n)}return t}renderLayer(e,t,r){if(e.isHidden(r.transform.zoom))return!1;let i=D_(e),n=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(i&&(this._prevRenderedToTexture||this._stacks.push([]),this._prevRenderedToTexture=!0,this._stacks[this._stacks.length-1].push(e.id),!a))return!0;if(this._prevRenderedToTexture||i&&a){this._prevRenderedToTexture=i;let o=this._stacks.length-1,s=this._stacks[o]||[];r.isRenderingToTexture=!0,N6(n.context.frameUniformBuffer,this.rttSize,this.rttSize);for(let l of this._renderableTiles){if(this._rttTiles.push(l),l.getRTT(o))continue;let u=l.acquireRTT(n,o,this.rttSize);n.bindRTT(u),n.context.clear({color:he.transparent,stencil:0}),r.invalidateTileClippingMasks();for(let c of s){let h=t._layers[c],p=h.source?this._coordsAscending[h.source][l.tileID.key]:[l.tileID];n.context.viewport.set([0,0,this.rttSize,this.rttSize]),r.renderTileClippingMasks(h,p),n.renderLayer(n,t.tileManagers[h.source],h,p,r);let d=G1(h);d&&(l.rttFingerprint[d]=this._rttFingerprints[d][l.tileID.key])}u.texture.generateMipmap()}return r.isRenderingToTexture=!1,N6(n.context.frameUniformBuffer,n.context.gl.drawingBufferWidth,n.context.gl.drawingBufferHeight),jq(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],i}return!1}},ZG={"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":"Drag to rotate map, click to reset 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 \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},HG=pT,lT={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:aD,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:bo.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,globalState:void 0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},sD=class extends lr{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(e){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new NG,this._controls=[],this._mapId=vT(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=a=>{if(a.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)this.fire(new r1("webglcontextlost",{originalEvent:a}));else{for(let o of Object.values(this.style._layers))if(o.type==="custom"&&console.warn(`Custom layer with id '${o.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),o._listeners)for(let[s]of Object.entries(o._listeners))console.warn(`Custom layer with id '${o.id}' had event listeners for event '${s}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.off("error",this._onStyleError),this.style.destroy(),this.style=null,this.fire(new r1("webglcontextlost",{originalEvent:a}))}},this._contextRestored=a=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style){this.style.imageManager.images=this._lostContextStyle.images;for(let o in this._lostContextStyle.images){let s=this._lostContextStyle.images[o];s.isWebGLImage&&this.style.imageManager.updateImage(o,s,!1)}}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(o){this.fire(new ee(o));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new r1("webglcontextrestored",{originalEvent:a}))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onStyleError=a=>{a.tile&&this.triggerRepaint()},this._onWindowOnline=()=>{this._update()};let t={...lT,...e,canvasContextAttributes:{...lT.canvasContextAttributes,...e.canvasContextAttributes}};if(t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(t.minPitch!=null&&t.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(t.maxPitch!=null&&t.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new RG({minZoom:t.minZoom,maxZoom:t.maxZoom,minPitch:t.minPitch,maxPitch:t.maxPitch,bearingSnap:t.bearingSnap,zoomSnap:t.zoomSnap,renderWorldCopies:t.renderWorldCopies,centerClampedToGround:t.centerClampedToGround,terrain:this.terrain,transformConstrain:t.transformConstrain,requestRenderFrame:a=>this._requestRenderFrame(a),cancelRenderFrame:a=>this._cancelRenderFrame(a),transformCameraUpdate:t.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._canvasContextAttributes={...t.canvasContextAttributes},this._trackResize=t.trackResize===!0,this._terrainSkirtLength=t.terrainSkirtLength,this._refreshExpiredTiles=t.refreshExpiredTiles===!0,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions===!0,this._collectResourceTiming=t.collectResourceTiming===!0,this._locale={...ZG,...t.locale},this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this._zoomLevelsToOverscale=t.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=t.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(t.anisotropicFilterPitch),t.reduceMotion!==void 0&&(Nr.prefersReducedMotion=t.reduceMotion),this._requestManager=new WI(t.transformRequest),this._container=this._resolveContainer(t.container),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer();try{this._setupPainter()}catch(a){throw this._cleanupContainer(),a}this._imageQueueHandle=Vi.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.markTerrainDepthDirty(),this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new zG(this,this._camera,t),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let r=typeof t.hash=="string"&&t.hash||void 0;this._hash=t.hash?new Kq(r).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:t.center,elevation:t.elevation,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch,roll:t.roll}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,J({},t.fitBoundsOptions,{duration:0}))));let i=typeof t.style=="string"?void 0:t.style?.projection?.type,n=i!=="globe"&&!Pf(i);this.resize(null,n),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,this._initialGlobalState=t.globalState,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new OG(typeof t.attributionControl=="boolean"?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new jG,t.logoPosition),this.on("style.load",()=>{if(n||this._resizeTransform(),this._camera.transform.unmodified){let a=Qd(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(a)}}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(a.dataType==="style"?new ji("styledata",a):new et("sourcedata",a))}),this.on("dataloading",a=>{this.fire(a.dataType==="style"?new ji("styledataloading",a):new et("sourcedataloading",a))}),this.on("dataabort",a=>{this.fire(new et("sourcedataabort",a))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,t){if(t===void 0&&(t=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new ee(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[t];return t.includes("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}removeControl(e){if(!e?.onRemove)return this.fire(new ee(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(e);return t>-1&&this._controls.splice(t,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return Cc(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new H(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,t){return this._camera.setCenter(e,t),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,t){return this._camera.setCenterElevation(e,t),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,t,r){return this._camera.panBy(e,t,r),this}panTo(e,t,r){return this._camera.panTo(e,t,r),this}getZoom(){return this._camera.transform.zoom}setZoom(e,t){return this._camera.setZoom(e,t),this}zoomTo(e,t,r){return this._camera.zoomTo(e,t,r),this}zoomIn(e,t){return this._camera.zoomIn(e,t),this}zoomOut(e,t){return this._camera.zoomOut(e,t),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,t){return this._camera.setVerticalFieldOfView(e,t),this}getBearing(){return this._camera.transform.bearing}setBearing(e,t){return this._camera.setBearing(e,t),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,t){return this._camera.setPadding(e,t),this}rotateTo(e,t,r){return this._camera.rotateTo(e,t,r),this}resetNorth(e,t){return this._camera.resetNorth(e,t),this}resetNorthPitch(e,t){return this._camera.resetNorthPitch(e,t),this}snapToNorth(e,t){return this._camera.snapToNorth(e,t),this}getPitch(){return this._camera.transform.pitch}setPitch(e,t){return this._camera.setPitch(e,t),this}getRoll(){return this._camera.transform.roll}setRoll(e,t){return this._camera.setRoll(e,t),this}cameraForBounds(e,t){return this._camera.cameraForBounds(e,t)}fitBounds(e,t,r){return this._camera.fitBounds(e,t,r),this}fitScreenCoordinates(e,t,r,i,n){return this._camera.fitScreenCoordinates(e,t,r,i,n),this}jumpTo(e,t){return this._camera.jumpTo(e,t),this}calculateAnchoredCameraOptions(e){return this._camera.calculateAnchoredCameraOptions(e)}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n)}easeTo(e,t){return this._camera.easeTo(e,t),this}flyTo(e,t){return this._camera.flyTo(e,t),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(H.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,t,r,i){return i==null&&this.terrain&&(i=this.terrain.getElevationForLngLat(r,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(e,t,r,i??0)}resize(e,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let r=!this._camera._moving;return r&&(this.stop(),this.fire(new ne("movestart",e)).fire(new ne("move",e))),this.fire(new Wt("resize",e)),r&&this.fire(new ne("moveend",e)),this}_resizeInternal(e=!0){let[t,r]=this._containerDimensions();if(this._clampedPixelRatio=this._getClampedPixelRatio(t,r),this._resizeCanvas(t,r,this._clampedPixelRatio),this.painter.resize(t,r,this._clampedPixelRatio),this.painter.overLimit()){let i=this.painter.context.gl;this._maxCanvasSize=[i.drawingBufferWidth,i.drawingBufferHeight],this._clampedPixelRatio=this._getClampedPixelRatio(t,r),this._resizeCanvas(t,r,this._clampedPixelRatio),this.painter.resize(t,r,this._clampedPixelRatio)}this.style?.resize(),this._resizeTransform(e)}_resizeTransform(e=!0){let[t,r]=this._containerDimensions();this._camera.transform.resize(t,r,e),this._camera._requestedCameraState?.resize(t,r,e)}_getClampedPixelRatio(e,t){let{0:r,1:i}=this._maxCanvasSize,n=this.getPixelRatio(),a=e*n,o=t*n,s=a>r?r/a:1,l=o>i?i/o:1,u=Math.min(s,l);return u<1&&we("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),u*n}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.applyTransformChange(t=>t.setMaxBounds(Zn.convert(e))),this._update()}setMinZoom(e){if(e??(e=-2),e>=-2&&e<=this._camera.transform.maxZoom){let t=this._camera.transform.zoom;return this._camera.applyTransformChange(r=>r.setMinZoom(e)),this._update(),t!==this._camera.transform.zoom&&this.fire(new ne("zoomstart")).fire(new ne("zoom")).fire(new ne("zoomend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(e=!1){let t=this._camera.transform;return e?t.applyConstrain(t.center,t.minZoom).zoom:t.minZoom}setMaxZoom(e){if(e??(e=22),e>=this._camera.transform.minZoom){let t=this._camera.transform.zoom;return this._camera.applyTransformChange(r=>r.setMaxZoom(e)),this._update(),t!==this._camera.transform.zoom&&this.fire(new ne("zoomstart")).fire(new ne("zoom")).fire(new ne("zoomend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??(e=0),e<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this._camera.transform.maxPitch){let t=this._camera.transform.pitch;return this._camera.applyTransformChange(r=>r.setMinPitch(e)),this._update(),t!==this._camera.transform.pitch&&this.fire(new ne("pitchstart")).fire(new ne("pitch")).fire(new ne("pitchend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??(e=60),e>180)throw Error("maxPitch must be less than or equal to 180");if(e>=this._camera.transform.minPitch){let t=this._camera.transform.pitch;return this._camera.applyTransformChange(r=>r.setMaxPitch(e)),this._update(),t!==this._camera.transform.pitch&&this.fire(new ne("pitchstart")).fire(new ne("pitch")).fire(new ne("pitchend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??(e=20),e>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(e<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.applyTransformChange(t=>t.setRenderWorldCopies(e)),this._update()}setTransformConstrain(e){return this._camera.applyTransformChange(t=>t.setConstrainOverride(e)),this._update()}project(e){return this._camera.transform.locationToScreenPoint(H.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(k.convert(e),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegates(e,t,r){if(e==="mouseenter"||e==="mouseover"){let i=!1;return{mousemove:n=>{let a=t.filter(s=>this.getLayer(s)),o=a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length?i||(i=!0,r.call(this,new ei(e,this,n.originalEvent,{features:o}))):i=!1},mouseout:()=>{i=!1}}}if(e==="mouseleave"||e==="mouseout"){let i=!1;return{mousemove:n=>{let a=t.filter(o=>this.getLayer(o));(a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a})).length?i=!0:i&&(i=!1,r.call(this,new ei(e,this,n.originalEvent)))},mouseout:n=>{i&&(i=!1,r.call(this,new ei(e,this,n.originalEvent)))}}}{let i=n=>{let a=t.filter(s=>this.getLayer(s)),o=a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length&&(n.features=o,r.call(this,n),delete n.features)};return{[e]:i}}}_addDelegatedListener(e,t){var r;this._delegatedListeners||(this._delegatedListeners={}),(r=this._delegatedListeners)[e]||(r[e]=[]),this._delegatedListeners[e].push(t);for(let i in t.delegates)this.on(i,t.delegates[i])}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners?.[e])return;let i=this._delegatedListeners[e];for(let n=0;n<i.length;n++){let a=i[n];if(a.listener===r&&a.layers.length===t.length&&a.layers.every(o=>t.includes(o))){for(let o in a.delegates)this.off(o,a.delegates[o]);i.splice(n,1);return}}}on(e,t,r){if(r===void 0)return super.on(e,t);let i=typeof t=="string"?[t]:t,n={layers:i,listener:r,delegates:this._createDelegates(e,i,r)};return this._addDelegatedListener(e,n),{unsubscribe:()=>{this._removeDelegatedListener(e,i,r)}}}once(e,t,r){if(r===void 0)return super.once(e,t);let i=typeof t=="string"?[t]:t,n={layers:i,listener:r,delegates:this._createDelegates(e,i,a=>{this._removeDelegatedListener(e,i,r),r.call(this,a)})};return this._addDelegatedListener(e,n),this}off(e,t,r){if(r===void 0)return super.off(e,t);let i=typeof t=="string"?[t]:t;return this._removeDelegatedListener(e,i,r),this}queryRenderedFeatures(e,t){if(!this.style)return[];let r,i=e instanceof k||Array.isArray(e),n=i?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(t||(t=(i?{}:e)||{}),n instanceof k||typeof n[0]=="number")r=[k.convert(n)];else{let a=k.convert(n[0]),o=k.convert(n[1]);r=[a,new k(o.x,a.y),o,new k(a.x,o.y),a]}return this.style.queryRenderedFeatures(r,t,this._camera.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,t){return t=J({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle,globalState:this._initialGlobalState},t),this._styleUrl=typeof e=="string"?e:null,t.diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(e,t))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(t==null)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(e,t));return}let r=this.style&&t.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.off("error",this._onStyleError),this.style.setEventedParent(null),this.style._remove(!e)),e)this.style=new B6(this,t||{});else return this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.style?.projection?.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),this.style.on("error",this._onStyleError),typeof e=="string"?this.style.loadURL(e,t,r):this.style.loadJSON(e,t,r),this}_lazyInitEmptyStyle(){this.style||(this.style=new B6(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.on("error",this._onStyleError),this.style.loadEmpty())}async _diffStyle(e,t){if(this._diffStyleRequest?.abort(),typeof e=="string"){let r=e;this._diffStyleRequest=new AbortController;let i=this._diffStyleRequest;try{let n=await this._requestManager.transformRequest(r,"Style");if(i.signal.aborted){this._diffStyleRequest=null;return}let a=await ef(n,i);this._diffStyleRequest=null,this._updateDiff(a.data,t)}catch(n){this._diffStyleRequest=null,Ra(n)||this.fire(new ee(Xt(n)))}}else typeof e=="object"&&(this._diffStyleRequest=null,this._updateDiff(e,t))}_updateDiff(e,t){try{this.style.setState(e,t)&&this._update(!0)}catch(r){we(`Unable to perform style diff: ${Xt(r).message}. Rebuilding the style from scratch.`),this._updateStyle(e,t)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style)we("There is no style added to the map.");else return this.style.loaded()}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let t=this.style?.tileManagers[e];if(t===void 0)this.fire(new ee(Error(`There is no tile manager with ID '${e}'`)));else return t.loaded()}setTerrain(e,t={}){if(this.style._checkLoaded(),e&&vc(this,Br.terrain,{value:e},t))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!e)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this.painter.destroyRTTResources(),this._camera.setTerrain(null);else{let r=this.style.tileManagers[e.source];if(!r)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&r.reload();for(let i in this.style._layers){let n=this.style._layers[i];n.type==="hillshade"&&n.source===e.source&&we("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),n.type==="color-relief"&&n.source===e.source&&we("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&&this.terrain.destroy(),this.terrain=new $G(this.painter,r,e,this._terrainSkirtLength,()=>this._camera.transform.worldCoordinateHelper),this.painter.renderToTexture=new GG(this.painter,this.terrain),this._camera.setTerrain(this.terrain),this._terrainDataCallback=i=>this._handleTerrainDataEvent(i,e.source),this.style.on("data",this._terrainDataCallback)}return this.style.triggerSymbolPlacement(),this.fire(new XI({terrain:e})),this}_handleTerrainDataEvent(e,t){if(e.dataType==="style"){this.terrain.tileManager.releaseAllRTT();return}let r=e.sourceId===t;r&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),r&&e.tile&&(this.painter.markTerrainDepthDirty(),this._camera.applyTerrainChange()),e.tile&&(e.source?.type==="image"?this.terrain.tileManager.releaseAllRTT():this.terrain.tileManager.releaseRTT(e.tile.tileID))}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let e=this.style?.tileManagers;for(let t of Object.values(e))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style?.getSource(e)}setSourceTileLodParams(e,t,r){if(r){let i=this.getSource(r);if(!i)throw Error(`There is no source with ID "${r}", cannot set LOD parameters`);i.calculateTileZoom=x_(Math.max(1,e),Math.max(1,t))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=x_(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,t){let r=this.style.tileManagers[e];if(!r)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);t===void 0?r.reload(!0):r.refreshTiles(t.map(i=>new Cf(i.z,i.x,i.y)))}addImage(e,t,r={}){this._lazyInitEmptyStyle();let i=this._createStyleImage(t,r);return i&&(this.style.addImage(e,i),i.userImage?.onAdd&&i.userImage.onAdd(this,e)),this}setMissingStyleImageResolver(e){return this._missingStyleImageResolver=e,this.style?.setMissingImageResolver(e),this}_createStyleImage(e,t={}){let{pixelRatio:r=1,sdf:i=!1,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}=t;if(e instanceof HTMLImageElement||fo(e)){let{width:u,height:c,data:h}=Nr.getImageData(e);return{data:new Ye({width:u,height:c},h),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0}}if(e.width===void 0||e.height===void 0)return this.fire(new ee(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`"))),null;{let{width:u,height:c,data:h}=e,p=e,d=Vd(p.data);return{data:d?new Ye({width:u,height:c}):new Ye({width:u,height:c},new Uint8Array(h)),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0,isWebGLImage:d,userImage:p}}}updateImage(e,t){let r=this.style.getImage(e);if(!r)return this.fire(new ee(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:n,data:a}=t instanceof HTMLImageElement||fo(t)?Nr.getImageData(t):t;if(i===void 0||n===void 0)return this.fire(new ee(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(i!==r.data.width||n!==r.data.height)return this.fire(new ee(Error("The width and height of the updated image must be that same as the previous version of the image")));if(r.isWebGLImage=Vd(a),r.isWebGLImage)r.userImage=t;else{let o=!(t instanceof HTMLImageElement||fo(t));r.data.replace(a,o)}return this.style.updateImage(e,r),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new ee(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}async loadImage(e){let t=await Vi.getImage(await this._requestManager.transformRequest(e,"Image"),new AbortController);if(!t.data)throw Error(`Could not load image ${e}: the response is empty`);return t}listImages(){return this.style?.listImages()??[]}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style?.getLayer(e)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){return this.style?.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,i={}){return this.style?.setPaintProperty(e,t,r,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,i={}){return this.style.setLayoutProperty(e,t,r,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(e){return this._lazyInitEmptyStyle(),this.style.setFontFaces(e),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(e,t,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,i=>{i||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,r=>{r||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=Math.floor(this._container.clientWidth)||400,t=Math.floor(this._container.clientHeight)||300),[e,t]}_shouldHandleInitialResize(){if(!this._container?.clientWidth||!this._container.clientHeight)return!1;let[e,t]=this._containerDimensions();return e!==this._camera.transform.width||t!==this._camera.transform.height}_setupResizeObserver(){let e=!1,t=Xv(i=>{this._trackResize&&!this._removed&&(this.resize(i),this.redraw())},50),r=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new r(i=>{!e&&(e=!0,!this._shouldHandleInitialResize())||t(i)}),this._resizeObserver.observe(this._container)}_resolveContainer(e){if(typeof e=="string"){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&typeof e=="object"&&e.nodeType===1)return e;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let e=this._containerDimensions(),t=this._getClampedPixelRatio(e[0],e[1]),r=this._container;r.classList.add("maplibregl-map");let i=this._canvasContainer=ht.create("div","maplibregl-canvas-container",r);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=ht.create("canvas","maplibregl-canvas",i),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"),this._resizeCanvas(e[0],e[1],t);let n=this._controlContainer=ht.create("div","maplibregl-control-container",r),a=this._controlPositions={};for(let o of["top-left","top-right","bottom-left","bottom-right"])a[o]=ht.create("div",`maplibregl-ctrl-${o} `,n);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(e,t,r){let i=Math.round(r*e),n=Math.round(r*t);this._canvas.width=i,this._canvas.height=n,this._canvas.style.width=`${i/r}px`,this._canvas.style.height=`${n/r}px`}_setupPainter(){let e={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},t=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{t=i},{once:!0});let r=this._canvas.getContext("webgl2",e);if(!r)throw new Xq(e,t);this.painter=new Yq(r)}migrateProjection(e,t){this._camera.migrateProjection(e,t),this.fire(new KI({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?._loaded&&(this._styleDirty||(this._styleDirty=e),this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let t=this._idleTriggered?this._fadeDuration:0,r=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let i=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let l=this._camera.transform.zoom,u=Be();this.style.zoomHistory.update(l,u);let c=new Re(l,{now:u,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),h=c.crossFadingFactor();(h!==1||h!==this._crossFadingFactor)&&(i=!0,this._crossFadingFactor=h),this.style.update(c)}let n=this.style.projection?.transitionState>0!==r;if(this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||n)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain){if(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()){let{elevation:l,demState:u}=this.terrain.getElevationAndDEMStateForLngLat(this._camera.transform.center,this._camera.transform);u!=="loading"&&this._camera.transform.setElevation(l)}}else this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,t,this._crossSourceCollisions,n);let a=this.style.projection,o=a?.transitionState??0;this.painter.render(this.style,this._camera.transform,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,symbolFadeChange:this.style.placement.symbolFadeChange(Be()),variableOffsets:this.style.placement.variableOffsets,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch(),projectionTransition:o,isRenderingGlobe:o>0,projectionShaderVariant:a?{name:a.shaderVariantName,define:a.shaderDefine,prelude:a.shaderPreludeCode}:void 0,useSubdivision:a?.useSubdivision??!1,pixelRatio:this._clampedPixelRatio,light:this.style.light?.getEvaluated(),sky:this.style.sky?.getEvaluated()}),this.fire(new Wt("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new Wt("load"))),this.style&&(this.style.hasTransitions()||i)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let s=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new Wt("idle")),this._loaded&&!this._fullyLoaded&&!s&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Vi.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let e=this.painter.context.gl.getExtension("WEBGL_lose_context");e?.loseContext&&e.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new Wt("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Nr.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(t){if(!Ra(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return HG}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}};function WG(e,t,r,i=!1){if(i||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let n=new H(e.lng,e.lat);if(e=new H(e.lng,e.lat),t){let a=new H(e.lng-360,e.lat),o=new H(e.lng+360,e.lat),s=r.locationToScreenPoint(e).distSqr(t);r.locationToScreenPoint(a).distSqr(t)<s?e=a:r.locationToScreenPoint(o).distSqr(t)<s&&(e=o)}for(;Math.abs(e.lng-r.center.lng)>180;){let a=r.locationToScreenPoint(e);if(a.x>=0&&a.y>=0&&a.x<=r.width&&a.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e.lng!==n.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(e))?e:n}var lD={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 YG(e,t,r){let i=e.classList;for(let n in lD)i.remove(`maplibregl-${r}-anchor-${n}`);i.add(`maplibregl-${r}-anchor-${t}`)}var uT={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},uD="#3FB1CE";function yi(e,t,r=[]){let i=ht.createNS("http://www.w3.org/2000/svg",e);for(let n in t)i.setAttributeNS(null,n,t[n]);for(let n of r)i.appendChild(n);return i}var Z1;function XG(){return Z1||(Z1=yi("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[yi("g",{"fill-rule":"nonzero"},[yi("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([e,t])=>yi("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:e,ry:t}))),yi("g",{fill:uD},[yi("path",{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"})]),yi("g",{opacity:"0.25",fill:"#000000"},[yi("path",{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"})]),yi("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),yi("g",{transform:"translate(8.0, 8.0)"},[yi("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),yi("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]),Z1)}function KG(e){return e.firstElementChild.children[1]}var Ss=class extends Ao{},QG=class extends Ao{},cD=class extends lr{constructor(e){if(super(),this._onClick=t=>{this.fire(new QG("click",{originalEvent:t}))},this._onKeyPress=t=>{(t.code==="Space"||t.code==="Enter")&&this.togglePopup()},this._onKeyDown=t=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||t.composedPath()[0]!==this._element||t.altKey||t.ctrlKey||t.metaKey)return;let r=uT[t.key];if(!r)return;t.preventDefault(),t.stopPropagation();let i=t.shiftKey?10:1,n=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new k(n.x+r[0]*i,n.y+r[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new Ss("dragstart"))),this.fire(new Ss("drag"))},this._onKeyUp=t=>{uT[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let r=t.originalEvent.target,i=this._element;this._popup&&(r===i||i.contains(r))&&this.togglePopup()},this._updateCoveredUnthrottled=()=>{let t=this._map?.terrain;if(!t||!this._isInViewport())return;let r=this._isCovered(t);r&&this._popup?.isOpen()&&this._popup.remove(),this._element.style.opacity=r?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",r)},this._updateCovered=Xv(this._updateCoveredUnthrottled,100),this._update=t=>{if(!this._map)return;this._lngLat=WG(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?r=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?i="rotateX(0deg)":this._pitchAlignment==="map"&&(i=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&t?.type!=="move"&&(this._pos=this._pos.round()),this._element.style.transform=`${lD[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${r}`,this._updateOpacity()},this._onMove=t=>{if(!this._isDragging){let r=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=t.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 Ss("dragstart"))),this.fire(new Ss("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 Ss("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e?.anchor||"center",this._color=e?.color||uD,this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||"auto",this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=k.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=ht.create("div");let t=XG().cloneNode(!0);t.setAttributeNS(null,"height",`${41*this._scale}px`),t.setAttributeNS(null,"width",`${27*this._scale}px`),KG(t).setAttributeNS(null,"fill",this._color),this._element.appendChild(t),this._offset=k.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),YG(this._element,this._anchor,"marker"),e?.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),e.on("idle",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return 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("idle",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),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=H.convert(e),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),e){if(!("offset"in e.options)){let t=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,(24.6+t)*-1],"bottom-right":[-t,(24.6+t)*-1],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new Ss("dragend")))}getPopup(){return this._popup}togglePopup(){let e=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(e)e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map));else return this;return this}_updateOpacity(){if(!this._isInViewport())return;let e=this._map?.terrain,t=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!e||t){let r=t?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==r&&(this._element.style.opacity=r,this._element.classList.toggle("maplibregl-marker-covered",t))}else this._updateCovered()}_isInViewport(){let{width:e,height:t}=this._map._camera.transform;return!!this._pos&&this._pos.x>=0&&this._pos.y>=0&&this._pos.x<=e&&this._pos.y<=t}_isCovered(e){let t=this._map._camera.transform,r=e.getElevationForLngLat(this._lngLat,t),i=Math.max(0,-this._offset.y)/t.pixelsPerMeter,n=Math.sin(this._map.getPitch()*Math.PI/180)*i;return t.isLocationOccluded(this._lngLat,e,r+n)}getOffset(){return this._offset}setOffset(e){return this._offset=k.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=(this._element.getAttribute("tabindex")==="0"&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let e=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(this._opacity===void 0||e===void 0&&t===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=String(e)),t!==void 0&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(),this}};var hH=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Jv(e){bo.WORKER_URL=e}var pD=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0);-webkit-touch-callout:none}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media(forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid buttontext}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media(hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%23333'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%2333b5e5'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%23333'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%2333b5e5'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23000'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23666'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media(forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right,[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@media(prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:rgba(0,0,0,.4);position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media(hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}`;var Rf="gramps-connect-story";var dD={},eZ=Object.freeze(Array.from({length:1},(e,t)=>t+1).filter(e=>e===1||dD[e]!==void 0)),Vr=class extends Error{constructor(t,r){super(r),this.name="StoryFormatError",this.code=t}};function Lf(e){if(typeof e!="string")return null;let t=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.exec(e);return t?{major:Number(t[1]),minor:Number(t[2])}:null}function e2(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Vr("not-a-story","story.json is not a JSON object.");let t=e;if(t.format!==Rf)throw new Vr("not-a-story",`story.json's "format" is not "${Rf}".`);let r=Lf(t.version);if(!r||r.major<1)throw new Vr("bad-version",`story.json's "version" (${JSON.stringify(t.version)}) is not a valid MAJOR.MINOR version.`);if(r.major>1)throw new Vr("newer-version",`This story uses format version ${t.version}, which is newer than this viewer supports (up to 1.x). A newer viewer is needed to open it.`);for(let i=r.major;i<1;i++){let n=dD[i];if(!n)throw new Vr("bad-version",`No upgrade path from format version ${i}.x.`);t=n(t)}return t}var t2={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json",title:"Gramps Connect Story, format 1.0",description:"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).",type:"object",required:["format","version","title","slides","media"],properties:{$schema:{type:"string"},format:{const:"gramps-connect-story"},version:{description:"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.",type:"string",pattern:"^1\\.(0|[1-9][0-9]*)$"},title:{type:"string",pattern:"\\S"},language:{description:`BCP 47 language tag of the story's text, e.g. "en", "de-CH".`,type:"string",pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},created:{description:"When the file was written, as an RFC 3339 date-time.",type:"string",pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},generator:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},version:{type:"string"},url:{type:"string"}}},authors:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},url:{type:"string"}}}},license:{description:"License of the story's content (text and media), as an SPDX identifier or free text.",type:"string"},presentation:{type:"object",properties:{basemap:{enum:["standard","historical","auto","none"]}}},slides:{type:"array",minItems:1,items:{$ref:"#/$defs/slide"}},media:{description:"Every media file in the story, keyed by an id that slides and overlays refer to.",type:"object",propertyNames:{$ref:"#/$defs/id"},additionalProperties:{$ref:"#/$defs/mediaItem"}},extensions:{description:"Producer-specific data, keyed by namespace. Viewers ignore it.",type:"object",additionalProperties:{type:"object"}}},$defs:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},storyDate:{type:"object",required:["text"],properties:{text:{description:"The date as it should be shown, in the story's language.",type:"string",pattern:"\\S"},edtf:{description:"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).",type:"string",pattern:"\\S"},sortYear:{description:"Optional year (proleptic Gregorian) that places the slide on the timeline.",type:"integer"}}},slide:{type:"object",required:["id"],properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},text:{description:"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.",type:"string"},date:{$ref:"#/$defs/storyDate"},place:{$ref:"#/$defs/place"},media:{type:"array",items:{$ref:"#/$defs/slideMedia"}},people:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},role:{type:"string"}}}}}},slideMedia:{type:"object",required:["ref"],properties:{ref:{$ref:"#/$defs/id"},caption:{type:"string"},credit:{type:"string"}}},place:{type:"object",properties:{name:{type:"string"},lat:{type:"number",minimum:-90,maximum:90},lon:{type:"number",minimum:-180,maximum:180},geometry:{description:"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.",type:"object",required:["type"],properties:{type:{type:"string"}},additionalProperties:!0},overlays:{type:"array",items:{$ref:"#/$defs/overlay"}}},dependentRequired:{lat:["lon"],lon:["lat"]}},lonLat:{type:"array",prefixItems:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}],minItems:2,maxItems:2},overlay:{type:"object",required:["media","corners"],properties:{media:{$ref:"#/$defs/id"},corners:{description:"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.",type:"array",items:{$ref:"#/$defs/lonLat"},minItems:4,maxItems:4},opacity:{type:"number",minimum:0,maximum:1},order:{description:"Stacking order among a slide's overlays; lower is drawn first.",type:"integer"},date:{$ref:"#/$defs/storyDate"}}},mediaItem:{type:"object",required:["src","mime"],properties:{src:{description:'Path of the file inside the zip, relative to its root. No leading slash, no ".." segments.',type:"string",pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},mime:{type:"string",pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},width:{type:"integer",minimum:1},height:{type:"integer",minimum:1},alt:{type:"string"}}}}};var r2=Bf;var rZ={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json",title:"Gramps Connect Story, format 1.0",description:"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).",type:"object",required:["format","version","title","slides","media"],properties:{$schema:{type:"string"},format:{const:"gramps-connect-story"},version:{description:"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.",type:"string",pattern:"^1\\.(0|[1-9][0-9]*)$"},title:{type:"string",pattern:"\\S"},language:{description:`BCP 47 language tag of the story's text, e.g. "en", "de-CH".`,type:"string",pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},created:{description:"When the file was written, as an RFC 3339 date-time.",type:"string",pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},generator:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},version:{type:"string"},url:{type:"string"}}},authors:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},url:{type:"string"}}}},license:{description:"License of the story's content (text and media), as an SPDX identifier or free text.",type:"string"},presentation:{type:"object",properties:{basemap:{enum:["standard","historical","auto","none"]}}},slides:{type:"array",minItems:1,items:{$ref:"#/$defs/slide"}},media:{description:"Every media file in the story, keyed by an id that slides and overlays refer to.",type:"object",propertyNames:{$ref:"#/$defs/id"},additionalProperties:{$ref:"#/$defs/mediaItem"}},extensions:{description:"Producer-specific data, keyed by namespace. Viewers ignore it.",type:"object",additionalProperties:{type:"object"}}},$defs:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},storyDate:{type:"object",required:["text"],properties:{text:{description:"The date as it should be shown, in the story's language.",type:"string",pattern:"\\S"},edtf:{description:"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).",type:"string",pattern:"\\S"},sortYear:{description:"Optional year (proleptic Gregorian) that places the slide on the timeline.",type:"integer"}}},slide:{type:"object",required:["id"],properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},text:{description:"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.",type:"string"},date:{$ref:"#/$defs/storyDate"},place:{$ref:"#/$defs/place"},media:{type:"array",items:{$ref:"#/$defs/slideMedia"}},people:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},role:{type:"string"}}}}}},slideMedia:{type:"object",required:["ref"],properties:{ref:{$ref:"#/$defs/id"},caption:{type:"string"},credit:{type:"string"}}},place:{type:"object",properties:{name:{type:"string"},lat:{type:"number",minimum:-90,maximum:90},lon:{type:"number",minimum:-180,maximum:180},geometry:{description:"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.",type:"object",required:["type"],properties:{type:{type:"string"}},additionalProperties:!0},overlays:{type:"array",items:{$ref:"#/$defs/overlay"}}},dependentRequired:{lat:["lon"],lon:["lat"]}},lonLat:{type:"array",prefixItems:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}],minItems:2,maxItems:2},overlay:{type:"object",required:["media","corners"],properties:{media:{$ref:"#/$defs/id"},corners:{description:"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.",type:"array",items:{$ref:"#/$defs/lonLat"},minItems:4,maxItems:4},opacity:{type:"number",minimum:0,maximum:1},order:{description:"Stacking order among a slide's overlays; lower is drawn first.",type:"integer"},date:{$ref:"#/$defs/storyDate"}}},mediaItem:{type:"object",required:["src","mime"],properties:{src:{description:'Path of the file inside the zip, relative to its root. No leading slash, no ".." segments.',type:"string",pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},mime:{type:"string",pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},width:{type:"integer",minimum:1},height:{type:"integer",minimum:1},alt:{type:"string"}}}}};var iZ=new RegExp("^1\\.(0|[1-9][0-9]*)$","u"),Na=new RegExp("\\S","u"),nZ=new RegExp("^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$","u"),aZ=new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$","u"),Of=new RegExp("^[A-Za-z0-9_-]{1,64}$","u"),oZ=new RegExp("^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$","u"),sZ=new RegExp("^[a-z]+/[A-Za-z0-9.+-]+$","u");function sl(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=sl.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.media===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"media"},message:"must have required property 'media'"};o===null?o=[u]:o.push(u),s++}if(e.corners===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"corners"},message:"must have required property 'corners'"};o===null?o=[u]:o.push(u),s++}if(e.media!==void 0){let u=e.media;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/media",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/media",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.corners!==void 0){let u=e.corners;if(Array.isArray(u)){if(u.length>4){let h={instancePath:t+"/corners",schemaPath:"#/properties/corners/maxItems",keyword:"maxItems",params:{limit:4},message:"must NOT have more than 4 items"};o===null?o=[h]:o.push(h),s++}if(u.length<4){let h={instancePath:t+"/corners",schemaPath:"#/properties/corners/minItems",keyword:"minItems",params:{limit:4},message:"must NOT have fewer than 4 items"};o===null?o=[h]:o.push(h),s++}let c=u.length;for(let h=0;h<c;h++){let p=u[h];if(Array.isArray(p)){if(p.length>2){let f={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items"};o===null?o=[f]:o.push(f),s++}if(p.length<2){let f={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items"};o===null?o=[f]:o.push(f),s++}let d=p.length;if(d>0){let f=p[0];if(typeof f=="number"&&isFinite(f)){if(f>180||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/maximum",keyword:"maximum",params:{comparison:"<=",limit:180},message:"must be <= 180"};o===null?o=[m]:o.push(m),s++}if(f<-180||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/minimum",keyword:"minimum",params:{comparison:">=",limit:-180},message:"must be >= -180"};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[m]:o.push(m),s++}}if(d>1){let f=p[1];if(typeof f=="number"&&isFinite(f)){if(f>90||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/maximum",keyword:"maximum",params:{comparison:"<=",limit:90},message:"must be <= 90"};o===null?o=[m]:o.push(m),s++}if(f<-90||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/minimum",keyword:"minimum",params:{comparison:">=",limit:-90},message:"must be >= -90"};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[m]:o.push(m),s++}}}else{let d={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[d]:o.push(d),s++}}}else{let c={instancePath:t+"/corners",schemaPath:"#/properties/corners/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.opacity!==void 0){let u=e.opacity;if(typeof u=="number"&&isFinite(u)){if(u>1||isNaN(u)){let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/maximum",keyword:"maximum",params:{comparison:"<=",limit:1},message:"must be <= 1"};o===null?o=[c]:o.push(c),s++}if(u<0||isNaN(u)){let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.order!==void 0){let u=e.order;if(!(typeof u=="number"&&!(u%1)&&!isNaN(u)&&isFinite(u))){let c={instancePath:t+"/order",schemaPath:"#/properties/order/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[c]:o.push(c),s++}}if(e.date!==void 0){let u=e.date;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.text===void 0){let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};o===null?o=[c]:o.push(c),s++}if(u.text!==void 0){let c=u.text;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.edtf!==void 0){let c=u.edtf;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.sortYear!==void 0){let c=u.sortYear;if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let h={instancePath:t+"/date/sortYear",schemaPath:"#/$defs/storyDate/properties/sortYear/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return sl.errors=o,s===0}sl.evaluated={props:{media:!0,corners:!0,opacity:!0,order:!0,date:!0},dynamicProps:!1,dynamicItems:!1};function ll(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=ll.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.name!==void 0&&typeof e.name!="string"){let u={instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.lat!==void 0){let u=e.lat;if(typeof u=="number"&&isFinite(u)){if(u>90||isNaN(u)){let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/maximum",keyword:"maximum",params:{comparison:"<=",limit:90},message:"must be <= 90"};o===null?o=[c]:o.push(c),s++}if(u<-90||isNaN(u)){let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/minimum",keyword:"minimum",params:{comparison:">=",limit:-90},message:"must be >= -90"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.lon!==void 0){let u=e.lon;if(typeof u=="number"&&isFinite(u)){if(u>180||isNaN(u)){let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/maximum",keyword:"maximum",params:{comparison:"<=",limit:180},message:"must be <= 180"};o===null?o=[c]:o.push(c),s++}if(u<-180||isNaN(u)){let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/minimum",keyword:"minimum",params:{comparison:">=",limit:-180},message:"must be >= -180"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.geometry!==void 0){let u=e.geometry;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.type===void 0){let c={instancePath:t+"/geometry",schemaPath:"#/properties/geometry/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};o===null?o=[c]:o.push(c),s++}if(u.type!==void 0&&typeof u.type!="string"){let c={instancePath:t+"/geometry/type",schemaPath:"#/properties/geometry/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/geometry",schemaPath:"#/properties/geometry/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}if(e.overlays!==void 0){let u=e.overlays;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++)sl(u[h],{instancePath:t+"/overlays/"+h,parentData:u,parentDataProperty:h,rootData:n,dynamicAnchors:a})||(o=o===null?sl.errors:o.concat(sl.errors),s=o.length)}else{let c={instancePath:t+"/overlays",schemaPath:"#/properties/overlays/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.lat!==void 0&&e.lon===void 0){let u={instancePath:t,schemaPath:"#/dependentRequired",keyword:"dependentRequired",params:{property:"lat",missingProperty:"lon",depsCount:1,deps:"lon"},message:"must have property lon when property lat is present"};o===null?o=[u]:o.push(u),s++}if(e.lon!==void 0&&e.lat===void 0){let u={instancePath:t,schemaPath:"#/dependentRequired",keyword:"dependentRequired",params:{property:"lon",missingProperty:"lat",depsCount:1,deps:"lat"},message:"must have property lat when property lon is present"};o===null?o=[u]:o.push(u),s++}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return ll.errors=o,s===0}ll.evaluated={props:{name:!0,lat:!0,lon:!0,geometry:!0,overlays:!0},dynamicProps:!1,dynamicItems:!1};function ul(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=ul.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.ref===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"ref"},message:"must have required property 'ref'"};o===null?o=[u]:o.push(u),s++}if(e.ref!==void 0){let u=e.ref;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/ref",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/ref",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.caption!==void 0&&typeof e.caption!="string"){let u={instancePath:t+"/caption",schemaPath:"#/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.credit!==void 0&&typeof e.credit!="string"){let u={instancePath:t+"/credit",schemaPath:"#/properties/credit/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return ul.errors=o,s===0}ul.evaluated={props:{ref:!0,caption:!0,credit:!0},dynamicProps:!1,dynamicItems:!1};function cl(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=cl.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.id===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};o===null?o=[u]:o.push(u),s++}if(e.id!==void 0){let u=e.id;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.title!==void 0&&typeof e.title!="string"){let u={instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.text!==void 0&&typeof e.text!="string"){let u={instancePath:t+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.date!==void 0){let u=e.date;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.text===void 0){let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};o===null?o=[c]:o.push(c),s++}if(u.text!==void 0){let c=u.text;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.edtf!==void 0){let c=u.edtf;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.sortYear!==void 0){let c=u.sortYear;if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let h={instancePath:t+"/date/sortYear",schemaPath:"#/$defs/storyDate/properties/sortYear/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}if(e.place!==void 0&&(ll(e.place,{instancePath:t+"/place",parentData:e,parentDataProperty:"place",rootData:n,dynamicAnchors:a})||(o=o===null?ll.errors:o.concat(ll.errors),s=o.length)),e.media!==void 0){let u=e.media;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++)ul(u[h],{instancePath:t+"/media/"+h,parentData:u,parentDataProperty:h,rootData:n,dynamicAnchors:a})||(o=o===null?ul.errors:o.concat(ul.errors),s=o.length)}else{let c={instancePath:t+"/media",schemaPath:"#/properties/media/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.people!==void 0){let u=e.people;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++){let p=u[h];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.name===void 0){let d={instancePath:t+"/people/"+h,schemaPath:"#/properties/people/items/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[d]:o.push(d),s++}if(p.name!==void 0){let d=p.name;if(typeof d=="string"){if(!Na.test(d)){let f={instancePath:t+"/people/"+h+"/name",schemaPath:"#/properties/people/items/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/people/"+h+"/name",schemaPath:"#/properties/people/items/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.role!==void 0&&typeof p.role!="string"){let d={instancePath:t+"/people/"+h+"/role",schemaPath:"#/properties/people/items/properties/role/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/people/"+h,schemaPath:"#/properties/people/items/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}}else{let c={instancePath:t+"/people",schemaPath:"#/properties/people/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return cl.errors=o,s===0}cl.evaluated={props:{id:!0,title:!0,text:!0,date:!0,place:!0,media:!0,people:!0},dynamicProps:!1,dynamicItems:!1};function Bf(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=Bf.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.format===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"format"},message:"must have required property 'format'"};o===null?o=[c]:o.push(c),s++}if(e.version===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"version"},message:"must have required property 'version'"};o===null?o=[c]:o.push(c),s++}if(e.title===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};o===null?o=[c]:o.push(c),s++}if(e.slides===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"slides"},message:"must have required property 'slides'"};o===null?o=[c]:o.push(c),s++}if(e.media===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"media"},message:"must have required property 'media'"};o===null?o=[c]:o.push(c),s++}if(e.$schema!==void 0&&typeof e.$schema!="string"){let c={instancePath:t+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}if(e.format!==void 0&&e.format!=="gramps-connect-story"){let c={instancePath:t+"/format",schemaPath:"#/properties/format/const",keyword:"const",params:{allowedValue:"gramps-connect-story"},message:"must be equal to constant"};o===null?o=[c]:o.push(c),s++}if(e.version!==void 0){let c=e.version;if(typeof c=="string"){if(!iZ.test(c)){let h={instancePath:t+"/version",schemaPath:"#/properties/version/pattern",keyword:"pattern",params:{pattern:"^1\\.(0|[1-9][0-9]*)$"},message:'must match pattern "^1\\.(0|[1-9][0-9]*)$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.title!==void 0){let c=e.title;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/title",schemaPath:"#/properties/title/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.language!==void 0){let c=e.language;if(typeof c=="string"){if(!nZ.test(c)){let h={instancePath:t+"/language",schemaPath:"#/properties/language/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},message:'must match pattern "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/language",schemaPath:"#/properties/language/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.created!==void 0){let c=e.created;if(typeof c=="string"){if(!aZ.test(c)){let h={instancePath:t+"/created",schemaPath:"#/properties/created/pattern",keyword:"pattern",params:{pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},message:'must match pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/created",schemaPath:"#/properties/created/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.generator!==void 0){let c=e.generator;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.name===void 0){let h={instancePath:t+"/generator",schemaPath:"#/properties/generator/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[h]:o.push(h),s++}if(c.name!==void 0){let h=c.name;if(typeof h=="string"){if(!Na.test(h)){let p={instancePath:t+"/generator/name",schemaPath:"#/properties/generator/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[p]:o.push(p),s++}}else{let p={instancePath:t+"/generator/name",schemaPath:"#/properties/generator/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[p]:o.push(p),s++}}if(c.version!==void 0&&typeof c.version!="string"){let h={instancePath:t+"/generator/version",schemaPath:"#/properties/generator/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}if(c.url!==void 0&&typeof c.url!="string"){let h={instancePath:t+"/generator/url",schemaPath:"#/properties/generator/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/generator",schemaPath:"#/properties/generator/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.authors!==void 0){let c=e.authors;if(Array.isArray(c)){let h=c.length;for(let p=0;p<h;p++){let d=c[p];if(d&&typeof d=="object"&&!Array.isArray(d)){if(d.name===void 0){let f={instancePath:t+"/authors/"+p,schemaPath:"#/properties/authors/items/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[f]:o.push(f),s++}if(d.name!==void 0){let f=d.name;if(typeof f=="string"){if(!Na.test(f)){let m={instancePath:t+"/authors/"+p+"/name",schemaPath:"#/properties/authors/items/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/authors/"+p+"/name",schemaPath:"#/properties/authors/items/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[m]:o.push(m),s++}}if(d.url!==void 0&&typeof d.url!="string"){let f={instancePath:t+"/authors/"+p+"/url",schemaPath:"#/properties/authors/items/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/authors/"+p,schemaPath:"#/properties/authors/items/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[f]:o.push(f),s++}}}else{let h={instancePath:t+"/authors",schemaPath:"#/properties/authors/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[h]:o.push(h),s++}}if(e.license!==void 0&&typeof e.license!="string"){let c={instancePath:t+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}if(e.presentation!==void 0){let c=e.presentation;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.basemap!==void 0){let h=c.basemap;if(!(h==="standard"||h==="historical"||h==="auto"||h==="none")){let p={instancePath:t+"/presentation/basemap",schemaPath:"#/properties/presentation/properties/basemap/enum",keyword:"enum",params:{allowedValues:rZ.properties.presentation.properties.basemap.enum},message:"must be equal to one of the allowed values"};o===null?o=[p]:o.push(p),s++}}}else{let h={instancePath:t+"/presentation",schemaPath:"#/properties/presentation/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.slides!==void 0){let c=e.slides;if(Array.isArray(c)){if(c.length<1){let p={instancePath:t+"/slides",schemaPath:"#/properties/slides/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};o===null?o=[p]:o.push(p),s++}let h=c.length;for(let p=0;p<h;p++)cl(c[p],{instancePath:t+"/slides/"+p,parentData:c,parentDataProperty:p,rootData:n,dynamicAnchors:a})||(o=o===null?cl.errors:o.concat(cl.errors),s=o.length)}else{let h={instancePath:t+"/slides",schemaPath:"#/properties/slides/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[h]:o.push(h),s++}}if(e.media!==void 0){let c=e.media;if(c&&typeof c=="object"&&!Array.isArray(c)){for(let h in c){let p=s;if(typeof h=="string"){if(!Of.test(h)){let d={instancePath:t+"/media",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"',propertyName:h};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/media",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",propertyName:h};o===null?o=[d]:o.push(d),s++}var u=p===s;if(!u){let d={instancePath:t+"/media",schemaPath:"#/properties/media/propertyNames",keyword:"propertyNames",params:{propertyName:h},message:"property name must be valid"};o===null?o=[d]:o.push(d),s++}}for(let h in c){let p=c[h];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.src===void 0){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/required",keyword:"required",params:{missingProperty:"src"},message:"must have required property 'src'"};o===null?o=[d]:o.push(d),s++}if(p.mime===void 0){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/required",keyword:"required",params:{missingProperty:"mime"},message:"must have required property 'mime'"};o===null?o=[d]:o.push(d),s++}if(p.src!==void 0){let d=p.src;if(typeof d=="string"){if(!oZ.test(d)){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/src",schemaPath:"#/$defs/mediaItem/properties/src/pattern",keyword:"pattern",params:{pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},message:'must match pattern "^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/src",schemaPath:"#/$defs/mediaItem/properties/src/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.mime!==void 0){let d=p.mime;if(typeof d=="string"){if(!sZ.test(d)){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/mime",schemaPath:"#/$defs/mediaItem/properties/mime/pattern",keyword:"pattern",params:{pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},message:'must match pattern "^[a-z]+/[A-Za-z0-9.+-]+$"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/mime",schemaPath:"#/$defs/mediaItem/properties/mime/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.width!==void 0){let d=p.width;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/width",schemaPath:"#/$defs/mediaItem/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[f]:o.push(f),s++}if(typeof d=="number"&&isFinite(d)&&(d<1||isNaN(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/width",schemaPath:"#/$defs/mediaItem/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};o===null?o=[f]:o.push(f),s++}}if(p.height!==void 0){let d=p.height;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/height",schemaPath:"#/$defs/mediaItem/properties/height/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[f]:o.push(f),s++}if(typeof d=="number"&&isFinite(d)&&(d<1||isNaN(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/height",schemaPath:"#/$defs/mediaItem/properties/height/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};o===null?o=[f]:o.push(f),s++}}if(p.alt!==void 0&&typeof p.alt!="string"){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/alt",schemaPath:"#/$defs/mediaItem/properties/alt/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}}else{let h={instancePath:t+"/media",schemaPath:"#/properties/media/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.extensions!==void 0){let c=e.extensions;if(c&&typeof c=="object"&&!Array.isArray(c))for(let h in c){let p=c[h];if(!(p&&typeof p=="object"&&!Array.isArray(p))){let d={instancePath:t+"/extensions/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/extensions/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}else{let h={instancePath:t+"/extensions",schemaPath:"#/properties/extensions/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}return Bf.errors=o,s===0}Bf.evaluated={props:{$schema:!0,format:!0,version:!0,title:!0,language:!0,created:!0,generator:!0,authors:!0,license:!0,presentation:!0,slides:!0,media:!0,extensions:!0},dynamicProps:!1,dynamicItems:!1};var lZ=0;function i2(e,t){let r=[],i=[];if(!r2(e)){for(let u of r2.errors??[])r.push({path:u.instancePath,message:uZ(u)});return{valid:!1,errors:r,warnings:i}}let n=e,a=new Set,o=new Set,s=(u,c)=>{o.add(u),Object.prototype.hasOwnProperty.call(n.media,u)||r.push({path:c,message:`refers to media "${u}", which isn't in "media".`})};n.slides.forEach((u,c)=>{a.has(u.id)&&r.push({path:`/slides/${c}/id`,message:`duplicate slide id "${u.id}".`}),a.add(u.id),u.media?.forEach((h,p)=>s(h.ref,`/slides/${c}/media/${p}/ref`)),u.place?.overlays?.forEach((h,p)=>s(h.media,`/slides/${c}/place/overlays/${p}/media`))});for(let[u,c]of Object.entries(n.media)){let h=`/media/${mD(u)}`;t&&!t.has(c.src)&&r.push({path:`${h}/src`,message:`file "${c.src}" is not in the zip.`}),o.has(u)||i.push({path:h,message:`media "${u}" isn't used by any slide or overlay.`})}let l=Lf(n.version);return l&&l.major===1&&l.minor<=lZ&&jf(n,t2,"",i),{valid:r.length===0,errors:r,warnings:i}}function uZ(e){return e.keyword==="pattern"&&e.params.pattern==="\\S"?"must not be empty.":e.keyword==="required"?`is missing required field "${String(e.params.missingProperty)}".`:e.keyword==="const"?`must be ${JSON.stringify(e.params.allowedValue)}.`:e.keyword==="enum"?`must be one of ${e.params.allowedValues.map(t=>JSON.stringify(t)).join(", ")}.`:`${e.message??"is invalid"}.`}function mD(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function cZ(e,t){if(!e.$ref)return e;let r=e.$ref.replace(/^#\/\$defs\//,"");return t.$defs[r]}function jf(e,t,r,i,n=t2){if(t=cZ(t,n),Array.isArray(e)){e.forEach((a,o)=>{let s=t.prefixItems?.[o]??t.items;s&&jf(a,s,`${r}/${o}`,i,n)});return}if(!(typeof e!="object"||e===null))for(let[a,o]of Object.entries(e)){let s=`${r}/${mD(a)}`,l=t.properties?.[a];l?jf(o,l,s,i,n):typeof t.additionalProperties=="object"?jf(o,t.additionalProperties,s,i,n):t.properties&&t.additionalProperties!==!0&&i.push({path:s,message:`unknown field "${a}" (ignored).`})}}var gD={},hZ=(function(e,t,r,i,n){var a=new Worker(gD[t]||(gD[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var s=o.data,l=s.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],n(u,null)}else n(null,s)},a.postMessage(r,i),a}),Dr=Uint8Array,Ro=Uint16Array,vD=Int32Array,o2=new Dr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s2=new Dr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xD=new Dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bD=function(e,t){for(var r=new Ro(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];for(var n=new vD(r[30]),i=1;i<30;++i)for(var a=r[i];a<r[i+1];++a)n[a]=a-r[i]<<5|i;return{b:r,r:n}},wD=bD(o2,2),l2=wD.b,pZ=wD.r;l2[28]=258,pZ[258]=28;var TD=bD(s2,0),SD=TD.b,LJ=TD.r,$f=new Ro(32768);for(Ve=0;Ve<32768;++Ve)Wn=(Ve&43690)>>1|(Ve&21845)<<1,Wn=(Wn&52428)>>2|(Wn&13107)<<2,Wn=(Wn&61680)>>4|(Wn&3855)<<4,$f[Ve]=((Wn&65280)>>8|(Wn&255)<<8)>>1;var Wn,Ve,hl=(function(e,t,r){for(var i=e.length,n=0,a=new Ro(t);n<i;++n)e[n]&&++a[e[n]-1];var o=new Ro(t);for(n=1;n<t;++n)o[n]=o[n-1]+a[n-1]<<1;var s;if(r){s=new Ro(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],h=o[e[n]-1]++<<c,p=h|(1<<c)-1;h<=p;++h)s[$f[h]>>l]=u}else for(s=new Ro(i),n=0;n<i;++n)e[n]&&(s[n]=$f[o[e[n]-1]++]>>15-e[n]);return s}),Dc=new Dr(288);for(Ve=0;Ve<144;++Ve)Dc[Ve]=8;var Ve;for(Ve=144;Ve<256;++Ve)Dc[Ve]=9;var Ve;for(Ve=256;Ve<280;++Ve)Dc[Ve]=7;var Ve;for(Ve=280;Ve<288;++Ve)Dc[Ve]=8;var Ve,ED=new Dr(32);for(Ve=0;Ve<32;++Ve)ED[Ve]=5;var Ve;var CD=hl(Dc,9,1);var PD=hl(ED,5,1),Vf=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},Ei=function(e,t,r){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(t&7)&r},Uf=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},DD=function(e){return(e+7)/8|0},qf=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Dr(e.subarray(t,r))};var AD=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_r=function(e,t,r){var i=new Error(t||AD[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,_r),!r)throw i;return i},MD=function(e,t,r,i){var n=e.length,a=i?i.length:0;if(!n||t.f&&!t.l)return r||new Dr(0);var o=!r,s=o||t.i!=2,l=t.i;o&&(r=new Dr(n*3));var u=function(Et){var kt=r.length;if(Et>kt){var st=new Dr(Math.max(kt*2,Et));st.set(r),r=st}},c=t.f||0,h=t.p||0,p=t.b||0,d=t.l,f=t.d,m=t.m,_=t.n,g=n*8;do{if(!d){c=Ei(e,h,1);var y=Ei(e,h+1,3);if(h+=3,y)if(y==1)d=CD,f=PD,m=9,_=5;else if(y==2){var w=Ei(e,h,31)+257,T=Ei(e,h+10,15)+4,S=w+Ei(e,h+5,31)+1;h+=14;for(var E=new Dr(S),P=new Dr(19),D=0;D<T;++D)P[xD[D]]=Ei(e,h+D*3,7);h+=T*3;for(var F=Vf(P),I=(1<<F)-1,C=hl(P,F,1),D=0;D<S;){var A=C[Ei(e,h,I)];h+=A&15;var v=A>>4;if(v<16)E[D++]=v;else{var M=0,L=0;for(v==16?(L=3+Ei(e,h,3),h+=2,M=E[D-1]):v==17?(L=3+Ei(e,h,7),h+=3):v==18&&(L=11+Ei(e,h,127),h+=7);L--;)E[D++]=M}}var j=E.subarray(0,w),O=E.subarray(w);m=Vf(j),_=Vf(O),d=hl(j,m,1),f=hl(O,_,1)}else _r(1);else{var v=DD(h)+4,x=e[v-4]|e[v-3]<<8,b=v+x;if(b>n){l&&_r(0);break}s&&u(p+x),r.set(e.subarray(v,b),p),t.b=p+=x,t.p=h=b*8,t.f=c;continue}if(h>g){l&&_r(0);break}}s&&u(p+131072);for(var Y=(1<<m)-1,ue=(1<<_)-1,pe=h;;pe=h){var M=d[Uf(e,h)&Y],de=M>>4;if(h+=M&15,h>g){l&&_r(0);break}if(M||_r(2),de<256)r[p++]=de;else if(de==256){pe=h,d=null;break}else{var je=de-254;if(de>264){var D=de-257,Se=o2[D];je=Ei(e,h,(1<<Se)-1)+l2[D],h+=Se}var ae=f[Uf(e,h)&ue],oe=ae>>4;ae||_r(3),h+=ae&15;var O=SD[oe];if(oe>3){var Se=s2[oe];O+=Uf(e,h)&(1<<Se)-1,h+=Se}if(h>g){l&&_r(0);break}s&&u(p+131072);var $e=p+je;if(p<O){var qe=a-O,mt=Math.min(O,$e);for(qe+p<0&&_r(3);p<mt;++p)r[p]=i[qe+p]}for(;p<$e;++p)r[p]=r[p-O]}}t.l=d,t.p=pe,t.b=p,t.f=c,d&&(c=1,t.m=m,t.d=f,t.n=_)}while(!c);return p!=r.length&&o?qf(r,0,p):r.subarray(0,p)};var dZ=new Dr(0);var fZ=function(e,t){var r={};for(var i in e)r[i]=e[i];for(var i in t)r[i]=t[i];return r},yD=function(e,t,r){for(var i=e(),n=e.toString(),a=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<i.length;++o){var s=i[o],l=a[o];if(typeof s=="function"){t+=";"+l+"=";var u=s.toString();if(s.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;t+=u.slice(c,u.indexOf("(",c))}else{t+=u;for(var h in s.prototype)t+=";"+l+".prototype."+h+"="+s.prototype[h].toString()}else t+=u}else r[l]=s}return t},Nf=[],mZ=function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},gZ=function(e,t,r,i){if(!Nf[r]){for(var n="",a={},o=e.length-1,s=0;s<o;++s)n=yD(e[s],n,a);Nf[r]={c:yD(e[o],n,a),e:a}}var l=fZ({},Nf[r].e);return hZ(Nf[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,l,mZ(l),i)},yZ=function(){return[Dr,Ro,vD,o2,s2,xD,l2,SD,CD,PD,$f,AD,hl,Vf,Ei,Uf,DD,qf,_r,MD,u2,ID,kD]};var ID=function(e){return postMessage(e,[e.buffer])},kD=function(e){return e&&{out:e.size&&new Dr(e.size),dictionary:e.dictionary}},_Z=function(e,t,r,i,n,a){var o=gZ(r,i,n,function(s,l){o.terminate(),a(s,l)});return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}};var xn=function(e,t){return e[t]|e[t+1]<<8},Ci=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},n2=function(e,t){return Ci(e,t)+Ci(e,t+4)*4294967296};function vZ(e,t,r){return r||(r=t,t={}),typeof r!="function"&&_r(7),_Z(e,t,[yZ],function(i){return ID(u2(i.data[0],kD(i.data[1])))},1,r)}function u2(e,t){return MD(e,{i:2},t&&t.out,t&&t.dictionary)}var a2=typeof TextDecoder<"u"&&new TextDecoder,xZ=0;try{a2.decode(dZ,{stream:!0}),xZ=1}catch{}var bZ=function(e){for(var t="",r=0;;){var i=e[r++],n=(i>127)+(i>223)+(i>239);if(r+n>e.length)return{s:t,r:qf(e,r-1)};n?n==3?(i=((i&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|i>>10,56320|i&1023)):n&1?t+=String.fromCharCode((i&31)<<6|e[r++]&63):t+=String.fromCharCode((i&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(i)}};function wZ(e,t){if(t){for(var r="",i=0;i<e.length;i+=16384)r+=String.fromCharCode.apply(null,e.subarray(i,i+16384));return r}else{if(a2)return a2.decode(e);var n=bZ(e),a=n.s,r=n.r;return r.length&&_r(8),a}}var TZ=function(e,t){return t+30+xn(e,t+26)+xn(e,t+28)},SZ=function(e,t,r){var i=xn(e,t+28),n=xn(e,t+30),a=wZ(e.subarray(t+46,t+46+i),!(xn(e,t+8)&2048)),o=t+46+i,s=EZ(e,o,n,r,Ci(e,t+20),Ci(e,t+24),Ci(e,t+42)),l=s[0],u=s[1],c=s[2];return[xn(e,t+10),l,u,a,o+n+xn(e,t+32),c]},EZ=function(e,t,r,i,n,a,o){var s=n==4294967295,l=a==4294967295,u=o==4294967295,c=t+r,h=s+l+u;if(i&&h){for(;t+4<c;t+=4+xn(e,t+2))if(xn(e,t)==1)return[s?n2(e,t+4+8*l):n,l?n2(e,t+4):a,u?n2(e,t+4+8*(l+s)):o,1];i<2&&_r(13)}return[n,a,o,0]};var _D=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function zD(e,t,r){r||(r=t,t={}),typeof r!="function"&&_r(7);var i=[],n=function(){for(var _=0;_<i.length;++_)i[_]()},a={},o=function(_,g){_D(function(){r(_,g)})};_D(function(){o=r});for(var s=e.length-22;Ci(e,s)!=101010256;--s)if(!s||e.length-s>65558)return o(_r(13,0,1),null),n;var l=xn(e,s+8);if(l){var u=l,c=Ci(e,s+16),h=Ci(e,s-20)==117853008;if(h){var p=Ci(e,s-12);h=Ci(e,p)==101075792,h&&(u=l=Ci(e,p+32),c=Ci(e,p+48))}for(var d=t&&t.filter,f=function(_){var g=SZ(e,c,h),y=g[0],v=g[1],x=g[2],b=g[3],w=g[4],T=g[5],S=TZ(e,T);c=w;var E=function(D,F){D?(n(),o(D,null)):(F&&(a[b]=F),--l||o(null,a))};if(!d||d({name:b,size:v,originalSize:x,compression:y}))if(!y)E(null,qf(e,S,S+v));else if(y==8){var P=e.subarray(S,S+v);if(x<524288||v>.8*x)try{E(null,u2(P,{out:new Dr(x)}))}catch(D){E(D,null)}else i.push(vZ(P,{size:x},E))}else E(_r(14,"unknown compression type "+y,1),null);else E(null,null)},m=0;m<u;++m)f(m)}else o(null,{});return n}var c2="story.json";async function PZ(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(await e.arrayBuffer())}function DZ(e){return e.endsWith("/")||e.startsWith("__MACOSX/")}async function h2(e,t={}){let r=t.maxTotalBytes??536870912,i=t.maxFiles??1e4,n=await PZ(e),a=0,o=0,s=!1,l=await new Promise((f,m)=>{zD(n,{filter(_){return DZ(_.name)?!1:(o+=1,a+=_.originalSize,(o>i||a>r)&&(s=!0),!s)}},(_,g)=>_?m(_):f(g))}).catch(f=>{throw new Vr("not-a-zip",`Not a readable zip file (${f instanceof Error?f.message:String(f)}).`)});if(s)throw new Vr("too-large","This zip is too large to open as a story.");let u=AZ(Object.keys(l)),c=new Map;for(let[f,m]of Object.entries(l))f.startsWith(u)&&c.set(f.slice(u.length),m);let h;try{h=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(c.get(c2)))}catch(f){throw new Vr("bad-json",`story.json is not valid JSON (${f instanceof Error?f.message:String(f)}).`)}let p=e2(h),d=i2(p,c);if(!d.valid)throw new Gf(d.errors);return{doc:p,files:c,warnings:d.warnings}}var Gf=class extends Vr{constructor(t){super("invalid",`story.json is invalid: ${t.slice(0,5).map(r=>`${r.path||"/"} ${r.message}`).join("; ")}${t.length>5?` (and ${t.length-5} more)`:""}`),this.issues=t}};function AZ(e){if(e.includes(c2))return"";let t=e.filter(r=>/^[^/]+\/story\.json$/.test(r));if(t.length===1)return t[0].slice(0,-c2.length);throw new Vr("no-story-json",t.length>1?"This zip holds more than one story.json; a story zip has exactly one.":"This zip has no story.json, so it isn't a story.")}function p2(e,t){let r=Object.prototype.hasOwnProperty.call(e.doc.media,t)?e.doc.media[t]:void 0,i=r&&e.files.get(r.src);return i?new Blob([i],{type:r.mime}):void 0}var He=ur($a(),1);var FD=/^(-?\d{4})(?:-(\d{2}|XX))?(?:-(\d{2}|XX))?[~?%]?$/;function Ac(e){let t=FD.exec(e.trim());return t?Number(t[1]):null}function RD(e){if(!e)return null;let t=e.trim(),r=/^\[(.+)\.\.(.+)\]$/.exec(t);if(r){let n=Ac(r[1]),a=Ac(r[2]);return n!==null&&a!==null?{min:Math.min(n,a),max:Math.max(n,a)}:null}if(t.includes("/")){let[n,a]=t.split("/"),o=n===".."||n==="",s=a===".."||a==="",l=o?void 0:Ac(n),u=s?void 0:Ac(a);return l===null||u===null||l===void 0&&u===void 0?null:l!==void 0&&u!==void 0?{min:Math.min(l,u),max:Math.max(l,u)}:{min:l,max:u}}let i=Ac(t);return i===null?null:{min:i,max:i}}function Zf(e,t){if(!e||t===null)return!0;let r=RD(e.edtf);return r?!(r.min!==void 0&&t<r.min||r.max!==void 0&&t>r.max):!0}function Hf(e){if(!e)return null;let t=e.edtf?FD.exec(e.edtf.trim()):null,r=e.sortYear??(t?Number(t[1]):void 0);if(r===void 0)return null;if(!t||Number(t[1])!==r)return r;let i=t[2]&&t[2]!=="XX"?Number(t[2]):0,n=t[3]&&t[3]!=="XX"?Number(t[3]):0;return i?r+(i-1)/12+(n?(n-1)/365:0):r}function Mc(e,t){if(Array.isArray(e)){if(e.length>=2&&typeof e[0]=="number"&&typeof e[1]=="number"){let[r,i]=e;t[0]=Math.min(t[0],r),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],r),t[3]=Math.max(t[3],i);return}for(let r of e)Mc(r,t)}}function Wf(e,t){if(!e||typeof e!="object")return;let r=e;r.coordinates!==void 0&&Mc(r.coordinates,t),r.geometry&&Wf(r.geometry,t);for(let i of r.geometries??[])Wf(i,t);for(let i of r.features??[])Wf(i,t)}function Ic(e){if(!e)return null;let t=[1/0,1/0,-1/0,-1/0];Wf(e.geometry,t);for(let r of e.overlays??[])Mc(r.corners,t);return Number.isFinite(t[0])?t:null}function Yn(e){if(e?.lat!==void 0&&e.lon!==void 0)return[e.lon,e.lat];let t=Ic(e);return t?[(t[0]+t[2])/2,(t[1]+t[3])/2]:null}function LD(e){let t=[1/0,1/0,-1/0,-1/0],r=new Map;for(let i of e){let n=Yn(i);if(!n)continue;r.set(`${n[0].toFixed(5)},${n[1].toFixed(5)}`,n),Mc(n,t);let a=Ic(i);a&&Mc([[a[0],a[1]],[a[2],a[3]]],t)}return r.size?{points:[...r.values()],bounds:t}:null}var It=ur($a(),1);var $D=ur(UD(),1),qD="https://tiles.openfreemap.org/styles/liberty",GD="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",ZD="https://www.openhistoricalmap.org/map-styles/main/main.json";function zc(e,t){return t!=null?"ohm":e?"dark":"light"}function Qf(e,t){return t!=null?ZD:e?GD:qD}function g2(e,t,r,i=300){let n=e.getContainer();n.style.zIndex||(n.style.zIndex="0");let a=null;try{a=e.getCanvas().toDataURL("image/png")}catch{}if(r(),e.setStyle(t),!a)return;let o=document.createElement("img");o.src=a,o.alt="",Object.assign(o.style,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"5",pointerEvents:"none",transition:`opacity ${i}ms ease`}),n.appendChild(o),e.once("idle",()=>{requestAnimationFrame(()=>{o.style.opacity="0"}),window.setTimeout(()=>o.remove(),i+50)})}function y2(e,t){(0,$D.filterByDate)(e,String(Math.round(t)))}function _2(e){return e?{surface:"#242424",text:"#c9c9c9",muted:"#828282",border:"#424242",mark:"#3987e5",panel:"rgb(20,20,20)"}:{surface:"#ffffff",text:"#000000",muted:"#868e96",border:"#dee2e6",mark:"#2a78d6",panel:"rgb(255,255,255)"}}var Fc="M12 0C7.03 0 3 4.03 3 9c0 6.25 9 15 9 15s9-8.75 9-15c0-4.97-4.03-9-9-9z";var e8=ur(Xi(),1),Lo="story-shape",XD="story-shape-fill",LZ="story-shape-line",BZ="story-shape-points",OZ="story-shape-labels",jZ="story-overlay-",v2="story-places",NZ="story-places-dots",VZ=60,x2={type:"FeatureCollection",features:[]};function KD(e,t,r){if(t.overview){let[o,s,l,u]=t.overview.bounds;e.fitBounds([[o,s],[l,u]],{maxZoom:9,padding:VZ,duration:r});return}let i=t.place,n=Ic(i);if(n){e.fitBounds([[n[0],n[1]],[n[2],n[3]]],{maxZoom:17,duration:r});return}let a=Yn(i);a&&e.flyTo({center:a,zoom:9,essential:!0,duration:r})}function QD(e,t){if(!e)return;let r=Yn(t.place);r&&e.setLngLat(r),e.setOpacity(t.overview?0:r?1:.4)}var UZ=e=>({type:"FeatureCollection",features:(e?.points??[]).map(t=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:t}}))});function JD({initialCenter:e,current:t,dark:r,colors:i,panelFraction:n,ohmYear:a,resolveMedia:o}){let[s,l]=(0,It.useState)(null),u=(0,It.useRef)(null),c=(0,It.useRef)(null),[h,p]=(0,It.useState)(!1),d=(0,It.useRef)(r);d.current=r;let f=(0,It.useRef)(a);f.current=a;let m=(0,It.useRef)(i);m.current=i;let _=(0,It.useRef)(new Map),g=(0,It.useRef)(zc(r,a)),y=(0,It.useRef)(t);y.current=t,(0,It.useEffect)(()=>{if(!s)return;p(!1),g.current=zc(d.current,f.current);let b=new sD({container:s,style:Qf(d.current,f.current),zoom:5,attributionControl:{compact:!0},canvasContextAttributes:{preserveDrawingBuffer:!0}});u.current=b,b.on("style.load",()=>p(!0)),b.setPadding({top:0,bottom:0,left:0,right:s.clientWidth*n});let w=y.current;return b.jumpTo({center:Yn(w.place)??e}),KD(b,w,0),b.on("load",()=>{let T=m.current,S=document.createElement("div");S.style.width="26px",S.style.height="26px",S.style.transition="opacity 300ms",S.innerHTML=`<svg viewBox="0 0 24 24" width="26" height="26"><path d="${Fc}" fill="${T.mark}" stroke="${T.surface}" stroke-width="1.5" /></svg>`,c.current=new cD({element:S,anchor:"bottom"}).setLngLat(e).addTo(b),QD(c.current,y.current)}),()=>{c.current?.remove(),c.current=null,b.remove(),u.current=null}},[s]),(0,It.useEffect)(()=>{let b=u.current,w=zc(r,a);!b||g.current===w||(g.current=w,g2(b,Qf(r,a),()=>p(!1)))},[r,a]),(0,It.useEffect)(()=>{let b=u.current;!b||!h||a==null||y2(b,a)},[h,a]),(0,It.useEffect)(()=>{let b=u.current;if(!b||!h||b.getSource(Lo))return;let w=m.current;b.addSource(Lo,{type:"geojson",data:x2});let T=["coalesce",["get","color"],w.mark];b.addLayer({id:XD,type:"fill",source:Lo,filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":T,"fill-opacity":.25}}),b.addLayer({id:LZ,type:"line",source:Lo,filter:["any",["==",["geometry-type"],"Polygon"],["==",["geometry-type"],"LineString"]],paint:{"line-color":T,"line-width":2}}),b.addLayer({id:BZ,type:"circle",source:Lo,filter:["all",["==",["geometry-type"],"Point"],["!",["has","name"]]],paint:{"circle-radius":5,"circle-color":T,"circle-stroke-width":1,"circle-stroke-color":w.surface}}),b.addLayer({id:OZ,type:"symbol",source:Lo,filter:["all",["==",["geometry-type"],"Point"],["has","name"]],layout:{"text-field":["get","name"],"text-size":12,"text-font":["Noto Sans Regular"],"text-anchor":"left","text-offset":[.6,0]},paint:{"text-color":["coalesce",["get","color"],w.text],"text-halo-color":w.surface,"text-halo-width":1.5}}),b.addSource(v2,{type:"geojson",data:x2}),b.addLayer({id:NZ,type:"circle",source:v2,paint:{"circle-radius":6,"circle-color":w.mark,"circle-stroke-width":2,"circle-stroke-color":w.surface}})},[h]);let v=t.place;(0,It.useEffect)(()=>{let b=u.current;if(!b||!h)return;b.getSource(Lo)?.setData(v?.geometry??x2),b.getSource(v2)?.setData(UZ(t.overview))},[h,t.key,v,t.overview]),(0,It.useEffect)(()=>{let b=u.current;b&&(QD(c.current,t),KD(b,t,900))},[t.key]);let x=JSON.stringify(v?.overlays??[]);return(0,It.useEffect)(()=>{let b=u.current,w=v?.overlays??[];if(!b||!h||w.length===0)return;let T=!1,S=[];return(async()=>{let E=w.map((P,D)=>({overlay:P,i:D})).sort((P,D)=>(P.overlay.order??P.i)-(D.overlay.order??D.i));for(let{overlay:P,i:D}of E){let F=await o(P.media);if(T)return;if(!F)continue;let I=`${jZ}${D}`;b.getSource(I)||(b.addSource(I,{type:"image",url:F,coordinates:P.corners}),b.addLayer({id:I,type:"raster",source:I},XD),b.setPaintProperty(I,"raster-opacity",P.opacity??1),_.current.set(I,P.date),b.setLayoutProperty(I,"visibility",Zf(P.date,f.current)?"visible":"none"),S.push(I))}})(),()=>{T=!0;for(let E of S)_.current.delete(E),b.getLayer(E)&&b.removeLayer(E),b.getSource(E)&&b.removeSource(E)}},[x,h]),(0,It.useEffect)(()=>{let b=u.current;if(!(!b||!h))for(let[w,T]of _.current)b.getLayer(w)&&b.setLayoutProperty(w,"visibility",Zf(T,a)?"visible":"none")},[a,h]),(0,e8.jsx)("div",{ref:l,style:{position:"absolute",inset:0}})}var Xn=ur(Xi(),1);function b2({mode:e,onModeChange:t,autoYear:r,year:i,onYearChange:n,yearBounds:a,strings:o,colors:s}){let l=[["auto",o.auto],["standard",o.standard],["historical",o.historical]],u={fontSize:12,fontFamily:"inherit"};return(0,Xn.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,whiteSpace:"nowrap"},children:[(0,Xn.jsx)("div",{role:"radiogroup","aria-label":o.mapMode,style:{display:"flex",border:`1px solid ${s.border}`,borderRadius:6,overflow:"hidden",background:s.surface},children:l.map(([c,h])=>(0,Xn.jsx)("button",{type:"button",role:"radio","aria-checked":e===c,onClick:()=>t(c),style:{...u,padding:"4px 10px",border:"none",cursor:"pointer",background:e===c?s.mark:"transparent",color:e===c?"#ffffff":s.text},children:h},c))}),e==="auto"&&(0,Xn.jsx)("span",{style:{...u,color:s.muted},children:r!=null?o.historicalMapYear(r):o.noDateStandardMap}),e==="historical"&&(0,Xn.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,Xn.jsx)("input",{type:"range",min:a[0],max:a[1],step:1,value:i,onChange:c=>n(Number(c.currentTarget.value)),"aria-label":o.historicalYear,style:{width:150,accentColor:s.mark}}),(0,Xn.jsx)("input",{type:"number",min:a[0],max:a[1],step:1,value:i,onChange:c=>{let h=Number(c.currentTarget.value);Number.isFinite(h)&&c.currentTarget.value!==""&&n(Math.round(h))},"aria-label":o.historicalYear,style:{...u,width:70,padding:"3px 4px",border:`1px solid ${s.border}`,borderRadius:4,background:s.surface,color:s.text}})]})]})}var $Z=/\*\*([^\n]+?)\*\*|\*([^\n]+?)\*/g;function qZ(e){let t=[],r=0;for(let i of e.matchAll($Z)){let n=i.index??0;n>r&&t.push({text:e.slice(r,n)}),i[1]!==void 0?t.push({text:i[1],bold:!0}):t.push({text:i[2],italic:!0}),r=n+i[0].length}return r<e.length&&t.push({text:e.slice(r)}),t}function w2(e){return e.replace(/\r\n?/g,`
|
|
824
|
+
${o.prelude.vertexSource}`,define:o.define},defaultProjectionData:h,getProjectionData:f=>c.getProjectionData({overscaledTileID:new ir(f.tileID.canonical.z,f.tileID.wrap??0,f.tileID.canonical.z,f.tileID.canonical.x,f.tileID.canonical.y),aligned:f.aligned,applyGlobeMatrix:f.applyGlobeMatrix,applyTerrainMatrix:f.applyTerrainMatrix}),renderTerrainHeightMap:s&&n.currentPass==="offscreen"?f=>Nq(n,s,f):void 0},d=u.renderingMode?u.renderingMode:"2d";if(n.currentPass==="offscreen"){let f=u.prerender;f&&(l.setCustomLayerDefaults(),l.setColorMode(n.colorModeForRenderPass()),f.call(u,l.gl,p),l.setDirty(),e.setBaseState())}else if(n.currentPass==="translucent"){l.setCustomLayerDefaults(),l.setColorMode(n.colorModeForRenderPass()),l.setStencilMode(Ie.disabled);let f=d==="3d"?n.getDepthModeFor3D():n.getDepthModeForSublayer(0,be.ReadOnly);l.setDepthMode(f),u.render(l.gl,p),l.setDirty(),e.setBaseState(),l.bindFramebuffer.set(null)}}function Uq(e,t,r,i){let n=i.context,a=n.bindFramebuffer.get(),o=n.viewport.get();n.setCustomLayerDefaults(),n.setColorMode(i.colorModeForRenderPass()),n.setDepthMode(be.disabled),n.setStencilMode(Ie.disabled),t.implementation.renderToTerrainTile(n.gl,{tileID:{canonical:r.canonical,wrap:r.wrap},width:o[2],height:o[3]}),n.setDirty(),e.setBaseState(),n.bindFramebuffer.set(a),n.viewport.set(o)}function $q(e,t){let r=t.context,i=r.gl,{sky:n,pixelRatio:a}=t.data,o=H$(n,t.transform,a),s=new be(i.LEQUAL,be.ReadWrite,[0,1]),l=Ie.disabled,u=t.colorModeForRenderPass();t.useProgram("sky").draw(r,i.TRIANGLES,s,l,u,ke.disabled,o,null,void 0,"sky",e.vertexBuffer,e.indexBuffer,e.segments)}function qq(e,t){let r=bT(e.position);tI(r,r);let i=Gi(new Float64Array(16));return e.anchor==="map"&&(Pa(i,i,t.rollInRadians),qs(i,i,-t.pitchInRadians),Pa(i,i,t.bearingInRadians),qs(i,i,t.center.lat*Math.PI/180),gT(i,i,-t.center.lng*Math.PI/180)),iI(r,r,i),r}function Gq(e,t){let r=t.context,i=r.gl,{sky:n,light:a}=t.data,o=t.useProgram("atmosphere"),s=new be(i.LEQUAL,be.ReadOnly,[0,1]),l=t.transform,u=qq(a,l),c=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),h=yo(l.worldSize,l.center.lat),p=zP(l),d=FP(Ui(p)-h,h),f=n["atmosphere-blend"]*c.projectionTransition*d;if(f===0)return;let m=G$(u,f,p,h,l.inverseProjectionMatrix);o.draw(r,i.TRIANGLES,s,Ie.disabled,vt.alphaBlended,ke.disabled,m,null,null,"atmosphere",e.vertexBuffer,e.indexBuffer,e.segments)}var Zq={symbol:Q$,circle:nq,heatmap:aq,line:gq,fill:yq,fillExtrusion:_q,hillshade:vq,colorRelief:bq,raster:wq,background:Cq,sky:$q,atmosphere:Gq,custom:Vq,debug:Fq,debugPadding:kq,terrainDepth:Oq},X6=b_.maxOverzooming+b_.maxUnderzooming+1,K6=1/2**16,Hq={name:TP,define:wP,prelude:dn.projectionMercator},Wq=class{constructor(e){this.currentLayer=0,this.opaquePassCutoff=1/0,this.depthRangeFor3D=[0,1],this.isRenderingToTexture=!1,this.nextStencilID=1,this.tileClippingMaskIDs={},this.transform=e.transform,this.terrain=e.terrain,this.data=e.data,this.context=e.context,this.programCache=e.programCache,this.currentPass=e.currentPass,this.projection=e.projection}getProjectionDataForTile(e,t={}){let r=this.transform.getProjectionData({overscaledTileID:e,aligned:t.aligned,applyGlobeMatrix:!this.isRenderingToTexture,applyTerrainMatrix:t.applyTerrainMatrix??!0});return this.isRenderingToTexture||(r.uniformBufferKey=t.aligned?`${e.key}/aligned`:e.key),r}getTerrainDataForTile(e){return this.isRenderingToTexture?null:this.terrain?.getTerrainData(e)??null}getMeshFromTileID(e,t,r,i){return this.projection.getMeshFromTileID(this.context,e,t,r,i)}useProgram(e,t,r=!1,i=[]){return this.programCache.getProgram({name:e,programConfiguration:t,projectionShaderVariant:r?Hq:this.data.projectionShaderVariant,showOverdrawInspector:this.data.showOverdrawInspector,useTerrain:this.terrain!==null,defines:i})}colorModeForRenderPass(){let e=this.context.gl;if(this.data.showOverdrawInspector){let t=.125;return new vt([e.CONSTANT_COLOR,e.ONE],new he(t,t,t,0),[!0,!0,!0,!0])}return this.currentPass==="opaque"?vt.unblended:vt.alphaBlended}getDepthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return be.disabled;let i=1-((1+this.currentLayer)*X6+e)*K6;return new be(r||this.context.gl.LEQUAL,t,[i,i])}getDepthModeFor3D(){return new be(this.context.gl.LEQUAL,be.ReadWrite,this.depthRangeFor3D)}setDepthRangeFor3D(e){this.depthRangeFor3D=[0,1-(e+2)*X6*K6]}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}clearStencil(){this.nextStencilID=1,this.currentStencilSource=void 0,this.context.clear({stencil:0})}invalidateTileClippingMasks(){this.currentStencilSource=void 0}renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t?.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let r=this.context;r.setColorMode(vt.disabled),r.setDepthMode(be.disabled);let i={};for(let n of t)i[n.key]=this.nextStencilID++;this.data.useSubdivision&&this.renderTileMasks(i,t,!0),this.renderTileMasks(i,t,!1),this.tileClippingMaskIDs=i}renderTileMasks(e,t,r){let i=this.context,n=i.gl,a=this.useProgram("clippingMask");for(let o of t){let s=e[o.key],l=this.getTerrainDataForTile(o),u=this.getMeshFromTileID(o.canonical,r,!0,"stencil"),c=this.getProjectionDataForTile(o);a.draw(i,n.TRIANGLES,be.disabled,new Ie({func:n.ALWAYS,mask:0},s,255,n.KEEP,n.KEEP,n.REPLACE),vt.disabled,this.isRenderingToTexture?ke.disabled:ke.backCCW,null,l,c,"$clipping",u.vertexBuffer,u.indexBuffer,u.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new Ie({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new Ie({func:t.EQUAL,mask:255},this.tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,r=e.sort((a,o)=>o.overscaledZ-a.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();let a={};for(let o=0;o<n;o++)a[o+i]=new Ie({func:t.GEQUAL,mask:255},o+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=n,[a,r]}return[{[i]:Ie.disabled},r]}stencilConfigForOverlapTwoPass(e){let t=this.context.gl,r=e.sort((a,o)=>o.overscaledZ-a.overscaledZ),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(this.clearStencil(),n>1){let a={},o={};for(let s=0;s<n;s++)a[s+i]=new Ie({func:t.GREATER,mask:255},n+1+s,255,t.KEEP,t.KEEP,t.REPLACE),o[s+i]=new Ie({func:t.GREATER,mask:255},1+s,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID=n*2+1,[a,o,r]}return this.nextStencilID=3,[{[i]:new Ie({func:t.GREATER,mask:255},2,255,t.KEEP,t.KEEP,t.REPLACE)},{[i]:new Ie({func:t.GREATER,mask:255},1,255,t.KEEP,t.KEEP,t.REPLACE)},r]}},vo,Yq=(vo=class{constructor(t){this.drawFunctions=Zq,this.context=new qU(t),this.programCache=new Y$(this.context),this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:Gi(new Float64Array(16)),renderTime:0},this.setup()}resize(t,r,i){this.width=Math.round(t*i),this.height=Math.round(r*i),this.context.viewport.set([0,0,this.width,this.height])}setup(){let t=this.context,r=new ho;r.emplaceBack(0,0),r.emplaceBack(R,0),r.emplaceBack(0,R),r.emplaceBack(R,R),this.tileExtentBuffer=t.createVertexBuffer(r,Fs.members),this.tileExtentSegments=ct.simpleSegment(0,0,4,2);let i=new ho;i.emplaceBack(0,0),i.emplaceBack(R,0),i.emplaceBack(0,R),i.emplaceBack(R,R),this.debugBuffer=t.createVertexBuffer(i,Fs.members),this.debugSegments=ct.simpleSegment(0,0,4,5);let n=new fz;n.emplaceBack(0,0,0,0),n.emplaceBack(R,0,R,0),n.emplaceBack(0,R,0,R),n.emplaceBack(R,R,R,R),this.rasterBoundsBuffer=t.createVertexBuffer(n,KV.members),this.rasterBoundsSegments=ct.simpleSegment(0,0,4,2);let a=new ho;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,Fs.members),this.viewportSegments=ct.simpleSegment(0,0,4,2);let o=new Cz;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);let s=new yn;s.emplaceBack(1,0,2),s.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.tileExtentMesh=new hc(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments);let l=new ho;l.emplaceBack(-1,-1),l.emplaceBack(1,-1),l.emplaceBack(1,1),l.emplaceBack(-1,1);let u=new yn;u.emplaceBack(0,1,2),u.emplaceBack(0,2,3),this.skyMesh=new hc(t.createVertexBuffer(l,Fs.members),t.createIndexBuffer(u),ct.simpleSegment(0,0,l.length,u.length))}_renderTilesDepthBuffer(t){let r=this.context,i=r.gl,n=t.transform,a=t.useProgram("depth"),o=t.getDepthModeFor3D(),s=Cc(n,{tileSize:n.tileSize});for(let l of s){let u=t.getTerrainDataForTile(l),c=t.getMeshFromTileID(l.canonical,!0,!0,"raster"),h=t.getProjectionDataForTile(l);a.draw(r,i.TRIANGLES,o,Ie.disabled,vt.disabled,ke.backCCW,null,u,h,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}render(t,r,i){if(this.context.gl.isContextLost())return;let n=new Wq({transform:r,terrain:t.map.terrain??null,data:i,context:this.context,programCache:this.programCache,currentPass:"offscreen",projection:t.projection});this.lineAtlas=t.lineAtlas,this.patternAtlas=t.patternAtlas,VU(this.context.frameUniformBuffer,r,i),t.imageManager.beginFrame(),OU(this.context);let a=t._order,o=t.tileManagers,s={},l={},u={};for(let h in o){let p=o[h];p.used&&p.prepare(this.context),s[h]=p.getVisibleCoordinates(!1),l[h]=s[h].slice().reverse(),u[h]=p.getVisibleCoordinates(!0).reverse()}n.opaquePassCutoff=1/0;for(let h=0;h<a.length;h++){let p=a[h];if(t._layers[p].is3D()){n.opaquePassCutoff=h;break}}this.maybeDrawDepth(n),this.renderToTexture&&(this.renderToTexture.prepareForRender(t,r.zoom,i.moving),n.opaquePassCutoff=0),n.currentPass="offscreen";for(let h of a){let p=t._layers[h];if(!p.hasOffscreenPass()||p.isHidden(r.zoom))continue;let d=l[p.source];(p.type==="custom"||d.length)&&this.renderLayer(this,o[p.source],p,d,n)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?he.black:he.transparent,depth:1}),n.clearStencil(),i.sky&&this.drawFunctions.sky(this.skyMesh,n),n.setDepthRangeFor3D(t._order.length),!this.renderToTexture)for(n.currentPass="opaque",n.currentLayer=a.length-1;n.currentLayer>=0;n.currentLayer--){let h=t._layers[a[n.currentLayer]];if(h.isHidden(r.zoom))continue;let p=o[h.source],d=s[h.source];n.renderTileClippingMasks(h,d),this.renderLayer(this,p,h,d,n)}n.currentPass="translucent";let c=!1;for(n.currentLayer=0;n.currentLayer<a.length;n.currentLayer++){let h=t._layers[a[n.currentLayer]];if(h.isHidden(r.zoom))continue;let p=o[h.source];if(this.renderToTexture?.renderLayer(h,t,n))continue;!n.opaquePassEnabledForLayer()&&!c&&(c=!0,i.isRenderingGlobe&&!n.terrain&&this._renderTilesDepthBuffer(n));let d=(h.type==="symbol"?u:l)[h.source];n.renderTileClippingMasks(h,s[h.source]),this.renderLayer(this,p,h,d,n)}if(i.isRenderingGlobe&&this.drawFunctions.atmosphere(this.skyMesh,n),i.showTileBoundaries){let h=Bq(t,r.zoom);h&&this.drawFunctions.debug(this,h,h.getVisibleCoordinates(),n)}i.showPadding&&this.drawFunctions.debugPadding(n),this.renderToTexture&&!i.moving&&this.clearRTTPool(),this.context.setDefault()}markTerrainDepthDirty(){this.terrainFacilitator.depthDirty=!0}maybeDrawDepth(t){if(!t.data.projectionShaderVariant||!t.terrain)return;let r=this.terrainFacilitator.matrix,i=t.transform.modelViewProjectionMatrix,n=this.terrainFacilitator.depthDirty;n||(n=!eI(r,i)),n||(n=t.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime)),n&&(YM(r,i),this.terrainFacilitator.renderTime=Be(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,t.terrain,t))}renderLayer(t,r,i,n,a){if(i.isHidden(a.transform.zoom)||i.type!=="background"&&i.type!=="custom"&&!(n||[]).length)return;let o=this.drawFunctions;wC(i)?o.symbol(t,r,i,n,a):Qz(i)?o.circle(r,i,n,a):r9(i)?o.heatmap(t,r,i,n,a):CF(i)?o.line(t,r,i,n,a):$9(i)?o.fill(t,r,i,n,a):dF(i)?o.fillExtrusion(r,i,n,a):o9(i)?o.hillshade(t,r,i,n,a):h9(i)?o.colorRelief(t,r,i,n,a):my(i)?o.raster(r,i,n,a):SL(i)?o.background(t,r,i,n,a):Ef(i)&&o.custom(t,r,i,n,a)}saveTileTexture(t){let r=this._tileTextures[t.size[0]];r?r.length<vo.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?r.push(t):t.destroy():this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let r=this._tileTextures[t];return r&&r.length>0?r.pop():null}acquireRTT(t){let r=this.context.gl,i=this._rttObjectRecyclePool.pop();if(i)return i.size!==t&&(i.texture.update({width:t,height:t,data:null},{premultiply:!1,useMipmap:!0}),i.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),i.size=t),i;let n=new Ot(this.context,{width:t,height:t,data:null},r.RGBA,{premultiply:!1,useMipmap:!0});return n.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&r.texParameterf(r.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:n,size:t}}bindRTT(t){let r=this.context.gl,i=t.size;if(!this._rttSharedFbo){let n=this.context.createFramebuffer(i,i,!0,!0),a=this.context.createRenderbuffer(r.DEPTH_STENCIL,i,i);n.depthAttachment.set(a),this._rttSharedFbo={fbo:n,depthRenderbuffer:a,size:i}}this._rttSharedFbo.size!==i&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,i,i),this.context.bindRenderbuffer.set(null),this._rttSharedFbo.fbo.width=i,this._rttSharedFbo.fbo.height=i,this._rttSharedFbo.size=i),this._rttSharedFbo.fbo.colorAttachment.set(t.texture.texture),this.context.bindFramebuffer.set(this._rttSharedFbo.fbo.framebuffer)}releaseRTT(t){this._rttObjectRecyclePool.push(t)}clearRTTPool(){for(let t of this._rttObjectRecyclePool)t.texture.destroy();this._rttObjectRecyclePool.length=0}destroyRTTResources(){if(this.clearRTTPool(),!this._rttSharedFbo)return;this._rttSharedFbo.fbo.colorAttachment.set(null),this._rttSharedFbo.fbo.depthAttachment.set(null);let t=this.context.gl;t.deleteRenderbuffer(this._rttSharedFbo.depthRenderbuffer),t.deleteFramebuffer(this._rttSharedFbo.fbo.framebuffer),this._rttSharedFbo=null}setBaseState(){let t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){if(this.debugOverlayCanvas==null){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new Ot(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let r=this._tileTextures[t];if(r)for(let i of r)i.destroy()}this._tileTextures={}}this.destroyRTTResources(),this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.viewportBuffer&&this.viewportBuffer.destroy(),this.tileBorderIndexBuffer&&this.tileBorderIndexBuffer.destroy(),this.quadTriangleIndexBuffer&&this.quadTriangleIndexBuffer.destroy(),this.tileExtentMesh&&this.tileExtentMesh.vertexBuffer?.destroy(),this.tileExtentMesh&&this.tileExtentMesh.indexBuffer?.destroy(),this.skyMesh?.destroy(),this.skyMesh=null,this.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.destroy(),this.programCache.destroy(),this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:r}=this.context.gl;return this.width!==t||this.height!==r}},vo.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50,vo),Xq=class extends Error{constructor(e,t){super("WebGL2 is required to display this map. We are sorry, but it seems that your browser does not support WebGL2, a technology for rendering 3D graphics on the web. Read more on https://wiki.openstreetmap.org/wiki/This_map_requires_WebGL"),this.name="GPUInitializationError",this.requestedAttributes=e,this.statusMessage=t?.statusMessage??null}};function Xv(e,t){let r=!1,i=null,n,a=()=>{i=null,r&&(r=(e(...n),i=setTimeout(a,t),!1))};return(...o)=>(r=!0,n=o,i||a(),i)}var Kq=class{constructor(e){this._getHashParams=()=>new URLSearchParams(window.location.hash.replace("#","")),this._getCurrentHash=()=>{let t=this._getHashParams();return this._hashName?(t.get(this._hashName)||"").split("/"):([...t.keys()][0]??"").split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(!this._isValidHash(t))return!1;let r=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:r,pitch:+(t[4]||0)}),!0},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{let t=this._getHashParams();if(this._hashName)t.delete(this._hashName);else{let a=Array.from(t.keys());a.length>0&&t.delete(a[0])}let r=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=r?`#${r}`:"",n=window.location.href.replace(/(#.+)?$/,i);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=Xv(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let t=this._map.getCenter(),r=Math.round(this._map.getZoom()*100)/100,i=tF(this._map._camera.transform.worldCoordinateHelper,t),n=10**Math.ceil((r*Math.LN2+Math.log(512/i/.5))/Math.LN10),a=Math.round(t.lng*n)/n,o=Math.round(t.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch(),u="";if(u+=e?`/${a}/${o}/${r}`:`${r}/${o}/${a}`,(s||l)&&(u+=`/${Math.round(s*10)/10}`),l&&(u+=`/${Math.round(l)}`),this._hashName){let c=this._getHashParams();return c.set(this._hashName,u),`#${decodeURIComponent(c.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${u}`}_isValidHash(e){if(e.length<3||e.some(n=>isNaN(+n)))return!1;try{new H(+e[2],+e[1])}catch{return!1}let t=+e[0],r=+(e[3]||0),i=+(e[4]||0);return t>=this._map.getMinZoom()&&t<=this._map.getMaxZoom()&&r>=-180&&r<=180&&i>=this._map.getMinPitch()&&i<=this._map.getMaxPitch()}},Pc={linearity:.3,easing:F_(0,0,.3,1)},Qq=J({deceleration:2500,maxSpeed:1400},Pc),Jq=J({deceleration:20,maxSpeed:1400},Pc),eG=J({deceleration:1e3,maxSpeed:360},Pc),tG=J({deceleration:1e3,maxSpeed:90},Pc),rG=J({deceleration:1e3,maxSpeed:360},Pc),iG=class{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:Be(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=Be();for(;e.length>0&&t-e[0].time>160;)e.shift()}_getVelocityEntries(){let e=this._inertiaBuffer,t=Be()-60,r=Math.max(0,e.length-2);for(;r>0&&e[r-1].time>=t;)r--;return e.slice(r)}_onMoveEnd(e){this._drainInertiaBuffer();let t=this._getVelocityEntries();if(t.length<2){this.clear();return}let r={zoom:0,bearing:0,pitch:0,roll:0,pan:new k(0,0),pinchAround:void 0,around:void 0};for(let{settings:a}of t)a.around&&(r.around=a.around),a.pinchAround&&(r.pinchAround=a.pinchAround);for(let{settings:a}of t.slice(1))r.zoom+=a.zoomDelta||0,r.bearing+=a.bearingDelta||0,r.pitch+=a.pitchDelta||0,r.roll+=a.rollDelta||0,a.panDelta&&r.pan._add(a.panDelta);if(!r.pan.mag()&&!r.zoom&&!r.bearing&&!r.pitch&&!r.roll){this.clear();return}let i=Be()-t[0].time,n={};if(r.pan.mag()){let a=Cu(r.pan.mag(),i,J({},Qq,e||{})),o=r.pan.mult(a.amount/r.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(o,this._map._camera.transform);n.center=s.easingCenter,n.offset=s.easingOffset,Eu(n,a)}if(r.zoom){let a=Cu(r.zoom,i,Jq);n.zoom=Jr(this._map.getZoom()+a.amount,this._map.getZoomSnap(),a.amount),Eu(n,a)}if(r.bearing){let a=Cu(r.bearing,i,eG);n.bearing=this._map.getBearing()+Q(a.amount,-179,179),Eu(n,a)}if(r.pitch){let a=Cu(r.pitch,i,tG);n.pitch=this._map.getPitch()+a.amount,Eu(n,a)}if(r.roll){let a=Cu(r.roll,i,rG);n.roll=this._map.getRoll()+Q(a.amount,-179,179),Eu(n,a)}if(n.zoom||n.bearing){let a=r.pinchAround===void 0?r.around:r.pinchAround;n.around=a?this._map.unproject(a):this._map.getCenter()}return this.clear(),J(n,{noMoveStart:!0})}};function Eu(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Cu(e,t,r){let{maxSpeed:i,linearity:n,deceleration:a}=r,o=Q(e*n/(t/1e3),-i,i),s=Math.abs(o)/(a*n);return{easing:r.easing,duration:s*1e3,amount:s/2*o}}var nG=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new YI(this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new ei(e.type,this._map,e))}mouseup(e){this._map.fire(new ei(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new ei(e.type,this._map,e))}dblclick(e){return this._firePreventable(new ei(e.type,this._map,e))}mouseover(e){this._map.fire(new ei(e.type,this._map,e))}mouseout(e){this._map.fire(new ei(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Dp(e.type,this._map,e))}touchmove(e){this._map.fire(new Dp(e.type,this._map,e))}touchend(e){this._map.fire(new Dp(e.type,this._map,e))}touchcancel(e){this._map.fire(new Dp(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},aG=class{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent,this._clearLongPress(),this._touchActive=!1}mousemove(e){this._map.fire(new ei(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new ei("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}touchstart(e,t,r){if(this._clearLongPress(),this._touchActive=r.length>0,r.length!==1)return;this._longPressStart=t[0];let i=r[0];this._longPressTimer=setTimeout(()=>{this._longPressTimer=void 0;let n=new MouseEvent("contextmenu",{clientX:i.clientX,clientY:i.clientY,button:2,bubbles:!0,cancelable:!0});this._map.fire(new ei("contextmenu",this._map,n))},500)}touchmove(e,t,r){this._longPressTimer&&(r.length!==1||!this._longPressStart||t[0].dist(this._longPressStart)>this._clickTolerance)&&this._clearLongPress()}touchend(){this._touchActive=!1,this._clearLongPress()}touchcancel(){this._touchActive=!1,this._clearLongPress()}_clearLongPress(){this._longPressTimer&&(this._longPressTimer=(clearTimeout(this._longPressTimer),void 0)),this._longPressStart=void 0}contextmenu(e){this._touchActive?e.preventDefault():(this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new ei(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault())}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},oG=class{constructor(e,t,r){this._map=e,this._tr=r,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1,t.boxZoom&&typeof t.boxZoom=="object"&&(this._boxZoomEnd=t.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&e.button===0&&(ht.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=r,this._box||(this._box=ht.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let n=Math.min(i.x,r.x),a=Math.max(i.x,r.x),o=Math.min(i.y,r.y),s=Math.max(i.y,r.y);this._box.style.transform=`translate(${n}px,${o}px)`,this._box.style.width=`${a-n}px`,this._box.style.height=`${s-o}px`}mouseupWindow(e,t){if(!this._active||e.button!==0)return;let r=this._startPos,i=t;if(this.reset(),ht.suppressClick(),r.x===i.x&&r.y===i.y)this._fireEvent("boxzoomcancel",e);else{if(this._map.fire(new e5("boxzoomend",{originalEvent:e})),this._boxZoomEnd){this._boxZoomEnd(this._map,r,i,e);return}return{cameraAnimation:n=>n.fitScreenCoordinates(r,i,this._tr.bearing,{linear:!0})}}}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(this._box=(this._box.remove(),null)),ht.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,t){return this._map.fire(new e5(e,{originalEvent:t}))}};function C_(e,t){if(e.length!==t.length)throw Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let r={};for(let i=0;i<e.length;i++)r[e[i].identifier]=t[i];return r}function sG(e){let t=new k(0,0);for(let r of e)t._add(r);return t.div(e.length)}var lG=class{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,t,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),!this.aborted&&(this.startTime===void 0&&(this.startTime=e.timeStamp),r.length===this.numTouches&&(this.centroid=sG(t),this.touches=C_(r,t)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;let i=C_(r,t);for(let n in this.touches){let a=this.touches[n],o=i[n];(!o||o.dist(a)>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),r.length===0){let i=!this.aborted&&this.centroid;if(this.reset(),i)return i}}},P_=class{constructor(e){this.singleTap=new lG(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){let i=this.singleTap.touchend(e,t,r);if(i){let n=e.timeStamp-this.lastTime<500,a=!this.lastTap||this.lastTap.dist(i)<30;if((!n||!a)&&this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}},uG=class{constructor(e,t){this._tr=t,this._zoomIn=new P_({numTouches:1,numTaps:2}),this._zoomOut=new P_({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){let i=this._zoomIn.touchend(e,t,r),n=this._zoomOut.touchend(e,t,r),a=this._tr;if(i)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:Jr(a.zoom+1,o.getZoomSnap()),around:a.transform.isPointOnMapSurface(i)?a.unproject(i):void 0},{originalEvent:e})};if(n)return this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:o=>o.easeTo({duration:300,zoom:Jr(a.zoom-1,o.getZoomSnap()),around:a.transform.isPointOnMapSurface(n)?a.unproject(n):void 0},{originalEvent:e})}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},kf=class{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._startPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._startPoint=Array.isArray(t)?t[0]:t,this._lastPoint=this._startPoint,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e)){this.reset(e);return}let i=Array.isArray(t)?t[0]:t;if(!(!this._moved&&i.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=i,this._move(r,i,this._startPoint)}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&ht.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}},cG={0:1,2:2};function hG(e,t){let r=cG[t];return e.buttons===void 0||(e.buttons&r)!==r}var zf=class{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){this._eventButton=e.button}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!hG(e,this._eventButton)}isValidEndEvent(e){return e.button===this._eventButton}};function Kv(e,t,r){return t==="center"||!(e.bearingDelta||e.pitchDelta||e.rollDelta)?e:{...e,around:r}}var Ff=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=t=>{t.preventDefault()}};function pG({enable:e,clickTolerance:t}){return new kf({clickTolerance:t,move:(r,i)=>({around:i,panDelta:i.sub(r)}),activateOnStart:!0,moveStateManager:new zf({checkCorrectEvent:r=>r.button===0&&!r.ctrlKey}),enable:e,assignEvents:Ff})}function dG({enable:e,clickTolerance:t,minPixelCenterThreshold:r=100,rotateSpeed:i=.8},n,a,o){return new kf({clickTolerance:t,move:(s,l,u)=>{if(a?.()==="pointer")return Kv({bearingDelta:(l.x-s.x)*i},"pointer",u);let c=n(),h=(o?.()??"circular")==="circular";if(h&&Math.abs(c.y-s.y)>r)return{bearingDelta:RI(new k(s.x,l.y),l,c)};let p=(l.x-s.x)*i;return h&&l.y<c.y&&(p=-p),{bearingDelta:p}},moveStateManager:new zf({checkCorrectEvent:s=>s.button===0&&s.ctrlKey||s.button===2&&!s.ctrlKey}),enable:e,assignEvents:Ff})}function fG({enable:e,clickTolerance:t,pitchSpeed:r=-.5},i){return new kf({clickTolerance:t,move:(n,a,o)=>Kv({pitchDelta:(a.y-n.y)*r},i?.()??"center",o),moveStateManager:new zf({checkCorrectEvent:n=>n.button===0&&n.ctrlKey||n.button===2}),enable:e,assignEvents:Ff})}function mG({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:r=.3},i,n){return new kf({clickTolerance:t,move:(a,o,s)=>{let l=i(),u=(o.x-a.x)*r;return o.y<l.y&&(u=-u),Kv({rollDelta:u},n?.()??"center",s)},moveStateManager:new zf({checkCorrectEvent:a=>a.button===2&&a.ctrlKey}),enable:e,assignEvents:Ff})}var gG=class{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new k(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active)if(this._shouldBePrevented(r.length))this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e);else return e.preventDefault(),this._calculateTransform(e,t,r)}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,t,r){r.length>0&&(this._active=!0);let i=C_(r,t),n=new k(0,0),a=new k(0,0),o=0;for(let l in i){let u=i[l],c=this._touches[l];c&&(n._add(u),a._add(u.sub(c)),o++,i[l]=u)}if(this._touches=i,this._shouldBePrevented(o)||!a.mag())return;let s=a.div(o);if(this._sum._add(s),!(this._sum.mag()<this._clickTolerance))return{around:n.div(o),panDelta:s}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},Qv=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){if(!this._firstTwoTouches)return;e.preventDefault();let[i,n]=this._firstTwoTouches,a=ed(r,t,i),o=ed(r,t,n);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;let[i,n]=this._firstTwoTouches,a=ed(r,t,i),o=ed(r,t,n);a&&o||(this._active&&ht.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function ed(e,t,r){for(let i=0;i<e.length;i++)if(e[i].identifier===r)return t[i]}var Q6=.1;function J6(e,t){return Math.log(e/t)/Math.LN2}var yG=class extends Qv{constructor(){super(),this._zoomRate=1,this._zoomThreshold=Q6}setZoomRate(e){this._zoomRate=e??1}setZoomThreshold(e){this._zoomThreshold=e??Q6}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let r=this._distance;if(this._distance=e[0].dist(e[1]),!(!this._active&&Math.abs(J6(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:J6(this._distance,r)*this._zoomRate,pinchAround:t}}};function eT(e,t){return e.angleWith(t)*180/Math.PI}var _G=class extends Qv{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,r){let i=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:eT(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,r=eT(e,this._startVector);return Math.abs(r)<t}};function $1(e){return Math.abs(e.y)>Math.abs(e.x)}var vG=class extends Qv{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,$1(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let i=e[0].sub(this._lastPoints[0]),n=e[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid)return this._lastPoints=e,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}}gestureBeginsVertically(e,t,r){if(this._valid!==void 0)return this._valid;let i=e.mag()>=2,n=t.mag()>=2;if(!i&&!n)return;if(!i||!n)return this._firstMove===void 0&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return $1(e)&&$1(t)&&a}},xG={panStep:100,bearingStep:15,pitchStep:10},bG=class{constructor(e,t){this._tr=t;let r=xG;this._panStep=r.panStep,this._bearingStep=r.bearingStep,this._pitchStep=r.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,i=0,n=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:wG,zoom:t?Jr(s.zoom+t*(e.shiftKey?2:1),o.getZoomSnap()):s.zoom,bearing:s.bearing+r*this._bearingStep,pitch:s.pitch+i*this._pitchStep,offset:[-n*this._panStep,-a*this._panStep],center:s.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}};function wG(e){return e*(2-e)}var tT=4.000244140625,TG=class{constructor(e,t,r){this._onTimeout=i=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},this._map=e,this._tr=r,this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return this._map.cooperativeGestures.isEnabled()?!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e)):!1}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e)){this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);return}let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?e.deltaY*40:e.deltaY,r=Be(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,t!==0&&t%tT==0?this._type="wheel":t!==0&&Math.abs(t)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let t=ht.mousePos(this._map.getCanvas(),e),r=this._tr;this._aroundPoint=this._aroundCenter?r.transform.locationToScreenPoint(H.convert(r.center)):t,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let e=this._tr.transform;if(typeof this._lastExpectedZoom=="number"){let o=e.zoom-this._lastExpectedZoom;typeof this._startZoom=="number"&&(this._startZoom+=o),typeof this._targetZoom=="number"&&(this._targetZoom+=o)}if(this._delta!==0){let o=this._type==="wheel"&&Math.abs(this._delta)>tT?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*o)));this._delta<0&&s!==0&&(s=1/s);let l=typeof this._targetZoom=="number"?Bt(this._targetZoom):e.scale,u=e.applyConstrain(e.getCameraLngLat(),Ut(l*s)).zoom,c=this._map.getZoomSnap();if(this._type==="wheel"&&c>0){let h=Jr(e.zoom,c);this._targetZoom=Jr(u,c,u-h)}else this._targetZoom=u;this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let t=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,r=this._startZoom,i=this._easing,n=!1,a;if(this._type==="wheel"&&r&&i){let o=Be()-this._lastWheelEventTime,s=Math.min((o+5)/200,1),l=i(s);a=ot.number(r,t,l),s<1?this._needsRerender=!0:n=!0}else a=t,n=!0;return this._active=!0,n&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout},200)),this._lastExpectedZoom=a,{noInertia:!0,needsRenderFrame:!n,zoomDelta:a-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let t=Q1;if(this._prevEase){let r=this._prevEase,i=(Be()-r.start)/r.duration,n=r.easing(i+.01)-r.easing(i),a=.27/Math.sqrt(n*n+1e-4)*.01;t=F_(a,Math.sqrt(.0729-a*a),.25,1)}return this._prevEase={start:Be(),duration:e,easing:t},t}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},SG=class{constructor(e,t){this._clickZoom=e,this._tapZoom=t}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()}},EG=class{constructor(e,t){this._tr=t,this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:Jr(this._tr.zoom+(e.shiftKey?-1:1),r.getZoomSnap()),around:this._tr.transform.isPointOnMapSurface(t)?this._tr.unproject(t):void 0},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},CG=class{constructor(){this._tap=new P_({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(e){this._zoomRate=e??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,r){if(!this._swipePoint)if(!this._tapTime)this._tap.touchstart(e,t,r);else{let i=t[0],n=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(i)<30;!n||!a?this.reset():r.length>0&&(this._swipePoint=i,this._swipeTouch=r[0].identifier)}}touchmove(e,t,r){if(!this._tapTime)this._tap.touchmove(e,t,r);else if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let i=t[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:n/128*this._zoomRate}}}touchend(e,t,r){if(this._tapTime)this._swipePoint&&r.length===0&&this.reset();else{let i=this._tap.touchend(e,t,r);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},PG=class{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}},DG=class{constructor(e,t,r,i){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=r,this._mouseRoll=i;let{aroundCenter:n=!0}=e;this._defaultMovement=n?"circular":"linear",this.around="center",this.movement=this._defaultMovement}enable(e){let t=typeof e=="object"?e:{};this.around=t.around??"center",this.movement=t.around==="pointer"?"linear":t.movement??this._defaultMovement,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()}},AG=class{constructor(e,t,r,i){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}setZoomRate(e){this._touchZoom.setZoomRate(e),this._tapDragZoom.setZoomRate(e)}setZoomThreshold(e){this._touchZoom.setZoomThreshold(e)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},MG=class{constructor(e,t){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=ht.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=t,this._container.appendChild(i);let n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=r,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(this._container.remove(),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,t){this._enabled&&(this._map.fire(new Wt("cooperativegestureprevented",{gestureType:e,originalEvent:t})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},IG=class{constructor(e){this._camera=e}get transform(){return this._camera._requestedCameraState||this._camera.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(k.convert(e),this._camera.terrain)}},td=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate,kG=class extends Ao{};function q1(e){return e.panDelta?.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}var zG=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(e,t,r){this._terrainGesture={inFlight:!1,anchorElevation:null,anchorCenterElevation:null},this._rotationPivot=null,this.handleWindowEvent=n=>{this.handleEvent(n,`${n.type}Window`)},this.handleEvent=(n,a)=>{if(n.type==="blur"){this.stop(!0);return}this._updatingCamera=!0;let o=n.type==="renderFrame"?void 0:n,s={needsRenderFrame:!1},l={},u={};for(let{handlerName:p,handler:d,allowed:f}of this._handlers){if(!d.isEnabled())continue;let m;if(this._blockedByActive(u,f,p))d.reset();else if(d[a||n.type]){if(BI(n,a||n.type)){let _=ht.mousePos(this._map.getCanvas(),n);m=d[a||n.type](n,_)}else if(LI(n,a||n.type)){let _=n.touches,g=this._getMapTouches(_),y=ht.touchPos(this._map.getCanvas(),g);m=d[a||n.type](n,y,g)}else OI(a||n.type)||(m=d[a||n.type](n));this.mergeHandlerResult(s,l,m,p,o),m?.needsRenderFrame&&this._triggerRenderFrame()}(m||d.isActive())&&(u[p]=d)}let c={};for(let p in this._previousActiveHandlers)u[p]||(c[p]=o);this._previousActiveHandlers=u,(Object.keys(c).length||q1(s))&&(this._changes.push([s,l,c]),this._triggerRenderFrame()),(Object.keys(u).length||q1(s))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=s;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=e,this._camera=t,this._transformProvider=new IG(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iG(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);let i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]];for(let[n,a,o]of this._listeners)n.addEventListener(a,n===this._ownerDocument?this.handleWindowEvent:this.handleEvent,o)}destroy(){for(let[e,t,r]of this._listeners)e.removeEventListener(t,e===this._ownerDocument?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){let t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new nG(t,e));let i=t.boxZoom=new oG(t,e,this._transformProvider);this._add("boxZoom",i),e.interactive&&e.boxZoom&&i.enable();let n=t.cooperativeGestures=new MG(t,e.cooperativeGestures);this._add("cooperativeGestures",n),e.cooperativeGestures&&n.enable();let a=new uG(t,this._transformProvider),o=new EG(t,this._transformProvider);t.doubleClickZoom=new SG(o,a),this._add("tapZoom",a),this._add("clickZoom",o),e.interactive&&e.doubleClickZoom&&t.doubleClickZoom.enable();let s=new CG;this._add("tapDragZoom",s);let l=t.touchPitch=new vG(t);this._add("touchPitch",l),e.interactive&&e.touchPitch&&t.touchPitch.enable(e.touchPitch);let u=()=>this._camera.transform.centerPoint,c=()=>t.dragRotate.around,h=dG(e,u,c,()=>t.dragRotate.movement),p=fG(e,c),d=mG(e,u,c);t.dragRotate=new DG(e,h,p,d),this._add("mouseRotate",h,["mousePitch"]),this._add("mousePitch",p,["mouseRotate","mouseRoll"]),this._add("mouseRoll",d,["mousePitch"]),e.interactive&&e.dragRotate&&t.dragRotate.enable(e.dragRotate);let f=pG(e),m=new gG(e,t);t.dragPan=new PG(r,f,m),this._add("mousePan",f),this._add("touchPan",m,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&t.dragPan.enable(e.dragPan);let _=new _G,g=new yG;t.touchZoomRotate=new AG(r,g,_,s),this._add("touchRotate",_,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&t.touchZoomRotate.enable(e.touchZoomRotate),this._add("blockableMapEvent",new aG(t,e),["touchPan"]);let y=t.scrollZoom=new TG(t,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",y,["mousePan"]),e.interactive&&e.scrollZoom&&t.scrollZoom.enable(e.scrollZoom);let v=t.keyboard=new bG(t,this._transformProvider);this._add("keyboard",v),e.interactive&&e.keyboard&&t.keyboard.enable()}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!td(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,r){for(let i in e)if(i!==r&&!t?.includes(i))return!0;return!1}_getMapTouches(e){let t=[];for(let r of e){let i=r.target;this._el.contains(i)&&t.push(r)}return t}mergeHandlerResult(e,t,r,i,n){if(!r)return;J(e,r);let a={handlerName:i,originalEvent:r.originalEvent||n};r.zoomDelta!==void 0&&(t.zoom=a),r.panDelta!==void 0&&(t.drag=a),r.rollDelta!==void 0&&(t.roll=a),r.pitchDelta!==void 0&&(t.pitch=a),r.bearingDelta!==void 0&&(t.rotate=a)}_applyChanges(){let e={},t={},r={};for(let[i,n,a]of this._changes)i.panDelta&&(e.panDelta=(e.panDelta||new k(0,0))._add(i.panDelta)),i.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+i.zoomDelta),i.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+i.bearingDelta),i.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+i.pitchDelta),i.rollDelta&&(e.rollDelta=(e.rollDelta||0)+i.rollDelta),i.around!==void 0&&(e.around=i.around),i.pinchAround!==void 0&&(e.pinchAround=i.pinchAround),i.noInertia&&(e.noInertia=i.noInertia),J(t,n),J(r,a);this._updateMapTransform(e,t,r),this._changes=[]}_updateMapTransform(e,t,r){let i=this._map.terrain;if(!q1(e)){this._fireEvents(t,r,!0);return}let n=this._camera.getTransformForUpdate();if(this._camera.stop(!0),this._turnsAroundPivot(e,t)){this._orbitRotationPivot(n,e,i),this._commitFrame(n,e,t,r);return}let{panDelta:a,zoomDelta:o,bearingDelta:s,pitchDelta:l,rollDelta:u}=e;o>0&&this._terrainGesture.inFlight&&this._camera.moveCenterOntoTerrain(n,o);let{around:c,aroundOnSurface:h}=this._resolveAround(e,i,n),p=i?this._terrainGestureElevation(i,c,h,n,t):void 0,d={panDelta:a,zoomDelta:o,rollDelta:u,pitchDelta:l,bearingDelta:s,around:c,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!n.isPointOnMapSurface(c)&&(c=n.centerPoint);let f=this._computePreZoomAroundLoc(n,c,a,p);this._handleMapControls({terrain:i,tr:n,deltasForHelper:d,preZoomAroundLoc:f,combinedEventsInProgress:t,panDelta:a}),this._commitFrame(n,e,t,r)}_commitFrame(e,t,r,i){this._camera.applyUpdatedTransform(e),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,i,!0)}_turnsAroundPivot(e,t){return e.around?!t.drag&&!t.zoom:!1}_orbitRotationPivot(e,t,r){r&&!this._terrainGesture.inFlight&&(this._terrainGesture.inFlight=!0,this._camera.holdElevation(e,"gesture"));let{panDelta:i,zoomDelta:n,bearingDelta:a,pitchDelta:o,rollDelta:s,around:l}=t;this._rotationPivot??(this._rotationPivot=this._camera.captureRotationPivot(e,l)),this._camera.orbitRotationPivot(e,this._rotationPivot,{panDelta:i,zoomDelta:n,bearingDelta:a,pitchDelta:o,rollDelta:s,around:l})||(this._rotationPivot=null)}_resolveAround(e,t,r){let i=e.pinchAround===void 0?e.around:e.pinchAround;return i||(i=this._camera.transform.centerPoint),t&&!r.isPointOnMapSurface(i)?{around:r.centerPoint,aroundOnSurface:!1}:{around:i,aroundOnSurface:!0}}_terrainGestureElevation(e,t,r,i,n){if(!r)return;if(this._terrainGesture.anchorCenterElevation!==i.elevation&&(n.drag||n.zoom)){let o=i.screenTerrainPointToMercatorCoordinate(t,e);this._terrainGesture.anchorElevation=o?o.z:void 0,this._terrainGesture.anchorCenterElevation=i.elevation}let a=this._terrainGesture.anchorElevation;if(a!=null&&!(t.distSqr(i.centerPoint)<.01)&&!(a-i.elevation>=.9*(i.getCameraAltitude()-i.elevation)))return a}_computePreZoomAroundLoc(e,t,r,i){if(t.distSqr(e.centerPoint)<.01)return e.center;let n=r?t.sub(r):t;return i===void 0?e.screenPointToLocation(n):e.screenPointToLocationAtElevation(n,i)}_handleMapControls({terrain:e,tr:t,deltasForHelper:r,preZoomAroundLoc:i,combinedEventsInProgress:n,panDelta:a}){let o=this._camera.cameraHelper;o.handleMapControlsRollPitchBearingZoom(r,t),!e&&!o.useGlobeControls&&!t.isPointOnMapSurface(r.around)?a&&t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):e?this._terrainGesture.inFlight?!o.useGlobeControls&&r.aroundElevation===void 0&&n.drag&&a?t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):o.handleMapControlsPan(r,t,i):(this._terrainGesture.inFlight=!0,this._camera.holdElevation(t,"gesture"),o.handleMapControlsPan(r,t,i)):o.handleMapControlsPan(r,t,i)}_fireEvents(e,t,r){let i=td(this._eventsInProgress),n=td(e),a={};for(let c in e){let{originalEvent:h}=e[c];this._eventsInProgress[c]||(a[`${c}start`]=h),this._eventsInProgress[c]=e[c]}!i&&n&&this._fireEvent("movestart",n.originalEvent);for(let c in a)this._fireEvent(c,a[c]);n&&this._fireEvent("move",n.originalEvent);for(let c in e){let{originalEvent:h}=e[c];this._fireEvent(c,h)}let o={},s;for(let c in this._eventsInProgress){let{handlerName:h,originalEvent:p}=this._eventsInProgress[c];this._handlersById[h].isActive()||(delete this._eventsInProgress[c],s=t[h]||p,o[`${c}end`]=s)}for(let c in o)this._fireEvent(c,o[c]);let l=td(this._eventsInProgress),u=(i||n)&&!l;if(u&&this._terrainGesture.inFlight){let c=this._camera.releaseElevation();this._terrainGesture={inFlight:!1,anchorElevation:null,anchorCenterElevation:null},this._camera.applyTransformChange(h=>{this._map.getCenterClampedToGround()&&(this._map.terrain?this._camera.putCenterBackOnTerrain(h,this._map.terrain,c):h.setElevation(0))})}if(r&&u){this._updatingCamera=!0;let c=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),h=p=>p!==0&&-this._bearingSnap<p&&p<this._bearingSnap;c&&(c.essential||!Nr.prefersReducedMotion)?(h(c.bearing||this._map.getBearing())&&(c.bearing=0),c.freezeElevation=!0,this._map.easeTo(c,{originalEvent:s})):(this._fireEvent("moveend",s),h(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}u&&(this._rotationPivot=null)}_fireEvent(e,t){this._camera.fire(new ne(e,t?{originalEvent:t}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new kG("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}},FG=class{constructor(e,t,r){this.holder=e,this.lift=null,this._terrainChanged=!1,this._dem=t?"awaiting":"loaded",this.keepsTerrainBelowMaxZoomForCenter=r}get tookDem(){return this._dem==="taken"}noteTerrainChange(){this._terrainChanged=!0}take(e,t){let r=!1;if(this._terrainChanged&&(this._terrainChanged=!1,t.getElevationAndDEMStateForLngLat(e.center,e).demState!=="loaded"&&(e.setElevation(0),this._dem="awaiting",r=!0)),this._dem!=="awaiting")return r;let i=t.getDrawnElevationForLngLat(e.center,!0);if(i!==void 0)return e.setElevation(i),this._dem="taken",!0;let n=t.getDrawnElevationForLngLat(e.center);return n===void 0||n===e.elevation?r:(e.setElevation(n),!0)}},rT=.01,RG=class extends lr{constructor(e){super(),this._elevationHold=null,this._renderFrameCallback=()=>{let t=Math.min((Be()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this.transform=fd(),this.cameraHelper=new qu,e.minZoom!==void 0&&this.transform.setMinZoom(e.minZoom),e.maxZoom!==void 0&&this.transform.setMaxZoom(e.maxZoom),e.minPitch!==void 0&&this.transform.setMinPitch(e.minPitch),e.maxPitch!==void 0&&this.transform.setMaxPitch(e.maxPitch),e.renderWorldCopies!==void 0&&this.transform.setRenderWorldCopies(e.renderWorldCopies),e.transformConstrain!==null&&this.transform.setConstrainOverride(e.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=e.bearingSnap,this._zoomSnap=e.zoomSnap,this._requestRenderFrame=e.requestRenderFrame,this._cancelRenderFrame=e.cancelRenderFrame,this.terrain=e.terrain,this._centerClampedToGround=e.centerClampedToGround??!0,this.transformCameraUpdate=e.transformCameraUpdate??null,this._stopHandlers=e.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}setTerrain(e){this.terrain=e,e&&this._elevationHold?.noteTerrainChange(),this.applyTerrainChange()}migrateProjection(e,t){if(e.apply(this.transform,!0),this.transform=e,this.cameraHelper=t,this._requestedCameraState){let r=e.clone();r.apply(this._requestedCameraState,!0),this._requestedCameraState=r}}getCenter(){return new H(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,t,r){return e=k.convert(e).mult(-1),this.panTo(this.transform.center,J({offset:e},t),r)}panTo(e,t,r){return this.easeTo(J({center:e},t),r)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,t,r){return this.easeTo(J({zoom:e},t),r)}zoomIn(e,t){return this.zoomTo(Jr(this.getZoom()+1,this._zoomSnap),e,t),this}zoomOut(e,t){return this.zoomTo(Jr(this.getZoom()-1,this._zoomSnap),e,t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,t){return e!=this.transform.fov&&(this.applyTransformChange(r=>r.setFov(e)),this.fire(new ne("movestart",t)).fire(new ne("move",t)).fire(new ne("moveend",t))),this}getBearing(){return this.transform.bearing}setZoomSnap(e){return this._zoomSnap=e,this}getZoomSnap(){return this._zoomSnap}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,t,r){return this.easeTo(J({bearing:e},t),r)}resetNorth(e,t){return this.rotateTo(0,J({duration:1e3},e),t),this}resetNorthPitch(e,t){return this.easeTo(J({bearing:0,pitch:0,roll:0,duration:1e3},e),t),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getRoll(){return this.transform.roll}setRoll(e,t){return this.jumpTo({roll:e},t),this}cameraForBounds(e,t){e=Zn.convert(e).adjustAntiMeridian();let r=t?.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,t)}_cameraForBoxAndBearing(e,t,r,i){let n={top:0,bottom:0,right:0,left:0};if(i=J({padding:n,offset:[0,0],maxZoom:this.transform.maxZoom},i),typeof i.padding=="number"){let p=i.padding;i.padding={top:p,bottom:p,right:p,left:p}}let a=J(n,i.padding);i.padding=a;let o=this.transform,s=new Zn(e,t),l={top:0,bottom:0,right:0,left:0},u=i.absolutePadding?l:a,c=i.absolutePadding?a:J(l,o.padding),h=this.cameraHelper.cameraForBoxAndBearing(i,u,c,s,r,o);if(h)return this._zoomSnap&&(h.zoom=Jr(h.zoom,this._zoomSnap,-1)),i.absolutePadding?{...h,padding:a}:h}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(e,t,r,i,n){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(k.convert(e)),this.transform.screenPointToLocation(k.convert(t)),r,i),i,n)}_fitInternal(e,t,r){return e?(t=J(e,t),t.absolutePadding?(t.padding=e.padding,delete t.absolutePadding):delete t.padding,t.linear?this.easeTo(t,r):this.flyTo(t,r)):this}jumpTo(e,t){this.stop(),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=!1,n=!1,a=!1,o=r.zoom;if(this.terrain&&this.getCenterClampedToGround()){let{elevation:l,demState:u}=this.terrain.getElevationAndDEMStateForLngLat(e.center?H.convert(e.center):r.center,r);u!=="loading"&&r.setElevation(l)}this.cameraHelper.handleJumpToCenterZoom(r,e);let s=r.zoom!==o;return e.elevation!==void 0&&r.elevation!==+e.elevation&&r.setElevation(+e.elevation),e.bearing!==void 0&&r.bearing!==+e.bearing&&(i=!0,r.setBearing(+e.bearing)),e.pitch!==void 0&&r.pitch!==+e.pitch&&(n=!0,r.setPitch(+e.pitch)),e.roll!==void 0&&r.roll!==+e.roll&&(a=!0,r.setRoll(+e.roll)),e.padding!=null&&!r.isPaddingEqual(e.padding)&&r.setPadding(e.padding),this.applyUpdatedTransform(r),this.fire(new ne("movestart",t)).fire(new ne("move",t)),s&&this.fire(new ne("zoomstart",t)).fire(new ne("zoom",t)).fire(new ne("zoomend",t)),i&&this.fire(new ne("rotatestart",t)).fire(new ne("rotate",t)).fire(new ne("rotateend",t)),n&&this.fire(new ne("pitchstart",t)).fire(new ne("pitch",t)).fire(new ne("pitchend",t)),a&&this.fire(new ne("rollstart",t)).fire(new ne("roll",t)).fire(new ne("rollend",t)),this.fire(new ne("moveend",t))}calculateAnchoredCameraOptions(e){let t=this.transform.clone(),r=H.convert(e.anchorLocation),i=k.convert(e.anchorScreenPoint),n={panDelta:i.sub(this.transform.locationToScreenPoint(r,this.terrain)),zoomDelta:e.zoom===void 0?0:e.zoom-t.zoom,bearingDelta:0,pitchDelta:0,rollDelta:0,around:i,aroundElevation:this.terrain?.getElevationForLngLat(r,t)};return this.cameraHelper.handleMapControlsRollPitchBearingZoom(n,t),this.cameraHelper.handleMapControlsPan(n,t,r),{center:t.center,zoom:t.zoom}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){let a=this.transform.calculateCenterFromCameraLngLatAlt(e,t,r,i);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:r,pitch:i,roll:n}}easeTo(e,t){this._stop(!1,e.easeId),e=J({offset:[0,0],duration:500,easing:Q1},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap)),(e.animate===!1||!e.essential&&Nr.prefersReducedMotion)&&(e.duration=0);let r=this.getTransformForUpdate(),i=this.getBearing(),n=r.pitch,a=r.roll,o=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),s=e.pitch===void 0?n:+e.pitch,l=e.roll===void 0?a:this._normalizeBearing(e.roll,a),u=e.padding===void 0?r.padding:e.padding,c=k.convert(e.offset),h,p;e.around&&(h=H.convert(e.around),p=r.locationToScreenPoint(h));let d={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},f=this.cameraHelper.handleEaseTo(r,{bearing:o,pitch:s,roll:l,padding:u,around:h,aroundPoint:p,offsetAsPoint:c,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating||(this._rotating=i!==o),this._pitching||(this._pitching=s!==n),this._rolling||(this._rolling=l!==a),this._padding=!r.isPaddingEqual(u),this._zooming||(this._zooming=f.isZooming),this._easeId=e.easeId,this._prepareEase(t,e.noMoveStart,d,{tr:r,center:f.elevationCenter,freeze:e.freezeElevation}),this._ease(m=>{f.easeFunc(m),this.terrain&&!e.freezeElevation&&this._updateElevation(m,r),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},m=>{this._afterEase(t,m,e.freezeElevation)},e),this}_prepareEase(e,t,r={},i){this._moving=!0,this.terrain&&i&&(this._prepareElevation(i.center,i.tr),i.freeze&&this.holdElevation(i.tr,"animation")),!t&&!r.moving&&this.fire(new ne("movestart",e)),this._zooming&&!r.zooming&&this.fire(new ne("zoomstart",e)),this._rotating&&!r.rotating&&this.fire(new ne("rotatestart",e)),this._pitching&&!r.pitching&&this.fire(new ne("pitchstart",e)),this._rolling&&!r.rolling&&this.fire(new ne("rollstart",e))}_prepareElevation(e,t){this._elevationCenter=e,this._elevationStart=t.elevation;let{elevation:r,demState:i}=this.terrain.getElevationAndDEMStateForLngLat(e,t);this._elevationTarget=i==="loading"?t.elevation:r,this.elevationFreeze=!0}_updateElevation(e,t){(this._elevationStart===void 0||this._elevationCenter===void 0)&&this._prepareElevation(t.center,t),t.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,t.tileZoom));let{elevation:r,demState:i}=this.terrain.getElevationAndDEMStateForLngLat(this._elevationCenter,t),n=i==="loading"?this._elevationTarget:r;if(e<1&&n!==this._elevationTarget){let a=this._elevationTarget-this._elevationStart,o=(n-(a*e+this._elevationStart))/(1-e);this._elevationStart+=e*(a-o),this._elevationTarget=n}this.getCenterClampedToGround()&&t.setElevation(ot.number(this._elevationStart,this._elevationTarget,e))}holdElevation(e,t){this.elevationFreeze=!0;let r=!!this.terrain&&this.getCenterClampedToGround()&&this.terrain.getElevationAndDEMStateForLngLat(e.center,e).demState!=="loaded",i=this.terrain?this._terrainHeightAboveMaxZoomForCenter(e):void 0;this._elevationHold=new FG(t,r,i!==void 0&&i<=rT)}releaseElevation(){let e=this._elevationHold?.tookDem??!1;return this.elevationFreeze=!1,this._elevationHold=null,e}putCenterBackOnTerrain(e,t,r){if(r&&t.getDrawnElevationForLngLat(e.center,!0)===void 0){e.setElevation(t.getElevationForLngLat(e.center,e));let i=this._raiseCameraByPitchAndZoom(e);i!==e&&e.apply(i,!1)}else e.recalculateZoomAndCenter(t)}_takeLandedElevation(e){return!this._elevationHold||!this.terrain||!this.getCenterClampedToGround()?!1:this._elevationHold.take(e,this.terrain)}applyTerrainChange(){if(this.elevationFreeze){let i=this._requestedCameraState;this._elevationHold?.holder==="gesture"&&i&&this._takeLandedElevation(i)&&this.applyUpdatedTransform(i);return}let e=this.transform;if(e.setMinElevationForCurrentTile(this.terrain?this.terrain.getMinTileElevationForLngLatZoom(e.center,e.tileZoom):0),!this.getCenterClampedToGround())return;if(!this.terrain){e.setElevation(0);return}let{elevation:t,demState:r}=this.terrain.getElevationAndDEMStateForLngLat(e.center,e);r!=="loading"&&e.setElevation(t)}getTransformForUpdate(){return!this.transformCameraUpdate&&!this.terrain?this.transform:(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState)}_keepCameraAboveTerrain(e){let t=this._elevationHold;if(!this.terrain||!t||e.pitch>=90||!this.getCenterClampedToGround()||e.getClippingPlane())return this._raiseCameraByPitchAndZoom(e);let r=t.holder==="gesture",i=t.lift&&t.lift.heldElevation+t.lift.height===e.elevation?t.lift:{heldElevation:e.elevation,height:0},n=this._terrainHeightAboveMaxZoomForCenter(e);n!==void 0&&n<=rT&&(t.keepsTerrainBelowMaxZoomForCenter=!0);let a=t.keepsTerrainBelowMaxZoomForCenter&&n!==void 0?n:-1/0,o=r?this._terrainHeightAboveCamera(e):-1/0,s=Math.max(0,Math.max(o,a)+i.height);return s!==i.height&&e.setElevation(i.heldElevation+s),t.lift=s>0?{heldElevation:i.heldElevation,height:s}:null,r?e:this._raiseCameraByPitchAndZoom(e)}_raiseCameraByPitchAndZoom(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90||e.getClippingPlane())return e;let t=e.getCameraLngLat(),r=this.terrain?this._terrainHeightAboveCamera(e):-e.getCameraAltitude();if(r<=0)return e;let i=e.clone();for(let n=0;n<3&&r>0;n++){let{zoom:a,pitch:o}=i.calculateCameraOptionsFromTo(t,i.getCameraAltitude()+r,i.center,i.elevation);i.setZoom(a),i.setPitch(o),r=this.terrain?this._terrainHeightAboveCamera(i):-i.getCameraAltitude()}return i}_terrainHeightAboveCamera(e){let t=this.terrain.getElevationForLngLat(e.getCameraLngLat(),e)-e.getCameraAltitude(),r=e.getClippingPlane()?null:this.terrain.getCoverageIndex();if(!r)return t;let[i,n,a,o]=e.getCameraFrustum().points;for(let s=0;s<=2;s++){let l=s/2;for(let u=0;u<=2;u++){let c=u/2,h=(1-c)*(1-l),p=c*(1-l),d=c*l,f=(1-c)*l,m=h*i[0]+p*n[0]+d*a[0]+f*o[0],_=h*i[1]+p*n[1]+d*a[1]+f*o[1],g=h*i[2]+p*n[2]+d*a[2]+f*o[2],y=tl(r,this.terrain.exaggeration,m,_,e.worldCoordinateHelper.wraps);y.covered&&(t=Math.max(t,y.elevation-g))}}return t}_terrainHeightAboveMaxZoomForCenter(e){let t=this.terrain.getCoverageIndex();if(!t)return;let r=e.worldCoordinateHelper,i=e.getCameraLngLat(),n=r.worldFromLngLat(i.lng,i.lat),a=r.worldFromLngLat(e.center.lng,e.center.lat),o=Bt(e.zoom-e.maxZoom),s=tl(t,this.terrain.exaggeration,Ma(n.x,a.x,o),Ma(n.y,a.y,o),r.wraps);return s.covered?s.elevation-Ma(e.getCameraAltitude(),e.elevation,o):void 0}moveCenterOntoTerrain(e,t){if(!this.terrain||!this.getCenterClampedToGround()||e.getClippingPlane())return;let{center:r,elevation:i,zoom:n}=e;e.recalculateZoomAndCenter(this.terrain),(!(e.zoom>n-t&&e.zoom<e.maxZoom)||Math.abs(this.terrain.getElevationForLngLat(e.center,e)-e.elevation)>=1)&&(e.setZoom(n),e.setCenter(r),e.setElevation(i))}captureRotationPivot(e,t){if(!aT(e,t))return{point:e.centerPoint,location:e.center,distance:yd(e,e.center)};let r=this.terrain?e.screenTerrainPointToMercatorCoordinate(t,this.terrain):null,i=r?r.toLngLat():e.screenPointToLocation(t);return r&&this.cameraHelper.useGlobeControls?{point:e.locationToScreenPoint(i),location:i,distance:yd(e,i)}:{point:t,location:i,elevation:r?.z,distance:yd(e,i,r?.z)}}orbitRotationPivot(e,t,r){if(t.point.equals(e.centerPoint))return this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,e),!0;let i=this._turnAroundPivot(e,t,r)??this._turnAroundPivot(e,t,{...r,pitchDelta:0,rollDelta:0});return i?(e.apply(i,!1),!0):(this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,e),!1)}_turnAroundPivot(e,t,r){let i=e.clone();return this.cameraHelper.handleMapControlsRollPitchBearingZoom(r,i),i.pitch>=90||!aT(i,t.point)?null:LG(i,t)&&BG(i,t)?i:null}applyUpdatedTransform(e){this._takeLandedElevation(e);let t=this._keepCameraAboveTerrain(e);if(!this.transformCameraUpdate){t!==this.transform&&this.transform.apply(t,!1);return}let r=t.clone(),{center:i,zoom:n,roll:a,pitch:o,bearing:s,elevation:l}=this.transformCameraUpdate(r);i&&r.setCenter(i),l!==void 0&&r.setElevation(l),n!==void 0&&r.setZoom(n),a!==void 0&&r.setRoll(a),o!==void 0&&r.setPitch(o),s!==void 0&&r.setBearing(s),this.transform.apply(l===void 0?r:this._raiseCameraByPitchAndZoom(r),!1)}applyTransformChange(e){let t=this._requestedCameraState!==void 0,r=this.getTransformForUpdate();e(r),this.applyUpdatedTransform(r),t||delete this._requestedCameraState}_fireMoveEvents(e){this.fire(new ne("move",e)),this._zooming&&this.fire(new ne("zoom",e)),this._rotating&&this.fire(new ne("rotate",e)),this._pitching&&this.fire(new ne("pitch",e)),this._rolling&&this.fire(new ne("roll",e))}_afterEase(e,t,r=!1){this._takeLandedElevation(this.transform);let i=this.releaseElevation();if(this.terrain&&r&&this.getCenterClampedToGround()&&this.putCenterBackOnTerrain(this.transform,this.terrain,i),this._easeId&&t&&this._easeId===t)return;delete this._easeId;let n=this._zooming,a=this._rotating,o=this._pitching,s=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,n&&this.fire(new ne("zoomend",e)),a&&this.fire(new ne("rotateend",e)),o&&this.fire(new ne("pitchend",e)),s&&this.fire(new ne("rollend",e)),this.fire(new ne("moveend",e))}flyTo(e,t){if(!e.essential&&Nr.prefersReducedMotion)return this.easeTo(e,t);this.stop(),e=J({offset:[0,0],speed:1.2,curve:1.42,easing:Q1},e),e.zoom!==void 0&&this._zoomSnap&&(e.zoom=Jr(e.zoom,this._zoomSnap));let r=this.getTransformForUpdate(),i=r.bearing,n=r.pitch,a=r.roll,o=r.padding,s=e.bearing===void 0?i:this._normalizeBearing(e.bearing,i),l=e.pitch===void 0?n:+e.pitch,u=e.roll===void 0?a:this._normalizeBearing(e.roll,a),c=e.padding===void 0?r.padding:e.padding,h=k.convert(e.offset),p=r.centerPoint.add(h),d=r.screenPointToLocation(p),f=this.cameraHelper.handleFlyTo(r,{bearing:s,pitch:l,roll:u,padding:c,locationAtOffset:d,offsetAsPoint:h,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),m=e.curve,_=Math.max(r.width,r.height),g=_/f.scaleOfZoom,y=f.pixelPathLength,v=_/f.scaleOfMinZoom;m=Math.min(m,Math.sqrt(v/y*2));let x=m*m;function b(I){let C=(g*g-_*_+(I?-1:1)*x*x*y*y)/(2*(I?g:_)*x*y);return Math.log(Math.sqrt(C*C+1)-C)}function w(I){return(Math.exp(I)-Math.exp(-I))/2}function T(I){return(Math.exp(I)+Math.exp(-I))/2}function S(I){return w(I)/T(I)}let E=b(!1),P=function(I){return T(E)/T(E+m*I)},D=function(I){return _*((T(E)*S(E+m*I)-w(E))/x)/y},F=(b(!0)-E)/m;if(Math.abs(y)<2e-6||!isFinite(F)){if(Math.abs(_-g)<1e-6)return this.easeTo(e,t);let I=g<_?-1:1;F=Math.abs(Math.log(g/_))/m,D=()=>0,P=C=>Math.exp(I*m*C)}if(e.duration!==void 0)e.duration=+e.duration;else{let I=e.screenSpeed===void 0?+e.speed:+e.screenSpeed/m;e.duration=1e3*F/I}return e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=i!==s,this._pitching=l!==n,this._rolling=u!==a,this._padding=!r.isPaddingEqual(c),this._prepareEase(t,!1,{},{tr:r,center:f.targetCenter,freeze:e.freezeElevation}),this._ease(I=>{let C=I*F,A=1/P(C),M=D(C);this._rotating&&r.setBearing(ot.number(i,s,I)),this._pitching&&r.setPitch(ot.number(n,l,I)),this._rolling&&r.setRoll(ot.number(a,u,I)),this._padding&&(r.interpolatePadding(o,c,I),p=r.centerPoint.add(h)),f.easeFunc(I,A,M,p),this.terrain&&!e.freezeElevation&&this._updateElevation(I,r),this.applyUpdatedTransform(r),this._fireMoveEvents(t)},()=>{this._afterEase(t,void 0,e.freezeElevation)},e),this}isEasing(){return!!this._easeFrameId}stop(e){return this._stop(e)}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let r=this._onEaseEnd;delete this._onEaseEnd,r.call(this,t)}return e||this._stopHandlers(),this}_ease(e,t,r){r.animate===!1||r.duration===0?(e(1),t()):(this._easeStart=Be(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,t){e=xi(e,-180,180);let r=Math.abs(e-t);return Math.abs(e-360-t)<r&&(e-=360),Math.abs(e+360-t)<r&&(e+=360),e}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};function LG(e,t){let r=1,i=iT(e,t),n=t.distance/i;for(let a=0;a<5&&!nT(i,t);a++){if(!Number.isFinite(n)||n<=0)return!1;let o=e.zoom;e.setZoom(o+Ut(r/n));let s=r*Bt(o-e.zoom);if(s===r)return!0;let l=iT(e,t);n=s+(t.distance-l)*(s-r)/(l-i),r=s,i=l}return nT(i,t)}function iT(e,t){return e.setLocationAtPoint(t.location,t.point,t.elevation),yd(e,t.location,t.elevation)}function nT(e,t){return Math.abs(e/t.distance-1)<1e-7}function BG(e,t){return t.elevation!==void 0||k_(Kd(e.screenPointToLocation(t.point),0),Kd(t.location,0))<t.distance*1e-4}function aT(e,t){return e.isPointOnMapSurface(new k(t.x,t.y-16))}function yd(e,t,r=e.elevation){return k_(Kd(e.getCameraLngLat(),e.getCameraAltitude()),Kd(t,r))}function Kd(e,t){let r=Ft(e);return Xe(r,r,Er+t)}var aD={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'},OG=class{constructor(e=aD){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=t=>{t&&(t.type==="terrain"||t.dataType==="style"||t.dataType==="source"&&(t.sourceDataType==="metadata"||t.sourceDataType==="visibility"))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?this._container.setAttribute("open",""):!this._container.classList.contains("maplibregl-compact")&&!this._container.classList.contains("maplibregl-attrib-empty")&&(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=ht.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=ht.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=ht.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(){this._container.remove(),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(i=>typeof i=="string"?i:"")):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let i=this._map.style.stylesheet;this.styleOwner=i.owner,this.styleId=i.id}let t=this._map.style.tileManagers;for(let i in t){let n=t[i];if(n.used||n.usedForTerrain){let a=n.getSource();a.attribution&&!e.includes(a.attribution)&&e.push(a.attribution)}}e=e.filter(i=>String(i).trim()),e.sort((i,n)=>i.length-n.length),e=e.filter((i,n)=>{for(let a=n+1;a<e.length;a++)if(e[a].includes(i))return!1;return!0});let r=e.join(" | ");if(r!==this._attribHTML){if(this._attribHTML=r,e.length){let i=document.createDocumentFragment(),n=!0;for(let a of e){let o=ht.sanitize(a);o.hasChildNodes()&&(n||i.append(" | "),i.append(o),n=!1)}this._innerContainer.replaceChildren(i),this._container.classList.remove("maplibregl-attrib-empty")}else this._container.classList.add("maplibregl-attrib-empty");this._updateCompact(),this._editLink=null}}},jG=class{constructor(e={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let r=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&r.classList.add("maplibregl-compact"):r.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options?.compact,this._container=ht.create("div","maplibregl-ctrl");let t=ht.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){this._container.remove(),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}},NG=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(let i of r)if(i.id===e){i.cancelled=!0;return}}run(e=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];let r=!1,i;for(let n of t)if(!n.cancelled){try{n.callback(e)}catch(a){r||(r=!0,i=a)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,r)throw i}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},VG=dt([{name:"a_pos3d",type:"Int16",components:3}]),UG=class extends lr{constructor(e){super(),this._lastTilesetChange=Be(),this.tileManager=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.tileManager.usedForTerrain=!1,this.tileManager.tileSize=null,this.releaseAllRTT()}getSource(){return this.tileManager._source}update(e,t){this.tileManager.update(e,t),this._renderableTilesKeys=[];let r={},i=!1;for(let n of Cc(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:t}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.terrainRttPosMatrix32f=new Float32Array(16),Ln(n.terrainRttPosMatrix32f,0,R,R,0,0,1),this._tiles[n.key]=new dP(n,this.tileSize),this._lastTilesetChange=Be(),i=!0);for(let n in this._tiles)r[n]||(this._tiles[n].releaseRTT(this.tileManager.map.painter),delete this._tiles[n],i=!0);return i}releaseRTT(e){for(let t in this._tiles){let r=this._tiles[t];(r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&r.releaseRTT(this.tileManager.map.painter)}}releaseAllRTT(){for(let e in this._tiles)this._tiles[e].releaseRTT(this.tileManager.map.painter)}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let t={};for(let r of this._renderableTilesKeys){let i=this._tiles[r].tileID,n=e.clone(),a=uo();if(i.canonical.equals(e.canonical))Ln(a,0,R,R,0,0,1);else if(i.canonical.isChildOf(e.canonical)){let o=i.canonical.z-e.canonical.z,s=i.canonical.x-(i.canonical.x>>o<<o),l=i.canonical.y-(i.canonical.y>>o<<o),u=R>>o;Ln(a,0,u,u,0,0,1),At(a,a,[-s*u,-l*u,0])}else if(e.canonical.isChildOf(i.canonical)){let o=e.canonical.z-i.canonical.z,s=e.canonical.x-(e.canonical.x>>o<<o),l=e.canonical.y-(e.canonical.y>>o<<o),u=R>>o;Ln(a,0,R,R,0,0,1),At(a,a,[s*u,l*u,0]),gr(a,a,[1/2**o,1/2**o,0])}else continue;n.terrainRttPosMatrix32f=new Float32Array(a),t[r]=n}return t}_getTerrainCoordsForTileRanges(e,t){let r={};for(let i of this._renderableTilesKeys){let n=this._tiles[i].tileID;if(!this._isWithinTileRanges(n,t))continue;let a=e.clone(),o=uo();if(n.canonical.z===e.canonical.z){let s=e.canonical.x-n.canonical.x+e.wrap*(1<<e.canonical.z),l=e.canonical.y-n.canonical.y;Ln(o,0,R,R,0,0,1),At(o,o,[s*R,l*R,0])}else if(n.canonical.z>e.canonical.z){let s=n.canonical.z-e.canonical.z,l=n.canonical.x-(n.canonical.x>>s<<s)+e.wrap*(1<<n.canonical.z),u=n.canonical.y-(n.canonical.y>>s<<s),c=e.canonical.x-(n.canonical.x>>s),h=e.canonical.y-(n.canonical.y>>s),p=R>>s;Ln(o,0,p,p,0,0,1),At(o,o,[-l*p+c*R,-u*p+h*R,0])}else{let s=e.canonical.z-n.canonical.z,l=e.canonical.x-(e.canonical.x>>s<<s)+e.wrap*(1<<e.canonical.z),u=e.canonical.y-(e.canonical.y>>s<<s),c=(e.canonical.x>>s)-n.canonical.x,h=(e.canonical.y>>s)-n.canonical.y,p=R<<s;Ln(o,0,p,p,0,0,1),At(o,o,[l*R+c*p,u*R+h*p,0])}a.terrainRttPosMatrix32f=new Float32Array(o),r[i]=a}return r}getSourceTile(e,t){let r=this.tileManager._source,i=e.overscaledZ-this.deltaZoom;if(i>r.maxzoom&&(i=r.maxzoom),i<r.minzoom)return;this._sourceTileCache[e.key]?.zoom!==i&&(this._sourceTileCache[e.key]={zoom:i,key:e.scaledTo(i).key});let n=this.findTileInCaches(this._sourceTileCache[e.key].key);if(!n?.dem&&t)for(;i>=r.minzoom&&!n?.dem;)n=this.findTileInCaches(e.scaledTo(i--).key);return n}isStillWaitingForDEM(e){let t=this.tileManager._source,r=Math.min(e.overscaledZ-this.deltaZoom,t.maxzoom);if(r<t.minzoom)return!1;let i=e.scaledTo(r);return t.hasTile&&!t.hasTile(i)?!1:this.findTileInCaches(i.key)?.state!=="errored"}findTileInCaches(e){let t=this.tileManager.getTileByID(e);return t||(t=this.tileManager._outOfViewCache.getByKey(e),t)}anyTilesAfterTime(e=Be()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){let r=t[e.canonical.z];return!!r&&(e.wrap>r.minWrap||e.wrap<r.maxWrap||e.canonical.x>=r.minTileXWrapped&&e.canonical.x<=r.maxTileXWrapped&&e.canonical.y>=r.minTileY&&e.canonical.y<=r.maxTileY)}},$G=class{constructor(e,t,r,i="auto",n=()=>nl){this._meshCache={},this.painter=e,this._getWorldCoordinateHelper=n,this.tileManager=new UG(t),this.options=r,this.exaggeration=typeof r.exaggeration=="number"?r.exaggeration:1,this._terrainSkirtLength=i,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache=new Map,this.coverage=new IV(this.tileManager,this.exaggeration,()=>this._worldCoordinateHelper)}destroy(){this._fbo&&(this._fbo=(this._fbo.destroy(),null)),this._heightMapFbo&&(this._heightMapFbo=(this._heightMapFbo.destroy(),null)),this._fboDepthTexture&&(this._fboDepthTexture=(this._fboDepthTexture.destroy(),null)),this._emptyDemTexture&&(this._emptyDemTexture=(this._emptyDemTexture.destroy(),null)),this._emptyDepthTexture&&(this._emptyDepthTexture=(this._emptyDepthTexture.destroy(),null));for(let e in this._meshCache)this._meshCache[e].destroy();this._meshCache={},this.tileManager.destruct()}getDEMElevation(e,t,r,i=R){let n=e.normalizeCoordinates(t,r,i);if(!n)return 0;let a=this.coverage.getSampler(n.tileID);return a?a(n.x,n.y,i):0}getElevationForLngLatZoom(e,t){let r=this._worldCoordinateHelper;if(!E1(t,r.wraps?e.wrap():e,r))return 0;let{tileID:i,worldX:n,worldY:a}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getElevation(i,n%R,a%R,R)}getElevationForLngLat(e,t){let r=this.getDrawnElevationForLngLat(e);return r===void 0?this.getElevationForLngLatZoom(e,this._getFallbackZoom(t)):r}getDrawnElevationForLngLat(e,t=!1){return this.coverage.sample(e,t)}getElevationAndDEMStateForLngLat(e,t){let r=this.getElevationForLngLat(e,t);if(r!==0||this.getDrawnElevationForLngLat(e)!==void 0)return{elevation:r,demState:"loaded"};let i=this._getFallbackZoom(t),n=this._worldCoordinateHelper;if(!E1(i,n.wraps?e.wrap():e,n))return{elevation:r,demState:"none"};let{tileID:a}=this._getOverscaledTileIDFromLngLatZoom(e,i);return this.tileManager.getSourceTile(a,!0)?.dem?{elevation:r,demState:"loaded"}:{elevation:r,demState:this.tileManager.isStillWaitingForDEM(a)?"loading":"none"}}_getFallbackZoom(e){return Math.min(e.tileZoom,this.tileManager.maxzoom)}getElevation(e,t,r,i=R){return this.getDEMElevation(e,t,r,i)*this.exaggeration}resetElevationCache(){this.coverage.reset()}getCoverageIndex(){return this.coverage.getIndex()}_getDEMTileMatrix(e,t){let r=`${t.tileID.key}/${e.key}`,i=this._demMatrixCache.get(r);if(i)return i;let n=e.canonical.z-t.tileID.canonical.z,a=e.canonical.x-(e.canonical.x>>n<<n),o=e.canonical.y-(e.canonical.y>>n<<n),s=XM(new Float64Array(16),[1/(R<<n),1/(R<<n),0]);return At(s,s,[a*R,o*R,0]),this._demMatrixCache.set(r,s),s}getTerrainData(e){if(!this._emptyDemTexture){let i=this.painter.context,n=new Ye({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ot(i,n,i.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ot(i,new Ye({width:1,height:1}),i.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=Gi([])}let t=this.tileManager.getSourceTile(e,!0);if(t?.dem&&(!t.demTexture||t.needsTerrainPrepare)){let i=this.painter.context;t.demTexture||(t.demTexture=this.painter.getTileTexture(t.dem.stride)),t.demTexture?t.demTexture.update(t.dem.getPixels(),{premultiply:!1}):t.demTexture=new Ot(i,t.dem.getPixels(),i.gl.RGBA,{premultiply:!1}),t.demTexture.bind(i.gl.NEAREST,i.gl.CLAMP_TO_EDGE),t.needsTerrainPrepare=!1}let r=t?this._getDEMTileMatrix(e,t):this._emptyDemMatrix;return{u_depth:2,u_terrain:3,u_terrain_dim:t?.dem?.dim||1,u_terrain_matrix:r,u_terrain_unpack:t?.dem?.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(t?.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:t}}getFramebuffer(){let e=this.painter,t=e.width/devicePixelRatio,r=e.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==t||this._fbo.height!==r)&&(this._fbo.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture),this._fboDepthTexture||(this._fboDepthTexture=new Ot(e.context,{width:t,height:r,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(t,r,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,t,r))),this._fbo.colorAttachment.set(this._fboDepthTexture.texture),this._fbo}getHeightMapFramebuffer(e){return this._heightMapFbo||(this._heightMapFbo=this.painter.context.createFramebuffer(1,1,!1,!1)),this._heightMapFbo.colorAttachment.set(e),this._heightMapFbo}getTerrainMesh(e,t){let r=t&&e.canonical.y===0,i=t&&e.canonical.y===(1<<e.canonical.z)-1,n=`m_${r?"n":""}_${i?"s":""}`;if(this._meshCache[n])return this._meshCache[n];let a=this.painter.context,o=new dz,s=new yn,l=this.meshSize,u=R/l,c=l*l;for(let p=0;p<=l;p++)for(let d=0;d<=l;d++)o.emplaceBack(d*u,p*u,0);for(let p=0;p<c;p+=l+1)for(let d=0;d<l;d++)s.emplaceBack(d+p,l+d+p+1,l+d+p+2),s.emplaceBack(d+p,l+d+p+2,d+p+1);this._terrainSkirtLength!=="none"&&this._buildSkirts(o,s,l,u,r,i);let h=new hc(a.createVertexBuffer(o,VG.members),a.createIndexBuffer(s),ct.simpleSegment(0,0,o.length,s.length));return this._meshCache[n]=h,h}getSkirtLength(e){return this._worldCoordinateHelper.metersPerWorldUnit(.5,.5)/2**Math.max(e,0)/5}getMinTileElevationForLngLatZoom(e,t){let r=this._worldCoordinateHelper;if(!E1(t,r.wraps?e.wrap():e,r))return 0;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return this.getMinMaxElevation(i).minElevation??0}getMinMaxElevation(e){let t=this.tileManager.getSourceTile(e,!0),r={minElevation:null,maxElevation:null};return t?.dem&&(r.minElevation=t.dem.min*this.exaggeration,r.maxElevation=t.dem.max*this.exaggeration),r}get _worldCoordinateHelper(){return this._getWorldCoordinateHelper()}_getOverscaledTileIDFromLngLatZoom(e,t){let r=this._worldCoordinateHelper,i=r.wraps?e.wrap():e,n=r.worldFromLngLat(i.lng,i.lat),a=(1<<t)*R,o=n.x*a,s=n.y*a;return{tileID:new ir(t,0,t,Math.floor(o/R),Math.floor(s/R)),worldX:o,worldY:s}}_buildSkirts(e,t,r,i,n,a){let o=e.length,s=o+(r+1),l=(r+1)*r,u=n?Nu:0,c=+!n,h=a?Vu:R,p=+!a;for(let m=0;m<=r;m++)e.emplaceBack(m*i,u,c);for(let m=0;m<=r;m++)e.emplaceBack(m*i,h,p);for(let m=0;m<r;m++)t.emplaceBack(l+m,s+m,s+m+1),t.emplaceBack(l+m,s+m+1,l+m+1),t.emplaceBack(0+m,o+m+1,o+m),t.emplaceBack(0+m,0+m+1,o+m+1);let d=e.length,f=d+(r+1)*2;for(let m of[0,1])for(let _=0;_<=r;_++)for(let g of[0,1])e.emplaceBack(m*R,_*i,g);for(let m=0;m<r*2;m+=2)t.emplaceBack(d+m,d+m+1,d+m+3),t.emplaceBack(d+m,d+m+3,d+m+2),t.emplaceBack(f+m,f+m+3,f+m+1),t.emplaceBack(f+m,f+m+2,f+m+3)}},oT=["none","zoom","sourceTiles","visibleLayers","revision"],sT=class{constructor(e,t,r,i){this._tileKeys=e.map(n=>n.key).sort().join(),this._revision=t,this._zoom=r,this._visibleLayerIds=i}difference(e){return this._revision===e?._revision?this._visibleLayerIds===e._visibleLayerIds?this._tileKeys===e._tileKeys?this._zoom===e._zoom?"none":"zoom":"sourceTiles":"visibleLayers":"revision"}},oD={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};function G1(e){return Ef(e)?`custom-layer:${e.id}`:e.source}function D_(e){return Ef(e)?e.implementation.renderToTerrainTile!==void 0:oD[e.type]===!0}function qG(e,t){let r=[],i=!1;for(let n of t){let a=D_(e._layers[n]);a&&!i&&r.push([]),a&&r[r.length-1].push(n),i=a}return r}var GG=class{constructor(e,t){this.needsFollowUpFrame=!1,this.painter=e,this.terrain=t,this.rttSize=t.tileManager.tileSize*t.qualityFactor}getTexture(e){return e.getRTT(this._stacks.length-1).texture}prepareForRender(e,t,r){let i=t!==this._lastPrepareZoom;this._lastPrepareZoom=t,this._stacks=[],this._prevRenderedToTexture=!1,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=e._order.filter(u=>!e._layers[u].isHidden(t));let n=qG(e,this._renderableLayerIds),a=this._renderableLayerIds.join(),o=new Set;for(let u of this._renderableLayerIds){let c=e._layers[u],h=c.source;h&&oD[c.type]&&o.add(h)}this._coordsAscending={},this._rttFingerprints={};for(let u of o){let c=e.tileManagers[u];if(!c)continue;this._coordsAscending[u]={};let h=this._coordsAscending[u],p=c.getSource(),d=p instanceof Tc?p.terrainTileRanges:null;for(let _ of c.getVisibleCoordinates()){let g=this.terrain.tileManager.getTerrainCoords(_,d);for(let y in g)h[y]||(h[y]=[]),h[y].push(g[y])}this._rttFingerprints[u]={};let f=this._rttFingerprints[u],m=c.getState().revision;for(let _ in h)f[_]=new sT(h[_],m,t,a)}for(let u of this._renderableLayerIds){let c=e._layers[u];if(!Ef(c)||!D_(c))continue;let h=c.implementation.terrainTileRevision??0,p={};for(let d of this._renderableTiles)p[d.tileID.key]=new sT([d.tileID],h,t,a);this._rttFingerprints[G1(c)]=p}this.needsFollowUpFrame=!1;let s=i||r,l=!1;for(let u of this._renderableTiles){let c=this._textureDifference(u);c!=="none"&&(c==="zoom"&&s||c==="visibleLayers"&&i?this.needsFollowUpFrame=!0:c==="zoom"||c==="sourceTiles"?(l?this.needsFollowUpFrame=!0:this._releaseChangedTextures(u,e,n),l=!0):this._releaseChangedTextures(u,e,n))}}_releaseChangedTextures(e,t,r){let i=r.map(n=>this._hasStackChanged(e,t,n));if(!i.includes(!1))e.releaseRTT(this.painter);else for(let[n,a]of i.entries())a&&e.releaseRTTStack(this.painter,n)}_hasStackChanged(e,t,r){let i=!1;for(let n of r){let a=G1(t._layers[n]),o=this._rttFingerprints[a]?.[e.tileID.key],s=e.rttFingerprint[a];if(o||s){if(o?.difference(s)!=="none")return!0;i=!0}}return!i}_textureDifference(e){let t="none";for(let r in this._rttFingerprints){let i=this._rttFingerprints[r][e.tileID.key];if(!i)continue;let n=i.difference(e.rttFingerprint[r]);oT.indexOf(n)>oT.indexOf(t)&&(t=n)}return t}renderLayer(e,t,r){if(e.isHidden(r.transform.zoom))return!1;let i=D_(e),n=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(i&&(this._prevRenderedToTexture||this._stacks.push([]),this._prevRenderedToTexture=!0,this._stacks[this._stacks.length-1].push(e.id),!a))return!0;if(this._prevRenderedToTexture||i&&a){this._prevRenderedToTexture=i;let o=this._stacks.length-1,s=this._stacks[o]||[];r.isRenderingToTexture=!0,N6(n.context.frameUniformBuffer,this.rttSize,this.rttSize);for(let l of this._renderableTiles){if(this._rttTiles.push(l),l.getRTT(o))continue;let u=l.acquireRTT(n,o,this.rttSize);n.bindRTT(u),n.context.clear({color:he.transparent,stencil:0}),r.invalidateTileClippingMasks();for(let c of s){let h=t._layers[c],p=h.source?this._coordsAscending[h.source][l.tileID.key]:[l.tileID];n.context.viewport.set([0,0,this.rttSize,this.rttSize]),r.renderTileClippingMasks(h,p),n.renderLayer(n,t.tileManagers[h.source],h,p,r);let d=G1(h);d&&(l.rttFingerprint[d]=this._rttFingerprints[d][l.tileID.key])}u.texture.generateMipmap()}return r.isRenderingToTexture=!1,N6(n.context.frameUniformBuffer,n.context.gl.drawingBufferWidth,n.context.gl.drawingBufferHeight),jq(this.painter,this.terrain,this._rttTiles,r),this._rttTiles=[],i}return!1}},ZG={"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":"Drag to rotate map, click to reset 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 \u2318 + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},HG=pT,lT={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:aD,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:bo.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,transformConstrain:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,rotateSpeed:.8,pitchSpeed:-.5,reduceMotion:void 0,validateStyle:!0,globalState:void 0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20},sD=class extends lr{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(e){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new NG,this._controls=[],this._mapId=vT(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=a=>{if(a.preventDefault(),this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)this.fire(new r1("webglcontextlost",{originalEvent:a}));else{for(let o of Object.values(this.style._layers))if(o.type==="custom"&&console.warn(`Custom layer with id '${o.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),o._listeners)for(let[s]of Object.entries(o._listeners))console.warn(`Custom layer with id '${o.id}' had event listeners for event '${s}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.off("error",this._onStyleError),this.style.destroy(),this.style=null,this.fire(new r1("webglcontextlost",{originalEvent:a}))}},this._contextRestored=a=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style){this.style.imageManager.images=this._lostContextStyle.images;for(let o in this._lostContextStyle.images){let s=this._lostContextStyle.images[o];s.isWebGLImage&&this.style.imageManager.updateImage(o,s,!1)}}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(o){this.fire(new ee(o));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new r1("webglcontextrestored",{originalEvent:a}))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onStyleError=a=>{a.tile&&this.triggerRepaint()},this._onWindowOnline=()=>{this._update()};let t={...lT,...e,canvasContextAttributes:{...lT.canvasContextAttributes,...e.canvasContextAttributes}};if(t.minZoom!=null&&t.maxZoom!=null&&t.minZoom>t.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(t.minPitch!=null&&t.maxPitch!=null&&t.minPitch>t.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(t.minPitch!=null&&t.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(t.maxPitch!=null&&t.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new RG({minZoom:t.minZoom,maxZoom:t.maxZoom,minPitch:t.minPitch,maxPitch:t.maxPitch,bearingSnap:t.bearingSnap,zoomSnap:t.zoomSnap,renderWorldCopies:t.renderWorldCopies,centerClampedToGround:t.centerClampedToGround,terrain:this.terrain,transformConstrain:t.transformConstrain,requestRenderFrame:a=>this._requestRenderFrame(a),cancelRenderFrame:a=>this._cancelRenderFrame(a),transformCameraUpdate:t.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._canvasContextAttributes={...t.canvasContextAttributes},this._trackResize=t.trackResize===!0,this._terrainSkirtLength=t.terrainSkirtLength,this._refreshExpiredTiles=t.refreshExpiredTiles===!0,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions===!0,this._collectResourceTiming=t.collectResourceTiming===!0,this._locale={...ZG,...t.locale},this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this._zoomLevelsToOverscale=t.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=t.cancelPendingTileRequestsWhileZooming===!0,this.setAnisotropicFilterPitch(t.anisotropicFilterPitch),t.reduceMotion!==void 0&&(Nr.prefersReducedMotion=t.reduceMotion),this._requestManager=new WI(t.transformRequest),this._container=this._resolveContainer(t.container),t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer();try{this._setupPainter()}catch(a){throw this._cleanupContainer(),a}this._imageQueueHandle=Vi.addThrottleControl(()=>this.isMoving()),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.markTerrainDepthDirty(),this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new zG(this,this._camera,t),typeof window<"u"&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let r=typeof t.hash=="string"&&t.hash||void 0;this._hash=t.hash?new Kq(r).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:t.center,elevation:t.elevation,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch,roll:t.roll}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,J({},t.fitBoundsOptions,{duration:0}))));let i=typeof t.style=="string"?void 0:t.style?.projection?.type,n=i!=="globe"&&!Pf(i);this.resize(null,n),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,this._initialGlobalState=t.globalState,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new OG(typeof t.attributionControl=="boolean"?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new jG,t.logoPosition),this.on("style.load",()=>{if(n||this._resizeTransform(),this._camera.transform.unmodified){let a=Qd(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(a)}}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(a.dataType==="style"?new ji("styledata",a):new et("sourcedata",a))}),this.on("dataloading",a=>{this.fire(a.dataType==="style"?new ji("styledataloading",a):new et("sourcedataloading",a))}),this.on("dataabort",a=>{this.fire(new et("sourcedataabort",a))})}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,t){if(t===void 0&&(t=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e?.onAdd)return this.fire(new ee(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let r=e.onAdd(this);this._controls.push(e);let i=this._controlPositions[t];return t.includes("bottom")?i.insertBefore(r,i.firstChild):i.appendChild(r),this}removeControl(e){if(!e?.onRemove)return this.fire(new ee(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let t=this._controls.indexOf(e);return t>-1&&this._controls.splice(t,1),e.onRemove(this),this}hasControl(e){return this._controls.includes(e)}coveringTiles(e){return Cc(this._camera.transform,e)}setTransformCameraUpdate(e){this._camera.transformCameraUpdate=e}getCenter(){return new H(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(e,t){return this._camera.setCenter(e,t),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(e,t){return this._camera.setCenterElevation(e,t),this}setCenterClampedToGround(e){this._camera.setCenterClampedToGround(e)}panBy(e,t,r){return this._camera.panBy(e,t,r),this}panTo(e,t,r){return this._camera.panTo(e,t,r),this}getZoom(){return this._camera.transform.zoom}setZoom(e,t){return this._camera.setZoom(e,t),this}zoomTo(e,t,r){return this._camera.zoomTo(e,t,r),this}zoomIn(e,t){return this._camera.zoomIn(e,t),this}zoomOut(e,t){return this._camera.zoomOut(e,t),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(e,t){return this._camera.setVerticalFieldOfView(e,t),this}getBearing(){return this._camera.transform.bearing}setBearing(e,t){return this._camera.setBearing(e,t),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(e){return this._camera.setZoomSnap(e),this}getPadding(){return this._camera.transform.padding}setPadding(e,t){return this._camera.setPadding(e,t),this}rotateTo(e,t,r){return this._camera.rotateTo(e,t,r),this}resetNorth(e,t){return this._camera.resetNorth(e,t),this}resetNorthPitch(e,t){return this._camera.resetNorthPitch(e,t),this}snapToNorth(e,t){return this._camera.snapToNorth(e,t),this}getPitch(){return this._camera.transform.pitch}setPitch(e,t){return this._camera.setPitch(e,t),this}getRoll(){return this._camera.transform.roll}setRoll(e,t){return this._camera.setRoll(e,t),this}cameraForBounds(e,t){return this._camera.cameraForBounds(e,t)}fitBounds(e,t,r){return this._camera.fitBounds(e,t,r),this}fitScreenCoordinates(e,t,r,i,n){return this._camera.fitScreenCoordinates(e,t,r,i,n),this}jumpTo(e,t){return this._camera.jumpTo(e,t),this}calculateAnchoredCameraOptions(e){return this._camera.calculateAnchoredCameraOptions(e)}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n)}easeTo(e,t){return this._camera.easeTo(e,t),this}flyTo(e,t){return this._camera.flyTo(e,t),this}stop(){return this._camera.stop(),this}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLat(H.convert(e),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(e,t,r,i){return i==null&&this.terrain&&(i=this.terrain.getElevationForLngLat(r,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(e,t,r,i??0)}resize(e,t=!0){if(this._lostContextStyle.style!==null)return this;this._resizeInternal(t);let r=!this._camera._moving;return r&&(this.stop(),this.fire(new ne("movestart",e)).fire(new ne("move",e))),this.fire(new Wt("resize",e)),r&&this.fire(new ne("moveend",e)),this}_resizeInternal(e=!0){let[t,r]=this._containerDimensions();if(this._clampedPixelRatio=this._getClampedPixelRatio(t,r),this._resizeCanvas(t,r,this._clampedPixelRatio),this.painter.resize(t,r,this._clampedPixelRatio),this.painter.overLimit()){let i=this.painter.context.gl;this._maxCanvasSize=[i.drawingBufferWidth,i.drawingBufferHeight],this._clampedPixelRatio=this._getClampedPixelRatio(t,r),this._resizeCanvas(t,r,this._clampedPixelRatio),this.painter.resize(t,r,this._clampedPixelRatio)}this.style?.resize(),this._resizeTransform(e)}_resizeTransform(e=!0){let[t,r]=this._containerDimensions();this._camera.transform.resize(t,r,e),this._camera._requestedCameraState?.resize(t,r,e)}_getClampedPixelRatio(e,t){let{0:r,1:i}=this._maxCanvasSize,n=this.getPixelRatio(),a=e*n,o=t*n,s=a>r?r/a:1,l=o>i?i/o:1,u=Math.min(s,l);return u<1&&we("The canvas is larger than maxCanvasSize and is rendered at a lower pixel ratio to fit. Increase maxCanvasSize, within MAX_TEXTURE_SIZE, to render at full resolution."),u*n}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(e){return this._camera.applyTransformChange(t=>t.setMaxBounds(Zn.convert(e))),this._update()}setMinZoom(e){if(e??(e=-2),e>=-2&&e<=this._camera.transform.maxZoom){let t=this._camera.transform.zoom;return this._camera.applyTransformChange(r=>r.setMinZoom(e)),this._update(),t!==this._camera.transform.zoom&&this.fire(new ne("zoomstart")).fire(new ne("zoom")).fire(new ne("zoomend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(e=!1){let t=this._camera.transform;return e?t.applyConstrain(t.center,t.minZoom).zoom:t.minZoom}setMaxZoom(e){if(e??(e=22),e>=this._camera.transform.minZoom){let t=this._camera.transform.zoom;return this._camera.applyTransformChange(r=>r.setMaxZoom(e)),this._update(),t!==this._camera.transform.zoom&&this.fire(new ne("zoomstart")).fire(new ne("zoom")).fire(new ne("zoomend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(e){if(e??(e=0),e<0)throw Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this._camera.transform.maxPitch){let t=this._camera.transform.pitch;return this._camera.applyTransformChange(r=>r.setMinPitch(e)),this._update(),t!==this._camera.transform.pitch&&this.fire(new ne("pitchstart")).fire(new ne("pitch")).fire(new ne("pitchend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(e){if(e??(e=60),e>180)throw Error("maxPitch must be less than or equal to 180");if(e>=this._camera.transform.minPitch){let t=this._camera.transform.pitch;return this._camera.applyTransformChange(r=>r.setMaxPitch(e)),this._update(),t!==this._camera.transform.pitch&&this.fire(new ne("pitchstart")).fire(new ne("pitch")).fire(new ne("pitchend")).fire(new ne("movestart")).fire(new ne("move")).fire(new ne("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(e){if(e??(e=20),e>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(e<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=e,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(e){return this._camera.applyTransformChange(t=>t.setRenderWorldCopies(e)),this._update()}setTransformConstrain(e){return this._camera.applyTransformChange(t=>t.setConstrainOverride(e)),this._update()}project(e){return this._camera.transform.locationToScreenPoint(H.convert(e),this.style&&this.terrain)}unproject(e){return this._camera.transform.screenPointToLocation(k.convert(e),this.terrain)}isMoving(){return this._camera.isMoving()||this._handlers?.isMoving()||!1}isZooming(){return this._camera.isZooming()||this._handlers?.isZooming()||!1}isRotating(){return this._camera.isRotating()||this._handlers?.isRotating()||!1}_createDelegates(e,t,r){if(e==="mouseenter"||e==="mouseover"){let i=!1;return{mousemove:n=>{let a=t.filter(s=>this.getLayer(s)),o=a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length?i||(i=!0,r.call(this,new ei(e,this,n.originalEvent,{features:o}))):i=!1},mouseout:()=>{i=!1}}}if(e==="mouseleave"||e==="mouseout"){let i=!1;return{mousemove:n=>{let a=t.filter(o=>this.getLayer(o));(a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a})).length?i=!0:i&&(i=!1,r.call(this,new ei(e,this,n.originalEvent)))},mouseout:n=>{i&&(i=!1,r.call(this,new ei(e,this,n.originalEvent)))}}}{let i=n=>{let a=t.filter(s=>this.getLayer(s)),o=a.length===0?[]:this.queryRenderedFeatures(n.point,{layers:a});o.length&&(n.features=o,r.call(this,n),delete n.features)};return{[e]:i}}}_addDelegatedListener(e,t){var r;this._delegatedListeners||(this._delegatedListeners={}),(r=this._delegatedListeners)[e]||(r[e]=[]),this._delegatedListeners[e].push(t);for(let i in t.delegates)this.on(i,t.delegates[i])}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners?.[e])return;let i=this._delegatedListeners[e];for(let n=0;n<i.length;n++){let a=i[n];if(a.listener===r&&a.layers.length===t.length&&a.layers.every(o=>t.includes(o))){for(let o in a.delegates)this.off(o,a.delegates[o]);i.splice(n,1);return}}}on(e,t,r){if(r===void 0)return super.on(e,t);let i=typeof t=="string"?[t]:t,n={layers:i,listener:r,delegates:this._createDelegates(e,i,r)};return this._addDelegatedListener(e,n),{unsubscribe:()=>{this._removeDelegatedListener(e,i,r)}}}once(e,t,r){if(r===void 0)return super.once(e,t);let i=typeof t=="string"?[t]:t,n={layers:i,listener:r,delegates:this._createDelegates(e,i,a=>{this._removeDelegatedListener(e,i,r),r.call(this,a)})};return this._addDelegatedListener(e,n),this}off(e,t,r){if(r===void 0)return super.off(e,t);let i=typeof t=="string"?[t]:t;return this._removeDelegatedListener(e,i,r),this}queryRenderedFeatures(e,t){if(!this.style)return[];let r,i=e instanceof k||Array.isArray(e),n=i?e:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(t||(t=(i?{}:e)||{}),n instanceof k||typeof n[0]=="number")r=[k.convert(n)];else{let a=k.convert(n[0]),o=k.convert(n[1]);r=[a,new k(o.x,a.y),o,new k(a.x,o.y),a]}return this.style.queryRenderedFeatures(r,t,this._camera.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,t){return t=J({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle,globalState:this._initialGlobalState},t),this._styleUrl=typeof e=="string"?e:null,t.diff!==!1&&t.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,t),this):(this._localIdeographFontFamily=t.localIdeographFontFamily,this._updateStyle(e,t))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(t==null)throw Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,t.transformStyle&&this.style&&!this.style._loaded){this.style.once("style.load",()=>this._updateStyle(e,t));return}let r=this.style&&t.transformStyle?this.style.serialize():void 0;if(this.style&&(this.style.off("error",this._onStyleError),this.style.setEventedParent(null),this.style._remove(!e)),e)this.style=new B6(this,t||{});else return this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this.style?.projection?.destroy(),delete this.style,this;return this.style.setEventedParent(this,{style:this.style}),this.style.on("error",this._onStyleError),typeof e=="string"?this.style.loadURL(e,t,r):this.style.loadJSON(e,t,r),this}_lazyInitEmptyStyle(){this.style||(this.style=new B6(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.on("error",this._onStyleError),this.style.loadEmpty())}async _diffStyle(e,t){if(this._diffStyleRequest?.abort(),typeof e=="string"){let r=e;this._diffStyleRequest=new AbortController;let i=this._diffStyleRequest;try{let n=await this._requestManager.transformRequest(r,"Style");if(i.signal.aborted){this._diffStyleRequest=null;return}let a=await ef(n,i);this._diffStyleRequest=null,this._updateDiff(a.data,t)}catch(n){this._diffStyleRequest=null,Ra(n)||this.fire(new ee(Xt(n)))}}else typeof e=="object"&&(this._diffStyleRequest=null,this._updateDiff(e,t))}_updateDiff(e,t){try{this.style.setState(e,t)&&this._update(!0)}catch(r){we(`Unable to perform style diff: ${Xt(r).message}. Rebuilding the style from scratch.`),this._updateStyle(e,t)}}getStyle(){if(this.style)return this.style.serialize()}getStyleUrl(){return this._styleUrl}_getStyleAndImages(){return this.style?{style:this.style.serialize(),images:this.style.imageManager.cloneImages()}:{style:null,images:{}}}isStyleLoaded(){if(!this.style)we("There is no style added to the map.");else return this.style.loaded()}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let t=this.style?.tileManagers[e];if(t===void 0)this.fire(new ee(Error(`There is no tile manager with ID '${e}'`)));else return t.loaded()}setTerrain(e,t={}){if(this.style._checkLoaded(),e&&vc(this,Br.terrain,{value:e},t))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),!e)this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this.painter.destroyRTTResources(),this._camera.setTerrain(null);else{let r=this.style.tileManagers[e.source];if(!r)throw Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);this.terrain===null&&r.reload();for(let i in this.style._layers){let n=this.style._layers[i];n.type==="hillshade"&&n.source===e.source&&we("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),n.type==="color-relief"&&n.source===e.source&&we("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&&this.terrain.destroy(),this.terrain=new $G(this.painter,r,e,this._terrainSkirtLength,()=>this._camera.transform.worldCoordinateHelper),this.painter.renderToTexture=new GG(this.painter,this.terrain),this._camera.setTerrain(this.terrain),this._terrainDataCallback=i=>this._handleTerrainDataEvent(i,e.source),this.style.on("data",this._terrainDataCallback)}return this.style.triggerSymbolPlacement(),this.fire(new XI({terrain:e})),this}_handleTerrainDataEvent(e,t){if(e.dataType==="style"){this.terrain.tileManager.releaseAllRTT();return}let r=e.sourceId===t;r&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),r&&e.tile&&(this.painter.markTerrainDepthDirty(),this._camera.applyTerrainChange()),e.tile&&(e.source?.type==="image"?this.terrain.tileManager.releaseAllRTT():this.terrain.tileManager.releaseRTT(e.tile.tileID))}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){let e=this.style?.tileManagers;for(let t of Object.values(e))if(!t.areTilesLoaded())return!1;return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style?.getSource(e)}setSourceTileLodParams(e,t,r){if(r){let i=this.getSource(r);if(!i)throw Error(`There is no source with ID "${r}", cannot set LOD parameters`);i.calculateTileZoom=x_(Math.max(1,e),Math.max(1,t))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=x_(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,t){let r=this.style.tileManagers[e];if(!r)throw Error(`There is no tile manager with ID "${e}", cannot refresh tile`);t===void 0?r.reload(!0):r.refreshTiles(t.map(i=>new Cf(i.z,i.x,i.y)))}addImage(e,t,r={}){this._lazyInitEmptyStyle();let i=this._createStyleImage(t,r);return i&&(this.style.addImage(e,i),i.userImage?.onAdd&&i.userImage.onAdd(this,e)),this}setMissingStyleImageResolver(e){return this._missingStyleImageResolver=e,this.style?.setMissingImageResolver(e),this}_createStyleImage(e,t={}){let{pixelRatio:r=1,sdf:i=!1,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l}=t;if(e instanceof HTMLImageElement||fo(e)){let{width:u,height:c,data:h}=Nr.getImageData(e);return{data:new Ye({width:u,height:c},h),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0}}if(e.width===void 0||e.height===void 0)return this.fire(new ee(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`"))),null;{let{width:u,height:c,data:h}=e,p=e,d=Vd(p.data);return{data:d?new Ye({width:u,height:c}):new Ye({width:u,height:c},new Uint8Array(h)),pixelRatio:r,stretchX:n,stretchY:a,content:o,textFitWidth:s,textFitHeight:l,sdf:i,version:0,isWebGLImage:d,userImage:p}}}updateImage(e,t){let r=this.style.getImage(e);if(!r)return this.fire(new ee(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:i,height:n,data:a}=t instanceof HTMLImageElement||fo(t)?Nr.getImageData(t):t;if(i===void 0||n===void 0)return this.fire(new ee(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(i!==r.data.width||n!==r.data.height)return this.fire(new ee(Error("The width and height of the updated image must be that same as the previous version of the image")));if(r.isWebGLImage=Vd(a),r.isWebGLImage)r.userImage=t;else{let o=!(t instanceof HTMLImageElement||fo(t));r.data.replace(a,o)}return this.style.updateImage(e,r),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new ee(Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}async loadImage(e){let t=await Vi.getImage(await this._requestManager.transformRequest(e,"Image"),new AbortController);if(!t.data)throw Error(`Could not load image ${e}: the response is empty`);return t}listImages(){return this.style?.listImages()??[]}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style?.getLayer(e)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){return this.style?.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,i={}){return this.style?.setPaintProperty(e,t,r,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,i={}){return this.style.setLayoutProperty(e,t,r,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(e){return this._lazyInitEmptyStyle(),this.style.setFontFaces(e),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(e,t,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,i=>{i||this._update(!0)}),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,r=>{r||this._update(!0)}),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=Math.floor(this._container.clientWidth)||400,t=Math.floor(this._container.clientHeight)||300),[e,t]}_shouldHandleInitialResize(){if(!this._container?.clientWidth||!this._container.clientHeight)return!1;let[e,t]=this._containerDimensions();return e!==this._camera.transform.width||t!==this._camera.transform.height}_setupResizeObserver(){let e=!1,t=Xv(i=>{this._trackResize&&!this._removed&&(this.resize(i),this.redraw())},50),r=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new r(i=>{!e&&(e=!0,!this._shouldHandleInitialResize())||t(i)}),this._resizeObserver.observe(this._container)}_resolveContainer(e){if(typeof e=="string"){let t=document.getElementById(e);if(!t)throw Error(`Container '${e}' not found.`);return t}if(e instanceof HTMLElement||e&&typeof e=="object"&&e.nodeType===1)return e;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let e=this._containerDimensions(),t=this._getClampedPixelRatio(e[0],e[1]),r=this._container;r.classList.add("maplibregl-map");let i=this._canvasContainer=ht.create("div","maplibregl-canvas-container",r);this._interactive&&i.classList.add("maplibregl-interactive"),this._canvas=ht.create("canvas","maplibregl-canvas",i),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"),this._resizeCanvas(e[0],e[1],t);let n=this._controlContainer=ht.create("div","maplibregl-control-container",r),a=this._controlPositions={};for(let o of["top-left","top-right","bottom-left","bottom-right"])a[o]=ht.create("div",`maplibregl-ctrl-${o} `,n);this._container.addEventListener("scroll",this._onMapScroll,!1)}_cleanupContainer(){this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),this._canvasContainer.remove(),this._controlContainer.remove(),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map")}_resizeCanvas(e,t,r){let i=Math.round(r*e),n=Math.round(r*t);this._canvas.width=i,this._canvas.height=n,this._canvas.style.width=`${i/r}px`,this._canvas.style.height=`${n/r}px`}_setupPainter(){let e={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},t=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{t=i},{once:!0});let r=this._canvas.getContext("webgl2",e);if(!r)throw new Xq(e,t);this.painter=new Yq(r)}migrateProjection(e,t){this._camera.migrateProjection(e,t),this.fire(new KI({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?._loaded&&(this._styleDirty||(this._styleDirty=e),this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){let t=this._idleTriggered?this._fadeDuration:0,r=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let i=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let l=this._camera.transform.zoom,u=Be();this.style.zoomHistory.update(l,u);let c=new Re(l,{now:u,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),h=c.crossFadingFactor();(h!==1||h!==this._crossFadingFactor)&&(i=!0,this._crossFadingFactor=h),this.style.update(c)}let n=this.style.projection?.transitionState>0!==r;if(this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||n)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain){if(this.terrain.tileManager.update(this._camera.transform,this.terrain)&&this.terrain.resetElevationCache(),this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),!this._camera.elevationFreeze&&this.getCenterClampedToGround()){let{elevation:l,demState:u}=this.terrain.getElevationAndDEMStateForLngLat(this._camera.transform.center,this._camera.transform);u!=="loading"&&this._camera.transform.setElevation(l)}}else this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,t,this._crossSourceCollisions,n);let a=this.style.projection,o=a?.transitionState??0;this.painter.render(this.style,this._camera.transform,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,symbolFadeChange:this.style.placement.symbolFadeChange(Be()),variableOffsets:this.style.placement.variableOffsets,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch(),projectionTransition:o,isRenderingGlobe:o>0,projectionShaderVariant:a?{name:a.shaderVariantName,define:a.shaderDefine,prelude:a.shaderPreludeCode}:void 0,useSubdivision:a?.useSubdivision??!1,pixelRatio:this._clampedPixelRatio,light:this.style.light?.getEvaluated(),sky:this.style.sky?.getEvaluated()}),this.fire(new Wt("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new Wt("load"))),this.style&&(this.style.hasTransitions()||i)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let s=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new Wt("idle")),this._loaded&&!this._fullyLoaded&&!s&&(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(let t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest=(this._frameRequest.abort(),null)),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),typeof window<"u"&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),Vi.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let e=this.painter.context.gl.getExtension("WEBGL_lose_context");e?.loseContext&&e.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new Wt("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,Nr.frame(this._frameRequest,e=>{this._frameRequest=null;try{this._render(e)}catch(t){if(!Ra(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return HG}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}};function WG(e,t,r,i=!1){if(i||!r.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let n=new H(e.lng,e.lat);if(e=new H(e.lng,e.lat),t){let a=new H(e.lng-360,e.lat),o=new H(e.lng+360,e.lat),s=r.locationToScreenPoint(e).distSqr(t);r.locationToScreenPoint(a).distSqr(t)<s?e=a:r.locationToScreenPoint(o).distSqr(t)<s&&(e=o)}for(;Math.abs(e.lng-r.center.lng)>180;){let a=r.locationToScreenPoint(e);if(a.x>=0&&a.y>=0&&a.x<=r.width&&a.y<=r.height)break;e.lng>r.center.lng?e.lng-=360:e.lng+=360}return e.lng!==n.lng&&r.isPointOnMapSurface(r.locationToScreenPoint(e))?e:n}var lD={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 YG(e,t,r){let i=e.classList;for(let n in lD)i.remove(`maplibregl-${r}-anchor-${n}`);i.add(`maplibregl-${r}-anchor-${t}`)}var uT={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},uD="#3FB1CE";function yi(e,t,r=[]){let i=ht.createNS("http://www.w3.org/2000/svg",e);for(let n in t)i.setAttributeNS(null,n,t[n]);for(let n of r)i.appendChild(n);return i}var Z1;function XG(){return Z1||(Z1=yi("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[yi("g",{"fill-rule":"nonzero"},[yi("g",{transform:"translate(3.0, 29.0)",fill:"#000000"},[["10.5","5.25002273"],["10.5","5.25002273"],["9.5","4.77275007"],["8.5","4.29549936"],["7.5","3.81822308"],["6.5","3.34094679"],["5.5","2.86367051"],["4.5","2.38636864"]].map(([e,t])=>yi("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:e,ry:t}))),yi("g",{fill:uD},[yi("path",{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"})]),yi("g",{opacity:"0.25",fill:"#000000"},[yi("path",{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"})]),yi("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),yi("g",{transform:"translate(8.0, 8.0)"},[yi("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),yi("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]),Z1)}function KG(e){return e.firstElementChild.children[1]}var Ss=class extends Ao{},QG=class extends Ao{},cD=class extends lr{constructor(e){if(super(),this._onClick=t=>{this.fire(new QG("click",{originalEvent:t}))},this._onKeyPress=t=>{(t.code==="Space"||t.code==="Enter")&&this.togglePopup()},this._onKeyDown=t=>{if(!this._defaultMarker||!this._draggable||!this._map||!this._lngLat||t.composedPath()[0]!==this._element||t.altKey||t.ctrlKey||t.metaKey)return;let r=uT[t.key];if(!r)return;t.preventDefault(),t.stopPropagation();let i=t.shiftKey?10:1,n=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new k(n.x+r[0]*i,n.y+r[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new Ss("dragstart"))),this.fire(new Ss("drag"))},this._onKeyUp=t=>{uT[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let r=t.originalEvent.target,i=this._element;this._popup&&(r===i||i.contains(r))&&this.togglePopup()},this._updateCoveredUnthrottled=()=>{let t=this._map?.terrain;if(!t||!this._isInViewport())return;let r=this._isCovered(t);r&&this._popup?.isOpen()&&this._popup.remove(),this._element.style.opacity=r?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",r)},this._updateCovered=Xv(this._updateCoveredUnthrottled,100),this._update=t=>{if(!this._map)return;this._lngLat=WG(this._lngLat,this._flatPos,this._map._camera.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map._camera.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?r=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?i="rotateX(0deg)":this._pitchAlignment==="map"&&(i=`rotateX(${this._map.getPitch()}deg)`),!this._subpixelPositioning&&t?.type!=="move"&&(this._pos=this._pos.round()),this._element.style.transform=`${lD[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${r}`,this._updateOpacity()},this._onMove=t=>{if(!this._isDragging){let r=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=r}this._isDragging&&(this._pos=t.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 Ss("dragstart"))),this.fire(new Ss("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 Ss("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e?.anchor||"center",this._color=e?.color||uD,this._scale=e?.scale||1,this._draggable=e?.draggable||!1,this._clickTolerance=e?.clickTolerance||0,this._subpixelPositioning=e?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=e?.rotation||0,this._rotationAlignment=e?.rotationAlignment||"auto",this._pitchAlignment=e?.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e?.element)this._element=e.element,this._offset=k.convert(e?.offset||[0,0]);else{this._defaultMarker=!0,this._element=ht.create("div");let t=XG().cloneNode(!0);t.setAttributeNS(null,"height",`${41*this._scale}px`),t.setAttributeNS(null,"width",`${27*this._scale}px`),KG(t).setAttributeNS(null,"fill",this._color),this._element.appendChild(t),this._offset=k.convert(e?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),YG(this._element,this._anchor,"marker"),e?.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),this._updateAccessibilityRole(),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),e.on("idle",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return 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("idle",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),this._element.removeEventListener("click",this._onClick),this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._element.removeEventListener("keypress",this._onKeyPress),this._keyboardDragActive=!1,this._element.remove(),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=H.convert(e),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),e){if(!("offset"in e.options)){let t=13.5/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,(24.6+t)*-1],"bottom-right":[-t,(24.6+t)*-1],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new Ss("dragend")))}getPopup(){return this._popup}togglePopup(){let e=this._popup;if(this._element.style.opacity===this._opacityWhenCovered)return this;if(e)e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map));else return this;return this}_updateOpacity(){if(!this._isInViewport())return;let e=this._map?.terrain,t=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!e||t){let r=t?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==r&&(this._element.style.opacity=r,this._element.classList.toggle("maplibregl-marker-covered",t))}else this._updateCovered()}_isInViewport(){let{width:e,height:t}=this._map._camera.transform;return!!this._pos&&this._pos.x>=0&&this._pos.y>=0&&this._pos.x<=e&&this._pos.y<=t}_isCovered(e){let t=this._map._camera.transform,r=e.getElevationForLngLat(this._lngLat,t),i=Math.max(0,-this._offset.y)/t.pixelsPerMeter,n=Math.sin(this._map.getPitch()*Math.PI/180)*i;return t.isLocationOccluded(this._lngLat,e,r+n)}getOffset(){return this._offset}setOffset(e){return this._offset=k.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this._defaultMarker&&(this._draggable?(this._element.addEventListener("keydown",this._onKeyDown),this._element.addEventListener("keyup",this._onKeyUp),this._element.addEventListener("blur",this._onBlur)):(this._element.removeEventListener("keydown",this._onKeyDown),this._element.removeEventListener("keyup",this._onKeyUp),this._element.removeEventListener("blur",this._onBlur),this._endKeyboardDrag())),this._updateTabIndex(),this._updateAccessibilityRole(),this}isDraggable(){return this._draggable}_updateTabIndex(){this._popup||this._defaultMarker&&this._draggable?this._element.hasAttribute("tabindex")||(this._element.setAttribute("tabindex","0"),this._tabIndexManaged=!0):this._tabIndexManaged&&(this._tabIndexManaged=(this._element.getAttribute("tabindex")==="0"&&this._element.removeAttribute("tabindex"),!1))}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let e=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",e),this._roleManaged=!0}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(this._opacity===void 0||e===void 0&&t===void 0)&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=String(e)),t!==void 0&&(this._opacityWhenCovered=String(t)),this._map&&this._updateOpacity(),this}};var hH=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Jv(e){bo.WORKER_URL=e}var pD=`.maplibregl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgb(0 0 0/0);-webkit-touch-callout:none}.maplibregl-canvas{position:absolute;left:0;top:0}.maplibregl-map:fullscreen{width:100%;height:100%}.maplibregl-ctrl-group button.maplibregl-ctrl-compass{touch-action:none}.maplibregl-canvas-container.maplibregl-interactive,.maplibregl-ctrl-group button.maplibregl-ctrl-compass{cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-canvas-container.maplibregl-interactive.maplibregl-track-pointer{cursor:pointer}.maplibregl-canvas-container.maplibregl-interactive:active,.maplibregl-ctrl-group button.maplibregl-ctrl-compass:active{cursor:grabbing}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-canvas-container.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:pinch-zoom}.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan,.maplibregl-canvas-container.maplibregl-touch-zoom-rotate.maplibregl-touch-drag-pan .maplibregl-canvas{touch-action:none}.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures,.maplibregl-canvas-container.maplibregl-touch-drag-pan.maplibregl-cooperative-gestures .maplibregl-canvas{touch-action:pan-x pan-y}.maplibregl-ctrl-bottom-left,.maplibregl-ctrl-bottom-right,.maplibregl-ctrl-top-left,.maplibregl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.maplibregl-ctrl-top-left{top:0;left:0}.maplibregl-ctrl-top-right{top:0;right:0}.maplibregl-ctrl-bottom-left{bottom:0;left:0}.maplibregl-ctrl-bottom-right{right:0;bottom:0}.maplibregl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.maplibregl-ctrl-top-left .maplibregl-ctrl{margin:10px 0 0 10px;float:left}.maplibregl-ctrl-top-right .maplibregl-ctrl{margin:10px 10px 0 0;float:right}.maplibregl-ctrl-bottom-left .maplibregl-ctrl{margin:0 0 10px 10px;float:left}.maplibregl-ctrl-bottom-right .maplibregl-ctrl{margin:0 10px 10px 0;float:right}.maplibregl-ctrl-group{border-radius:4px;background:#fff}.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px rgba(0,0,0,.1)}.maplibregl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.maplibregl-ctrl button{-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-ctrl-group button+button{border-top:1px solid #ddd}.maplibregl-ctrl button .maplibregl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media(forced-colors:active){.maplibregl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}.maplibregl-ctrl-icon{background-color:transparent}.maplibregl-ctrl-group button+button{border-top:1px solid buttontext}}.maplibregl-ctrl button::-moz-focus-inner{border:0;padding:0}.maplibregl-ctrl-attrib-button:focus,.maplibregl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl button:disabled{cursor:not-allowed}.maplibregl-ctrl button:disabled .maplibregl-ctrl-icon{opacity:.25}@media(hover:hover){.maplibregl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}}.maplibregl-ctrl button:not(:disabled):active{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.maplibregl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.maplibregl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.maplibregl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.maplibregl-ctrl-group button:focus:only-child{border-radius:inherit}.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-fullscreen .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-shrink .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23333'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23fff'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-compass .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 29 29' fill='%23000'%3E %3Cpath d='m10.5 14 4-8 4 8z'/%3E %3Cpath fill='%23ccc' d='m10.5 16 4 8 4-8z'/%3E %3C/svg%3E")}}.maplibregl-ctrl button.maplibregl-ctrl-globe .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%23333'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-globe-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' fill='none' viewBox='0 0 22 22' stroke='%2333b5e5'%3E %3Ccircle cx='11' cy='11' r='8.5'/%3E %3Cpath d='M17.5 11c0 4.819-3.02 8.5-6.5 8.5S4.5 15.819 4.5 11 7.52 2.5 11 2.5s6.5 3.681 6.5 8.5Z'/%3E %3Cpath d='M13.5 11c0 2.447-.331 4.64-.853 6.206-.262.785-.562 1.384-.872 1.777-.314.399-.58.517-.775.517-.195 0-.461-.118-.775-.517-.31-.393-.61-.992-.872-1.777C8.831 15.64 8.5 13.446 8.5 11c0-2.447.331-4.64.853-6.206.262-.785.562-1.384.872-1.777.314-.399.58-.517.775-.517.195 0 .461.118.775.517.31.393.61.992.872 1.777.522 1.565.853 3.76.853 6.206Z'/%3E %3Cpath d='M11 7.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.333 1.333 0 0 1-.224-.138c.047-.038.12-.085.224-.138.299-.151.763-.302 1.379-.434C7.378 5.666 9.091 5.5 11 5.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138-.047.038-.12.085-.224.138-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428ZM4.486 6.436ZM11 16.5c-1.909 0-3.622-.166-4.845-.428-.616-.132-1.08-.283-1.379-.434a1.33 1.33 0 0 1-.224-.138 1.33 1.33 0 0 1 .224-.138c.299-.151.763-.302 1.379-.434C7.378 14.666 9.091 14.5 11 14.5c1.909 0 3.622.166 4.845.428.616.132 1.08.283 1.379.434.105.053.177.1.224.138a1.33 1.33 0 0 1-.224.138c-.299.151-.763.302-1.379.434-1.223.262-2.936.428-4.845.428Zm-6.514-1.064ZM11 12.5c-2.46 0-4.672-.222-6.255-.574-.796-.177-1.406-.38-1.805-.59a1.465 1.465 0 0 1-.39-.272.293.293 0 0 1-.047-.064.293.293 0 0 1 .048-.064c.066-.073.189-.167.389-.272.399-.21 1.009-.413 1.805-.59C6.328 9.722 8.54 9.5 11 9.5s4.672.222 6.256.574c.795.177 1.405.38 1.804.59.2.105.323.2.39.272a.33.33 0 0 1 .047.064.293.293 0 0 1-.048.064 1.435 1.435 0 0 1-.389.272c-.399.21-1.009.413-1.804.59-1.584.352-3.796.574-6.256.574Zm-8.501-1.51v.002-.002Zm0 .018v.002-.002Zm17.002.002v-.002.002Zm0-.018v-.002.002Z'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%23333'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-terrain-enabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22' fill='%2333b5e5'%3E %3Cpath d='m1.754 13.406 4.453-4.851 3.09 3.09 3.281 3.277.969-.969-3.309-3.312 3.844-4.121 6.148 6.886h1.082v-.855l-7.207-8.07-4.84 5.187L6.169 6.57l-5.48 5.965v.871ZM.688 16.844h20.625v1.375H.688Zm0 0'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23333'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23aaa'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon{animation:maplibregl-spin 2s linear infinite}@media(forced-colors:active){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23999'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e58978'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%2333b5e5'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-background-error .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23e54e33'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2' display='none'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl button.maplibregl-ctrl-geolocate .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23000'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' display='none'/%3E %3C/svg%3E")}.maplibregl-ctrl button.maplibregl-ctrl-geolocate:disabled .maplibregl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='29' height='29' viewBox='0 0 20 20' fill='%23666'%3E %3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 0 0 5.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 0 0 9 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 0 0 3.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0 0 11 5.1V5s0-1-1-1m0 2.5a3.5 3.5 0 1 1 0 7 3.5 3.5 0 1 1 0-7'/%3E %3Ccircle id='dot' cx='10' cy='10' r='2'/%3E %3Cpath id='stroke' d='m14 5 1 1-9 9-1-1z' fill='%23f00'/%3E %3C/svg%3E")}}@keyframes maplibregl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.maplibregl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}a.maplibregl-ctrl-logo.maplibregl-compact{width:14px}@media(forced-colors:active){a.maplibregl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}@media(forced-colors:active) and (prefers-color-scheme:light){a.maplibregl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='88' height='23' fill='none'%3E %3Cpath fill='%23000' fill-opacity='.4' fill-rule='evenodd' d='M17.408 16.796h-1.827l2.501-12.095h.198l3.324 6.533.988 2.19.988-2.19 3.258-6.533h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.929 5.644h-.098l-2.914-5.644-.757-1.71-.345 1.71zm1.958-3.42-.726 3.663a1.255 1.255 0 0 1-1.232 1.011h-1.827a1.255 1.255 0 0 1-1.229-1.509l2.501-12.095a1.255 1.255 0 0 1 1.23-1.001h.197a1.25 1.25 0 0 1 1.12.685l3.19 6.273 3.125-6.263a1.25 1.25 0 0 1 1.123-.695h.181a1.255 1.255 0 0 1 1.227.991l1.443 6.71a5 5 0 0 1 .314-.787l.009-.016a4.6 4.6 0 0 1 1.777-1.887c.782-.46 1.668-.667 2.611-.667a4.6 4.6 0 0 1 1.7.32l.306.134c.21-.16.474-.256.759-.256h1.694a1.255 1.255 0 0 1 1.212.925 1.255 1.255 0 0 1 1.212-.925h1.711c.284 0 .545.094.755.252.613-.3 1.312-.45 2.075-.45 1.356 0 2.557.445 3.482 1.4q.47.48.763 1.064V4.701a1.255 1.255 0 0 1 1.255-1.255h1.86A1.255 1.255 0 0 1 54.44 4.7v9.194h2.217c.19 0 .37.043.532.118v-4.77c0-.356.147-.678.385-.906a2.42 2.42 0 0 1-.682-1.71c0-.665.267-1.253.735-1.7a2.45 2.45 0 0 1 1.722-.674 2.43 2.43 0 0 1 1.705.675q.318.302.504.683V4.7a1.255 1.255 0 0 1 1.255-1.255h1.744A1.255 1.255 0 0 1 65.812 4.7v3.335a4.8 4.8 0 0 1 1.526-.246c.938 0 1.817.214 2.59.69a4.47 4.47 0 0 1 1.67 1.743v-.98a1.255 1.255 0 0 1 1.256-1.256h1.777c.233 0 .451.064.639.174a3.4 3.4 0 0 1 1.567-.372c.346 0 .861.02 1.285.232a1.25 1.25 0 0 1 .689 1.004 4.7 4.7 0 0 1 .853-.588c.795-.44 1.675-.647 2.61-.647 1.385 0 2.65.39 3.525 1.396.836.938 1.168 2.173 1.168 3.528q-.001.515-.056 1.051a1.255 1.255 0 0 1-.947 1.09l.408.952a1.255 1.255 0 0 1-.477 1.552c-.418.268-.92.463-1.458.612-.613.171-1.304.244-2.049.244-1.06 0-2.043-.207-2.886-.698l-.015-.008c-.798-.48-1.419-1.135-1.818-1.963l-.004-.008a5.8 5.8 0 0 1-.548-2.512q0-.429.053-.843a1.3 1.3 0 0 1-.333-.086l-.166-.004c-.223 0-.426.062-.643.228-.03.024-.142.139-.142.59v3.883a1.255 1.255 0 0 1-1.256 1.256h-1.777a1.255 1.255 0 0 1-1.256-1.256V15.69l-.032.057a4.8 4.8 0 0 1-1.86 1.833 5.04 5.04 0 0 1-2.484.634 4.5 4.5 0 0 1-1.935-.424 1.25 1.25 0 0 1-.764.258h-1.71a1.255 1.255 0 0 1-1.256-1.255V7.687a2.4 2.4 0 0 1-.428.625c.253.23.412.561.412.93v7.553a1.255 1.255 0 0 1-1.256 1.255h-1.843a1.25 1.25 0 0 1-.894-.373c-.228.23-.544.373-.894.373H51.32a1.255 1.255 0 0 1-1.256-1.255v-1.251l-.061.117a4.7 4.7 0 0 1-1.782 1.884 4.77 4.77 0 0 1-2.485.67 5.6 5.6 0 0 1-1.485-.188l.009 2.764a1.255 1.255 0 0 1-1.255 1.259h-1.729a1.255 1.255 0 0 1-1.255-1.255v-3.537a1.255 1.255 0 0 1-1.167.793h-1.679a1.25 1.25 0 0 1-.77-.263 4.5 4.5 0 0 1-1.945.429c-.885 0-1.724-.21-2.495-.632l-.017-.01a5 5 0 0 1-1.081-.836 1.255 1.255 0 0 1-1.254 1.312h-1.81a1.255 1.255 0 0 1-1.228-.99l-.782-3.625-2.044 3.939a1.25 1.25 0 0 1-1.115.676h-.098a1.25 1.25 0 0 1-1.116-.68l-2.061-3.994zM35.92 16.63l.207-.114.223-.15q.493-.356.735-.785l.061-.118.033 1.332h1.678V9.242h-1.694l-.033 1.267q-.133-.329-.526-.658l-.032-.028a3.2 3.2 0 0 0-.668-.428l-.27-.12a3.3 3.3 0 0 0-1.235-.23q-1.136-.001-1.974.493a3.36 3.36 0 0 0-1.3 1.382q-.445.89-.444 2.074 0 1.2.51 2.107a3.8 3.8 0 0 0 1.382 1.381 3.9 3.9 0 0 0 1.893.477q.795 0 1.455-.33zm-2.789-5.38q-.576.675-.575 1.762 0 1.102.559 1.794.576.675 1.645.675a2.25 2.25 0 0 0 .934-.19 2.2 2.2 0 0 0 .468-.29l.178-.161a2.2 2.2 0 0 0 .397-.561q.244-.5.244-1.15v-.115q0-.708-.296-1.267l-.043-.077a2.2 2.2 0 0 0-.633-.709l-.13-.086-.047-.028a2.1 2.1 0 0 0-1.073-.285q-1.052 0-1.629.692zm2.316 2.706c.163-.17.28-.407.28-.83v-.114c0-.292-.06-.508-.15-.68a.96.96 0 0 0-.353-.389.85.85 0 0 0-.464-.127c-.4 0-.56.114-.664.239l-.01.012c-.148.174-.275.45-.275.945 0 .506.122.801.27.99.097.11.266.224.68.224.303 0 .504-.09.687-.269zm7.545 1.705a2.6 2.6 0 0 0 .331.423q.319.33.755.548l.173.074q.65.255 1.49.255 1.02 0 1.844-.493a3.45 3.45 0 0 0 1.316-1.4q.493-.904.493-2.089 0-1.909-.988-2.913-.988-1.02-2.584-1.02-.898 0-1.575.347a3 3 0 0 0-.415.262l-.199.166a3.4 3.4 0 0 0-.64.82V9.242h-1.712v11.553h1.729l-.017-5.134zm.53-1.138q.206.29.48.5l.155.11.053.034q.51.296 1.119.297 1.07 0 1.645-.675.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.435 0-.835.16a2 2 0 0 0-.284.136 2 2 0 0 0-.363.254 2.2 2.2 0 0 0-.46.569l-.082.162a2.6 2.6 0 0 0-.213 1.072v.115q0 .707.296 1.267l.135.211zm.964-.818a1.1 1.1 0 0 0 .367.385.94.94 0 0 0 .476.118c.423 0 .59-.117.687-.23.159-.194.28-.478.28-.95 0-.53-.133-.8-.266-.952l-.021-.025c-.078-.094-.231-.221-.68-.221a1 1 0 0 0-.503.135l-.012.007a.86.86 0 0 0-.335.343c-.073.133-.132.324-.132.614v.115a1.4 1.4 0 0 0 .14.66zm15.7-6.222q.347-.346.346-.856a1.05 1.05 0 0 0-.345-.79 1.18 1.18 0 0 0-.84-.329q-.51 0-.855.33a1.05 1.05 0 0 0-.346.79q0 .51.346.855.345.346.856.346.51 0 .839-.346zm4.337 9.314.033-1.332q.191.403.59.747l.098.081a4 4 0 0 0 .316.224l.223.122a3.2 3.2 0 0 0 1.44.322 3.8 3.8 0 0 0 1.875-.477 3.5 3.5 0 0 0 1.382-1.366q.527-.89.526-2.09 0-1.184-.444-2.073a3.24 3.24 0 0 0-1.283-1.399q-.823-.51-1.942-.51a3.5 3.5 0 0 0-1.527.344l-.086.043-.165.09a3 3 0 0 0-.33.214q-.432.315-.656.707a2 2 0 0 0-.099.198l.082-1.283V4.701h-1.744v12.095zm.473-2.509a2.5 2.5 0 0 0 .566.7q.117.098.245.18l.144.08a2.1 2.1 0 0 0 .975.232q1.07 0 1.645-.675.576-.69.576-1.778 0-1.102-.576-1.777-.56-.691-1.645-.692a2.2 2.2 0 0 0-1.015.235q-.22.113-.415.282l-.15.142a2.1 2.1 0 0 0-.42.594q-.223.479-.223 1.1v.115q0 .705.293 1.26zm2.616-.293c.157-.191.28-.479.28-.967 0-.51-.13-.79-.276-.961l-.021-.026c-.082-.1-.232-.225-.67-.225a.87.87 0 0 0-.681.279l-.012.011c-.154.155-.274.38-.274.807v.115c0 .285.057.499.144.669a1.1 1.1 0 0 0 .367.405c.137.082.28.123.455.123.423 0 .59-.118.686-.23zm8.266-3.013q.345-.13.724-.14l.069-.002q.493 0 .642.099l.247-1.794q-.196-.099-.717-.099a2.3 2.3 0 0 0-.545.063 2 2 0 0 0-.411.148 2.2 2.2 0 0 0-.4.249 2.5 2.5 0 0 0-.485.499 2.7 2.7 0 0 0-.32.581l-.05.137v-1.48h-1.778v7.553h1.777v-3.884q0-.546.159-.943a1.5 1.5 0 0 1 .466-.636 2.5 2.5 0 0 1 .399-.253 2 2 0 0 1 .224-.099zm9.784 2.656.05-.922q0-1.743-.856-2.698-.838-.97-2.584-.97-1.119-.001-2.007.493a3.46 3.46 0 0 0-1.4 1.382q-.493.906-.493 2.106 0 1.07.428 1.975.428.89 1.332 1.432.906.526 2.255.526.973 0 1.668-.185l.044-.012.135-.04q.613-.184.984-.421l-.542-1.267q-.3.162-.642.274l-.297.087q-.51.131-1.3.131-.954 0-1.497-.444a1.6 1.6 0 0 1-.192-.193q-.366-.44-.512-1.234l-.004-.021zm-5.427-1.256-.003.022h3.752v-.138q-.011-.727-.288-1.118a1 1 0 0 0-.156-.176q-.46-.428-1.316-.428-.986 0-1.494.604-.379.45-.494 1.234zm-27.053 2.77V4.7h-1.86v12.095h5.333V15.15zm7.103-5.908v7.553h-1.843V9.242h1.843z'/%3E %3Cpath fill='%23fff' d='m19.63 11.151-.757-1.71-.345 1.71-1.12 5.644h-1.827L18.083 4.7h.197l3.325 6.533.988 2.19.988-2.19L26.839 4.7h.181l2.6 12.095h-1.81l-1.218-5.644-.362-1.71-.658 1.71-2.93 5.644h-.098l-2.913-5.644zm14.836 5.81q-1.02 0-1.893-.478a3.8 3.8 0 0 1-1.381-1.382q-.51-.906-.51-2.106 0-1.185.444-2.074a3.36 3.36 0 0 1 1.3-1.382q.839-.494 1.974-.494a3.3 3.3 0 0 1 1.234.231 3.3 3.3 0 0 1 .97.575q.396.33.527.659l.033-1.267h1.694v7.553H37.18l-.033-1.332q-.279.593-1.02 1.053a3.17 3.17 0 0 1-1.662.444zm.296-1.482q.938 0 1.58-.642.642-.66.642-1.711v-.115q0-.708-.296-1.267a2.2 2.2 0 0 0-.807-.872 2.1 2.1 0 0 0-1.119-.313q-1.053 0-1.629.692-.575.675-.575 1.76 0 1.103.559 1.795.577.675 1.645.675zm6.521-6.237h1.711v1.4q.906-1.597 2.83-1.597 1.596 0 2.584 1.02.988 1.005.988 2.914 0 1.185-.493 2.09a3.46 3.46 0 0 1-1.316 1.399 3.5 3.5 0 0 1-1.844.493q-.954 0-1.662-.329a2.67 2.67 0 0 1-1.086-.97l.017 5.134h-1.728zm4.048 6.22q1.07 0 1.645-.674.577-.69.576-1.762 0-1.119-.576-1.777-.558-.675-1.645-.675-.592 0-1.12.296-.51.28-.822.823-.296.527-.296 1.234v.115q0 .708.296 1.267.313.543.823.855.51.296 1.119.297z'/%3E %3Cpath fill='%23e1e3e9' d='M51.325 4.7h1.86v10.45h3.473v1.646h-5.333zm7.12 4.542h1.843v7.553h-1.843zm.905-1.415a1.16 1.16 0 0 1-.856-.346 1.17 1.17 0 0 1-.346-.856 1.05 1.05 0 0 1 .346-.79q.346-.329.856-.329.494 0 .839.33a1.05 1.05 0 0 1 .345.79 1.16 1.16 0 0 1-.345.855q-.33.346-.84.346zm7.875 9.133a3.17 3.17 0 0 1-1.662-.444q-.723-.46-1.004-1.053l-.033 1.332h-1.71V4.701h1.743v4.657l-.082 1.283q.279-.658 1.086-1.119a3.5 3.5 0 0 1 1.778-.477q1.119 0 1.942.51a3.24 3.24 0 0 1 1.283 1.4q.445.888.444 2.072 0 1.201-.526 2.09a3.5 3.5 0 0 1-1.382 1.366 3.8 3.8 0 0 1-1.876.477zm-.296-1.481q1.069 0 1.645-.675.577-.69.577-1.778 0-1.102-.577-1.776-.56-.691-1.645-.692a2.12 2.12 0 0 0-1.58.659q-.642.641-.642 1.694v.115q0 .71.296 1.267a2.4 2.4 0 0 0 .807.872 2.1 2.1 0 0 0 1.119.313zm5.927-6.237h1.777v1.481q.263-.757.856-1.217a2.14 2.14 0 0 1 1.349-.46q.527 0 .724.098l-.247 1.794q-.149-.099-.642-.099-.774 0-1.416.494-.626.493-.626 1.58v3.883h-1.777V9.242zm9.534 7.718q-1.35 0-2.255-.526-.904-.543-1.332-1.432a4.6 4.6 0 0 1-.428-1.975q0-1.2.493-2.106a3.46 3.46 0 0 1 1.4-1.382q.889-.495 2.007-.494 1.744 0 2.584.97.855.956.856 2.7 0 .444-.05.92h-5.43q.18 1.005.708 1.45.542.443 1.497.443.79 0 1.3-.131a4 4 0 0 0 .938-.362l.542 1.267q-.411.263-1.119.46-.708.198-1.711.197zm1.596-4.558q.016-1.02-.444-1.432-.46-.428-1.316-.428-1.728 0-1.991 1.86z'/%3E %3Cpath d='M5.074 15.948a.484.657 0 0 0-.486.659v1.84a.484.657 0 0 0 .486.659h4.101a.484.657 0 0 0 .486-.659v-1.84a.484.657 0 0 0-.486-.659zm3.56 1.16H5.617v.838h3.017z' style='fill:%23fff;fill-rule:evenodd;stroke-width:1.03600001'/%3E %3Cg style='stroke-width:1.12603545'%3E %3Cpath d='M-9.408-1.416c-3.833-.025-7.056 2.912-7.08 6.615-.02 3.08 1.653 4.832 3.107 6.268.903.892 1.721 1.74 2.32 2.902l-.525-.004c-.543-.003-.992.304-1.24.639a1.87 1.87 0 0 0-.362 1.121l-.011 1.877c-.003.402.104.787.347 1.125.244.338.688.653 1.23.656l4.142.028c.542.003.99-.306 1.238-.641a1.87 1.87 0 0 0 .363-1.121l.012-1.875a1.87 1.87 0 0 0-.348-1.127c-.243-.338-.688-.653-1.23-.656l-.518-.004c.597-1.145 1.425-1.983 2.348-2.87 1.473-1.414 3.18-3.149 3.2-6.226-.016-3.59-2.923-6.684-6.993-6.707m-.006 1.1v.002c3.274.02 5.92 2.532 5.9 5.6-.017 2.706-1.39 4.026-2.863 5.44-1.034.994-2.118 2.033-2.814 3.633-.018.041-.052.055-.075.065q-.013.004-.02.01a.34.34 0 0 1-.226.084.34.34 0 0 1-.224-.086l-.092-.077c-.699-1.615-1.768-2.669-2.781-3.67-1.454-1.435-2.797-2.762-2.78-5.478.02-3.067 2.7-5.545 5.975-5.523m-.02 2.826c-1.62-.01-2.944 1.315-2.955 2.96-.01 1.646 1.295 2.988 2.916 2.999h.002c1.621.01 2.943-1.316 2.953-2.961.011-1.646-1.294-2.988-2.916-2.998m-.005 1.1c1.017.006 1.829.83 1.822 1.89s-.83 1.874-1.848 1.867c-1.018-.006-1.829-.83-1.822-1.89s.83-1.874 1.848-1.868m-2.155 11.857 4.14.025c.271.002.49.305.487.676l-.013 1.875c-.003.37-.224.67-.495.668l-4.14-.025c-.27-.002-.487-.306-.485-.676l.012-1.875c.003-.37.224-.67.494-.668' style='color:%23000;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:%23000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;clip-rule:evenodd;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:%23000;solid-opacity:1;vector-effect:none;fill:%23000;fill-opacity:.4;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-9.415-.316C-12.69-.338-15.37 2.14-15.39 5.207c-.017 2.716 1.326 4.041 2.78 5.477 1.013 1 2.081 2.055 2.78 3.67l.092.076a.34.34 0 0 0 .225.086.34.34 0 0 0 .227-.083l.019-.01c.022-.009.057-.024.074-.064.697-1.6 1.78-2.64 2.814-3.634 1.473-1.414 2.847-2.733 2.864-5.44.02-3.067-2.627-5.58-5.901-5.601m-.057 8.784c1.621.011 2.944-1.315 2.955-2.96.01-1.646-1.295-2.988-2.916-2.999-1.622-.01-2.945 1.315-2.955 2.96s1.295 2.989 2.916 3' style='clip-rule:evenodd;fill:%23e1e3e9;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3Cpath d='M-11.594 15.465c-.27-.002-.492.297-.494.668l-.012 1.876c-.003.371.214.673.485.675l4.14.027c.271.002.492-.298.495-.668l.012-1.877c.003-.37-.215-.672-.485-.674z' style='clip-rule:evenodd;fill:%23fff;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:2.47727823;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:.4' transform='translate(15.553 2.85)scale(.88807)'/%3E %3C/g%3E %3C/svg%3E")}}.maplibregl-ctrl.maplibregl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.maplibregl-ctrl-attrib.maplibregl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;color:#000;border-radius:12px;box-sizing:content-box}.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact-show,.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner{display:none}.maplibregl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;list-style:none}.maplibregl-ctrl-attrib summary.maplibregl-ctrl-attrib-button::-webkit-details-marker{display:none}.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-top-left .maplibregl-ctrl-attrib-button{left:0}.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button,.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-inner{display:block}.maplibregl-ctrl-attrib.maplibregl-compact-show .maplibregl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.maplibregl-ctrl-bottom-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;right:0}.maplibregl-ctrl-top-right>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;right:0}.maplibregl-ctrl-top-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{top:0;left:0}.maplibregl-ctrl-bottom-left>.maplibregl-ctrl-attrib.maplibregl-compact:after{bottom:0;left:0}}@media screen and (forced-colors:active){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20' fill='%23fff'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}@media screen and (forced-colors:active) and (prefers-color-scheme:light){.maplibregl-ctrl-attrib.maplibregl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill-rule='evenodd' viewBox='0 0 20 20'%3E %3Cpath d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0'/%3E %3C/svg%3E")}}.maplibregl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.maplibregl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.maplibregl-attrib-empty{display:none}.maplibregl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;white-space:nowrap;border-color:#333;border-style:none solid solid;border-width:medium 2px 2px;padding:0 5px;color:#333;box-sizing:border-box}.maplibregl-popup{position:absolute;top:0;left:0;display:flex;will-change:transform;pointer-events:none}.maplibregl-popup-anchor-top,.maplibregl-popup-anchor-top-left,.maplibregl-popup-anchor-top-right{flex-direction:column}.maplibregl-popup-anchor-bottom,.maplibregl-popup-anchor-bottom-left,.maplibregl-popup-anchor-bottom-right{flex-direction:column-reverse}.maplibregl-popup-anchor-left{flex-direction:row}.maplibregl-popup-anchor-right,[dir=rtl] .maplibregl-popup-anchor-left{flex-direction:row-reverse}.maplibregl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.maplibregl-popup-anchor-top .maplibregl-popup-tip{align-self:center;border-top:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{align-self:center;border-bottom:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.maplibregl-popup-anchor-left .maplibregl-popup-tip{align-self:center;border-left:none;border-right-color:#fff}.maplibregl-popup-anchor-right .maplibregl-popup-tip{align-self:center;border-right:none;border-left-color:#fff}[dir=rtl] .maplibregl-popup-anchor-right{flex-direction:row}[dir=rtl] .maplibregl-popup-anchor-top-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-top-right .maplibregl-popup-tip{align-self:flex-start}[dir=rtl] .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip{align-self:flex-end}[dir=rtl] .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip{align-self:flex-start}.maplibregl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.maplibregl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.maplibregl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:15px 10px;pointer-events:auto}.maplibregl-popup-anchor-top-left .maplibregl-popup-content{border-top-left-radius:0}.maplibregl-popup-anchor-top-right .maplibregl-popup-content{border-top-right-radius:0}.maplibregl-popup-anchor-bottom-left .maplibregl-popup-content{border-bottom-left-radius:0}.maplibregl-popup-anchor-bottom-right .maplibregl-popup-content{border-bottom-right-radius:0}.maplibregl-popup-track-pointer{display:none}.maplibregl-popup-track-pointer *{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.maplibregl-map:hover .maplibregl-popup-track-pointer{display:flex}.maplibregl-map:active .maplibregl-popup-track-pointer{display:none}.maplibregl-marker{position:absolute;top:0;left:0;will-change:transform;transition:opacity .2s}.maplibregl-marker-draggable{cursor:grab}.maplibregl-user-location-dot,.maplibregl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.maplibregl-user-location-dot:before{content:"";position:absolute;animation:maplibregl-user-location-dot-pulse 2s infinite}.maplibregl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@media(prefers-reduced-motion:reduce){.maplibregl-user-location-dot:before{animation:none}}@keyframes maplibregl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.maplibregl-user-location-dot-stale{background-color:#aaa}.maplibregl-user-location-dot-stale:after{display:none}.maplibregl-user-location-accuracy-circle{background-color:#1da1f233;width:1px;height:1px;border-radius:100%}.maplibregl-crosshair,.maplibregl-crosshair .maplibregl-interactive,.maplibregl-crosshair .maplibregl-interactive:active{cursor:crosshair}.maplibregl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}.maplibregl-cooperative-gesture-screen{background:rgba(0,0,0,.4);position:absolute;inset:0;display:flex;justify-content:center;align-items:center;color:#fff;padding:1rem;font-size:1.4em;line-height:1.2;opacity:0;pointer-events:none;transition:opacity 1s 1s;z-index:99999}.maplibregl-cooperative-gesture-screen.maplibregl-show{opacity:1;transition:opacity .05s}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:none}@media(hover:none),(pointer:coarse){.maplibregl-cooperative-gesture-screen .maplibregl-desktop-message{display:none}.maplibregl-cooperative-gesture-screen .maplibregl-mobile-message{display:block}}.maplibregl-pseudo-fullscreen{position:fixed!important;width:100%!important;height:100%!important;top:0!important;left:0!important;z-index:99999}`;var Rf="gramps-connect-story";var dD={},eZ=Object.freeze(Array.from({length:1},(e,t)=>t+1).filter(e=>e===1||dD[e]!==void 0)),Vr=class extends Error{constructor(t,r){super(r),this.name="StoryFormatError",this.code=t}};function Lf(e){if(typeof e!="string")return null;let t=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$/.exec(e);return t?{major:Number(t[1]),minor:Number(t[2])}:null}function e2(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new Vr("not-a-story","story.json is not a JSON object.");let t=e;if(t.format!==Rf)throw new Vr("not-a-story",`story.json's "format" is not "${Rf}".`);let r=Lf(t.version);if(!r||r.major<1)throw new Vr("bad-version",`story.json's "version" (${JSON.stringify(t.version)}) is not a valid MAJOR.MINOR version.`);if(r.major>1)throw new Vr("newer-version",`This story uses format version ${t.version}, which is newer than this viewer supports (up to 1.x). A newer viewer is needed to open it.`);for(let i=r.major;i<1;i++){let n=dD[i];if(!n)throw new Vr("bad-version",`No upgrade path from format version ${i}.x.`);t=n(t)}return t}var t2={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json",title:"Gramps Connect Story, format 1.0",description:"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).",type:"object",required:["format","version","title","slides","media"],properties:{$schema:{type:"string"},format:{const:"gramps-connect-story"},version:{description:"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.",type:"string",pattern:"^1\\.(0|[1-9][0-9]*)$"},title:{type:"string",pattern:"\\S"},language:{description:`BCP 47 language tag of the story's text, e.g. "en", "de-CH".`,type:"string",pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},created:{description:"When the file was written, as an RFC 3339 date-time.",type:"string",pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},generator:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},version:{type:"string"},url:{type:"string"}}},authors:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},url:{type:"string"}}}},license:{description:"License of the story's content (text and media), as an SPDX identifier or free text.",type:"string"},presentation:{type:"object",properties:{basemap:{enum:["standard","historical","auto","none"]}}},slides:{type:"array",minItems:1,items:{$ref:"#/$defs/slide"}},media:{description:"Every media file in the story, keyed by an id that slides and overlays refer to.",type:"object",propertyNames:{$ref:"#/$defs/id"},additionalProperties:{$ref:"#/$defs/mediaItem"}},extensions:{description:"Producer-specific data, keyed by namespace. Viewers ignore it.",type:"object",additionalProperties:{type:"object"}}},$defs:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},storyDate:{type:"object",required:["text"],properties:{text:{description:"The date as it should be shown, in the story's language.",type:"string",pattern:"\\S"},edtf:{description:"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).",type:"string",pattern:"\\S"},sortYear:{description:"Optional year (proleptic Gregorian) that places the slide on the timeline.",type:"integer"}}},slide:{type:"object",required:["id"],properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},text:{description:"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.",type:"string"},date:{$ref:"#/$defs/storyDate"},place:{$ref:"#/$defs/place"},media:{type:"array",items:{$ref:"#/$defs/slideMedia"}},people:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},role:{type:"string"}}}}}},slideMedia:{type:"object",required:["ref"],properties:{ref:{$ref:"#/$defs/id"},caption:{type:"string"},credit:{type:"string"}}},place:{type:"object",properties:{name:{type:"string"},lat:{type:"number",minimum:-90,maximum:90},lon:{type:"number",minimum:-180,maximum:180},geometry:{description:"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.",type:"object",required:["type"],properties:{type:{type:"string"}},additionalProperties:!0},overlays:{type:"array",items:{$ref:"#/$defs/overlay"}}},dependentRequired:{lat:["lon"],lon:["lat"]}},lonLat:{type:"array",prefixItems:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}],minItems:2,maxItems:2},overlay:{type:"object",required:["media","corners"],properties:{media:{$ref:"#/$defs/id"},corners:{description:"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.",type:"array",items:{$ref:"#/$defs/lonLat"},minItems:4,maxItems:4},opacity:{type:"number",minimum:0,maximum:1},order:{description:"Stacking order among a slide's overlays; lower is drawn first.",type:"integer"},date:{$ref:"#/$defs/storyDate"}}},mediaItem:{type:"object",required:["src","mime"],properties:{src:{description:'Path of the file inside the zip, relative to its root. No leading slash, no ".." segments.',type:"string",pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},mime:{type:"string",pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},width:{type:"integer",minimum:1},height:{type:"integer",minimum:1},alt:{type:"string"}}}}};var r2=Bf;var rZ={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://dsblank.github.io/gramps-connect-stories/spec/1.0/story.schema.json",title:"Gramps Connect Story, format 1.0",description:"The story.json at the root of a .story.zip. See spec/1.0/README.md for the rules this schema can't express (every ref resolves, every src exists in the zip, unknown fields are ignored).",type:"object",required:["format","version","title","slides","media"],properties:{$schema:{type:"string"},format:{const:"gramps-connect-story"},version:{description:"MAJOR.MINOR. This schema validates any 1.x file: newer minor versions only add optional fields.",type:"string",pattern:"^1\\.(0|[1-9][0-9]*)$"},title:{type:"string",pattern:"\\S"},language:{description:`BCP 47 language tag of the story's text, e.g. "en", "de-CH".`,type:"string",pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},created:{description:"When the file was written, as an RFC 3339 date-time.",type:"string",pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},generator:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},version:{type:"string"},url:{type:"string"}}},authors:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},url:{type:"string"}}}},license:{description:"License of the story's content (text and media), as an SPDX identifier or free text.",type:"string"},presentation:{type:"object",properties:{basemap:{enum:["standard","historical","auto","none"]}}},slides:{type:"array",minItems:1,items:{$ref:"#/$defs/slide"}},media:{description:"Every media file in the story, keyed by an id that slides and overlays refer to.",type:"object",propertyNames:{$ref:"#/$defs/id"},additionalProperties:{$ref:"#/$defs/mediaItem"}},extensions:{description:"Producer-specific data, keyed by namespace. Viewers ignore it.",type:"object",additionalProperties:{type:"object"}}},$defs:{id:{type:"string",pattern:"^[A-Za-z0-9_-]{1,64}$"},storyDate:{type:"object",required:["text"],properties:{text:{description:"The date as it should be shown, in the story's language.",type:"string",pattern:"\\S"},edtf:{description:"Optional machine-readable form, in Extended Date/Time Format (ISO 8601-2).",type:"string",pattern:"\\S"},sortYear:{description:"Optional year (proleptic Gregorian) that places the slide on the timeline.",type:"integer"}}},slide:{type:"object",required:["id"],properties:{id:{$ref:"#/$defs/id"},title:{type:"string"},text:{description:"Body text. Markup: **bold**, *italic*, line breaks. Nothing else is interpreted.",type:"string"},date:{$ref:"#/$defs/storyDate"},place:{$ref:"#/$defs/place"},media:{type:"array",items:{$ref:"#/$defs/slideMedia"}},people:{type:"array",items:{type:"object",required:["name"],properties:{name:{type:"string",pattern:"\\S"},role:{type:"string"}}}}}},slideMedia:{type:"object",required:["ref"],properties:{ref:{$ref:"#/$defs/id"},caption:{type:"string"},credit:{type:"string"}}},place:{type:"object",properties:{name:{type:"string"},lat:{type:"number",minimum:-90,maximum:90},lon:{type:"number",minimum:-180,maximum:180},geometry:{description:"Optional GeoJSON (RFC 7946) object drawn under the slide's pin: a FeatureCollection, Feature, or bare geometry.",type:"object",required:["type"],properties:{type:{type:"string"}},additionalProperties:!0},overlays:{type:"array",items:{$ref:"#/$defs/overlay"}}},dependentRequired:{lat:["lon"],lon:["lat"]}},lonLat:{type:"array",prefixItems:[{type:"number",minimum:-180,maximum:180},{type:"number",minimum:-90,maximum:90}],minItems:2,maxItems:2},overlay:{type:"object",required:["media","corners"],properties:{media:{$ref:"#/$defs/id"},corners:{description:"[lon, lat] of the image's top-left, top-right, bottom-right and bottom-left corners.",type:"array",items:{$ref:"#/$defs/lonLat"},minItems:4,maxItems:4},opacity:{type:"number",minimum:0,maximum:1},order:{description:"Stacking order among a slide's overlays; lower is drawn first.",type:"integer"},date:{$ref:"#/$defs/storyDate"}}},mediaItem:{type:"object",required:["src","mime"],properties:{src:{description:'Path of the file inside the zip, relative to its root. No leading slash, no ".." segments.',type:"string",pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},mime:{type:"string",pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},width:{type:"integer",minimum:1},height:{type:"integer",minimum:1},alt:{type:"string"}}}}};var iZ=new RegExp("^1\\.(0|[1-9][0-9]*)$","u"),Na=new RegExp("\\S","u"),nZ=new RegExp("^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$","u"),aZ=new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$","u"),Of=new RegExp("^[A-Za-z0-9_-]{1,64}$","u"),oZ=new RegExp("^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$","u"),sZ=new RegExp("^[a-z]+/[A-Za-z0-9.+-]+$","u");function sl(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=sl.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.media===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"media"},message:"must have required property 'media'"};o===null?o=[u]:o.push(u),s++}if(e.corners===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"corners"},message:"must have required property 'corners'"};o===null?o=[u]:o.push(u),s++}if(e.media!==void 0){let u=e.media;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/media",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/media",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.corners!==void 0){let u=e.corners;if(Array.isArray(u)){if(u.length>4){let h={instancePath:t+"/corners",schemaPath:"#/properties/corners/maxItems",keyword:"maxItems",params:{limit:4},message:"must NOT have more than 4 items"};o===null?o=[h]:o.push(h),s++}if(u.length<4){let h={instancePath:t+"/corners",schemaPath:"#/properties/corners/minItems",keyword:"minItems",params:{limit:4},message:"must NOT have fewer than 4 items"};o===null?o=[h]:o.push(h),s++}let c=u.length;for(let h=0;h<c;h++){let p=u[h];if(Array.isArray(p)){if(p.length>2){let f={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/maxItems",keyword:"maxItems",params:{limit:2},message:"must NOT have more than 2 items"};o===null?o=[f]:o.push(f),s++}if(p.length<2){let f={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/minItems",keyword:"minItems",params:{limit:2},message:"must NOT have fewer than 2 items"};o===null?o=[f]:o.push(f),s++}let d=p.length;if(d>0){let f=p[0];if(typeof f=="number"&&isFinite(f)){if(f>180||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/maximum",keyword:"maximum",params:{comparison:"<=",limit:180},message:"must be <= 180"};o===null?o=[m]:o.push(m),s++}if(f<-180||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/minimum",keyword:"minimum",params:{comparison:">=",limit:-180},message:"must be >= -180"};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/corners/"+h+"/0",schemaPath:"#/$defs/lonLat/prefixItems/0/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[m]:o.push(m),s++}}if(d>1){let f=p[1];if(typeof f=="number"&&isFinite(f)){if(f>90||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/maximum",keyword:"maximum",params:{comparison:"<=",limit:90},message:"must be <= 90"};o===null?o=[m]:o.push(m),s++}if(f<-90||isNaN(f)){let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/minimum",keyword:"minimum",params:{comparison:">=",limit:-90},message:"must be >= -90"};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/corners/"+h+"/1",schemaPath:"#/$defs/lonLat/prefixItems/1/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[m]:o.push(m),s++}}}else{let d={instancePath:t+"/corners/"+h,schemaPath:"#/$defs/lonLat/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[d]:o.push(d),s++}}}else{let c={instancePath:t+"/corners",schemaPath:"#/properties/corners/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.opacity!==void 0){let u=e.opacity;if(typeof u=="number"&&isFinite(u)){if(u>1||isNaN(u)){let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/maximum",keyword:"maximum",params:{comparison:"<=",limit:1},message:"must be <= 1"};o===null?o=[c]:o.push(c),s++}if(u<0||isNaN(u)){let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/minimum",keyword:"minimum",params:{comparison:">=",limit:0},message:"must be >= 0"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/opacity",schemaPath:"#/properties/opacity/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.order!==void 0){let u=e.order;if(!(typeof u=="number"&&!(u%1)&&!isNaN(u)&&isFinite(u))){let c={instancePath:t+"/order",schemaPath:"#/properties/order/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[c]:o.push(c),s++}}if(e.date!==void 0){let u=e.date;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.text===void 0){let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};o===null?o=[c]:o.push(c),s++}if(u.text!==void 0){let c=u.text;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.edtf!==void 0){let c=u.edtf;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.sortYear!==void 0){let c=u.sortYear;if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let h={instancePath:t+"/date/sortYear",schemaPath:"#/$defs/storyDate/properties/sortYear/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return sl.errors=o,s===0}sl.evaluated={props:{media:!0,corners:!0,opacity:!0,order:!0,date:!0},dynamicProps:!1,dynamicItems:!1};function ll(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=ll.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.name!==void 0&&typeof e.name!="string"){let u={instancePath:t+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.lat!==void 0){let u=e.lat;if(typeof u=="number"&&isFinite(u)){if(u>90||isNaN(u)){let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/maximum",keyword:"maximum",params:{comparison:"<=",limit:90},message:"must be <= 90"};o===null?o=[c]:o.push(c),s++}if(u<-90||isNaN(u)){let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/minimum",keyword:"minimum",params:{comparison:">=",limit:-90},message:"must be >= -90"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/lat",schemaPath:"#/properties/lat/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.lon!==void 0){let u=e.lon;if(typeof u=="number"&&isFinite(u)){if(u>180||isNaN(u)){let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/maximum",keyword:"maximum",params:{comparison:"<=",limit:180},message:"must be <= 180"};o===null?o=[c]:o.push(c),s++}if(u<-180||isNaN(u)){let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/minimum",keyword:"minimum",params:{comparison:">=",limit:-180},message:"must be >= -180"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/lon",schemaPath:"#/properties/lon/type",keyword:"type",params:{type:"number"},message:"must be number"};o===null?o=[c]:o.push(c),s++}}if(e.geometry!==void 0){let u=e.geometry;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.type===void 0){let c={instancePath:t+"/geometry",schemaPath:"#/properties/geometry/required",keyword:"required",params:{missingProperty:"type"},message:"must have required property 'type'"};o===null?o=[c]:o.push(c),s++}if(u.type!==void 0&&typeof u.type!="string"){let c={instancePath:t+"/geometry/type",schemaPath:"#/properties/geometry/properties/type/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/geometry",schemaPath:"#/properties/geometry/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}if(e.overlays!==void 0){let u=e.overlays;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++)sl(u[h],{instancePath:t+"/overlays/"+h,parentData:u,parentDataProperty:h,rootData:n,dynamicAnchors:a})||(o=o===null?sl.errors:o.concat(sl.errors),s=o.length)}else{let c={instancePath:t+"/overlays",schemaPath:"#/properties/overlays/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.lat!==void 0&&e.lon===void 0){let u={instancePath:t,schemaPath:"#/dependentRequired",keyword:"dependentRequired",params:{property:"lat",missingProperty:"lon",depsCount:1,deps:"lon"},message:"must have property lon when property lat is present"};o===null?o=[u]:o.push(u),s++}if(e.lon!==void 0&&e.lat===void 0){let u={instancePath:t,schemaPath:"#/dependentRequired",keyword:"dependentRequired",params:{property:"lon",missingProperty:"lat",depsCount:1,deps:"lat"},message:"must have property lat when property lon is present"};o===null?o=[u]:o.push(u),s++}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return ll.errors=o,s===0}ll.evaluated={props:{name:!0,lat:!0,lon:!0,geometry:!0,overlays:!0},dynamicProps:!1,dynamicItems:!1};function ul(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=ul.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.ref===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"ref"},message:"must have required property 'ref'"};o===null?o=[u]:o.push(u),s++}if(e.ref!==void 0){let u=e.ref;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/ref",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/ref",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.caption!==void 0&&typeof e.caption!="string"){let u={instancePath:t+"/caption",schemaPath:"#/properties/caption/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.credit!==void 0&&typeof e.credit!="string"){let u={instancePath:t+"/credit",schemaPath:"#/properties/credit/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return ul.errors=o,s===0}ul.evaluated={props:{ref:!0,caption:!0,credit:!0},dynamicProps:!1,dynamicItems:!1};function cl(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=cl.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.id===void 0){let u={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"id"},message:"must have required property 'id'"};o===null?o=[u]:o.push(u),s++}if(e.id!==void 0){let u=e.id;if(typeof u=="string"){if(!Of.test(u)){let c={instancePath:t+"/id",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"'};o===null?o=[c]:o.push(c),s++}}else{let c={instancePath:t+"/id",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}}if(e.title!==void 0&&typeof e.title!="string"){let u={instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.text!==void 0&&typeof e.text!="string"){let u={instancePath:t+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[u]:o.push(u),s++}if(e.date!==void 0){let u=e.date;if(u&&typeof u=="object"&&!Array.isArray(u)){if(u.text===void 0){let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/required",keyword:"required",params:{missingProperty:"text"},message:"must have required property 'text'"};o===null?o=[c]:o.push(c),s++}if(u.text!==void 0){let c=u.text;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/text",schemaPath:"#/$defs/storyDate/properties/text/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.edtf!==void 0){let c=u.edtf;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/date/edtf",schemaPath:"#/$defs/storyDate/properties/edtf/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(u.sortYear!==void 0){let c=u.sortYear;if(!(typeof c=="number"&&!(c%1)&&!isNaN(c)&&isFinite(c))){let h={instancePath:t+"/date/sortYear",schemaPath:"#/$defs/storyDate/properties/sortYear/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t+"/date",schemaPath:"#/$defs/storyDate/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}}if(e.place!==void 0&&(ll(e.place,{instancePath:t+"/place",parentData:e,parentDataProperty:"place",rootData:n,dynamicAnchors:a})||(o=o===null?ll.errors:o.concat(ll.errors),s=o.length)),e.media!==void 0){let u=e.media;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++)ul(u[h],{instancePath:t+"/media/"+h,parentData:u,parentDataProperty:h,rootData:n,dynamicAnchors:a})||(o=o===null?ul.errors:o.concat(ul.errors),s=o.length)}else{let c={instancePath:t+"/media",schemaPath:"#/properties/media/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}if(e.people!==void 0){let u=e.people;if(Array.isArray(u)){let c=u.length;for(let h=0;h<c;h++){let p=u[h];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.name===void 0){let d={instancePath:t+"/people/"+h,schemaPath:"#/properties/people/items/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[d]:o.push(d),s++}if(p.name!==void 0){let d=p.name;if(typeof d=="string"){if(!Na.test(d)){let f={instancePath:t+"/people/"+h+"/name",schemaPath:"#/properties/people/items/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/people/"+h+"/name",schemaPath:"#/properties/people/items/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.role!==void 0&&typeof p.role!="string"){let d={instancePath:t+"/people/"+h+"/role",schemaPath:"#/properties/people/items/properties/role/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/people/"+h,schemaPath:"#/properties/people/items/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}}else{let c={instancePath:t+"/people",schemaPath:"#/properties/people/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[c]:o.push(c),s++}}}else{let u={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[u]:o.push(u),s++}return cl.errors=o,s===0}cl.evaluated={props:{id:!0,title:!0,text:!0,date:!0,place:!0,media:!0,people:!0},dynamicProps:!1,dynamicItems:!1};function Bf(e,{instancePath:t="",parentData:r,parentDataProperty:i,rootData:n=e,dynamicAnchors:a={}}={}){let o=null,s=0,l=Bf.evaluated;if(l.dynamicProps&&(l.props=void 0),l.dynamicItems&&(l.items=void 0),e&&typeof e=="object"&&!Array.isArray(e)){if(e.format===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"format"},message:"must have required property 'format'"};o===null?o=[c]:o.push(c),s++}if(e.version===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"version"},message:"must have required property 'version'"};o===null?o=[c]:o.push(c),s++}if(e.title===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"title"},message:"must have required property 'title'"};o===null?o=[c]:o.push(c),s++}if(e.slides===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"slides"},message:"must have required property 'slides'"};o===null?o=[c]:o.push(c),s++}if(e.media===void 0){let c={instancePath:t,schemaPath:"#/required",keyword:"required",params:{missingProperty:"media"},message:"must have required property 'media'"};o===null?o=[c]:o.push(c),s++}if(e.$schema!==void 0&&typeof e.$schema!="string"){let c={instancePath:t+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}if(e.format!==void 0&&e.format!=="gramps-connect-story"){let c={instancePath:t+"/format",schemaPath:"#/properties/format/const",keyword:"const",params:{allowedValue:"gramps-connect-story"},message:"must be equal to constant"};o===null?o=[c]:o.push(c),s++}if(e.version!==void 0){let c=e.version;if(typeof c=="string"){if(!iZ.test(c)){let h={instancePath:t+"/version",schemaPath:"#/properties/version/pattern",keyword:"pattern",params:{pattern:"^1\\.(0|[1-9][0-9]*)$"},message:'must match pattern "^1\\.(0|[1-9][0-9]*)$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.title!==void 0){let c=e.title;if(typeof c=="string"){if(!Na.test(c)){let h={instancePath:t+"/title",schemaPath:"#/properties/title/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.language!==void 0){let c=e.language;if(typeof c=="string"){if(!nZ.test(c)){let h={instancePath:t+"/language",schemaPath:"#/properties/language/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"},message:'must match pattern "^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/language",schemaPath:"#/properties/language/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.created!==void 0){let c=e.created;if(typeof c=="string"){if(!aZ.test(c)){let h={instancePath:t+"/created",schemaPath:"#/properties/created/pattern",keyword:"pattern",params:{pattern:"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"},message:'must match pattern "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?(Z|[+-][0-9]{2}:[0-9]{2})$"'};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/created",schemaPath:"#/properties/created/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}if(e.generator!==void 0){let c=e.generator;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.name===void 0){let h={instancePath:t+"/generator",schemaPath:"#/properties/generator/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[h]:o.push(h),s++}if(c.name!==void 0){let h=c.name;if(typeof h=="string"){if(!Na.test(h)){let p={instancePath:t+"/generator/name",schemaPath:"#/properties/generator/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[p]:o.push(p),s++}}else{let p={instancePath:t+"/generator/name",schemaPath:"#/properties/generator/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[p]:o.push(p),s++}}if(c.version!==void 0&&typeof c.version!="string"){let h={instancePath:t+"/generator/version",schemaPath:"#/properties/generator/properties/version/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}if(c.url!==void 0&&typeof c.url!="string"){let h={instancePath:t+"/generator/url",schemaPath:"#/properties/generator/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[h]:o.push(h),s++}}else{let h={instancePath:t+"/generator",schemaPath:"#/properties/generator/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.authors!==void 0){let c=e.authors;if(Array.isArray(c)){let h=c.length;for(let p=0;p<h;p++){let d=c[p];if(d&&typeof d=="object"&&!Array.isArray(d)){if(d.name===void 0){let f={instancePath:t+"/authors/"+p,schemaPath:"#/properties/authors/items/required",keyword:"required",params:{missingProperty:"name"},message:"must have required property 'name'"};o===null?o=[f]:o.push(f),s++}if(d.name!==void 0){let f=d.name;if(typeof f=="string"){if(!Na.test(f)){let m={instancePath:t+"/authors/"+p+"/name",schemaPath:"#/properties/authors/items/properties/name/pattern",keyword:"pattern",params:{pattern:"\\S"},message:'must match pattern "\\S"'};o===null?o=[m]:o.push(m),s++}}else{let m={instancePath:t+"/authors/"+p+"/name",schemaPath:"#/properties/authors/items/properties/name/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[m]:o.push(m),s++}}if(d.url!==void 0&&typeof d.url!="string"){let f={instancePath:t+"/authors/"+p+"/url",schemaPath:"#/properties/authors/items/properties/url/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/authors/"+p,schemaPath:"#/properties/authors/items/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[f]:o.push(f),s++}}}else{let h={instancePath:t+"/authors",schemaPath:"#/properties/authors/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[h]:o.push(h),s++}}if(e.license!==void 0&&typeof e.license!="string"){let c={instancePath:t+"/license",schemaPath:"#/properties/license/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[c]:o.push(c),s++}if(e.presentation!==void 0){let c=e.presentation;if(c&&typeof c=="object"&&!Array.isArray(c)){if(c.basemap!==void 0){let h=c.basemap;if(!(h==="standard"||h==="historical"||h==="auto"||h==="none")){let p={instancePath:t+"/presentation/basemap",schemaPath:"#/properties/presentation/properties/basemap/enum",keyword:"enum",params:{allowedValues:rZ.properties.presentation.properties.basemap.enum},message:"must be equal to one of the allowed values"};o===null?o=[p]:o.push(p),s++}}}else{let h={instancePath:t+"/presentation",schemaPath:"#/properties/presentation/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.slides!==void 0){let c=e.slides;if(Array.isArray(c)){if(c.length<1){let p={instancePath:t+"/slides",schemaPath:"#/properties/slides/minItems",keyword:"minItems",params:{limit:1},message:"must NOT have fewer than 1 items"};o===null?o=[p]:o.push(p),s++}let h=c.length;for(let p=0;p<h;p++)cl(c[p],{instancePath:t+"/slides/"+p,parentData:c,parentDataProperty:p,rootData:n,dynamicAnchors:a})||(o=o===null?cl.errors:o.concat(cl.errors),s=o.length)}else{let h={instancePath:t+"/slides",schemaPath:"#/properties/slides/type",keyword:"type",params:{type:"array"},message:"must be array"};o===null?o=[h]:o.push(h),s++}}if(e.media!==void 0){let c=e.media;if(c&&typeof c=="object"&&!Array.isArray(c)){for(let h in c){let p=s;if(typeof h=="string"){if(!Of.test(h)){let d={instancePath:t+"/media",schemaPath:"#/$defs/id/pattern",keyword:"pattern",params:{pattern:"^[A-Za-z0-9_-]{1,64}$"},message:'must match pattern "^[A-Za-z0-9_-]{1,64}$"',propertyName:h};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/media",schemaPath:"#/$defs/id/type",keyword:"type",params:{type:"string"},message:"must be string",propertyName:h};o===null?o=[d]:o.push(d),s++}var u=p===s;if(!u){let d={instancePath:t+"/media",schemaPath:"#/properties/media/propertyNames",keyword:"propertyNames",params:{propertyName:h},message:"property name must be valid"};o===null?o=[d]:o.push(d),s++}}for(let h in c){let p=c[h];if(p&&typeof p=="object"&&!Array.isArray(p)){if(p.src===void 0){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/required",keyword:"required",params:{missingProperty:"src"},message:"must have required property 'src'"};o===null?o=[d]:o.push(d),s++}if(p.mime===void 0){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/required",keyword:"required",params:{missingProperty:"mime"},message:"must have required property 'mime'"};o===null?o=[d]:o.push(d),s++}if(p.src!==void 0){let d=p.src;if(typeof d=="string"){if(!oZ.test(d)){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/src",schemaPath:"#/$defs/mediaItem/properties/src/pattern",keyword:"pattern",params:{pattern:"^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"},message:'must match pattern "^(?!/)(?!.*(^|/)\\.\\.?(/|$))[^\\\\]+$"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/src",schemaPath:"#/$defs/mediaItem/properties/src/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.mime!==void 0){let d=p.mime;if(typeof d=="string"){if(!sZ.test(d)){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/mime",schemaPath:"#/$defs/mediaItem/properties/mime/pattern",keyword:"pattern",params:{pattern:"^[a-z]+/[A-Za-z0-9.+-]+$"},message:'must match pattern "^[a-z]+/[A-Za-z0-9.+-]+$"'};o===null?o=[f]:o.push(f),s++}}else{let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/mime",schemaPath:"#/$defs/mediaItem/properties/mime/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[f]:o.push(f),s++}}if(p.width!==void 0){let d=p.width;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/width",schemaPath:"#/$defs/mediaItem/properties/width/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[f]:o.push(f),s++}if(typeof d=="number"&&isFinite(d)&&(d<1||isNaN(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/width",schemaPath:"#/$defs/mediaItem/properties/width/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};o===null?o=[f]:o.push(f),s++}}if(p.height!==void 0){let d=p.height;if(!(typeof d=="number"&&!(d%1)&&!isNaN(d)&&isFinite(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/height",schemaPath:"#/$defs/mediaItem/properties/height/type",keyword:"type",params:{type:"integer"},message:"must be integer"};o===null?o=[f]:o.push(f),s++}if(typeof d=="number"&&isFinite(d)&&(d<1||isNaN(d))){let f={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/height",schemaPath:"#/$defs/mediaItem/properties/height/minimum",keyword:"minimum",params:{comparison:">=",limit:1},message:"must be >= 1"};o===null?o=[f]:o.push(f),s++}}if(p.alt!==void 0&&typeof p.alt!="string"){let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1")+"/alt",schemaPath:"#/$defs/mediaItem/properties/alt/type",keyword:"type",params:{type:"string"},message:"must be string"};o===null?o=[d]:o.push(d),s++}}else{let d={instancePath:t+"/media/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/$defs/mediaItem/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}}else{let h={instancePath:t+"/media",schemaPath:"#/properties/media/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}if(e.extensions!==void 0){let c=e.extensions;if(c&&typeof c=="object"&&!Array.isArray(c))for(let h in c){let p=c[h];if(!(p&&typeof p=="object"&&!Array.isArray(p))){let d={instancePath:t+"/extensions/"+h.replace(/~/g,"~0").replace(/\//g,"~1"),schemaPath:"#/properties/extensions/additionalProperties/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[d]:o.push(d),s++}}else{let h={instancePath:t+"/extensions",schemaPath:"#/properties/extensions/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[h]:o.push(h),s++}}}else{let c={instancePath:t,schemaPath:"#/type",keyword:"type",params:{type:"object"},message:"must be object"};o===null?o=[c]:o.push(c),s++}return Bf.errors=o,s===0}Bf.evaluated={props:{$schema:!0,format:!0,version:!0,title:!0,language:!0,created:!0,generator:!0,authors:!0,license:!0,presentation:!0,slides:!0,media:!0,extensions:!0},dynamicProps:!1,dynamicItems:!1};var lZ=0;function i2(e,t){let r=[],i=[];if(!r2(e)){for(let u of r2.errors??[])r.push({path:u.instancePath,message:uZ(u)});return{valid:!1,errors:r,warnings:i}}let n=e,a=new Set,o=new Set,s=(u,c)=>{o.add(u),Object.prototype.hasOwnProperty.call(n.media,u)||r.push({path:c,message:`refers to media "${u}", which isn't in "media".`})};n.slides.forEach((u,c)=>{a.has(u.id)&&r.push({path:`/slides/${c}/id`,message:`duplicate slide id "${u.id}".`}),a.add(u.id),u.media?.forEach((h,p)=>s(h.ref,`/slides/${c}/media/${p}/ref`)),u.place?.overlays?.forEach((h,p)=>s(h.media,`/slides/${c}/place/overlays/${p}/media`))});for(let[u,c]of Object.entries(n.media)){let h=`/media/${mD(u)}`;t&&!t.has(c.src)&&r.push({path:`${h}/src`,message:`file "${c.src}" is not in the zip.`}),o.has(u)||i.push({path:h,message:`media "${u}" isn't used by any slide or overlay.`})}let l=Lf(n.version);return l&&l.major===1&&l.minor<=lZ&&jf(n,t2,"",i),{valid:r.length===0,errors:r,warnings:i}}function uZ(e){return e.keyword==="pattern"&&e.params.pattern==="\\S"?"must not be empty.":e.keyword==="required"?`is missing required field "${String(e.params.missingProperty)}".`:e.keyword==="const"?`must be ${JSON.stringify(e.params.allowedValue)}.`:e.keyword==="enum"?`must be one of ${e.params.allowedValues.map(t=>JSON.stringify(t)).join(", ")}.`:`${e.message??"is invalid"}.`}function mD(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function cZ(e,t){if(!e.$ref)return e;let r=e.$ref.replace(/^#\/\$defs\//,"");return t.$defs[r]}function jf(e,t,r,i,n=t2){if(t=cZ(t,n),Array.isArray(e)){e.forEach((a,o)=>{let s=t.prefixItems?.[o]??t.items;s&&jf(a,s,`${r}/${o}`,i,n)});return}if(!(typeof e!="object"||e===null))for(let[a,o]of Object.entries(e)){let s=`${r}/${mD(a)}`,l=t.properties?.[a];l?jf(o,l,s,i,n):typeof t.additionalProperties=="object"?jf(o,t.additionalProperties,s,i,n):t.properties&&t.additionalProperties!==!0&&i.push({path:s,message:`unknown field "${a}" (ignored).`})}}var gD={},hZ=(function(e,t,r,i,n){var a=new Worker(gD[t]||(gD[t]=URL.createObjectURL(new Blob([e+';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'],{type:"text/javascript"}))));return a.onmessage=function(o){var s=o.data,l=s.$e$;if(l){var u=new Error(l[0]);u.code=l[1],u.stack=l[2],n(u,null)}else n(null,s)},a.postMessage(r,i),a}),Dr=Uint8Array,Ro=Uint16Array,vD=Int32Array,o2=new Dr([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s2=new Dr([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xD=new Dr([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),bD=function(e,t){for(var r=new Ro(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];for(var n=new vD(r[30]),i=1;i<30;++i)for(var a=r[i];a<r[i+1];++a)n[a]=a-r[i]<<5|i;return{b:r,r:n}},wD=bD(o2,2),l2=wD.b,pZ=wD.r;l2[28]=258,pZ[258]=28;var TD=bD(s2,0),SD=TD.b,LJ=TD.r,$f=new Ro(32768);for(Ve=0;Ve<32768;++Ve)Wn=(Ve&43690)>>1|(Ve&21845)<<1,Wn=(Wn&52428)>>2|(Wn&13107)<<2,Wn=(Wn&61680)>>4|(Wn&3855)<<4,$f[Ve]=((Wn&65280)>>8|(Wn&255)<<8)>>1;var Wn,Ve,hl=(function(e,t,r){for(var i=e.length,n=0,a=new Ro(t);n<i;++n)e[n]&&++a[e[n]-1];var o=new Ro(t);for(n=1;n<t;++n)o[n]=o[n-1]+a[n-1]<<1;var s;if(r){s=new Ro(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var u=n<<4|e[n],c=t-e[n],h=o[e[n]-1]++<<c,p=h|(1<<c)-1;h<=p;++h)s[$f[h]>>l]=u}else for(s=new Ro(i),n=0;n<i;++n)e[n]&&(s[n]=$f[o[e[n]-1]++]>>15-e[n]);return s}),Dc=new Dr(288);for(Ve=0;Ve<144;++Ve)Dc[Ve]=8;var Ve;for(Ve=144;Ve<256;++Ve)Dc[Ve]=9;var Ve;for(Ve=256;Ve<280;++Ve)Dc[Ve]=7;var Ve;for(Ve=280;Ve<288;++Ve)Dc[Ve]=8;var Ve,ED=new Dr(32);for(Ve=0;Ve<32;++Ve)ED[Ve]=5;var Ve;var CD=hl(Dc,9,1);var PD=hl(ED,5,1),Vf=function(e){for(var t=e[0],r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},Ei=function(e,t,r){var i=t/8|0;return(e[i]|e[i+1]<<8)>>(t&7)&r},Uf=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(t&7)},DD=function(e){return(e+7)/8|0},qf=function(e,t,r){return(t==null||t<0)&&(t=0),(r==null||r>e.length)&&(r=e.length),new Dr(e.subarray(t,r))};var AD=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],_r=function(e,t,r){var i=new Error(t||AD[e]);if(i.code=e,Error.captureStackTrace&&Error.captureStackTrace(i,_r),!r)throw i;return i},MD=function(e,t,r,i){var n=e.length,a=i?i.length:0;if(!n||t.f&&!t.l)return r||new Dr(0);var o=!r,s=o||t.i!=2,l=t.i;o&&(r=new Dr(n*3));var u=function(Et){var kt=r.length;if(Et>kt){var st=new Dr(Math.max(kt*2,Et));st.set(r),r=st}},c=t.f||0,h=t.p||0,p=t.b||0,d=t.l,f=t.d,m=t.m,_=t.n,g=n*8;do{if(!d){c=Ei(e,h,1);var y=Ei(e,h+1,3);if(h+=3,y)if(y==1)d=CD,f=PD,m=9,_=5;else if(y==2){var w=Ei(e,h,31)+257,T=Ei(e,h+10,15)+4,S=w+Ei(e,h+5,31)+1;h+=14;for(var E=new Dr(S),P=new Dr(19),D=0;D<T;++D)P[xD[D]]=Ei(e,h+D*3,7);h+=T*3;for(var F=Vf(P),I=(1<<F)-1,C=hl(P,F,1),D=0;D<S;){var A=C[Ei(e,h,I)];h+=A&15;var v=A>>4;if(v<16)E[D++]=v;else{var M=0,L=0;for(v==16?(L=3+Ei(e,h,3),h+=2,M=E[D-1]):v==17?(L=3+Ei(e,h,7),h+=3):v==18&&(L=11+Ei(e,h,127),h+=7);L--;)E[D++]=M}}var j=E.subarray(0,w),O=E.subarray(w);m=Vf(j),_=Vf(O),d=hl(j,m,1),f=hl(O,_,1)}else _r(1);else{var v=DD(h)+4,x=e[v-4]|e[v-3]<<8,b=v+x;if(b>n){l&&_r(0);break}s&&u(p+x),r.set(e.subarray(v,b),p),t.b=p+=x,t.p=h=b*8,t.f=c;continue}if(h>g){l&&_r(0);break}}s&&u(p+131072);for(var Y=(1<<m)-1,ue=(1<<_)-1,pe=h;;pe=h){var M=d[Uf(e,h)&Y],de=M>>4;if(h+=M&15,h>g){l&&_r(0);break}if(M||_r(2),de<256)r[p++]=de;else if(de==256){pe=h,d=null;break}else{var je=de-254;if(de>264){var D=de-257,Se=o2[D];je=Ei(e,h,(1<<Se)-1)+l2[D],h+=Se}var ae=f[Uf(e,h)&ue],oe=ae>>4;ae||_r(3),h+=ae&15;var O=SD[oe];if(oe>3){var Se=s2[oe];O+=Uf(e,h)&(1<<Se)-1,h+=Se}if(h>g){l&&_r(0);break}s&&u(p+131072);var $e=p+je;if(p<O){var qe=a-O,mt=Math.min(O,$e);for(qe+p<0&&_r(3);p<mt;++p)r[p]=i[qe+p]}for(;p<$e;++p)r[p]=r[p-O]}}t.l=d,t.p=pe,t.b=p,t.f=c,d&&(c=1,t.m=m,t.d=f,t.n=_)}while(!c);return p!=r.length&&o?qf(r,0,p):r.subarray(0,p)};var dZ=new Dr(0);var fZ=function(e,t){var r={};for(var i in e)r[i]=e[i];for(var i in t)r[i]=t[i];return r},yD=function(e,t,r){for(var i=e(),n=e.toString(),a=n.slice(n.indexOf("[")+1,n.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o<i.length;++o){var s=i[o],l=a[o];if(typeof s=="function"){t+=";"+l+"=";var u=s.toString();if(s.prototype)if(u.indexOf("[native code]")!=-1){var c=u.indexOf(" ",8)+1;t+=u.slice(c,u.indexOf("(",c))}else{t+=u;for(var h in s.prototype)t+=";"+l+".prototype."+h+"="+s.prototype[h].toString()}else t+=u}else r[l]=s}return t},Nf=[],mZ=function(e){var t=[];for(var r in e)e[r].buffer&&t.push((e[r]=new e[r].constructor(e[r])).buffer);return t},gZ=function(e,t,r,i){if(!Nf[r]){for(var n="",a={},o=e.length-1,s=0;s<o;++s)n=yD(e[s],n,a);Nf[r]={c:yD(e[o],n,a),e:a}}var l=fZ({},Nf[r].e);return hZ(Nf[r].c+";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage="+t.toString()+"}",r,l,mZ(l),i)},yZ=function(){return[Dr,Ro,vD,o2,s2,xD,l2,SD,CD,PD,$f,AD,hl,Vf,Ei,Uf,DD,qf,_r,MD,u2,ID,kD]};var ID=function(e){return postMessage(e,[e.buffer])},kD=function(e){return e&&{out:e.size&&new Dr(e.size),dictionary:e.dictionary}},_Z=function(e,t,r,i,n,a){var o=gZ(r,i,n,function(s,l){o.terminate(),a(s,l)});return o.postMessage([e,t],t.consume?[e.buffer]:[]),function(){o.terminate()}};var xn=function(e,t){return e[t]|e[t+1]<<8},Ci=function(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0},n2=function(e,t){return Ci(e,t)+Ci(e,t+4)*4294967296};function vZ(e,t,r){return r||(r=t,t={}),typeof r!="function"&&_r(7),_Z(e,t,[yZ],function(i){return ID(u2(i.data[0],kD(i.data[1])))},1,r)}function u2(e,t){return MD(e,{i:2},t&&t.out,t&&t.dictionary)}var a2=typeof TextDecoder<"u"&&new TextDecoder,xZ=0;try{a2.decode(dZ,{stream:!0}),xZ=1}catch{}var bZ=function(e){for(var t="",r=0;;){var i=e[r++],n=(i>127)+(i>223)+(i>239);if(r+n>e.length)return{s:t,r:qf(e,r-1)};n?n==3?(i=((i&15)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,t+=String.fromCharCode(55296|i>>10,56320|i&1023)):n&1?t+=String.fromCharCode((i&31)<<6|e[r++]&63):t+=String.fromCharCode((i&15)<<12|(e[r++]&63)<<6|e[r++]&63):t+=String.fromCharCode(i)}};function wZ(e,t){if(t){for(var r="",i=0;i<e.length;i+=16384)r+=String.fromCharCode.apply(null,e.subarray(i,i+16384));return r}else{if(a2)return a2.decode(e);var n=bZ(e),a=n.s,r=n.r;return r.length&&_r(8),a}}var TZ=function(e,t){return t+30+xn(e,t+26)+xn(e,t+28)},SZ=function(e,t,r){var i=xn(e,t+28),n=xn(e,t+30),a=wZ(e.subarray(t+46,t+46+i),!(xn(e,t+8)&2048)),o=t+46+i,s=EZ(e,o,n,r,Ci(e,t+20),Ci(e,t+24),Ci(e,t+42)),l=s[0],u=s[1],c=s[2];return[xn(e,t+10),l,u,a,o+n+xn(e,t+32),c]},EZ=function(e,t,r,i,n,a,o){var s=n==4294967295,l=a==4294967295,u=o==4294967295,c=t+r,h=s+l+u;if(i&&h){for(;t+4<c;t+=4+xn(e,t+2))if(xn(e,t)==1)return[s?n2(e,t+4+8*l):n,l?n2(e,t+4):a,u?n2(e,t+4+8*(l+s)):o,1];i<2&&_r(13)}return[n,a,o,0]};var _D=typeof queueMicrotask=="function"?queueMicrotask:typeof setTimeout=="function"?setTimeout:function(e){e()};function zD(e,t,r){r||(r=t,t={}),typeof r!="function"&&_r(7);var i=[],n=function(){for(var _=0;_<i.length;++_)i[_]()},a={},o=function(_,g){_D(function(){r(_,g)})};_D(function(){o=r});for(var s=e.length-22;Ci(e,s)!=101010256;--s)if(!s||e.length-s>65558)return o(_r(13,0,1),null),n;var l=xn(e,s+8);if(l){var u=l,c=Ci(e,s+16),h=Ci(e,s-20)==117853008;if(h){var p=Ci(e,s-12);h=Ci(e,p)==101075792,h&&(u=l=Ci(e,p+32),c=Ci(e,p+48))}for(var d=t&&t.filter,f=function(_){var g=SZ(e,c,h),y=g[0],v=g[1],x=g[2],b=g[3],w=g[4],T=g[5],S=TZ(e,T);c=w;var E=function(D,F){D?(n(),o(D,null)):(F&&(a[b]=F),--l||o(null,a))};if(!d||d({name:b,size:v,originalSize:x,compression:y}))if(!y)E(null,qf(e,S,S+v));else if(y==8){var P=e.subarray(S,S+v);if(x<524288||v>.8*x)try{E(null,u2(P,{out:new Dr(x)}))}catch(D){E(D,null)}else i.push(vZ(P,{size:x},E))}else E(_r(14,"unknown compression type "+y,1),null);else E(null,null)},m=0;m<u;++m)f(m)}else o(null,{});return n}var c2="story.json";async function PZ(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(await e.arrayBuffer())}function DZ(e){return e.endsWith("/")||e.startsWith("__MACOSX/")}async function h2(e,t={}){let r=t.maxTotalBytes??536870912,i=t.maxFiles??1e4,n=await PZ(e),a=0,o=0,s=!1,l=await new Promise((f,m)=>{zD(n,{filter(_){return DZ(_.name)?!1:(o+=1,a+=_.originalSize,(o>i||a>r)&&(s=!0),!s)}},(_,g)=>_?m(_):f(g))}).catch(f=>{throw new Vr("not-a-zip",`Not a readable zip file (${f instanceof Error?f.message:String(f)}).`)});if(s)throw new Vr("too-large","This zip is too large to open as a story.");let u=AZ(Object.keys(l)),c=new Map;for(let[f,m]of Object.entries(l))f.startsWith(u)&&c.set(f.slice(u.length),m);let h;try{h=JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(c.get(c2)))}catch(f){throw new Vr("bad-json",`story.json is not valid JSON (${f instanceof Error?f.message:String(f)}).`)}let p=e2(h),d=i2(p,c);if(!d.valid)throw new Gf(d.errors);return{doc:p,files:c,warnings:d.warnings}}var Gf=class extends Vr{constructor(t){super("invalid",`story.json is invalid: ${t.slice(0,5).map(r=>`${r.path||"/"} ${r.message}`).join("; ")}${t.length>5?` (and ${t.length-5} more)`:""}`),this.issues=t}};function AZ(e){if(e.includes(c2))return"";let t=e.filter(r=>/^[^/]+\/story\.json$/.test(r));if(t.length===1)return t[0].slice(0,-c2.length);throw new Vr("no-story-json",t.length>1?"This zip holds more than one story.json; a story zip has exactly one.":"This zip has no story.json, so it isn't a story.")}function p2(e,t){let r=Object.prototype.hasOwnProperty.call(e.doc.media,t)?e.doc.media[t]:void 0,i=r&&e.files.get(r.src);return i?new Blob([i],{type:r.mime}):void 0}var He=ur($a(),1);var FD=/^(-?\d{4})(?:-(\d{2}|XX))?(?:-(\d{2}|XX))?[~?%]?$/;function Ac(e){let t=FD.exec(e.trim());return t?Number(t[1]):null}function RD(e){if(!e)return null;let t=e.trim(),r=/^\[(.+)\.\.(.+)\]$/.exec(t);if(r){let n=Ac(r[1]),a=Ac(r[2]);return n!==null&&a!==null?{min:Math.min(n,a),max:Math.max(n,a)}:null}if(t.includes("/")){let[n,a]=t.split("/"),o=n===".."||n==="",s=a===".."||a==="",l=o?void 0:Ac(n),u=s?void 0:Ac(a);return l===null||u===null||l===void 0&&u===void 0?null:l!==void 0&&u!==void 0?{min:Math.min(l,u),max:Math.max(l,u)}:{min:l,max:u}}let i=Ac(t);return i===null?null:{min:i,max:i}}function Zf(e,t){if(!e||t===null)return!0;let r=RD(e.edtf);return r?!(r.min!==void 0&&t<r.min||r.max!==void 0&&t>r.max):!0}function Hf(e){if(!e)return null;let t=e.edtf?FD.exec(e.edtf.trim()):null,r=e.sortYear??(t?Number(t[1]):void 0);if(r===void 0)return null;if(!t||Number(t[1])!==r)return r;let i=t[2]&&t[2]!=="XX"?Number(t[2]):0,n=t[3]&&t[3]!=="XX"?Number(t[3]):0;return i?r+(i-1)/12+(n?(n-1)/365:0):r}function Mc(e,t){if(Array.isArray(e)){if(e.length>=2&&typeof e[0]=="number"&&typeof e[1]=="number"){let[r,i]=e;t[0]=Math.min(t[0],r),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],r),t[3]=Math.max(t[3],i);return}for(let r of e)Mc(r,t)}}function Wf(e,t){if(!e||typeof e!="object")return;let r=e;r.coordinates!==void 0&&Mc(r.coordinates,t),r.geometry&&Wf(r.geometry,t);for(let i of r.geometries??[])Wf(i,t);for(let i of r.features??[])Wf(i,t)}function Ic(e){if(!e)return null;let t=[1/0,1/0,-1/0,-1/0];Wf(e.geometry,t);for(let r of e.overlays??[])Mc(r.corners,t);return Number.isFinite(t[0])?t:null}function Yn(e){if(e?.lat!==void 0&&e.lon!==void 0)return[e.lon,e.lat];let t=Ic(e);return t?[(t[0]+t[2])/2,(t[1]+t[3])/2]:null}function LD(e){let t=[1/0,1/0,-1/0,-1/0],r=new Map;for(let i of e){let n=Yn(i);if(!n)continue;r.set(`${n[0].toFixed(5)},${n[1].toFixed(5)}`,n),Mc(n,t);let a=Ic(i);a&&Mc([[a[0],a[1]],[a[2],a[3]]],t)}return r.size?{points:[...r.values()],bounds:t}:null}var It=ur($a(),1);var $D=ur(UD(),1),qD="https://tiles.openfreemap.org/styles/liberty",GD="https://basemaps.cartocdn.com/gl/dark-matter-gl-style/style.json",ZD="https://www.openhistoricalmap.org/map-styles/main/main.json";function zc(e,t){return t!=null?"ohm":e?"dark":"light"}function Qf(e,t){return t!=null?ZD:e?GD:qD}function g2(e,t,r,i=300){let n=e.getContainer();n.style.zIndex||(n.style.zIndex="0");let a=null;try{a=e.getCanvas().toDataURL("image/png")}catch{}if(r(),e.setStyle(t),!a)return;let o=document.createElement("img");o.src=a,o.alt="",Object.assign(o.style,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"5",pointerEvents:"none",transition:`opacity ${i}ms ease`}),n.appendChild(o),e.once("idle",()=>{requestAnimationFrame(()=>{o.style.opacity="0"}),window.setTimeout(()=>o.remove(),i+50)})}function y2(e,t){(0,$D.filterByDate)(e,String(Math.round(t)))}function _2(e){return e?{surface:"#242424",text:"#c9c9c9",muted:"#828282",border:"#424242",mark:"#3987e5",panel:"rgb(20,20,20)"}:{surface:"#ffffff",text:"#000000",muted:"#868e96",border:"#dee2e6",mark:"#2a78d6",panel:"rgb(255,255,255)"}}var Fc="M12 0C7.03 0 3 4.03 3 9c0 6.25 9 15 9 15s9-8.75 9-15c0-4.97-4.03-9-9-9z";var e8=ur(Xi(),1),Lo="story-shape",XD="story-shape-fill",LZ="story-shape-line",BZ="story-shape-points",OZ="story-shape-labels",jZ="story-overlay-",v2="story-places",NZ="story-places-dots",VZ=60,x2={type:"FeatureCollection",features:[]};function KD(e,t,r){if(t.overview){let[o,s,l,u]=t.overview.bounds;e.fitBounds([[o,s],[l,u]],{maxZoom:9,padding:VZ,duration:r});return}let i=t.place,n=Ic(i);if(n){e.fitBounds([[n[0],n[1]],[n[2],n[3]]],{maxZoom:17,duration:r});return}let a=Yn(i);a&&e.flyTo({center:a,zoom:9,essential:!0,duration:r})}function QD(e,t){if(!e)return;let r=Yn(t.place);r&&e.setLngLat(r),e.setOpacity(t.overview?0:r?1:.4)}var UZ=e=>({type:"FeatureCollection",features:(e?.points??[]).map(t=>({type:"Feature",properties:{},geometry:{type:"Point",coordinates:t}}))});function JD({initialCenter:e,current:t,dark:r,colors:i,panelFraction:n,ohmYear:a,resolveMedia:o}){let[s,l]=(0,It.useState)(null),u=(0,It.useRef)(null),c=(0,It.useRef)(null),[h,p]=(0,It.useState)(!1),d=(0,It.useRef)(r);d.current=r;let f=(0,It.useRef)(a);f.current=a;let m=(0,It.useRef)(i);m.current=i;let _=(0,It.useRef)(new Map),g=(0,It.useRef)(zc(r,a)),y=(0,It.useRef)(t);y.current=t,(0,It.useEffect)(()=>{if(!s)return;p(!1),g.current=zc(d.current,f.current);let b=new sD({container:s,style:Qf(d.current,f.current),zoom:5,attributionControl:{compact:!0},canvasContextAttributes:{preserveDrawingBuffer:!0}});u.current=b,b.on("style.load",()=>p(!0)),b.setPadding({top:0,bottom:0,left:0,right:s.clientWidth*n});let w=y.current;return b.jumpTo({center:Yn(w.place)??e}),KD(b,w,0),b.on("load",()=>{let T=m.current,S=document.createElement("div");S.style.width="26px",S.style.height="26px",S.style.transition="opacity 300ms",S.innerHTML=`<svg viewBox="0 0 24 24" width="26" height="26"><path d="${Fc}" fill="${T.mark}" stroke="${T.surface}" stroke-width="1.5" /></svg>`,c.current=new cD({element:S,anchor:"bottom"}).setLngLat(e).addTo(b),QD(c.current,y.current)}),()=>{c.current?.remove(),c.current=null,b.remove(),u.current=null}},[s]),(0,It.useEffect)(()=>{let b=u.current,w=zc(r,a);!b||g.current===w||(g.current=w,g2(b,Qf(r,a),()=>p(!1)))},[r,a]),(0,It.useEffect)(()=>{let b=u.current;!b||!h||a==null||y2(b,a)},[h,a]),(0,It.useEffect)(()=>{let b=u.current;if(!b||!h||b.getSource(Lo))return;let w=m.current;b.addSource(Lo,{type:"geojson",data:x2});let T=["coalesce",["get","color"],w.mark];b.addLayer({id:XD,type:"fill",source:Lo,filter:["==",["geometry-type"],"Polygon"],paint:{"fill-color":T,"fill-opacity":["coalesce",["to-number",["get","opacity"],.25],.25]}}),b.addLayer({id:LZ,type:"line",source:Lo,filter:["any",["==",["geometry-type"],"Polygon"],["==",["geometry-type"],"LineString"]],paint:{"line-color":T,"line-width":2}}),b.addLayer({id:BZ,type:"circle",source:Lo,filter:["all",["==",["geometry-type"],"Point"],["!",["has","name"]]],paint:{"circle-radius":5,"circle-color":T,"circle-stroke-width":1,"circle-stroke-color":w.surface}}),b.addLayer({id:OZ,type:"symbol",source:Lo,filter:["all",["==",["geometry-type"],"Point"],["has","name"]],layout:{"text-field":["get","name"],"text-size":12,"text-font":["Noto Sans Regular"],"text-anchor":"left","text-offset":[.6,0]},paint:{"text-color":["coalesce",["get","color"],w.text],"text-halo-color":w.surface,"text-halo-width":1.5}}),b.addSource(v2,{type:"geojson",data:x2}),b.addLayer({id:NZ,type:"circle",source:v2,paint:{"circle-radius":6,"circle-color":w.mark,"circle-stroke-width":2,"circle-stroke-color":w.surface}})},[h]);let v=t.place;(0,It.useEffect)(()=>{let b=u.current;if(!b||!h)return;b.getSource(Lo)?.setData(v?.geometry??x2),b.getSource(v2)?.setData(UZ(t.overview))},[h,t.key,v,t.overview]),(0,It.useEffect)(()=>{let b=u.current;b&&(QD(c.current,t),KD(b,t,900))},[t.key]);let x=JSON.stringify(v?.overlays??[]);return(0,It.useEffect)(()=>{let b=u.current,w=v?.overlays??[];if(!b||!h||w.length===0)return;let T=!1,S=[];return(async()=>{let E=w.map((P,D)=>({overlay:P,i:D})).sort((P,D)=>(P.overlay.order??P.i)-(D.overlay.order??D.i));for(let{overlay:P,i:D}of E){let F=await o(P.media);if(T)return;if(!F)continue;let I=`${jZ}${D}`;b.getSource(I)||(b.addSource(I,{type:"image",url:F,coordinates:P.corners}),b.addLayer({id:I,type:"raster",source:I},XD),b.setPaintProperty(I,"raster-opacity",P.opacity??1),_.current.set(I,P.date),b.setLayoutProperty(I,"visibility",Zf(P.date,f.current)?"visible":"none"),S.push(I))}})(),()=>{T=!0;for(let E of S)_.current.delete(E),b.getLayer(E)&&b.removeLayer(E),b.getSource(E)&&b.removeSource(E)}},[x,h]),(0,It.useEffect)(()=>{let b=u.current;if(!(!b||!h))for(let[w,T]of _.current)b.getLayer(w)&&b.setLayoutProperty(w,"visibility",Zf(T,a)?"visible":"none")},[a,h]),(0,e8.jsx)("div",{ref:l,style:{position:"absolute",inset:0}})}var Xn=ur(Xi(),1);function b2({mode:e,onModeChange:t,autoYear:r,year:i,onYearChange:n,yearBounds:a,strings:o,colors:s}){let l=[["auto",o.auto],["standard",o.standard],["historical",o.historical]],u={fontSize:12,fontFamily:"inherit"};return(0,Xn.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,whiteSpace:"nowrap"},children:[(0,Xn.jsx)("div",{role:"radiogroup","aria-label":o.mapMode,style:{display:"flex",border:`1px solid ${s.border}`,borderRadius:6,overflow:"hidden",background:s.surface},children:l.map(([c,h])=>(0,Xn.jsx)("button",{type:"button",role:"radio","aria-checked":e===c,onClick:()=>t(c),style:{...u,padding:"4px 10px",border:"none",cursor:"pointer",background:e===c?s.mark:"transparent",color:e===c?"#ffffff":s.text},children:h},c))}),e==="auto"&&(0,Xn.jsx)("span",{style:{...u,color:s.muted},children:r!=null?o.historicalMapYear(r):o.noDateStandardMap}),e==="historical"&&(0,Xn.jsxs)("span",{style:{display:"flex",alignItems:"center",gap:6},children:[(0,Xn.jsx)("input",{type:"range",min:a[0],max:a[1],step:1,value:i,onChange:c=>n(Number(c.currentTarget.value)),"aria-label":o.historicalYear,style:{width:150,accentColor:s.mark}}),(0,Xn.jsx)("input",{type:"number",min:a[0],max:a[1],step:1,value:i,onChange:c=>{let h=Number(c.currentTarget.value);Number.isFinite(h)&&c.currentTarget.value!==""&&n(Math.round(h))},"aria-label":o.historicalYear,style:{...u,width:70,padding:"3px 4px",border:`1px solid ${s.border}`,borderRadius:4,background:s.surface,color:s.text}})]})]})}var $Z=/\*\*([^\n]+?)\*\*|\*([^\n]+?)\*/g;function qZ(e){let t=[],r=0;for(let i of e.matchAll($Z)){let n=i.index??0;n>r&&t.push({text:e.slice(r,n)}),i[1]!==void 0?t.push({text:i[1],bold:!0}):t.push({text:i[2],italic:!0}),r=n+i[0].length}return r<e.length&&t.push({text:e.slice(r)}),t}function w2(e){return e.replace(/\r\n?/g,`
|
|
825
825
|
`).split(/\n[ \t]*\n+/).map(t=>t.replace(/^\n+|\n+$/g,"")).filter(t=>t.length>0).map(t=>t.split(`
|
|
826
826
|
`).map(qZ))}var S2={previous:"Previous",next:"Next",close:"Close",mapMode:"Map",auto:"Auto",standard:"Standard",historical:"Historical",historicalMapYear:e=>`Historical map, ${e}`,noDateStandardMap:"No date here \u2014 standard map",historicalYear:"Historical map year",photoOf:(e,t)=>`Photo ${e} of ${t}`},T2={en:S2,de:{previous:"Zur\xFCck",next:"Weiter",close:"Schlie\xDFen",mapMode:"Karte",auto:"Automatisch",standard:"Standard",historical:"Historisch",historicalMapYear:e=>`Historische Karte, ${e}`,noDateStandardMap:"Kein Datum hier \u2014 Standardkarte",historicalYear:"Jahr der historischen Karte",photoOf:(e,t)=>`Foto ${e} von ${t}`},es:{previous:"Anterior",next:"Siguiente",close:"Cerrar",mapMode:"Mapa",auto:"Autom\xE1tico",standard:"Est\xE1ndar",historical:"Hist\xF3rico",historicalMapYear:e=>`Mapa hist\xF3rico, ${e}`,noDateStandardMap:"Sin fecha aqu\xED \u2014 mapa est\xE1ndar",historicalYear:"A\xF1o del mapa hist\xF3rico",photoOf:(e,t)=>`Foto ${e} de ${t}`},fr:{previous:"Pr\xE9c\xE9dent",next:"Suivant",close:"Fermer",mapMode:"Carte",auto:"Auto",standard:"Standard",historical:"Historique",historicalMapYear:e=>`Carte historique, ${e}`,noDateStandardMap:"Pas de date ici \u2014 carte standard",historicalYear:"Ann\xE9e de la carte historique",photoOf:(e,t)=>`Photo ${e} sur ${t}`},nl:{previous:"Vorige",next:"Volgende",close:"Sluiten",mapMode:"Kaart",auto:"Automatisch",standard:"Standaard",historical:"Historisch",historicalMapYear:e=>`Historische kaart, ${e}`,noDateStandardMap:"Geen datum hier \u2014 standaardkaart",historicalYear:"Jaar van de historische kaart",photoOf:(e,t)=>`Foto ${e} van ${t}`}};function E2(...e){for(let t of e){let r=t?.toLowerCase().split(/[-_]/)[0];if(r&&T2[r])return T2[r]}return S2}var GZ=Object.keys(T2);var pl=ur($a(),1);function C2(e){let t=Math.min(...e),r=Math.max(...e);if(r-t<1)return[t-5,t+5];let i=(r-t)*.05;return[t-i,r+i]}function P2(e,t,r){let[i,n]=t,a=n-i;return a>0?(e-i)/a*r:r/2}var ZZ=[1e3,500,250,100,50,25,10,5,2,1],HZ=8;function D2(e,t){let[r,i]=e,n=i-r;if(!(n>0)||t<=0)return[];let a=ZZ.find(s=>n/s>=HZ)??1,o=[];for(let s=Math.ceil(r/a)*a;s<i;s+=a)o.push({x:(s-r)/n*t,label:Rc(s)});return o}function Rc(e){let t=Math.floor(e);return t<0?`${-t} BC`:String(t)}var bn=ur(Xi(),1),Bc=70,Lc=28,em=42,WZ=62,A2=.95;function t8({points:e,currentIndex:t,onSelect:r,colors:i}){let n=(0,pl.useRef)(null),[a,o]=(0,pl.useState)(0);(0,pl.useEffect)(()=>{let c=n.current;if(!c)return;let h=new ResizeObserver(([p])=>o(p.contentRect.width));return h.observe(c),()=>h.disconnect()},[]);let s=Math.max(0,a-Lc*2),l=C2(e.map(c=>c.year)),u=s>0?D2(l,s):[];return(0,bn.jsx)("div",{ref:n,style:{position:"absolute",left:0,right:0,bottom:0,height:Bc,background:i.surface,zIndex:2},children:a>0&&(0,bn.jsxs)("svg",{width:a,height:Bc,style:{display:"block",overflow:"visible"},children:[(0,bn.jsx)("line",{x1:Lc,y1:em,x2:a-Lc,y2:em,stroke:i.border,strokeWidth:1}),u.map(c=>(0,bn.jsx)("text",{x:Lc+c.x,y:WZ,fontSize:15,fill:i.muted,textAnchor:"middle",children:c.label},c.x)),e.map(c=>{let h=Lc+P2(c.year,l,s);return c.index===t?(0,bn.jsx)("path",{d:Fc,transform:`translate(${h-12*A2} ${em-24*A2}) scale(${A2})`,fill:i.mark,stroke:i.text,strokeWidth:1.5,style:{cursor:"pointer"},onClick:()=>r(c.index),children:(0,bn.jsx)("title",{children:Rc(c.year)})},c.index):(0,bn.jsx)("circle",{cx:h,cy:em,r:3.5,fill:i.mark,stroke:i.surface,strokeWidth:1.5,style:{cursor:"pointer"},onClick:()=>r(c.index),children:(0,bn.jsx)("title",{children:Rc(c.year)})},c.index)})]})})}var ce=ur(Xi(),1),r8=.62,dl=56;function YZ(e){return e.presentation?.basemap==="historical"?"auto":"standard"}function XZ({text:e,colors:t}){return(0,ce.jsx)(ce.Fragment,{children:w2(e).map((r,i)=>(0,ce.jsx)("p",{dir:"auto",style:{margin:"0 0 0.6em",color:t.text,lineHeight:1.55},children:r.map((n,a)=>(0,ce.jsxs)("span",{children:[a>0&&(0,ce.jsx)("br",{}),n.map((o,s)=>o.bold?(0,ce.jsx)("b",{children:o.text},s):o.italic?(0,ce.jsx)("i",{children:o.text},s):(0,ce.jsx)("span",{children:o.text},s))]},a))},i))})}function KZ({mediaKey:e,item:t,caption:r,credit:i,resolveMedia:n,colors:a}){let[o,s]=(0,He.useState)(null);return(0,He.useEffect)(()=>{s(null);let l=!1;return n(e,t).then(u=>{l||s(u)},()=>{}),()=>{l=!0}},[e,t,n]),o?(0,ce.jsxs)("figure",{style:{margin:0,display:"flex",flexDirection:"column",alignItems:"center",gap:4},children:[(0,ce.jsx)("img",{src:o,alt:t.alt??"",width:t.width,height:t.height,style:{maxHeight:"42vh",maxWidth:"100%",width:"auto",height:"auto",objectFit:"contain",borderRadius:4}}),(r||i)&&(0,ce.jsx)("figcaption",{style:{fontSize:13,color:a.muted},children:[r,i&&`\xA9 ${i}`].filter(Boolean).join(" \xB7 ")})]}):null}function QZ({mediaKey:e,item:t,label:r,selected:i,onSelect:n,resolveMedia:a,colors:o}){let[s,l]=(0,He.useState)(null);return(0,He.useEffect)(()=>{let u=!1;return a(e,t).then(c=>{u||l(c)},()=>{}),()=>{u=!0}},[e,t,a]),(0,ce.jsx)("button",{type:"button","aria-label":r,title:r,"aria-pressed":i,onClick:n,style:{width:44,height:44,padding:0,borderRadius:4,overflow:"hidden",cursor:"pointer",border:`2px solid ${i?o.mark:"transparent"}`,background:o.border,opacity:i?1:.7},children:s&&(0,ce.jsx)("img",{src:s,alt:"",style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}})})}function JZ({slide:e,story:t,resolveMedia:r,colors:i,strings:n}){let a=(e?.media??[]).filter(c=>Object.prototype.hasOwnProperty.call(t.media,c.ref)),[o,s]=(0,He.useState)(0),l=a[Math.min(o,a.length-1)],u=[e?.date?.text,e?.place?.name].filter(Boolean).join(" \xB7 ");return(0,ce.jsxs)(ce.Fragment,{children:[l&&(0,ce.jsx)(KZ,{mediaKey:l.ref,item:t.media[l.ref],caption:l.caption,credit:l.credit,resolveMedia:r,colors:i}),a.length>1&&(0,ce.jsx)("div",{style:{display:"flex",gap:6,flexWrap:"wrap",justifyContent:"center"},children:a.map((c,h)=>(0,ce.jsx)(QZ,{mediaKey:c.ref,item:t.media[c.ref],label:n.photoOf(h+1,a.length),selected:l===c,onSelect:()=>s(h),resolveMedia:r,colors:i},`${h}:${c.ref}`))}),(0,ce.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"center",maxWidth:640,textAlign:"center"},children:[u&&(0,ce.jsx)("div",{dir:"auto",style:{fontSize:14,color:i.muted},children:u}),e?.title&&(0,ce.jsx)("div",{dir:"auto",style:{fontSize:20,fontWeight:700,color:i.text},children:e.title}),e?.text&&(0,ce.jsx)("div",{children:(0,ce.jsx)(XZ,{text:e.text,colors:i})})]})]})}function Oc({label:e,onClick:t,disabled:r,size:i,children:n,style:a}){return(0,ce.jsx)("button",{type:"button","aria-label":e,title:e,onClick:t,disabled:r,style:{width:i,height:i,borderRadius:"50%",border:"none",background:"#25262b",color:"#ffffff",fontSize:i>=48?22:18,cursor:r?"default":"pointer",opacity:r?.35:.8,display:"flex",alignItems:"center",justifyContent:"center",padding:0,fontFamily:"inherit",...a},children:n})}function i8({index:e,total:t,onPrev:r,onNext:i,variant:n,strings:a,colors:o}){if(n==="edge"){let s={position:"absolute",top:"50%",transform:"translateY(-50%)",zIndex:2};return(0,ce.jsxs)(ce.Fragment,{children:[(0,ce.jsx)(Oc,{label:a.previous,size:56,disabled:e===0,onClick:r,style:{...s,left:24},children:"\u2190"}),(0,ce.jsx)(Oc,{label:a.next,size:56,disabled:e===t-1,onClick:i,style:{...s,right:24},children:"\u2192"})]})}return(0,ce.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:16,marginTop:16},children:[(0,ce.jsx)(Oc,{label:a.previous,size:34,disabled:e===0,onClick:r,children:"\u2190"}),(0,ce.jsxs)("span",{style:{fontSize:14,color:o.muted},children:[e+1," / ",t]}),(0,ce.jsx)(Oc,{label:a.next,size:34,disabled:e===t-1,onClick:i,children:"\u2192"})]})}function M2({story:e,resolveMedia:t,dark:r=!1,colors:i,strings:n,onClose:a,keyboard:o=!0,onSlideChange:s,renderMapModeControl:l,brand:u,actions:c,initialSlide:h=0}){let p=(0,He.useMemo)(()=>({..._2(r),...i}),[r,i]),d=(0,He.useMemo)(()=>({...E2(e.language,typeof navigator>"u"?void 0:navigator.language),...n}),[e.language,n]),f=(0,He.useRef)(null),m=e.slides,[_,g]=(0,He.useState)(h),y=m[_];(0,He.useEffect)(()=>{g(Math.min(Math.max(h,0),Math.max(m.length-1,0)))},[e,h,m.length]);let v=(0,He.useMemo)(()=>{let ae=[];return m.forEach((oe,$e)=>{let qe=Hf(oe.date);qe!==null&&ae.push({index:$e,year:qe})}),ae},[m]),x=v.length>=2,[b,w]=(0,He.useState)(()=>YZ(e)),[T,S]=(0,He.useState)(()=>new Date().getFullYear()),E=Hf(y?.date),P=E!==null?Math.floor(E):null,D=(0,He.useMemo)(()=>{if(v.length===0){let oe=new Date().getFullYear();return[oe-200,oe]}let ae=v.map(oe=>oe.year);return[Math.floor(Math.min(...ae)),Math.ceil(Math.max(...ae))]},[v]),F=(0,He.useRef)(!1);(0,He.useEffect)(()=>{b==="historical"&&!F.current&&S(P??D[1]),F.current=b==="historical"},[b,P,D]);let I=b==="standard"?null:b==="auto"?P:T,C=()=>g(ae=>Math.max(ae-1,0)),A=()=>g(ae=>Math.min(ae+1,m.length-1)),M=(0,He.useRef)(s);M.current=s,(0,He.useEffect)(()=>{M.current?.(_)},[_]),(0,He.useEffect)(()=>{if(!o)return;let ae=o==="focus"?f.current:window;if(!ae)return;function oe($e){let qe=$e.key,mt=$e.target;mt&&(mt.tagName==="INPUT"||mt.tagName==="TEXTAREA"||mt.isContentEditable)||(qe==="ArrowRight"&&g(Et=>Math.min(Et+1,m.length-1)),qe==="ArrowLeft"&&g(Et=>Math.max(Et-1,0)))}return ae.addEventListener("keydown",oe),()=>ae.removeEventListener("keydown",oe)},[o,m.length]);let L=(0,He.useRef)(null),j={onTouchStart:ae=>{let oe=ae.touches[0];L.current=ae.touches.length===1?{x:oe.clientX,y:oe.clientY}:null},onTouchEnd:ae=>{let oe=L.current;L.current=null;let $e=ae.changedTouches[0];if(!oe||!$e)return;let qe=$e.clientX-oe.x,mt=$e.clientY-oe.y;Math.abs(qe)<50||Math.abs(qe)<Math.abs(mt)*1.5||(qe<0?A():C())}},O=(0,He.useMemo)(()=>LD(m.map(ae=>ae.place)),[m]),Y=(0,He.useMemo)(()=>({key:y?.id??String(_),place:y?.place,overview:_===0&&!Yn(y?.place)?O:null}),[y,_,O]),ue=(0,He.useMemo)(()=>{if(e.presentation?.basemap==="none")return null;for(let ae of m){let oe=Yn(ae.place);if(oe)return oe}return null},[e,m]),pe={mode:b,onModeChange:w,autoYear:P,year:T,onYearChange:S,yearBounds:D},de=(0,He.useMemo)(()=>ae=>{let oe=Object.prototype.hasOwnProperty.call(e.media,ae)?e.media[ae]:void 0;return oe?t(ae,oe):Promise.resolve(null)},[e,t]),je=(0,ce.jsx)(JZ,{slide:y,story:e,resolveMedia:t,colors:p,strings:d},y?.id??_),Se=x&&(0,ce.jsx)(t8,{points:v,currentIndex:_,onSelect:g,colors:p});return(0,ce.jsxs)("div",{ref:f,lang:e.language,tabIndex:o==="focus"?0:void 0,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",background:p.surface,color:p.text},children:[(0,ce.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:dl,zIndex:3,background:r?"rgba(20,20,20,0.55)":"rgba(255,255,255,0.55)"}}),(0,ce.jsxs)("div",{dir:"auto",style:{position:"absolute",top:0,left:20,height:dl,maxWidth:"26%",zIndex:3,display:"flex",alignItems:"center",gap:10,fontWeight:600},children:[u&&(0,ce.jsx)("span",{style:{flex:"none",display:"flex"},children:u}),(0,ce.jsx)("span",{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title})]}),ue&&(0,ce.jsx)("div",{style:{position:"absolute",top:0,left:0,right:0,height:dl,zIndex:3,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:(0,ce.jsx)("div",{style:{pointerEvents:"auto"},children:l?l(pe):(0,ce.jsx)(b2,{...pe,strings:d,colors:p})})}),c&&(0,ce.jsx)("div",{style:{position:"absolute",top:0,right:a?60:12,height:dl,zIndex:3,display:"flex",alignItems:"center",gap:8},children:c}),a&&(0,ce.jsx)(Oc,{label:d.close,size:36,onClick:a,style:{position:"absolute",top:10,right:12,zIndex:3},children:"\xD7"}),ue?(0,ce.jsxs)("div",{style:{position:"absolute",inset:0},children:[(0,ce.jsx)(JD,{initialCenter:ue,current:Y,dark:r,colors:p,panelFraction:r8,ohmYear:I,resolveMedia:de}),(0,ce.jsx)("div",{style:{position:"absolute",top:0,bottom:0,right:0,width:`${r8*100}%`,zIndex:1,padding:`${dl}px 32px ${x?Bc:32}px`,boxSizing:"border-box",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:16,overflowY:"auto",background:`linear-gradient(to right, transparent 0%, ${p.panel} 22%)`},...j,children:je}),(0,ce.jsx)(i8,{index:_,total:m.length,onPrev:C,onNext:A,variant:"edge",strings:d,colors:p}),Se]}):(0,ce.jsxs)("div",{style:{position:"absolute",inset:0,overflowY:"auto",boxSizing:"border-box",padding:`${dl+16}px 24px ${x?Bc+16:24}px`,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:16},...j,children:[je,(0,ce.jsx)(i8,{index:_,total:m.length,onPrev:C,onNext:A,variant:"inline",strings:d,colors:p}),Se]})]})}var Pi=ur(Xi(),1),I2="Gramps Connect Story Viewer",n8="https://dsblank.github.io/gramps-connect-stories/";function a8({size:e=24}){return(0,Pi.jsxs)("svg",{viewBox:"0 0 64 64",width:e,height:e,"aria-hidden":"true",focusable:"false",children:[(0,Pi.jsx)("rect",{width:"64",height:"64",rx:"15",fill:"#1866ba"}),(0,Pi.jsxs)("g",{transform:"translate(9.6 9.6) scale(0.7)",children:[(0,Pi.jsx)("path",{d:"M25 32h7M32 15v34M32 15h7M32 49h7",fill:"none",stroke:"#fff",strokeWidth:"5",strokeLinecap:"round"}),(0,Pi.jsxs)("g",{fill:"#fff",children:[(0,Pi.jsx)("rect",{x:"1",y:"24",width:"24",height:"16",rx:"4"}),(0,Pi.jsx)("rect",{x:"39",y:"7",width:"24",height:"16",rx:"4"}),(0,Pi.jsx)("rect",{x:"39",y:"41",width:"24",height:"16",rx:"4"})]})]})]})}function k2({href:e=n8,target:t="_blank",size:r=24}){return(0,Pi.jsx)("a",{href:e,target:t,rel:t==="_blank"?"noopener":void 0,title:I2,"aria-label":I2,style:{display:"flex",lineHeight:0,borderRadius:6},children:(0,Pi.jsx)(a8,{size:r})})}function eH(){let e=new URL("./maplibre-gl-worker.mjs",import.meta.url);if(e.origin===location.origin)Jv(e.href);else{let t=new Blob([`import ${JSON.stringify(e.href)};`],{type:"text/javascript"});Jv(URL.createObjectURL(t))}}var tH=`
|
|
827
827
|
:host { display: block; position: relative; height: 480px; overflow: hidden; font-family: system-ui, sans-serif; }
|