@openremote/or-map 1.31.1 → 1.32.0-snapshot.20260929083723

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.
@@ -814,7 +814,7 @@ uniform ${i} ${r} u_${o};
814
814
  `),x=y.concat(ne.prelude.vertexSource,s.vertexSource,n.vertexSource).join(`
815
815
  `),F=d.createShader(d.FRAGMENT_SHADER);if(d.isContextLost()){this.failedToCreate=!0;return}d.shaderSource(F,v),d.compileShader(F),d.attachShader(this.program,F);let w=d.createShader(d.VERTEX_SHADER);if(d.isContextLost()){this.failedToCreate=!0;return}d.shaderSource(w,x),d.compileShader(w),d.attachShader(this.program,w),this.attributes={};let C={};if(this.numAttributes=m.length,d.linkProgram(this.program),!d.getProgramParameter(this.program,d.LINK_STATUS)){if(d.isContextLost()){this.failedToCreate=!0;return}throw d.getShaderParameter(F,d.COMPILE_STATUS)?d.getShaderParameter(w,d.COMPILE_STATUS)?Error(`Program failed to link: ${d.getProgramInfoLog(this.program)}`):Error(`Could not compile vertex shader: ${d.getShaderInfoLog(w)}`):Error(`Could not compile fragment shader: ${d.getShaderInfoLog(F)}`)}!function(t,n){for(let[i,r]of Object.entries(n4)){let o=t.getUniformBlockIndex(n,i);o!==t.INVALID_INDEX&&t.uniformBlockBinding(n,o,r)}}(d,this.program);let A=function(t,n){let i=new Set([t.INT,t.INT_VEC2,t.INT_VEC3,t.INT_VEC4,t.UNSIGNED_INT,t.UNSIGNED_INT_VEC2,t.UNSIGNED_INT_VEC3,t.UNSIGNED_INT_VEC4]),r=new Set,o=t.getProgramParameter(n,t.ACTIVE_ATTRIBUTES);for(let a=0;a<o;a++){let o=t.getActiveAttrib(n,a);o&&i.has(o.type)&&r.add(o.name)}return r}(d,this.program);for(let t of m){if(!t)continue;let n=d.getAttribLocation(this.program,t);n>=0&&(this.attributes[t]={location:n,isInteger:A.has(t)})}for(let t of(d.deleteShader(w),d.deleteShader(F),_))if(t&&!C[t]){let n=d.getUniformLocation(this.program,t);n&&(C[t]=n)}this.fixedUniforms=r(t,C),this.terrainUniforms=((t,n)=>({u_depth:new E.At(t,n.u_depth),u_terrain:new E.At(t,n.u_terrain)}))(t,C),this.binderUniforms=i?i.getUniforms(t,C):[]}draw(t,n,i,r,o,a,s,l,c,d,u,h,m,p,f,b,g,_,y){var v,x;let F,w=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(o),t.setCullFace(a),l){let n;for(let n in t.activeTexture.set(w.TEXTURE2),w.bindTexture(w.TEXTURE_2D,l.depthTexture),t.activeTexture.set(w.TEXTURE3),w.bindTexture(w.TEXTURE_2D,l.texture),this.terrainUniforms)this.terrainUniforms[n].set(l[n]);v=t.terrainUniformBuffer,(n=v.pending).set(l.u_terrain_matrix,ii.u_terrain_matrix),n.set(l.u_terrain_unpack,ii.u_terrain_unpack),n[ii.u_terrain_dim]=l.u_terrain_dim,n[ii.u_terrain_exaggeration]=l.u_terrain_exaggeration,v.upload()}if(c&&(x=t.projectionUniformBuffer,(F=x.pending).set(c.mainMatrix,ie.u_projection_matrix),F.set(c.fallbackMatrix,ie.u_projection_fallback_matrix),F.set(c.tileMercatorCoords,ie.u_projection_tile_mercator_coords),F.set(c.clippingPlane,ie.u_projection_clipping_plane),F[ie.u_projection_transition]=c.projectionTransition,x.pendingWords[ie.u_projection_clip_antimeridian]=+!!c.clipAntimeridian,x.upload()),s)for(let t in this.fixedUniforms)this.fixedUniforms[t].set(s[t]);b&&b.setUniforms(t,this.binderUniforms,p,{zoom:f});let E=0;switch(n){case w.LINES:E=2;break;case w.TRIANGLES:E=3;break;case w.LINE_STRIP:E=1}for(let i of m.get())i.vaos||={},i.vaos[d]||=new n2,i.vaos[d].bind(t,this,u,b?b.getPaintVertexBuffers():[],h,i.vertexOffset,g,_,y),w.drawElements(n,i.primitiveLength*E,w.UNSIGNED_SHORT,i.primitiveOffset*E*2)}};function ia(t,n,i){let r=1/(0,E.Lr)(i,1,n.transform.tileZoom),o=2**i.tileID.overscaledZ,a=i.tileSize*2**n.transform.tileZoom/o,s=a*(i.tileID.canonical.x+i.tileID.wrap*o),l=a*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,l>>16],u_pixel_coord_lower:[65535&s,65535&l]}}let is=(t,n,i,r)=>{let o=t.style.light,a=o.getCartesianPosition(),s=(0,E.Ni)();"viewport"===o.properties.get("anchor")&&(0,E.Pi)(s,t.transform.bearingInRadians),(0,E.pi)(a,a,s);let l=t.transform.transformLightDirection(a),c=o.properties.get("color");return{u_lightpos:a,u_lightpos_globe:l,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:i,u_fill_translate:r}},il=(t,n,i,r,o,a,s)=>(0,E.tr)(is(t,n,i,r),ia(a,t,s),{u_height_factor:-(2**o.overscaledZ)/s.tileSize/8}),ic=(t,n,i,r,o)=>(0,E.tr)(ia(n,t,i),{u_fill_translate:r,u_sdf_pattern:+!!o}),id=t=>({u_fill_translate:t}),iu=t=>({u_fill_translate:t}),ih=(t,n,i,r,o)=>ic(t,n,i,r,o),im=(t,n,i,r,o)=>{let a=t.transform,s,l,c=0;if("map"===i.paint.get("circle-pitch-alignment")){let t=(0,E.Lr)(n,1,a.zoom);s=!0,l=[t,t],c=t/(8192*2**n.tileID.overscaledZ)*2*Math.PI*o}else s=!1,l=a.pixelsToGLUnits;return{u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_pitch_with_map:+s,u_extrude_scale:l,u_globe_extrude_scale:c,u_translate:r}},ip=(t,n=1)=>({u_color:t,u_overlay:0,u_overlay_scale:n}),ib=(t,n,i,r)=>{let o=(0,E.Lr)(t,1,n)/(8192*2**t.tileID.overscaledZ)*2*Math.PI*r;return{u_extrude_scale:(0,E.Lr)(t,1,n),u_intensity:i,u_globe_extrude_scale:o}},ig=(t,n,i,r)=>{let o=(0,E.yi)();return(0,E.Ei)(o,0,t.width,t.height,0,0,1),{u_matrix:o,u_image:i,u_color_ramp:r,u_opacity:n.paint.get("heatmap-opacity")}},i_=(t,n,i)=>{var r;let o,a,s=i.paint.get("hillshade-accent-color"),l;switch(i.paint.get("hillshade-method")){case"basic":l=4;break;case"combined":l=1;break;case"igor":l=2;break;case"multidirectional":l=3;break;default:l=0}let c=i.getIlluminationProperties();for(let n=0;n<c.directionRadians.length;n++)"viewport"===i.paint.get("hillshade-illumination-anchor")&&(c.directionRadians[n]+=t.transform.bearingInRadians);return{u_image:0,u_latrange:(r=n.tileID,o=2**r.canonical.z,a=r.canonical.y,[new E.et(0,a/o).toLngLat().lat,new E.et(0,(a+1)/o).toLngLat().lat]),u_exaggeration:i.paint.get("hillshade-exaggeration"),u_altitudes:c.altitudeRadians,u_azimuths:c.directionRadians,u_accent:s,u_method:l,u_highlights:c.highlightColor,u_shadows:c.shadowColor}},iy=(t,n)=>{let i=n.stride,r=(0,E.yi)();return(0,E.Ei)(r,0,8192,-8192,0,0,1),(0,E.Mi)(r,r,[0,-8192,0]),{u_matrix:r,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:n.getUnpackVector()}},iv=(t,n,i=0)=>({u_image:0,u_unpack:n.getUnpackVector(),u_dimension:[n.stride,n.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:i,u_opacity:t.paint.get("color-relief-opacity")}),ix=(t,n,i,r)=>{let o=t.transform;return{u_translation:ik(t,n,i),u_ratio:r/(0,E.Lr)(n,1,o.zoom)}},iF=(t,n,i,r,o)=>(0,E.tr)(ix(t,n,i,r),{u_image:0,u_image_height:o}),iw=(t,n,i,r,o)=>{let a=t.transform,s=iA(n,a);return{u_translation:ik(t,n,i),u_texsize:n.imageAtlasTexture.size,u_ratio:r/(0,E.Lr)(n,1,a.zoom),u_image:0,u_scale:[s,o.fromScale,o.toScale],u_fade:o.t}},iE=(t,n,i,r,o)=>{let a=iA(n,t.transform);return(0,E.tr)(ix(t,n,i,r),{u_tileratio:a,u_crossfade_from:o.fromScale,u_crossfade_to:o.toScale,u_image:0,u_mix:o.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})},iC=(t,n,i,r,o,a)=>{let s=iA(n,t.transform);return(0,E.tr)(ix(t,n,i,r),{u_image:0,u_image_height:a,u_tileratio:s,u_crossfade_from:o.fromScale,u_crossfade_to:o.toScale,u_image_dash:1,u_mix:o.t,u_lineatlas_width:t.lineAtlas.width,u_lineatlas_height:t.lineAtlas.height})};function iA(t,n){return 1/(0,E.Lr)(t,1,n.tileZoom)}function ik(t,n,i){return(0,E.Mr)(t.transform,n,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}let iT=(t,n,i,r,o,a,s,l,c,d,u,h,m,p,f)=>({u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:n?n.uSizeT:0,u_size:n?n.uSize:0,u_rotate_symbol:+i,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+u,u_pitch_with_map:+r,u_is_along_line:o,u_is_variable_anchor:a,u_texsize:h,u_texture:0,u_translation:d,u_pitched_scale:m,u_is_offset:p,u_height_anchor_ground:+f}),iS=(t,n,i,r,o,a,s,l,c,d,u,h,m,p,f,b)=>{let g=s.transform;return(0,E.tr)(iT(t,n,i,r,o,a,s,l,c,d,u,h,p,f,b),{u_gamma_scale:r?Math.cos(g.pitch*Math.PI/180)*g.cameraToCenterDistance:1,u_is_halo:+!!m,u_is_plain:1})},iI=(t,n,i,r,o,a,s,l,c,d,u,h,m,p,f)=>(0,E.tr)(iS(t,n,i,r,o,a,s,l,c,d,!0,u,!0,m,p,f),{u_texsize_icon:h,u_texture_icon:1}),iD=(t,n)=>({u_opacity:t,u_color:n}),iP=(t,n,i,r,o)=>(0,E.tr)(function(t,n,i,r){let o=i.patternAtlas.getPattern(t.from.toString()),a=i.patternAtlas.getPattern(t.to.toString()),{width:s,height:l}=i.patternAtlas.getPixelSize(),c=2**r.tileID.overscaledZ,d=r.tileSize*2**i.transform.tileZoom/c,u=d*(r.tileID.canonical.x+r.tileID.wrap*c),h=d*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:o.tl,u_pattern_br_a:o.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[s,l],u_mix:n.t,u_pattern_size_a:o.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:n.fromScale,u_scale_b:n.toScale,u_tile_units_to_pixels:1/(0,E.Lr)(r,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(i,o,n,r),{u_opacity:t}),iR=(t,n)=>({}),iO={fillExtrusion:(t,n)=>({u_lightpos:new E.Mt(t,n.u_lightpos),u_lightpos_globe:new E.Mt(t,n.u_lightpos_globe),u_lightintensity:new E.kt(t,n.u_lightintensity),u_lightcolor:new E.Mt(t,n.u_lightcolor),u_vertical_gradient:new E.kt(t,n.u_vertical_gradient),u_opacity:new E.kt(t,n.u_opacity),u_fill_translate:new E.jt(t,n.u_fill_translate)}),fillExtrusionPattern:(t,n)=>({u_lightpos:new E.Mt(t,n.u_lightpos),u_lightpos_globe:new E.Mt(t,n.u_lightpos_globe),u_lightintensity:new E.kt(t,n.u_lightintensity),u_lightcolor:new E.Mt(t,n.u_lightcolor),u_vertical_gradient:new E.kt(t,n.u_vertical_gradient),u_height_factor:new E.kt(t,n.u_height_factor),u_opacity:new E.kt(t,n.u_opacity),u_fill_translate:new E.jt(t,n.u_fill_translate),u_image:new E.At(t,n.u_image),u_texsize:new E.jt(t,n.u_texsize),u_pixel_coord_upper:new E.jt(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new E.jt(t,n.u_pixel_coord_lower),u_scale:new E.Mt(t,n.u_scale),u_fade:new E.kt(t,n.u_fade)}),fill:(t,n)=>({u_fill_translate:new E.jt(t,n.u_fill_translate)}),fillPattern:(t,n)=>({u_image:new E.At(t,n.u_image),u_texsize:new E.jt(t,n.u_texsize),u_pixel_coord_upper:new E.jt(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new E.jt(t,n.u_pixel_coord_lower),u_scale:new E.Mt(t,n.u_scale),u_fade:new E.kt(t,n.u_fade),u_sdf_pattern:new E.At(t,n.u_sdf_pattern),u_fill_translate:new E.jt(t,n.u_fill_translate)}),fillOutline:(t,n)=>({u_fill_translate:new E.jt(t,n.u_fill_translate)}),fillOutlinePattern:(t,n)=>({u_image:new E.At(t,n.u_image),u_texsize:new E.jt(t,n.u_texsize),u_pixel_coord_upper:new E.jt(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new E.jt(t,n.u_pixel_coord_lower),u_scale:new E.Mt(t,n.u_scale),u_fade:new E.kt(t,n.u_fade),u_sdf_pattern:new E.At(t,n.u_sdf_pattern),u_fill_translate:new E.jt(t,n.u_fill_translate)}),circle:(t,n)=>({u_scale_with_map:new E.At(t,n.u_scale_with_map),u_pitch_with_map:new E.At(t,n.u_pitch_with_map),u_extrude_scale:new E.jt(t,n.u_extrude_scale),u_globe_extrude_scale:new E.kt(t,n.u_globe_extrude_scale),u_translate:new E.jt(t,n.u_translate)}),collisionBox:iR,collisionCircle:iR,debug:(t,n)=>({u_color:new E.Pt(t,n.u_color),u_overlay:new E.At(t,n.u_overlay),u_overlay_scale:new E.kt(t,n.u_overlay_scale)}),depth:iR,clippingMask:iR,heatmap:(t,n)=>({u_extrude_scale:new E.kt(t,n.u_extrude_scale),u_intensity:new E.kt(t,n.u_intensity),u_globe_extrude_scale:new E.kt(t,n.u_globe_extrude_scale)}),heatmapTexture:(t,n)=>({u_matrix:new E.Lt(t,n.u_matrix),u_image:new E.At(t,n.u_image),u_color_ramp:new E.At(t,n.u_color_ramp),u_opacity:new E.kt(t,n.u_opacity)}),hillshade:(t,n)=>({u_image:new E.At(t,n.u_image),u_latrange:new E.jt(t,n.u_latrange),u_exaggeration:new E.kt(t,n.u_exaggeration),u_altitudes:new E.It(t,n.u_altitudes),u_azimuths:new E.It(t,n.u_azimuths),u_accent:new E.Pt(t,n.u_accent),u_method:new E.At(t,n.u_method),u_shadows:new E.Ft(t,n.u_shadows),u_highlights:new E.Ft(t,n.u_highlights)}),hillshadePrepare:(t,n)=>({u_matrix:new E.Lt(t,n.u_matrix),u_image:new E.At(t,n.u_image),u_dimension:new E.jt(t,n.u_dimension),u_zoom:new E.kt(t,n.u_zoom),u_unpack:new E.Nt(t,n.u_unpack)}),colorRelief:(t,n)=>({u_image:new E.At(t,n.u_image),u_unpack:new E.Nt(t,n.u_unpack),u_dimension:new E.jt(t,n.u_dimension),u_elevation_stops:new E.At(t,n.u_elevation_stops),u_color_stops:new E.At(t,n.u_color_stops),u_color_ramp_size:new E.At(t,n.u_color_ramp_size),u_opacity:new E.kt(t,n.u_opacity)}),line:(t,n)=>({u_translation:new E.jt(t,n.u_translation),u_ratio:new E.kt(t,n.u_ratio)}),lineGradient:(t,n)=>({u_translation:new E.jt(t,n.u_translation),u_ratio:new E.kt(t,n.u_ratio),u_image:new E.At(t,n.u_image),u_image_height:new E.kt(t,n.u_image_height)}),linePattern:(t,n)=>({u_translation:new E.jt(t,n.u_translation),u_texsize:new E.jt(t,n.u_texsize),u_ratio:new E.kt(t,n.u_ratio),u_image:new E.At(t,n.u_image),u_scale:new E.Mt(t,n.u_scale),u_fade:new E.kt(t,n.u_fade)}),lineSDF:(t,n)=>({u_translation:new E.jt(t,n.u_translation),u_ratio:new E.kt(t,n.u_ratio),u_image:new E.At(t,n.u_image),u_mix:new E.kt(t,n.u_mix),u_tileratio:new E.kt(t,n.u_tileratio),u_crossfade_from:new E.kt(t,n.u_crossfade_from),u_crossfade_to:new E.kt(t,n.u_crossfade_to),u_lineatlas_width:new E.kt(t,n.u_lineatlas_width),u_lineatlas_height:new E.kt(t,n.u_lineatlas_height)}),lineGradientSDF:(t,n)=>({u_translation:new E.jt(t,n.u_translation),u_ratio:new E.kt(t,n.u_ratio),u_image:new E.At(t,n.u_image),u_image_height:new E.kt(t,n.u_image_height),u_tileratio:new E.kt(t,n.u_tileratio),u_crossfade_from:new E.kt(t,n.u_crossfade_from),u_crossfade_to:new E.kt(t,n.u_crossfade_to),u_image_dash:new E.At(t,n.u_image_dash),u_mix:new E.kt(t,n.u_mix),u_lineatlas_width:new E.kt(t,n.u_lineatlas_width),u_lineatlas_height:new E.kt(t,n.u_lineatlas_height)}),layerOpacity:(t,n)=>({u_image:new E.At(t,n.u_image),u_opacity:new E.kt(t,n.u_opacity)}),raster:(t,n)=>({u_tl_parent:new E.jt(t,n.u_tl_parent),u_scale_parent:new E.kt(t,n.u_scale_parent),u_buffer_scale:new E.kt(t,n.u_buffer_scale),u_image_warp:new E.Mt(t,n.u_image_warp),u_fade_t:new E.kt(t,n.u_fade_t),u_opacity:new E.kt(t,n.u_opacity),u_image0:new E.At(t,n.u_image0),u_image1:new E.At(t,n.u_image1),u_brightness_low:new E.kt(t,n.u_brightness_low),u_brightness_high:new E.kt(t,n.u_brightness_high),u_saturation_factor:new E.kt(t,n.u_saturation_factor),u_contrast_factor:new E.kt(t,n.u_contrast_factor),u_spin_weights:new E.Mt(t,n.u_spin_weights),u_coords_top:new E.Nt(t,n.u_coords_top),u_coords_bottom:new E.Nt(t,n.u_coords_bottom)}),symbolIcon:(t,n)=>({u_is_size_zoom_constant:new E.At(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new E.At(t,n.u_is_size_feature_constant),u_size_t:new E.kt(t,n.u_size_t),u_size:new E.kt(t,n.u_size),u_rotate_symbol:new E.At(t,n.u_rotate_symbol),u_label_plane_matrix:new E.Lt(t,n.u_label_plane_matrix),u_coord_matrix:new E.Lt(t,n.u_coord_matrix),u_is_text:new E.At(t,n.u_is_text),u_pitch_with_map:new E.At(t,n.u_pitch_with_map),u_is_along_line:new E.At(t,n.u_is_along_line),u_is_variable_anchor:new E.At(t,n.u_is_variable_anchor),u_texsize:new E.jt(t,n.u_texsize),u_texture:new E.At(t,n.u_texture),u_translation:new E.jt(t,n.u_translation),u_pitched_scale:new E.kt(t,n.u_pitched_scale),u_is_offset:new E.At(t,n.u_is_offset),u_height_anchor_ground:new E.At(t,n.u_height_anchor_ground)}),symbolSDF:(t,n)=>({u_is_size_zoom_constant:new E.At(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new E.At(t,n.u_is_size_feature_constant),u_size_t:new E.kt(t,n.u_size_t),u_size:new E.kt(t,n.u_size),u_rotate_symbol:new E.At(t,n.u_rotate_symbol),u_label_plane_matrix:new E.Lt(t,n.u_label_plane_matrix),u_coord_matrix:new E.Lt(t,n.u_coord_matrix),u_is_text:new E.At(t,n.u_is_text),u_pitch_with_map:new E.At(t,n.u_pitch_with_map),u_is_along_line:new E.At(t,n.u_is_along_line),u_is_variable_anchor:new E.At(t,n.u_is_variable_anchor),u_texsize:new E.jt(t,n.u_texsize),u_texture:new E.At(t,n.u_texture),u_gamma_scale:new E.kt(t,n.u_gamma_scale),u_is_halo:new E.At(t,n.u_is_halo),u_is_plain:new E.At(t,n.u_is_plain),u_translation:new E.jt(t,n.u_translation),u_pitched_scale:new E.kt(t,n.u_pitched_scale),u_is_offset:new E.At(t,n.u_is_offset),u_height_anchor_ground:new E.At(t,n.u_height_anchor_ground)}),symbolTextAndIcon:(t,n)=>({u_is_size_zoom_constant:new E.At(t,n.u_is_size_zoom_constant),u_is_size_feature_constant:new E.At(t,n.u_is_size_feature_constant),u_size_t:new E.kt(t,n.u_size_t),u_size:new E.kt(t,n.u_size),u_rotate_symbol:new E.At(t,n.u_rotate_symbol),u_label_plane_matrix:new E.Lt(t,n.u_label_plane_matrix),u_coord_matrix:new E.Lt(t,n.u_coord_matrix),u_is_text:new E.At(t,n.u_is_text),u_pitch_with_map:new E.At(t,n.u_pitch_with_map),u_is_along_line:new E.At(t,n.u_is_along_line),u_is_variable_anchor:new E.At(t,n.u_is_variable_anchor),u_texsize:new E.jt(t,n.u_texsize),u_texsize_icon:new E.jt(t,n.u_texsize_icon),u_texture:new E.At(t,n.u_texture),u_texture_icon:new E.At(t,n.u_texture_icon),u_gamma_scale:new E.kt(t,n.u_gamma_scale),u_is_halo:new E.At(t,n.u_is_halo),u_translation:new E.jt(t,n.u_translation),u_pitched_scale:new E.kt(t,n.u_pitched_scale),u_is_offset:new E.At(t,n.u_is_offset),u_height_anchor_ground:new E.At(t,n.u_height_anchor_ground)}),background:(t,n)=>({u_opacity:new E.kt(t,n.u_opacity),u_color:new E.Pt(t,n.u_color)}),backgroundPattern:(t,n)=>({u_opacity:new E.kt(t,n.u_opacity),u_image:new E.At(t,n.u_image),u_pattern_tl_a:new E.jt(t,n.u_pattern_tl_a),u_pattern_br_a:new E.jt(t,n.u_pattern_br_a),u_pattern_tl_b:new E.jt(t,n.u_pattern_tl_b),u_pattern_br_b:new E.jt(t,n.u_pattern_br_b),u_texsize:new E.jt(t,n.u_texsize),u_mix:new E.kt(t,n.u_mix),u_pattern_size_a:new E.jt(t,n.u_pattern_size_a),u_pattern_size_b:new E.jt(t,n.u_pattern_size_b),u_scale_a:new E.kt(t,n.u_scale_a),u_scale_b:new E.kt(t,n.u_scale_b),u_pixel_coord_upper:new E.jt(t,n.u_pixel_coord_upper),u_pixel_coord_lower:new E.jt(t,n.u_pixel_coord_lower),u_tile_units_to_pixels:new E.kt(t,n.u_tile_units_to_pixels)}),terrain:(t,n)=>({u_texture:new E.At(t,n.u_texture),u_ele_delta:new E.kt(t,n.u_ele_delta),u_fog_matrix:new E.Lt(t,n.u_fog_matrix),u_fog_color:new E.Pt(t,n.u_fog_color),u_fog_ground_blend:new E.kt(t,n.u_fog_ground_blend),u_fog_ground_blend_opacity:new E.kt(t,n.u_fog_ground_blend_opacity),u_horizon_color:new E.Pt(t,n.u_horizon_color),u_horizon_fog_blend:new E.kt(t,n.u_horizon_fog_blend),u_is_globe_mode:new E.kt(t,n.u_is_globe_mode)}),terrainDepth:(t,n)=>({u_ele_delta:new E.kt(t,n.u_ele_delta)}),atmosphere:(t,n)=>({u_sun_pos:new E.Mt(t,n.u_sun_pos),u_atmosphere_blend:new E.kt(t,n.u_atmosphere_blend),u_globe_position:new E.Mt(t,n.u_globe_position),u_globe_radius:new E.kt(t,n.u_globe_radius),u_inv_proj_matrix:new E.Lt(t,n.u_inv_proj_matrix)}),sky:(t,n)=>({u_sky_color:new E.Pt(t,n.u_sky_color),u_horizon_color:new E.Pt(t,n.u_horizon_color),u_horizon:new E.jt(t,n.u_horizon),u_horizon_normal:new E.jt(t,n.u_horizon_normal),u_sky_horizon_blend:new E.kt(t,n.u_sky_horizon_blend),u_sky_blend:new E.kt(t,n.u_sky_blend),u_inv_proj_matrix:new E.Lt(t,n.u_inv_proj_matrix),u_globe_position:new E.Mt(t,n.u_globe_position),u_globe_radius:new E.kt(t,n.u_globe_radius)})};var iM=class{constructor(t,n,i){this.context=t;let r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||n.freeBufferAfterUpload()}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let n=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),n.bufferSubData(n.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}};let iL={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};var iB=class{constructor(t,n,i,r){this.length=n.length,this.attributes=i,this.itemSize=n.bytesPerElement,this.dynamicDraw=r,this.context=t;let o=t.gl;this.buffer=o.createBuffer(),t.bindVertexBuffer.set(this.buffer),o.bufferData(o.ARRAY_BUFFER,n.arrayBuffer,this.dynamicDraw?o.DYNAMIC_DRAW:o.STATIC_DRAW),this.dynamicDraw||n.freeBufferAfterUpload()}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);let n=this.context.gl;this.bind(),n.bufferSubData(n.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,n){for(let i of this.attributes){let r=n.attributes[i.name];void 0!==r&&t.enableVertexAttribArray(r.location)}}setVertexAttribPointers(t,n,i){for(let r of this.attributes){let o=n.attributes[r.name];if(void 0!==o){let n=r.offset+this.itemSize*(i||0);o.isInteger?t.vertexAttribIPointer(o.location,r.components,t[iL[r.type]],this.itemSize,n):t.vertexAttribPointer(o.location,r.components,t[iL[r.type]],!1,this.itemSize,n)}}}destroy(){let t=this.context.gl;this.buffer&&(t.deleteBuffer(this.buffer),delete this.buffer)}},iz=class{constructor(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this.default}setDefault(){this.set(this.default)}},iN=class extends iz{getDefault(){return E.pn.transparent}set(t){let n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}},iU=class extends iz{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}},ij=class extends iz{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}},iV=class extends iz{getDefault(){return[!0,!0,!0,!0]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}},i$=class extends iz{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}},iq=class extends iz{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}},iG=class extends iz{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let n=this.current;(t.func!==n.func||t.ref!==n.ref||t.mask!==n.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}},iH=class extends iz{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}},iW=class extends iz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.STENCIL_TEST):n.disable(n.STENCIL_TEST),this.current=t,this.dirty=!1}},iY=class extends iz{getDefault(){return[0,1]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}},iX=class extends iz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),this.current=t,this.dirty=!1}},iZ=class extends iz{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}},iK=class extends iz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.BLEND):n.disable(n.BLEND),this.current=t,this.dirty=!1}},iJ=class extends iz{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}},iQ=class extends iz{getDefault(){return E.pn.transparent}set(t){let n=this.current;(t.r!==n.r||t.g!==n.g||t.b!==n.b||t.a!==n.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}},i0=class extends iz{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}},i1=class extends iz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;t?n.enable(n.CULL_FACE):n.disable(n.CULL_FACE),this.current=t,this.dirty=!1}},i2=class extends iz{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}},i3=class extends iz{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}},i5=class extends iz{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}},i4=class extends iz{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}},i6=class extends iz{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let n=this.current;(t[0]!==n[0]||t[1]!==n[1]||t[2]!==n[2]||t[3]!==n[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}},i8=class extends iz{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindFramebuffer(n.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},i7=class extends iz{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindRenderbuffer(n.RENDERBUFFER,t),this.current=t,this.dirty=!1}},i9=class extends iz{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindTexture(n.TEXTURE_2D,t),this.current=t,this.dirty=!1}},re=class extends iz{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.bindBuffer(n.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},rt=class extends iz{getDefault(){return null}set(t){let n=this.gl;n.bindBuffer(n.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},rn=class extends iz{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.bindVertexArray(t),this.current=t,this.dirty=!1)}},ri=class extends iz{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},rr=class extends iz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},ro=class extends iz{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let n=this.gl;n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},ra=class extends iz{constructor(t,n){super(t),this.context=t,this.parent=n}getDefault(){return null}},rs=class extends ra{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},rl=class extends ra{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}},rc=class extends ra{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let n=this.gl;n.framebufferRenderbuffer(n.FRAMEBUFFER,n.DEPTH_STENCIL_ATTACHMENT,n.RENDERBUFFER,t),this.current=t,this.dirty=!1}},rd=class{constructor(t,n,i,r,o){this.context=t,this.width=n,this.height=i;let a=t.gl,s=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new rs(t,s),r)this.depthAttachment=o?new rc(t,s):new rl(t,s);else if(o)throw Error("Stencil cannot be set without depth")}destroy(){let t=this.context.gl,n=this.colorAttachment.get();if(n&&t.deleteTexture(n),this.depthAttachment){let n=this.depthAttachment.get();n&&t.deleteRenderbuffer(n)}t.deleteFramebuffer(this.framebuffer)}};let ru=n8([{name:"u_units_to_pixels",type:"vec2"},{name:"u_world_size",type:"vec2"},{name:"u_camera_to_center_distance",type:"float"},{name:"u_symbol_fade_change",type:"float"},{name:"u_aspect_ratio",type:"float"},{name:"u_device_pixel_ratio",type:"float"},{name:"u_viewport_size",type:"vec2"},{name:"u_pixel_extrude_scale",type:"vec2"},{name:"u_pitch",type:"float"}]),rh=ru.offsets;var rm=class{constructor(t,n,i){this.blendFunction=t,this.blendColor=n,this.mask=i}};rm.Replace=[1,0],rm.disabled=new rm(rm.Replace,E.pn.transparent,[!1,!1,!1,!1]),rm.unblended=new rm(rm.Replace,E.pn.transparent,[!0,!0,!0,!0]),rm.alphaBlended=new rm([1,771],E.pn.transparent,[!0,!0,!0,!0]);var rp=class{constructor(t){this.gl=t,this.clearColor=new iN(this),this.clearDepth=new iU(this),this.clearStencil=new ij(this),this.colorMask=new iV(this),this.depthMask=new i$(this),this.stencilMask=new iq(this),this.stencilFunc=new iG(this),this.stencilOp=new iH(this),this.stencilTest=new iW(this),this.depthRange=new iY(this),this.depthTest=new iX(this),this.depthFunc=new iZ(this),this.blend=new iK(this),this.blendFunc=new iJ(this),this.blendColor=new iQ(this),this.blendEquation=new i0(this),this.cullFace=new i1(this),this.cullFaceSide=new i2(this),this.frontFace=new i3(this),this.program=new i5(this),this.activeTexture=new i4(this),this.viewport=new i6(this),this.bindFramebuffer=new i8(this),this.bindRenderbuffer=new i7(this),this.bindTexture=new i9(this),this.bindVertexBuffer=new re(this),this.bindElementBuffer=new rt(this),this.bindVertexArray=new rn(this),this.pixelStoreUnpack=new ri(this),this.pixelStoreUnpackPremultiplyAlpha=new rr(this),this.pixelStoreUnpackFlipY=new ro(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),t.getExtension("EXT_color_buffer_half_float"),t.getExtension("EXT_color_buffer_float"),this.projectionUniformBuffer=function(t){return new n7(t,n4.ProjectionUBO,n9)}(this),this.terrainUniformBuffer=function(t){return new n7(t,n4.TerrainUBO,it)}(this),this.frameUniformBuffer=function(t){return new n7(t,n4.FrameUBO,ru)}(this)}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0,this.projectionUniformBuffer.bindingDirty=!0,this.terrainUniformBuffer.bindingDirty=!0,this.frameUniformBuffer.bindingDirty=!0}setCustomLayerDefaults(){this.unbindVAO(),this.cullFace.setDefault(),this.activeTexture.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}createIndexBuffer(t,n){return new iM(this,t,n)}createVertexBuffer(t,n,i){return new iB(this,t,n,i)}createRenderbuffer(t,n,i){let r=this.gl,o=r.createRenderbuffer();return this.bindRenderbuffer.set(o),r.renderbufferStorage(r.RENDERBUFFER,t,n,i),this.bindRenderbuffer.set(null),o}createFramebuffer(t,n,i,r){return new rd(this,t,n,i,r)}clear({color:t,depth:n,stencil:i}){let r=this.gl,o=0;t&&(o|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==n&&(o|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),void 0!==i&&(o|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(o)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){(0,E.Jn)(t.blendFunction,rm.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){return this.gl.createVertexArray()}deleteVertexArray(t){this.gl.deleteVertexArray(t)}unbindVAO(){this.bindVertexArray.set(null)}},rf=class{constructor(t,n,i){this.func=t,this.mask=n,this.range=i}};rf.ReadOnly=!1,rf.ReadWrite=!0,rf.disabled=new rf(519,rf.ReadOnly,[0,1]);var rb=class{constructor(t,n,i,r,o,a){this.test=t,this.ref=n,this.mask=i,this.fail=r,this.depthFail=o,this.pass=a}};rb.disabled=new rb({func:519,mask:0},0,0,7680,7680,7680);var rg=class{constructor(t,n,i){this.enable=t,this.mode=n,this.frontFace=i}};function r_(t,n,i,r,o){let a=t.context,s=t.transform,l=a.gl,c=t.useProgram("collisionBox"),d=[],u=0,h=0;for(let m of r){let r=n.getTile(m).getBucket(i);if(!r)continue;let p=o?r.textCollisionBox:r.iconCollisionBox,f=r.collisionCircleArray;f.length>0&&(d.push({circleArray:f,circleOffset:h,coord:m}),u+=f.length/4,h=u),p&&c.draw(a,l.LINES,rf.disabled,rb.disabled,t.colorModeForRenderPass(),rg.disabled,null,t.style.map.terrain?.getTerrainData(m),s.getProjectionData({overscaledTileID:m,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),i.id,p.layoutVertexBuffer,p.indexBuffer,p.segments,null,t.transform.zoom,null,null,p.collisionVertexBuffer)}if(!o||!d.length)return;let p=t.useProgram("collisionCircle"),f=new E.Bt;f.resize(4*u),f._trim();let b=0;for(let t of d)for(let n=0;n<t.circleArray.length/4;n++){let i=4*n,r=t.circleArray[i+0],o=t.circleArray[i+1],a=t.circleArray[i+2],s=t.circleArray[i+3];f.emplace(b++,r,o,a,s,0),f.emplace(b++,r,o,a,s,1),f.emplace(b++,r,o,a,s,2),f.emplace(b++,r,o,a,s,3)}(!m||m.length<2*u)&&(m=function(t){let n=2*t,i=new E.Wt;i.resize(n),i._trim();for(let t=0;t<n;t++){let n=6*t;i.uint16[n+0]=4*t+0,i.uint16[n+1]=4*t+1,i.uint16[n+2]=4*t+2,i.uint16[n+3]=4*t+2,i.uint16[n+4]=4*t+3,i.uint16[n+5]=4*t+0}return i}(u));let g=a.createIndexBuffer(m,!0),_=a.createVertexBuffer(f,E.V.members,!0);for(let n of d)p.draw(a,l.TRIANGLES,rf.disabled,rb.disabled,t.colorModeForRenderPass(),rg.disabled,null,t.style.map.terrain?.getTerrainData(n.coord),null,i.id,_,g,E.Rt.simpleSegment(0,2*n.circleOffset,n.circleArray.length,n.circleArray.length/2),null,t.transform.zoom,null,null,null);_.destroy(),g.destroy()}rg.disabled=new rg(!1,1029,2305),rg.backCCW=new rg(!0,1029,2305),rg.frontCCW=new rg(!0,1028,2305);let ry=(0,E.Ci)(new Float32Array(16));function rv(t,n,i,r,o,a,s,l,c,d,u,h,m){let p=t.context,f=p.gl,b=t.transform,g="map"===l,_="map"===c,y="viewport"!==l&&"point"!==i.layout.get("symbol-placement"),v=g&&!_&&!y,x=!i.layout.get("symbol-sort-key").isConstant(),F=!1,w=t.getDepthModeForSublayer(0,rf.ReadOnly),C=i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"),A=[],k=b.getCircleRadiusCorrection();for(let l of r){let r=n.getTile(l),c=r.getBucket(i);if(!c)continue;let u=o?c.text:c.icon;if(!u?.segments.get().length||!u.hasVisibleVertices)continue;let h=u.programConfigurations.get(i.id),p=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,T=_||0!==b.pitch,S=t.useProgram(c.iconsInText&&o?"symbolTextAndIcon":p?"symbolSDF":"symbolIcon",h),I=(0,E.A)(w,b.zoom),D=t.style.map.terrain?.getTerrainData(l),P,R=[0,0],O,M,L=null,B;if(o){if(O=r.glyphAtlasTexture,M=f.LINEAR,P=r.glyphAtlasTexture.size,c.iconsInText){R=r.imageAtlasTexture.size,L=r.imageAtlasTexture;let n="composite"===w.kind||"camera"===w.kind;B=T||t.options.rotating||t.options.zooming||n?f.LINEAR:f.NEAREST}}else{let n=1!==i.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;O=r.imageAtlasTexture,M=p||t.options.rotating||t.options.zooming||n||T?f.LINEAR:f.NEAREST,P=r.imageAtlasTexture.size}let z=(0,E.Lr)(r,1,t.transform.zoom),N=ty(g,t.transform,z),U=function(t,n,i,r){if(t){let t=(0,E.yi)();if(!n){let{vecSouth:n,vecEast:r}=tv(i);t[0]=r[0],t[1]=r[1],t[4]=n[0],t[5]=n[1]}return(0,E.ji)(t,t,[r,r,1]),t}return i.pixelsToClipSpaceMatrix}(_,g,t.transform,z),j=(0,E.Mr)(b,r,a,s),V=b.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!m,applyTerrainMatrix:!0}),$=C&&c.hasTextData(),q="none"!==i.layout.get("icon-text-fit")&&$&&c.hasIconData(),G=i._unevaluatedLayout.hasValue("icon-offset"),H="ground"===i.layout.get("symbol-height-anchor");if(y){let n=(0,E.yi)();!function(t,n){let i=1/(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]),r=1/(n[8]*n[8]+n[9]*n[9]+n[10]*n[10]),o=n[0]*i,a=n[4]*i,s=n[8]*r,l=n[1]*i,c=n[5]*i,d=n[9]*r,u=n[2]*i,h=n[6]*i,m=n[10]*r;t[0]=o,t[1]=a,t[2]=s,t[4]=l,t[5]=c,t[6]=d,t[8]=u,t[9]=h,t[10]=m;let p=n[12],f=n[13],b=n[14];t[12]=-o*p-l*f-u*b,t[13]=-a*p-c*f-h*b,t[14]=-s*p-d*f-m*b,t[3]=0,t[7]=0,t[11]=0,t[15]=1}(n,N);let r=t.style.map.terrain?(n,i)=>t.style.map.terrain.getElevation(l,n,i):void 0;!function(t,n,i,r,o,a,s,l,c,d,u,h,m){let p=i?t.textSizeData:t.iconSizeData,f=(0,E.A)(p,n.transform.zoom),b=[256/n.width*2+1,256/n.height*2+1],g=i?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;g.clear();let _=t.lineVertexArray,y=i?t.text.placedSymbolArray:t.icon.placedSymbolArray,v=n.transform.width/n.transform.height,x=!1;for(let i=0;i<y.length;i++){var F;let w=y.get(i);if(w.hidden||2===w.writingMode&&!x){tO(w.numGlyphs,g);continue}x=!1;let C=new E.Ri(w.anchorX,w.anchorY),A={getElevation:m,pitchedLabelPlaneMatrix:r,lineVertexArray:_,pitchWithMap:a,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:n.transform,tileAnchorPoint:C,unwrappedTileID:c,width:d,height:u,translation:h},k=tI(w.anchorX,w.anchorY,A);if(F=k.point,!(F.x>=-b[0]&&F.x<=b[0]&&F.y>=-b[1])||!(F.y<=b[1])){tO(w.numGlyphs,g);continue}let T=k.signedDistanceFromCamera,S=.5+n.transform.cameraToCenterDistance/T*.5,I=(0,E.k)(p,f,w),D=a?I*n.transform.getPitchedTextCorrection(w.anchorX,w.anchorY,c)/S:I*S,P=tC({projectionContext:A,pitchedLabelPlaneMatrixInverse:o,symbol:w,fontSize:D,flip:!1,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:v,rotateToLine:l});x=P.useVertical,(P.notEnoughRoom||x||P.needsFlipping&&tC({projectionContext:A,pitchedLabelPlaneMatrixInverse:o,symbol:w,fontSize:D,flip:!0,keepUpright:s,glyphOffsetArray:t.glyphOffsetArray,dynamicLayoutVertexArray:g,aspectRatio:v,rotateToLine:l}).notEnoughRoom)&&tO(w.numGlyphs,g)}i?t.text.dynamicLayoutVertexBuffer.updateData(g):t.icon.dynamicLayoutVertexBuffer.updateData(g)}(c,t,o,N,n,_,d,"map"===i.layout.get("text-rotation-alignment"),l.toUnwrapped(),b.width,b.height,j,r)}let W=o&&C||q,Y=_?N:t.transform.clipSpaceToPixelsMatrix,X=y||W?ry:Y,Z=p&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),K={program:S,buffers:u,uniformValues:p?c.iconsInText?iI(w.kind,I,v,_,y,W,t,X,U,j,P,R,k,G,H):iS(w.kind,I,v,_,y,W,t,X,U,j,o,P,Z,k,G,H):iT(w.kind,I,v,_,y,W,t,X,U,j,o,P,k,G,H),projectionData:V,atlasTexture:O,atlasTextureIcon:L,atlasInterpolation:M,atlasInterpolationIcon:B,isSDF:p,hasHalo:Z};if(x&&c.canOverlap)for(let t of(F=!0,u.segments.get()))A.push({segments:new E.Rt([t]),sortKey:t.sortKey,state:K,terrainData:D});else A.push({segments:u.segments,sortKey:0,state:K,terrainData:D})}F&&A.sort((t,n)=>t.sortKey-n.sortKey);let T=i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(null)??1/0,S=24*i.layout.get("text-letter-spacing").constantOr(0)<0||T>1;for(let n of A){let r=n.state;p.activeTexture.set(f.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,f.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,f.CLAMP_TO_EDGE));let o=r.isSDF&&r.hasHalo;if(o){let o=r.uniformValues;o.u_is_halo=1,S&&(o.u_is_plain=0,rx(r.buffers,n.segments,i,t,r.program,w,u,h,o,r.projectionData,n.terrainData),o.u_is_halo=0,o.u_is_plain=1)}rx(r.buffers,n.segments,i,t,r.program,w,u,h,r.uniformValues,r.projectionData,n.terrainData),o&&!S&&(r.uniformValues.u_is_halo=0)}}function rx(t,n,i,r,o,a,s,l,c,d,u){let h=r.context,m=h.gl;o.draw(h,m.TRIANGLES,a,s,l,rg.backCCW,c,u,d,i.id,t.layoutVertexBuffer,t.indexBuffer,n,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function rF(t,n,i){let r=t.gl,o=r.createTexture();r.bindTexture(r.TEXTURE_2D,o),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texStorage2D(r.TEXTURE_2D,1,r.RGBA16F,n,i);let a=t.createFramebuffer(n,i,!1,!1);return a.colorAttachment.set(o),a}function rw(t,n){return n.colorRampTexture||=new E.yt(t,n.colorRamp,t.gl.RGBA),n.colorRampTexture}function rE(t,n,i,r){let o=t.context,a=o.bindFramebuffer.get(),s=o.viewport.get(),[,,l,c]=s;return function(t,n,i){let r=t.context.gl;if(!t.layerOpacityFbo){let o=t.context.createFramebuffer(n,i,!0,!0),a=r.createTexture();r.bindTexture(r.TEXTURE_2D,a),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,r.LINEAR),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,n,i,0,r.RGBA,r.UNSIGNED_BYTE,null),o.colorAttachment.set(a),o.depthAttachment.set(t.context.createRenderbuffer(r.DEPTH_STENCIL,n,i)),t.layerOpacityFbo=o,t.context.bindFramebuffer.set(t.layerOpacityFbo.framebuffer);return}if(t.layerOpacityFbo.width===n&&t.layerOpacityFbo.height===i)return t.context.bindFramebuffer.set(t.layerOpacityFbo.framebuffer);let o=t.layerOpacityFbo;r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,n,i,0,r.RGBA,r.UNSIGNED_BYTE,null),t.context.bindRenderbuffer.set(o.depthAttachment.get()),r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,n,i),t.context.bindRenderbuffer.set(null),o.width=n,o.height=i,t.context.bindFramebuffer.set(o.framebuffer)}(t,l,c),o.viewport.set([0,0,l,c]),o.clear({color:E.pn.transparent,depth:1,stencil:0}),t.currentStencilSource=void 0,t.renderTileClippingMasks(n,i,r),{compositeTarget:a,compositeViewport:s}}function rC(t,n,i,r){let o=t.context,a=o.gl;o.bindFramebuffer.set(i.compositeTarget),o.viewport.set(i.compositeViewport),o.activeTexture.set(a.TEXTURE0),a.bindTexture(a.TEXTURE_2D,t.layerOpacityFbo.colorAttachment.get()),t.useProgram("layerOpacity").draw(o,a.TRIANGLES,rf.disabled,rb.disabled,t.colorModeForRenderPass(),rg.disabled,{u_image:0,u_opacity:n},null,null,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom),t.currentStencilSource=void 0}function rA(t,n,i,r,o,a,s,l){let c=256;if(o.stepInterpolant){let r=n.getSource().maxzoom,o=s.canonical.z===r?Math.ceil(1<<t.transform.maxZoom-s.canonical.z):1,l=a.maxLineLength/8192*1024*o;c=(0,E.Vn)((0,E.vr)(l),256,i.maxTextureSize)}return l.gradient=(0,E.Ct)({expression:o.gradientExpression(),evaluationKey:"lineProgress",resolution:c,image:l.gradient||void 0,clips:a.lineClipsArray}),l.texture?l.texture.update(l.gradient):l.texture=new E.yt(i,l.gradient,r.RGBA),l.version=o.gradientVersion,l.texture}function rk(t,n,i,r,o,a){let{isRenderingToTexture:s}=o,l=t.getDepthModeForSublayer(0,rf.ReadOnly),c=t.colorModeForRenderPass(),d=i.paint.get("line-dasharray"),u=d.constantOr(1),h=i.paint.get("line-pattern"),m=h.constantOr(1),p=i.paint.get("line-gradient"),f=i.getCrossfadeParameters(),b;b=m?"linePattern":u&&p?"lineGradientSDF":u?"lineSDF":p?"lineGradient":"line";let g=t.context,_=g.gl,y=t.transform,v=!0;for(let o of r){let r=n.getTile(o);if(m&&!r.patternsLoaded())continue;let x=r.getBucket(i);if(!x)continue;let F=x.programConfigurations.get(i.id),w=t.context.program.get(),E=t.useProgram(b,F),C=v||E.program!==w,A=a?t.getTerrainDataForTile(o,s):null,k=h.constantOr(null),T=d?.constantOr(null);if(k&&r.imageAtlas){let t=r.imageAtlas,n=t.patternPositions[k.to.toString()],i=t.patternPositions[k.from.toString()];n&&i&&F.setConstantPatternPositions(n,i)}else if(T){let n="round"===i.layout.get("line-cap").constantOr(null),r=t.lineAtlas.getDash(T.to,n),o=t.lineAtlas.getDash(T.from,n);F.setConstantDashPositions(r,o)}let S=y.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),I=y.getPixelScale(),D;m?(D=iw(t,r,i,I,f),g.activeTexture.set(_.TEXTURE0),r.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),F.updatePaintBuffers(f)):u&&p?(D=iC(t,r,i,I,f,x.lineClipsArray.length),function(t,n,i,r,o,a,s,l,c){let d=a.gradients[o.id],u=d.texture;o.gradientVersion!==d.version&&(u=rA(t,n,i,r,o,a,s,d)),i.activeTexture.set(r.TEXTURE0),u.bind(o.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE),i.activeTexture.set(r.TEXTURE1),t.lineAtlas.bind(i),l.updatePaintBuffers(c)}(t,n,g,_,i,x,o,F,f)):u?(D=iE(t,r,i,I,f),(C||t.lineAtlas.dirty)&&(g.activeTexture.set(_.TEXTURE0),t.lineAtlas.bind(g)),F.updatePaintBuffers(f)):p?(D=iF(t,r,i,I,x.lineClipsArray.length),function(t,n,i,r,o,a,s){let l=a.gradients[o.id],c=l.texture;o.gradientVersion!==l.version&&(c=rA(t,n,i,r,o,a,s,l)),i.activeTexture.set(r.TEXTURE0),c.bind(o.stepInterpolant?r.NEAREST:r.LINEAR,r.CLAMP_TO_EDGE)}(t,n,g,_,i,x,o)):D=ix(t,r,i,I);let P=t.stencilModeForClipping(o);E.draw(g,_.TRIANGLES,l,P,c,rg.disabled,D,A,S,i.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,i.paint,t.transform.zoom,F,x.layoutVertexBuffer2),v=!1}}function rT(t,n,i,r,o){if(!i||!r?.imageAtlas)return;let a=r.imageAtlas.patternPositions,s=a[i.to.toString()],l=a[i.from.toString()];if(!s&&l&&(s=l),!l&&s&&(l=s),!s||!l){let t=o.getPaintProperty(n);s=a[t],l=a[t]}s&&l&&t.setConstantPatternPositions(s,l)}function rS(t,n,i,r,o){let{isRenderingToTexture:a}=o,s=t.colorModeForRenderPass();rD(t,n,i,r,t.getDepthModeForSublayer(1,rf.ReadOnly),s,!1,a),rI(t,n,i,r,o)}function rI(t,n,i,r,o){if(!i.paint.get("fill-antialias"))return;let{isRenderingToTexture:a}=o,s=t.colorModeForRenderPass();rD(t,n,i,r,t.getDepthModeForSublayer(2*!!i.getPaintProperty("fill-outline-color"),rf.ReadOnly),s,!0,a)}function rD(t,n,i,r,o,a,s,l){let c=t.context.gl,d="fill-pattern",u=i.paint.get(d),h=u?.constantOr(1),m=i.getCrossfadeParameters(),p,f,b,g,_,y=t.transform,v=i.paint.get("fill-translate"),x=i.paint.get("fill-translate-anchor");s?(f=h&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",p=c.LINES):(f=h?"fillPattern":"fill",p=c.TRIANGLES);let F=u.constantOr(null);for(let u of r){let r=n.getTile(u);if(h&&!r.patternsLoaded())continue;let w=r.getBucket(i);if(!w)continue;let C=w.sdfPatterns[i.id]??!1,A=w.programConfigurations.get(i.id),k=t.useProgram(f,A),T=t.getTerrainDataForTile(u,l);h&&(t.context.activeTexture.set(c.TEXTURE0),r.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),A.updatePaintBuffers(m)),rT(A,d,F,r,i);let S=y.getProjectionData({overscaledTileID:u,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),I=(0,E.Mr)(y,r,v,x);s?(g=w.indexBuffer2,_=w.segments2,b="fillOutlinePattern"===f&&h?ih(t,m,r,I,C):iu(I)):(g=w.indexBuffer,_=w.segments,b=h?ic(t,m,r,I,C):id(I));let D=t.stencilModeForClipping(u);k.draw(t.context,p,o,D,a,rg.backCCW,b,T,S,i.id,w.layoutVertexBuffer,g,_,i.paint,t.transform.zoom,A)}}function rP(t,n,i,r,o,a,s,l){let c=t.context,d=c.gl,u="fill-extrusion-pattern",h=i.paint.get(u),m=h.constantOr(1),p=i.getCrossfadeParameters(),f=i.paint.get("fill-extrusion-opacity"),b=h.constantOr(null),g=t.transform;for(let h of r){let r=n.getTile(h),_=r.getBucket(i);if(!_)continue;let y=t.style.map.terrain?.getTerrainData(h),v=_.programConfigurations.get(i.id),x=t.useProgram(m?"fillExtrusionPattern":"fillExtrusion",v);m&&(t.context.activeTexture.set(d.TEXTURE0),r.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),v.updatePaintBuffers(p));let F=g.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!l,applyTerrainMatrix:!0});rT(v,u,b,r,i);let w=(0,E.Mr)(g,r,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),C=i.paint.get("fill-extrusion-vertical-gradient"),A=m?il(t,C,f,w,h,p,r):is(t,C,f,w);x.draw(c,c.gl.TRIANGLES,o,a,s,rg.backCCW,A,y,F,i.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,i.paint,t.transform.zoom,v,t.style.map.terrain&&_.centroidVertexBuffer)}}function rR(t,n,i,r,o,a,s,l,c){let d=t.style.projection,u=t.context,h=t.transform,m=u.gl,p=[`#define NUM_ILLUMINATION_SOURCES ${i.paint.get("hillshade-highlight-color").values.length}`],f=t.useProgram("hillshade",null,!1,p),b=!t.options.moving;for(let p of r){let r=n.getTile(p),g=r.fbo;if(!g)continue;let _=d.getMeshFromTileID(u,p.canonical,l,!0,"raster"),y=t.getTerrainDataForTile(p,c);u.activeTexture.set(m.TEXTURE0),m.bindTexture(m.TEXTURE_2D,g.colorAttachment.get());let v=h.getProjectionData({overscaledTileID:p,aligned:b,applyGlobeMatrix:!c,applyTerrainMatrix:!0});f.draw(u,m.TRIANGLES,a,o[p.overscaledZ],s,rg.backCCW,i_(t,r,i),y,v,i.id,_.vertexBuffer,_.indexBuffer,_.segments)}}let rO=0;function rM(t,n,i,r,o,a,s,l,c){let d=t.style.projection,u=t.context,h=t.transform,m=u.gl,p=t.useProgram("colorRelief"),f=!t.options.moving,b="nearest"===i.paint.get("resampling")?m.NEAREST:m.LINEAR,g=!0,_=0;for(let y of r){let r=n.getTile(y),v=r.dem;if(!v?.data)continue;if(g){let t=rO||=m.getParameter(m.MAX_TEXTURE_SIZE),{elevationTexture:n,colorTexture:r}=i.getColorRampTextures(u,t,v.getUnpackVector());u.activeTexture.set(m.TEXTURE1),n.bind(m.NEAREST,m.CLAMP_TO_EDGE),u.activeTexture.set(m.TEXTURE4),r.bind(m.LINEAR,m.CLAMP_TO_EDGE),g=!1,_=n.size[0]}let x=v.stride;u.activeTexture.set(m.TEXTURE0),(!r.demTexture||r.needsColorReliefPrepare)&&(u.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture||=t.getTileTexture(x)??new E.yt(u,{width:x,height:x,data:null},m.RGBA),r.demTexture.update(v.getPixels(),{premultiply:!1}),r.needsColorReliefPrepare=!1),r.demTexture.bind(b,m.CLAMP_TO_EDGE);let F=d.getMeshFromTileID(u,y.canonical,l,!0,"raster"),w=t.getTerrainDataForTile(y,c),C=h.getProjectionData({overscaledTileID:y,aligned:f,applyGlobeMatrix:!c,applyTerrainMatrix:!0});p.draw(u,m.TRIANGLES,a,o[y.overscaledZ],s,rg.backCCW,iv(i,r.dem,_),w,C,i.id,F.vertexBuffer,F.indexBuffer,F.segments)}}let rL=[new E.Ri(0,0),new E.Ri(8192,0),new E.Ri(8192,8192),new E.Ri(0,8192)];function rB(t,n,i,r,o,a,s,l,c,d=!1,u=!1,h=null){let m=r[r.length-1].overscaledZ,p=t.context,f=p.gl,b=t.useProgram("raster"),g=t.transform,_=t.style.projection,y=t.colorModeForRenderPass(),v=!t.options.moving,x=i.paint.get("raster-opacity"),F="nearest"===i.paint.get("resampling")||"nearest"===i.paint.get("raster-resampling")?f.NEAREST:f.LINEAR,w=i.paint.get("raster-fade-duration"),C=!!t.style.map.terrain;for(let A of r){let r=t.getDepthModeForSublayer(A.overscaledZ-m,1===x?rf.ReadWrite:rf.ReadOnly,f.LESS),k=n.getTile(A);p.activeTexture.set(f.TEXTURE0),k.texture.bind(F,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(f.TEXTURE1);let{parentTile:T,parentScaleBy:I,parentTopLeft:D,fadeValues:P}=function(t,n,i,r){let o={parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:{tileOpacity:1,parentTileOpacity:1,fadeMix:{opacity:1,mix:0}}};if(0===i||r)return o;if(t.fadingParentID){let r=n.getLoadedTile(t.fadingParentID);if(!r)return o;let a=2**(r.tileID.overscaledZ-t.tileID.overscaledZ);return{parentTile:r,parentScaleBy:a,parentTopLeft:[t.tileID.canonical.x*a%1,t.tileID.canonical.y*a%1],fadeValues:function(t,n,i){let r=S(),o=(r-t.timeAdded)/i,a=(r-n.timeAdded)/i,s=1===t.fadingDirection,l=(0,E.Vn)(o,0,1),c=(0,E.Vn)(1-a,0,1),d=s?l:c;return{tileOpacity:d,parentTileOpacity:s?c:l,fadeMix:{opacity:1,mix:1-d}}}(t,r,i)}}return t.selfFading?{parentTile:null,parentScaleBy:1,parentTopLeft:[0,0],fadeValues:function(t,n){let i=(S()-t.timeAdded)/n,r=(0,E.Vn)(i,0,1);return{tileOpacity:r,fadeMix:{opacity:r,mix:0}}}(t,i)}:o}(k,n,w,C);k.fadeOpacity=P.tileOpacity,T?(T.fadeOpacity=P.parentTileOpacity,T.texture.bind(F,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST)):k.texture.bind(F,f.CLAMP_TO_EDGE,f.LINEAR_MIPMAP_NEAREST),k.texture.useMipmap&&p.extTextureFilterAnisotropic&&t.transform.pitch>t.options.anisotropicFilterPitch&&f.texParameterf(f.TEXTURE_2D,p.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,p.extTextureFilterAnisotropicMax);let R=t.getTerrainDataForTile(A,u),O=g.getProjectionData({overscaledTileID:A,aligned:v,applyGlobeMatrix:!u,applyTerrainMatrix:!0}),M=eW(D,I,P.fadeMix,i,l,c),L=h??_.getMeshFromTileID(p,A.canonical,a,s,"raster"),B=o?o[A.overscaledZ]:rb.disabled;b.draw(p,f.TRIANGLES,r,B,y,d?rg.frontCCW:rg.backCCW,M,R,O,i.id,L.vertexBuffer,L.indexBuffer,L.segments)}}let rz=new E.pn(1,0,0,1),rN=new E.pn(0,1,0,1),rU=new E.pn(0,0,1,1),rj=new E.pn(1,0,1,1),rV=new E.pn(0,1,1,1);function r$(t,n,i,r){rG(t,0,n+i/2,t.transform.width,i,r)}function rq(t,n,i,r){rG(t,n-i/2,0,i,t.transform.height,r)}function rG(t,n,i,r,o,a){let s=t.context,l=s.gl;l.enable(l.SCISSOR_TEST),l.scissor(n*t.pixelRatio,i*t.pixelRatio,r*t.pixelRatio,o*t.pixelRatio),s.clear({color:a}),l.disable(l.SCISSOR_TEST)}function rH(t,n){if(!n.mesh){let i=new E.Ut;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1);let r=new E.Kt;r.emplaceBack(0,1,2),r.emplaceBack(0,2,3),n.mesh=new eY(t.createVertexBuffer(i,eX.members),t.createIndexBuffer(r),E.Rt.simpleSegment(0,0,i.length,r.length))}return n.mesh}let rW={symbol:function(t,n,i,r,o,a){if("translucent"!==a.currentPass)return;let{isRenderingToTexture:s}=a,l=rb.disabled,c=t.colorModeForRenderPass();(i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,n,i,r,o,a,s,l,c){let d=n.transform,u=n.style.map.terrain,h="map"===o,m="map"===a;for(let o of t){let t=r.getTile(o),a=t.getBucket(i);if(!a?.text?.segments.get().length)continue;let p=a.textSizeData,f=(0,E.A)(p,d.zoom),b=(0,E.Lr)(t,1,n.transform.zoom),g=ty(h,n.transform,b),_="none"!==i.layout.get("icon-text-fit")&&a.hasIconData();if(f){let n=2**(d.zoom-t.tileID.overscaledZ),r=u?(t,n)=>u.getElevation(o,t,n):void 0;!function(t,n,i,r,o,a,s,l,c,d,u,h,m){let p=t.text.placedSymbolArray,f=t.text.dynamicLayoutVertexArray,b=t.icon.dynamicLayoutVertexArray,g={};f.clear();for(let b=0;b<p.length;b++){let _=p.get(b),y=t.allowVerticalPlacement&&!_.placedOrientation,v=_.hidden||!_.crossTileID||y?null:r[_.crossTileID];if(v){let r=new E.Ri(_.anchorX,_.anchorY),p={getElevation:h,heightOffset:_.heightOffset,heightAnchorGround:m,width:o.width,height:o.height,pitchedLabelPlaneMatrix:a,lineVertexArray:null,pitchWithMap:i,transform:o,projectionCache:null,tileAnchorPoint:r,translation:d,unwrappedTileID:u},b=i?tI(r.x,r.y,p):tT(r.x,r.y,p),y=.5+o.cameraToCenterDistance/b.signedDistanceFromCamera*.5,x=(0,E.k)(t.textSizeData,l,_)*y/24;i&&(x*=t.tilePixelRatio/s);let{width:F,height:w,anchor:C,textOffset:A,textBoxScale:k}=v,T=function(t,n,i,r,o,a){let{horizontalAlign:s,verticalAlign:l}=(0,E.M)(t);return new E.Ri((-(s-.5)*n/o+r[0])*a,(-(l-.5)*i/o+r[1])*a)}(C,F,w,A,k,x),S=o.getPitchedTextCorrection(r.x+d[0],r.y+d[1],u),I=function(t,n,i,r,o,a){let s=n.tileAnchorPoint.add(new E.Ri(n.translation[0],n.translation[1]));if(n.pitchWithMap){let t=r.mult(a);i||(t=t.rotate(-o));let l=s.add(t);return tF(l.x,l.y,n.pitchedLabelPlaneMatrix,tx(n,l.x,l.y)).point}if(i){let i=tT(n.tileAnchorPoint.x+1,n.tileAnchorPoint.y,n).point.sub(t),o=Math.atan(i.y/i.x)+(i.x<0?Math.PI:0);return t.add(r.rotate(o))}return t.add(r)}(b.point,p,n,T,-o.bearingInRadians,S),D=t.allowVerticalPlacement&&2===_.placedOrientation?Math.PI/2:0;for(let t=0;t<_.numGlyphs;t++)(0,E.C)(f,I,D);c&&_.associatedIconIndex>=0&&(g[_.associatedIconIndex]={shiftedAnchor:I,angle:D})}else tO(_.numGlyphs,f)}if(c){b.clear();let n=t.icon.placedSymbolArray;for(let t=0;t<n.length;t++){let i=n.get(t);if(i.hidden)tO(i.numGlyphs,b);else{let n=g[t];if(n)for(let t=0;t<i.numGlyphs;t++)(0,E.C)(b,n.shiftedAnchor,n.angle);else tO(i.numGlyphs,b)}}t.icon.dynamicLayoutVertexBuffer.updateData(b)}t.text.dynamicLayoutVertexBuffer.updateData(f)}(a,h,m,c,d,g,n,f,_,(0,E.Mr)(d,t,s,l),o.toUnwrapped(),r,"ground"===i.layout.get("symbol-height-anchor"))}}}(r,t,i,n,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&rv(t,n,i,r,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment").constantOr("viewport"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),l,c,s),0!==i.paint.get("text-opacity").constantOr(1)&&rv(t,n,i,r,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),l,c,s),n.map.showCollisionBoxes&&(r_(t,n,i,r,!0),r_(t,n,i,r,!1))},circle:function(t,n,i,r,o){if("translucent"!==o.currentPass)return;let{isRenderingToTexture:a}=o,s=i.paint.get("circle-opacity"),l=i.paint.get("circle-stroke-width"),c=i.paint.get("circle-stroke-opacity"),d=!i.layout.get("circle-sort-key").isConstant();if(0===s.constantOr(1)&&(0===l.constantOr(1)||0===c.constantOr(1)))return;let u=t.context,h=u.gl,m=t.transform,p=t.getDepthModeForSublayer(0,rf.ReadOnly),f=rb.disabled,b=t.colorModeForRenderPass(),g=[],_=m.getCircleRadiusCorrection();for(let o of r){let r=n.getTile(o),s=r.getBucket(i);if(!s)continue;let l=i.paint.get("circle-translate"),c=i.paint.get("circle-translate-anchor"),u=(0,E.Mr)(m,r,l,c),h=s.programConfigurations.get(i.id),p=t.useProgram("circle",h),f=s.layoutVertexBuffer,b=s.indexBuffer,y=t.style.map.terrain?.getTerrainData(o),v={programConfiguration:h,program:p,layoutVertexBuffer:f,indexBuffer:b,uniformValues:im(t,r,i,u,_),terrainData:y,projectionData:m.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!a,applyTerrainMatrix:!0})};if(d)for(let t of s.segments.get())g.push({segments:new E.Rt([t]),sortKey:t.sortKey,state:v});else g.push({segments:s.segments,sortKey:0,state:v})}for(let n of(d&&g.sort((t,n)=>t.sortKey-n.sortKey),g)){let{programConfiguration:r,program:o,layoutVertexBuffer:a,indexBuffer:s,uniformValues:l,terrainData:c,projectionData:d}=n.state,m=n.segments;o.draw(u,h.TRIANGLES,p,f,b,rg.backCCW,l,c,d,i.id,a,s,m,i.paint,t.transform.zoom,r)}},heatmap:function(t,n,i,r,o){if(0===i.paint.get("heatmap-opacity"))return;let a=t.context,{isRenderingToTexture:s,isRenderingGlobe:l}=o;if(t.style.map.terrain){for(let a of r){let r=n.getTile(a);n.hasRenderableParent(a)||("offscreen"===o.currentPass?function(t,n,i,r,o){let a=t.context,s=a.gl,l=rb.disabled,c=new rm([s.ONE,s.ONE],E.pn.transparent,[!0,!0,!0,!0]),d=n.getBucket(i);if(!d)return;let u=r.key,h=i.heatmapFbos.get(u);h||(h=rF(a,n.tileSize,n.tileSize),i.heatmapFbos.set(u,h)),a.bindFramebuffer.set(h.framebuffer),a.viewport.set([0,0,n.tileSize,n.tileSize]),a.clear({color:E.pn.transparent});let m=d.programConfigurations.get(i.id),p=t.useProgram("heatmap",m,!o),f=t.transform.getProjectionData({overscaledTileID:n.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),b=t.style.map.terrain.getTerrainData(r);p.draw(a,s.TRIANGLES,rf.disabled,l,c,rg.disabled,ib(n,t.transform.zoom,i.paint.get("heatmap-intensity"),1),b,f,i.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,i.paint,t.transform.zoom,m)}(t,r,i,a,l):"translucent"===o.currentPass&&function(t,n,i,r,o){let a=t.context,s=a.gl,l=t.transform;a.setColorMode(t.colorModeForRenderPass());let c=rw(a,n),d=i.key,u=n.heatmapFbos.get(d);if(!u)return;a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.colorAttachment.get()),a.activeTexture.set(s.TEXTURE1),c.bind(s.LINEAR,s.CLAMP_TO_EDGE);let h=l.getProjectionData({overscaledTileID:i,applyTerrainMatrix:o,applyGlobeMatrix:!r});t.useProgram("heatmapTexture").draw(a,s.TRIANGLES,rf.disabled,rb.disabled,t.colorModeForRenderPass(),rg.disabled,ig(t,n,0,1),null,h,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,n.paint,l.zoom),u.destroy(),n.heatmapFbos.delete(d)}(t,i,a,s,l))}a.viewport.set([0,0,t.width,t.height])}else{var c,d;let a,s,l;"offscreen"===o.currentPass?function(t,n,i,r){var o,a,s;let l,c,d=t.context,u=d.gl,h=t.transform,m=rb.disabled,p=new rm([u.ONE,u.ONE],E.pn.transparent,[!0,!0,!0,!0]);for(let f of(o=d,a=t,s=i,l=o.gl,o.activeTexture.set(l.TEXTURE1),o.viewport.set([0,0,a.width/4,a.height/4]),(c=s.heatmapFbos.get("big-fb"))?(l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),o.bindFramebuffer.set(c.framebuffer)):(c=rF(o,a.width/4,a.height/4),s.heatmapFbos.set("big-fb",c)),d.clear({color:E.pn.transparent}),r)){if(n.hasRenderableParent(f))continue;let r=n.getTile(f),o=r.getBucket(i);if(!o)continue;let a=o.programConfigurations.get(i.id),s=t.useProgram("heatmap",a),l=h.getProjectionData({overscaledTileID:f,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),c=h.getCircleRadiusCorrection();s.draw(d,u.TRIANGLES,rf.disabled,m,p,rg.backCCW,ib(r,h.zoom,i.paint.get("heatmap-intensity"),c),null,l,i.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,i.paint,h.zoom,a)}d.viewport.set([0,0,t.width,t.height])}(t,n,i,r):"translucent"===o.currentPass&&(c=t,d=i,s=(a=c.context).gl,a.setColorMode(c.colorModeForRenderPass()),(l=d.heatmapFbos.get("big-fb"))&&(a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,l.colorAttachment.get()),a.activeTexture.set(s.TEXTURE1),rw(a,d).bind(s.LINEAR,s.CLAMP_TO_EDGE),c.useProgram("heatmapTexture").draw(a,s.TRIANGLES,rf.disabled,rb.disabled,c.colorModeForRenderPass(),rg.disabled,ig(c,d,0,1),null,null,d.id,c.viewportBuffer,c.quadTriangleIndexBuffer,c.viewportSegments,d.paint,c.transform.zoom)))}},line:function(t,n,i,r,o){if("translucent"!==o.currentPass)return;let a=i.paint.get("line-opacity"),s=i.paint.get("line-width"),l=i.paint.get("line-layer-opacity");if(0===a.constantOr(1)||0===s.constantOr(1)||0===l)return;let c=!!t.style.map.terrain;if(l<1){let a=rE(t,i,r,c);rk(t,n,i,r,o,c),rC(t,l,a,i);return}rk(t,n,i,r,o,c)},fill:function(t,n,i,r,o){let a=i.paint.get("fill-color"),s=i.paint.get("fill-opacity"),l=i.paint.get("fill-layer-opacity");if(0===s.constantOr(1)||0===l)return;if(l<1){if("translucent"!==o.currentPass)return;let a=rE(t,i,r,!!t.style.map.terrain);rS(t,n,i,r,o),rC(t,l,a,i);return}let c=i.paint.get("fill-pattern"),d=t.opaquePassEnabledForLayer()&&!c.constantOr(1)&&1===a.constantOr(E.pn.transparent).a&&1===s.constantOr(0);if(d&&"opaque"===o.currentPass){let{isRenderingToTexture:a}=o,s=t.colorModeForRenderPass();rD(t,n,i,r,t.getDepthModeForSublayer(1,rf.ReadWrite),s,!1,a);return}d&&"translucent"===o.currentPass?rI(t,n,i,r,o):"translucent"===o.currentPass&&rS(t,n,i,r,o)},fillExtrusion:function(t,n,i,r,o){let a=i.paint.get("fill-extrusion-opacity");if(0===a)return;let{isRenderingToTexture:s}=o;if("translucent"===o.currentPass){let l=new rf(t.context.gl.LEQUAL,rf.ReadWrite,o.depthRangeFor3D);if(1!==a||i.paint.get("fill-extrusion-pattern").constantOr(1))rP(t,n,i,r,l,rb.disabled,rm.disabled,s),rP(t,n,i,r,l,t.stencilModeFor3D(),t.colorModeForRenderPass(),s);else{let o=t.colorModeForRenderPass();rP(t,n,i,r,l,rb.disabled,o,s)}}},hillshade:function(t,n,i,r,o){if("offscreen"!==o.currentPass&&"translucent"!==o.currentPass)return;let{isRenderingToTexture:a}=o,s=t.context,l=t.style.projection.useSubdivision,c=t.getDepthModeForSublayer(0,rf.ReadOnly),d=t.colorModeForRenderPass();if("offscreen"===o.currentPass)(function(t,n,i,r,o,a,s){let l=t.context,c=l.gl,d="nearest"===r.paint.get("resampling")?c.NEAREST:c.LINEAR;for(let u of i){let i=n.getTile(u),h=i.dem;if(!h?.data||!i.needsHillshadePrepare)continue;let m=h.dim+2,p=h.stride,f=h.getPixels();if(l.activeTexture.set(c.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture||=t.getTileTexture(p),i.demTexture){let t=i.demTexture;t.update(f,{premultiply:!1}),t.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else i.demTexture=new E.yt(l,f,c.RGBA,{premultiply:!1}),i.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);l.activeTexture.set(c.TEXTURE0);let b=i.fbo;if(!b){let t=new E.yt(l,{width:m,height:m,data:null},c.RGBA);t.bind(d,c.CLAMP_TO_EDGE),(b=i.fbo=l.createFramebuffer(m,m,!0,!1)).colorAttachment.set(t.texture)}l.bindFramebuffer.set(b.framebuffer),l.viewport.set([0,0,m,m]),t.useProgram("hillshadePrepare").draw(l,c.TRIANGLES,o,a,s,rg.disabled,iy(i.tileID,h),null,null,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),i.needsHillshadePrepare=!1}})(t,n,r,i,c,rb.disabled,d),s.viewport.set([0,0,t.width,t.height]);else if("translucent"===o.currentPass)if(l){let[o,s,l]=t.stencilConfigForOverlapTwoPass(r);rR(t,n,i,l,o,c,d,!1,a),rR(t,n,i,l,s,c,d,!0,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(r);rR(t,n,i,s,o,c,d,!1,a)}},colorRelief:function(t,n,i,r,o){if("translucent"!==o.currentPass||!r.length)return;let{isRenderingToTexture:a}=o,s=t.style.projection.useSubdivision,l=t.getDepthModeForSublayer(0,rf.ReadOnly),c=t.colorModeForRenderPass();if(s){let[o,s,d]=t.stencilConfigForOverlapTwoPass(r);rM(t,n,i,d,o,l,c,!1,a),rM(t,n,i,d,s,l,c,!0,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(r);rM(t,n,i,s,o,l,c,!1,a)}},raster:function(t,n,i,r,o){if("translucent"!==o.currentPass||0===i.paint.get("raster-opacity")||!r.length)return;let{isRenderingToTexture:a}=o,s=n.getSource(),l=t.style.projection.useSubdivision;if(s instanceof eJ)rB(t,n,i,r,null,!1,!1,s.tileCoords,s.imageWarp,s.flippedWindingOrder,a,s.getMesh(t.context,l));else if(l){let[o,s,l]=t.stencilConfigForOverlapTwoPass(r);rB(t,n,i,l,o,!1,!0,rL,eH,!1,a),rB(t,n,i,l,s,!0,!0,rL,eH,!1,a)}else{let[o,s]=t.getStencilConfigForOverlapAndUpdateStencilID(r);rB(t,n,i,s,o,!1,!0,rL,eH,!1,a)}},background:function(t,n,i,r,o){let a=i.paint.get("background-color"),s=i.paint.get("background-opacity");if(0===s)return;let{isRenderingToTexture:l}=o,c=t.context,d=c.gl,u=t.style.projection,h=t.transform,m=h.tileSize,p=i.paint.get("background-pattern");if(t.isPatternMissing(p))return;let f=!p&&1===a.a&&1===s&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(o.currentPass!==f)return;let b=rb.disabled,g=t.getDepthModeForSublayer(0,"opaque"===f?rf.ReadWrite:rf.ReadOnly),_=t.colorModeForRenderPass(),y=t.useProgram(p?"backgroundPattern":"background"),v=r||tl(h,{tileSize:m,terrain:t.style.map.terrain});p&&(c.activeTexture.set(d.TEXTURE0),t.patternAtlas.bind(t.context));let x=i.getCrossfadeParameters();for(let n of v){let r=h.getProjectionData({overscaledTileID:n,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),o=p?iP(s,t,p,{tileID:n,tileSize:m},x):iD(s,a),f=t.getTerrainDataForTile(n,l),v=u.getMeshFromTileID(c,n.canonical,!1,!0,"raster");y.draw(c,d.TRIANGLES,g,b,_,rg.backCCW,o,f,r,i.id,v.vertexBuffer,v.indexBuffer,v.segments)}},sky:function(t,n){var i,r;let o,a,s,l,c=t.context,d=c.gl,u=(i=t.transform,r=t.pixelRatio,o=Math.cos(i.rollInRadians),a=Math.sin(i.rollInRadians),s=(0,E.Y)(i),l=i.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition,{u_sky_color:n.properties.get("sky-color"),u_horizon_color:n.properties.get("horizon-color"),u_horizon:[(i.width/2-s*a)*r,(i.height/2+s*o)*r],u_horizon_normal:[-a,o],u_sky_horizon_blend:n.properties.get("sky-horizon-blend")*i.height/2*r,u_sky_blend:l,u_inv_proj_matrix:i.inverseProjectionMatrix,u_globe_position:nP(i),u_globe_radius:nD(i.worldSize,i.center.lat)}),h=new rf(d.LEQUAL,rf.ReadWrite,[0,1]),m=rb.disabled,p=t.colorModeForRenderPass(),f=t.useProgram("sky"),b=rH(c,n);f.draw(c,d.TRIANGLES,h,m,p,rg.disabled,u,null,void 0,"sky",b.vertexBuffer,b.indexBuffer,b.segments)},atmosphere:function(t,n,i){var r;let o,a,s=t.context,l=s.gl,c=t.useProgram("atmosphere"),d=new rf(l.LEQUAL,rf.ReadOnly,[0,1]),u=t.transform,h=(r=t.transform,o=i.getCartesianPosition(),(0,E.ii)(o,o),a=(0,E.Ci)(new Float64Array(16)),"map"===i.properties.get("anchor")&&((0,E.Ai)(a,a,r.rollInRadians),(0,E.Oi)(a,a,-r.pitchInRadians),(0,E.Ai)(a,a,r.bearingInRadians),(0,E.Oi)(a,a,r.center.lat*Math.PI/180),(0,E.ki)(a,a,-r.center.lng*Math.PI/180)),(0,E.mi)(o,o,a),o),m=u.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),p=n.properties.get("atmosphere-blend")*m.projectionTransition;if(0===p)return;let f=nD(u.worldSize,u.center.lat),b={u_sun_pos:h,u_atmosphere_blend:p,u_globe_position:nP(u),u_globe_radius:f,u_inv_proj_matrix:u.inverseProjectionMatrix},g=rH(s,n);c.draw(s,l.TRIANGLES,d,rb.disabled,rm.alphaBlended,rg.disabled,b,null,null,"atmosphere",g.vertexBuffer,g.indexBuffer,g.segments)},custom:function(t,n,i,r){let{isRenderingGlobe:o}=r,a=t.context,s=i.implementation,l=t.style.projection,c=t.transform,d=c.getProjectionDataForCustomLayer(o),u={farZ:c.farZ,nearZ:c.nearZ,fov:c.fov*Math.PI/180,modelViewProjectionMatrix:c.modelViewProjectionMatrix,projectionMatrix:c.projectionMatrix,shaderData:{variantName:l.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;
816
816
  uniform mat4 u_projection_matrix;
817
- ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionData:d,getProjectionData:t=>c.getProjectionData({overscaledTileID:new E.d(t.tileID.canonical.z,t.tileID.wrap??0,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),aligned:t.aligned,applyGlobeMatrix:t.applyGlobeMatrix,applyTerrainMatrix:t.applyTerrainMatrix})},h=s.renderingMode?s.renderingMode:"2d";if("offscreen"===r.currentPass){let n=s.prerender;n&&(t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),n.call(s,a.gl,u),a.setDirty(),t.setBaseState())}else if("translucent"===r.currentPass){t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),a.setStencilMode(rb.disabled);let n="3d"===h?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,rf.ReadOnly);a.setDepthMode(n),s.render(a.gl,u),a.setDirty(),t.setBaseState(),a.bindFramebuffer.set(null)}},debug:function(t,n,i){for(let r of i)!function(t,n,i){let r=t.context,o=r.gl,a=t.useProgram("debug"),s=rf.disabled,l=rb.disabled,c=t.colorModeForRenderPass(),d="$debug",u=t.style.map.terrain?.getTerrainData(i);r.activeTexture.set(o.TEXTURE0);let h=Math.floor((n.getTileByID(i.key).latestRawTileData?.byteLength||0)/1024),m=512/Math.min(n.getTile(i).tileSize,512)*(i.overscaledZ/t.transform.zoom)*.5,p=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(p+=` => ${i.overscaledZ}`),function(t,n){t.initDebugOverlayCanvas();let i=t.debugOverlayCanvas,r=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,i.width,i.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(n,5,5),o.strokeText(n,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,`${p} ${h}kB`);let f=t.transform.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!0,applyTerrainMatrix:!0});a.draw(r,o.TRIANGLES,s,l,rm.alphaBlended,rg.disabled,ip(E.pn.transparent,m),null,f,d,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),a.draw(r,o.LINE_STRIP,s,l,c,rg.disabled,ip(E.pn.red),u,f,d,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,n,r)},debugPadding:function(t){var n,i,r,o;let a=t.transform.padding;r$(t,t.transform.height-(a.top||0),3,rz),r$(t,a.bottom||0,3,rN),rq(t,a.left||0,3,rU),rq(t,t.transform.width-(a.right||0),3,rj);let s=t.transform.centerPoint;n=t,i=s.x,r=t.transform.height-s.y,rG(n,i-1,r-10,2,20,o=rV),rG(n,i-10,r-1,20,2,o)},terrainDepth:function(t,n){let i=t.context,r=i.gl,o=t.transform,a=rm.unblended,s=new rf(r.LEQUAL,rf.ReadWrite,[0,1]),l=n.tileManager.getRenderableTiles(),c=t.useProgram("terrainDepth");for(let d of(i.bindFramebuffer.set(n.getFramebuffer().framebuffer),i.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),i.clear({color:E.pn.white,depth:1}),l)){let t=n.getTerrainMesh(d.tileID),l=n.getTerrainData(d.tileID),u=o.getProjectionData({overscaledTileID:d.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),h=n5(n.getSkirtLength(o.zoom));c.draw(i,r.TRIANGLES,s,rb.disabled,a,rg.backCCW,h,l,u,"terrain",t.vertexBuffer,t.indexBuffer,t.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,t.width,t.height])}};var rY=class t{constructor(t,n){this.drawFunctions=rW,this.context=new rp(t),this.transform=n,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:(0,E.Ci)(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=tm.maxOverzooming+tm.maxUnderzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new t5}resize(t,n,i){if(this.width=Math.floor(t*i),this.height=Math.floor(n*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let t of this.style._order)this.style._layers[t].resize()}setup(){let t=this.context,n=new E.Ut;n.emplaceBack(0,0),n.emplaceBack(8192,0),n.emplaceBack(0,8192),n.emplaceBack(8192,8192),this.tileExtentBuffer=t.createVertexBuffer(n,eX.members),this.tileExtentSegments=E.Rt.simpleSegment(0,0,4,2);let i=new E.Ut;i.emplaceBack(0,0),i.emplaceBack(8192,0),i.emplaceBack(0,8192),i.emplaceBack(8192,8192),this.debugBuffer=t.createVertexBuffer(i,eX.members),this.debugSegments=E.Rt.simpleSegment(0,0,4,5);let r=new E.Gt;r.emplaceBack(0,0,0,0),r.emplaceBack(8192,0,8192,0),r.emplaceBack(0,8192,0,8192),r.emplaceBack(8192,8192,8192,8192),this.rasterBoundsBuffer=t.createVertexBuffer(r,n1.members),this.rasterBoundsSegments=E.Rt.simpleSegment(0,0,4,2);let o=new E.Ut;o.emplaceBack(0,0),o.emplaceBack(8192,0),o.emplaceBack(0,8192),o.emplaceBack(8192,8192),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(o,eX.members),this.rasterBoundsSegmentsPosOnly=E.Rt.simpleSegment(0,0,4,5);let a=new E.Ut;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,eX.members),this.viewportSegments=E.Rt.simpleSegment(0,0,4,2);let s=new E.Vt;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(s);let l=new E.Kt;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);let c=this.context.gl;this.stencilClearMode=new rb({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO),this.tileExtentMesh=new eY(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let i=(0,E.yi)();(0,E.Ei)(i,0,this.width,this.height,0,0,1),(0,E.ji)(i,i,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask",null,!0).draw(t,n.TRIANGLES,rf.disabled,this.stencilClearMode,rm.disabled,rg.disabled,null,null,{mainMatrix:i,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:i,clipAntimeridian:!1},"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(t,n,i){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n?.length)return;this.currentStencilSource=t.source,this.nextStencilID+n.length>256&&this.clearStencil();let r=this.context;r.setColorMode(rm.disabled),r.setDepthMode(rf.disabled);let o={};for(let t of n)o[t.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(o,n,i,!0),this._renderTileMasks(o,n,i,!1),this._tileClippingMaskIDs=o}_renderTileMasks(t,n,i,r){let o=this.context,a=o.gl,s=this.style.projection,l=this.transform,c=this.useProgram("clippingMask");for(let d of n){let n=t[d.key],u=this.getTerrainDataForTile(d,i),h=s.getMeshFromTileID(this.context,d.canonical,r,!0,"stencil"),m=l.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!i,applyTerrainMatrix:!0});c.draw(o,a.TRIANGLES,rf.disabled,new rb({func:a.ALWAYS,mask:0},n,255,a.KEEP,a.KEEP,a.REPLACE),rm.disabled,i?rg.disabled:rg.backCCW,null,u,m,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}getTerrainDataForTile(t,n){return n&&this.style.projection?.name==="mercator"?null:this.style.map.terrain?.getTerrainData(t)||null}_renderTilesDepthBuffer(){let t=this.context,n=t.gl,i=this.style.projection,r=this.transform,o=this.useProgram("depth"),a=this.getDepthModeFor3D();for(let s of tl(r,{tileSize:r.tileSize})){let l=this.style.map.terrain?.getTerrainData(s),c=i.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),d=r.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(t,n.TRIANGLES,a,rb.disabled,rm.disabled,rg.backCCW,null,l,d,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,n=this.context.gl;return new rb({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){let n=this.context.gl;return new rb({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let n=this.context.gl,i=t.sort((t,n)=>n.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();let t={};for(let i=0;i<o;i++)t[i+r]=new rb({func:n.GEQUAL,mask:255},i+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[t,i]}return[{[r]:rb.disabled},i]}stencilConfigForOverlapTwoPass(t){let n=this.context.gl,i=t.sort((t,n)=>n.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(this.clearStencil(),o>1){let t={},a={};for(let i=0;i<o;i++)t[i+r]=new rb({func:n.GREATER,mask:255},o+1+i,255,n.KEEP,n.KEEP,n.REPLACE),a[i+r]=new rb({func:n.GREATER,mask:255},1+i,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID=2*o+1,[t,a,i]}return this.nextStencilID=3,[{[r]:new rb({func:n.GREATER,mask:255},2,255,n.KEEP,n.KEEP,n.REPLACE)},{[r]:new rb({func:n.GREATER,mask:255},1,255,n.KEEP,n.KEEP,n.REPLACE)},i]}colorModeForRenderPass(){let t=this.context.gl;if(this._showOverdrawInspector){let n=1/8;return new rm([t.CONSTANT_COLOR,t.ONE],new E.pn(n,n,n,0),[!0,!0,!0,!0])}return"opaque"===this.renderOptions.currentPass?rm.unblended:rm.alphaBlended}getDepthModeForSublayer(t,n,i){if(!this.opaquePassEnabledForLayer())return rf.disabled;let r=1-((1+this.renderOptions.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new rf(i||this.context.gl.LEQUAL,n,[r,r])}getDepthModeFor3D(){return new rf(this.context.gl.LEQUAL,rf.ReadWrite,this.renderOptions.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.renderOptions.currentLayer<this.renderOptions.opaquePassCutoff}render(t,n){var i,r;let o;this.style=t,this.options=n;let a=this.renderOptions=(i=this.transform,r=t.projection,{currentPass:"offscreen",currentLayer:0,opaquePassCutoff:1/0,depthRangeFor3D:[0,1],isRenderingToTexture:!1,transform:i,terrain:t.map.terrain??null,projectionTransition:o=r?.transitionState??0,isRenderingGlobe:o>0});this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.patternAtlas=t.patternAtlas,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(S()),function(t,n){let i=t.pending,{transform:r}=n,o=n.context.gl;i[rh.u_units_to_pixels]=1/r.pixelsToGLUnits[0],i[rh.u_units_to_pixels+1]=1/r.pixelsToGLUnits[1],i[rh.u_world_size]=o.drawingBufferWidth,i[rh.u_world_size+1]=o.drawingBufferHeight,i[rh.u_camera_to_center_distance]=r.cameraToCenterDistance,i[rh.u_symbol_fade_change]=n.options.fadeDuration?n.symbolFadeChange:1,i[rh.u_aspect_ratio]=r.width/r.height,i[rh.u_device_pixel_ratio]=n.pixelRatio,i[rh.u_viewport_size]=r.width,i[rh.u_viewport_size+1]=r.height,i[rh.u_pixel_extrude_scale]=1/r.width,i[rh.u_pixel_extrude_scale+1]=1/r.height,i[rh.u_pitch]=r.pitch/360*2*Math.PI,t.upload()}(this.context.frameUniformBuffer,this),this.imageManager.beginFrame();let s=this.style._order,l=this.style.tileManagers,c={},d={},u={};for(let t in l){let n=l[t];n.used&&n.prepare(this.context),c[t]=n.getVisibleCoordinates(!1),d[t]=c[t].slice().reverse(),u[t]=n.getVisibleCoordinates(!0).reverse()}a.opaquePassCutoff=1/0;for(let t=0;t<s.length;t++){let n=s[t];if(this.style._layers[n].is3D()){a.opaquePassCutoff=t;break}}for(let t of(this.maybeDrawDepth(),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),a.opaquePassCutoff=0),a.currentPass="offscreen",s)){let n=this.style._layers[t];if(!n.hasOffscreenPass()||n.isHidden(this.transform.zoom))continue;let i=d[n.source];("custom"===n.type||i.length)&&this.renderLayer(this,l[n.source],n,i,a)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?E.pn.black:E.pn.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,a.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(a.currentPass="opaque",a.currentLayer=s.length-1;a.currentLayer>=0;a.currentLayer--){let t=this.style._layers[s[a.currentLayer]],n=l[t.source],i=c[t.source];this.renderTileClippingMasks(t,i,!1),this.renderLayer(this,n,t,i,a)}a.currentPass="translucent";let h=!1;for(a.currentLayer=0;a.currentLayer<s.length;a.currentLayer++){let t=this.style._layers[s[a.currentLayer]],n=l[t.source];if(this.renderToTexture?.renderLayer(t,a))continue;this.opaquePassEnabledForLayer()||h||(h=!0,a.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let i=("symbol"===t.type?u:d)[t.source];this.renderTileClippingMasks(t,c[t.source],!!this.renderToTexture),this.renderLayer(this,n,t,i,a)}if(a.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let t=function(t,n){let i=null,r=Object.values(t._layers).flatMap(i=>i.source&&!i.isHidden(n)?[t.tileManagers[i.source]]:[]),o=r.filter(t=>"vector"===t.getSource().type),a=r.filter(t=>"vector"!==t.getSource().type),s=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};for(let t of o)s(t);if(!i)for(let t of a)s(t);return i}(this.style,this.transform.zoom);t&&this.drawFunctions.debug(this,t,t.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(){if(!this.style?.map?.terrain)return;let t=this.terrainFacilitator.matrix,n=this.transform.modelViewProjectionMatrix,i=this.terrainFacilitator.depthDirty;i||=!(0,E.bi)(t,n),(i||=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime))&&((0,E.vi)(t,n),this.terrainFacilitator.renderTime=S(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}renderLayer(t,n,i,r,o){if(i.isHidden(this.transform.zoom)||"background"!==i.type&&"custom"!==i.type&&!(r||[]).length)return;this.id=i.id;let a=this.drawFunctions;(0,E.x)(i)?a.symbol(t,n,i,r,this.style.placement.variableOffsets,o):(0,E.Et)(i)?a.circle(t,n,i,r,o):(0,E.St)(i)?a.heatmap(t,n,i,r,o):(0,E.H)(i)?a.line(t,n,i,r,o):(0,E.ft)(i)?a.fill(t,n,i,r,o):(0,E.W)(i)?a.fillExtrusion(t,n,i,r,o):(0,E.bt)(i)?a.hillshade(t,n,i,r,o):(0,E._t)(i)?a.colorRelief(t,n,i,r,o):(0,E.Jt)(i)?a.raster(t,n,i,r,o):(0,E.b)(i)?a.background(t,n,i,r,o):(0,E.v)(i)&&a.custom(t,n,i,o)}static{this.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50}saveTileTexture(n){let i=this._tileTextures[n.size[0]];i?i.length<t.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?i.push(n):n.destroy():this._tileTextures[n.size[0]]=[n]}getTileTexture(t){let n=this._tileTextures[t];return n&&n.length>0?n.pop():null}acquireRTT(t){let n=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(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&n.texParameterf(n.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),i.size=t),i;let r=new E.yt(this.context,{width:t,height:t,data:null},n.RGBA,{premultiply:!1,useMipmap:!0});return r.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&n.texParameterf(n.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:r,size:t}}bindRTT(t){let n=this.context.gl,i=t.size;if(!this._rttSharedFbo){let t=this.context.createFramebuffer(i,i,!0,!0),r=this.context.createRenderbuffer(n.DEPTH_STENCIL,i,i);t.depthAttachment.set(r),this._rttSharedFbo={fbo:t,depthRenderbuffer:r,size:i}}this._rttSharedFbo.size!==i&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),n.renderbufferStorage(n.RENDERBUFFER,n.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)}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let n=this.patternAtlas.getPattern(t.from.toString()),i=this.patternAtlas.getPattern(t.to.toString());return!n||!i}useProgram(t,n,i=!1,r=[]){this.cache||={};let o=!!this.style.map.terrain,a=this.style.projection,s=i?ne.projectionMercator:a.shaderPreludeCode,l=i?nn:a.shaderDefine,c=`/${i?ni:a.shaderVariantName}`,d=t+(n?n.cacheKey:"")+c+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[d]||=new io(this.context,ne[t],n,iO[t],this._showOverdrawInspector,o,s,l,r),this.cache[d]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}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(null==this.debugOverlayCanvas){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new E.yt(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let n=this._tileTextures[t];if(n)for(let t of n)t.destroy()}this._tileTextures={}}for(let t of this._rttObjectRecyclePool)t.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){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}if(this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.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.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let t in this.cache){let n=this.cache[t];n?.program&&this.context.gl.deleteProgram(n.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}},rX=class extends Error{constructor(t,n){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=t,this.statusMessage=n?.statusMessage??null}};function rZ(t,n){let i=!1,r=null,o,a=()=>{r=null,i&&=(t(...o),r=setTimeout(a,n),!1)};return(...t)=>(i=!0,o=t,r||a(),r)}var rK=class{constructor(t){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 n=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:n,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 n=Array.from(t.keys());n.length>0&&t.delete(n[0])}let n=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=n?`#${n}`:"",r=window.location.href.replace(/(#.+)?$/,i);r=r.replace("&&","&"),window.history.replaceState(window.history.state,null,r)},this._updateHash=rZ(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,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(t){let n=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=10**Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.round(n.lng*r)/r,a=Math.round(n.lat*r)/r,s=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=t?`/${o}/${a}/${i}`:`${i}/${a}/${o}`,(s||l)&&(c+=`/${Math.round(10*s)/10}`),l&&(c+=`/${Math.round(l)}`),this._hashName){let t=this._getHashParams();return t.set(this._hashName,c),`#${decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${c}`}_isValidHash(t){if(t.length<3||t.some(t=>isNaN(+t)))return!1;try{new E.st(+t[2],+t[1])}catch{return!1}let n=+t[0],i=+(t[3]||0),r=+(t[4]||0);return n>=this._map.getMinZoom()&&n<=this._map.getMaxZoom()&&i>=-180&&i<=180&&r>=this._map.getMinPitch()&&r<=this._map.getMaxPitch()}};let rJ={linearity:.3,easing:(0,E.Bn)(0,0,.3,1)},rQ=(0,E.tr)({deceleration:2500,maxSpeed:1400},rJ),r0=(0,E.tr)({deceleration:20,maxSpeed:1400},rJ),r1=(0,E.tr)({deceleration:1e3,maxSpeed:360},rJ),r2=(0,E.tr)({deceleration:1e3,maxSpeed:90},rJ),r3=(0,E.tr)({deceleration:1e3,maxSpeed:360},rJ);var r5=class{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:S(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,n=S();for(;t.length>0&&n-t[0].time>160;)t.shift()}_getVelocityEntries(){let t=this._inertiaBuffer,n=S()-60,i=Math.max(0,t.length-2);for(;i>0&&t[i-1].time>=n;)i--;return t.slice(i)}_onMoveEnd(t){this._drainInertiaBuffer();let n=this._getVelocityEntries();if(n.length<2)return void this.clear();let i={zoom:0,bearing:0,pitch:0,roll:0,pan:new E.Ri(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of n)t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);for(let{settings:t}of n.slice(1))i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,i.roll+=t.rollDelta||0,t.panDelta&&i.pan._add(t.panDelta);if(!i.pan.mag()&&!i.zoom&&!i.bearing&&!i.pitch&&!i.roll)return void this.clear();let r=S()-n[0].time,o={};if(i.pan.mag()){let n=r6(i.pan.mag(),r,(0,E.tr)({},rQ,t||{})),a=i.pan.mult(n.amount/i.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(a,this._map._camera.transform);o.center=s.easingCenter,o.offset=s.easingOffset,r4(o,n)}if(i.zoom){let t=r6(i.zoom,r,r0);o.zoom=(0,E.er)(this._map.getZoom()+t.amount,this._map.getZoomSnap(),t.amount),r4(o,t)}if(i.bearing){let t=r6(i.bearing,r,r1);o.bearing=this._map.getBearing()+(0,E.Vn)(t.amount,-179,179),r4(o,t)}if(i.pitch){let t=r6(i.pitch,r,r2);o.pitch=this._map.getPitch()+t.amount,r4(o,t)}if(i.roll){let t=r6(i.roll,r,r3);o.roll=this._map.getRoll()+(0,E.Vn)(t.amount,-179,179),r4(o,t)}if(o.zoom||o.bearing){let t=void 0===i.pinchAround?i.around:i.pinchAround;o.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),(0,E.tr)(o,{noMoveStart:!0})}};function r4(t,n){(!t.duration||t.duration<n.duration)&&(t.duration=n.duration,t.easing=n.easing)}function r6(t,n,i){let{maxSpeed:r,linearity:o,deceleration:a}=i,s=(0,E.Vn)(t*o/(n/1e3),-r,r),l=Math.abs(s)/(a*o);return{easing:i.easing,duration:1e3*l,amount:l/2*s}}var r8=class{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new V(this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new U(t.type,this._map,t))}mouseup(t){this._map.fire(new U(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new U(t.type,this._map,t))}dblclick(t){return this._firePreventable(new U(t.type,this._map,t))}mouseover(t){this._map.fire(new U(t.type,this._map,t))}mouseout(t){this._map.fire(new U(t.type,this._map,t))}touchstart(t){return this._firePreventable(new j(t.type,this._map,t))}touchmove(t){this._map.fire(new j(t.type,this._map,t))}touchend(t){this._map.fire(new j(t.type,this._map,t))}touchcancel(t){this._map.fire(new j(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},r7=class{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new U(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new U("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new U(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},r9=class{constructor(t,n,i){this._map=t,this._tr=i,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1,n.boxZoom&&"object"==typeof n.boxZoom&&(this._boxZoomEnd=n.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&0===t.button&&(R.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active||this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=n,this._box||(this._box=R.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let r=Math.min(i.x,n.x),o=Math.max(i.x,n.x),a=Math.min(i.y,n.y),s=Math.max(i.y,n.y);this._box.style.transform=`translate(${r}px,${a}px)`,this._box.style.width=`${o-r}px`,this._box.style.height=`${s-a}px`}mouseupWindow(t,n){if(!this._active||0!==t.button)return;let i=this._startPos;if(this.reset(),R.suppressClick(),i.x!==n.x||i.y!==n.y)return(this._map.fire(new $("boxzoomend",{originalEvent:t})),this._boxZoomEnd)?void this._boxZoomEnd(this._map,i,n,t):{cameraAnimation:t=>t.fitScreenCoordinates(i,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&=(this._box.remove(),null),R.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new $(t,{originalEvent:n}))}};function oe(t,n){if(t.length!==n.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${n.length}`);let i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=n[r];return i}var ot=class{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,n,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){let n=new E.Ri(0,0);for(let i of t)n._add(i);return n.div(t.length)}(n),this.touches=oe(i,n)))}touchmove(t,n,i){if(this.aborted||!this.centroid)return;let r=oe(i,n);for(let t in this.touches){let n=this.touches[t],i=r[t];(!i||i.dist(n)>30)&&(this.aborted=!0)}}touchend(t,n,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}},on=class{constructor(t){this.singleTap=new ot(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,i){this.singleTap.touchstart(t,n,i)}touchmove(t,n,i){this.singleTap.touchmove(t,n,i)}touchend(t,n,i){let r=this.singleTap.touchend(t,n,i);if(r){let n=t.timeStamp-this.lastTime<500,i=!this.lastTap||30>this.lastTap.dist(r);if(n&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}},oi=class{constructor(t,n){this._tr=n,this._zoomIn=new on({numTouches:1,numTaps:2}),this._zoomOut=new on({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,i){this._zoomIn.touchstart(t,n,i),this._zoomOut.touchstart(t,n,i)}touchmove(t,n,i){this._zoomIn.touchmove(t,n,i),this._zoomOut.touchmove(t,n,i)}touchend(t,n,i){let r=this._zoomIn.touchend(t,n,i),o=this._zoomOut.touchend(t,n,i),a=this._tr;return r?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:(0,E.er)(a.zoom+1,n.getZoomSnap()),around:a.unproject(r)},{originalEvent:t})}):o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:(0,E.er)(a.zoom-1,n.getZoomSnap()),around:a.unproject(o)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},or=class{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.rollDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(n)?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let r=Array.isArray(n)?n[0]:n;if(!(!this._moved&&r.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=r,this._move(i,r)}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&R.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}};let oo={0:1,2:2};var oa=class{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){let n;return n=oo[this._eventButton],void 0!==t.buttons&&(t.buttons&n)===n}isValidEndEvent(t){return t.button===this._eventButton}},os=class{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}},ol=class{constructor(t=new oa({checkCorrectEvent:()=>!0}),n=new os){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,i){return t instanceof MouseEvent?n(t):"u">typeof TouchEvent&&t instanceof TouchEvent?i(t):void 0}startMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.startMove(t)},t=>{this.oneFingerTouchMoveStateManager.startMove(t)})}endMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.endMove(t)},t=>{this.oneFingerTouchMoveStateManager.endMove(t)})}isValidStartEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}};let oc=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};var od=class{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new E.Ri(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,n,i){return this._calculateTransform(t,n,i)}touchmove(t,n,i){if(this._active)return this._shouldBePrevented(i.length)?void this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t):(t.preventDefault(),this._calculateTransform(t,n,i))}touchend(t,n,i){this._calculateTransform(t,n,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,n,i){i.length>0&&(this._active=!0);let r=oe(i,n),o=new E.Ri(0,0),a=new E.Ri(0,0),s=0;for(let t in r){let n=r[t],i=this._touches[t];i&&(o._add(n),a._add(n.sub(i)),s++,r[t]=n)}if(this._touches=r,this._shouldBePrevented(s)||!a.mag())return;let l=a.div(s);if(this._sum._add(l),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},ou=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,n,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([n[0],n[1]]))}touchmove(t,n,i){if(!this._firstTwoTouches)return;t.preventDefault();let[r,o]=this._firstTwoTouches,a=oh(i,n,r),s=oh(i,n,o);if(!a||!s)return;let l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,t)}touchend(t,n,i){if(!this._firstTwoTouches)return;let[r,o]=this._firstTwoTouches,a=oh(i,n,r),s=oh(i,n,o);a&&s||(this._active&&R.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function oh(t,n,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return n[r]}function om(t,n){return Math.log(t/n)/Math.LN2}var op=class extends ou{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(t){this._zoomRate=t??1}setZoomThreshold(t){this._zoomThreshold=t??.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,n){let i=this._distance;if(this._distance=t[0].dist(t[1]),!(!this._active&&Math.abs(om(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:om(this._distance,i)*this._zoomRate,pinchAround:n}}};function of(t,n){return 180*t.angleWith(n)/Math.PI}var ob=class extends ou{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,n,i){let r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:of(this._vector,r),pinchAround:n}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let n=25/(Math.PI*this._minDiameter)*360;return Math.abs(of(t,this._startVector))<n}};function og(t){return Math.abs(t.y)>Math.abs(t.x)}var o_=class extends ou{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,i){super.touchstart(t,n,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,og(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,o,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:-((r.y+o.y)/2*.5)}}gestureBeginsVertically(t,n,i){if(void 0!==this._valid)return this._valid;let r=t.mag()>=2,o=n.mag()>=2;if(!r&&!o)return;if(!r||!o)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let a=t.y>0==n.y>0;return og(t)&&og(n)&&a}};let oy=100,ov=15,ox=10;var oF=class{constructor(t,n){this._tr=n,this._panStep=oy,this._bearingStep=ov,this._pitchStep=ox,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,i=0,r=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:ow,zoom:n?(0,E.er)(l.zoom+n*(t.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+i*this._bearingStep,pitch:l.pitch+r*this._pitchStep,offset:[-o*this._panStep,-a*this._panStep],center:l.center},{originalEvent:t})}}}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 ow(t){return t*(2-t)}var oE=class{constructor(t,n,i){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=i,this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=S(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&4>Math.abs(n)?this._type="trackpad":r>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(r*n)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=R.mousePos(this._map.getCanvas(),t),i=this._tr;this._aroundPoint=this._aroundCenter?i.transform.locationToScreenPoint(E.st.convert(i.center)):n,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let n=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=n),"number"==typeof this._targetZoom&&(this._targetZoom+=n)}if(0!==this._delta){let n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);let r="number"==typeof this._targetZoom?(0,E.Ir)(this._targetZoom):t.scale,o=t.applyConstrain(t.getCameraLngLat(),(0,E.Or)(r*i)).zoom,a=this._map.getZoomSnap();if("wheel"===this._type&&a>0){let n=(0,E.er)(t.zoom,a);this._targetZoom=(0,E.er)(o,a,o-n)}else this._targetZoom=o;"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n="number"==typeof this._targetZoom?this._targetZoom:t.zoom,i=this._startZoom,r=this._easing,o=!1,a;if("wheel"===this._type&&i&&r){let t=Math.min((S()-this._lastWheelEventTime+5)/200,1),s=r(t);a=E.dn.number(i,n,s),t<1?this._needsRerender=!0:o=!0}else a=n,o=!0;return this._active=!0,o&&(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:!o,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=E.Yn;if(this._prevEase){let t=this._prevEase,i=(S()-t.start)/t.duration,r=t.easing(i+.01)-t.easing(i),o=.27/Math.sqrt(r*r+1e-4)*.01,a=Math.sqrt(.0729-o*o);n=(0,E.Bn)(o,a,.25,1)}return this._prevEase={start:S(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},oC=class{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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()}},oA=class{constructor(t,n){this._tr=n,this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:(0,E.er)(this._tr.zoom+(t.shiftKey?-1:1),i.getZoomSnap()),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},ok=class{constructor(){this._tap=new on({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,i){if(!this._swipePoint)if(this._tapTime){let r=n[0],o=t.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(r);o&&a?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,n,i)}touchmove(t,n,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let r=n[0],o=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:o/128*this._zoomRate}}}else this._tap.touchmove(t,n,i)}touchend(t,n,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{let r=this._tap.touchend(t,n,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},oT=class{constructor(t,n,i){this._el=t,this._mousePan=n,this._touchPan=i}enable(t){this._inertiaOptions=t||{},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()}},oS=class{constructor(t,n,i,r){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=n,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},oI=class{constructor(t,n,i,r){this._el=t,this._touchZoom=n,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},oD=class{constructor(t,n){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=R.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=n,this._container.appendChild(r);let o=document.createElement("div");o.className="maplibregl-mobile-message",o.textContent=i,this._container.appendChild(o),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(t){return t[this._bypassKey]}notifyGestureBlocked(t,n){this._enabled&&(this._map.fire(new M("cooperativegestureprevented",{gestureType:t,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},oP=class{constructor(t){this._camera=t}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(t){return this.transform.screenPointToLocation(E.Ri.convert(t),this._camera.terrain)}};let oR=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;var oO=class extends E.vn{};function oM(t){return t.panDelta?.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}var oL=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(t,n,i){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,n)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let i="renderFrame"===t.type?void 0:t,r={needsRenderFrame:!1},o={},a={};for(let{handlerName:s,handler:l,allowed:c}of this._handlers){let d;if(l.isEnabled()){if(this._blockedByActive(a,c,s))l.reset();else if(l[n||t.type]){if((0,E.ur)(t,n||t.type)){let i=R.mousePos(this._map.getCanvas(),t);d=l[n||t.type](t,i)}else if((0,E.fr)(t,n||t.type)){let i=t.touches,r=this._getMapTouches(i),o=R.touchPos(this._map.getCanvas(),r);d=l[n||t.type](t,o,r)}else(0,E.pr)(n||t.type)||(d=l[n||t.type](t));this.mergeHandlerResult(r,o,d,s,i),d?.needsRenderFrame&&this._triggerRenderFrame()}(d||l.isActive())&&(a[s]=l)}}let s={};for(let t in this._previousActiveHandlers)a[t]||(s[t]=i);this._previousActiveHandlers=a,(Object.keys(s).length||oM(r))&&(this._changes.push([r,o,s]),this._triggerRenderFrame()),(Object.keys(a).length||oM(r))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:l}=r;l&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],l(this._map))},this._map=t,this._camera=n,this._transformProvider=new oP(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new r5(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);let r=this._el;for(let[t,n,i]of(this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]],this._listeners))t.addEventListener(n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[t,n,i]of this._listeners)t.removeEventListener(n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let n=this._map,i=n.getCanvasContainer();this._add("mapEvent",new r8(n,t));let r=n.boxZoom=new r9(n,t,this._transformProvider);this._add("boxZoom",r),t.interactive&&t.boxZoom&&r.enable();let o=n.cooperativeGestures=new oD(n,t.cooperativeGestures);this._add("cooperativeGestures",o),t.cooperativeGestures&&o.enable();let a=new oi(n,this._transformProvider),s=new oA(n,this._transformProvider);n.doubleClickZoom=new oC(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();let l=new ok;this._add("tapDragZoom",l);let c=n.touchPitch=new o_(n);this._add("touchPitch",c),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);let d=()=>n.project(n.getCenter()),u=function({enable:t,clickTolerance:n,aroundCenter:i=!0,minPixelCenterThreshold:r=100,rotateSpeed:o=.8},a){return new or({clickTolerance:n,move:(t,n)=>{let s=a();if(i&&Math.abs(s.y-t.y)>r)return{bearingDelta:(0,E.ar)(new E.Ri(t.x,n.y),n,s)};let l=(n.x-t.x)*o;return i&&n.y<s.y&&(l=-l),{bearingDelta:l}},moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button&&!t.ctrlKey}),enable:t,assignEvents:oc})}(t,d),h=function({enable:t,clickTolerance:n,pitchSpeed:i=-.5}){return new or({clickTolerance:n,move:(t,n)=>({pitchDelta:(n.y-t.y)*i}),moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button}),enable:t,assignEvents:oc})}(t),m=function({enable:t,clickTolerance:n,rollDegreesPerPixelMoved:i=.3},r){return new or({clickTolerance:n,move:(t,n)=>{let o=r(),a=(n.x-t.x)*i;return n.y<o.y&&(a=-a),{rollDelta:a}},moveStateManager:new oa({checkCorrectEvent:t=>2===t.button&&t.ctrlKey}),enable:t,assignEvents:oc})}(t,d);n.dragRotate=new oS(t,u,h,m),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",m,["mousePitch"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();let p=function({enable:t,clickTolerance:n}){return new or({clickTolerance:n,move:(t,n)=>({around:n,panDelta:n.sub(t)}),activateOnStart:!0,moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&!t.ctrlKey}),enable:t,assignEvents:oc})}(t),f=new od(t,n);n.dragPan=new oT(i,p,f),this._add("mousePan",p),this._add("touchPan",f,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);let b=new ob,g=new op;n.touchZoomRotate=new oI(i,g,b,l),this._add("touchRotate",b,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new r7(n));let _=n.scrollZoom=new oE(n,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",_,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);let y=n.keyboard=new oF(n,this._transformProvider);this._add("keyboard",y),t.interactive&&t.keyboard&&n.keyboard.enable()}_add(t,n,i){this._handlers.push({handlerName:t,handler:n,allowed:i}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!oR(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,i){for(let r in t)if(r!==i&&!n?.includes(r))return!0;return!1}_getMapTouches(t){let n=[];for(let i of t){let t=i.target;this._el.contains(t)&&n.push(i)}return n}mergeHandlerResult(t,n,i,r,o){if(!i)return;(0,E.tr)(t,i);let a={handlerName:r,originalEvent:i.originalEvent||o};void 0!==i.zoomDelta&&(n.zoom=a),void 0!==i.panDelta&&(n.drag=a),void 0!==i.rollDelta&&(n.roll=a),void 0!==i.pitchDelta&&(n.pitch=a),void 0!==i.bearingDelta&&(n.rotate=a)}_applyChanges(){let t={},n={},i={};for(let[r,o,a]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new E.Ri(0,0))._add(r.panDelta)),r.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+r.pitchDelta),r.rollDelta&&(t.rollDelta=(t.rollDelta||0)+r.rollDelta),void 0!==r.around&&(t.around=r.around),void 0!==r.pinchAround&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),(0,E.tr)(n,o),(0,E.tr)(i,a);this._updateMapTransform(t,n,i),this._changes=[]}_updateMapTransform(t,n,i){let r=this._map,o=this._camera.getTransformForUpdate(),a=r.terrain;if(!oM(t)&&!(a&&this._terrainMovement))return void this._fireEvents(n,i,!0);this._camera.stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:d,rollDelta:u}=t,{around:h,aroundOnSurface:m}=this._resolveAround(t,a,o),p=a?this._terrainGestureElevation(a,h,m,o,n):void 0,f={panDelta:s,zoomDelta:l,rollDelta:u,pitchDelta:d,bearingDelta:c,around:h,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!o.isPointOnMapSurface(h)&&(h=o.centerPoint);let b=this._computePreZoomAroundLoc(o,h,s,p);this._handleMapControls({terrain:a,tr:o,deltasForHelper:f,preZoomAroundLoc:b,combinedEventsInProgress:n,panDelta:s}),this._camera.applyUpdatedTransform(o),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,i,!0)}_resolveAround(t,n,i){let r=void 0===t.pinchAround?t.around:t.pinchAround;return r||=this._camera.transform.centerPoint,n&&!i.isPointOnMapSurface(r)?{around:i.centerPoint,aroundOnSurface:!1}:{around:r,aroundOnSurface:!0}}_terrainGestureElevation(t,n,i,r,o){if(!i)return;if(!this._terrainMovement&&(o.drag||o.zoom)){let i=r.screenTerrainPointToMercatorCoordinate(n,t);this._terrainGestureAnchorElevation=i?i.z:null}if(null===this._terrainGestureAnchorElevation)return;let a=this._terrainGestureAnchorElevation;if(!(.01>n.distSqr(r.centerPoint))&&!(a-r.elevation>=.9*(r.getCameraAltitude()-r.elevation)))return a}_computePreZoomAroundLoc(t,n,i,r){if(.01>n.distSqr(t.centerPoint))return t.center;let o=i?n.sub(i):n;return void 0===r?t.screenPointToLocation(o):t.screenPointToLocationAtElevation(o,r)}_handleMapControls({terrain:t,tr:n,deltasForHelper:i,preZoomAroundLoc:r,combinedEventsInProgress:o,panDelta:a}){let s=this._camera.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(i,n),!t)return void s.handleMapControlsPan(i,n,r);if(s.useGlobeControls){!this._terrainMovement&&(o.drag||o.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),s.handleMapControlsPan(i,n,r);return}if(!this._terrainMovement&&(o.drag||o.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,s.handleMapControlsPan(i,n,r);return}void 0===i.aroundElevation&&o.drag&&this._terrainMovement&&a?n.setCenter(n.screenPointToLocation(n.centerPoint.sub(a))):s.handleMapControlsPan(i,n,r)}_fireEvents(t,n,i){let r=oR(this._eventsInProgress),o=oR(t),a={};for(let n in t){let{originalEvent:i}=t[n];this._eventsInProgress[n]||(a[`${n}start`]=i),this._eventsInProgress[n]=t[n]}for(let t in!r&&o&&this._fireEvent("movestart",o.originalEvent),a)this._fireEvent(t,a[t]);for(let n in o&&this._fireEvent("move",o.originalEvent),t){let{originalEvent:i}=t[n];this._fireEvent(n,i)}let s={},l;for(let t in this._eventsInProgress){let{handlerName:i,originalEvent:r}=this._eventsInProgress[t];this._handlersById[i].isActive()||(delete this._eventsInProgress[t],l=n[i]||r,s[`${t}end`]=l)}for(let t in s)this._fireEvent(t,s[t]);let c=oR(this._eventsInProgress),d=(r||o)&&!c;if(d&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let t=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(t)}if(i&&d){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t&&(t.essential||!k.prefersReducedMotion)?(n(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new L("moveend",{originalEvent:l})),n(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,n){this._map.fire(new L(t,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new oO("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}},oB=class extends E.yn{constructor(t){super(),this._renderFrameCallback=()=>{let t=Math.min((S()-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=new n_,this.cameraHelper=new nE,void 0!==t.minZoom&&this.transform.setMinZoom(t.minZoom),void 0!==t.maxZoom&&this.transform.setMaxZoom(t.maxZoom),void 0!==t.minPitch&&this.transform.setMinPitch(t.minPitch),void 0!==t.maxPitch&&this.transform.setMaxPitch(t.maxPitch),void 0!==t.renderWorldCopies&&this.transform.setRenderWorldCopies(t.renderWorldCopies),null!==t.transformConstrain&&this.transform.setConstrainOverride(t.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=t.bearingSnap,this._zoomSnap=t.zoomSnap,this._requestRenderFrame=t.requestRenderFrame,this._cancelRenderFrame=t.cancelRenderFrame,this.terrain=t.terrain,this._centerClampedToGround=t.centerClampedToGround??!0,this.transformCameraUpdate=t.transformCameraUpdate??null,this._stopHandlers=t.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,n){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=n}getCenter(){return new E.st(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,n){return this.jumpTo({elevation:t},n),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,n,i){return t=E.Ri.convert(t).mult(-1),this.panTo(this.transform.center,(0,E.tr)({offset:t},n),i)}panTo(t,n,i){return this.easeTo((0,E.tr)({center:t},n),i)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,i){return this.easeTo((0,E.tr)({zoom:t},n),i)}zoomIn(t,n){return this.zoomTo((0,E.er)(this.getZoom()+1,this._zoomSnap),t,n),this}zoomOut(t,n){return this.zoomTo((0,E.er)(this.getZoom()-1,this._zoomSnap),t,n),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,n){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new L("movestart",n)).fire(new L("move",n)).fire(new L("moveend",n))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,i){return this.easeTo((0,E.tr)({bearing:t},n),i)}resetNorth(t,n){return this.rotateTo(0,(0,E.tr)({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo((0,E.tr)({bearing:0,pitch:0,roll:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,n):this}getPitch(){return this.transform.pitch}setPitch(t,n){return this.jumpTo({pitch:t},n),this}getRoll(){return this.transform.roll}setRoll(t,n){return this.jumpTo({roll:t},n),this}cameraForBounds(t,n){t=eL.convert(t).adjustAntiMeridian();let i=n?.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,n)}_cameraForBoxAndBearing(t,n,i,r){let o={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=(0,E.tr)({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){let t=r.padding;r.padding={top:t,bottom:t,right:t,left:t}}let a=(0,E.tr)(o,r.padding);r.padding=a;let s=this.transform,l=new eL(t,n),c=this.cameraHelper.cameraForBoxAndBearing(r,a,l,i,s);return c&&this._zoomSnap&&(c.zoom=(0,E.er)(c.zoom,this._zoomSnap,-1)),c}fitBounds(t,n,i){return this._fitInternal(this.cameraForBounds(t,n),n,i)}fitScreenCoordinates(t,n,i,r,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(E.Ri.convert(t)),this.transform.screenPointToLocation(E.Ri.convert(n)),i,r),r,o)}_fitInternal(t,n,i){return t?(n=(0,E.tr)(t,n),delete n.padding,n.linear?this.easeTo(n,i):this.flyTo(n,i)):this}jumpTo(t,n){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=!1,o=!1,a=!1,s=i.zoom;this.terrain&&i.setElevation(this.terrain.getElevationForLngLat(t.center?E.st.convert(t.center):i.center,i)),this.cameraHelper.handleJumpToCenterZoom(i,t);let l=i.zoom!==s;return"elevation"in t&&i.elevation!==+t.elevation&&i.setElevation(+t.elevation),"bearing"in t&&i.bearing!==+t.bearing&&(r=!0,i.setBearing(+t.bearing)),"pitch"in t&&i.pitch!==+t.pitch&&(o=!0,i.setPitch(+t.pitch)),"roll"in t&&i.roll!==+t.roll&&(a=!0,i.setRoll(+t.roll)),null==t.padding||i.isPaddingEqual(t.padding)||i.setPadding(t.padding),this.applyUpdatedTransform(i),this.fire(new L("movestart",n)).fire(new L("move",n)),l&&this.fire(new L("zoomstart",n)).fire(new L("zoom",n)).fire(new L("zoomend",n)),r&&this.fire(new L("rotatestart",n)).fire(new L("rotate",n)).fire(new L("rotateend",n)),o&&this.fire(new L("pitchstart",n)).fire(new L("pitch",n)).fire(new L("pitchend",n)),a&&this.fire(new L("rollstart",n)).fire(new L("roll",n)).fire(new L("rollend",n)),this.fire(new L("moveend",n))}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,i,r,o){let a=this.transform.calculateCenterFromCameraLngLatAlt(t,n,i,r);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:i,pitch:r,roll:o}}easeTo(t,n){this._stop(!1,t.easeId),"zoom"in(t=(0,E.tr)({offset:[0,0],duration:500,easing:E.Yn},t))&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap)),(!1===t.animate||!t.essential&&k.prefersReducedMotion)&&(t.duration=0);let i=this.getTransformForUpdate(),r=this.getBearing(),o=i.pitch,a=i.roll,s="bearing"in t?this._normalizeBearing(t.bearing,r):r,l="pitch"in t?+t.pitch:o,c="roll"in t?this._normalizeBearing(t.roll,a):a,d="padding"in t?t.padding:i.padding,u=E.Ri.convert(t.offset),h,m;t.around&&(h=E.st.convert(t.around),m=i.locationToScreenPoint(h));let p={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},f=this.cameraHelper.handleEaseTo(i,{bearing:s,pitch:l,roll:c,padding:d,around:h,aroundPoint:m,offsetAsPoint:u,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||=r!==s,this._pitching||=l!==o,this._rolling||=c!==a,this._padding=!i.isPaddingEqual(d),this._zooming||=f.isZooming,this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,p),this.terrain&&this._prepareElevation(f.elevationCenter),this._ease(r=>{f.easeFunc(r),this.terrain&&!t.freezeElevation&&this._updateElevation(r),this.applyUpdatedTransform(i),this._fireMoveEvents(n)},i=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n,i)},t),this}_prepareEase(t,n,i={}){this._moving=!0,n||i.moving||this.fire(new L("movestart",t)),this._zooming&&!i.zooming&&this.fire(new L("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new L("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new L("pitchstart",t)),this._rolling&&!i.rolling&&this.fire(new L("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(t,this.transform),this.elevationFreeze=!0}_updateElevation(t){(void 0===this._elevationStart||void 0===this._elevationCenter)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let n=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(t<1&&n!==this._elevationTarget){let i=this._elevationTarget-this._elevationStart,r=(n-(i*t+this._elevationStart))/(1-t);this._elevationStart+=t*(i-r),this._elevationTarget=n}this.transform.setElevation(E.dn.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let n=t.getCameraLngLat(),i=t.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(n,t.zoom):0;if(i<r){let i=t.calculateCameraOptionsFromTo(n,r,t.center,t.elevation);return{pitch:i.pitch,zoom:i.zoom}}return{}}applyUpdatedTransform(t){let n=[];if(n.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&n.push(t=>this.transformCameraUpdate(t)),!n.length)return;let i=t.clone();for(let t of n){let n=i.clone(),{center:r,zoom:o,roll:a,pitch:s,bearing:l,elevation:c}=t(n);r&&n.setCenter(r),void 0!==c&&n.setElevation(c),void 0!==o&&n.setZoom(o),void 0!==a&&n.setRoll(a),void 0!==s&&n.setPitch(s),void 0!==l&&n.setBearing(l),i.apply(n,!1)}this.transform.apply(i,!1)}_fireMoveEvents(t){this.fire(new L("move",t)),this._zooming&&this.fire(new L("zoom",t)),this._rotating&&this.fire(new L("rotate",t)),this._pitching&&this.fire(new L("pitch",t)),this._rolling&&this.fire(new L("roll",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let i=this._zooming,r=this._rotating,o=this._pitching,a=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,i&&this.fire(new L("zoomend",t)),r&&this.fire(new L("rotateend",t)),o&&this.fire(new L("pitchend",t)),a&&this.fire(new L("rollend",t)),this.fire(new L("moveend",t))}flyTo(t,n){if(!t.essential&&k.prefersReducedMotion){let i=(0,E.br)(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(i,n)}this.stop(),"zoom"in(t=(0,E.tr)({offset:[0,0],speed:1.2,curve:1.42,easing:E.Yn},t))&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=i.bearing,o=i.pitch,a=i.roll,s=i.padding,l="bearing"in t?this._normalizeBearing(t.bearing,r):r,c="pitch"in t?+t.pitch:o,d="roll"in t?this._normalizeBearing(t.roll,a):a,u="padding"in t?t.padding:i.padding,h=E.Ri.convert(t.offset),m=i.centerPoint.add(h),p=i.screenPointToLocation(m),f=this.cameraHelper.handleFlyTo(i,{bearing:l,pitch:c,roll:d,padding:u,locationAtOffset:p,offsetAsPoint:h,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),b=t.curve,g=Math.max(i.width,i.height),_=g/f.scaleOfZoom,y=f.pixelPathLength,v=g/f.scaleOfMinZoom,x=(b=Math.min(b,Math.sqrt(v/y*2)))*b;function F(t){let n=(_*_-g*g+(t?-1:1)*x*x*y*y)/(2*(t?_:g)*x*y);return Math.log(Math.sqrt(n*n+1)-n)}function w(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}let A=F(!1),T=function(t){return C(A)/C(A+b*t)},S=function(t){var n;return g*((C(A)*(w(n=A+b*t)/C(n))-w(A))/x)/y},I=(F(!0)-A)/b;if(2e-6>Math.abs(y)||!isFinite(I)){if(1e-6>Math.abs(g-_))return this.easeTo(t,n);let i=_<g?-1:1;I=Math.abs(Math.log(_/g))/b,S=()=>0,T=t=>Math.exp(i*b*t)}if("duration"in t)t.duration=+t.duration;else{let n="screenSpeed"in t?t.screenSpeed/b:+t.speed;t.duration=1e3*I/n}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=r!==l,this._pitching=c!==o,this._rolling=d!==a,this._padding=!i.isPaddingEqual(u),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(f.targetCenter),this._ease(p=>{let b=p*I,g=1/T(b),_=S(b);this._rotating&&i.setBearing(E.dn.number(r,l,p)),this._pitching&&i.setPitch(E.dn.number(o,c,p)),this._rolling&&i.setRoll(E.dn.number(a,d,p)),this._padding&&(i.interpolatePadding(s,u,p),m=i.centerPoint.add(h)),f.easeFunc(p,g,_,m),this.terrain&&!t.freezeElevation&&this._updateElevation(p),this.applyUpdatedTransform(i),this._fireMoveEvents(n)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(t){return this._stop(t)}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,n)}return t||this._stopHandlers(),this}_ease(t,n,i){!1===i.animate||0===i.duration?(t(1),n()):(this._easeStart=S(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){let i=Math.abs((t=(0,E.Fr)(t,-180,180))-n);return Math.abs(t-360-n)<i&&(t-=360),Math.abs(t+360-n)<i&&(t+=360),t}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};let oz={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};var oN=class{constructor(t=oz){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&&("terrain"===t.type||"style"===t.dataType||"source"===t.dataType&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=R.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=R.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=R.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(t,n){let i=this._map._getUIString(`AttributionControl.${n}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"==typeof t?t:"")):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let n=this._map.style.tileManagers;for(let i in n){let r=n[i];if(r.used||r.usedForTerrain){let n=r.getSource();n.attribution&&!t.includes(n.attribution)&&t.push(n.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,n)=>t.length-n.length);let i=(t=t.filter((n,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].includes(n))return!1;return!0})).join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=R.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}},oU=class{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let n=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options?.compact,this._container=R.create("div","maplibregl-ctrl");let n=R.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),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}},oj=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){let n=this._currentlyRunning;for(let i of n?this._queue.concat(n):this._queue)if(i.id===t){i.cancelled=!0;return}}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let n=this._currentlyRunning=this._queue;this._queue=[];let i=!1,r;for(let o of n)if(!o.cancelled){try{o.callback(t)}catch(t){i||(i=!0,r=t)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,i)throw r}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},oV=class{constructor(t,n,i){this._tileKeys=t.map(t=>t.key).sort().join(),this._revision=n,this._zoom=i}equals(t){return this.equalsIgnoringZoom(t)&&this._zoom===t._zoom}equalsIgnoringZoom(t){return void 0!==t&&this._tileKeys===t._tileKeys&&this._revision===t._revision}};let o$={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};var oq=class{constructor(t,n){this.needsFollowUpFrame=!1,this.painter=t,this.terrain=n,this.rttSize=n.tileManager.tileSize*n.qualityFactor}getTexture(t){return t.getRTT(this._stacks.length-1).texture}prepareForRender(t,n){let i=n!==this._lastPrepareZoom;this._lastPrepareZoom=n,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(n));let r=new Set;for(let n of this._renderableLayerIds){let i=t._layers[n],o=i.source;o&&o$[i.type]&&r.add(o)}for(let i of(this._coordsAscending={},this._rttFingerprints={},r)){let r=t.tileManagers[i];if(!r)continue;this._coordsAscending[i]={};let o=this._coordsAscending[i],a=r.getSource(),s=a instanceof eJ?a.terrainTileRanges:null;for(let t of r.getVisibleCoordinates()){let n=this.terrain.tileManager.getTerrainCoords(t,s);for(let t in n)o[t]||=[],o[t].push(n[t])}this._rttFingerprints[i]={};let l=this._rttFingerprints[i],c=r.getState().revision;for(let t in o)l[t]=new oV(o[t],c,n)}for(let t of(this.needsFollowUpFrame=!1,this._renderableTiles))for(let n in this._rttFingerprints){let r=this._rttFingerprints[n][t.tileID.key],o=t.rttFingerprint[n];r&&!r.equals(o)&&(i&&r.equalsIgnoringZoom(o)?this.needsFollowUpFrame=!0:t.releaseRTT(this.painter))}}renderLayer(t,n){if(t.isHidden(this.painter.transform.zoom))return!1;let i={...n,isRenderingToTexture:!0},r=t.type,o=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(o$[r]&&(this._prevType&&o$[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(t.id),!a))return!0;if(o$[this._prevType]||o$[r]&&a){this._prevType=r;let t=this._stacks.length-1,n=this._stacks[t]||[];for(let r of this._renderableTiles){if(this._rttTiles.push(r),r.getRTT(t))continue;let a=r.acquireRTT(o,t,this.rttSize);for(let t of(o.bindRTT(a),o.context.clear({color:E.pn.transparent,stencil:0}),o.currentStencilSource=void 0,n)){let n=o.style._layers[t],a=n.source?this._coordsAscending[n.source][r.tileID.key]:[r.tileID];o.context.viewport.set([0,0,this.rttSize,this.rttSize]),o.renderTileClippingMasks(n,a,!0),o.renderLayer(o,o.style.tileManagers[n.source],n,a,i),n.source&&(r.rttFingerprint[n.source]=this._rttFingerprints[n.source][r.tileID.key])}a.texture.generateMipmap()}return function(t,n,i,r){let{isRenderingGlobe:o}=r,a=t.context,s=a.gl,l=t.transform,c=t.colorModeForRenderPass(),d=t.getDepthModeFor3D(),u=t.useProgram("terrain");for(let r of(a.bindFramebuffer.set(null),a.viewport.set([0,0,t.width,t.height]),i)){let i=n.getTerrainMesh(r.tileID),h=t.renderToTexture.getTexture(r),m=n.getTerrainData(r.tileID);a.activeTexture.set(s.TEXTURE0),h.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_LINEAR);let p=n3(n.getSkirtLength(l.zoom),l.calculateFogMatrix(r.tileID.toUnwrapped()),t.style.sky,l.pitch,o),f=l.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(a,s.TRIANGLES,d,rb.disabled,c,rg.backCCW,p,m,f,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}(this.painter,this.terrain,this._rttTiles,i),this._rttTiles=[],o$[r]}return!1}};let oG={"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 ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},oH={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:oz,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:E.jn.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,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20};var oW=class extends E.yn{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(t){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new oj,this._controls=[],this._mapId=(0,E.Nr)(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)return void this.fire(new H("webglcontextlost",{originalEvent:t}));for(let t of Object.values(this.style._layers))if("custom"===t.type&&console.warn(`Custom layer with id '${t.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),t._listeners)for(let[n]of Object.entries(t._listeners))console.warn(`Custom layer with id '${t.id}' had event listeners for event '${n}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new H("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style)for(let t in this.style.imageManager.images=this._lostContextStyle.images,this._lostContextStyle.images){let n=this._lostContextStyle.images[t];n.isWebGLImage&&this.style.imageManager.updateImage(t,n,!1)}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(t){this.fire(new E._n(t));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new H("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let n={...oH,...t,canvasContextAttributes:{...oH.canvasContextAttributes,...t.canvasContextAttributes}};if(null!=n.minZoom&&null!=n.maxZoom&&n.minZoom>n.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=n.minPitch&&null!=n.maxPitch&&n.minPitch>n.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=n.minPitch&&n.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=n.maxPitch&&n.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new oB({minZoom:n.minZoom,maxZoom:n.maxZoom,minPitch:n.minPitch,maxPitch:n.maxPitch,bearingSnap:n.bearingSnap,zoomSnap:n.zoomSnap,renderWorldCopies:n.renderWorldCopies,centerClampedToGround:n.centerClampedToGround,terrain:this.terrain,transformConstrain:n.transformConstrain,requestRenderFrame:t=>this._requestRenderFrame(t),cancelRenderFrame:t=>this._cancelRenderFrame(t),transformCameraUpdate:n.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=n.interactive,this._maxTileCacheSize=n.maxTileCacheSize,this._maxTileCacheZoomLevels=n.maxTileCacheZoomLevels,this._canvasContextAttributes={...n.canvasContextAttributes},this._trackResize=!0===n.trackResize,this._terrainSkirtLength=n.terrainSkirtLength,this._refreshExpiredTiles=!0===n.refreshExpiredTiles,this._fadeDuration=n.fadeDuration,this._crossSourceCollisions=!0===n.crossSourceCollisions,this._collectResourceTiming=!0===n.collectResourceTiming,this._locale={...oG,...n.locale},this._clickTolerance=n.clickTolerance,this._overridePixelRatio=n.pixelRatio,this._maxCanvasSize=n.maxCanvasSize,this._zoomLevelsToOverscale=n.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=!0===n.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(n.anisotropicFilterPitch),void 0!==n.reduceMotion&&(k.prefersReducedMotion=n.reduceMotion),this._requestManager=new O(n.transformRequest),this._container=this._resolveContainer(n.container),n.maxBounds&&this.setMaxBounds(n.maxBounds),this._setupContainer();try{this._setupPainter()}catch(t){throw this._cleanupContainer(),t}this._imageQueueHandle=s.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.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new oL(this,this._camera,n),"u">typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let i="string"==typeof n.hash&&n.hash||void 0;this._hash=n.hash?new rK(i).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:n.center,elevation:n.elevation,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,roll:n.roll}),n.bounds&&(this.resize(),this.fitBounds(n.bounds,(0,E.tr)({},n.fitBoundsOptions,{duration:0}))));let r="string"==typeof n.style||n.style?.projection?.type!=="globe";this.resize(null,r),this._localIdeographFontFamily=n.localIdeographFontFamily,this._validateStyle=n.validateStyle,n.style&&this.setStyle(n.style,{localIdeographFontFamily:n.localIdeographFontFamily}),n.attributionControl&&this.addControl(new oN("boolean"==typeof n.attributionControl?void 0:n.attributionControl)),n.maplibreLogo&&this.addControl(new oU,n.logoPosition),this.on("style.load",()=>{if(r||this._resizeTransform(),this._camera.transform.unmodified){let t=(0,E.br)(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}}),this.on("data",t=>{this._update("style"===t.dataType),this.fire("style"===t.dataType?new z("styledata",t):new N("sourcedata",t))}),this.on("dataloading",t=>{this.fire("style"===t.dataType?new z("styledataloading",t):new N("sourcedataloading",t))}),this.on("dataabort",t=>{this.fire(new N("sourcedataabort",t))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,n){return this.style.setGlobalStateProperty(t,n),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,n){if(void 0===n&&(n=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t?.onAdd)return this.fire(new E._n(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let i=t.onAdd(this);this._controls.push(t);let r=this._controlPositions[n];return n.includes("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this}removeControl(t){if(!t?.onRemove)return this.fire(new E._n(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let n=this._controls.indexOf(t);return n>-1&&this._controls.splice(n,1),t.onRemove(this),this}hasControl(t){return this._controls.includes(t)}coveringTiles(t){return tl(this._camera.transform,t)}setTransformCameraUpdate(t){this._camera.transformCameraUpdate=t}getCenter(){return new E.st(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(t,n){return this._camera.setCenter(t,n),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(t,n){return this._camera.setCenterElevation(t,n),this}setCenterClampedToGround(t){this._camera.setCenterClampedToGround(t)}panBy(t,n,i){return this._camera.panBy(t,n,i),this}panTo(t,n,i){return this._camera.panTo(t,n,i),this}getZoom(){return this._camera.transform.zoom}setZoom(t,n){return this._camera.setZoom(t,n),this}zoomTo(t,n,i){return this._camera.zoomTo(t,n,i),this}zoomIn(t,n){return this._camera.zoomIn(t,n),this}zoomOut(t,n){return this._camera.zoomOut(t,n),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(t,n){return this._camera.setVerticalFieldOfView(t,n),this}getBearing(){return this._camera.transform.bearing}setBearing(t,n){return this._camera.setBearing(t,n),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(t){return this._camera.setZoomSnap(t),this}getPadding(){return this._camera.transform.padding}setPadding(t,n){return this._camera.setPadding(t,n),this}rotateTo(t,n,i){return this._camera.rotateTo(t,n,i),this}resetNorth(t,n){return this._camera.resetNorth(t,n),this}resetNorthPitch(t,n){return this._camera.resetNorthPitch(t,n),this}snapToNorth(t,n){return this._camera.snapToNorth(t,n),this}getPitch(){return this._camera.transform.pitch}setPitch(t,n){return this._camera.setPitch(t,n),this}getRoll(){return this._camera.transform.roll}setRoll(t,n){return this._camera.setRoll(t,n),this}cameraForBounds(t,n){return this._camera.cameraForBounds(t,n)}fitBounds(t,n,i){return this._camera.fitBounds(t,n,i),this}fitScreenCoordinates(t,n,i,r,o){return this._camera.fitScreenCoordinates(t,n,i,r,o),this}jumpTo(t,n){return this._camera.jumpTo(t,n),this}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,i,r,o){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(t,n,i,r,o)}easeTo(t,n){return this._camera.easeTo(t,n),this}flyTo(t,n){return this._camera.flyTo(t,n),this}stop(){return this._camera.stop(),this}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(E.st.convert(t),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(t,n,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLat(i,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(t,n,i,r??0)}resize(t,n=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(n);let i=!this._camera._moving;return i&&(this.stop(),this.fire(new L("movestart",t)).fire(new L("move",t))),this.fire(new M("resize",t)),i&&this.fire(new L("moveend",t)),this}_resizeInternal(t=!0){let[n,i]=this._containerDimensions(),r=this._getClampedPixelRatio(n,i);if(this._resizeCanvas(n,i,r),this.painter.resize(n,i,r),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let r=this._getClampedPixelRatio(n,i);this._resizeCanvas(n,i,r),this.painter.resize(n,i,r)}this._resizeTransform(t)}_resizeTransform(t=!0){let[n,i]=this._containerDimensions();this._camera.transform.resize(n,i,t),this._camera._requestedCameraState?.resize(n,i,t)}_getClampedPixelRatio(t,n){let{0:i,1:r}=this._maxCanvasSize,o=this.getPixelRatio(),a=t*o,s=n*o,l=Math.min(a>i?i/a:1,s>r?r/s:1);return l<1&&(0,E.Pr)("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."),l*o}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(t){return this._camera.transform.setMaxBounds(eL.convert(t)),this._update()}setMinZoom(t){if((t??=-2)>=-2&&t<=this._camera.transform.maxZoom){let n=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMinZoom(t),this._camera.applyUpdatedTransform(i),this._update(),n!==this._camera.transform.zoom&&this.fire(new L("zoomstart")).fire(new L("zoom")).fire(new L("zoomend")).fire(new L("movestart")).fire(new L("move")).fire(new L("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(t=!1){let n=this._camera.transform;return t?n.applyConstrain(n.center,n.minZoom).zoom:n.minZoom}setMaxZoom(t){if((t??=22)>=this._camera.transform.minZoom){let n=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMaxZoom(t),this._camera.applyUpdatedTransform(i),this._update(),n!==this._camera.transform.zoom&&this.fire(new L("zoomstart")).fire(new L("zoom")).fire(new L("zoomend")).fire(new L("movestart")).fire(new L("move")).fire(new L("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(t){if((t??=0)<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this._camera.transform.maxPitch){let n=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMinPitch(t),this._camera.applyUpdatedTransform(i),this._update(),n!==this._camera.transform.pitch&&this.fire(new L("pitchstart")).fire(new L("pitch")).fire(new L("pitchend")).fire(new L("movestart")).fire(new L("move")).fire(new L("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(t){if((t??=60)>180)throw Error("maxPitch must be less than or equal to 180");if(t>=this._camera.transform.minPitch){let n=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMaxPitch(t),this._camera.applyUpdatedTransform(i),this._update(),n!==this._camera.transform.pitch&&this.fire(new L("pitchstart")).fire(new L("pitch")).fire(new L("pitchend")).fire(new L("movestart")).fire(new L("move")).fire(new L("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if((t??=20)>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(t){return this._camera.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this._camera.transform.setConstrainOverride(t),this._update()}project(t){return this._camera.transform.locationToScreenPoint(E.st.convert(t),this.style&&this.terrain)}unproject(t){return this._camera.transform.screenPointToLocation(E.Ri.convert(t),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}_createDelegatedListener(t,n,i){if("mouseenter"===t||"mouseover"===t){let r=!1;return{layers:n,listener:i,delegates:{mousemove:o=>{let a=n.filter(t=>this.getLayer(t)),s=0===a.length?[]:this.queryRenderedFeatures(o.point,{layers:a});s.length?r||(r=!0,i.call(this,new U(t,this,o.originalEvent,{features:s}))):r=!1},mouseout:()=>{r=!1}}}}if("mouseleave"===t||"mouseout"===t){let r=!1;return{layers:n,listener:i,delegates:{mousemove:o=>{let a=n.filter(t=>this.getLayer(t));(0===a.length?[]:this.queryRenderedFeatures(o.point,{layers:a})).length?r=!0:r&&(r=!1,i.call(this,new U(t,this,o.originalEvent)))},mouseout:n=>{r&&(r=!1,i.call(this,new U(t,this,n.originalEvent)))}}}}{let r=t=>{let r=n.filter(t=>this.getLayer(t)),o=0===r.length?[]:this.queryRenderedFeatures(t.point,{layers:r});o.length&&(t.features=o,i.call(this,t),delete t.features)};return{layers:n,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,n){this._delegatedListeners||={},this._delegatedListeners[t]||=[],this._delegatedListeners[t].push(n)}_removeDelegatedListener(t,n,i){if(!this._delegatedListeners?.[t])return;let r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){let o=r[t];if(o.listener===i&&o.layers.length===n.length&&o.layers.every(t=>n.includes(t))){for(let t in o.delegates)this.off(t,o.delegates[t]);r.splice(t,1);return}}}on(t,n,i){if(void 0===i)return super.on(t,n);let r="string"==typeof n?[n]:n,o=this._createDelegatedListener(t,r,i);for(let n in this._saveDelegatedListener(t,o),o.delegates)this.on(n,o.delegates[n]);return{unsubscribe:()=>{this._removeDelegatedListener(t,r,i)}}}once(t,n,i){if(void 0===i)return super.once(t,n);let r="string"==typeof n?[n]:n,o=this._createDelegatedListener(t,r,i);for(let n in o.delegates){let a=o.delegates[n];o.delegates[n]=(...n)=>{this._removeDelegatedListener(t,r,i),a(...n)}}for(let n in this._saveDelegatedListener(t,o),o.delegates)this.once(n,o.delegates[n]);return this}off(t,n,i){if(void 0===i)return super.off(t,n);let r="string"==typeof n?[n]:n;return this._removeDelegatedListener(t,r,i),this}queryRenderedFeatures(t,n){if(!this.style)return[];let i,r=t instanceof E.Ri||Array.isArray(t),o=r?t:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(n||=(r?{}:t)||{},o instanceof E.Ri||"number"==typeof o[0])i=[E.Ri.convert(o)];else{let t=E.Ri.convert(o[0]),n=E.Ri.convert(o[1]);i=[t,new E.Ri(n.x,t.y),n,new E.Ri(t.x,n.y),t]}return this.style.queryRenderedFeatures(i,n,this._camera.transform)}querySourceFeatures(t,n){return this.style.querySourceFeatures(t,n)}setStyle(t,n){return n=(0,E.tr)({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},n),this._styleUrl="string"==typeof t?t:null,!1!==n.diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(t,n))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let n=this._locale[t];if(null==n)throw Error(`Missing UI string '${t}'`);return n}_updateStyle(t,n){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,n.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,n));let i=this.style&&n.transformStyle?this.style.serialize():void 0;return(this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t)?(this.style=new n0(this,n||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,n,i):this.style.loadJSON(t,n,i)):(this._frameRequest&&=(this._frameRequest.abort(),null),this.style?.projection?.destroy(),delete this.style),this}_lazyInitEmptyStyle(){this.style||(this.style=new n0(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}async _diffStyle(t,n){if(this._diffStyleRequest?.abort(),"string"==typeof t){this._diffStyleRequest=new AbortController;let i=this._diffStyleRequest;try{let r=await this._requestManager.transformRequest(t,"Style");if(i.signal.aborted){this._diffStyleRequest=null;return}let o=await (0,E.Cn)(r,i);this._diffStyleRequest=null,this._updateDiff(o.data,n)}catch(t){this._diffStyleRequest=null,(0,E.Nn)(t)||this.fire(new E._n((0,E.$n)(t)))}}else"object"==typeof t&&(this._diffStyleRequest=null,this._updateDiff(t,n))}_updateDiff(t,n){try{this.style.setState(t,n)&&this._update(!0)}catch(i){(0,E.Pr)(`Unable to perform style diff: ${(0,E.$n)(i).message}. Rebuilding the style from scratch.`),this._updateStyle(t,n)}}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(){return this.style?this.style.loaded():void(0,E.Pr)("There is no style added to the map.")}addSource(t,n){return this._lazyInitEmptyStyle(),this.style.addSource(t,n),this._update(!0)}isSourceLoaded(t){let n=this.style?.tileManagers[t];return void 0===n?void this.fire(new E._n(Error(`There is no tile manager with ID '${t}'`))):n.loaded()}setTerrain(t,n={}){if(this.style._checkLoaded(),t&&(0,E.on)(this,E.sn.terrain,{value:t},n))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let n=this.style.tileManagers[t.source];if(!n)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let i in null===this.terrain&&n.reload(),this.style._layers){let n=this.style._layers[i];"hillshade"===n.type&&n.source===t.source&&(0,E.Pr)("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===n.type&&n.source===t.source&&(0,E.Pr)("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 nm(this.painter,n,t,this._terrainSkirtLength),this.painter.renderToTexture=new oq(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=n=>this._handleTerrainDataEvent(n,t.source),this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);return this.style.triggerSymbolPlacement(),this.fire(new q({terrain:t})),this}_handleTerrainDataEvent(t,n){if("style"===t.dataType)return void this.terrain.tileManager.releaseAllRTT();let i=t.sourceId===n;if(i&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),i&&t.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),t.tile){if(t.source?.type==="image")return void this.terrain.tileManager.releaseAllRTT();this.terrain.tileManager.releaseRTT(t.tile.tileID)}}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){for(let t of Object.values(this.style?.tileManagers))if(!t.areTilesLoaded())return!1;return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style?.getSource(t)}setSourceTileLodParams(t,n,i){if(i){let r=this.getSource(i);if(!r)throw Error(`There is no source with ID "${i}", cannot set LOD parameters`);r.calculateTileZoom=to(Math.max(1,t),Math.max(1,n))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=to(Math.max(1,t),Math.max(1,n));return this._update(!0),this}refreshTiles(t,n){let i=this.style.tileManagers[t];if(!i)throw Error(`There is no tile manager with ID "${t}", cannot refresh tile`);void 0===n?i.reload(!0):i.refreshTiles(n.map(t=>new E.u(t.z,t.x,t.y)))}addImage(t,n,i={}){this._lazyInitEmptyStyle();let r=this._createStyleImage(n,i);return r&&(this.style.addImage(t,r),r.userImage?.onAdd&&r.userImage.onAdd(this,t)),this}setMissingStyleImageResolver(t){return this._missingStyleImageResolver=t,this.style?.setMissingImageResolver(t),this}_createStyleImage(t,n={}){let{pixelRatio:i=1,sdf:r=!1,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c}=n;if(t instanceof HTMLImageElement||(0,E.lr)(t)){let{width:n,height:d,data:u}=k.getImageData(t);return{data:new E.Tt({width:n,height:d},u),pixelRatio:i,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c,sdf:r,version:0}}if(void 0===t.width||void 0===t.height)return this.fire(new E._n(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:n,height:d,data:u}=t,h=(0,E.I)(t.data);return{data:h?new E.Tt({width:n,height:d}):new E.Tt({width:n,height:d},new Uint8Array(u)),pixelRatio:i,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c,sdf:r,version:0,isWebGLImage:h,userImage:t}}}updateImage(t,n){let i=this.style.getImage(t);if(!i)return this.fire(new E._n(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:o,data:a}=n instanceof HTMLImageElement||(0,E.lr)(n)?k.getImageData(n):n;if(void 0===r||void 0===o)return this.fire(new E._n(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(r!==i.data.width||o!==i.data.height)return this.fire(new E._n(Error("The width and height of the updated image must be that same as the previous version of the image")));if(i.isWebGLImage=(0,E.I)(a),i.isWebGLImage)i.userImage=n;else{let t=!(n instanceof HTMLImageElement||(0,E.lr)(n));i.data.replace(a,t)}return this.style.updateImage(t,i),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new E._n(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}async loadImage(t){let n=await s.getImage(await this._requestManager.transformRequest(t,"Image"),new AbortController);if(!n.data)throw Error(`Could not load image ${t}: the response is empty`);return n}listImages(){return this.style?.listImages()??[]}addLayer(t,n){return this._lazyInitEmptyStyle(),this.style.addLayer(t,n),this._update(!0)}moveLayer(t,n){return this.style.moveLayer(t,n),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style?.getLayer(t)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(t,n,i){return this.style.setLayerZoomRange(t,n,i),this._update(!0)}setFilter(t,n,i={}){return this.style?.setFilter(t,n,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,n,i,r={}){return this.style?.setPaintProperty(t,n,i,r),this._update(!0)}getPaintProperty(t,n){return this.style.getPaintProperty(t,n)}setLayoutProperty(t,n,i,r={}){return this.style.setLayoutProperty(t,n,i,r),this._update(!0)}getLayoutProperty(t,n){return this.style.getLayoutProperty(t,n)}setGlyphs(t,n={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,n),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(t){return this._lazyInitEmptyStyle(),this.style.setFontFaces(t),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(t,n,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,n,i,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,n={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,n,t=>{t||this._update(!0)}),this}setLight(t,n={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,n),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,n={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,n),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,n){return this.style.setFeatureState(t,n),this._update()}removeFeatureState(t,n){return this.style.removeFeatureState(t,n),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,n=0;return this._container&&(t=this._container.clientWidth||400,n=this._container.clientHeight||300),[t,n]}_setupResizeObserver(){let t=!1,n=rZ(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50),i=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new i(i=>{if(!t){t=!0;return}n(i)}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if("string"==typeof t){let n=document.getElementById(t);if(!n)throw Error(`Container '${t}' not found.`);return n}if(t instanceof HTMLElement||t&&"object"==typeof t&&1===t.nodeType)return t;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let n=this._canvasContainer=R.create("div","maplibregl-canvas-container",t);this._interactive&&n.classList.add("maplibregl-interactive"),this._canvas=R.create("canvas","maplibregl-canvas",n),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");let i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);let o=this._controlContainer=R.create("div","maplibregl-control-container",t),a=this._controlPositions={};for(let t of["top-left","top-right","bottom-left","bottom-right"])a[t]=R.create("div",`maplibregl-ctrl-${t} `,o);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(t,n,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*n),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${n}px`}_setupPainter(){let t={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},n=null;this._canvas.addEventListener("webglcontextcreationerror",t=>{n=t},{once:!0});let i=this._canvas.getContext("webgl2",t);if(!i)throw new rX(t,n);this.painter=new rY(i,this._camera.transform)}migrateProjection(t,n){this._camera.migrateProjection(t,n),this.painter.transform=t,this.fire(new G({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style?._loaded&&(this._styleDirty||=t,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){let n=this._idleTriggered?this._fadeDuration:0,i=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let r=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this._camera.transform.zoom,i=S();this.style.zoomHistory.update(t,i);let o=new E.$t(t,{now:i,fadeDuration:n,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),a=o.crossFadingFactor();(1!==a||a!==this._crossFadingFactor)&&(r=!0,this._crossFadingFactor=a),this.style.update(o)}let o=this.style.projection?.transitionState>0!==i;this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||o)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(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()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,n,this._crossSourceCollisions,o),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:n,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new M("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new M("load"))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let a=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new M("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&=(this._frameRequest.abort(),null),this._render(0)),this}remove(){for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&=(this._frameRequest.abort(),null),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),"u">typeof window&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),s.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new M("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,k.frame(this._frameRequest,t=>{this._frameRequest=null;try{this._render(t)}catch(t){if(!(0,E.Nn)(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return C}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}};let oY={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};var oX=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),n=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom(!0);this._zoomInButton.disabled=n,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{let t=this._map.getPitch(),n=this._map.getRoll(),i=this._map.getBearing(),r=1/Math.cos((0,E.Xn)(t))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${r}) rotateZ(${-n}deg) rotateX(${t}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${r}) rotateX(${t}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-i-n}deg)`;return}this._compassIcon.style.transform=`rotate(${-i}deg)`},this._setButtonTitle=(t,n)=>{let i=this._map._getUIString(`NavigationControl.${n}`);t.title=i,t.setAttribute("aria-label",i)},this.options=(0,E.tr)({},oY,t),this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),R.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),R.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=R.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new oZ(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,n){let i=R.create("button",t,this._container);return i.type="button",i.addEventListener("click",n),i}},oZ=class{constructor(t,n,i=!1){this.mousedown=t=>{this.startMove(t,R.mousePos(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,R.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1===t.targetTouches.length?(this._startPos=this._lastPos=R.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=t=>{1===t.targetTouches.length?(this._lastPos=R.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos)):this.reset()},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=n;let r=new ol;this._rotatePitchHandler=new or({clickTolerance:3,move:(t,r)=>{let o=n.getBoundingClientRect(),a=new E.Ri((o.bottom-o.top)/2,(o.right-o.left)/2);return{bearingDelta:(0,E.ar)(new E.Ri(t.x,r.y),r,a),pitchDelta:i?-((r.y-t.y)*.5):void 0}},moveStateManager:r,enable:!0,assignEvents:()=>{}}),this.map=t,n.addEventListener("mousedown",this.mousedown),n.addEventListener("touchstart",this.touchstart,{passive:!1}),n.addEventListener("touchcancel",this.reset)}startMove(t,n){this._rotatePitchHandler.dragStart(t,n),R.disableDrag()}move(t,n){let i=this.map,{bearingDelta:r,pitchDelta:o}=this._rotatePitchHandler.dragMove(t,n)||{};r&&i.setBearing(i.getBearing()+r),o&&i.setPitch(i.getPitch()+o)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){R.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}};async function oK(t=!1){if(void 0!==p&&!t)return p;if(void 0===window.navigator.permissions)return p=!!window.navigator.geolocation;try{p="denied"!==(await window.navigator.permissions.query({name:"geolocation"})).state}catch{p=!!window.navigator.geolocation}return p}function oJ(t,n,i,r=!1){if(r||!i.getCoveringTilesDetailsProvider().allowWorldCopies())return t?.wrap();let o=new E.st(t.lng,t.lat);if(t=new E.st(t.lng,t.lat),n){let r=new E.st(t.lng-360,t.lat),o=new E.st(t.lng+360,t.lat),a=i.locationToScreenPoint(t).distSqr(n);i.locationToScreenPoint(r).distSqr(n)<a?t=r:i.locationToScreenPoint(o).distSqr(n)<a&&(t=o)}for(;Math.abs(t.lng-i.center.lng)>180;){let n=i.locationToScreenPoint(t);if(n.x>=0&&n.y>=0&&n.x<=i.width&&n.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t.lng!==o.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(t))?t:o}let oQ={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 o0(t,n,i){let r=t.classList;for(let t in oQ)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${n}`)}let o1={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},o2="#3FB1CE";function o3(t,n,i=[]){let r=R.createNS("http://www.w3.org/2000/svg",t);for(let t in n)r.setAttributeNS(null,t,n[t]);for(let t of i)r.appendChild(t);return r}var o5=class extends E.vn{},o4=class extends E.vn{},o6=class extends E.yn{constructor(t){if(super(),this._onClick=t=>{this.fire(new o4("click",{originalEvent:t}))},this._onKeyPress=t=>{("Space"===t.code||"Enter"===t.code)&&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 n=o1[t.key];if(!n)return;t.preventDefault(),t.stopPropagation();let i=t.shiftKey?10:1,r=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new E.Ri(r.x+n[0]*i,r.y+n[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new o5("dragstart"))),this.fire(new o5("drag"))},this._onKeyUp=t=>{o1[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let n=t.originalEvent.target,i=this._element;this._popup&&(n===i||i.contains(n))&&this.togglePopup()},this._update=t=>{if(!this._map)return;let n=this._map.loaded()&&!this._map.isMoving();t?.type!=="terrain"&&(t?.type!=="render"||n)||this._map.once("render",this._update),this._lngLat=oJ(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 i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),this._element.style.transform=`${oQ[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`,k.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(t?.type==="moveend")}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}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","pending"===this._state&&(this._state="active",this.fire(new o5("dragstart"))),this.fire(new o5("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),"active"===this._state&&this.fire(new o5("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=t?.anchor||"center",this._color=t?.color||o2,this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=E.Ri.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=R.create("div");let n=(f||(f=o3("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[o3("g",{"fill-rule":"nonzero"},[o3("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(([t,n])=>o3("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:t,ry:n}))),o3("g",{fill:o2},[o3("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"})]),o3("g",{opacity:"0.25",fill:"#000000"},[o3("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"})]),o3("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),o3("g",{transform:"translate(8.0, 8.0)"},[o3("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),o3("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]))).cloneNode(!0);n.setAttributeNS(null,"height",`${41*this._scale}px`),n.setAttributeNS(null,"width",`${27*this._scale}px`),(function(t){return t.firstElementChild.children[1]})(n).setAttributeNS(null,"fill",this._color),this._element.appendChild(n),this._offset=E.Ri.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),o0(this._element,this._anchor,"marker"),t?.className)for(let n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._updateAccessibilityRole(),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),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(t){return this._lngLat=E.st.convert(t),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),t){if(!("offset"in t.options)){let n=13.5/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[n,-((24.6+n)*1)],"bottom-right":[-n,-((24.6+n)*1)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new o5("dragend")))}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered||t&&(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map))),this}_updateOpacity(t=!1){let n=this._map?.terrain,i=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!n||i){let t=i?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==t&&(this._element.style.opacity=t,this._element.classList.toggle("maplibregl-marker-covered",i));return}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let r=this._map,o=r.terrain.depthAtPoint(this._pos),a=r.terrain.getElevationForLngLat(this._lngLat,r._camera.transform);if(r._camera.transform.lngLatToCameraDepth(this._lngLat,a)-o<.006){this._element.style.opacity=this._opacity,this._element.classList.remove("maplibregl-marker-covered");return}let s=-this._offset.y/r._camera.transform.pixelsPerMeter,l=Math.sin(r.getPitch()*Math.PI/180)*s,c=r.terrain.depthAtPoint(new E.Ri(this._pos.x,this._pos.y-this._offset.y)),d=r._camera.transform.lngLatToCameraDepth(this._lngLat,a+l)-c>.006;this._popup?.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",d)}getOffset(){return this._offset}setOffset(t){return this._offset=E.Ri.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(t?(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&&=("0"===this._element.getAttribute("tabindex")&&this._element.removeAttribute("tabindex"),!1)}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let t=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",t),this._roleManaged=!0}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return(void 0===this._opacity||void 0===t&&void 0===n)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=String(t)),void 0!==n&&(this._opacityWhenCovered=String(n)),this._map&&this._updateOpacity(!0),this}};let o8={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},o7=0,o9=!1;var ae=class extends E.vn{},at=class extends E.vn{},an=class extends E.vn{},ai=class extends E.yn{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t)){this._setErrorState(),this.fire(new at("outofmaxbounds",t)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new at("geolocate",t)),this._finish()}},this._updateCamera=t=>{let n=new E.st(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,r=this._map.getBearing(),o=(0,E.tr)({bearing:r},this.options.fitBoundsOptions),a=eL.fromLngLat(n,i);this._map.fitBounds(a,o,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let n=new E.st(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&o9)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new an("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let n=t?.[0]instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||n||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new ae("trackuserlocationend")),this.fire(new ae("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>{t.preventDefault()}),this._geolocateButton=R.create("button","maplibregl-ctrl-geolocate",this._container),R.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){(0,E.Pr)("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=R.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new o6({element:this._dotElement}),this._circleElement=R.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new o6({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=(0,E.tr)({},o8,t)}onAdd(t){return this._map=t,this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),oK().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,o7=0,o9=!1}_isOutOfMapMaxBounds(t){let n=this._map.getMaxBounds(),i=t.coords;return n&&(i.longitude<n.getWest()||i.longitude>n.getEast()||i.latitude<n.getSouth()||i.latitude>n.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let t=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!t)return;let n=this._map.project(t),i=this._map.unproject([n.x+100,n.y]),r=t.distanceTo(i)/100,o=2*this._accuracy/r;this._circleElement.style.width=`${o.toFixed(2)}px`,this._circleElement.style.height=`${o.toFixed(2)}px`}trigger(){if(!this._setup)return(0,E.Pr)("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new ae("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":o7--,o9=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new ae("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new ae("trackuserlocationstart")),this.fire(new ae("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++o7>1?(t={maximumAge:6e5,timeout:0},o9=!0):(t=this.options.positionOptions,o9=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}};let ar={maxWidth:100,unit:"metric"};var ao=class{constructor(t){this._onMove=()=>{aa(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,aa(this._map,this._container,this.options)},this.options={...ar,...t}}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}};function aa(t,n,i){let r=i?.maxWidth||100,o=t._container.clientHeight/2,a=t._container.clientWidth/2,s=t.unproject([a-r/2,o]),l=t.unproject([a+r/2,o]),c=Math.min(r,Math.round(t.project(l).x-t.project(s).x),t._container.clientWidth),d=s.distanceTo(l);if(i?.unit==="imperial"){let i=3.2808*d;i>5280?as(n,c,i/5280,t._getUIString("ScaleControl.Miles")):as(n,c,i,t._getUIString("ScaleControl.Feet"))}else i?.unit==="nautical"?as(n,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?as(n,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):as(n,c,d,t._getUIString("ScaleControl.Meters"))}function as(t,n,i,r){var o,a;let s,l,c,d=(o=i,l=10**(`${Math.floor(o)}`.length-1),c=o/l,l*(c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:c>=1?1:(a=c,s=10**Math.ceil(-Math.log(a)/Math.LN10),Math.round(a*s)/s))),u=d/i;t.style.width=`${n*u}px`,t.innerHTML=`${d}&nbsp;${r}`}var al=class extends E.vn{},ac=class extends E.yn{constructor(t={}){super(),this._onFullscreenChange=()=>{let t=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;t?.shadowRoot?.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=t.pseudo??!1,t?.container&&(t.container instanceof HTMLElement?this._container=t.container:(0,E.Pr)("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||=this._map.getContainer(),this._controlContainer=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=R.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);R.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new al("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new al("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},ad=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=R.create("button","maplibregl-ctrl-terrain",this._container),R.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},au=class{constructor(){this._toggleProjection=()=>{let t=this._map.getProjection()?.type;"mercator"!==t&&t?this._map.setProjection({type:"mercator"}):this._map.setProjection({type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),this._map.getProjection()?.type==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=R.create("button","maplibregl-ctrl-globe",this._container),R.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}};let ah={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0};var am=class extends E.vn{},ap=class extends E.yn{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new am("close"))),this),this._update=t=>{let n,i=this._lngLat||this._trackPointer;if(!this._map||!i||!this._content)return;if(!this._container){if(this._container=R.create("div","maplibregl-popup",this._map.getContainer()),this._tip=R.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=oJ(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer),t&&"point"in t&&t.point&&(n=t.point),this._trackPointer&&!n)return;let r=this._flatPos=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&n?n:this._map._camera.transform.locationToScreenPoint(this._lngLat));let o=this.options.anchor,a=function t(n){if(!n)return t(new E.Ri(0,0));if("number"==typeof n){let t=Math.round(Math.abs(n)/Math.SQRT2);return{center:new E.Ri(0,0),top:new E.Ri(0,n),"top-left":new E.Ri(t,t),"top-right":new E.Ri(-t,t),bottom:new E.Ri(0,-n),"bottom-left":new E.Ri(t,-t),"bottom-right":new E.Ri(-t,-t),left:new E.Ri(n,0),right:new E.Ri(-n,0)}}if(n instanceof E.Ri||Array.isArray(n)){let t=E.Ri.convert(n);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:E.Ri.convert(n.center||[0,0]),top:E.Ri.convert(n.top||[0,0]),"top-left":E.Ri.convert(n["top-left"]||[0,0]),"top-right":E.Ri.convert(n["top-right"]||[0,0]),bottom:E.Ri.convert(n.bottom||[0,0]),"bottom-left":E.Ri.convert(n["bottom-left"]||[0,0]),"bottom-right":E.Ri.convert(n["bottom-right"]||[0,0]),left:E.Ri.convert(n.left||[0,0]),right:E.Ri.convert(n.right||[0,0])}}(this.options.offset);if(!o){var s;let t=this._container.offsetWidth,n=this._container.offsetHeight,i=(s=this.options.padding)?{top:s.top??0,right:s.right??0,bottom:s.bottom??0,left:s.left??0}:{top:0,right:0,bottom:0,left:0},l;l=r.y+a.bottom.y<n+i.top?["top"]:r.y>this._map._camera.transform.height-n-i.bottom?["bottom"]:[],r.x<t/2+i.left?l.push("left"):r.x>this._map._camera.transform.width-t/2-i.right&&l.push("right"),o=0===l.length?"bottom":l.join("-")}let l=r.add(a[o]);this.options.subpixelPositioning||(l=l.round()),this._container.style.transform=`${oQ[o]} translate(${l.x}px,${l.y}px)`,o0(this._container,o,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=(0,E.tr)(Object.create(ah),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new am("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=E.st.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let n=document.createDocumentFragment(),i=document.createElement("body"),r;for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)}getMaxWidth(){return this._container?.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=R.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}setPadding(t){this.options.padding=t,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=R.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let t=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");t&&t.focus()}};function af(t,n){return e7().setRTLTextPlugin(t,n)}function ab(){return e7().getRTLTextPluginStatus()}function ag(){return C}function a_(){return eA.workerCount}function ay(t){eA.workerCount=t}function av(){return E.jn.MAX_PARALLEL_IMAGE_REQUESTS}function ax(t){E.jn.MAX_PARALLEL_IMAGE_REQUESTS=t}function aF(){return E.jn.WORKER_URL}function aw(t){E.jn.WORKER_URL=t}async function aE(t){await eP().broadcast("IS",t)}i.d(n,{AJAXError:()=>E.bn,AttributionControl:()=>oN,BoxZoomHandler:()=>r9,CanvasSource:()=>e1,CooperativeGesturesHandler:()=>oD,DoubleClickZoomHandler:()=>oC,DragPanHandler:()=>oT,DragRotateHandler:()=>oS,EXTENT:()=>8192,EdgeInsets:()=>no,ErrorEvent:()=>E._n,Event:()=>E.vn,Evented:()=>E.yn,FullscreenControl:()=>ac,FullscreenEvent:()=>al,GPUInitializationError:()=>rX,GeoJSONSource:()=>eG,GeolocateControl:()=>ai,GeolocateErrorEvent:()=>an,GeolocateEvent:()=>ae,GeolocatePositionEvent:()=>at,GlobeControl:()=>au,Hash:()=>rK,ImageSource:()=>eJ,KeyboardHandler:()=>oF,LngLat:()=>E.st,LngLatBounds:()=>eL,LogoControl:()=>oU,Map:()=>oW,MapBoxZoomEvent:()=>$,MapContextEvent:()=>H,MapLibreEvent:()=>M,MapLibreMap:()=>oW,MapMouseEvent:()=>U,MapMovementEvent:()=>L,MapProjectionEvent:()=>G,MapSourceDataEvent:()=>N,MapStyleDataEvent:()=>z,MapStyleImageMissingEvent:()=>W,MapStyleLoadEvent:()=>B,MapTerrainEvent:()=>q,MapTouchEvent:()=>j,MapWheelEvent:()=>V,Marker:()=>o6,MarkerClickEvent:()=>o4,MarkerDragEvent:()=>o5,MercatorCoordinate:()=>E.et,NavigationControl:()=>oX,Point:()=>E.Ri,Popup:()=>ap,PopupEvent:()=>am,RasterDEMTileSource:()=>eU,RasterTileSource:()=>eN,ScaleControl:()=>ao,ScrollZoomHandler:()=>oE,Style:()=>n0,TerrainControl:()=>ad,TwoFingersTouchPitchHandler:()=>o_,TwoFingersTouchRotateHandler:()=>ob,TwoFingersTouchZoomHandler:()=>op,TwoFingersTouchZoomRotateHandler:()=>oI,VectorTileSource:()=>ez,VideoSource:()=>e0,addProtocol:()=>E.On,clearPrewarmedResources:()=>eI,config:()=>E.jn,createTileMesh:()=>eK,getGlobalDispatcher:()=>eP,getMaxParallelImageRequests:()=>av,getRTLTextPluginStatus:()=>ab,getVersion:()=>ag,getWorkerCount:()=>a_,getWorkerUrl:()=>aF,importScriptInWorkers:()=>aE,isTimeFrozen:()=>P,now:()=>S,prewarm:()=>eS,removeProtocol:()=>E.An,restoreNow:()=>D,setMaxParallelImageRequests:()=>ax,setNow:()=>I,setRTLTextPlugin:()=>af,setWorkerCount:()=>ay,setWorkerUrl:()=>aw},{addSourceType:e5})}},n={};function i(r){var o=n[r];if(void 0!==o)return o.exports;var a=n[r]={exports:{}};return t[r].call(a.exports,a,a.exports,i),a.exports}i.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return i.d(n,{a:n}),n},i.d=(t,n,r)=>{var o=(n,r)=>{for(var o in n)i.o(n,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,[r]:n[o]})};o(n,"get"),o(r,"value")},i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";let t,n,o,a,s,l,c,d,u;i.r(r),i.d(r,{DefaultConfig:()=>f0,LngLat:()=>sG.st,OrClusterMarker:()=>fa,OrMap:()=>f7,OrMapAssetCard:()=>f1,OrMapAssetCardLoadAssetEvent:()=>fQ,OrMapClickedEvent:()=>f5,OrMapGeocoder:()=>p9,OrMapGeocoderChangeEvent:()=>p7,OrMapGeocoderControl:()=>fe,OrMapLegend:()=>fS,OrMapLegendControl:()=>fI,OrMapLegendEvent:()=>fT,OrMapLoadedEvent:()=>f3,OrMapLongPressEvent:()=>f4,OrMapMarker:()=>sQ,OrMapMarkerAsset:()=>lt,OrMapMarkerChangedEvent:()=>sK,OrMapMarkerClickedEvent:()=>sJ,OrMapMarkersChangedEvent:()=>f6,OrMapPresetFilter:()=>fW,OrMapPresetFilterControl:()=>fY,OrMapPresetFilterEvent:()=>fH,Util:()=>tW,geoJsonPointInputTemplateProvider:()=>f8,getMarkerConfigAttributeName:()=>le,getMarkerConfigForAssetType:()=>s9});var h,m,p,f,b,g,_,y,v,x,F,w,E,C,A,k,T,S,I,D,P,R,O,M,L,B,z,N,U,j,V,$,q,G,H,W,Y,X,Z,K,J,Q,ee,et,en,ei,er,eo,ea,es,el,ec,ed,eu,eh,em,ep,ef,eb,eg,e_,ey,ev,ex,eF,ew,eE,eC,eA,ek,eT,eS,eI,eD,eP,eR,eO,eM,eL,eB,ez,eN,eU,ej,eV,e$,eq,eG,eH,eW,eY,eX,eZ,eK,eJ,eQ,e0,e1,e2,e3,e5,e4,e6,e8,e7,e9,te,tt,tn,ti,tr,to,ta,ts,tl,tc,td,tu,th,tm,tp,tf,tb,tg,t_,ty,tv,tx,tF,tw,tE,tC,tA,tk,tT,tS,tI,tD,tP,tR,tO,tM,tL,tB,tz,tN,tU,tj,tV,t$,tq,tG,tH={};i.r(tH),i.d(tH,{hasBrowserEnv:()=>rs,hasStandardBrowserEnv:()=>rc,hasStandardBrowserWebWorkerEnv:()=>rd,navigator:()=>rl,origin:()=>ru});var tW={};i.r(tW),i.d(tW,{formatCount:()=>s1,getGeoJSONPoint:()=>s5,getLngLat:()=>s3,getLngLatBounds:()=>s4,getMarkerIconAndColorFromAssetType:()=>s6,isAssetWithLocation:()=>s8,metersToPixelsAtMaxZoom:()=>s2}),i(4532),(b=eO||(eO={})).CREATE="CREATE",b.UPDATE="UPDATE",b.DELETE="DELETE",(g=eM||(eM={})).LOW="LOW",g.MEDIUM="MEDIUM",g.HIGH="HIGH",(_=eL||(eL={})).MANUAL="MANUAL",_.CLIENT="CLIENT",_.GLOBAL_RULESET="GLOBAL_RULESET",_.REALM_RULESET="REALM_RULESET",_.ASSET_RULESET="ASSET_RULESET",_.AGENT="AGENT",(y=eB||(eB={})).OPEN="OPEN",y.ACKNOWLEDGED="ACKNOWLEDGED",y.IN_PROGRESS="IN_PROGRESS",y.RESOLVED="RESOLVED",y.CLOSED="CLOSED",(v=ez||(ez={})).BOTTOM_LEFT="BOTTOM_LEFT",v.BOTTOM_RIGHT="BOTTOM_RIGHT",v.TOP_LEFT="TOP_LEFT",v.TOP_RIGHT="TOP_RIGHT",(x=eN||(eN={})).CREATE="CREATE",x.READ="READ",x.UPDATE="UPDATE",x.DELETE="DELETE",(F=eU||(eU={})).NONE="NONE",F.FORECAST="FORECAST",F.SETPOINT="SETPOINT",(w=ej||(ej={})).DISCONNECTED="DISCONNECTED",w.CONNECTING="CONNECTING",w.DISCONNECTING="DISCONNECTING",w.CONNECTED="CONNECTED",w.DISABLED="DISABLED",w.WAITING="WAITING",w.ERROR="ERROR",w.STOPPED="STOPPED",(E=eV||(eV={})).REQUEST_START="REQUEST_START",E.REQUEST_REPEATING="REQUEST_REPEATING",E.REQUEST_CANCEL="REQUEST_CANCEL",E.READY="READY",E.COMPLETED="COMPLETED",E.RUNNING="RUNNING",E.CANCELLED="CANCELLED",(C=e$||(e$={})).TOGGLE="TOGGLE",C.INCREMENT="INCREMENT",C.DECREMENT="DECREMENT",C.NEGATE="NEGATE",(A=eq||(eq={})).ASSET_NOT_FOUND="ASSET_NOT_FOUND",A.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",A.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",A.INVALID_VALUE="INVALID_VALUE",A.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",A.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",A.CANNOT_PROCESS="CANNOT_PROCESS",A.QUEUE_FULL="QUEUE_FULL",A.UNKNOWN="UNKNOWN",A.ASSET_ID_MISSING="ASSET_ID_MISSING",A.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING",(k=eG||(eG={})).PUBLIC="PUBLIC",k.SHARED="SHARED",k.PRIVATE="PRIVATE",(T=eH||(eH={})).OFF="OFF",T.ONE_MIN="ONE_MIN",T.FIVE_MIN="FIVE_MIN",T.QUARTER="QUARTER",T.ONE_HOUR="ONE_HOUR",(S=eW||(eW={})).WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",S.KEEP_LAYOUT="KEEP_LAYOUT",S.REDIRECT="REDIRECT",S.BLOCK_DEVICE="BLOCK_DEVICE",(I=eY||(eY={})).CSV="CSV",I.CSV_CROSSTAB="CSV_CROSSTAB",I.CSV_CROSSTAB_MINUTE="CSV_CROSSTAB_MINUTE",(D=eX||(eX={})).MINUTE="MINUTE",D.HOUR="HOUR",D.DAY="DAY",D.WEEK="WEEK",D.MONTH="MONTH",D.YEAR="YEAR",(P=eZ||(eZ={})).MIN="MIN",P.AVG="AVG",P.MAX="MAX",P.DIFFERENCE="DIFFERENCE",P.COUNT="COUNT",P.SUM="SUM",P.MODE="MODE",P.MEDIAN="MEDIAN",(R=eK||(eK={})).TERMINATING="TERMINATING",R.DISABLED="DISABLED",R.ALREADY_CONNECTED="ALREADY_CONNECTED",R.UNRECOGNISED="UNRECOGNISED",R.PERMANENT_ERROR="PERMANENT_ERROR",R.SYNC_ERROR="SYNC_ERROR",(O=eJ||(eJ={})).HTTPS="HTTPS",O.HTTP="HTTP",O.TCP="TCP",(M=eQ||(eQ={})).GET="GET",M.POST="POST",M.PUT="PUT",M.DELETE="DELETE",M.OPTIONS="OPTIONS",M.PATCH="PATCH",(L=e0||(e0={})).KEYCLOAK="KEYCLOAK",L.NONE="NONE",(B=e1||(e1={})).WEBSOCKET="WEBSOCKET",B.POLLING="POLLING",(z=e2||(e2={})).INTERNAL="INTERNAL",z.CLIENT="CLIENT",z.GLOBAL_RULESET="GLOBAL_RULESET",z.REALM_RULESET="REALM_RULESET",z.ASSET_RULESET="ASSET_RULESET",(N=e3||(e3={})).REALM="REALM",N.USER="USER",N.ASSET="ASSET",N.CUSTOM="CUSTOM",(U=e5||(e5={})).NORMAL="NORMAL",U.HIGH="HIGH",(j=e4||(e4={})).DEVICE="DEVICE",j.TOPIC="TOPIC",j.CONDITION="CONDITION",(V=e6||(e6={})).ALWAYS="ALWAYS",V.ONCE="ONCE",V.HOURLY="HOURLY",V.DAILY="DAILY",V.WEEKLY="WEEKLY",V.MONTHLY="MONTHLY",V.ANNUALLY="ANNUALLY",($=e8||(e8={})).TITLE="TITLE",$.SOURCE="SOURCE",$.STATUS="STATUS",$.SENT_ON="SENT_ON",$.DELIVERED_ON="DELIVERED_ON",(q=e7||(e7={})).MESSAGE_INVALID="MESSAGE_INVALID",q.CERTIFICATE_INVALID="CERTIFICATE_INVALID",q.UNAUTHORIZED="UNAUTHORIZED",q.FORBIDDEN="FORBIDDEN",q.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",q.CONFIG_DISABLED="CONFIG_DISABLED",q.USER_DISABLED="USER_DISABLED",q.SERVER_ERROR="SERVER_ERROR",q.ASSET_ERROR="ASSET_ERROR",q.SERVER_BUSY="SERVER_BUSY",(G=e9||(e9={})).PRIVATE="PRIVATE",G.PROTECTED="PROTECTED",G.PUBLIC="PUBLIC",(H=te||(te={})).EXACT="EXACT",H.BEGIN="BEGIN",H.END="END",H.CONTAINS="CONTAINS",(W=tt||(tt={})).EQUALS="EQUALS",W.GREATER_THAN="GREATER_THAN",W.GREATER_EQUALS="GREATER_EQUALS",W.LESS_THAN="LESS_THAN",W.LESS_EQUALS="LESS_EQUALS",W.BETWEEN="BETWEEN",(Y=tn||(tn={})).CREATED_ON="CREATED_ON",Y.NAME="NAME",Y.ASSET_TYPE="ASSET_TYPE",Y.PARENT_ID="PARENT_ID",Y.REALM="REALM",(X=ti||(ti={})).RESTRICTED="RESTRICTED",X.LINKED="LINKED",X.REALM="REALM",(Z=tr||(tr={})).AT_LEAST_ONE="AT_LEAST_ONE",Z.ALL="ALL",Z.NONE="NONE",(K=to||(to={})).AND="AND",K.OR="OR",(J=ta||(ta={})).CREATED_ON="CREATED_ON",J.FIRST_NAME="FIRST_NAME",J.LAST_NAME="LAST_NAME",J.USERNAME="USERNAME",J.EMAIL="EMAIL",(Q=ts||(ts={})).STOPPED="STOPPED",Q.RUNNING="RUNNING",Q.ERROR="ERROR",(ee=tl||(tl={})).JAVASCRIPT="JAVASCRIPT",ee.GROOVY="GROOVY",ee.JSON="JSON",ee.FLOW="FLOW",(et=tc||(tc={})).READY="READY",et.DEPLOYED="DEPLOYED",et.COMPILATION_ERROR="COMPILATION_ERROR",et.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",et.EXECUTION_ERROR="EXECUTION_ERROR",et.LOOP_ERROR="LOOP_ERROR",et.DISABLED="DISABLED",et.PAUSED="PAUSED",et.EXPIRED="EXPIRED",et.REMOVED="REMOVED",et.EMPTY="EMPTY",(en=td||(td={})).SUNRISE="SUNRISE",en.SUNSET="SUNSET",en.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",en.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",en.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",en.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",en.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",en.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",en.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",en.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",en.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",en.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",en.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",en.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",en.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",en.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",en.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",en.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",en.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",en.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR",(ei=tu||(tu={})).NUMBER="NUMBER",ei.NUMBER_ARRAY="NUMBER_ARRAY",ei.STRING="STRING",ei.BOOLEAN="BOOLEAN",ei.TRIGGER="TRIGGER",ei.COLOR="COLOR",ei.ANY="ANY",(er=th||(th={})).NEW_LINE="NEW_LINE",er.SPACER="SPACER",(eo=tm||(tm={})).INPUT="INPUT",eo.PROCESSOR="PROCESSOR",eo.OUTPUT="OUTPUT",eo.THEN="THEN",(ea=tp||(tp={})).TEXT="TEXT",ea.MULTILINE="MULTILINE",ea.NUMBER="NUMBER",ea.DROPDOWN="DROPDOWN",ea.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",ea.CHECKBOX="CHECKBOX",ea.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",ea.COLOR="COLOR",ea.DATE="DATE",(es=tf||(tf={})).ADD="ADD",es.ADD_OR_REPLACE="ADD_OR_REPLACE",es.REPLACE="REPLACE",es.DELETE="DELETE",es.CLEAR="CLEAR",(el=tb||(tb={})).PER_ASSET="PER_ASSET",el.GLOBAL="GLOBAL",(ec=tg||(tg={})).READ_ADMIN="read:admin",ec.READ_LOGS="read:logs",ec.READ_USERS="read:users",ec.READ_MAP="read:map",ec.READ_ASSETS="read:assets",ec.READ_RULES="read:rules",ec.READ_INSIGHTS="read:insights",ec.READ_ALARMS="read:alarms",ec.READ_NOTIFICATIONS="read:notifications",ec.READ_SERVICES="read:services",ec.READ_TUNNELS="read:tunnels",ec.WRITE_SERVICES="write:services",ec.WRITE_USER="write:user",ec.WRITE_ADMIN="write:admin",ec.WRITE_LOGS="write:logs",ec.WRITE_ASSETS="write:assets",ec.WRITE_ATTRIBUTES="write:attributes",ec.WRITE_RULES="write:rules",ec.WRITE_INSIGHTS="write:insights",ec.WRITE_ALARMS="write:alarms",ec.WRITE_NOTIFICATIONS="write:notifications",ec.WRITE_TUNNELS="write:tunnels",ec.READ="read",ec.WRITE="write",(ed=t_||(t_={})).REGISTER="REGISTER",ed.UPDATE="UPDATE",ed.DEREGISTER="DEREGISTER",(eu=ty||(ty={})).AVAILABLE="AVAILABLE",eu.UNAVAILABLE="UNAVAILABLE",(eh=tv||(tv={})).ASSET="ASSET",eh.AGENT="AGENT",eh.NOTIFICATION="NOTIFICATION",eh.ALARM="ALARM",eh.RULES="RULES",eh.PROTOCOL="PROTOCOL",eh.GATEWAY="GATEWAY",eh.MODEL_AND_VALUES="MODEL_AND_VALUES",eh.API="API",eh.DATA="DATA",(em=tx||(tx={})).INFO="INFO",em.WARN="WARN",em.ERROR="ERROR",(ep=tF||(tF={})).NUMERIC="numeric",ep.DIGIT_2="2-digit",ep.FULL="full",ep.LONG="long",ep.MEDIUM="medium",ep.SHORT="short",ep.NARROW="narrow",(ef=tw||(tw={})).SECONDLY="SECONDLY",ef.MINUTELY="MINUTELY",ef.HOURLY="HOURLY",ef.DAILY="DAILY",ef.WEEKLY="WEEKLY",ef.MONTHLY="MONTHLY",ef.YEARLY="YEARLY",(eb=tE||(tE={})).OMIT="OMIT",eb.BACKWARD="BACKWARD",eb.FORWARD="FORWARD",(eg=tC||(tC={})).JAPANESE="JAPANESE",eg.BUDDHIST="BUDDHIST",eg.ROC="ROC",eg.ISLAMIC="ISLAMIC",eg.ISO8601="ISO8601",eg.CHINESE="CHINESE",eg.ETHIOPIC="ETHIOPIC",eg.HEBREW="HEBREW",eg.GREGORIAN="GREGORIAN",(e_=tA||(tA={})).SU="SU",e_.MO="MO",e_.TU="TU",e_.WE="WE",e_.TH="TH",e_.FR="FR",e_.SA="SA",(ey=tk||(tk={})).PEOPLECOUNTERASSET="PeopleCounterAsset",ey.MAILAGENT="MailAgent",ey.UDPAGENT="UDPAgent",ey.ROOMASSET="RoomAsset",ey.CITYASSET="CityAsset",ey.VENTILATIONASSET="VentilationAsset",ey.TRADFRILIGHTASSET="TradfriLightAsset",ey.CONSOLEASSET="ConsoleAsset",ey.PRESENCESENSORASSET="PresenceSensorAsset",ey.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",ey.LIGHTASSET="LightAsset",ey.KNXAGENT="KNXAgent",ey.THETHINGSSTACKAGENT="TheThingsStackAgent",ey.PLUGASSET="PlugAsset",ey.CHIRPSTACKAGENT="ChirpStackAgent",ey.WEATHERASSET="WeatherAsset",ey.THINGASSET="ThingAsset",ey.WEBSOCKETAGENT="WebsocketAgent",ey.TCPAGENT="TCPAgent",ey.GATEWAYASSET="GatewayAsset",ey.SERIALAGENT="SerialAgent",ey.BLUETOOTHMESHAGENT="BluetoothMeshAgent",ey.PARKINGASSET="ParkingAsset",ey.TRADFRIPLUGASSET="TradfriPlugAsset",ey.SIMULATORAGENT="SimulatorAgent",ey.SNMPAGENT="SNMPAgent",ey.GROUPASSET="GroupAsset",ey.BUILDINGASSET="BuildingAsset",ey.MODBUSSERIALAGENT="ModbusSerialAgent",ey.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",ey.MQTTAGENT="MQTTAgent",ey.VELBUSTCPAGENT="VelbusTCPAgent",ey.ARTNETLIGHTASSET="ArtnetLightAsset",ey.VELBUSSERIALAGENT="VelbusSerialAgent",ey.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",ey.MICROPHONEASSET="MicrophoneAsset",ey.MODBUSTCPAGENT="ModbusTcpAgent",ey.ZWAVEAGENT="ZWaveAgent",ey.HTTPAGENT="HTTPAgent",ey.DOORASSET="DoorAsset",ey.THERMOSTATASSET="ThermostatAsset",ey.SHIPASSET="ShipAsset",(ev=tT||(tT={})).COLOURRGB="colourRGB",ev.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",ev.PRICEHOURLY="priceHourly",ev.MQTTPORT="MQTTPort",ev.PINGDISABLED="pingDisabled",ev.FLOW="flow",ev.CHILDASSETTYPE="childAssetType",ev.LASTACCESS="lastAccess",ev.POSITION="position",ev.NETWORKKEY="networkKey",ev.UNIVERSE="universe",ev.ROUTINGMODE="routingMode",ev.MSSINUMBER="MSSINumber",ev.LASTWILLRETAIN="lastWillRetain",ev.LASTWILLTOPIC="lastWillTopic",ev.SERIALBAUDRATE="serialBaudrate",ev.SUBSCRIBEQOS="subscribeQos",ev.LEDCOUNT="lEDCount",ev.LOCKED="locked",ev.CLOUDCOVERAGE="cloudCoverage",ev.BASEURL="baseURL",ev.PROTOCOL="protocol",ev.REQUIREDVALUES="requiredValues",ev.REGION="region",ev.CONSOLEPLATFORM="consolePlatform",ev.GATEWAYSTATUS="gatewayStatus",ev.NO2LEVEL="NO2Level",ev.ATMOSPHERICPRESSURE="atmosphericPressure",ev.SERIALPORT="serialPort",ev.APPLICATIONID="applicationId",ev.TAGS="tags",ev.UNLOCK="unlock",ev.CHECKINTERVALSECONDS="checkIntervalSeconds",ev.LOCATION="location",ev.CLIENTSECRET="clientSecret",ev.WINDDIRECTION="windDirection",ev.WINDSPEED="windSpeed",ev.PARTICLESPM10="particlesPM10",ev.APPLICATIONKEY="applicationKey",ev.LENGTH="length",ev.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",ev.USERNAMEPASSWORD="usernamePassword",ev.WATERLEVEL="waterLevel",ev.CONNECTHEADERS="connectHeaders",ev.CONSOLENAME="consoleName",ev.WEBSOCKETQUERY="websocketQuery",ev.PREFERHTML="preferHTML",ev.PARITY="parity",ev.COOLING="cooling",ev.POLLINGMILLIS="pollingMillis",ev.SOILTEMPERATURE="soilTemperature",ev.SUNIRRADIANCE="sunIrradiance",ev.MESSAGEMAXLENGTH="messageMaxLength",ev.WINDGUSTSPEED="windGustSpeed",ev.LIGHTID="lightId",ev.PROXYADDRESS="proxyAddress",ev.REQUESTQUERYPARAMETERS="requestQueryParameters",ev.MQTTHOST="MQTTHost",ev.SECUREGRPC="secureGRPC",ev.MODEL="model",ev.STREET="street",ev.MANUFACTURER="manufacturer",ev.DELETEPROCESSEDMAIL="deleteProcessedMail",ev.RESUMESESSION="resumeSession",ev.ONOFF="onOff",ev.APIKEY="ApiKey",ev.CITY="city",ev.PRESENCE="presence",ev.SPACESOCCUPIED="spacesOccupied",ev.STARTTLS="startTLS",ev.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",ev.WEBSOCKETPATH="websocketPath",ev.AGENTSTATUS="agentStatus",ev.PRICEDAILY="priceDaily",ev.COUNTGROWTHMINUTE="countGrowthMinute",ev.IMONUMBER="IMONumber",ev.ATTRIBUTION="Attribution",ev.TENANTID="tenantId",ev.REQUESTHEADERS="requestHeaders",ev.HOST="host",ev.COUNTOUTMINUTE="countOutMinute",ev.MESSAGECHARSET="messageCharset",ev.CERTIFICATEALIAS="certificateAlias",ev.EMAIL="email",ev.BINDPORT="bindPort",ev.CONSOLEVERSION="consoleVersion",ev.PARTICLESPM1="particlesPM1",ev.MTU="mtu",ev.SPEED="speed",ev.MESSAGESTRIPDELIMITER="messageStripDelimiter",ev.AREA="area",ev.COUNTRY="country",ev.SHIPTYPE="shipType",ev.CONNECTSUBSCRIPTIONS="connectSubscriptions",ev.RELATIVEHUMIDITY="relativeHumidity",ev.SOURCEADDRESS="sourceAddress",ev.RAINFALL="rainfall",ev.OAUTHGRANT="oAuthGrant",ev.OZONELEVEL="ozoneLevel",ev.SEQUENCENUMBER="sequenceNumber",ev.COUNTINMINUTE="countInMinute",ev.PORT="port",ev.SUNALTITUDE="sunAltitude",ev.COUNTOUT="countOut",ev.ROOMNUMBER="roomNumber",ev.TUNNELINGSUPPORTED="tunnelingSupported",ev.ENINUMBER="ENINumber",ev.PARTICLESPM2_5="particlesPM2_5",ev.AGENTDISABLED="agentDisabled",ev.DISABLED="disabled",ev.COUNTIN="countIn",ev.MESSAGESOURCEADDRESS="messageSourceAddress",ev.PROVISIONWEATHERASSET="ProvisionWeatherAsset",ev.TIMEINJECTIONINTERVAL="timeInjectionInterval",ev.TEMPERATURESETPOINT="temperatureSetpoint",ev.CONSOLEPROVIDERS="consoleProviders",ev.COUNTTOTAL="countTotal",ev.SPACESBUFFER="spacesBuffer",ev.DEVICECONFIG="deviceConfig",ev.SPACESTOTAL="spacesTotal",ev.BINDHOST="bindHost",ev.FANSPEED="fanSpeed",ev.MESSAGECONVERTBINARY="messageConvertBinary",ev.NOTES="notes",ev.MAILFOLDERNAME="mailFolderName",ev.MESSAGEDELIMITERS="messageDelimiters",ev.TEMPERATURE="temperature",ev.SUNZENITH="sunZenith",ev.SNMPVERSIONVALUE="SNMPVersionValue",ev.BRIGHTNESS="brightness",ev.POSTALCODE="postalCode",ev.SPACESOPEN="spacesOpen",ev.HUMIDITY="humidity",ev.SOUNDLEVEL="soundLevel",ev.SECUREMODE="secureMode",ev.DIRECTION="direction",ev.STOPBITS="stopbits",ev.UVINDEX="uVIndex",ev.CONNECTURL="connectURL",ev.CLIENTID="clientId",ev.NATMODE="NATMode",ev.UPDATEONWRITE="updateOnWrite",ev.LASTWILLPAYLOAD="lastWillPayload",ev.GROUPID="groupId",ev.FOLLOWREDIRECTS="followRedirects",ev.SUNAZIMUTH="sunAzimuth",ev.MESSAGECONVERTHEX="messageConvertHex",ev.WEBSOCKETMODE="websocketMode",ev.COLOURTEMPERATURE="colourTemperature",ev.PUBLISHQOS="publishQos",ev.DATABITS="dataBits",(ex=tS||(tS={})).FORMAT="format",ex.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",ex.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",ex.SECRET="secret",ex.APPLYPREDICTEDDATAPOINTS="applyPredictedDataPoints",ex.ATTRIBUTELINKS="attributeLinks",ex.RULERESETIMMEDIATE="ruleResetImmediate",ex.RULESTATE="ruleState",ex.AGENTLINKCONFIG="agentLinkConfig",ex.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",ex.FORECAST="forecast",ex.STOREDATAPOINTS="storeDataPoints",ex.LABEL="label",ex.CONSTRAINTS="constraints",ex.UNITS="units",ex.USERCONNECTED="userConnected",ex.SHOWONDASHBOARD="showOnDashboard",ex.READONLY="readOnly",ex.MULTILINE="multiline",ex.ACCESSPUBLICWRITE="accessPublicWrite",ex.MOMENTARY="momentary",ex.AGENTLINK="agentLink",ex.ACCESSRESTRICTEDREAD="accessRestrictedRead",ex.ACCESSPUBLICREAD="accessPublicRead",(eF=tI||(tI={})).ASSETQUERY="assetQuery",eF.WSURL="WS_URL",eF.COLOURRGB="colourRGB",eF.VALUEFORMAT="valueFormat",eF.TEXT="text",eF.BYTE="byte",eF.USERNAMEANDPASSWORD="usernameAndPassword",eF.HTTPURL="HTTP_URL",eF.ATTRIBUTELINK="attributeLink",eF.ASSETID="assetID",eF.NUMBERMAP="numberMap",eF.HTTPMETHOD="HTTPMethod",eF.ATTRIBUTESTATE="attributeState",eF.POSITIVENUMBER="positiveNumber",eF.POSITIVEINTEGER="positiveInteger",eF.EXECUTIONSTATUS="executionStatus",eF.BIGINTEGER="bigInteger",eF.VALUEDESCRIPTOR="valueDescriptor",eF.PERIODDURATIONISO8601="periodDurationISO8601",eF.LONG="long",eF.DATEANDTIME="dateAndTime",eF.BOOLEANMAP="booleanMap",eF.MQTTQOS="MQTTQos",eF.NEGATIVEINTEGER="negativeInteger",eF.TCPIPPORTNUMBER="TCP_IPPortNumber",eF.GEOJSONPOINT="GEO_JSONPoint",eF.SNMPVERSION="SNMPVersion",eF.ASSETTYPE="assetType",eF.JSONOBJECT="JSONObject",eF.INTEGERMAP="integerMap",eF.BIGNUMBER="bigNumber",eF.IPADDRESS="IPAddress",eF.EMAIL="email",eF.TIMESTAMP="timestamp",eF.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",eF.ATTRIBUTEREFERENCE="attributeReference",eF.UUID="UUID",eF.INTEGER="integer",eF.OAUTHGRANT="oAuthGrant",eF.NUMBER="number",eF.DEVICECONFIGMAP="DeviceConfigMap",eF.TEXTMAP="textMap",eF.WEBSOCKETSUBSCRIPTION="websocketSubscription",eF.BOOLEAN="boolean",eF.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",eF.FORECASTCONFIGURATION="forecastConfiguration",eF.TIMEDURATIONISO8601="timeDurationISO8601",eF.TIMESTAMPISO8601="timestampISO8601",eF.CONSOLEPROVIDERS="consoleProviders",eF.MULTIVALUEDTEXTMAP="multivaluedTextMap",eF.NEGATIVENUMBER="negativeNumber",eF.PARITYBIT="Paritybit",eF.JSON="JSON",eF.CRONEXPRESSION="CRONExpression",eF.INTEGERBYTE="integerByte",eF.AGENTLINK="agentLink",eF.DIRECTION="direction",eF.HOSTORIPADDRESS="hostOrIPAddress",eF.STOPBITS="Stopbits",eF.CALENDAREVENT="calendarEvent",eF.CONNECTIONSTATUS="connectionStatus",eF.VALUECONSTRAINT="valueConstraint",(ew=tD||(tD={})).MONTH="month",ew.MILE_SCANDINAVIAN="mile_scandinavian",ew.VAR="var",ew.OUNCE="ounce",ew.HECTARE="hectare",ew.YARD="yard",ew.YEAR="year",ew.GIGA="giga",ew.JOULE="joule",ew.VOLT="volt",ew.HERTZ="hertz",ew.MILE="mile",ew.DEGREE="degree",ew.KILO="kilo",ew.BTU="btu",ew.TERA="tera",ew.FOOT="foot",ew.MEGA="mega",ew.KELVIN="kelvin",ew.CARBON="carbon",ew.DECIBEL_ATTENUATED="decibel_attenuated",ew.INCH="inch",ew.SQUARED="squared",ew.PERCENTAGE="percentage",ew.IN_HG="inch_mercury",ew.CENTI="centi",ew.GRAM="gram",ew.CUBED="cubed",ew.DAY="day",ew.RADIAN="radian",ew.OHM="ohm",ew.MINUTE="minute",ew.PART_PER_MILLION="ppm",ew.AMP="amp",ew.MASS_POUND="pound",ew.KNOT="knot",ew.METRE="metre",ew.LITRE="litre",ew.FLUID_OUNCE="fluid_ounce",ew.HOUR="hour",ew.ACRE="acre",ew.CELSIUS="celsius",ew.RPM="rpm",ew.PASCAL="pascal",ew.DECIBEL="decibel",ew.LUMEN="lumen",ew.WEEK="week",ew.FAHRENHEIT="fahrenheit",ew.WATT="watt",ew.GALLON="gallon",ew.LUX="lux",ew.MILLI="milli",ew.BAR="bar",ew.HECTO="hecto",ew.PEAK="peak",ew.SECOND="second",ew.MICRO="micro",ew.PER="per",ew.STONE="stone",tP||(tP={});class tY{static getAssetDescriptors(){return tY._assetTypeInfos.map(t=>t.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(t){if(t)return t.assetDescriptor?t:("string"!=typeof t&&(t=t.name),this._assetTypeInfos.find(n=>n.assetDescriptor.name===t))}static getAssetDescriptor(t){if(!t)return;if(t.assetDescriptor)return t.assetDescriptor;if("string"!=typeof t)return t;let n=this._assetTypeInfos.find(n=>n.assetDescriptor.name===t);return n?n.assetDescriptor:void 0}static getAttributeDescriptor(t,n){if(!t)return;let i=this.getAssetTypeInfo(n||"ThingAsset");if(i&&i.attributeDescriptors)return i.attributeDescriptors.find(n=>n.name===t)}static getValueDescriptor(t){let n;if(!t)return;if(t.endsWith("[]"))for(n=0;t.endsWith("[]");)t=t.substring(0,t.length-2),n++;let i=this._valueDescriptors.find(n=>n.name===t);return i&&n&&(i=Object.assign(Object.assign({},i),{arrayDimensions:n})),i}static resolveValueDescriptor(t,n){let i;return n&&("string"==typeof n&&(i=tY.getValueDescriptor(n)),i=n.jsonType?n:tY.getValueDescriptor(n.type)),!i&&t&&(i=tY.getValueDescriptor("JSON")),i}static resolveValueTypeFromValue(t){if(null!=t){if("number"==typeof t)return"number";if("string"==typeof t)return"text";if("boolean"==typeof t)return"boolean";if(Array.isArray(t)){let n=1,i=t.find(t=>null!=t);for(;Array.isArray(i);)i=i.find(t=>null!=t),n++;let r=this.resolveValueTypeFromValue(i);if(!r)return;for(;n>0;)r+="[]",n--;return r}if(t instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(t,n,i){let r,o;if(n&&"string"!=typeof n)r=n;else{let o=this.getAssetTypeInfo(t||"ThingAsset");if(!o)return[void 0,void 0];"string"==typeof n&&(r=this.getAttributeDescriptor(n,o)),!r&&i&&(r={type:i.type,name:i.name,meta:i.meta})}return r&&(o=this.getValueDescriptor(r.type)),[r,o]}static getMetaItemDescriptor(t){if(t)return this._metaItemDescriptors.find(n=>n.name===t)}static getAssetDescriptorColour(t,n){let i=this.getAssetDescriptor(t);return i&&i.colour?i.colour:n}static getAssetDescriptorIcon(t,n){let i=this.getAssetDescriptor(t);return i&&i.icon?i.icon:n}}function tX(t){return(tX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tZ(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function tK(t){var n=function(t,n){if("object"!=tX(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=tX(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==tX(n)?n:n+""}function tJ(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tK(r.key),r)}}function tQ(t,n,i){return n&&tJ(t.prototype,n),i&&tJ(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function t0(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function t1(t,n){return(t1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function t2(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&t1(t,n)}function t3(t,n){if(n&&("object"==tX(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return t0(t)}function t5(t){return(t5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t4(t,n,i){return(n=tK(n))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function t6(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=Array(n);i<n;i++)r[i]=t[i];return r}function t8(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function t7(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t8(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):t8(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}tY._assetTypeInfos=[],tY._metaItemDescriptors=[],tY._valueDescriptors=[];var t9={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},ne=new(function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tZ(this,t),this.init(n,i)}return tQ(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||t9,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,n,i,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(i).concat(this.prefix," ").concat(t[0])),this.logger[n](t))}},{key:"create",value:function(n){return new t(this.logger,t7(t7({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return(n=n||this.options).prefix=n.prefix||this.prefix,new t(this.logger,n)}}]),t}()),nt=function(){function t(){tZ(this,t),this.observers={}}return tQ(t,[{key:"on",value:function(t,n){var i=this;return t.split(" ").forEach(function(t){i.observers[t]=i.observers[t]||[],i.observers[t].push(n)}),this}},{key:"off",value:function(t,n){if(this.observers[t]){if(!n)return void delete this.observers[t];this.observers[t]=this.observers[t].filter(function(t){return t!==n})}}},{key:"emit",value:function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.observers[t]&&[].concat(this.observers[t]).forEach(function(t){t.apply(void 0,i)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(n){n.apply(n,[t].concat(i))})}}]),t}();function nn(){var t,n,i=new Promise(function(i,r){t=i,n=r});return i.resolve=t,i.reject=n,i}function ni(t){return null==t?"":""+t}function nr(t,n,i){function r(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function o(){return!t||"string"==typeof t}for(var a="string"!=typeof n?[].concat(n):n.split(".");a.length>1;){if(o())return{};var s=r(a.shift());!t[s]&&i&&(t[s]=new i),t=Object.prototype.hasOwnProperty.call(t,s)?t[s]:{}}return o()?{}:{obj:t,k:r(a.shift())}}function no(t,n,i){var r=nr(t,n,Object);r.obj[r.k]=i}function na(t,n){var i=nr(t,n),r=i.obj,o=i.k;if(r)return r[o]}function ns(t,n,i){var r=na(t,i);return void 0!==r?r:na(n,i)}function nl(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var nc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function nd(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,function(t){return nc[t]}):t}var nu="u">typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,nh=[" ",",","?","!",";"];function nm(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function np(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nm(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nm(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nf=function(t){t2(r,t);var n,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t5(r);return t=n?Reflect.construct(i,arguments,t5(this).constructor):i.apply(this,arguments),t3(this,t)});function r(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return tZ(this,r),n=i.call(this),nu&&nt.call(t0(n)),n.data=t||{},n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return tQ(r,[{key:"addNamespaces",value:function(t){0>this.options.ns.indexOf(t)&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[t,n];i&&"string"!=typeof i&&(s=s.concat(i)),i&&"string"==typeof i&&(s=s.concat(o?i.split(o):i)),t.indexOf(".")>-1&&(s=t.split("."));var l=na(this.data,s);return l||!a||"string"!=typeof i?l:function t(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(n){if(n[i])return n[i];for(var o=i.split(r),a=n,s=0;s<o.length;++s){if(!a||"string"==typeof a[o[s]]&&s+1<o.length)return;if(void 0===a[o[s]]){for(var l=2,c=o.slice(s,s+l).join(r),d=a[c];void 0===d&&o.length>s+l;)l++,d=a[c=o.slice(s,s+l).join(r)];if(void 0===d)return;if(null===d)return null;if(i.endsWith(c)){if("string"==typeof d)return d;if(c&&"string"==typeof d[c])return d[c]}var u=o.slice(s+l).join(r);if(u)return t(d,u,r);return}a=a[o[s]]}return a}}(this.data&&this.data[t]&&this.data[t][n],i,o)}},{key:"addResource",value:function(t,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var s=[t,n];i&&(s=s.concat(a?i.split(a):i)),t.indexOf(".")>-1&&(s=t.split("."),r=n,n=s[1]),this.addNamespaces(n),no(this.data,s,r),o.silent||this.emit("added",t,n,i,r)}},{key:"addResources",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in i)("string"==typeof i[o]||"[object Array]"===Object.prototype.toString.apply(i[o]))&&this.addResource(t,n,o,i[o],{silent:!0});r.silent||this.emit("added",t,n,i)}},{key:"addResourceBundle",value:function(t,n,i,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),r=i,i=n,n=s[1]),this.addNamespaces(n);var l=na(this.data,s)||{};r?function t(n,i,r){for(var o in i)"__proto__"!==o&&"constructor"!==o&&(o in n?"string"==typeof n[o]||n[o]instanceof String||"string"==typeof i[o]||i[o]instanceof String?r&&(n[o]=i[o]):t(n[o],i[o],r):n[o]=i[o]);return n}(l,i,o):l=np(np({},l),i),no(this.data,s,l),a.silent||this.emit("added",t,n,i)}},{key:"removeResourceBundle",value:function(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}},{key:"hasResourceBundle",value:function(t,n){return void 0!==this.getResource(t,n)}},{key:"getResourceBundle",value:function(t,n){return(n||(n=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?np(np({},{}),this.getResource(t,n)):this.getResource(t,n)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(function(t){return n[t]&&Object.keys(n[t]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(nt),nb={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,i,r,o){var a=this;return t.forEach(function(t){a.processors[t]&&(n=a.processors[t].process(n,i,r,o))}),n}};function ng(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function n_(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ng(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ng(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var ny={},nv=function(t){t2(r,t);var n,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t5(r);return t=n?Reflect.construct(i,arguments,t5(this).constructor):i.apply(this,arguments),t3(this,t)});function r(t){var n,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return tZ(this,r),a=i.call(this),nu&&nt.call(t0(a)),n=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o=t0(a),n.forEach(function(n){t[n]&&(o[n]=t[n])}),a.options=s,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=ne.create("translator"),a}return tQ(r,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;var i=this.resolve(t,n);return i&&void 0!==i.res}},{key:"extractFromKey",value:function(t,n){var i=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");var r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=n.ns||this.options.defaultNS||[],a=i&&t.indexOf(i)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!function(t,n,i){n=n||"",i=i||"";var r=nh.filter(function(t){return 0>n.indexOf(t)&&0>i.indexOf(t)});if(0===r.length)return!0;var o=new RegExp("(".concat(r.map(function(t){return"?"===t?"\\?":t}).join("|"),")")),a=!o.test(t);if(!a){var s=t.indexOf(i);s>0&&!o.test(t.substring(0,s))&&(a=!0)}return a}(t,i,r);if(a&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};var c=t.split(i);(i!==r||i===r&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function(t,n,i){var o=this;if("object"!==tX(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var a=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,l=this.extractFromKey(t[t.length-1],n),c=l.key,d=l.namespaces,u=d[d.length-1],h=n.lng||this.language,m=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&"cimode"===h.toLowerCase()){if(m){var p=n.nsSeparator||this.options.nsSeparator;return a?(f.res="".concat(u).concat(p).concat(c),f):"".concat(u).concat(p).concat(c)}return a?(f.res=c,f):c}var f=this.resolve(t,n),b=f&&f.res,g=f&&f.usedKey||c,_=f&&f.exactUsedKey||c,y=Object.prototype.toString.apply(b),v=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,F="string"!=typeof b&&"boolean"!=typeof b&&"number"!=typeof b;if(x&&b&&F&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(y)&&("string"!=typeof v||"[object Array]"!==y)){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,b,n_(n_({},n),{},{ns:d})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(f.res=w,f):w}if(s){var E="[object Array]"===y,C=E?[]:{},A=E?_:g;for(var k in b)if(Object.prototype.hasOwnProperty.call(b,k)){var T="".concat(A).concat(s).concat(k);C[k]=this.translate(T,n_(n_({},n),{joinArrays:!1,ns:d})),C[k]===T&&(C[k]=b[k])}b=C}}else if(x&&"string"==typeof v&&"[object Array]"===y)(b=b.join(v))&&(b=this.extendTranslation(b,t,n,i));else{var S=!1,I=!1,D=void 0!==n.count&&"string"!=typeof n.count,P=r.hasDefaultValue(n),R=D?this.pluralResolver.getSuffix(h,n.count,n):"",O=n["defaultValue".concat(R)]||n.defaultValue;!this.isValidLookup(b)&&P&&(S=!0,b=O),this.isValidLookup(b)||(I=!0,b=c);var M=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&I?void 0:b,L=P&&O!==b&&this.options.updateMissing;if(I||S||L){if(this.logger.log(L?"updateKey":"missingKey",h,u,c,L?O:b),s){var B=this.resolve(c,n_(n_({},n),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var z=[],N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&N&&N[0])for(var U=0;U<N.length;U++)z.push(N[U]);else"all"===this.options.saveMissingTo?z=this.languageUtils.toResolveHierarchy(n.lng||this.language):z.push(n.lng||this.language);var j=function(t,i,r){var a=P&&r!==b?r:M;o.options.missingKeyHandler?o.options.missingKeyHandler(t,u,i,a,L,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(t,u,i,a,L,n),o.emit("missingKey",t,u,i,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?z.forEach(function(t){o.pluralResolver.getSuffixes(t,n).forEach(function(i){j([t],c+i,n["defaultValue".concat(i)]||O)})}):j(z,c,O))}b=this.extendTranslation(b,t,n,f,i),I&&b===c&&this.options.appendNamespaceToMissingKey&&(b="".concat(u,":").concat(c)),(I||S)&&this.options.parseMissingKeyHandler&&(b="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(c):c,S?b:void 0):this.options.parseMissingKeyHandler(b))}return a?(f.res=b,f):b}},{key:"extendTranslation",value:function(t,n,i,r,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,n_(n_({},this.options.interpolation.defaultVariables),i),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(n_(n_({},i),{interpolation:n_(n_({},this.options.interpolation),i.interpolation)}));var s,l="string"==typeof t&&(i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){var c=t.match(this.interpolator.nestingRegexp);s=c&&c.length}var d=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(d=n_(n_({},this.options.interpolation.defaultVariables),d)),t=this.interpolator.interpolate(t,d,i.lng||this.language,i),l){var u=t.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(i.nest=!1)}!1!==i.nest&&(t=this.interpolator.nest(t,function(){for(var t=arguments.length,r=Array(t),s=0;s<t;s++)r[s]=arguments[s];return o&&o[0]===r[0]&&!i.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(n[0])),null):a.translate.apply(a,r.concat([n]))},i)),i.interpolation&&this.interpolator.reset()}var h=i.postProcess||this.options.postProcess,m="string"==typeof h?[h]:h;return null!=t&&m&&m.length&&!1!==i.applyPostProcessor&&(t=nb.handle(m,t,n,this.options&&this.options.postProcessPassResolved?n_({i18nResolved:r},i):i,this)),t}},{key:"resolve",value:function(t){var n,i,r,o,a,s=this,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach(function(t){if(!s.isValidLookup(n)){var c=s.extractFromKey(t,l),d=c.key;i=d;var u=c.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var h=void 0!==l.count&&"string"!=typeof l.count,m=h&&!l.ordinal&&0===l.count&&s.pluralResolver.shouldUseIntlApi(),p=void 0!==l.context&&("string"==typeof l.context||"number"==typeof l.context)&&""!==l.context,f=l.lngs?l.lngs:s.languageUtils.toResolveHierarchy(l.lng||s.language,l.fallbackLng);u.forEach(function(t){s.isValidLookup(n)||(a=t,!ny["".concat(f[0],"-").concat(t)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(a)&&(ny["".concat(f[0],"-").concat(t)]=!0,s.logger.warn('key "'.concat(i,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(function(i){if(!s.isValidLookup(n)){o=i;var a,c=[d];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(c,d,i,t,l);else{h&&(u=s.pluralResolver.getSuffix(i,l.count,l));var u,f="".concat(s.options.pluralSeparator,"zero");if(h&&(c.push(d+u),m&&c.push(d+f)),p){var b="".concat(d).concat(s.options.contextSeparator).concat(l.context);c.push(b),h&&(c.push(b+u),m&&c.push(b+f))}}for(;a=c.pop();)s.isValidLookup(n)||(r=a,n=s.getResource(i,t,a,l))}}))})}}),{res:n,usedKey:i,exactUsedKey:r,usedLng:o,usedNS:a}}},{key:"isValidLookup",value:function(t){return void 0!==t&&!(!this.options.returnNull&&null===t)&&!(!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}}],[{key:"hasDefaultValue",value:function(t){var n="defaultValue";for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&n===i.substring(0,n.length)&&void 0!==t[i])return!0;return!1}}]),r}(nt);function nx(t){return t.charAt(0).toUpperCase()+t.slice(1)}var nF=function(){function t(n){tZ(this,t),this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ne.create("languageUtils")}return tQ(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return null;var n=t.split("-");return 2===n.length||(n.pop(),"x"===n[n.length-1].toLowerCase())?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return t;var n=t.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=t.split("-");return this.options.lowerCaseLng?i=i.map(function(t){return t.toLowerCase()}):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=nx(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=nx(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=nx(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var n,i=this;return t?(t.forEach(function(t){if(!n){var r=i.formatLanguageCode(t);(!i.options.supportedLngs||i.isSupportedCode(r))&&(n=r)}}),!n&&this.options.supportedLngs&&t.forEach(function(t){if(!n){var r=i.getLanguagePartFromCode(t);if(i.isSupportedCode(r))return n=r;n=i.options.supportedLngs.find(function(t){if(0===t.indexOf(r))return t})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n):null}},{key:"getFallbackCodes",value:function(t,n){if(!t)return[];if("function"==typeof t&&(t=t(n)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!n)return t.default||[];var i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}},{key:"toResolveHierarchy",value:function(t,n){var i=this,r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=function(t){t&&(i.isSupportedCode(t)?o.push(t):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(t))):"string"==typeof t&&a(this.formatLanguageCode(t)),r.forEach(function(t){0>o.indexOf(t)&&a(i.formatLanguageCode(t))}),o}}]),t}(),nw=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],nE={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(+(1!=t&&(t%10!=1||t%100==11)))},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:3*(t%100==3||t%100==4))},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},nC=["v1","v2","v3"],nA={zero:0,one:1,two:2,few:3,many:4,other:5},nk=function(){function t(n){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tZ(this,t),this.languageUtils=n,this.options=r,this.logger=ne.create("pluralResolver"),(!this.options.compatibilityJSON||"v4"===this.options.compatibilityJSON)&&("u"<typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(i={},nw.forEach(function(t){t.lngs.forEach(function(n){i[n]={numbers:t.nr,plurals:nE[t.fc]}})}),i)}return tQ(t,[{key:"addRule",value:function(t,n){this.rules[t]=n}},{key:"getRule",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:n.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(t,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,i).map(function(t){return"".concat(n).concat(t)})}},{key:"getSuffixes",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,i);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort(function(t,n){return nA[t]-nA[n]}).map(function(t){return"".concat(n.options.prepend).concat(t)}):r.numbers.map(function(r){return n.getSuffix(t,r,i)}):[]}},{key:"getSuffix",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(t,i);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(n)):this.getSuffixRetroCompatible(r,n):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,n){var i=this,r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n)),o=t.numbers[r];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!nC.includes(this.options.compatibilityJSON)}}]),t}();function nT(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function nS(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nT(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nT(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nI=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tZ(this,t),this.logger=ne.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return tQ(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var n=t.interpolation;this.escape=void 0!==n.escape?n.escape:nd,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?nl(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?nl(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?nl(n.nestingPrefix):n.nestingPrefixEscaped||nl("$t("),this.nestingSuffix=n.nestingSuffix?nl(n.nestingSuffix):n.nestingSuffixEscaped||nl(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=void 0!==n.alwaysFormat&&n.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(t,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(i,"g")}},{key:"interpolate",value:function(t,n,i,r){var o,a,s,l=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(t){return t.replace(/\$/g,"$$$$")}var u=function(t){if(0>t.indexOf(l.formatSeparator)){var o=ns(n,c,t);return l.alwaysFormat?l.format(o,void 0,i,nS(nS(nS({},r),n),{},{interpolationkey:t})):o}var a=t.split(l.formatSeparator),s=a.shift().trim(),d=a.join(l.formatSeparator).trim();return l.format(ns(n,c,s),d,i,nS(nS(nS({},r),n),{},{interpolationkey:s}))};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,m=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return d(t)}},{regex:this.regexp,safeValue:function(t){return l.escapeValue?d(l.escape(t)):d(t)}}].forEach(function(n){for(s=0;o=n.regex.exec(t);){var i=o[1].trim();if(void 0===(a=u(i)))if("function"==typeof h){var c=h(t,o,r);a="string"==typeof c?c:""}else if(r&&r.hasOwnProperty(i))a="";else if(m){a=o[0];continue}else l.logger.warn("missed to pass in variable ".concat(i," for interpolating ").concat(t)),a="";else"string"==typeof a||l.useRawValueToEscape||(a=ni(a));var d=n.safeValue(a);if(t=t.replace(o[0],d),m?(n.regex.lastIndex+=a.length,n.regex.lastIndex-=o[0].length):n.regex.lastIndex=0,++s>=l.maxReplaces)break}}),t}},{key:"nest",value:function(t,n){var i,r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=nS({},a);function l(t,n){var i=this.nestingOptionsSeparator;if(0>t.indexOf(i))return t;var r=t.split(new RegExp("".concat(i,"[ ]*{"))),o="{".concat(r[1]);t=r[0];var a=(o=this.interpolate(o,s)).match(/'/g),l=o.match(/"/g);(a&&a.length%2==0&&!l||l.length%2!=0)&&(o=o.replace(/'/g,'"'));try{s=JSON.parse(o),n&&(s=nS(nS({},n),s))}catch(n){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),n),"".concat(t).concat(i).concat(o)}return delete s.defaultValue,t}for(s.applyPostProcessor=!1,delete s.defaultValue;i=this.nestingRegexp.exec(t);){var c=[],d=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){var u=i[1].split(this.formatSeparator).map(function(t){return t.trim()});i[1]=u.shift(),c=u,d=!0}if((r=n(l.call(this,i[1].trim(),s),s))&&i[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=ni(r)),r||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(t)),r=""),d&&(r=c.reduce(function(t,n){return o.format(t,n,a.lng,nS(nS({},a),{},{interpolationkey:i[1].trim()}))},r.trim())),t=t.replace(i[0],r),this.regexp.lastIndex=0}return t}}]),t}();function nD(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function nP(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nD(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nD(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function nR(t){var n={};return function(i,r,o){var a=r+JSON.stringify(o),s=n[a];return s||(s=t(r,o),n[a]=s),s(i)}}var nO=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tZ(this,t),this.logger=ne.create("formatter"),this.options=n,this.formats={number:nR(function(t,n){var i=new Intl.NumberFormat(t,n);return function(t){return i.format(t)}}),currency:nR(function(t,n){var i=new Intl.NumberFormat(t,nP(nP({},n),{},{style:"currency"}));return function(t){return i.format(t)}}),datetime:nR(function(t,n){var i=new Intl.DateTimeFormat(t,nP({},n));return function(t){return i.format(t)}}),relativetime:nR(function(t,n){var i=new Intl.RelativeTimeFormat(t,nP({},n));return function(t){return i.format(t,n.range||"day")}}),list:nR(function(t,n){var i=new Intl.ListFormat(t,nP({},n));return function(t){return i.format(t)}})},this.init(n)}return tQ(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(t,n){this.formats[t.toLowerCase().trim()]=n}},{key:"addCached",value:function(t,n){this.formats[t.toLowerCase().trim()]=nR(n)}},{key:"format",value:function(t,n,i,r){var o=this;return n.split(this.formatSeparator).reduce(function(t,n){var a=function(t){var n=t.toLowerCase().trim(),i={};if(t.indexOf("(")>-1){var r=t.split("(");n=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===n&&0>o.indexOf(":")?i.currency||(i.currency=o.trim()):"relativetime"===n&&0>o.indexOf(":")?i.range||(i.range=o.trim()):o.split(";").forEach(function(t){if(t){var n,r=function(t){if(Array.isArray(t))return t}(n=t.split(":"))||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t){if(t){if("string"==typeof t)return t6(t,void 0);var n=({}).toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t6(t,void 0):void 0}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],a=r.slice(1).join(":").trim().replace(/^'+|'+$/g,"");i[o.trim()]||(i[o.trim()]=a),"false"===a&&(i[o.trim()]=!1),"true"===a&&(i[o.trim()]=!0),isNaN(a)||(i[o.trim()]=parseInt(a,10))}})}return{formatName:n,formatOptions:i}}(n),s=a.formatName,l=a.formatOptions;if(o.formats[s]){var c=t;try{var d=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=d.locale||d.lng||r.locale||r.lng||i;c=o.formats[s](t,u,nP(nP(nP({},l),r),d))}catch(t){o.logger.warn(t)}return c}return o.logger.warn("there was no format function for ".concat(s)),t},t)}}]),t}();function nM(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function nL(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nM(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nM(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nB=function(t){t2(r,t);var n,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t5(r);return t=n?Reflect.construct(i,arguments,t5(this).constructor):i.apply(this,arguments),t3(this,t)});function r(t,n,o){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return tZ(this,r),a=i.call(this),nu&&nt.call(t0(a)),a.backend=t,a.store=n,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=ne.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return tQ(r,[{key:"queueLoad",value:function(t,n,i,r){var o=this,a={},s={},l={},c={};return t.forEach(function(t){var r=!0;n.forEach(function(n){var l="".concat(t,"|").concat(n);!i.reload&&o.store.hasResourceBundle(t,n)?o.state[l]=2:o.state[l]<0||(1===o.state[l]?void 0===s[l]&&(s[l]=!0):(o.state[l]=1,r=!1,void 0===s[l]&&(s[l]=!0),void 0===a[l]&&(a[l]=!0),void 0===c[n]&&(c[n]=!0)))}),r||(l[t]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(t,n,i){var r=t.split("|"),o=r[0],a=r[1];n&&this.emit("failedLoading",o,a,n),i&&this.store.addResourceBundle(o,a,i),this.state[t]=n?-1:2;var s={};this.queue.forEach(function(i){var r,l,c,d;r=i.loaded,(c=(l=nr(r,[o],Object)).obj)[d=l.k]=c[d]||[],c[d].push(a),void 0!==i.pending[t]&&(delete i.pending[t],i.pendingCount--),n&&i.errors.push(n),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach(function(t){s[t]||(s[t]={});var n=i.loaded[t];n.length&&n.forEach(function(n){void 0===s[t][n]&&(s[t][n]=!0)})}),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(function(t){return!t.done})}},{key:"read",value:function(t,n,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return t.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:t,ns:n,fcName:i,tried:o,wait:a,callback:s}):(this.readingCalls++,this.backend[i](t,n,function(l,c){if(r.readingCalls--,r.waitingReads.length>0){var d=r.waitingReads.shift();r.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}l&&c&&o<r.maxRetries?setTimeout(function(){r.read.call(r,t,n,i,o+1,2*a,s)},a):s(l,c)})):s(null,{})}},{key:"prepareLoading",value:function(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof n&&(n=[n]);var a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(function(t){i.loadOne(t)})}},{key:"load",value:function(t,n,i){this.prepareLoading(t,n,{},i)}},{key:"reload",value:function(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}},{key:"loadOne",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,function(r,s){r&&n.logger.warn("".concat(i,"loading namespace ").concat(a," for language ").concat(o," failed"),r),!r&&s&&n.logger.log("".concat(i,"loaded namespace ").concat(a," for language ").concat(o),s),n.loaded(t,r,s)})}},{key:"saveMissing",value:function(t,n,i,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null==i||""===i||(this.backend&&this.backend.create&&this.backend.create(t,n,i,r,null,nL(nL({},a),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],n,i,r))}}]),r}(nt);function nz(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&0>t.supportedLngs.indexOf("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function nN(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function nU(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nN(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nN(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function nj(){}var nV=function(t){t2(r,t);var n,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t5(r);return t=n?Reflect.construct(i,arguments,t5(this).constructor):i.apply(this,arguments),t3(this,t)});function r(){var t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(tZ(this,r),n=i.call(this),nu&&nt.call(t0(n)),n.options=nz(o),n.services={},n.logger=ne,n.modules={external:[]},Object.getOwnPropertyNames(Object.getPrototypeOf(t=t0(n))).forEach(function(n){"function"==typeof t[n]&&(t[n]=t[n].bind(t))}),a&&!n.isInitialized&&!o.isClone){if(!n.options.initImmediate)return n.init(o,a),t3(n,t0(n));setTimeout(function(){n.init(o,a)},0)}return n}return tQ(r,[{key:"init",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;"function"==typeof n&&(i=n,n={}),!n.defaultNS&&!1!==n.defaultNS&&n.ns&&("string"==typeof n.ns?n.defaultNS=n.ns:0>n.ns.indexOf("translation")&&(n.defaultNS=n.ns[0]));var r={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if("object"===tX(t[1])&&(n=t[1]),"string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"===tX(t[2])||"object"===tX(t[3])){var i=t[3]||t[2];Object.keys(i).forEach(function(t){n[t]=i[t]})}return n},interpolation:{escapeValue:!0,format:function(t,n,i,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function o(t){return t?"function"==typeof t?new t:t:null}if(this.options=nU(nU(nU({},r),this.options),nz(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=nU(nU({},r.interpolation),this.options.interpolation)),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator),!this.options.isClone){this.modules.logger?ne.init(o(this.modules.logger),this.options):ne.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"u">typeof Intl&&(a=nO);var a,s=new nF(this.options);this.store=new nf(this.options.resources,this.options);var l=this.services;l.logger=ne,l.resourceStore=this.store,l.languageUtils=s,l.pluralResolver=new nk(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(l.formatter=o(a),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new nI(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new nB(o(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];t.emit.apply(t,[n].concat(r))}),this.modules.languageDetector&&(l.languageDetector=o(this.modules.languageDetector),l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=o(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new nv(this.services,this.options),this.translator.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];t.emit.apply(t,[n].concat(r))}),this.modules.external.forEach(function(n){n.init&&n.init(t)})}if(this.format=this.options.interpolation.format,i||(i=nj),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(n){t[n]=function(){var i;return(i=t.store)[n].apply(i,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(n){t[n]=function(){var i;return(i=t.store)[n].apply(i,arguments),t}});var d=nn(),u=function(){var n=function(n,r){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),d.resolve(r),i(n,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return n(null,t.t.bind(t));t.changeLanguage(t.options.lng,n)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),d}},{key:"loadResources",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nj,r=i,o="string"==typeof t?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var a=[],s=function(t){t&&n.services.languageUtils.toResolveHierarchy(t).forEach(function(t){0>a.indexOf(t)&&a.push(t)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(t){return s(t)}),this.options.preload&&this.options.preload.forEach(function(t){return s(t)}),this.services.backendConnector.load(a,this.options.ns,function(t){t||n.resolvedLanguage||!n.language||n.setResolvedLanguage(n.language),r(t)})}else r(null)}},{key:"reloadResources",value:function(t,n,i){var r=nn();return t||(t=this.languages),n||(n=this.options.ns),i||(i=nj),this.services.backendConnector.reload(t,n,function(t){r.resolve(),i(t)}),r}},{key:"use",value:function(t){if(!t)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&nb.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(var n=0;n<this.languages.length;n++){var i=this.languages[n];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}},{key:"changeLanguage",value:function(t,n){var i=this;this.isLanguageChangingTo=t;var r=nn();this.emit("languageChanging",t);var o=function(t){i.language=t,i.languages=i.services.languageUtils.toResolveHierarchy(t),i.resolvedLanguage=void 0,i.setResolvedLanguage(t)},a=function(t,a){a?(o(a),i.translator.changeLanguage(a),i.isLanguageChangingTo=void 0,i.emit("languageChanged",a),i.logger.log("languageChanged",a)):i.isLanguageChangingTo=void 0,r.resolve(function(){return i.t.apply(i,arguments)}),n&&n(t,function(){return i.t.apply(i,arguments)})},s=function(n){t||n||!i.services.languageDetector||(n=[]);var r="string"==typeof n?n:i.services.languageUtils.getBestMatchFromCodes(n);r&&(i.language||o(r),i.translator.language||i.translator.changeLanguage(r),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(r)),i.loadResources(r,function(t){a(t,r)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,n,i){var r=this,o=function t(n,o){if("object"!==tX(o)){for(var a,s=arguments.length,l=Array(s>2?s-2:0),c=2;c<s;c++)l[c-2]=arguments[c];a=r.options.overloadTranslationOptionHandler([n,o].concat(l))}else a=nU({},o);a.lng=a.lng||t.lng,a.lngs=a.lngs||t.lngs,a.ns=a.ns||t.ns,a.keyPrefix=a.keyPrefix||i||t.keyPrefix;var d=r.options.keySeparator||".",u=a.keyPrefix?"".concat(a.keyPrefix).concat(d).concat(n):n;return r.t(u,a)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(t,i){var r=n.services.backendConnector.state["".concat(t,"|").concat(i)];return -1===r||2===r};if(i.precheck){var l=i.precheck(this,s);if(void 0!==l)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(a,t)))}},{key:"loadNamespaces",value:function(t,n){var i=this,r=nn();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach(function(t){0>i.options.ns.indexOf(t)&&i.options.ns.push(t)}),this.loadResources(function(t){r.resolve(),n&&n(t)}),r):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(t,n){var i=nn();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],o=t.filter(function(t){return 0>r.indexOf(t)});return o.length?(this.options.preload=r.concat(o),this.loadResources(function(t){i.resolve(),n&&n(t)}),i):(n&&n(),Promise.resolve())}},{key:"dir",value:function(t){return(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),t)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nj,o=nU(nU(nU({},this.options),n),{isClone:!0}),a=new r(o);return(void 0!==n.debug||void 0!==n.prefix)&&(a.logger=a.logger.clone(n)),["store","services","language"].forEach(function(n){a[n]=t[n]}),a.services=nU({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new nv(a.services,a.options),a.translator.on("*",function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];a.emit.apply(a,[t].concat(i))}),a.init(o,i),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(nt);t4(nV,"createInstance",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new nV(t,n)});var n$=nV.createInstance();n$.createInstance=nV.createInstance,n$.createInstance,n$.init,n$.loadResources,n$.reloadResources,n$.use,n$.changeLanguage,n$.getFixedT,n$.t,n$.exists,n$.setDefaultNamespace,n$.hasLoadedNamespace,n$.loadNamespaces,n$.loadLanguages;let nq=n$;var nG=i(4867),nH=i.n(nG);i(3472);class nW{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n}),Object.freeze(this)}}function nY(t,n,i=!0){if(null==t||null==n)return t===n;if(t.constructor!==n.constructor)return!1;if(t instanceof Function||t instanceof RegExp)return t===n;if(t===n||t.valueOf()===n.valueOf())return!0;if(Array.isArray(t)&&t.length!==n.length||t instanceof Date||!(t instanceof Object)||!(n instanceof Object))return!1;if(i){if(Array.isArray(t))return t.every((t,i)=>nY(t,n[i]));let i=Object.keys(t);return Object.keys(n).every(t=>-1!==i.indexOf(t))&&i.every(i=>nY(t[i],n[i]))}return!1}function nX(t){if(null==t)return"";let n=!1;return t.split(/([A-Z]|\d)/).map((t,i,r)=>{if(!t)return t;if(!n)return n=!0,t.charAt(0).toUpperCase()+t.slice(1);if("_"===t)return" ";if(1===t.length&&t===t.toUpperCase()){let n=!r[i-1]||"_"===r[i-1],o=i+1<r.length&&r[i+1]&&"_"!==r[i+1],a=i+3>r.length||!r[i+1]&&!r[i+3];(!n||o)&&(t=" "+t),!o&&(n||a)||(t=t.toLowerCase())}return t}).join("").trim()}function nZ(t,n,i){let r="string"==typeof t?t:t.name;return n&&n.meta&&n.meta.hasOwnProperty(r)?n.meta[r]:i&&i.meta?i.meta[r]:void 0}function nK(t){return("string"==typeof t&&(t=tY.getAssetDescriptor(t)),t)?nq.t("label.asset."+t.name,{defaultValue:nX(t.name)}):""}function nJ(t,n,i,r,o,a){let s=nQ(t?t.value:void 0,()=>n1("format",t,n,i,o),void 0,a),l=n1("units",t,n,i,!0);return r&&l&&l.length&&(s=n0(n1("units",t,n,i,o),s)),s}function nQ(t,n,i,r){let o="";if(null==t)o=r||"";else if("string"==typeof t)o=t;else if("number"==typeof t||"boolean"==typeof t||t instanceof Date){let r=n&&n();if(r&&0!==Object.keys(r).length)switch("number"==typeof t?r.asBoolean?t=!!t:r.asDate&&(t=new Date(t)):"boolean"==typeof t&&r.asNumber&&(t=+!!t),typeof t){case"number":o=new Intl.NumberFormat(i||nq.language,r).format(t);break;case"boolean":r.asOnOff&&(o=t?nq.t("on"):nq.t("off")),r.asOpenClosed&&(o=t?nq.t("open"):nq.t("closed")),r.asPressedReleased&&(o=t?nq.t("pressed"):nq.t("released"));break;case"object":if(r.momentJsFormat)o=nH()(t).format(r.momentJsFormat);else if(r.iso8601)o=t.toISOString();else if(r.week){var a;let n,i=((a=new Date(Date.UTC((a=t).getFullYear(),a.getMonth(),a.getDate()))).setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7)),n=new Date(Date.UTC(a.getUTCFullYear(),0,1)),Math.ceil(((a.getTime()-n.getTime())/864e5+1)/7));o="2-digit"===r.week?String(i).padStart(2,"0"):Number(i).toString(10)}else o=new Intl.DateTimeFormat(i||nq.language,r).format(t)}else o=Object(t).toString()}return o}function n0(t,n){if(!t)return"";n||(n="");let i=t.map((t,i)=>{if(3!==t.length||t.toUpperCase()!==t)return nq.t(["units."+t,"or:units."+t]);{let r=new Intl.NumberFormat(nq.language,{currency:t,style:"currency"}).formatToParts();if(0!==i||"currency"!==r[0].type)return"currency"===r[0].type?r[0].value:r[r.length-1].value;if(!n)return r[0].value;n=r[0].value+n}}).join("");return n.length>0?n+" "+i:i}function n1(t,n,i,r,o){let a,s=[],l=n2(t,n&&"string"==typeof n?n:n?n.name:i?"string"==typeof i?i:i.name:void 0,i,r,o);if(l&&(a=JSON.parse(l)))if("format"!==t)return a;else s.push(a);if(n&&n.meta&&(a=nZ(t,n,i)))if("format"!==t)return a;else s.push(a);if(i&&"string"!=typeof i&&i.hasOwnProperty(t)){if(a=i[t],"format"!==t)return a;s.push(a)}if(i&&i.type){if(a=tY.getValueDescriptor(i.type)[t],"format"!==t)return a;s.push(a)}if("format"!==t||0===s.length)return a;let c={};return s.reverse().forEach(t=>{c=Object.assign(Object.assign({},c),t)}),c}function n2(t,n,i,r,o,a){let s;if(n?s="string"==typeof n?n:n.name:i&&(s="string"==typeof i?i:i.name),!s)return;let l=[],c=t+"."+(o?"attribute":"meta")+".";if(r&&l.push(c+r+"."+s),i&&"string"!=typeof i&&(l.push(c+i.type+"."+s),l.push(c+i.type)),l.push(c+s),l.length>0)return nq.t(l,{defaultValue:a||""})}function n3(t,n){let i=n.ref.name;if(t.attributes)if(n.deleted)delete t.attributes[i];else{let r=t.attributes[i];r&&(r.value=n.value,r.timestamp=n.timestamp)}return Object.assign({},t)}class n5{constructor(t){t&&Object.assign(this,t)}matches(t){var n,i,r,o,a,s,l;if((null==(n=this.ids)?void 0:n.length)&&(!t.id||!this.ids.includes(t.id))||(null==(i=this.types)?void 0:i.length)&&(!t.type||!this.types.includes(t.type))||(null==(r=this.realm)?void 0:r.name)&&t.realm!==this.realm.name||(null==(o=this.parents)?void 0:o.length)&&!this.parents.some(n=>!n.id||t.parentId===n.id))return!1;if(null==(a=this.paths)?void 0:a.length){let n=null!=(s=t.path)?s:[];if(!this.paths.some(t=>{var i;return(null!=(i=t.path)?i:[]).every((t,i)=>n[i]===t)}))return!1}return(null==(l=this.names)||!l.length||!!this.names.every(n=>n5._evalValuePredicate(t.name,n)))&&(!this.attributes||n5._evalGroup(t,this.attributes))}static getUnsupportedFields(t){return Object.keys(t).filter(t=>!n5._SUPPORTED_FIELDS.has(t))}collectAttributeNames(){return this.attributes?n5._collectNames(this.attributes):[]}static _evalValuePredicate(t,n){var i;switch(n.predicateType){case"string":{let r;if(null==t)return!1;let o=!1!==n.caseSensitive?String(t):String(t).toLowerCase(),a=!1!==n.caseSensitive?n.value:null==(i=n.value)?void 0:i.toLowerCase();switch(n.match){case"BEGIN":r=o.startsWith(a);break;case"END":r=o.endsWith(a);break;case"CONTAINS":r=o.includes(a);break;default:r=o===a}return n.negate?!r:r}case"boolean":return t===n.value;case"number":{let i;if("number"!=typeof t)return!1;switch(n.operator){case"GREATER_THAN":i=t>n.value;break;case"GREATER_EQUALS":i=t>=n.value;break;case"LESS_THAN":i=t<n.value;break;case"LESS_EQUALS":i=t<=n.value;break;case"BETWEEN":i=t>=n.value&&t<=n.rangeValue;break;default:i=t===n.value}return n.negate?!i:i}}return!1}static _evalPredicate(t,n){var i,r;let o=null==(i=n.name)?void 0:i.value;if(!o)return!0;let a=null==(r=t.attributes)?void 0:r[o];if(!a)return!!n.negated;let s=!n.value||n5._evalValuePredicate(a.value,n.value);return n.negated?!s:s}static _evalGroup(t,n){var i,r,o;let a=null!=(i=n.operator)?i:"AND",s=[...(null!=(r=n.items)?r:[]).map(n=>n5._evalPredicate(t,n)),...(null!=(o=n.groups)?o:[]).map(n=>n5._evalGroup(t,n))];return!s.length||("OR"===a?s.some(Boolean):s.every(Boolean))}static _collectNames(t){var n,i;return[...(null!=(n=t.items)?n:[]).map(t=>{var n;return null==(n=t.name)?void 0:n.value}).filter(t=>!!t),...(null!=(i=t.groups)?i:[]).flatMap(t=>n5._collectNames(t))]}}n5._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var n4=function(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})};let n6=i(4461);class n8{constructor(t,n,i){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=t,this._autoEnable=n,this._enableCompleteCallback=i,window.OpenRemoteConsole=this;let r=new URLSearchParams(window.location.search),o=r.get("consoleName"),a=r.get("consoleVersion"),s=r.get("consolePlatform"),l=r.get("consoleProviders"),c=r.get("consoleAutoEnable"),d=l&&l.length>0?l.split(" "):["push"];this._pendingProviderEnables=d;let u=n8._createConsoleRegistration(),h=window.localStorage.getItem(this._storageKey);if(h)try{let t=JSON.parse(h);t.id&&(u.id=t.id),t.name&&(u.name=t.name),t.providers&&(u.providers=t.providers),t.apps&&(u.apps=t.apps)}catch(t){console.error("Failed to deserialise console registration")}let m=u.providers;for(let t of(u.providers={},d)){let n=m&&m.hasOwnProperty(t)?m[t]:{enabled:!1,disabled:!1};u.providers[t]=n}let p=sq.getAppName();p.length>0&&0>u.apps.indexOf(p)&&u.apps.push(p),this._registration=u,o&&(u.name=o),a&&(u.version=a),s&&(u.platform=s),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let t=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return t&&("iP"===t.substring(0,2)||"Mac"===t.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return n4(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let t of Object.keys(this._registration.providers))yield this._initialiseProvider(t);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(t){console.error(t)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return n4(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let t=this._pendingProviderEnables.length-1;t>-1;t--){let n=this._pendingProviderEnables[t];yield this.enableProvider(n)}})}enableProvider(t,n){return n4(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: enabling provider '"+t+"'");let i={provider:t,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:n},r=yield this.sendProviderMessage(i,!0);this._registration.providers[t].hasPermission=r.hasPermission,this._registration.providers[t].success=r.success,this._registration.providers[t].enabled=r.success,this._registration.providers[t].data=r.data;let o=this._pendingProviderEnables.indexOf(t);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),r})}disableProvider(t){return n4(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: disabling provider '"+t+"'");let n=yield this.sendProviderMessage({provider:t,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[t].disabled=!0,this._registration.providers[t].enabled=!1,n})}getProvider(t){return this._registration&&this._registration.providers?this._registration.providers[t]:void 0}sendProviderMessage(t,n){return n4(this,void 0,void 0,function*(){if("storage"!==t.provider&&!this._registration.providers.hasOwnProperty(t.provider))throw console.debug("Invalid console provider '"+t.provider+"'"),Error("Invalid console provider '"+t.provider+"'");if(!n)return void this._doSendProviderMessage(t);let i=t.provider+t.action;if(this._pendingProviderPromises[i])throw Error("Message already pending for provider '"+t.provider+"' with action '"+t.action+"'");let r=new nW,o=()=>{delete this._pendingProviderPromises[i],r.reject("No response from provider")};return this._pendingProviderPromises[i]=[r,window.setTimeout(o,5e3)],this._doSendProviderMessage(t),r.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((t,n)=>{this._registrationTimer=window.setTimeout(()=>n4(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),t()}catch(t){console.error("Failed to register console",t),n(t)}}))})}_sendRegistration(t){return n4(this,void 0,void 0,function*(){this._normaliseRegistration();let n=!!this._registration.id;try{let t=yield sq.rest.api.ConsoleResource.register(this._registration);if(200!==t.status)throw Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(i){if(t&&n&&n8._isStaleRegistrationResponse(i)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw i}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(t){let n=t&&t.response?t.response.status:void 0;return 403===n||409===n}storeData(t,n){this.sendProviderMessage({provider:"storage",action:"STORE",key:t,value:n},!1)}retrieveData(t){return n4(this,void 0,void 0,function*(){let n=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:t},!0);try{let t=yield Promise.race([n,new Promise((t,n)=>setTimeout(n,2e3))]);if(t&&t.value){let n=t.value;return"null"===n?void 0:n}}catch(t){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(t,n){this._providerMessageListeners[t.provider+t.action]=n}removeProviderMessageListener(t){delete this._providerMessageListeners[t.provider+t.action]}_postNativeShellMessage(t){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(t));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(t)}catch(t){console.error("Failed to send shell message towards console",t)}}_doSendGenericMessage(t,n){let i={type:t,data:n};this.isMobile?this._postNativeShellMessage(i):console.warn("Failed to send generic message to console.",i)}_doSendProviderMessage(t){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:t});else{if(!t.provider||!t.action)return;switch(t.provider.trim().toUpperCase()){case"PUSH":switch(t.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;case"STORAGE":switch(t.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let n=t.key?t.key.trim():null;if(!n||0===n.length)throw Error("Storage provider 'store' action requires a `key`");null===t.value?window.localStorage.removeItem(n):window.localStorage.setItem(n,JSON.stringify(t.value))}break;case"RETRIEVE":{let n=t.key?t.key.trim():null;if(!n||0===n.length)throw Error("Storage provider 'retrieve' action requires a `key`");let i=window.localStorage.getItem(n);if(null!==i)try{i=JSON.parse(i)}catch(t){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:n,value:i}))}break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;default:console.error("Unsupported provider: "+t.provider)}}}_handleProviderResponse(t){if(!t)return;let n=JSON.parse(t),i=n.provider,r=n.action,o=this._pendingProviderPromises[i+r];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[i+r],o[0].resolve(n));let a=this._providerMessageListeners[i+r];a&&a(n)}_callCompletedCallback(){let t=this._enableCompleteCallback;this._enableCompleteCallback=null,t&&window.setTimeout(()=>{t()},0)}static _createConsoleRegistration(){return{name:n6.name,version:n6.version,platform:n6.os.toString(),apps:[],model:((n6.manufacturer?n6.manufacturer+" ":"")+(n6.product?n6.product:"")).trim()}}_initialiseProvider(t){return n4(this,void 0,void 0,function*(){let n;console.debug("Console: initialising provider '"+t+"'");try{n=yield this.sendProviderMessage({provider:t,action:"PROVIDER_INIT"},!0),this._registration.providers[t].version=n.version,this._registration.providers[t].requiresPermission=n.requiresPermission,this._registration.providers[t].hasPermission=n.hasPermission,this._registration.providers[t].success=n.success,this._registration.providers[t].enabled=n.enabled,this._registration.providers[t].disabled=n.disabled,this._registration.providers[t].data=n.data}catch(t){console.error(t),n={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(n.success||(console.debug("Provider initialisation failed: '"+t+"'"),n.disabled=!0,this._registration.providers[t].disabled=!0),n.disabled||n.enabled){let n=this._pendingProviderEnables.indexOf(t);n>=0&&this._pendingProviderEnables.splice(n,1)}})}}function n7(t,n){return function(){return t.apply(n,arguments)}}let{toString:n9}=Object.prototype,{getPrototypeOf:ie}=Object,{iterator:it,toStringTag:ii}=Symbol,ir=(({hasOwnProperty:t})=>(n,i)=>t.call(n,i))(Object.prototype),io=(t,n)=>{let i=t,r=[];for(;null!=i&&i!==Object.prototype&&-1===r.indexOf(i);){if(r.push(i),ir(i,n))return!0;i=ie(i)}return!1},ia=(l=Object.create(null),t=>{let n=n9.call(t);return l[n]||(l[n]=n.slice(8,-1).toLowerCase())}),is=t=>(t=t.toLowerCase(),n=>ia(n)===t),il=t=>n=>typeof n===t,{isArray:ic}=Array,id=il("undefined");function iu(t){return null!==t&&!id(t)&&null!==t.constructor&&!id(t.constructor)&&ip(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let ih=is("ArrayBuffer"),im=il("string"),ip=il("function"),ib=il("number"),ig=t=>null!==t&&"object"==typeof t,i_=t=>{if(!ig(t))return!1;let n=ie(t);return(null===n||n===Object.prototype||null===ie(n))&&!io(t,ii)&&!io(t,it)},iy=is("Date"),iv=is("File"),ix=is("Blob"),iF=is("FileList"),iw="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},iE=void 0!==iw.FormData?iw.FormData:void 0,iC=is("URLSearchParams"),[iA,ik,iT,iS]=["ReadableStream","Request","Response","Headers"].map(is);function iI(t,n,{allOwnKeys:i=!1}={}){let r,o;if(null!=t)if("object"!=typeof t&&(t=[t]),ic(t))for(r=0,o=t.length;r<o;r++)n.call(null,t[r],r,t);else{let o;if(iu(t))return;let a=i?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;for(r=0;r<s;r++)o=a[r],n.call(null,t[o],o,t)}}function iD(t,n){let i;if(iu(t))return null;n=n.toLowerCase();let r=Object.keys(t),o=r.length;for(;o-- >0;)if(n===(i=r[o]).toLowerCase())return i;return null}let iP="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,iR=t=>!id(t)&&t!==iP,iO=(c="u">typeof Uint8Array&&ie(Uint8Array),t=>c&&t instanceof c),iM=is("HTMLFormElement"),{propertyIsEnumerable:iL}=Object.prototype,iB=is("RegExp"),iz=(t,n)=>{let i=Object.getOwnPropertyDescriptors(t),r={};iI(i,(i,o)=>{let a;!1!==(a=n(i,o,t))&&(r[o]=a||i)}),Object.defineProperties(t,r)},iN=is("AsyncFunction"),iU=(h="function"==typeof setImmediate,m=ip(iP.postMessage),h?setImmediate:m?(p=`axios@${Math.random()}`,f=[],iP.addEventListener("message",({source:t,data:n})=>{t===iP&&n===p&&f.length&&f.shift()()},!1),t=>{f.push(t),iP.postMessage(p,"*")}):t=>setTimeout(t)),ij="u">typeof queueMicrotask?queueMicrotask.bind(iP):"u">typeof process&&process.nextTick||iU,iV=t=>null!=t&&ip(t[it]),i$={isArray:ic,isArrayBuffer:ih,isBuffer:iu,isFormData:t=>{if(!t)return!1;if(iE&&t instanceof iE)return!0;let n=ie(t);if(!n||n===Object.prototype||!ip(t.append))return!1;let i=ia(t);return"formdata"===i||"object"===i&&ip(t.toString)&&"[object FormData]"===t.toString()},isArrayBufferView:function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&ih(t.buffer)},isString:im,isNumber:ib,isBoolean:t=>!0===t||!1===t,isObject:ig,isPlainObject:i_,isEmptyObject:t=>{if(!ig(t)||iu(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:iA,isRequest:ik,isResponse:iT,isHeaders:iS,isUndefined:id,isDate:iy,isFile:iv,isReactNativeBlob:t=>!!(t&&void 0!==t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:ix,isRegExp:iB,isFunction:ip,isStream:t=>ig(t)&&ip(t.pipe),isURLSearchParams:iC,isTypedArray:iO,isFileList:iF,forEach:iI,merge:function t(...n){let{caseless:i,skipUndefined:r}=iR(this)&&this||{},o={},a=(n,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;let s=i&&"string"==typeof a&&iD(o,a)||a,l=ir(o,s)?o[s]:void 0;i_(l)&&i_(n)?o[s]=t(l,n):i_(n)?o[s]=t({},n):ic(n)?o[s]=n.slice():r&&id(n)||(o[s]=n)};for(let t=0,i=n.length;t<i;t++){let i=n[t];if(!i||iu(i)||(iI(i,a),"object"!=typeof i||ic(i)))continue;let r=Object.getOwnPropertySymbols(i);for(let t=0;t<r.length;t++){let n=r[t];iL.call(i,n)&&a(i[n],n)}}return o},extend:(t,n,i,{allOwnKeys:r}={})=>(iI(n,(n,r)=>{i&&ip(n)?Object.defineProperty(t,r,{__proto__:null,value:n7(n,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,n,i,r)=>{t.prototype=Object.create(n.prototype,r),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:n.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,n,i,r)=>{let o,a,s,l={};if(n=n||{},null==t)return n;do{for(a=(o=Object.getOwnPropertyNames(t)).length;a-- >0;)s=o[a],(!r||r(s,t,n))&&!l[s]&&(n[s]=t[s],l[s]=!0);t=!1!==i&&ie(t)}while(t&&(!i||i(t,n))&&t!==Object.prototype);return n},kindOf:ia,kindOfTest:is,endsWith:(t,n,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=n.length;let r=t.indexOf(n,i);return -1!==r&&r===i},toArray:t=>{if(!t)return null;if(ic(t))return t;let n=t.length;if(!ib(n))return null;let i=Array(n);for(;n-- >0;)i[n]=t[n];return i},forEachEntry:(t,n)=>{let i,r=(t&&t[it]).call(t);for(;(i=r.next())&&!i.done;){let r=i.value;n.call(t,r[0],r[1])}},matchAll:(t,n)=>{let i,r=[];for(;null!==(i=t.exec(n));)r.push(i);return r},isHTMLForm:iM,hasOwnProperty:ir,hasOwnProp:ir,hasOwnInPrototypeChain:io,getSafeProp:(t,n)=>null!=t&&io(t,n)?t[n]:void 0,reduceDescriptors:iz,freezeMethods:t=>{iz(t,(n,i)=>{if(ip(t)&&["arguments","caller","callee"].includes(i))return!1;if(ip(t[i])){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},toObjectSet:(t,n)=>{let i={};return(ic(t)?t:String(t).split(n)).forEach(t=>{i[t]=!0}),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(t,n)=>null!=t&&Number.isFinite(t*=1)?t:n,findKey:iD,global:iP,isContextDefined:iR,isSpecCompliantForm:function(t){return!!(t&&ip(t.append)&&"FormData"===t[ii]&&t[it])},toJSONObject:t=>{let n=new WeakSet,i=t=>{if(ig(t)){if(n.has(t))return;if(iu(t))return t;if(!("toJSON"in t)){n.add(t);let r=ic(t)?[]:{};return iI(t,(t,n)=>{let o=i(t);id(o)||(r[n]=o)}),n.delete(t),r}}return t};return i(t)},isAsyncFn:iN,isThenable:t=>t&&(ig(t)||ip(t))&&ip(t.then)&&ip(t.catch),setImmediate:iU,asap:ij,isIterable:iV,isSafeIterable:t=>null!=t&&io(t,it)&&iV(t)},iq=i$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),iG=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),iH=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function iW(t,n){return i$.isArray(t)?t.map(t=>iW(t,n)):function(t){let n=0,i=t.length;for(;n<i;){let i=t.charCodeAt(n);if(9!==i&&32!==i)break;n+=1}for(;i>n;){let n=t.charCodeAt(i-1);if(9!==n&&32!==n)break;i-=1}return 0===n&&i===t.length?t:t.slice(n,i)}(String(t).replace(n,""))}function iY(t){let n=Object.create(null);return i$.forEach(t.toJSON(),(t,i)=>{n[i]=iW(t,iH)}),n}let iX=Symbol("internals");function iZ(t){return t&&String(t).trim().toLowerCase()}function iK(t){return!1===t||null==t?t:i$.isArray(t)?t.map(iK):iW(String(t),iG)}function iJ(t,n,i,r,o){if(i$.isFunction(r))return r.call(this,n,i);if(o&&(n=i),i$.isString(n)){if(i$.isString(r))return -1!==n.indexOf(r);if(i$.isRegExp(r))return r.test(n)}}class iQ{constructor(t){t&&this.set(t)}set(t,n,i){let r=this;function o(t,n,i){let o=iZ(n);if(!o)return;let a=i$.findKey(r,o);a&&void 0!==r[a]&&!0!==i&&(void 0!==i||!1===r[a])||(r[a||n]=iK(t))}let a=(t,n)=>i$.forEach(t,(t,i)=>o(t,i,n));if(i$.isPlainObject(t)||t instanceof this.constructor)a(t,n);else{let r;if(i$.isString(t)&&(t=t.trim())&&(r=t,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()))){var s;let i,r,o,l;a((l={},(s=t)&&s.split("\n").forEach(function(t){o=t.indexOf(":"),i=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!i||l[i]&&iq[i]||("set-cookie"===i?l[i]?l[i].push(r):l[i]=[r]:l[i]=l[i]?l[i]+", "+r:r)}),l),n)}else if(i$.isObject(t)&&i$.isSafeIterable(t)){let i=Object.create(null),r,o;for(let n of t){if(!i$.isArray(n))throw TypeError("Object iterator must return a key-value pair");o=n[0],i$.hasOwnProp(i,o)?(r=i[o],i[o]=i$.isArray(r)?[...r,n[1]]:[r,n[1]]):i[o]=n[1]}a(i,n)}else null!=t&&o(n,t,i)}return this}get(t,n){if(t=iZ(t)){let i=i$.findKey(this,t);if(i){let t=this[i];if(!n)return t;if(!0===n){let n,i=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;n=r.exec(t);)i[n[1]]=n[2];return i}if(i$.isFunction(n))return n.call(this,t,i);if(i$.isRegExp(n))return n.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=iZ(t)){let i=i$.findKey(this,t);return!!(i&&void 0!==this[i]&&(!n||iJ(this,this[i],i,n)))}return!1}delete(t,n){let i=this,r=!1;function o(t){if(t=iZ(t)){let o=i$.findKey(i,t);o&&(!n||iJ(i,i[o],o,n))&&(delete i[o],r=!0)}}return i$.isArray(t)?t.forEach(o):o(t),r}clear(t){let n=Object.keys(this),i=n.length,r=!1;for(;i--;){let o=n[i];(!t||iJ(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){let n=this,i={};return i$.forEach(this,(r,o)=>{let a=i$.findKey(i,o);if(a){n[a]=iK(r),delete n[o];return}let s=t?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i):String(o).trim();s!==o&&delete n[o],n[s]=iK(r),i[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return i$.forEach(this,(i,r)=>{null!=i&&!1!==i&&(n[r]=t&&i$.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(t=>i.set(t)),i}static accessor(t){let n=(this[iX]=this[iX]={accessors:{}}).accessors,i=this.prototype;function r(t){let r=iZ(t);if(!n[r]){let o;o=i$.toCamelCase(" "+t),["get","set","has"].forEach(n=>{Object.defineProperty(i,n+o,{__proto__:null,value:function(i,r,o){return this[n].call(this,t,i,r,o)},configurable:!0})}),n[r]=!0}}return i$.isArray(t)?t.forEach(r):r(t),this}}iQ.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),i$.reduceDescriptors(iQ.prototype,({value:t},n)=>{let i=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(t){this[i]=t}}}),i$.freezeMethods(iQ);class i0 extends Error{static from(t,n,i,r,o,a){let s=new i0(t.message,n||t.code,i,r,o);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,null!=t.status&&null==s.status&&(s.status=t.status),a&&Object.assign(s,a),s}constructor(t,n,i,r,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){let t,n,i,r=this.config,o=r&&i$.hasOwnProp(r,"redact")?r.redact:void 0,a=i$.isArray(o)&&o.length>0?(t=new Set(o.map(t=>String(t).toLowerCase())),n=[],(i=r=>{let o;if(null===r||"object"!=typeof r||i$.isBuffer(r))return r;if(-1===n.indexOf(r)){if(r instanceof iQ&&(r=r.toJSON()),n.push(r),i$.isArray(r))o=[],r.forEach((t,n)=>{let r=i(t);i$.isUndefined(r)||(o[n]=r)});else{if(!i$.isPlainObject(r)&&function(t){if(i$.hasOwnProp(t,"toJSON"))return!0;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;){if(i$.hasOwnProp(n,"toJSON"))return!0;n=Object.getPrototypeOf(n)}return!1}(r))return n.pop(),r;for(let[n,a]of(o=Object.create(null),Object.entries(r))){let r=t.has(n.toLowerCase())?"[REDACTED ****]":i(a);i$.isUndefined(r)||(o[n]=r)}}return n.pop(),o}})(r)):i$.toJSONObject(r);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a,code:this.code,status:this.status}}}i0.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",i0.ERR_BAD_OPTION="ERR_BAD_OPTION",i0.ECONNABORTED="ECONNABORTED",i0.ETIMEDOUT="ETIMEDOUT",i0.ECONNREFUSED="ECONNREFUSED",i0.ERR_NETWORK="ERR_NETWORK",i0.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",i0.ERR_DEPRECATED="ERR_DEPRECATED",i0.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",i0.ERR_BAD_REQUEST="ERR_BAD_REQUEST",i0.ERR_CANCELED="ERR_CANCELED",i0.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",i0.ERR_INVALID_URL="ERR_INVALID_URL",i0.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let i1=i0;function i2(t){return i$.isPlainObject(t)||i$.isArray(t)}function i3(t){return i$.endsWith(t,"[]")?t.slice(0,-2):t}function i5(t,n,i){return t?t.concat(n).map(function(t,n){return t=i3(t),!i&&n?"["+t+"]":t}).join(i?".":""):n}let i4=i$.toFlatObject(i$,{},null,function(t){return/^is[A-Z]/.test(t)}),i6=function(t,n,i){if(!i$.isObject(t))throw TypeError("target must be an object");n=n||new FormData;let r=(i=i$.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,n){return!i$.isUndefined(n[t])})).metaTokens,o=i.visitor||p,a=i.dots,s=i.indexes,l=i.Blob||"u">typeof Blob&&Blob,c=void 0===i.maxDepth?100:i.maxDepth,d=l&&i$.isSpecCompliantForm(n),u=[];if(!i$.isFunction(o))throw TypeError("visitor must be a function");function h(t){if(null===t)return"";if(i$.isDate(t))return t.toISOString();if(i$.isBoolean(t))return t.toString();if(!d&&i$.isBlob(t))throw new i1("Blob is not supported. Use a Buffer instead.");if(i$.isArrayBuffer(t)||i$.isTypedArray(t)){if(d&&"function"==typeof l)return new l([t]);if("u">typeof Buffer)return Buffer.from(t);throw new i1("Blob is not supported. Use a Buffer instead.",i1.ERR_NOT_SUPPORT)}return t}function m(t){if(t>c)throw new i1("Object is too deeply nested ("+t+" levels). Max depth: "+c,i1.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(t,i,o){let l=t;if(i$.isReactNative(n)&&i$.isReactNativeBlob(t))return n.append(i5(o,i,a),h(t)),!1;if(t&&!o&&"object"==typeof t)if(i$.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=function(t){if(1/0===c)return JSON.stringify(t);let n=[];return JSON.stringify(t,function(t,i){if(!i$.isObject(i))return i;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(i),m(1+n.length-1),i})}(t);else{var d;if(i$.isArray(t)&&(d=t,i$.isArray(d)&&!d.some(i2))||(i$.isFileList(t)||i$.endsWith(i,"[]"))&&(l=i$.toArray(t)))return i=i3(i),l.forEach(function(t,r){i$.isUndefined(t)||null===t||n.append(!0===s?i5([i],r,a):null===s?i:i+"[]",h(t))}),!1}return!!i2(t)||(n.append(i5(o,i,a),h(t)),!1)}let f=Object.assign(i4,{defaultVisitor:p,convertValue:h,isVisitable:i2});if(!i$.isObject(t))throw TypeError("data must be an object");return!function t(i,r,a=0){if(!i$.isUndefined(i)){if(m(a),-1!==u.indexOf(i))throw Error("Circular reference detected in "+r.join("."));u.push(i),i$.forEach(i,function(i,s){!0===(!(i$.isUndefined(i)||null===i)&&o.call(n,i,i$.isString(s)?s.trim():s,r,f))&&t(i,r?r.concat(s):[s],a+1)}),u.pop()}}(t),n};function i8(t){let n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(t){return n[t]})}function i7(t,n){this._pairs=[],t&&i6(t,this,n)}let i9=i7.prototype;function re(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function rt(t,n,i){let r;if(!n)return t;t=t||"";let o=i$.isFunction(i)?{serialize:i}:i,a=i$.getSafeProp(o,"encode")||re,s=i$.getSafeProp(o,"serialize");if(r=s?s(n,o):i$.isURLSearchParams(n)?n.toString():new i7(n,o).toString(a)){let n=t.indexOf("#");-1!==n&&(t=t.slice(0,n)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}i9.append=function(t,n){this._pairs.push([t,n])},i9.toString=function(t){let n=t?n=>t.call(this,n,i8):i8;return this._pairs.map(function(t){return n(t[0])+"="+n(t[1])},"").join("&")};let rn=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){i$.forEach(this.handlers,function(n){null!==n&&t(n)})}},ri={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},rr="u">typeof URLSearchParams?URLSearchParams:i7,ro="u">typeof FormData?FormData:null,ra="u">typeof Blob?Blob:null,rs="u">typeof window&&"u">typeof document,rl="object"==typeof navigator&&navigator||void 0,rc=rs&&(!rl||0>["ReactNative","NativeScript","NS"].indexOf(rl.product)),rd="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ru=rs&&window.location.href||"http://localhost",rh={...tH,isBrowser:!0,classes:{URLSearchParams:rr,FormData:ro,Blob:ra},protocols:["http","https","file","blob","url","data"]};function rm(t){if(t>100)throw new i1("FormData field is too deeply nested ("+t+" levels). Max depth: 100",i1.ERR_FORM_DATA_DEPTH_EXCEEDED)}let rp=function(t){if(i$.isFormData(t)&&i$.isFunction(t.entries)){let n={};return i$.forEachEntry(t,(t,i)=>{!function t(n,i,r,o){rm(o);let a=n[o++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),l=o>=n.length;return(a=!a&&i$.isArray(r)?r.length:a,l)?i$.hasOwnProp(r,a)?r[a]=i$.isArray(r[a])?r[a].concat(i):[r[a],i]:r[a]=i:(i$.hasOwnProp(r,a)&&i$.isObject(r[a])||(r[a]=[]),t(n,i,r[a],o)&&i$.isArray(r[a])&&(r[a]=function(t){let n,i,r={},o=Object.keys(t),a=o.length;for(n=0;n<a;n++)r[i=o[n]]=t[i];return r}(r[a]))),!s}(function(t){let n,i=[],r=/\w+|\[(\w*)]/g;for(;null!==(n=r.exec(t));)rm(i.length),i.push("[]"===n[0]?"":n[1]||n[0]);return i}(t),i,n,0)}),n}return null},rf=(t,n)=>null!=t&&i$.hasOwnProp(t,n)?t[n]:void 0,rb={transitional:ri,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i,r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=i$.isObject(t);if(a&&i$.isHTMLForm(t)&&(t=new FormData(t)),i$.isFormData(t))return o?JSON.stringify(rp(t)):t;if(i$.isArrayBuffer(t)||i$.isBuffer(t)||i$.isStream(t)||i$.isFile(t)||i$.isBlob(t)||i$.isReadableStream(t))return t;if(i$.isArrayBufferView(t))return t.buffer;if(i$.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(a){let n=rf(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return i6(t,new rh.classes.URLSearchParams,{visitor:function(t,n,i,r){return rh.isNode&&i$.isBuffer(t)?(this.append(n,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...n}).toString();if((i=i$.isFileList(t))||r.indexOf("multipart/form-data")>-1){let r=rf(this,"env"),o=r&&r.FormData;return i6(i?{"files[]":t}:t,o&&new o,n)}}if(a||o){n.setContentType("application/json",!1);var s=t;if(i$.isString(s))try{return(0,JSON.parse)(s),i$.trim(s)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(s)}return t}],transformResponse:[function(t){let n=rf(this,"transitional")||rb.transitional,i=n&&n.forcedJSONParsing,r=rf(this,"responseType"),o="json"===r;if(i$.isResponse(t)||i$.isReadableStream(t))return t;if(t&&i$.isString(t)&&(i&&!r||o)){let i=n&&n.silentJSONParsing;try{return JSON.parse(t,rf(this,"parseReviver"))}catch(t){if(!i&&o){if("SyntaxError"===t.name)throw i1.from(t,i1.ERR_BAD_RESPONSE,this,null,rf(this,"response"));throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rh.classes.FormData,Blob:rh.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function rg(t,n){let i=this||rb,r=n||i,o=iQ.from(r.headers),a=r.data;return i$.forEach(t,function(t){a=t.call(i,a,o.normalize(),n?n.status:void 0)}),o.normalize(),a}function r_(t){return!!(t&&t.__CANCEL__)}i$.forEach(["delete","get","head","post","put","patch","query"],t=>{rb.headers[t]={}});let ry=class extends i1{constructor(t,n,i){super(null==t?"canceled":t,i1.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function rv(t,n,i){let r=i.config.validateStatus;!i.status||!r||r(i.status)?t(i):n(new i1("Request failed with status code "+i.status,i.status>=400&&i.status<500?i1.ERR_BAD_REQUEST:i1.ERR_BAD_RESPONSE,i.config,i.request,i))}let rx=function(t,n){let i,r=Array(t=t||10),o=Array(t),a=0,s=0;return n=void 0!==n?n:1e3,function(l){let c=Date.now(),d=o[s];i||(i=c),r[a]=l,o[a]=c;let u=s,h=0;for(;u!==a;)h+=r[u++],u%=t;if((a=(a+1)%t)===s&&(s=(s+1)%t),c-i<n)return;let m=d&&c-d;return m?Math.round(1e3*h/m):void 0}},rF=function(t,n){let i,r,o=0,a=1e3/n,s=(n,a=Date.now())=>{o=a,i=null,r&&(clearTimeout(r),r=null),t(...n)};return[(...t)=>{let n=Date.now(),l=n-o;l>=a?s(t,n):(i=t,r||(r=setTimeout(()=>{r=null,s(i)},a-l)))},()=>i&&s(i)]},rw=(t,n,i=3)=>{let r=0,o=rx(50,250);return rF(i=>{if(!i||"number"!=typeof i.loaded)return;let a=i.loaded,s=i.lengthComputable?i.total:void 0,l=null!=s?Math.min(a,s):a,c=Math.max(0,l-r),d=o(c);r=Math.max(r,l),t({loaded:l,total:s,progress:s?l/s:void 0,bytes:c,rate:d||void 0,estimated:d&&s?(s-l)/d:void 0,event:i,lengthComputable:null!=s,[n?"download":"upload"]:!0})},i)},rE=(t,n)=>{let i=null!=t;return[r=>n[0]({lengthComputable:i,total:t,loaded:r}),n[1]]},rC=t=>(...n)=>i$.asap(()=>t(...n)),rA=rh.hasStandardBrowserEnv?(d=new URL(rh.origin),u=rh.navigator&&/(msie|trident)/i.test(rh.navigator.userAgent),t=>(t=new URL(t,rh.origin),d.protocol===t.protocol&&d.host===t.host&&(u||d.port===t.port))):()=>!0,rk=rh.hasStandardBrowserEnv?{write(t,n,i,r,o,a,s){if("u"<typeof document)return;let l=[`${t}=${encodeURIComponent(n)}`];i$.isNumber(i)&&l.push(`expires=${new Date(i).toUTCString()}`),i$.isString(r)&&l.push(`path=${r}`),i$.isString(o)&&l.push(`domain=${o}`),!0===a&&l.push("secure"),i$.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if("u"<typeof document)return null;let n=document.cookie.split(";");for(let i=0;i<n.length;i++){let r=n[i].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===t)try{return decodeURIComponent(r.slice(o+1))}catch(t){return r.slice(o+1)}}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},rT=/^https?:(?!\/\/)/i,rS=/[\t\n\r]/g;function rI(t,n){if("string"==typeof t&&rT.test((function(t){let n=0;for(;n<t.length&&32>=t.charCodeAt(n);)n++;return t.slice(n)})(t).replace(rS,"")))throw new i1('Invalid URL: missing "//" after protocol',i1.ERR_INVALID_URL,n)}function rD(t,n,i,r){rI(n,r);let o=!("string"==typeof n&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n));return t&&(o||!1===i)?(rI(t,r),n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t):n}let rP=t=>t instanceof iQ?{...t}:t;function rR(t,n){t=t||{},n=n||{};let i=Object.create(null);function r(t,n,i,r){return i$.isPlainObject(t)&&i$.isPlainObject(n)?i$.merge.call({caseless:r},t,n):i$.isPlainObject(n)?i$.merge({},n):i$.isArray(n)?n.slice():n}function o(t,n,i,o){return i$.isUndefined(n)?i$.isUndefined(t)?void 0:r(void 0,t,i,o):r(t,n,i,o)}function a(t,n){if(!i$.isUndefined(n))return r(void 0,n)}function s(t,n){return i$.isUndefined(n)?i$.isUndefined(t)?void 0:r(void 0,t):r(void 0,n)}function l(i,o,a){return i$.hasOwnProp(n,a)?r(i,o):i$.hasOwnProp(t,a)?r(void 0,i):void 0}Object.defineProperty(i,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:l,headers:(t,n,i)=>o(rP(t),rP(n),i,!0)};return i$.forEach(Object.keys({...t,...n}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=i$.hasOwnProp(c,r)?c[r]:o,s=a(i$.hasOwnProp(t,r)?t[r]:void 0,i$.hasOwnProp(n,r)?n[r]:void 0,r);i$.isUndefined(s)&&a!==l||(i[r]=s)}),i$.hasOwnProp(n,"validateStatus")&&i$.isUndefined(n.validateStatus)&&!1===function(i){let r=i$.hasOwnProp(n,"transitional")?n.transitional:void 0;if(!i$.isUndefined(r)){if(!i$.isPlainObject(r))return;else if(i$.hasOwnProp(r,i))return r[i]}let o=i$.hasOwnProp(t,"transitional")?t.transitional:void 0;if(i$.isPlainObject(o)&&i$.hasOwnProp(o,i))return o[i]}("validateStatusUndefinedResolves")&&(i$.hasOwnProp(t,"validateStatus")?i.validateStatus=r(void 0,t.validateStatus):delete i.validateStatus),i}let rO=["content-type","content-length"],rM=function(t){let n=rR({},t),i=t=>i$.hasOwnProp(n,t)?n[t]:void 0,r=i("data"),o=i("withXSRFToken"),a=i("xsrfHeaderName"),s=i("xsrfCookieName"),l=i("headers"),c=i("auth"),d=i("baseURL"),u=i("allowAbsoluteUrls"),h=i("url");if(n.headers=l=iQ.from(l),n.url=rt(rD(d,h,u,n),i("params"),i("paramsSerializer")),c){let n=i$.getSafeProp(c,"username")||"",i=i$.getSafeProp(c,"password")||"";try{l.set("Authorization","Basic "+btoa(n+":"+(i?encodeURIComponent(i).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))):"")))}catch(n){throw i1.from(n,i1.ERR_BAD_OPTION_VALUE,t)}}if(i$.isFormData(r))if(rh.hasStandardBrowserEnv||rh.hasStandardBrowserWebWorkerEnv||i$.isReactNative(r))l.setContentType(void 0);else{var m,p;i$.isFunction(r.getHeaders)&&(m=l,p=r.getHeaders(),"content-only"!==i("formDataHeaderPolicy")?m.set(p):Object.entries(p||{}).forEach(([t,n])=>{rO.includes(t.toLowerCase())&&m.set(t,n)}))}if(rh.hasStandardBrowserEnv&&(i$.isFunction(o)&&(o=o(n)),!0===o||null==o&&rA(n.url))){let t=a&&s&&rk.read(s);t&&l.set(a,t)}return n},rL="u">typeof XMLHttpRequest&&function(t){return new Promise(function(n,i){var r;let o,a,s,l,c,d,u=rM(t),h=u.data,m=iQ.from(u.headers).normalize(),{responseType:p,onUploadProgress:f,onDownloadProgress:b}=u;function g(){l&&l(),c&&c(),u.cancelToken&&u.cancelToken.unsubscribe(o),u.signal&&u.signal.removeEventListener("abort",o)}let _=new XMLHttpRequest;function y(){if(!_)return;let r=iQ.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());rv(function(t){n(t),g()},function(t){i(t),g()},{data:p&&"text"!==p&&"json"!==p?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:r,config:t,request:_}),_=null}_.open(u.method.toUpperCase(),u.url,!0),_.timeout=u.timeout,"onloadend"in _?_.onloadend=y:_.onreadystatechange=function(){!_||4!==_.readyState||(0!==_.status||_.responseURL&&_.responseURL.startsWith("file:"))&&setTimeout(y)},_.onabort=function(){_&&(i(new i1("Request aborted",i1.ECONNABORTED,t,_)),g(),_=null)},_.onerror=function(n){let r=new i1(n&&n.message?n.message:"Network Error",i1.ERR_NETWORK,t,_);r.event=n||null,i(r),g(),_=null},_.ontimeout=function(){let n=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||ri;u.timeoutErrorMessage&&(n=u.timeoutErrorMessage),i(new i1(n,r.clarifyTimeoutError?i1.ETIMEDOUT:i1.ECONNABORTED,t,_)),g(),_=null},void 0===h&&m.setContentType(null),"setRequestHeader"in _&&i$.forEach(iY(m),function(t,n){_.setRequestHeader(n,t)}),i$.isUndefined(u.withCredentials)||(_.withCredentials=!!u.withCredentials),p&&"json"!==p&&(_.responseType=u.responseType),b&&([s,c]=rw(b,!0),_.addEventListener("progress",s)),f&&_.upload&&([a,l]=rw(f),_.upload.addEventListener("progress",a),_.upload.addEventListener("loadend",l)),(u.cancelToken||u.signal)&&(o=n=>{_&&(i(!n||n.type?new ry(null,t,_):n),_.abort(),g(),_=null)},u.cancelToken&&u.cancelToken.subscribe(o),u.signal&&(u.signal.aborted?o():u.signal.addEventListener("abort",o)));let v=(r=u.url,(d=/^([-+\w]{1,25}):(?:\/\/)?/.exec(r))&&d[1]||"");if(v&&!rh.protocols.includes(v)){i(new i1("Unsupported protocol "+v+":",i1.ERR_BAD_REQUEST,t)),g();return}_.send(h||null)})},rB=function*(t,n){let i,r=t.byteLength;if(!n||r<n)return void(yield t);let o=0;for(;o<r;)i=o+n,yield t.slice(o,i),o=i},rz=async function*(t,n){for await(let i of rN(t))yield*rB(i,n)},rN=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let n=t.getReader();try{for(;;){let{done:t,value:i}=await n.read();if(t)break;yield i}}finally{await n.cancel()}},rU=(t,n,i,r)=>{let o,a=rz(t,n),s=0,l=t=>{!o&&(o=!0,r&&r(t))};return new ReadableStream({async pull(t){try{let{done:n,value:r}=await a.next();if(n){l(),t.close();return}let o=r.byteLength;if(i){let t=s+=o;i(t)}t.enqueue(new Uint8Array(r))}catch(t){throw l(t),t}},cancel:t=>(l(t),a.return())},{highWaterMark:2})},rj=t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,rV=(t,n,i)=>n+2<i&&rj(t.charCodeAt(n+1))&&rj(t.charCodeAt(n+2)),{isFunction:r$}=i$,rq=t=>{if(!i$.isString(t))return t;try{return decodeURIComponent(t)}catch(n){return t}},rG=(t,...n)=>{try{return!!t(...n)}catch(t){return!1}},rH=t=>{let n,i=void 0!==i$.global&&null!==i$.global?i$.global:globalThis,{ReadableStream:r,TextEncoder:o}=i,{fetch:a,Request:s,Response:l}=t=i$.merge.call({skipUndefined:!0},{Request:i.Request,Response:i.Response},t),c=a?r$(a):"function"==typeof fetch,d=r$(s),u=r$(l);if(!c)return!1;let h=c&&r$(r),m=c&&("function"==typeof o?(n=new o,t=>n.encode(t)):async t=>new Uint8Array(await new s(t).arrayBuffer())),p=d&&h&&rG(()=>{let t=!1,n=new s(rh.origin,{body:new r,method:"POST",get duplex(){return t=!0,"half"}}),i=n.headers.has("Content-Type");return null!=n.body&&n.body.cancel(),t&&!i}),f=u&&h&&rG(()=>i$.isReadableStream(new l("").body)),b={stream:f&&(t=>t.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{b[t]||(b[t]=(n,i)=>{let r=n&&n[t];if(r)return r.call(n);throw new i1(`Response type '${t}' is not supported`,i1.ERR_NOT_SUPPORT,i)})});let g=async t=>{if(null==t)return 0;if(i$.isBlob(t))return t.size;if(i$.isSpecCompliantForm(t)){let n=new s(rh.origin,{method:"POST",body:t});return(await n.arrayBuffer()).byteLength}return i$.isArrayBufferView(t)||i$.isArrayBuffer(t)?t.byteLength:(i$.isURLSearchParams(t)&&(t+=""),i$.isString(t))?(await m(t)).byteLength:void 0},_=async(t,n)=>{let i=i$.toFiniteNumber(t.getContentLength());return null==i?g(n):i};return async t=>{let n,{url:i,method:r,data:c,signal:u,cancelToken:m,timeout:y,onDownloadProgress:v,onUploadProgress:x,responseType:F,headers:w,withCredentials:E="same-origin",fetchOptions:C,maxContentLength:A,maxBodyLength:k}=rM(t),T=i$.isNumber(A)&&A>-1,S=i$.isNumber(k)&&k>-1,I=a||fetch;F=F?(F+"").toLowerCase():"text";let D=((t,n)=>{if(t=t?t.filter(Boolean):[],!n&&!t.length)return;let i=new AbortController,r=!1,o=function(t){if(!r){r=!0,s();let n=t instanceof Error?t:this.reason;i.abort(n instanceof i1?n:new ry(n instanceof Error?n.message:n))}},a=n&&setTimeout(()=>{a=null,o(new i1(`timeout of ${n}ms exceeded`,i1.ETIMEDOUT))},n),s=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o,{once:!0}));let{signal:l}=i;return l.unsubscribe=()=>i$.asap(s),l})([u,m&&m.toAbortSignal()],y),P=null,R=D&&D.unsubscribe&&(()=>{D.unsubscribe()}),O=null,M=()=>new i1("Request body larger than maxBodyLength limit",i1.ERR_BAD_REQUEST,t,P);try{var L;let a,u,m,y,B=(u="auth",i$.hasOwnProp(t,u)?t[u]:void 0);if(B){let t=i$.getSafeProp(B,"username")||"",n=i$.getSafeProp(B,"password")||"";a={username:t,password:n}}if(m=(L=i).indexOf("://"),y=L,-1!==m&&(y=y.slice(m+3)),y.includes("@")||y.includes(":")){let t=new URL(i,rh.origin);if(!a&&(t.username||t.password)){let n=rq(t.username),i=rq(t.password);a={username:n,password:i}}(t.username||t.password)&&(t.username="",t.password="",i=t.href)}if(a){let t;w.delete("authorization"),w.set("Authorization","Basic "+btoa((t=(a.username||"")+":"+(a.password||""),encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))))))}if(T&&"string"==typeof i&&i.startsWith("data:")&&function(t){if(!t||"string"!=typeof t||!t.startsWith("data:"))return 0;let n=t.indexOf(",");if(n<0)return 0;let i=t.slice(5,n),r=t.slice(n+1);if(/;base64/i.test(i)){let t=r.length,n=r.length;for(let i=0;i<n;i++)if(37===r.charCodeAt(i)&&i+2<n){let n=r.charCodeAt(i+1),o=r.charCodeAt(i+2);rj(n)&&rj(o)&&(t-=2,i+=2)}let i=0,o=n-1,a=t=>t>=2&&37===r.charCodeAt(t-2)&&51===r.charCodeAt(t-1)&&(68===r.charCodeAt(t)||100===r.charCodeAt(t));o>=0&&(61===r.charCodeAt(o)?(i++,o--):a(o)&&(i++,o-=3)),1===i&&o>=0&&(61===r.charCodeAt(o)?i++:a(o)&&i++);let s=3*Math.floor(t/4)-(i||0);return s>0?s:0}let o=0;for(let t=0,n=r.length;t<n;t++){let i=r.charCodeAt(t);if(37===i&&rV(r,t,n))o+=1,t+=2;else if(i<128)o+=1;else if(i<2048)o+=2;else if(i>=55296&&i<=56319&&t+1<n){let n=r.charCodeAt(t+1);n>=56320&&n<=57343?(o+=4,t++):o+=3}else o+=3}return o}(i)>A)throw new i1("maxContentLength size of "+A+" exceeded",i1.ERR_BAD_RESPONSE,t,P);if(S&&"get"!==r&&"head"!==r){let t=await g(c);if("number"==typeof t&&isFinite(t)&&(n=t,t>k))throw M()}let z=S&&(i$.isReadableStream(c)||i$.isStream(c)),N=(t,n,i)=>rU(t,65536,t=>{if(S&&t>k)throw O=M();n&&n(t)},i);if(p&&"get"!==r&&"head"!==r&&(x||z)){if(n=null==n?await _(w,c):n,0!==n||z){let t,r=new s(i,{method:"POST",body:c,duplex:"half"});if(i$.isFormData(c)&&(t=r.headers.get("content-type"))&&w.setContentType(t),r.body){let[t,i]=x&&rE(n,rw(rC(x)))||[];c=N(r.body,t,i)}}}else if(z&&!d&&h&&"get"!==r&&"head"!==r)c=N(c);else if(z&&d&&!p&&"get"!==r&&"head"!==r)throw new i1("Stream request bodies are not supported by the current fetch implementation",i1.ERR_NOT_SUPPORT,t,P);i$.isString(E)||(E=E?"include":"omit");let U=d&&"credentials"in s.prototype;if(i$.isFormData(c)){let t=w.getContentType();t&&/^multipart\/form-data/i.test(t)&&!/boundary=/i.test(t)&&w.delete("content-type")}w.set("User-Agent","axios/1.18.1",!1);let j={...C,signal:D,method:r.toUpperCase(),headers:iY(w.normalize()),body:c,duplex:"half",credentials:U?E:void 0};P=d&&new s(i,j);let V=await (d?I(P,C):I(i,j)),$=iQ.from(V.headers);if(T){let n=i$.toFiniteNumber($.getContentLength());if(null!=n&&n>A)throw new i1("maxContentLength size of "+A+" exceeded",i1.ERR_BAD_RESPONSE,t,P)}let q=f&&("stream"===F||"response"===F);if(f&&V.body&&(v||T||q&&R)){let n={};["status","statusText","headers"].forEach(t=>{n[t]=V[t]});let i=i$.toFiniteNumber($.getContentLength()),[r,o]=v&&rE(i,rw(rC(v),!0))||[];V=new l(rU(V.body,65536,n=>{if(T&&n>A)throw new i1("maxContentLength size of "+A+" exceeded",i1.ERR_BAD_RESPONSE,t,P);r&&r(n)},()=>{o&&o(),R&&R()}),n)}F=F||"text";let G=await b[i$.findKey(b,F)||"text"](V,t);if(T&&!f&&!q){let n;if(null!=G&&("number"==typeof G.byteLength?n=G.byteLength:"number"==typeof G.size?n=G.size:"string"==typeof G&&(n="function"==typeof o?new o().encode(G).byteLength:G.length)),"number"==typeof n&&n>A)throw new i1("maxContentLength size of "+A+" exceeded",i1.ERR_BAD_RESPONSE,t,P)}return!q&&R&&R(),await new Promise((n,i)=>{rv(n,i,{data:G,headers:iQ.from(V.headers),status:V.status,statusText:V.statusText,config:t,request:P})})}catch(n){if(R&&R(),D&&D.aborted&&D.reason instanceof i1){let i=D.reason;throw i.config=t,P&&(i.request=P),n!==i&&Object.defineProperty(i,"cause",{__proto__:null,value:n,writable:!0,enumerable:!1,configurable:!0}),i}if(O)throw P&&!O.request&&(O.request=P),O;if(n instanceof i1)throw P&&!n.request&&(n.request=P),n;if(n&&"TypeError"===n.name&&/Load failed|fetch/i.test(n.message)){let i=new i1("Network Error",i1.ERR_NETWORK,t,P,n&&n.response);throw Object.defineProperty(i,"cause",{__proto__:null,value:n.cause||n,writable:!0,enumerable:!1,configurable:!0}),i}throw i1.from(n,n&&n.code,t,P,n&&n.response)}}},rW=new Map,rY=t=>{let n=t&&t.env||{},{fetch:i,Request:r,Response:o}=n,a=[r,o,i],s=a.length,l,c,d=rW;for(;s--;)l=a[s],void 0===(c=d.get(l))&&d.set(l,c=s?new Map:rH(n)),d=c;return c};rY();let rX={http:null,xhr:rL,fetch:{get:rY}};i$.forEach(rX,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:n})}catch(t){}Object.defineProperty(t,"adapterName",{__proto__:null,value:n})}});let rZ=t=>`- ${t}`,rK=t=>i$.isFunction(t)||null===t||!1===t,rJ=function(t,n){let i,r,{length:o}=t=i$.isArray(t)?t:[t],a={};for(let s=0;s<o;s++){let o;if(r=i=t[s],!rK(i)&&void 0===(r=rX[(o=String(i)).toLowerCase()]))throw new i1(`Unknown adapter '${o}'`);if(r&&(i$.isFunction(r)||(r=r.get(n))))break;a[o||"#"+s]=r}if(!r){let t=Object.entries(a).map(([t,n])=>`adapter ${t} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new i1("There is no suitable adapter to dispatch the request "+(o?t.length>1?"since :\n"+t.map(rZ).join("\n"):" "+rZ(t[0]):"as no adapter specified"),i1.ERR_NOT_SUPPORT)}return r};function rQ(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ry(null,t)}function r0(t){return rQ(t),t.headers=iQ.from(t.headers),t.data=rg.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),rJ(t.adapter||rb.adapter,t)(t).then(function(n){rQ(t),t.response=n;try{n.data=rg.call(t,t.transformResponse,n)}finally{delete t.response}return n.headers=iQ.from(n.headers),n},function(n){if(!r_(n)&&(rQ(t),n&&n.response)){t.response=n.response;try{n.response.data=rg.call(t,t.transformResponse,n.response)}finally{delete t.response}n.response.headers=iQ.from(n.response.headers)}return Promise.reject(n)})}let r1={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{r1[t]=function(i){return typeof i===t||"a"+(n<1?"n ":" ")+t}});let r2={};r1.transitional=function(t,n,i){function r(t,n){return"[Axios v1.18.1] Transitional option '"+t+"'"+n+(i?". "+i:"")}return(i,o,a)=>{if(!1===t)throw new i1(r(o," has been removed"+(n?" in "+n:"")),i1.ERR_DEPRECATED);return n&&!r2[o]&&(r2[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(i,o,a)}},r1.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};let r3=function(t,n,i){if("object"!=typeof t||null===t)throw new i1("options must be an object",i1.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),o=r.length;for(;o-- >0;){let a=r[o],s=Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;if(s){let n=t[a],i=void 0===n||s(n,a,t);if(!0!==i)throw new i1("option "+a+" must be "+i,i1.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new i1("Unknown option "+a,i1.ERR_BAD_OPTION)}};class r5{constructor(t){this.defaults=t||{},this.interceptors={request:new rn,response:new rn}}async request(t,n){try{return await this._request(t,n)}catch(t){if(t instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=Error();let i=(()=>{if(!n.stack)return"";let t=n.stack.indexOf("\n");return -1===t?"":n.stack.slice(t+1)})();try{if(t.stack){if(i){let n=i.indexOf("\n"),r=-1===n?-1:i.indexOf("\n",n+1),o=-1===r?"":i.slice(r+1);String(t.stack).endsWith(o)||(t.stack+="\n"+i)}}else t.stack=i}catch(t){}}throw t}}_request(t,n){let i,r;"string"==typeof t?(n=n||{}).url=t:n=t||{};let{transitional:o,paramsSerializer:a,headers:s}=n=rR(this.defaults,n);void 0!==o&&r3(o,{silentJSONParsing:r1.transitional(r1.boolean),forcedJSONParsing:r1.transitional(r1.boolean),clarifyTimeoutError:r1.transitional(r1.boolean),legacyInterceptorReqResOrdering:r1.transitional(r1.boolean),advertiseZstdAcceptEncoding:r1.transitional(r1.boolean),validateStatusUndefinedResolves:r1.transitional(r1.boolean)},!1),null!=a&&(i$.isFunction(a)?n.paramsSerializer={serialize:a}:r3(a,{encode:r1.function,serialize:r1.function},!0)),void 0!==n.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),r3(n,{baseUrl:r1.spelling("baseURL"),withXsrfToken:r1.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&i$.merge(s.common,s[n.method]);s&&i$.forEach(["delete","get","head","post","put","patch","query","common"],t=>{delete s[t]}),n.headers=iQ.concat(l,s);let c=[],d=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(n))return;d=d&&t.synchronous;let i=n.transitional||ri;i&&i.legacyInterceptorReqResOrdering?c.unshift(t.fulfilled,t.rejected):c.push(t.fulfilled,t.rejected)});let u=[];this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let h=0;if(!d){let t=[r0.bind(this),void 0];for(t.unshift(...c),t.push(...u),r=t.length,i=Promise.resolve(n);h<r;)i=i.then(t[h++],t[h++]);return i}r=c.length;let m=n;for(;h<r;){let t=c[h++],n=c[h++];try{m=t(m)}catch(t){n.call(this,t);break}}try{i=r0.call(this,m)}catch(t){return Promise.reject(t)}for(h=0,r=u.length;h<r;)i=i.then(u[h++],u[h++]);return i}getUri(t){return rt(rD((t=rR(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls,t),t.params,t.paramsSerializer)}}i$.forEach(["delete","get","head","options"],function(t){r5.prototype[t]=function(n,i){return this.request(rR(i||{},{method:t,url:n,data:i&&i$.hasOwnProp(i,"data")?i.data:void 0}))}}),i$.forEach(["post","put","patch","query"],function(t){function n(n){return function(i,r,o){return this.request(rR(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}r5.prototype[t]=n(),"query"!==t&&(r5.prototype[t+"Form"]=n(!0))});let r4=class t{constructor(t){let n;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){n=t});const i=this;this.promise.then(t=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](t);i._listeners=null}),this.promise.then=t=>{let n,r=new Promise(t=>{i.subscribe(t),n=t}).then(t);return r.cancel=function(){i.unsubscribe(n)},r},t(function(t,r,o){i.reason||(i.reason=new ry(t,r,o),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=n=>{t.abort(n)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let n;return{token:new t(function(t){n=t}),cancel:n}}},r6={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(r6).forEach(([t,n])=>{r6[n]=t});let r8=function t(n){let i=new r5(n),r=n7(r5.prototype.request,i);return i$.extend(r,r5.prototype,i,{allOwnKeys:!0}),i$.extend(r,i,null,{allOwnKeys:!0}),r.create=function(i){return t(rR(n,i))},r}(rb);r8.Axios=r5,r8.CanceledError=ry,r8.CancelToken=r4,r8.isCancel=r_,r8.VERSION="1.18.1",r8.toFormData=i6,r8.AxiosError=i1,r8.Cancel=r8.CanceledError,r8.all=function(t){return Promise.all(t)},r8.spread=function(t){return function(n){return t.apply(null,n)}},r8.isAxiosError=function(t){return i$.isObject(t)&&!0===t.isAxiosError},r8.mergeConfig=rR,r8.AxiosHeaders=iQ,r8.formToJSON=t=>rp(i$.isHTMLForm(t)?new FormData(t):t),r8.getAdapter=rJ,r8.HttpStatusCode=r6,r8.default=r8;class r7{constructor(t){this.httpClient=t}getHealthStatus(t){return this.httpClient.request({method:"GET",url:ov`health`,options:t})}getInfo(t){return this.httpClient.request({method:"GET",url:ov`info`,options:t})}}class r9{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:ov`dashboard`,data:t,options:n})}update(t,n){return this.httpClient.request({method:"PUT",url:ov`dashboard`,data:t,options:n})}getAllRealmDashboards(t,n){return this.httpClient.request({method:"GET",url:ov`dashboard/all/${t}`,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:ov`dashboard/query`,data:t,options:n})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`dashboard/${t}/${n}`,options:i})}get(t,n,i){return this.httpClient.request({method:"GET",url:ov`dashboard/${t}/${n}`,options:i})}}class oe{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:ov`realm`,data:t,options:n})}getAll(t){return this.httpClient.request({method:"GET",url:ov`realm`,options:t})}getAccessible(t){return this.httpClient.request({method:"GET",url:ov`realm/accessible`,options:t})}delete(t,n){return this.httpClient.request({method:"DELETE",url:ov`realm/${t}`,options:n})}get(t,n){return this.httpClient.request({method:"GET",url:ov`realm/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:ov`realm/${t}`,data:n,options:i})}}class ot{constructor(t){this.httpClient=t}register(t,n){return this.httpClient.request({method:"POST",url:ov`console/register`,data:t,options:n})}}class on{constructor(t){this.httpClient=t}getServices(t,n){return this.httpClient.request({method:"GET",url:ov`service`,queryParams:t,options:n})}registerService(t,n){return this.httpClient.request({method:"POST",url:ov`service`,data:t,options:n})}getGlobalServices(t){return this.httpClient.request({method:"GET",url:ov`service/global`,options:t})}registerGlobalService(t,n){return this.httpClient.request({method:"POST",url:ov`service/global`,data:t,options:n})}deregisterService(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`service/${t}/${n}`,options:i})}getService(t,n,i){return this.httpClient.request({method:"GET",url:ov`service/${t}/${n}`,options:i})}heartbeat(t,n,i){return this.httpClient.request({method:"PUT",url:ov`service/${t}/${n}`,options:i})}}class oi{constructor(t){this.httpClient=t}getPredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:ov`asset/predicted/${t}/${n}`,data:i,options:r})}writePredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`asset/predicted/${t}/${n}`,data:i,options:r})}}class or{constructor(t){this.httpClient=t}getConfig(t){return this.httpClient.request({method:"GET",url:ov`syslog/config`,options:t})}updateConfig(t,n){return this.httpClient.request({method:"PUT",url:ov`syslog/config`,data:t,options:n})}clearEvents(t){return this.httpClient.request({method:"DELETE",url:ov`syslog/event`,options:t})}getEvents(t,n){return this.httpClient.request({method:"GET",url:ov`syslog/event`,queryParams:t,options:n})}}class oo{constructor(t){this.httpClient=t}getManagerConfig(t){return this.httpClient.request({method:"GET",url:ov`configuration/manager`,options:t})}update(t,n){return this.httpClient.request({method:"PUT",url:ov`configuration/manager`,data:t,options:n})}fileUpload(t,n,i){return this.httpClient.request({method:"POST",url:ov`configuration/manager/file`,queryParams:n,data:t,options:i})}getManagerConfigImage(t,n){return this.httpClient.request({method:"GET",url:ov`configuration/manager/image/${t}`,options:n})}}class oa{constructor(t){this.httpClient=t}getDatapointExport(t,n){return this.httpClient.request({method:"GET",url:ov`asset/datapoint/export`,queryParams:t,options:n})}getDatapointPeriod(t,n){return this.httpClient.request({method:"GET",url:ov`asset/datapoint/periods`,queryParams:t,options:n})}getDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:ov`asset/datapoint/${t}/${n}`,data:i,options:r})}}class os{constructor(t){this.httpClient=t}doProtocolAssetDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:ov`agent/assetDiscovery/${t}`,queryParams:n,options:i})}doProtocolAssetImport(t,n,i,r){return this.httpClient.request({method:"POST",url:ov`agent/assetImport/${t}`,queryParams:i,data:n,options:r})}doProtocolInstanceDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:ov`agent/instanceDiscovery/${t}`,queryParams:n,options:i})}}class ol{constructor(t){this.httpClient=t}updateCurrentUserLocale(t,n){return this.httpClient.request({method:"PUT",url:ov`user/locale`,data:t,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:ov`user/query`,data:t,options:n})}requestPasswordResetCurrent(t){return this.httpClient.request({method:"PUT",url:ov`user/request-password-reset`,options:t})}updatePasswordCurrent(t,n){return this.httpClient.request({method:"PUT",url:ov`user/reset-password`,data:t,options:n})}updateCurrent(t,n){return this.httpClient.request({method:"PUT",url:ov`user/update`,data:t,options:n})}getCurrent(t){return this.httpClient.request({method:"GET",url:ov`user/user`,options:t})}getCurrentUserRealmRoles(t){return this.httpClient.request({method:"GET",url:ov`user/userRealmRoles`,options:t})}getCurrentUserClientRoles(t,n){return this.httpClient.request({method:"GET",url:ov`user/userRoles/${t}`,options:n})}disconnectUserSession(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`user/${t}/disconnect/${n}`,options:i})}requestPasswordReset(t,n,i){return this.httpClient.request({method:"PUT",url:ov`user/${t}/request-password-reset/${n}`,options:i})}updatePassword(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`user/${t}/reset-password/${n}`,data:i,options:r})}resetSecret(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/reset-secret/${n}`,options:i})}updateRoles(t,n,i){return this.httpClient.request({method:"PUT",url:ov`user/${t}/roles`,data:n,options:i})}getUserRealmRoles(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/userRealmRoles/${n}`,options:i})}updateUserRealmRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`user/${t}/userRealmRoles/${n}`,data:i,options:r})}getUserClientRoles(t,n,i,r){return this.httpClient.request({method:"GET",url:ov`user/${t}/userRoles/${n}/${i}`,options:r})}updateUserClientRoles(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:ov`user/${t}/userRoles/${n}/${i}`,data:r,options:o})}getUserSessions(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/userSessions/${n}`,options:i})}create(t,n,i){return this.httpClient.request({method:"POST",url:ov`user/${t}/users`,data:n,options:i})}update(t,n,i){return this.httpClient.request({method:"PUT",url:ov`user/${t}/users`,data:n,options:i})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`user/${t}/users/${n}`,options:i})}getClientRoles(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/${n}/roles`,options:i})}updateClientRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`user/${t}/${n}/roles`,data:i,options:r})}get(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/${n}`,options:i})}}class oc{constructor(t){this.httpClient=t}getSettings(t){return this.httpClient.request({method:"GET",url:ov`map`,options:t})}saveSettings(t,n){return this.httpClient.request({method:"PUT",url:ov`map`,data:t,options:n})}deleteMap(t){return this.httpClient.request({method:"DELETE",url:ov`map/deleteMap`,options:t})}getCustomMapInfo(t){return this.httpClient.request({method:"GET",url:ov`map/getCustomMapInfo`,options:t})}getTile(t,n,i,r){return this.httpClient.request({method:"GET",url:ov`map/tile/${t}/${n}/${i}`,options:r})}uploadMap(t,n){return this.httpClient.request({method:"POST",url:ov`map/upload`,queryParams:t,options:n})}}class od{constructor(t){this.httpClient=t}createProvisioningConfig(t,n){return this.httpClient.request({method:"POST",url:ov`provisioning`,data:t,options:n})}getProvisioningConfigs(t){return this.httpClient.request({method:"GET",url:ov`provisioning`,options:t})}deleteProvisioningConfig(t,n){return this.httpClient.request({method:"DELETE",url:ov`provisioning/${t}`,options:n})}updateProvisioningConfig(t,n,i){return this.httpClient.request({method:"PUT",url:ov`provisioning/${t}`,data:n,options:i})}}class ou{constructor(t){this.httpClient=t}getAllNodeDefinitions(t){return this.httpClient.request({method:"GET",url:ov`flow`,options:t})}getNodeDefinition(t,n){return this.httpClient.request({method:"GET",url:ov`flow/${t}`,options:n})}getAllNodeDefinitionsByType(t,n){return this.httpClient.request({method:"GET",url:ov`flow/${t}`,options:n})}}class oh{constructor(t){this.httpClient=t}startTunnel(t,n){return this.httpClient.request({method:"POST",url:ov`gateway/tunnel`,data:t,options:n})}stopTunnel(t,n){return this.httpClient.request({method:"DELETE",url:ov`gateway/tunnel`,data:t,options:n})}getAllActiveTunnelInfos(t,n){return this.httpClient.request({method:"GET",url:ov`gateway/tunnel/${t}`,options:n})}getGatewayActiveTunnelInfos(t,n,i){return this.httpClient.request({method:"GET",url:ov`gateway/tunnel/${t}/${n}`,options:i})}getActiveTunnelInfo(t,n,i,r,o){return this.httpClient.request({method:"GET",url:ov`gateway/tunnel/${t}/${n}/${i}/${r}`,options:o})}}class om{constructor(t){this.httpClient=t}createGlobalRuleset(t,n){return this.httpClient.request({method:"POST",url:ov`rules`,data:t,options:n})}getGlobalRulesets(t,n){return this.httpClient.request({method:"GET",url:ov`rules`,queryParams:t,options:n})}createAssetRuleset(t,n){return this.httpClient.request({method:"POST",url:ov`rules/asset`,data:t,options:n})}getAssetRulesets(t,n,i){return this.httpClient.request({method:"GET",url:ov`rules/asset/for/${t}`,queryParams:n,options:i})}deleteAssetRuleset(t,n){return this.httpClient.request({method:"DELETE",url:ov`rules/asset/${t}`,options:n})}getAssetRuleset(t,n){return this.httpClient.request({method:"GET",url:ov`rules/asset/${t}`,options:n})}updateAssetRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:ov`rules/asset/${t}`,data:n,options:i})}getAssetGeofences(t,n){return this.httpClient.request({method:"GET",url:ov`rules/geofences/${t}`,options:n})}getAssetEngineInfo(t,n){return this.httpClient.request({method:"GET",url:ov`rules/info/asset/${t}`,options:n})}getGlobalEngineInfo(t){return this.httpClient.request({method:"GET",url:ov`rules/info/global`,options:t})}getRealmEngineInfo(t,n){return this.httpClient.request({method:"GET",url:ov`rules/info/realm/${t}`,options:n})}createRealmRuleset(t,n){return this.httpClient.request({method:"POST",url:ov`rules/realm`,data:t,options:n})}getRealmRulesets(t,n,i){return this.httpClient.request({method:"GET",url:ov`rules/realm/for/${t}`,queryParams:n,options:i})}deleteRealmRuleset(t,n){return this.httpClient.request({method:"DELETE",url:ov`rules/realm/${t}`,options:n})}getRealmRuleset(t,n){return this.httpClient.request({method:"GET",url:ov`rules/realm/${t}`,options:n})}updateRealmRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:ov`rules/realm/${t}`,data:n,options:i})}deleteGlobalRuleset(t,n){return this.httpClient.request({method:"DELETE",url:ov`rules/${t}`,options:n})}getGlobalRuleset(t,n){return this.httpClient.request({method:"GET",url:ov`rules/${t}`,options:n})}updateGlobalRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:ov`rules/${t}`,data:n,options:i})}}class op{constructor(t){this.httpClient=t}getNotifications(t,n){return this.httpClient.request({method:"GET",url:ov`notification`,queryParams:t,options:n})}removeNotifications(t,n){return this.httpClient.request({method:"DELETE",url:ov`notification`,queryParams:t,options:n})}sendNotification(t,n){return this.httpClient.request({method:"POST",url:ov`notification/alert`,data:t,options:n})}getNotificationsCount(t,n){return this.httpClient.request({method:"GET",url:ov`notification/count`,queryParams:t,options:n})}removeNotification(t,n){return this.httpClient.request({method:"DELETE",url:ov`notification/${t}`,options:n})}notificationAcknowledged(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`notification/${t}/acknowledged`,queryParams:i,data:n,options:r})}notificationDelivered(t,n,i){return this.httpClient.request({method:"PUT",url:ov`notification/${t}/delivered`,queryParams:n,options:i})}}class of{constructor(t){this.httpClient=t}getAssetDescriptors(t,n){return this.httpClient.request({method:"GET",url:ov`model/assetDescriptors`,queryParams:t,options:n})}getAssetInfo(t,n,i){return this.httpClient.request({method:"GET",url:ov`model/assetInfo/${t}`,queryParams:n,options:i})}getAssetInfos(t,n){return this.httpClient.request({method:"GET",url:ov`model/assetInfos`,queryParams:t,options:n})}getValueDescriptorSchema(t,n){return this.httpClient.request({method:"GET",url:ov`model/getValueDescriptorSchema`,queryParams:t,options:n})}getMetaItemDescriptors(t,n){return this.httpClient.request({method:"GET",url:ov`model/metaItemDescriptors`,queryParams:t,options:n})}getValueDescriptors(t,n){return this.httpClient.request({method:"GET",url:ov`model/valueDescriptors`,queryParams:t,options:n})}}class ob{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:ov`asset`,data:t,options:n})}delete(t,n){return this.httpClient.request({method:"DELETE",url:ov`asset`,queryParams:t,options:n})}writeAttributeValues(t,n){return this.httpClient.request({method:"PUT",url:ov`asset/attributes`,data:t,options:n})}writeAttributeEvents(t,n){return this.httpClient.request({method:"PUT",url:ov`asset/attributes/timestamp`,data:t,options:n})}queryCount(t,n){return this.httpClient.request({method:"POST",url:ov`asset/count`,data:t,options:n})}updateNoneParent(t,n){return this.httpClient.request({method:"DELETE",url:ov`asset/parent`,queryParams:t,options:n})}getPartial(t,n){return this.httpClient.request({method:"GET",url:ov`asset/partial/${t}`,options:n})}queryAssets(t,n){return this.httpClient.request({method:"POST",url:ov`asset/query`,data:t,options:n})}queryAssetTree(t,n){return this.httpClient.request({method:"POST",url:ov`asset/tree`,data:t,options:n})}getCurrentUserAssets(t){return this.httpClient.request({method:"GET",url:ov`asset/user/current`,options:t})}createUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:ov`asset/user/link`,data:t,options:n})}getUserAssetLinks(t,n){return this.httpClient.request({method:"GET",url:ov`asset/user/link`,queryParams:t,options:n})}deleteUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:ov`asset/user/link/delete`,data:t,options:n})}deleteAllUserAssetLinks(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`asset/user/link/${t}/${n}`,options:i})}deleteUserAssetLink(t,n,i,r){return this.httpClient.request({method:"DELETE",url:ov`asset/user/link/${t}/${n}/${i}`,options:r})}get(t,n){return this.httpClient.request({method:"GET",url:ov`asset/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:ov`asset/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`asset/${t}/attribute/${n}`,data:i,options:r})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:ov`asset/${t}/attribute/${n}/${i}`,data:r,options:o})}updateParent(t,n,i){return this.httpClient.request({method:"PUT",url:ov`asset/${t}/child`,queryParams:n,options:i})}}class og{constructor(t){this.httpClient=t}createAlarm(t,n,i){return this.httpClient.request({method:"POST",url:ov`alarm`,queryParams:n,data:t,options:i})}getAlarms(t,n){return this.httpClient.request({method:"GET",url:ov`alarm`,queryParams:t,options:n})}removeAlarms(t,n){return this.httpClient.request({method:"DELETE",url:ov`alarm`,data:t,options:n})}setAssetLinks(t,n){return this.httpClient.request({method:"PUT",url:ov`alarm/assets`,data:t,options:n})}getAlarm(t,n){return this.httpClient.request({method:"GET",url:ov`alarm/${t}`,options:n})}removeAlarm(t,n){return this.httpClient.request({method:"DELETE",url:ov`alarm/${t}`,options:n})}updateAlarm(t,n,i){return this.httpClient.request({method:"PUT",url:ov`alarm/${t}`,data:n,options:i})}getAssetLinks(t,n,i){return this.httpClient.request({method:"GET",url:ov`alarm/${t}/assets`,queryParams:n,options:i})}}class o_{constructor(t){this.httpClient=t}deleteConnections(t,n){return this.httpClient.request({method:"DELETE",url:ov`gateway/connection`,queryParams:t,options:n})}getConnections(t){return this.httpClient.request({method:"GET",url:ov`gateway/connection`,options:t})}deleteConnection(t,n){return this.httpClient.request({method:"DELETE",url:ov`gateway/connection/${t}`,options:n})}getConnection(t,n){return this.httpClient.request({method:"GET",url:ov`gateway/connection/${t}`,options:n})}setConnection(t,n,i){return this.httpClient.request({method:"PUT",url:ov`gateway/connection/${t}`,data:n,options:i})}getConnectionStatus(t,n){return this.httpClient.request({method:"GET",url:ov`gateway/status/${t}`,options:n})}}class oy{constructor(t){this.httpClient=t}getApps(t){return this.httpClient.request({method:"GET",url:ov`apps`,options:t})}getConsoleConfig(t){return this.httpClient.request({method:"GET",url:ov`apps/consoleConfig`,options:t})}getAppInfos(t){return this.httpClient.request({method:"GET",url:ov`apps/info`,options:t})}}function ov(t,...n){let i="";for(let r=0;r<n.length;r++)i+=t[r],i+=encodeURIComponent(n[r]);return i+t[t.length-1]}class ox{constructor(t,n=r8.create()){this._statusResource=new ow(t,n),this._dashboardResource=new oE(t,n),this._realmResource=new oC(t,n),this._consoleResource=new oA(t,n),this._externalServiceResource=new ok(t,n),this._assetPredictedDatapointResource=new oT(t,n),this._syslogResource=new oS(t,n),this._configurationResource=new oI(t,n),this._assetDatapointResource=new oD(t,n),this._agentResource=new oP(t,n),this._userResource=new oR(t,n),this._mapResource=new oO(t,n),this._provisioningResource=new oM(t,n),this._flowResource=new oL(t,n),this._gatewayServiceResource=new oB(t,n),this._rulesResource=new oz(t,n),this._notificationResource=new oN(t,n),this._assetModelResource=new oU(t,n),this._assetResource=new oj(t,n),this._alarmResource=new oV(t,n),this._gatewayClientResource=new o$(t,n),this._appResource=new oq(t,n),this._assetResource=new oj(t,n)}get StatusResource(){return this._statusResource}get DashboardResource(){return this._dashboardResource}get RealmResource(){return this._realmResource}get ConsoleResource(){return this._consoleResource}get ExternalServiceResource(){return this._externalServiceResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get SyslogResource(){return this._syslogResource}get ConfigurationResource(){return this._configurationResource}get AssetDatapointResource(){return this._assetDatapointResource}get AgentResource(){return this._agentResource}get UserResource(){return this._userResource}get MapResource(){return this._mapResource}get ProvisioningResource(){return this._provisioningResource}get FlowResource(){return this._flowResource}get GatewayServiceResource(){return this._gatewayServiceResource}get RulesResource(){return this._rulesResource}get NotificationResource(){return this._notificationResource}get AssetModelResource(){return this._assetModelResource}get AssetResource(){return this._assetResource}get AlarmResource(){return this._alarmResource}get GatewayClientResource(){return this._gatewayClientResource}get AppResource(){return this._appResource}}class oF{constructor(t){this.axios=t}request(t){let n={};n.method=t.method,n.url=t.url,n.params=t.queryParams,n.data=t.data,function(t,n){if(void 0!=n)for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}(n,t.options);let i=t.copyFn;return this.axios.request(n).then(t=>(i&&t.data&&(t.originalData=t.data,t.data=i(t.data)),t))}}class ow extends r7{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oE extends r9{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oC extends oe{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oA extends ot{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class ok extends on{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oT extends oi{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oS extends or{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oI extends oo{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oD extends oa{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oP extends os{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oR extends ol{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oO extends oc{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oM extends od{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oL extends ou{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oB extends oh{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oz extends om{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oN extends op{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oU extends of{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oj extends ob{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oV extends og{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class o$ extends o_{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oq extends oy{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}var oG=i(8183),oH=i.n(oG);r8.isAxiosError;let oW=new class{get api(){return this._client}constructor(){this._axiosInstance=r8.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(t=>(t.paramsSerializer=t=>oH().stringify(t,{arrayFormat:"repeat"}),t))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(t){this._axiosInstance.defaults.timeout=t}addRequestInterceptor(t){this._axiosInstance.interceptors.request.use(t)}initialise(t){this._baseUrl=t,this._client=new ox(t,this._axiosInstance)}};var oY=function(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})};(eE=tR||(tR={})).DISCONNECTED="DISCONNECTED",eE.CONNECTED="CONNECTED",eE.CONNECTING="CONNECTING";let oX="SUBSCRIBED:",oZ="UNAUTHORIZED:",oK="TRIGGERED:",oJ="EVENT:";class oQ{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=o0.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tR.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(t){this._statusCallbacks.push(t)}unsubscribeStatusChange(t){!function(t,n){if(0===t.length)return;let i=t.indexOf(n);i>=0&&t.splice(i,1)}(this._statusCallbacks,t)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tR.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tR.CONNECTING),this._connectingDeferred=new nW,this._doConnect().then(t=>{if(this._connectingDeferred){let n=this._connectingDeferred;t?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=o0.MIN_RECONNECT_DELAY,this._onStatusChanged(tR.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),n.resolve(t)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tR.DISCONNECTED&&this._doDisconnect())}subscribe(t,n){let i={eventSubscription:t,callback:n,deferred:new nW};return null!=this._pendingSubscription||this._status!==tR.CONNECTED?(this._queuedSubscriptions.push(i),i.deferred.promise):(this._pendingSubscription=i,this._doSubscribe(t).then(t=>{if(this._pendingSubscription){let n=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(t,n),this._processNextSubscription();let i=n.deferred;n.deferred=null,i&&i.resolve(t)}},t=>{if(console.error(t),this._pendingSubscription){let n=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let i=n.deferred;n.deferred=null,i&&i.reject(t)}}),this._pendingSubscription.deferred.promise)}unsubscribe(t){return oY(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(t))return void this._doUnsubscribe(t);if(this._assetEventCallbackMap.delete(t)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let t=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(t)}return}if(this._attributeEventCallbackMap.delete(t)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let t=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(t)}})}sendEvent(t){this._status===tR.CONNECTED&&this._doSend(t)}sendEventWithReply(t){return this._status!==tR.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(t)}subscribeAssetEvents(t,n,i){return oY(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0]?t.map(t=>t.id):t,o="AssetEvent"+oQ._subscriptionCounter++;if(!this._assetEventPromise){let t;sq.authenticated||(t={filterType:"asset",realm:sq.displayRealm});let n={eventType:"asset",filter:t};this._assetEventPromise=this.subscribe(n,t=>{this._assetEventCallbackMap.forEach(n=>n(t))})}return this._assetEventCallbackMap.set(o,t=>{let n=t.asset.id;r?r.find(t=>n===t)&&i(t):t.asset.realm===sq.displayRealm&&i(t)}),this._assetEventPromise.then(()=>{try{if(r&&n){let t={messageID:"read-assets:"+r.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(t).then(t=>{t.assets&&this._assetEventCallbackMap.has(o)&&t.assets.forEach(t=>{i({eventType:"asset",asset:t,cause:"READ"})})})}}catch(n){throw console.error("Failed to subscribe to asset events for assets: "+t),o&&this.unsubscribe(o),n}return o})})}subscribeAttributeEvents(t,n,i){return oY(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0],o=r?t.map(t=>t.id):t,a=r?t:void 0,s="AttributeEvent"+oQ._subscriptionCounter++;if(!this._attributeEventPromise){let t;sq.authenticated||(t={filterType:"asset",realm:sq.displayRealm});let n={eventType:"attribute",filter:t};this._attributeEventPromise=this.subscribe(n,t=>{this._attributeEventCallbackMap.forEach(n=>n(t))})}let l=n=>{let a=n.ref;r?t.forEach(t=>{a.id===t.id&&a.name===t.name&&i(n)}):o?o.find(t=>a.id===t)&&i(n):n.realm===sq.displayRealm&&i(n)};return this._attributeEventCallbackMap.set(s,l),this._attributeEventPromise.then(()=>{try{if(n&&o){let t={messageID:"read-assets:"+o.join(",")+":"+s,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(t).then(t=>{t.assets&&this._attributeEventCallbackMap.has(s)&&t.assets.forEach(t=>{t.attributes&&Object.entries(t.attributes).forEach(([n,i])=>{(!a||a.find(i=>i.id===t.id&&i.name===n))&&l({eventType:"attribute",timestamp:i.timestamp,value:i.value,ref:{id:t.id,name:n}})})})})}}catch(n){throw console.error("Failed to subscribe to asset events for assets: "+t),s&&this.unsubscribe(s),n}return s})})}_processNextSubscription(){this._status===tR.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let t=this._queuedSubscriptions.shift();t&&this.subscribe(t.eventSubscription,t.callback).then(n=>{let i=t.deferred;t.deferred=null,i&&i.resolve(n)},n=>{let i=t.deferred;t.deferred=null,i&&i.reject(n)})},0)}_onStatusChanged(t){t!==this._status&&(console.debug("Event provider status changed: "+t),this._status=t,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(n=>n(t))},0))}_onMessageReceived(t,n){let i=this._subscriptionMap.get(t);i&&i.callback(n)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let t in this._subscriptionMap)this._subscriptionMap.has(t)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(t));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tR.CONNECTED&&this._onStatusChanged(tR.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tR.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<o0.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(o0.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}oQ.MIN_RECONNECT_DELAY=0,oQ.MAX_RECONNECT_DELAY=3e4,oQ._subscriptionCounter=0;class o0 extends oQ{get endpointUrl(){return this._endpointUrl}constructor(t){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(t.startsWith("https:")?"wss":"ws")+"://"+t.substr(t.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let t=this._endpointUrl+"?Realm="+sq.config.realm;return this._connectDeferred=new nW,(sq.authenticated?sq.retrieveAuthorizationHeader().then(n=>{t+="&Authorization="+n}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(t),this._webSocket.onopen=t=>{if(this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!0)}},this._webSocket.onerror=t=>{if(console.error("Event provider error:",t),this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=t=>{let n=t.data;if(n&&n.startsWith(oX)){let t=JSON.parse(n.substring(oX.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&i.resolve(t.subscriptionId)}else if(n.startsWith(oZ)){let t=JSON.parse(n.substring(oZ.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&(console.warn("Unauthorized event subscription: "+JSON.stringify(t,null,2)),i.reject("Unauthorized"))}else if(n.startsWith(oK)){let t=JSON.parse(n.substring(oK.length));t.events&&t.events.forEach(n=>{this._onMessageReceived(t.subscriptionId,n)})}else if(n.startsWith(oJ)){let t=JSON.parse(n.substring(oJ.length));if(t.messageID){let n=this._repliesDeferred.get(t.messageID);this._repliesDeferred.delete(t.messageID),n&&n.resolve(t)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var t;null==(t=this._webSocket)||t.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(t){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new nW,t.subscriptionId||(t.subscriptionId=o0._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(t)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(t){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:t}))}_doSend(t){let n=oJ+JSON.stringify(t);this._webSocket.send(n)}_doSendWithReply(t){if(t.messageID||(t.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(t.messageID))return Promise.reject("There's already a pending send and reply with this ID");let n=new nW;return this._repliesDeferred.set(t.messageID,n),this._webSocket.send(oJ+JSON.stringify(t)),n.promise}}o0._subscriptionCounter=1;let o1=["__proto__","constructor","prototype"];function o2(t){return!("string"!=typeof t||0===t.length||t.length>128||o1.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%\s@]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function o3(t){return!(!o2(t)||t.indexOf("/")>-1)}let o5={lng:o3,ns:function(t){return o2(t)}};function o4(t){return"string"!=typeof t?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function o6(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let o8=/\{\{(.+?)\}\}/g;function o7(t,n){let i=!1,r=t.replace(o8,(t,r)=>{let o=r.trim();if(o1.indexOf(o)>-1)return t;let a=n[o];if(null==a)return t;let s=o5[o]||o3,l=String(a).split("+");for(let n of l)if(!s(n))return i=!0,t;return l.join("+")});return i?null:r}let o9="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?t=fetch:o9&&"function"==typeof o9.fetch&&(t=o9.fetch);let ae=o6()&&o9?o9.XMLHttpRequest:void 0,at="function"==typeof ActiveXObject&&o9?o9.ActiveXObject:void 0,an=["__proto__","constructor","prototype"],ai=(t,n)=>{if(n&&"object"==typeof n){let i="";for(let t of Object.keys(n))an.indexOf(t)>-1||(i+="&"+encodeURIComponent(t)+"="+encodeURIComponent(n[t]));if(!i)return t;t=t+(-1!==t.indexOf("?")?"&":"?")+i.slice(1)}return t},ar=(n,i,r,o)=>{let a=t=>{if(!t.ok)return r(t.statusText||"Error",{status:t.status});t.text().then(n=>{r(null,{status:t.status,data:n})}).catch(r)};if(o){let t=o(n,i);if(t instanceof Promise)return void t.then(a).catch(r)}"function"==typeof fetch?fetch(n,i).then(a).catch(r):t(n,i).then(a).catch(r)},ao=(n,i,r,o)=>{if("function"==typeof r&&(o=r,r=void 0),o=o||(()=>{}),t&&0!==i.indexOf("file:")){var a=i,s=r,l=o;n.queryStringParams&&(a=ai(a,n.queryStringParams));let t={..."function"==typeof n.customHeaders?n.customHeaders():n.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(t["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),s&&(t["Content-Type"]="application/json");let c="function"==typeof n.requestOptions?n.requestOptions(s):n.requestOptions,d={method:s?"POST":"GET",body:s?n.stringify(s):void 0,headers:t,...n._omitFetchOptions?{}:c},u="function"==typeof n.alternateFetch&&n.alternateFetch.length>=1?n.alternateFetch:void 0;try{ar(a,d,l,u)}catch(t){if(!c||0===Object.keys(c).length||!t.message||0>t.message.indexOf("not implemented"))return l(t);try{Object.keys(c).forEach(t=>{delete d[t]}),ar(a,d,l,u),n._omitFetchOptions=!0}catch(t){l(t)}}return}if(o6()||"function"==typeof ActiveXObject){var c=i,d=r,u=o;d&&"object"==typeof d&&(d=ai("",d).slice(1)),n.queryStringParams&&(c=ai(c,n.queryStringParams));try{let t=ae?new ae:new at("MSXML2.XMLHTTP.3.0");t.open(d?"POST":"GET",c,1),n.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!n.withCredentials,d&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let i=n.customHeaders;if(i="function"==typeof i?i():i)for(let n of Object.keys(i))an.indexOf(n)>-1||t.setRequestHeader(n,i[n]);t.onreadystatechange=()=>{t.readyState>3&&u(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(d)}catch(t){console&&console.log(t)}return}o(Error("No fetch and no xhr implementation found!"))};var aa=class{constructor(t,n={},i={}){this.services=t,this.options=n,this.allOptions=i,this.type="backend",this.init(t,n,i)}init(t,n={},i={}){if(this.services=t,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:t=>JSON.parse(t),stringify:JSON.stringify,parsePayload:(t,n,i)=>({[n]:i||""}),parseLoadPayload:(t,n)=>void 0,request:ao,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...n},this.allOptions=i,this.services&&this.options.reloadInterval){let t=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof t&&"function"==typeof t.unref&&t.unref()}}readMulti(t,n,i){this._readAny(t,t,n,n,i)}read(t,n,i){this._readAny([t],t,[n],n,i)}_readAny(t,n,i,r,o){var a,s;let l=this.options.loadPath;"function"==typeof this.options.loadPath&&(l=this.options.loadPath(t,i)),(l=(s=a=l)&&"function"==typeof s.then?a:Promise.resolve(a)).then(a=>{if(!a)return o(null,{});let s=o7(a,{lng:t.join("+"),ns:i.join("+")});if(null==s)return o(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+t.map(o4).join(", ")+"] namespaces=["+i.map(o4).join(", ")+"]"),!1);this.loadUrl(s,o,n,r)})}loadUrl(t,n,i,r){let o=this.options.parseLoadPayload("string"==typeof i?[i]:i,"string"==typeof r?[r]:r),a=o4(function(t){if("string"!=typeof t||0===t.length)return t;try{let n=new URL(t);if(n.username||n.password)return n.username="",n.password="",n.toString();return t}catch(n){return t.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(t));this.options.request(this.options,t,o,(t,o)=>{let s,l;if(o&&(o.status>=500&&o.status<600||!o.status))return n("failed loading "+a+"; status code: "+o.status,!0);if(o&&o.status>=400&&o.status<500)return n("failed loading "+a+"; status code: "+o.status,!1);if(!o&&t&&t.message){let i=t.message.toLowerCase();if(["failed","fetch","network","load"].find(t=>i.indexOf(t)>-1))return n("failed loading "+a+": "+o4(t.message),!0)}if(t)return n(t,!1);try{s="string"==typeof o.data?this.options.parse(o.data,i,r):o.data}catch(t){l="failed parsing "+a+" to json"}if(l)return n(l,!1);n(null,s)})}create(t,n,i,r,o){if(!this.options.addPath)return;"string"==typeof t&&(t=[t]);let a=this.options.parsePayload(n,i,r),s=0,l=[],c=[];t.forEach(i=>{let r=this.options.addPath;"function"==typeof this.options.addPath&&(r=this.options.addPath(i,n));let d=o7(r,{lng:i,ns:n});if(null==d){s+=1,o&&s===t.length&&o(l,c);return}this.options.request(this.options,d,a,(n,i)=>{s+=1,l.push(n),c.push(i),s===t.length&&"function"==typeof o&&o(l,c)})})}reload(){let{backendConnector:t,languageUtils:n,logger:i}=this.services,r=t.language;if(r&&"cimode"===r.toLowerCase())return;let o=[],a=t=>{n.toResolveHierarchy(t).forEach(t=>{0>o.indexOf(t)&&o.push(t)})};a(r),this.allOptions.preload&&this.allOptions.preload.forEach(t=>a(t)),o.forEach(n=>{this.allOptions.ns.forEach(r=>{t.read(n,r,"read",null,null,(o,a)=>{o&&i.warn(`loading namespace ${r} for language ${n} failed`,o),!o&&a&&i.log(`loaded namespace ${r} for language ${n}`,a),t.loaded(`${n}|${r}`,o,a)})})})}};aa.type="backend";let as=globalThis,al=as.ShadowRoot&&(void 0===as.ShadyCSS||as.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ac=Symbol(),ad=new WeakMap;class au{constructor(t,n,i){if(this._$cssResult$=!0,i!==ac)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o,n=this.t;if(al&&void 0===t){let i=void 0!==n&&1===n.length;i&&(t=ad.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ad.set(n,t))}return t}toString(){return this.cssText}}let ah=t=>new au("string"==typeof t?t:t+"",void 0,ac),am=(t,...n)=>new au(1===t.length?t[0]:n.reduce((n,i,r)=>n+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]),t,ac),ap=(t,n)=>{if(al)t.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let i of n){let n=document.createElement("style"),r=as.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,t.appendChild(n)}},af=al?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let n="";for(let i of t.cssRules)n+=i.cssText;return ah(n)})(t):t,{is:ab,defineProperty:ag,getOwnPropertyDescriptor:a_,getOwnPropertyNames:ay,getOwnPropertySymbols:av,getPrototypeOf:ax}=Object,aF=globalThis,aw=aF.trustedTypes,aE=aw?aw.emptyScript:"",aC=aF.reactiveElementPolyfillSupport,aA={toAttribute(t,n){switch(n){case Boolean:t=t?aE:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,n){let i=t;switch(n){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},ak=(t,n)=>!ab(t,n),aT={attribute:!0,type:String,converter:aA,reflect:!1,useDefault:!1,hasChanged:ak};Symbol.metadata??=Symbol("metadata"),aF.litPropertyMetadata??=new WeakMap;class aS extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=aT){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,n);void 0!==r&&ag(this.prototype,t,r)}}static getPropertyDescriptor(t,n,i){let{get:r,set:o}=a_(this.prototype,t)??{get(){return this[n]},set(t){this[n]=t}};return{get:r,set(n){let a=r?.call(this);o?.call(this,n),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??aT}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=ax(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let t=this.properties;for(let n of[...ay(t),...av(t)])this.createProperty(n,t[n])}let t=this[Symbol.metadata];if(null!==t){let n=litPropertyMetadata.get(t);if(void 0!==n)for(let[t,i]of n)this.elementProperties.set(t,i)}for(let[t,n]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(t,n);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let n=[];if(Array.isArray(t))for(let i of new Set(t.flat(1/0).reverse()))n.unshift(af(i));else void 0!==t&&n.push(af(t));return n}static _$Eu(t,n){let i=n.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map;for(let n of this.constructor.elementProperties.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ap(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,n,i){this._$AK(t,i)}_$ET(t,n){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){let o=(void 0!==i.converter?.toAttribute?i.converter:aA).toAttribute(n,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,n){let i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){let t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:aA;this._$Em=r;let a=o.fromAttribute(n,t.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,n,i){if(void 0!==t){let r=this.constructor,o=this[t];if(!(((i??=r.getPropertyOptions(t)).hasChanged??ak)(o,n)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,n,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,n,{useDefault:i,reflect:r,wrapped:o},a){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??n??this[t]),!0!==o||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||i||(n=void 0),this._$AL.set(t,n)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[t,n]of this._$Ep)this[t]=n;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[n,i]of t){let{wrapped:t}=i,r=this[n];!0!==t||this._$AL.has(n)||void 0===r||this.C(n,void 0,i,r)}}let t=!1,n=this._$AL;try{(t=this.shouldUpdate(n))?(this.willUpdate(n),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(n)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}aS.elementStyles=[],aS.shadowRootOptions={mode:"open"},aS.elementProperties=new Map,aS.finalized=new Map,aC?.({ReactiveElement:aS}),(aF.reactiveElementVersions??=[]).push("2.1.1");let aI=globalThis,aD=aI.trustedTypes,aP=aD?aD.createPolicy("lit-html",{createHTML:t=>t}):void 0,aR="$lit$",aO=`lit$${Math.random().toFixed(9).slice(2)}$`,aM="?"+aO,aL=`<${aM}>`,aB=document,az=()=>aB.createComment(""),aN=t=>null===t||"object"!=typeof t&&"function"!=typeof t,aU=Array.isArray,aj=t=>aU(t)||"function"==typeof t?.[Symbol.iterator],aV="[ \n\f\r]",a$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,aq=/-->/g,aG=/>/g,aH=RegExp(`>|${aV}(?:([^\\s"'>=/]+)(${aV}*=${aV}*(?:[^
817
+ ${l.shaderPreludeCode.vertexSource}`,define:l.shaderDefine},defaultProjectionData:d,getProjectionData:t=>c.getProjectionData({overscaledTileID:new E.d(t.tileID.canonical.z,t.tileID.wrap??0,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),aligned:t.aligned,applyGlobeMatrix:t.applyGlobeMatrix,applyTerrainMatrix:t.applyTerrainMatrix})},h=s.renderingMode?s.renderingMode:"2d";if("offscreen"===r.currentPass){let n=s.prerender;n&&(t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),n.call(s,a.gl,u),a.setDirty(),t.setBaseState())}else if("translucent"===r.currentPass){t.setCustomLayerDefaults(),a.setColorMode(t.colorModeForRenderPass()),a.setStencilMode(rb.disabled);let n="3d"===h?t.getDepthModeFor3D():t.getDepthModeForSublayer(0,rf.ReadOnly);a.setDepthMode(n),s.render(a.gl,u),a.setDirty(),t.setBaseState(),a.bindFramebuffer.set(null)}},debug:function(t,n,i){for(let r of i)!function(t,n,i){let r=t.context,o=r.gl,a=t.useProgram("debug"),s=rf.disabled,l=rb.disabled,c=t.colorModeForRenderPass(),d="$debug",u=t.style.map.terrain?.getTerrainData(i);r.activeTexture.set(o.TEXTURE0);let h=Math.floor((n.getTileByID(i.key).latestRawTileData?.byteLength||0)/1024),m=512/Math.min(n.getTile(i).tileSize,512)*(i.overscaledZ/t.transform.zoom)*.5,p=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(p+=` => ${i.overscaledZ}`),function(t,n){t.initDebugOverlayCanvas();let i=t.debugOverlayCanvas,r=t.context.gl,o=t.debugOverlayCanvas.getContext("2d");o.clearRect(0,0,i.width,i.height),o.shadowColor="white",o.shadowBlur=2,o.lineWidth=1.5,o.strokeStyle="white",o.textBaseline="top",o.font="bold 36px Open Sans, sans-serif",o.fillText(n,5,5),o.strokeText(n,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,`${p} ${h}kB`);let f=t.transform.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!0,applyTerrainMatrix:!0});a.draw(r,o.TRIANGLES,s,l,rm.alphaBlended,rg.disabled,ip(E.pn.transparent,m),null,f,d,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),a.draw(r,o.LINE_STRIP,s,l,c,rg.disabled,ip(E.pn.red),u,f,d,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,n,r)},debugPadding:function(t){var n,i,r,o;let a=t.transform.padding;r$(t,t.transform.height-(a.top||0),3,rz),r$(t,a.bottom||0,3,rN),rq(t,a.left||0,3,rU),rq(t,t.transform.width-(a.right||0),3,rj);let s=t.transform.centerPoint;n=t,i=s.x,r=t.transform.height-s.y,rG(n,i-1,r-10,2,20,o=rV),rG(n,i-10,r-1,20,2,o)},terrainDepth:function(t,n){let i=t.context,r=i.gl,o=t.transform,a=rm.unblended,s=new rf(r.LEQUAL,rf.ReadWrite,[0,1]),l=n.tileManager.getRenderableTiles(),c=t.useProgram("terrainDepth");for(let d of(i.bindFramebuffer.set(n.getFramebuffer().framebuffer),i.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),i.clear({color:E.pn.white,depth:1}),l)){let t=n.getTerrainMesh(d.tileID),l=n.getTerrainData(d.tileID),u=o.getProjectionData({overscaledTileID:d.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),h=n5(n.getSkirtLength(o.zoom));c.draw(i,r.TRIANGLES,s,rb.disabled,a,rg.backCCW,h,l,u,"terrain",t.vertexBuffer,t.indexBuffer,t.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,t.width,t.height])}};var rY=class t{constructor(t,n){this.drawFunctions=rW,this.context=new rp(t),this.transform=n,this.layerOpacityFbo=null,this._tileTextures={},this._rttObjectRecyclePool=[],this._rttSharedFbo=null,this.terrainFacilitator={depthDirty:!0,matrix:(0,E.Ci)(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=tm.maxOverzooming+tm.maxUnderzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new t5}resize(t,n,i){if(this.width=Math.floor(t*i),this.height=Math.floor(n*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let t of this.style._order)this.style._layers[t].resize()}setup(){let t=this.context,n=new E.Ut;n.emplaceBack(0,0),n.emplaceBack(8192,0),n.emplaceBack(0,8192),n.emplaceBack(8192,8192),this.tileExtentBuffer=t.createVertexBuffer(n,eX.members),this.tileExtentSegments=E.Rt.simpleSegment(0,0,4,2);let i=new E.Ut;i.emplaceBack(0,0),i.emplaceBack(8192,0),i.emplaceBack(0,8192),i.emplaceBack(8192,8192),this.debugBuffer=t.createVertexBuffer(i,eX.members),this.debugSegments=E.Rt.simpleSegment(0,0,4,5);let r=new E.Gt;r.emplaceBack(0,0,0,0),r.emplaceBack(8192,0,8192,0),r.emplaceBack(0,8192,0,8192),r.emplaceBack(8192,8192,8192,8192),this.rasterBoundsBuffer=t.createVertexBuffer(r,n1.members),this.rasterBoundsSegments=E.Rt.simpleSegment(0,0,4,2);let o=new E.Ut;o.emplaceBack(0,0),o.emplaceBack(8192,0),o.emplaceBack(0,8192),o.emplaceBack(8192,8192),this.rasterBoundsBufferPosOnly=t.createVertexBuffer(o,eX.members),this.rasterBoundsSegmentsPosOnly=E.Rt.simpleSegment(0,0,4,5);let a=new E.Ut;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,eX.members),this.viewportSegments=E.Rt.simpleSegment(0,0,4,2);let s=new E.Vt;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(s);let l=new E.Kt;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(l);let c=this.context.gl;this.stencilClearMode=new rb({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO),this.tileExtentMesh=new eY(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let t=this.context,n=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let i=(0,E.yi)();(0,E.Ei)(i,0,this.width,this.height,0,0,1),(0,E.ji)(i,i,[n.drawingBufferWidth,n.drawingBufferHeight,0]),this.useProgram("clippingMask",null,!0).draw(t,n.TRIANGLES,rf.disabled,this.stencilClearMode,rm.disabled,rg.disabled,null,null,{mainMatrix:i,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:i,clipAntimeridian:!1},"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}renderTileClippingMasks(t,n,i){if(this.currentStencilSource===t.source||!t.isTileClipped()||!n?.length)return;this.currentStencilSource=t.source,this.nextStencilID+n.length>256&&this.clearStencil();let r=this.context;r.setColorMode(rm.disabled),r.setDepthMode(rf.disabled);let o={};for(let t of n)o[t.key]=this.nextStencilID++;this.style.projection.useSubdivision&&this._renderTileMasks(o,n,i,!0),this._renderTileMasks(o,n,i,!1),this._tileClippingMaskIDs=o}_renderTileMasks(t,n,i,r){let o=this.context,a=o.gl,s=this.style.projection,l=this.transform,c=this.useProgram("clippingMask");for(let d of n){let n=t[d.key],u=this.getTerrainDataForTile(d,i),h=s.getMeshFromTileID(this.context,d.canonical,r,!0,"stencil"),m=l.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!i,applyTerrainMatrix:!0});c.draw(o,a.TRIANGLES,rf.disabled,new rb({func:a.ALWAYS,mask:0},n,255,a.KEEP,a.KEEP,a.REPLACE),rm.disabled,i?rg.disabled:rg.backCCW,null,u,m,"$clipping",h.vertexBuffer,h.indexBuffer,h.segments)}}getTerrainDataForTile(t,n){return n&&this.style.projection?.name==="mercator"?null:this.style.map.terrain?.getTerrainData(t)||null}_renderTilesDepthBuffer(){let t=this.context,n=t.gl,i=this.style.projection,r=this.transform,o=this.useProgram("depth"),a=this.getDepthModeFor3D();for(let s of tl(r,{tileSize:r.tileSize})){let l=this.style.map.terrain?.getTerrainData(s),c=i.getMeshFromTileID(this.context,s.canonical,!0,!0,"raster"),d=r.getProjectionData({overscaledTileID:s,applyGlobeMatrix:!0,applyTerrainMatrix:!0});o.draw(t,n.TRIANGLES,a,rb.disabled,rm.disabled,rg.backCCW,null,l,d,"$clipping",c.vertexBuffer,c.indexBuffer,c.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,n=this.context.gl;return new rb({func:n.NOTEQUAL,mask:255},t,255,n.KEEP,n.KEEP,n.REPLACE)}stencilModeForClipping(t){let n=this.context.gl;return new rb({func:n.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,n.KEEP,n.KEEP,n.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(t){let n=this.context.gl,i=t.sort((t,n)=>n.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();let t={};for(let i=0;i<o;i++)t[i+r]=new rb({func:n.GEQUAL,mask:255},i+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=o,[t,i]}return[{[r]:rb.disabled},i]}stencilConfigForOverlapTwoPass(t){let n=this.context.gl,i=t.sort((t,n)=>n.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,o=i[0].overscaledZ-r+1;if(this.clearStencil(),o>1){let t={},a={};for(let i=0;i<o;i++)t[i+r]=new rb({func:n.GREATER,mask:255},o+1+i,255,n.KEEP,n.KEEP,n.REPLACE),a[i+r]=new rb({func:n.GREATER,mask:255},1+i,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID=2*o+1,[t,a,i]}return this.nextStencilID=3,[{[r]:new rb({func:n.GREATER,mask:255},2,255,n.KEEP,n.KEEP,n.REPLACE)},{[r]:new rb({func:n.GREATER,mask:255},1,255,n.KEEP,n.KEEP,n.REPLACE)},i]}colorModeForRenderPass(){let t=this.context.gl;if(this._showOverdrawInspector){let n=1/8;return new rm([t.CONSTANT_COLOR,t.ONE],new E.pn(n,n,n,0),[!0,!0,!0,!0])}return"opaque"===this.renderOptions.currentPass?rm.unblended:rm.alphaBlended}getDepthModeForSublayer(t,n,i){if(!this.opaquePassEnabledForLayer())return rf.disabled;let r=1-((1+this.renderOptions.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new rf(i||this.context.gl.LEQUAL,n,[r,r])}getDepthModeFor3D(){return new rf(this.context.gl.LEQUAL,rf.ReadWrite,this.renderOptions.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.renderOptions.currentLayer<this.renderOptions.opaquePassCutoff}render(t,n){var i,r;let o;this.style=t,this.options=n;let a=this.renderOptions=(i=this.transform,r=t.projection,{currentPass:"offscreen",currentLayer:0,opaquePassCutoff:1/0,depthRangeFor3D:[0,1],isRenderingToTexture:!1,transform:i,terrain:t.map.terrain??null,projectionTransition:o=r?.transitionState??0,isRenderingGlobe:o>0});this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.patternAtlas=t.patternAtlas,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(S()),function(t,n){let i=t.pending,{transform:r}=n,o=n.context.gl;i[rh.u_units_to_pixels]=1/r.pixelsToGLUnits[0],i[rh.u_units_to_pixels+1]=1/r.pixelsToGLUnits[1],i[rh.u_world_size]=o.drawingBufferWidth,i[rh.u_world_size+1]=o.drawingBufferHeight,i[rh.u_camera_to_center_distance]=r.cameraToCenterDistance,i[rh.u_symbol_fade_change]=n.options.fadeDuration?n.symbolFadeChange:1,i[rh.u_aspect_ratio]=r.width/r.height,i[rh.u_device_pixel_ratio]=n.pixelRatio,i[rh.u_viewport_size]=r.width,i[rh.u_viewport_size+1]=r.height,i[rh.u_pixel_extrude_scale]=1/r.width,i[rh.u_pixel_extrude_scale+1]=1/r.height,i[rh.u_pitch]=r.pitch/360*2*Math.PI,t.upload()}(this.context.frameUniformBuffer,this),this.imageManager.beginFrame();let s=this.style._order,l=this.style.tileManagers,c={},d={},u={};for(let t in l){let n=l[t];n.used&&n.prepare(this.context),c[t]=n.getVisibleCoordinates(!1),d[t]=c[t].slice().reverse(),u[t]=n.getVisibleCoordinates(!0).reverse()}a.opaquePassCutoff=1/0;for(let t=0;t<s.length;t++){let n=s[t];if(this.style._layers[n].is3D()){a.opaquePassCutoff=t;break}}for(let t of(this.maybeDrawDepth(),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),a.opaquePassCutoff=0),a.currentPass="offscreen",s)){let n=this.style._layers[t];if(!n.hasOffscreenPass()||n.isHidden(this.transform.zoom))continue;let i=d[n.source];("custom"===n.type||i.length)&&this.renderLayer(this,l[n.source],n,i,a)}if(this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:n.showOverdrawInspector?E.pn.black:E.pn.transparent,depth:1}),this.clearStencil(),this.style.sky&&this.drawFunctions.sky(this,this.style.sky),this._showOverdrawInspector=n.showOverdrawInspector,a.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(a.currentPass="opaque",a.currentLayer=s.length-1;a.currentLayer>=0;a.currentLayer--){let t=this.style._layers[s[a.currentLayer]],n=l[t.source],i=c[t.source];this.renderTileClippingMasks(t,i,!1),this.renderLayer(this,n,t,i,a)}a.currentPass="translucent";let h=!1;for(a.currentLayer=0;a.currentLayer<s.length;a.currentLayer++){let t=this.style._layers[s[a.currentLayer]],n=l[t.source];if(this.renderToTexture?.renderLayer(t,a))continue;this.opaquePassEnabledForLayer()||h||(h=!0,a.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let i=("symbol"===t.type?u:d)[t.source];this.renderTileClippingMasks(t,c[t.source],!!this.renderToTexture),this.renderLayer(this,n,t,i,a)}if(a.isRenderingGlobe&&this.drawFunctions.atmosphere(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let t=function(t,n){let i=null,r=Object.values(t._layers).flatMap(i=>i.source&&!i.isHidden(n)?[t.tileManagers[i.source]]:[]),o=r.filter(t=>"vector"===t.getSource().type),a=r.filter(t=>"vector"!==t.getSource().type),s=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};for(let t of o)s(t);if(!i)for(let t of a)s(t);return i}(this.style,this.transform.zoom);t&&this.drawFunctions.debug(this,t,t.getVisibleCoordinates())}this.options.showPadding&&this.drawFunctions.debugPadding(this),this.context.setDefault()}maybeDrawDepth(){if(!this.style?.map?.terrain)return;let t=this.terrainFacilitator.matrix,n=this.transform.modelViewProjectionMatrix,i=this.terrainFacilitator.depthDirty;i||=!(0,E.bi)(t,n),(i||=this.style.map.terrain.tileManager.anyTilesAfterTime(this.terrainFacilitator.renderTime))&&((0,E.vi)(t,n),this.terrainFacilitator.renderTime=S(),this.terrainFacilitator.depthDirty=!1,this.drawFunctions.terrainDepth(this,this.style.map.terrain))}renderLayer(t,n,i,r,o){if(i.isHidden(this.transform.zoom)||"background"!==i.type&&"custom"!==i.type&&!(r||[]).length)return;this.id=i.id;let a=this.drawFunctions;(0,E.x)(i)?a.symbol(t,n,i,r,this.style.placement.variableOffsets,o):(0,E.Et)(i)?a.circle(t,n,i,r,o):(0,E.St)(i)?a.heatmap(t,n,i,r,o):(0,E.H)(i)?a.line(t,n,i,r,o):(0,E.ft)(i)?a.fill(t,n,i,r,o):(0,E.W)(i)?a.fillExtrusion(t,n,i,r,o):(0,E.bt)(i)?a.hillshade(t,n,i,r,o):(0,E._t)(i)?a.colorRelief(t,n,i,r,o):(0,E.Jt)(i)?a.raster(t,n,i,r,o):(0,E.b)(i)?a.background(t,n,i,r,o):(0,E.v)(i)&&a.custom(t,n,i,o)}static{this.MAX_TEXTURE_POOL_SIZE_PER_BUCKET=50}saveTileTexture(n){let i=this._tileTextures[n.size[0]];i?i.length<t.MAX_TEXTURE_POOL_SIZE_PER_BUCKET?i.push(n):n.destroy():this._tileTextures[n.size[0]]=[n]}getTileTexture(t){let n=this._tileTextures[t];return n&&n.length>0?n.pop():null}acquireRTT(t){let n=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(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&n.texParameterf(n.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),i.size=t),i;let r=new E.yt(this.context,{width:t,height:t,data:null},n.RGBA,{premultiply:!1,useMipmap:!0});return r.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_LINEAR),this.context.extTextureFilterAnisotropic&&n.texParameterf(n.TEXTURE_2D,this.context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this.context.extTextureFilterAnisotropicMax),{texture:r,size:t}}bindRTT(t){let n=this.context.gl,i=t.size;if(!this._rttSharedFbo){let t=this.context.createFramebuffer(i,i,!0,!0),r=this.context.createRenderbuffer(n.DEPTH_STENCIL,i,i);t.depthAttachment.set(r),this._rttSharedFbo={fbo:t,depthRenderbuffer:r,size:i}}this._rttSharedFbo.size!==i&&(this.context.bindRenderbuffer.set(this._rttSharedFbo.depthRenderbuffer),n.renderbufferStorage(n.RENDERBUFFER,n.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)}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let n=this.patternAtlas.getPattern(t.from.toString()),i=this.patternAtlas.getPattern(t.to.toString());return!n||!i}useProgram(t,n,i=!1,r=[]){this.cache||={};let o=!!this.style.map.terrain,a=this.style.projection,s=i?ne.projectionMercator:a.shaderPreludeCode,l=i?nn:a.shaderDefine,c=`/${i?ni:a.shaderVariantName}`,d=t+(n?n.cacheKey:"")+c+(this._showOverdrawInspector?"/overdraw":"")+(o?"/terrain":"")+(r?`/${r.join("/")}`:"");return this.cache[d]||=new io(this.context,ne[t],n,iO[t],this._showOverdrawInspector,o,s,l,r),this.cache[d]}setCustomLayerDefaults(){this.context.setCustomLayerDefaults()}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(null==this.debugOverlayCanvas){this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512;let t=this.context.gl;this.debugOverlayTexture=new E.yt(this.context,this.debugOverlayCanvas,t.RGBA)}}destroy(){if(this._tileTextures){for(let t in this._tileTextures){let n=this._tileTextures[t];if(n)for(let t of n)t.destroy()}this._tileTextures={}}for(let t of this._rttObjectRecyclePool)t.texture.destroy();if(this._rttObjectRecyclePool=[],this._rttSharedFbo){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}if(this.layerOpacityFbo?.destroy(),this.layerOpacityFbo=null,this.tileExtentBuffer&&this.tileExtentBuffer.destroy(),this.debugBuffer&&this.debugBuffer.destroy(),this.rasterBoundsBuffer&&this.rasterBoundsBuffer.destroy(),this.rasterBoundsBufferPosOnly&&this.rasterBoundsBufferPosOnly.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.debugOverlayTexture&&this.debugOverlayTexture.destroy(),this.context.projectionUniformBuffer.destroy(),this.context.terrainUniformBuffer.destroy(),this.context.frameUniformBuffer.destroy(),this.cache){for(let t in this.cache){let n=this.cache[t];n?.program&&this.context.gl.deleteProgram(n.program)}this.cache={}}this.context&&this.context.setDefault()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:n}=this.context.gl;return this.width!==t||this.height!==n}},rX=class extends Error{constructor(t,n){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=t,this.statusMessage=n?.statusMessage??null}};function rZ(t,n){let i=!1,r=null,o,a=()=>{r=null,i&&=(t(...o),r=setTimeout(a,n),!1)};return(...t)=>(i=!0,o=t,r||a(),r)}var rK=class{constructor(t){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 n=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:n,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 n=Array.from(t.keys());n.length>0&&t.delete(n[0])}let n=decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,""),i=n?`#${n}`:"",r=window.location.href.replace(/(#.+)?$/,i);r=r.replace("&&","&"),window.history.replaceState(window.history.state,null,r)},this._updateHash=rZ(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,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(t){let n=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=10**Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.round(n.lng*r)/r,a=Math.round(n.lat*r)/r,s=this._map.getBearing(),l=this._map.getPitch(),c="";if(c+=t?`/${o}/${a}/${i}`:`${i}/${a}/${o}`,(s||l)&&(c+=`/${Math.round(10*s)/10}`),l&&(c+=`/${Math.round(l)}`),this._hashName){let t=this._getHashParams();return t.set(this._hashName,c),`#${decodeURIComponent(t.toString()).replace(/=&/g,"&").replace(/=$/g,"")}`}return`#${c}`}_isValidHash(t){if(t.length<3||t.some(t=>isNaN(+t)))return!1;try{new E.st(+t[2],+t[1])}catch{return!1}let n=+t[0],i=+(t[3]||0),r=+(t[4]||0);return n>=this._map.getMinZoom()&&n<=this._map.getMaxZoom()&&i>=-180&&i<=180&&r>=this._map.getMinPitch()&&r<=this._map.getMaxPitch()}};let rJ={linearity:.3,easing:(0,E.Bn)(0,0,.3,1)},rQ=(0,E.tr)({deceleration:2500,maxSpeed:1400},rJ),r0=(0,E.tr)({deceleration:20,maxSpeed:1400},rJ),r1=(0,E.tr)({deceleration:1e3,maxSpeed:360},rJ),r2=(0,E.tr)({deceleration:1e3,maxSpeed:90},rJ),r3=(0,E.tr)({deceleration:1e3,maxSpeed:360},rJ);var r5=class{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:S(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,n=S();for(;t.length>0&&n-t[0].time>160;)t.shift()}_getVelocityEntries(){let t=this._inertiaBuffer,n=S()-60,i=Math.max(0,t.length-2);for(;i>0&&t[i-1].time>=n;)i--;return t.slice(i)}_onMoveEnd(t){this._drainInertiaBuffer();let n=this._getVelocityEntries();if(n.length<2)return void this.clear();let i={zoom:0,bearing:0,pitch:0,roll:0,pan:new E.Ri(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of n)t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);for(let{settings:t}of n.slice(1))i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,i.roll+=t.rollDelta||0,t.panDelta&&i.pan._add(t.panDelta);if(!i.pan.mag()&&!i.zoom&&!i.bearing&&!i.pitch&&!i.roll)return void this.clear();let r=S()-n[0].time,o={};if(i.pan.mag()){let n=r6(i.pan.mag(),r,(0,E.tr)({},rQ,t||{})),a=i.pan.mult(n.amount/i.pan.mag()),s=this._map._camera.cameraHelper.handlePanInertia(a,this._map._camera.transform);o.center=s.easingCenter,o.offset=s.easingOffset,r4(o,n)}if(i.zoom){let t=r6(i.zoom,r,r0);o.zoom=(0,E.er)(this._map.getZoom()+t.amount,this._map.getZoomSnap(),t.amount),r4(o,t)}if(i.bearing){let t=r6(i.bearing,r,r1);o.bearing=this._map.getBearing()+(0,E.Vn)(t.amount,-179,179),r4(o,t)}if(i.pitch){let t=r6(i.pitch,r,r2);o.pitch=this._map.getPitch()+t.amount,r4(o,t)}if(i.roll){let t=r6(i.roll,r,r3);o.roll=this._map.getRoll()+(0,E.Vn)(t.amount,-179,179),r4(o,t)}if(o.zoom||o.bearing){let t=void 0===i.pinchAround?i.around:i.pinchAround;o.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),(0,E.tr)(o,{noMoveStart:!0})}};function r4(t,n){(!t.duration||t.duration<n.duration)&&(t.duration=n.duration,t.easing=n.easing)}function r6(t,n,i){let{maxSpeed:r,linearity:o,deceleration:a}=i,s=(0,E.Vn)(t*o/(n/1e3),-r,r),l=Math.abs(s)/(a*o);return{easing:i.easing,duration:1e3*l,amount:l/2*s}}var r8=class{constructor(t,n){this._map=t,this._clickTolerance=n.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new V(this._map,t))}mousedown(t,n){return this._mousedownPos=n,this._firePreventable(new U(t.type,this._map,t))}mouseup(t){this._map.fire(new U(t.type,this._map,t))}click(t,n){this._mousedownPos&&this._mousedownPos.dist(n)>=this._clickTolerance||this._map.fire(new U(t.type,this._map,t))}dblclick(t){return this._firePreventable(new U(t.type,this._map,t))}mouseover(t){this._map.fire(new U(t.type,this._map,t))}mouseout(t){this._map.fire(new U(t.type,this._map,t))}touchstart(t){return this._firePreventable(new j(t.type,this._map,t))}touchmove(t){this._map.fire(new j(t.type,this._map,t))}touchend(t){this._map.fire(new j(t.type,this._map,t))}touchcancel(t){this._map.fire(new j(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},r7=class{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new U(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new U("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new U(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}},r9=class{constructor(t,n,i){this._map=t,this._tr=i,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=n.clickTolerance||1,n.boxZoom&&"object"==typeof n.boxZoom&&(this._boxZoomEnd=n.boxZoom.boxZoomEnd)}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,n){this.isEnabled()&&t.shiftKey&&0===t.button&&(R.disableDrag(),this._startPos=this._lastPos=n,this._active=!0)}mousemoveWindow(t,n){if(!this._active||this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=n,this._box||(this._box=R.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let r=Math.min(i.x,n.x),o=Math.max(i.x,n.x),a=Math.min(i.y,n.y),s=Math.max(i.y,n.y);this._box.style.transform=`translate(${r}px,${a}px)`,this._box.style.width=`${o-r}px`,this._box.style.height=`${s-a}px`}mouseupWindow(t,n){if(!this._active||0!==t.button)return;let i=this._startPos;if(this.reset(),R.suppressClick(),i.x!==n.x||i.y!==n.y)return(this._map.fire(new $("boxzoomend",{originalEvent:t})),this._boxZoomEnd)?void this._boxZoomEnd(this._map,i,n,t):{cameraAnimation:t=>t.fitScreenCoordinates(i,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&=(this._box.remove(),null),R.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,n){return this._map.fire(new $(t,{originalEvent:n}))}};function oe(t,n){if(t.length!==n.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${n.length}`);let i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=n[r];return i}var ot=class{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,n,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){let n=new E.Ri(0,0);for(let i of t)n._add(i);return n.div(t.length)}(n),this.touches=oe(i,n)))}touchmove(t,n,i){if(this.aborted||!this.centroid)return;let r=oe(i,n);for(let t in this.touches){let n=this.touches[t],i=r[t];(!i||i.dist(n)>30)&&(this.aborted=!0)}}touchend(t,n,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){let t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}},on=class{constructor(t){this.singleTap=new ot(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,n,i){this.singleTap.touchstart(t,n,i)}touchmove(t,n,i){this.singleTap.touchmove(t,n,i)}touchend(t,n,i){let r=this.singleTap.touchend(t,n,i);if(r){let n=t.timeStamp-this.lastTime<500,i=!this.lastTap||30>this.lastTap.dist(r);if(n&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}},oi=class{constructor(t,n){this._tr=n,this._zoomIn=new on({numTouches:1,numTaps:2}),this._zoomOut=new on({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,n,i){this._zoomIn.touchstart(t,n,i),this._zoomOut.touchstart(t,n,i)}touchmove(t,n,i){this._zoomIn.touchmove(t,n,i),this._zoomOut.touchmove(t,n,i)}touchend(t,n,i){let r=this._zoomIn.touchend(t,n,i),o=this._zoomOut.touchend(t,n,i),a=this._tr;return r?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:(0,E.er)(a.zoom+1,n.getZoomSnap()),around:a.unproject(r)},{originalEvent:t})}):o?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:n=>n.easeTo({duration:300,zoom:(0,E.er)(a.zoom-1,n.getZoomSnap()),around:a.unproject(o)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},or=class{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){let n=this._moveFunction(...t);if(n.bearingDelta||n.pitchDelta||n.rollDelta||n.around||n.panDelta)return this._active=!0,n}dragStart(t,n){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=Array.isArray(n)?n[0]:n,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,n){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let r=Array.isArray(n)?n[0]:n;if(!(!this._moved&&r.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=r,this._move(i,r)}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&R.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}};let oo={0:1,2:2};var oa=class{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){this._eventButton=t.button}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){let n;return n=oo[this._eventButton],void 0!==t.buttons&&(t.buttons&n)===n}isValidEndEvent(t){return t.button===this._eventButton}},os=class{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}},ol=class{constructor(t=new oa({checkCorrectEvent:()=>!0}),n=new os){this.mouseMoveStateManager=t,this.oneFingerTouchMoveStateManager=n}_executeRelevantHandler(t,n,i){return t instanceof MouseEvent?n(t):"u">typeof TouchEvent&&t instanceof TouchEvent?i(t):void 0}startMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.startMove(t)},t=>{this.oneFingerTouchMoveStateManager.startMove(t)})}endMove(t){this._executeRelevantHandler(t,t=>{this.mouseMoveStateManager.endMove(t)},t=>{this.oneFingerTouchMoveStateManager.endMove(t)})}isValidStartEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidStartEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidStartEvent(t))}isValidMoveEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidMoveEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(t))}isValidEndEvent(t){return!!this._executeRelevantHandler(t,t=>this.mouseMoveStateManager.isValidEndEvent(t),t=>this.oneFingerTouchMoveStateManager.isValidEndEvent(t))}};let oc=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}};var od=class{constructor(t,n){this._clickTolerance=t.clickTolerance||1,this._map=n,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new E.Ri(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,n,i){return this._calculateTransform(t,n,i)}touchmove(t,n,i){if(this._active)return this._shouldBePrevented(i.length)?void this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t):(t.preventDefault(),this._calculateTransform(t,n,i))}touchend(t,n,i){this._calculateTransform(t,n,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,n,i){i.length>0&&(this._active=!0);let r=oe(i,n),o=new E.Ri(0,0),a=new E.Ri(0,0),s=0;for(let t in r){let n=r[t],i=this._touches[t];i&&(o._add(n),a._add(n.sub(i)),s++,r[t]=n)}if(this._touches=r,this._shouldBePrevented(s)||!a.mag())return;let l=a.div(s);if(this._sum._add(l),!(this._sum.mag()<this._clickTolerance))return{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},ou=class{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,n,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([n[0],n[1]]))}touchmove(t,n,i){if(!this._firstTwoTouches)return;t.preventDefault();let[r,o]=this._firstTwoTouches,a=oh(i,n,r),s=oh(i,n,o);if(!a||!s)return;let l=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],l,t)}touchend(t,n,i){if(!this._firstTwoTouches)return;let[r,o]=this._firstTwoTouches,a=oh(i,n,r),s=oh(i,n,o);a&&s||(this._active&&R.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}};function oh(t,n,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return n[r]}function om(t,n){return Math.log(t/n)/Math.LN2}var op=class extends ou{constructor(){super(),this._zoomRate=1,this._zoomThreshold=.1}setZoomRate(t){this._zoomRate=t??1}setZoomThreshold(t){this._zoomThreshold=t??.1}reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,n){let i=this._distance;if(this._distance=t[0].dist(t[1]),!(!this._active&&Math.abs(om(this._distance,this._startDistance))<this._zoomThreshold))return this._active=!0,{zoomDelta:om(this._distance,i)*this._zoomRate,pinchAround:n}}};function of(t,n){return 180*t.angleWith(n)/Math.PI}var ob=class extends ou{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,n,i){let r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:of(this._vector,r),pinchAround:n}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let n=25/(Math.PI*this._minDiameter)*360;return Math.abs(of(t,this._startVector))<n}};function og(t){return Math.abs(t.y)>Math.abs(t.x)}var o_=class extends ou{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,n,i){super.touchstart(t,n,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,og(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,n,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let r=t[0].sub(this._lastPoints[0]),o=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(r,o,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:-((r.y+o.y)/2*.5)}}gestureBeginsVertically(t,n,i){if(void 0!==this._valid)return this._valid;let r=t.mag()>=2,o=n.mag()>=2;if(!r&&!o)return;if(!r||!o)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let a=t.y>0==n.y>0;return og(t)&&og(n)&&a}};let oy=100,ov=15,ox=10;var oF=class{constructor(t,n){this._tr=n,this._panStep=oy,this._bearingStep=ov,this._pitchStep=ox,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let n=0,i=0,r=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:s=>{let l=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:ow,zoom:n?(0,E.er)(l.zoom+n*(t.shiftKey?2:1),s.getZoomSnap()):l.zoom,bearing:l.bearing+i*this._bearingStep,pitch:l.pitch+r*this._pitchStep,offset:[-o*this._panStep,-a*this._panStep],center:l.center},{originalEvent:t})}}}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 ow(t){return t*(2-t)}var oE=class{constructor(t,n,i){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=i,this._triggerRenderFrame=n,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let n=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=S(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==n&&n%4.000244140625==0?this._type="wheel":0!==n&&4>Math.abs(n)?this._type="trackpad":r>400?(this._type=null,this._lastValue=n,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(r*n)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,n+=this._lastValue)),t.shiftKey&&n&&(n/=4),this._type&&(this._lastWheelEvent=t,this._delta-=n,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._needsRerender=!1,this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let n=R.mousePos(this._map.getCanvas(),t),i=this._tr;this._aroundPoint=this._aroundCenter?i.transform.locationToScreenPoint(E.st.convert(i.center)):n,this._needsRerender||(this._needsRerender=!0,this._triggerRenderFrame())}renderFrame(){if(!this._needsRerender||(this._needsRerender=!1,!this.isActive()))return;let t=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let n=t.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=n),"number"==typeof this._targetZoom&&(this._targetZoom+=n)}if(0!==this._delta){let n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==i&&(i=1/i);let r="number"==typeof this._targetZoom?(0,E.Ir)(this._targetZoom):t.scale,o=t.applyConstrain(t.getCameraLngLat(),(0,E.Or)(r*i)).zoom,a=this._map.getZoomSnap();if("wheel"===this._type&&a>0){let n=(0,E.er)(t.zoom,a);this._targetZoom=(0,E.er)(o,a,o-n)}else this._targetZoom=o;"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let n="number"==typeof this._targetZoom?this._targetZoom:t.zoom,i=this._startZoom,r=this._easing,o=!1,a;if("wheel"===this._type&&i&&r){let t=Math.min((S()-this._lastWheelEventTime+5)/200,1),s=r(t);a=E.dn.number(i,n,s),t<1?this._needsRerender=!0:o=!0}else a=n,o=!0;return this._active=!0,o&&(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:!o,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let n=E.Yn;if(this._prevEase){let t=this._prevEase,i=(S()-t.start)/t.duration,r=t.easing(i+.01)-t.easing(i),o=.27/Math.sqrt(r*r+1e-4)*.01,a=Math.sqrt(.0729-o*o);n=(0,E.Bn)(o,a,.25,1)}return this._prevEase={start:S(),duration:t,easing:n},n}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}},oC=class{constructor(t,n){this._clickZoom=t,this._tapZoom=n}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()}},oA=class{constructor(t,n){this._tr=n,this.reset()}reset(){this._active=!1}dblclick(t,n){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:(0,E.er)(this._tr.zoom+(t.shiftKey?-1:1),i.getZoomSnap()),around:this._tr.unproject(n)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},ok=class{constructor(){this._tap=new on({numTouches:1,numTaps:1}),this._zoomRate=1,this.reset()}setZoomRate(t){this._zoomRate=t??1}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,n,i){if(!this._swipePoint)if(this._tapTime){let r=n[0],o=t.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(r);o&&a?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,n,i)}touchmove(t,n,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let r=n[0],o=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:o/128*this._zoomRate}}}else this._tap.touchmove(t,n,i)}touchend(t,n,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{let r=this._tap.touchend(t,n,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}},oT=class{constructor(t,n,i){this._el=t,this._mousePan=n,this._touchPan=i}enable(t){this._inertiaOptions=t||{},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()}},oS=class{constructor(t,n,i,r){this._pitchWithRotate=t.pitchWithRotate,this._rollEnabled=t.rollEnabled,this._mouseRotate=n,this._mousePitch=i,this._mouseRoll=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}},oI=class{constructor(t,n,i,r){this._el=t,this._touchZoom=n,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),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(t){this._touchZoom.setZoomRate(t),this._tapDragZoom.setZoomRate(t)}setZoomThreshold(t){this._touchZoom.setZoomThreshold(t)}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}},oD=class{constructor(t,n){this._bypassKey=navigator.userAgent.includes("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=n,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=R.create("div","maplibregl-cooperative-gesture-screen",t);let n=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(n=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=n,this._container.appendChild(r);let o=document.createElement("div");o.className="maplibregl-mobile-message",o.textContent=i,this._container.appendChild(o),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(t){return t[this._bypassKey]}notifyGestureBlocked(t,n){this._enabled&&(this._map.fire(new M("cooperativegestureprevented",{gestureType:t,originalEvent:n})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}},oP=class{constructor(t){this._camera=t}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(t){return this.transform.screenPointToLocation(E.Ri.convert(t),this._camera.terrain)}};let oR=t=>t.zoom||t.drag||t.roll||t.pitch||t.rotate;var oO=class extends E.vn{};function oM(t){return t.panDelta?.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta||t.rollDelta}var oL=class{get _ownerDocument(){return this._el?.ownerDocument||document}get _ownerWindow(){return this._el?.ownerDocument?.defaultView||window}constructor(t,n,i){this._terrainGestureAnchorElevation=null,this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,n)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let i="renderFrame"===t.type?void 0:t,r={needsRenderFrame:!1},o={},a={};for(let{handlerName:s,handler:l,allowed:c}of this._handlers){let d;if(l.isEnabled()){if(this._blockedByActive(a,c,s))l.reset();else if(l[n||t.type]){if((0,E.ur)(t,n||t.type)){let i=R.mousePos(this._map.getCanvas(),t);d=l[n||t.type](t,i)}else if((0,E.fr)(t,n||t.type)){let i=t.touches,r=this._getMapTouches(i),o=R.touchPos(this._map.getCanvas(),r);d=l[n||t.type](t,o,r)}else(0,E.pr)(n||t.type)||(d=l[n||t.type](t));this.mergeHandlerResult(r,o,d,s,i),d?.needsRenderFrame&&this._triggerRenderFrame()}(d||l.isActive())&&(a[s]=l)}}let s={};for(let t in this._previousActiveHandlers)a[t]||(s[t]=i);this._previousActiveHandlers=a,(Object.keys(s).length||oM(r))&&(this._changes.push([r,o,s]),this._triggerRenderFrame()),(Object.keys(a).length||oM(r))&&this._camera.stop(!0),this._updatingCamera=!1;let{cameraAnimation:l}=r;l&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],l(this._map))},this._map=t,this._camera=n,this._transformProvider=new oP(this._camera),this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new r5(t),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i);let r=this._el;for(let[t,n,i]of(this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[this._ownerDocument,"mousemove",{capture:!0}],[this._ownerDocument,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[this._ownerWindow,"blur",void 0]],this._listeners))t.addEventListener(n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(let[t,n,i]of this._listeners)t.removeEventListener(n,t===this._ownerDocument?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let n=this._map,i=n.getCanvasContainer();this._add("mapEvent",new r8(n,t));let r=n.boxZoom=new r9(n,t,this._transformProvider);this._add("boxZoom",r),t.interactive&&t.boxZoom&&r.enable();let o=n.cooperativeGestures=new oD(n,t.cooperativeGestures);this._add("cooperativeGestures",o),t.cooperativeGestures&&o.enable();let a=new oi(n,this._transformProvider),s=new oA(n,this._transformProvider);n.doubleClickZoom=new oC(s,a),this._add("tapZoom",a),this._add("clickZoom",s),t.interactive&&t.doubleClickZoom&&n.doubleClickZoom.enable();let l=new ok;this._add("tapDragZoom",l);let c=n.touchPitch=new o_(n);this._add("touchPitch",c),t.interactive&&t.touchPitch&&n.touchPitch.enable(t.touchPitch);let d=()=>n.project(n.getCenter()),u=function({enable:t,clickTolerance:n,aroundCenter:i=!0,minPixelCenterThreshold:r=100,rotateSpeed:o=.8},a){return new or({clickTolerance:n,move:(t,n)=>{let s=a();if(i&&Math.abs(s.y-t.y)>r)return{bearingDelta:(0,E.ar)(new E.Ri(t.x,n.y),n,s)};let l=(n.x-t.x)*o;return i&&n.y<s.y&&(l=-l),{bearingDelta:l}},moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button&&!t.ctrlKey}),enable:t,assignEvents:oc})}(t,d),h=function({enable:t,clickTolerance:n,pitchSpeed:i=-.5}){return new or({clickTolerance:n,move:(t,n)=>({pitchDelta:(n.y-t.y)*i}),moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&t.ctrlKey||2===t.button}),enable:t,assignEvents:oc})}(t),m=function({enable:t,clickTolerance:n,rollDegreesPerPixelMoved:i=.3},r){return new or({clickTolerance:n,move:(t,n)=>{let o=r(),a=(n.x-t.x)*i;return n.y<o.y&&(a=-a),{rollDelta:a}},moveStateManager:new oa({checkCorrectEvent:t=>2===t.button&&t.ctrlKey}),enable:t,assignEvents:oc})}(t,d);n.dragRotate=new oS(t,u,h,m),this._add("mouseRotate",u,["mousePitch"]),this._add("mousePitch",h,["mouseRotate","mouseRoll"]),this._add("mouseRoll",m,["mousePitch"]),t.interactive&&t.dragRotate&&n.dragRotate.enable();let p=function({enable:t,clickTolerance:n}){return new or({clickTolerance:n,move:(t,n)=>({around:n,panDelta:n.sub(t)}),activateOnStart:!0,moveStateManager:new oa({checkCorrectEvent:t=>0===t.button&&!t.ctrlKey}),enable:t,assignEvents:oc})}(t),f=new od(t,n);n.dragPan=new oT(i,p,f),this._add("mousePan",p),this._add("touchPan",f,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&n.dragPan.enable(t.dragPan);let b=new ob,g=new op;n.touchZoomRotate=new oI(i,g,b,l),this._add("touchRotate",b,["touchPan","touchZoom"]),this._add("touchZoom",g,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&n.touchZoomRotate.enable(t.touchZoomRotate),this._add("blockableMapEvent",new r7(n));let _=n.scrollZoom=new oE(n,()=>this._triggerRenderFrame(),this._transformProvider);this._add("scrollZoom",_,["mousePan"]),t.interactive&&t.scrollZoom&&n.scrollZoom.enable(t.scrollZoom);let y=n.keyboard=new oF(n,this._transformProvider);this._add("keyboard",y),t.interactive&&t.keyboard&&n.keyboard.enable()}_add(t,n,i){this._handlers.push({handlerName:t,handler:n,allowed:i}),this._handlersById[t]=n}stop(t){if(!this._updatingCamera){for(let{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(let{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!oR(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,n,i){for(let r in t)if(r!==i&&!n?.includes(r))return!0;return!1}_getMapTouches(t){let n=[];for(let i of t){let t=i.target;this._el.contains(t)&&n.push(i)}return n}mergeHandlerResult(t,n,i,r,o){if(!i)return;(0,E.tr)(t,i);let a={handlerName:r,originalEvent:i.originalEvent||o};void 0!==i.zoomDelta&&(n.zoom=a),void 0!==i.panDelta&&(n.drag=a),void 0!==i.rollDelta&&(n.roll=a),void 0!==i.pitchDelta&&(n.pitch=a),void 0!==i.bearingDelta&&(n.rotate=a)}_applyChanges(){let t={},n={},i={};for(let[r,o,a]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new E.Ri(0,0))._add(r.panDelta)),r.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+r.zoomDelta),r.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+r.bearingDelta),r.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+r.pitchDelta),r.rollDelta&&(t.rollDelta=(t.rollDelta||0)+r.rollDelta),void 0!==r.around&&(t.around=r.around),void 0!==r.pinchAround&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),(0,E.tr)(n,o),(0,E.tr)(i,a);this._updateMapTransform(t,n,i),this._changes=[]}_updateMapTransform(t,n,i){let r=this._map,o=this._camera.getTransformForUpdate(),a=r.terrain;if(!oM(t)&&!(a&&this._terrainMovement))return void this._fireEvents(n,i,!0);this._camera.stop(!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:d,rollDelta:u}=t,{around:h,aroundOnSurface:m}=this._resolveAround(t,a,o),p=a?this._terrainGestureElevation(a,h,m,o,n):void 0,f={panDelta:s,zoomDelta:l,rollDelta:u,pitchDelta:d,bearingDelta:c,around:h,aroundElevation:p};this._camera.cameraHelper.useGlobeControls&&!o.isPointOnMapSurface(h)&&(h=o.centerPoint);let b=this._computePreZoomAroundLoc(o,h,s,p);this._handleMapControls({terrain:a,tr:o,deltasForHelper:f,preZoomAroundLoc:b,combinedEventsInProgress:n,panDelta:s}),this._camera.applyUpdatedTransform(o),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(n,i,!0)}_resolveAround(t,n,i){let r=void 0===t.pinchAround?t.around:t.pinchAround;return r||=this._camera.transform.centerPoint,n&&!i.isPointOnMapSurface(r)?{around:i.centerPoint,aroundOnSurface:!1}:{around:r,aroundOnSurface:!0}}_terrainGestureElevation(t,n,i,r,o){if(!i)return;if(!this._terrainMovement&&(o.drag||o.zoom)){let i=r.screenTerrainPointToMercatorCoordinate(n,t);this._terrainGestureAnchorElevation=i?i.z:null}if(null===this._terrainGestureAnchorElevation)return;let a=this._terrainGestureAnchorElevation;if(!(.01>n.distSqr(r.centerPoint))&&!(a-r.elevation>=.9*(r.getCameraAltitude()-r.elevation)))return a}_computePreZoomAroundLoc(t,n,i,r){if(.01>n.distSqr(t.centerPoint))return t.center;let o=i?n.sub(i):n;return void 0===r?t.screenPointToLocation(o):t.screenPointToLocationAtElevation(o,r)}_handleMapControls({terrain:t,tr:n,deltasForHelper:i,preZoomAroundLoc:r,combinedEventsInProgress:o,panDelta:a}){let s=this._camera.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(i,n),!t)return void s.handleMapControlsPan(i,n,r);if(s.useGlobeControls){!this._terrainMovement&&(o.drag||o.zoom)&&(this._terrainMovement=!0,this._camera.elevationFreeze=!0),s.handleMapControlsPan(i,n,r);return}if(!this._terrainMovement&&(o.drag||o.zoom)){this._terrainMovement=!0,this._camera.elevationFreeze=!0,s.handleMapControlsPan(i,n,r);return}void 0===i.aroundElevation&&o.drag&&this._terrainMovement&&a?n.setCenter(n.screenPointToLocation(n.centerPoint.sub(a))):s.handleMapControlsPan(i,n,r)}_fireEvents(t,n,i){let r=oR(this._eventsInProgress),o=oR(t),a={};for(let n in t){let{originalEvent:i}=t[n];this._eventsInProgress[n]||(a[`${n}start`]=i),this._eventsInProgress[n]=t[n]}for(let t in!r&&o&&this._fireEvent("movestart",o.originalEvent),a)this._fireEvent(t,a[t]);for(let n in o&&this._fireEvent("move",o.originalEvent),t){let{originalEvent:i}=t[n];this._fireEvent(n,i)}let s={},l;for(let t in this._eventsInProgress){let{handlerName:i,originalEvent:r}=this._eventsInProgress[t];this._handlersById[i].isActive()||(delete this._eventsInProgress[t],l=n[i]||r,s[`${t}end`]=l)}for(let t in s)this._fireEvent(t,s[t]);let c=oR(this._eventsInProgress),d=(r||o)&&!c;if(d&&this._terrainMovement){this._camera.elevationFreeze=!1,this._terrainMovement=!1,this._terrainGestureAnchorElevation=null;let t=this._camera.getTransformForUpdate();this._map.getCenterClampedToGround()&&t.recalculateZoomAndCenter(this._map.terrain),this._camera.applyUpdatedTransform(t)}if(i&&d){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),n=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t&&(t.essential||!k.prefersReducedMotion)?(n(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new L("moveend",{originalEvent:l})),n(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,n){this._map.fire(new L(t,n?{originalEvent:n}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new oO("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}},oB=class extends E.yn{constructor(t){super(),this._renderFrameCallback=()=>{let t=Math.min((S()-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=new n_,this.cameraHelper=new nE,void 0!==t.minZoom&&this.transform.setMinZoom(t.minZoom),void 0!==t.maxZoom&&this.transform.setMaxZoom(t.maxZoom),void 0!==t.minPitch&&this.transform.setMinPitch(t.minPitch),void 0!==t.maxPitch&&this.transform.setMaxPitch(t.maxPitch),void 0!==t.renderWorldCopies&&this.transform.setRenderWorldCopies(t.renderWorldCopies),null!==t.transformConstrain&&this.transform.setConstrainOverride(t.transformConstrain),this._moving=!1,this._zooming=!1,this._bearingSnap=t.bearingSnap,this._zoomSnap=t.zoomSnap,this._requestRenderFrame=t.requestRenderFrame,this._cancelRenderFrame=t.cancelRenderFrame,this.terrain=t.terrain,this._centerClampedToGround=t.centerClampedToGround??!0,this.transformCameraUpdate=t.transformCameraUpdate??null,this._stopHandlers=t.stopHandlers??(()=>{}),this.on("moveend",()=>{delete this._requestedCameraState})}migrateProjection(t,n){t.apply(this.transform,!0),this.transform=t,this.cameraHelper=n}getCenter(){return new E.st(this.transform.center.lng,this.transform.center.lat)}setCenter(t,n){return this.jumpTo({center:t},n)}getCenterElevation(){return this.transform.elevation}setCenterElevation(t,n){return this.jumpTo({elevation:t},n),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(t){this._centerClampedToGround=t}panBy(t,n,i){return t=E.Ri.convert(t).mult(-1),this.panTo(this.transform.center,(0,E.tr)({offset:t},n),i)}panTo(t,n,i){return this.easeTo((0,E.tr)({center:t},n),i)}getZoom(){return this.transform.zoom}setZoom(t,n){return this.jumpTo({zoom:t},n),this}zoomTo(t,n,i){return this.easeTo((0,E.tr)({zoom:t},n),i)}zoomIn(t,n){return this.zoomTo((0,E.er)(this.getZoom()+1,this._zoomSnap),t,n),this}zoomOut(t,n){return this.zoomTo((0,E.er)(this.getZoom()-1,this._zoomSnap),t,n),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(t,n){return t!=this.transform.fov&&(this.transform.setFov(t),this.fire(new L("movestart",n)).fire(new L("move",n)).fire(new L("moveend",n))),this}getBearing(){return this.transform.bearing}setZoomSnap(t){return this._zoomSnap=t,this}getZoomSnap(){return this._zoomSnap}setBearing(t,n){return this.jumpTo({bearing:t},n),this}getPadding(){return this.transform.padding}setPadding(t,n){return this.jumpTo({padding:t},n),this}rotateTo(t,n,i){return this.easeTo((0,E.tr)({bearing:t},n),i)}resetNorth(t,n){return this.rotateTo(0,(0,E.tr)({duration:1e3},t),n),this}resetNorthPitch(t,n){return this.easeTo((0,E.tr)({bearing:0,pitch:0,roll:0,duration:1e3},t),n),this}snapToNorth(t,n){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,n):this}getPitch(){return this.transform.pitch}setPitch(t,n){return this.jumpTo({pitch:t},n),this}getRoll(){return this.transform.roll}setRoll(t,n){return this.jumpTo({roll:t},n),this}cameraForBounds(t,n){t=eL.convert(t).adjustAntiMeridian();let i=n?.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,n)}_cameraForBoxAndBearing(t,n,i,r){let o={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=(0,E.tr)({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){let t=r.padding;r.padding={top:t,bottom:t,right:t,left:t}}let a=(0,E.tr)(o,r.padding);r.padding=a;let s=this.transform,l=new eL(t,n),c=this.cameraHelper.cameraForBoxAndBearing(r,a,l,i,s);return c&&this._zoomSnap&&(c.zoom=(0,E.er)(c.zoom,this._zoomSnap,-1)),c}fitBounds(t,n,i){return this._fitInternal(this.cameraForBounds(t,n),n,i)}fitScreenCoordinates(t,n,i,r,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(E.Ri.convert(t)),this.transform.screenPointToLocation(E.Ri.convert(n)),i,r),r,o)}_fitInternal(t,n,i){return t?(n=(0,E.tr)(t,n),delete n.padding,n.linear?this.easeTo(n,i):this.flyTo(n,i)):this}jumpTo(t,n){this.stop(),"zoom"in t&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=!1,o=!1,a=!1,s=i.zoom;this.terrain&&i.setElevation(this.terrain.getElevationForLngLat(t.center?E.st.convert(t.center):i.center,i)),this.cameraHelper.handleJumpToCenterZoom(i,t);let l=i.zoom!==s;return"elevation"in t&&i.elevation!==+t.elevation&&i.setElevation(+t.elevation),"bearing"in t&&i.bearing!==+t.bearing&&(r=!0,i.setBearing(+t.bearing)),"pitch"in t&&i.pitch!==+t.pitch&&(o=!0,i.setPitch(+t.pitch)),"roll"in t&&i.roll!==+t.roll&&(a=!0,i.setRoll(+t.roll)),null==t.padding||i.isPaddingEqual(t.padding)||i.setPadding(t.padding),this.applyUpdatedTransform(i),this.fire(new L("movestart",n)).fire(new L("move",n)),l&&this.fire(new L("zoomstart",n)).fire(new L("zoom",n)).fire(new L("zoomend",n)),r&&this.fire(new L("rotatestart",n)).fire(new L("rotate",n)).fire(new L("rotateend",n)),o&&this.fire(new L("pitchstart",n)).fire(new L("pitch",n)).fire(new L("pitchend",n)),a&&this.fire(new L("rollstart",n)).fire(new L("roll",n)).fire(new L("rollend",n)),this.fire(new L("moveend",n))}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,i,r,o){let a=this.transform.calculateCenterFromCameraLngLatAlt(t,n,i,r);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:i,pitch:r,roll:o}}easeTo(t,n){this._stop(!1,t.easeId),"zoom"in(t=(0,E.tr)({offset:[0,0],duration:500,easing:E.Yn},t))&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap)),(!1===t.animate||!t.essential&&k.prefersReducedMotion)&&(t.duration=0);let i=this.getTransformForUpdate(),r=this.getBearing(),o=i.pitch,a=i.roll,s="bearing"in t?this._normalizeBearing(t.bearing,r):r,l="pitch"in t?+t.pitch:o,c="roll"in t?this._normalizeBearing(t.roll,a):a,d="padding"in t?t.padding:i.padding,u=E.Ri.convert(t.offset),h,m;t.around&&(h=E.st.convert(t.around),m=i.locationToScreenPoint(h));let p={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},f=this.cameraHelper.handleEaseTo(i,{bearing:s,pitch:l,roll:c,padding:d,around:h,aroundPoint:m,offsetAsPoint:u,offset:t.offset,zoom:t.zoom,center:t.center});return this._rotating||=r!==s,this._pitching||=l!==o,this._rolling||=c!==a,this._padding=!i.isPaddingEqual(d),this._zooming||=f.isZooming,this._easeId=t.easeId,this._prepareEase(n,t.noMoveStart,p),this.terrain&&this._prepareElevation(f.elevationCenter),this._ease(r=>{f.easeFunc(r),this.terrain&&!t.freezeElevation&&this._updateElevation(r),this.applyUpdatedTransform(i),this._fireMoveEvents(n)},i=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n,i)},t),this}_prepareEase(t,n,i={}){this._moving=!0,n||i.moving||this.fire(new L("movestart",t)),this._zooming&&!i.zooming&&this.fire(new L("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new L("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new L("pitchstart",t)),this._rolling&&!i.rolling&&this.fire(new L("rollstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLat(t,this.transform),this.elevationFreeze=!0}_updateElevation(t){(void 0===this._elevationStart||void 0===this._elevationCenter)&&this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let n=this.terrain.getElevationForLngLat(this._elevationCenter,this.transform);if(t<1&&n!==this._elevationTarget){let i=this._elevationTarget-this._elevationStart,r=(n-(i*t+this._elevationStart))/(1-t);this._elevationStart+=t*(i-r),this._elevationTarget=n}this.transform.setElevation(E.dn.number(this._elevationStart,this._elevationTarget,t))}_finalizeElevation(){this.elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||=this.transform.clone(),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){if(!this.terrain&&t.elevation>=0&&t.pitch<=90)return{};let n=t.getCameraLngLat(),i=t.getCameraAltitude(),r=this.terrain?this.terrain.getElevationForLngLatZoom(n,t.zoom):0;if(i<r){let i=t.calculateCameraOptionsFromTo(n,r,t.center,t.elevation);return{pitch:i.pitch,zoom:i.zoom}}return{}}applyUpdatedTransform(t){let n=[];if(n.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&n.push(t=>this.transformCameraUpdate(t)),!n.length)return;let i=t.clone();for(let t of n){let n=i.clone(),{center:r,zoom:o,roll:a,pitch:s,bearing:l,elevation:c}=t(n);r&&n.setCenter(r),void 0!==c&&n.setElevation(c),void 0!==o&&n.setZoom(o),void 0!==a&&n.setRoll(a),void 0!==s&&n.setPitch(s),void 0!==l&&n.setBearing(l),i.apply(n,!1)}this.transform.apply(i,!1)}_fireMoveEvents(t){this.fire(new L("move",t)),this._zooming&&this.fire(new L("zoom",t)),this._rotating&&this.fire(new L("rotate",t)),this._pitching&&this.fire(new L("pitch",t)),this._rolling&&this.fire(new L("roll",t))}_afterEase(t,n){if(this._easeId&&n&&this._easeId===n)return;delete this._easeId;let i=this._zooming,r=this._rotating,o=this._pitching,a=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,i&&this.fire(new L("zoomend",t)),r&&this.fire(new L("rotateend",t)),o&&this.fire(new L("pitchend",t)),a&&this.fire(new L("rollend",t)),this.fire(new L("moveend",t))}flyTo(t,n){if(!t.essential&&k.prefersReducedMotion){let i=(0,E.br)(t,["center","zoom","bearing","pitch","roll","elevation","padding"]);return this.jumpTo(i,n)}this.stop(),"zoom"in(t=(0,E.tr)({offset:[0,0],speed:1.2,curve:1.42,easing:E.Yn},t))&&this._zoomSnap&&(t.zoom=(0,E.er)(t.zoom,this._zoomSnap));let i=this.getTransformForUpdate(),r=i.bearing,o=i.pitch,a=i.roll,s=i.padding,l="bearing"in t?this._normalizeBearing(t.bearing,r):r,c="pitch"in t?+t.pitch:o,d="roll"in t?this._normalizeBearing(t.roll,a):a,u="padding"in t?t.padding:i.padding,h=E.Ri.convert(t.offset),m=i.centerPoint.add(h),p=i.screenPointToLocation(m),f=this.cameraHelper.handleFlyTo(i,{bearing:l,pitch:c,roll:d,padding:u,locationAtOffset:p,offsetAsPoint:h,center:t.center,minZoom:t.minZoom,zoom:t.zoom}),b=t.curve,g=Math.max(i.width,i.height),_=g/f.scaleOfZoom,y=f.pixelPathLength,v=g/f.scaleOfMinZoom,x=(b=Math.min(b,Math.sqrt(v/y*2)))*b;function F(t){let n=(_*_-g*g+(t?-1:1)*x*x*y*y)/(2*(t?_:g)*x*y);return Math.log(Math.sqrt(n*n+1)-n)}function w(t){return(Math.exp(t)-Math.exp(-t))/2}function C(t){return(Math.exp(t)+Math.exp(-t))/2}let A=F(!1),T=function(t){return C(A)/C(A+b*t)},S=function(t){var n;return g*((C(A)*(w(n=A+b*t)/C(n))-w(A))/x)/y},I=(F(!0)-A)/b;if(2e-6>Math.abs(y)||!isFinite(I)){if(1e-6>Math.abs(g-_))return this.easeTo(t,n);let i=_<g?-1:1;I=Math.abs(Math.log(_/g))/b,S=()=>0,T=t=>Math.exp(i*b*t)}if("duration"in t)t.duration=+t.duration;else{let n="screenSpeed"in t?t.screenSpeed/b:+t.speed;t.duration=1e3*I/n}return t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=r!==l,this._pitching=c!==o,this._rolling=d!==a,this._padding=!i.isPaddingEqual(u),this._prepareEase(n,!1),this.terrain&&this._prepareElevation(f.targetCenter),this._ease(p=>{let b=p*I,g=1/T(b),_=S(b);this._rotating&&i.setBearing(E.dn.number(r,l,p)),this._pitching&&i.setPitch(E.dn.number(o,c,p)),this._rolling&&i.setRoll(E.dn.number(a,d,p)),this._padding&&(i.interpolatePadding(s,u,p),m=i.centerPoint.add(h)),f.easeFunc(p,g,_,m),this.terrain&&!t.freezeElevation&&this._updateElevation(p),this.applyUpdatedTransform(i),this._fireMoveEvents(n)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(n)},t),this}isEasing(){return!!this._easeFrameId}stop(t){return this._stop(t)}_stop(t,n){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,n)}return t||this._stopHandlers(),this}_ease(t,n,i){!1===i.animate||0===i.duration?(t(1),n()):(this._easeStart=S(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=n,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,n){let i=Math.abs((t=(0,E.Fr)(t,-180,180))-n);return Math.abs(t-360-n)<i&&(t-=360),Math.abs(t+360-n)<i&&(t+=360),t}isMoving(){return this._moving}isZooming(){return this._zooming}isRotating(){return this._rotating}};let oz={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};var oN=class{constructor(t=oz){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&&("terrain"===t.type||"style"===t.dataType||"source"===t.dataType&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType))&&this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?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=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=R.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=R.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=R.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(t,n){let i=this._map._getUIString(`AttributionControl.${n}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"==typeof t?t:"")):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){let t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}let n=this._map.style.tileManagers;for(let i in n){let r=n[i];if(r.used||r.usedForTerrain){let n=r.getSource();n.attribution&&!t.includes(n.attribution)&&t.push(n.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,n)=>t.length-n.length);let i=(t=t.filter((n,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].includes(n))return!1;return!0})).join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=R.sanitize(i),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}},oU=class{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let n=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&n.classList.add("maplibregl-compact"):n.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options?.compact,this._container=R.create("div","maplibregl-ctrl");let n=R.create("a","maplibregl-ctrl-logo");return n.target="_blank",n.rel="noopener nofollow",n.href="https://maplibre.org/",n.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),n.setAttribute("rel","noopener nofollow"),this._container.appendChild(n),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}},oj=class{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let n=++this._id;return this._queue.push({callback:t,id:n,cancelled:!1}),n}remove(t){let n=this._currentlyRunning;for(let i of n?this._queue.concat(n):this._queue)if(i.id===t){i.cancelled=!0;return}}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let n=this._currentlyRunning=this._queue;this._queue=[];let i=!1,r;for(let o of n)if(!o.cancelled){try{o.callback(t)}catch(t){i||(i=!0,r=t)}if(this._cleared)break}if(this._cleared=!1,this._currentlyRunning=!1,i)throw r}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}},oV=class{constructor(t,n,i){this._tileKeys=t.map(t=>t.key).sort().join(),this._revision=n,this._zoom=i}equals(t){return this.equalsIgnoringZoom(t)&&this._zoom===t._zoom}equalsIgnoringZoom(t){return void 0!==t&&this._tileKeys===t._tileKeys&&this._revision===t._revision}};let o$={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};var oq=class{constructor(t,n){this.needsFollowUpFrame=!1,this.painter=t,this.terrain=n,this.rttSize=n.tileManager.tileSize*n.qualityFactor}getTexture(t){return t.getRTT(this._stacks.length-1).texture}prepareForRender(t,n){let i=n!==this._lastPrepareZoom;this._lastPrepareZoom=n,this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.tileManager.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(n));let r=new Set;for(let n of this._renderableLayerIds){let i=t._layers[n],o=i.source;o&&o$[i.type]&&r.add(o)}for(let i of(this._coordsAscending={},this._rttFingerprints={},r)){let r=t.tileManagers[i];if(!r)continue;this._coordsAscending[i]={};let o=this._coordsAscending[i],a=r.getSource(),s=a instanceof eJ?a.terrainTileRanges:null;for(let t of r.getVisibleCoordinates()){let n=this.terrain.tileManager.getTerrainCoords(t,s);for(let t in n)o[t]||=[],o[t].push(n[t])}this._rttFingerprints[i]={};let l=this._rttFingerprints[i],c=r.getState().revision;for(let t in o)l[t]=new oV(o[t],c,n)}for(let t of(this.needsFollowUpFrame=!1,this._renderableTiles))for(let n in this._rttFingerprints){let r=this._rttFingerprints[n][t.tileID.key],o=t.rttFingerprint[n];r&&!r.equals(o)&&(i&&r.equalsIgnoringZoom(o)?this.needsFollowUpFrame=!0:t.releaseRTT(this.painter))}}renderLayer(t,n){if(t.isHidden(this.painter.transform.zoom))return!1;let i={...n,isRenderingToTexture:!0},r=t.type,o=this.painter,a=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(o$[r]&&(this._prevType&&o$[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(t.id),!a))return!0;if(o$[this._prevType]||o$[r]&&a){this._prevType=r;let t=this._stacks.length-1,n=this._stacks[t]||[];for(let r of this._renderableTiles){if(this._rttTiles.push(r),r.getRTT(t))continue;let a=r.acquireRTT(o,t,this.rttSize);for(let t of(o.bindRTT(a),o.context.clear({color:E.pn.transparent,stencil:0}),o.currentStencilSource=void 0,n)){let n=o.style._layers[t],a=n.source?this._coordsAscending[n.source][r.tileID.key]:[r.tileID];o.context.viewport.set([0,0,this.rttSize,this.rttSize]),o.renderTileClippingMasks(n,a,!0),o.renderLayer(o,o.style.tileManagers[n.source],n,a,i),n.source&&(r.rttFingerprint[n.source]=this._rttFingerprints[n.source][r.tileID.key])}a.texture.generateMipmap()}return function(t,n,i,r){let{isRenderingGlobe:o}=r,a=t.context,s=a.gl,l=t.transform,c=t.colorModeForRenderPass(),d=t.getDepthModeFor3D(),u=t.useProgram("terrain");for(let r of(a.bindFramebuffer.set(null),a.viewport.set([0,0,t.width,t.height]),i)){let i=n.getTerrainMesh(r.tileID),h=t.renderToTexture.getTexture(r),m=n.getTerrainData(r.tileID);a.activeTexture.set(s.TEXTURE0),h.bind(s.LINEAR,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_LINEAR);let p=n3(n.getSkirtLength(l.zoom),l.calculateFogMatrix(r.tileID.toUnwrapped()),t.style.sky,l.pitch,o),f=l.getProjectionData({overscaledTileID:r.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});u.draw(a,s.TRIANGLES,d,rb.disabled,c,rg.backCCW,p,m,f,"terrain",i.vertexBuffer,i.indexBuffer,i.segments)}}(this.painter,this.terrain,this._rttTiles,i),this._rttTiles=[],o$[r]}return!1}};let oG={"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 ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},oH={hash:!1,interactive:!0,bearingSnap:7,zoomSnap:0,attributionControl:oz,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:E.jn.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,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0,terrainSkirtLength:"auto",zoomLevelsToOverscale:4,anisotropicFilterPitch:20};var oW=class extends E.yn{get _ownerWindow(){return this._container?.ownerDocument?.defaultView||window}constructor(t){super(),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new oj,this._controls=[],this._mapId=(0,E.Nr)(),this._styleUrl=null,this._missingStyleImageResolver=null,this._lostContextStyle={style:null,images:null},this._contextLost=t=>{if(t.preventDefault(),this._frameRequest&&=(this._frameRequest.abort(),null),this.painter.destroy(),this._lostContextStyle=this._getStyleAndImages(),!this.style)return void this.fire(new H("webglcontextlost",{originalEvent:t}));for(let t of Object.values(this.style._layers))if("custom"===t.type&&console.warn(`Custom layer with id '${t.id}' cannot be restored after WebGL context loss. You will need to re-add it manually after context restoration.`),t._listeners)for(let[n]of Object.entries(t._listeners))console.warn(`Custom layer with id '${t.id}' had event listeners for event '${n}' which cannot be restored after WebGL context loss. You will need to re-add them manually after context restoration.`);this.style.destroy(),this.style=null,this.fire(new H("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{if(this._lostContextStyle.style&&this.setStyle(this._lostContextStyle.style,{diff:!1}),this._lostContextStyle.images&&this.style)for(let t in this.style.imageManager.images=this._lostContextStyle.images,this._lostContextStyle.images){let n=this._lostContextStyle.images[t];n.isWebGLImage&&this.style.imageManager.updateImage(t,n,!1)}this._lostContextStyle={style:null,images:null};try{this._setupPainter()}catch(t){this.fire(new E._n(t));return}this.resize(),this._update(),this._resizeInternal(),this.fire(new H("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()};let n={...oH,...t,canvasContextAttributes:{...oH.canvasContextAttributes,...t.canvasContextAttributes}};if(null!=n.minZoom&&null!=n.maxZoom&&n.minZoom>n.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=n.minPitch&&null!=n.maxPitch&&n.minPitch>n.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=n.minPitch&&n.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=n.maxPitch&&n.maxPitch>180)throw Error("maxPitch must be less than or equal to 180");this._camera=new oB({minZoom:n.minZoom,maxZoom:n.maxZoom,minPitch:n.minPitch,maxPitch:n.maxPitch,bearingSnap:n.bearingSnap,zoomSnap:n.zoomSnap,renderWorldCopies:n.renderWorldCopies,centerClampedToGround:n.centerClampedToGround,terrain:this.terrain,transformConstrain:n.transformConstrain,requestRenderFrame:t=>this._requestRenderFrame(t),cancelRenderFrame:t=>this._cancelRenderFrame(t),transformCameraUpdate:n.transformCameraUpdate,stopHandlers:()=>this._handlers?.stop(!1)}),this._camera.setEventedParent(this),this._interactive=n.interactive,this._maxTileCacheSize=n.maxTileCacheSize,this._maxTileCacheZoomLevels=n.maxTileCacheZoomLevels,this._canvasContextAttributes={...n.canvasContextAttributes},this._trackResize=!0===n.trackResize,this._terrainSkirtLength=n.terrainSkirtLength,this._refreshExpiredTiles=!0===n.refreshExpiredTiles,this._fadeDuration=n.fadeDuration,this._crossSourceCollisions=!0===n.crossSourceCollisions,this._collectResourceTiming=!0===n.collectResourceTiming,this._locale={...oG,...n.locale},this._clickTolerance=n.clickTolerance,this._overridePixelRatio=n.pixelRatio,this._maxCanvasSize=n.maxCanvasSize,this._zoomLevelsToOverscale=n.zoomLevelsToOverscale,this.cancelPendingTileRequestsWhileZooming=!0===n.cancelPendingTileRequestsWhileZooming,this.setAnisotropicFilterPitch(n.anisotropicFilterPitch),void 0!==n.reduceMotion&&(k.prefersReducedMotion=n.reduceMotion),this._requestManager=new O(n.transformRequest),this._container=this._resolveContainer(n.container),n.maxBounds&&this.setMaxBounds(n.maxBounds),this._setupContainer();try{this._setupPainter()}catch(t){throw this._cleanupContainer(),t}this._imageQueueHandle=s.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.terrainFacilitator.depthDirty=!0,this._update(!0)}),this.once("idle",()=>this._idleTriggered=!0),this._handlers=new oL(this,this._camera,n),"u">typeof window&&(this._ownerWindow.addEventListener("online",this._onWindowOnline,!1),this._setupResizeObserver());let i="string"==typeof n.hash&&n.hash||void 0;this._hash=n.hash?new rK(i).addTo(this):void 0,this._hash?._onHashChange()||(this.jumpTo({center:n.center,elevation:n.elevation,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,roll:n.roll}),n.bounds&&(this.resize(),this.fitBounds(n.bounds,(0,E.tr)({},n.fitBoundsOptions,{duration:0}))));let r="string"==typeof n.style||n.style?.projection?.type!=="globe";this.resize(null,r),this._localIdeographFontFamily=n.localIdeographFontFamily,this._validateStyle=n.validateStyle,n.style&&this.setStyle(n.style,{localIdeographFontFamily:n.localIdeographFontFamily}),n.attributionControl&&this.addControl(new oN("boolean"==typeof n.attributionControl?void 0:n.attributionControl)),n.maplibreLogo&&this.addControl(new oU,n.logoPosition),this.on("style.load",()=>{if(r||this._resizeTransform(),this._camera.transform.unmodified){let t=(0,E.br)(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(t)}}),this.on("data",t=>{this._update("style"===t.dataType),this.fire("style"===t.dataType?new z("styledata",t):new N("sourcedata",t))}),this.on("dataloading",t=>{this.fire("style"===t.dataType?new z("styledataloading",t):new N("sourcedataloading",t))}),this.on("dataabort",t=>{this.fire(new N("sourcedataabort",t))})}_getMapId(){return this._mapId}setGlobalStateProperty(t,n){return this.style.setGlobalStateProperty(t,n),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(t,n){if(void 0===n&&(n=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t?.onAdd)return this.fire(new E._n(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let i=t.onAdd(this);this._controls.push(t);let r=this._controlPositions[n];return n.includes("bottom")?r.insertBefore(i,r.firstChild):r.appendChild(i),this}removeControl(t){if(!t?.onRemove)return this.fire(new E._n(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let n=this._controls.indexOf(t);return n>-1&&this._controls.splice(n,1),t.onRemove(this),this}hasControl(t){return this._controls.includes(t)}coveringTiles(t){return tl(this._camera.transform,t)}setTransformCameraUpdate(t){this._camera.transformCameraUpdate=t}getCenter(){return new E.st(this._camera.transform.center.lng,this._camera.transform.center.lat)}setCenter(t,n){return this._camera.setCenter(t,n),this}getCenterElevation(){return this._camera.transform.elevation}setCenterElevation(t,n){return this._camera.setCenterElevation(t,n),this}setCenterClampedToGround(t){this._camera.setCenterClampedToGround(t)}panBy(t,n,i){return this._camera.panBy(t,n,i),this}panTo(t,n,i){return this._camera.panTo(t,n,i),this}getZoom(){return this._camera.transform.zoom}setZoom(t,n){return this._camera.setZoom(t,n),this}zoomTo(t,n,i){return this._camera.zoomTo(t,n,i),this}zoomIn(t,n){return this._camera.zoomIn(t,n),this}zoomOut(t,n){return this._camera.zoomOut(t,n),this}getVerticalFieldOfView(){return this._camera.transform.fov}setVerticalFieldOfView(t,n){return this._camera.setVerticalFieldOfView(t,n),this}getBearing(){return this._camera.transform.bearing}setBearing(t,n){return this._camera.setBearing(t,n),this}getZoomSnap(){return this._camera.getZoomSnap()}setZoomSnap(t){return this._camera.setZoomSnap(t),this}getPadding(){return this._camera.transform.padding}setPadding(t,n){return this._camera.setPadding(t,n),this}rotateTo(t,n,i){return this._camera.rotateTo(t,n,i),this}resetNorth(t,n){return this._camera.resetNorth(t,n),this}resetNorthPitch(t,n){return this._camera.resetNorthPitch(t,n),this}snapToNorth(t,n){return this._camera.snapToNorth(t,n),this}getPitch(){return this._camera.transform.pitch}setPitch(t,n){return this._camera.setPitch(t,n),this}getRoll(){return this._camera.transform.roll}setRoll(t,n){return this._camera.setRoll(t,n),this}cameraForBounds(t,n){return this._camera.cameraForBounds(t,n)}fitBounds(t,n,i){return this._camera.fitBounds(t,n,i),this}fitScreenCoordinates(t,n,i,r,o){return this._camera.fitScreenCoordinates(t,n,i,r,o),this}jumpTo(t,n){return this._camera.jumpTo(t,n),this}calculateCameraOptionsFromCameraLngLatAltRotation(t,n,i,r,o){return this._camera.calculateCameraOptionsFromCameraLngLatAltRotation(t,n,i,r,o)}easeTo(t,n){return this._camera.easeTo(t,n),this}flyTo(t,n){return this._camera.flyTo(t,n),this}stop(){return this._camera.stop(),this}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLat(E.st.convert(t),this._camera.transform):null}getCenterClampedToGround(){return this._camera.getCenterClampedToGround()}calculateCameraOptionsFromTo(t,n,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLat(i,this._camera.transform)),this._camera.transform.calculateCameraOptionsFromTo(t,n,i,r??0)}resize(t,n=!0){if(null!==this._lostContextStyle.style)return this;this._resizeInternal(n);let i=!this._camera._moving;return i&&(this.stop(),this.fire(new L("movestart",t)).fire(new L("move",t))),this.fire(new M("resize",t)),i&&this.fire(new L("moveend",t)),this}_resizeInternal(t=!0){let[n,i]=this._containerDimensions(),r=this._getClampedPixelRatio(n,i);if(this._resizeCanvas(n,i,r),this.painter.resize(n,i,r),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let r=this._getClampedPixelRatio(n,i);this._resizeCanvas(n,i,r),this.painter.resize(n,i,r)}this._resizeTransform(t)}_resizeTransform(t=!0){let[n,i]=this._containerDimensions();this._camera.transform.resize(n,i,t),this._camera._requestedCameraState?.resize(n,i,t)}_getClampedPixelRatio(t,n){let{0:i,1:r}=this._maxCanvasSize,o=this.getPixelRatio(),a=t*o,s=n*o,l=Math.min(a>i?i/a:1,s>r?r/s:1);return l<1&&(0,E.Pr)("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."),l*o}getPixelRatio(){return this._overridePixelRatio??devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this._camera.transform.getBounds()}getMaxBounds(){return this._camera.transform.getMaxBounds()}setMaxBounds(t){return this._camera.transform.setMaxBounds(eL.convert(t)),this._update()}setMinZoom(t){if((t??=-2)>=-2&&t<=this._camera.transform.maxZoom){let n=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMinZoom(t),this._camera.applyUpdatedTransform(i),this._update(),n!==this._camera.transform.zoom&&this.fire(new L("zoomstart")).fire(new L("zoom")).fire(new L("zoomend")).fire(new L("movestart")).fire(new L("move")).fire(new L("moveend")),this}throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(t=!1){let n=this._camera.transform;return t?n.applyConstrain(n.center,n.minZoom).zoom:n.minZoom}setMaxZoom(t){if((t??=22)>=this._camera.transform.minZoom){let n=this._camera.transform.zoom,i=this._camera.getTransformForUpdate();return i.setMaxZoom(t),this._camera.applyUpdatedTransform(i),this._update(),n!==this._camera.transform.zoom&&this.fire(new L("zoomstart")).fire(new L("zoom")).fire(new L("zoomend")).fire(new L("movestart")).fire(new L("move")).fire(new L("moveend")),this}throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this._camera.transform.maxZoom}setMinPitch(t){if((t??=0)<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this._camera.transform.maxPitch){let n=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMinPitch(t),this._camera.applyUpdatedTransform(i),this._update(),n!==this._camera.transform.pitch&&this.fire(new L("pitchstart")).fire(new L("pitch")).fire(new L("pitchend")).fire(new L("movestart")).fire(new L("move")).fire(new L("moveend")),this}throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this._camera.transform.minPitch}setMaxPitch(t){if((t??=60)>180)throw Error("maxPitch must be less than or equal to 180");if(t>=this._camera.transform.minPitch){let n=this._camera.transform.pitch,i=this._camera.getTransformForUpdate();return i.setMaxPitch(t),this._camera.applyUpdatedTransform(i),this._update(),n!==this._camera.transform.pitch&&this.fire(new L("pitchstart")).fire(new L("pitch")).fire(new L("pitchend")).fire(new L("movestart")).fire(new L("move")).fire(new L("moveend")),this}throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this._camera.transform.maxPitch}getAnisotropicFilterPitch(){return this._anisotropicFilterPitch}setAnisotropicFilterPitch(t){if((t??=20)>180)throw Error("anisotropicFilterPitch must be less than or equal to 180");if(t<0)throw Error("anisotropicFilterPitch must be greater than or equal to 0");return this._anisotropicFilterPitch=t,this._update()}getRenderWorldCopies(){return this._camera.transform.renderWorldCopies}setRenderWorldCopies(t){return this._camera.transform.setRenderWorldCopies(t),this._update()}setTransformConstrain(t){return this._camera.transform.setConstrainOverride(t),this._update()}project(t){return this._camera.transform.locationToScreenPoint(E.st.convert(t),this.style&&this.terrain)}unproject(t){return this._camera.transform.screenPointToLocation(E.Ri.convert(t),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}_createDelegatedListener(t,n,i){if("mouseenter"===t||"mouseover"===t){let r=!1;return{layers:n,listener:i,delegates:{mousemove:o=>{let a=n.filter(t=>this.getLayer(t)),s=0===a.length?[]:this.queryRenderedFeatures(o.point,{layers:a});s.length?r||(r=!0,i.call(this,new U(t,this,o.originalEvent,{features:s}))):r=!1},mouseout:()=>{r=!1}}}}if("mouseleave"===t||"mouseout"===t){let r=!1;return{layers:n,listener:i,delegates:{mousemove:o=>{let a=n.filter(t=>this.getLayer(t));(0===a.length?[]:this.queryRenderedFeatures(o.point,{layers:a})).length?r=!0:r&&(r=!1,i.call(this,new U(t,this,o.originalEvent)))},mouseout:n=>{r&&(r=!1,i.call(this,new U(t,this,n.originalEvent)))}}}}{let r=t=>{let r=n.filter(t=>this.getLayer(t)),o=0===r.length?[]:this.queryRenderedFeatures(t.point,{layers:r});o.length&&(t.features=o,i.call(this,t),delete t.features)};return{layers:n,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,n){this._delegatedListeners||={},this._delegatedListeners[t]||=[],this._delegatedListeners[t].push(n)}_removeDelegatedListener(t,n,i){if(!this._delegatedListeners?.[t])return;let r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){let o=r[t];if(o.listener===i&&o.layers.length===n.length&&o.layers.every(t=>n.includes(t))){for(let t in o.delegates)this.off(t,o.delegates[t]);r.splice(t,1);return}}}on(t,n,i){if(void 0===i)return super.on(t,n);let r="string"==typeof n?[n]:n,o=this._createDelegatedListener(t,r,i);for(let n in this._saveDelegatedListener(t,o),o.delegates)this.on(n,o.delegates[n]);return{unsubscribe:()=>{this._removeDelegatedListener(t,r,i)}}}once(t,n,i){if(void 0===i)return super.once(t,n);let r="string"==typeof n?[n]:n,o=this._createDelegatedListener(t,r,i);for(let n in o.delegates){let a=o.delegates[n];o.delegates[n]=(...n)=>{this._removeDelegatedListener(t,r,i),a(...n)}}for(let n in this._saveDelegatedListener(t,o),o.delegates)this.once(n,o.delegates[n]);return this}off(t,n,i){if(void 0===i)return super.off(t,n);let r="string"==typeof n?[n]:n;return this._removeDelegatedListener(t,r,i),this}queryRenderedFeatures(t,n){if(!this.style)return[];let i,r=t instanceof E.Ri||Array.isArray(t),o=r?t:[[0,0],[this._camera.transform.width,this._camera.transform.height]];if(n||=(r?{}:t)||{},o instanceof E.Ri||"number"==typeof o[0])i=[E.Ri.convert(o)];else{let t=E.Ri.convert(o[0]),n=E.Ri.convert(o[1]);i=[t,new E.Ri(n.x,t.y),n,new E.Ri(t.x,n.y),t]}return this.style.queryRenderedFeatures(i,n,this._camera.transform)}querySourceFeatures(t,n){return this.style.querySourceFeatures(t,n)}setStyle(t,n){return n=(0,E.tr)({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},n),this._styleUrl="string"==typeof t?t:null,!1!==n.diff&&n.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,n),this):(this._localIdeographFontFamily=n.localIdeographFontFamily,this._updateStyle(t,n))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let n=this._locale[t];if(null==n)throw Error(`Missing UI string '${t}'`);return n}_updateStyle(t,n){if(this._diffStyleRequest?.abort(),this._diffStyleRequest=null,n.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,n));let i=this.style&&n.transformStyle?this.style.serialize():void 0;return(this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t)?(this.style=new n0(this,n||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,n,i):this.style.loadJSON(t,n,i)):(this._frameRequest&&=(this._frameRequest.abort(),null),this.style?.projection?.destroy(),delete this.style),this}_lazyInitEmptyStyle(){this.style||(this.style=new n0(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}async _diffStyle(t,n){if(this._diffStyleRequest?.abort(),"string"==typeof t){this._diffStyleRequest=new AbortController;let i=this._diffStyleRequest;try{let r=await this._requestManager.transformRequest(t,"Style");if(i.signal.aborted){this._diffStyleRequest=null;return}let o=await (0,E.Cn)(r,i);this._diffStyleRequest=null,this._updateDiff(o.data,n)}catch(t){this._diffStyleRequest=null,(0,E.Nn)(t)||this.fire(new E._n((0,E.$n)(t)))}}else"object"==typeof t&&(this._diffStyleRequest=null,this._updateDiff(t,n))}_updateDiff(t,n){try{this.style.setState(t,n)&&this._update(!0)}catch(i){(0,E.Pr)(`Unable to perform style diff: ${(0,E.$n)(i).message}. Rebuilding the style from scratch.`),this._updateStyle(t,n)}}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(){return this.style?this.style.loaded():void(0,E.Pr)("There is no style added to the map.")}addSource(t,n){return this._lazyInitEmptyStyle(),this.style.addSource(t,n),this._update(!0)}isSourceLoaded(t){let n=this.style?.tileManagers[t];return void 0===n?void this.fire(new E._n(Error(`There is no tile manager with ID '${t}'`))):n.loaded()}setTerrain(t,n={}){if(this.style._checkLoaded(),t&&(0,E.on)(this,E.sn.terrain,{value:t},n))return this;if(this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let n=this.style.tileManagers[t.source];if(!n)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let i in null===this.terrain&&n.reload(),this.style._layers){let n=this.style._layers[i];"hillshade"===n.type&&n.source===t.source&&(0,E.Pr)("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===n.type&&n.source===t.source&&(0,E.Pr)("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 nm(this.painter,n,t,this._terrainSkirtLength),this.painter.renderToTexture=new oq(this.painter,this.terrain),this._camera.terrain=this.terrain,this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform)),this._terrainDataCallback=n=>this._handleTerrainDataEvent(n,t.source),this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.destroy(),this.terrain=null,this.painter.renderToTexture=null,this._camera.terrain=null,this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0);return this.style.triggerSymbolPlacement(),this.fire(new q({terrain:t})),this}_handleTerrainDataEvent(t,n){if("style"===t.dataType)return void this.terrain.tileManager.releaseAllRTT();let i=t.sourceId===n;if(i&&(this.terrain.resetElevationCache(),this.style.triggerSymbolPlacement()),i&&t.tile&&!this._camera.elevationFreeze&&(this._camera.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._camera.transform.center,this._camera.transform.tileZoom)),this.getCenterClampedToGround()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))),t.tile){if(t.source?.type==="image")return void this.terrain.tileManager.releaseAllRTT();this.terrain.tileManager.releaseRTT(t.tile.tileID)}}getTerrain(){return this.terrain?.options??null}areTilesLoaded(){for(let t of Object.values(this.style?.tileManagers))if(!t.areTilesLoaded())return!1;return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style?.getSource(t)}setSourceTileLodParams(t,n,i){if(i){let r=this.getSource(i);if(!r)throw Error(`There is no source with ID "${i}", cannot set LOD parameters`);r.calculateTileZoom=to(Math.max(1,t),Math.max(1,n))}else for(let i in this.style.tileManagers)this.style.tileManagers[i].getSource().calculateTileZoom=to(Math.max(1,t),Math.max(1,n));return this._update(!0),this}refreshTiles(t,n){let i=this.style.tileManagers[t];if(!i)throw Error(`There is no tile manager with ID "${t}", cannot refresh tile`);void 0===n?i.reload(!0):i.refreshTiles(n.map(t=>new E.u(t.z,t.x,t.y)))}addImage(t,n,i={}){this._lazyInitEmptyStyle();let r=this._createStyleImage(n,i);return r&&(this.style.addImage(t,r),r.userImage?.onAdd&&r.userImage.onAdd(this,t)),this}setMissingStyleImageResolver(t){return this._missingStyleImageResolver=t,this.style?.setMissingImageResolver(t),this}_createStyleImage(t,n={}){let{pixelRatio:i=1,sdf:r=!1,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c}=n;if(t instanceof HTMLImageElement||(0,E.lr)(t)){let{width:n,height:d,data:u}=k.getImageData(t);return{data:new E.Tt({width:n,height:d},u),pixelRatio:i,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c,sdf:r,version:0}}if(void 0===t.width||void 0===t.height)return this.fire(new E._n(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:n,height:d,data:u}=t,h=(0,E.I)(t.data);return{data:h?new E.Tt({width:n,height:d}):new E.Tt({width:n,height:d},new Uint8Array(u)),pixelRatio:i,stretchX:o,stretchY:a,content:s,textFitWidth:l,textFitHeight:c,sdf:r,version:0,isWebGLImage:h,userImage:t}}}updateImage(t,n){let i=this.style.getImage(t);if(!i)return this.fire(new E._n(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:o,data:a}=n instanceof HTMLImageElement||(0,E.lr)(n)?k.getImageData(n):n;if(void 0===r||void 0===o)return this.fire(new E._n(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(r!==i.data.width||o!==i.data.height)return this.fire(new E._n(Error("The width and height of the updated image must be that same as the previous version of the image")));if(i.isWebGLImage=(0,E.I)(a),i.isWebGLImage)i.userImage=n;else{let t=!(n instanceof HTMLImageElement||(0,E.lr)(n));i.data.replace(a,t)}return this.style.updateImage(t,i),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new E._n(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}async loadImage(t){let n=await s.getImage(await this._requestManager.transformRequest(t,"Image"),new AbortController);if(!n.data)throw Error(`Could not load image ${t}: the response is empty`);return n}listImages(){return this.style?.listImages()??[]}addLayer(t,n){return this._lazyInitEmptyStyle(),this.style.addLayer(t,n),this._update(!0)}moveLayer(t,n){return this.style.moveLayer(t,n),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style?.getLayer(t)}getLayersOrder(){return this.style?.getLayersOrder()??[]}setLayerZoomRange(t,n,i){return this.style.setLayerZoomRange(t,n,i),this._update(!0)}setFilter(t,n,i={}){return this.style?.setFilter(t,n,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,n,i,r={}){return this.style?.setPaintProperty(t,n,i,r),this._update(!0)}getPaintProperty(t,n){return this.style.getPaintProperty(t,n)}setLayoutProperty(t,n,i,r={}){return this.style.setLayoutProperty(t,n,i,r),this._update(!0)}getLayoutProperty(t,n){return this.style.getLayoutProperty(t,n)}setGlyphs(t,n={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,n),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}setFontFaces(t){return this._lazyInitEmptyStyle(),this.style.setFontFaces(t),this._update(!0)}getFontFaces(){return this.style.getFontFaces()}addSprite(t,n,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,n,i,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,n={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,n,t=>{t||this._update(!0)}),this}setLight(t,n={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,n),this._update(!0)}getLight(){return this.style.getLight()}setSky(t,n={}){return this._lazyInitEmptyStyle(),this.style.setSky(t,n),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,n){return this.style.setFeatureState(t,n),this._update()}removeFeatureState(t,n){return this.style.removeFeatureState(t,n),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,n=0;return this._container&&(t=this._container.clientWidth||400,n=this._container.clientHeight||300),[t,n]}_setupResizeObserver(){let t=!1,n=rZ(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50),i=this._ownerWindow.ResizeObserver??ResizeObserver;this._resizeObserver=new i(i=>{if(!t){t=!0;return}n(i)}),this._resizeObserver.observe(this._container)}_resolveContainer(t){if("string"==typeof t){let n=document.getElementById(t);if(!n)throw Error(`Container '${t}' not found.`);return n}if(t instanceof HTMLElement||t&&"object"==typeof t&&1===t.nodeType)return t;throw Error("Invalid type: 'container' must be a String or HTMLElement.")}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let n=this._canvasContainer=R.create("div","maplibregl-canvas-container",t);this._interactive&&n.classList.add("maplibregl-interactive"),this._canvas=R.create("canvas","maplibregl-canvas",n),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");let i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);let o=this._controlContainer=R.create("div","maplibregl-control-container",t),a=this._controlPositions={};for(let t of["top-left","top-right","bottom-left","bottom-right"])a[t]=R.create("div",`maplibregl-ctrl-${t} `,o);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(t,n,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*n),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${n}px`}_setupPainter(){let t={...this._canvasContextAttributes,alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0},n=null;this._canvas.addEventListener("webglcontextcreationerror",t=>{n=t},{once:!0});let i=this._canvas.getContext("webgl2",t);if(!i)throw new rX(t,n);this.painter=new rY(i,this._camera.transform)}migrateProjection(t,n){this._camera.migrateProjection(t,n),this.painter.transform=t,this.fire(new G({newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style?._loaded&&(this._styleDirty||=t,this._sourcesDirty=!0,this.triggerRepaint()),this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){let n=this._idleTriggered?this._fadeDuration:0,i=this.style.projection?.transitionState>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let r=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this._camera.transform.zoom,i=S();this.style.zoomHistory.update(t,i);let o=new E.$t(t,{now:i,fadeDuration:n,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),a=o.crossFadingFactor();(1!==a||a!==this._crossFadingFactor)&&(r=!0,this._crossFadingFactor=a),this.style.update(o)}let o=this.style.projection?.transitionState>0!==i;this._camera.transform.setTransitionState(this.style.projection?.transitionState),this.style&&(this._sourcesDirty||o)&&(this._sourcesDirty=!1,this.style._updateSources(this._camera.transform)),this.terrain?(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()&&this._camera.transform.setElevation(this.terrain.getElevationForLngLat(this._camera.transform.center,this._camera.transform))):(this._camera.transform.setMinElevationForCurrentTile(0),this.getCenterClampedToGround()&&this._camera.transform.setElevation(0)),this._placementDirty=this.style?._updatePlacement(this._camera.transform,this.showCollisionBoxes,n,this._crossSourceCollisions,o),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:n,showPadding:this.showPadding,anisotropicFilterPitch:this.getAnisotropicFilterPitch()}),this.fire(new M("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new M("load"))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let a=this._sourcesDirty||this._styleDirty||this._placementDirty||this.painter.renderToTexture?.needsFollowUpFrame;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new M("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0),this}redraw(){return this.style&&(this._frameRequest&&=(this._frameRequest.abort(),null),this._render(0)),this}remove(){for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&=(this._frameRequest.abort(),null),this._renderTaskQueue.clear(),this._diffStyleRequest?.abort(),this.painter.destroy(),this._handlers.destroy(),this.setStyle(null),"u">typeof window&&this._ownerWindow.removeEventListener("online",this._onWindowOnline,!1),s.removeThrottleControl(this._imageQueueHandle),this._resizeObserver?.disconnect();let t=this.painter.context.gl.getExtension("WEBGL_lose_context");t?.loseContext&&t.loseContext(),this._cleanupContainer(),this._removed=!0,this.fire(new M("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,k.frame(this._frameRequest,t=>{this._frameRequest=null;try{this._render(t)}catch(t){if(!(0,E.Nn)(t))throw t}},()=>{},this._ownerWindow))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return C}getCameraTargetElevation(){return this._camera.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(t){return this._lazyInitEmptyStyle(),this.style.setProjection(t),this._update(!0)}};let oY={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};var oX=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),n=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom(!0);this._zoomInButton.disabled=n,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",n.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{let t=this._map.getPitch(),n=this._map.getRoll(),i=this._map.getBearing(),r=1/Math.cos((0,E.Xn)(t))**.5;if(this.options.visualizePitch&&this.options.visualizeRoll){this._compassIcon.style.transform=`scale(${r}) rotateZ(${-n}deg) rotateX(${t}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizePitch){this._compassIcon.style.transform=`scale(${r}) rotateX(${t}deg) rotateZ(${-i}deg)`;return}if(this.options.visualizeRoll){this._compassIcon.style.transform=`rotate(${-i-n}deg)`;return}this._compassIcon.style.transform=`rotate(${-i}deg)`},this._setButtonTitle=(t,n)=>{let i=this._map._getUIString(`NavigationControl.${n}`);t.title=i,t.setAttribute("aria-label",i)},this.options=(0,E.tr)({},oY,t),this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),R.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),R.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=R.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("move",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new oZ(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){this._container.remove(),this.options.showZoom&&this._map.off("move",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,n){let i=R.create("button",t,this._container);return i.type="button",i.addEventListener("click",n),i}},oZ=class{constructor(t,n,i=!1){this.mousedown=t=>{this.startMove(t,R.mousePos(this.element,t)),window.addEventListener("mousemove",this.mousemove),window.addEventListener("mouseup",this.mouseup)},this.mousemove=t=>{this.move(t,R.mousePos(this.element,t))},this.mouseup=t=>{this._rotatePitchHandler.dragEnd(t),this.offTemp()},this.touchstart=t=>{1===t.targetTouches.length?(this._startPos=this._lastPos=R.touchPos(this.element,t.targetTouches)[0],this.startMove(t,this._startPos),window.addEventListener("touchmove",this.touchmove,{passive:!1}),window.addEventListener("touchend",this.touchend)):this.reset()},this.touchmove=t=>{1===t.targetTouches.length?(this._lastPos=R.touchPos(this.element,t.targetTouches)[0],this.move(t,this._lastPos)):this.reset()},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=n;let r=new ol;this._rotatePitchHandler=new or({clickTolerance:3,move:(t,r)=>{let o=n.getBoundingClientRect(),a=new E.Ri((o.bottom-o.top)/2,(o.right-o.left)/2);return{bearingDelta:(0,E.ar)(new E.Ri(t.x,r.y),r,a),pitchDelta:i?-((r.y-t.y)*.5):void 0}},moveStateManager:r,enable:!0,assignEvents:()=>{}}),this.map=t,n.addEventListener("mousedown",this.mousedown),n.addEventListener("touchstart",this.touchstart,{passive:!1}),n.addEventListener("touchcancel",this.reset)}startMove(t,n){this._rotatePitchHandler.dragStart(t,n),R.disableDrag()}move(t,n){let i=this.map,{bearingDelta:r,pitchDelta:o}=this._rotatePitchHandler.dragMove(t,n)||{};r&&i.setBearing(i.getBearing()+r),o&&i.setPitch(i.getPitch()+o)}off(){let t=this.element;t.removeEventListener("mousedown",this.mousedown),t.removeEventListener("touchstart",this.touchstart),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend),t.removeEventListener("touchcancel",this.reset),this.offTemp()}offTemp(){R.enableDrag(),window.removeEventListener("mousemove",this.mousemove),window.removeEventListener("mouseup",this.mouseup),window.removeEventListener("touchmove",this.touchmove),window.removeEventListener("touchend",this.touchend)}};async function oK(t=!1){if(void 0!==p&&!t)return p;if(void 0===window.navigator.permissions)return p=!!window.navigator.geolocation;try{p="denied"!==(await window.navigator.permissions.query({name:"geolocation"})).state}catch{p=!!window.navigator.geolocation}return p}function oJ(t,n,i,r=!1){if(r||!i.getCoveringTilesDetailsProvider().allowWorldCopies())return t?.wrap();let o=new E.st(t.lng,t.lat);if(t=new E.st(t.lng,t.lat),n){let r=new E.st(t.lng-360,t.lat),o=new E.st(t.lng+360,t.lat),a=i.locationToScreenPoint(t).distSqr(n);i.locationToScreenPoint(r).distSqr(n)<a?t=r:i.locationToScreenPoint(o).distSqr(n)<a&&(t=o)}for(;Math.abs(t.lng-i.center.lng)>180;){let n=i.locationToScreenPoint(t);if(n.x>=0&&n.y>=0&&n.x<=i.width&&n.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t.lng!==o.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(t))?t:o}let oQ={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 o0(t,n,i){let r=t.classList;for(let t in oQ)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${n}`)}let o1={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},o2="#3FB1CE";function o3(t,n,i=[]){let r=R.createNS("http://www.w3.org/2000/svg",t);for(let t in n)r.setAttributeNS(null,t,n[t]);for(let t of i)r.appendChild(t);return r}var o5=class extends E.vn{},o4=class extends E.vn{},o6=class extends E.yn{constructor(t){if(super(),this._onClick=t=>{this.fire(new o4("click",{originalEvent:t}))},this._onKeyPress=t=>{("Space"===t.code||"Enter"===t.code)&&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 n=o1[t.key];if(!n)return;t.preventDefault(),t.stopPropagation();let i=t.shiftKey?10:1,r=this._map.project(this._lngLat);this.setLngLat(this._map.unproject(new E.Ri(r.x+n[0]*i,r.y+n[1]*i))),this._keyboardDragActive||(this._keyboardDragActive=!0,this.fire(new o5("dragstart"))),this.fire(new o5("drag"))},this._onKeyUp=t=>{o1[t.key]&&this._endKeyboardDrag()},this._onBlur=()=>{this._endKeyboardDrag()},this._onMapClick=t=>{let n=t.originalEvent.target,i=this._element;this._popup&&(n===i||i.contains(n))&&this.togglePopup()},this._update=t=>{if(!this._map)return;let n=this._map.loaded()&&!this._map.isMoving();t?.type!=="terrain"&&(t?.type!=="render"||n)||this._map.once("render",this._update),this._lngLat=oJ(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 i="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?i=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(i=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),this._element.style.transform=`${oQ[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${i}`,k.frameAsync(new AbortController,this._map._ownerWindow).then(()=>{this._updateOpacity(t?.type==="moveend")}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let n=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=n}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","pending"===this._state&&(this._state="active",this.fire(new o5("dragstart"))),this.fire(new o5("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),"active"===this._state&&this.fire(new o5("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=t?.anchor||"center",this._color=t?.color||o2,this._scale=t?.scale||1,this._draggable=t?.draggable||!1,this._clickTolerance=t?.clickTolerance||0,this._subpixelPositioning=t?.subpixelPositioning||!1,this._isDragging=!1,this._roleManaged=!1,this._tabIndexManaged=!1,this._keyboardDragActive=!1,this._state="inactive",this._rotation=t?.rotation||0,this._rotationAlignment=t?.rotationAlignment||"auto",this._pitchAlignment=t?.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(t?.opacity,t?.opacityWhenCovered),t?.element)this._element=t.element,this._offset=E.Ri.convert(t?.offset||[0,0]);else{this._defaultMarker=!0,this._element=R.create("div");let n=(f||(f=o3("svg",{display:"block",height:"41px",width:"27px",viewBox:"0 0 27 41"},[o3("g",{"fill-rule":"nonzero"},[o3("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(([t,n])=>o3("ellipse",{opacity:"0.04",cx:"10.5",cy:"5.80029008",rx:t,ry:n}))),o3("g",{fill:o2},[o3("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"})]),o3("g",{opacity:"0.25",fill:"#000000"},[o3("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"})]),o3("g",{transform:"translate(6.0, 7.0)",fill:"#FFFFFF"}),o3("g",{transform:"translate(8.0, 8.0)"},[o3("circle",{fill:"#000000",opacity:"0.25",cx:"5.5",cy:"5.5",r:"5.4999962"}),o3("circle",{fill:"#FFFFFF",cx:"5.5",cy:"5.5",r:"5.4999962"})])])]))).cloneNode(!0);n.setAttributeNS(null,"height",`${41*this._scale}px`),n.setAttributeNS(null,"width",`${27*this._scale}px`),(function(t){return t.firstElementChild.children[1]})(n).setAttributeNS(null,"fill",this._color),this._element.appendChild(n),this._offset=E.Ri.convert(t?.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),o0(this._element,this._anchor,"marker"),t?.className)for(let n of t.className.split(" "))this._element.classList.add(n);this._popup=null}addTo(t){return this.remove(),this._map=t,this._defaultMarker&&!this._element.hasAttribute("aria-label")&&this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),this._updateAccessibilityRole(),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),t.on("projectiontransition",this._update),this._element.addEventListener("click",this._onClick),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),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(t){return this._lngLat=E.st.convert(t),this._pos=null,this._update(),this._popup&&this._popup.setLngLat(this._lngLat),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress)),t){if(!("offset"in t.options)){let n=13.5/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[n,-((24.6+n)*1)],"bottom-right":[-n,-((24.6+n)*1)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._element.addEventListener("keypress",this._onKeyPress)}return this._updateTabIndex(),this._updateAccessibilityRole(),this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}_endKeyboardDrag(){this._keyboardDragActive&&(this._keyboardDragActive=!1,this.fire(new o5("dragend")))}getPopup(){return this._popup}togglePopup(){let t=this._popup;return this._element.style.opacity===this._opacityWhenCovered||t&&(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map))),this}_updateOpacity(t=!1){let n=this._map?.terrain,i=this._map._camera.transform.isLocationOccluded(this._lngLat);if(!n||i){let t=i?this._opacityWhenCovered:this._opacity;this._element.style.opacity!==t&&(this._element.style.opacity=t,this._element.classList.toggle("maplibregl-marker-covered",i));return}if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let r=this._map,o=r.terrain.depthAtPoint(this._pos),a=r.terrain.getElevationForLngLat(this._lngLat,r._camera.transform);if(r._camera.transform.lngLatToCameraDepth(this._lngLat,a)-o<.006){this._element.style.opacity=this._opacity,this._element.classList.remove("maplibregl-marker-covered");return}let s=-this._offset.y/r._camera.transform.pixelsPerMeter,l=Math.sin(r.getPitch()*Math.PI/180)*s,c=r.terrain.depthAtPoint(new E.Ri(this._pos.x,this._pos.y-this._offset.y)),d=r._camera.transform.lngLatToCameraDepth(this._lngLat,a+l)-c>.006;this._popup?.isOpen()&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity,this._element.classList.toggle("maplibregl-marker-covered",d)}getOffset(){return this._offset}setOffset(t){return this._offset=E.Ri.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._element.classList.toggle("maplibregl-marker-draggable",this._draggable),this._map&&(t?(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&&=("0"===this._element.getAttribute("tabindex")&&this._element.removeAttribute("tabindex"),!1)}_updateAccessibilityRole(){if(!this._defaultMarker||this._element.hasAttribute("role")&&!this._roleManaged)return;let t=this._draggable||this._popup?"button":"img";this._element.setAttribute("role",t),this._roleManaged=!0}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,n){return(void 0===this._opacity||void 0===t&&void 0===n)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=String(t)),void 0!==n&&(this._opacityWhenCovered=String(n)),this._map&&this._updateOpacity(!0),this}};let o8={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},o7=0,o9=!1;var ae=class extends E.vn{},at=class extends E.vn{},an=class extends E.vn{},ai=class extends E.yn{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t)){this._setErrorState(),this.fire(new at("outofmaxbounds",t)),this._updateMarker(),this._finish();return}if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new at("geolocate",t)),this._finish()}},this._updateCamera=t=>{let n=new E.st(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,r=this._map.getBearing(),o=(0,E.tr)({bearing:r},this.options.fitBoundsOptions),a=eL.fromLngLat(n,i);this._map.fitBounds(a,o,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let n=new E.st(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(n).addTo(this._map),this._userLocationDotMarker.setLngLat(n).addTo(this._map),this._accuracy=t.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=t=>{if(this._map){if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&o9)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new an("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._onMoveStart=t=>{if(!this._map)return;let n=t?.[0]instanceof ResizeObserverEntry;t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||n||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new ae("trackuserlocationend")),this.fire(new ae("userlocationlostfocus")))},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>{t.preventDefault()}),this._geolocateButton=R.create("button","maplibregl-ctrl-geolocate",this._container),R.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){(0,E.Pr)("Geolocation support is not available so the GeolocateControl will be disabled.");let t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{let t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=R.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new o6({element:this._dotElement}),this._circleElement=R.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new o6({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",this._onMoveStart)}},this.options=(0,E.tr)({},o8,t)}onAdd(t){return this._map=t,this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),oK().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),this._container.remove(),this._map.off("movestart",this._onMoveStart),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,o7=0,o9=!1}_isOutOfMapMaxBounds(t){let n=this._map.getMaxBounds(),i=t.coords;return n&&(i.longitude<n.getWest()||i.longitude>n.getEast()||i.latitude<n.getSouth()||i.latitude>n.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let t=this._userLocationDotMarker.getLngLat();if(!this.options.showUserLocation||!this.options.showAccuracyCircle||!this._accuracy||!t)return;let n=this._map.project(t),i=this._map.unproject([n.x+100,n.y]),r=t.distanceTo(i)/100,o=2*this._accuracy/r;this._circleElement.style.width=`${o.toFixed(2)}px`,this._circleElement.style.height=`${o.toFixed(2)}px`}trigger(){if(!this._setup)return(0,E.Pr)("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new ae("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":o7--,o9=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new ae("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new ae("trackuserlocationstart")),this.fire(new ae("userlocationfocus"));break;default:throw Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++o7>1?(t={maximumAge:6e5,timeout:0},o9=!0):(t=this.options.positionOptions,o9=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}};let ar={maxWidth:100,unit:"metric"};var ao=class{constructor(t){this._onMove=()=>{aa(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,aa(this._map,this._container,this.options)},this.options={...ar,...t}}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){this._container.remove(),this._map.off("move",this._onMove),this._map=void 0}};function aa(t,n,i){let r=i?.maxWidth||100,o=t._container.clientHeight/2,a=t._container.clientWidth/2,s=t.unproject([a-r/2,o]),l=t.unproject([a+r/2,o]),c=Math.min(r,Math.round(t.project(l).x-t.project(s).x),t._container.clientWidth),d=s.distanceTo(l);if(i?.unit==="imperial"){let i=3.2808*d;i>5280?as(n,c,i/5280,t._getUIString("ScaleControl.Miles")):as(n,c,i,t._getUIString("ScaleControl.Feet"))}else i?.unit==="nautical"?as(n,c,d/1852,t._getUIString("ScaleControl.NauticalMiles")):d>=1e3?as(n,c,d/1e3,t._getUIString("ScaleControl.Kilometers")):as(n,c,d,t._getUIString("ScaleControl.Meters"))}function as(t,n,i,r){var o,a;let s,l,c,d=(o=i,l=10**(`${Math.floor(o)}`.length-1),c=o/l,l*(c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:c>=1?1:(a=c,s=10**Math.ceil(-Math.log(a)/Math.LN10),Math.round(a*s)/s))),u=d/i;t.style.width=`${n*u}px`,t.innerHTML=`${d}&nbsp;${r}`}var al=class extends E.vn{},ac=class extends E.yn{constructor(t={}){super(),this._onFullscreenChange=()=>{let t=window.document.fullscreenElement||window.document.webkitFullscreenElement;for(;t?.shadowRoot?.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,this._pseudo=t.pseudo??!1,t?.container&&(t.container instanceof HTMLElement?this._container=t.container:(0,E.Pr)("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||=this._map.getContainer(),this._controlContainer=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){this._controlContainer.remove(),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=R.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);R.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new al("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new al("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){this._pseudo?this._togglePseudoFullScreen():window.document.exitFullscreen?window.document.exitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._pseudo?this._togglePseudoFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},ad=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=R.create("button","maplibregl-ctrl-terrain",this._container),R.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){this._container.remove(),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},au=class{constructor(){this._toggleProjection=()=>{let t=this._map.getProjection()?.type;"mercator"!==t&&t?this._map.setProjection({type:"mercator"}):this._map.setProjection({type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),this._map.getProjection()?.type==="globe"?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(t){return this._map=t,this._container=R.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=R.create("button","maplibregl-ctrl-globe",this._container),R.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._map.on("projectiontransition",this._updateGlobeIcon),this._container}onRemove(){this._container.remove(),this._map.off("styledata",this._updateGlobeIcon),this._map.off("projectiontransition",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}};let ah={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0,padding:void 0};var am=class extends E.vn{},ap=class extends E.yn{constructor(t){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._map._camera.transform.isLocationOccluded(this.getLngLat())?this._container.style.opacity=`${this.options.locationOccludedOpacity}`:this._container.style.opacity="")},this.remove=()=>(this._content&&this._content.remove(),this._container&&(this._container.remove(),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousemove",this._update),this._map.off("mouseup",this._update),this._map.off("drag",this._update),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new am("close"))),this),this._update=t=>{let n,i=this._lngLat||this._trackPointer;if(!this._map||!i||!this._content)return;if(!this._container){if(this._container=R.create("div","maplibregl-popup",this._map.getContainer()),this._tip=R.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=oJ(this._lngLat,this._flatPos,this._map._camera.transform,this._trackPointer),t&&"point"in t&&t.point&&(n=t.point),this._trackPointer&&!n)return;let r=this._flatPos=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&n?n:this._map._camera.transform.locationToScreenPoint(this._lngLat));let o=this.options.anchor,a=function t(n){if(!n)return t(new E.Ri(0,0));if("number"==typeof n){let t=Math.round(Math.abs(n)/Math.SQRT2);return{center:new E.Ri(0,0),top:new E.Ri(0,n),"top-left":new E.Ri(t,t),"top-right":new E.Ri(-t,t),bottom:new E.Ri(0,-n),"bottom-left":new E.Ri(t,-t),"bottom-right":new E.Ri(-t,-t),left:new E.Ri(n,0),right:new E.Ri(-n,0)}}if(n instanceof E.Ri||Array.isArray(n)){let t=E.Ri.convert(n);return{center:t,top:t,"top-left":t,"top-right":t,bottom:t,"bottom-left":t,"bottom-right":t,left:t,right:t}}return{center:E.Ri.convert(n.center||[0,0]),top:E.Ri.convert(n.top||[0,0]),"top-left":E.Ri.convert(n["top-left"]||[0,0]),"top-right":E.Ri.convert(n["top-right"]||[0,0]),bottom:E.Ri.convert(n.bottom||[0,0]),"bottom-left":E.Ri.convert(n["bottom-left"]||[0,0]),"bottom-right":E.Ri.convert(n["bottom-right"]||[0,0]),left:E.Ri.convert(n.left||[0,0]),right:E.Ri.convert(n.right||[0,0])}}(this.options.offset);if(!o){var s;let t=this._container.offsetWidth,n=this._container.offsetHeight,i=(s=this.options.padding)?{top:s.top??0,right:s.right??0,bottom:s.bottom??0,left:s.left??0}:{top:0,right:0,bottom:0,left:0},l;l=r.y+a.bottom.y<n+i.top?["top"]:r.y>this._map._camera.transform.height-n-i.bottom?["bottom"]:[],r.x<t/2+i.left?l.push("left"):r.x>this._map._camera.transform.width-t/2-i.right&&l.push("right"),o=0===l.length?"bottom":l.join("-")}let l=r.add(a[o]);this.options.subpixelPositioning||(l=l.round()),this._container.style.transform=`${oQ[o]} translate(${l.x}px,${l.y}px)`,o0(this._container,o,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=(0,E.tr)(Object.create(ah),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._map.on("terrain",this._update),this._map.on("projectiontransition",this._update),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._update),this._map.on("mouseup",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new am("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=E.st.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._update),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._update),this._map.on("drag",this._update),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let n=document.createDocumentFragment(),i=document.createElement("body"),r;for(i.innerHTML=t;r=i.firstChild;)n.appendChild(r);return this.setDOMContent(n)}getMaxWidth(){return this._container?.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=R.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}setPadding(t){this.options.padding=t,this._update()}_createCloseButton(){this.options.closeButton&&(this._closeButton=R.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let t=this._container.querySelector("a[href], [tabindex]:not([tabindex='-1']), [contenteditable]:not([contenteditable='false']), button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])");t&&t.focus()}};function af(t,n){return e7().setRTLTextPlugin(t,n)}function ab(){return e7().getRTLTextPluginStatus()}function ag(){return C}function a_(){return eA.workerCount}function ay(t){eA.workerCount=t}function av(){return E.jn.MAX_PARALLEL_IMAGE_REQUESTS}function ax(t){E.jn.MAX_PARALLEL_IMAGE_REQUESTS=t}function aF(){return E.jn.WORKER_URL}function aw(t){E.jn.WORKER_URL=t}async function aE(t){await eP().broadcast("IS",t)}i.d(n,{AJAXError:()=>E.bn,AttributionControl:()=>oN,BoxZoomHandler:()=>r9,CanvasSource:()=>e1,CooperativeGesturesHandler:()=>oD,DoubleClickZoomHandler:()=>oC,DragPanHandler:()=>oT,DragRotateHandler:()=>oS,EXTENT:()=>8192,EdgeInsets:()=>no,ErrorEvent:()=>E._n,Event:()=>E.vn,Evented:()=>E.yn,FullscreenControl:()=>ac,FullscreenEvent:()=>al,GPUInitializationError:()=>rX,GeoJSONSource:()=>eG,GeolocateControl:()=>ai,GeolocateErrorEvent:()=>an,GeolocateEvent:()=>ae,GeolocatePositionEvent:()=>at,GlobeControl:()=>au,Hash:()=>rK,ImageSource:()=>eJ,KeyboardHandler:()=>oF,LngLat:()=>E.st,LngLatBounds:()=>eL,LogoControl:()=>oU,Map:()=>oW,MapBoxZoomEvent:()=>$,MapContextEvent:()=>H,MapLibreEvent:()=>M,MapLibreMap:()=>oW,MapMouseEvent:()=>U,MapMovementEvent:()=>L,MapProjectionEvent:()=>G,MapSourceDataEvent:()=>N,MapStyleDataEvent:()=>z,MapStyleImageMissingEvent:()=>W,MapStyleLoadEvent:()=>B,MapTerrainEvent:()=>q,MapTouchEvent:()=>j,MapWheelEvent:()=>V,Marker:()=>o6,MarkerClickEvent:()=>o4,MarkerDragEvent:()=>o5,MercatorCoordinate:()=>E.et,NavigationControl:()=>oX,Point:()=>E.Ri,Popup:()=>ap,PopupEvent:()=>am,RasterDEMTileSource:()=>eU,RasterTileSource:()=>eN,ScaleControl:()=>ao,ScrollZoomHandler:()=>oE,Style:()=>n0,TerrainControl:()=>ad,TwoFingersTouchPitchHandler:()=>o_,TwoFingersTouchRotateHandler:()=>ob,TwoFingersTouchZoomHandler:()=>op,TwoFingersTouchZoomRotateHandler:()=>oI,VectorTileSource:()=>ez,VideoSource:()=>e0,addProtocol:()=>E.On,clearPrewarmedResources:()=>eI,config:()=>E.jn,createTileMesh:()=>eK,getGlobalDispatcher:()=>eP,getMaxParallelImageRequests:()=>av,getRTLTextPluginStatus:()=>ab,getVersion:()=>ag,getWorkerCount:()=>a_,getWorkerUrl:()=>aF,importScriptInWorkers:()=>aE,isTimeFrozen:()=>P,now:()=>S,prewarm:()=>eS,removeProtocol:()=>E.An,restoreNow:()=>D,setMaxParallelImageRequests:()=>ax,setNow:()=>I,setRTLTextPlugin:()=>af,setWorkerCount:()=>ay,setWorkerUrl:()=>aw},{addSourceType:e5})}},n={};function i(r){var o=n[r];if(void 0!==o)return o.exports;var a=n[r]={exports:{}};return t[r].call(a.exports,a,a.exports,i),a.exports}i.n=t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return i.d(n,{a:n}),n},i.d=(t,n,r)=>{var o=(n,r)=>{for(var o in n)i.o(n,o)&&!i.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,[r]:n[o]})};o(n,"get"),o(r,"value")},i.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),i.o=(t,n)=>Object.prototype.hasOwnProperty.call(t,n),i.r=t=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var r={};(()=>{"use strict";let t,n,o,a,s,l,c,d,u;i.r(r),i.d(r,{DefaultConfig:()=>f0,LngLat:()=>sG.st,OrClusterMarker:()=>fa,OrMap:()=>f7,OrMapAssetCard:()=>f1,OrMapAssetCardLoadAssetEvent:()=>fQ,OrMapClickedEvent:()=>f5,OrMapGeocoder:()=>p9,OrMapGeocoderChangeEvent:()=>p7,OrMapGeocoderControl:()=>fe,OrMapLegend:()=>fS,OrMapLegendControl:()=>fI,OrMapLegendEvent:()=>fT,OrMapLoadedEvent:()=>f3,OrMapLongPressEvent:()=>f4,OrMapMarker:()=>sQ,OrMapMarkerAsset:()=>lt,OrMapMarkerChangedEvent:()=>sK,OrMapMarkerClickedEvent:()=>sJ,OrMapMarkersChangedEvent:()=>f6,OrMapPresetFilter:()=>fW,OrMapPresetFilterControl:()=>fY,OrMapPresetFilterEvent:()=>fH,Util:()=>tW,geoJsonPointInputTemplateProvider:()=>f8,getMarkerConfigAttributeName:()=>le,getMarkerConfigForAssetType:()=>s9});var h,m,p,f,b,g,_,y,v,x,F,w,E,C,A,k,T,S,I,D,P,R,O,M,L,B,z,N,U,j,V,$,q,G,H,W,Y,X,Z,K,J,Q,ee,et,en,ei,er,eo,ea,es,el,ec,ed,eu,eh,em,ep,ef,eb,eg,e_,ey,ev,ex,eF,ew,eE,eC,eA,ek,eT,eS,eI,eD,eP,eR,eO,eM,eL,eB,ez,eN,eU,ej,eV,e$,eq,eG,eH,eW,eY,eX,eZ,eK,eJ,eQ,e0,e1,e2,e3,e5,e4,e6,e8,e7,e9,te,tt,tn,ti,tr,to,ta,ts,tl,tc,td,tu,th,tm,tp,tf,tb,tg,t_,ty,tv,tx,tF,tw,tE,tC,tA,tk,tT,tS,tI,tD,tP,tR,tO,tM,tL,tB,tz,tN,tU,tj,tV,t$,tq,tG,tH={};i.r(tH),i.d(tH,{hasBrowserEnv:()=>rs,hasStandardBrowserEnv:()=>rc,hasStandardBrowserWebWorkerEnv:()=>rd,navigator:()=>rl,origin:()=>ru});var tW={};i.r(tW),i.d(tW,{formatCount:()=>s1,getGeoJSONPoint:()=>s5,getLngLat:()=>s3,getLngLatBounds:()=>s4,getMarkerIconAndColorFromAssetType:()=>s6,isAssetWithLocation:()=>s8,metersToPixelsAtMaxZoom:()=>s2}),i(4532),(b=eO||(eO={})).CREATE="CREATE",b.UPDATE="UPDATE",b.DELETE="DELETE",(g=eM||(eM={})).LOW="LOW",g.MEDIUM="MEDIUM",g.HIGH="HIGH",(_=eL||(eL={})).MANUAL="MANUAL",_.CLIENT="CLIENT",_.GLOBAL_RULESET="GLOBAL_RULESET",_.REALM_RULESET="REALM_RULESET",_.ASSET_RULESET="ASSET_RULESET",_.AGENT="AGENT",(y=eB||(eB={})).OPEN="OPEN",y.ACKNOWLEDGED="ACKNOWLEDGED",y.IN_PROGRESS="IN_PROGRESS",y.RESOLVED="RESOLVED",y.CLOSED="CLOSED",(v=ez||(ez={})).BOTTOM_LEFT="BOTTOM_LEFT",v.BOTTOM_RIGHT="BOTTOM_RIGHT",v.TOP_LEFT="TOP_LEFT",v.TOP_RIGHT="TOP_RIGHT",(x=eN||(eN={})).CREATE="CREATE",x.READ="READ",x.UPDATE="UPDATE",x.DELETE="DELETE",(F=eU||(eU={})).NONE="NONE",F.FORECAST="FORECAST",F.SETPOINT="SETPOINT",(w=ej||(ej={})).DISCONNECTED="DISCONNECTED",w.CONNECTING="CONNECTING",w.DISCONNECTING="DISCONNECTING",w.CONNECTED="CONNECTED",w.DISABLED="DISABLED",w.WAITING="WAITING",w.ERROR="ERROR",w.STOPPED="STOPPED",(E=eV||(eV={})).REQUEST_START="REQUEST_START",E.REQUEST_REPEATING="REQUEST_REPEATING",E.REQUEST_CANCEL="REQUEST_CANCEL",E.READY="READY",E.COMPLETED="COMPLETED",E.RUNNING="RUNNING",E.CANCELLED="CANCELLED",(C=e$||(e$={})).TOGGLE="TOGGLE",C.INCREMENT="INCREMENT",C.DECREMENT="DECREMENT",C.NEGATE="NEGATE",(A=eq||(eq={})).ASSET_NOT_FOUND="ASSET_NOT_FOUND",A.ATTRIBUTE_NOT_FOUND="ATTRIBUTE_NOT_FOUND",A.INSUFFICIENT_ACCESS="INSUFFICIENT_ACCESS",A.INVALID_VALUE="INVALID_VALUE",A.INTERCEPTOR_FAILURE="INTERCEPTOR_FAILURE",A.STATE_STORAGE_FAILED="STATE_STORAGE_FAILED",A.CANNOT_PROCESS="CANNOT_PROCESS",A.QUEUE_FULL="QUEUE_FULL",A.UNKNOWN="UNKNOWN",A.ASSET_ID_MISSING="ASSET_ID_MISSING",A.ATTRIBUTE_NAME_MISSING="ATTRIBUTE_NAME_MISSING",(k=eG||(eG={})).PUBLIC="PUBLIC",k.SHARED="SHARED",k.PRIVATE="PRIVATE",(T=eH||(eH={})).OFF="OFF",T.ONE_MIN="ONE_MIN",T.FIVE_MIN="FIVE_MIN",T.QUARTER="QUARTER",T.ONE_HOUR="ONE_HOUR",(S=eW||(eW={})).WRAP_TO_SINGLE_COLUMN="WRAP_TO_SINGLE_COLUMN",S.KEEP_LAYOUT="KEEP_LAYOUT",S.REDIRECT="REDIRECT",S.BLOCK_DEVICE="BLOCK_DEVICE",(I=eY||(eY={})).CSV="CSV",I.CSV_CROSSTAB="CSV_CROSSTAB",I.CSV_CROSSTAB_MINUTE="CSV_CROSSTAB_MINUTE",(D=eX||(eX={})).MINUTE="MINUTE",D.HOUR="HOUR",D.DAY="DAY",D.WEEK="WEEK",D.MONTH="MONTH",D.YEAR="YEAR",(P=eZ||(eZ={})).MIN="MIN",P.AVG="AVG",P.MAX="MAX",P.DIFFERENCE="DIFFERENCE",P.COUNT="COUNT",P.SUM="SUM",P.MODE="MODE",P.MEDIAN="MEDIAN",(R=eK||(eK={})).TERMINATING="TERMINATING",R.DISABLED="DISABLED",R.ALREADY_CONNECTED="ALREADY_CONNECTED",R.UNRECOGNISED="UNRECOGNISED",R.PERMANENT_ERROR="PERMANENT_ERROR",R.SYNC_ERROR="SYNC_ERROR",(O=eJ||(eJ={})).HTTPS="HTTPS",O.HTTP="HTTP",O.TCP="TCP",(M=eQ||(eQ={})).GET="GET",M.POST="POST",M.PUT="PUT",M.DELETE="DELETE",M.OPTIONS="OPTIONS",M.PATCH="PATCH",(L=e0||(e0={})).KEYCLOAK="KEYCLOAK",L.NONE="NONE",(B=e1||(e1={})).WEBSOCKET="WEBSOCKET",B.POLLING="POLLING",(z=e2||(e2={})).INTERNAL="INTERNAL",z.CLIENT="CLIENT",z.GLOBAL_RULESET="GLOBAL_RULESET",z.REALM_RULESET="REALM_RULESET",z.ASSET_RULESET="ASSET_RULESET",(N=e3||(e3={})).REALM="REALM",N.USER="USER",N.ASSET="ASSET",N.CUSTOM="CUSTOM",(U=e5||(e5={})).NORMAL="NORMAL",U.HIGH="HIGH",(j=e4||(e4={})).DEVICE="DEVICE",j.TOPIC="TOPIC",j.CONDITION="CONDITION",(V=e6||(e6={})).ALWAYS="ALWAYS",V.ONCE="ONCE",V.HOURLY="HOURLY",V.DAILY="DAILY",V.WEEKLY="WEEKLY",V.MONTHLY="MONTHLY",V.ANNUALLY="ANNUALLY",($=e8||(e8={})).TITLE="TITLE",$.SOURCE="SOURCE",$.STATUS="STATUS",$.SENT_ON="SENT_ON",$.DELIVERED_ON="DELIVERED_ON",(q=e7||(e7={})).MESSAGE_INVALID="MESSAGE_INVALID",q.CERTIFICATE_INVALID="CERTIFICATE_INVALID",q.UNAUTHORIZED="UNAUTHORIZED",q.FORBIDDEN="FORBIDDEN",q.UNIQUE_ID_MISMATCH="UNIQUE_ID_MISMATCH",q.CONFIG_DISABLED="CONFIG_DISABLED",q.USER_DISABLED="USER_DISABLED",q.SERVER_ERROR="SERVER_ERROR",q.ASSET_ERROR="ASSET_ERROR",q.SERVER_BUSY="SERVER_BUSY",(G=e9||(e9={})).PRIVATE="PRIVATE",G.PROTECTED="PROTECTED",G.PUBLIC="PUBLIC",(H=te||(te={})).EXACT="EXACT",H.BEGIN="BEGIN",H.END="END",H.CONTAINS="CONTAINS",(W=tt||(tt={})).EQUALS="EQUALS",W.GREATER_THAN="GREATER_THAN",W.GREATER_EQUALS="GREATER_EQUALS",W.LESS_THAN="LESS_THAN",W.LESS_EQUALS="LESS_EQUALS",W.BETWEEN="BETWEEN",(Y=tn||(tn={})).CREATED_ON="CREATED_ON",Y.NAME="NAME",Y.ASSET_TYPE="ASSET_TYPE",Y.PARENT_ID="PARENT_ID",Y.REALM="REALM",(X=ti||(ti={})).RESTRICTED="RESTRICTED",X.LINKED="LINKED",X.REALM="REALM",(Z=tr||(tr={})).AT_LEAST_ONE="AT_LEAST_ONE",Z.ALL="ALL",Z.NONE="NONE",(K=to||(to={})).AND="AND",K.OR="OR",(J=ta||(ta={})).CREATED_ON="CREATED_ON",J.FIRST_NAME="FIRST_NAME",J.LAST_NAME="LAST_NAME",J.USERNAME="USERNAME",J.EMAIL="EMAIL",(Q=ts||(ts={})).STOPPED="STOPPED",Q.RUNNING="RUNNING",Q.ERROR="ERROR",(ee=tl||(tl={})).JAVASCRIPT="JAVASCRIPT",ee.GROOVY="GROOVY",ee.JSON="JSON",ee.FLOW="FLOW",(et=tc||(tc={})).READY="READY",et.DEPLOYED="DEPLOYED",et.COMPILATION_ERROR="COMPILATION_ERROR",et.VALIDITY_PERIOD_ERROR="VALIDITY_PERIOD_ERROR",et.EXECUTION_ERROR="EXECUTION_ERROR",et.LOOP_ERROR="LOOP_ERROR",et.DISABLED="DISABLED",et.PAUSED="PAUSED",et.EXPIRED="EXPIRED",et.REMOVED="REMOVED",et.EMPTY="EMPTY",(en=td||(td={})).SUNRISE="SUNRISE",en.SUNSET="SUNSET",en.TWILIGHT_MORNING_VISUAL="TWILIGHT_MORNING_VISUAL",en.TWILIGHT_MORNING_VISUAL_LOWER="TWILIGHT_MORNING_VISUAL_LOWER",en.TWILIGHT_MORNING_HORIZON="TWILIGHT_MORNING_HORIZON",en.TWILIGHT_MORNING_CIVIL="TWILIGHT_MORNING_CIVIL",en.TWILIGHT_MORNING_NAUTICAL="TWILIGHT_MORNING_NAUTICAL",en.TWILIGHT_MORNING_ASTRONOMICAL="TWILIGHT_MORNING_ASTRONOMICAL",en.TWILIGHT_MORNING_GOLDEN_HOUR="TWILIGHT_MORNING_GOLDEN_HOUR",en.TWILIGHT_MORNING_BLUE_HOUR="TWILIGHT_MORNING_BLUE_HOUR",en.TWILIGHT_MORNING_NIGHT_HOUR="TWILIGHT_MORNING_NIGHT_HOUR",en.TWILIGHT_EVENING_VISUAL="TWILIGHT_EVENING_VISUAL",en.TWILIGHT_EVENING_VISUAL_LOWER="TWILIGHT_EVENING_VISUAL_LOWER",en.TWILIGHT_EVENING_HORIZON="TWILIGHT_EVENING_HORIZON",en.TWILIGHT_EVENING_CIVIL="TWILIGHT_EVENING_CIVIL",en.TWILIGHT_EVENING_NAUTICAL="TWILIGHT_EVENING_NAUTICAL",en.TWILIGHT_EVENING_ASTRONOMICAL="TWILIGHT_EVENING_ASTRONOMICAL",en.TWILIGHT_EVENING_GOLDEN_HOUR="TWILIGHT_EVENING_GOLDEN_HOUR",en.TWILIGHT_EVENING_BLUE_HOUR="TWILIGHT_EVENING_BLUE_HOUR",en.TWILIGHT_EVENING_NIGHT_HOUR="TWILIGHT_EVENING_NIGHT_HOUR",(ei=tu||(tu={})).NUMBER="NUMBER",ei.NUMBER_ARRAY="NUMBER_ARRAY",ei.STRING="STRING",ei.BOOLEAN="BOOLEAN",ei.TRIGGER="TRIGGER",ei.COLOR="COLOR",ei.ANY="ANY",(er=th||(th={})).NEW_LINE="NEW_LINE",er.SPACER="SPACER",(eo=tm||(tm={})).INPUT="INPUT",eo.PROCESSOR="PROCESSOR",eo.OUTPUT="OUTPUT",eo.THEN="THEN",(ea=tp||(tp={})).TEXT="TEXT",ea.MULTILINE="MULTILINE",ea.NUMBER="NUMBER",ea.DROPDOWN="DROPDOWN",ea.DOUBLE_DROPDOWN="DOUBLE_DROPDOWN",ea.CHECKBOX="CHECKBOX",ea.ASSET_ATTRIBUTE="ASSET_ATTRIBUTE",ea.COLOR="COLOR",ea.DATE="DATE",(es=tf||(tf={})).ADD="ADD",es.ADD_OR_REPLACE="ADD_OR_REPLACE",es.REPLACE="REPLACE",es.DELETE="DELETE",es.CLEAR="CLEAR",(el=tb||(tb={})).PER_ASSET="PER_ASSET",el.GLOBAL="GLOBAL",(ec=tg||(tg={})).READ_ADMIN="read:admin",ec.READ_LOGS="read:logs",ec.READ_USERS="read:users",ec.READ_MAP="read:map",ec.READ_ASSETS="read:assets",ec.READ_RULES="read:rules",ec.READ_INSIGHTS="read:insights",ec.READ_ALARMS="read:alarms",ec.READ_NOTIFICATIONS="read:notifications",ec.READ_SERVICES="read:services",ec.READ_TUNNELS="read:tunnels",ec.WRITE_SERVICES="write:services",ec.WRITE_USER="write:user",ec.WRITE_ADMIN="write:admin",ec.WRITE_LOGS="write:logs",ec.WRITE_ASSETS="write:assets",ec.WRITE_ATTRIBUTES="write:attributes",ec.WRITE_RULES="write:rules",ec.WRITE_INSIGHTS="write:insights",ec.WRITE_ALARMS="write:alarms",ec.WRITE_NOTIFICATIONS="write:notifications",ec.WRITE_TUNNELS="write:tunnels",ec.READ="read",ec.WRITE="write",(ed=t_||(t_={})).REGISTER="REGISTER",ed.UPDATE="UPDATE",ed.DEREGISTER="DEREGISTER",(eu=ty||(ty={})).AVAILABLE="AVAILABLE",eu.UNAVAILABLE="UNAVAILABLE",(eh=tv||(tv={})).ASSET="ASSET",eh.AGENT="AGENT",eh.NOTIFICATION="NOTIFICATION",eh.ALARM="ALARM",eh.RULES="RULES",eh.PROTOCOL="PROTOCOL",eh.GATEWAY="GATEWAY",eh.MODEL_AND_VALUES="MODEL_AND_VALUES",eh.API="API",eh.DATA="DATA",(em=tx||(tx={})).INFO="INFO",em.WARN="WARN",em.ERROR="ERROR",(ep=tF||(tF={})).NUMERIC="numeric",ep.DIGIT_2="2-digit",ep.FULL="full",ep.LONG="long",ep.MEDIUM="medium",ep.SHORT="short",ep.NARROW="narrow",(ef=tw||(tw={})).SECONDLY="SECONDLY",ef.MINUTELY="MINUTELY",ef.HOURLY="HOURLY",ef.DAILY="DAILY",ef.WEEKLY="WEEKLY",ef.MONTHLY="MONTHLY",ef.YEARLY="YEARLY",(eb=tE||(tE={})).OMIT="OMIT",eb.BACKWARD="BACKWARD",eb.FORWARD="FORWARD",(eg=tC||(tC={})).JAPANESE="JAPANESE",eg.BUDDHIST="BUDDHIST",eg.ROC="ROC",eg.ISLAMIC="ISLAMIC",eg.ISO8601="ISO8601",eg.CHINESE="CHINESE",eg.ETHIOPIC="ETHIOPIC",eg.HEBREW="HEBREW",eg.GREGORIAN="GREGORIAN",(e_=tA||(tA={})).SU="SU",e_.MO="MO",e_.TU="TU",e_.WE="WE",e_.TH="TH",e_.FR="FR",e_.SA="SA",(ey=tk||(tk={})).PEOPLECOUNTERASSET="PeopleCounterAsset",ey.MAILAGENT="MailAgent",ey.UDPAGENT="UDPAgent",ey.ROOMASSET="RoomAsset",ey.CITYASSET="CityAsset",ey.VENTILATIONASSET="VentilationAsset",ey.TRADFRILIGHTASSET="TradfriLightAsset",ey.CONSOLEASSET="ConsoleAsset",ey.PRESENCESENSORASSET="PresenceSensorAsset",ey.OPENWEATHERMAPAGENT="OpenWeatherMapAgent",ey.LIGHTASSET="LightAsset",ey.KNXAGENT="KNXAgent",ey.THETHINGSSTACKAGENT="TheThingsStackAgent",ey.PLUGASSET="PlugAsset",ey.CHIRPSTACKAGENT="ChirpStackAgent",ey.WEATHERASSET="WeatherAsset",ey.THINGASSET="ThingAsset",ey.WEBSOCKETAGENT="WebsocketAgent",ey.TCPAGENT="TCPAgent",ey.GATEWAYASSET="GatewayAsset",ey.SERIALAGENT="SerialAgent",ey.BLUETOOTHMESHAGENT="BluetoothMeshAgent",ey.PARKINGASSET="ParkingAsset",ey.TRADFRIPLUGASSET="TradfriPlugAsset",ey.SIMULATORAGENT="SimulatorAgent",ey.SNMPAGENT="SNMPAgent",ey.GROUPASSET="GroupAsset",ey.BUILDINGASSET="BuildingAsset",ey.MODBUSSERIALAGENT="ModbusSerialAgent",ey.ENVIRONMENTSENSORASSET="EnvironmentSensorAsset",ey.MQTTAGENT="MQTTAgent",ey.VELBUSTCPAGENT="VelbusTCPAgent",ey.ARTNETLIGHTASSET="ArtnetLightAsset",ey.VELBUSSERIALAGENT="VelbusSerialAgent",ey.GROUNDWATERSENSORASSET="GroundwaterSensorAsset",ey.MICROPHONEASSET="MicrophoneAsset",ey.MODBUSTCPAGENT="ModbusTcpAgent",ey.ZWAVEAGENT="ZWaveAgent",ey.HTTPAGENT="HTTPAgent",ey.DOORASSET="DoorAsset",ey.THERMOSTATASSET="ThermostatAsset",ey.SHIPASSET="ShipAsset",(ev=tT||(tT={})).COLOURRGB="colourRGB",ev.WILDCARDSUBSCRIPTIONTOPICS="wildcardSubscriptionTopics",ev.PRICEHOURLY="priceHourly",ev.MQTTPORT="MQTTPort",ev.PINGDISABLED="pingDisabled",ev.FLOW="flow",ev.CHILDASSETTYPE="childAssetType",ev.LASTACCESS="lastAccess",ev.POSITION="position",ev.NETWORKKEY="networkKey",ev.UNIVERSE="universe",ev.ROUTINGMODE="routingMode",ev.MSSINUMBER="MSSINumber",ev.LASTWILLRETAIN="lastWillRetain",ev.LASTWILLTOPIC="lastWillTopic",ev.SERIALBAUDRATE="serialBaudrate",ev.SUBSCRIBEQOS="subscribeQos",ev.LEDCOUNT="lEDCount",ev.LOCKED="locked",ev.CLOUDCOVERAGE="cloudCoverage",ev.BASEURL="baseURL",ev.PROTOCOL="protocol",ev.REQUIREDVALUES="requiredValues",ev.REGION="region",ev.CONSOLEPLATFORM="consolePlatform",ev.GATEWAYSTATUS="gatewayStatus",ev.NO2LEVEL="NO2Level",ev.ATMOSPHERICPRESSURE="atmosphericPressure",ev.SERIALPORT="serialPort",ev.APPLICATIONID="applicationId",ev.TAGS="tags",ev.UNLOCK="unlock",ev.CHECKINTERVALSECONDS="checkIntervalSeconds",ev.LOCATION="location",ev.CLIENTSECRET="clientSecret",ev.WINDDIRECTION="windDirection",ev.WINDSPEED="windSpeed",ev.PARTICLESPM10="particlesPM10",ev.APPLICATIONKEY="applicationKey",ev.LENGTH="length",ev.PROBABILITYOFPRECIPITATION="probabilityOfPrecipitation",ev.USERNAMEPASSWORD="usernamePassword",ev.WATERLEVEL="waterLevel",ev.CONNECTHEADERS="connectHeaders",ev.CONSOLENAME="consoleName",ev.WEBSOCKETQUERY="websocketQuery",ev.PREFERHTML="preferHTML",ev.PARITY="parity",ev.COOLING="cooling",ev.POLLINGMILLIS="pollingMillis",ev.SOILTEMPERATURE="soilTemperature",ev.SUNIRRADIANCE="sunIrradiance",ev.MESSAGEMAXLENGTH="messageMaxLength",ev.WINDGUSTSPEED="windGustSpeed",ev.LIGHTID="lightId",ev.PROXYADDRESS="proxyAddress",ev.REQUESTQUERYPARAMETERS="requestQueryParameters",ev.MQTTHOST="MQTTHost",ev.SECUREGRPC="secureGRPC",ev.MODEL="model",ev.STREET="street",ev.MANUFACTURER="manufacturer",ev.DELETEPROCESSEDMAIL="deleteProcessedMail",ev.RESUMESESSION="resumeSession",ev.ONOFF="onOff",ev.APIKEY="ApiKey",ev.CITY="city",ev.PRESENCE="presence",ev.SPACESOCCUPIED="spacesOccupied",ev.STARTTLS="startTLS",ev.REQUESTTIMEOUTMILLIS="requestTimeoutMillis",ev.WEBSOCKETPATH="websocketPath",ev.AGENTSTATUS="agentStatus",ev.PRICEDAILY="priceDaily",ev.COUNTGROWTHMINUTE="countGrowthMinute",ev.IMONUMBER="IMONumber",ev.ATTRIBUTION="Attribution",ev.TENANTID="tenantId",ev.REQUESTHEADERS="requestHeaders",ev.HOST="host",ev.COUNTOUTMINUTE="countOutMinute",ev.MESSAGECHARSET="messageCharset",ev.CERTIFICATEALIAS="certificateAlias",ev.EMAIL="email",ev.BINDPORT="bindPort",ev.CONSOLEVERSION="consoleVersion",ev.PARTICLESPM1="particlesPM1",ev.MTU="mtu",ev.SPEED="speed",ev.MESSAGESTRIPDELIMITER="messageStripDelimiter",ev.AREA="area",ev.COUNTRY="country",ev.SHIPTYPE="shipType",ev.CONNECTSUBSCRIPTIONS="connectSubscriptions",ev.RELATIVEHUMIDITY="relativeHumidity",ev.SOURCEADDRESS="sourceAddress",ev.RAINFALL="rainfall",ev.OAUTHGRANT="oAuthGrant",ev.OZONELEVEL="ozoneLevel",ev.SEQUENCENUMBER="sequenceNumber",ev.COUNTINMINUTE="countInMinute",ev.PORT="port",ev.SUNALTITUDE="sunAltitude",ev.COUNTOUT="countOut",ev.ROOMNUMBER="roomNumber",ev.TUNNELINGSUPPORTED="tunnelingSupported",ev.ENINUMBER="ENINumber",ev.PARTICLESPM2_5="particlesPM2_5",ev.AGENTDISABLED="agentDisabled",ev.DISABLED="disabled",ev.COUNTIN="countIn",ev.MESSAGESOURCEADDRESS="messageSourceAddress",ev.PROVISIONWEATHERASSET="ProvisionWeatherAsset",ev.TIMEINJECTIONINTERVAL="timeInjectionInterval",ev.TEMPERATURESETPOINT="temperatureSetpoint",ev.CONSOLEPROVIDERS="consoleProviders",ev.COUNTTOTAL="countTotal",ev.SPACESBUFFER="spacesBuffer",ev.DEVICECONFIG="deviceConfig",ev.SPACESTOTAL="spacesTotal",ev.BINDHOST="bindHost",ev.FANSPEED="fanSpeed",ev.MESSAGECONVERTBINARY="messageConvertBinary",ev.NOTES="notes",ev.MAILFOLDERNAME="mailFolderName",ev.MESSAGEDELIMITERS="messageDelimiters",ev.TEMPERATURE="temperature",ev.SUNZENITH="sunZenith",ev.SNMPVERSIONVALUE="SNMPVersionValue",ev.BRIGHTNESS="brightness",ev.POSTALCODE="postalCode",ev.SPACESOPEN="spacesOpen",ev.HUMIDITY="humidity",ev.SOUNDLEVEL="soundLevel",ev.SECUREMODE="secureMode",ev.DIRECTION="direction",ev.STOPBITS="stopbits",ev.UVINDEX="uVIndex",ev.CONNECTURL="connectURL",ev.CLIENTID="clientId",ev.NATMODE="NATMode",ev.UPDATEONWRITE="updateOnWrite",ev.LASTWILLPAYLOAD="lastWillPayload",ev.GROUPID="groupId",ev.FOLLOWREDIRECTS="followRedirects",ev.SUNAZIMUTH="sunAzimuth",ev.MESSAGECONVERTHEX="messageConvertHex",ev.WEBSOCKETMODE="websocketMode",ev.COLOURTEMPERATURE="colourTemperature",ev.PUBLISHQOS="publishQos",ev.DATABITS="dataBits",(ex=tS||(tS={})).FORMAT="format",ex.DATAPOINTSMAXAGEDAYS="dataPointsMaxAgeDays",ex.ACCESSRESTRICTEDWRITE="accessRestrictedWrite",ex.SECRET="secret",ex.APPLYPREDICTEDDATAPOINTS="applyPredictedDataPoints",ex.ATTRIBUTELINKS="attributeLinks",ex.RULERESETIMMEDIATE="ruleResetImmediate",ex.RULESTATE="ruleState",ex.AGENTLINKCONFIG="agentLinkConfig",ex.HASPREDICTEDDATAPOINTS="hasPredictedDataPoints",ex.FORECAST="forecast",ex.STOREDATAPOINTS="storeDataPoints",ex.LABEL="label",ex.CONSTRAINTS="constraints",ex.UNITS="units",ex.USERCONNECTED="userConnected",ex.SHOWONDASHBOARD="showOnDashboard",ex.READONLY="readOnly",ex.MULTILINE="multiline",ex.ACCESSPUBLICWRITE="accessPublicWrite",ex.MOMENTARY="momentary",ex.AGENTLINK="agentLink",ex.ACCESSRESTRICTEDREAD="accessRestrictedRead",ex.ACCESSPUBLICREAD="accessPublicRead",(eF=tI||(tI={})).ASSETQUERY="assetQuery",eF.WSURL="WS_URL",eF.COLOURRGB="colourRGB",eF.VALUEFORMAT="valueFormat",eF.TEXT="text",eF.BYTE="byte",eF.USERNAMEANDPASSWORD="usernameAndPassword",eF.HTTPURL="HTTP_URL",eF.ATTRIBUTELINK="attributeLink",eF.ASSETID="assetID",eF.NUMBERMAP="numberMap",eF.HTTPMETHOD="HTTPMethod",eF.ATTRIBUTESTATE="attributeState",eF.POSITIVENUMBER="positiveNumber",eF.POSITIVEINTEGER="positiveInteger",eF.EXECUTIONSTATUS="executionStatus",eF.BIGINTEGER="bigInteger",eF.VALUEDESCRIPTOR="valueDescriptor",eF.PERIODDURATIONISO8601="periodDurationISO8601",eF.LONG="long",eF.DATEANDTIME="dateAndTime",eF.BOOLEANMAP="booleanMap",eF.MQTTQOS="MQTTQos",eF.NEGATIVEINTEGER="negativeInteger",eF.TCPIPPORTNUMBER="TCP_IPPortNumber",eF.GEOJSONPOINT="GEO_JSONPoint",eF.SNMPVERSION="SNMPVersion",eF.ASSETTYPE="assetType",eF.JSONOBJECT="JSONObject",eF.INTEGERMAP="integerMap",eF.BIGNUMBER="bigNumber",eF.IPADDRESS="IPAddress",eF.EMAIL="email",eF.TIMESTAMP="timestamp",eF.KNXMESSAGESOURCEADDRESS="kNXMessageSourceAddress",eF.ATTRIBUTEREFERENCE="attributeReference",eF.UUID="UUID",eF.INTEGER="integer",eF.OAUTHGRANT="oAuthGrant",eF.NUMBER="number",eF.DEVICECONFIGMAP="DeviceConfigMap",eF.TEXTMAP="textMap",eF.WEBSOCKETSUBSCRIPTION="websocketSubscription",eF.BOOLEAN="boolean",eF.TIMEANDPERIODDURATIONISO8601="timeAndPeriodDurationISO8601",eF.FORECASTCONFIGURATION="forecastConfiguration",eF.TIMEDURATIONISO8601="timeDurationISO8601",eF.TIMESTAMPISO8601="timestampISO8601",eF.CONSOLEPROVIDERS="consoleProviders",eF.MULTIVALUEDTEXTMAP="multivaluedTextMap",eF.NEGATIVENUMBER="negativeNumber",eF.PARITYBIT="Paritybit",eF.JSON="JSON",eF.CRONEXPRESSION="CRONExpression",eF.INTEGERBYTE="integerByte",eF.AGENTLINK="agentLink",eF.DIRECTION="direction",eF.HOSTORIPADDRESS="hostOrIPAddress",eF.STOPBITS="Stopbits",eF.CALENDAREVENT="calendarEvent",eF.CONNECTIONSTATUS="connectionStatus",eF.VALUECONSTRAINT="valueConstraint",(ew=tD||(tD={})).MONTH="month",ew.MILE_SCANDINAVIAN="mile_scandinavian",ew.VAR="var",ew.OUNCE="ounce",ew.HECTARE="hectare",ew.YARD="yard",ew.YEAR="year",ew.GIGA="giga",ew.JOULE="joule",ew.VOLT="volt",ew.HERTZ="hertz",ew.MILE="mile",ew.DEGREE="degree",ew.KILO="kilo",ew.BTU="btu",ew.TERA="tera",ew.FOOT="foot",ew.MEGA="mega",ew.KELVIN="kelvin",ew.CARBON="carbon",ew.DECIBEL_ATTENUATED="decibel_attenuated",ew.INCH="inch",ew.SQUARED="squared",ew.PERCENTAGE="percentage",ew.IN_HG="inch_mercury",ew.CENTI="centi",ew.GRAM="gram",ew.CUBED="cubed",ew.DAY="day",ew.RADIAN="radian",ew.OHM="ohm",ew.MINUTE="minute",ew.PART_PER_MILLION="ppm",ew.AMP="amp",ew.MASS_POUND="pound",ew.KNOT="knot",ew.METRE="metre",ew.LITRE="litre",ew.FLUID_OUNCE="fluid_ounce",ew.HOUR="hour",ew.ACRE="acre",ew.CELSIUS="celsius",ew.RPM="rpm",ew.PASCAL="pascal",ew.DECIBEL="decibel",ew.LUMEN="lumen",ew.WEEK="week",ew.FAHRENHEIT="fahrenheit",ew.WATT="watt",ew.GALLON="gallon",ew.LUX="lux",ew.MILLI="milli",ew.BAR="bar",ew.HECTO="hecto",ew.PEAK="peak",ew.SECOND="second",ew.MICRO="micro",ew.PER="per",ew.STONE="stone",tP||(tP={});class tY{static getAssetDescriptors(){return tY._assetTypeInfos.map(t=>t.assetDescriptor)}static getMetaItemDescriptors(){return[...this._metaItemDescriptors]}static getValueDescriptors(){return[...this._valueDescriptors]}static getAssetTypeInfos(){return[...this._assetTypeInfos]}static getAssetTypeInfo(t){if(t)return t.assetDescriptor?t:("string"!=typeof t&&(t=t.name),this._assetTypeInfos.find(n=>n.assetDescriptor.name===t))}static getAssetDescriptor(t){if(!t)return;if(t.assetDescriptor)return t.assetDescriptor;if("string"!=typeof t)return t;let n=this._assetTypeInfos.find(n=>n.assetDescriptor.name===t);return n?n.assetDescriptor:void 0}static getAttributeDescriptor(t,n){if(!t)return;let i=this.getAssetTypeInfo(n||"ThingAsset");if(i&&i.attributeDescriptors)return i.attributeDescriptors.find(n=>n.name===t)}static getValueDescriptor(t){let n;if(!t)return;if(t.endsWith("[]"))for(n=0;t.endsWith("[]");)t=t.substring(0,t.length-2),n++;let i=this._valueDescriptors.find(n=>n.name===t);return i&&n&&(i=Object.assign(Object.assign({},i),{arrayDimensions:n})),i}static resolveValueDescriptor(t,n){let i;return n&&("string"==typeof n&&(i=tY.getValueDescriptor(n)),i=n.jsonType?n:tY.getValueDescriptor(n.type)),!i&&t&&(i=tY.getValueDescriptor("JSON")),i}static resolveValueTypeFromValue(t){if(null!=t){if("number"==typeof t)return"number";if("string"==typeof t)return"text";if("boolean"==typeof t)return"boolean";if(Array.isArray(t)){let n=1,i=t.find(t=>null!=t);for(;Array.isArray(i);)i=i.find(t=>null!=t),n++;let r=this.resolveValueTypeFromValue(i);if(!r)return;for(;n>0;)r+="[]",n--;return r}if(t instanceof Date)return"dateAndTime"}}static getAttributeAndValueDescriptors(t,n,i){let r,o;if(n&&"string"!=typeof n)r=n;else{let o=this.getAssetTypeInfo(t||"ThingAsset");if(!o)return[void 0,void 0];"string"==typeof n&&(r=this.getAttributeDescriptor(n,o)),!r&&i&&(r={type:i.type,name:i.name,meta:i.meta})}return r&&(o=this.getValueDescriptor(r.type)),[r,o]}static getMetaItemDescriptor(t){if(t)return this._metaItemDescriptors.find(n=>n.name===t)}static getAssetDescriptorColour(t,n){let i=this.getAssetDescriptor(t);return i&&i.colour?i.colour:n}static getAssetDescriptorIcon(t,n){let i=this.getAssetDescriptor(t);return i&&i.icon?i.icon:n}}function tX(t){return(tX="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function tZ(t,n){if(!(t instanceof n))throw TypeError("Cannot call a class as a function")}function tK(t){var n=function(t,n){if("object"!=tX(t)||!t)return t;var i=t[Symbol.toPrimitive];if(void 0!==i){var r=i.call(t,n||"default");if("object"!=tX(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==tX(n)?n:n+""}function tJ(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,tK(r.key),r)}}function tQ(t,n,i){return n&&tJ(t.prototype,n),i&&tJ(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function t0(t){if(void 0===t)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function t1(t,n){return(t1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t})(t,n)}function t2(t,n){if("function"!=typeof n&&null!==n)throw TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&t1(t,n)}function t3(t,n){if(n&&("object"==tX(n)||"function"==typeof n))return n;if(void 0!==n)throw TypeError("Derived constructors may only return object or undefined");return t0(t)}function t5(t){return(t5=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function t4(t,n,i){return(n=tK(n))in t?Object.defineProperty(t,n,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[n]=i,t}function t6(t,n){(null==n||n>t.length)&&(n=t.length);for(var i=0,r=Array(n);i<n;i++)r[i]=t[i];return r}function t8(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function t7(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t8(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):t8(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}tY._assetTypeInfos=[],tY._metaItemDescriptors=[],tY._valueDescriptors=[];var t9={type:"logger",log:function(t){this.output("log",t)},warn:function(t){this.output("warn",t)},error:function(t){this.output("error",t)},output:function(t,n){console&&console[t]&&console[t].apply(console,n)}},ne=new(function(){function t(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tZ(this,t),this.init(n,i)}return tQ(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=t||t9,this.options=n,this.debug=n.debug}},{key:"setDebug",value:function(t){this.debug=t}},{key:"log",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"log","",!0)}},{key:"warn",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"warn","",!0)}},{key:"error",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"error","")}},{key:"deprecate",value:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];return this.forward(n,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(t,n,i,r){return r&&!this.debug?null:("string"==typeof t[0]&&(t[0]="".concat(i).concat(this.prefix," ").concat(t[0])),this.logger[n](t))}},{key:"create",value:function(n){return new t(this.logger,t7(t7({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}},{key:"clone",value:function(n){return(n=n||this.options).prefix=n.prefix||this.prefix,new t(this.logger,n)}}]),t}()),nt=function(){function t(){tZ(this,t),this.observers={}}return tQ(t,[{key:"on",value:function(t,n){var i=this;return t.split(" ").forEach(function(t){i.observers[t]=i.observers[t]||[],i.observers[t].push(n)}),this}},{key:"off",value:function(t,n){if(this.observers[t]){if(!n)return void delete this.observers[t];this.observers[t]=this.observers[t].filter(function(t){return t!==n})}}},{key:"emit",value:function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];this.observers[t]&&[].concat(this.observers[t]).forEach(function(t){t.apply(void 0,i)}),this.observers["*"]&&[].concat(this.observers["*"]).forEach(function(n){n.apply(n,[t].concat(i))})}}]),t}();function nn(){var t,n,i=new Promise(function(i,r){t=i,n=r});return i.resolve=t,i.reject=n,i}function ni(t){return null==t?"":""+t}function nr(t,n,i){function r(t){return t&&t.indexOf("###")>-1?t.replace(/###/g,"."):t}function o(){return!t||"string"==typeof t}for(var a="string"!=typeof n?[].concat(n):n.split(".");a.length>1;){if(o())return{};var s=r(a.shift());!t[s]&&i&&(t[s]=new i),t=Object.prototype.hasOwnProperty.call(t,s)?t[s]:{}}return o()?{}:{obj:t,k:r(a.shift())}}function no(t,n,i){var r=nr(t,n,Object);r.obj[r.k]=i}function na(t,n){var i=nr(t,n),r=i.obj,o=i.k;if(r)return r[o]}function ns(t,n,i){var r=na(t,i);return void 0!==r?r:na(n,i)}function nl(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var nc={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};function nd(t){return"string"==typeof t?t.replace(/[&<>"'\/]/g,function(t){return nc[t]}):t}var nu="u">typeof window&&window.navigator&&void 0===window.navigator.userAgentData&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,nh=[" ",",","?","!",";"];function nm(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function np(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nm(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nm(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nf=function(t){t2(r,t);var n,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t5(r);return t=n?Reflect.construct(i,arguments,t5(this).constructor):i.apply(this,arguments),t3(this,t)});function r(t){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return tZ(this,r),n=i.call(this),nu&&nt.call(t0(n)),n.data=t||{},n.options=o,void 0===n.options.keySeparator&&(n.options.keySeparator="."),void 0===n.options.ignoreJSONStructure&&(n.options.ignoreJSONStructure=!0),n}return tQ(r,[{key:"addNamespaces",value:function(t){0>this.options.ns.indexOf(t)&&this.options.ns.push(t)}},{key:"removeNamespaces",value:function(t){var n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}},{key:"getResource",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[t,n];i&&"string"!=typeof i&&(s=s.concat(i)),i&&"string"==typeof i&&(s=s.concat(o?i.split(o):i)),t.indexOf(".")>-1&&(s=t.split("."));var l=na(this.data,s);return l||!a||"string"!=typeof i?l:function t(n,i){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(n){if(n[i])return n[i];for(var o=i.split(r),a=n,s=0;s<o.length;++s){if(!a||"string"==typeof a[o[s]]&&s+1<o.length)return;if(void 0===a[o[s]]){for(var l=2,c=o.slice(s,s+l).join(r),d=a[c];void 0===d&&o.length>s+l;)l++,d=a[c=o.slice(s,s+l).join(r)];if(void 0===d)return;if(null===d)return null;if(i.endsWith(c)){if("string"==typeof d)return d;if(c&&"string"==typeof d[c])return d[c]}var u=o.slice(s+l).join(r);if(u)return t(d,u,r);return}a=a[o[s]]}return a}}(this.data&&this.data[t]&&this.data[t][n],i,o)}},{key:"addResource",value:function(t,n,i,r){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},a=this.options.keySeparator;void 0===a&&(a=".");var s=[t,n];i&&(s=s.concat(a?i.split(a):i)),t.indexOf(".")>-1&&(s=t.split("."),r=n,n=s[1]),this.addNamespaces(n),no(this.data,s,r),o.silent||this.emit("added",t,n,i,r)}},{key:"addResources",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var o in i)("string"==typeof i[o]||"[object Array]"===Object.prototype.toString.apply(i[o]))&&this.addResource(t,n,o,i[o],{silent:!0});r.silent||this.emit("added",t,n,i)}},{key:"addResourceBundle",value:function(t,n,i,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},s=[t,n];t.indexOf(".")>-1&&(s=t.split("."),r=i,i=n,n=s[1]),this.addNamespaces(n);var l=na(this.data,s)||{};r?function t(n,i,r){for(var o in i)"__proto__"!==o&&"constructor"!==o&&(o in n?"string"==typeof n[o]||n[o]instanceof String||"string"==typeof i[o]||i[o]instanceof String?r&&(n[o]=i[o]):t(n[o],i[o],r):n[o]=i[o]);return n}(l,i,o):l=np(np({},l),i),no(this.data,s,l),a.silent||this.emit("added",t,n,i)}},{key:"removeResourceBundle",value:function(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}},{key:"hasResourceBundle",value:function(t,n){return void 0!==this.getResource(t,n)}},{key:"getResourceBundle",value:function(t,n){return(n||(n=this.options.defaultNS),"v1"===this.options.compatibilityAPI)?np(np({},{}),this.getResource(t,n)):this.getResource(t,n)}},{key:"getDataByLanguage",value:function(t){return this.data[t]}},{key:"hasLanguageSomeTranslations",value:function(t){var n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(function(t){return n[t]&&Object.keys(n[t]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),r}(nt),nb={processors:{},addPostProcessor:function(t){this.processors[t.name]=t},handle:function(t,n,i,r,o){var a=this;return t.forEach(function(t){a.processors[t]&&(n=a.processors[t].process(n,i,r,o))}),n}};function ng(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function n_(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?ng(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ng(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var ny={},nv=function(t){t2(r,t);var n,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t5(r);return t=n?Reflect.construct(i,arguments,t5(this).constructor):i.apply(this,arguments),t3(this,t)});function r(t){var n,o,a,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return tZ(this,r),a=i.call(this),nu&&nt.call(t0(a)),n=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],o=t0(a),n.forEach(function(n){t[n]&&(o[n]=t[n])}),a.options=s,void 0===a.options.keySeparator&&(a.options.keySeparator="."),a.logger=ne.create("translator"),a}return tQ(r,[{key:"changeLanguage",value:function(t){t&&(this.language=t)}},{key:"exists",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==t)return!1;var i=this.resolve(t,n);return i&&void 0!==i.res}},{key:"extractFromKey",value:function(t,n){var i=void 0!==n.nsSeparator?n.nsSeparator:this.options.nsSeparator;void 0===i&&(i=":");var r=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,o=n.ns||this.options.defaultNS||[],a=i&&t.indexOf(i)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!function(t,n,i){n=n||"",i=i||"";var r=nh.filter(function(t){return 0>n.indexOf(t)&&0>i.indexOf(t)});if(0===r.length)return!0;var o=new RegExp("(".concat(r.map(function(t){return"?"===t?"\\?":t}).join("|"),")")),a=!o.test(t);if(!a){var s=t.indexOf(i);s>0&&!o.test(t.substring(0,s))&&(a=!0)}return a}(t,i,r);if(a&&!s){var l=t.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:t,namespaces:o};var c=t.split(i);(i!==r||i===r&&this.options.ns.indexOf(c[0])>-1)&&(o=c.shift()),t=c.join(r)}return"string"==typeof o&&(o=[o]),{key:t,namespaces:o}}},{key:"translate",value:function(t,n,i){var o=this;if("object"!==tX(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==t)return"";Array.isArray(t)||(t=[String(t)]);var a=void 0!==n.returnDetails?n.returnDetails:this.options.returnDetails,s=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,l=this.extractFromKey(t[t.length-1],n),c=l.key,d=l.namespaces,u=d[d.length-1],h=n.lng||this.language,m=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(h&&"cimode"===h.toLowerCase()){if(m){var p=n.nsSeparator||this.options.nsSeparator;return a?(f.res="".concat(u).concat(p).concat(c),f):"".concat(u).concat(p).concat(c)}return a?(f.res=c,f):c}var f=this.resolve(t,n),b=f&&f.res,g=f&&f.usedKey||c,_=f&&f.exactUsedKey||c,y=Object.prototype.toString.apply(b),v=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,x=!this.i18nFormat||this.i18nFormat.handleAsObject,F="string"!=typeof b&&"boolean"!=typeof b&&"number"!=typeof b;if(x&&b&&F&&0>["[object Number]","[object Function]","[object RegExp]"].indexOf(y)&&("string"!=typeof v||"[object Array]"!==y)){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(g,b,n_(n_({},n),{},{ns:d})):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");return a?(f.res=w,f):w}if(s){var E="[object Array]"===y,C=E?[]:{},A=E?_:g;for(var k in b)if(Object.prototype.hasOwnProperty.call(b,k)){var T="".concat(A).concat(s).concat(k);C[k]=this.translate(T,n_(n_({},n),{joinArrays:!1,ns:d})),C[k]===T&&(C[k]=b[k])}b=C}}else if(x&&"string"==typeof v&&"[object Array]"===y)(b=b.join(v))&&(b=this.extendTranslation(b,t,n,i));else{var S=!1,I=!1,D=void 0!==n.count&&"string"!=typeof n.count,P=r.hasDefaultValue(n),R=D?this.pluralResolver.getSuffix(h,n.count,n):"",O=n["defaultValue".concat(R)]||n.defaultValue;!this.isValidLookup(b)&&P&&(S=!0,b=O),this.isValidLookup(b)||(I=!0,b=c);var M=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&I?void 0:b,L=P&&O!==b&&this.options.updateMissing;if(I||S||L){if(this.logger.log(L?"updateKey":"missingKey",h,u,c,L?O:b),s){var B=this.resolve(c,n_(n_({},n),{},{keySeparator:!1}));B&&B.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var z=[],N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&N&&N[0])for(var U=0;U<N.length;U++)z.push(N[U]);else"all"===this.options.saveMissingTo?z=this.languageUtils.toResolveHierarchy(n.lng||this.language):z.push(n.lng||this.language);var j=function(t,i,r){var a=P&&r!==b?r:M;o.options.missingKeyHandler?o.options.missingKeyHandler(t,u,i,a,L,n):o.backendConnector&&o.backendConnector.saveMissing&&o.backendConnector.saveMissing(t,u,i,a,L,n),o.emit("missingKey",t,u,i,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&D?z.forEach(function(t){o.pluralResolver.getSuffixes(t,n).forEach(function(i){j([t],c+i,n["defaultValue".concat(i)]||O)})}):j(z,c,O))}b=this.extendTranslation(b,t,n,f,i),I&&b===c&&this.options.appendNamespaceToMissingKey&&(b="".concat(u,":").concat(c)),(I||S)&&this.options.parseMissingKeyHandler&&(b="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(u,":").concat(c):c,S?b:void 0):this.options.parseMissingKeyHandler(b))}return a?(f.res=b,f):b}},{key:"extendTranslation",value:function(t,n,i,r,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)t=this.i18nFormat.parse(t,n_(n_({},this.options.interpolation.defaultVariables),i),r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init(n_(n_({},i),{interpolation:n_(n_({},this.options.interpolation),i.interpolation)}));var s,l="string"==typeof t&&(i&&i.interpolation&&void 0!==i.interpolation.skipOnVariables?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);if(l){var c=t.match(this.interpolator.nestingRegexp);s=c&&c.length}var d=i.replace&&"string"!=typeof i.replace?i.replace:i;if(this.options.interpolation.defaultVariables&&(d=n_(n_({},this.options.interpolation.defaultVariables),d)),t=this.interpolator.interpolate(t,d,i.lng||this.language,i),l){var u=t.match(this.interpolator.nestingRegexp);s<(u&&u.length)&&(i.nest=!1)}!1!==i.nest&&(t=this.interpolator.nest(t,function(){for(var t=arguments.length,r=Array(t),s=0;s<t;s++)r[s]=arguments[s];return o&&o[0]===r[0]&&!i.context?(a.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(n[0])),null):a.translate.apply(a,r.concat([n]))},i)),i.interpolation&&this.interpolator.reset()}var h=i.postProcess||this.options.postProcess,m="string"==typeof h?[h]:h;return null!=t&&m&&m.length&&!1!==i.applyPostProcessor&&(t=nb.handle(m,t,n,this.options&&this.options.postProcessPassResolved?n_({i18nResolved:r},i):i,this)),t}},{key:"resolve",value:function(t){var n,i,r,o,a,s=this,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof t&&(t=[t]),t.forEach(function(t){if(!s.isValidLookup(n)){var c=s.extractFromKey(t,l),d=c.key;i=d;var u=c.namespaces;s.options.fallbackNS&&(u=u.concat(s.options.fallbackNS));var h=void 0!==l.count&&"string"!=typeof l.count,m=h&&!l.ordinal&&0===l.count&&s.pluralResolver.shouldUseIntlApi(),p=void 0!==l.context&&("string"==typeof l.context||"number"==typeof l.context)&&""!==l.context,f=l.lngs?l.lngs:s.languageUtils.toResolveHierarchy(l.lng||s.language,l.fallbackLng);u.forEach(function(t){s.isValidLookup(n)||(a=t,!ny["".concat(f[0],"-").concat(t)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(a)&&(ny["".concat(f[0],"-").concat(t)]=!0,s.logger.warn('key "'.concat(i,'" for languages "').concat(f.join(", "),'" won\'t get resolved as namespace "').concat(a,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),f.forEach(function(i){if(!s.isValidLookup(n)){o=i;var a,c=[d];if(s.i18nFormat&&s.i18nFormat.addLookupKeys)s.i18nFormat.addLookupKeys(c,d,i,t,l);else{h&&(u=s.pluralResolver.getSuffix(i,l.count,l));var u,f="".concat(s.options.pluralSeparator,"zero");if(h&&(c.push(d+u),m&&c.push(d+f)),p){var b="".concat(d).concat(s.options.contextSeparator).concat(l.context);c.push(b),h&&(c.push(b+u),m&&c.push(b+f))}}for(;a=c.pop();)s.isValidLookup(n)||(r=a,n=s.getResource(i,t,a,l))}}))})}}),{res:n,usedKey:i,exactUsedKey:r,usedLng:o,usedNS:a}}},{key:"isValidLookup",value:function(t){return void 0!==t&&!(!this.options.returnNull&&null===t)&&!(!this.options.returnEmptyString&&""===t)}},{key:"getResource",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(t,n,i,r):this.resourceStore.getResource(t,n,i,r)}}],[{key:"hasDefaultValue",value:function(t){var n="defaultValue";for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&n===i.substring(0,n.length)&&void 0!==t[i])return!0;return!1}}]),r}(nt);function nx(t){return t.charAt(0).toUpperCase()+t.slice(1)}var nF=function(){function t(n){tZ(this,t),this.options=n,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ne.create("languageUtils")}return tQ(t,[{key:"getScriptPartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return null;var n=t.split("-");return 2===n.length||(n.pop(),"x"===n[n.length-1].toLowerCase())?null:this.formatLanguageCode(n.join("-"))}},{key:"getLanguagePartFromCode",value:function(t){if(!t||0>t.indexOf("-"))return t;var n=t.split("-");return this.formatLanguageCode(n[0])}},{key:"formatLanguageCode",value:function(t){if("string"==typeof t&&t.indexOf("-")>-1){var n=["hans","hant","latn","cyrl","cans","mong","arab"],i=t.split("-");return this.options.lowerCaseLng?i=i.map(function(t){return t.toLowerCase()}):2===i.length?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=nx(i[1].toLowerCase()))):3===i.length&&(i[0]=i[0].toLowerCase(),2===i[1].length&&(i[1]=i[1].toUpperCase()),"sgn"!==i[0]&&2===i[2].length&&(i[2]=i[2].toUpperCase()),n.indexOf(i[1].toLowerCase())>-1&&(i[1]=nx(i[1].toLowerCase())),n.indexOf(i[2].toLowerCase())>-1&&(i[2]=nx(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}},{key:"isSupportedCode",value:function(t){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}},{key:"getBestMatchFromCodes",value:function(t){var n,i=this;return t?(t.forEach(function(t){if(!n){var r=i.formatLanguageCode(t);(!i.options.supportedLngs||i.isSupportedCode(r))&&(n=r)}}),!n&&this.options.supportedLngs&&t.forEach(function(t){if(!n){var r=i.getLanguagePartFromCode(t);if(i.isSupportedCode(r))return n=r;n=i.options.supportedLngs.find(function(t){if(0===t.indexOf(r))return t})}}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n):null}},{key:"getFallbackCodes",value:function(t,n){if(!t)return[];if("function"==typeof t&&(t=t(n)),"string"==typeof t&&(t=[t]),"[object Array]"===Object.prototype.toString.apply(t))return t;if(!n)return t.default||[];var i=t[n];return i||(i=t[this.getScriptPartFromCode(n)]),i||(i=t[this.formatLanguageCode(n)]),i||(i=t[this.getLanguagePartFromCode(n)]),i||(i=t.default),i||[]}},{key:"toResolveHierarchy",value:function(t,n){var i=this,r=this.getFallbackCodes(n||this.options.fallbackLng||[],t),o=[],a=function(t){t&&(i.isSupportedCode(t)?o.push(t):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(t)))};return"string"==typeof t&&t.indexOf("-")>-1?("languageOnly"!==this.options.load&&a(this.formatLanguageCode(t)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&a(this.getScriptPartFromCode(t)),"currentOnly"!==this.options.load&&a(this.getLanguagePartFromCode(t))):"string"==typeof t&&a(this.formatLanguageCode(t)),r.forEach(function(t){0>o.indexOf(t)&&a(i.formatLanguageCode(t))}),o}}]),t}(),nw=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],nE={1:function(t){return Number(t>1)},2:function(t){return Number(1!=t)},3:function(t){return 0},4:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},5:function(t){return Number(0==t?0:1==t?1:2==t?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5)},6:function(t){return Number(1==t?0:t>=2&&t<=4?1:2)},7:function(t){return Number(1==t?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2)},8:function(t){return Number(1==t?0:2==t?1:8!=t&&11!=t?2:3)},9:function(t){return Number(t>=2)},10:function(t){return Number(1==t?0:2==t?1:t<7?2:t<11?3:4)},11:function(t){return Number(1==t||11==t?0:2==t||12==t?1:t>2&&t<20?2:3)},12:function(t){return Number(t%10!=1||t%100==11)},13:function(t){return Number(0!==t)},14:function(t){return Number(1==t?0:2==t?1:3==t?2:3)},15:function(t){return Number(t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2)},16:function(t){return Number(t%10==1&&t%100!=11?0:0!==t?1:2)},17:function(t){return Number(+(1!=t&&(t%10!=1||t%100==11)))},18:function(t){return Number(0==t?0:1==t?1:2)},19:function(t){return Number(1==t?0:0==t||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3)},20:function(t){return Number(1==t?0:0==t||t%100>0&&t%100<20?1:2)},21:function(t){return Number(t%100==1?1:t%100==2?2:3*(t%100==3||t%100==4))},22:function(t){return Number(1==t?0:2==t?1:(t<0||t>10)&&t%10==0?2:3)}},nC=["v1","v2","v3"],nA={zero:0,one:1,two:2,few:3,many:4,other:5},nk=function(){function t(n){var i,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};tZ(this,t),this.languageUtils=n,this.options=r,this.logger=ne.create("pluralResolver"),(!this.options.compatibilityJSON||"v4"===this.options.compatibilityJSON)&&("u"<typeof Intl||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=(i={},nw.forEach(function(t){t.lngs.forEach(function(n){i[n]={numbers:t.nr,plurals:nE[t.fc]}})}),i)}return tQ(t,[{key:"addRule",value:function(t,n){this.rules[t]=n}},{key:"getRule",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(t,{type:n.ordinal?"ordinal":"cardinal"})}catch(t){return}return this.rules[t]||this.rules[this.languageUtils.getLanguagePartFromCode(t)]}},{key:"needsPlural",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=this.getRule(t,n);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(t,i).map(function(t){return"".concat(n).concat(t)})}},{key:"getSuffixes",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this.getRule(t,i);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort(function(t,n){return nA[t]-nA[n]}).map(function(t){return"".concat(n.options.prepend).concat(t)}):r.numbers.map(function(r){return n.getSuffix(t,r,i)}):[]}},{key:"getSuffix",value:function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.getRule(t,i);return r?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(r.select(n)):this.getSuffixRetroCompatible(r,n):(this.logger.warn("no plural rule found for: ".concat(t)),"")}},{key:"getSuffixRetroCompatible",value:function(t,n){var i=this,r=t.noAbs?t.plurals(n):t.plurals(Math.abs(n)),o=t.numbers[r];this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var a=function(){return i.options.prepend&&o.toString()?i.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):a():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===t.numbers.length&&1===t.numbers[0]?a():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}},{key:"shouldUseIntlApi",value:function(){return!nC.includes(this.options.compatibilityJSON)}}]),t}();function nT(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function nS(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nT(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nT(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nI=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tZ(this,t),this.logger=ne.create("interpolator"),this.options=n,this.format=n.interpolation&&n.interpolation.format||function(t){return t},this.init(n)}return tQ(t,[{key:"init",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t.interpolation||(t.interpolation={escapeValue:!0});var n=t.interpolation;this.escape=void 0!==n.escape?n.escape:nd,this.escapeValue=void 0===n.escapeValue||n.escapeValue,this.useRawValueToEscape=void 0!==n.useRawValueToEscape&&n.useRawValueToEscape,this.prefix=n.prefix?nl(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?nl(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?nl(n.nestingPrefix):n.nestingPrefixEscaped||nl("$t("),this.nestingSuffix=n.nestingSuffix?nl(n.nestingSuffix):n.nestingSuffixEscaped||nl(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=void 0!==n.alwaysFormat&&n.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var t="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=RegExp(t,"g");var n="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=RegExp(n,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=RegExp(i,"g")}},{key:"interpolate",value:function(t,n,i,r){var o,a,s,l=this,c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function d(t){return t.replace(/\$/g,"$$$$")}var u=function(t){if(0>t.indexOf(l.formatSeparator)){var o=ns(n,c,t);return l.alwaysFormat?l.format(o,void 0,i,nS(nS(nS({},r),n),{},{interpolationkey:t})):o}var a=t.split(l.formatSeparator),s=a.shift().trim(),d=a.join(l.formatSeparator).trim();return l.format(ns(n,c,s),d,i,nS(nS(nS({},r),n),{},{interpolationkey:s}))};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,m=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(t){return d(t)}},{regex:this.regexp,safeValue:function(t){return l.escapeValue?d(l.escape(t)):d(t)}}].forEach(function(n){for(s=0;o=n.regex.exec(t);){var i=o[1].trim();if(void 0===(a=u(i)))if("function"==typeof h){var c=h(t,o,r);a="string"==typeof c?c:""}else if(r&&r.hasOwnProperty(i))a="";else if(m){a=o[0];continue}else l.logger.warn("missed to pass in variable ".concat(i," for interpolating ").concat(t)),a="";else"string"==typeof a||l.useRawValueToEscape||(a=ni(a));var d=n.safeValue(a);if(t=t.replace(o[0],d),m?(n.regex.lastIndex+=a.length,n.regex.lastIndex-=o[0].length):n.regex.lastIndex=0,++s>=l.maxReplaces)break}}),t}},{key:"nest",value:function(t,n){var i,r,o=this,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=nS({},a);function l(t,n){var i=this.nestingOptionsSeparator;if(0>t.indexOf(i))return t;var r=t.split(new RegExp("".concat(i,"[ ]*{"))),o="{".concat(r[1]);t=r[0];var a=(o=this.interpolate(o,s)).match(/'/g),l=o.match(/"/g);(a&&a.length%2==0&&!l||l.length%2!=0)&&(o=o.replace(/'/g,'"'));try{s=JSON.parse(o),n&&(s=nS(nS({},n),s))}catch(n){return this.logger.warn("failed parsing options string in nesting for key ".concat(t),n),"".concat(t).concat(i).concat(o)}return delete s.defaultValue,t}for(s.applyPostProcessor=!1,delete s.defaultValue;i=this.nestingRegexp.exec(t);){var c=[],d=!1;if(-1!==i[0].indexOf(this.formatSeparator)&&!/{.*}/.test(i[1])){var u=i[1].split(this.formatSeparator).map(function(t){return t.trim()});i[1]=u.shift(),c=u,d=!0}if((r=n(l.call(this,i[1].trim(),s),s))&&i[0]===t&&"string"!=typeof r)return r;"string"!=typeof r&&(r=ni(r)),r||(this.logger.warn("missed to resolve ".concat(i[1]," for nesting ").concat(t)),r=""),d&&(r=c.reduce(function(t,n){return o.format(t,n,a.lng,nS(nS({},a),{},{interpolationkey:i[1].trim()}))},r.trim())),t=t.replace(i[0],r),this.regexp.lastIndex=0}return t}}]),t}();function nD(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function nP(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nD(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nD(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function nR(t){var n={};return function(i,r,o){var a=r+JSON.stringify(o),s=n[a];return s||(s=t(r,o),n[a]=s),s(i)}}var nO=function(){function t(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};tZ(this,t),this.logger=ne.create("formatter"),this.options=n,this.formats={number:nR(function(t,n){var i=new Intl.NumberFormat(t,n);return function(t){return i.format(t)}}),currency:nR(function(t,n){var i=new Intl.NumberFormat(t,nP(nP({},n),{},{style:"currency"}));return function(t){return i.format(t)}}),datetime:nR(function(t,n){var i=new Intl.DateTimeFormat(t,nP({},n));return function(t){return i.format(t)}}),relativetime:nR(function(t,n){var i=new Intl.RelativeTimeFormat(t,nP({},n));return function(t){return i.format(t,n.range||"day")}}),list:nR(function(t,n){var i=new Intl.ListFormat(t,nP({},n));return function(t){return i.format(t)}})},this.init(n)}return tQ(t,[{key:"init",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},i=n.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(t,n){this.formats[t.toLowerCase().trim()]=n}},{key:"addCached",value:function(t,n){this.formats[t.toLowerCase().trim()]=nR(n)}},{key:"format",value:function(t,n,i,r){var o=this;return n.split(this.formatSeparator).reduce(function(t,n){var a=function(t){var n=t.toLowerCase().trim(),i={};if(t.indexOf("(")>-1){var r=t.split("(");n=r[0].toLowerCase().trim();var o=r[1].substring(0,r[1].length-1);"currency"===n&&0>o.indexOf(":")?i.currency||(i.currency=o.trim()):"relativetime"===n&&0>o.indexOf(":")?i.range||(i.range=o.trim()):o.split(";").forEach(function(t){if(t){var n,r=function(t){if(Array.isArray(t))return t}(n=t.split(":"))||function(t){if("u">typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||function(t){if(t){if("string"==typeof t)return t6(t,void 0);var n=({}).toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t6(t,void 0):void 0}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],a=r.slice(1).join(":").trim().replace(/^'+|'+$/g,"");i[o.trim()]||(i[o.trim()]=a),"false"===a&&(i[o.trim()]=!1),"true"===a&&(i[o.trim()]=!0),isNaN(a)||(i[o.trim()]=parseInt(a,10))}})}return{formatName:n,formatOptions:i}}(n),s=a.formatName,l=a.formatOptions;if(o.formats[s]){var c=t;try{var d=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},u=d.locale||d.lng||r.locale||r.lng||i;c=o.formats[s](t,u,nP(nP(nP({},l),r),d))}catch(t){o.logger.warn(t)}return c}return o.logger.warn("there was no format function for ".concat(s)),t},t)}}]),t}();function nM(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function nL(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nM(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nM(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}var nB=function(t){t2(r,t);var n,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t5(r);return t=n?Reflect.construct(i,arguments,t5(this).constructor):i.apply(this,arguments),t3(this,t)});function r(t,n,o){var a,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return tZ(this,r),a=i.call(this),nu&&nt.call(t0(a)),a.backend=t,a.store=n,a.services=o,a.languageUtils=o.languageUtils,a.options=s,a.logger=ne.create("backendConnector"),a.waitingReads=[],a.maxParallelReads=s.maxParallelReads||10,a.readingCalls=0,a.maxRetries=s.maxRetries>=0?s.maxRetries:5,a.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,a.state={},a.queue=[],a.backend&&a.backend.init&&a.backend.init(o,s.backend,s),a}return tQ(r,[{key:"queueLoad",value:function(t,n,i,r){var o=this,a={},s={},l={},c={};return t.forEach(function(t){var r=!0;n.forEach(function(n){var l="".concat(t,"|").concat(n);!i.reload&&o.store.hasResourceBundle(t,n)?o.state[l]=2:o.state[l]<0||(1===o.state[l]?void 0===s[l]&&(s[l]=!0):(o.state[l]=1,r=!1,void 0===s[l]&&(s[l]=!0),void 0===a[l]&&(a[l]=!0),void 0===c[n]&&(c[n]=!0)))}),r||(l[t]=!0)}),(Object.keys(a).length||Object.keys(s).length)&&this.queue.push({pending:s,pendingCount:Object.keys(s).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(a),pending:Object.keys(s),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}},{key:"loaded",value:function(t,n,i){var r=t.split("|"),o=r[0],a=r[1];n&&this.emit("failedLoading",o,a,n),i&&this.store.addResourceBundle(o,a,i),this.state[t]=n?-1:2;var s={};this.queue.forEach(function(i){var r,l,c,d;r=i.loaded,(c=(l=nr(r,[o],Object)).obj)[d=l.k]=c[d]||[],c[d].push(a),void 0!==i.pending[t]&&(delete i.pending[t],i.pendingCount--),n&&i.errors.push(n),0!==i.pendingCount||i.done||(Object.keys(i.loaded).forEach(function(t){s[t]||(s[t]={});var n=i.loaded[t];n.length&&n.forEach(function(n){void 0===s[t][n]&&(s[t][n]=!0)})}),i.done=!0,i.errors.length?i.callback(i.errors):i.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(function(t){return!t.done})}},{key:"read",value:function(t,n,i){var r=this,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,s=arguments.length>5?arguments[5]:void 0;return t.length?this.readingCalls>=this.maxParallelReads?void this.waitingReads.push({lng:t,ns:n,fcName:i,tried:o,wait:a,callback:s}):(this.readingCalls++,this.backend[i](t,n,function(l,c){if(r.readingCalls--,r.waitingReads.length>0){var d=r.waitingReads.shift();r.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}l&&c&&o<r.maxRetries?setTimeout(function(){r.read.call(r,t,n,i,o+1,2*a,s)},a):s(l,c)})):s(null,{})}},{key:"prepareLoading",value:function(t,n){var i=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),o&&o();"string"==typeof t&&(t=this.languageUtils.toResolveHierarchy(t)),"string"==typeof n&&(n=[n]);var a=this.queueLoad(t,n,r,o);if(!a.toLoad.length)return a.pending.length||o(),null;a.toLoad.forEach(function(t){i.loadOne(t)})}},{key:"load",value:function(t,n,i){this.prepareLoading(t,n,{},i)}},{key:"reload",value:function(t,n,i){this.prepareLoading(t,n,{reload:!0},i)}},{key:"loadOne",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=t.split("|"),o=r[0],a=r[1];this.read(o,a,"read",void 0,void 0,function(r,s){r&&n.logger.warn("".concat(i,"loading namespace ").concat(a," for language ").concat(o," failed"),r),!r&&s&&n.logger.log("".concat(i,"loaded namespace ").concat(a," for language ").concat(o),s),n.loaded(t,r,s)})}},{key:"saveMissing",value:function(t,n,i,r,o){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)?this.logger.warn('did not save key "'.concat(i,'" as the namespace "').concat(n,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null==i||""===i||(this.backend&&this.backend.create&&this.backend.create(t,n,i,r,null,nL(nL({},a),{},{isUpdate:o})),t&&t[0]&&this.store.addResource(t[0],n,i,r))}}]),r}(nt);function nz(t){return"string"==typeof t.ns&&(t.ns=[t.ns]),"string"==typeof t.fallbackLng&&(t.fallbackLng=[t.fallbackLng]),"string"==typeof t.fallbackNS&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&0>t.supportedLngs.indexOf("cimode")&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function nN(t,n){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);n&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),i.push.apply(i,r)}return i}function nU(t){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?nN(Object(i),!0).forEach(function(n){t4(t,n,i[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):nN(Object(i)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(i,n))})}return t}function nj(){}var nV=function(t){t2(r,t);var n,i=(n=function(){if("u"<typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}(),function(){var t,i=t5(r);return t=n?Reflect.construct(i,arguments,t5(this).constructor):i.apply(this,arguments),t3(this,t)});function r(){var t,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=arguments.length>1?arguments[1]:void 0;if(tZ(this,r),n=i.call(this),nu&&nt.call(t0(n)),n.options=nz(o),n.services={},n.logger=ne,n.modules={external:[]},Object.getOwnPropertyNames(Object.getPrototypeOf(t=t0(n))).forEach(function(n){"function"==typeof t[n]&&(t[n]=t[n].bind(t))}),a&&!n.isInitialized&&!o.isClone){if(!n.options.initImmediate)return n.init(o,a),t3(n,t0(n));setTimeout(function(){n.init(o,a)},0)}return n}return tQ(r,[{key:"init",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1?arguments[1]:void 0;"function"==typeof n&&(i=n,n={}),!n.defaultNS&&!1!==n.defaultNS&&n.ns&&("string"==typeof n.ns?n.defaultNS=n.ns:0>n.ns.indexOf("translation")&&(n.defaultNS=n.ns[0]));var r={debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){var n={};if("object"===tX(t[1])&&(n=t[1]),"string"==typeof t[1]&&(n.defaultValue=t[1]),"string"==typeof t[2]&&(n.tDescription=t[2]),"object"===tX(t[2])||"object"===tX(t[3])){var i=t[3]||t[2];Object.keys(i).forEach(function(t){n[t]=i[t]})}return n},interpolation:{escapeValue:!0,format:function(t,n,i,r){return t},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}};function o(t){return t?"function"==typeof t?new t:t:null}if(this.options=nU(nU(nU({},r),this.options),nz(n)),"v1"!==this.options.compatibilityAPI&&(this.options.interpolation=nU(nU({},r.interpolation),this.options.interpolation)),void 0!==n.keySeparator&&(this.options.userDefinedKeySeparator=n.keySeparator),void 0!==n.nsSeparator&&(this.options.userDefinedNsSeparator=n.nsSeparator),!this.options.isClone){this.modules.logger?ne.init(o(this.modules.logger),this.options):ne.init(null,this.options),this.modules.formatter?a=this.modules.formatter:"u">typeof Intl&&(a=nO);var a,s=new nF(this.options);this.store=new nf(this.options.resources,this.options);var l=this.services;l.logger=ne,l.resourceStore=this.store,l.languageUtils=s,l.pluralResolver=new nk(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(l.formatter=o(a),l.formatter.init(l,this.options),this.options.interpolation.format=l.formatter.format.bind(l.formatter)),l.interpolator=new nI(this.options),l.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},l.backendConnector=new nB(o(this.modules.backend),l.resourceStore,l,this.options),l.backendConnector.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];t.emit.apply(t,[n].concat(r))}),this.modules.languageDetector&&(l.languageDetector=o(this.modules.languageDetector),l.languageDetector.init(l,this.options.detection,this.options)),this.modules.i18nFormat&&(l.i18nFormat=o(this.modules.i18nFormat),l.i18nFormat.init&&l.i18nFormat.init(this)),this.translator=new nv(this.services,this.options),this.translator.on("*",function(n){for(var i=arguments.length,r=Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];t.emit.apply(t,[n].concat(r))}),this.modules.external.forEach(function(n){n.init&&n.init(t)})}if(this.format=this.options.interpolation.format,i||(i=nj),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var c=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);c.length>0&&"dev"!==c[0]&&(this.options.lng=c[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(function(n){t[n]=function(){var i;return(i=t.store)[n].apply(i,arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(function(n){t[n]=function(){var i;return(i=t.store)[n].apply(i,arguments),t}});var d=nn(),u=function(){var n=function(n,r){t.isInitialized&&!t.initializedStoreOnce&&t.logger.warn("init: i18next is already initialized. You should call init just once!"),t.isInitialized=!0,t.options.isClone||t.logger.log("initialized",t.options),t.emit("initialized",t.options),d.resolve(r),i(n,r)};if(t.languages&&"v1"!==t.options.compatibilityAPI&&!t.isInitialized)return n(null,t.t.bind(t));t.changeLanguage(t.options.lng,n)};return this.options.resources||!this.options.initImmediate?u():setTimeout(u,0),d}},{key:"loadResources",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nj,r=i,o="string"==typeof t?t:this.language;if("function"==typeof t&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(o&&"cimode"===o.toLowerCase())return r();var a=[],s=function(t){t&&n.services.languageUtils.toResolveHierarchy(t).forEach(function(t){0>a.indexOf(t)&&a.push(t)})};o?s(o):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(function(t){return s(t)}),this.options.preload&&this.options.preload.forEach(function(t){return s(t)}),this.services.backendConnector.load(a,this.options.ns,function(t){t||n.resolvedLanguage||!n.language||n.setResolvedLanguage(n.language),r(t)})}else r(null)}},{key:"reloadResources",value:function(t,n,i){var r=nn();return t||(t=this.languages),n||(n=this.options.ns),i||(i=nj),this.services.backendConnector.reload(t,n,function(t){r.resolve(),i(t)}),r}},{key:"use",value:function(t){if(!t)throw Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===t.type&&(this.modules.backend=t),("logger"===t.type||t.log&&t.warn&&t.error)&&(this.modules.logger=t),"languageDetector"===t.type&&(this.modules.languageDetector=t),"i18nFormat"===t.type&&(this.modules.i18nFormat=t),"postProcessor"===t.type&&nb.addPostProcessor(t),"formatter"===t.type&&(this.modules.formatter=t),"3rdParty"===t.type&&this.modules.external.push(t),this}},{key:"setResolvedLanguage",value:function(t){if(t&&this.languages&&!(["cimode","dev"].indexOf(t)>-1))for(var n=0;n<this.languages.length;n++){var i=this.languages[n];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}}},{key:"changeLanguage",value:function(t,n){var i=this;this.isLanguageChangingTo=t;var r=nn();this.emit("languageChanging",t);var o=function(t){i.language=t,i.languages=i.services.languageUtils.toResolveHierarchy(t),i.resolvedLanguage=void 0,i.setResolvedLanguage(t)},a=function(t,a){a?(o(a),i.translator.changeLanguage(a),i.isLanguageChangingTo=void 0,i.emit("languageChanged",a),i.logger.log("languageChanged",a)):i.isLanguageChangingTo=void 0,r.resolve(function(){return i.t.apply(i,arguments)}),n&&n(t,function(){return i.t.apply(i,arguments)})},s=function(n){t||n||!i.services.languageDetector||(n=[]);var r="string"==typeof n?n:i.services.languageUtils.getBestMatchFromCodes(n);r&&(i.language||o(r),i.translator.language||i.translator.changeLanguage(r),i.services.languageDetector&&i.services.languageDetector.cacheUserLanguage(r)),i.loadResources(r,function(t){a(t,r)})};return t||!this.services.languageDetector||this.services.languageDetector.async?!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(s):s(t):s(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(t,n,i){var r=this,o=function t(n,o){if("object"!==tX(o)){for(var a,s=arguments.length,l=Array(s>2?s-2:0),c=2;c<s;c++)l[c-2]=arguments[c];a=r.options.overloadTranslationOptionHandler([n,o].concat(l))}else a=nU({},o);a.lng=a.lng||t.lng,a.lngs=a.lngs||t.lngs,a.ns=a.ns||t.ns,a.keyPrefix=a.keyPrefix||i||t.keyPrefix;var d=r.options.keySeparator||".",u=a.keyPrefix?"".concat(a.keyPrefix).concat(d).concat(n):n;return r.t(u,a)};return"string"==typeof t?o.lng=t:o.lngs=t,o.ns=n,o.keyPrefix=i,o}},{key:"t",value:function(){var t;return this.translator&&(t=this.translator).translate.apply(t,arguments)}},{key:"exists",value:function(){var t;return this.translator&&(t=this.translator).exists.apply(t,arguments)}},{key:"setDefaultNamespace",value:function(t){this.options.defaultNS=t}},{key:"hasLoadedNamespace",value:function(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.resolvedLanguage||this.languages[0],o=!!this.options&&this.options.fallbackLng,a=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(t,i){var r=n.services.backendConnector.state["".concat(t,"|").concat(i)];return -1===r||2===r};if(i.precheck){var l=i.precheck(this,s);if(void 0!==l)return l}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||s(r,t)&&(!o||s(a,t)))}},{key:"loadNamespaces",value:function(t,n){var i=this,r=nn();return this.options.ns?("string"==typeof t&&(t=[t]),t.forEach(function(t){0>i.options.ns.indexOf(t)&&i.options.ns.push(t)}),this.loadResources(function(t){r.resolve(),n&&n(t)}),r):(n&&n(),Promise.resolve())}},{key:"loadLanguages",value:function(t,n){var i=nn();"string"==typeof t&&(t=[t]);var r=this.options.preload||[],o=t.filter(function(t){return 0>r.indexOf(t)});return o.length?(this.options.preload=r.concat(o),this.loadResources(function(t){i.resolve(),n&&n(t)}),i):(n&&n(),Promise.resolve())}},{key:"dir",value:function(t){return(t||(t=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),t)?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(this.services.languageUtils.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr":"rtl"}},{key:"cloneInstance",value:function(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nj,o=nU(nU(nU({},this.options),n),{isClone:!0}),a=new r(o);return(void 0!==n.debug||void 0!==n.prefix)&&(a.logger=a.logger.clone(n)),["store","services","language"].forEach(function(n){a[n]=t[n]}),a.services=nU({},this.services),a.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a.translator=new nv(a.services,a.options),a.translator.on("*",function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];a.emit.apply(a,[t].concat(i))}),a.init(o,i),a.translator.options=a.options,a.translator.backendConnector.services.utils={hasLoadedNamespace:a.hasLoadedNamespace.bind(a)},a}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),r}(nt);t4(nV,"createInstance",function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new nV(t,n)});var n$=nV.createInstance();n$.createInstance=nV.createInstance,n$.createInstance,n$.init,n$.loadResources,n$.reloadResources,n$.use,n$.changeLanguage,n$.getFixedT,n$.t,n$.exists,n$.setDefaultNamespace,n$.hasLoadedNamespace,n$.loadNamespaces,n$.loadLanguages;let nq=n$;var nG=i(4867),nH=i.n(nG);i(3472);class nW{get resolve(){return this._resolve}get reject(){return this._reject}get promise(){return this._promise}constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n}),Object.freeze(this)}}function nY(t,n,i=!0){if(null==t||null==n)return t===n;if(t.constructor!==n.constructor)return!1;if(t instanceof Function||t instanceof RegExp)return t===n;if(t===n||t.valueOf()===n.valueOf())return!0;if(Array.isArray(t)&&t.length!==n.length||t instanceof Date||!(t instanceof Object)||!(n instanceof Object))return!1;if(i){if(Array.isArray(t))return t.every((t,i)=>nY(t,n[i]));let i=Object.keys(t);return Object.keys(n).every(t=>-1!==i.indexOf(t))&&i.every(i=>nY(t[i],n[i]))}return!1}function nX(t){if(null==t)return"";let n=!1;return t.split(/([A-Z]|\d)/).map((t,i,r)=>{if(!t)return t;if(!n)return n=!0,t.charAt(0).toUpperCase()+t.slice(1);if("_"===t)return" ";if(1===t.length&&t===t.toUpperCase()){let n=!r[i-1]||"_"===r[i-1],o=i+1<r.length&&r[i+1]&&"_"!==r[i+1],a=i+3>r.length||!r[i+1]&&!r[i+3];(!n||o)&&(t=" "+t),!o&&(n||a)||(t=t.toLowerCase())}return t}).join("").trim()}function nZ(t,n,i){let r="string"==typeof t?t:t.name;return n&&n.meta&&n.meta.hasOwnProperty(r)?n.meta[r]:i&&i.meta?i.meta[r]:void 0}function nK(t){return("string"==typeof t&&(t=tY.getAssetDescriptor(t)),t)?nq.t("label.asset."+t.name,{defaultValue:nX(t.name)}):""}function nJ(t,n,i,r,o,a){let s=nQ(t?t.value:void 0,()=>n1("format",t,n,i,o),void 0,a),l=n1("units",t,n,i,!0);return r&&l&&l.length&&(s=n0(n1("units",t,n,i,o),s)),s}function nQ(t,n,i,r){let o="";if(null==t)o=r||"";else if("string"==typeof t)o=t;else if("number"==typeof t||"boolean"==typeof t||t instanceof Date){let r=n&&n();if(r&&0!==Object.keys(r).length)switch("number"==typeof t?r.asBoolean?t=!!t:r.asDate&&(t=new Date(t)):"boolean"==typeof t&&r.asNumber&&(t=+!!t),typeof t){case"number":o=new Intl.NumberFormat(i||nq.language,r).format(t);break;case"boolean":r.asOnOff&&(o=t?nq.t("on"):nq.t("off")),r.asOpenClosed&&(o=t?nq.t("open"):nq.t("closed")),r.asPressedReleased&&(o=t?nq.t("pressed"):nq.t("released"));break;case"object":if(r.momentJsFormat)o=nH()(t).format(r.momentJsFormat);else if(r.iso8601)o=t.toISOString();else if(r.week){var a;let n,i=((a=new Date(Date.UTC((a=t).getFullYear(),a.getMonth(),a.getDate()))).setUTCDate(a.getUTCDate()+4-(a.getUTCDay()||7)),n=new Date(Date.UTC(a.getUTCFullYear(),0,1)),Math.ceil(((a.getTime()-n.getTime())/864e5+1)/7));o="2-digit"===r.week?String(i).padStart(2,"0"):Number(i).toString(10)}else o=new Intl.DateTimeFormat(i||nq.language,r).format(t)}else o=Object(t).toString()}return o}function n0(t,n){if(!t)return"";n||(n="");let i=t.map((t,i)=>{if(3!==t.length||t.toUpperCase()!==t)return nq.t(["units."+t,"or:units."+t]);{let r=new Intl.NumberFormat(nq.language,{currency:t,style:"currency"}).formatToParts();if(0!==i||"currency"!==r[0].type)return"currency"===r[0].type?r[0].value:r[r.length-1].value;if(!n)return r[0].value;n=r[0].value+n}}).join("");return n.length>0?n+" "+i:i}function n1(t,n,i,r,o){let a,s=[],l=n2(t,n&&"string"==typeof n?n:n?n.name:i?"string"==typeof i?i:i.name:void 0,i,r,o);if(l&&(a=JSON.parse(l)))if("format"!==t)return a;else s.push(a);if(n&&n.meta&&(a=nZ(t,n,i)))if("format"!==t)return a;else s.push(a);if(i&&"string"!=typeof i&&i.hasOwnProperty(t)){if(a=i[t],"format"!==t)return a;s.push(a)}if(i&&i.type){if(a=tY.getValueDescriptor(i.type)[t],"format"!==t)return a;s.push(a)}if("format"!==t||0===s.length)return a;let c={};return s.reverse().forEach(t=>{c=Object.assign(Object.assign({},c),t)}),c}function n2(t,n,i,r,o,a){let s;if(n?s="string"==typeof n?n:n.name:i&&(s="string"==typeof i?i:i.name),!s)return;let l=[],c=t+"."+(o?"attribute":"meta")+".";if(r&&l.push(c+r+"."+s),i&&"string"!=typeof i&&(l.push(c+i.type+"."+s),l.push(c+i.type)),l.push(c+s),l.length>0)return nq.t(l,{defaultValue:a||""})}function n3(t,n){let i=n.ref.name;if(t.attributes)if(n.deleted)delete t.attributes[i];else{let r=t.attributes[i];r&&(r.value=n.value,r.timestamp=n.timestamp)}return Object.assign({},t)}class n5{constructor(t){t&&Object.assign(this,t)}matches(t){var n,i,r,o,a,s,l;if((null==(n=this.ids)?void 0:n.length)&&(!t.id||!this.ids.includes(t.id))||(null==(i=this.types)?void 0:i.length)&&(!t.type||!this.types.includes(t.type))||(null==(r=this.realm)?void 0:r.name)&&t.realm!==this.realm.name||(null==(o=this.parents)?void 0:o.length)&&!this.parents.some(n=>!n.id||t.parentId===n.id))return!1;if(null==(a=this.paths)?void 0:a.length){let n=null!=(s=t.path)?s:[];if(!this.paths.some(t=>{var i;return(null!=(i=t.path)?i:[]).every((t,i)=>n[i]===t)}))return!1}return(null==(l=this.names)||!l.length||!!this.names.every(n=>n5._evalValuePredicate(t.name,n)))&&(!this.attributes||n5._evalGroup(t,this.attributes))}static getUnsupportedFields(t){return Object.keys(t).filter(t=>!n5._SUPPORTED_FIELDS.has(t))}collectAttributeNames(){return this.attributes?n5._collectNames(this.attributes):[]}static _evalValuePredicate(t,n){var i;switch(n.predicateType){case"string":{let r;if(null==t)return!1;let o=!1!==n.caseSensitive?String(t):String(t).toLowerCase(),a=!1!==n.caseSensitive?n.value:null==(i=n.value)?void 0:i.toLowerCase();switch(n.match){case"BEGIN":r=o.startsWith(a);break;case"END":r=o.endsWith(a);break;case"CONTAINS":r=o.includes(a);break;default:r=o===a}return n.negate?!r:r}case"boolean":return t===n.value;case"number":{let i;if("number"!=typeof t)return!1;switch(n.operator){case"GREATER_THAN":i=t>n.value;break;case"GREATER_EQUALS":i=t>=n.value;break;case"LESS_THAN":i=t<n.value;break;case"LESS_EQUALS":i=t<=n.value;break;case"BETWEEN":i=t>=n.value&&t<=n.rangeValue;break;default:i=t===n.value}return n.negate?!i:i}}return!1}static _evalPredicate(t,n){var i,r;let o=null==(i=n.name)?void 0:i.value;if(!o)return!0;let a=null==(r=t.attributes)?void 0:r[o];if(!a)return!!n.negated;let s=!n.value||n5._evalValuePredicate(a.value,n.value);return n.negated?!s:s}static _evalGroup(t,n){var i,r,o;let a=null!=(i=n.operator)?i:"AND",s=[...(null!=(r=n.items)?r:[]).map(n=>n5._evalPredicate(t,n)),...(null!=(o=n.groups)?o:[]).map(n=>n5._evalGroup(t,n))];return!s.length||("OR"===a?s.some(Boolean):s.every(Boolean))}static _collectNames(t){var n,i;return[...(null!=(n=t.items)?n:[]).map(t=>{var n;return null==(n=t.name)?void 0:n.value}).filter(t=>!!t),...(null!=(i=t.groups)?i:[]).flatMap(t=>n5._collectNames(t))]}}n5._SUPPORTED_FIELDS=new Set(["ids","types","names","parents","paths","realm","attributes"]);var n4=function(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})};let n6=i(4461);class n8{constructor(t,n,i){this._autoEnable=!1,this._initialised=!1,this._initialiseInProgress=!1,this._pendingProviderPromises={},this._providerMessageListeners={},this._pendingProviderEnables=[],this._registrationTimer=null,this._realm=t,this._autoEnable=n,this._enableCompleteCallback=i,window.OpenRemoteConsole=this;let r=new URLSearchParams(window.location.search),o=r.get("consoleName"),a=r.get("consoleVersion"),s=r.get("consolePlatform"),l=r.get("consoleProviders"),c=r.get("consoleAutoEnable"),d=l&&l.length>0?l.split(" "):["push"];this._pendingProviderEnables=d;let u=n8._createConsoleRegistration(),h=window.localStorage.getItem(this._storageKey);if(h)try{let t=JSON.parse(h);t.id&&(u.id=t.id),t.name&&(u.name=t.name),t.providers&&(u.providers=t.providers),t.apps&&(u.apps=t.apps)}catch(t){console.error("Failed to deserialise console registration")}let m=u.providers;for(let t of(u.providers={},d)){let n=m&&m.hasOwnProperty(t)?m[t]:{enabled:!1,disabled:!1};u.providers[t]=n}let p=sq.getAppName();p.length>0&&0>u.apps.indexOf(p)&&u.apps.push(p),this._registration=u,o&&(u.name=o),a&&(u.version=a),s&&(u.platform=s),c&&(this._autoEnable="TRUE"===c||"true"===c)}get registration(){return this._registration}get autoEnable(){return this._autoEnable}get pendingProviderEnables(){return this._pendingProviderEnables.slice(0)}get shellApple(){let t=navigator.userAgentData&&navigator.userAgentData.platform?navigator.userAgentData.platform:navigator.platform;return t&&("iP"===t.substring(0,2)||"Mac"===t.substring(0,3))&&window.webkit&&window.webkit.messageHandlers}get shellAndroid(){return!!window.MobileInterface}get isMobile(){return this.shellApple||this.shellAndroid}initialise(){return n4(this,void 0,void 0,function*(){if(!this._initialised&&!this._initialiseInProgress){console.debug("Console: initialising"),this._initialiseInProgress=!0;try{if(this._registration.providers)for(let t of Object.keys(this._registration.providers))yield this._initialiseProvider(t);this._registration.id||(yield this.sendRegistration()),this._initialised=!0,this._initialiseInProgress=!1,0===this._pendingProviderEnables.length?(yield this.sendRegistration(),this._callCompletedCallback()):this._autoEnable&&(yield this.enableProviders())}catch(t){console.error(t)}finally{this._initialiseInProgress=!1}}})}enableProviders(){return n4(this,void 0,void 0,function*(){if(!this._initialised)throw Error("Console must be initialised before enabling providers");for(let t=this._pendingProviderEnables.length-1;t>-1;t--){let n=this._pendingProviderEnables[t];yield this.enableProvider(n)}})}enableProvider(t,n){return n4(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before enabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: enabling provider '"+t+"'");let i={provider:t,action:"PROVIDER_ENABLE",consoleId:this._registration.id,data:n},r=yield this.sendProviderMessage(i,!0);this._registration.providers[t].hasPermission=r.hasPermission,this._registration.providers[t].success=r.success,this._registration.providers[t].enabled=r.success,this._registration.providers[t].data=r.data;let o=this._pendingProviderEnables.indexOf(t);return o>=0&&(this._pendingProviderEnables.splice(o,1),0===this._pendingProviderEnables.length&&(this.sendRegistration().catch(()=>void 0),this._callCompletedCallback())),r})}disableProvider(t){return n4(this,void 0,void 0,function*(){if(!this._initialised)throw console.debug("Console must be initialised before disabling providers"),Error("Console must be initialised before disabling providers");if(!this._registration.providers.hasOwnProperty(t))throw console.debug("Invalid console provider '"+t+"'"),Error("Invalid console provider '"+t+"'");console.debug("Console: disabling provider '"+t+"'");let n=yield this.sendProviderMessage({provider:t,action:"PROVIDER_DISABLE"},!0);return this._registration.providers[t].disabled=!0,this._registration.providers[t].enabled=!1,n})}getProvider(t){return this._registration&&this._registration.providers?this._registration.providers[t]:void 0}sendProviderMessage(t,n){return n4(this,void 0,void 0,function*(){if("storage"!==t.provider&&!this._registration.providers.hasOwnProperty(t.provider))throw console.debug("Invalid console provider '"+t.provider+"'"),Error("Invalid console provider '"+t.provider+"'");if(!n)return void this._doSendProviderMessage(t);let i=t.provider+t.action;if(this._pendingProviderPromises[i])throw Error("Message already pending for provider '"+t.provider+"' with action '"+t.action+"'");let r=new nW,o=()=>{delete this._pendingProviderPromises[i],r.reject("No response from provider")};return this._pendingProviderPromises[i]=[r,window.setTimeout(o,5e3)],this._doSendProviderMessage(t),r.promise})}sendRegistration(){return this._registrationTimer&&(window.clearTimeout(this._registrationTimer),this._registrationTimer=null),new Promise((t,n)=>{this._registrationTimer=window.setTimeout(()=>n4(this,void 0,void 0,function*(){this._registrationTimer=null,console.debug("Console: updating registration");try{yield this._sendRegistration(!0),t()}catch(t){console.error("Failed to register console",t),n(t)}}))})}_sendRegistration(t){return n4(this,void 0,void 0,function*(){this._normaliseRegistration();let n=!!this._registration.id;try{let t=yield sq.rest.api.ConsoleResource.register(this._registration);if(200!==t.status)throw Error("Failed to register console");this._registration=t.data,console.debug("Console: registration successful"),console.debug("Console: updating locally stored registration"),window.localStorage.setItem(this._storageKey,JSON.stringify(this._registration))}catch(i){if(t&&n&&n8._isStaleRegistrationResponse(i)){console.warn("Console registration ID is stale or cannot be claimed; creating a new console registration"),window.localStorage.removeItem(this._storageKey),delete this._registration.id,yield this._sendRegistration(!1);return}throw i}})}_normaliseRegistration(){this._registration.name||(this._registration.name="Console"),this._registration.platform||(this._registration.platform="N/A"),this._registration.version||(this._registration.version="N/A"),this._registration.providers||(this._registration.providers={})}get _storageKey(){return"OpenRemoteConsole:"+this._realm}static _isStaleRegistrationResponse(t){let n=t&&t.response?t.response.status:void 0;return 403===n||409===n}storeData(t,n){this.sendProviderMessage({provider:"storage",action:"STORE",key:t,value:n},!1)}retrieveData(t){return n4(this,void 0,void 0,function*(){let n=this.sendProviderMessage({provider:"storage",action:"RETRIEVE",key:t},!0);try{let t=yield Promise.race([n,new Promise((t,n)=>setTimeout(n,2e3))]);if(t&&t.value){let n=t.value;return"null"===n?void 0:n}}catch(t){console.log("Failed to retrieve data from storage provider")}})}addProviderMessageListener(t,n){this._providerMessageListeners[t.provider+t.action]=n}removeProviderMessageListener(t){delete this._providerMessageListeners[t.provider+t.action]}_postNativeShellMessage(t){try{if(this.shellAndroid)return window.MobileInterface.postMessage(JSON.stringify(t));if(this.shellApple)return window.webkit.messageHandlers.int.postMessage(t)}catch(t){console.error("Failed to send shell message towards console",t)}}_doSendGenericMessage(t,n){let i={type:t,data:n};this.isMobile?this._postNativeShellMessage(i):console.warn("Failed to send generic message to console.",i)}_doSendProviderMessage(t){if(this.isMobile)this._postNativeShellMessage({type:"provider",data:t});else{if(!t.provider||!t.action)return;switch(t.provider.trim().toUpperCase()){case"PUSH":switch(t.action.trim().toUpperCase()){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"push",version:"web",enabled:!0,disabled:!1,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"push",hasPermission:!0,success:!0}));break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;case"STORAGE":switch(t.action){case"PROVIDER_INIT":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_INIT",provider:"storage",version:"1.0.0",disabled:!1,enabled:!0,hasPermission:!0,requiresPermission:!1,success:!0}));break;case"PROVIDER_ENABLE":this._handleProviderResponse(JSON.stringify({action:"PROVIDER_ENABLE",provider:"storage",hasPermission:!0,success:!0}));break;case"STORE":{let n=t.key?t.key.trim():null;if(!n||0===n.length)throw Error("Storage provider 'store' action requires a `key`");null===t.value?window.localStorage.removeItem(n):window.localStorage.setItem(n,JSON.stringify(t.value))}break;case"RETRIEVE":{let n=t.key?t.key.trim():null;if(!n||0===n.length)throw Error("Storage provider 'retrieve' action requires a `key`");let i=window.localStorage.getItem(n);if(null!==i)try{i=JSON.parse(i)}catch(t){}this._handleProviderResponse(JSON.stringify({action:"RETRIEVE",provider:"storage",key:n,value:i}))}break;default:throw Error("Unsupported provider '"+t.provider+"' and action '"+t.action+"'")}break;default:console.error("Unsupported provider: "+t.provider)}}}_handleProviderResponse(t){if(!t)return;let n=JSON.parse(t),i=n.provider,r=n.action,o=this._pendingProviderPromises[i+r];o&&(window.clearTimeout(o[1]),delete this._pendingProviderPromises[i+r],o[0].resolve(n));let a=this._providerMessageListeners[i+r];a&&a(n)}_callCompletedCallback(){let t=this._enableCompleteCallback;this._enableCompleteCallback=null,t&&window.setTimeout(()=>{t()},0)}static _createConsoleRegistration(){return{name:n6.name,version:n6.version,platform:n6.os.toString(),apps:[],model:((n6.manufacturer?n6.manufacturer+" ":"")+(n6.product?n6.product:"")).trim()}}_initialiseProvider(t){return n4(this,void 0,void 0,function*(){let n;console.debug("Console: initialising provider '"+t+"'");try{n=yield this.sendProviderMessage({provider:t,action:"PROVIDER_INIT"},!0),this._registration.providers[t].version=n.version,this._registration.providers[t].requiresPermission=n.requiresPermission,this._registration.providers[t].hasPermission=n.hasPermission,this._registration.providers[t].success=n.success,this._registration.providers[t].enabled=n.enabled,this._registration.providers[t].disabled=n.disabled,this._registration.providers[t].data=n.data}catch(t){console.error(t),n={action:"",disabled:!1,enabled:!1,hasPermission:!1,provider:"",requiresPermission:!1,version:"",success:!1}}if(n.success||(console.debug("Provider initialisation failed: '"+t+"'"),n.disabled=!0,this._registration.providers[t].disabled=!0),n.disabled||n.enabled){let n=this._pendingProviderEnables.indexOf(t);n>=0&&this._pendingProviderEnables.splice(n,1)}})}}function n7(t,n){return function(){return t.apply(n,arguments)}}let{toString:n9}=Object.prototype,{getPrototypeOf:ie}=Object,{iterator:it,toStringTag:ii}=Symbol,ir=(({hasOwnProperty:t})=>(n,i)=>t.call(n,i))(Object.prototype),io=(t,n)=>{let i=t,r=[];for(;null!=i&&i!==Object.prototype&&-1===r.indexOf(i);){if(r.push(i),ir(i,n))return!0;i=ie(i)}return!1},ia=(l=Object.create(null),t=>{let n=n9.call(t);return l[n]||(l[n]=n.slice(8,-1).toLowerCase())}),is=t=>(t=t.toLowerCase(),n=>ia(n)===t),il=t=>n=>typeof n===t,{isArray:ic}=Array,id=il("undefined");function iu(t){return null!==t&&!id(t)&&null!==t.constructor&&!id(t.constructor)&&ip(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}let ih=is("ArrayBuffer"),im=il("string"),ip=il("function"),ib=il("number"),ig=t=>null!==t&&"object"==typeof t,i_=t=>{if(!ig(t))return!1;let n=ie(t);return(null===n||n===Object.prototype||null===ie(n))&&!io(t,ii)&&!io(t,it)},iy=is("Date"),iv=is("File"),ix=is("Blob"),iF=is("FileList"),iw="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:"u">typeof global?global:{},iE=void 0!==iw.FormData?iw.FormData:void 0,iC=is("URLSearchParams"),[iA,ik,iT,iS]=["ReadableStream","Request","Response","Headers"].map(is);function iI(t,n,{allOwnKeys:i=!1}={}){let r,o;if(null!=t)if("object"!=typeof t&&(t=[t]),ic(t))for(r=0,o=t.length;r<o;r++)n.call(null,t[r],r,t);else{let o;if(iu(t))return;let a=i?Object.getOwnPropertyNames(t):Object.keys(t),s=a.length;for(r=0;r<s;r++)o=a[r],n.call(null,t[o],o,t)}}function iD(t,n){let i;if(iu(t))return null;n=n.toLowerCase();let r=Object.keys(t),o=r.length;for(;o-- >0;)if(n===(i=r[o]).toLowerCase())return i;return null}let iP="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:global,iR=t=>!id(t)&&t!==iP,iO=(c="u">typeof Uint8Array&&ie(Uint8Array),t=>c&&t instanceof c),iM=is("HTMLFormElement"),{propertyIsEnumerable:iL}=Object.prototype,iB=is("RegExp"),iz=(t,n)=>{let i=Object.getOwnPropertyDescriptors(t),r={};iI(i,(i,o)=>{let a;!1!==(a=n(i,o,t))&&(r[o]=a||i)}),Object.defineProperties(t,r)},iN=is("AsyncFunction"),iU=(h="function"==typeof setImmediate,m=ip(iP.postMessage),h?setImmediate:m?(p=`axios@${Math.random()}`,f=[],iP.addEventListener("message",({source:t,data:n})=>{t===iP&&n===p&&f.length&&f.shift()()},!1),t=>{f.push(t),iP.postMessage(p,"*")}):t=>setTimeout(t)),ij="u">typeof queueMicrotask?queueMicrotask.bind(iP):"u">typeof process&&process.nextTick||iU,iV=t=>null!=t&&ip(t[it]),i$={isArray:ic,isArrayBuffer:ih,isBuffer:iu,isFormData:t=>{if(!t)return!1;if(iE&&t instanceof iE)return!0;let n=ie(t);if(!n||n===Object.prototype||!ip(t.append))return!1;let i=ia(t);return"formdata"===i||"object"===i&&ip(t.toString)&&"[object FormData]"===t.toString()},isArrayBufferView:function(t){return"u">typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&ih(t.buffer)},isString:im,isNumber:ib,isBoolean:t=>!0===t||!1===t,isObject:ig,isPlainObject:i_,isEmptyObject:t=>{if(!ig(t)||iu(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:iA,isRequest:ik,isResponse:iT,isHeaders:iS,isUndefined:id,isDate:iy,isFile:iv,isReactNativeBlob:t=>!!(t&&void 0!==t.uri),isReactNative:t=>t&&void 0!==t.getParts,isBlob:ix,isRegExp:iB,isFunction:ip,isStream:t=>ig(t)&&ip(t.pipe),isURLSearchParams:iC,isTypedArray:iO,isFileList:iF,forEach:iI,merge:function t(...n){let{caseless:i,skipUndefined:r}=iR(this)&&this||{},o={},a=(n,a)=>{if("__proto__"===a||"constructor"===a||"prototype"===a)return;let s=i&&"string"==typeof a&&iD(o,a)||a,l=ir(o,s)?o[s]:void 0;i_(l)&&i_(n)?o[s]=t(l,n):i_(n)?o[s]=t({},n):ic(n)?o[s]=n.slice():r&&id(n)||(o[s]=n)};for(let t=0,i=n.length;t<i;t++){let i=n[t];if(!i||iu(i)||(iI(i,a),"object"!=typeof i||ic(i)))continue;let r=Object.getOwnPropertySymbols(i);for(let t=0;t<r.length;t++){let n=r[t];iL.call(i,n)&&a(i[n],n)}}return o},extend:(t,n,i,{allOwnKeys:r}={})=>(iI(n,(n,r)=>{i&&ip(n)?Object.defineProperty(t,r,{__proto__:null,value:n7(n,i),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,r,{__proto__:null,value:n,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,n,i,r)=>{t.prototype=Object.create(n.prototype,r),Object.defineProperty(t.prototype,"constructor",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{__proto__:null,value:n.prototype}),i&&Object.assign(t.prototype,i)},toFlatObject:(t,n,i,r)=>{let o,a,s,l={};if(n=n||{},null==t)return n;do{for(a=(o=Object.getOwnPropertyNames(t)).length;a-- >0;)s=o[a],(!r||r(s,t,n))&&!l[s]&&(n[s]=t[s],l[s]=!0);t=!1!==i&&ie(t)}while(t&&(!i||i(t,n))&&t!==Object.prototype);return n},kindOf:ia,kindOfTest:is,endsWith:(t,n,i)=>{t=String(t),(void 0===i||i>t.length)&&(i=t.length),i-=n.length;let r=t.indexOf(n,i);return -1!==r&&r===i},toArray:t=>{if(!t)return null;if(ic(t))return t;let n=t.length;if(!ib(n))return null;let i=Array(n);for(;n-- >0;)i[n]=t[n];return i},forEachEntry:(t,n)=>{let i,r=(t&&t[it]).call(t);for(;(i=r.next())&&!i.done;){let r=i.value;n.call(t,r[0],r[1])}},matchAll:(t,n)=>{let i,r=[];for(;null!==(i=t.exec(n));)r.push(i);return r},isHTMLForm:iM,hasOwnProperty:ir,hasOwnProp:ir,hasOwnInPrototypeChain:io,getSafeProp:(t,n)=>null!=t&&io(t,n)?t[n]:void 0,reduceDescriptors:iz,freezeMethods:t=>{iz(t,(n,i)=>{if(ip(t)&&["arguments","caller","callee"].includes(i))return!1;if(ip(t[i])){if(n.enumerable=!1,"writable"in n){n.writable=!1;return}n.set||(n.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},toObjectSet:(t,n)=>{let i={};return(ic(t)?t:String(t).split(n)).forEach(t=>{i[t]=!0}),i},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),noop:()=>{},toFiniteNumber:(t,n)=>null!=t&&Number.isFinite(t*=1)?t:n,findKey:iD,global:iP,isContextDefined:iR,isSpecCompliantForm:function(t){return!!(t&&ip(t.append)&&"FormData"===t[ii]&&t[it])},toJSONObject:t=>{let n=new WeakSet,i=t=>{if(ig(t)){if(n.has(t))return;if(iu(t))return t;if(!("toJSON"in t)){n.add(t);let r=ic(t)?[]:{};return iI(t,(t,n)=>{let o=i(t);id(o)||(r[n]=o)}),n.delete(t),r}}return t};return i(t)},isAsyncFn:iN,isThenable:t=>t&&(ig(t)||ip(t))&&ip(t.then)&&ip(t.catch),setImmediate:iU,asap:ij,isIterable:iV,isSafeIterable:t=>null!=t&&io(t,it)&&iV(t)},iq=i$.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),iG=RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),iH=RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function iW(t,n){return i$.isArray(t)?t.map(t=>iW(t,n)):function(t){let n=0,i=t.length;for(;n<i;){let i=t.charCodeAt(n);if(9!==i&&32!==i)break;n+=1}for(;i>n;){let n=t.charCodeAt(i-1);if(9!==n&&32!==n)break;i-=1}return 0===n&&i===t.length?t:t.slice(n,i)}(String(t).replace(n,""))}function iY(t){let n=Object.create(null);return i$.forEach(t.toJSON(),(t,i)=>{n[i]=iW(t,iH)}),n}let iX=Symbol("internals");function iZ(t){return t&&String(t).trim().toLowerCase()}function iK(t){return!1===t||null==t?t:i$.isArray(t)?t.map(iK):iW(String(t),iG)}function iJ(t,n,i,r,o){if(i$.isFunction(r))return r.call(this,n,i);if(o&&(n=i),i$.isString(n)){if(i$.isString(r))return -1!==n.indexOf(r);if(i$.isRegExp(r))return r.test(n)}}class iQ{constructor(t){t&&this.set(t)}set(t,n,i){let r=this;function o(t,n,i){let o=iZ(n);if(!o)return;let a=i$.findKey(r,o);a&&void 0!==r[a]&&!0!==i&&(void 0!==i||!1===r[a])||(r[a||n]=iK(t))}let a=(t,n)=>i$.forEach(t,(t,i)=>o(t,i,n));if(i$.isPlainObject(t)||t instanceof this.constructor)a(t,n);else{let r;if(i$.isString(t)&&(t=t.trim())&&(r=t,!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim()))){var s;let i,r,o,l;a((l={},(s=t)&&s.split("\n").forEach(function(t){o=t.indexOf(":"),i=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!i||l[i]&&iq[i]||("set-cookie"===i?l[i]?l[i].push(r):l[i]=[r]:l[i]=l[i]?l[i]+", "+r:r)}),l),n)}else if(i$.isObject(t)&&i$.isSafeIterable(t)){let i=Object.create(null),r,o;for(let n of t){if(!i$.isArray(n))throw TypeError("Object iterator must return a key-value pair");o=n[0],i$.hasOwnProp(i,o)?(r=i[o],i[o]=i$.isArray(r)?[...r,n[1]]:[r,n[1]]):i[o]=n[1]}a(i,n)}else null!=t&&o(n,t,i)}return this}get(t,n){if(t=iZ(t)){let i=i$.findKey(this,t);if(i){let t=this[i];if(!n)return t;if(!0===n){let n,i=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;n=r.exec(t);)i[n[1]]=n[2];return i}if(i$.isFunction(n))return n.call(this,t,i);if(i$.isRegExp(n))return n.exec(t);throw TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=iZ(t)){let i=i$.findKey(this,t);return!!(i&&void 0!==this[i]&&(!n||iJ(this,this[i],i,n)))}return!1}delete(t,n){let i=this,r=!1;function o(t){if(t=iZ(t)){let o=i$.findKey(i,t);o&&(!n||iJ(i,i[o],o,n))&&(delete i[o],r=!0)}}return i$.isArray(t)?t.forEach(o):o(t),r}clear(t){let n=Object.keys(this),i=n.length,r=!1;for(;i--;){let o=n[i];(!t||iJ(this,this[o],o,t,!0))&&(delete this[o],r=!0)}return r}normalize(t){let n=this,i={};return i$.forEach(this,(r,o)=>{let a=i$.findKey(i,o);if(a){n[a]=iK(r),delete n[o];return}let s=t?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,i)=>n.toUpperCase()+i):String(o).trim();s!==o&&delete n[o],n[s]=iK(r),i[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let n=Object.create(null);return i$.forEach(this,(i,r)=>{null!=i&&!1!==i&&(n[r]=t&&i$.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){let i=new this(t);return n.forEach(t=>i.set(t)),i}static accessor(t){let n=(this[iX]=this[iX]={accessors:{}}).accessors,i=this.prototype;function r(t){let r=iZ(t);if(!n[r]){let o;o=i$.toCamelCase(" "+t),["get","set","has"].forEach(n=>{Object.defineProperty(i,n+o,{__proto__:null,value:function(i,r,o){return this[n].call(this,t,i,r,o)},configurable:!0})}),n[r]=!0}}return i$.isArray(t)?t.forEach(r):r(t),this}}iQ.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),i$.reduceDescriptors(iQ.prototype,({value:t},n)=>{let i=n[0].toUpperCase()+n.slice(1);return{get:()=>t,set(t){this[i]=t}}}),i$.freezeMethods(iQ);class i0 extends Error{static from(t,n,i,r,o,a){let s=new i0(t.message,n||t.code,i,r,o);return Object.defineProperty(s,"cause",{__proto__:null,value:t,writable:!0,enumerable:!1,configurable:!0}),s.name=t.name,null!=t.status&&null==s.status&&(s.status=t.status),a&&Object.assign(s,a),s}constructor(t,n,i,r,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),i&&(this.config=i),r&&(this.request=r),o&&(this.response=o,this.status=o.status)}toJSON(){let t,n,i,r=this.config,o=r&&i$.hasOwnProp(r,"redact")?r.redact:void 0,a=i$.isArray(o)&&o.length>0?(t=new Set(o.map(t=>String(t).toLowerCase())),n=[],(i=r=>{let o;if(null===r||"object"!=typeof r||i$.isBuffer(r))return r;if(-1===n.indexOf(r)){if(r instanceof iQ&&(r=r.toJSON()),n.push(r),i$.isArray(r))o=[],r.forEach((t,n)=>{let r=i(t);i$.isUndefined(r)||(o[n]=r)});else{if(!i$.isPlainObject(r)&&function(t){if(i$.hasOwnProp(t,"toJSON"))return!0;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;){if(i$.hasOwnProp(n,"toJSON"))return!0;n=Object.getPrototypeOf(n)}return!1}(r))return n.pop(),r;for(let[n,a]of(o=Object.create(null),Object.entries(r))){let r=t.has(n.toLowerCase())?"[REDACTED ****]":i(a);i$.isUndefined(r)||(o[n]=r)}}return n.pop(),o}})(r)):i$.toJSONObject(r);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:a,code:this.code,status:this.status}}}i0.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE",i0.ERR_BAD_OPTION="ERR_BAD_OPTION",i0.ECONNABORTED="ECONNABORTED",i0.ETIMEDOUT="ETIMEDOUT",i0.ECONNREFUSED="ECONNREFUSED",i0.ERR_NETWORK="ERR_NETWORK",i0.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS",i0.ERR_DEPRECATED="ERR_DEPRECATED",i0.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE",i0.ERR_BAD_REQUEST="ERR_BAD_REQUEST",i0.ERR_CANCELED="ERR_CANCELED",i0.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT",i0.ERR_INVALID_URL="ERR_INVALID_URL",i0.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";let i1=i0;function i2(t){return i$.isPlainObject(t)||i$.isArray(t)}function i3(t){return i$.endsWith(t,"[]")?t.slice(0,-2):t}function i5(t,n,i){return t?t.concat(n).map(function(t,n){return t=i3(t),!i&&n?"["+t+"]":t}).join(i?".":""):n}let i4=i$.toFlatObject(i$,{},null,function(t){return/^is[A-Z]/.test(t)}),i6=function(t,n,i){if(!i$.isObject(t))throw TypeError("target must be an object");n=n||new FormData;let r=(i=i$.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,n){return!i$.isUndefined(n[t])})).metaTokens,o=i.visitor||p,a=i.dots,s=i.indexes,l=i.Blob||"u">typeof Blob&&Blob,c=void 0===i.maxDepth?100:i.maxDepth,d=l&&i$.isSpecCompliantForm(n),u=[];if(!i$.isFunction(o))throw TypeError("visitor must be a function");function h(t){if(null===t)return"";if(i$.isDate(t))return t.toISOString();if(i$.isBoolean(t))return t.toString();if(!d&&i$.isBlob(t))throw new i1("Blob is not supported. Use a Buffer instead.");if(i$.isArrayBuffer(t)||i$.isTypedArray(t)){if(d&&"function"==typeof l)return new l([t]);if("u">typeof Buffer)return Buffer.from(t);throw new i1("Blob is not supported. Use a Buffer instead.",i1.ERR_NOT_SUPPORT)}return t}function m(t){if(t>c)throw new i1("Object is too deeply nested ("+t+" levels). Max depth: "+c,i1.ERR_FORM_DATA_DEPTH_EXCEEDED)}function p(t,i,o){let l=t;if(i$.isReactNative(n)&&i$.isReactNativeBlob(t))return n.append(i5(o,i,a),h(t)),!1;if(t&&!o&&"object"==typeof t)if(i$.endsWith(i,"{}"))i=r?i:i.slice(0,-2),t=function(t){if(1/0===c)return JSON.stringify(t);let n=[];return JSON.stringify(t,function(t,i){if(!i$.isObject(i))return i;for(;n.length&&n[n.length-1]!==this;)n.pop();return n.push(i),m(1+n.length-1),i})}(t);else{var d;if(i$.isArray(t)&&(d=t,i$.isArray(d)&&!d.some(i2))||(i$.isFileList(t)||i$.endsWith(i,"[]"))&&(l=i$.toArray(t)))return i=i3(i),l.forEach(function(t,r){i$.isUndefined(t)||null===t||n.append(!0===s?i5([i],r,a):null===s?i:i+"[]",h(t))}),!1}return!!i2(t)||(n.append(i5(o,i,a),h(t)),!1)}let f=Object.assign(i4,{defaultVisitor:p,convertValue:h,isVisitable:i2});if(!i$.isObject(t))throw TypeError("data must be an object");return!function t(i,r,a=0){if(!i$.isUndefined(i)){if(m(a),-1!==u.indexOf(i))throw Error("Circular reference detected in "+r.join("."));u.push(i),i$.forEach(i,function(i,s){!0===(!(i$.isUndefined(i)||null===i)&&o.call(n,i,i$.isString(s)?s.trim():s,r,f))&&t(i,r?r.concat(s):[s],a+1)}),u.pop()}}(t),n};function i8(t){let n={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(t).replace(/[!'()~]|%20/g,function(t){return n[t]})}function i7(t,n){this._pairs=[],t&&i6(t,this,n)}let i9=i7.prototype;function re(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function rt(t,n,i){let r;if(!n)return t;t=t||"";let o=i$.isFunction(i)?{serialize:i}:i,a=i$.getSafeProp(o,"encode")||re,s=i$.getSafeProp(o,"serialize");if(r=s?s(n,o):i$.isURLSearchParams(n)?n.toString():new i7(n,o).toString(a)){let n=t.indexOf("#");-1!==n&&(t=t.slice(0,n)),t+=(-1===t.indexOf("?")?"?":"&")+r}return t}i9.append=function(t,n){this._pairs.push([t,n])},i9.toString=function(t){let n=t?n=>t.call(this,n,i8):i8;return this._pairs.map(function(t){return n(t[0])+"="+n(t[1])},"").join("&")};let rn=class{constructor(){this.handlers=[]}use(t,n,i){return this.handlers.push({fulfilled:t,rejected:n,synchronous:!!i&&i.synchronous,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){i$.forEach(this.handlers,function(n){null!==n&&t(n)})}},ri={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},rr="u">typeof URLSearchParams?URLSearchParams:i7,ro="u">typeof FormData?FormData:null,ra="u">typeof Blob?Blob:null,rs="u">typeof window&&"u">typeof document,rl="object"==typeof navigator&&navigator||void 0,rc=rs&&(!rl||0>["ReactNative","NativeScript","NS"].indexOf(rl.product)),rd="u">typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ru=rs&&window.location.href||"http://localhost",rh={...tH,isBrowser:!0,classes:{URLSearchParams:rr,FormData:ro,Blob:ra},protocols:["http","https","file","blob","url","data"]};function rm(t){if(t>100)throw new i1("FormData field is too deeply nested ("+t+" levels). Max depth: 100",i1.ERR_FORM_DATA_DEPTH_EXCEEDED)}let rp=function(t){if(i$.isFormData(t)&&i$.isFunction(t.entries)){let n={};return i$.forEachEntry(t,(t,i)=>{!function t(n,i,r,o){rm(o);let a=n[o++];if("__proto__"===a)return!0;let s=Number.isFinite(+a),l=o>=n.length;return(a=!a&&i$.isArray(r)?r.length:a,l)?i$.hasOwnProp(r,a)?r[a]=i$.isArray(r[a])?r[a].concat(i):[r[a],i]:r[a]=i:(i$.hasOwnProp(r,a)&&i$.isObject(r[a])||(r[a]=[]),t(n,i,r[a],o)&&i$.isArray(r[a])&&(r[a]=function(t){let n,i,r={},o=Object.keys(t),a=o.length;for(n=0;n<a;n++)r[i=o[n]]=t[i];return r}(r[a]))),!s}(function(t){let n,i=[],r=/\w+|\[(\w*)]/g;for(;null!==(n=r.exec(t));)rm(i.length),i.push("[]"===n[0]?"":n[1]||n[0]);return i}(t),i,n,0)}),n}return null},rf=(t,n)=>null!=t&&i$.hasOwnProp(t,n)?t[n]:void 0,rb={transitional:ri,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){let i,r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=i$.isObject(t);if(a&&i$.isHTMLForm(t)&&(t=new FormData(t)),i$.isFormData(t))return o?JSON.stringify(rp(t)):t;if(i$.isArrayBuffer(t)||i$.isBuffer(t)||i$.isStream(t)||i$.isFile(t)||i$.isBlob(t)||i$.isReadableStream(t))return t;if(i$.isArrayBufferView(t))return t.buffer;if(i$.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();if(a){let n=rf(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return i6(t,new rh.classes.URLSearchParams,{visitor:function(t,n,i,r){return rh.isNode&&i$.isBuffer(t)?(this.append(n,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...n}).toString();if((i=i$.isFileList(t))||r.indexOf("multipart/form-data")>-1){let r=rf(this,"env"),o=r&&r.FormData;return i6(i?{"files[]":t}:t,o&&new o,n)}}if(a||o){n.setContentType("application/json",!1);var s=t;if(i$.isString(s))try{return(0,JSON.parse)(s),i$.trim(s)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(s)}return t}],transformResponse:[function(t){let n=rf(this,"transitional")||rb.transitional,i=n&&n.forcedJSONParsing,r=rf(this,"responseType"),o="json"===r;if(i$.isResponse(t)||i$.isReadableStream(t))return t;if(t&&i$.isString(t)&&(i&&!r||o)){let i=n&&n.silentJSONParsing;try{return JSON.parse(t,rf(this,"parseReviver"))}catch(t){if(!i&&o){if("SyntaxError"===t.name)throw i1.from(t,i1.ERR_BAD_RESPONSE,this,null,rf(this,"response"));throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:rh.classes.FormData,Blob:rh.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};function rg(t,n){let i=this||rb,r=n||i,o=iQ.from(r.headers),a=r.data;return i$.forEach(t,function(t){a=t.call(i,a,o.normalize(),n?n.status:void 0)}),o.normalize(),a}function r_(t){return!!(t&&t.__CANCEL__)}i$.forEach(["delete","get","head","post","put","patch","query"],t=>{rb.headers[t]={}});let ry=class extends i1{constructor(t,n,i){super(null==t?"canceled":t,i1.ERR_CANCELED,n,i),this.name="CanceledError",this.__CANCEL__=!0}};function rv(t,n,i){let r=i.config.validateStatus;!i.status||!r||r(i.status)?t(i):n(new i1("Request failed with status code "+i.status,i.status>=400&&i.status<500?i1.ERR_BAD_REQUEST:i1.ERR_BAD_RESPONSE,i.config,i.request,i))}let rx=function(t,n){let i,r=Array(t=t||10),o=Array(t),a=0,s=0;return n=void 0!==n?n:1e3,function(l){let c=Date.now(),d=o[s];i||(i=c),r[a]=l,o[a]=c;let u=s,h=0;for(;u!==a;)h+=r[u++],u%=t;if((a=(a+1)%t)===s&&(s=(s+1)%t),c-i<n)return;let m=d&&c-d;return m?Math.round(1e3*h/m):void 0}},rF=function(t,n){let i,r,o=0,a=1e3/n,s=(n,a=Date.now())=>{o=a,i=null,r&&(clearTimeout(r),r=null),t(...n)};return[(...t)=>{let n=Date.now(),l=n-o;l>=a?s(t,n):(i=t,r||(r=setTimeout(()=>{r=null,s(i)},a-l)))},()=>i&&s(i)]},rw=(t,n,i=3)=>{let r=0,o=rx(50,250);return rF(i=>{if(!i||"number"!=typeof i.loaded)return;let a=i.loaded,s=i.lengthComputable?i.total:void 0,l=null!=s?Math.min(a,s):a,c=Math.max(0,l-r),d=o(c);r=Math.max(r,l),t({loaded:l,total:s,progress:s?l/s:void 0,bytes:c,rate:d||void 0,estimated:d&&s?(s-l)/d:void 0,event:i,lengthComputable:null!=s,[n?"download":"upload"]:!0})},i)},rE=(t,n)=>{let i=null!=t;return[r=>n[0]({lengthComputable:i,total:t,loaded:r}),n[1]]},rC=t=>(...n)=>i$.asap(()=>t(...n)),rA=rh.hasStandardBrowserEnv?(d=new URL(rh.origin),u=rh.navigator&&/(msie|trident)/i.test(rh.navigator.userAgent),t=>(t=new URL(t,rh.origin),d.protocol===t.protocol&&d.host===t.host&&(u||d.port===t.port))):()=>!0,rk=rh.hasStandardBrowserEnv?{write(t,n,i,r,o,a,s){if("u"<typeof document)return;let l=[`${t}=${encodeURIComponent(n)}`];i$.isNumber(i)&&l.push(`expires=${new Date(i).toUTCString()}`),i$.isString(r)&&l.push(`path=${r}`),i$.isString(o)&&l.push(`domain=${o}`),!0===a&&l.push("secure"),i$.isString(s)&&l.push(`SameSite=${s}`),document.cookie=l.join("; ")},read(t){if("u"<typeof document)return null;let n=document.cookie.split(";");for(let i=0;i<n.length;i++){let r=n[i].replace(/^\s+/,""),o=r.indexOf("=");if(-1!==o&&r.slice(0,o)===t)try{return decodeURIComponent(r.slice(o+1))}catch(t){return r.slice(o+1)}}return null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read:()=>null,remove(){}},rT=/^https?:(?!\/\/)/i,rS=/[\t\n\r]/g;function rI(t,n){if("string"==typeof t&&rT.test((function(t){let n=0;for(;n<t.length&&32>=t.charCodeAt(n);)n++;return t.slice(n)})(t).replace(rS,"")))throw new i1('Invalid URL: missing "//" after protocol',i1.ERR_INVALID_URL,n)}function rD(t,n,i,r){rI(n,r);let o=!("string"==typeof n&&/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n));return t&&(o||!1===i)?(rI(t,r),n?t.replace(/\/?\/$/,"")+"/"+n.replace(/^\/+/,""):t):n}let rP=t=>t instanceof iQ?{...t}:t;function rR(t,n){t=t||{},n=n||{};let i=Object.create(null);function r(t,n,i,r){return i$.isPlainObject(t)&&i$.isPlainObject(n)?i$.merge.call({caseless:r},t,n):i$.isPlainObject(n)?i$.merge({},n):i$.isArray(n)?n.slice():n}function o(t,n,i,o){return i$.isUndefined(n)?i$.isUndefined(t)?void 0:r(void 0,t,i,o):r(t,n,i,o)}function a(t,n){if(!i$.isUndefined(n))return r(void 0,n)}function s(t,n){return i$.isUndefined(n)?i$.isUndefined(t)?void 0:r(void 0,t):r(void 0,n)}function l(i,o,a){return i$.hasOwnProp(n,a)?r(i,o):i$.hasOwnProp(t,a)?r(void 0,i):void 0}Object.defineProperty(i,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});let c={url:a,method:a,data:a,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,allowedSocketPaths:s,responseEncoding:s,validateStatus:l,headers:(t,n,i)=>o(rP(t),rP(n),i,!0)};return i$.forEach(Object.keys({...t,...n}),function(r){if("__proto__"===r||"constructor"===r||"prototype"===r)return;let a=i$.hasOwnProp(c,r)?c[r]:o,s=a(i$.hasOwnProp(t,r)?t[r]:void 0,i$.hasOwnProp(n,r)?n[r]:void 0,r);i$.isUndefined(s)&&a!==l||(i[r]=s)}),i$.hasOwnProp(n,"validateStatus")&&i$.isUndefined(n.validateStatus)&&!1===function(i){let r=i$.hasOwnProp(n,"transitional")?n.transitional:void 0;if(!i$.isUndefined(r)){if(!i$.isPlainObject(r))return;else if(i$.hasOwnProp(r,i))return r[i]}let o=i$.hasOwnProp(t,"transitional")?t.transitional:void 0;if(i$.isPlainObject(o)&&i$.hasOwnProp(o,i))return o[i]}("validateStatusUndefinedResolves")&&(i$.hasOwnProp(t,"validateStatus")?i.validateStatus=r(void 0,t.validateStatus):delete i.validateStatus),i}let rO=["content-type","content-length"],rM=function(t){let n=rR({},t),i=t=>i$.hasOwnProp(n,t)?n[t]:void 0,r=i("data"),o=i("withXSRFToken"),a=i("xsrfHeaderName"),s=i("xsrfCookieName"),l=i("headers"),c=i("auth"),d=i("baseURL"),u=i("allowAbsoluteUrls"),h=i("url");if(n.headers=l=iQ.from(l),n.url=rt(rD(d,h,u,n),i("params"),i("paramsSerializer")),c){let n=i$.getSafeProp(c,"username")||"",i=i$.getSafeProp(c,"password")||"";try{l.set("Authorization","Basic "+btoa(n+":"+(i?encodeURIComponent(i).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))):"")))}catch(n){throw i1.from(n,i1.ERR_BAD_OPTION_VALUE,t)}}if(i$.isFormData(r))if(rh.hasStandardBrowserEnv||rh.hasStandardBrowserWebWorkerEnv||i$.isReactNative(r))l.setContentType(void 0);else{var m,p;i$.isFunction(r.getHeaders)&&(m=l,p=r.getHeaders(),"content-only"!==i("formDataHeaderPolicy")?m.set(p):Object.entries(p||{}).forEach(([t,n])=>{rO.includes(t.toLowerCase())&&m.set(t,n)}))}if(rh.hasStandardBrowserEnv&&(i$.isFunction(o)&&(o=o(n)),!0===o||null==o&&rA(n.url))){let t=a&&s&&rk.read(s);t&&l.set(a,t)}return n},rL="u">typeof XMLHttpRequest&&function(t){return new Promise(function(n,i){var r;let o,a,s,l,c,d,u=rM(t),h=u.data,m=iQ.from(u.headers).normalize(),{responseType:p,onUploadProgress:f,onDownloadProgress:b}=u;function g(){l&&l(),c&&c(),u.cancelToken&&u.cancelToken.unsubscribe(o),u.signal&&u.signal.removeEventListener("abort",o)}let _=new XMLHttpRequest;function y(){if(!_)return;let r=iQ.from("getAllResponseHeaders"in _&&_.getAllResponseHeaders());rv(function(t){n(t),g()},function(t){i(t),g()},{data:p&&"text"!==p&&"json"!==p?_.response:_.responseText,status:_.status,statusText:_.statusText,headers:r,config:t,request:_}),_=null}_.open(u.method.toUpperCase(),u.url,!0),_.timeout=u.timeout,"onloadend"in _?_.onloadend=y:_.onreadystatechange=function(){!_||4!==_.readyState||(0!==_.status||_.responseURL&&_.responseURL.startsWith("file:"))&&setTimeout(y)},_.onabort=function(){_&&(i(new i1("Request aborted",i1.ECONNABORTED,t,_)),g(),_=null)},_.onerror=function(n){let r=new i1(n&&n.message?n.message:"Network Error",i1.ERR_NETWORK,t,_);r.event=n||null,i(r),g(),_=null},_.ontimeout=function(){let n=u.timeout?"timeout of "+u.timeout+"ms exceeded":"timeout exceeded",r=u.transitional||ri;u.timeoutErrorMessage&&(n=u.timeoutErrorMessage),i(new i1(n,r.clarifyTimeoutError?i1.ETIMEDOUT:i1.ECONNABORTED,t,_)),g(),_=null},void 0===h&&m.setContentType(null),"setRequestHeader"in _&&i$.forEach(iY(m),function(t,n){_.setRequestHeader(n,t)}),i$.isUndefined(u.withCredentials)||(_.withCredentials=!!u.withCredentials),p&&"json"!==p&&(_.responseType=u.responseType),b&&([s,c]=rw(b,!0),_.addEventListener("progress",s)),f&&_.upload&&([a,l]=rw(f),_.upload.addEventListener("progress",a),_.upload.addEventListener("loadend",l)),(u.cancelToken||u.signal)&&(o=n=>{_&&(i(!n||n.type?new ry(null,t,_):n),_.abort(),g(),_=null)},u.cancelToken&&u.cancelToken.subscribe(o),u.signal&&(u.signal.aborted?o():u.signal.addEventListener("abort",o)));let v=(r=u.url,(d=/^([-+\w]{1,25}):(?:\/\/)?/.exec(r))&&d[1]||"");if(v&&!rh.protocols.includes(v)){i(new i1("Unsupported protocol "+v+":",i1.ERR_BAD_REQUEST,t)),g();return}_.send(h||null)})},rB=function*(t,n){let i,r=t.byteLength;if(!n||r<n)return void(yield t);let o=0;for(;o<r;)i=o+n,yield t.slice(o,i),o=i},rz=async function*(t,n){for await(let i of rN(t))yield*rB(i,n)},rN=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);let n=t.getReader();try{for(;;){let{done:t,value:i}=await n.read();if(t)break;yield i}}finally{await n.cancel()}},rU=(t,n,i,r)=>{let o,a=rz(t,n),s=0,l=t=>{!o&&(o=!0,r&&r(t))};return new ReadableStream({async pull(t){try{let{done:n,value:r}=await a.next();if(n){l(),t.close();return}let o=r.byteLength;if(i){let t=s+=o;i(t)}t.enqueue(new Uint8Array(r))}catch(t){throw l(t),t}},cancel:t=>(l(t),a.return())},{highWaterMark:2})},rj=t=>t>=48&&t<=57||t>=65&&t<=70||t>=97&&t<=102,rV=(t,n,i)=>n+2<i&&rj(t.charCodeAt(n+1))&&rj(t.charCodeAt(n+2)),{isFunction:r$}=i$,rq=t=>{if(!i$.isString(t))return t;try{return decodeURIComponent(t)}catch(n){return t}},rG=(t,...n)=>{try{return!!t(...n)}catch(t){return!1}},rH=t=>{let n,i=void 0!==i$.global&&null!==i$.global?i$.global:globalThis,{ReadableStream:r,TextEncoder:o}=i,{fetch:a,Request:s,Response:l}=t=i$.merge.call({skipUndefined:!0},{Request:i.Request,Response:i.Response},t),c=a?r$(a):"function"==typeof fetch,d=r$(s),u=r$(l);if(!c)return!1;let h=c&&r$(r),m=c&&("function"==typeof o?(n=new o,t=>n.encode(t)):async t=>new Uint8Array(await new s(t).arrayBuffer())),p=d&&h&&rG(()=>{let t=!1,n=new s(rh.origin,{body:new r,method:"POST",get duplex(){return t=!0,"half"}}),i=n.headers.has("Content-Type");return null!=n.body&&n.body.cancel(),t&&!i}),f=u&&h&&rG(()=>i$.isReadableStream(new l("").body)),b={stream:f&&(t=>t.body)};c&&["text","arrayBuffer","blob","formData","stream"].forEach(t=>{b[t]||(b[t]=(n,i)=>{let r=n&&n[t];if(r)return r.call(n);throw new i1(`Response type '${t}' is not supported`,i1.ERR_NOT_SUPPORT,i)})});let g=async t=>{if(null==t)return 0;if(i$.isBlob(t))return t.size;if(i$.isSpecCompliantForm(t)){let n=new s(rh.origin,{method:"POST",body:t});return(await n.arrayBuffer()).byteLength}return i$.isArrayBufferView(t)||i$.isArrayBuffer(t)?t.byteLength:(i$.isURLSearchParams(t)&&(t+=""),i$.isString(t))?(await m(t)).byteLength:void 0},_=async(t,n)=>{let i=i$.toFiniteNumber(t.getContentLength());return null==i?g(n):i};return async t=>{let n,{url:i,method:r,data:c,signal:u,cancelToken:m,timeout:y,onDownloadProgress:v,onUploadProgress:x,responseType:F,headers:w,withCredentials:E="same-origin",fetchOptions:C,maxContentLength:A,maxBodyLength:k}=rM(t),T=i$.isNumber(A)&&A>-1,S=i$.isNumber(k)&&k>-1,I=a||fetch;F=F?(F+"").toLowerCase():"text";let D=((t,n)=>{if(t=t?t.filter(Boolean):[],!n&&!t.length)return;let i=new AbortController,r=!1,o=function(t){if(!r){r=!0,s();let n=t instanceof Error?t:this.reason;i.abort(n instanceof i1?n:new ry(n instanceof Error?n.message:n))}},a=n&&setTimeout(()=>{a=null,o(new i1(`timeout of ${n}ms exceeded`,i1.ETIMEDOUT))},n),s=()=>{t&&(a&&clearTimeout(a),a=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)}),t=null)};t.forEach(t=>t.addEventListener("abort",o,{once:!0}));let{signal:l}=i;return l.unsubscribe=()=>i$.asap(s),l})([u,m&&m.toAbortSignal()],y),P=null,R=D&&D.unsubscribe&&(()=>{D.unsubscribe()}),O=null,M=()=>new i1("Request body larger than maxBodyLength limit",i1.ERR_BAD_REQUEST,t,P);try{var L;let a,u,m,y,B=(u="auth",i$.hasOwnProp(t,u)?t[u]:void 0);if(B){let t=i$.getSafeProp(B,"username")||"",n=i$.getSafeProp(B,"password")||"";a={username:t,password:n}}if(m=(L=i).indexOf("://"),y=L,-1!==m&&(y=y.slice(m+3)),y.includes("@")||y.includes(":")){let t=new URL(i,rh.origin);if(!a&&(t.username||t.password)){let n=rq(t.username),i=rq(t.password);a={username:n,password:i}}(t.username||t.password)&&(t.username="",t.password="",i=t.href)}if(a){let t;w.delete("authorization"),w.set("Authorization","Basic "+btoa((t=(a.username||"")+":"+(a.password||""),encodeURIComponent(t).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))))))}if(T&&"string"==typeof i&&i.startsWith("data:")&&function(t){if(!t||"string"!=typeof t||!t.startsWith("data:"))return 0;let n=t.indexOf(",");if(n<0)return 0;let i=t.slice(5,n),r=t.slice(n+1);if(/;base64/i.test(i)){let t=r.length,n=r.length;for(let i=0;i<n;i++)if(37===r.charCodeAt(i)&&i+2<n){let n=r.charCodeAt(i+1),o=r.charCodeAt(i+2);rj(n)&&rj(o)&&(t-=2,i+=2)}let i=0,o=n-1,a=t=>t>=2&&37===r.charCodeAt(t-2)&&51===r.charCodeAt(t-1)&&(68===r.charCodeAt(t)||100===r.charCodeAt(t));o>=0&&(61===r.charCodeAt(o)?(i++,o--):a(o)&&(i++,o-=3)),1===i&&o>=0&&(61===r.charCodeAt(o)?i++:a(o)&&i++);let s=3*Math.floor(t/4)-(i||0);return s>0?s:0}let o=0;for(let t=0,n=r.length;t<n;t++){let i=r.charCodeAt(t);if(37===i&&rV(r,t,n))o+=1,t+=2;else if(i<128)o+=1;else if(i<2048)o+=2;else if(i>=55296&&i<=56319&&t+1<n){let n=r.charCodeAt(t+1);n>=56320&&n<=57343?(o+=4,t++):o+=3}else o+=3}return o}(i)>A)throw new i1("maxContentLength size of "+A+" exceeded",i1.ERR_BAD_RESPONSE,t,P);if(S&&"get"!==r&&"head"!==r){let t=await g(c);if("number"==typeof t&&isFinite(t)&&(n=t,t>k))throw M()}let z=S&&(i$.isReadableStream(c)||i$.isStream(c)),N=(t,n,i)=>rU(t,65536,t=>{if(S&&t>k)throw O=M();n&&n(t)},i);if(p&&"get"!==r&&"head"!==r&&(x||z)){if(n=null==n?await _(w,c):n,0!==n||z){let t,r=new s(i,{method:"POST",body:c,duplex:"half"});if(i$.isFormData(c)&&(t=r.headers.get("content-type"))&&w.setContentType(t),r.body){let[t,i]=x&&rE(n,rw(rC(x)))||[];c=N(r.body,t,i)}}}else if(z&&!d&&h&&"get"!==r&&"head"!==r)c=N(c);else if(z&&d&&!p&&"get"!==r&&"head"!==r)throw new i1("Stream request bodies are not supported by the current fetch implementation",i1.ERR_NOT_SUPPORT,t,P);i$.isString(E)||(E=E?"include":"omit");let U=d&&"credentials"in s.prototype;if(i$.isFormData(c)){let t=w.getContentType();t&&/^multipart\/form-data/i.test(t)&&!/boundary=/i.test(t)&&w.delete("content-type")}w.set("User-Agent","axios/1.18.1",!1);let j={...C,signal:D,method:r.toUpperCase(),headers:iY(w.normalize()),body:c,duplex:"half",credentials:U?E:void 0};P=d&&new s(i,j);let V=await (d?I(P,C):I(i,j)),$=iQ.from(V.headers);if(T){let n=i$.toFiniteNumber($.getContentLength());if(null!=n&&n>A)throw new i1("maxContentLength size of "+A+" exceeded",i1.ERR_BAD_RESPONSE,t,P)}let q=f&&("stream"===F||"response"===F);if(f&&V.body&&(v||T||q&&R)){let n={};["status","statusText","headers"].forEach(t=>{n[t]=V[t]});let i=i$.toFiniteNumber($.getContentLength()),[r,o]=v&&rE(i,rw(rC(v),!0))||[];V=new l(rU(V.body,65536,n=>{if(T&&n>A)throw new i1("maxContentLength size of "+A+" exceeded",i1.ERR_BAD_RESPONSE,t,P);r&&r(n)},()=>{o&&o(),R&&R()}),n)}F=F||"text";let G=await b[i$.findKey(b,F)||"text"](V,t);if(T&&!f&&!q){let n;if(null!=G&&("number"==typeof G.byteLength?n=G.byteLength:"number"==typeof G.size?n=G.size:"string"==typeof G&&(n="function"==typeof o?new o().encode(G).byteLength:G.length)),"number"==typeof n&&n>A)throw new i1("maxContentLength size of "+A+" exceeded",i1.ERR_BAD_RESPONSE,t,P)}return!q&&R&&R(),await new Promise((n,i)=>{rv(n,i,{data:G,headers:iQ.from(V.headers),status:V.status,statusText:V.statusText,config:t,request:P})})}catch(n){if(R&&R(),D&&D.aborted&&D.reason instanceof i1){let i=D.reason;throw i.config=t,P&&(i.request=P),n!==i&&Object.defineProperty(i,"cause",{__proto__:null,value:n,writable:!0,enumerable:!1,configurable:!0}),i}if(O)throw P&&!O.request&&(O.request=P),O;if(n instanceof i1)throw P&&!n.request&&(n.request=P),n;if(n&&"TypeError"===n.name&&/Load failed|fetch/i.test(n.message)){let i=new i1("Network Error",i1.ERR_NETWORK,t,P,n&&n.response);throw Object.defineProperty(i,"cause",{__proto__:null,value:n.cause||n,writable:!0,enumerable:!1,configurable:!0}),i}throw i1.from(n,n&&n.code,t,P,n&&n.response)}}},rW=new Map,rY=t=>{let n=t&&t.env||{},{fetch:i,Request:r,Response:o}=n,a=[r,o,i],s=a.length,l,c,d=rW;for(;s--;)l=a[s],void 0===(c=d.get(l))&&d.set(l,c=s?new Map:rH(n)),d=c;return c};rY();let rX={http:null,xhr:rL,fetch:{get:rY}};i$.forEach(rX,(t,n)=>{if(t){try{Object.defineProperty(t,"name",{__proto__:null,value:n})}catch(t){}Object.defineProperty(t,"adapterName",{__proto__:null,value:n})}});let rZ=t=>`- ${t}`,rK=t=>i$.isFunction(t)||null===t||!1===t,rJ=function(t,n){let i,r,{length:o}=t=i$.isArray(t)?t:[t],a={};for(let s=0;s<o;s++){let o;if(r=i=t[s],!rK(i)&&void 0===(r=rX[(o=String(i)).toLowerCase()]))throw new i1(`Unknown adapter '${o}'`);if(r&&(i$.isFunction(r)||(r=r.get(n))))break;a[o||"#"+s]=r}if(!r){let t=Object.entries(a).map(([t,n])=>`adapter ${t} `+(!1===n?"is not supported by the environment":"is not available in the build"));throw new i1("There is no suitable adapter to dispatch the request "+(o?t.length>1?"since :\n"+t.map(rZ).join("\n"):" "+rZ(t[0]):"as no adapter specified"),i1.ERR_NOT_SUPPORT)}return r};function rQ(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ry(null,t)}function r0(t){return rQ(t),t.headers=iQ.from(t.headers),t.data=rg.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),rJ(t.adapter||rb.adapter,t)(t).then(function(n){rQ(t),t.response=n;try{n.data=rg.call(t,t.transformResponse,n)}finally{delete t.response}return n.headers=iQ.from(n.headers),n},function(n){if(!r_(n)&&(rQ(t),n&&n.response)){t.response=n.response;try{n.response.data=rg.call(t,t.transformResponse,n.response)}finally{delete t.response}n.response.headers=iQ.from(n.response.headers)}return Promise.reject(n)})}let r1={};["object","boolean","number","function","string","symbol"].forEach((t,n)=>{r1[t]=function(i){return typeof i===t||"a"+(n<1?"n ":" ")+t}});let r2={};r1.transitional=function(t,n,i){function r(t,n){return"[Axios v1.18.1] Transitional option '"+t+"'"+n+(i?". "+i:"")}return(i,o,a)=>{if(!1===t)throw new i1(r(o," has been removed"+(n?" in "+n:"")),i1.ERR_DEPRECATED);return n&&!r2[o]&&(r2[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),!t||t(i,o,a)}},r1.spelling=function(t){return(n,i)=>(console.warn(`${i} is likely a misspelling of ${t}`),!0)};let r3=function(t,n,i){if("object"!=typeof t||null===t)throw new i1("options must be an object",i1.ERR_BAD_OPTION_VALUE);let r=Object.keys(t),o=r.length;for(;o-- >0;){let a=r[o],s=Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;if(s){let n=t[a],i=void 0===n||s(n,a,t);if(!0!==i)throw new i1("option "+a+" must be "+i,i1.ERR_BAD_OPTION_VALUE);continue}if(!0!==i)throw new i1("Unknown option "+a,i1.ERR_BAD_OPTION)}};class r5{constructor(t){this.defaults=t||{},this.interceptors={request:new rn,response:new rn}}async request(t,n){try{return await this._request(t,n)}catch(t){if(t instanceof Error){let n={};Error.captureStackTrace?Error.captureStackTrace(n):n=Error();let i=(()=>{if(!n.stack)return"";let t=n.stack.indexOf("\n");return -1===t?"":n.stack.slice(t+1)})();try{if(t.stack){if(i){let n=i.indexOf("\n"),r=-1===n?-1:i.indexOf("\n",n+1),o=-1===r?"":i.slice(r+1);String(t.stack).endsWith(o)||(t.stack+="\n"+i)}}else t.stack=i}catch(t){}}throw t}}_request(t,n){let i,r;"string"==typeof t?(n=n||{}).url=t:n=t||{};let{transitional:o,paramsSerializer:a,headers:s}=n=rR(this.defaults,n);void 0!==o&&r3(o,{silentJSONParsing:r1.transitional(r1.boolean),forcedJSONParsing:r1.transitional(r1.boolean),clarifyTimeoutError:r1.transitional(r1.boolean),legacyInterceptorReqResOrdering:r1.transitional(r1.boolean),advertiseZstdAcceptEncoding:r1.transitional(r1.boolean),validateStatusUndefinedResolves:r1.transitional(r1.boolean)},!1),null!=a&&(i$.isFunction(a)?n.paramsSerializer={serialize:a}:r3(a,{encode:r1.function,serialize:r1.function},!0)),void 0!==n.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),r3(n,{baseUrl:r1.spelling("baseURL"),withXsrfToken:r1.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=s&&i$.merge(s.common,s[n.method]);s&&i$.forEach(["delete","get","head","post","put","patch","query","common"],t=>{delete s[t]}),n.headers=iQ.concat(l,s);let c=[],d=!0;this.interceptors.request.forEach(function(t){if("function"==typeof t.runWhen&&!1===t.runWhen(n))return;d=d&&t.synchronous;let i=n.transitional||ri;i&&i.legacyInterceptorReqResOrdering?c.unshift(t.fulfilled,t.rejected):c.push(t.fulfilled,t.rejected)});let u=[];this.interceptors.response.forEach(function(t){u.push(t.fulfilled,t.rejected)});let h=0;if(!d){let t=[r0.bind(this),void 0];for(t.unshift(...c),t.push(...u),r=t.length,i=Promise.resolve(n);h<r;)i=i.then(t[h++],t[h++]);return i}r=c.length;let m=n;for(;h<r;){let t=c[h++],n=c[h++];try{m=t(m)}catch(t){n.call(this,t);break}}try{i=r0.call(this,m)}catch(t){return Promise.reject(t)}for(h=0,r=u.length;h<r;)i=i.then(u[h++],u[h++]);return i}getUri(t){return rt(rD((t=rR(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls,t),t.params,t.paramsSerializer)}}i$.forEach(["delete","get","head","options"],function(t){r5.prototype[t]=function(n,i){return this.request(rR(i||{},{method:t,url:n,data:i&&i$.hasOwnProp(i,"data")?i.data:void 0}))}}),i$.forEach(["post","put","patch","query"],function(t){function n(n){return function(i,r,o){return this.request(rR(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:r}))}}r5.prototype[t]=n(),"query"!==t&&(r5.prototype[t+"Form"]=n(!0))});let r4=class t{constructor(t){let n;if("function"!=typeof t)throw TypeError("executor must be a function.");this.promise=new Promise(function(t){n=t});const i=this;this.promise.then(t=>{if(!i._listeners)return;let n=i._listeners.length;for(;n-- >0;)i._listeners[n](t);i._listeners=null}),this.promise.then=t=>{let n,r=new Promise(t=>{i.subscribe(t),n=t}).then(t);return r.cancel=function(){i.unsubscribe(n)},r},t(function(t,r,o){i.reason||(i.reason=new ry(t,r,o),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);-1!==n&&this._listeners.splice(n,1)}toAbortSignal(){let t=new AbortController,n=n=>{t.abort(n)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let n;return{token:new t(function(t){n=t}),cancel:n}}},r6={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(r6).forEach(([t,n])=>{r6[n]=t});let r8=function t(n){let i=new r5(n),r=n7(r5.prototype.request,i);return i$.extend(r,r5.prototype,i,{allOwnKeys:!0}),i$.extend(r,i,null,{allOwnKeys:!0}),r.create=function(i){return t(rR(n,i))},r}(rb);r8.Axios=r5,r8.CanceledError=ry,r8.CancelToken=r4,r8.isCancel=r_,r8.VERSION="1.18.1",r8.toFormData=i6,r8.AxiosError=i1,r8.Cancel=r8.CanceledError,r8.all=function(t){return Promise.all(t)},r8.spread=function(t){return function(n){return t.apply(null,n)}},r8.isAxiosError=function(t){return i$.isObject(t)&&!0===t.isAxiosError},r8.mergeConfig=rR,r8.AxiosHeaders=iQ,r8.formToJSON=t=>rp(i$.isHTMLForm(t)?new FormData(t):t),r8.getAdapter=rJ,r8.HttpStatusCode=r6,r8.default=r8;class r7{constructor(t){this.httpClient=t}startTunnel(t,n){return this.httpClient.request({method:"POST",url:ov`gateway/tunnel`,data:t,options:n})}stopTunnel(t,n){return this.httpClient.request({method:"DELETE",url:ov`gateway/tunnel`,data:t,options:n})}getAllActiveTunnelInfos(t,n){return this.httpClient.request({method:"GET",url:ov`gateway/tunnel/${t}`,options:n})}getGatewayActiveTunnelInfos(t,n,i){return this.httpClient.request({method:"GET",url:ov`gateway/tunnel/${t}/${n}`,options:i})}getActiveTunnelInfo(t,n,i,r,o){return this.httpClient.request({method:"GET",url:ov`gateway/tunnel/${t}/${n}/${i}/${r}`,options:o})}}class r9{constructor(t){this.httpClient=t}register(t,n){return this.httpClient.request({method:"POST",url:ov`console/register`,data:t,options:n})}}class oe{constructor(t){this.httpClient=t}doProtocolAssetDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:ov`agent/assetDiscovery/${t}`,queryParams:n,options:i})}doProtocolAssetImport(t,n,i,r){return this.httpClient.request({method:"POST",url:ov`agent/assetImport/${t}`,queryParams:i,data:n,options:r})}doProtocolInstanceDiscovery(t,n,i){return this.httpClient.request({method:"GET",url:ov`agent/instanceDiscovery/${t}`,queryParams:n,options:i})}}class ot{constructor(t){this.httpClient=t}getApps(t){return this.httpClient.request({method:"GET",url:ov`apps`,options:t})}getConsoleConfig(t){return this.httpClient.request({method:"GET",url:ov`apps/consoleConfig`,options:t})}getAppInfos(t){return this.httpClient.request({method:"GET",url:ov`apps/info`,options:t})}}class on{constructor(t){this.httpClient=t}createProvisioningConfig(t,n){return this.httpClient.request({method:"POST",url:ov`provisioning`,data:t,options:n})}getProvisioningConfigs(t){return this.httpClient.request({method:"GET",url:ov`provisioning`,options:t})}deleteProvisioningConfig(t,n){return this.httpClient.request({method:"DELETE",url:ov`provisioning/${t}`,options:n})}updateProvisioningConfig(t,n,i){return this.httpClient.request({method:"PUT",url:ov`provisioning/${t}`,data:n,options:i})}}class oi{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:ov`dashboard`,data:t,options:n})}update(t,n){return this.httpClient.request({method:"PUT",url:ov`dashboard`,data:t,options:n})}getAllRealmDashboards(t,n){return this.httpClient.request({method:"GET",url:ov`dashboard/all/${t}`,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:ov`dashboard/query`,data:t,options:n})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`dashboard/${t}/${n}`,options:i})}get(t,n,i){return this.httpClient.request({method:"GET",url:ov`dashboard/${t}/${n}`,options:i})}}class or{constructor(t){this.httpClient=t}getPredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:ov`asset/predicted/${t}/${n}`,data:i,options:r})}writePredictedDatapoints(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`asset/predicted/${t}/${n}`,data:i,options:r})}}class oo{constructor(t){this.httpClient=t}getServices(t,n){return this.httpClient.request({method:"GET",url:ov`service`,queryParams:t,options:n})}registerService(t,n){return this.httpClient.request({method:"POST",url:ov`service`,data:t,options:n})}getGlobalServices(t){return this.httpClient.request({method:"GET",url:ov`service/global`,options:t})}registerGlobalService(t,n){return this.httpClient.request({method:"POST",url:ov`service/global`,data:t,options:n})}deregisterService(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`service/${t}/${n}`,options:i})}getService(t,n,i){return this.httpClient.request({method:"GET",url:ov`service/${t}/${n}`,options:i})}heartbeat(t,n,i){return this.httpClient.request({method:"PUT",url:ov`service/${t}/${n}`,options:i})}}class oa{constructor(t){this.httpClient=t}getAssetDescriptors(t,n){return this.httpClient.request({method:"GET",url:ov`model/assetDescriptors`,queryParams:t,options:n})}getAssetInfo(t,n,i){return this.httpClient.request({method:"GET",url:ov`model/assetInfo/${t}`,queryParams:n,options:i})}getAssetInfos(t,n){return this.httpClient.request({method:"GET",url:ov`model/assetInfos`,queryParams:t,options:n})}getValueDescriptorSchema(t,n){return this.httpClient.request({method:"GET",url:ov`model/getValueDescriptorSchema`,queryParams:t,options:n})}getMetaItemDescriptors(t,n){return this.httpClient.request({method:"GET",url:ov`model/metaItemDescriptors`,queryParams:t,options:n})}getValueDescriptors(t,n){return this.httpClient.request({method:"GET",url:ov`model/valueDescriptors`,queryParams:t,options:n})}}class os{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:ov`realm`,data:t,options:n})}getAll(t){return this.httpClient.request({method:"GET",url:ov`realm`,options:t})}getAccessible(t){return this.httpClient.request({method:"GET",url:ov`realm/accessible`,options:t})}delete(t,n){return this.httpClient.request({method:"DELETE",url:ov`realm/${t}`,options:n})}get(t,n){return this.httpClient.request({method:"GET",url:ov`realm/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:ov`realm/${t}`,data:n,options:i})}}class ol{constructor(t){this.httpClient=t}createGlobalRuleset(t,n){return this.httpClient.request({method:"POST",url:ov`rules`,data:t,options:n})}getGlobalRulesets(t,n){return this.httpClient.request({method:"GET",url:ov`rules`,queryParams:t,options:n})}createAssetRuleset(t,n){return this.httpClient.request({method:"POST",url:ov`rules/asset`,data:t,options:n})}getAssetRulesets(t,n,i){return this.httpClient.request({method:"GET",url:ov`rules/asset/for/${t}`,queryParams:n,options:i})}deleteAssetRuleset(t,n){return this.httpClient.request({method:"DELETE",url:ov`rules/asset/${t}`,options:n})}getAssetRuleset(t,n){return this.httpClient.request({method:"GET",url:ov`rules/asset/${t}`,options:n})}updateAssetRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:ov`rules/asset/${t}`,data:n,options:i})}getAssetGeofences(t,n){return this.httpClient.request({method:"GET",url:ov`rules/geofences/${t}`,options:n})}getAssetEngineInfo(t,n){return this.httpClient.request({method:"GET",url:ov`rules/info/asset/${t}`,options:n})}getGlobalEngineInfo(t){return this.httpClient.request({method:"GET",url:ov`rules/info/global`,options:t})}getRealmEngineInfo(t,n){return this.httpClient.request({method:"GET",url:ov`rules/info/realm/${t}`,options:n})}createRealmRuleset(t,n){return this.httpClient.request({method:"POST",url:ov`rules/realm`,data:t,options:n})}getRealmRulesets(t,n,i){return this.httpClient.request({method:"GET",url:ov`rules/realm/for/${t}`,queryParams:n,options:i})}deleteRealmRuleset(t,n){return this.httpClient.request({method:"DELETE",url:ov`rules/realm/${t}`,options:n})}getRealmRuleset(t,n){return this.httpClient.request({method:"GET",url:ov`rules/realm/${t}`,options:n})}updateRealmRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:ov`rules/realm/${t}`,data:n,options:i})}deleteGlobalRuleset(t,n){return this.httpClient.request({method:"DELETE",url:ov`rules/${t}`,options:n})}getGlobalRuleset(t,n){return this.httpClient.request({method:"GET",url:ov`rules/${t}`,options:n})}updateGlobalRuleset(t,n,i){return this.httpClient.request({method:"PUT",url:ov`rules/${t}`,data:n,options:i})}}class oc{constructor(t){this.httpClient=t}updateCurrentUserLocale(t,n){return this.httpClient.request({method:"PUT",url:ov`user/locale`,data:t,options:n})}query(t,n){return this.httpClient.request({method:"POST",url:ov`user/query`,data:t,options:n})}requestPasswordResetCurrent(t){return this.httpClient.request({method:"PUT",url:ov`user/request-password-reset`,options:t})}updatePasswordCurrent(t,n){return this.httpClient.request({method:"PUT",url:ov`user/reset-password`,data:t,options:n})}updateCurrent(t,n){return this.httpClient.request({method:"PUT",url:ov`user/update`,data:t,options:n})}getCurrent(t){return this.httpClient.request({method:"GET",url:ov`user/user`,options:t})}getCurrentUserRealmRoles(t){return this.httpClient.request({method:"GET",url:ov`user/userRealmRoles`,options:t})}getCurrentUserClientRoles(t,n){return this.httpClient.request({method:"GET",url:ov`user/userRoles/${t}`,options:n})}disconnectUserSession(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`user/${t}/disconnect/${n}`,options:i})}requestPasswordReset(t,n,i){return this.httpClient.request({method:"PUT",url:ov`user/${t}/request-password-reset/${n}`,options:i})}updatePassword(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`user/${t}/reset-password/${n}`,data:i,options:r})}resetSecret(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/reset-secret/${n}`,options:i})}updateRoles(t,n,i){return this.httpClient.request({method:"PUT",url:ov`user/${t}/roles`,data:n,options:i})}getUserRealmRoles(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/userRealmRoles/${n}`,options:i})}updateUserRealmRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`user/${t}/userRealmRoles/${n}`,data:i,options:r})}getUserClientRoles(t,n,i,r){return this.httpClient.request({method:"GET",url:ov`user/${t}/userRoles/${n}/${i}`,options:r})}updateUserClientRoles(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:ov`user/${t}/userRoles/${n}/${i}`,data:r,options:o})}getUserSessions(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/userSessions/${n}`,options:i})}create(t,n,i){return this.httpClient.request({method:"POST",url:ov`user/${t}/users`,data:n,options:i})}update(t,n,i){return this.httpClient.request({method:"PUT",url:ov`user/${t}/users`,data:n,options:i})}delete(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`user/${t}/users/${n}`,options:i})}getClientRoles(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/${n}/roles`,options:i})}updateClientRoles(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`user/${t}/${n}/roles`,data:i,options:r})}get(t,n,i){return this.httpClient.request({method:"GET",url:ov`user/${t}/${n}`,options:i})}}class od{constructor(t){this.httpClient=t}getAllNodeDefinitions(t){return this.httpClient.request({method:"GET",url:ov`flow`,options:t})}getNodeDefinition(t,n){return this.httpClient.request({method:"GET",url:ov`flow/${t}`,options:n})}getAllNodeDefinitionsByType(t,n){return this.httpClient.request({method:"GET",url:ov`flow/${t}`,options:n})}}class ou{constructor(t){this.httpClient=t}getDatapointExport(t,n){return this.httpClient.request({method:"GET",url:ov`asset/datapoint/export`,queryParams:t,options:n})}getDatapointPeriod(t,n){return this.httpClient.request({method:"GET",url:ov`asset/datapoint/periods`,queryParams:t,options:n})}getDatapoints(t,n,i,r){return this.httpClient.request({method:"POST",url:ov`asset/datapoint/${t}/${n}`,data:i,options:r})}}class oh{constructor(t){this.httpClient=t}getHealthStatus(t){return this.httpClient.request({method:"GET",url:ov`health`,options:t})}getInfo(t){return this.httpClient.request({method:"GET",url:ov`info`,options:t})}}class om{constructor(t){this.httpClient=t}deleteConnections(t,n){return this.httpClient.request({method:"DELETE",url:ov`gateway/connection`,queryParams:t,options:n})}getConnections(t){return this.httpClient.request({method:"GET",url:ov`gateway/connection`,options:t})}deleteConnection(t,n){return this.httpClient.request({method:"DELETE",url:ov`gateway/connection/${t}`,options:n})}getConnection(t,n){return this.httpClient.request({method:"GET",url:ov`gateway/connection/${t}`,options:n})}setConnection(t,n,i){return this.httpClient.request({method:"PUT",url:ov`gateway/connection/${t}`,data:n,options:i})}getConnectionStatus(t,n){return this.httpClient.request({method:"GET",url:ov`gateway/status/${t}`,options:n})}}class op{constructor(t){this.httpClient=t}createAlarm(t,n,i){return this.httpClient.request({method:"POST",url:ov`alarm`,queryParams:n,data:t,options:i})}getAlarms(t,n){return this.httpClient.request({method:"GET",url:ov`alarm`,queryParams:t,options:n})}removeAlarms(t,n){return this.httpClient.request({method:"DELETE",url:ov`alarm`,data:t,options:n})}setAssetLinks(t,n){return this.httpClient.request({method:"PUT",url:ov`alarm/assets`,data:t,options:n})}getAlarm(t,n){return this.httpClient.request({method:"GET",url:ov`alarm/${t}`,options:n})}removeAlarm(t,n){return this.httpClient.request({method:"DELETE",url:ov`alarm/${t}`,options:n})}updateAlarm(t,n,i){return this.httpClient.request({method:"PUT",url:ov`alarm/${t}`,data:n,options:i})}getAssetLinks(t,n,i){return this.httpClient.request({method:"GET",url:ov`alarm/${t}/assets`,queryParams:n,options:i})}}class of{constructor(t){this.httpClient=t}getConfig(t){return this.httpClient.request({method:"GET",url:ov`syslog/config`,options:t})}updateConfig(t,n){return this.httpClient.request({method:"PUT",url:ov`syslog/config`,data:t,options:n})}clearEvents(t){return this.httpClient.request({method:"DELETE",url:ov`syslog/event`,options:t})}getEvents(t,n){return this.httpClient.request({method:"GET",url:ov`syslog/event`,queryParams:t,options:n})}}class ob{constructor(t){this.httpClient=t}getNotifications(t,n){return this.httpClient.request({method:"GET",url:ov`notification`,queryParams:t,options:n})}removeNotifications(t,n){return this.httpClient.request({method:"DELETE",url:ov`notification`,queryParams:t,options:n})}sendNotification(t,n){return this.httpClient.request({method:"POST",url:ov`notification/alert`,data:t,options:n})}getNotificationsCount(t,n){return this.httpClient.request({method:"GET",url:ov`notification/count`,queryParams:t,options:n})}removeNotification(t,n){return this.httpClient.request({method:"DELETE",url:ov`notification/${t}`,options:n})}notificationAcknowledged(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`notification/${t}/acknowledged`,queryParams:i,data:n,options:r})}notificationDelivered(t,n,i){return this.httpClient.request({method:"PUT",url:ov`notification/${t}/delivered`,queryParams:n,options:i})}}class og{constructor(t){this.httpClient=t}create(t,n){return this.httpClient.request({method:"POST",url:ov`asset`,data:t,options:n})}delete(t,n){return this.httpClient.request({method:"DELETE",url:ov`asset`,queryParams:t,options:n})}writeAttributeValues(t,n){return this.httpClient.request({method:"PUT",url:ov`asset/attributes`,data:t,options:n})}writeAttributeEvents(t,n){return this.httpClient.request({method:"PUT",url:ov`asset/attributes/timestamp`,data:t,options:n})}queryCount(t,n){return this.httpClient.request({method:"POST",url:ov`asset/count`,data:t,options:n})}updateNoneParent(t,n){return this.httpClient.request({method:"DELETE",url:ov`asset/parent`,queryParams:t,options:n})}getPartial(t,n){return this.httpClient.request({method:"GET",url:ov`asset/partial/${t}`,options:n})}queryAssets(t,n){return this.httpClient.request({method:"POST",url:ov`asset/query`,data:t,options:n})}queryAssetTree(t,n){return this.httpClient.request({method:"POST",url:ov`asset/tree`,data:t,options:n})}getCurrentUserAssets(t){return this.httpClient.request({method:"GET",url:ov`asset/user/current`,options:t})}createUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:ov`asset/user/link`,data:t,options:n})}getUserAssetLinks(t,n){return this.httpClient.request({method:"GET",url:ov`asset/user/link`,queryParams:t,options:n})}deleteUserAssetLinks(t,n){return this.httpClient.request({method:"POST",url:ov`asset/user/link/delete`,data:t,options:n})}deleteAllUserAssetLinks(t,n,i){return this.httpClient.request({method:"DELETE",url:ov`asset/user/link/${t}/${n}`,options:i})}deleteUserAssetLink(t,n,i,r){return this.httpClient.request({method:"DELETE",url:ov`asset/user/link/${t}/${n}/${i}`,options:r})}get(t,n){return this.httpClient.request({method:"GET",url:ov`asset/${t}`,options:n})}update(t,n,i){return this.httpClient.request({method:"PUT",url:ov`asset/${t}`,data:n,options:i})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName(t,n,i,r){return this.httpClient.request({method:"PUT",url:ov`asset/${t}/attribute/${n}`,data:i,options:r})}writeAttributeValue$PUT$asset_assetId_attribute_attributeName_timestamp(t,n,i,r,o){return this.httpClient.request({method:"PUT",url:ov`asset/${t}/attribute/${n}/${i}`,data:r,options:o})}updateParent(t,n,i){return this.httpClient.request({method:"PUT",url:ov`asset/${t}/child`,queryParams:n,options:i})}}class o_{constructor(t){this.httpClient=t}getSettings(t){return this.httpClient.request({method:"GET",url:ov`map`,options:t})}saveSettings(t,n){return this.httpClient.request({method:"PUT",url:ov`map`,data:t,options:n})}deleteMap(t){return this.httpClient.request({method:"DELETE",url:ov`map/deleteMap`,options:t})}getCustomMapInfo(t){return this.httpClient.request({method:"GET",url:ov`map/getCustomMapInfo`,options:t})}getTile(t,n,i,r){return this.httpClient.request({method:"GET",url:ov`map/tile/${t}/${n}/${i}`,options:r})}uploadMap(t,n){return this.httpClient.request({method:"POST",url:ov`map/upload`,queryParams:t,options:n})}}class oy{constructor(t){this.httpClient=t}getManagerConfig(t){return this.httpClient.request({method:"GET",url:ov`configuration/manager`,options:t})}update(t,n){return this.httpClient.request({method:"PUT",url:ov`configuration/manager`,data:t,options:n})}fileUpload(t,n,i){return this.httpClient.request({method:"POST",url:ov`configuration/manager/file`,queryParams:n,data:t,options:i})}getManagerConfigImage(t,n){return this.httpClient.request({method:"GET",url:ov`configuration/manager/image/${t}`,options:n})}}function ov(t,...n){let i="";for(let r=0;r<n.length;r++)i+=t[r],i+=encodeURIComponent(n[r]);return i+t[t.length-1]}class ox{constructor(t,n=r8.create()){this._gatewayServiceResource=new ow(t,n),this._consoleResource=new oE(t,n),this._agentResource=new oC(t,n),this._appResource=new oA(t,n),this._provisioningResource=new ok(t,n),this._dashboardResource=new oT(t,n),this._assetPredictedDatapointResource=new oS(t,n),this._externalServiceResource=new oI(t,n),this._assetModelResource=new oD(t,n),this._realmResource=new oP(t,n),this._rulesResource=new oR(t,n),this._userResource=new oO(t,n),this._flowResource=new oM(t,n),this._assetDatapointResource=new oL(t,n),this._statusResource=new oB(t,n),this._gatewayClientResource=new oz(t,n),this._alarmResource=new oN(t,n),this._syslogResource=new oU(t,n),this._notificationResource=new oj(t,n),this._assetResource=new oV(t,n),this._mapResource=new o$(t,n),this._configurationResource=new oq(t,n),this._assetResource=new oV(t,n)}get GatewayServiceResource(){return this._gatewayServiceResource}get ConsoleResource(){return this._consoleResource}get AgentResource(){return this._agentResource}get AppResource(){return this._appResource}get ProvisioningResource(){return this._provisioningResource}get DashboardResource(){return this._dashboardResource}get AssetPredictedDatapointResource(){return this._assetPredictedDatapointResource}get ExternalServiceResource(){return this._externalServiceResource}get AssetModelResource(){return this._assetModelResource}get RealmResource(){return this._realmResource}get RulesResource(){return this._rulesResource}get UserResource(){return this._userResource}get FlowResource(){return this._flowResource}get AssetDatapointResource(){return this._assetDatapointResource}get StatusResource(){return this._statusResource}get GatewayClientResource(){return this._gatewayClientResource}get AlarmResource(){return this._alarmResource}get SyslogResource(){return this._syslogResource}get NotificationResource(){return this._notificationResource}get AssetResource(){return this._assetResource}get MapResource(){return this._mapResource}get ConfigurationResource(){return this._configurationResource}}class oF{constructor(t){this.axios=t}request(t){let n={};n.method=t.method,n.url=t.url,n.params=t.queryParams,n.data=t.data,function(t,n){if(void 0!=n)for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i])}(n,t.options);let i=t.copyFn;return this.axios.request(n).then(t=>(i&&t.data&&(t.originalData=t.data,t.data=i(t.data)),t))}}class ow extends r7{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oE extends r9{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oC extends oe{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oA extends ot{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class ok extends on{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oT extends oi{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oS extends or{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oI extends oo{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oD extends oa{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oP extends os{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oR extends ol{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oO extends oc{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oM extends od{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oL extends ou{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oB extends oh{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oz extends om{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oN extends op{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oU extends of{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oj extends ob{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oV extends og{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class o$ extends o_{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}class oq extends oy{constructor(t,n=r8.create()){n.defaults.baseURL=t,super(new oF(n))}}var oG=i(8183),oH=i.n(oG);r8.isAxiosError;let oW=new class{get api(){return this._client}constructor(){this._axiosInstance=r8.create(),this._axiosInstance.defaults.headers.common["Content-Type"]="application/json",this._axiosInstance.interceptors.request.use(t=>(t.paramsSerializer=t=>oH().stringify(t,{arrayFormat:"repeat"}),t))}get axiosInstance(){return this._axiosInstance}get baseUrl(){return this._baseUrl}setTimeout(t){this._axiosInstance.defaults.timeout=t}addRequestInterceptor(t){this._axiosInstance.interceptors.request.use(t)}initialise(t){this._baseUrl=t,this._client=new ox(t,this._axiosInstance)}};var oY=function(t,n,i,r){return new(i||(i=Promise))(function(o,a){function s(t){try{c(r.next(t))}catch(t){a(t)}}function l(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var n;t.done?o(t.value):((n=t.value)instanceof i?n:new i(function(t){t(n)})).then(s,l)}c((r=r.apply(t,n||[])).next())})};(eE=tR||(tR={})).DISCONNECTED="DISCONNECTED",eE.CONNECTED="CONNECTED",eE.CONNECTING="CONNECTING";let oX="SUBSCRIBED:",oZ="UNAUTHORIZED:",oK="TRIGGERED:",oJ="EVENT:";class oQ{constructor(){this._disconnectRequested=!1,this._reconnectDelayMillis=o0.MIN_RECONNECT_DELAY,this._reconnectTimer=null,this._status=tR.DISCONNECTED,this._connectingDeferred=null,this._statusCallbacks=[],this._pendingSubscription=null,this._queuedSubscriptions=[],this._subscriptionMap=new Map,this._assetEventCallbackMap=new Map,this._attributeEventCallbackMap=new Map,this._unloading=!1}get status(){return this._status}subscribeStatusChange(t){this._statusCallbacks.push(t)}unsubscribeStatusChange(t){!function(t,n){if(0===t.length)return;let i=t.indexOf(n);i>=0&&t.splice(i,1)}(this._statusCallbacks,t)}connect(){return(console.debug("Attempting to connect to events:",this.endpointUrl),this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this._status===tR.CONNECTED)?(console.debug("Already connected to events!"),Promise.resolve(!0)):((this._disconnectRequested=!1,this._connectingDeferred)?console.warn("Already connecting to events, continuing the previous one."):(this._onStatusChanged(tR.CONNECTING),this._connectingDeferred=new nW,this._doConnect().then(t=>{if(this._connectingDeferred){let n=this._connectingDeferred;t?(console.debug("Connected to event service: "+this.endpointUrl),this._reconnectDelayMillis=o0.MIN_RECONNECT_DELAY,this._onStatusChanged(tR.CONNECTED),window.setTimeout(()=>{this._onConnect()},0)):console.debug("Failed to connect to event service: "+this.endpointUrl),n.resolve(t)}}).finally(()=>{this._connectingDeferred=null})),this._connectingDeferred.promise)}disconnect(){console.debug("Disconnecting from event service: "+this.endpointUrl),this._disconnectRequested||(this._disconnectRequested=!0,this._reconnectTimer&&(window.clearTimeout(this._reconnectTimer),this._reconnectTimer=null),this.status!==tR.DISCONNECTED&&this._doDisconnect())}subscribe(t,n){let i={eventSubscription:t,callback:n,deferred:new nW};return null!=this._pendingSubscription||this._status!==tR.CONNECTED?(this._queuedSubscriptions.push(i),i.deferred.promise):(this._pendingSubscription=i,this._doSubscribe(t).then(t=>{if(this._pendingSubscription){let n=this._pendingSubscription;this._pendingSubscription=null,this._subscriptionMap.set(t,n),this._processNextSubscription();let i=n.deferred;n.deferred=null,i&&i.resolve(t)}},t=>{if(console.error(t),this._pendingSubscription){let n=this._pendingSubscription;this._pendingSubscription=null,this._processNextSubscription();let i=n.deferred;n.deferred=null,i&&i.reject(t)}}),this._pendingSubscription.deferred.promise)}unsubscribe(t){return oY(this,void 0,void 0,function*(){if(this._subscriptionMap.delete(t))return void this._doUnsubscribe(t);if(this._assetEventCallbackMap.delete(t)){if(this._assetEventPromise&&0===this._assetEventCallbackMap.size){let t=yield this._assetEventPromise;this._assetEventPromise=void 0,this.unsubscribe(t)}return}if(this._attributeEventCallbackMap.delete(t)&&this._attributeEventPromise&&0===this._attributeEventCallbackMap.size){let t=yield this._attributeEventPromise;this._attributeEventPromise=void 0,this.unsubscribe(t)}})}sendEvent(t){this._status===tR.CONNECTED&&this._doSend(t)}sendEventWithReply(t){return this._status!==tR.CONNECTED?Promise.reject("Not connected"):this._doSendWithReply(t)}subscribeAssetEvents(t,n,i){return oY(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0]?t.map(t=>t.id):t,o="AssetEvent"+oQ._subscriptionCounter++;if(!this._assetEventPromise){let t;sq.authenticated||(t={filterType:"asset",realm:sq.displayRealm});let n={eventType:"asset",filter:t};this._assetEventPromise=this.subscribe(n,t=>{this._assetEventCallbackMap.forEach(n=>n(t))})}return this._assetEventCallbackMap.set(o,t=>{let n=t.asset.id;r?r.find(t=>n===t)&&i(t):t.asset.realm===sq.displayRealm&&i(t)}),this._assetEventPromise.then(()=>{try{if(r&&n){let t={messageID:"read-assets:"+r.join(",")+":"+o,eventType:"read-assets",assetQuery:{ids:r}};this.sendEventWithReply(t).then(t=>{t.assets&&this._assetEventCallbackMap.has(o)&&t.assets.forEach(t=>{i({eventType:"asset",asset:t,cause:"READ"})})})}}catch(n){throw console.error("Failed to subscribe to asset events for assets: "+t),o&&this.unsubscribe(o),n}return o})})}subscribeAttributeEvents(t,n,i){return oY(this,void 0,void 0,function*(){let r=t&&"string"!=typeof t[0],o=r?t.map(t=>t.id):t,a=r?t:void 0,s="AttributeEvent"+oQ._subscriptionCounter++;if(!this._attributeEventPromise){let t;sq.authenticated||(t={filterType:"asset",realm:sq.displayRealm});let n={eventType:"attribute",filter:t};this._attributeEventPromise=this.subscribe(n,t=>{this._attributeEventCallbackMap.forEach(n=>n(t))})}let l=n=>{let a=n.ref;r?t.forEach(t=>{a.id===t.id&&a.name===t.name&&i(n)}):o?o.find(t=>a.id===t)&&i(n):n.realm===sq.displayRealm&&i(n)};return this._attributeEventCallbackMap.set(s,l),this._attributeEventPromise.then(()=>{try{if(n&&o){let t={messageID:"read-assets:"+o.join(",")+":"+s,eventType:"read-assets",assetQuery:{ids:o}};this.sendEventWithReply(t).then(t=>{t.assets&&this._attributeEventCallbackMap.has(s)&&t.assets.forEach(t=>{t.attributes&&Object.entries(t.attributes).forEach(([n,i])=>{(!a||a.find(i=>i.id===t.id&&i.name===n))&&l({eventType:"attribute",timestamp:i.timestamp,value:i.value,ref:{id:t.id,name:n}})})})})}}catch(n){throw console.error("Failed to subscribe to asset events for assets: "+t),s&&this.unsubscribe(s),n}return s})})}_processNextSubscription(){this._status===tR.CONNECTED&&0!==this._queuedSubscriptions.length&&setTimeout(()=>{let t=this._queuedSubscriptions.shift();t&&this.subscribe(t.eventSubscription,t.callback).then(n=>{let i=t.deferred;t.deferred=null,i&&i.resolve(n)},n=>{let i=t.deferred;t.deferred=null,i&&i.reject(n)})},0)}_onStatusChanged(t){t!==this._status&&(console.debug("Event provider status changed: "+t),this._status=t,this._unloading||window.setTimeout(()=>{this._statusCallbacks.forEach(n=>n(t))},0))}_onMessageReceived(t,n){let i=this._subscriptionMap.get(t);i&&i.callback(n)}_onConnect(){if(Object.keys(this._subscriptionMap).length>0){for(let t in this._subscriptionMap)this._subscriptionMap.has(t)&&this._queuedSubscriptions.unshift(this._subscriptionMap.get(t));this._subscriptionMap.clear()}this._processNextSubscription()}_onDisconnect(){this._status===tR.CONNECTED&&this._onStatusChanged(tR.DISCONNECTED),this._pendingSubscription&&(this._queuedSubscriptions.unshift(this._pendingSubscription),this._pendingSubscription=null),this._onStatusChanged(tR.CONNECTING),this._scheduleReconnect()}_scheduleReconnect(){this._reconnectTimer||!this._disconnectRequested&&(console.debug("Event provider scheduling reconnect in "+this._reconnectDelayMillis+"ms"),this._reconnectTimer=window.setTimeout(()=>{this._disconnectRequested||this.connect()},this._reconnectDelayMillis),this._reconnectDelayMillis<o0.MAX_RECONNECT_DELAY&&(this._reconnectDelayMillis=Math.min(o0.MAX_RECONNECT_DELAY,this._reconnectDelayMillis+3e3)))}}oQ.MIN_RECONNECT_DELAY=0,oQ.MAX_RECONNECT_DELAY=3e4,oQ._subscriptionCounter=0;class o0 extends oQ{get endpointUrl(){return this._endpointUrl}constructor(t){super(),this._webSocket=void 0,this._connectDeferred=null,this._subscribeDeferred=null,this._repliesDeferred=new Map,this._endpointUrl=(t.startsWith("https:")?"wss":"ws")+"://"+t.substr(t.indexOf("://")+3)+"/websocket/events",window.addEventListener("beforeunload",()=>{this._unloading=!0,this.disconnect()})}_doConnect(){let t=this._endpointUrl+"?Realm="+sq.config.realm;return this._connectDeferred=new nW,(sq.authenticated?sq.retrieveAuthorizationHeader().then(n=>{t+="&Authorization="+n}):Promise.resolve()).finally(()=>{this._webSocket=new WebSocket(t),this._webSocket.onopen=t=>{if(this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!0)}},this._webSocket.onerror=t=>{if(console.error("Event provider error:",t),this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onclose=()=>{if(console.warn("The WebSocket connection of the event provider has been closed."),this._webSocket=void 0,this._connectDeferred){let t=this._connectDeferred;this._connectDeferred=null,t.resolve(!1)}else this._beforeDisconnect()},this._webSocket.onmessage=t=>{let n=t.data;if(n&&n.startsWith(oX)){let t=JSON.parse(n.substring(oX.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&i.resolve(t.subscriptionId)}else if(n.startsWith(oZ)){let t=JSON.parse(n.substring(oZ.length)),i=this._subscribeDeferred;this._subscribeDeferred=null,i&&(console.warn("Unauthorized event subscription: "+JSON.stringify(t,null,2)),i.reject("Unauthorized"))}else if(n.startsWith(oK)){let t=JSON.parse(n.substring(oK.length));t.events&&t.events.forEach(n=>{this._onMessageReceived(t.subscriptionId,n)})}else if(n.startsWith(oJ)){let t=JSON.parse(n.substring(oJ.length));if(t.messageID){let n=this._repliesDeferred.get(t.messageID);this._repliesDeferred.delete(t.messageID),n&&n.resolve(t)}}}}),this._connectDeferred.promise}_beforeDisconnect(){this._onDisconnect()}_doDisconnect(){var t;null==(t=this._webSocket)||t.close(),this._subscribeDeferred=null,this._repliesDeferred.clear()}_doSubscribe(t){return this._webSocket?this._subscribeDeferred?Promise.reject("There's already a pending subscription"):(this._subscribeDeferred=new nW,t.subscriptionId||(t.subscriptionId=o0._subscriptionCounter+++""),this._webSocket.send("SUBSCRIBE:"+JSON.stringify(t)),this._subscribeDeferred.promise):Promise.reject("Not connected")}_doUnsubscribe(t){this._webSocket&&this._webSocket.send("UNSUBSCRIBE:"+JSON.stringify({subscriptionId:t}))}_doSend(t){let n=oJ+JSON.stringify(t);this._webSocket.send(n)}_doSendWithReply(t){if(t.messageID||(t.messageID=(new Date().getTime()+10*Math.random()).toString(10)),this._repliesDeferred.has(t.messageID))return Promise.reject("There's already a pending send and reply with this ID");let n=new nW;return this._repliesDeferred.set(t.messageID,n),this._webSocket.send(oJ+JSON.stringify(t)),n.promise}}o0._subscriptionCounter=1;let o1=["__proto__","constructor","prototype"];function o2(t){return!("string"!=typeof t||0===t.length||t.length>128||o1.indexOf(t)>-1||t.indexOf("..")>-1||t.indexOf("\\")>-1||/[?#%\s@]/.test(t)||/[\x00-\x1F\x7F]/.test(t))}function o3(t){return!(!o2(t)||t.indexOf("/")>-1)}let o5={lng:o3,ns:function(t){return o2(t)}};function o4(t){return"string"!=typeof t?t:t.replace(/[\r\n\x00-\x1F\x7F]/g," ")}function o6(){return"function"==typeof XMLHttpRequest||"object"==typeof XMLHttpRequest}let o8=/\{\{(.+?)\}\}/g;function o7(t,n){let i=!1,r=t.replace(o8,(t,r)=>{let o=r.trim();if(o1.indexOf(o)>-1)return t;let a=n[o];if(null==a)return t;let s=o5[o]||o3,l=String(a).split("+");for(let n of l)if(!s(n))return i=!0,t;return l.join("+")});return i?null:r}let o9="u">typeof globalThis?globalThis:"u">typeof global?global:"u">typeof window?window:void 0;"function"==typeof fetch?t=fetch:o9&&"function"==typeof o9.fetch&&(t=o9.fetch);let ae=o6()&&o9?o9.XMLHttpRequest:void 0,at="function"==typeof ActiveXObject&&o9?o9.ActiveXObject:void 0,an=["__proto__","constructor","prototype"],ai=(t,n)=>{if(n&&"object"==typeof n){let i="";for(let t of Object.keys(n))an.indexOf(t)>-1||(i+="&"+encodeURIComponent(t)+"="+encodeURIComponent(n[t]));if(!i)return t;t=t+(-1!==t.indexOf("?")?"&":"?")+i.slice(1)}return t},ar=(n,i,r,o)=>{let a=t=>{if(!t.ok)return r(t.statusText||"Error",{status:t.status});t.text().then(n=>{r(null,{status:t.status,data:n})}).catch(r)};if(o){let t=o(n,i);if(t instanceof Promise)return void t.then(a).catch(r)}"function"==typeof fetch?fetch(n,i).then(a).catch(r):t(n,i).then(a).catch(r)},ao=(n,i,r,o)=>{if("function"==typeof r&&(o=r,r=void 0),o=o||(()=>{}),t&&0!==i.indexOf("file:")){var a=i,s=r,l=o;n.queryStringParams&&(a=ai(a,n.queryStringParams));let t={..."function"==typeof n.customHeaders?n.customHeaders():n.customHeaders};"u"<typeof window&&"u">typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(t["User-Agent"]=`i18next-http-backend (node/${global.process.version}; ${global.process.platform} ${global.process.arch})`),s&&(t["Content-Type"]="application/json");let c="function"==typeof n.requestOptions?n.requestOptions(s):n.requestOptions,d={method:s?"POST":"GET",body:s?n.stringify(s):void 0,headers:t,...n._omitFetchOptions?{}:c},u="function"==typeof n.alternateFetch&&n.alternateFetch.length>=1?n.alternateFetch:void 0;try{ar(a,d,l,u)}catch(t){if(!c||0===Object.keys(c).length||!t.message||0>t.message.indexOf("not implemented"))return l(t);try{Object.keys(c).forEach(t=>{delete d[t]}),ar(a,d,l,u),n._omitFetchOptions=!0}catch(t){l(t)}}return}if(o6()||"function"==typeof ActiveXObject){var c=i,d=r,u=o;d&&"object"==typeof d&&(d=ai("",d).slice(1)),n.queryStringParams&&(c=ai(c,n.queryStringParams));try{let t=ae?new ae:new at("MSXML2.XMLHTTP.3.0");t.open(d?"POST":"GET",c,1),n.crossDomain||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=!!n.withCredentials,d&&t.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),t.overrideMimeType&&t.overrideMimeType("application/json");let i=n.customHeaders;if(i="function"==typeof i?i():i)for(let n of Object.keys(i))an.indexOf(n)>-1||t.setRequestHeader(n,i[n]);t.onreadystatechange=()=>{t.readyState>3&&u(t.status>=400?t.statusText:null,{status:t.status,data:t.responseText})},t.send(d)}catch(t){console&&console.log(t)}return}o(Error("No fetch and no xhr implementation found!"))};var aa=class{constructor(t,n={},i={}){this.services=t,this.options=n,this.allOptions=i,this.type="backend",this.init(t,n,i)}init(t,n={},i={}){if(this.services=t,this.options={...{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:t=>JSON.parse(t),stringify:JSON.stringify,parsePayload:(t,n,i)=>({[n]:i||""}),parseLoadPayload:(t,n)=>void 0,request:ao,reloadInterval:"u"<typeof window&&36e5,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}},...this.options||{},...n},this.allOptions=i,this.services&&this.options.reloadInterval){let t=setInterval(()=>this.reload(),this.options.reloadInterval);"object"==typeof t&&"function"==typeof t.unref&&t.unref()}}readMulti(t,n,i){this._readAny(t,t,n,n,i)}read(t,n,i){this._readAny([t],t,[n],n,i)}_readAny(t,n,i,r,o){var a,s;let l=this.options.loadPath;"function"==typeof this.options.loadPath&&(l=this.options.loadPath(t,i)),(l=(s=a=l)&&"function"==typeof s.then?a:Promise.resolve(a)).then(a=>{if(!a)return o(null,{});let s=o7(a,{lng:t.join("+"),ns:i.join("+")});if(null==s)return o(Error("i18next-http-backend: unsafe lng/ns value — refusing to build request URL for languages=["+t.map(o4).join(", ")+"] namespaces=["+i.map(o4).join(", ")+"]"),!1);this.loadUrl(s,o,n,r)})}loadUrl(t,n,i,r){let o=this.options.parseLoadPayload("string"==typeof i?[i]:i,"string"==typeof r?[r]:r),a=o4(function(t){if("string"!=typeof t||0===t.length)return t;try{let n=new URL(t);if(n.username||n.password)return n.username="",n.password="",n.toString();return t}catch(n){return t.replace(/(\/\/)[^/@\s]+@/g,"$1")}}(t));this.options.request(this.options,t,o,(t,o)=>{let s,l;if(o&&(o.status>=500&&o.status<600||!o.status))return n("failed loading "+a+"; status code: "+o.status,!0);if(o&&o.status>=400&&o.status<500)return n("failed loading "+a+"; status code: "+o.status,!1);if(!o&&t&&t.message){let i=t.message.toLowerCase();if(["failed","fetch","network","load"].find(t=>i.indexOf(t)>-1))return n("failed loading "+a+": "+o4(t.message),!0)}if(t)return n(t,!1);try{s="string"==typeof o.data?this.options.parse(o.data,i,r):o.data}catch(t){l="failed parsing "+a+" to json"}if(l)return n(l,!1);n(null,s)})}create(t,n,i,r,o){if(!this.options.addPath)return;"string"==typeof t&&(t=[t]);let a=this.options.parsePayload(n,i,r),s=0,l=[],c=[];t.forEach(i=>{let r=this.options.addPath;"function"==typeof this.options.addPath&&(r=this.options.addPath(i,n));let d=o7(r,{lng:i,ns:n});if(null==d){s+=1,o&&s===t.length&&o(l,c);return}this.options.request(this.options,d,a,(n,i)=>{s+=1,l.push(n),c.push(i),s===t.length&&"function"==typeof o&&o(l,c)})})}reload(){let{backendConnector:t,languageUtils:n,logger:i}=this.services,r=t.language;if(r&&"cimode"===r.toLowerCase())return;let o=[],a=t=>{n.toResolveHierarchy(t).forEach(t=>{0>o.indexOf(t)&&o.push(t)})};a(r),this.allOptions.preload&&this.allOptions.preload.forEach(t=>a(t)),o.forEach(n=>{this.allOptions.ns.forEach(r=>{t.read(n,r,"read",null,null,(o,a)=>{o&&i.warn(`loading namespace ${r} for language ${n} failed`,o),!o&&a&&i.log(`loaded namespace ${r} for language ${n}`,a),t.loaded(`${n}|${r}`,o,a)})})})}};aa.type="backend";let as=globalThis,al=as.ShadowRoot&&(void 0===as.ShadyCSS||as.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ac=Symbol(),ad=new WeakMap;class au{constructor(t,n,i){if(this._$cssResult$=!0,i!==ac)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=n}get styleSheet(){let t=this.o,n=this.t;if(al&&void 0===t){let i=void 0!==n&&1===n.length;i&&(t=ad.get(n)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ad.set(n,t))}return t}toString(){return this.cssText}}let ah=t=>new au("string"==typeof t?t:t+"",void 0,ac),am=(t,...n)=>new au(1===t.length?t[0]:n.reduce((n,i,r)=>n+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[r+1],t[0]),t,ac),ap=(t,n)=>{if(al)t.adoptedStyleSheets=n.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let i of n){let n=document.createElement("style"),r=as.litNonce;void 0!==r&&n.setAttribute("nonce",r),n.textContent=i.cssText,t.appendChild(n)}},af=al?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let n="";for(let i of t.cssRules)n+=i.cssText;return ah(n)})(t):t,{is:ab,defineProperty:ag,getOwnPropertyDescriptor:a_,getOwnPropertyNames:ay,getOwnPropertySymbols:av,getPrototypeOf:ax}=Object,aF=globalThis,aw=aF.trustedTypes,aE=aw?aw.emptyScript:"",aC=aF.reactiveElementPolyfillSupport,aA={toAttribute(t,n){switch(n){case Boolean:t=t?aE:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,n){let i=t;switch(n){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},ak=(t,n)=>!ab(t,n),aT={attribute:!0,type:String,converter:aA,reflect:!1,useDefault:!1,hasChanged:ak};Symbol.metadata??=Symbol("metadata"),aF.litPropertyMetadata??=new WeakMap;class aS extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,n=aT){if(n.state&&(n.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((n=Object.create(n)).wrapped=!0),this.elementProperties.set(t,n),!n.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,n);void 0!==r&&ag(this.prototype,t,r)}}static getPropertyDescriptor(t,n,i){let{get:r,set:o}=a_(this.prototype,t)??{get(){return this[n]},set(t){this[n]=t}};return{get:r,set(n){let a=r?.call(this);o?.call(this,n),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??aT}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=ax(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let t=this.properties;for(let n of[...ay(t),...av(t)])this.createProperty(n,t[n])}let t=this[Symbol.metadata];if(null!==t){let n=litPropertyMetadata.get(t);if(void 0!==n)for(let[t,i]of n)this.elementProperties.set(t,i)}for(let[t,n]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(t,n);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let n=[];if(Array.isArray(t))for(let i of new Set(t.flat(1/0).reverse()))n.unshift(af(i));else void 0!==t&&n.push(af(t));return n}static _$Eu(t,n){let i=n.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map;for(let n of this.constructor.elementProperties.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ap(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,n,i){this._$AK(t,i)}_$ET(t,n){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(void 0!==r&&!0===i.reflect){let o=(void 0!==i.converter?.toAttribute?i.converter:aA).toAttribute(n,i.type);this._$Em=t,null==o?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,n){let i=this.constructor,r=i._$Eh.get(t);if(void 0!==r&&this._$Em!==r){let t=i.getPropertyOptions(r),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:aA;this._$Em=r;let a=o.fromAttribute(n,t.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(t,n,i){if(void 0!==t){let r=this.constructor,o=this[t];if(!(((i??=r.getPropertyOptions(t)).hasChanged??ak)(o,n)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(r._$Eu(t,i))))return;this.C(t,n,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,n,{useDefault:i,reflect:r,wrapped:o},a){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??n??this[t]),!0!==o||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||i||(n=void 0),this._$AL.set(t,n)),!0===r&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[t,n]of this._$Ep)this[t]=n;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[n,i]of t){let{wrapped:t}=i,r=this[n];!0!==t||this._$AL.has(n)||void 0===r||this.C(n,void 0,i,r)}}let t=!1,n=this._$AL;try{(t=this.shouldUpdate(n))?(this.willUpdate(n),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(n)):this._$EM()}catch(n){throw t=!1,this._$EM(),n}t&&this._$AE(n)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}aS.elementStyles=[],aS.shadowRootOptions={mode:"open"},aS.elementProperties=new Map,aS.finalized=new Map,aC?.({ReactiveElement:aS}),(aF.reactiveElementVersions??=[]).push("2.1.1");let aI=globalThis,aD=aI.trustedTypes,aP=aD?aD.createPolicy("lit-html",{createHTML:t=>t}):void 0,aR="$lit$",aO=`lit$${Math.random().toFixed(9).slice(2)}$`,aM="?"+aO,aL=`<${aM}>`,aB=document,az=()=>aB.createComment(""),aN=t=>null===t||"object"!=typeof t&&"function"!=typeof t,aU=Array.isArray,aj=t=>aU(t)||"function"==typeof t?.[Symbol.iterator],aV="[ \n\f\r]",a$=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,aq=/-->/g,aG=/>/g,aH=RegExp(`>|${aV}(?:([^\\s"'>=/]+)(${aV}*=${aV}*(?:[^
818
818
  \f\r"'\`<>=]|("|')|))|$)`,"g"),aW=/'/g,aY=/"/g,aX=/^(?:script|style|textarea|title)$/i,aZ=t=>(n,...i)=>({_$litType$:t,strings:n,values:i}),aK=aZ(1),aJ=aZ(2),aQ=Symbol.for("lit-noChange"),a0=Symbol.for("lit-nothing"),a1=new WeakMap,a2=aB.createTreeWalker(aB,129);function a3(t,n){if(!aU(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==aP?aP.createHTML(n):n}let a5=(t,n)=>{let i=t.length-1,r=[],o,a=2===n?"<svg>":3===n?"<math>":"",s=a$;for(let n=0;n<i;n++){let i=t[n],l,c,d=-1,u=0;for(;u<i.length&&(s.lastIndex=u,null!==(c=s.exec(i)));)u=s.lastIndex,s===a$?"!--"===c[1]?s=aq:void 0!==c[1]?s=aG:void 0!==c[2]?(aX.test(c[2])&&(o=RegExp("</"+c[2],"g")),s=aH):void 0!==c[3]&&(s=aH):s===aH?">"===c[0]?(s=o??a$,d=-1):void 0===c[1]?d=-2:(d=s.lastIndex-c[2].length,l=c[1],s=void 0===c[3]?aH:'"'===c[3]?aY:aW):s===aY||s===aW?s=aH:s===aq||s===aG?s=a$:(s=aH,o=void 0);let h=s===aH&&t[n+1].startsWith("/>")?" ":"";a+=s===a$?i+aL:d>=0?(r.push(l),i.slice(0,d)+aR+i.slice(d)+aO+h):i+aO+(-2===d?n:h)}return[a3(t,a+(t[i]||"<?>")+(2===n?"</svg>":3===n?"</math>":"")),r]};class a4{constructor({strings:t,_$litType$:n},i){let r;this.parts=[];let o=0,a=0;const s=t.length-1,l=this.parts,[c,d]=a5(t,n);if(this.el=a4.createElement(c,i),a2.currentNode=this.el.content,2===n||3===n){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(r=a2.nextNode())&&l.length<s;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(aR)){const n=d[a++],i=r.getAttribute(t).split(aO),s=/([.?@])?(.*)/.exec(n);l.push({type:1,index:o,name:s[2],strings:i,ctor:"."===s[1]?se:"?"===s[1]?st:"@"===s[1]?sn:a9}),r.removeAttribute(t)}else t.startsWith(aO)&&(l.push({type:6,index:o}),r.removeAttribute(t));if(aX.test(r.tagName)){const t=r.textContent.split(aO),n=t.length-1;if(n>0){r.textContent=aD?aD.emptyScript:"";for(let i=0;i<n;i++)r.append(t[i],az()),a2.nextNode(),l.push({type:2,index:++o});r.append(t[n],az())}}}else if(8===r.nodeType)if(r.data===aM)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=r.data.indexOf(aO,t+1));)l.push({type:7,index:o}),t+=aO.length-1}o++}}static createElement(t,n){let i=aB.createElement("template");return i.innerHTML=t,i}}function a6(t,n,i=t,r){if(n===aQ)return n;let o=void 0!==r?i._$Co?.[r]:i._$Cl,a=aN(n)?void 0:n._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),void 0===a?o=void 0:(o=new a(t))._$AT(t,i,r),void 0!==r?(i._$Co??=[])[r]=o:i._$Cl=o),void 0!==o&&(n=a6(t,o._$AS(t,n.values),o,r)),n}class a8{constructor(t,n){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=n}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:n},parts:i}=this._$AD,r=(t?.creationScope??aB).importNode(n,!0);a2.currentNode=r;let o=a2.nextNode(),a=0,s=0,l=i[0];for(;void 0!==l;){if(a===l.index){let n;2===l.type?n=new a7(o,o.nextSibling,this,t):1===l.type?n=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(n=new si(o,this,t)),this._$AV.push(n),l=i[++s]}a!==l?.index&&(o=a2.nextNode(),a++)}return a2.currentNode=aB,r}p(t){let n=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,n),n+=i.strings.length-2):i._$AI(t[n])),n++}}class a7{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,n,i,r){this.type=2,this._$AH=a0,this._$AN=void 0,this._$AA=t,this._$AB=n,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,n=this._$AM;return void 0!==n&&11===t?.nodeType&&(t=n.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,n=this){aN(t=a6(this,t,n))?t===a0||null==t||""===t?(this._$AH!==a0&&this._$AR(),this._$AH=a0):t!==this._$AH&&t!==aQ&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):aj(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==a0&&aN(this._$AH)?this._$AA.nextSibling.data=t:this.T(aB.createTextNode(t)),this._$AH=t}$(t){let{values:n,_$litType$:i}=t,r="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=a4.createElement(a3(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(n);else{let t=new a8(r,this),i=t.u(this.options);t.p(n),this.T(i),this._$AH=t}}_$AC(t){let n=a1.get(t.strings);return void 0===n&&a1.set(t.strings,n=new a4(t)),n}k(t){aU(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,i,r=0;for(let o of t)r===n.length?n.push(i=new a7(this.O(az()),this.O(az()),this,this.options)):i=n[r],i._$AI(o),r++;r<n.length&&(this._$AR(i&&i._$AB.nextSibling,r),n.length=r)}_$AR(t=this._$AA.nextSibling,n){for(this._$AP?.(!1,!0,n);t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class a9{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,n,i,r,o){this.type=1,this._$AH=a0,this._$AN=void 0,this.element=t,this.name=n,this._$AM=r,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=a0}_$AI(t,n=this,i,r){let o=this.strings,a=!1;if(void 0===o)(a=!aN(t=a6(this,t,n,0))||t!==this._$AH&&t!==aQ)&&(this._$AH=t);else{let r,s,l=t;for(t=o[0],r=0;r<o.length-1;r++)(s=a6(this,l[i+r],n,r))===aQ&&(s=this._$AH[r]),a||=!aN(s)||s!==this._$AH[r],s===a0?t=a0:t!==a0&&(t+=(s??"")+o[r+1]),this._$AH[r]=s}a&&!r&&this.j(t)}j(t){t===a0?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class se extends a9{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===a0?void 0:t}}class st extends a9{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==a0)}}class sn extends a9{constructor(t,n,i,r,o){super(t,n,i,r,o),this.type=5}_$AI(t,n=this){if((t=a6(this,t,n,0)??a0)===aQ)return;let i=this._$AH,r=t===a0&&i!==a0||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==a0&&(i===a0||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class si{constructor(t,n,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=n,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){a6(this,t)}}let sr=aI.litHtmlPolyfillSupport;sr?.(a4,a7),(aI.litHtmlVersions??=[]).push("3.3.1");let so=(t,n,i)=>{let r=i?.renderBefore??n,o=r._$litPart$;if(void 0===o){let t=i?.renderBefore??null;r._$litPart$=o=new a7(n.insertBefore(az(),t),t,void 0,i??{})}return o._$AI(t),o},sa=globalThis;class ss extends aS{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let n=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=so(n,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return aQ}}ss._$litElement$=!0,ss.finalized=!0,sa.litElementHydrateSupport?.({LitElement:ss});let sl=sa.litElementPolyfillSupport;sl?.({LitElement:ss}),(sa.litElementVersions??=[]).push("4.2.1");let sc=am`
819
819
  h4 {
820
820
  margin: 0;