@openremote/or-map 1.8.0-snapshot.20250820125434 → 1.8.1

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.
@@ -48,17 +48,17 @@ uniform ${i} ${n} u_${r};
48
48
  #else
49
49
  ${i} ${n} ${r} = u_${r};
50
50
  #endif
51
- `}),staticAttributes:n,staticUniforms:o}}class t4{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,n,r,a,o,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!c&&t<n.length;t++)this.boundPaintVertexBuffers[t]!==n[t]&&(c=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||c||this.boundIndexBuffer!==r||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,i,n,r,a,o,s,l):(t.bindVertexArray.set(this.vao),o&&o.bind(),r&&r.dynamicDraw&&r.bind(),s&&s.bind(),l&&l.bind())}freshBind(t,e,i,n,r,a,o,s){let l=t.numAttributes,c=this.context,d=c.gl;for(let l of(this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,e.enableAttributes(d,t),i))l.enableAttributes(d,t);for(let n of(a&&a.enableAttributes(d,t),o&&o.enableAttributes(d,t),s&&s.enableAttributes(d,t),e.bind(),e.setVertexAttribPointers(d,t,r),i))n.bind(),n.setVertexAttribPointers(d,t,r);a&&(a.bind(),a.setVertexAttribPointers(d,t,r)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(d,t,r)),s&&(s.bind(),s.setVertexAttribPointers(d,t,r)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function t6(t){let e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;let n=t[i].split(" ");e.push(n.pop())}return e}class t7{constructor(t,i,n,r,a,o){let s=t.gl;this.program=s.createProgram();let l=t6(i.staticAttributes),c=n?n.getBinderAttributes():[],d=l.concat(c),u=t5.prelude.staticUniforms?t6(t5.prelude.staticUniforms):[],h=i.staticUniforms?t6(i.staticUniforms):[],p=n?n.getBinderUniforms():[],m=u.concat(h).concat(p),f=[];for(let t of m)0>f.indexOf(t)&&f.push(t);let g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;"),o&&g.push("#define TERRAIN3D;");let _=g.concat(t5.prelude.fragmentSource,i.fragmentSource).join("\n"),b=g.concat(t5.prelude.vertexSource,i.vertexSource).join("\n"),y=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(y,_),s.compileShader(y),!s.getShaderParameter(y,s.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${s.getShaderInfoLog(y)}`);s.attachShader(this.program,y);let v=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(v,b),s.compileShader(v),!s.getShaderParameter(v,s.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${s.getShaderInfoLog(v)}`);s.attachShader(this.program,v),this.attributes={};let x={};this.numAttributes=d.length;for(let t=0;t<this.numAttributes;t++)d[t]&&(s.bindAttribLocation(this.program,t,d[t]),this.attributes[d[t]]=t);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(v),s.deleteShader(y);for(let t=0;t<f.length;t++){let e=f[t];if(e&&!x[e]){let t=s.getUniformLocation(this.program,e);t&&(x[e]=t)}}this.fixedUniforms=r(t,x),this.terrainUniforms=((t,i)=>({u_depth:new e.aG(t,i.u_depth),u_terrain:new e.aG(t,i.u_terrain),u_terrain_dim:new e.aH(t,i.u_terrain_dim),u_terrain_matrix:new e.aI(t,i.u_terrain_matrix),u_terrain_unpack:new e.aJ(t,i.u_terrain_unpack),u_terrain_exaggeration:new e.aH(t,i.u_terrain_exaggeration)}))(t,x),this.binderUniforms=n?n.getUniforms(t,x):[]}draw(t,e,i,n,r,a,o,s,l,c,d,u,h,p,m,f,g,_){let b=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(r),t.setCullFace(a),s)for(let e in t.activeTexture.set(b.TEXTURE2),b.bindTexture(b.TEXTURE_2D,s.depthTexture),t.activeTexture.set(b.TEXTURE3),b.bindTexture(b.TEXTURE_2D,s.texture),this.terrainUniforms)this.terrainUniforms[e].set(s[e]);for(let t in this.fixedUniforms)this.fixedUniforms[t].set(o[t]);m&&m.setUniforms(t,this.binderUniforms,h,{zoom:p});let y=0;switch(e){case b.LINES:y=2;break;case b.TRIANGLES:y=3;break;case b.LINE_STRIP:y=1}for(let i of u.get()){let n=i.vaos||(i.vaos={});(n[l]||(n[l]=new t4)).bind(t,this,c,m?m.getPaintVertexBuffers():[],d,i.vertexOffset,f,g,_),b.drawElements(e,i.primitiveLength*y,b.UNSIGNED_SHORT,i.primitiveOffset*y*2)}}}function t8(t,e,i){let n=1/tM(i,1,e.transform.tileZoom),r=Math.pow(2,i.tileID.overscaledZ),a=i.tileSize*Math.pow(2,e.transform.tileZoom)/r,o=a*(i.tileID.canonical.x+i.tileID.wrap*r),s=a*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}let t9=(t,i,n,r)=>{var a,o,s,l,c,d,u;let h=i.style.light,p=h.properties.get("position"),m=[p.x,p.y,p.z],f=(a=new e.A(9),e.A!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a);"viewport"===h.properties.get("anchor")&&(s=Math.sin(o=-i.transform.angle),l=Math.cos(o),f[0]=l,f[1]=s,f[2]=0,f[3]=-s,f[4]=l,f[5]=0,f[6]=0,f[7]=0,f[8]=1),c=m[0],d=m[1],u=m[2],m[0]=c*f[0]+d*f[3]+u*f[6],m[1]=c*f[1]+d*f[4]+u*f[7],m[2]=c*f[2]+d*f[5]+u*f[8];let g=h.properties.get("color");return{u_matrix:t,u_lightpos:m,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[g.r,g.g,g.b],u_vertical_gradient:+n,u_opacity:r}},et=(t,i,n,r,a,o,s)=>e.e(t9(t,i,n,r),t8(o,i,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),ee=t=>({u_matrix:t}),ei=(t,i,n,r)=>e.e(ee(t),t8(n,i,r)),en=(t,e)=>({u_matrix:t,u_world:e}),er=(t,i,n,r,a)=>e.e(ei(t,i,n,r),{u_world:a}),ea=(t,e,i,n)=>{let r,a,o=t.transform;if("map"===n.paint.get("circle-pitch-alignment")){let t=tM(i,1,o.zoom);r=!0,a=[t,t]}else r=!1,a=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+r,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:a}},eo=(t,e,i)=>{let n=tM(i,1,e.zoom),r=Math.pow(2,e.zoom-i.tileID.overscaledZ),a=i.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*r),e.pixelsToGLUnits[1]/(n*r)],u_overscale_factor:a}},es=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),el=t=>({u_matrix:t}),ec=(t,e,i,n)=>({u_matrix:t,u_extrude_scale:tM(e,1,i),u_intensity:n}),ed=(t,e,i,n)=>{let r=t.transform;return{u_matrix:ef(t,e,i,n),u_ratio:1/tM(e,1,r.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},eu=(t,i,n,r,a)=>e.e(ed(t,i,n,a),{u_image:0,u_image_height:r}),eh=(t,e,i,n,r)=>{let a=t.transform,o=em(e,a);return{u_matrix:ef(t,e,i,r),u_texsize:e.imageAtlasTexture.size,u_ratio:1/tM(e,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},ep=(t,i,n,r,a,o)=>{let s=t.lineAtlas,l=em(i,t.transform),c="round"===n.layout.get("line-cap"),d=s.getDash(r.from,c),u=s.getDash(r.to,c),h=d.width*a.fromScale,p=u.width*a.toScale;return e.e(ed(t,i,n,o),{u_patternscale_a:[l/h,-d.height/2],u_patternscale_b:[l/p,-u.height/2],u_sdfgamma:s.width/(256*Math.min(h,p)*t.pixelRatio)/2,u_image:0,u_tex_y_a:d.y,u_tex_y_b:u.y,u_mix:a.t})};function em(t,e){return 1/tM(t,1,e.tileZoom)}function ef(t,e,i,n){return t.translatePosMatrix(n?n.posMatrix:e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}let eg=(t,e,i,n,r)=>{var a,o;return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(o=r.paint.get("raster-saturation"))>0?1-1/(1.001-o):-o,u_contrast_factor:(a=r.paint.get("raster-contrast"))>0?1/(1-a):1+a,u_spin_weights:function(t){let e=Math.sin(t*=Math.PI/180),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}(r.paint.get("raster-hue-rotate"))}},e_=(t,e,i,n,r,a,o,s,l,c)=>{let d=r.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:d.width/d.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},eb=(t,i,n,r,a,o,s,l,c,d,u)=>{let h=a.transform;return e.e(e_(t,i,n,r,a,o,s,l,c,d),{u_gamma_scale:r?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:a.pixelRatio,u_is_halo:+u})},ey=(t,i,n,r,a,o,s,l,c,d)=>e.e(eb(t,i,n,r,a,o,s,l,!0,c,!0),{u_texsize_icon:d,u_texture_icon:1}),ev=(t,e,i)=>({u_matrix:t,u_opacity:e,u_color:i}),ex=(t,i,n,r,a,o)=>e.e(function(t,e,i,n){let r=i.imageManager.getPattern(t.from.toString()),a=i.imageManager.getPattern(t.to.toString()),{width:o,height:s}=i.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,i.transform.tileZoom)/l,d=c*(n.tileID.canonical.x+n.tileID.wrap*l),u=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/tM(n,1,i.transform.tileZoom),u_pixel_coord_upper:[d>>16,u>>16],u_pixel_coord_lower:[65535&d,65535&u]}}(r,o,n,a),{u_matrix:t,u_opacity:i}),ew={fillExtrusion:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_lightpos:new e.aK(t,i.u_lightpos),u_lightintensity:new e.aH(t,i.u_lightintensity),u_lightcolor:new e.aK(t,i.u_lightcolor),u_vertical_gradient:new e.aH(t,i.u_vertical_gradient),u_opacity:new e.aH(t,i.u_opacity)}),fillExtrusionPattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_lightpos:new e.aK(t,i.u_lightpos),u_lightintensity:new e.aH(t,i.u_lightintensity),u_lightcolor:new e.aK(t,i.u_lightcolor),u_vertical_gradient:new e.aH(t,i.u_vertical_gradient),u_height_factor:new e.aH(t,i.u_height_factor),u_image:new e.aG(t,i.u_image),u_texsize:new e.aL(t,i.u_texsize),u_pixel_coord_upper:new e.aL(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aL(t,i.u_pixel_coord_lower),u_scale:new e.aK(t,i.u_scale),u_fade:new e.aH(t,i.u_fade),u_opacity:new e.aH(t,i.u_opacity)}),fill:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix)}),fillPattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_image:new e.aG(t,i.u_image),u_texsize:new e.aL(t,i.u_texsize),u_pixel_coord_upper:new e.aL(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aL(t,i.u_pixel_coord_lower),u_scale:new e.aK(t,i.u_scale),u_fade:new e.aH(t,i.u_fade)}),fillOutline:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_world:new e.aL(t,i.u_world)}),fillOutlinePattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_world:new e.aL(t,i.u_world),u_image:new e.aG(t,i.u_image),u_texsize:new e.aL(t,i.u_texsize),u_pixel_coord_upper:new e.aL(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aL(t,i.u_pixel_coord_lower),u_scale:new e.aK(t,i.u_scale),u_fade:new e.aH(t,i.u_fade)}),circle:(t,i)=>({u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_scale_with_map:new e.aG(t,i.u_scale_with_map),u_pitch_with_map:new e.aG(t,i.u_pitch_with_map),u_extrude_scale:new e.aL(t,i.u_extrude_scale),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_matrix:new e.aI(t,i.u_matrix)}),collisionBox:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_pixels_to_tile_units:new e.aH(t,i.u_pixels_to_tile_units),u_extrude_scale:new e.aL(t,i.u_extrude_scale),u_overscale_factor:new e.aH(t,i.u_overscale_factor)}),collisionCircle:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_inv_matrix:new e.aI(t,i.u_inv_matrix),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_viewport_size:new e.aL(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new e.aM(t,i.u_color),u_matrix:new e.aI(t,i.u_matrix),u_overlay:new e.aG(t,i.u_overlay),u_overlay_scale:new e.aH(t,i.u_overlay_scale)}),clippingMask:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix)}),heatmap:(t,i)=>({u_extrude_scale:new e.aH(t,i.u_extrude_scale),u_intensity:new e.aH(t,i.u_intensity),u_matrix:new e.aI(t,i.u_matrix)}),heatmapTexture:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_world:new e.aL(t,i.u_world),u_image:new e.aG(t,i.u_image),u_color_ramp:new e.aG(t,i.u_color_ramp),u_opacity:new e.aH(t,i.u_opacity)}),hillshade:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_image:new e.aG(t,i.u_image),u_latrange:new e.aL(t,i.u_latrange),u_light:new e.aL(t,i.u_light),u_shadow:new e.aM(t,i.u_shadow),u_highlight:new e.aM(t,i.u_highlight),u_accent:new e.aM(t,i.u_accent)}),hillshadePrepare:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_image:new e.aG(t,i.u_image),u_dimension:new e.aL(t,i.u_dimension),u_zoom:new e.aH(t,i.u_zoom),u_unpack:new e.aJ(t,i.u_unpack)}),line:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_ratio:new e.aH(t,i.u_ratio),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aL(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_ratio:new e.aH(t,i.u_ratio),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aL(t,i.u_units_to_pixels),u_image:new e.aG(t,i.u_image),u_image_height:new e.aH(t,i.u_image_height)}),linePattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_texsize:new e.aL(t,i.u_texsize),u_ratio:new e.aH(t,i.u_ratio),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_image:new e.aG(t,i.u_image),u_units_to_pixels:new e.aL(t,i.u_units_to_pixels),u_scale:new e.aK(t,i.u_scale),u_fade:new e.aH(t,i.u_fade)}),lineSDF:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_ratio:new e.aH(t,i.u_ratio),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aL(t,i.u_units_to_pixels),u_patternscale_a:new e.aL(t,i.u_patternscale_a),u_patternscale_b:new e.aL(t,i.u_patternscale_b),u_sdfgamma:new e.aH(t,i.u_sdfgamma),u_image:new e.aG(t,i.u_image),u_tex_y_a:new e.aH(t,i.u_tex_y_a),u_tex_y_b:new e.aH(t,i.u_tex_y_b),u_mix:new e.aH(t,i.u_mix)}),raster:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_tl_parent:new e.aL(t,i.u_tl_parent),u_scale_parent:new e.aH(t,i.u_scale_parent),u_buffer_scale:new e.aH(t,i.u_buffer_scale),u_fade_t:new e.aH(t,i.u_fade_t),u_opacity:new e.aH(t,i.u_opacity),u_image0:new e.aG(t,i.u_image0),u_image1:new e.aG(t,i.u_image1),u_brightness_low:new e.aH(t,i.u_brightness_low),u_brightness_high:new e.aH(t,i.u_brightness_high),u_saturation_factor:new e.aH(t,i.u_saturation_factor),u_contrast_factor:new e.aH(t,i.u_contrast_factor),u_spin_weights:new e.aK(t,i.u_spin_weights)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new e.aG(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aG(t,i.u_is_size_feature_constant),u_size_t:new e.aH(t,i.u_size_t),u_size:new e.aH(t,i.u_size),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_pitch:new e.aH(t,i.u_pitch),u_rotate_symbol:new e.aG(t,i.u_rotate_symbol),u_aspect_ratio:new e.aH(t,i.u_aspect_ratio),u_fade_change:new e.aH(t,i.u_fade_change),u_matrix:new e.aI(t,i.u_matrix),u_label_plane_matrix:new e.aI(t,i.u_label_plane_matrix),u_coord_matrix:new e.aI(t,i.u_coord_matrix),u_is_text:new e.aG(t,i.u_is_text),u_pitch_with_map:new e.aG(t,i.u_pitch_with_map),u_texsize:new e.aL(t,i.u_texsize),u_texture:new e.aG(t,i.u_texture)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new e.aG(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aG(t,i.u_is_size_feature_constant),u_size_t:new e.aH(t,i.u_size_t),u_size:new e.aH(t,i.u_size),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_pitch:new e.aH(t,i.u_pitch),u_rotate_symbol:new e.aG(t,i.u_rotate_symbol),u_aspect_ratio:new e.aH(t,i.u_aspect_ratio),u_fade_change:new e.aH(t,i.u_fade_change),u_matrix:new e.aI(t,i.u_matrix),u_label_plane_matrix:new e.aI(t,i.u_label_plane_matrix),u_coord_matrix:new e.aI(t,i.u_coord_matrix),u_is_text:new e.aG(t,i.u_is_text),u_pitch_with_map:new e.aG(t,i.u_pitch_with_map),u_texsize:new e.aL(t,i.u_texsize),u_texture:new e.aG(t,i.u_texture),u_gamma_scale:new e.aH(t,i.u_gamma_scale),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_is_halo:new e.aG(t,i.u_is_halo)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new e.aG(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aG(t,i.u_is_size_feature_constant),u_size_t:new e.aH(t,i.u_size_t),u_size:new e.aH(t,i.u_size),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_pitch:new e.aH(t,i.u_pitch),u_rotate_symbol:new e.aG(t,i.u_rotate_symbol),u_aspect_ratio:new e.aH(t,i.u_aspect_ratio),u_fade_change:new e.aH(t,i.u_fade_change),u_matrix:new e.aI(t,i.u_matrix),u_label_plane_matrix:new e.aI(t,i.u_label_plane_matrix),u_coord_matrix:new e.aI(t,i.u_coord_matrix),u_is_text:new e.aG(t,i.u_is_text),u_pitch_with_map:new e.aG(t,i.u_pitch_with_map),u_texsize:new e.aL(t,i.u_texsize),u_texsize_icon:new e.aL(t,i.u_texsize_icon),u_texture:new e.aG(t,i.u_texture),u_texture_icon:new e.aG(t,i.u_texture_icon),u_gamma_scale:new e.aH(t,i.u_gamma_scale),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_is_halo:new e.aG(t,i.u_is_halo)}),background:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_opacity:new e.aH(t,i.u_opacity),u_color:new e.aM(t,i.u_color)}),backgroundPattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_opacity:new e.aH(t,i.u_opacity),u_image:new e.aG(t,i.u_image),u_pattern_tl_a:new e.aL(t,i.u_pattern_tl_a),u_pattern_br_a:new e.aL(t,i.u_pattern_br_a),u_pattern_tl_b:new e.aL(t,i.u_pattern_tl_b),u_pattern_br_b:new e.aL(t,i.u_pattern_br_b),u_texsize:new e.aL(t,i.u_texsize),u_mix:new e.aH(t,i.u_mix),u_pattern_size_a:new e.aL(t,i.u_pattern_size_a),u_pattern_size_b:new e.aL(t,i.u_pattern_size_b),u_scale_a:new e.aH(t,i.u_scale_a),u_scale_b:new e.aH(t,i.u_scale_b),u_pixel_coord_upper:new e.aL(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aL(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aH(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_texture:new e.aG(t,i.u_texture),u_ele_delta:new e.aH(t,i.u_ele_delta)}),terrainDepth:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_ele_delta:new e.aH(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_texture:new e.aG(t,i.u_texture),u_terrain_coords_id:new e.aH(t,i.u_terrain_coords_id),u_ele_delta:new e.aH(t,i.u_ele_delta)})};class ek{constructor(t,e,i){this.context=t;let n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let e=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let eE={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class eC{constructor(t,e,i,n){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;let r=t.gl;this.buffer=r.createBuffer(),t.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}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 e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){let n=e.attributes[this.attributes[i].name];void 0!==n&&t.enableVertexAttribArray(n)}}setVertexAttribPointers(t,e,i){for(let n=0;n<this.attributes.length;n++){let r=this.attributes[n],a=e.attributes[r.name];void 0!==a&&t.vertexAttribPointer(a,r.components,t[eE[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let eA=new WeakMap;function eT(t){var e;if(eA.has(t))return eA.get(t);{let i=null==(e=t.getParameter(t.VERSION))?void 0:e.startsWith("WebGL 2.0");return eA.set(t,i),i}}class eI{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)}}class eS extends eI{getDefault(){return e.aO.transparent}set(t){let e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class ez extends eI{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class eL extends eI{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class eM extends eI{getDefault(){return[!0,!0,!0,!0]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class eP extends eI{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class eR extends eI{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class eO extends eI{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class eD extends eI{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class eB extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class eF extends eI{getDefault(){return[0,1]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class eN extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class eV extends eI{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class eU extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class e$ extends eI{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class ej extends eI{getDefault(){return e.aO.transparent}set(t){let e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class eH extends eI{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class eq extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class eG extends eI{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class eX extends eI{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class eZ extends eI{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class eW extends eI{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class eY extends eI{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class eK extends eI{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class eJ extends eI{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class eQ extends eI{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class e0 extends eI{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class e1 extends eI{getDefault(){return null}set(t){let e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class e2 extends eI{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;let i=this.gl;eT(i)?i.bindVertexArray(t):null==(e=i.getExtension("OES_vertex_array_object"))||e.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class e5 extends eI{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class e3 extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class e4 extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class e6 extends eI{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class e7 extends e6{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class e8 extends e6{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class e9 extends e6{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class it{constructor(t,e,i,n,r){this.context=t,this.width=e,this.height=i;let a=t.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new e7(t,o),n)this.depthAttachment=r?new e9(t,o):new e8(t,o);else if(r)throw Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw Error("Framebuffer is not complete")}destroy(){let t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){let e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class ie{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}ie.Replace=[1,0],ie.disabled=new ie(ie.Replace,e.aO.transparent,[!1,!1,!1,!1]),ie.unblended=new ie(ie.Replace,e.aO.transparent,[!0,!0,!0,!0]),ie.alphaBlended=new ie([1,771],e.aO.transparent,[!0,!0,!0,!0]);class ii{constructor(t){var e,i;if(this.gl=t,this.clearColor=new eS(this),this.clearDepth=new ez(this),this.clearStencil=new eL(this),this.colorMask=new eM(this),this.depthMask=new eP(this),this.stencilMask=new eR(this),this.stencilFunc=new eO(this),this.stencilOp=new eD(this),this.stencilTest=new eB(this),this.depthRange=new eF(this),this.depthTest=new eN(this),this.depthFunc=new eV(this),this.blend=new eU(this),this.blendFunc=new e$(this),this.blendColor=new ej(this),this.blendEquation=new eH(this),this.cullFace=new eq(this),this.cullFaceSide=new eG(this),this.frontFace=new eX(this),this.program=new eZ(this),this.activeTexture=new eW(this),this.viewport=new eY(this),this.bindFramebuffer=new eK(this),this.bindRenderbuffer=new eJ(this),this.bindTexture=new eQ(this),this.bindVertexBuffer=new e0(this),this.bindElementBuffer=new e1(this),this.bindVertexArray=new e2(this),this.pixelStoreUnpack=new e5(this),this.pixelStoreUnpackPremultiplyAlpha=new e3(this),this.pixelStoreUnpackFlipY=new e4(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_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),eT(t)){this.HALF_FLOAT=t.HALF_FLOAT;let n=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!=(e=t.RGBA16F)?e:null==n?void 0:n.RGBA16F_EXT,this.RGB16F=null!=(i=t.RGB16F)?i:null==n?void 0:n.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");let e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,e){return new ek(this,t,e)}createVertexBuffer(t,e,i){return new eC(this,t,e,i)}createRenderbuffer(t,e,i){let n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),r}createFramebuffer(t,e,i,n){return new it(this,t,e,i,n)}clear({color:t,depth:e,stencil:i}){let n=this.gl,r=0;t&&(r|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==e&&(r|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==i&&(r|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),n.clear(r)}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){e.aD(t.blendFunction,ie.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(){var t;return eT(this.gl)?this.gl.createVertexArray():null==(t=this.gl.getExtension("OES_vertex_array_object"))?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return eT(this.gl)?this.gl.deleteVertexArray(t):null==(e=this.gl.getExtension("OES_vertex_array_object"))?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class ir{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}ir.ReadOnly=!1,ir.ReadWrite=!0,ir.disabled=new ir(519,ir.ReadOnly,[0,1]);class ia{constructor(t,e,i,n,r,a){this.test=t,this.ref=e,this.mask=i,this.fail=n,this.depthFail=r,this.pass=a}}ia.disabled=new ia({func:519,mask:0},0,0,7680,7680,7680);class io{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}function is(t,i,n,r,a,o,l){var c;let d=t.context,u=d.gl,h=t.useProgram("collisionBox"),p=[],m=0,f=0;for(let s=0;s<r.length;s++){let c=r[s],g=i.getTile(c),_=g.getBucket(n);if(!_)continue;let b=c.posMatrix;0===a[0]&&0===a[1]||(b=t.translatePosMatrix(c.posMatrix,g,a,o));let y=l?_.textCollisionBox:_.iconCollisionBox,v=_.collisionCircleArray;if(v.length>0){let i=e.F(),n=b;e.aP(i,_.placementInvProjMatrix,t.transform.glCoordMatrix),e.aP(i,i,_.placementViewportMatrix),p.push({circleArray:v,circleOffset:f,transform:n,invTransform:i,coord:c}),m+=v.length/4,f=m}y&&h.draw(d,u.LINES,ir.disabled,ia.disabled,t.colorModeForRenderPass(),io.disabled,eo(b,t.transform,g),t.style.map.terrain&&t.style.map.terrain.getTerrainData(c),n.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,t.transform.zoom,null,null,y.collisionVertexBuffer)}if(!l||!p.length)return;let g=t.useProgram("collisionCircle"),_=new e.aQ;_.resize(4*m),_._trim();let b=0;for(let t of p)for(let e=0;e<t.circleArray.length/4;e++){let i=4*e,n=t.circleArray[i+0],r=t.circleArray[i+1],a=t.circleArray[i+2],o=t.circleArray[i+3];_.emplace(b++,n,r,a,o,0),_.emplace(b++,n,r,a,o,1),_.emplace(b++,n,r,a,o,2),_.emplace(b++,n,r,a,o,3)}(!s||s.length<2*m)&&(s=function(t){let i=2*t,n=new e.aS;n.resize(i),n._trim();for(let t=0;t<i;t++){let e=6*t;n.uint16[e+0]=4*t+0,n.uint16[e+1]=4*t+1,n.uint16[e+2]=4*t+2,n.uint16[e+3]=4*t+2,n.uint16[e+4]=4*t+3,n.uint16[e+5]=4*t+0}return n}(m));let y=d.createIndexBuffer(s,!0),v=d.createVertexBuffer(_,e.aR.members,!0);for(let i of p){let r={u_matrix:i.transform,u_inv_matrix:i.invTransform,u_camera_to_center_distance:(c=t.transform).cameraToCenterDistance,u_viewport_size:[c.width,c.height]};g.draw(d,u.TRIANGLES,ir.disabled,ia.disabled,t.colorModeForRenderPass(),io.disabled,r,t.style.map.terrain&&t.style.map.terrain.getTerrainData(i.coord),n.id,v,y,e.$.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,t.transform.zoom,null,null,null)}v.destroy(),y.destroy()}io.disabled=new io(!1,1029,2305),io.backCCW=new io(!0,1029,2305);let il=e.an(new Float32Array(16));function ic(t,i,n,r,a,o,s,l,c,d,u,h){let p=t.context,m=p.gl,f=t.transform,g="map"===l,_="map"===c,b="viewport"!==l&&"point"!==n.layout.get("symbol-placement"),y=g&&!_&&!b,v=!n.layout.get("symbol-sort-key").isConstant(),x=!1,w=t.depthModeForSublayer(0,ir.ReadOnly),k=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),E=[];for(let l of r){let r=i.getTile(l),c=r.getBucket(n);if(!c)continue;let u=a?c.text:c.icon;if(!u||!u.segments.get().length||!u.hasVisibleVertices)continue;let h=u.programConfigurations.get(n.id),p=a||c.sdfIcons,w=a?c.textSizeData:c.iconSizeData,C=_||0!==f.pitch,A=t.useProgram(c.iconsInText&&a?"symbolTextAndIcon":p?"symbolSDF":"symbolIcon",h),T=e.ag(w,f.zoom),I=t.style.map.terrain&&t.style.map.terrain.getTerrainData(l),S,z,M,P,R=[0,0],O=null;if(a)z=r.glyphAtlasTexture,M=m.LINEAR,S=r.glyphAtlasTexture.size,c.iconsInText&&(R=r.imageAtlasTexture.size,O=r.imageAtlasTexture,P=C||t.options.rotating||t.options.zooming||"composite"===w.kind||"camera"===w.kind?m.LINEAR:m.NEAREST);else{let e=1!==n.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;z=r.imageAtlasTexture,M=p||t.options.rotating||t.options.zooming||e||C?m.LINEAR:m.NEAREST,S=r.imageAtlasTexture.size}let D=tM(r,1,t.transform.zoom),B=t_(l.posMatrix,_,g,t.transform,D),F=tb(l.posMatrix,_,g,t.transform,D),N=k&&c.hasTextData(),V="none"!==n.layout.get("icon-text-fit")&&N&&c.hasIconData();if(b){let i=t.style.map.terrain?(e,i)=>t.style.map.terrain.getElevation(l,e,i):null,r="map"===n.layout.get("text-rotation-alignment");!function(t,i,n,r,a,o,s,l,c,d){let u=r?t.textSizeData:t.iconSizeData,h=e.ag(u,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],m=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;m.clear();let f=t.lineVertexArray,g=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,_=n.transform.width/n.transform.height,b=!1;for(let r=0;r<g.length;r++){let y,v=g.get(r);if(v.hidden||v.writingMode===e.ah.vertical&&!b||(b=!1,d?(y=[v.anchorX,v.anchorY,d(v.anchorX,v.anchorY),1],e.af(y,y,i)):tz(y=[v.anchorX,v.anchorY,0,1],y,i),!function(t,e){let i=t[0]/t[3],n=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&n>=-e[1]&&n<=e[1]}(y,p))){tS(v.numGlyphs,m);continue}let x=tv(n.transform.cameraToCenterDistance,y[3]),w=e.ai(u,h,v),k=s?w/x:w*x,E=new e.P(v.anchorX,v.anchorY),C=ty(E,a,d).point,A={projections:{},offsets:{}},T=tk(v,k,!1,l,i,a,o,t.glyphOffsetArray,f,m,C,E,A,_,c,d);b=T.useVertical,(T.notEnoughRoom||b||T.needsFlipping&&tk(v,k,!0,l,i,a,o,t.glyphOffsetArray,f,m,C,E,A,_,c,d).notEnoughRoom)&&tS(v.numGlyphs,m)}r?t.text.dynamicLayoutVertexBuffer.updateData(m):t.icon.dynamicLayoutVertexBuffer.updateData(m)}(c,l.posMatrix,t,a,B,F,_,d,r,i)}let U=t.translatePosMatrix(l.posMatrix,r,o,s),$=b||a&&k||V?il:B,j=t.translatePosMatrix(F,r,o,s,!0),H=p&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),q={program:A,buffers:u,uniformValues:p?c.iconsInText?ey(w.kind,T,y,_,t,U,$,j,S,R):eb(w.kind,T,y,_,t,U,$,j,a,S,!0):e_(w.kind,T,y,_,t,U,$,j,a,S),atlasTexture:z,atlasTextureIcon:O,atlasInterpolation:M,atlasInterpolationIcon:P,isSDF:p,hasHalo:H};if(v&&c.canOverlap)for(let t of(x=!0,u.segments.get()))E.push({segments:new e.$([t]),sortKey:t.sortKey,state:q,terrainData:I});else E.push({segments:u.segments,sortKey:0,state:q,terrainData:I})}for(let e of(x&&E.sort((t,e)=>t.sortKey-e.sortKey),E)){let i=e.state;if(p.activeTexture.set(m.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,m.CLAMP_TO_EDGE),i.atlasTextureIcon&&(p.activeTexture.set(m.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),i.isSDF){let r=i.uniformValues;i.hasHalo&&(r.u_is_halo=1,id(i.buffers,e.segments,n,t,i.program,w,u,h,r,e.terrainData)),r.u_is_halo=0}id(i.buffers,e.segments,n,t,i.program,w,u,h,i.uniformValues,e.terrainData)}}function id(t,e,i,n,r,a,o,s,l,c){let d=n.context;r.draw(d,d.gl.TRIANGLES,a,o,s,io.disabled,l,c,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,n.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function iu(t,e,i,n,r){if(!i||!n||!n.imageAtlas)return;let a=n.imageAtlas.patternPositions,o=a[i.to.toString()],s=a[i.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let t=r.getPaintProperty(e);o=a[t],s=a[t]}o&&s&&t.setConstantPatternPositions(o,s)}function ih(t,e,i,n,r,a,o){let s,l,c,d,u,h=t.context.gl,p="fill-pattern",m=i.paint.get(p),f=m&&m.constantOr(1),g=i.getCrossfadeParameters();o?(l=f&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(l=f?"fillPattern":"fill",s=h.TRIANGLES);let _=m.constantOr(null);for(let m of n){let n=e.getTile(m);if(f&&!n.patternsLoaded())continue;let b=n.getBucket(i);if(!b)continue;let y=b.programConfigurations.get(i.id),v=t.useProgram(l,y),x=t.style.map.terrain&&t.style.map.terrain.getTerrainData(m);f&&(t.context.activeTexture.set(h.TEXTURE0),n.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),y.updatePaintBuffers(g)),iu(y,p,_,n,i);let w=x?m:null,k=t.translatePosMatrix(w?w.posMatrix:m.posMatrix,n,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(o){d=b.indexBuffer2,u=b.segments2;let e=[h.drawingBufferWidth,h.drawingBufferHeight];c="fillOutlinePattern"===l&&f?er(k,t,g,n,e):en(k,e)}else d=b.indexBuffer,u=b.segments,c=f?ei(k,t,g,n):ee(k);v.draw(t.context,s,r,t.stencilModeForClipping(m),a,io.disabled,c,x,i.id,b.layoutVertexBuffer,d,u,i.paint,t.transform.zoom,y)}}function ip(t,e,i,n,r,a,o){let s=t.context,l=s.gl,c="fill-extrusion-pattern",d=i.paint.get(c),u=d.constantOr(1),h=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),m=d.constantOr(null);for(let d of n){let n=e.getTile(d),f=n.getBucket(i);if(!f)continue;let g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(d),_=f.programConfigurations.get(i.id),b=t.useProgram(u?"fillExtrusionPattern":"fillExtrusion",_);u&&(t.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),_.updatePaintBuffers(h)),iu(_,c,m,n,i);let y=t.translatePosMatrix(d.posMatrix,n,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),v=i.paint.get("fill-extrusion-vertical-gradient"),x=u?et(y,t,v,p,d,h,n):t9(y,t,v,p);b.draw(s,s.gl.TRIANGLES,r,a,o,io.backCCW,x,g,i.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,i.paint,t.transform.zoom,_,t.style.map.terrain&&f.centroidVertexBuffer)}}let im=new e.aO(1,0,0,1),ig=new e.aO(0,1,0,1),i_=new e.aO(0,0,1,1),ib=new e.aO(1,0,1,1),iy=new e.aO(0,1,1,1);function iv(t,e,i,n){iw(t,0,e+i/2,t.transform.width,i,n)}function ix(t,e,i,n){iw(t,e-i/2,0,i,t.transform.height,n)}function iw(t,e,i,n,r,a){let o=t.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,i*t.pixelRatio,n*t.pixelRatio,r*t.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function ik(t,e,i){let n=t.context,r=n.gl,a=t.colorModeForRenderPass(),o=new ir(r.LEQUAL,ir.ReadWrite,t.depthRangeFor3D),s=t.useProgram("terrain"),l=e.getTerrainMesh();for(let c of(n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height]),i)){let i=t.renderToTexture.getTexture(c),d=e.getTerrainData(c.tileID);n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,i.texture);let u={u_matrix:t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),u_texture:0,u_ele_delta:e.getMeshFrameDelta(t.transform.zoom)};s.draw(n,r.TRIANGLES,o,ia.disabled,a,io.backCCW,u,d,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class iE{constructor(t,i){this.context=new ii(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=tu.maxUnderzooming+tu.maxOverzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new tK}resize(t,e,i){if(this.width=Math.floor(t*i),this.height=Math.floor(e*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,i=new e.aV;i.emplaceBack(0,0),i.emplaceBack(e.W,0),i.emplaceBack(0,e.W),i.emplaceBack(e.W,e.W),this.tileExtentBuffer=t.createVertexBuffer(i,t1.members),this.tileExtentSegments=e.$.simpleSegment(0,0,4,2);let n=new e.aV;n.emplaceBack(0,0),n.emplaceBack(e.W,0),n.emplaceBack(0,e.W),n.emplaceBack(e.W,e.W),this.debugBuffer=t.createVertexBuffer(n,t1.members),this.debugSegments=e.$.simpleSegment(0,0,4,5);let r=new e.Z;r.emplaceBack(0,0,0,0),r.emplaceBack(e.W,0,e.W,0),r.emplaceBack(0,e.W,0,e.W),r.emplaceBack(e.W,e.W,e.W,e.W),this.rasterBoundsBuffer=t.createVertexBuffer(r,J.members),this.rasterBoundsSegments=e.$.simpleSegment(0,0,4,2);let a=new e.aV;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,t1.members),this.viewportSegments=e.$.simpleSegment(0,0,4,2);let o=new e.aW;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);let s=new e.aX;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new ia({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){let t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let n=e.F();e.aN(n,0,this.width,this.height,0,0,1),e.J(n,n,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,i.TRIANGLES,ir.disabled,this.stencilClearMode,ie.disabled,io.disabled,el(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;let i=this.context,n=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(ie.disabled),i.setDepthMode(ir.disabled);let r=this.useProgram("clippingMask");for(let t of(this._tileClippingMaskIDs={},e)){let e=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,a=this.style.map.terrain&&this.style.map.terrain.getTerrainData(t);r.draw(i,n.TRIANGLES,ir.disabled,new ia({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),ie.disabled,io.disabled,el(t.posMatrix),a,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,e=this.context.gl;return new ia({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){let e=this.context.gl;return new ia({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){let e=this.context.gl,i=t.sort((t,e)=>e.overscaledZ-t.overscaledZ),n=i[i.length-1].overscaledZ,r=i[0].overscaledZ-n+1;if(r>1){this.currentStencilSource=void 0,this.nextStencilID+r>256&&this.clearStencil();let t={};for(let i=0;i<r;i++)t[i+n]=new ia({func:e.GEQUAL,mask:255},i+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=r,[t,i]}return[{[n]:ia.disabled},i]}colorModeForRenderPass(){let t=this.context.gl;if(this._showOverdrawInspector){let i=1/8;return new ie([t.CONSTANT_COLOR,t.ONE],new e.aO(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?ie.unblended:ie.alphaBlended}depthModeForSublayer(t,e,i){if(!this.opaquePassEnabledForLayer())return ir.disabled;let n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new ir(i||this.context.gl.LEQUAL,e,[n,n])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(u.now()),this.imageManager.beginFrame();let n=this.style._order,r=this.style.sourceCaches,a={},o={},s={};for(let t in r){let e=r[t];e.used&&e.prepare(this.context),a[t]=e.getVisibleCoordinates(),o[t]=a[t].slice().reverse(),s[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<n.length;t++)if(this.style._layers[n[t]].is3D()){this.opaquePassCutoff=t;break}for(let t of(this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen",n)){let e=this.style._layers[t];if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;let i=o[e.source];("custom"===e.type||i.length)&&this.renderLayer(this,r[e.source],e,i)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?e.aO.black:e.aO.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){let t=this.style._layers[n[this.currentLayer]],e=r[t.source],i=a[t.source];this._renderTileClippingMasks(t,i),this.renderLayer(this,e,t,i)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){let t=this.style._layers[n[this.currentLayer]],e=r[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t))continue;let i=("symbol"===t.type?s:o)[t.source];this._renderTileClippingMasks(t,a[t.source]),this.renderLayer(this,e,t,i)}if(this.options.showTileBoundaries){let t=function(t,e){let i=null,n=Object.values(t._layers).flatMap(i=>i.source&&!i.isHidden(e)?[t.sourceCaches[i.source]]:[]),r=n.filter(t=>"vector"===t.getSource().type),a=n.filter(t=>"vector"!==t.getSource().type),o=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};return r.forEach(t=>o(t)),i||a.forEach(t=>o(t)),i}(this.style,this.transform.zoom);t&&function(t,i,n){for(let r=0;r<n.length;r++)!function(t,i,n){let r=t.context,a=r.gl,o=n.posMatrix,s=t.useProgram("debug"),l=ir.disabled,c=ia.disabled,d=t.colorModeForRenderPass(),u="$debug",h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n);r.activeTexture.set(a.TEXTURE0);let p=i.getTileByID(n.key).latestRawTileData,m=Math.floor((p&&p.byteLength||0)/1024),f=512/Math.min(i.getTile(n).tileSize,512)*(n.overscaledZ/t.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();let i=t.debugOverlayCanvas,n=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${g} ${m}kB`),s.draw(r,a.TRIANGLES,l,c,ie.alphaBlended,io.disabled,es(o,e.aO.transparent,f),null,u,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(r,a.LINE_STRIP,l,c,d,io.disabled,es(o,e.aO.red),h,u,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,i,n[r])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){var e,i;let n=t.transform.padding;iv(t,t.transform.height-(n.top||0),3,im),iv(t,n.bottom||0,3,ig),ix(t,n.left||0,3,i_),ix(t,t.transform.width-(n.right||0),3,ib);let r=t.transform.centerPoint;e=r.x,i=t.transform.height-r.y,iw(t,e-1,i-10,2,20,iy),iw(t,e-10,i-1,20,2,iy)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;let i=this.terrainFacilitator.matrix,n=this.transform.projMatrix,r=this.terrainFacilitator.dirty;r||(r=t?!e.aY(i,n):!e.aZ(i,n)),r||(r=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),r&&(e.a_(i,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,i){let n=t.context,r=n.gl,a=ie.unblended,o=new ir(r.LEQUAL,ir.ReadWrite,[0,1]),s=i.getTerrainMesh(),l=i.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");for(let d of(n.bindFramebuffer.set(i.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aO.transparent,depth:1}),l)){let e=i.getTerrainData(d.tileID),l={u_matrix:t.transform.calculatePosMatrix(d.tileID.toUnwrapped()),u_ele_delta:i.getMeshFrameDelta(t.transform.zoom)};c.draw(n,r.TRIANGLES,o,ia.disabled,a,io.backCCW,l,e,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,i){let n=t.context,r=n.gl,a=ie.unblended,o=new ir(r.LEQUAL,ir.ReadWrite,[0,1]),s=i.getTerrainMesh(),l=i.getCoordsTexture(),c=i.sourceCache.getRenderableTiles(),d=t.useProgram("terrainCoords");for(let u of(n.bindFramebuffer.set(i.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aO.transparent,depth:1}),i.coordsIndex=[],c)){let e=i.getTerrainData(u.tileID);n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,l.texture);let c={u_matrix:t.transform.calculatePosMatrix(u.tileID.toUnwrapped()),u_terrain_coords_id:(255-i.coordsIndex.length)/255,u_texture:0,u_ele_delta:i.getMeshFrameDelta(t.transform.zoom)};d.draw(n,r.TRIANGLES,o,ia.disabled,a,io.backCCW,c,e,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),i.coordsIndex.push(u.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,i,n,r){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(r||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(t,i,n,r,a){if("translucent"!==t.renderPass)return;let o=ia.disabled,s=t.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,n,r,a,o,s){let l=i.transform,c="map"===a,d="map"===o;for(let a of t){let t=r.getTile(a),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;let u=e.ag(o.textSizeData,l.zoom),h=tM(t,1,i.transform.zoom),p=t_(a.posMatrix,d,c,i.transform,h),m="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(u){let n=Math.pow(2,l.zoom-t.tileID.overscaledZ);!function(t,i,n,r,a,o,s,l,c,d,u){let h=t.text.placedSymbolArray,p=t.text.dynamicLayoutVertexArray,m=t.icon.dynamicLayoutVertexArray,f={};p.clear();for(let m=0;m<h.length;m++){let g=h.get(m),_=g.hidden||!g.crossTileID||t.allowVerticalPlacement&&!g.placedOrientation?null:r[g.crossTileID];if(_){let r=new e.P(g.anchorX,g.anchorY),h=ty(r,n?s:o,u),m=tv(a.cameraToCenterDistance,h.signedDistanceFromCamera),b=e.ai(t.textSizeData,c,g)*m/e.ao;n&&(b*=t.tilePixelRatio/l);let{width:y,height:v,anchor:x,textOffset:w,textBoxScale:k}=_,E=function(t,i,n,r,a,o){let{horizontalAlign:s,verticalAlign:l}=e.at(t);return new e.P((-(s-.5)*i/a+r[0])*o,(-(l-.5)*n/a+r[1])*o)}(x,y,v,w,k,b),C=n?ty(r.add(E),o,u).point:h.point.add(i?E.rotate(-a.angle):E),A=t.allowVerticalPlacement&&g.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let t=0;t<g.numGlyphs;t++)e.aj(p,C,A);d&&g.associatedIconIndex>=0&&(f[g.associatedIconIndex]={shiftedAnchor:C,angle:A})}else tS(g.numGlyphs,p)}if(d){m.clear();let i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){let n=i.get(t);if(n.hidden)tS(n.numGlyphs,m);else{let i=f[t];if(i)for(let t=0;t<n.numGlyphs;t++)e.aj(m,i.shiftedAnchor,i.angle);else tS(n.numGlyphs,m)}}t.icon.dynamicLayoutVertexBuffer.updateData(m)}t.text.dynamicLayoutVertexBuffer.updateData(p)}(o,c,d,s,l,p,a.posMatrix,n,u,m,i.style.map.terrain?(t,e)=>i.style.map.terrain.getElevation(a,t,e):null)}}}(r,t,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&ic(t,i,n,r,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&ic(t,i,n,r,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),i.map.showCollisionBoxes&&(is(t,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),is(t,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}(t,i,n,r,this.style.placement.variableOffsets);break;case"circle":!function(t,i,n,r){if("translucent"!==t.renderPass)return;let a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;let c=t.context,d=c.gl,u=t.depthModeForSublayer(0,ir.ReadOnly),h=ia.disabled,p=t.colorModeForRenderPass(),m=[];for(let a=0;a<r.length;a++){let o=r[a],s=i.getTile(o),c=s.getBucket(n);if(!c)continue;let d=c.programConfigurations.get(n.id),u=t.useProgram("circle",d),h=c.layoutVertexBuffer,p=c.indexBuffer,f=t.style.map.terrain&&t.style.map.terrain.getTerrainData(o),g={programConfiguration:d,program:u,layoutVertexBuffer:h,indexBuffer:p,uniformValues:ea(t,o,s,n),terrainData:f};if(l)for(let t of c.segments.get())m.push({segments:new e.$([t]),sortKey:t.sortKey,state:g});else m.push({segments:c.segments,sortKey:0,state:g})}for(let e of(l&&m.sort((t,e)=>t.sortKey-e.sortKey),m)){let{programConfiguration:i,program:r,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=e.state;r.draw(c,d.TRIANGLES,u,h,p,io.disabled,s,l,n.id,a,o,e.segments,n.paint,t.transform.zoom,i)}}(t,i,n,r);break;case"heatmap":!function(t,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){let a=t.context,o=a.gl,s=ia.disabled,l=new ie([o.ONE,o.ONE],e.aO.transparent,[!0,!0,!0,!0]);!function(t,e,i){let n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);let r=i.heatmapFbo;if(r)n.bindTexture(n.TEXTURE_2D,r.colorAttachment.get()),t.bindFramebuffer.set(r.framebuffer);else{let a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),r=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1,!1),function(t,e,i,n){var r,a;let o=t.gl,s=null!=(r=t.HALF_FLOAT)?r:o.UNSIGNED_BYTE,l=null!=(a=t.RGBA16F)?a:o.RGBA;o.texImage2D(o.TEXTURE_2D,0,l,e.width/4,e.height/4,0,o.RGBA,s,null),n.colorAttachment.set(i)}(t,e,a,r)}}(a,t,n),a.clear({color:e.aO.transparent});for(let e=0;e<r.length;e++){let c=r[e];if(i.hasRenderableParent(c))continue;let d=i.getTile(c),u=d.getBucket(n);if(!u)continue;let h=u.programConfigurations.get(n.id),p=t.useProgram("heatmap",h),{zoom:m}=t.transform;p.draw(a,o.TRIANGLES,ir.disabled,s,l,io.disabled,ec(c.posMatrix,d,m,n.paint.get("heatmap-intensity")),null,n.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,n.paint,t.transform.zoom,h)}a.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,i){let n=t.context,r=n.gl,a=i.heatmapFbo;if(!a)return;n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(r.TEXTURE1);let o=i.colorRampTexture;o||(o=i.colorRampTexture=new S(n,i.colorRamp,r.RGBA)),o.bind(r.LINEAR,r.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,r.TRIANGLES,ir.disabled,ia.disabled,t.colorModeForRenderPass(),io.disabled,((t,i,n,r)=>{let a=e.F();e.aN(a,0,t.width,t.height,0,0,1);let o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:i.paint.get("heatmap-opacity")}})(t,i),null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom)}(t,n))}(t,i,n,r);break;case"line":!function(t,i,n,r){if("translucent"!==t.renderPass)return;let a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0===a.constantOr(1)||0===o.constantOr(1))return;let s=t.depthModeForSublayer(0,ir.ReadOnly),l=t.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),d=n.paint.get("line-pattern"),u=d.constantOr(1),h=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),m=u?"linePattern":c?"lineSDF":h?"lineGradient":"line",f=t.context,g=f.gl,_=!0;for(let a of r){let r=i.getTile(a);if(u&&!r.patternsLoaded())continue;let o=r.getBucket(n);if(!o)continue;let b=o.programConfigurations.get(n.id),y=t.context.program.get(),v=t.useProgram(m,b),x=_||v.program!==y,w=t.style.map.terrain&&t.style.map.terrain.getTerrainData(a),k=d.constantOr(null);if(k&&r.imageAtlas){let t=r.imageAtlas,e=t.patternPositions[k.to.toString()],i=t.patternPositions[k.from.toString()];e&&i&&b.setConstantPatternPositions(e,i)}let E=w?a:null,C=u?eh(t,r,n,p,E):c?ep(t,r,n,c,p,E):h?eu(t,r,n,o.lineClipsArray.length,E):ed(t,r,n,E);if(u)f.activeTexture.set(g.TEXTURE0),r.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),b.updatePaintBuffers(p);else if(c&&(x||t.lineAtlas.dirty))f.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(f);else if(h){let r=o.gradients[n.id],s=r.texture;if(n.gradientVersion!==r.version){let l=256;if(n.stepInterpolant){let n=i.getSource().maxzoom,r=a.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-a.canonical.z):1;l=e.ac(e.aT(o.maxLineLength/e.W*1024*r),256,f.maxTextureSize)}r.gradient=e.aU({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:r.gradient||void 0,clips:o.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new S(f,r.gradient,g.RGBA),r.version=n.gradientVersion,s=r.texture}f.activeTexture.set(g.TEXTURE0),s.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}v.draw(f,g.TRIANGLES,s,t.stencilModeForClipping(a),l,io.disabled,C,w,n.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,n.paint,t.transform.zoom,b,o.layoutVertexBuffer2),_=!1}}(t,i,n,r);break;case"fill":!function(t,i,n,r){let a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0===o.constantOr(1))return;let s=t.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(e.aO.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){let e=t.depthModeForSublayer(1,"opaque"===t.renderPass?ir.ReadWrite:ir.ReadOnly);ih(t,i,n,r,e,s,!1)}if("translucent"===t.renderPass&&n.paint.get("fill-antialias")){let e=t.depthModeForSublayer(2*!!n.getPaintProperty("fill-outline-color"),ir.ReadOnly);ih(t,i,n,r,e,s,!0)}}(t,i,n,r);break;case"fill-extrusion":let a=n.paint.get("fill-extrusion-opacity");if(0!==a&&"translucent"===t.renderPass){let e=new ir(t.context.gl.LEQUAL,ir.ReadWrite,t.depthRangeFor3D);if(1!==a||n.paint.get("fill-extrusion-pattern").constantOr(1))ip(t,i,n,r,e,ia.disabled,ie.disabled),ip(t,i,n,r,e,t.stencilModeFor3D(),t.colorModeForRenderPass());else{let a=t.colorModeForRenderPass();ip(t,i,n,r,e,ia.disabled,a)}}break;case"hillshade":!function(t,i,n,r){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;let a=t.context,o=t.depthModeForSublayer(0,ir.ReadOnly),s=t.colorModeForRenderPass(),[l,c]="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r];for(let r of c){let a=i.getTile(r);void 0!==a.needsHillshadePrepare&&a.needsHillshadePrepare&&"offscreen"===t.renderPass?function(t,i,n,r,a,o){let s=t.context,l=s.gl,c=i.dem;if(c&&c.data){let d=c.dim,u=c.stride,h=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(u),i.demTexture){let t=i.demTexture;t.update(h,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else i.demTexture=new S(s,h,l.RGBA,{premultiply:!1}),i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let p=i.fbo;if(!p){let t=new S(s,{width:d,height:d,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),(p=i.fbo=s.createFramebuffer(d,d,!0,!1)).colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,d,d]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,r,a,o,io.disabled,((t,i)=>{let n=i.stride,r=e.F();return e.aN(r,0,e.W,-e.W,0,0,1),e.H(r,r,[0,-e.W,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}})(i.tileID,c),null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),i.needsHillshadePrepare=!1}}(t,a,n,o,ia.disabled,s):"translucent"===t.renderPass&&function(t,i,n,r,a,o,s){let l=t.context,c=l.gl,d=n.fbo;if(!d)return;let u=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(i);l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,d.colorAttachment.get()),u.draw(l,c.TRIANGLES,a,o,s,io.disabled,((t,i,n,r)=>{let a=n.paint.get("hillshade-shadow-color"),o=n.paint.get("hillshade-highlight-color"),s=n.paint.get("hillshade-accent-color"),l=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===n.paint.get("hillshade-illumination-anchor")&&(l-=t.transform.angle);let c=!t.options.moving;return{u_matrix:r?r.posMatrix:t.transform.calculatePosMatrix(i.tileID.toUnwrapped(),c),u_image:0,u_latrange:function(t,i){let n=Math.pow(2,i.canonical.z),r=i.canonical.y;return[new e.Y(0,r/n).toLngLat().lat,new e.Y(0,(r+1)/n).toLngLat().lat]}(0,i.tileID),u_light:[n.paint.get("hillshade-exaggeration"),l],u_shadow:a,u_highlight:o,u_accent:s}})(t,n,r,h?i:null),h,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}(t,r,a,n,o,l[r.overscaledZ],s)}a.viewport.set([0,0,t.width,t.height])}(t,i,n,r);break;case"raster":!function(t,i,n,r){if("translucent"!==t.renderPass||0===n.paint.get("raster-opacity")||!r.length)return;let a=t.context,o=a.gl,s=i.getSource(),l=t.useProgram("raster"),c=t.colorModeForRenderPass(),[d,h]=s instanceof Q?[{},r]:t.stencilConfigForOverlap(r),p=h[h.length-1].overscaledZ,m=!t.options.moving;for(let r of h){let h,f,g=t.depthModeForSublayer(r.overscaledZ-p,1===n.paint.get("raster-opacity")?ir.ReadWrite:ir.ReadOnly,o.LESS),_=i.getTile(r);_.registerFadeDuration(n.paint.get("raster-fade-duration"));let b=i.findLoadedParent(r,0),y=function(t,i,n,r,a,o){let s=r.paint.get("raster-fade-duration");if(!o&&s>0){let r=u.now(),o=(r-t.timeAdded)/s,l=i?(r-i.timeAdded)/s:-1,c=n.getSource(),d=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!i||Math.abs(i.tileID.overscaledZ-d)>Math.abs(t.tileID.overscaledZ-d),p=h&&t.refreshedUponExpiration?1:e.ac(h?o:1-l,0,1);return t.refreshedUponExpiration&&o>=1&&(t.refreshedUponExpiration=!1),i?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}(_,b,i,n,t.transform,t.style.map.terrain),v="nearest"===n.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;a.activeTexture.set(o.TEXTURE0),_.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(o.TEXTURE1),b?(b.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),h=Math.pow(2,b.tileID.overscaledZ-_.tileID.overscaledZ),f=[_.tileID.canonical.x*h%1,_.tileID.canonical.y*h%1]):_.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);let x=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r),w=x?r:null,k=eg(w?w.posMatrix:t.transform.calculatePosMatrix(r.toUnwrapped(),m),f||[0,0],h||1,y,n);s instanceof Q?l.draw(a,o.TRIANGLES,g,ia.disabled,c,io.disabled,k,x,n.id,s.boundsBuffer,t.quadTriangleIndexBuffer,s.boundsSegments):l.draw(a,o.TRIANGLES,g,d[r.overscaledZ],c,io.disabled,k,x,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,i,n,r);break;case"background":!function(t,e,i,n){let r=i.paint.get("background-color"),a=i.paint.get("background-opacity");if(0===a)return;let o=t.context,s=o.gl,l=t.transform,c=l.tileSize,d=i.paint.get("background-pattern");if(t.isPatternMissing(d))return;let u=!d&&1===r.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==u)return;let h=ia.disabled,p=t.depthModeForSublayer(0,"opaque"===u?ir.ReadWrite:ir.ReadOnly),m=t.colorModeForRenderPass(),f=t.useProgram(d?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});d&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));let _=i.getCrossfadeParameters();for(let e of g){let l=n?e.posMatrix:t.transform.calculatePosMatrix(e.toUnwrapped()),u=d?ex(l,a,t,d,{tileID:e,tileSize:c},_):ev(l,a,r),g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);f.draw(o,s.TRIANGLES,p,h,m,io.disabled,u,g,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,n,r);break;case"custom":let o=t.context,s=n.implementation;if("offscreen"===t.renderPass){let e=s.prerender;e&&(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),e.call(s,o.gl,t.transform.customLayerMatrix()),o.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(ia.disabled);let e="3d"===s.renderingMode?new ir(t.context.gl.LEQUAL,ir.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,ir.ReadOnly);o.setDepthMode(e),s.render(o.gl,t.transform.customLayerMatrix()),o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}}translatePosMatrix(t,i,n,r,a){if(!n[0]&&!n[1])return t;let o=a?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(o){let t=Math.sin(o),e=Math.cos(o);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}let s=[a?n[0]:tM(i,n[0],this.transform.zoom),a?n[1]:tM(i,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.H(l,t,s),l}saveTileTexture(t){let e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}useProgram(t,e){this.cache=this.cache||{};let i=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[i]||(this.cache[i]=new t7(this.context,t5[t],e,ew[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[i]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){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(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new S(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class iC{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,i,n){let r=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(n=>{let a=1/(n=e.af([],n,t))[3]/i*r;return e.a$(n,n,[a,a,1/n[3],a])}),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(t=>{var e,i,n,r,o,s,l,c,d,u,h,p,m,f,g,_;let b=(h=[],m=(i=[],n=A([],a[t[0]],a[t[1]]),r=A([],a[t[2]],a[t[1]]),o=n[0],s=n[1],l=n[2],c=r[0],d=r[1],u=r[2],i[0]=s*u-l*d,i[1]=l*c-o*u,i[2]=o*d-s*c,p=i)[0],(_=m*m+(f=p[1])*f+(g=p[2])*g)>0&&(_=1/Math.sqrt(_)),h[0]=p[0]*_,h[1]=p[1]*_,h[2]=p[2]*_,h),y=-(b[0]*(e=a[t[1]])[0]+b[1]*e[1]+b[2]*e[2]);return b.concat(y)});return new iC(a,o)}}class iA{constructor(t,e){this.min=t,this.max=e,this.center=function(t,e,i){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}([],this.min,this.max))}quadrant(t){let e=[t%2==0,t<2],i=x(this.min),n=x(this.max);for(let t=0;t<e.length;t++)i[t]=e[t]?this.min[t]:this.center[t],n[t]=e[t]?this.center[t]:this.max[t];return n[2]=this.max[2],new iA(i,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){let i=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],n=!0;for(let r=0;r<t.planes.length;r++){let a=t.planes[r],o=0;for(let t=0;t<i.length;t++)e.b0(a,i[t])>=0&&o++;if(0===o)return 0;o!==i.length&&(n=!1)}if(n)return 2;for(let e=0;e<3;e++){let i=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let r=0;r<t.points.length;r++){let a=t.points[r][e]-this.min[e];i=Math.min(i,a),n=Math.max(n,a)}if(n<0||i>this.max[e]-this.min[e])return 0}return 1}}class iT{constructor(t=0,e=0,i=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(n)||n<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=n}interpolate(t,i,n){return null!=i.top&&null!=t.top&&(this.top=e.z.number(t.top,i.top,n)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.z.number(t.bottom,i.bottom,n)),null!=i.left&&null!=t.left&&(this.left=e.z.number(t.left,i.left,n)),null!=i.right&&null!=t.right&&(this.right=e.z.number(t.right,i.right,n)),this}getCenter(t,i){let n=e.ac((this.left+t-this.right)/2,0,t),r=e.ac((this.top+i-this.bottom)/2,0,i);return new e.P(n,r)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new iT(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class iI{constructor(t,i,n,r,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=t||0,this._maxZoom=i||22,this._minPitch=null==n?0:n,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new iT,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){let t=new iI(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){var i,n,r,a,o,s,l,c,d,u;let h=-e.b1(t,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(i=new e.A(4),e.A!=Float32Array&&(i[1]=0,i[2]=0),i[0]=1,i[3]=1,i),n=this.rotationMatrix,r=this.rotationMatrix,a=this.angle,o=r[0],s=r[1],l=r[2],c=r[3],d=Math.sin(a),u=Math.cos(a),n[0]=o*u+l*d,n[1]=s*u+c*d,n[2]=-(o*d)+l*u,n[3]=-(s*d)+c*u)}get pitch(){return this._pitch/Math.PI*180}set pitch(t){let i=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){let e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){return Math.max(0,(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize)))}getVisibleUnwrappedCoordinates(t){let i=[new e.b2(0,t)];if(this._renderWorldCopies){let n=this.pointCoordinate(new e.P(0,0)),r=this.pointCoordinate(new e.P(this.width,0)),a=this.pointCoordinate(new e.P(this.width,this.height)),o=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(n.x,r.x,a.x,o.x)),l=Math.floor(Math.max(n.x,r.x,a.x,o.x));for(let n=s-1;n<=l+1;n++)0!==n&&i.push(new e.b2(n,t))}return i}coveringTiles(t){var i,n;let r=this.coveringZoomLevel(t),a=r;if(void 0!==t.minzoom&&r<t.minzoom)return[];void 0!==t.maxzoom&&r>t.maxzoom&&(r=t.maxzoom);let o=this.pointCoordinate(this.getCameraPoint()),s=e.Y.fromLngLat(this.center),l=Math.pow(2,r),c=[l*o.x,l*o.y,0],d=[l*s.x,l*s.y,0],u=iC.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),h=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(h=r);let p=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,m=t=>({aabb:new iA([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),f=[],g=[],_=r,b=t.reparseOverscaled?a:r;if(this._renderWorldCopies)for(let t=1;t<=3;t++)f.push(m(-t)),f.push(m(t));for(f.push(m(0));f.length>0;){let r=f.pop(),a=r.x,o=r.y,s=r.fullyVisible;if(!s){let t=r.aabb.intersects(u);if(0===t)continue;s=2===t}let l=t.terrain?c:d,m=Math.max(Math.abs(r.aabb.distanceX(l)),Math.abs(r.aabb.distanceY(l)));if(r.zoom===_||m>p+(1<<_-r.zoom)-2&&r.zoom>=h){let t=_-r.zoom,i=c[0]-.5-(a<<t),n=c[1]-.5-(o<<t);g.push({tileID:new e.Q(r.zoom===_?b:r.zoom,r.wrap,r.zoom,a,o),distanceSq:T([d[0]-.5-a,d[1]-.5-o]),tileDistanceToCamera:Math.sqrt(i*i+n*n)})}else for(let l=0;l<4;l++){let c=(a<<1)+l%2,d=(o<<1)+(l>>1),u=r.zoom+1,h=r.aabb.quadrant(l);if(t.terrain){let a=new e.Q(u,r.wrap,u,c,d),o=t.terrain.getMinMaxElevation(a),s=null!=(i=o.minElevation)?i:this.elevation,l=null!=(n=o.maxElevation)?n:this.elevation;h=new iA([h.min[0],h.min[1],s],[h.max[0],h.max[1],l])}f.push({aabb:h,zoom:u,x:c,y:d,wrap:r.wrap,fullyVisible:s})}}return g.sort((t,e)=>t.distanceSq-e.distanceSq).map(t=>t.tileID)}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){let i=e.ac(t.lat,-85.051129,85.051129);return new e.P(e.N(t.lng)*this.worldSize,e.O(i)*this.worldSize)}unproject(t){return new e.Y(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){let i=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,r=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(r,this.tileZoom);if(!(this.elevation-a))return;let o=Math.cos(this._pitch)*this.cameraToCenterDistance/(n+i-a)/e.b3(1,r.lat),s=this.scaleZoom(o/this.tileSize);this._elevation=a,this._center=r,this.zoom=s}setLocationAtPoint(t,i){let n=this.pointCoordinate(i),r=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.Y(a.x-(n.x-r.x),a.y-(n.y-r.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Y.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,i){if(i){let e=i.pointCoordinate(t);if(null!=e)return e}let n=[t.x,t.y,0,1],r=[t.x,t.y,1,1];e.af(n,n,this.pixelMatrixInverse),e.af(r,r,this.pixelMatrixInverse);let a=n[3],o=r[3],s=n[1]/a,l=r[1]/o,c=n[2]/a,d=r[2]/o,u=c===d?0:(0-c)/(d-c);return new e.Y(e.z.number(n[0]/a,r[0]/o,u)/this.worldSize,e.z.number(s,l,u)/this.worldSize)}coordinatePoint(t,i=0,n=this.pixelMatrix){let r=[t.x*this.worldSize,t.y*this.worldSize,i,1];return e.af(r,r,n),new e.P(r[0]/r[3],r[1]/r[3])}getBounds(){let t=Math.max(0,this.height/2-this.getHorizon());return(new G).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new G([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,85.051129])}calculatePosMatrix(t,i=!1){let n=t.key,r=i?this._alignedPosMatrixCache:this._posMatrixCache;if(r[n])return r[n];let a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.an(new Float64Array(16));return e.H(l,l,[s*o,a.y*o,0]),e.J(l,l,[o/e.W,o/e.W,1]),e.K(l,i?this.alignedProjMatrix:this.projMatrix,l),r[n]=new Float32Array(l),r[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,i){let n,r;i=e.ac(+i,this.minZoom,this.maxZoom);let a={center:new e.M(t.lng,t.lat),zoom:i},o=this.lngRange;this._renderWorldCopies||null!==o||(o=[-(180-1e-10),180-1e-10]);let s=this.tileSize*this.zoomScale(a.zoom),l=0,c=s,d=0,u=s,h=0,p=0,{x:m,y:f}=this.size;if(this.latRange){let t=this.latRange;l=e.O(t[1])*s,(c=e.O(t[0])*s)-l<f&&(h=f/(c-l))}o&&(d=e.b1(e.N(o[0])*s,0,s),(u=e.b1(e.N(o[1])*s,0,s))<d&&(u+=s),u-d<m&&(p=m/(u-d)));let{x:g,y:_}=this.project.call({worldSize:s},t),b=Math.max(p||0,h||0);if(b){let t=new e.P(p?(u+d)/2:g,h?(c+l)/2:_);return a.center=this.unproject.call({worldSize:s},t).wrap(),a.zoom+=this.scaleZoom(b),a}if(this.latRange){let t=f/2;_-t<l&&(r=l+t),_+t>c&&(r=c-t)}if(o){let t=(d+u)/2,i=g;this._renderWorldCopies&&(i=e.b1(g,t-s/2,t+s/2));let r=m/2;i-r<d&&(n=d+r),i+r>u&&(n=u-r)}if(void 0!==n||void 0!==r){let t=new e.P(null!=n?n:g,null!=r?r:_);a.center=this.unproject.call({worldSize:s},t).wrap()}return a}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:e,zoom:i}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=i,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;let t=this.centerOffset,i=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b3(1,this.center.lat)*this.worldSize;let r=e.an(new Float64Array(16));e.J(r,r,[this.width/2,-this.height/2,1]),e.H(r,r,[1,-1,0]),this.labelPlaneMatrix=r,r=e.an(new Float64Array(16)),e.J(r,r,[1,-1,1]),e.H(r,r,[-1,-1,0]),e.J(r,r,[2/this.width,2/this.height,1]),this.glCoordMatrix=r;let a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,c=Math.PI/2+this._pitch,d=this._fov*(.5+t.y/this.height),u=Math.sin(d)*l/Math.sin(e.ac(Math.PI-c-d,.01,Math.PI-.01)),h=this.getHorizon(),p=2*Math.atan(h/this.cameraToCenterDistance)*(.5+t.y/(2*h)),m=Math.min(u,Math.sin(p)*l/Math.sin(e.ac(Math.PI-c-p,.01,Math.PI-.01))),f=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),g=this.height/50;r=new Float64Array(16),e.b4(r,this._fov,this.width/this.height,g,f),r[8]=-(2*t.x)/this.width,r[9]=2*t.y/this.height,e.J(r,r,[1,-1,1]),e.H(r,r,[0,0,-this.cameraToCenterDistance]),e.b5(r,r,this._pitch),e.ad(r,r,this.angle),e.H(r,r,[-i,-n,0]),this.mercatorMatrix=e.J([],r,[this.worldSize,this.worldSize,this.worldSize]),e.J(r,r,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.K(new Float64Array(16),this.labelPlaneMatrix,r),e.H(r,r,[0,0,-this.elevation]),this.projMatrix=r,this.invProjMatrix=e.ar([],r),this.pixelMatrix3D=e.K(new Float64Array(16),this.labelPlaneMatrix,r);let _=this.width%2/2,b=this.height%2/2,y=Math.cos(this.angle),v=Math.sin(this.angle),x=i-Math.round(i)+y*_+v*b,w=n-Math.round(n)+y*b+v*_,k=new Float64Array(r);if(e.H(k,k,[x>.5?x-1:x,w>.5?w-1:w,0]),this.alignedProjMatrix=k,!(r=e.ar(new Float64Array(16),this.pixelMatrix)))throw Error("failed to invert matrix");this.pixelMatrixInverse=r,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let t=this.pointCoordinate(new e.P(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){let i=this.getCameraPoint();if(1===t.length)return[t[0],i];{let n=i.x,r=i.y,a=i.x,o=i.y;for(let e of t)n=Math.min(n,e.x),r=Math.min(r,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);return[new e.P(n,r),new e.P(a,r),new e.P(a,o),new e.P(n,o),new e.P(n,r)]}}lngLatToCameraDepth(t,i){let n=this.locationCoordinate(t),r=[n.x*this.worldSize,n.y*this.worldSize,i,1];return e.af(r,r,this.projMatrix),r[2]/r[3]}}function iS(t,e){let i,n=!1,r=null,a=null,o=()=>{r=null,n&&(t.apply(a,i),r=setTimeout(o,e),n=!1)};return(...t)=>(n=!0,a=this,i=t,r||o(),r)}class iz{constructor(t){this._getCurrentHash=()=>{let t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map(t=>t.split("=")).forEach(t=>{t[0]===this._hashName&&(e=t)}),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(t.length>=3&&!t.some(t=>isNaN(t))){let e=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:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,t)}catch(t){}},this._updateHash=iS(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()),delete this._map,this}getHashString(t){let e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,n=Math.pow(10,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10)),r=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,o=this._map.getBearing(),s=this._map.getPitch(),l="";if(l+=t?`/${r}/${a}/${i}`:`${i}/${a}/${r}`,(o||s)&&(l+="/"+Math.round(10*o)/10),s&&(l+=`/${Math.round(s)}`),this._hashName){let t=this._hashName,e=!1,i=window.location.hash.slice(1).split("&").map(i=>{let n=i.split("=")[0];return n===t?(e=!0,`${n}=${l}`):i}).filter(t=>t);return e||i.push(`${t}=${l}`),`#${i.join("&")}`}return`#${l}`}}let iL={linearity:.3,easing:e.b6(0,0,.3,1)},iM=e.e({deceleration:2500,maxSpeed:1400},iL),iP=e.e({deceleration:20,maxSpeed:1400},iL),iR=e.e({deceleration:1e3,maxSpeed:360},iL),iO=e.e({deceleration:1e3,maxSpeed:90},iL);class iD{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,e=u.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);let n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(i.pan.mag()){let a=iF(i.pan.mag(),n,e.e({},iM,t||{}));r.offset=i.pan.mult(a.amount/i.pan.mag()),r.center=this._map.transform.center,iB(r,a)}if(i.zoom){let t=iF(i.zoom,n,iP);r.zoom=this._map.transform.zoom+t.amount,iB(r,t)}if(i.bearing){let t=iF(i.bearing,n,iR);r.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),iB(r,t)}if(i.pitch){let t=iF(i.pitch,n,iO);r.pitch=this._map.transform.pitch+t.amount,iB(r,t)}if(r.zoom||r.bearing){let t=void 0===i.pinchAround?i.around:i.pinchAround;r.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(r,{noMoveStart:!0})}}function iB(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function iF(t,i,n){let{maxSpeed:r,linearity:a,deceleration:o}=n,s=e.ac(t*a/(i/1e3),-r,r),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:l/2*s}}class iN extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,n,r={}){let a=h.mousePos(i.getCanvas(),n);super(t,e.e({point:a,lngLat:i.unproject(a),originalEvent:n},r)),this._defaultPrevented=!1,this.target=i}}class iV extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,n){let r="touchend"===t?n.changedTouches:n.touches,a=h.touchPos(i.getCanvasContainer(),r),o=a.map(t=>i.unproject(t)),s=a.reduce((t,e,i,n)=>t.add(e.div(n.length)),new e.P(0,0));super(t,{points:a,point:s,lngLats:o,lngLat:i.unproject(s),originalEvent:n}),this._defaultPrevented=!1}}class iU extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class i${constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new iU(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new iN(t.type,this._map,t))}mouseup(t){this._map.fire(new iN(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new iN(t.type,this._map,t))}dblclick(t){return this._firePreventable(new iN(t.type,this._map,t))}mouseover(t){this._map.fire(new iN(t.type,this._map,t))}mouseout(t){this._map.fire(new iN(t.type,this._map,t))}touchstart(t){return this._firePreventable(new iV(t.type,this._map,t))}touchmove(t){this._map.fire(new iV(t.type,this._map,t))}touchend(t){this._map.fire(new iV(t.type,this._map,t))}touchcancel(t){this._map.fire(new iV(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ij{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new iN(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new iN("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new iN(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iH{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this._map.terrain)}}class iq{constructor(t,e){this._map=t,this._tr=new iH(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(h.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active||this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=e,this._box||(this._box=h.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let n=Math.min(i.x,e.x),r=Math.max(i.x,e.x),a=Math.min(i.y,e.y),o=Math.max(i.y,e.y);h.setTransform(this._box,`translate(${n}px,${a}px)`),this._box.style.width=r-n+"px",this._box.style.height=o-a+"px"}mouseupWindow(t,i){if(!this._active||0!==t.button)return;let n=this._startPos;if(this.reset(),h.suppressClick(),n.x!==i.x||n.y!==i.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(n,i,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&&(h.remove(this._box),this._box=null),h.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.k(t,{originalEvent:i}))}}function iG(t,e){if(t.length!==e.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);let i={};for(let n=0;n<t.length;n++)i[t[n].identifier]=e[n];return i}class iX{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){let i=new e.P(0,0);for(let e of t)i._add(e);return i.div(t.length)}(i),this.touches=iG(n,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;let n=iG(i,e);for(let t in this.touches){let e=n[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,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}}}class iZ{constructor(t){this.singleTap=new iX(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){let n=this.singleTap.touchend(t,e,i);if(n){let e=t.timeStamp-this.lastTime<500,i=!this.lastTap||30>this.lastTap.dist(n);if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class iW{constructor(t){this._tr=new iH(t),this._zoomIn=new iZ({numTouches:1,numTaps:2}),this._zoomOut=new iZ({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){let n=this._zoomIn.touchend(t,e,i),r=this._zoomOut.touchend(t,e,i),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:t})}):r?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(r)},{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}}class iY{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 e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let n=e.length?e[0]:e;return!this._moved&&n.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=n,this._move(i,n))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&h.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 iK={0:1,2:2};class iJ{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){let e=h.mouseButton(t);this._eventButton=e}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){let i=iK[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return h.mouseButton(t)===this._eventButton}}class iQ{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)}}let i0=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=function(t){t.preventDefault()}},i1=({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:i=.8})=>new iY({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*i}),moveStateManager:new iJ({checkCorrectEvent:t=>0===h.mouseButton(t)&&t.ctrlKey||2===h.mouseButton(t)}),enable:t,assignEvents:i0}),i2=({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5})=>new iY({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:new iJ({checkCorrectEvent:t=>0===h.mouseButton(t)&&t.ctrlKey||2===h.mouseButton(t)}),enable:t,assignEvents:i0});class i5{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active&&!(i.length<this.minTouchs()))return t.preventDefault(),this._calculateTransform(t,e,i)}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&i.length<this.minTouchs()&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,n){n.length>0&&(this._active=!0);let r=iG(n,i),a=new e.P(0,0),o=new e.P(0,0),s=0;for(let t in r){let e=r[t],i=this._touches[t];i&&(a._add(e),o._add(e.sub(i)),s++,r[t]=e)}if(this._touches=r,s<this.minTouchs()||!o.mag())return;let l=o.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class i3{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();let[n,r]=this._firstTwoTouches,a=i4(i,e,n),o=i4(i,e,r);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;let[n,r]=this._firstTwoTouches,a=i4(i,e,n),o=i4(i,e,r);a&&o||(this._active&&h.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 i4(t,e,i){for(let n=0;n<t.length;n++)if(t[n].identifier===i)return e[n]}function i6(t,e){return Math.log(t/e)/Math.LN2}class i7 extends i3{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){let i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(.1>Math.abs(i6(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:i6(this._distance,i),pinchAround:e}}}function i8(t,e){return 180*t.angleWith(e)/Math.PI}class i9 extends i3{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,e,i){let n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:i8(this._vector,n),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let e=25/(Math.PI*this._minDiameter)*360;return Math.abs(i8(t,this._startVector))<e}}function nt(t){return Math.abs(t.y)>Math.abs(t.x)}class ne extends i3{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,i){super.touchstart(t,e,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,nt(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let n=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,r,i.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:-((n.y+r.y)/2*.5)}):void 0}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;let n=t.mag()>=2,r=e.mag()>=2;if(!n&&!r)return;if(!n||!r)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let a=t.y>0==e.y>0;return nt(t)&&nt(e)&&a}}let ni=100,nn=15,nr=10;class na{constructor(t){this._tr=new iH(t),this._panStep=ni,this._bearingStep=nn,this._pitchStep=nr,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,n=0,r=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),r=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),r=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:no,zoom:e?Math.round(s.zoom)+e*(t.shiftKey?2:1):s.zoom,bearing:s.bearing+i*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-r*this._panStep,-a*this._panStep],center:s.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 no(t){return t*(2-t)}class ns{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new iH(t),this._triggerRenderFrame=e,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)}wheel(t){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!t[this._map.cooperativeGestures._bypassKey])return;let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=u.now(),n=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&4>Math.abs(e)?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(n*e)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let i=h.mousePos(this._map.getCanvas(),t),n=this._tr;this._around=i.y>n.transform.height/2-n.transform.getHorizon()?e.M.convert(this._aroundCenter?n.center:n.unproject(i)):e.M.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if(0!==this._delta){let e="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==i&&(i=1/i);let n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*i))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let i="number"==typeof this._targetZoom?this._targetZoom:t.zoom,n=this._startZoom,r=this._easing,a,o=!1;if("wheel"===this._type&&n&&r){let t=Math.min((u.now()-this._lastWheelEventTime)/200,1),s=r(t);a=e.z.number(n,i,s),t<1?this._frameId||(this._frameId=!0):o=!0}else a=i,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!o,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.b7;if(this._prevEase){let t=this._prevEase,n=(u.now()-t.start)/t.duration,r=t.easing(n+.01)-t.easing(n),a=.27/Math.sqrt(r*r+1e-4)*.01,o=Math.sqrt(.0729-a*a);i=e.b6(a,o,.25,1)}return this._prevEase={start:u.now(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class nl{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class nc{constructor(t){this._tr=new iH(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nd{constructor(){this._tap=new iZ({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,i){if(!this._swipePoint)if(this._tapTime){let n=e[0],r=t.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(n);r&&a?i.length>0&&(this._swipePoint=n,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,e,i)}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let n=e[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{let n=this._tap.touchend(t,e,i);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nu{constructor(t,e,i){this._el=t,this._mousePan=e,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()}}class nh{constructor(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class np{constructor(t,e,i,n){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=n,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()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class nm{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,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=h.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=e,this._container.appendChild(n);let r=document.createElement("div");r.className="maplibregl-mobile-message",r.textContent=i,this._container.appendChild(r),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(h.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(t){this._onCooperativeGesture(1===t.touches.length)}wheel(t){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!t[this._bypassKey])}_onCooperativeGesture(t){this._enabled&&t&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let nf=t=>t.zoom||t.drag||t.pitch||t.rotate;class ng extends e.k{}function n_(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class nb{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let i="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},r={},a={},o=t.touches,s=o?this._getMapTouches(o):void 0,l=s?h.touchPos(this._map.getCanvas(),s):h.mousePos(this._map.getCanvas(),t);for(let{handlerName:o,handler:c,allowed:d}of this._handlers){let u;c.isEnabled()&&(this._blockedByActive(a,d,o)?c.reset():c[e||t.type]&&(u=c[e||t.type](t,l,s),this.mergeHandlerResult(n,r,u,o,i),u&&u.needsRenderFrame&&this._triggerRenderFrame()),(u||c.isActive())&&(a[o]=c))}let c={};for(let t in this._previousActiveHandlers)a[t]||(c[t]=i);this._previousActiveHandlers=a,(Object.keys(c).length||n_(n))&&(this._changes.push([n,r,c]),this._triggerRenderFrame()),(Object.keys(a).length||n_(n))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:d}=n;d&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],d(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iD(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);let i=this._el;for(let[t,e,n]of(this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[window,"blur",void 0]],this._listeners))h.addEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(let[t,e,i]of this._listeners)h.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new i$(e,t));let n=e.boxZoom=new iq(e,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();let r=e.cooperativeGestures=new nm(e,t.cooperativeGestures);this._add("cooperativeGestures",r),t.cooperativeGestures&&r.enable();let a=new iW(e),o=new nc(e);e.doubleClickZoom=new nl(o,a),this._add("tapZoom",a),this._add("clickZoom",o),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();let s=new nd;this._add("tapDragZoom",s);let l=e.touchPitch=new ne(e);this._add("touchPitch",l),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);let c=i1(t),d=i2(t);e.dragRotate=new nh(t,c,d),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",d,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();let u=(({enable:t,clickTolerance:e})=>new iY({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:new iJ({checkCorrectEvent:t=>0===h.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:i0}))(t),p=new i5(t,e);e.dragPan=new nu(i,u,p),this._add("mousePan",u),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);let m=new i9,f=new i7;e.touchZoomRotate=new np(i,f,m,s),this._add("touchRotate",m,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);let g=e.scrollZoom=new ns(e,()=>this._triggerRenderFrame());this._add("scrollZoom",g,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);let _=e.keyboard=new na(e);this._add("keyboard",_),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new ij(e))}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}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!!nf(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,e,i){for(let n in t)if(n!==i&&(!e||0>e.indexOf(n)))return!0;return!1}_getMapTouches(t){let e=[];for(let i of t)this._el.contains(i.target)&&e.push(i);return e}mergeHandlerResult(t,i,n,r,a){if(!n)return;e.e(t,n);let o={handlerName:r,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(i.zoom=o),void 0!==n.panDelta&&(i.drag=o),void 0!==n.pitchDelta&&(i.pitch=o),void 0!==n.bearingDelta&&(i.rotate=o)}_applyChanges(){let t={},i={},n={};for(let[r,a,o]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new e.P(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),void 0!==r.around&&(t.around=r.around),void 0!==r.pinchAround&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),e.e(i,a),e.e(n,o);this._updateMapTransform(t,i,n),this._changes=[]}_updateMapTransform(t,e,i){let n=this._map,r=n._getTransformForUpdate(),a=n.terrain;if(!(n_(t)||a&&this._terrainMovement))return this._fireEvents(e,i,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:d,pinchAround:u}=t;void 0!==u&&(d=u),n._stop(!0),d=d||n.transform.centerPoint;let h=r.pointLocation(o?d.sub(o):d);l&&(r.bearing+=l),c&&(r.pitch+=c),s&&(r.zoom+=s),a?!this._terrainMovement&&(e.drag||e.zoom)?(this._terrainMovement=!0,this._map._elevationFreeze=!0,r.setLocationAtPoint(h,d),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,r.recalculateZoom(n.terrain)})):e.drag&&this._terrainMovement?r.center=r.pointLocation(r.centerPoint.sub(o)):r.setLocationAtPoint(h,d):r.setLocationAtPoint(h,d),n._applyUpdatedTransform(r),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)}_fireEvents(t,i,n){let r,a=nf(this._eventsInProgress),o=nf(t),s={};for(let e in t){let{originalEvent:i}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=i),this._eventsInProgress[e]=t[e]}for(let t in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(t,s[t]);for(let e in o&&this._fireEvent("move",o.originalEvent),t){let{originalEvent:i}=t[e];this._fireEvent(e,i)}let l={};for(let t in this._eventsInProgress){let{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],r=i[e]||n,l[`${t}end`]=r)}for(let t in l)this._fireEvent(t,l[t]);let c=nf(this._eventsInProgress);if(n&&(a||o)&&!c){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t&&(t.essential||!u.prefersReducedMotion)?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:r})):(this._map.fire(new e.k("moveend",{originalEvent:r})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.k(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new ng("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class ny extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{let t=Math.min((u.now()-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._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.M(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,i,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),n)}panTo(t,i,n){return this.easeTo(e.e({center:t},i),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,n){return this.easeTo(e.e({zoom:t},i),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,i,n){return this.easeTo(e.e({bearing:t},i),n)}resetNorth(t,i){return this.rotateTo(0,e.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=G.convert(t);let i=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)}_cameraForBoxAndBearing(t,i,n,r){let a={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=e.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){let t=r.padding;r.padding={top:t,bottom:t,right:t,left:t}}r.padding=e.e(a,r.padding);let o=this.transform,s=o.padding,l=new G(t,i),c=o.project(l.getNorthWest()),d=o.project(l.getNorthEast()),u=o.project(l.getSouthEast()),h=o.project(l.getSouthWest()),p=e.b8(-n),m=c.rotate(p),f=d.rotate(p),g=u.rotate(p),_=h.rotate(p),b=new e.P(Math.max(m.x,f.x,_.x,g.x),Math.max(m.y,f.y,_.y,g.y)),y=new e.P(Math.min(m.x,f.x,_.x,g.x),Math.min(m.y,f.y,_.y,g.y)),v=b.sub(y),x=(o.width-(s.left+s.right+r.padding.left+r.padding.right))/v.x,w=(o.height-(s.top+s.bottom+r.padding.top+r.padding.bottom))/v.y;if(w<0||x<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let k=Math.min(o.scaleZoom(o.scale*Math.min(x,w)),r.maxZoom),E=e.P.convert(r.offset),C=new e.P((r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2).rotate(e.b8(n)),A=E.add(C).mult(o.scale/o.zoomScale(k));return{center:o.unproject(c.add(u).div(2).sub(A)),zoom:k,bearing:n}}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,i,n,r,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(t)),this.transform.pointLocation(e.P.convert(i)),n,r),r,a)}_fitInternal(t,i,n){return t?(delete(i=e.e(t,i)).padding,i.linear?this.easeTo(i,n):this.flyTo(i,n)):this}jumpTo(t,i){this.stop();let n=this._getTransformForUpdate(),r=!1,a=!1,o=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(r=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.M.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(a=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch),null==t.padding||n.isPaddingEqual(t.padding)||(n.padding=t.padding),this._applyUpdatedTransform(n),this.fire(new e.k("movestart",i)).fire(new e.k("move",i)),r&&this.fire(new e.k("zoomstart",i)).fire(new e.k("zoom",i)).fire(new e.k("zoomend",i)),a&&this.fire(new e.k("rotatestart",i)).fire(new e.k("rotate",i)).fire(new e.k("rotateend",i)),o&&this.fire(new e.k("pitchstart",i)).fire(new e.k("pitch",i)).fire(new e.k("pitchend",i)),this.fire(new e.k("moveend",i))}calculateCameraOptionsFromTo(t,i,n,r=0){let a=e.Y.fromLngLat(t,i),o=e.Y.fromLngLat(n,r),s=o.x-a.x,l=o.y-a.y,c=o.z-a.z,d=Math.hypot(s,l,c);if(0===d)throw Error("Can't calculate camera options with same From and To");let u=Math.hypot(s,l),h=this.transform.scaleZoom(this.transform.cameraToCenterDistance/d/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI,m=180*Math.acos(u/d)/Math.PI;return m=c<0?90-m:90+m,{center:o.toLngLat(),zoom:h,pitch:m,bearing:p}}easeTo(t,i){var n;let r,a;this._stop(!1,t.easeId),(!1===(t=e.e({offset:[0,0],duration:500,easing:e.b7},t)).animate||!t.essential&&u.prefersReducedMotion)&&(t.duration=0);let o=this._getTransformForUpdate(),s=this.getZoom(),l=this.getBearing(),c=this.getPitch(),d=this.getPadding(),h="bearing"in t?this._normalizeBearing(t.bearing,l):l,p="pitch"in t?+t.pitch:c,m="padding"in t?t.padding:o.padding,f=e.P.convert(t.offset),g=o.centerPoint.add(f),_=o.pointLocation(g),{center:b,zoom:y}=o.getConstrained(e.M.convert(t.center||_),null!=(n=t.zoom)?n:s);this._normalizeCenter(b);let v=o.project(_),x=o.project(b).sub(v),w=o.zoomScale(y-s);t.around&&(r=e.M.convert(t.around),a=o.locationPoint(r));let k={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==s,this._rotating=this._rotating||l!==h,this._pitching=this._pitching||p!==c,this._padding=!o.isPaddingEqual(m),this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,k),this.terrain&&this._prepareElevation(b),this._ease(n=>{if(this._zooming&&(o.zoom=e.z.number(s,y,n)),this._rotating&&(o.bearing=e.z.number(l,h,n)),this._pitching&&(o.pitch=e.z.number(c,p,n)),this._padding&&(o.interpolatePadding(d,m,n),g=o.centerPoint.add(f)),this.terrain&&!t.freezeElevation&&this._updateElevation(n),r)o.setLocationAtPoint(r,a);else{let t=o.zoomScale(o.zoom-s),e=Math.pow(y>s?Math.min(2,w):Math.max(.5,w),1-n),i=o.unproject(v.add(x.mult(n*e)).mult(t));o.setLocationAtPoint(o.renderWorldCopies?i.wrap():i,g)}this._applyUpdatedTransform(o),this._fireMoveEvents(i)},t=>{this.terrain&&this._finalizeElevation(),this._afterEase(i,t)},t),this}_prepareEase(t,i,n={}){this._moving=!0,i||n.moving||this.fire(new e.k("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){let e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(i-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.elevation=e.z.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;let e=t.clone(),{center:i,zoom:n,pitch:r,bearing:a,elevation:o}=this.transformCameraUpdate(e);i&&(e.center=i),void 0!==n&&(e.zoom=n),void 0!==r&&(e.pitch=r),void 0!==a&&(e.bearing=a),void 0!==o&&(e.elevation=o),this.transform.apply(e)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;let n=this._zooming,r=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.k("zoomend",t)),r&&this.fire(new e.k("rotateend",t)),a&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,i){var n;if(!t.essential&&u.prefersReducedMotion){let n=e.L(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,i)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b7},t);let r=this._getTransformForUpdate(),a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="bearing"in t?this._normalizeBearing(t.bearing,o):o,d="pitch"in t?+t.pitch:s,h="padding"in t?t.padding:r.padding,p=e.P.convert(t.offset),m=r.centerPoint.add(p),f=r.pointLocation(m),{center:g,zoom:_}=r.getConstrained(e.M.convert(t.center||f),null!=(n=t.zoom)?n:a);this._normalizeCenter(g);let b=r.zoomScale(_-a),y=r.project(f),v=r.project(g).sub(y),x=t.curve,w=Math.max(r.width,r.height),k=w/b,E=v.mag();if("minZoom"in t){let i=e.ac(Math.min(t.minZoom,a,_),r.minZoom,r.maxZoom);x=Math.sqrt(w/r.zoomScale(i-a)/E*2)}let C=x*x;function A(t){let e=(k*k-w*w+(t?-1:1)*C*C*E*E)/(2*(t?k:w)*C*E);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}let S=A(!1),z=function(t){return I(S)/I(S+x*t)},M=function(t){var e;return w*((I(S)*(T(e=S+x*t)/I(e))-T(S))/C)/E},P=(A(!0)-S)/x;if(1e-6>Math.abs(E)||!isFinite(P)){if(1e-6>Math.abs(w-k))return this.easeTo(t,i);let e=k<w?-1:1;P=Math.abs(Math.log(k/w))/x,M=function(){return 0},z=function(t){return Math.exp(e*x*t)}}return t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?t.screenSpeed/x:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=o!==c,this._pitching=d!==s,this._padding=!r.isPaddingEqual(h),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(g),this._ease(n=>{let u=n*P,f=1/z(u);r.zoom=1===n?_:a+r.scaleZoom(f),this._rotating&&(r.bearing=e.z.number(o,c,n)),this._pitching&&(r.pitch=e.z.number(s,d,n)),this._padding&&(r.interpolatePadding(l,h,n),m=r.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n);let b=1===n?g:r.unproject(y.add(v.mult(M(u))).mult(f));r.setLocationAtPoint(r.renderWorldCopies?b.wrap():b,m),this._applyUpdatedTransform(r),this._fireMoveEvents(i)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){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,e)}if(!t){let t=this.handlers;t&&t.stop(!1)}return this}_ease(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=u.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){let n=Math.abs((t=e.b1(t,-180,180))-i);return Math.abs(t-360-i)<n&&(t-=360),Math.abs(t+360-i)<n&&(t+=360),t}_normalizeCenter(t){let e=this.transform;if(!e.renderWorldCopies||e.lngRange)return;let i=t.lng-e.center.lng;t.lng+=i>180?-360:360*(i<-180)}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.M.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}let nv={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class nx{constructor(t=nv){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&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType||"style"===t.dataType||"terrain"===t.type)&&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=h.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=h.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=h.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(){h.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,e){let i=this._map._getUIString(`AttributionControl.${e}`);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 e=this._map.style.sourceCaches;for(let i in e){let n=e[i];if(n.used||n.usedForTerrain){let e=n.getSource();e.attribution&&0>t.indexOf(e.attribution)&&t.push(e.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,e)=>t.length-e.length);let i=(t=t.filter((e,i)=>{for(let n=i+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0})).join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class nw{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=h.create("div","maplibregl-ctrl");let e=h.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){h.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class nk{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){let e=this._currentlyRunning;for(let i of e?this._queue.concat(e):this._queue)if(i.id===t)return void(i.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let e=this._currentlyRunning=this._queue;for(let i of(this._queue=[],e))if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var nE=e.X([{name:"a_pos3d",type:"Int16",components:3}]);class nC extends e.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,i){this.sourceCache.update(t,i),this._renderableTilesKeys=[];let n={};for(let r of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i}))n[r.key]=!0,this._renderableTilesKeys.push(r.key),this._tiles[r.key]||(r.posMatrix=new Float64Array(16),e.aN(r.posMatrix,0,e.W,0,e.W,0,1),this._tiles[r.key]=new tl(r,this.tileSize));for(let t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(t){for(let e in this._tiles){let i=this._tiles[e];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){let i={};for(let n of this._renderableTilesKeys){let r=this._tiles[n].tileID;if(r.canonical.equals(t.canonical)){let r=t.clone();r.posMatrix=new Float64Array(16),e.aN(r.posMatrix,0,e.W,0,e.W,0,1),i[n]=r}else if(r.canonical.isChildOf(t.canonical)){let a=t.clone();a.posMatrix=new Float64Array(16);let o=r.canonical.z-t.canonical.z,s=r.canonical.x-(r.canonical.x>>o<<o),l=r.canonical.y-(r.canonical.y>>o<<o),c=e.W>>o;e.aN(a.posMatrix,0,c,0,c,0,1),e.H(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),i[n]=a}else if(t.canonical.isChildOf(r.canonical)){let a=t.clone();a.posMatrix=new Float64Array(16);let o=t.canonical.z-r.canonical.z,s=t.canonical.x-(t.canonical.x>>o<<o),l=t.canonical.y-(t.canonical.y>>o<<o),c=e.W>>o;e.aN(a.posMatrix,0,e.W,0,e.W,0,1),e.H(a.posMatrix,a.posMatrix,[s*c,l*c,0]),e.J(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),i[n]=a}}return i}getSourceTile(t,e){let i=this.sourceCache._source,n=t.overscaledZ-this.deltaZoom;if(n>i.maxzoom&&(n=i.maxzoom),n<i.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(n).key);let r=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!r||!r.dem)&&e)for(;n>=i.minzoom&&(!r||!r.dem);)r=this.sourceCache.getTileByID(t.scaledTo(n--).key);return r}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(e=>e.timeAdded>=t)}}class nA{constructor(t,e,i){this.painter=t,this.sourceCache=new nC(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,i,n,r=e.W){var a,o,s,l,c,d;if(!(i>=0&&i<r&&n>=0&&n<r))return 0;let u=this.getTerrainData(t),h=null==(a=u.tile)?void 0:a.dem;if(!h)return 0;let p=(o=[],s=[i/r*e.W,n/r*e.W],l=u.u_terrain_matrix,c=s[0],d=s[1],o[0]=l[0]*c+l[4]*d+l[12],o[1]=l[1]*c+l[5]*d+l[13],o),m=[p[0]*h.dim,p[1]*h.dim],f=Math.floor(m[0]),g=Math.floor(m[1]),_=m[0]-f,b=m[1]-g;return h.get(f,g)*(1-_)*(1-b)+h.get(f+1,g)*_*(1-b)+h.get(f,g+1)*(1-_)*b+h.get(f+1,g+1)*_*b}getElevationForLngLatZoom(t,i){let{tileID:n,mercatorX:r,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(n,r%e.W,a%e.W,e.W)}getElevation(t,i,n,r=e.W){return this.getDEMElevation(t,i,n,r)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){let t=this.painter.context,i=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new S(t,i,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new S(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}let i=this.sourceCache.getSourceTile(t,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){let t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new S(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}let n=i&&i+i.tileID.key+t.key;if(n&&!this._demMatrixCache[n]){let n=this.sourceCache.sourceCache._source.maxzoom,r=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=n?r=t.canonical.z-n:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let a=t.canonical.x-(t.canonical.x>>r<<r),o=t.canonical.y-(t.canonical.y>>r<<r),s=e.b9(new Float64Array(16),[1/(e.W<<r),1/(e.W<<r),0]);e.H(s,s,[a*e.W,o*e.W,0]),this._demMatrixCache[t.key]={matrix:s,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){let e=this.painter,i=e.width/devicePixelRatio,n=e.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==i||this._fbo.height!==n)&&(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new S(e.context,{width:i,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new S(e.context,{width:i,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(i,n,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,i,n))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,e=0;t<this._coordsTextureSize;t++)for(let n=0;n<this._coordsTextureSize;n++,e+=4)i[e+0]=255&n,i[e+1]=255&t,i[e+2]=n>>8<<4|t>>8,i[e+3]=0;let n=new S(t,new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),t.gl.RGBA,{premultiply:!1});return n.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);let i=new Uint8Array(4),n=this.painter.context,r=n.gl;n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,i),n.bindFramebuffer.set(null);let a=i[0]+(i[2]>>4<<8),o=i[1]+((15&i[2])<<8),s=this.coordsIndex[255-i[3]],l=s&&this.sourceCache.getTileByID(s);if(!l)return null;let c=this._coordsTextureSize,d=(1<<l.tileID.canonical.z)*c;return new e.Y((l.tileID.canonical.x*c+a)/d+l.tileID.wrap,(l.tileID.canonical.y*c+o)/d,this.getElevation(l.tileID,a,o,c))}depthAtPoint(t){let e=new Uint8Array(4),i=this.painter.context,n=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),n.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,n.RGBA,n.UNSIGNED_BYTE,e),i.bindFramebuffer.set(null),(e[0]/0x1000000+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let t=this.painter.context,i=new e.ba,n=new e.aX,r=this.meshSize,a=e.W/r,o=r*r;for(let t=0;t<=r;t++)for(let e=0;e<=r;e++)i.emplaceBack(e*a,t*a,0);for(let t=0;t<o;t+=r+1)for(let e=0;e<r;e++)n.emplaceBack(e+t,r+e+t+1,r+e+t+2),n.emplaceBack(e+t,r+e+t+2,e+t+1);let s=i.length,l=s+2*(r+1);for(let t of[0,1])for(let n=0;n<=r;n++)for(let r of[0,1])i.emplaceBack(n*a,t*e.W,r);for(let t=0;t<2*r;t+=2)n.emplaceBack(l+t,l+t+1,l+t+3),n.emplaceBack(l+t,l+t+3,l+t+2),n.emplaceBack(s+t,s+t+3,s+t+1),n.emplaceBack(s+t,s+t+2,s+t+3);let c=i.length,d=c+2*(r+1);for(let t of[0,1])for(let n=0;n<=r;n++)for(let r of[0,1])i.emplaceBack(t*e.W,n*a,r);for(let t=0;t<2*r;t+=2)n.emplaceBack(c+t,c+t+1,c+t+3),n.emplaceBack(c+t,c+t+3,c+t+2),n.emplaceBack(d+t,d+t+3,d+t+1),n.emplaceBack(d+t,d+t+2,d+t+3);return this._mesh={indexBuffer:t.createIndexBuffer(n),vertexBuffer:t.createVertexBuffer(i,nE.members),segments:e.$.simpleSegment(0,0,i.length,n.length)},this._mesh}getMeshFrameDelta(t){return 2*Math.PI*e.bb/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,e){var i;let{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(t,e);return null!=(i=this.getMinMaxElevation(n).minElevation)?i:0}getMinMaxElevation(t){let e=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return e&&e.dem&&(i.minElevation=e.dem.min*this.exaggeration,i.maxElevation=e.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){let n=e.Y.fromLngLat(t.wrap()),r=(1<<i)*e.W,a=n.x*r,o=n.y*r,s=Math.floor(a/e.W),l=Math.floor(o/e.W);return{tileID:new e.Q(i,0,i,s,l),mercatorX:a,mercatorY:o}}}class nT{constructor(t,e,i){this._context=t,this._size=e,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let e=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),i=new S(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return i.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),e.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),e.colorAttachment.set(i.texture),{id:t,fbo:e,texture:i,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(e=>t.id!==e),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(t=>!t.inUse)}}let nI={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class nS{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new nT(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){for(let i in this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(e)),this._coordsDescendingInv={},t.sourceCaches)for(let e of(this._coordsDescendingInv[i]={},t.sourceCaches[i].getVisibleCoordinates())){let t=this.terrain.sourceCache.getTerrainCoords(e);for(let e in t)this._coordsDescendingInv[i][e]||(this._coordsDescendingInv[i][e]=[]),this._coordsDescendingInv[i][e].push(t[e])}for(let e of(this._coordsDescendingInvStr={},t._order)){let i=t._layers[e],n=i.source;if(nI[i.type]&&!this._coordsDescendingInvStr[n])for(let t in this._coordsDescendingInvStr[n]={},this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][t]=this._coordsDescendingInv[n][t].map(t=>t.key).sort().join()}for(let t of this._renderableTiles)for(let e in this._coordsDescendingInvStr){let i=this._coordsDescendingInvStr[e][t.tileID.key];i&&i!==t.rttCoords[e]&&(t.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;let i=t.type,n=this.painter,r=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(nI[i]&&(this._prevType&&nI[this._prevType]||this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(t.id),!r))return!0;if(nI[this._prevType]||nI[i]&&r){this._prevType=i;let t=this._stacks.length-1,r=this._stacks[t]||[];for(let i of this._renderableTiles){if(this.pool.isFull()&&(ik(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(i),i.rtt[t]){let e=this.pool.getObjectForId(i.rtt[t].id);if(e.stamp===i.rtt[t].stamp){this.pool.useObject(e);continue}}let a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),i.rtt[t]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:e.aO.transparent,stencil:0}),n.currentStencilSource=void 0;for(let t=0;t<r.length;t++){let e=n.style._layers[r[t]],o=e.source?this._coordsDescendingInv[e.source][i.tileID.key]:[i.tileID];n.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),n._renderTileClippingMasks(e,o),n.renderLayer(n,n.style.sourceCaches[e.source],e,o),e.source&&(i.rttCoords[e.source]=this._coordsDescendingInvStr[e.source][i.tileID.key])}}return ik(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),nI[i]}return!1}}let nz={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","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"},nL={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:nv,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.a.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},nM=t=>{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},nP={showCompass:!0,showZoom:!0,visualizePitch:!1};class nR{constructor(t,i,n=!1){this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),h.mousePos(this.element,t)),h.addEventListener(window,"mousemove",this.mousemove),h.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,h.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=h.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),h.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=h.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},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.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let r=t.dragRotate._mouseRotate.getClickTolerance(),a=t.dragRotate._mousePitch.getClickTolerance();this.element=i,this.mouseRotate=i1({clickTolerance:r,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:i=.8})=>new iY({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*i}),moveStateManager:new iQ,enable:t,assignEvents:nM}))({clickTolerance:r,enable:!0}),this.map=t,n&&(this.mousePitch=i2({clickTolerance:a,enable:!0}),this.touchPitch=(({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5})=>new iY({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:new iQ,enable:t,assignEvents:nM}))({clickTolerance:a,enable:!0})),h.addEventListener(i,"mousedown",this.mousedown),h.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),h.addEventListener(i,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),h.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),h.disableDrag()}moveMouse(t,e){let i=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(t,e)||{};if(n&&i.setBearing(i.getBearing()+n),this.mousePitch){let{pitchDelta:n}=this.mousePitch.dragMove(t,e)||{};n&&i.setPitch(i.getPitch()+n)}}moveTouch(t,e){let i=this.map,{bearingDelta:n}=this.touchRotate.dragMove(t,e)||{};if(n&&i.setBearing(i.getBearing()+n),this.touchPitch){let{pitchDelta:n}=this.touchPitch.dragMove(t,e)||{};n&&i.setPitch(i.getPitch()+n)}}off(){let t=this.element;h.removeEventListener(t,"mousedown",this.mousedown),h.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend),h.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){h.enableDrag(),h.removeEventListener(window,"mousemove",this.mousemove),h.removeEventListener(window,"mouseup",this.mouseup),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend)}}function nO(t,i,n){let r=new e.M(t.lng,t.lat);if(t=new e.M(t.lng,t.lat),i){let r=new e.M(t.lng-360,t.lat),a=new e.M(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(i);n.locationPoint(r).distSqr(i)<o?t=r:n.locationPoint(a).distSqr(i)<o&&(t=a)}for(;Math.abs(t.lng-n.center.lng)>180;){let e=n.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t.lng!==r.lng&&n.locationPoint(t).y>n.height/2-n.getHorizon()?t:r}let nD={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 nB(t,e,i){let n=t.classList;for(let t in nD)n.remove(`maplibregl-${i}-anchor-${t}`);n.add(`maplibregl-${i}-anchor-${e}`)}class nF extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{let e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},this._onMapClick=t=>{let e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;let i=this._map.loaded()&&!this._map.isMoving();"terrain"!==(null==t?void 0:t.type)&&("render"!==(null==t?void 0:t.type)||i)||this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?nO(this._lngLat,this._flatPos,this._map.transform):null==(e=this._lngLat)?void 0:e.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`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)`),t&&"moveend"!==t.type||(this._pos=this._pos.round()),h.setTransform(this._element,`${nD[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${n}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(t&&"moveend"===t.type)}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}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 e.k("dragstart"))),this.fire(new e.k("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 e.k("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&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=h.create("div"),this._element.setAttribute("aria-label","Map marker");let i=h.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");let n=h.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd");let r=h.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"fill-rule","nonzero");let a=h.createNS("http://www.w3.org/2000/svg","g");for(let t of(a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000"),[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}])){let e=h.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),a.appendChild(e)}let o=h.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill",this._color);let s=h.createNS("http://www.w3.org/2000/svg","path");s.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),o.appendChild(s);let l=h.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"opacity","0.25"),l.setAttributeNS(null,"fill","#000000");let c=h.createNS("http://www.w3.org/2000/svg","path");c.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),l.appendChild(c);let d=h.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");let u=h.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(8.0, 8.0)");let p=h.createNS("http://www.w3.org/2000/svg","circle");p.setAttributeNS(null,"fill","#000000"),p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"cx","5.5"),p.setAttributeNS(null,"cy","5.5"),p.setAttributeNS(null,"r","5.4999962");let m=h.createNS("http://www.w3.org/2000/svg","circle");m.setAttributeNS(null,"fill","#FFFFFF"),m.setAttributeNS(null,"cx","5.5"),m.setAttributeNS(null,"cy","5.5"),m.setAttributeNS(null,"r","5.4999962"),u.appendChild(p),u.appendChild(m),r.appendChild(a),r.appendChild(o),r.appendChild(l),r.appendChild(d),r.appendChild(u),i.appendChild(r),i.setAttributeNS(null,"height",41*this._scale+"px"),i.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(i),this._offset=e.P.convert(t&&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()}),nB(this._element,this._anchor,"marker"),t&&t.className)for(let e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("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),h.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.M.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let e=Math.abs(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":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}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){var i,n;if(!(null==(i=this._map)?void 0:i.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let r=this._map,a=r.terrain.depthAtPoint(this._pos),o=r.terrain.getElevationForLngLatZoom(this._lngLat,r.transform.tileZoom);if(r.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);let s=-this._offset.y/r.transform._pixelPerMeter,l=Math.sin(r.getPitch()*Math.PI/180)*s,c=r.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),d=r.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;(null==(n=this._popup)?void 0:n.isOpen())&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.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._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}isDraggable(){return this._draggable}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,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}let nN={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},nV=0,nU=!1,n$={maxWidth:100,unit:"metric"};function nj(t,e,i){let n=i&&i.maxWidth||100,r=t._container.clientHeight/2,a=t.unproject([0,r]),o=t.unproject([n,r]),s=a.distanceTo(o);if(i&&"imperial"===i.unit){let i=3.2808*s;i>5280?nH(e,n,i/5280,t._getUIString("ScaleControl.Miles")):nH(e,n,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?nH(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?nH(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):nH(e,n,s,t._getUIString("ScaleControl.Meters"))}function nH(t,e,i,n){let r=function(t){let e=Math.pow(10,`${Math.floor(t)}`.length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){let e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i))}(i);t.style.width=r/i*e+"px",t.innerHTML=`${r}&nbsp;${n}`}let nq={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1};t.AJAXError=e.be,t.Evented=e.E,t.LngLat=e.M,t.MercatorCoordinate=e.Y,t.Point=e.P,t.addProtocol=e.bf,t.config=e.a,t.removeProtocol=e.bg,t.AttributionControl=nx,t.BoxZoomHandler=iq,t.CanvasSource=te,t.CooperativeGesturesHandler=nm,t.DoubleClickZoomHandler=nl,t.DragPanHandler=nu,t.DragRotateHandler=nh,t.EdgeInsets=iT,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null==(t=null==e?void 0:e.shadowRoot)?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){h.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=h.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);h.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 e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=K,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();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 e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{let i=new e.M(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,r=this._map.getBearing(),a=e.e({bearing:r},this.options.fitBoundsOptions),o=G.fromLngLat(i,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new e.M(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)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&&nU)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=h.create("button","maplibregl-ctrl-geolocate",this._container),h.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.w("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.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=h.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new nF({element:this._dotElement}),this._circleElement=h.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new nF({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")))})}},this.options=e.e({},nN,t)}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),(function(){return e._(this,arguments,void 0,function*(t=!1){if(void 0!==l&&!t)return l;if(void 0===window.navigator.permissions)return l=!!window.navigator.geolocation;try{let t=yield window.navigator.permissions.query({name:"geolocation"});l="denied"!==t.state}catch(t){l=!!window.navigator.geolocation}return l})})().then(t=>this._setupUI(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(),h.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,nV=0,nU=!1}_isOutOfMapMaxBounds(t){let e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let t=this._map.getBounds(),e=t.getSouthEast(),i=t.getNorthEast(),n=e.distanceTo(i),r=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":nV--,nU=!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 e.k("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 e.k("trackuserlocationstart"));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"),++nV>1?(t={maximumAge:6e5,timeout:0},nU=!0):(t=this.options.positionOptions,nU=!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)}},t.Hash=iz,t.ImageSource=Q,t.KeyboardHandler=na,t.LngLatBounds=G,t.LogoControl=nw,t.Map=class extends ny{constructor(t){if(e.bc.mark(e.bd.create),null!=(t=e.e({},nL,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw Error("maxPitch must be less than or equal to 85");if(super(new iI(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),{bearingSnap:t.bearingSnap}),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("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()},this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new nk,this._controls=[],this._mapId=e.a3(),this._locale=e.e({},nz,t.locale),this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this.transformCameraUpdate=t.transformCameraUpdate,this._imageQueueHandle=k.addThrottleControl(()=>this.isMoving()),this._requestManager=new y(t.transformRequest),"string"==typeof t.container){if(this._container=document.getElementById(t.container),!this._container)throw Error(`Container '${t.container}' not found.`)}else{if(!(t.container instanceof HTMLElement))throw Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1,e=iS(t=>{this._trackResize&&!this._removed&&this.resize(t)._update()},50);this._resizeObserver=new ResizeObserver(i=>{t?e(i):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new nb(this,t),this._hash=t.hash&&new iz("string"==typeof t.hash&&t.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.e({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new nx("boolean"==typeof t.attributionControl?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new nw,t.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new e.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=t.onAdd(this);this._controls.push(t);let r=this._controlPositions[i];return -1!==i.indexOf("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,i,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,i,n)}resize(t){var i;let n=this._containerDimensions(),r=n[0],a=n[1],o=this._getClampedPixelRatio(r,a);if(this._resizeCanvas(r,a,o),this.painter.resize(r,a,o),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let e=this._getClampedPixelRatio(r,a);this._resizeCanvas(r,a,e),this.painter.resize(r,a,e)}this.transform.resize(r,a),null==(i=this._requestedCameraState)||i.resize(r,a);let s=!this._moving;return s&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),s&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){let{0:i,1:n}=this._maxCanvasSize,r=this.getPixelRatio(),a=t*r,o=e*r;return Math.min(a>i?i/a:1,o>n?n/o:1)*r}getPixelRatio(){var t;return null!=(t=this._overridePixelRatio)?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(G.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>85)throw Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.M.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null==(t=this.handlers)?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null==(t=this.handlers)?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null==(t=this.handlers)?void 0:t.isRotating())}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let n=!1,r=r=>{let a=this.getLayer(e)?this.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?n||(n=!0,i.call(this,new iN(t,this,r.originalEvent,{features:a}))):n=!1};return{layer:e,listener:i,delegates:{mousemove:r,mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1,r=r=>{(this.getLayer(e)?this.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?n=!0:n&&(n=!1,i.call(this,new iN(t,this,r.originalEvent)))},a=e=>{n&&(n=!1,i.call(this,new iN(t,this,e.originalEvent)))};return{layer:e,listener:i,delegates:{mousemove:r,mouseout:a}}}{let n=t=>{let n=this.getLayer(e)?this.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,i.call(this,t),delete t.features)};return{layer:e,listener:i,delegates:{[t]:n}}}}on(t,e,i){if(void 0===i)return super.on(t,e);let n=this._createDelegatedListener(t,e,i);for(let e in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n),n.delegates)this.on(e,n.delegates[e]);return this}once(t,e,i){if(void 0===i)return super.once(t,e);let n=this._createDelegatedListener(t,e,i);for(let t in n.delegates)this.once(t,n.delegates[t]);return this}off(t,e,i){return void 0===i?super.off(t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&(n=>{let r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){let n=r[t];if(n.layer===e&&n.listener===i){for(let t in n.delegates)this.off(t,n.delegates[t]);return r.splice(t,1),this}}})(),this)}queryRenderedFeatures(t,i){let n;if(!this.style)return[];let r=t instanceof e.P||Array.isArray(t),a=r?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(r?{}:t)||{},a instanceof e.P||"number"==typeof a[0])n=[e.P.convert(a)];else{let t=e.P.convert(a[0]),i=e.P.convert(a[1]);n=[t,new e.P(i.x,t.y),i,new e.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(n,i,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,i){return!1!==(i=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let e=this._locale[t];if(null==e)throw Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,e));let i=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new t0(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,i):this.style.loadJSON(t,e,i)):delete this.style,this}_lazyInitEmptyStyle(){this.style||(this.style=new t0(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if("string"==typeof t){let n=this._requestManager.transformRequest(t,E.Style);e.h(n,new AbortController).then(t=>{this._updateDiff(t.data,i)}).catch(t=>{t&&this.fire(new e.j(t))})}else"object"==typeof t&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(n){e.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){let i=this.style&&this.style.sourceCaches[t];if(void 0!==i)return i.loaded();this.fire(new e.j(Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let i=this.style.sourceCaches[t.source];if(!i)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let n in null===this.terrain&&i.reload(),this.style._layers){let i=this.style._layers[n];"hillshade"===i.type&&i.source===t.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new nA(this.painter,i,t),this.painter.renderToTexture=new nS(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!=(e=null==(t=this.terrain)?void 0:t.options)?e:null}areTilesLoaded(){let t=this.style&&this.style.sourceCaches;for(let e in t){let i=t[e]._tiles;for(let t in i){let e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,i,n={}){let{pixelRatio:r=1,sdf:a=!1,stretchX:o,stretchY:s,content:l}=n;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new e.j(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`")));{let{width:n,height:c,data:d}=i;return this.style.addImage(t,{data:new e.R({width:n,height:c},new Uint8Array(d)),pixelRatio:r,stretchX:o,stretchY:s,content:l,sdf:a,version:0,userImage:i}),i.onAdd&&i.onAdd(this,t),this}}{let{width:n,height:c,data:d}=u.getImageData(i);this.style.addImage(t,{data:new e.R({width:n,height:c},d),pixelRatio:r,stretchX:o,stretchY:s,content:l,sdf:a,version:0})}}updateImage(t,i){let n=this.style.getImage(t);if(!n)return this.fire(new e.j(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:a,data:o}=i instanceof HTMLImageElement||e.b(i)?u.getImageData(i):i;if(void 0===r||void 0===a)return this.fire(new e.j(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!==n.data.width||a!==n.data.height)return this.fire(new e.j(Error("The width and height of the updated image must be that same as the previous version of the image")));let s=!(i instanceof HTMLImageElement||e.b(i));return n.data.replace(o,s),this.style.updateImage(t,n),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return k.getImage(this._requestManager.transformRequest(t,E.Image),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),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,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,n={}){return this.style.setPaintProperty(t,e,i,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,n={}){return this.style.setLayoutProperty(t,e,i,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,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,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,t=>{t||this._update(!0)}),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),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,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let e=this._canvasContainer=h.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=h.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let i=this._containerDimensions(),n=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],n);let r=this._controlContainer=h.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{a[t]=h.create("div",`maplibregl-ctrl-${t} `,r)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){let t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},e=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{e={requestedAttributes:t},i&&(e.statusMessage=i.statusMessage,e.type=i.type)},{once:!0});let i=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!i){let t="Failed to initialize WebGL";throw e?(e.message=t,Error(JSON.stringify(e))):Error(t)}this.painter=new iE(i,this.transform),p.testSupport(i)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded&&(this._styleDirty=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 i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this.transform.zoom,r=u.now();this.style.zoomHistory.update(t,r);let a=new e.a8(t,{now:r,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=a.crossFadingFactor();1===o&&o===this._crossFadingFactor||(n=!0,this._crossFadingFactor=o),this.style.update(a)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bc.mark(e.bd.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let r=this._sourcesDirty||this._styleDirty||this._placementDirty;return r||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||r||(this._fullyLoaded=!0,e.bc.mark(e.bd.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),k.removeThrottleControl(this._imageQueueHandle),null==(t=this._resizeObserver)||t.disconnect();let i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),h.remove(this._canvasContainer),h.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bc.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(t=>{e.bc.frame(t),this._frameRequest=null,this._render(t)}).catch(()=>{}))}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 d}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=iN,t.MapTouchEvent=iV,t.MapWheelEvent=iU,t.Marker=nF,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{let t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,e)=>{let i=this._map._getUIString(`NavigationControl.${e}`);t.title=i,t.setAttribute("aria-label",i)},this.options=e.e({},nP,t),this._container=h.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})),h.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})),h.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=h.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("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new nR(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){h.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){let i=h.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&h.remove(this._content),this._container&&(h.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var i;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=h.create("div","maplibregl-popup",this._map.getContainer()),this._tip=h.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._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=this._map.transform.renderWorldCopies&&!this._trackPointer?nO(this._lngLat,this._flatPos,this._map.transform):null==(i=this._lngLat)?void 0:i.wrap(),this._trackPointer&&!t)return;let n=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let r=this.options.anchor,a=function t(i){if(i){if("number"==typeof i){let t=Math.round(Math.abs(i)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,i),"top-left":new e.P(t,t),"top-right":new e.P(-t,t),bottom:new e.P(0,-i),"bottom-left":new e.P(t,-t),"bottom-right":new e.P(-t,-t),left:new e.P(i,0),right:new e.P(-i,0)}}if(i instanceof e.P||Array.isArray(i)){let t=e.P.convert(i);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.P.convert(i.center||[0,0]),top:e.P.convert(i.top||[0,0]),"top-left":e.P.convert(i["top-left"]||[0,0]),"top-right":e.P.convert(i["top-right"]||[0,0]),bottom:e.P.convert(i.bottom||[0,0]),"bottom-left":e.P.convert(i["bottom-left"]||[0,0]),"bottom-right":e.P.convert(i["bottom-right"]||[0,0]),left:e.P.convert(i.left||[0,0]),right:e.P.convert(i.right||[0,0])}}return t(new e.P(0,0))}(this.options.offset);if(!r){let t,e=this._container.offsetWidth,i=this._container.offsetHeight;t=n.y+a.bottom.y<i?["top"]:n.y>this._map.transform.height-i?["bottom"]:[],n.x<e/2?t.push("left"):n.x>this._map.transform.width-e/2&&t.push("right"),r=0===t.length?"bottom":t.join("-")}let o=n.add(a[r]);this.options.subpixelPositioning||(o=o.round()),h.setTransform(this._container,`${nD[r]} translate(${o.x}px,${o.y}px)`),nB(this._container,r,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(nq),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._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.M.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._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let e,i=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)i.appendChild(e);return this.setDOMContent(i)}getMaxWidth(){var t;return null==(t=this._container)?void 0:t.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=h.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){this._container&&this._container.classList.add(t)}removeClassName(t){this._container&&this._container.classList.remove(t)}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}_createCloseButton(){this.options.closeButton&&(this._closeButton=h.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),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()}},t.RasterDEMTileSource=Y,t.RasterTileSource=W,t.ScaleControl=class{constructor(t){this._onMove=()=>{nj(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,nj(this._map,this._container,this.options)},this.options=e.e({},n$,t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){h.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=ns,t.Style=t0,t.TerrainControl=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=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=h.create("button","maplibregl-ctrl-terrain",this._container),h.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(){h.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=ne,t.TwoFingersTouchRotateHandler=i9,t.TwoFingersTouchZoomHandler=i7,t.TwoFingersTouchZoomRotateHandler=np,t.VectorTileSource=Z,t.VideoSource=tt,t.addSourceType=(t,i)=>e._(void 0,void 0,void 0,function*(){if(tn(t))throw Error(`A source type called "${t}" already exists.`);ti[t]=i}),t.clearPrewarmedResources=function(){let t=a;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(F),a=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return ts().getRTLTextPluginStatus()},t.getVersion=function(){return d},t.getWorkerCount=function(){return N.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return j().broadcast("importScript",t)},t.prewarm=function(){U().acquire(F)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return ts().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){N.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}}),t}()}},a={};function o(t){var e=a[t];if(void 0!==e)return e.exports;var i=a[t]={id:t,loaded:!1,exports:{}};return r[t].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},(()=>{var t,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;o.t=function(i,n){if(1&n&&(i=this(i)),8&n||"object"==typeof i&&i&&(4&n&&i.__esModule||16&n&&"function"==typeof i.then))return i;var r=Object.create(null);o.r(r);var a={};t=t||[null,e({}),e([]),e(e)];for(var s=2&n&&i;"object"==typeof s&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(t=>{a[t]=()=>i[t]});return a.default=()=>i,o.d(r,a),r}})(),o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var s={};return(()=>{"use strict";let t;o.r(s),o.d(s,{OrMapLoadedEvent:()=>ar,geoJsonPointInputTemplateProvider:()=>ah,OrMapMarkerClickedEvent:()=>e_,OrMap:()=>ap,OrMapMarker:()=>eb,OrMapAssetCard:()=>ai,getMarkerConfigAttributeName:()=>ex,Util:()=>y,DefaultConfig:()=>ae,CenterControl:()=>al,OrMapAssetCardLoadAssetEvent:()=>at,getMarkerConfigForAssetType:()=>ev,OrMapLongPressEvent:()=>ao,OrMapMarkerChangedEvent:()=>eg,CoordinatesControl:()=>au,OrMapMarkerAsset:()=>ew,OrMapGeocoderChangeEvent:()=>as,OrMapClickedEvent:()=>aa});var e,i,n,r,a,l,c,d,u,h,p,m,f,g,_,b,y={};o.r(y),o.d(y,{getGeoJSONPoint:()=>et,getLatLngBounds:()=>ei,getLngLat:()=>t9,getLngLatBounds:()=>ee,getMarkerIconAndColorFromAssetType:()=>en});var v=o(801),x=o.n(v);function w(t,e,i){return{index:t,removed:e,addedCount:i}}window.JSCompiler_renameProperty=function(t,e){return t};let k=0,E=0,C=[],A=0,T=!1,I=document.createTextNode("");new window.MutationObserver(function(){T=!1;let t=C.length;for(let e=0;e<t;e++){let t=C[e];if(t)try{t()}catch(t){setTimeout(()=>{throw t})}}C.splice(0,t),E+=t}).observe(I,{characterData:!0});let S={run:t=>(T||(T=!0,I.textContent=A++),C.push(t),k++),cancel(t){let e=t-E;if(e>=0){if(!C[e])throw Error("invalid async handle: "+t);C[e]=null}}},z=window.ShadyDOM&&window.ShadyDOM.noPatch&&window.ShadyDOM.wrap?window.ShadyDOM.wrap:window.ShadyDOM?t=>ShadyDOM.patch(t):t=>t;function M(t){return"slot"===t.localName}let P=class{static getFlattenedNodes(t){let e=z(t);return M(t)?e.assignedNodes({flatten:!0}):Array.from(e.childNodes).map(t=>M(t)?z(t).assignedNodes({flatten:!0}):[t]).reduce((t,e)=>t.concat(e),[])}constructor(t,e){this._shadyChildrenObserver=null,this._nativeChildrenObserver=null,this._connected=!1,this._target=t,this.callback=e,this._effectiveNodes=[],this._observer=null,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){M(this._target)?this._listenSlots([this._target]):z(this._target).children&&(this._listenSlots(z(this._target).children),window.ShadyDOM?this._shadyChildrenObserver=window.ShadyDOM.observeChildren(this._target,t=>{this._processMutations(t)}):(this._nativeChildrenObserver=new MutationObserver(t=>{this._processMutations(t)}),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}disconnect(){M(this._target)?this._unlistenSlots([this._target]):z(this._target).children&&(this._unlistenSlots(z(this._target).children),window.ShadyDOM&&this._shadyChildrenObserver?(window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,S.run(()=>this.flush()))}_processMutations(t){this._processSlotMutations(t),this.flush()}_processSlotMutations(t){if(t)for(let e=0;e<t.length;e++){let i=t[e];i.addedNodes&&this._listenSlots(i.addedNodes),i.removedNodes&&this._unlistenSlots(i.removedNodes)}}flush(){var t;if(!this._connected)return!1;window.ShadyDOM&&ShadyDOM.flush(),this._nativeChildrenObserver?this._processSlotMutations(this._nativeChildrenObserver.takeRecords()):this._shadyChildrenObserver&&this._processSlotMutations(this._shadyChildrenObserver.takeRecords()),this._scheduled=!1;let e={target:this._target,addedNodes:[],removedNodes:[]},i=this.constructor.getFlattenedNodes(this._target),n=(t=this._effectiveNodes,function(t,e,i,n,r,a){let o,s=0,l=0,c=Math.min(i-e,a-r);if(0==e&&0==r&&(s=function(t,e,i){for(let r=0;r<i;r++){var n;if(n=t[r],n!==e[r])return r}return i}(t,n,c)),i==t.length&&a==n.length&&(l=function(t,e,i){var n;let r=t.length,a=e.length,o=0;for(;o<i&&(n=t[--r],n===e[--a]);)o++;return o}(t,n,c-s)),e+=s,r+=s,i-=l,a-=l,i-e==0&&a-r==0)return[];if(e==i){for(o=w(e,[],0);r<a;)o.removed.push(n[r++]);return[o]}if(r==a)return[w(e,[],i-e)];let d=function(t){let e=t.length-1,i=t[0].length-1,n=t[e][i],r=[];for(;e>0||i>0;){let a;if(0==e){r.push(2),i--;continue}if(0==i){r.push(3),e--;continue}let o=t[e-1][i-1],s=t[e-1][i],l=t[e][i-1];(a=s<l?s<o?s:o:l<o?l:o)==o?(o==n?r.push(0):(r.push(1),n=o),e--,i--):a==s?(r.push(3),e--,n=s):(r.push(2),i--,n=l)}return r.reverse(),r}(function(t,e,i,n,r,a){let o=a-r+1,s=i-e+1,l=Array(o);for(let t=0;t<o;t++)l[t]=Array(s),l[t][0]=t;for(let t=0;t<s;t++)l[0][t]=t;for(let i=1;i<o;i++)for(let a=1;a<s;a++){var c;if(c=t[e+a-1],c===n[r+i-1])l[i][a]=l[i-1][a-1];else{let t=l[i-1][a]+1,e=l[i][a-1]+1;l[i][a]=t<e?t:e}}return l}(t,e,i,n,r,a));o=void 0;let u=[],h=e,p=r;for(let t=0;t<d.length;t++)switch(d[t]){case 0:o&&(u.push(o),o=void 0),h++,p++;break;case 1:o||(o=w(h,[],0)),o.addedCount++,h++,o.removed.push(n[p]),p++;break;case 2:o||(o=w(h,[],0)),o.addedCount++,h++;break;case 3:o||(o=w(h,[],0)),o.removed.push(n[p]),p++}return o&&u.push(o),u}(i,0,i.length,t,0,t.length));for(let t=0,i;t<n.length&&(i=n[t]);t++)for(let t=0,n;t<i.removed.length&&(n=i.removed[t]);t++)e.removedNodes.push(n);for(let t=0,r;t<n.length&&(r=n[t]);t++)for(let t=r.index;t<r.index+r.addedCount;t++)e.addedNodes.push(i[t]);this._effectiveNodes=i;let r=!1;return(e.addedNodes.length||e.removedNodes.length)&&(r=!0,this.callback.call(this._target,e)),r}_listenSlots(t){for(let e=0;e<t.length;e++){let i=t[e];M(i)&&i.addEventListener("slotchange",this._boundSchedule)}}_unlistenSlots(t){for(let e=0;e<t.length;e++){let i=t[e];M(i)&&i.removeEventListener("slotchange",this._boundSchedule)}}},R=window,O=R.ShadowRoot&&(void 0===R.ShadyCSS||R.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,D=Symbol(),B=new WeakMap;class F{constructor(t,e,i){if(this._$cssResult$=!0,i!==D)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(O&&void 0===t){let i=void 0!==e&&1===e.length;i&&(t=B.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&B.set(e,t))}return t}toString(){return this.cssText}}let N=O?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return(t=>new F("string"==typeof t?t:t+"",void 0,D))(e)})(t):t,V=window,U=V.trustedTypes,$=U?U.emptyScript:"",j=V.reactiveElementPolyfillSupport,H={toAttribute(t,e){switch(e){case Boolean:t=t?$:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){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}},q=(t,e)=>e!==t&&(e==e||t==t),G={attribute:!0,type:String,converter:H,reflect:!1,hasChanged:q},X="finalized";class Z extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!=(e=this.h)?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,i)=>{let n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))}),t}static createProperty(t,e=G){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){let r=this[t];this[e]=n,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||G}static finalize(){if(this.hasOwnProperty(X))return!1;this[X]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties;for(let e of[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)])this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t))for(let i of new Set(t.flat(1/0).reverse()))e.unshift(N(i));else void 0!==t&&e.push(N(t));return e}static _$Ep(t,e){let i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null==(t=this.constructor.h)||t.forEach(t=>t(this))}addController(t){var e,i;(null!=(e=this._$ES)?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null==(i=t.hostConnected)||i.call(t))}removeController(t){var e;null==(e=this._$ES)||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t,e;let i=null!=(t=this.shadowRoot)?t:this.attachShadow(this.constructor.shadowRootOptions);return e=this.constructor.elementStyles,O?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let e=document.createElement("style"),n=R.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=t.cssText,i.appendChild(e)}),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$ES)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$ES)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=G){var n;let r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){let a=(void 0!==(null==(n=i.converter)?void 0:n.toAttribute)?i.converter:H).toAttribute(e,i.type);this._$El=t,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$El=null}}_$AK(t,e){var i;let n=this.constructor,r=n._$Ev.get(t);if(void 0!==r&&this._$El!==r){let t=n.getPropertyOptions(r),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(i=t.converter)?void 0:i.fromAttribute)?t.converter:H;this._$El=r,this[r]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||q)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((t,e)=>this[e]=t),this._$Ei=void 0);let e=!1,i=this._$AL;try{(e=this.shouldUpdate(i))?(this.willUpdate(i),null==(t=this._$ES)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null==(e=this._$ES)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach((t,e)=>this._$EO(e,this[e],t)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}Z[X]=!0,Z.elementProperties=new Map,Z.elementStyles=[],Z.shadowRootOptions={mode:"open"},null==j||j({ReactiveElement:Z}),(null!=(e=V.reactiveElementVersions)?e:V.reactiveElementVersions=[]).push("1.6.3");let W=window,Y=W.trustedTypes,K=Y?Y.createPolicy("lit-html",{createHTML:t=>t}):void 0,J="$lit$",Q=`lit$${(Math.random()+"").slice(9)}$`,tt="?"+Q,te=`<${tt}>`,ti=document,tn=()=>ti.createComment(""),tr=t=>null===t||"object"!=typeof t&&"function"!=typeof t,ta=Array.isArray,to=t=>ta(t)||"function"==typeof(null==t?void 0:t[Symbol.iterator]),ts="[ \n\f\r]",tl=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,tc=/-->/g,td=/>/g,tu=RegExp(`>|${ts}(?:([^\\s"'>=/]+)(${ts}*=${ts}*(?:[^
52
- \f\r"'\`<>=]|("|')|))|$)`,"g"),th=/'/g,tp=/"/g,tm=/^(?:script|style|textarea|title)$/i,tf=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),tg=tf(1),t_=(tf(2),Symbol.for("lit-noChange")),tb=Symbol.for("lit-nothing"),ty=new WeakMap,tv=ti.createTreeWalker(ti,129,null,!1);function tx(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==K?K.createHTML(e):e}let tw=(t,e)=>{let i=t.length-1,n=[],r,a=2===e?"<svg>":"",o=tl;for(let e=0;e<i;e++){let i=t[e],s,l,c=-1,d=0;for(;d<i.length&&(o.lastIndex=d,null!==(l=o.exec(i)));)d=o.lastIndex,o===tl?"!--"===l[1]?o=tc:void 0!==l[1]?o=td:void 0!==l[2]?(tm.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=tu):void 0!==l[3]&&(o=tu):o===tu?">"===l[0]?(o=null!=r?r:tl,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?tu:'"'===l[3]?tp:th):o===tp||o===th?o=tu:o===tc||o===td?o=tl:(o=tu,r=void 0);let u=o===tu&&t[e+1].startsWith("/>")?" ":"";a+=o===tl?i+te:c>=0?(n.push(s),i.slice(0,c)+J+i.slice(c)+Q+u):i+Q+(-2===c?(n.push(void 0),e):u)}return[tx(t,a+(t[i]||"<?>")+(2===e?"</svg>":"")),n]};class tk{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,a=0,o=t.length-1,s=this.parts,[l,c]=tw(t,e);if(this.el=tk.createElement(l,i),tv.currentNode=this.el.content,2===e){let t=this.el.content,e=t.firstChild;e.remove(),t.append(...e.childNodes)}for(;null!==(n=tv.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes()){let t=[];for(let e of n.getAttributeNames())if(e.endsWith(J)||e.startsWith(Q)){let i=c[a++];if(t.push(e),void 0!==i){let t=n.getAttribute(i.toLowerCase()+J).split(Q),e=/([.?@])?(.*)/.exec(i);s.push({type:1,index:r,name:e[2],strings:t,ctor:"."===e[1]?tI:"?"===e[1]?tz:"@"===e[1]?tL:tT})}else s.push({type:6,index:r})}for(let e of t)n.removeAttribute(e)}if(tm.test(n.tagName)){let t=n.textContent.split(Q),e=t.length-1;if(e>0){n.textContent=Y?Y.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],tn()),tv.nextNode(),s.push({type:2,index:++r});n.append(t[e],tn())}}}else if(8===n.nodeType)if(n.data===tt)s.push({type:2,index:r});else{let t=-1;for(;-1!==(t=n.data.indexOf(Q,t+1));)s.push({type:7,index:r}),t+=Q.length-1}r++}}static createElement(t,e){let i=ti.createElement("template");return i.innerHTML=t,i}}function tE(t,e,i=t,n){var r,a,o;if(e===t_)return e;let s=void 0!==n?null==(r=i._$Co)?void 0:r[n]:i._$Cl,l=tr(e)?void 0:e._$litDirective$;return(null==s?void 0:s.constructor)!==l&&(null==(a=null==s?void 0:s._$AO)||a.call(s,!1),void 0===l?s=void 0:(s=new l(t))._$AT(t,i,n),void 0!==n?(null!=(o=i._$Co)?o:i._$Co=[])[n]=s:i._$Cl=s),void 0!==s&&(e=tE(t,s._$AS(t,e.values),s,n)),e}class tC{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;let{el:{content:i},parts:n}=this._$AD,r=(null!=(e=null==t?void 0:t.creationScope)?e:ti).importNode(i,!0);tv.currentNode=r;let a=tv.nextNode(),o=0,s=0,l=n[0];for(;void 0!==l;){if(o===l.index){let e;2===l.type?e=new tA(a,a.nextSibling,this,t):1===l.type?e=new l.ctor(a,l.name,l.strings,this,t):6===l.type&&(e=new tM(a,this,t)),this._$AV.push(e),l=n[++s]}o!==(null==l?void 0:l.index)&&(a=tv.nextNode(),o++)}return tv.currentNode=ti,r}v(t){let e=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class tA{constructor(t,e,i,n){var r;this.type=2,this._$AH=tb,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cp=null==(r=null==n?void 0:n.isConnected)||r}get _$AU(){var t,e;return null!=(e=null==(t=this._$AM)?void 0:t._$AU)?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){tr(t=tE(this,t,e))?t===tb||null==t||""===t?(this._$AH!==tb&&this._$AR(),this._$AH=tb):t!==this._$AH&&t!==t_&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):to(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==tb&&tr(this._$AH)?this._$AA.nextSibling.data=t:this.$(ti.createTextNode(t)),this._$AH=t}g(t){var e;let{values:i,_$litType$:n}=t,r="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=tk.createElement(tx(n.h,n.h[0]),this.options)),n);if((null==(e=this._$AH)?void 0:e._$AD)===r)this._$AH.v(i);else{let t=new tC(r,this),e=t.u(this.options);t.v(i),this.$(e),this._$AH=t}}_$AC(t){let e=ty.get(t.strings);return void 0===e&&ty.set(t.strings,e=new tk(t)),e}T(t){ta(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,n=0;for(let r of t)n===e.length?e.push(i=new tA(this.k(tn()),this.k(tn()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var i;for(null==(i=this._$AP)||i.call(this,!1,!0,e);t&&t!==this._$AB;){let e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cp=t,null==(e=this._$AP)||e.call(this,t))}}class tT{constructor(t,e,i,n,r){this.type=1,this._$AH=tb,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=tb}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,n){let r=this.strings,a=!1;if(void 0===r)(a=!tr(t=tE(this,t,e,0))||t!==this._$AH&&t!==t_)&&(this._$AH=t);else{let n,o,s=t;for(t=r[0],n=0;n<r.length-1;n++)(o=tE(this,s[i+n],e,n))===t_&&(o=this._$AH[n]),a||(a=!tr(o)||o!==this._$AH[n]),o===tb?t=tb:t!==tb&&(t+=(null!=o?o:"")+r[n+1]),this._$AH[n]=o}a&&!n&&this.j(t)}j(t){t===tb?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class tI extends tT{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===tb?void 0:t}}let tS=Y?Y.emptyScript:"";class tz extends tT{constructor(){super(...arguments),this.type=4}j(t){t&&t!==tb?this.element.setAttribute(this.name,tS):this.element.removeAttribute(this.name)}}class tL extends tT{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){var i;if((t=null!=(i=tE(this,t,e,0))?i:tb)===t_)return;let n=this._$AH,r=t===tb&&n!==tb||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,a=t!==tb&&(n===tb||r);r&&this.element.removeEventListener(this.name,this,n),a&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!=(i=null==(e=this.options)?void 0:e.host)?i:this.element,t):this._$AH.handleEvent(t)}}class tM{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){tE(this,t)}}let tP=W.litHtmlPolyfillSupport;null==tP||tP(tk,tA),(null!=(i=W.litHtmlVersions)?i:W.litHtmlVersions=[]).push("2.8.0");let tR=window,tO=tR.ShadowRoot&&(void 0===tR.ShadyCSS||tR.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,tD=Symbol(),tB=new WeakMap;class tF{constructor(t,e,i){if(this._$cssResult$=!0,i!==tD)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(tO&&void 0===t){let i=void 0!==e&&1===e.length;i&&(t=tB.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&tB.set(e,t))}return t}toString(){return this.cssText}}let tN=t=>new tF("string"==typeof t?t:t+"",void 0,tD),tV=(t,...e)=>new tF(1===t.length?t[0]:e.reduce((e,i,n)=>e+(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[n+1],t[0]),t,tD),tU=tO?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return tN(e)})(t):t,t$=window,tj=t$.trustedTypes,tH=tj?tj.emptyScript:"",tq=t$.reactiveElementPolyfillSupport,tG={toAttribute(t,e){switch(e){case Boolean:t=t?tH:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){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}},tX=(t,e)=>e!==t&&(e==e||t==t),tZ={attribute:!0,type:String,converter:tG,reflect:!1,hasChanged:tX},tW="finalized";class tY extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),(null!=(e=this.h)?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,i)=>{let n=this._$Ep(i,e);void 0!==n&&(this._$Ev.set(n,i),t.push(n))}),t}static createProperty(t,e=tZ){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let i="symbol"==typeof t?Symbol():"__"+t,n=this.getPropertyDescriptor(t,i,e);void 0!==n&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(n){let r=this[t];this[e]=n,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||tZ}static finalize(){if(this.hasOwnProperty(tW))return!1;this[tW]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),void 0!==t.h&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let t=this.properties;for(let e of[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)])this.createProperty(e,t[e])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t))for(let i of new Set(t.flat(1/0).reverse()))e.unshift(tU(i));else void 0!==t&&e.push(tU(t));return e}static _$Ep(t,e){let i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null==(t=this.constructor.h)||t.forEach(t=>t(this))}addController(t){var e,i;(null!=(e=this._$ES)?e:this._$ES=[]).push(t),void 0!==this.renderRoot&&this.isConnected&&(null==(i=t.hostConnected)||i.call(t))}removeController(t){var e;null==(e=this._$ES)||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t,e;let i=null!=(t=this.shadowRoot)?t:this.attachShadow(this.constructor.shadowRootOptions);return e=this.constructor.elementStyles,tO?i.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet):e.forEach(t=>{let e=document.createElement("style"),n=tR.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=t.cssText,i.appendChild(e)}),i}connectedCallback(){var t;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$ES)||t.forEach(t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)})}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$ES)||t.forEach(t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e,i=tZ){var n;let r=this.constructor._$Ep(t,i);if(void 0!==r&&!0===i.reflect){let a=(void 0!==(null==(n=i.converter)?void 0:n.toAttribute)?i.converter:tG).toAttribute(e,i.type);this._$El=t,null==a?this.removeAttribute(r):this.setAttribute(r,a),this._$El=null}}_$AK(t,e){var i;let n=this.constructor,r=n._$Ev.get(t);if(void 0!==r&&this._$El!==r){let t=n.getPropertyOptions(r),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(i=t.converter)?void 0:i.fromAttribute)?t.converter:tG;this._$El=r,this[r]=a.fromAttribute(e,t.type),this._$El=null}}requestUpdate(t,e,i){let n=!0;void 0!==t&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||tX)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$El!==t&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(t,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}let t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((t,e)=>this[e]=t),this._$Ei=void 0);let e=!1,i=this._$AL;try{(e=this.shouldUpdate(i))?(this.willUpdate(i),null==(t=this._$ES)||t.forEach(t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)}),this.update(i)):this._$Ek()}catch(t){throw e=!1,this._$Ek(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null==(e=this._$ES)||e.forEach(t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){void 0!==this._$EC&&(this._$EC.forEach((t,e)=>this._$EO(e,this[e],t)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}}tY[tW]=!0,tY.elementProperties=new Map,tY.elementStyles=[],tY.shadowRootOptions={mode:"open"},null==tq||tq({ReactiveElement:tY}),(null!=(n=t$.reactiveElementVersions)?n:t$.reactiveElementVersions=[]).push("1.6.3");class tK extends tY{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;let e=super.createRenderRoot();return null!=(t=this.renderOptions).renderBefore||(t.renderBefore=e.firstChild),e}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{var n,r;let a=null!=(n=null==i?void 0:i.renderBefore)?n:e,o=a._$litPart$;if(void 0===o){let t=null!=(r=null==i?void 0:i.renderBefore)?r:null;a._$litPart$=o=new tA(e.insertBefore(tn(),t),t,void 0,null!=i?i:{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return t_}}tK.finalized=!0,tK._$litElement$=!0,null==(r=globalThis.litElementHydrateSupport)||r.call(globalThis,{LitElement:tK});let tJ=globalThis.litElementPolyfillSupport;null==tJ||tJ({LitElement:tK}),(null!=(a=globalThis.litElementVersions)?a:globalThis.litElementVersions=[]).push("3.3.3");let tQ=t=>e=>"function"==typeof e?((t,e)=>(customElements.define(t,e),e))(t,e):((t,e)=>{let{kind:i,elements:n}=e;return{kind:i,elements:n,finisher(e){customElements.define(t,e)}}})(t,e);function t0(t){return(e,i)=>void 0!==i?void e.constructor.createProperty(i,t):"method"!==e.kind||!e.descriptor||"value"in e.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){"function"==typeof e.initializer&&(this[e.key]=e.initializer.call(this))},finisher(i){i.createProperty(e.key,t)}}:{...e,finisher(i){i.createProperty(e.key,t)}}}function t1(t){return t0({...t,state:!0})}function t2(t,e){return(({finisher:t,descriptor:e})=>(i,n)=>{var r;if(void 0===n){let n=null!=(r=i.originalKey)?r:i.key,a=null!=e?{kind:"method",placement:"prototype",key:n,descriptor:e(i.key)}:{...i,key:n};return null!=t&&(a.finisher=function(e){t(e,n)}),a}{let r=i.constructor;void 0!==e&&Object.defineProperty(i,n,e(n)),null==t||t(r,n)}})({descriptor:i=>{let n={get(){var e,i;return null!=(i=null==(e=this.renderRoot)?void 0:e.querySelector(t))?i:null},enumerable:!0,configurable:!0};if(e){let e="symbol"==typeof i?Symbol():"__"+i;n.get=function(){var i,n;return void 0===this[e]&&(this[e]=null!=(n=null==(i=this.renderRoot)?void 0:i.querySelector(t))?n:null),this[e]}}return n}})}null!=(null==(l=window.HTMLSlotElement)?void 0:l.prototype.assignedElements)||((t,e)=>t.assignedNodes(e).filter(t=>t.nodeType===Node.ELEMENT_NODE));var t5=o(266),t3=o.n(t5),t4=o(230),t6=o.n(t4);o(811);var t7=o(891),t8=o(297);function t9(t){if(t){if(t instanceof t5.LngLat)return t;if(t.lat)return t.lon?{lng:t.lon,lat:t.lat}:{lng:t.lng,lat:t.lat};if(Array.isArray(t))return{lng:t[0],lat:t[1]};if(t.coordinates&&Array.isArray(t.coordinates)&&t.coordinates.length>=2)return t9(t.coordinates);if(t.attributes){let e=t.attributes.location;return e&&e.value?t9(e.value):void 0}if(t.value)return t9(t.value)}}function et(t){if(t)return Array.isArray(t)?{type:"Point",coordinates:t}:{type:"Point",coordinates:[t.hasOwnProperty("lng")?t.lng:t.lon,t.lat]}}function ee(t){if(t){if(t instanceof t5.LngLatBounds)return t;if(2===t.length){let e=t9(t[0]),i=t9(t[1]);if(e&&i)return new t5.LngLatBounds(e,i)}if(4===t.length)return new t5.LngLatBounds([t[0],t[1],t[2],t[3]])}}function ei(t){let e=ee(t);if(e)return L.latLngBounds(e.getNorthEast(),e.getSouthWest())}function en(t,e){if(!t)return;let i="string"==typeof t?t8.AssetModelUtil.getAssetDescriptor(t):t,n=i&&i.icon?i.icon:"help-circle",r=i&&i.colour?i.colour:void 0;if(e&&e.markerConfig){let t=e.markerConfig,i=e.currentValue;if("range"===t.type&&t.ranges&&"number"==typeof i){let e=t.ranges;r=(e.sort((t,e)=>e.min-t.min).find(t=>i>=t.min)||e.reduce((t,e)=>e.min>t.min?t:e)).colour||void 0}else"boolean"===t.type?r=t[!!i+""]:"string"===t.type&&(r=t[i+""])}return{color:r,icon:n}}function er(t){let e=t.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!e)throw Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function ea(t,e){let i=er("https://api.mapbox.com");t.protocol=i.protocol,t.authority=i.authority,t.params.push(`access_token=${e}`);let n=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${n}`}var eo=function(t,e,i,n){return new(i||(i=Promise))(function(r,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(o,s)}l((n=n.apply(t,e||[])).next())})};let es=o(278),el=o(569),ec=o(811);class ed{constructor(t,e,i,n=!1,r=!1,a=!0,o=!0){this._loaded=!1,this._markersJs=new Map,this._markersGl=new Map,this._geoJsonSources=[],this._geoJsonLayers=new Map,this._showGeoCodingControl=!1,this._showBoundaryBox=!1,this._useZoomControls=!0,this._showGeoJson=!0,this._clickHandlers=new Map,this._type=t,this._styleParent=e,this._mapContainer=i,this._showGeoCodingControl=n,this._showBoundaryBox=r,this._useZoomControls=a,this._showGeoJson=o}setCenter(t){switch(this._center=t9(t),this._type){case"RASTER":if(this._mapJs){let t=t9(this._center)||(this._viewSettings?t9(this._viewSettings.center):void 0);t&&this._mapJs.setView(t,void 0,{pan:{animate:!1},zoom:{animate:!1}})}break;case"VECTOR":this._mapGl&&this._center&&this._mapGl.setCenter(this._center)}return this}flyTo(t,e){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":t||(t=this._center?this._center:this._viewSettings?this._viewSettings.center:void 0),e||(e=this._zoom?this._zoom:this._viewSettings&&this._viewSettings.zoom?this._viewSettings.zoom:void 0),this._mapGl?t&&this._mapGl.flyTo({center:t,zoom:e}):(this._center=t,this._zoom=e)}return this}resize(){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":this._mapGl&&this._mapGl.resize()}return this}setZoom(t){switch(this._zoom=t,this._type){case"RASTER":this._mapJs&&this._zoom&&this._mapJs.setZoom(this._zoom,{animate:!1});break;case"VECTOR":this._mapGl&&this._zoom&&this._mapGl.setZoom(this._zoom)}return this}setControls(t){return this._controls=t,this._mapGl&&(this._controls?this._controls.forEach(t=>{Array.isArray(t)?this._mapGl.addControl(t[0],t[1]):this._mapGl.addControl(t)}):this._mapGl.addControl(new t5.NavigationControl)),this}setGeoJson(t){var e;return this._geoJsonConfig=t,this._mapGl&&(this._geoJsonConfig?this.loadGeoJSON(this._geoJsonConfig):this.loadGeoJSON(null==(e=this._viewSettings)?void 0:e.geoJson)),this}loadViewSettings(){return eo(this,void 0,void 0,function*(){var t;let e=("RASTER"===this._type?yield x().rest.api.MapResource.getSettingsJs():yield x().rest.api.MapResource.getSettings()).data;if(e.override)return e.override;let i=x().displayRealm||"default";return this._viewSettings=e.options?e.options[i]?e.options[i]:e.options.default:null,this._viewSettings&&(this._mapGl&&(this._mapGl.setMinZoom(this._viewSettings.minZoom),this._mapGl.setMaxZoom(this._viewSettings.maxZoom),this._viewSettings.bounds&&this._mapGl.setMaxBounds(this._viewSettings.bounds),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson)),this._center?this.setCenter(this._center):this.setCenter(this._viewSettings.center)),e})}load(){return eo(this,void 0,void 0,function*(){var e;if(!this._loaded){if("RASTER"===this._type){let t,e=document.createElement("style");e.id="mapboxJsStyle",e.textContent=es,this._styleParent.appendChild(e);let i=yield this.loadViewSettings();if(this._viewSettings){if((t={}).zoom=this._viewSettings.zoom?this._viewSettings.zoom+1:void 0,this._useZoomControls&&(t.maxZoom=this._viewSettings.maxZoom?this._viewSettings.maxZoom-1:void 0,t.minZoom=this._viewSettings.minZoom?this._viewSettings.minZoom+1:void 0),t.boxZoom=this._viewSettings.boxZoom,this._viewSettings.bounds&&(t.maxBounds=ei(this._viewSettings.bounds)),this._viewSettings.center){let e=t9(this._viewSettings.center);t.center=e?L.latLng(e.lat,e.lng):void 0}if(this._center){let e=t9(this._center);t.center=e?L.latLng(e.lat,e.lng):void 0}this._zoom&&(t.zoom=this._zoom+1)}if(this._mapJs=L.mapbox.map(this._mapContainer,i,t),this._mapJs.on("click",t=>{this._onMapClick(t.latlng)}),t&&t.maxBounds){let e=this._mapJs.getBoundsZoom(t.maxBounds,!0);(!t.minZoom||t.minZoom<e)&&this._mapJs.setMinZoom(e)}}else{let i=document.createElement("style");i.id="maplibreGlStyle",i.textContent=el,this._styleParent.appendChild(i),(i=document.createElement("style")).id="maplibreGeoCoderStyles",i.textContent=ec,this._styleParent.appendChild(i);let n=yield Promise.resolve().then(o.t.bind(o,266,23)),r=yield this.loadViewSettings(),a={attributionControl:{compact:!0},container:this._mapContainer,style:r,transformRequest:(e,i)=>{if(t||(t=new URL(e).searchParams.get("access_token")||""),0===e.indexOf("mapbox:")){var n;return n=t,e.indexOf("/styles/")>-1&&-1===e.indexOf("/sprite")?{url:function(t,e){let i=er(t);return i.path=`/styles/v1${i.path}`,ea(i,e)}(e,n)}:e.indexOf("/sprites/")>-1?{url:function(t,e){let i=er(t),n=i.path.split("."),r=n[0],a=n[1],o="";return r.indexOf("@2x")&&(r=r.split("@2x")[0],o="@2x"),i.path=`/styles/v1${r}/sprite${o}.${a}`,ea(i,e)}(e,n)}:e.indexOf("/fonts/")>-1?{url:function(t,e){let i=er(t);return i.path=`/fonts/v1${i.path}`,ea(i,e)}(e,n)}:e.indexOf("/v4/")>-1||"Source"===i?{url:function(t,e){let i=er(t);return i.path=`/v4/${i.authority}.json`,i.params.push("secure"),ea(i,e)}(e,n)}:void 0}return{headers:new URL(window.origin).hostname===new URL(e).hostname?{Authorization:x().getAuthorizationHeader()}:{},url:e}}};if(this._viewSettings&&(this._useZoomControls&&(a.maxZoom=this._viewSettings.maxZoom,a.minZoom=this._viewSettings.minZoom),this._viewSettings.bounds&&!this._showBoundaryBox&&(a.maxBounds=this._viewSettings.bounds),a.boxZoom=this._viewSettings.boxZoom,a.zoom=this._viewSettings.zoom,a.center=this._viewSettings.center),this._center=this._center||(this._viewSettings?this._viewSettings.center:void 0),a.center=this._center,this._zoom&&(a.zoom=this._zoom),!this.isWebglSupported())return void console.warn("WebGL is not supported in this environment. The map cannot be initialized.");this._mapGl=new n.Map(a),yield this.styleLoaded(),this._mapGl.on("click",t=>{this._onMapClick(t.lngLat)}),this._mapGl.on("dblclick",t=>{this._onMapClick(t.lngLat,!0)}),this._showGeoCodingControl&&this._viewSettings&&this._viewSettings.geocodeUrl&&(this._geocoder=new(t6())({forwardGeocode:this._forwardGeocode.bind(this),reverseGeocode:this._reverseGeocode},{maplibregl:t3(),showResultsWhileTyping:!0}),this._geocoder._onKeyDown=(0,t7.debounce)(t=>{if(27===t.keyCode&&this._geocoder.options.clearAndBlurOnEsc)return this._geocoder._clear(t),this._geocoder._inputEl.blur();var e=this._geocoder._inputEl.value||t.key;if(!e)return this._geocoder.fresh=!0,9!==t.keyCode&&this._geocoder.clear(t),this._geocoder._clearEl.style.display="none";if(!t.metaKey&&-1===[9,27,37,39,38,40].indexOf(t.keyCode)){if(13===t.keyCode)if(this._geocoder.options.showResultsWhileTyping){this._geocoder.options.showResultMarkers&&this._geocoder._fitBoundsForMarkers(),this._geocoder._inputEl.value=this._geocoder._typeahead.query,this._geocoder.lastSelected=null,this._geocoder._typeahead.selected=null;return}else this._geocoder._typeahead.list.selectingListItem||this._geocoder._geocode(e);e.length>=this._geocoder.options.minLength&&this._geocoder.options.showResultsWhileTyping&&this._geocoder._geocode(e)}},300),this._mapGl.addControl(this._geocoder,"top-left"),this._geocoder._inputEl.addEventListener("change",()=>{var t=this._geocoder._typeahead.selected;this._onGeocodeChange(t)})),this._controls?this._controls.forEach(t=>{Array.isArray(t)?this._mapGl.addControl(t[0],t[1]):this._mapGl.addControl(t)}):(this._mapGl.addControl(new t5.NavigationControl),this._mapGl.addControl(new t5.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!0,showUserLocation:!0}))),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(e=this._viewSettings)?void 0:e.geoJson),this._initLongPressEvent()}this._mapContainer.dispatchEvent(new ar),this._loaded=!0,this.createBoundaryBox()}})}styleLoaded(){return new Promise(t=>{this._mapGl&&this._mapGl.once("style.load",()=>{t()})})}unload(){this._mapGl&&(this._mapGl.remove(),this._mapGl=void 0),this._mapJs&&(this._mapJs.remove(),this._mapJs=void 0)}_onMapClick(t,e=!1){this._mapContainer.dispatchEvent(new aa(t,e))}loadGeoJSON(t){return eo(this,void 0,void 0,function*(){if(this._geoJsonLayers.size>0&&(this._geoJsonLayers.forEach((t,e)=>this._mapGl.removeLayer(e)),this._geoJsonLayers=new Map),this._geoJsonSources.length>0&&(this._geoJsonSources.forEach(t=>this._mapGl.removeSource(t)),this._geoJsonSources=[]),this._showGeoJson&&t)if("FeatureCollection"==t.source.type){let e=this.groupSourcesByGeometryType(t.source);null==e||e.forEach((t,e)=>{let i=this.addGeoJSONSource({type:"geojson",data:{type:"FeatureCollection",features:t}});i&&this.addGeoJSONLayer(e,i.sourceId)})}else if("Feature"==t.source.type){let e=this.addGeoJSONSource(t.source);e&&this.addGeoJSONLayer(e.source.type,e.sourceId)}else console.error("Could not create layer since source type is neither 'FeatureCollection' nor 'Feature'.")})}groupSourcesByGeometryType(t){let e=new Map;return t.features.forEach(t=>{let i=e.get(t.geometry.type);void 0==i&&(i=[]),i.push(t),e.set(t.geometry.type,i)}),e}addGeoJSONSource(t){if(!this._mapGl)return void console.error("mapGl instance not found!");let e=Date.now()+"-"+(this._geoJsonSources.length+1);return this._mapGl.addSource(e,t),this._geoJsonSources.push(e),{source:t,sourceId:e}}addGeoJSONLayer(t,e){if(!this._mapGl)return void console.error("mapGl instance not found!");let i=e+"-"+t;if(void 0==this._geoJsonLayers.get(i)){let n=getComputedStyle(this._mapContainer).getPropertyValue("--or-app-color4");(void 0==n||0==n.length)&&(n=v.DefaultColor4);let r={id:i,source:e};switch(t){case"Point":case"MultiPoint":r.type="circle",r.paint={"circle-radius":12,"circle-color":n},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);break;case"LineString":case"MultiLineString":r.type="line",r.paint={"line-color":n,"line-width":4},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);break;case"Polygon":case"MultiPolygon":{r.type="fill",r.paint={"fill-color":n,"fill-opacity":.3},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);let t=i+"-outline",a={id:t,source:e,type:"line",paint:{"line-color":n,"line-width":2}};this._geoJsonLayers.set(t,a),this._mapGl.addLayer(a);break}case"GeometryCollection":return void console.error("GeometryCollection GeoJSON is not implemented yet!")}}}addMarker(t){t.hasPosition()&&this._updateMarkerElement(t,!0)}removeMarker(t){this._removeMarkerRadius(t),this._updateMarkerElement(t,!1)}onMarkerChanged(t,e){if(this._loaded)switch(e){case"lat":case"lng":case"radius":t.hasPosition()?t._actualMarkerElement?this._updateMarkerPosition(t):this._updateMarkerElement(t,!0):t._actualMarkerElement&&this._updateMarkerElement(t,!1)}}_updateMarkerPosition(t){switch(this._type){case"RASTER":let e=this._markersJs.get(t);e&&e.setLatLng([t.lat,t.lng]);break;case"VECTOR":let i=this._markersGl.get(t);i&&i.setLngLat([t.lng,t.lat])}this._createMarkerRadius(t)}_updateMarkerElement(t,e){switch(this._type){case"RASTER":let i=this._markersJs.get(t);if(i&&(this._removeMarkerClickHandler(t,t.markerContainer),t._actualMarkerElement=void 0,i.removeFrom(this._mapJs),this._markersJs.delete(t)),e){let e=t._createMarkerElement();if(e){let n=L.divIcon({html:e.outerHTML,className:"or-marker-raster"});(i=L.marker([t.lat,t.lng],{icon:n,clickable:t.interactive})).addTo(this._mapJs),t._actualMarkerElement=i.getElement()?i.getElement().firstElementChild:void 0,t.interactive&&this._addMarkerClickHandler(t,t.markerContainer),this._markersJs.set(t,i)}t.radius&&this._createMarkerRadius(t)}break;case"VECTOR":let n=this._markersGl.get(t);if(n&&(t._actualMarkerElement=void 0,this._removeMarkerClickHandler(t,n.getElement()),n.remove(),this._markersGl.delete(t)),e){let e=t._createMarkerElement();e&&(n=new t5.Marker({element:e,anchor:"top-left"}).setLngLat([t.lng,t.lat]).addTo(this._mapGl),this._markersGl.set(t,n),t._actualMarkerElement=n.getElement(),t.interactive&&this._addMarkerClickHandler(t,n.getElement())),t.radius&&this._createMarkerRadius(t)}}}_removeMarkerRadius(t){this._mapGl&&this._loaded&&t.radius&&t.lat&&t.lng&&this._mapGl.getSource("circleData")&&(this._mapGl.removeLayer("marker-radius-circle"),this._mapGl.removeSource("circleData"))}_createMarkerRadius(t){this._mapGl&&this._loaded&&t.radius&&t.lat&&t.lng&&(this._removeMarkerRadius(t),this._mapGl.addSource("circleData",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[t.lng,t.lat]},properties:{title:"You Found Me"}}]}}),this._mapGl.addLayer({id:"marker-radius-circle",type:"circle",source:"circleData",paint:{"circle-radius":["interpolate",["linear"],["zoom"],0,0,20,t.radius/.075/Math.cos(t.lat*Math.PI/180)],"circle-color":"red","circle-opacity":.3}}))}createBoundaryBox(t=[]){var e,i;if(this._mapGl&&this._loaded&&this._showBoundaryBox&&(null==(e=this._viewSettings)?void 0:e.bounds)){this._mapGl.getSource("bounds")&&(this._mapGl.removeLayer("bounds"),this._mapGl.removeSource("bounds")),4!==t.length&&(t=null==(i=this._viewSettings)?void 0:i.bounds.toString().split(","));var n=[[[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]],[t[0],t[3]]]];this._mapGl.fitBounds([parseFloat(t[0])+.01,parseFloat(t[1])-.01,parseFloat(t[2])-.01,parseFloat(t[3])+.01]),this._mapGl.addSource("bounds",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:n}}}),this._mapGl.addLayer({id:"bounds",type:"fill",source:"bounds",paint:{"fill-color":"#FF0000","fill-opacity":.4}})}}_addMarkerClickHandler(t,e){if(e){let i=e=>{e.stopPropagation(),t._onClick(e)};this._clickHandlers.set(t,i),e.addEventListener("click",i)}}_removeMarkerClickHandler(t,e){let i=this._clickHandlers.get(t);i&&e&&(e.removeEventListener("click",i),this._clickHandlers.delete(t))}_forwardGeocode(t){return eo(this,void 0,void 0,function*(){let e=[];try{let i=this._viewSettings.geocodeUrl+"/search?q="+t.query+"&format=geojson&polygon_geojson=1&addressdetails=1",n=yield fetch(i);for(let t of(yield n.json()).features){let i=[t.bbox[0]+(t.bbox[2]-t.bbox[0])/2,t.bbox[1]+(t.bbox[3]-t.bbox[1])/2],n={type:"Feature",geometry:{type:"Point",coordinates:i},place_name:t.properties.display_name,properties:t.properties,text:t.properties.display_name,place_type:["place"],center:i};e.push(n)}}catch(t){console.error(`Failed to forwardGeocode with error: ${t}`)}return{features:e}})}_reverseGeocode(t){return eo(this,void 0,void 0,function*(){let e=[];try{let i=this._viewSettings.geocodeUrl+"/reverse?lat="+t.lat+"&lon="+t.lon+"&format=geojson&polygon_geojson=1&addressdetails=1",n=yield fetch(i);for(let t of(yield n.json()).features){let i=[t.bbox[0]+(t.bbox[2]-t.bbox[0])/2,t.bbox[1]+(t.bbox[3]-t.bbox[1])/2],n={type:"Feature",geometry:{type:"Point",coordinates:i},place_name:t.properties.display_name,properties:t.properties,text:t.properties.display_name,place_type:["place"],center:i};e.push(n)}}catch(t){console.error(`Failed to reverseGeocode with error: ${t}`)}return{features:e}})}_initLongPressEvent(){if(this._mapGl){let t,e,i=()=>{t&&clearTimeout(t),t=null};this._mapGl.on("touchstart",i=>{i.originalEvent.touches.length>1||(e=i.lngLat,t=setTimeout(()=>{this._onLongPress(e)},500))}),this._mapGl.on("mousedown",i=>{t||(e=i.lngLat,t=setTimeout(()=>{this._onLongPress(e),t=null},500))}),this._mapGl.on("dragstart",i),this._mapGl.on("mouseup",i),this._mapGl.on("touchend",i),this._mapGl.on("touchcancel",i),this._mapGl.on("touchmove",i),this._mapGl.on("moveend",i),this._mapGl.on("gesturestart",i),this._mapGl.on("gesturechange",i),this._mapGl.on("gestureend",i)}}_onLongPress(t){this._mapContainer.dispatchEvent(new ao(t))}_onGeocodeChange(t){this._mapContainer.dispatchEvent(new as(t))}isWebglSupported(){if(window.WebGLRenderingContext){let t=document.createElement("canvas");try{let e=t.getContext("webgl2")||t.getContext("webgl");if(e&&"function"==typeof e.getParameter)return!0}catch(t){}}return!1}}let eu="--internal-or-map-marker-color",eh="--internal-or-map-marker-active-color",ep=tV`
51
+ `}),staticAttributes:n,staticUniforms:o}}class t4{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,n,r,a,o,s,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==n.length;for(let t=0;!c&&t<n.length;t++)this.boundPaintVertexBuffers[t]!==n[t]&&(c=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||c||this.boundIndexBuffer!==r||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==o||this.boundDynamicVertexBuffer2!==s||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,i,n,r,a,o,s,l):(t.bindVertexArray.set(this.vao),o&&o.bind(),r&&r.dynamicDraw&&r.bind(),s&&s.bind(),l&&l.bind())}freshBind(t,e,i,n,r,a,o,s){let l=t.numAttributes,c=this.context,d=c.gl;for(let l of(this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=o,this.boundDynamicVertexBuffer3=s,e.enableAttributes(d,t),i))l.enableAttributes(d,t);for(let n of(a&&a.enableAttributes(d,t),o&&o.enableAttributes(d,t),s&&s.enableAttributes(d,t),e.bind(),e.setVertexAttribPointers(d,t,r),i))n.bind(),n.setVertexAttribPointers(d,t,r);a&&(a.bind(),a.setVertexAttribPointers(d,t,r)),n&&n.bind(),o&&(o.bind(),o.setVertexAttribPointers(d,t,r)),s&&(s.bind(),s.setVertexAttribPointers(d,t,r)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function t6(t){let e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;let n=t[i].split(" ");e.push(n.pop())}return e}class t7{constructor(t,i,n,r,a,o){let s=t.gl;this.program=s.createProgram();let l=t6(i.staticAttributes),c=n?n.getBinderAttributes():[],d=l.concat(c),u=t5.prelude.staticUniforms?t6(t5.prelude.staticUniforms):[],h=i.staticUniforms?t6(i.staticUniforms):[],p=n?n.getBinderUniforms():[],m=u.concat(h).concat(p),f=[];for(let t of m)0>f.indexOf(t)&&f.push(t);let g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;"),o&&g.push("#define TERRAIN3D;");let _=g.concat(t5.prelude.fragmentSource,i.fragmentSource).join("\n"),b=g.concat(t5.prelude.vertexSource,i.vertexSource).join("\n"),y=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(y,_),s.compileShader(y),!s.getShaderParameter(y,s.COMPILE_STATUS))throw Error(`Could not compile fragment shader: ${s.getShaderInfoLog(y)}`);s.attachShader(this.program,y);let v=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())return void(this.failedToCreate=!0);if(s.shaderSource(v,b),s.compileShader(v),!s.getShaderParameter(v,s.COMPILE_STATUS))throw Error(`Could not compile vertex shader: ${s.getShaderInfoLog(v)}`);s.attachShader(this.program,v),this.attributes={};let x={};this.numAttributes=d.length;for(let t=0;t<this.numAttributes;t++)d[t]&&(s.bindAttribLocation(this.program,t,d[t]),this.attributes[d[t]]=t);if(s.linkProgram(this.program),!s.getProgramParameter(this.program,s.LINK_STATUS))throw Error(`Program failed to link: ${s.getProgramInfoLog(this.program)}`);s.deleteShader(v),s.deleteShader(y);for(let t=0;t<f.length;t++){let e=f[t];if(e&&!x[e]){let t=s.getUniformLocation(this.program,e);t&&(x[e]=t)}}this.fixedUniforms=r(t,x),this.terrainUniforms=((t,i)=>({u_depth:new e.aG(t,i.u_depth),u_terrain:new e.aG(t,i.u_terrain),u_terrain_dim:new e.aH(t,i.u_terrain_dim),u_terrain_matrix:new e.aI(t,i.u_terrain_matrix),u_terrain_unpack:new e.aJ(t,i.u_terrain_unpack),u_terrain_exaggeration:new e.aH(t,i.u_terrain_exaggeration)}))(t,x),this.binderUniforms=n?n.getUniforms(t,x):[]}draw(t,e,i,n,r,a,o,s,l,c,d,u,h,p,m,f,g,_){let b=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(r),t.setCullFace(a),s)for(let e in t.activeTexture.set(b.TEXTURE2),b.bindTexture(b.TEXTURE_2D,s.depthTexture),t.activeTexture.set(b.TEXTURE3),b.bindTexture(b.TEXTURE_2D,s.texture),this.terrainUniforms)this.terrainUniforms[e].set(s[e]);for(let t in this.fixedUniforms)this.fixedUniforms[t].set(o[t]);m&&m.setUniforms(t,this.binderUniforms,h,{zoom:p});let y=0;switch(e){case b.LINES:y=2;break;case b.TRIANGLES:y=3;break;case b.LINE_STRIP:y=1}for(let i of u.get()){let n=i.vaos||(i.vaos={});(n[l]||(n[l]=new t4)).bind(t,this,c,m?m.getPaintVertexBuffers():[],d,i.vertexOffset,f,g,_),b.drawElements(e,i.primitiveLength*y,b.UNSIGNED_SHORT,i.primitiveOffset*y*2)}}}function t8(t,e,i){let n=1/tM(i,1,e.transform.tileZoom),r=Math.pow(2,i.tileID.overscaledZ),a=i.tileSize*Math.pow(2,e.transform.tileZoom)/r,o=a*(i.tileID.canonical.x+i.tileID.wrap*r),s=a*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[o>>16,s>>16],u_pixel_coord_lower:[65535&o,65535&s]}}let t9=(t,i,n,r)=>{var a,o,s,l,c,d,u;let h=i.style.light,p=h.properties.get("position"),m=[p.x,p.y,p.z],f=(a=new e.A(9),e.A!=Float32Array&&(a[1]=0,a[2]=0,a[3]=0,a[5]=0,a[6]=0,a[7]=0),a[0]=1,a[4]=1,a[8]=1,a);"viewport"===h.properties.get("anchor")&&(s=Math.sin(o=-i.transform.angle),l=Math.cos(o),f[0]=l,f[1]=s,f[2]=0,f[3]=-s,f[4]=l,f[5]=0,f[6]=0,f[7]=0,f[8]=1),c=m[0],d=m[1],u=m[2],m[0]=c*f[0]+d*f[3]+u*f[6],m[1]=c*f[1]+d*f[4]+u*f[7],m[2]=c*f[2]+d*f[5]+u*f[8];let g=h.properties.get("color");return{u_matrix:t,u_lightpos:m,u_lightintensity:h.properties.get("intensity"),u_lightcolor:[g.r,g.g,g.b],u_vertical_gradient:+n,u_opacity:r}},et=(t,i,n,r,a,o,s)=>e.e(t9(t,i,n,r),t8(o,i,s),{u_height_factor:-Math.pow(2,a.overscaledZ)/s.tileSize/8}),ee=t=>({u_matrix:t}),ei=(t,i,n,r)=>e.e(ee(t),t8(n,i,r)),en=(t,e)=>({u_matrix:t,u_world:e}),er=(t,i,n,r,a)=>e.e(ei(t,i,n,r),{u_world:a}),ea=(t,e,i,n)=>{let r,a,o=t.transform;if("map"===n.paint.get("circle-pitch-alignment")){let t=tM(i,1,o.zoom);r=!0,a=[t,t]}else r=!1,a=o.pixelsToGLUnits;return{u_camera_to_center_distance:o.cameraToCenterDistance,u_scale_with_map:+("map"===n.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,n.paint.get("circle-translate"),n.paint.get("circle-translate-anchor")),u_pitch_with_map:+r,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:a}},eo=(t,e,i)=>{let n=tM(i,1,e.zoom),r=Math.pow(2,e.zoom-i.tileID.overscaledZ),a=i.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*r),e.pixelsToGLUnits[1]/(n*r)],u_overscale_factor:a}},es=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),el=t=>({u_matrix:t}),ec=(t,e,i,n)=>({u_matrix:t,u_extrude_scale:tM(e,1,i),u_intensity:n}),ed=(t,e,i,n)=>{let r=t.transform;return{u_matrix:ef(t,e,i,n),u_ratio:1/tM(e,1,r.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},eu=(t,i,n,r,a)=>e.e(ed(t,i,n,a),{u_image:0,u_image_height:r}),eh=(t,e,i,n,r)=>{let a=t.transform,o=em(e,a);return{u_matrix:ef(t,e,i,r),u_texsize:e.imageAtlasTexture.size,u_ratio:1/tM(e,1,a.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[o,n.fromScale,n.toScale],u_fade:n.t,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},ep=(t,i,n,r,a,o)=>{let s=t.lineAtlas,l=em(i,t.transform),c="round"===n.layout.get("line-cap"),d=s.getDash(r.from,c),u=s.getDash(r.to,c),h=d.width*a.fromScale,p=u.width*a.toScale;return e.e(ed(t,i,n,o),{u_patternscale_a:[l/h,-d.height/2],u_patternscale_b:[l/p,-u.height/2],u_sdfgamma:s.width/(256*Math.min(h,p)*t.pixelRatio)/2,u_image:0,u_tex_y_a:d.y,u_tex_y_b:u.y,u_mix:a.t})};function em(t,e){return 1/tM(t,1,e.tileZoom)}function ef(t,e,i,n){return t.translatePosMatrix(n?n.posMatrix:e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}let eg=(t,e,i,n,r)=>{var a,o;return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(o=r.paint.get("raster-saturation"))>0?1-1/(1.001-o):-o,u_contrast_factor:(a=r.paint.get("raster-contrast"))>0?1/(1-a):1+a,u_spin_weights:function(t){let e=Math.sin(t*=Math.PI/180),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}(r.paint.get("raster-hue-rotate"))}},e_=(t,e,i,n,r,a,o,s,l,c)=>{let d=r.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:d.width/d.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:a,u_label_plane_matrix:o,u_coord_matrix:s,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},eb=(t,i,n,r,a,o,s,l,c,d,u)=>{let h=a.transform;return e.e(e_(t,i,n,r,a,o,s,l,c,d),{u_gamma_scale:r?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:a.pixelRatio,u_is_halo:+u})},ey=(t,i,n,r,a,o,s,l,c,d)=>e.e(eb(t,i,n,r,a,o,s,l,!0,c,!0),{u_texsize_icon:d,u_texture_icon:1}),ev=(t,e,i)=>({u_matrix:t,u_opacity:e,u_color:i}),ex=(t,i,n,r,a,o)=>e.e(function(t,e,i,n){let r=i.imageManager.getPattern(t.from.toString()),a=i.imageManager.getPattern(t.to.toString()),{width:o,height:s}=i.imageManager.getPixelSize(),l=Math.pow(2,n.tileID.overscaledZ),c=n.tileSize*Math.pow(2,i.transform.tileZoom)/l,d=c*(n.tileID.canonical.x+n.tileID.wrap*l),u=c*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:a.tl,u_pattern_br_b:a.br,u_texsize:[o,s],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:a.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/tM(n,1,i.transform.tileZoom),u_pixel_coord_upper:[d>>16,u>>16],u_pixel_coord_lower:[65535&d,65535&u]}}(r,o,n,a),{u_matrix:t,u_opacity:i}),ew={fillExtrusion:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_lightpos:new e.aK(t,i.u_lightpos),u_lightintensity:new e.aH(t,i.u_lightintensity),u_lightcolor:new e.aK(t,i.u_lightcolor),u_vertical_gradient:new e.aH(t,i.u_vertical_gradient),u_opacity:new e.aH(t,i.u_opacity)}),fillExtrusionPattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_lightpos:new e.aK(t,i.u_lightpos),u_lightintensity:new e.aH(t,i.u_lightintensity),u_lightcolor:new e.aK(t,i.u_lightcolor),u_vertical_gradient:new e.aH(t,i.u_vertical_gradient),u_height_factor:new e.aH(t,i.u_height_factor),u_image:new e.aG(t,i.u_image),u_texsize:new e.aL(t,i.u_texsize),u_pixel_coord_upper:new e.aL(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aL(t,i.u_pixel_coord_lower),u_scale:new e.aK(t,i.u_scale),u_fade:new e.aH(t,i.u_fade),u_opacity:new e.aH(t,i.u_opacity)}),fill:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix)}),fillPattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_image:new e.aG(t,i.u_image),u_texsize:new e.aL(t,i.u_texsize),u_pixel_coord_upper:new e.aL(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aL(t,i.u_pixel_coord_lower),u_scale:new e.aK(t,i.u_scale),u_fade:new e.aH(t,i.u_fade)}),fillOutline:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_world:new e.aL(t,i.u_world)}),fillOutlinePattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_world:new e.aL(t,i.u_world),u_image:new e.aG(t,i.u_image),u_texsize:new e.aL(t,i.u_texsize),u_pixel_coord_upper:new e.aL(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aL(t,i.u_pixel_coord_lower),u_scale:new e.aK(t,i.u_scale),u_fade:new e.aH(t,i.u_fade)}),circle:(t,i)=>({u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_scale_with_map:new e.aG(t,i.u_scale_with_map),u_pitch_with_map:new e.aG(t,i.u_pitch_with_map),u_extrude_scale:new e.aL(t,i.u_extrude_scale),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_matrix:new e.aI(t,i.u_matrix)}),collisionBox:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_pixels_to_tile_units:new e.aH(t,i.u_pixels_to_tile_units),u_extrude_scale:new e.aL(t,i.u_extrude_scale),u_overscale_factor:new e.aH(t,i.u_overscale_factor)}),collisionCircle:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_inv_matrix:new e.aI(t,i.u_inv_matrix),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_viewport_size:new e.aL(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new e.aM(t,i.u_color),u_matrix:new e.aI(t,i.u_matrix),u_overlay:new e.aG(t,i.u_overlay),u_overlay_scale:new e.aH(t,i.u_overlay_scale)}),clippingMask:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix)}),heatmap:(t,i)=>({u_extrude_scale:new e.aH(t,i.u_extrude_scale),u_intensity:new e.aH(t,i.u_intensity),u_matrix:new e.aI(t,i.u_matrix)}),heatmapTexture:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_world:new e.aL(t,i.u_world),u_image:new e.aG(t,i.u_image),u_color_ramp:new e.aG(t,i.u_color_ramp),u_opacity:new e.aH(t,i.u_opacity)}),hillshade:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_image:new e.aG(t,i.u_image),u_latrange:new e.aL(t,i.u_latrange),u_light:new e.aL(t,i.u_light),u_shadow:new e.aM(t,i.u_shadow),u_highlight:new e.aM(t,i.u_highlight),u_accent:new e.aM(t,i.u_accent)}),hillshadePrepare:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_image:new e.aG(t,i.u_image),u_dimension:new e.aL(t,i.u_dimension),u_zoom:new e.aH(t,i.u_zoom),u_unpack:new e.aJ(t,i.u_unpack)}),line:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_ratio:new e.aH(t,i.u_ratio),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aL(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_ratio:new e.aH(t,i.u_ratio),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aL(t,i.u_units_to_pixels),u_image:new e.aG(t,i.u_image),u_image_height:new e.aH(t,i.u_image_height)}),linePattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_texsize:new e.aL(t,i.u_texsize),u_ratio:new e.aH(t,i.u_ratio),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_image:new e.aG(t,i.u_image),u_units_to_pixels:new e.aL(t,i.u_units_to_pixels),u_scale:new e.aK(t,i.u_scale),u_fade:new e.aH(t,i.u_fade)}),lineSDF:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_ratio:new e.aH(t,i.u_ratio),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aL(t,i.u_units_to_pixels),u_patternscale_a:new e.aL(t,i.u_patternscale_a),u_patternscale_b:new e.aL(t,i.u_patternscale_b),u_sdfgamma:new e.aH(t,i.u_sdfgamma),u_image:new e.aG(t,i.u_image),u_tex_y_a:new e.aH(t,i.u_tex_y_a),u_tex_y_b:new e.aH(t,i.u_tex_y_b),u_mix:new e.aH(t,i.u_mix)}),raster:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_tl_parent:new e.aL(t,i.u_tl_parent),u_scale_parent:new e.aH(t,i.u_scale_parent),u_buffer_scale:new e.aH(t,i.u_buffer_scale),u_fade_t:new e.aH(t,i.u_fade_t),u_opacity:new e.aH(t,i.u_opacity),u_image0:new e.aG(t,i.u_image0),u_image1:new e.aG(t,i.u_image1),u_brightness_low:new e.aH(t,i.u_brightness_low),u_brightness_high:new e.aH(t,i.u_brightness_high),u_saturation_factor:new e.aH(t,i.u_saturation_factor),u_contrast_factor:new e.aH(t,i.u_contrast_factor),u_spin_weights:new e.aK(t,i.u_spin_weights)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new e.aG(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aG(t,i.u_is_size_feature_constant),u_size_t:new e.aH(t,i.u_size_t),u_size:new e.aH(t,i.u_size),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_pitch:new e.aH(t,i.u_pitch),u_rotate_symbol:new e.aG(t,i.u_rotate_symbol),u_aspect_ratio:new e.aH(t,i.u_aspect_ratio),u_fade_change:new e.aH(t,i.u_fade_change),u_matrix:new e.aI(t,i.u_matrix),u_label_plane_matrix:new e.aI(t,i.u_label_plane_matrix),u_coord_matrix:new e.aI(t,i.u_coord_matrix),u_is_text:new e.aG(t,i.u_is_text),u_pitch_with_map:new e.aG(t,i.u_pitch_with_map),u_texsize:new e.aL(t,i.u_texsize),u_texture:new e.aG(t,i.u_texture)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new e.aG(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aG(t,i.u_is_size_feature_constant),u_size_t:new e.aH(t,i.u_size_t),u_size:new e.aH(t,i.u_size),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_pitch:new e.aH(t,i.u_pitch),u_rotate_symbol:new e.aG(t,i.u_rotate_symbol),u_aspect_ratio:new e.aH(t,i.u_aspect_ratio),u_fade_change:new e.aH(t,i.u_fade_change),u_matrix:new e.aI(t,i.u_matrix),u_label_plane_matrix:new e.aI(t,i.u_label_plane_matrix),u_coord_matrix:new e.aI(t,i.u_coord_matrix),u_is_text:new e.aG(t,i.u_is_text),u_pitch_with_map:new e.aG(t,i.u_pitch_with_map),u_texsize:new e.aL(t,i.u_texsize),u_texture:new e.aG(t,i.u_texture),u_gamma_scale:new e.aH(t,i.u_gamma_scale),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_is_halo:new e.aG(t,i.u_is_halo)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new e.aG(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aG(t,i.u_is_size_feature_constant),u_size_t:new e.aH(t,i.u_size_t),u_size:new e.aH(t,i.u_size),u_camera_to_center_distance:new e.aH(t,i.u_camera_to_center_distance),u_pitch:new e.aH(t,i.u_pitch),u_rotate_symbol:new e.aG(t,i.u_rotate_symbol),u_aspect_ratio:new e.aH(t,i.u_aspect_ratio),u_fade_change:new e.aH(t,i.u_fade_change),u_matrix:new e.aI(t,i.u_matrix),u_label_plane_matrix:new e.aI(t,i.u_label_plane_matrix),u_coord_matrix:new e.aI(t,i.u_coord_matrix),u_is_text:new e.aG(t,i.u_is_text),u_pitch_with_map:new e.aG(t,i.u_pitch_with_map),u_texsize:new e.aL(t,i.u_texsize),u_texsize_icon:new e.aL(t,i.u_texsize_icon),u_texture:new e.aG(t,i.u_texture),u_texture_icon:new e.aG(t,i.u_texture_icon),u_gamma_scale:new e.aH(t,i.u_gamma_scale),u_device_pixel_ratio:new e.aH(t,i.u_device_pixel_ratio),u_is_halo:new e.aG(t,i.u_is_halo)}),background:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_opacity:new e.aH(t,i.u_opacity),u_color:new e.aM(t,i.u_color)}),backgroundPattern:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_opacity:new e.aH(t,i.u_opacity),u_image:new e.aG(t,i.u_image),u_pattern_tl_a:new e.aL(t,i.u_pattern_tl_a),u_pattern_br_a:new e.aL(t,i.u_pattern_br_a),u_pattern_tl_b:new e.aL(t,i.u_pattern_tl_b),u_pattern_br_b:new e.aL(t,i.u_pattern_br_b),u_texsize:new e.aL(t,i.u_texsize),u_mix:new e.aH(t,i.u_mix),u_pattern_size_a:new e.aL(t,i.u_pattern_size_a),u_pattern_size_b:new e.aL(t,i.u_pattern_size_b),u_scale_a:new e.aH(t,i.u_scale_a),u_scale_b:new e.aH(t,i.u_scale_b),u_pixel_coord_upper:new e.aL(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aL(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aH(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_texture:new e.aG(t,i.u_texture),u_ele_delta:new e.aH(t,i.u_ele_delta)}),terrainDepth:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_ele_delta:new e.aH(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_matrix:new e.aI(t,i.u_matrix),u_texture:new e.aG(t,i.u_texture),u_terrain_coords_id:new e.aH(t,i.u_terrain_coords_id),u_ele_delta:new e.aH(t,i.u_ele_delta)})};class ek{constructor(t,e,i){this.context=t;let n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=!!i,this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){let e=this.context.gl;if(!this.dynamicDraw)throw Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let eE={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class eC{constructor(t,e,i,n){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;let r=t.gl;this.buffer=r.createBuffer(),t.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}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 e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){let n=e.attributes[this.attributes[i].name];void 0!==n&&t.enableVertexAttribArray(n)}}setVertexAttribPointers(t,e,i){for(let n=0;n<this.attributes.length;n++){let r=this.attributes[n],a=e.attributes[r.name];void 0!==a&&t.vertexAttribPointer(a,r.components,t[eE[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let eA=new WeakMap;function eT(t){var e;if(eA.has(t))return eA.get(t);{let i=null==(e=t.getParameter(t.VERSION))?void 0:e.startsWith("WebGL 2.0");return eA.set(t,i),i}}class eI{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)}}class eS extends eI{getDefault(){return e.aO.transparent}set(t){let e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class ez extends eI{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class eL extends eI{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class eM extends eI{getDefault(){return[!0,!0,!0,!0]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class eP extends eI{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class eR extends eI{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class eO extends eI{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){let e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class eD extends eI{getDefault(){let t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class eB extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class eF extends eI{getDefault(){return[0,1]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class eN extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class eV extends eI{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class eU extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class e$ extends eI{getDefault(){let t=this.gl;return[t.ONE,t.ZERO]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class ej extends eI{getDefault(){return e.aO.transparent}set(t){let e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class eH extends eI{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class eq extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class eG extends eI{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class eX extends eI{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class eZ extends eI{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class eW extends eI{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class eY extends eI{getDefault(){let t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){let e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class eK extends eI{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class eJ extends eI{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class eQ extends eI{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class e0 extends eI{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class e1 extends eI{getDefault(){return null}set(t){let e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class e2 extends eI{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;let i=this.gl;eT(i)?i.bindVertexArray(t):null==(e=i.getExtension("OES_vertex_array_object"))||e.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class e5 extends eI{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class e3 extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class e4 extends eI{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;let e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class e6 extends eI{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class e7 extends e6{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class e8 extends e6{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class e9 extends e6{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class it{constructor(t,e,i,n,r){this.context=t,this.width=e,this.height=i;let a=t.gl,o=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new e7(t,o),n)this.depthAttachment=r?new e9(t,o):new e8(t,o);else if(r)throw Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw Error("Framebuffer is not complete")}destroy(){let t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){let e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class ie{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}ie.Replace=[1,0],ie.disabled=new ie(ie.Replace,e.aO.transparent,[!1,!1,!1,!1]),ie.unblended=new ie(ie.Replace,e.aO.transparent,[!0,!0,!0,!0]),ie.alphaBlended=new ie([1,771],e.aO.transparent,[!0,!0,!0,!0]);class ii{constructor(t){var e,i;if(this.gl=t,this.clearColor=new eS(this),this.clearDepth=new ez(this),this.clearStencil=new eL(this),this.colorMask=new eM(this),this.depthMask=new eP(this),this.stencilMask=new eR(this),this.stencilFunc=new eO(this),this.stencilOp=new eD(this),this.stencilTest=new eB(this),this.depthRange=new eF(this),this.depthTest=new eN(this),this.depthFunc=new eV(this),this.blend=new eU(this),this.blendFunc=new e$(this),this.blendColor=new ej(this),this.blendEquation=new eH(this),this.cullFace=new eq(this),this.cullFaceSide=new eG(this),this.frontFace=new eX(this),this.program=new eZ(this),this.activeTexture=new eW(this),this.viewport=new eY(this),this.bindFramebuffer=new eK(this),this.bindRenderbuffer=new eJ(this),this.bindTexture=new eQ(this),this.bindVertexBuffer=new e0(this),this.bindElementBuffer=new e1(this),this.bindVertexArray=new e2(this),this.pixelStoreUnpack=new e5(this),this.pixelStoreUnpackPremultiplyAlpha=new e3(this),this.pixelStoreUnpackFlipY=new e4(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_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),eT(t)){this.HALF_FLOAT=t.HALF_FLOAT;let n=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!=(e=t.RGBA16F)?e:null==n?void 0:n.RGBA16F_EXT,this.RGB16F=null!=(i=t.RGB16F)?i:null==n?void 0:n.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");let e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,e){return new ek(this,t,e)}createVertexBuffer(t,e,i){return new eC(this,t,e,i)}createRenderbuffer(t,e,i){let n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),r}createFramebuffer(t,e,i,n){return new it(this,t,e,i,n)}clear({color:t,depth:e,stencil:i}){let n=this.gl,r=0;t&&(r|=n.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==e&&(r|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==i&&(r|=n.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),n.clear(r)}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){e.aD(t.blendFunction,ie.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(){var t;return eT(this.gl)?this.gl.createVertexArray():null==(t=this.gl.getExtension("OES_vertex_array_object"))?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return eT(this.gl)?this.gl.deleteVertexArray(t):null==(e=this.gl.getExtension("OES_vertex_array_object"))?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class ir{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}ir.ReadOnly=!1,ir.ReadWrite=!0,ir.disabled=new ir(519,ir.ReadOnly,[0,1]);class ia{constructor(t,e,i,n,r,a){this.test=t,this.ref=e,this.mask=i,this.fail=n,this.depthFail=r,this.pass=a}}ia.disabled=new ia({func:519,mask:0},0,0,7680,7680,7680);class io{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}function is(t,i,n,r,a,o,l){var c;let d=t.context,u=d.gl,h=t.useProgram("collisionBox"),p=[],m=0,f=0;for(let s=0;s<r.length;s++){let c=r[s],g=i.getTile(c),_=g.getBucket(n);if(!_)continue;let b=c.posMatrix;0===a[0]&&0===a[1]||(b=t.translatePosMatrix(c.posMatrix,g,a,o));let y=l?_.textCollisionBox:_.iconCollisionBox,v=_.collisionCircleArray;if(v.length>0){let i=e.F(),n=b;e.aP(i,_.placementInvProjMatrix,t.transform.glCoordMatrix),e.aP(i,i,_.placementViewportMatrix),p.push({circleArray:v,circleOffset:f,transform:n,invTransform:i,coord:c}),m+=v.length/4,f=m}y&&h.draw(d,u.LINES,ir.disabled,ia.disabled,t.colorModeForRenderPass(),io.disabled,eo(b,t.transform,g),t.style.map.terrain&&t.style.map.terrain.getTerrainData(c),n.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,t.transform.zoom,null,null,y.collisionVertexBuffer)}if(!l||!p.length)return;let g=t.useProgram("collisionCircle"),_=new e.aQ;_.resize(4*m),_._trim();let b=0;for(let t of p)for(let e=0;e<t.circleArray.length/4;e++){let i=4*e,n=t.circleArray[i+0],r=t.circleArray[i+1],a=t.circleArray[i+2],o=t.circleArray[i+3];_.emplace(b++,n,r,a,o,0),_.emplace(b++,n,r,a,o,1),_.emplace(b++,n,r,a,o,2),_.emplace(b++,n,r,a,o,3)}(!s||s.length<2*m)&&(s=function(t){let i=2*t,n=new e.aS;n.resize(i),n._trim();for(let t=0;t<i;t++){let e=6*t;n.uint16[e+0]=4*t+0,n.uint16[e+1]=4*t+1,n.uint16[e+2]=4*t+2,n.uint16[e+3]=4*t+2,n.uint16[e+4]=4*t+3,n.uint16[e+5]=4*t+0}return n}(m));let y=d.createIndexBuffer(s,!0),v=d.createVertexBuffer(_,e.aR.members,!0);for(let i of p){let r={u_matrix:i.transform,u_inv_matrix:i.invTransform,u_camera_to_center_distance:(c=t.transform).cameraToCenterDistance,u_viewport_size:[c.width,c.height]};g.draw(d,u.TRIANGLES,ir.disabled,ia.disabled,t.colorModeForRenderPass(),io.disabled,r,t.style.map.terrain&&t.style.map.terrain.getTerrainData(i.coord),n.id,v,y,e.$.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,t.transform.zoom,null,null,null)}v.destroy(),y.destroy()}io.disabled=new io(!1,1029,2305),io.backCCW=new io(!0,1029,2305);let il=e.an(new Float32Array(16));function ic(t,i,n,r,a,o,s,l,c,d,u,h){let p=t.context,m=p.gl,f=t.transform,g="map"===l,_="map"===c,b="viewport"!==l&&"point"!==n.layout.get("symbol-placement"),y=g&&!_&&!b,v=!n.layout.get("symbol-sort-key").isConstant(),x=!1,w=t.depthModeForSublayer(0,ir.ReadOnly),k=n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"),E=[];for(let l of r){let r=i.getTile(l),c=r.getBucket(n);if(!c)continue;let u=a?c.text:c.icon;if(!u||!u.segments.get().length||!u.hasVisibleVertices)continue;let h=u.programConfigurations.get(n.id),p=a||c.sdfIcons,w=a?c.textSizeData:c.iconSizeData,C=_||0!==f.pitch,A=t.useProgram(c.iconsInText&&a?"symbolTextAndIcon":p?"symbolSDF":"symbolIcon",h),T=e.ag(w,f.zoom),I=t.style.map.terrain&&t.style.map.terrain.getTerrainData(l),S,z,M,P,R=[0,0],O=null;if(a)z=r.glyphAtlasTexture,M=m.LINEAR,S=r.glyphAtlasTexture.size,c.iconsInText&&(R=r.imageAtlasTexture.size,O=r.imageAtlasTexture,P=C||t.options.rotating||t.options.zooming||"composite"===w.kind||"camera"===w.kind?m.LINEAR:m.NEAREST);else{let e=1!==n.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;z=r.imageAtlasTexture,M=p||t.options.rotating||t.options.zooming||e||C?m.LINEAR:m.NEAREST,S=r.imageAtlasTexture.size}let D=tM(r,1,t.transform.zoom),B=t_(l.posMatrix,_,g,t.transform,D),F=tb(l.posMatrix,_,g,t.transform,D),N=k&&c.hasTextData(),V="none"!==n.layout.get("icon-text-fit")&&N&&c.hasIconData();if(b){let i=t.style.map.terrain?(e,i)=>t.style.map.terrain.getElevation(l,e,i):null,r="map"===n.layout.get("text-rotation-alignment");!function(t,i,n,r,a,o,s,l,c,d){let u=r?t.textSizeData:t.iconSizeData,h=e.ag(u,n.transform.zoom),p=[256/n.width*2+1,256/n.height*2+1],m=r?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;m.clear();let f=t.lineVertexArray,g=r?t.text.placedSymbolArray:t.icon.placedSymbolArray,_=n.transform.width/n.transform.height,b=!1;for(let r=0;r<g.length;r++){let y,v=g.get(r);if(v.hidden||v.writingMode===e.ah.vertical&&!b||(b=!1,d?(y=[v.anchorX,v.anchorY,d(v.anchorX,v.anchorY),1],e.af(y,y,i)):tz(y=[v.anchorX,v.anchorY,0,1],y,i),!function(t,e){let i=t[0]/t[3],n=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&n>=-e[1]&&n<=e[1]}(y,p))){tS(v.numGlyphs,m);continue}let x=tv(n.transform.cameraToCenterDistance,y[3]),w=e.ai(u,h,v),k=s?w/x:w*x,E=new e.P(v.anchorX,v.anchorY),C=ty(E,a,d).point,A={projections:{},offsets:{}},T=tk(v,k,!1,l,i,a,o,t.glyphOffsetArray,f,m,C,E,A,_,c,d);b=T.useVertical,(T.notEnoughRoom||b||T.needsFlipping&&tk(v,k,!0,l,i,a,o,t.glyphOffsetArray,f,m,C,E,A,_,c,d).notEnoughRoom)&&tS(v.numGlyphs,m)}r?t.text.dynamicLayoutVertexBuffer.updateData(m):t.icon.dynamicLayoutVertexBuffer.updateData(m)}(c,l.posMatrix,t,a,B,F,_,d,r,i)}let U=t.translatePosMatrix(l.posMatrix,r,o,s),$=b||a&&k||V?il:B,j=t.translatePosMatrix(F,r,o,s,!0),H=p&&0!==n.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1),q={program:A,buffers:u,uniformValues:p?c.iconsInText?ey(w.kind,T,y,_,t,U,$,j,S,R):eb(w.kind,T,y,_,t,U,$,j,a,S,!0):e_(w.kind,T,y,_,t,U,$,j,a,S),atlasTexture:z,atlasTextureIcon:O,atlasInterpolation:M,atlasInterpolationIcon:P,isSDF:p,hasHalo:H};if(v&&c.canOverlap)for(let t of(x=!0,u.segments.get()))E.push({segments:new e.$([t]),sortKey:t.sortKey,state:q,terrainData:I});else E.push({segments:u.segments,sortKey:0,state:q,terrainData:I})}for(let e of(x&&E.sort((t,e)=>t.sortKey-e.sortKey),E)){let i=e.state;if(p.activeTexture.set(m.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,m.CLAMP_TO_EDGE),i.atlasTextureIcon&&(p.activeTexture.set(m.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,m.CLAMP_TO_EDGE)),i.isSDF){let r=i.uniformValues;i.hasHalo&&(r.u_is_halo=1,id(i.buffers,e.segments,n,t,i.program,w,u,h,r,e.terrainData)),r.u_is_halo=0}id(i.buffers,e.segments,n,t,i.program,w,u,h,i.uniformValues,e.terrainData)}}function id(t,e,i,n,r,a,o,s,l,c){let d=n.context;r.draw(d,d.gl.TRIANGLES,a,o,s,io.disabled,l,c,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,n.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function iu(t,e,i,n,r){if(!i||!n||!n.imageAtlas)return;let a=n.imageAtlas.patternPositions,o=a[i.to.toString()],s=a[i.from.toString()];if(!o&&s&&(o=s),!s&&o&&(s=o),!o||!s){let t=r.getPaintProperty(e);o=a[t],s=a[t]}o&&s&&t.setConstantPatternPositions(o,s)}function ih(t,e,i,n,r,a,o){let s,l,c,d,u,h=t.context.gl,p="fill-pattern",m=i.paint.get(p),f=m&&m.constantOr(1),g=i.getCrossfadeParameters();o?(l=f&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",s=h.LINES):(l=f?"fillPattern":"fill",s=h.TRIANGLES);let _=m.constantOr(null);for(let m of n){let n=e.getTile(m);if(f&&!n.patternsLoaded())continue;let b=n.getBucket(i);if(!b)continue;let y=b.programConfigurations.get(i.id),v=t.useProgram(l,y),x=t.style.map.terrain&&t.style.map.terrain.getTerrainData(m);f&&(t.context.activeTexture.set(h.TEXTURE0),n.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),y.updatePaintBuffers(g)),iu(y,p,_,n,i);let w=x?m:null,k=t.translatePosMatrix(w?w.posMatrix:m.posMatrix,n,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(o){d=b.indexBuffer2,u=b.segments2;let e=[h.drawingBufferWidth,h.drawingBufferHeight];c="fillOutlinePattern"===l&&f?er(k,t,g,n,e):en(k,e)}else d=b.indexBuffer,u=b.segments,c=f?ei(k,t,g,n):ee(k);v.draw(t.context,s,r,t.stencilModeForClipping(m),a,io.disabled,c,x,i.id,b.layoutVertexBuffer,d,u,i.paint,t.transform.zoom,y)}}function ip(t,e,i,n,r,a,o){let s=t.context,l=s.gl,c="fill-extrusion-pattern",d=i.paint.get(c),u=d.constantOr(1),h=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),m=d.constantOr(null);for(let d of n){let n=e.getTile(d),f=n.getBucket(i);if(!f)continue;let g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(d),_=f.programConfigurations.get(i.id),b=t.useProgram(u?"fillExtrusionPattern":"fillExtrusion",_);u&&(t.context.activeTexture.set(l.TEXTURE0),n.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),_.updatePaintBuffers(h)),iu(_,c,m,n,i);let y=t.translatePosMatrix(d.posMatrix,n,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),v=i.paint.get("fill-extrusion-vertical-gradient"),x=u?et(y,t,v,p,d,h,n):t9(y,t,v,p);b.draw(s,s.gl.TRIANGLES,r,a,o,io.backCCW,x,g,i.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,i.paint,t.transform.zoom,_,t.style.map.terrain&&f.centroidVertexBuffer)}}let im=new e.aO(1,0,0,1),ig=new e.aO(0,1,0,1),i_=new e.aO(0,0,1,1),ib=new e.aO(1,0,1,1),iy=new e.aO(0,1,1,1);function iv(t,e,i,n){iw(t,0,e+i/2,t.transform.width,i,n)}function ix(t,e,i,n){iw(t,e-i/2,0,i,t.transform.height,n)}function iw(t,e,i,n,r,a){let o=t.context,s=o.gl;s.enable(s.SCISSOR_TEST),s.scissor(e*t.pixelRatio,i*t.pixelRatio,n*t.pixelRatio,r*t.pixelRatio),o.clear({color:a}),s.disable(s.SCISSOR_TEST)}function ik(t,e,i){let n=t.context,r=n.gl,a=t.colorModeForRenderPass(),o=new ir(r.LEQUAL,ir.ReadWrite,t.depthRangeFor3D),s=t.useProgram("terrain"),l=e.getTerrainMesh();for(let c of(n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height]),i)){let i=t.renderToTexture.getTexture(c),d=e.getTerrainData(c.tileID);n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,i.texture);let u={u_matrix:t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),u_texture:0,u_ele_delta:e.getMeshFrameDelta(t.transform.zoom)};s.draw(n,r.TRIANGLES,o,ia.disabled,a,io.backCCW,u,d,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class iE{constructor(t,i){this.context=new ii(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=tu.maxUnderzooming+tu.maxOverzooming+1,this.depthEpsilon=1/65536,this.crossTileSymbolIndex=new tK}resize(t,e,i){if(this.width=Math.floor(t*i),this.height=Math.floor(e*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,i=new e.aV;i.emplaceBack(0,0),i.emplaceBack(e.W,0),i.emplaceBack(0,e.W),i.emplaceBack(e.W,e.W),this.tileExtentBuffer=t.createVertexBuffer(i,t1.members),this.tileExtentSegments=e.$.simpleSegment(0,0,4,2);let n=new e.aV;n.emplaceBack(0,0),n.emplaceBack(e.W,0),n.emplaceBack(0,e.W),n.emplaceBack(e.W,e.W),this.debugBuffer=t.createVertexBuffer(n,t1.members),this.debugSegments=e.$.simpleSegment(0,0,4,5);let r=new e.Z;r.emplaceBack(0,0,0,0),r.emplaceBack(e.W,0,e.W,0),r.emplaceBack(0,e.W,0,e.W),r.emplaceBack(e.W,e.W,e.W,e.W),this.rasterBoundsBuffer=t.createVertexBuffer(r,J.members),this.rasterBoundsSegments=e.$.simpleSegment(0,0,4,2);let a=new e.aV;a.emplaceBack(0,0),a.emplaceBack(1,0),a.emplaceBack(0,1),a.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(a,t1.members),this.viewportSegments=e.$.simpleSegment(0,0,4,2);let o=new e.aW;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(o);let s=new e.aX;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s);let l=this.context.gl;this.stencilClearMode=new ia({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){let t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let n=e.F();e.aN(n,0,this.width,this.height,0,0,1),e.J(n,n,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,i.TRIANGLES,ir.disabled,this.stencilClearMode,ie.disabled,io.disabled,el(n),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;let i=this.context,n=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(ie.disabled),i.setDepthMode(ir.disabled);let r=this.useProgram("clippingMask");for(let t of(this._tileClippingMaskIDs={},e)){let e=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,a=this.style.map.terrain&&this.style.map.terrain.getTerrainData(t);r.draw(i,n.TRIANGLES,ir.disabled,new ia({func:n.ALWAYS,mask:0},e,255,n.KEEP,n.KEEP,n.REPLACE),ie.disabled,io.disabled,el(t.posMatrix),a,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let t=this.nextStencilID++,e=this.context.gl;return new ia({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){let e=this.context.gl;return new ia({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){let e=this.context.gl,i=t.sort((t,e)=>e.overscaledZ-t.overscaledZ),n=i[i.length-1].overscaledZ,r=i[0].overscaledZ-n+1;if(r>1){this.currentStencilSource=void 0,this.nextStencilID+r>256&&this.clearStencil();let t={};for(let i=0;i<r;i++)t[i+n]=new ia({func:e.GEQUAL,mask:255},i+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=r,[t,i]}return[{[n]:ia.disabled},i]}colorModeForRenderPass(){let t=this.context.gl;if(this._showOverdrawInspector){let i=1/8;return new ie([t.CONSTANT_COLOR,t.ONE],new e.aO(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?ie.unblended:ie.alphaBlended}depthModeForSublayer(t,e,i){if(!this.opaquePassEnabledForLayer())return ir.disabled;let n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new ir(i||this.context.gl.LEQUAL,e,[n,n])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(u.now()),this.imageManager.beginFrame();let n=this.style._order,r=this.style.sourceCaches,a={},o={},s={};for(let t in r){let e=r[t];e.used&&e.prepare(this.context),a[t]=e.getVisibleCoordinates(),o[t]=a[t].slice().reverse(),s[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<n.length;t++)if(this.style._layers[n[t]].is3D()){this.opaquePassCutoff=t;break}for(let t of(this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen",n)){let e=this.style._layers[t];if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;let i=o[e.source];("custom"===e.type||i.length)&&this.renderLayer(this,r[e.source],e,i)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?e.aO.black:e.aO.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=n.length-1;this.currentLayer>=0;this.currentLayer--){let t=this.style._layers[n[this.currentLayer]],e=r[t.source],i=a[t.source];this._renderTileClippingMasks(t,i),this.renderLayer(this,e,t,i)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<n.length;this.currentLayer++){let t=this.style._layers[n[this.currentLayer]],e=r[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t))continue;let i=("symbol"===t.type?s:o)[t.source];this._renderTileClippingMasks(t,a[t.source]),this.renderLayer(this,e,t,i)}if(this.options.showTileBoundaries){let t=function(t,e){let i=null,n=Object.values(t._layers).flatMap(i=>i.source&&!i.isHidden(e)?[t.sourceCaches[i.source]]:[]),r=n.filter(t=>"vector"===t.getSource().type),a=n.filter(t=>"vector"!==t.getSource().type),o=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};return r.forEach(t=>o(t)),i||a.forEach(t=>o(t)),i}(this.style,this.transform.zoom);t&&function(t,i,n){for(let r=0;r<n.length;r++)!function(t,i,n){let r=t.context,a=r.gl,o=n.posMatrix,s=t.useProgram("debug"),l=ir.disabled,c=ia.disabled,d=t.colorModeForRenderPass(),u="$debug",h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(n);r.activeTexture.set(a.TEXTURE0);let p=i.getTileByID(n.key).latestRawTileData,m=Math.floor((p&&p.byteLength||0)/1024),f=512/Math.min(i.getTile(n).tileSize,512)*(n.overscaledZ/t.transform.zoom)*.5,g=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(g+=` => ${n.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();let i=t.debugOverlayCanvas,n=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(t,`${g} ${m}kB`),s.draw(r,a.TRIANGLES,l,c,ie.alphaBlended,io.disabled,es(o,e.aO.transparent,f),null,u,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(r,a.LINE_STRIP,l,c,d,io.disabled,es(o,e.aO.red),h,u,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}(t,i,n[r])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){var e,i;let n=t.transform.padding;iv(t,t.transform.height-(n.top||0),3,im),iv(t,n.bottom||0,3,ig),ix(t,n.left||0,3,i_),ix(t,t.transform.width-(n.right||0),3,ib);let r=t.transform.centerPoint;e=r.x,i=t.transform.height-r.y,iw(t,e-1,i-10,2,20,iy),iw(t,e-10,i-1,20,2,iy)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;let i=this.terrainFacilitator.matrix,n=this.transform.projMatrix,r=this.terrainFacilitator.dirty;r||(r=t?!e.aY(i,n):!e.aZ(i,n)),r||(r=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),r&&(e.a_(i,n),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,i){let n=t.context,r=n.gl,a=ie.unblended,o=new ir(r.LEQUAL,ir.ReadWrite,[0,1]),s=i.getTerrainMesh(),l=i.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");for(let d of(n.bindFramebuffer.set(i.getFramebuffer("depth").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aO.transparent,depth:1}),l)){let e=i.getTerrainData(d.tileID),l={u_matrix:t.transform.calculatePosMatrix(d.tileID.toUnwrapped()),u_ele_delta:i.getMeshFrameDelta(t.transform.zoom)};c.draw(n,r.TRIANGLES,o,ia.disabled,a,io.backCCW,l,e,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,i){let n=t.context,r=n.gl,a=ie.unblended,o=new ir(r.LEQUAL,ir.ReadWrite,[0,1]),s=i.getTerrainMesh(),l=i.getCoordsTexture(),c=i.sourceCache.getRenderableTiles(),d=t.useProgram("terrainCoords");for(let u of(n.bindFramebuffer.set(i.getFramebuffer("coords").framebuffer),n.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),n.clear({color:e.aO.transparent,depth:1}),i.coordsIndex=[],c)){let e=i.getTerrainData(u.tileID);n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,l.texture);let c={u_matrix:t.transform.calculatePosMatrix(u.tileID.toUnwrapped()),u_terrain_coords_id:(255-i.coordsIndex.length)/255,u_texture:0,u_ele_delta:i.getMeshFrameDelta(t.transform.zoom)};d.draw(n,r.TRIANGLES,o,ia.disabled,a,io.backCCW,c,e,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),i.coordsIndex.push(u.tileID.key)}n.bindFramebuffer.set(null),n.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,i,n,r){if(!n.isHidden(this.transform.zoom)&&("background"===n.type||"custom"===n.type||(r||[]).length))switch(this.id=n.id,n.type){case"symbol":!function(t,i,n,r,a){if("translucent"!==t.renderPass)return;let o=ia.disabled,s=t.colorModeForRenderPass();(n._unevaluatedLayout.hasValue("text-variable-anchor")||n._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,n,r,a,o,s){let l=i.transform,c="map"===a,d="map"===o;for(let a of t){let t=r.getTile(a),o=t.getBucket(n);if(!o||!o.text||!o.text.segments.get().length)continue;let u=e.ag(o.textSizeData,l.zoom),h=tM(t,1,i.transform.zoom),p=t_(a.posMatrix,d,c,i.transform,h),m="none"!==n.layout.get("icon-text-fit")&&o.hasIconData();if(u){let n=Math.pow(2,l.zoom-t.tileID.overscaledZ);!function(t,i,n,r,a,o,s,l,c,d,u){let h=t.text.placedSymbolArray,p=t.text.dynamicLayoutVertexArray,m=t.icon.dynamicLayoutVertexArray,f={};p.clear();for(let m=0;m<h.length;m++){let g=h.get(m),_=g.hidden||!g.crossTileID||t.allowVerticalPlacement&&!g.placedOrientation?null:r[g.crossTileID];if(_){let r=new e.P(g.anchorX,g.anchorY),h=ty(r,n?s:o,u),m=tv(a.cameraToCenterDistance,h.signedDistanceFromCamera),b=e.ai(t.textSizeData,c,g)*m/e.ao;n&&(b*=t.tilePixelRatio/l);let{width:y,height:v,anchor:x,textOffset:w,textBoxScale:k}=_,E=function(t,i,n,r,a,o){let{horizontalAlign:s,verticalAlign:l}=e.at(t);return new e.P((-(s-.5)*i/a+r[0])*o,(-(l-.5)*n/a+r[1])*o)}(x,y,v,w,k,b),C=n?ty(r.add(E),o,u).point:h.point.add(i?E.rotate(-a.angle):E),A=t.allowVerticalPlacement&&g.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let t=0;t<g.numGlyphs;t++)e.aj(p,C,A);d&&g.associatedIconIndex>=0&&(f[g.associatedIconIndex]={shiftedAnchor:C,angle:A})}else tS(g.numGlyphs,p)}if(d){m.clear();let i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){let n=i.get(t);if(n.hidden)tS(n.numGlyphs,m);else{let i=f[t];if(i)for(let t=0;t<n.numGlyphs;t++)e.aj(m,i.shiftedAnchor,i.angle);else tS(n.numGlyphs,m)}}t.icon.dynamicLayoutVertexBuffer.updateData(m)}t.text.dynamicLayoutVertexBuffer.updateData(p)}(o,c,d,s,l,p,a.posMatrix,n,u,m,i.style.map.terrain?(t,e)=>i.style.map.terrain.getElevation(a,t,e):null)}}}(r,t,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),a),0!==n.paint.get("icon-opacity").constantOr(1)&&ic(t,i,n,r,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),o,s),0!==n.paint.get("text-opacity").constantOr(1)&&ic(t,i,n,r,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),o,s),i.map.showCollisionBoxes&&(is(t,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),is(t,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}(t,i,n,r,this.style.placement.variableOffsets);break;case"circle":!function(t,i,n,r){if("translucent"!==t.renderPass)return;let a=n.paint.get("circle-opacity"),o=n.paint.get("circle-stroke-width"),s=n.paint.get("circle-stroke-opacity"),l=!n.layout.get("circle-sort-key").isConstant();if(0===a.constantOr(1)&&(0===o.constantOr(1)||0===s.constantOr(1)))return;let c=t.context,d=c.gl,u=t.depthModeForSublayer(0,ir.ReadOnly),h=ia.disabled,p=t.colorModeForRenderPass(),m=[];for(let a=0;a<r.length;a++){let o=r[a],s=i.getTile(o),c=s.getBucket(n);if(!c)continue;let d=c.programConfigurations.get(n.id),u=t.useProgram("circle",d),h=c.layoutVertexBuffer,p=c.indexBuffer,f=t.style.map.terrain&&t.style.map.terrain.getTerrainData(o),g={programConfiguration:d,program:u,layoutVertexBuffer:h,indexBuffer:p,uniformValues:ea(t,o,s,n),terrainData:f};if(l)for(let t of c.segments.get())m.push({segments:new e.$([t]),sortKey:t.sortKey,state:g});else m.push({segments:c.segments,sortKey:0,state:g})}for(let e of(l&&m.sort((t,e)=>t.sortKey-e.sortKey),m)){let{programConfiguration:i,program:r,layoutVertexBuffer:a,indexBuffer:o,uniformValues:s,terrainData:l}=e.state;r.draw(c,d.TRIANGLES,u,h,p,io.disabled,s,l,n.id,a,o,e.segments,n.paint,t.transform.zoom,i)}}(t,i,n,r);break;case"heatmap":!function(t,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){let a=t.context,o=a.gl,s=ia.disabled,l=new ie([o.ONE,o.ONE],e.aO.transparent,[!0,!0,!0,!0]);!function(t,e,i){let n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);let r=i.heatmapFbo;if(r)n.bindTexture(n.TEXTURE_2D,r.colorAttachment.get()),t.bindFramebuffer.set(r.framebuffer);else{let a=n.createTexture();n.bindTexture(n.TEXTURE_2D,a),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),r=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1,!1),function(t,e,i,n){var r,a;let o=t.gl,s=null!=(r=t.HALF_FLOAT)?r:o.UNSIGNED_BYTE,l=null!=(a=t.RGBA16F)?a:o.RGBA;o.texImage2D(o.TEXTURE_2D,0,l,e.width/4,e.height/4,0,o.RGBA,s,null),n.colorAttachment.set(i)}(t,e,a,r)}}(a,t,n),a.clear({color:e.aO.transparent});for(let e=0;e<r.length;e++){let c=r[e];if(i.hasRenderableParent(c))continue;let d=i.getTile(c),u=d.getBucket(n);if(!u)continue;let h=u.programConfigurations.get(n.id),p=t.useProgram("heatmap",h),{zoom:m}=t.transform;p.draw(a,o.TRIANGLES,ir.disabled,s,l,io.disabled,ec(c.posMatrix,d,m,n.paint.get("heatmap-intensity")),null,n.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,n.paint,t.transform.zoom,h)}a.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,i){let n=t.context,r=n.gl,a=i.heatmapFbo;if(!a)return;n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,a.colorAttachment.get()),n.activeTexture.set(r.TEXTURE1);let o=i.colorRampTexture;o||(o=i.colorRampTexture=new S(n,i.colorRamp,r.RGBA)),o.bind(r.LINEAR,r.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(n,r.TRIANGLES,ir.disabled,ia.disabled,t.colorModeForRenderPass(),io.disabled,((t,i,n,r)=>{let a=e.F();e.aN(a,0,t.width,t.height,0,0,1);let o=t.context.gl;return{u_matrix:a,u_world:[o.drawingBufferWidth,o.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:i.paint.get("heatmap-opacity")}})(t,i),null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom)}(t,n))}(t,i,n,r);break;case"line":!function(t,i,n,r){if("translucent"!==t.renderPass)return;let a=n.paint.get("line-opacity"),o=n.paint.get("line-width");if(0===a.constantOr(1)||0===o.constantOr(1))return;let s=t.depthModeForSublayer(0,ir.ReadOnly),l=t.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),d=n.paint.get("line-pattern"),u=d.constantOr(1),h=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),m=u?"linePattern":c?"lineSDF":h?"lineGradient":"line",f=t.context,g=f.gl,_=!0;for(let a of r){let r=i.getTile(a);if(u&&!r.patternsLoaded())continue;let o=r.getBucket(n);if(!o)continue;let b=o.programConfigurations.get(n.id),y=t.context.program.get(),v=t.useProgram(m,b),x=_||v.program!==y,w=t.style.map.terrain&&t.style.map.terrain.getTerrainData(a),k=d.constantOr(null);if(k&&r.imageAtlas){let t=r.imageAtlas,e=t.patternPositions[k.to.toString()],i=t.patternPositions[k.from.toString()];e&&i&&b.setConstantPatternPositions(e,i)}let E=w?a:null,C=u?eh(t,r,n,p,E):c?ep(t,r,n,c,p,E):h?eu(t,r,n,o.lineClipsArray.length,E):ed(t,r,n,E);if(u)f.activeTexture.set(g.TEXTURE0),r.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),b.updatePaintBuffers(p);else if(c&&(x||t.lineAtlas.dirty))f.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(f);else if(h){let r=o.gradients[n.id],s=r.texture;if(n.gradientVersion!==r.version){let l=256;if(n.stepInterpolant){let n=i.getSource().maxzoom,r=a.canonical.z===n?Math.ceil(1<<t.transform.maxZoom-a.canonical.z):1;l=e.ac(e.aT(o.maxLineLength/e.W*1024*r),256,f.maxTextureSize)}r.gradient=e.aU({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:r.gradient||void 0,clips:o.lineClipsArray}),r.texture?r.texture.update(r.gradient):r.texture=new S(f,r.gradient,g.RGBA),r.version=n.gradientVersion,s=r.texture}f.activeTexture.set(g.TEXTURE0),s.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}v.draw(f,g.TRIANGLES,s,t.stencilModeForClipping(a),l,io.disabled,C,w,n.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,n.paint,t.transform.zoom,b,o.layoutVertexBuffer2),_=!1}}(t,i,n,r);break;case"fill":!function(t,i,n,r){let a=n.paint.get("fill-color"),o=n.paint.get("fill-opacity");if(0===o.constantOr(1))return;let s=t.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===a.constantOr(e.aO.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){let e=t.depthModeForSublayer(1,"opaque"===t.renderPass?ir.ReadWrite:ir.ReadOnly);ih(t,i,n,r,e,s,!1)}if("translucent"===t.renderPass&&n.paint.get("fill-antialias")){let e=t.depthModeForSublayer(2*!!n.getPaintProperty("fill-outline-color"),ir.ReadOnly);ih(t,i,n,r,e,s,!0)}}(t,i,n,r);break;case"fill-extrusion":let a=n.paint.get("fill-extrusion-opacity");if(0!==a&&"translucent"===t.renderPass){let e=new ir(t.context.gl.LEQUAL,ir.ReadWrite,t.depthRangeFor3D);if(1!==a||n.paint.get("fill-extrusion-pattern").constantOr(1))ip(t,i,n,r,e,ia.disabled,ie.disabled),ip(t,i,n,r,e,t.stencilModeFor3D(),t.colorModeForRenderPass());else{let a=t.colorModeForRenderPass();ip(t,i,n,r,e,ia.disabled,a)}}break;case"hillshade":!function(t,i,n,r){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;let a=t.context,o=t.depthModeForSublayer(0,ir.ReadOnly),s=t.colorModeForRenderPass(),[l,c]="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r];for(let r of c){let a=i.getTile(r);void 0!==a.needsHillshadePrepare&&a.needsHillshadePrepare&&"offscreen"===t.renderPass?function(t,i,n,r,a,o){let s=t.context,l=s.gl,c=i.dem;if(c&&c.data){let d=c.dim,u=c.stride,h=c.getPixels();if(s.activeTexture.set(l.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(u),i.demTexture){let t=i.demTexture;t.update(h,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else i.demTexture=new S(s,h,l.RGBA,{premultiply:!1}),i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);s.activeTexture.set(l.TEXTURE0);let p=i.fbo;if(!p){let t=new S(s,{width:d,height:d,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),(p=i.fbo=s.createFramebuffer(d,d,!0,!1)).colorAttachment.set(t.texture)}s.bindFramebuffer.set(p.framebuffer),s.viewport.set([0,0,d,d]),t.useProgram("hillshadePrepare").draw(s,l.TRIANGLES,r,a,o,io.disabled,((t,i)=>{let n=i.stride,r=e.F();return e.aN(r,0,e.W,-e.W,0,0,1),e.H(r,r,[0,-e.W,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}})(i.tileID,c),null,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),i.needsHillshadePrepare=!1}}(t,a,n,o,ia.disabled,s):"translucent"===t.renderPass&&function(t,i,n,r,a,o,s){let l=t.context,c=l.gl,d=n.fbo;if(!d)return;let u=t.useProgram("hillshade"),h=t.style.map.terrain&&t.style.map.terrain.getTerrainData(i);l.activeTexture.set(c.TEXTURE0),c.bindTexture(c.TEXTURE_2D,d.colorAttachment.get()),u.draw(l,c.TRIANGLES,a,o,s,io.disabled,((t,i,n,r)=>{let a=n.paint.get("hillshade-shadow-color"),o=n.paint.get("hillshade-highlight-color"),s=n.paint.get("hillshade-accent-color"),l=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===n.paint.get("hillshade-illumination-anchor")&&(l-=t.transform.angle);let c=!t.options.moving;return{u_matrix:r?r.posMatrix:t.transform.calculatePosMatrix(i.tileID.toUnwrapped(),c),u_image:0,u_latrange:function(t,i){let n=Math.pow(2,i.canonical.z),r=i.canonical.y;return[new e.Y(0,r/n).toLngLat().lat,new e.Y(0,(r+1)/n).toLngLat().lat]}(0,i.tileID),u_light:[n.paint.get("hillshade-exaggeration"),l],u_shadow:a,u_highlight:o,u_accent:s}})(t,n,r,h?i:null),h,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}(t,r,a,n,o,l[r.overscaledZ],s)}a.viewport.set([0,0,t.width,t.height])}(t,i,n,r);break;case"raster":!function(t,i,n,r){if("translucent"!==t.renderPass||0===n.paint.get("raster-opacity")||!r.length)return;let a=t.context,o=a.gl,s=i.getSource(),l=t.useProgram("raster"),c=t.colorModeForRenderPass(),[d,h]=s instanceof Q?[{},r]:t.stencilConfigForOverlap(r),p=h[h.length-1].overscaledZ,m=!t.options.moving;for(let r of h){let h,f,g=t.depthModeForSublayer(r.overscaledZ-p,1===n.paint.get("raster-opacity")?ir.ReadWrite:ir.ReadOnly,o.LESS),_=i.getTile(r);_.registerFadeDuration(n.paint.get("raster-fade-duration"));let b=i.findLoadedParent(r,0),y=function(t,i,n,r,a,o){let s=r.paint.get("raster-fade-duration");if(!o&&s>0){let r=u.now(),o=(r-t.timeAdded)/s,l=i?(r-i.timeAdded)/s:-1,c=n.getSource(),d=a.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!i||Math.abs(i.tileID.overscaledZ-d)>Math.abs(t.tileID.overscaledZ-d),p=h&&t.refreshedUponExpiration?1:e.ac(h?o:1-l,0,1);return t.refreshedUponExpiration&&o>=1&&(t.refreshedUponExpiration=!1),i?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}(_,b,i,n,t.transform,t.style.map.terrain),v="nearest"===n.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;a.activeTexture.set(o.TEXTURE0),_.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),a.activeTexture.set(o.TEXTURE1),b?(b.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),h=Math.pow(2,b.tileID.overscaledZ-_.tileID.overscaledZ),f=[_.tileID.canonical.x*h%1,_.tileID.canonical.y*h%1]):_.texture.bind(v,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);let x=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r),w=x?r:null,k=eg(w?w.posMatrix:t.transform.calculatePosMatrix(r.toUnwrapped(),m),f||[0,0],h||1,y,n);s instanceof Q?l.draw(a,o.TRIANGLES,g,ia.disabled,c,io.disabled,k,x,n.id,s.boundsBuffer,t.quadTriangleIndexBuffer,s.boundsSegments):l.draw(a,o.TRIANGLES,g,d[r.overscaledZ],c,io.disabled,k,x,n.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,i,n,r);break;case"background":!function(t,e,i,n){let r=i.paint.get("background-color"),a=i.paint.get("background-opacity");if(0===a)return;let o=t.context,s=o.gl,l=t.transform,c=l.tileSize,d=i.paint.get("background-pattern");if(t.isPatternMissing(d))return;let u=!d&&1===r.a&&1===a&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==u)return;let h=ia.disabled,p=t.depthModeForSublayer(0,"opaque"===u?ir.ReadWrite:ir.ReadOnly),m=t.colorModeForRenderPass(),f=t.useProgram(d?"backgroundPattern":"background"),g=n||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});d&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));let _=i.getCrossfadeParameters();for(let e of g){let l=n?e.posMatrix:t.transform.calculatePosMatrix(e.toUnwrapped()),u=d?ex(l,a,t,d,{tileID:e,tileSize:c},_):ev(l,a,r),g=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);f.draw(o,s.TRIANGLES,p,h,m,io.disabled,u,g,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,n,r);break;case"custom":let o=t.context,s=n.implementation;if("offscreen"===t.renderPass){let e=s.prerender;e&&(t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),e.call(s,o.gl,t.transform.customLayerMatrix()),o.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),o.setColorMode(t.colorModeForRenderPass()),o.setStencilMode(ia.disabled);let e="3d"===s.renderingMode?new ir(t.context.gl.LEQUAL,ir.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,ir.ReadOnly);o.setDepthMode(e),s.render(o.gl,t.transform.customLayerMatrix()),o.setDirty(),t.setBaseState(),o.bindFramebuffer.set(null)}}}translatePosMatrix(t,i,n,r,a){if(!n[0]&&!n[1])return t;let o=a?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(o){let t=Math.sin(o),e=Math.cos(o);n=[n[0]*e-n[1]*t,n[0]*t+n[1]*e]}let s=[a?n[0]:tM(i,n[0],this.transform.zoom),a?n[1]:tM(i,n[1],this.transform.zoom),0],l=new Float32Array(16);return e.H(l,t,s),l}saveTileTexture(t){let e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){let e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;let e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}useProgram(t,e){this.cache=this.cache||{};let i=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[i]||(this.cache[i]=new t7(this.context,t5[t],e,ew[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[i]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){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(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new S(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class iC{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,i,n){let r=Math.pow(2,n),a=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(n=>{let a=1/(n=e.af([],n,t))[3]/i*r;return e.a$(n,n,[a,a,1/n[3],a])}),o=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(t=>{var e,i,n,r,o,s,l,c,d,u,h,p,m,f,g,_;let b=(h=[],m=(i=[],n=A([],a[t[0]],a[t[1]]),r=A([],a[t[2]],a[t[1]]),o=n[0],s=n[1],l=n[2],c=r[0],d=r[1],u=r[2],i[0]=s*u-l*d,i[1]=l*c-o*u,i[2]=o*d-s*c,p=i)[0],(_=m*m+(f=p[1])*f+(g=p[2])*g)>0&&(_=1/Math.sqrt(_)),h[0]=p[0]*_,h[1]=p[1]*_,h[2]=p[2]*_,h),y=-(b[0]*(e=a[t[1]])[0]+b[1]*e[1]+b[2]*e[2]);return b.concat(y)});return new iC(a,o)}}class iA{constructor(t,e){this.min=t,this.max=e,this.center=function(t,e,i){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}([],this.min,this.max))}quadrant(t){let e=[t%2==0,t<2],i=x(this.min),n=x(this.max);for(let t=0;t<e.length;t++)i[t]=e[t]?this.min[t]:this.center[t],n[t]=e[t]?this.center[t]:this.max[t];return n[2]=this.max[2],new iA(i,n)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){let i=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]],n=!0;for(let r=0;r<t.planes.length;r++){let a=t.planes[r],o=0;for(let t=0;t<i.length;t++)e.b0(a,i[t])>=0&&o++;if(0===o)return 0;o!==i.length&&(n=!1)}if(n)return 2;for(let e=0;e<3;e++){let i=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let r=0;r<t.points.length;r++){let a=t.points[r][e]-this.min[e];i=Math.min(i,a),n=Math.max(n,a)}if(n<0||i>this.max[e]-this.min[e])return 0}return 1}}class iT{constructor(t=0,e=0,i=0,n=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(n)||n<0)throw Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=n}interpolate(t,i,n){return null!=i.top&&null!=t.top&&(this.top=e.z.number(t.top,i.top,n)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.z.number(t.bottom,i.bottom,n)),null!=i.left&&null!=t.left&&(this.left=e.z.number(t.left,i.left,n)),null!=i.right&&null!=t.right&&(this.right=e.z.number(t.right,i.right,n)),this}getCenter(t,i){let n=e.ac((this.left+t-this.right)/2,0,t),r=e.ac((this.top+i-this.bottom)/2,0,i);return new e.P(n,r)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new iT(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class iI{constructor(t,i,n,r,a){this.tileSize=512,this._renderWorldCopies=void 0===a||!!a,this._minZoom=t||0,this._maxZoom=i||22,this._minPitch=null==n?0:n,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.M(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new iT,this._posMatrixCache={},this._alignedPosMatrixCache={},this.minElevationForCurrentTile=0}clone(){let t=new iI(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){var i,n,r,a,o,s,l,c,d,u;let h=-e.b1(t,-180,180)*Math.PI/180;this.angle!==h&&(this._unmodified=!1,this.angle=h,this._calcMatrices(),this.rotationMatrix=(i=new e.A(4),e.A!=Float32Array&&(i[1]=0,i[2]=0),i[0]=1,i[3]=1,i),n=this.rotationMatrix,r=this.rotationMatrix,a=this.angle,o=r[0],s=r[1],l=r[2],c=r[3],d=Math.sin(a),u=Math.cos(a),n[0]=o*u+l*d,n[1]=s*u+c*d,n[2]=-(o*d)+l*u,n[3]=-(s*d)+c*u)}get pitch(){return this._pitch/Math.PI*180}set pitch(t){let i=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){let e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){return Math.max(0,(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize)))}getVisibleUnwrappedCoordinates(t){let i=[new e.b2(0,t)];if(this._renderWorldCopies){let n=this.pointCoordinate(new e.P(0,0)),r=this.pointCoordinate(new e.P(this.width,0)),a=this.pointCoordinate(new e.P(this.width,this.height)),o=this.pointCoordinate(new e.P(0,this.height)),s=Math.floor(Math.min(n.x,r.x,a.x,o.x)),l=Math.floor(Math.max(n.x,r.x,a.x,o.x));for(let n=s-1;n<=l+1;n++)0!==n&&i.push(new e.b2(n,t))}return i}coveringTiles(t){var i,n;let r=this.coveringZoomLevel(t),a=r;if(void 0!==t.minzoom&&r<t.minzoom)return[];void 0!==t.maxzoom&&r>t.maxzoom&&(r=t.maxzoom);let o=this.pointCoordinate(this.getCameraPoint()),s=e.Y.fromLngLat(this.center),l=Math.pow(2,r),c=[l*o.x,l*o.y,0],d=[l*s.x,l*s.y,0],u=iC.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),h=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(h=r);let p=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,m=t=>({aabb:new iA([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),f=[],g=[],_=r,b=t.reparseOverscaled?a:r;if(this._renderWorldCopies)for(let t=1;t<=3;t++)f.push(m(-t)),f.push(m(t));for(f.push(m(0));f.length>0;){let r=f.pop(),a=r.x,o=r.y,s=r.fullyVisible;if(!s){let t=r.aabb.intersects(u);if(0===t)continue;s=2===t}let l=t.terrain?c:d,m=Math.max(Math.abs(r.aabb.distanceX(l)),Math.abs(r.aabb.distanceY(l)));if(r.zoom===_||m>p+(1<<_-r.zoom)-2&&r.zoom>=h){let t=_-r.zoom,i=c[0]-.5-(a<<t),n=c[1]-.5-(o<<t);g.push({tileID:new e.Q(r.zoom===_?b:r.zoom,r.wrap,r.zoom,a,o),distanceSq:T([d[0]-.5-a,d[1]-.5-o]),tileDistanceToCamera:Math.sqrt(i*i+n*n)})}else for(let l=0;l<4;l++){let c=(a<<1)+l%2,d=(o<<1)+(l>>1),u=r.zoom+1,h=r.aabb.quadrant(l);if(t.terrain){let a=new e.Q(u,r.wrap,u,c,d),o=t.terrain.getMinMaxElevation(a),s=null!=(i=o.minElevation)?i:this.elevation,l=null!=(n=o.maxElevation)?n:this.elevation;h=new iA([h.min[0],h.min[1],s],[h.max[0],h.max[1],l])}f.push({aabb:h,zoom:u,x:c,y:d,wrap:r.wrap,fullyVisible:s})}}return g.sort((t,e)=>t.distanceSq-e.distanceSq).map(t=>t.tileID)}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){let i=e.ac(t.lat,-85.051129,85.051129);return new e.P(e.N(t.lng)*this.worldSize,e.O(i)*this.worldSize)}unproject(t){return new e.Y(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){let i=this.elevation,n=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,r=this.pointLocation(this.centerPoint,t),a=t.getElevationForLngLatZoom(r,this.tileZoom);if(!(this.elevation-a))return;let o=Math.cos(this._pitch)*this.cameraToCenterDistance/(n+i-a)/e.b3(1,r.lat),s=this.scaleZoom(o/this.tileSize);this._elevation=a,this._center=r,this.zoom=s}setLocationAtPoint(t,i){let n=this.pointCoordinate(i),r=this.pointCoordinate(this.centerPoint),a=this.locationCoordinate(t),o=new e.Y(a.x-(n.x-r.x),a.y-(n.y-r.y));this.center=this.coordinateLocation(o),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Y.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,i){if(i){let e=i.pointCoordinate(t);if(null!=e)return e}let n=[t.x,t.y,0,1],r=[t.x,t.y,1,1];e.af(n,n,this.pixelMatrixInverse),e.af(r,r,this.pixelMatrixInverse);let a=n[3],o=r[3],s=n[1]/a,l=r[1]/o,c=n[2]/a,d=r[2]/o,u=c===d?0:(0-c)/(d-c);return new e.Y(e.z.number(n[0]/a,r[0]/o,u)/this.worldSize,e.z.number(s,l,u)/this.worldSize)}coordinatePoint(t,i=0,n=this.pixelMatrix){let r=[t.x*this.worldSize,t.y*this.worldSize,i,1];return e.af(r,r,n),new e.P(r[0]/r[3],r[1]/r[3])}getBounds(){let t=Math.max(0,this.height/2-this.getHorizon());return(new G).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new G([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,85.051129])}calculatePosMatrix(t,i=!1){let n=t.key,r=i?this._alignedPosMatrixCache:this._posMatrixCache;if(r[n])return r[n];let a=t.canonical,o=this.worldSize/this.zoomScale(a.z),s=a.x+Math.pow(2,a.z)*t.wrap,l=e.an(new Float64Array(16));return e.H(l,l,[s*o,a.y*o,0]),e.J(l,l,[o/e.W,o/e.W,1]),e.K(l,i?this.alignedProjMatrix:this.projMatrix,l),r[n]=new Float32Array(l),r[n]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,i){let n,r;i=e.ac(+i,this.minZoom,this.maxZoom);let a={center:new e.M(t.lng,t.lat),zoom:i},o=this.lngRange;this._renderWorldCopies||null!==o||(o=[-(180-1e-10),180-1e-10]);let s=this.tileSize*this.zoomScale(a.zoom),l=0,c=s,d=0,u=s,h=0,p=0,{x:m,y:f}=this.size;if(this.latRange){let t=this.latRange;l=e.O(t[1])*s,(c=e.O(t[0])*s)-l<f&&(h=f/(c-l))}o&&(d=e.b1(e.N(o[0])*s,0,s),(u=e.b1(e.N(o[1])*s,0,s))<d&&(u+=s),u-d<m&&(p=m/(u-d)));let{x:g,y:_}=this.project.call({worldSize:s},t),b=Math.max(p||0,h||0);if(b){let t=new e.P(p?(u+d)/2:g,h?(c+l)/2:_);return a.center=this.unproject.call({worldSize:s},t).wrap(),a.zoom+=this.scaleZoom(b),a}if(this.latRange){let t=f/2;_-t<l&&(r=l+t),_+t>c&&(r=c-t)}if(o){let t=(d+u)/2,i=g;this._renderWorldCopies&&(i=e.b1(g,t-s/2,t+s/2));let r=m/2;i-r<d&&(n=d+r),i+r>u&&(n=u-r)}if(void 0!==n||void 0!==r){let t=new e.P(null!=n?n:g,null!=r?r:_);a.center=this.unproject.call({worldSize:s},t).wrap()}return a}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t=this._unmodified,{center:e,zoom:i}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=i,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;let t=this.centerOffset,i=this.point.x,n=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b3(1,this.center.lat)*this.worldSize;let r=e.an(new Float64Array(16));e.J(r,r,[this.width/2,-this.height/2,1]),e.H(r,r,[1,-1,0]),this.labelPlaneMatrix=r,r=e.an(new Float64Array(16)),e.J(r,r,[1,-1,1]),e.H(r,r,[-1,-1,0]),e.J(r,r,[2/this.width,2/this.height,1]),this.glCoordMatrix=r;let a=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),o=Math.min(this.elevation,this.minElevationForCurrentTile),s=a-o*this._pixelPerMeter/Math.cos(this._pitch),l=o<0?s:a,c=Math.PI/2+this._pitch,d=this._fov*(.5+t.y/this.height),u=Math.sin(d)*l/Math.sin(e.ac(Math.PI-c-d,.01,Math.PI-.01)),h=this.getHorizon(),p=2*Math.atan(h/this.cameraToCenterDistance)*(.5+t.y/(2*h)),m=Math.min(u,Math.sin(p)*l/Math.sin(e.ac(Math.PI-c-p,.01,Math.PI-.01))),f=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),g=this.height/50;r=new Float64Array(16),e.b4(r,this._fov,this.width/this.height,g,f),r[8]=-(2*t.x)/this.width,r[9]=2*t.y/this.height,e.J(r,r,[1,-1,1]),e.H(r,r,[0,0,-this.cameraToCenterDistance]),e.b5(r,r,this._pitch),e.ad(r,r,this.angle),e.H(r,r,[-i,-n,0]),this.mercatorMatrix=e.J([],r,[this.worldSize,this.worldSize,this.worldSize]),e.J(r,r,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.K(new Float64Array(16),this.labelPlaneMatrix,r),e.H(r,r,[0,0,-this.elevation]),this.projMatrix=r,this.invProjMatrix=e.ar([],r),this.pixelMatrix3D=e.K(new Float64Array(16),this.labelPlaneMatrix,r);let _=this.width%2/2,b=this.height%2/2,y=Math.cos(this.angle),v=Math.sin(this.angle),x=i-Math.round(i)+y*_+v*b,w=n-Math.round(n)+y*b+v*_,k=new Float64Array(r);if(e.H(k,k,[x>.5?x-1:x,w>.5?w-1:w,0]),this.alignedProjMatrix=k,!(r=e.ar(new Float64Array(16),this.pixelMatrix)))throw Error("failed to invert matrix");this.pixelMatrixInverse=r,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;let t=this.pointCoordinate(new e.P(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){let t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){let i=this.getCameraPoint();if(1===t.length)return[t[0],i];{let n=i.x,r=i.y,a=i.x,o=i.y;for(let e of t)n=Math.min(n,e.x),r=Math.min(r,e.y),a=Math.max(a,e.x),o=Math.max(o,e.y);return[new e.P(n,r),new e.P(a,r),new e.P(a,o),new e.P(n,o),new e.P(n,r)]}}lngLatToCameraDepth(t,i){let n=this.locationCoordinate(t),r=[n.x*this.worldSize,n.y*this.worldSize,i,1];return e.af(r,r,this.projMatrix),r[2]/r[3]}}function iS(t,e){let i,n=!1,r=null,a=null,o=()=>{r=null,n&&(t.apply(a,i),r=setTimeout(o,e),n=!1)};return(...t)=>(n=!0,a=this,i=t,r||o(),r)}class iz{constructor(t){this._getCurrentHash=()=>{let t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map(t=>t.split("=")).forEach(t=>{t[0]===this._hashName&&(e=t)}),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{let t=this._getCurrentHash();if(t.length>=3&&!t.some(t=>isNaN(t))){let e=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:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{let t=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,t)}catch(t){}},this._updateHash=iS(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()),delete this._map,this}getHashString(t){let e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,n=Math.pow(10,Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10)),r=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,o=this._map.getBearing(),s=this._map.getPitch(),l="";if(l+=t?`/${r}/${a}/${i}`:`${i}/${a}/${r}`,(o||s)&&(l+="/"+Math.round(10*o)/10),s&&(l+=`/${Math.round(s)}`),this._hashName){let t=this._hashName,e=!1,i=window.location.hash.slice(1).split("&").map(i=>{let n=i.split("=")[0];return n===t?(e=!0,`${n}=${l}`):i}).filter(t=>t);return e||i.push(`${t}=${l}`),`#${i.join("&")}`}return`#${l}`}}let iL={linearity:.3,easing:e.b6(0,0,.3,1)},iM=e.e({deceleration:2500,maxSpeed:1400},iL),iP=e.e({deceleration:20,maxSpeed:1400},iL),iR=e.e({deceleration:1e3,maxSpeed:360},iL),iO=e.e({deceleration:1e3,maxSpeed:90},iL);class iD{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:u.now(),settings:t})}_drainInertiaBuffer(){let t=this._inertiaBuffer,e=u.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);let n=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,r={};if(i.pan.mag()){let a=iF(i.pan.mag(),n,e.e({},iM,t||{}));r.offset=i.pan.mult(a.amount/i.pan.mag()),r.center=this._map.transform.center,iB(r,a)}if(i.zoom){let t=iF(i.zoom,n,iP);r.zoom=this._map.transform.zoom+t.amount,iB(r,t)}if(i.bearing){let t=iF(i.bearing,n,iR);r.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),iB(r,t)}if(i.pitch){let t=iF(i.pitch,n,iO);r.pitch=this._map.transform.pitch+t.amount,iB(r,t)}if(r.zoom||r.bearing){let t=void 0===i.pinchAround?i.around:i.pinchAround;r.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(r,{noMoveStart:!0})}}function iB(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function iF(t,i,n){let{maxSpeed:r,linearity:a,deceleration:o}=n,s=e.ac(t*a/(i/1e3),-r,r),l=Math.abs(s)/(o*a);return{easing:n.easing,duration:1e3*l,amount:l/2*s}}class iN extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,n,r={}){let a=h.mousePos(i.getCanvas(),n);super(t,e.e({point:a,lngLat:i.unproject(a),originalEvent:n},r)),this._defaultPrevented=!1,this.target=i}}class iV extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,n){let r="touchend"===t?n.changedTouches:n.touches,a=h.touchPos(i.getCanvasContainer(),r),o=a.map(t=>i.unproject(t)),s=a.reduce((t,e,i,n)=>t.add(e.div(n.length)),new e.P(0,0));super(t,{points:a,point:s,lngLats:o,lngLat:i.unproject(s),originalEvent:n}),this._defaultPrevented=!1}}class iU extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class i${constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new iU(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new iN(t.type,this._map,t))}mouseup(t){this._map.fire(new iN(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new iN(t.type,this._map,t))}dblclick(t){return this._firePreventable(new iN(t.type,this._map,t))}mouseover(t){this._map.fire(new iN(t.type,this._map,t))}mouseout(t){this._map.fire(new iN(t.type,this._map,t))}touchstart(t){return this._firePreventable(new iV(t.type,this._map,t))}touchmove(t){this._map.fire(new iV(t.type,this._map,t))}touchend(t){this._map.fire(new iV(t.type,this._map,t))}touchcancel(t){this._map.fire(new iV(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ij{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new iN(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new iN("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new iN(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class iH{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this._map.terrain)}}class iq{constructor(t,e){this._map=t,this._tr=new iH(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(h.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active||this._lastPos.equals(e)||!this._box&&e.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=e,this._box||(this._box=h.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));let n=Math.min(i.x,e.x),r=Math.max(i.x,e.x),a=Math.min(i.y,e.y),o=Math.max(i.y,e.y);h.setTransform(this._box,`translate(${n}px,${a}px)`),this._box.style.width=r-n+"px",this._box.style.height=o-a+"px"}mouseupWindow(t,i){if(!this._active||0!==t.button)return;let n=this._startPos;if(this.reset(),h.suppressClick(),n.x!==i.x||n.y!==i.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(n,i,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&&(h.remove(this._box),this._box=null),h.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.k(t,{originalEvent:i}))}}function iG(t,e){if(t.length!==e.length)throw Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);let i={};for(let n=0;n<t.length;n++)i[t[n].identifier]=e[n];return i}class iX{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),n.length===this.numTouches&&(this.centroid=function(t){let i=new e.P(0,0);for(let e of t)i._add(e);return i.div(t.length)}(i),this.touches=iG(n,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;let n=iG(i,e);for(let t in this.touches){let e=n[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,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}}}class iZ{constructor(t){this.singleTap=new iX(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){let n=this.singleTap.touchend(t,e,i);if(n){let e=t.timeStamp-this.lastTime<500,i=!this.lastTap||30>this.lastTap.dist(n);if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}}}class iW{constructor(t){this._tr=new iH(t),this._zoomIn=new iZ({numTouches:1,numTaps:2}),this._zoomOut=new iZ({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){let n=this._zoomIn.touchend(t,e,i),r=this._zoomOut.touchend(t,e,i),a=this._tr;return n?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(n)},{originalEvent:t})}):r?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(r)},{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}}class iY{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 e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;let i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);let n=e.length?e[0]:e;return!this._moved&&n.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=n,this._move(i,n))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&h.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 iK={0:1,2:2};class iJ{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){let e=h.mouseButton(t);this._eventButton=e}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){let i=iK[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return h.mouseButton(t)===this._eventButton}}class iQ{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)}}let i0=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=function(t){t.preventDefault()}},i1=({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:i=.8})=>new iY({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*i}),moveStateManager:new iJ({checkCorrectEvent:t=>0===h.mouseButton(t)&&t.ctrlKey||2===h.mouseButton(t)}),enable:t,assignEvents:i0}),i2=({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5})=>new iY({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:new iJ({checkCorrectEvent:t=>0===h.mouseButton(t)&&t.ctrlKey||2===h.mouseButton(t)}),enable:t,assignEvents:i0});class i5{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}minTouchs(){return this._map.cooperativeGestures.isEnabled()?2:1}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active&&!(i.length<this.minTouchs()))return t.preventDefault(),this._calculateTransform(t,e,i)}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&i.length<this.minTouchs()&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,n){n.length>0&&(this._active=!0);let r=iG(n,i),a=new e.P(0,0),o=new e.P(0,0),s=0;for(let t in r){let e=r[t],i=this._touches[t];i&&(a._add(e),o._add(e.sub(i)),s++,r[t]=e)}if(this._touches=r,s<this.minTouchs()||!o.mag())return;let l=o.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class i3{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();let[n,r]=this._firstTwoTouches,a=i4(i,e,n),o=i4(i,e,r);if(!a||!o)return;let s=this._aroundCenter?null:a.add(o).div(2);return this._move([a,o],s,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;let[n,r]=this._firstTwoTouches,a=i4(i,e,n),o=i4(i,e,r);a&&o||(this._active&&h.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 i4(t,e,i){for(let n=0;n<t.length;n++)if(t[n].identifier===i)return e[n]}function i6(t,e){return Math.log(t/e)/Math.LN2}class i7 extends i3{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){let i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(.1>Math.abs(i6(this._distance,this._startDistance))))return this._active=!0,{zoomDelta:i6(this._distance,i),pinchAround:e}}}function i8(t,e){return 180*t.angleWith(e)/Math.PI}class i9 extends i3{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,e,i){let n=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:i8(this._vector,n),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());let e=25/(Math.PI*this._minDiameter)*360;return Math.abs(i8(t,this._startVector))<e}}function nt(t){return Math.abs(t.y)>Math.abs(t.x)}class ne extends i3{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,i){super.touchstart(t,e,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,nt(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let n=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(n,r,i.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:-((n.y+r.y)/2*.5)}):void 0}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;let n=t.mag()>=2,r=e.mag()>=2;if(!n&&!r)return;if(!n||!r)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;let a=t.y>0==e.y>0;return nt(t)&&nt(e)&&a}}let ni=100,nn=15,nr=10;class na{constructor(t){this._tr=new iH(t),this._panStep=ni,this._bearingStep=nn,this._pitchStep=nr,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,n=0,r=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),r=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),r=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(i=0,n=0),{cameraAnimation:o=>{let s=this._tr;o.easeTo({duration:300,easeId:"keyboardHandler",easing:no,zoom:e?Math.round(s.zoom)+e*(t.shiftKey?2:1):s.zoom,bearing:s.bearing+i*this._bearingStep,pitch:s.pitch+n*this._pitchStep,offset:[-r*this._panStep,-a*this._panStep],center:s.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 no(t){return t*(2-t)}class ns{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new iH(t),this._triggerRenderFrame=e,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)}wheel(t){if(!this.isEnabled()||this._map.cooperativeGestures.isEnabled()&&!t[this._map.cooperativeGestures._bypassKey])return;let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY,i=u.now(),n=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%4.000244140625==0?this._type="wheel":0!==e&&4>Math.abs(e)?this._type="trackpad":n>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=200>Math.abs(n*e)?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let i=h.mousePos(this._map.getCanvas(),t),n=this._tr;this._around=i.y>n.transform.height/2-n.transform.getHorizon()?e.M.convert(this._aroundCenter?n.center:n.unproject(i)):e.M.convert(n.center),this._aroundPoint=n.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let t=this._tr.transform;if(0!==this._delta){let e="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==i&&(i=1/i);let n="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(n*i))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let i="number"==typeof this._targetZoom?this._targetZoom:t.zoom,n=this._startZoom,r=this._easing,a,o=!1;if("wheel"===this._type&&n&&r){let t=Math.min((u.now()-this._lastWheelEventTime)/200,1),s=r(t);a=e.z.number(n,i,s),t<1?this._frameId||(this._frameId=!0):o=!0}else a=i,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!o,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.b7;if(this._prevEase){let t=this._prevEase,n=(u.now()-t.start)/t.duration,r=t.easing(n+.01)-t.easing(n),a=.27/Math.sqrt(r*r+1e-4)*.01,o=Math.sqrt(.0729-a*a);i=e.b6(a,o,.25,1)}return this._prevEase={start:u.now(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class nl{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class nc{constructor(t){this._tr=new iH(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nd{constructor(){this._tap=new iZ({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,i){if(!this._swipePoint)if(this._tapTime){let n=e[0],r=t.timeStamp-this._tapTime<500,a=30>this._tapPoint.dist(n);r&&a?i.length>0&&(this._swipePoint=n,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,e,i)}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;let n=e[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{let n=this._tap.touchend(t,e,i);n&&(this._tapTime=t.timeStamp,this._tapPoint=n)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class nu{constructor(t,e,i){this._el=t,this._mousePan=e,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()}}class nh{constructor(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class np{constructor(t,e,i,n){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=n,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()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class nm{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,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=h.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),n=document.createElement("div");n.className="maplibregl-desktop-message",n.textContent=e,this._container.appendChild(n);let r=document.createElement("div");r.className="maplibregl-mobile-message",r.textContent=i,this._container.appendChild(r),this._container.setAttribute("aria-hidden","true")}_destoryUI(){this._container&&(h.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destoryUI()}isEnabled(){return this._enabled}touchmove(t){this._onCooperativeGesture(1===t.touches.length)}wheel(t){this._map.scrollZoom.isEnabled()&&this._onCooperativeGesture(!t[this._bypassKey])}_onCooperativeGesture(t){this._enabled&&t&&(this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}let nf=t=>t.zoom||t.drag||t.pitch||t.rotate;class ng extends e.k{}function n_(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class nb{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;let i="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},r={},a={},o=t.touches,s=o?this._getMapTouches(o):void 0,l=s?h.touchPos(this._map.getCanvas(),s):h.mousePos(this._map.getCanvas(),t);for(let{handlerName:o,handler:c,allowed:d}of this._handlers){let u;c.isEnabled()&&(this._blockedByActive(a,d,o)?c.reset():c[e||t.type]&&(u=c[e||t.type](t,l,s),this.mergeHandlerResult(n,r,u,o,i),u&&u.needsRenderFrame&&this._triggerRenderFrame()),(u||c.isActive())&&(a[o]=c))}let c={};for(let t in this._previousActiveHandlers)a[t]||(c[t]=i);this._previousActiveHandlers=a,(Object.keys(c).length||n_(n))&&(this._changes.push([n,r,c]),this._triggerRenderFrame()),(Object.keys(a).length||n_(n))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:d}=n;d&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],d(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new iD(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);let i=this._el;for(let[t,e,n]of(this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[window,"blur",void 0]],this._listeners))h.addEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,n)}destroy(){for(let[t,e,i]of this._listeners)h.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){let e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new i$(e,t));let n=e.boxZoom=new iq(e,t);this._add("boxZoom",n),t.interactive&&t.boxZoom&&n.enable();let r=e.cooperativeGestures=new nm(e,t.cooperativeGestures);this._add("cooperativeGestures",r),t.cooperativeGestures&&r.enable();let a=new iW(e),o=new nc(e);e.doubleClickZoom=new nl(o,a),this._add("tapZoom",a),this._add("clickZoom",o),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();let s=new nd;this._add("tapDragZoom",s);let l=e.touchPitch=new ne(e);this._add("touchPitch",l),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);let c=i1(t),d=i2(t);e.dragRotate=new nh(t,c,d),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",d,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();let u=(({enable:t,clickTolerance:e})=>new iY({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:new iJ({checkCorrectEvent:t=>0===h.mouseButton(t)&&!t.ctrlKey}),enable:t,assignEvents:i0}))(t),p=new i5(t,e);e.dragPan=new nu(i,u,p),this._add("mousePan",u),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);let m=new i9,f=new i7;e.touchZoomRotate=new np(i,f,m,s),this._add("touchRotate",m,["touchPan","touchZoom"]),this._add("touchZoom",f,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);let g=e.scrollZoom=new ns(e,()=>this._triggerRenderFrame());this._add("scrollZoom",g,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);let _=e.keyboard=new na(e);this._add("keyboard",_),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new ij(e))}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}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!!nf(this._eventsInProgress)||this.isZooming()}_blockedByActive(t,e,i){for(let n in t)if(n!==i&&(!e||0>e.indexOf(n)))return!0;return!1}_getMapTouches(t){let e=[];for(let i of t)this._el.contains(i.target)&&e.push(i);return e}mergeHandlerResult(t,i,n,r,a){if(!n)return;e.e(t,n);let o={handlerName:r,originalEvent:n.originalEvent||a};void 0!==n.zoomDelta&&(i.zoom=o),void 0!==n.panDelta&&(i.drag=o),void 0!==n.pitchDelta&&(i.pitch=o),void 0!==n.bearingDelta&&(i.rotate=o)}_applyChanges(){let t={},i={},n={};for(let[r,a,o]of this._changes)r.panDelta&&(t.panDelta=(t.panDelta||new e.P(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),void 0!==r.around&&(t.around=r.around),void 0!==r.pinchAround&&(t.pinchAround=r.pinchAround),r.noInertia&&(t.noInertia=r.noInertia),e.e(i,a),e.e(n,o);this._updateMapTransform(t,i,n),this._changes=[]}_updateMapTransform(t,e,i){let n=this._map,r=n._getTransformForUpdate(),a=n.terrain;if(!(n_(t)||a&&this._terrainMovement))return this._fireEvents(e,i,!0);let{panDelta:o,zoomDelta:s,bearingDelta:l,pitchDelta:c,around:d,pinchAround:u}=t;void 0!==u&&(d=u),n._stop(!0),d=d||n.transform.centerPoint;let h=r.pointLocation(o?d.sub(o):d);l&&(r.bearing+=l),c&&(r.pitch+=c),s&&(r.zoom+=s),a?!this._terrainMovement&&(e.drag||e.zoom)?(this._terrainMovement=!0,this._map._elevationFreeze=!0,r.setLocationAtPoint(h,d),this._map.once("moveend",()=>{this._map._elevationFreeze=!1,this._terrainMovement=!1,r.recalculateZoom(n.terrain)})):e.drag&&this._terrainMovement?r.center=r.pointLocation(r.centerPoint.sub(o)):r.setLocationAtPoint(h,d):r.setLocationAtPoint(h,d),n._applyUpdatedTransform(r),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)}_fireEvents(t,i,n){let r,a=nf(this._eventsInProgress),o=nf(t),s={};for(let e in t){let{originalEvent:i}=t[e];this._eventsInProgress[e]||(s[`${e}start`]=i),this._eventsInProgress[e]=t[e]}for(let t in!a&&o&&this._fireEvent("movestart",o.originalEvent),s)this._fireEvent(t,s[t]);for(let e in o&&this._fireEvent("move",o.originalEvent),t){let{originalEvent:i}=t[e];this._fireEvent(e,i)}let l={};for(let t in this._eventsInProgress){let{handlerName:e,originalEvent:n}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],r=i[e]||n,l[`${t}end`]=r)}for(let t in l)this._fireEvent(t,l[t]);let c=nf(this._eventsInProgress);if(n&&(a||o)&&!c){this._updatingCamera=!0;let t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;t&&(t.essential||!u.prefersReducedMotion)?(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:r})):(this._map.fire(new e.k("moveend",{originalEvent:r})),i(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.k(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new ng("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class ny extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{let t=Math.min((u.now()-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._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.M(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,i,n){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),n)}panTo(t,i,n){return this.easeTo(e.e({center:t},i),n)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,n){return this.easeTo(e.e({zoom:t},i),n)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,i,n){return this.easeTo(e.e({bearing:t},i),n)}resetNorth(t,i){return this.rotateTo(0,e.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=G.convert(t);let i=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)}_cameraForBoxAndBearing(t,i,n,r){let a={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=e.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){let t=r.padding;r.padding={top:t,bottom:t,right:t,left:t}}r.padding=e.e(a,r.padding);let o=this.transform,s=o.padding,l=new G(t,i),c=o.project(l.getNorthWest()),d=o.project(l.getNorthEast()),u=o.project(l.getSouthEast()),h=o.project(l.getSouthWest()),p=e.b8(-n),m=c.rotate(p),f=d.rotate(p),g=u.rotate(p),_=h.rotate(p),b=new e.P(Math.max(m.x,f.x,_.x,g.x),Math.max(m.y,f.y,_.y,g.y)),y=new e.P(Math.min(m.x,f.x,_.x,g.x),Math.min(m.y,f.y,_.y,g.y)),v=b.sub(y),x=(o.width-(s.left+s.right+r.padding.left+r.padding.right))/v.x,w=(o.height-(s.top+s.bottom+r.padding.top+r.padding.bottom))/v.y;if(w<0||x<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");let k=Math.min(o.scaleZoom(o.scale*Math.min(x,w)),r.maxZoom),E=e.P.convert(r.offset),C=new e.P((r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2).rotate(e.b8(n)),A=E.add(C).mult(o.scale/o.zoomScale(k));return{center:o.unproject(c.add(u).div(2).sub(A)),zoom:k,bearing:n}}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,i,n,r,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(t)),this.transform.pointLocation(e.P.convert(i)),n,r),r,a)}_fitInternal(t,i,n){return t?(delete(i=e.e(t,i)).padding,i.linear?this.easeTo(i,n):this.flyTo(i,n)):this}jumpTo(t,i){this.stop();let n=this._getTransformForUpdate(),r=!1,a=!1,o=!1;return"zoom"in t&&n.zoom!==+t.zoom&&(r=!0,n.zoom=+t.zoom),void 0!==t.center&&(n.center=e.M.convert(t.center)),"bearing"in t&&n.bearing!==+t.bearing&&(a=!0,n.bearing=+t.bearing),"pitch"in t&&n.pitch!==+t.pitch&&(o=!0,n.pitch=+t.pitch),null==t.padding||n.isPaddingEqual(t.padding)||(n.padding=t.padding),this._applyUpdatedTransform(n),this.fire(new e.k("movestart",i)).fire(new e.k("move",i)),r&&this.fire(new e.k("zoomstart",i)).fire(new e.k("zoom",i)).fire(new e.k("zoomend",i)),a&&this.fire(new e.k("rotatestart",i)).fire(new e.k("rotate",i)).fire(new e.k("rotateend",i)),o&&this.fire(new e.k("pitchstart",i)).fire(new e.k("pitch",i)).fire(new e.k("pitchend",i)),this.fire(new e.k("moveend",i))}calculateCameraOptionsFromTo(t,i,n,r=0){let a=e.Y.fromLngLat(t,i),o=e.Y.fromLngLat(n,r),s=o.x-a.x,l=o.y-a.y,c=o.z-a.z,d=Math.hypot(s,l,c);if(0===d)throw Error("Can't calculate camera options with same From and To");let u=Math.hypot(s,l),h=this.transform.scaleZoom(this.transform.cameraToCenterDistance/d/this.transform.tileSize),p=180*Math.atan2(s,-l)/Math.PI,m=180*Math.acos(u/d)/Math.PI;return m=c<0?90-m:90+m,{center:o.toLngLat(),zoom:h,pitch:m,bearing:p}}easeTo(t,i){var n;let r,a;this._stop(!1,t.easeId),(!1===(t=e.e({offset:[0,0],duration:500,easing:e.b7},t)).animate||!t.essential&&u.prefersReducedMotion)&&(t.duration=0);let o=this._getTransformForUpdate(),s=this.getZoom(),l=this.getBearing(),c=this.getPitch(),d=this.getPadding(),h="bearing"in t?this._normalizeBearing(t.bearing,l):l,p="pitch"in t?+t.pitch:c,m="padding"in t?t.padding:o.padding,f=e.P.convert(t.offset),g=o.centerPoint.add(f),_=o.pointLocation(g),{center:b,zoom:y}=o.getConstrained(e.M.convert(t.center||_),null!=(n=t.zoom)?n:s);this._normalizeCenter(b);let v=o.project(_),x=o.project(b).sub(v),w=o.zoomScale(y-s);t.around&&(r=e.M.convert(t.around),a=o.locationPoint(r));let k={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||y!==s,this._rotating=this._rotating||l!==h,this._pitching=this._pitching||p!==c,this._padding=!o.isPaddingEqual(m),this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,k),this.terrain&&this._prepareElevation(b),this._ease(n=>{if(this._zooming&&(o.zoom=e.z.number(s,y,n)),this._rotating&&(o.bearing=e.z.number(l,h,n)),this._pitching&&(o.pitch=e.z.number(c,p,n)),this._padding&&(o.interpolatePadding(d,m,n),g=o.centerPoint.add(f)),this.terrain&&!t.freezeElevation&&this._updateElevation(n),r)o.setLocationAtPoint(r,a);else{let t=o.zoomScale(o.zoom-s),e=Math.pow(y>s?Math.min(2,w):Math.max(.5,w),1-n),i=o.unproject(v.add(x.mult(n*e)).mult(t));o.setLocationAtPoint(o.renderWorldCopies?i.wrap():i,g)}this._applyUpdatedTransform(o),this._fireMoveEvents(i)},t=>{this.terrain&&this._finalizeElevation(),this._afterEase(i,t)},t),this}_prepareEase(t,i,n={}){this._moving=!0,i||n.moving||this.fire(new e.k("movestart",t)),this._zooming&&!n.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!n.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!n.pitching&&this.fire(new e.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);let i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){let e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(i-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.elevation=e.z.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_applyUpdatedTransform(t){if(!this.transformCameraUpdate)return;let e=t.clone(),{center:i,zoom:n,pitch:r,bearing:a,elevation:o}=this.transformCameraUpdate(e);i&&(e.center=i),void 0!==n&&(e.zoom=n),void 0!==r&&(e.pitch=r),void 0!==a&&(e.bearing=a),void 0!==o&&(e.elevation=o),this.transform.apply(e)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;let n=this._zooming,r=this._rotating,a=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new e.k("zoomend",t)),r&&this.fire(new e.k("rotateend",t)),a&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,i){var n;if(!t.essential&&u.prefersReducedMotion){let n=e.L(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,i)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b7},t);let r=this._getTransformForUpdate(),a=this.getZoom(),o=this.getBearing(),s=this.getPitch(),l=this.getPadding(),c="bearing"in t?this._normalizeBearing(t.bearing,o):o,d="pitch"in t?+t.pitch:s,h="padding"in t?t.padding:r.padding,p=e.P.convert(t.offset),m=r.centerPoint.add(p),f=r.pointLocation(m),{center:g,zoom:_}=r.getConstrained(e.M.convert(t.center||f),null!=(n=t.zoom)?n:a);this._normalizeCenter(g);let b=r.zoomScale(_-a),y=r.project(f),v=r.project(g).sub(y),x=t.curve,w=Math.max(r.width,r.height),k=w/b,E=v.mag();if("minZoom"in t){let i=e.ac(Math.min(t.minZoom,a,_),r.minZoom,r.maxZoom);x=Math.sqrt(w/r.zoomScale(i-a)/E*2)}let C=x*x;function A(t){let e=(k*k-w*w+(t?-1:1)*C*C*E*E)/(2*(t?k:w)*C*E);return Math.log(Math.sqrt(e*e+1)-e)}function T(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}let S=A(!1),z=function(t){return I(S)/I(S+x*t)},M=function(t){var e;return w*((I(S)*(T(e=S+x*t)/I(e))-T(S))/C)/E},P=(A(!0)-S)/x;if(1e-6>Math.abs(E)||!isFinite(P)){if(1e-6>Math.abs(w-k))return this.easeTo(t,i);let e=k<w?-1:1;P=Math.abs(Math.log(k/w))/x,M=function(){return 0},z=function(t){return Math.exp(e*x*t)}}return t.duration="duration"in t?+t.duration:1e3*P/("screenSpeed"in t?t.screenSpeed/x:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=o!==c,this._pitching=d!==s,this._padding=!r.isPaddingEqual(h),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(g),this._ease(n=>{let u=n*P,f=1/z(u);r.zoom=1===n?_:a+r.scaleZoom(f),this._rotating&&(r.bearing=e.z.number(o,c,n)),this._pitching&&(r.pitch=e.z.number(s,d,n)),this._padding&&(r.interpolatePadding(l,h,n),m=r.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(n);let b=1===n?g:r.unproject(y.add(v.mult(M(u))).mult(f));r.setLocationAtPoint(r.renderWorldCopies?b.wrap():b,m),this._applyUpdatedTransform(r),this._fireMoveEvents(i)},()=>{this.terrain&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){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,e)}if(!t){let t=this.handlers;t&&t.stop(!1)}return this}_ease(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=u.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){let n=Math.abs((t=e.b1(t,-180,180))-i);return Math.abs(t-360-i)<n&&(t-=360),Math.abs(t+360-i)<n&&(t+=360),t}_normalizeCenter(t){let e=this.transform;if(!e.renderWorldCopies||e.lngRange)return;let i=t.lng-e.center.lng;t.lng+=i>180?-360:360*(i<-180)}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.M.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}let nv={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class nx{constructor(t=nv){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&&("metadata"===t.sourceDataType||"visibility"===t.sourceDataType||"style"===t.dataType||"terrain"===t.type)&&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=h.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=h.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=h.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(){h.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,e){let i=this._map._getUIString(`AttributionControl.${e}`);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 e=this._map.style.sourceCaches;for(let i in e){let n=e[i];if(n.used||n.usedForTerrain){let e=n.getSource();e.attribution&&0>t.indexOf(e.attribution)&&t.push(e.attribution)}}(t=t.filter(t=>String(t).trim())).sort((t,e)=>t.length-e.length);let i=(t=t.filter((e,i)=>{for(let n=i+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0})).join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class nw{constructor(t={}){this._updateCompact=()=>{let t=this._container.children;if(t.length){let e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=h.create("div","maplibregl-ctrl");let e=h.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){h.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class nk{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){let e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){let e=this._currentlyRunning;for(let i of e?this._queue.concat(e):this._queue)if(i.id===t)return void(i.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw Error("Attempting to run(), but is already running.");let e=this._currentlyRunning=this._queue;for(let i of(this._queue=[],e))if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var nE=e.X([{name:"a_pos3d",type:"Int16",components:3}]);class nC extends e.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,i){this.sourceCache.update(t,i),this._renderableTilesKeys=[];let n={};for(let r of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i}))n[r.key]=!0,this._renderableTilesKeys.push(r.key),this._tiles[r.key]||(r.posMatrix=new Float64Array(16),e.aN(r.posMatrix,0,e.W,0,e.W,0,1),this._tiles[r.key]=new tl(r,this.tileSize));for(let t in this._tiles)n[t]||delete this._tiles[t]}freeRtt(t){for(let e in this._tiles){let i=this._tiles[e];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){let i={};for(let n of this._renderableTilesKeys){let r=this._tiles[n].tileID;if(r.canonical.equals(t.canonical)){let r=t.clone();r.posMatrix=new Float64Array(16),e.aN(r.posMatrix,0,e.W,0,e.W,0,1),i[n]=r}else if(r.canonical.isChildOf(t.canonical)){let a=t.clone();a.posMatrix=new Float64Array(16);let o=r.canonical.z-t.canonical.z,s=r.canonical.x-(r.canonical.x>>o<<o),l=r.canonical.y-(r.canonical.y>>o<<o),c=e.W>>o;e.aN(a.posMatrix,0,c,0,c,0,1),e.H(a.posMatrix,a.posMatrix,[-s*c,-l*c,0]),i[n]=a}else if(t.canonical.isChildOf(r.canonical)){let a=t.clone();a.posMatrix=new Float64Array(16);let o=t.canonical.z-r.canonical.z,s=t.canonical.x-(t.canonical.x>>o<<o),l=t.canonical.y-(t.canonical.y>>o<<o),c=e.W>>o;e.aN(a.posMatrix,0,e.W,0,e.W,0,1),e.H(a.posMatrix,a.posMatrix,[s*c,l*c,0]),e.J(a.posMatrix,a.posMatrix,[1/2**o,1/2**o,0]),i[n]=a}}return i}getSourceTile(t,e){let i=this.sourceCache._source,n=t.overscaledZ-this.deltaZoom;if(n>i.maxzoom&&(n=i.maxzoom),n<i.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(n).key);let r=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!r||!r.dem)&&e)for(;n>=i.minzoom&&(!r||!r.dem);)r=this.sourceCache.getTileByID(t.scaledTo(n--).key);return r}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(e=>e.timeAdded>=t)}}class nA{constructor(t,e,i){this.painter=t,this.sourceCache=new nC(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,i,n,r=e.W){var a,o,s,l,c,d;if(!(i>=0&&i<r&&n>=0&&n<r))return 0;let u=this.getTerrainData(t),h=null==(a=u.tile)?void 0:a.dem;if(!h)return 0;let p=(o=[],s=[i/r*e.W,n/r*e.W],l=u.u_terrain_matrix,c=s[0],d=s[1],o[0]=l[0]*c+l[4]*d+l[12],o[1]=l[1]*c+l[5]*d+l[13],o),m=[p[0]*h.dim,p[1]*h.dim],f=Math.floor(m[0]),g=Math.floor(m[1]),_=m[0]-f,b=m[1]-g;return h.get(f,g)*(1-_)*(1-b)+h.get(f+1,g)*_*(1-b)+h.get(f,g+1)*(1-_)*b+h.get(f+1,g+1)*_*b}getElevationForLngLatZoom(t,i){let{tileID:n,mercatorX:r,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(n,r%e.W,a%e.W,e.W)}getElevation(t,i,n,r=e.W){return this.getDEMElevation(t,i,n,r)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){let t=this.painter.context,i=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new S(t,i,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new S(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}let i=this.sourceCache.getSourceTile(t,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){let t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new S(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}let n=i&&i+i.tileID.key+t.key;if(n&&!this._demMatrixCache[n]){let n=this.sourceCache.sourceCache._source.maxzoom,r=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=n?r=t.canonical.z-n:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let a=t.canonical.x-(t.canonical.x>>r<<r),o=t.canonical.y-(t.canonical.y>>r<<r),s=e.b9(new Float64Array(16),[1/(e.W<<r),1/(e.W<<r),0]);e.H(s,s,[a*e.W,o*e.W,0]),this._demMatrixCache[t.key]={matrix:s,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:n?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){let e=this.painter,i=e.width/devicePixelRatio,n=e.height/devicePixelRatio;return this._fbo&&(this._fbo.width!==i||this._fbo.height!==n)&&(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new S(e.context,{width:i,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new S(e.context,{width:i,height:n,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(i,n,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,i,n))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,e=0;t<this._coordsTextureSize;t++)for(let n=0;n<this._coordsTextureSize;n++,e+=4)i[e+0]=255&n,i[e+1]=255&t,i[e+2]=n>>8<<4|t>>8,i[e+3]=0;let n=new S(t,new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),t.gl.RGBA,{premultiply:!1});return n.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);let i=new Uint8Array(4),n=this.painter.context,r=n.gl;n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,i),n.bindFramebuffer.set(null);let a=i[0]+(i[2]>>4<<8),o=i[1]+((15&i[2])<<8),s=this.coordsIndex[255-i[3]],l=s&&this.sourceCache.getTileByID(s);if(!l)return null;let c=this._coordsTextureSize,d=(1<<l.tileID.canonical.z)*c;return new e.Y((l.tileID.canonical.x*c+a)/d+l.tileID.wrap,(l.tileID.canonical.y*c+o)/d,this.getElevation(l.tileID,a,o,c))}depthAtPoint(t){let e=new Uint8Array(4),i=this.painter.context,n=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),n.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,n.RGBA,n.UNSIGNED_BYTE,e),i.bindFramebuffer.set(null),(e[0]/0x1000000+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;let t=this.painter.context,i=new e.ba,n=new e.aX,r=this.meshSize,a=e.W/r,o=r*r;for(let t=0;t<=r;t++)for(let e=0;e<=r;e++)i.emplaceBack(e*a,t*a,0);for(let t=0;t<o;t+=r+1)for(let e=0;e<r;e++)n.emplaceBack(e+t,r+e+t+1,r+e+t+2),n.emplaceBack(e+t,r+e+t+2,e+t+1);let s=i.length,l=s+2*(r+1);for(let t of[0,1])for(let n=0;n<=r;n++)for(let r of[0,1])i.emplaceBack(n*a,t*e.W,r);for(let t=0;t<2*r;t+=2)n.emplaceBack(l+t,l+t+1,l+t+3),n.emplaceBack(l+t,l+t+3,l+t+2),n.emplaceBack(s+t,s+t+3,s+t+1),n.emplaceBack(s+t,s+t+2,s+t+3);let c=i.length,d=c+2*(r+1);for(let t of[0,1])for(let n=0;n<=r;n++)for(let r of[0,1])i.emplaceBack(t*e.W,n*a,r);for(let t=0;t<2*r;t+=2)n.emplaceBack(c+t,c+t+1,c+t+3),n.emplaceBack(c+t,c+t+3,c+t+2),n.emplaceBack(d+t,d+t+3,d+t+1),n.emplaceBack(d+t,d+t+2,d+t+3);return this._mesh={indexBuffer:t.createIndexBuffer(n),vertexBuffer:t.createVertexBuffer(i,nE.members),segments:e.$.simpleSegment(0,0,i.length,n.length)},this._mesh}getMeshFrameDelta(t){return 2*Math.PI*e.bb/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,e){var i;let{tileID:n}=this._getOverscaledTileIDFromLngLatZoom(t,e);return null!=(i=this.getMinMaxElevation(n).minElevation)?i:0}getMinMaxElevation(t){let e=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return e&&e.dem&&(i.minElevation=e.dem.min*this.exaggeration,i.maxElevation=e.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){let n=e.Y.fromLngLat(t.wrap()),r=(1<<i)*e.W,a=n.x*r,o=n.y*r,s=Math.floor(a/e.W),l=Math.floor(o/e.W);return{tileID:new e.Q(i,0,i,s,l),mercatorX:a,mercatorY:o}}}class nT{constructor(t,e,i){this._context=t,this._size=e,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){let e=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),i=new S(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return i.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),e.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),e.colorAttachment.set(i.texture),{id:t,fbo:e,texture:i,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(e=>t.id!==e),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(let t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw Error("No free RenderPool available, call freeAllObjects() required!");let t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(let t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(t=>!t.inUse)}}let nI={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class nS{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new nT(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){for(let i in this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(e)),this._coordsDescendingInv={},t.sourceCaches)for(let e of(this._coordsDescendingInv[i]={},t.sourceCaches[i].getVisibleCoordinates())){let t=this.terrain.sourceCache.getTerrainCoords(e);for(let e in t)this._coordsDescendingInv[i][e]||(this._coordsDescendingInv[i][e]=[]),this._coordsDescendingInv[i][e].push(t[e])}for(let e of(this._coordsDescendingInvStr={},t._order)){let i=t._layers[e],n=i.source;if(nI[i.type]&&!this._coordsDescendingInvStr[n])for(let t in this._coordsDescendingInvStr[n]={},this._coordsDescendingInv[n])this._coordsDescendingInvStr[n][t]=this._coordsDescendingInv[n][t].map(t=>t.key).sort().join()}for(let t of this._renderableTiles)for(let e in this._coordsDescendingInvStr){let i=this._coordsDescendingInvStr[e][t.tileID.key];i&&i!==t.rttCoords[e]&&(t.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;let i=t.type,n=this.painter,r=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(nI[i]&&(this._prevType&&nI[this._prevType]||this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(t.id),!r))return!0;if(nI[this._prevType]||nI[i]&&r){this._prevType=i;let t=this._stacks.length-1,r=this._stacks[t]||[];for(let i of this._renderableTiles){if(this.pool.isFull()&&(ik(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(i),i.rtt[t]){let e=this.pool.getObjectForId(i.rtt[t].id);if(e.stamp===i.rtt[t].stamp){this.pool.useObject(e);continue}}let a=this.pool.getOrCreateFreeObject();this.pool.useObject(a),this.pool.stampObject(a),i.rtt[t]={id:a.id,stamp:a.stamp},n.context.bindFramebuffer.set(a.fbo.framebuffer),n.context.clear({color:e.aO.transparent,stencil:0}),n.currentStencilSource=void 0;for(let t=0;t<r.length;t++){let e=n.style._layers[r[t]],o=e.source?this._coordsDescendingInv[e.source][i.tileID.key]:[i.tileID];n.context.viewport.set([0,0,a.fbo.width,a.fbo.height]),n._renderTileClippingMasks(e,o),n.renderLayer(n,n.style.sourceCaches[e.source],e,o),e.source&&(i.rttCoords[e.source]=this._coordsDescendingInvStr[e.source][i.tileID.key])}}return ik(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),nI[i]}return!1}}let nz={"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","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","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"},nL={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:nv,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.a.MAX_TILE_CACHE_ZOOM_LEVELS,localIdeographFontFamily:"sans-serif",transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,validateStyle:!0,maxCanvasSize:[4096,4096]},nM=t=>{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},nP={showCompass:!0,showZoom:!0,visualizePitch:!1};class nR{constructor(t,i,n=!1){this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),h.mousePos(this.element,t)),h.addEventListener(window,"mousemove",this.mousemove),h.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,h.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=h.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),h.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=h.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},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.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;let r=t.dragRotate._mouseRotate.getClickTolerance(),a=t.dragRotate._mousePitch.getClickTolerance();this.element=i,this.mouseRotate=i1({clickTolerance:r,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:i=.8})=>new iY({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*i}),moveStateManager:new iQ,enable:t,assignEvents:nM}))({clickTolerance:r,enable:!0}),this.map=t,n&&(this.mousePitch=i2({clickTolerance:a,enable:!0}),this.touchPitch=(({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5})=>new iY({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:new iQ,enable:t,assignEvents:nM}))({clickTolerance:a,enable:!0})),h.addEventListener(i,"mousedown",this.mousedown),h.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),h.addEventListener(i,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),h.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),h.disableDrag()}moveMouse(t,e){let i=this.map,{bearingDelta:n}=this.mouseRotate.dragMove(t,e)||{};if(n&&i.setBearing(i.getBearing()+n),this.mousePitch){let{pitchDelta:n}=this.mousePitch.dragMove(t,e)||{};n&&i.setPitch(i.getPitch()+n)}}moveTouch(t,e){let i=this.map,{bearingDelta:n}=this.touchRotate.dragMove(t,e)||{};if(n&&i.setBearing(i.getBearing()+n),this.touchPitch){let{pitchDelta:n}=this.touchPitch.dragMove(t,e)||{};n&&i.setPitch(i.getPitch()+n)}}off(){let t=this.element;h.removeEventListener(t,"mousedown",this.mousedown),h.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend),h.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){h.enableDrag(),h.removeEventListener(window,"mousemove",this.mousemove),h.removeEventListener(window,"mouseup",this.mouseup),h.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),h.removeEventListener(window,"touchend",this.touchend)}}function nO(t,i,n){let r=new e.M(t.lng,t.lat);if(t=new e.M(t.lng,t.lat),i){let r=new e.M(t.lng-360,t.lat),a=new e.M(t.lng+360,t.lat),o=n.locationPoint(t).distSqr(i);n.locationPoint(r).distSqr(i)<o?t=r:n.locationPoint(a).distSqr(i)<o&&(t=a)}for(;Math.abs(t.lng-n.center.lng)>180;){let e=n.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=n.width&&e.y<=n.height)break;t.lng>n.center.lng?t.lng-=360:t.lng+=360}return t.lng!==r.lng&&n.locationPoint(t).y>n.height/2-n.getHorizon()?t:r}let nD={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 nB(t,e,i){let n=t.classList;for(let t in nD)n.remove(`maplibregl-${i}-anchor-${t}`);n.add(`maplibregl-${i}-anchor-${e}`)}class nF extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{let e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},this._onMapClick=t=>{let e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;let i=this._map.loaded()&&!this._map.isMoving();"terrain"!==(null==t?void 0:t.type)&&("render"!==(null==t?void 0:t.type)||i)||this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?nO(this._lngLat,this._flatPos,this._map.transform):null==(e=this._lngLat)?void 0:e.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let n="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?n=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(n=`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)`),t&&"moveend"!==t.type||(this._pos=this._pos.round()),h.setTransform(this._element,`${nD[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${n}`),u.frameAsync(new AbortController).then(()=>{this._updateOpacity(t&&"moveend"===t.type)}).catch(()=>{})},this._onMove=t=>{if(!this._isDragging){let e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}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 e.k("dragstart"))),this.fire(new e.k("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 e.k("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&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=h.create("div"),this._element.setAttribute("aria-label","Map marker");let i=h.createNS("http://www.w3.org/2000/svg","svg");i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height","41px"),i.setAttributeNS(null,"width","27px"),i.setAttributeNS(null,"viewBox","0 0 27 41");let n=h.createNS("http://www.w3.org/2000/svg","g");n.setAttributeNS(null,"stroke","none"),n.setAttributeNS(null,"stroke-width","1"),n.setAttributeNS(null,"fill","none"),n.setAttributeNS(null,"fill-rule","evenodd");let r=h.createNS("http://www.w3.org/2000/svg","g");r.setAttributeNS(null,"fill-rule","nonzero");let a=h.createNS("http://www.w3.org/2000/svg","g");for(let t of(a.setAttributeNS(null,"transform","translate(3.0, 29.0)"),a.setAttributeNS(null,"fill","#000000"),[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}])){let e=h.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),a.appendChild(e)}let o=h.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill",this._color);let s=h.createNS("http://www.w3.org/2000/svg","path");s.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),o.appendChild(s);let l=h.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"opacity","0.25"),l.setAttributeNS(null,"fill","#000000");let c=h.createNS("http://www.w3.org/2000/svg","path");c.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),l.appendChild(c);let d=h.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"transform","translate(6.0, 7.0)"),d.setAttributeNS(null,"fill","#FFFFFF");let u=h.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"transform","translate(8.0, 8.0)");let p=h.createNS("http://www.w3.org/2000/svg","circle");p.setAttributeNS(null,"fill","#000000"),p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"cx","5.5"),p.setAttributeNS(null,"cy","5.5"),p.setAttributeNS(null,"r","5.4999962");let m=h.createNS("http://www.w3.org/2000/svg","circle");m.setAttributeNS(null,"fill","#FFFFFF"),m.setAttributeNS(null,"cx","5.5"),m.setAttributeNS(null,"cy","5.5"),m.setAttributeNS(null,"r","5.4999962"),u.appendChild(p),u.appendChild(m),r.appendChild(a),r.appendChild(o),r.appendChild(l),r.appendChild(d),r.appendChild(u),i.appendChild(r),i.setAttributeNS(null,"height",41*this._scale+"px"),i.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(i),this._offset=e.P.convert(t&&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()}),nB(this._element,this._anchor,"marker"),t&&t.className)for(let e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("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),h.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.M.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){let e=Math.abs(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":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}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){var i,n;if(!(null==(i=this._map)?void 0:i.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}let r=this._map,a=r.terrain.depthAtPoint(this._pos),o=r.terrain.getElevationForLngLatZoom(this._lngLat,r.transform.tileZoom);if(r.transform.lngLatToCameraDepth(this._lngLat,o)-a<.006)return void(this._element.style.opacity=this._opacity);let s=-this._offset.y/r.transform._pixelPerMeter,l=Math.sin(r.getPitch()*Math.PI/180)*s,c=r.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),d=r.transform.lngLatToCameraDepth(this._lngLat,o+l)-c>.006;(null==(n=this._popup)?void 0:n.isOpen())&&d&&this._popup.remove(),this._element.style.opacity=d?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.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._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}isDraggable(){return this._draggable}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,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}let nN={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},nV=0,nU=!1,n$={maxWidth:100,unit:"metric"};function nj(t,e,i){let n=i&&i.maxWidth||100,r=t._container.clientHeight/2,a=t.unproject([0,r]),o=t.unproject([n,r]),s=a.distanceTo(o);if(i&&"imperial"===i.unit){let i=3.2808*s;i>5280?nH(e,n,i/5280,t._getUIString("ScaleControl.Miles")):nH(e,n,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?nH(e,n,s/1852,t._getUIString("ScaleControl.NauticalMiles")):s>=1e3?nH(e,n,s/1e3,t._getUIString("ScaleControl.Kilometers")):nH(e,n,s,t._getUIString("ScaleControl.Meters"))}function nH(t,e,i,n){let r=function(t){let e=Math.pow(10,`${Math.floor(t)}`.length-1),i=t/e;return e*(i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){let e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i))}(i);t.style.width=r/i*e+"px",t.innerHTML=`${r}&nbsp;${n}`}let nq={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1};t.AJAXError=e.be,t.Evented=e.E,t.LngLat=e.M,t.MercatorCoordinate=e.Y,t.Point=e.P,t.addProtocol=e.bf,t.config=e.a,t.removeProtocol=e.bg,t.AttributionControl=nx,t.BoxZoomHandler=iq,t.CanvasSource=te,t.CooperativeGesturesHandler=nm,t.DoubleClickZoomHandler=nl,t.DragPanHandler=nu,t.DragRotateHandler=nh,t.EdgeInsets=iT,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null==(t=null==e?void 0:e.shadowRoot)?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){h.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let t=this._fullscreenButton=h.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);h.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 e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=K,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();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 e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{let i=new e.M(t.coords.longitude,t.coords.latitude),n=t.coords.accuracy,r=this._map.getBearing(),a=e.e({bearing:r},this.options.fitBoundsOptions),o=G.fromLngLat(i,n);this._map.fitBounds(o,a,{geolocateSource:!0})},this._updateMarker=t=>{if(t){let i=new e.M(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)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&&nU)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=t=>{if(this._map){if(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=h.create("button","maplibregl-ctrl-geolocate",this._container),h.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.w("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.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=h.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new nF({element:this._dotElement}),this._circleElement=h.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new nF({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")))})}},this.options=e.e({},nN,t)}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),(function(){return e._(this,arguments,void 0,function*(t=!1){if(void 0!==l&&!t)return l;if(void 0===window.navigator.permissions)return l=!!window.navigator.geolocation;try{let t=yield window.navigator.permissions.query({name:"geolocation"});l="denied"!==t.state}catch(t){l=!!window.navigator.geolocation}return l})})().then(t=>this._setupUI(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(),h.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,nV=0,nU=!1}_isOutOfMapMaxBounds(t){let e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){let t=this._map.getBounds(),e=t.getSouthEast(),i=t.getNorthEast(),n=e.distanceTo(i),r=Math.ceil(this._accuracy/(n/this._map._container.clientHeight)*2);this._circleElement.style.width=`${r}px`,this._circleElement.style.height=`${r}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":nV--,nU=!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 e.k("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 e.k("trackuserlocationstart"));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"),++nV>1?(t={maximumAge:6e5,timeout:0},nU=!0):(t=this.options.positionOptions,nU=!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)}},t.Hash=iz,t.ImageSource=Q,t.KeyboardHandler=na,t.LngLatBounds=G,t.LogoControl=nw,t.Map=class extends ny{constructor(t){if(e.bc.mark(e.bd.create),null!=(t=e.e({},nL,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw Error("maxPitch must be less than or equal to 85");if(super(new iI(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),{bearingSnap:t.bearingSnap}),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("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()},this._interactive=t.interactive,this._maxTileCacheSize=t.maxTileCacheSize,this._maxTileCacheZoomLevels=t.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new nk,this._controls=[],this._mapId=e.a3(),this._locale=e.e({},nz,t.locale),this._clickTolerance=t.clickTolerance,this._overridePixelRatio=t.pixelRatio,this._maxCanvasSize=t.maxCanvasSize,this.transformCameraUpdate=t.transformCameraUpdate,this._imageQueueHandle=k.addThrottleControl(()=>this.isMoving()),this._requestManager=new y(t.transformRequest),"string"==typeof t.container){if(this._container=document.getElementById(t.container),!this._container)throw Error(`Container '${t.container}' not found.`)}else{if(!(t.container instanceof HTMLElement))throw Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)),this.on("moveend",()=>this._update(!1)),this.on("zoom",()=>this._update(!0)),this.on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}),this.once("idle",()=>{this._idleTriggered=!0}),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1,e=iS(t=>{this._trackResize&&!this._removed&&this.resize(t)._update()},50);this._resizeObserver=new ResizeObserver(i=>{t?e(i):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new nb(this,t),this._hash=t.hash&&new iz("string"==typeof t.hash&&t.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.e({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,this._validateStyle=t.validateStyle,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new nx("boolean"==typeof t.attributionControl?void 0:t.attributionControl)),t.maplibreLogo&&this.addControl(new nw,t.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new e.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let n=t.onAdd(this);this._controls.push(t);let r=this._controlPositions[i];return -1!==i.indexOf("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,i,n){return null==n&&this.terrain&&(n=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,i,n)}resize(t){var i;let n=this._containerDimensions(),r=n[0],a=n[1],o=this._getClampedPixelRatio(r,a);if(this._resizeCanvas(r,a,o),this.painter.resize(r,a,o),this.painter.overLimit()){let t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];let e=this._getClampedPixelRatio(r,a);this._resizeCanvas(r,a,e),this.painter.resize(r,a,e)}this.transform.resize(r,a),null==(i=this._requestedCameraState)||i.resize(r,a);let s=!this._moving;return s&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),s&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){let{0:i,1:n}=this._maxCanvasSize,r=this.getPixelRatio(),a=t*r,o=e*r;return Math.min(a>i?i/a:1,o>n?n/o:1)*r}getPixelRatio(){var t;return null!=(t=this._overridePixelRatio)?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(G.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>85)throw Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.M.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null==(t=this.handlers)?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null==(t=this.handlers)?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null==(t=this.handlers)?void 0:t.isRotating())}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let n=!1,r=r=>{let a=this.getLayer(e)?this.queryRenderedFeatures(r.point,{layers:[e]}):[];a.length?n||(n=!0,i.call(this,new iN(t,this,r.originalEvent,{features:a}))):n=!1};return{layer:e,listener:i,delegates:{mousemove:r,mouseout:()=>{n=!1}}}}if("mouseleave"===t||"mouseout"===t){let n=!1,r=r=>{(this.getLayer(e)?this.queryRenderedFeatures(r.point,{layers:[e]}):[]).length?n=!0:n&&(n=!1,i.call(this,new iN(t,this,r.originalEvent)))},a=e=>{n&&(n=!1,i.call(this,new iN(t,this,e.originalEvent)))};return{layer:e,listener:i,delegates:{mousemove:r,mouseout:a}}}{let n=t=>{let n=this.getLayer(e)?this.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,i.call(this,t),delete t.features)};return{layer:e,listener:i,delegates:{[t]:n}}}}on(t,e,i){if(void 0===i)return super.on(t,e);let n=this._createDelegatedListener(t,e,i);for(let e in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(n),n.delegates)this.on(e,n.delegates[e]);return this}once(t,e,i){if(void 0===i)return super.once(t,e);let n=this._createDelegatedListener(t,e,i);for(let t in n.delegates)this.once(t,n.delegates[t]);return this}off(t,e,i){return void 0===i?super.off(t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&(n=>{let r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){let n=r[t];if(n.layer===e&&n.listener===i){for(let t in n.delegates)this.off(t,n.delegates[t]);return r.splice(t,1),this}}})(),this)}queryRenderedFeatures(t,i){let n;if(!this.style)return[];let r=t instanceof e.P||Array.isArray(t),a=r?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(r?{}:t)||{},a instanceof e.P||"number"==typeof a[0])n=[e.P.convert(a)];else{let t=e.P.convert(a[0]),i=e.P.convert(a[1]);n=[t,new e.P(i.x,t.y),i,new e.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(n,i,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,i){return!1!==(i=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){let e=this._locale[t];if(null==e)throw Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,e));let i=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new t0(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,i):this.style.loadJSON(t,e,i)):delete this.style,this}_lazyInitEmptyStyle(){this.style||(this.style=new t0(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if("string"==typeof t){let n=this._requestManager.transformRequest(t,E.Style);e.h(n,new AbortController).then(t=>{this._updateDiff(t.data,i)}).catch(t=>{t&&this.fire(new e.j(t))})}else"object"==typeof t&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(n){e.w(`Unable to perform style diff: ${n.message||n.error||n}. Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){let i=this.style&&this.style.sourceCaches[t];if(void 0!==i)return i.loaded();this.fire(new e.j(Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){let i=this.style.sourceCaches[t.source];if(!i)throw Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);for(let n in null===this.terrain&&i.reload(),this.style._layers){let i=this.style._layers[n];"hillshade"===i.type&&i.source===t.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new nA(this.painter,i,t),this.painter.renderToTexture=new nS(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!=(e=null==(t=this.terrain)?void 0:t.options)?e:null}areTilesLoaded(){let t=this.style&&this.style.sourceCaches;for(let e in t){let i=t[e]._tiles;for(let t in i){let e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,i,n={}){let{pixelRatio:r=1,sdf:a=!1,stretchX:o,stretchY:s,content:l}=n;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new e.j(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`")));{let{width:n,height:c,data:d}=i;return this.style.addImage(t,{data:new e.R({width:n,height:c},new Uint8Array(d)),pixelRatio:r,stretchX:o,stretchY:s,content:l,sdf:a,version:0,userImage:i}),i.onAdd&&i.onAdd(this,t),this}}{let{width:n,height:c,data:d}=u.getImageData(i);this.style.addImage(t,{data:new e.R({width:n,height:c},d),pixelRatio:r,stretchX:o,stretchY:s,content:l,sdf:a,version:0})}}updateImage(t,i){let n=this.style.getImage(t);if(!n)return this.fire(new e.j(Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let{width:r,height:a,data:o}=i instanceof HTMLImageElement||e.b(i)?u.getImageData(i):i;if(void 0===r||void 0===a)return this.fire(new e.j(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!==n.data.width||a!==n.data.height)return this.fire(new e.j(Error("The width and height of the updated image must be that same as the previous version of the image")));let s=!(i instanceof HTMLImageElement||e.b(i));return n.data.replace(o,s),this.style.updateImage(t,n),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return k.getImage(this._requestManager.transformRequest(t,E.Image),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),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,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,n={}){return this.style.setPaintProperty(t,e,i,n),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,n={}){return this.style.setLayoutProperty(t,e,i,n),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,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,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,t=>{t||this._update(!0)}),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),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,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){let t=this._container;t.classList.add("maplibregl-map");let e=this._canvasContainer=h.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=h.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");let i=this._containerDimensions(),n=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],n);let r=this._controlContainer=h.create("div","maplibregl-control-container",t),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{a[t]=h.create("div",`maplibregl-ctrl-${t} `,r)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){let t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1},e=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{e={requestedAttributes:t},i&&(e.statusMessage=i.statusMessage,e.type=i.type)},{once:!0});let i=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!i){let t="Failed to initialize WebGL";throw e?(e.message=t,Error(JSON.stringify(e))):Error(t)}this.painter=new iE(i,this.transform),p.testSupport(i)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded&&(this._styleDirty=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 i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let t=this.transform.zoom,r=u.now();this.style.zoomHistory.update(t,r);let a=new e.a8(t,{now:r,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=a.crossFadingFactor();1===o&&o===this._crossFadingFactor||(n=!0,this._crossFadingFactor=o),this.style.update(a)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bc.mark(e.bd.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let r=this._sourcesDirty||this._styleDirty||this._placementDirty;return r||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||r||(this._fullyLoaded=!0,e.bc.mark(e.bd.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;for(let t of(this._hash&&this._hash.remove(),this._controls))t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),k.removeThrottleControl(this._imageQueueHandle),null==(t=this._resizeObserver)||t.disconnect();let i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),h.remove(this._canvasContainer),h.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bc.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,u.frameAsync(this._frameRequest).then(t=>{e.bc.frame(t),this._frameRequest=null,this._render(t)}).catch(()=>{}))}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 d}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=iN,t.MapTouchEvent=iV,t.MapWheelEvent=iU,t.Marker=nF,t.NavigationControl=class{constructor(t){this._updateZoomButtons=()=>{let t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{let t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,e)=>{let i=this._map._getUIString(`NavigationControl.${e}`);t.title=i,t.setAttribute("aria-label",i)},this.options=e.e({},nP,t),this._container=h.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})),h.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})),h.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=h.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("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new nR(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){h.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){let i=h.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&h.remove(this._content),this._container&&(h.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var i;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=h.create("div","maplibregl-popup",this._map.getContainer()),this._tip=h.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._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=this._map.transform.renderWorldCopies&&!this._trackPointer?nO(this._lngLat,this._flatPos,this._map.transform):null==(i=this._lngLat)?void 0:i.wrap(),this._trackPointer&&!t)return;let n=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let r=this.options.anchor,a=function t(i){if(i){if("number"==typeof i){let t=Math.round(Math.abs(i)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,i),"top-left":new e.P(t,t),"top-right":new e.P(-t,t),bottom:new e.P(0,-i),"bottom-left":new e.P(t,-t),"bottom-right":new e.P(-t,-t),left:new e.P(i,0),right:new e.P(-i,0)}}if(i instanceof e.P||Array.isArray(i)){let t=e.P.convert(i);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.P.convert(i.center||[0,0]),top:e.P.convert(i.top||[0,0]),"top-left":e.P.convert(i["top-left"]||[0,0]),"top-right":e.P.convert(i["top-right"]||[0,0]),bottom:e.P.convert(i.bottom||[0,0]),"bottom-left":e.P.convert(i["bottom-left"]||[0,0]),"bottom-right":e.P.convert(i["bottom-right"]||[0,0]),left:e.P.convert(i.left||[0,0]),right:e.P.convert(i.right||[0,0])}}return t(new e.P(0,0))}(this.options.offset);if(!r){let t,e=this._container.offsetWidth,i=this._container.offsetHeight;t=n.y+a.bottom.y<i?["top"]:n.y>this._map.transform.height-i?["bottom"]:[],n.x<e/2?t.push("left"):n.x>this._map.transform.width-e/2&&t.push("right"),r=0===t.length?"bottom":t.join("-")}let o=n.add(a[r]);this.options.subpixelPositioning||(o=o.round()),h.setTransform(this._container,`${nD[r]} translate(${o.x}px,${o.y}px)`),nB(this._container,r,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(nq),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._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.M.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._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){let e,i=document.createDocumentFragment(),n=document.createElement("body");for(n.innerHTML=t;e=n.firstChild;)i.appendChild(e);return this.setDOMContent(i)}getMaxWidth(){var t;return null==(t=this._container)?void 0:t.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=h.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){this._container&&this._container.classList.add(t)}removeClassName(t){this._container&&this._container.classList.remove(t)}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}_createCloseButton(){this.options.closeButton&&(this._closeButton=h.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),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()}},t.RasterDEMTileSource=Y,t.RasterTileSource=W,t.ScaleControl=class{constructor(t){this._onMove=()=>{nj(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,nj(this._map,this._container,this.options)},this.options=e.e({},n$,t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=h.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){h.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=ns,t.Style=t0,t.TerrainControl=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=h.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=h.create("button","maplibregl-ctrl-terrain",this._container),h.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(){h.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=ne,t.TwoFingersTouchRotateHandler=i9,t.TwoFingersTouchZoomHandler=i7,t.TwoFingersTouchZoomRotateHandler=np,t.VectorTileSource=Z,t.VideoSource=tt,t.addSourceType=(t,i)=>e._(void 0,void 0,void 0,function*(){if(tn(t))throw Error(`A source type called "${t}" already exists.`);ti[t]=i}),t.clearPrewarmedResources=function(){let t=a;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(F),a=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return ts().getRTLTextPluginStatus()},t.getVersion=function(){return d},t.getWorkerCount=function(){return N.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return j().broadcast("importScript",t)},t.prewarm=function(){U().acquire(F)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return ts().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){N.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}}),t}()}},a={};function o(t){var e=a[t];if(void 0!==e)return e.exports;var i=a[t]={id:t,loaded:!1,exports:{}};return r[t].call(i.exports,i,i.exports,o),i.loaded=!0,i.exports}o.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return o.d(e,{a:e}),e},(()=>{var t,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;o.t=function(i,n){if(1&n&&(i=this(i)),8&n||"object"==typeof i&&i&&(4&n&&i.__esModule||16&n&&"function"==typeof i.then))return i;var r=Object.create(null);o.r(r);var a={};t=t||[null,e({}),e([]),e(e)];for(var s=2&n&&i;"object"==typeof s&&!~t.indexOf(s);s=e(s))Object.getOwnPropertyNames(s).forEach(t=>{a[t]=()=>i[t]});return a.default=()=>i,o.d(r,a),r}})(),o.d=(t,e)=>{for(var i in e)o.o(e,i)&&!o.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},o.g=(()=>{if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(t){if("object"==typeof window)return window}})(),o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),o.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var s={};return(()=>{"use strict";let t;o.r(s),o.d(s,{OrMapLoadedEvent:()=>rJ,geoJsonPointInputTemplateProvider:()=>r6,OrMapMarkerClickedEvent:()=>en,OrMap:()=>r7,OrMapMarker:()=>er,OrMapAssetCard:()=>rY,getMarkerConfigAttributeName:()=>es,Util:()=>p,DefaultConfig:()=>rW,CenterControl:()=>r2,OrMapAssetCardLoadAssetEvent:()=>rZ,getMarkerConfigForAssetType:()=>eo,OrMapLongPressEvent:()=>r0,OrMapMarkerChangedEvent:()=>ei,CoordinatesControl:()=>r4,OrMapMarkerAsset:()=>el,OrMapGeocoderChangeEvent:()=>r1,OrMapClickedEvent:()=>rQ});var e,i,n,r,a,l,c,d,u,h,p={};o.r(p),o.d(p,{getGeoJSONPoint:()=>tY,getLatLngBounds:()=>tJ,getLngLat:()=>tW,getLngLatBounds:()=>tK,getMarkerIconAndColorFromAssetType:()=>tQ});var m=o(801),f=o.n(m);function g(t,e,i){return{index:t,removed:e,addedCount:i}}window.JSCompiler_renameProperty=function(t,e){return t};let _=0,b=0,y=[],v=0,x=!1,w=document.createTextNode("");new window.MutationObserver(function(){x=!1;let t=y.length;for(let e=0;e<t;e++){let t=y[e];if(t)try{t()}catch(t){setTimeout(()=>{throw t})}}y.splice(0,t),b+=t}).observe(w,{characterData:!0});let k={run:t=>(x||(x=!0,w.textContent=v++),y.push(t),_++),cancel(t){let e=t-b;if(e>=0){if(!y[e])throw Error("invalid async handle: "+t);y[e]=null}}},E=window.ShadyDOM&&window.ShadyDOM.noPatch&&window.ShadyDOM.wrap?window.ShadyDOM.wrap:window.ShadyDOM?t=>ShadyDOM.patch(t):t=>t;function C(t){return"slot"===t.localName}let A=class{static getFlattenedNodes(t){let e=E(t);return C(t)?e.assignedNodes({flatten:!0}):Array.from(e.childNodes).map(t=>C(t)?E(t).assignedNodes({flatten:!0}):[t]).reduce((t,e)=>t.concat(e),[])}constructor(t,e){this._shadyChildrenObserver=null,this._nativeChildrenObserver=null,this._connected=!1,this._target=t,this.callback=e,this._effectiveNodes=[],this._observer=null,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){C(this._target)?this._listenSlots([this._target]):E(this._target).children&&(this._listenSlots(E(this._target).children),window.ShadyDOM?this._shadyChildrenObserver=window.ShadyDOM.observeChildren(this._target,t=>{this._processMutations(t)}):(this._nativeChildrenObserver=new MutationObserver(t=>{this._processMutations(t)}),this._nativeChildrenObserver.observe(this._target,{childList:!0}))),this._connected=!0}disconnect(){C(this._target)?this._unlistenSlots([this._target]):E(this._target).children&&(this._unlistenSlots(E(this._target).children),window.ShadyDOM&&this._shadyChildrenObserver?(window.ShadyDOM.unobserveChildren(this._shadyChildrenObserver),this._shadyChildrenObserver=null):this._nativeChildrenObserver&&(this._nativeChildrenObserver.disconnect(),this._nativeChildrenObserver=null)),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,k.run(()=>this.flush()))}_processMutations(t){this._processSlotMutations(t),this.flush()}_processSlotMutations(t){if(t)for(let e=0;e<t.length;e++){let i=t[e];i.addedNodes&&this._listenSlots(i.addedNodes),i.removedNodes&&this._unlistenSlots(i.removedNodes)}}flush(){var t;if(!this._connected)return!1;window.ShadyDOM&&ShadyDOM.flush(),this._nativeChildrenObserver?this._processSlotMutations(this._nativeChildrenObserver.takeRecords()):this._shadyChildrenObserver&&this._processSlotMutations(this._shadyChildrenObserver.takeRecords()),this._scheduled=!1;let e={target:this._target,addedNodes:[],removedNodes:[]},i=this.constructor.getFlattenedNodes(this._target),n=(t=this._effectiveNodes,function(t,e,i,n,r,a){let o,s=0,l=0,c=Math.min(i-e,a-r);if(0==e&&0==r&&(s=function(t,e,i){for(let r=0;r<i;r++){var n;if(n=t[r],n!==e[r])return r}return i}(t,n,c)),i==t.length&&a==n.length&&(l=function(t,e,i){var n;let r=t.length,a=e.length,o=0;for(;o<i&&(n=t[--r],n===e[--a]);)o++;return o}(t,n,c-s)),e+=s,r+=s,i-=l,a-=l,i-e==0&&a-r==0)return[];if(e==i){for(o=g(e,[],0);r<a;)o.removed.push(n[r++]);return[o]}if(r==a)return[g(e,[],i-e)];let d=function(t){let e=t.length-1,i=t[0].length-1,n=t[e][i],r=[];for(;e>0||i>0;){let a;if(0==e){r.push(2),i--;continue}if(0==i){r.push(3),e--;continue}let o=t[e-1][i-1],s=t[e-1][i],l=t[e][i-1];(a=s<l?s<o?s:o:l<o?l:o)==o?(o==n?r.push(0):(r.push(1),n=o),e--,i--):a==s?(r.push(3),e--,n=s):(r.push(2),i--,n=l)}return r.reverse(),r}(function(t,e,i,n,r,a){let o=a-r+1,s=i-e+1,l=Array(o);for(let t=0;t<o;t++)l[t]=Array(s),l[t][0]=t;for(let t=0;t<s;t++)l[0][t]=t;for(let i=1;i<o;i++)for(let a=1;a<s;a++){var c;if(c=t[e+a-1],c===n[r+i-1])l[i][a]=l[i-1][a-1];else{let t=l[i-1][a]+1,e=l[i][a-1]+1;l[i][a]=t<e?t:e}}return l}(t,e,i,n,r,a));o=void 0;let u=[],h=e,p=r;for(let t=0;t<d.length;t++)switch(d[t]){case 0:o&&(u.push(o),o=void 0),h++,p++;break;case 1:o||(o=g(h,[],0)),o.addedCount++,h++,o.removed.push(n[p]),p++;break;case 2:o||(o=g(h,[],0)),o.addedCount++,h++;break;case 3:o||(o=g(h,[],0)),o.removed.push(n[p]),p++}return o&&u.push(o),u}(i,0,i.length,t,0,t.length));for(let t=0,i;t<n.length&&(i=n[t]);t++)for(let t=0,n;t<i.removed.length&&(n=i.removed[t]);t++)e.removedNodes.push(n);for(let t=0,r;t<n.length&&(r=n[t]);t++)for(let t=r.index;t<r.index+r.addedCount;t++)e.addedNodes.push(i[t]);this._effectiveNodes=i;let r=!1;return(e.addedNodes.length||e.removedNodes.length)&&(r=!0,this.callback.call(this._target,e)),r}_listenSlots(t){for(let e=0;e<t.length;e++){let i=t[e];C(i)&&i.addEventListener("slotchange",this._boundSchedule)}}_unlistenSlots(t){for(let e=0;e<t.length;e++){let i=t[e];C(i)&&i.removeEventListener("slotchange",this._boundSchedule)}}},T=globalThis,I=T.ShadowRoot&&(void 0===T.ShadyCSS||T.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,S=Symbol(),z=new WeakMap;class M{constructor(t,e,i){if(this._$cssResult$=!0,i!==S)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(I&&void 0===t){let i=void 0!==e&&1===e.length;i&&(t=z.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&z.set(e,t))}return t}toString(){return this.cssText}}let P=t=>new M("string"==typeof t?t:t+"",void 0,S),R=(t,...e)=>new M(1===t.length?t[0]:e.reduce((e,i,n)=>e+(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[n+1],t[0]),t,S),O=I?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return P(e)})(t):t,{is:D,defineProperty:B,getOwnPropertyDescriptor:F,getOwnPropertyNames:N,getOwnPropertySymbols:V,getPrototypeOf:U}=Object,$=globalThis,j=$.trustedTypes,H=j?j.emptyScript:"",q=$.reactiveElementPolyfillSupport,G={toAttribute(t,e){switch(e){case Boolean:t=t?H:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){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}},X=(t,e)=>!D(t,e),Z={attribute:!0,type:String,converter:G,reflect:!1,useDefault:!1,hasChanged:X};Symbol.metadata??=Symbol("metadata"),$.litPropertyMetadata??=new WeakMap;class W 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,e=Z){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&B(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){let{get:n,set:r}=F(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:n,set(e){let a=n?.call(this);r?.call(this,e),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Z}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let t=U(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 e of[...N(t),...V(t)])this.createProperty(e,t[e])}let t=this[Symbol.metadata];if(null!==t){let e=litPropertyMetadata.get(t);if(void 0!==e)for(let[t,i]of e)this.elementProperties.set(t,i)}for(let[t,e]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t))for(let i of new Set(t.flat(1/0).reverse()))e.unshift(O(i));else void 0!==t&&e.push(O(t));return e}static _$Eu(t,e){let i=e.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 e of this.constructor.elementProperties.keys())this.hasOwnProperty(e)&&(t.set(e,this[e]),delete this[e]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(I)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let i of e){let e=document.createElement("style"),n=T.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=i.cssText,t.appendChild(e)}})(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,e,i){this._$AK(t,i)}_$ET(t,e){let i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){let r=(void 0!==i.converter?.toAttribute?i.converter:G).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){let i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){let t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:G;this._$Em=n;let a=r.fromAttribute(e,t.type);this[n]=a??this._$Ej?.get(n)??a,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){let n=this.constructor,r=this[t];if(!(((i??=n.getPropertyOptions(t)).hasChanged??X)(r,e)||i.useDefault&&i.reflect&&r===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:n,wrapped:r},a){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,a??e??this[t]),!0!==r||void 0!==a)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===n&&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,e]of this._$Ep)this[t]=e;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[e,i]of t){let{wrapped:t}=i,n=this[e];!0!==t||this._$AL.has(e)||void 0===n||this.C(e,void 0,i,n)}}let t=!1,e=this._$AL;try{(t=this.shouldUpdate(e))?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}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){}}W.elementStyles=[],W.shadowRootOptions={mode:"open"},W.elementProperties=new Map,W.finalized=new Map,q?.({ReactiveElement:W}),($.reactiveElementVersions??=[]).push("2.1.1");let Y=globalThis,K=Y.trustedTypes,J=K?K.createPolicy("lit-html",{createHTML:t=>t}):void 0,Q="$lit$",tt=`lit$${Math.random().toFixed(9).slice(2)}$`,te="?"+tt,ti=`<${te}>`,tn=document,tr=()=>tn.createComment(""),ta=t=>null===t||"object"!=typeof t&&"function"!=typeof t,to=Array.isArray,ts=t=>to(t)||"function"==typeof t?.[Symbol.iterator],tl="[ \n\f\r]",tc=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,td=/-->/g,tu=/>/g,th=RegExp(`>|${tl}(?:([^\\s"'>=/]+)(${tl}*=${tl}*(?:[^
52
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),tp=/'/g,tm=/"/g,tf=/^(?:script|style|textarea|title)$/i,tg=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),t_=tg(1),tb=(tg(2),tg(3),Symbol.for("lit-noChange")),ty=Symbol.for("lit-nothing"),tv=new WeakMap,tx=tn.createTreeWalker(tn,129);function tw(t,e){if(!to(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==J?J.createHTML(e):e}let tk=(t,e)=>{let i=t.length-1,n=[],r,a=2===e?"<svg>":3===e?"<math>":"",o=tc;for(let e=0;e<i;e++){let i=t[e],s,l,c=-1,d=0;for(;d<i.length&&(o.lastIndex=d,null!==(l=o.exec(i)));)d=o.lastIndex,o===tc?"!--"===l[1]?o=td:void 0!==l[1]?o=tu:void 0!==l[2]?(tf.test(l[2])&&(r=RegExp("</"+l[2],"g")),o=th):void 0!==l[3]&&(o=th):o===th?">"===l[0]?(o=r??tc,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?th:'"'===l[3]?tm:tp):o===tm||o===tp?o=th:o===td||o===tu?o=tc:(o=th,r=void 0);let u=o===th&&t[e+1].startsWith("/>")?" ":"";a+=o===tc?i+ti:c>=0?(n.push(s),i.slice(0,c)+Q+i.slice(c)+tt+u):i+tt+(-2===c?e:u)}return[tw(t,a+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),n]};class tE{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,a=0,o=t.length-1,s=this.parts,[l,c]=tk(t,e);if(this.el=tE.createElement(l,i),tx.currentNode=this.el.content,2===e||3===e){let t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=tx.nextNode())&&s.length<o;){if(1===n.nodeType){if(n.hasAttributes())for(let t of n.getAttributeNames())if(t.endsWith(Q)){let e=c[a++],i=n.getAttribute(t).split(tt),o=/([.?@])?(.*)/.exec(e);s.push({type:1,index:r,name:o[2],strings:i,ctor:"."===o[1]?tS:"?"===o[1]?tz:"@"===o[1]?tL:tI}),n.removeAttribute(t)}else t.startsWith(tt)&&(s.push({type:6,index:r}),n.removeAttribute(t));if(tf.test(n.tagName)){let t=n.textContent.split(tt),e=t.length-1;if(e>0){n.textContent=K?K.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],tr()),tx.nextNode(),s.push({type:2,index:++r});n.append(t[e],tr())}}}else if(8===n.nodeType)if(n.data===te)s.push({type:2,index:r});else{let t=-1;for(;-1!==(t=n.data.indexOf(tt,t+1));)s.push({type:7,index:r}),t+=tt.length-1}r++}}static createElement(t,e){let i=tn.createElement("template");return i.innerHTML=t,i}}function tC(t,e,i=t,n){if(e===tb)return e;let r=void 0!==n?i._$Co?.[n]:i._$Cl,a=ta(e)?void 0:e._$litDirective$;return r?.constructor!==a&&(r?._$AO?.(!1),void 0===a?r=void 0:(r=new a(t))._$AT(t,i,n),void 0!==n?(i._$Co??=[])[n]=r:i._$Cl=r),void 0!==r&&(e=tC(t,r._$AS(t,e.values),r,n)),e}class tA{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:i}=this._$AD,n=(t?.creationScope??tn).importNode(e,!0);tx.currentNode=n;let r=tx.nextNode(),a=0,o=0,s=i[0];for(;void 0!==s;){if(a===s.index){let e;2===s.type?e=new tT(r,r.nextSibling,this,t):1===s.type?e=new s.ctor(r,s.name,s.strings,this,t):6===s.type&&(e=new tM(r,this,t)),this._$AV.push(e),s=i[++o]}a!==s?.index&&(r=tx.nextNode(),a++)}return tx.currentNode=tn,n}p(t){let e=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class tT{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=ty,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){ta(t=tC(this,t,e))?t===ty||null==t||""===t?(this._$AH!==ty&&this._$AR(),this._$AH=ty):t!==this._$AH&&t!==tb&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):ts(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!==ty&&ta(this._$AH)?this._$AA.nextSibling.data=t:this.T(tn.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=tE.createElement(tw(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(e);else{let t=new tA(n,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=tv.get(t.strings);return void 0===e&&tv.set(t.strings,e=new tE(t)),e}k(t){to(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,n=0;for(let r of t)n===e.length?e.push(i=new tT(this.O(tr()),this.O(tr()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tI{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,r){this.type=1,this._$AH=ty,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ty}_$AI(t,e=this,i,n){let r=this.strings,a=!1;if(void 0===r)(a=!ta(t=tC(this,t,e,0))||t!==this._$AH&&t!==tb)&&(this._$AH=t);else{let n,o,s=t;for(t=r[0],n=0;n<r.length-1;n++)(o=tC(this,s[i+n],e,n))===tb&&(o=this._$AH[n]),a||=!ta(o)||o!==this._$AH[n],o===ty?t=ty:t!==ty&&(t+=(o??"")+r[n+1]),this._$AH[n]=o}a&&!n&&this.j(t)}j(t){t===ty?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class tS extends tI{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ty?void 0:t}}class tz extends tI{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ty)}}class tL extends tI{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){if((t=tC(this,t,e,0)??ty)===tb)return;let i=this._$AH,n=t===ty&&i!==ty||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==ty&&(i===ty||n);n&&this.element.removeEventListener(this.name,this,i),r&&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 tM{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){tC(this,t)}}let tP=Y.litHtmlPolyfillSupport;tP?.(tE,tT),(Y.litHtmlVersions??=[]).push("3.3.1");let tR=globalThis;class tO extends W{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 e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,i)=>{let n=i?.renderBefore??e,r=n._$litPart$;if(void 0===r){let t=i?.renderBefore??null;n._$litPart$=r=new tT(e.insertBefore(tr(),t),t,void 0,i??{})}return r._$AI(t),r})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return tb}}tO._$litElement$=!0,tO.finalized=!0,tR.litElementHydrateSupport?.({LitElement:tO});let tD=tR.litElementPolyfillSupport;tD?.({LitElement:tO}),(tR.litElementVersions??=[]).push("4.2.1");let tB=t=>(e,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},tF={attribute:!0,type:String,converter:G,reflect:!1,hasChanged:X};function tN(t){return(e,i)=>"object"==typeof i?((t=tF,e,i)=>{let{kind:n,metadata:r}=i,a=globalThis.litPropertyMetadata.get(r);if(void 0===a&&globalThis.litPropertyMetadata.set(r,a=new Map),"setter"===n&&((t=Object.create(t)).wrapped=!0),a.set(i.name,t),"accessor"===n){let{name:n}=i;return{set(i){let r=e.get.call(this);e.set.call(this,i),this.requestUpdate(n,r,t)},init(e){return void 0!==e&&this.C(n,void 0,t,e),e}}}if("setter"===n){let{name:n}=i;return function(i){let r=this[n];e.call(this,i),this.requestUpdate(n,r,t)}}throw Error("Unsupported decorator location: "+n)})(t,e,i):((t,e,i)=>{let n=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),n?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function tV(t){return tN({...t,state:!0,attribute:!1})}let tU=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function t$(t,e){return(i,n,r)=>{let a=e=>e.renderRoot?.querySelector(t)??null;if(e){let{get:t,set:e}="object"==typeof n?i:r??(()=>{let t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return tU(i,n,{get(){let i=t.call(this);return void 0===i&&(null!==(i=a(this))||this.hasUpdated)&&e.call(this,i),i}})}return tU(i,n,{get(){return a(this)}})}}var tj=o(266),tH=o.n(tj),tq=o(230),tG=o.n(tq);o(811);var tX=o(891),tZ=o(297);function tW(t){if(t){if(t instanceof tj.LngLat)return t;if(t.lat)return t.lon?{lng:t.lon,lat:t.lat}:{lng:t.lng,lat:t.lat};if(Array.isArray(t))return{lng:t[0],lat:t[1]};if(t.coordinates&&Array.isArray(t.coordinates)&&t.coordinates.length>=2)return tW(t.coordinates);if(t.attributes){let e=t.attributes.location;return e&&e.value?tW(e.value):void 0}if(t.value)return tW(t.value)}}function tY(t){if(t)return Array.isArray(t)?{type:"Point",coordinates:t}:{type:"Point",coordinates:[t.hasOwnProperty("lng")?t.lng:t.lon,t.lat]}}function tK(t){if(t){if(t instanceof tj.LngLatBounds)return t;if(2===t.length){let e=tW(t[0]),i=tW(t[1]);if(e&&i)return new tj.LngLatBounds(e,i)}if(4===t.length)return new tj.LngLatBounds([t[0],t[1],t[2],t[3]])}}function tJ(t){let e=tK(t);if(e)return L.latLngBounds(e.getNorthEast(),e.getSouthWest())}function tQ(t,e){if(!t)return;let i="string"==typeof t?tZ.AssetModelUtil.getAssetDescriptor(t):t,n=i&&i.icon?i.icon:"help-circle",r=i&&i.colour?i.colour:void 0;if(e&&e.markerConfig){let t=e.markerConfig,i=e.currentValue;if("range"===t.type&&t.ranges&&"number"==typeof i){let e=t.ranges;r=(e.sort((t,e)=>e.min-t.min).find(t=>i>=t.min)||e.reduce((t,e)=>e.min>t.min?t:e)).colour||void 0}else"boolean"===t.type?r=t[!!i+""]:"string"===t.type&&(r=t[i+""])}return{color:r,icon:n}}function t0(t){let e=t.match(/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/);if(!e)throw Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function t1(t,e){let i=t0("https://api.mapbox.com");t.protocol=i.protocol,t.authority=i.authority,t.params.push(`access_token=${e}`);let n=t.params.length?`?${t.params.join("&")}`:"";return`${t.protocol}://${t.authority}${t.path}${n}`}var t2=function(t,e,i,n){return new(i||(i=Promise))(function(r,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(o,s)}l((n=n.apply(t,e||[])).next())})};let t5=o(278),t3=o(569),t4=o(811);class t6{constructor(t,e,i,n=!1,r=!1,a=!0,o=!0){this._loaded=!1,this._markersJs=new Map,this._markersGl=new Map,this._geoJsonSources=[],this._geoJsonLayers=new Map,this._showGeoCodingControl=!1,this._showBoundaryBox=!1,this._useZoomControls=!0,this._showGeoJson=!0,this._clickHandlers=new Map,this._type=t,this._styleParent=e,this._mapContainer=i,this._showGeoCodingControl=n,this._showBoundaryBox=r,this._useZoomControls=a,this._showGeoJson=o}setCenter(t){switch(this._center=tW(t),this._type){case"RASTER":if(this._mapJs){let t=tW(this._center)||(this._viewSettings?tW(this._viewSettings.center):void 0);t&&this._mapJs.setView(t,void 0,{pan:{animate:!1},zoom:{animate:!1}})}break;case"VECTOR":this._mapGl&&this._center&&this._mapGl.setCenter(this._center)}return this}flyTo(t,e){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":t||(t=this._center?this._center:this._viewSettings?this._viewSettings.center:void 0),e||(e=this._zoom?this._zoom:this._viewSettings&&this._viewSettings.zoom?this._viewSettings.zoom:void 0),this._mapGl?t&&this._mapGl.flyTo({center:t,zoom:e}):(this._center=t,this._zoom=e)}return this}resize(){switch(this._type){case"RASTER":this._mapJs;break;case"VECTOR":this._mapGl&&this._mapGl.resize()}return this}setZoom(t){switch(this._zoom=t,this._type){case"RASTER":this._mapJs&&this._zoom&&this._mapJs.setZoom(this._zoom,{animate:!1});break;case"VECTOR":this._mapGl&&this._zoom&&this._mapGl.setZoom(this._zoom)}return this}setControls(t){return this._controls=t,this._mapGl&&(this._controls?this._controls.forEach(t=>{Array.isArray(t)?this._mapGl.addControl(t[0],t[1]):this._mapGl.addControl(t)}):this._mapGl.addControl(new tj.NavigationControl)),this}setGeoJson(t){var e;return this._geoJsonConfig=t,this._mapGl&&(this._geoJsonConfig?this.loadGeoJSON(this._geoJsonConfig):this.loadGeoJSON(null==(e=this._viewSettings)?void 0:e.geoJson)),this}loadViewSettings(){return t2(this,void 0,void 0,function*(){var t;let e=("RASTER"===this._type?yield f().rest.api.MapResource.getSettingsJs():yield f().rest.api.MapResource.getSettings()).data;if(e.override)return e.override;let i=f().displayRealm||"default";return this._viewSettings=e.options?e.options[i]?e.options[i]:e.options.default:null,this._viewSettings&&(this._mapGl&&(this._mapGl.setMinZoom(this._viewSettings.minZoom),this._mapGl.setMaxZoom(this._viewSettings.maxZoom),this._viewSettings.bounds&&this._mapGl.setMaxBounds(this._viewSettings.bounds),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(t=this._viewSettings)?void 0:t.geoJson)),this._center?this.setCenter(this._center):this.setCenter(this._viewSettings.center)),e})}load(){return t2(this,void 0,void 0,function*(){var e;if(!this._loaded){if("RASTER"===this._type){let t,e=document.createElement("style");e.id="mapboxJsStyle",e.textContent=t5,this._styleParent.appendChild(e);let i=yield this.loadViewSettings();if(this._viewSettings){if((t={}).zoom=this._viewSettings.zoom?this._viewSettings.zoom+1:void 0,this._useZoomControls&&(t.maxZoom=this._viewSettings.maxZoom?this._viewSettings.maxZoom-1:void 0,t.minZoom=this._viewSettings.minZoom?this._viewSettings.minZoom+1:void 0),t.boxZoom=this._viewSettings.boxZoom,this._viewSettings.bounds&&(t.maxBounds=tJ(this._viewSettings.bounds)),this._viewSettings.center){let e=tW(this._viewSettings.center);t.center=e?L.latLng(e.lat,e.lng):void 0}if(this._center){let e=tW(this._center);t.center=e?L.latLng(e.lat,e.lng):void 0}this._zoom&&(t.zoom=this._zoom+1)}if(this._mapJs=L.mapbox.map(this._mapContainer,i,t),this._mapJs.on("click",t=>{this._onMapClick(t.latlng)}),t&&t.maxBounds){let e=this._mapJs.getBoundsZoom(t.maxBounds,!0);(!t.minZoom||t.minZoom<e)&&this._mapJs.setMinZoom(e)}}else{let i=document.createElement("style");i.id="maplibreGlStyle",i.textContent=t3,this._styleParent.appendChild(i),(i=document.createElement("style")).id="maplibreGeoCoderStyles",i.textContent=t4,this._styleParent.appendChild(i);let n=yield Promise.resolve().then(o.t.bind(o,266,23)),r=yield this.loadViewSettings(),a={attributionControl:{compact:!0},container:this._mapContainer,style:r,transformRequest:(e,i)=>{if(t||(t=new URL(e).searchParams.get("access_token")||""),0===e.indexOf("mapbox:")){var n;return n=t,e.indexOf("/styles/")>-1&&-1===e.indexOf("/sprite")?{url:function(t,e){let i=t0(t);return i.path=`/styles/v1${i.path}`,t1(i,e)}(e,n)}:e.indexOf("/sprites/")>-1?{url:function(t,e){let i=t0(t),n=i.path.split("."),r=n[0],a=n[1],o="";return r.indexOf("@2x")&&(r=r.split("@2x")[0],o="@2x"),i.path=`/styles/v1${r}/sprite${o}.${a}`,t1(i,e)}(e,n)}:e.indexOf("/fonts/")>-1?{url:function(t,e){let i=t0(t);return i.path=`/fonts/v1${i.path}`,t1(i,e)}(e,n)}:e.indexOf("/v4/")>-1||"Source"===i?{url:function(t,e){let i=t0(t);return i.path=`/v4/${i.authority}.json`,i.params.push("secure"),t1(i,e)}(e,n)}:void 0}return{headers:new URL(window.origin).hostname===new URL(e).hostname?{Authorization:f().getAuthorizationHeader()}:{},url:e}}};if(this._viewSettings&&(this._useZoomControls&&(a.maxZoom=this._viewSettings.maxZoom,a.minZoom=this._viewSettings.minZoom),this._viewSettings.bounds&&!this._showBoundaryBox&&(a.maxBounds=this._viewSettings.bounds),a.boxZoom=this._viewSettings.boxZoom,a.zoom=this._viewSettings.zoom,a.center=this._viewSettings.center),this._center=this._center||(this._viewSettings?this._viewSettings.center:void 0),a.center=this._center,this._zoom&&(a.zoom=this._zoom),!this.isWebglSupported())return void console.warn("WebGL is not supported in this environment. The map cannot be initialized.");this._mapGl=new n.Map(a),yield this.styleLoaded(),this._mapGl.on("click",t=>{this._onMapClick(t.lngLat)}),this._mapGl.on("dblclick",t=>{this._onMapClick(t.lngLat,!0)}),this._showGeoCodingControl&&this._viewSettings&&this._viewSettings.geocodeUrl&&(this._geocoder=new(tG())({forwardGeocode:this._forwardGeocode.bind(this),reverseGeocode:this._reverseGeocode},{maplibregl:tH(),showResultsWhileTyping:!0}),this._geocoder._onKeyDown=(0,tX.debounce)(t=>{if(27===t.keyCode&&this._geocoder.options.clearAndBlurOnEsc)return this._geocoder._clear(t),this._geocoder._inputEl.blur();var e=this._geocoder._inputEl.value||t.key;if(!e)return this._geocoder.fresh=!0,9!==t.keyCode&&this._geocoder.clear(t),this._geocoder._clearEl.style.display="none";if(!t.metaKey&&-1===[9,27,37,39,38,40].indexOf(t.keyCode)){if(13===t.keyCode)if(this._geocoder.options.showResultsWhileTyping){this._geocoder.options.showResultMarkers&&this._geocoder._fitBoundsForMarkers(),this._geocoder._inputEl.value=this._geocoder._typeahead.query,this._geocoder.lastSelected=null,this._geocoder._typeahead.selected=null;return}else this._geocoder._typeahead.list.selectingListItem||this._geocoder._geocode(e);e.length>=this._geocoder.options.minLength&&this._geocoder.options.showResultsWhileTyping&&this._geocoder._geocode(e)}},300),this._mapGl.addControl(this._geocoder,"top-left"),this._geocoder._inputEl.addEventListener("change",()=>{var t=this._geocoder._typeahead.selected;this._onGeocodeChange(t)})),this._controls?this._controls.forEach(t=>{Array.isArray(t)?this._mapGl.addControl(t[0],t[1]):this._mapGl.addControl(t)}):(this._mapGl.addControl(new tj.NavigationControl),this._mapGl.addControl(new tj.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!0,showUserLocation:!0}))),this._geoJsonConfig?yield this.loadGeoJSON(this._geoJsonConfig):yield this.loadGeoJSON(null==(e=this._viewSettings)?void 0:e.geoJson),this._initLongPressEvent()}this._mapContainer.dispatchEvent(new rJ),this._loaded=!0,this.createBoundaryBox()}})}styleLoaded(){return new Promise(t=>{this._mapGl&&this._mapGl.once("style.load",()=>{t()})})}unload(){this._mapGl&&(this._mapGl.remove(),this._mapGl=void 0),this._mapJs&&(this._mapJs.remove(),this._mapJs=void 0)}_onMapClick(t,e=!1){this._mapContainer.dispatchEvent(new rQ(t,e))}loadGeoJSON(t){return t2(this,void 0,void 0,function*(){if(this._geoJsonLayers.size>0&&(this._geoJsonLayers.forEach((t,e)=>this._mapGl.removeLayer(e)),this._geoJsonLayers=new Map),this._geoJsonSources.length>0&&(this._geoJsonSources.forEach(t=>this._mapGl.removeSource(t)),this._geoJsonSources=[]),this._showGeoJson&&t)if("FeatureCollection"==t.source.type){let e=this.groupSourcesByGeometryType(t.source);null==e||e.forEach((t,e)=>{let i=this.addGeoJSONSource({type:"geojson",data:{type:"FeatureCollection",features:t}});i&&this.addGeoJSONLayer(e,i.sourceId)})}else if("Feature"==t.source.type){let e=this.addGeoJSONSource(t.source);e&&this.addGeoJSONLayer(e.source.type,e.sourceId)}else console.error("Could not create layer since source type is neither 'FeatureCollection' nor 'Feature'.")})}groupSourcesByGeometryType(t){let e=new Map;return t.features.forEach(t=>{let i=e.get(t.geometry.type);void 0==i&&(i=[]),i.push(t),e.set(t.geometry.type,i)}),e}addGeoJSONSource(t){if(!this._mapGl)return void console.error("mapGl instance not found!");let e=Date.now()+"-"+(this._geoJsonSources.length+1);return this._mapGl.addSource(e,t),this._geoJsonSources.push(e),{source:t,sourceId:e}}addGeoJSONLayer(t,e){if(!this._mapGl)return void console.error("mapGl instance not found!");let i=e+"-"+t;if(void 0==this._geoJsonLayers.get(i)){let n=getComputedStyle(this._mapContainer).getPropertyValue("--or-app-color4");(void 0==n||0==n.length)&&(n=m.DefaultColor4);let r={id:i,source:e};switch(t){case"Point":case"MultiPoint":r.type="circle",r.paint={"circle-radius":12,"circle-color":n},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);break;case"LineString":case"MultiLineString":r.type="line",r.paint={"line-color":n,"line-width":4},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);break;case"Polygon":case"MultiPolygon":{r.type="fill",r.paint={"fill-color":n,"fill-opacity":.3},this._geoJsonLayers.set(i,r),this._mapGl.addLayer(r);let t=i+"-outline",a={id:t,source:e,type:"line",paint:{"line-color":n,"line-width":2}};this._geoJsonLayers.set(t,a),this._mapGl.addLayer(a);break}case"GeometryCollection":return void console.error("GeometryCollection GeoJSON is not implemented yet!")}}}addMarker(t){t.hasPosition()&&this._updateMarkerElement(t,!0)}removeMarker(t){this._removeMarkerRadius(t),this._updateMarkerElement(t,!1)}onMarkerChanged(t,e){if(this._loaded)switch(e){case"lat":case"lng":case"radius":t.hasPosition()?t._actualMarkerElement?this._updateMarkerPosition(t):this._updateMarkerElement(t,!0):t._actualMarkerElement&&this._updateMarkerElement(t,!1)}}_updateMarkerPosition(t){switch(this._type){case"RASTER":let e=this._markersJs.get(t);e&&e.setLatLng([t.lat,t.lng]);break;case"VECTOR":let i=this._markersGl.get(t);i&&i.setLngLat([t.lng,t.lat])}this._createMarkerRadius(t)}_updateMarkerElement(t,e){switch(this._type){case"RASTER":let i=this._markersJs.get(t);if(i&&(this._removeMarkerClickHandler(t,t.markerContainer),t._actualMarkerElement=void 0,i.removeFrom(this._mapJs),this._markersJs.delete(t)),e){let e=t._createMarkerElement();if(e){let n=L.divIcon({html:e.outerHTML,className:"or-marker-raster"});(i=L.marker([t.lat,t.lng],{icon:n,clickable:t.interactive})).addTo(this._mapJs),t._actualMarkerElement=i.getElement()?i.getElement().firstElementChild:void 0,t.interactive&&this._addMarkerClickHandler(t,t.markerContainer),this._markersJs.set(t,i)}t.radius&&this._createMarkerRadius(t)}break;case"VECTOR":let n=this._markersGl.get(t);if(n&&(t._actualMarkerElement=void 0,this._removeMarkerClickHandler(t,n.getElement()),n.remove(),this._markersGl.delete(t)),e){let e=t._createMarkerElement();e&&(n=new tj.Marker({element:e,anchor:"top-left"}).setLngLat([t.lng,t.lat]).addTo(this._mapGl),this._markersGl.set(t,n),t._actualMarkerElement=n.getElement(),t.interactive&&this._addMarkerClickHandler(t,n.getElement())),t.radius&&this._createMarkerRadius(t)}}}_removeMarkerRadius(t){this._mapGl&&this._loaded&&t.radius&&t.lat&&t.lng&&this._mapGl.getSource("circleData")&&(this._mapGl.removeLayer("marker-radius-circle"),this._mapGl.removeSource("circleData"))}_createMarkerRadius(t){this._mapGl&&this._loaded&&t.radius&&t.lat&&t.lng&&(this._removeMarkerRadius(t),this._mapGl.addSource("circleData",{type:"geojson",data:{type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[t.lng,t.lat]},properties:{title:"You Found Me"}}]}}),this._mapGl.addLayer({id:"marker-radius-circle",type:"circle",source:"circleData",paint:{"circle-radius":["interpolate",["linear"],["zoom"],0,0,20,t.radius/.075/Math.cos(t.lat*Math.PI/180)],"circle-color":"red","circle-opacity":.3}}))}createBoundaryBox(t=[]){var e,i;if(this._mapGl&&this._loaded&&this._showBoundaryBox&&(null==(e=this._viewSettings)?void 0:e.bounds)){this._mapGl.getSource("bounds")&&(this._mapGl.removeLayer("bounds"),this._mapGl.removeSource("bounds")),4!==t.length&&(t=null==(i=this._viewSettings)?void 0:i.bounds.toString().split(","));var n=[[[t[0],t[3]],[t[2],t[3]],[t[2],t[1]],[t[0],t[1]],[t[0],t[3]]]];this._mapGl.fitBounds([parseFloat(t[0])+.01,parseFloat(t[1])-.01,parseFloat(t[2])-.01,parseFloat(t[3])+.01]),this._mapGl.addSource("bounds",{type:"geojson",data:{type:"Feature",properties:{},geometry:{type:"Polygon",coordinates:n}}}),this._mapGl.addLayer({id:"bounds",type:"fill",source:"bounds",paint:{"fill-color":"#FF0000","fill-opacity":.4}})}}_addMarkerClickHandler(t,e){if(e){let i=e=>{e.stopPropagation(),t._onClick(e)};this._clickHandlers.set(t,i),e.addEventListener("click",i)}}_removeMarkerClickHandler(t,e){let i=this._clickHandlers.get(t);i&&e&&(e.removeEventListener("click",i),this._clickHandlers.delete(t))}_forwardGeocode(t){return t2(this,void 0,void 0,function*(){let e=[];try{let i=this._viewSettings.geocodeUrl+"/search?q="+t.query+"&format=geojson&polygon_geojson=1&addressdetails=1",n=yield fetch(i);for(let t of(yield n.json()).features){let i=[t.bbox[0]+(t.bbox[2]-t.bbox[0])/2,t.bbox[1]+(t.bbox[3]-t.bbox[1])/2],n={type:"Feature",geometry:{type:"Point",coordinates:i},place_name:t.properties.display_name,properties:t.properties,text:t.properties.display_name,place_type:["place"],center:i};e.push(n)}}catch(t){console.error(`Failed to forwardGeocode with error: ${t}`)}return{features:e}})}_reverseGeocode(t){return t2(this,void 0,void 0,function*(){let e=[];try{let i=this._viewSettings.geocodeUrl+"/reverse?lat="+t.lat+"&lon="+t.lon+"&format=geojson&polygon_geojson=1&addressdetails=1",n=yield fetch(i);for(let t of(yield n.json()).features){let i=[t.bbox[0]+(t.bbox[2]-t.bbox[0])/2,t.bbox[1]+(t.bbox[3]-t.bbox[1])/2],n={type:"Feature",geometry:{type:"Point",coordinates:i},place_name:t.properties.display_name,properties:t.properties,text:t.properties.display_name,place_type:["place"],center:i};e.push(n)}}catch(t){console.error(`Failed to reverseGeocode with error: ${t}`)}return{features:e}})}_initLongPressEvent(){if(this._mapGl){let t,e,i=()=>{t&&clearTimeout(t),t=null};this._mapGl.on("touchstart",i=>{i.originalEvent.touches.length>1||(e=i.lngLat,t=setTimeout(()=>{this._onLongPress(e)},500))}),this._mapGl.on("mousedown",i=>{t||(e=i.lngLat,t=setTimeout(()=>{this._onLongPress(e),t=null},500))}),this._mapGl.on("dragstart",i),this._mapGl.on("mouseup",i),this._mapGl.on("touchend",i),this._mapGl.on("touchcancel",i),this._mapGl.on("touchmove",i),this._mapGl.on("moveend",i),this._mapGl.on("gesturestart",i),this._mapGl.on("gesturechange",i),this._mapGl.on("gestureend",i)}}_onLongPress(t){this._mapContainer.dispatchEvent(new r0(t))}_onGeocodeChange(t){this._mapContainer.dispatchEvent(new r1(t))}isWebglSupported(){if(window.WebGLRenderingContext){let t=document.createElement("canvas");try{let e=t.getContext("webgl2")||t.getContext("webgl");if(e&&"function"==typeof e.getParameter)return!0}catch(t){}}return!1}}let t7="--internal-or-map-marker-color",t8="--internal-or-map-marker-active-color",t9=R`
53
53
  :host {
54
54
  --internal-or-map-width: var(--or-map-width, 100%);
55
55
  --internal-or-map-min-height: var(--or-map-min-height, 300px);
56
56
  --internal-or-map-marker-transform: var(--or-map-marker-transform, translate(-16px, -29px));
57
57
  --internal-or-map-marker-width: var(--or-map-marker-width, 32px);
58
58
  --internal-or-map-marker-height: var(--or-map-marker-height, 32px);
59
- --internal-or-map-marker-color: var(--or-map-marker-color, var(--or-app-color4, ${tN(v.DefaultColor4)}));
59
+ --internal-or-map-marker-color: var(--or-map-marker-color, var(--or-app-color4, ${P(m.DefaultColor4)}));
60
60
  --internal-or-map-marker-stroke: var(--or-map-marker-stroke, none);
61
- --internal-or-map-marker-icon-color: var(--or-map-marker-icon-color, var(--or-app-color1, ${tN(v.DefaultColor1)}));
61
+ --internal-or-map-marker-icon-color: var(--or-map-marker-icon-color, var(--or-app-color1, ${P(m.DefaultColor1)}));
62
62
  --internal-or-map-marker-icon-stroke: var(--or-map-marker-icon-stroke, none);
63
63
  --internal-or-map-marker-icon-width: var(--or-map-marker-icon-width, 16px);
64
64
  --internal-or-map-marker-icon-height: var(--or-map-marker-icon-height, 16px);
@@ -66,9 +66,9 @@ uniform ${i} ${n} u_${r};
66
66
  --internal-or-map-marker-active-transform: var(--or-map-marker-active-transform, translate(-24px, -44px));
67
67
  --internal-or-map-marker-active-width: var(--or-map-marker-active-width, 48px);
68
68
  --internal-or-map-marker-active-height: var(--or-map-marker-active-height, 48px);
69
- --internal-or-map-marker-active-color: var(--or-map-marker-active-color, var(--or-app-color4, ${tN(v.DefaultColor4)}));
69
+ --internal-or-map-marker-active-color: var(--or-map-marker-active-color, var(--or-app-color4, ${P(m.DefaultColor4)}));
70
70
  --internal-or-map-marker-active-stroke: var(--or-map-marker-active-stroke, 2px);
71
- --internal-or-map-marker-icon-active-color: var(--or-map-marker-icon-active-color, var(--or-app-color1, ${tN(v.DefaultColor1)}));
71
+ --internal-or-map-marker-icon-active-color: var(--or-map-marker-icon-active-color, var(--or-app-color1, ${P(m.DefaultColor1)}));
72
72
  --internal-or-map-marker-icon-active-stroke: var(--or-map-marker-icon-active-stroke, none);
73
73
  --internal-or-map-marker-icon-active-width: var(--or-map-marker-icon-active-width, 24px);
74
74
  --internal-or-map-marker-icon-active-height: var(--or-map-marker-icon-active-height, 24px);
@@ -193,14 +193,14 @@ uniform ${i} ${n} u_${r};
193
193
  right: 12px;
194
194
  }
195
195
  }
196
- `,em=tV`
196
+ `,et=R`
197
197
  :host {
198
- --internal-or-map-asset-card-header-color: var(--or-map-asset-card-header-color, var(--or-app-color4, ${tN(v.DefaultColor4)}));
199
- --internal-or-map-asset-card-header-text-color: var(--or-map-asset-card-header-text-color, var(--or-app-color1, ${tN(v.DefaultColor1)}));
200
- --internal-or-map-asset-card-header-height: var(--or-map-asset-card-header-height, calc(${tN(v.DefaultHeaderHeight)} - 10px));
201
- --internal-or-map-asset-card-background-color: var(--or-map-asset-card-background-color, var(--or-app-color1, ${tN(v.DefaultColor1)}));
202
- --internal-or-map-asset-card-background-text-color: var(--or-map-asset-card-background-text-color, var(--or-app-color3, ${tN(v.DefaultColor3)}));
203
- --internal-or-map-asset-card-separator-color: var(--or-map-asset-card-separator-color, var(--or-app-color2, ${tN(v.DefaultColor2)}));
198
+ --internal-or-map-asset-card-header-color: var(--or-map-asset-card-header-color, var(--or-app-color4, ${P(m.DefaultColor4)}));
199
+ --internal-or-map-asset-card-header-text-color: var(--or-map-asset-card-header-text-color, var(--or-app-color1, ${P(m.DefaultColor1)}));
200
+ --internal-or-map-asset-card-header-height: var(--or-map-asset-card-header-height, calc(${P(m.DefaultHeaderHeight)} - 10px));
201
+ --internal-or-map-asset-card-background-color: var(--or-map-asset-card-background-color, var(--or-app-color1, ${P(m.DefaultColor1)}));
202
+ --internal-or-map-asset-card-background-text-color: var(--or-map-asset-card-background-text-color, var(--or-app-color3, ${P(m.DefaultColor3)}));
203
+ --internal-or-map-asset-card-separator-color: var(--or-map-asset-card-separator-color, var(--or-app-color2, ${P(m.DefaultColor2)}));
204
204
 
205
205
  display: block;
206
206
  }
@@ -219,7 +219,7 @@ uniform ${i} ${n} u_${r};
219
219
  height: var(--internal-or-map-asset-card-header-height);
220
220
  background-color: var(--internal-or-map-asset-card-header-color);
221
221
  line-height: var(--internal-or-map-asset-card-header-height);
222
- border-bottom: 1px solid ${tN(v.DefaultColor5)};
222
+ border-bottom: 1px solid ${P(m.DefaultColor5)};
223
223
  text-align: center;
224
224
  color: var(--internal-or-map-asset-card-header-text-color);
225
225
  --or-icon-fill: var(--internal-or-map-asset-card-header-text-color);
@@ -283,7 +283,7 @@ uniform ${i} ${n} u_${r};
283
283
  min-height: 134px;
284
284
  }
285
285
  }
286
- `;var ef=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class eg extends CustomEvent{constructor(t,e){super(eg.NAME,{detail:{marker:t,property:e},bubbles:!0,composed:!0})}}eg.NAME="or-map-marker-changed";class e_ extends CustomEvent{constructor(t){super(e_.NAME,{detail:{marker:t},bubbles:!0,composed:!0})}}e_.NAME="or-map-marker-clicked";let eb=c=class extends tK{constructor(){super(...arguments),this.visible=!0,this.interactive=!0,this.active=!1}static get styles(){return tV`
286
+ `;var ee=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class ei extends CustomEvent{constructor(t,e){super(ei.NAME,{detail:{marker:t,property:e},bubbles:!0,composed:!0})}}ei.NAME="or-map-marker-changed";class en extends CustomEvent{constructor(t){super(en.NAME,{detail:{marker:t},bubbles:!0,composed:!0})}}en.NAME="or-map-marker-clicked";let er=e=class extends tO{constructor(){super(...arguments),this.visible=!0,this.interactive=!0,this.active=!1}static get styles(){return R`
287
287
  .label {
288
288
  background-color: white;
289
289
  width: auto;
@@ -295,9 +295,9 @@ uniform ${i} ${n} u_${r};
295
295
  transform: translate(-50%, -50%);
296
296
  text-align: center;
297
297
  border-radius: 3px;
298
- -webkit-box-shadow: ${tN(v.DefaultBoxShadow)};
299
- -moz-box-shadow: ${tN(v.DefaultBoxShadow)};
300
- box-shadow: ${tN(v.DefaultBoxShadow)};
298
+ -webkit-box-shadow: ${P(m.DefaultBoxShadow)};
299
+ -moz-box-shadow: ${P(m.DefaultBoxShadow)};
300
+ box-shadow: ${P(m.DefaultBoxShadow)};
301
301
  }
302
302
  .label > span {
303
303
  white-space: nowrap;
@@ -350,9 +350,9 @@ uniform ${i} ${n} u_${r};
350
350
  r: 18px;
351
351
  stroke-width: 4px;
352
352
  }
353
- `}get markerContainer(){if(this._actualMarkerElement)return this._actualMarkerElement.firstElementChild}_onClick(t){this.dispatchEvent(new e_(this))}_createMarkerElement(){let t=document.createElement("div"),e=document.createElement("div");t.appendChild(e),this.addMarkerClassNames(t),this.addMarkerContainerClassNames(e);let i=this.createMarkerContent();return i||(t.classList.add("or-map-marker-default"),i=this.createDefaultMarkerContent()),e.appendChild(i),this.updateInteractive(t),this.updateVisibility(t),this.updateColor(e),this.updateActive(t),t}createMarkerContent(){let t=!1,e=document.createElement("div");if(this._slot&&this._slot.assignedNodes({flatten:!0}).forEach(i=>{i instanceof HTMLElement&&(e.appendChild(i.cloneNode(!0)),t=!0)}),t)return e}shouldUpdate(t){return(t.has("icon")||t.has("displayValue")||t.has("direction"))&&this.refreshMarkerContent(),(t.has("color")||t.has("activeColor"))&&this.updateColor(this.markerContainer),t.has("visible")&&this.updateVisibility(this._actualMarkerElement),t.has("interactive")&&this.updateInteractive(this._actualMarkerElement),t.has("active")&&(this.updateActive(this._actualMarkerElement),this.updateColor(this.markerContainer)),t.forEach((t,e)=>this._raisePropertyChange(e)),!1}updateVisibility(t){t&&(this.visible?t.removeAttribute("hidden"):t.setAttribute("hidden","true"))}getColor(){return this.color&&"unset"!==this.color?this.color:void 0}getActiveColor(){return this.activeColor&&"unset"!==this.activeColor?this.activeColor:void 0}updateColor(t){if(t){t.style.removeProperty(eu),t.style.removeProperty(eh);let e=this.getColor(),i=this.getActiveColor();e&&t.style.setProperty(eu,e),i&&t.style.setProperty(eh,i)}}updateActive(t){t&&(this.active?t.classList.add("active"):t.classList.remove("active"))}updateInteractive(t){t&&(this.interactive?t.classList.add("interactive"):t.classList.remove("interactive"))}refreshMarkerContent(){if(this.markerContainer){let t=this.createMarkerContent();t?this._actualMarkerElement.classList.remove("or-map-marker-default"):(this._actualMarkerElement.classList.add("or-map-marker-default"),t=this.createDefaultMarkerContent()),this.markerContainer.children.length>0&&this.markerContainer.removeChild(this.markerContainer.children[0]),this.markerContainer.appendChild(t)}}render(){return tg`
353
+ `}get markerContainer(){if(this._actualMarkerElement)return this._actualMarkerElement.firstElementChild}_onClick(t){this.dispatchEvent(new en(this))}_createMarkerElement(){let t=document.createElement("div"),e=document.createElement("div");t.appendChild(e),this.addMarkerClassNames(t),this.addMarkerContainerClassNames(e);let i=this.createMarkerContent();return i||(t.classList.add("or-map-marker-default"),i=this.createDefaultMarkerContent()),e.appendChild(i),this.updateInteractive(t),this.updateVisibility(t),this.updateColor(e),this.updateActive(t),t}createMarkerContent(){let t=!1,e=document.createElement("div");if(this._slot&&this._slot.assignedNodes({flatten:!0}).forEach(i=>{i instanceof HTMLElement&&(e.appendChild(i.cloneNode(!0)),t=!0)}),t)return e}shouldUpdate(t){return(t.has("icon")||t.has("displayValue")||t.has("direction"))&&this.refreshMarkerContent(),(t.has("color")||t.has("activeColor"))&&this.updateColor(this.markerContainer),t.has("visible")&&this.updateVisibility(this._actualMarkerElement),t.has("interactive")&&this.updateInteractive(this._actualMarkerElement),t.has("active")&&(this.updateActive(this._actualMarkerElement),this.updateColor(this.markerContainer)),t.forEach((t,e)=>this._raisePropertyChange(e)),!1}updateVisibility(t){t&&(this.visible?t.removeAttribute("hidden"):t.setAttribute("hidden","true"))}getColor(){return this.color&&"unset"!==this.color?this.color:void 0}getActiveColor(){return this.activeColor&&"unset"!==this.activeColor?this.activeColor:void 0}updateColor(t){if(t){t.style.removeProperty(t7),t.style.removeProperty(t8);let e=this.getColor(),i=this.getActiveColor();e&&t.style.setProperty(t7,e),i&&t.style.setProperty(t8,i)}}updateActive(t){t&&(this.active?t.classList.add("active"):t.classList.remove("active"))}updateInteractive(t){t&&(this.interactive?t.classList.add("interactive"):t.classList.remove("interactive"))}refreshMarkerContent(){if(this.markerContainer){let t=this.createMarkerContent();t?this._actualMarkerElement.classList.remove("or-map-marker-default"):(this._actualMarkerElement.classList.add("or-map-marker-default"),t=this.createDefaultMarkerContent()),this.markerContainer.children.length>0&&this.markerContainer.removeChild(this.markerContainer.children[0]),this.markerContainer.appendChild(t)}}render(){return t_`
354
354
  <slot></slot>
355
- `}_raisePropertyChange(t){this.dispatchEvent(new eg(this,t))}addMarkerClassNames(t){t.classList.add("or-map-marker")}addMarkerContainerClassNames(t){t.classList.add("marker-container")}createDefaultMarkerContent(){let t=document.createElement("div");return t.innerHTML=c._defaultTemplate(this.icon,{displayValue:this.displayValue,direction:this.direction}),t}hasPosition(){return"number"==typeof this.lat&&"number"==typeof this.lng&&this.lat>=-90&&this.lat<90&&this.lng>=-180&&this.lng<180}};eb._defaultTemplate=(t,e)=>`
355
+ `}_raisePropertyChange(t){this.dispatchEvent(new ei(this,t))}addMarkerClassNames(t){t.classList.add("or-map-marker")}addMarkerContainerClassNames(t){t.classList.add("marker-container")}createDefaultMarkerContent(){let t=document.createElement("div");return t.innerHTML=e._defaultTemplate(this.icon,{displayValue:this.displayValue,direction:this.direction}),t}hasPosition(){return"number"==typeof this.lat&&"number"==typeof this.lng&&this.lat>=-90&&this.lat<90&&this.lng>=-180&&this.lng<180}};er._defaultTemplate=(t,e)=>`
356
356
  ${e&&void 0!==e.displayValue?`<div class="label"><span>${e.displayValue}</span></div>`:""}
357
357
  ${e&&e.direction?`<div class="direction-icon-wrapper" style="transform: rotate(${e.direction}deg);">
358
358
  <svg class="direction-circle">
@@ -362,19 +362,19 @@ uniform ${i} ${n} u_${r};
362
362
  </div>`:""}
363
363
  <or-icon icon="or:marker"></or-icon>
364
364
  <or-icon class="marker-icon" icon="${t||""}"></or-icon>
365
- `,ef([t0({type:Number,reflect:!0,attribute:!0})],eb.prototype,"lat",void 0),ef([t0({type:Number,reflect:!0})],eb.prototype,"lng",void 0),ef([t0({type:Number,reflect:!0})],eb.prototype,"radius",void 0),ef([t0({reflect:!0})],eb.prototype,"displayValue",void 0),ef([t0({reflect:!0})],eb.prototype,"direction",void 0),ef([t0({type:Boolean})],eb.prototype,"visible",void 0),ef([t0({type:String})],eb.prototype,"icon",void 0),ef([t0({type:String})],eb.prototype,"color",void 0),ef([t0({type:String})],eb.prototype,"activeColor",void 0),ef([t0({type:Boolean})],eb.prototype,"interactive",void 0),ef([t0({type:Boolean})],eb.prototype,"active",void 0),ef([t2("slot")],eb.prototype,"_slot",void 0),eb=c=ef([tQ("or-map-marker")],eb);var ey=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};function ev(t,e){if(t&&e&&t[e])return t[e]}function ex(t,e){let i=ev(t,e);if(i)return i.attributeName}let ew=class extends(0,v.subscribe)(x())(eb){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(t){let e,i=ev(this.config,t);if(i&&i.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[i.attributeName]&&i.colours){let t=this.asset.attributes[i.attributeName].value;e={markerConfig:i.colours,currentValue:t}}let n=en(t,e);if(!n){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=n.icon),this.markerColor=Array.isArray(n.color)?n.color[0].colour:n.color||void 0,this.updateColor(this.markerContainer),this.visible=!0}shouldUpdate(t){if(t.has("assetId")&&(this.lat=void 0,this.lng=void 0,this.type=void 0,this.direction=void 0,this.displayValue=void 0,this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1===Object.keys(t).length))return!1;if(t.has("asset"))try{this.onAssetChanged(this.asset)}catch(t){console.error(t)}return super.shouldUpdate(t)}_onEvent(t){if("attribute"===t.eventType)return"location"===t.ref.name?void this._updateLocation(t.value):void(this.asset&&(this.asset=v.Util.updateAsset(this.asset,t),this.requestUpdate()));if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this.onAssetChanged(t.asset);break;case"DELETE":this.onAssetChanged(void 0)}}onAssetChanged(t){var e,i,n,r;return e=this,i=void 0,n=void 0,r=function*(){if(t){this.direction=void 0,this.displayValue=void 0;let e=t.attributes?t.attributes.location:void 0;this._updateLocation(e?e.value:null);let i=ev(this.config,t.type),n=!i||!i.hideDirection,r=i&&!0===i.showLabel&&!!i.attributeName,a=!!(i&&!1!==i.showUnits);if(r&&t.attributes&&t.attributes[null==i?void 0:i.attributeName]){let e=t.attributes[i.attributeName],n=t8.AssetModelUtil.getAttributeAndValueDescriptors(t.type,e.name,e);this.displayValue=v.Util.getAttributeValueAsString(e,n[0],t.type,a,"-")}if(n&&t.attributes&&t.attributes.direction){let e=t.attributes.direction.value;null!=e&&(this.direction=e.toString())}this.type=t.type}else this.lat=void 0,this.lng=void 0},new(n||(n=Promise))(function(t,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(e){var i;e.done?t(e.value):((i=e.value)instanceof n?i:new n(function(t){t(i)})).then(o,s)}l((r=r.apply(e,i||[])).next())})}_updateLocation(t){this.lat=t&&t.coordinates?t.coordinates[1]:void 0,this.lng=t&&t.coordinates?t.coordinates[0]:void 0}getColor(){return this.markerColor&&!this.color?"#"+this.markerColor:super.getColor()}getActiveColor(){return this.markerColor&&!this.activeColor?"#"+this.markerColor:super.getActiveColor()}};ey([t0({type:String,reflect:!0,attribute:!0})],ew.prototype,"assetId",void 0),ey([t0({type:Object,attribute:!0})],ew.prototype,"asset",void 0),ey([t0()],ew.prototype,"config",void 0),ew=ey([tQ("or-map-marker-asset")],ew);let{I:ek}={O:J,P:Q,A:tt,C:1,M:tw,L:tC,R:to,D:tE,I:tA,V:tT,H:tz,N:tL,U:tI,F:tM},eE={ATTRIBUTE:1,CHILD:2},eC=t=>(...e)=>({_$litDirective$:t,values:e});class eA{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}let eT=(t,e)=>{var i;let n=t._$AN;if(void 0===n)return!1;for(let t of n)null==(i=t._$AO)||i.call(t,e,!1),eT(t,e);return!0},eI=t=>{let e,i;do{if(void 0===(e=t._$AM))break;(i=e._$AN).delete(t),t=e}while(0===(null==i?void 0:i.size))},eS=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),eM(e)}};function ez(t){void 0!==this._$AN?(eI(this),this._$AM=t,eS(this)):this._$AM=t}function eL(t,e=!1,i=0){let n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(n))for(let t=i;t<n.length;t++)eT(n[t],!1),eI(n[t]);else null!=n&&(eT(n,!1),eI(n));else eT(this,t)}let eM=t=>{t.type==eE.CHILD&&(null!=t._$AP||(t._$AP=eL),null!=t._$AQ||(t._$AQ=ez))};class eP extends eA{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),eS(this),this.isConnected=t._$AU}_$AO(t,e=!0){var i,n;t!==this.isConnected&&(this.isConnected=t,t?null==(i=this.reconnected)||i.call(this):null==(n=this.disconnected)||n.call(this)),e&&(eT(this,t),eI(this))}setValue(t){if(void 0===this._$Ct.strings)this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}let eR=new WeakMap;eC(class extends eP{render(t){return tb}update(t,[e]){var i;let n=e!==this.G;return n&&void 0!==this.G&&this.ot(void 0),(n||this.rt!==this.lt)&&(this.G=e,this.dt=null==(i=t.options)?void 0:i.host,this.ot(this.lt=t.element)),tb}ot(t){var e;if("function"==typeof this.G){let i=null!=(e=this.dt)?e:globalThis,n=eR.get(i);void 0===n&&(n=new WeakMap,eR.set(i,n)),void 0!==n.get(this.G)&&this.G.call(this.dt,void 0),n.set(this.G,t),void 0!==t&&this.G.call(this.dt,t)}else this.G.value=t}get rt(){var t,e,i;return"function"==typeof this.G?null==(e=eR.get(null!=(t=this.dt)?t:globalThis))?void 0:e.get(this.G):null==(i=this.G)?void 0:i.value}disconnected(){this.rt===this.lt&&this.ot(void 0)}reconnected(){this.ot(this.lt)}});let eO=eC(class extends eA{constructor(t){var e;if(super(t),t.type!==eE.ATTRIBUTE||"class"!==t.name||(null==(e=t.strings)?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var i,n;if(void 0===this.it){for(let n in this.it=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t))),e)!e[n]||(null==(i=this.nt)?void 0:i.has(n))||this.it.add(n);return this.render(e)}let r=t.element.classList;for(let t in this.it.forEach(t=>{t in e||(r.remove(t),this.it.delete(t))}),e){let i=!!e[t];i===this.it.has(t)||(null==(n=this.nt)?void 0:n.has(t))||(i?(r.add(t),this.it.add(t)):(r.remove(t),this.it.delete(t)))}return t_}}),eD=t=>null!=t?t:tb;function eB(t,e,i){return t?e():null==i?void 0:i()}class eF{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class eN{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){null!=this.Y||(this.Y=new Promise(t=>this.Z=t))}resume(){var t;null==(t=this.Z)||t.call(this),this.Y=this.Z=void 0}}let eV=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,eU=eC(class extends eP{constructor(){super(...arguments),this._$C_t=0x3fffffff,this._$Cwt=[],this._$Cq=new eF(this),this._$CK=new eN}render(...t){var e;return null!=(e=t.find(t=>!eV(t)))?e:t_}update(t,e){let i=this._$Cwt,n=i.length;this._$Cwt=e;let r=this._$Cq,a=this._$CK;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$C_t);t++){let o=e[t];if(!eV(o))return this._$C_t=t,o;t<n&&o===i[t]||(this._$C_t=0x3fffffff,n=0,Promise.resolve(o).then(async t=>{for(;a.get();)await a.get();let e=r.deref();if(void 0!==e){let i=e._$Cwt.indexOf(o);i>-1&&i<e._$C_t&&(e._$C_t=i,e.setValue(t))}}))}return t_}disconnected(){this._$Cq.disconnect(),this._$CK.pause()}reconnected(){this._$Cq.reconnect(this),this._$CK.resume()}});var e$=function(t,e){return(e$=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function ej(t,e){function i(){this.constructor=t}e$(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var eH=function(){return(eH=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eq=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),eG=function(){function t(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];this.root=t,this.initialize.apply(this,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,a=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}(i)),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new eq({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,i){this.root.addEventListener(t,e,i)},t.prototype.unlisten=function(t,e,i){this.root.removeEventListener(t,e,i)},t.prototype.emit=function(t,e,i){var n;void 0===i&&(i=!1),"function"==typeof CustomEvent?n=new CustomEvent(t,{bubbles:i,detail:e}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,i,!1,e),this.root.dispatchEvent(n)},t}();function eX(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var i={get passive(){return e=!0,!1}},n=function(){};t.document.addEventListener("test",n,i),t.document.removeEventListener("test",n,i)}catch(t){e=!1}return e}(t)&&{passive:!0}}function eZ(t,e){if(t.closest)return t.closest(e);for(var i=t;i;){if(eW(i,e))return i;i=i.parentElement}return null}function eW(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}var eY=function(t,e){return(eY=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function eK(t,e){function i(){this.constructor=t}eY(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var eJ=function(){return(eJ=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eQ={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},e0=function(t){function e(i){var n=t.call(this,eJ(eJ({},e.defaultAdapter),i))||this;return n.shakeAnimationEndHandler_=function(){return n.handleShakeAnimationEnd_()},n}return eK(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return eQ},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},e.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},e.prototype.getWidth=function(){return this.adapter.getWidth()},e.prototype.shake=function(t){var i=e.cssClasses.LABEL_SHAKE;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.float=function(t){var i=e.cssClasses,n=i.LABEL_FLOAT_ABOVE,r=i.LABEL_SHAKE;t?this.adapter.addClass(n):(this.adapter.removeClass(n),this.adapter.removeClass(r))},e.prototype.setRequired=function(t){var i=e.cssClasses.LABEL_REQUIRED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleShakeAnimationEnd_=function(){var t=e.cssClasses.LABEL_SHAKE;this.adapter.removeClass(t)},e}(eq),e1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eK(e,t),e.attachTo=function(t){return new e(t)},e.prototype.shake=function(t){this.foundation.shake(t)},e.prototype.float=function(t){this.foundation.float(t)},e.prototype.setRequired=function(t){this.foundation.setRequired(t)},e.prototype.getWidth=function(){return this.foundation.getWidth()},e.prototype.getDefaultFoundation=function(){var t=this;return new e0({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},getWidth:function(){var e=t.root;if(null!==e.offsetParent)return e.scrollWidth;var i=e.cloneNode(!0);i.style.setProperty("position","absolute"),i.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(i);var n=i.scrollWidth;return document.documentElement.removeChild(i),n},registerInteractionHandler:function(e,i){return t.listen(e,i)},deregisterInteractionHandler:function(e,i){return t.unlisten(e,i)}})},e}(eG),e2=function(t,e){return(e2=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function e5(t,e){function i(){this.constructor=t}e2(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var e3=function(){return(e3=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},e4={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},e6=function(t){function e(i){var n=t.call(this,e3(e3({},e.defaultAdapter),i))||this;return n.transitionEndHandler_=function(t){return n.handleTransitionEnd(t)},n}return e5(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return e4},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},e.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},e.prototype.activate=function(){this.adapter.removeClass(e4.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(e4.LINE_RIPPLE_ACTIVE)},e.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},e.prototype.deactivate=function(){this.adapter.addClass(e4.LINE_RIPPLE_DEACTIVATING)},e.prototype.handleTransitionEnd=function(t){var e=this.adapter.hasClass(e4.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&e&&(this.adapter.removeClass(e4.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(e4.LINE_RIPPLE_DEACTIVATING))},e}(eq),e7=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return e5(e,t),e.attachTo=function(t){return new e(t)},e.prototype.activate=function(){this.foundation.activate()},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.setRippleCenter=function(t){this.foundation.setRippleCenter(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new e6({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},setStyle:function(e,i){return t.root.style.setProperty(e,i)},registerEventHandler:function(e,i){return t.listen(e,i)},deregisterEventHandler:function(e,i){return t.unlisten(e,i)}})},e}(eG),e8=function(t,e){return(e8=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function e9(t,e){function i(){this.constructor=t}e8(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var it=function(){return(it=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ie={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},ii={NOTCH_ELEMENT_PADDING:8},ir={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},ia=function(t){function e(i){return t.call(this,it(it({},e.defaultAdapter),i))||this}return e9(e,t),Object.defineProperty(e,"strings",{get:function(){return ie},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return ir},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return ii},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!0,configurable:!0}),e.prototype.notch=function(t){var i=e.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=ii.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(i)},e.prototype.closeNotch=function(){var t=e.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(t),this.adapter.removeNotchWidthProperty()},e}(eq),io=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return e9(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){this.notchElement_=this.root.querySelector(ie.NOTCH_ELEMENT_SELECTOR);var t=this.root.querySelector("."+e0.cssClasses.ROOT);t?(t.style.transitionDuration="0s",this.root.classList.add(ir.OUTLINE_UPGRADED),requestAnimationFrame(function(){t.style.transitionDuration=""})):this.root.classList.add(ir.NO_LABEL)},e.prototype.notch=function(t){this.foundation.notch(t)},e.prototype.closeNotch=function(){this.foundation.closeNotch()},e.prototype.getDefaultFoundation=function(){var t=this;return new ia({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},setNotchWidthProperty:function(e){return t.notchElement_.style.setProperty("width",e+"px")},removeNotchWidthProperty:function(){return t.notchElement_.style.removeProperty("width")}})},e}(eG),is=function(t,e){return(is=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function il(t,e){function i(){this.constructor=t}is(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ic=function(){return(ic=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},id={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},iu={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},ih={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},ip=["touchstart","pointerdown","mousedown","keydown"],im=["touchend","pointerup","mouseup","contextmenu"],ig=[],i_=function(t){function e(i){var n=t.call(this,ic(ic({},e.defaultAdapter),i))||this;return n.activationAnimationHasEnded_=!1,n.activationTimer_=0,n.fgDeactivationRemovalTimer_=0,n.fgScale_="0",n.frame_={width:0,height:0},n.initialSize_=0,n.layoutFrame_=0,n.maxRadius_=0,n.unboundedCoords_={left:0,top:0},n.activationState_=n.defaultActivationState_(),n.activationTimerCallback_=function(){n.activationAnimationHasEnded_=!0,n.runDeactivationUXLogicIfReady_()},n.activateHandler_=function(t){return n.activate_(t)},n.deactivateHandler_=function(){return n.deactivate_()},n.focusHandler_=function(){return n.handleFocus()},n.blurHandler_=function(){return n.handleBlur()},n.resizeHandler_=function(){return n.layout()},n}return il(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return id},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return iu},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return ih},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this,i=this.supportsPressRipple_();if(this.registerRootHandlers_(i),i){var n=e.cssClasses,r=n.ROOT,a=n.UNBOUNDED;requestAnimationFrame(function(){t.adapter.addClass(r),t.adapter.isUnbounded()&&(t.adapter.addClass(a),t.layoutInternal_())})}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var i=e.cssClasses,n=i.ROOT,r=i.UNBOUNDED;requestAnimationFrame(function(){t.adapter.removeClass(n),t.adapter.removeClass(r),t.removeCssVars_()})}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},e.prototype.activate=function(t){this.activate_(t)},e.prototype.deactivate=function(){this.deactivate_()},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})},e.prototype.setUnbounded=function(t){var i=e.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame(function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)})},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame(function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)})},e.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers_=function(t){var e=this;t&&(ip.forEach(function(t){e.adapter.registerInteractionHandler(t,e.activateHandler_)}),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},e.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):im.forEach(function(t){e.adapter.registerDocumentInteractionHandler(t,e.deactivateHandler_)})},e.prototype.deregisterRootHandlers_=function(){var t=this;ip.forEach(function(e){t.adapter.deregisterInteractionHandler(e,t.activateHandler_)}),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},e.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),im.forEach(function(e){t.adapter.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)})},e.prototype.removeCssVars_=function(){var t=this,i=e.strings;Object.keys(i).forEach(function(e){0===e.indexOf("VAR_")&&t.adapter.updateCssVariable(i[e],null)})},e.prototype.activate_=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState_;if(!i.isActivated){var n=this.previousActivationEvent_;if(!(n&&void 0!==t&&n.type!==t.type)){if(i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&ig.length>0&&ig.some(function(t){return e.adapter.containsEventTarget(t)}))return void this.resetActivationState_();void 0!==t&&(ig.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){ig=[],!i.wasElementMadeActive&&void 0!==t&&(" "===t.key||32===t.keyCode)&&(i.wasElementMadeActive=e.checkElementMadeActive_(t),i.wasElementMadeActive&&e.animateActivation_()),i.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())})}}}},e.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},e.prototype.animateActivation_=function(){var t=this,i=e.strings,n=i.VAR_FG_TRANSLATE_START,r=i.VAR_FG_TRANSLATE_END,a=e.cssClasses,o=a.FG_DEACTIVATION,s=a.FG_ACTIVATION,l=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var c="",d="";if(!this.adapter.isUnbounded()){var u=this.getFgTranslationCoordinates_(),h=u.startPoint,p=u.endPoint;c=h.x+"px, "+h.y+"px",d=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(n,c),this.adapter.updateCssVariable(r,d),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(o),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer_=setTimeout(function(){return t.activationTimerCallback_()},l)},e.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var n,r,a=e.x,o=e.y,s=a+i.left,l=o+i.top;return"touchstart"===t.type?(n=t.changedTouches[0].pageX-s,r=t.changedTouches[0].pageY-l):(n=t.pageX-s,r=t.pageY-l),{x:n,y:r}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},e.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,i=e.cssClasses.FG_DEACTIVATION,n=this.activationState_,r=n.hasDeactivationUXRun,a=n.isActivated;(r||!a)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer_=setTimeout(function(){t.adapter.removeClass(i)},ih.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses_=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout(function(){return t.previousActivationEvent_=void 0},e.numbers.TAP_DELAY_MS)},e.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var i=ic({},e);e.isProgrammatic?(requestAnimationFrame(function(){return t.animateDeactivation_(i)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(i),t.resetActivationState_()}))}},e.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady_()},e.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+e.numbers.PADDING;var i=Math.floor(t*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!=0?this.initialSize_=i-1:this.initialSize_=i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},e.prototype.updateLayoutCssVars_=function(){var t=e.strings,i=t.VAR_FG_SIZE,n=t.VAR_LEFT,r=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize_+"px"),this.adapter.updateCssVariable(a,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(n,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(r,this.unboundedCoords_.top+"px"))},e}(eq),ib=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.disabled=!1,e}return il(e,t),e.attachTo=function(t,i){void 0===i&&(i={isUnbounded:void 0});var n=new e(t);return void 0!==i.isUnbounded&&(n.unbounded=i.isUnbounded),n},e.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return function(t,e){void 0===e&&(e=!1);var i=t.CSS,n=d;if("boolean"==typeof d&&!e)return d;if(!(i&&"function"==typeof i.supports))return!1;var r=i.supports("--css-vars","yes"),a=i.supports("(--css-vars: yes)")&&i.supports("color","#00000000");return n=r||a,e||(d=n),n}(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,eX())},deregisterInteractionHandler:function(e,i){return t.root.removeEventListener(e,i,eX())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return eW(t.root,":active")},isSurfaceDisabled:function(){return!!t.disabled},isUnbounded:function(){return!!t.unbounded},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,eX())},registerInteractionHandler:function(e,i){return t.root.addEventListener(e,i,eX())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,i){return t.root.style.setProperty(e,i)}}},Object.defineProperty(e.prototype,"unbounded",{get:function(){return!!this.unbounded_},set:function(t){this.unbounded_=!!t,this.setUnbounded_()},enumerable:!0,configurable:!0}),e.prototype.activate=function(){this.foundation.activate()},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getDefaultFoundation=function(){return new i_(e.createAdapter(this))},e.prototype.initialSyncWithDOM=function(){var t=this.root;this.unbounded="mdcRippleIsUnbounded"in t.dataset},e.prototype.setUnbounded_=function(){this.foundation.setUnbounded(!!this.unbounded_)},e}(eG),iy={ROOT:"mdc-text-field-character-counter"},iv={ROOT_SELECTOR:"."+iy.ROOT},ix=function(t){function e(i){return t.call(this,eH(eH({},e.defaultAdapter),i))||this}return ej(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return iy},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return iv},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.setCounterValue=function(t,e){t=Math.min(t,e),this.adapter.setContent(t+" / "+e)},e}(eq),iw=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ej(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new ix({setContent:function(e){t.root.textContent=e}})},e}(eG),ik={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},iE={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},iC={LABEL_SCALE:.75},iA=["pattern","min","max","required","step","minlength","maxlength"],iT=["color","date","datetime-local","month","range","time","week"],iI=["mousedown","touchstart"],iS=["click","keydown"],iz=function(t){function e(i,n){void 0===n&&(n={});var r=t.call(this,eH(eH({},e.defaultAdapter),i))||this;return r.isFocused_=!1,r.receivedUserInput_=!1,r.isValid_=!0,r.useNativeValidation_=!0,r.validateOnValueChange_=!0,r.helperText_=n.helperText,r.characterCounter_=n.characterCounter,r.leadingIcon_=n.leadingIcon,r.trailingIcon_=n.trailingIcon,r.inputFocusHandler_=function(){return r.activateFocus()},r.inputBlurHandler_=function(){return r.deactivateFocus()},r.inputInputHandler_=function(){return r.handleInput()},r.setPointerXOffset_=function(t){return r.setTransformOrigin(t)},r.textFieldInteractionHandler_=function(){return r.handleTextFieldInteraction()},r.validationAttributeChangeHandler_=function(t){return r.handleValidationAttributeChange(t)},r}return ej(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return iE},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return ik},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return iC},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldAlwaysFloat_",{get:function(){var t=this.getNativeInput_().type;return iT.indexOf(t)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver(function(){})},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),iI.forEach(function(e){t.adapter.registerInputInteractionHandler(e,t.setPointerXOffset_)}),iS.forEach(function(e){t.adapter.registerTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)}),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},e.prototype.destroy=function(){var t=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),iI.forEach(function(e){t.adapter.deregisterInputInteractionHandler(e,t.setPointerXOffset_)}),iS.forEach(function(e){t.adapter.deregisterTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)}),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},e.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput_=!0)},e.prototype.handleValidationAttributeChange=function(t){var e=this;t.some(function(t){return iA.indexOf(t)>-1&&(e.styleValidity_(!0),e.adapter.setLabelRequired(e.getNativeInput_().required),!0)}),t.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},e.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var e=this.adapter.getLabelWidth()*iC.LABEL_SCALE;this.adapter.notchOutline(e)}else this.adapter.closeOutline()},e.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.helperText_&&(this.helperText_.isPersistent()||!this.helperText_.isValidation()||!this.isValid_)&&this.helperText_.showToScreenReader()},e.prototype.setTransformOrigin=function(t){if(!(this.isDisabled()||this.adapter.hasOutline())){var e=t.touches,i=e?e[0]:t,n=i.target.getBoundingClientRect(),r=i.clientX-n.left;this.adapter.setLineRippleTransformOrigin(r)}},e.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},e.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},e.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var t=this.isValid();this.styleValidity_(t),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},e.prototype.getValue=function(){return this.getNativeInput_().value},e.prototype.setValue=function(t){if(this.getValue()!==t&&(this.getNativeInput_().value=t),this.setCharacterCounter_(t.length),this.validateOnValueChange_){var e=this.isValid();this.styleValidity_(e)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.validateOnValueChange_&&this.adapter.shakeLabel(this.shouldShake))},e.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},e.prototype.setValid=function(t){this.isValid_=t,this.styleValidity_(t);var e=!t&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(e)},e.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange_=t},e.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange_},e.prototype.setUseNativeValidation=function(t){this.useNativeValidation_=t},e.prototype.isDisabled=function(){return this.getNativeInput_().disabled},e.prototype.setDisabled=function(t){this.getNativeInput_().disabled=t,this.styleDisabled_(t)},e.prototype.setHelperTextContent=function(t){this.helperText_&&this.helperText_.setContent(t)},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon_&&this.leadingIcon_.setContent(t)},e.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(t)},e.prototype.setTrailingIconContent=function(t){this.trailingIcon_&&this.trailingIcon_.setContent(t)},e.prototype.setCharacterCounter_=function(t){if(this.characterCounter_){var e=this.getNativeInput_().maxLength;if(-1===e)throw Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(t,e)}},e.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},e.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},e.prototype.styleValidity_=function(t){var i=e.cssClasses.INVALID;if(t?this.adapter.removeClass(i):this.adapter.addClass(i),this.helperText_){if(this.helperText_.setValidity(t),!this.helperText_.isValidation())return;var n=this.helperText_.isVisible(),r=this.helperText_.getId();n&&r?this.adapter.setInputAttr(ik.ARIA_DESCRIBEDBY,r):this.adapter.removeInputAttr(ik.ARIA_DESCRIBEDBY)}},e.prototype.styleFocused_=function(t){var i=e.cssClasses.FOCUSED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.styleDisabled_=function(t){var i=e.cssClasses,n=i.DISABLED,r=i.INVALID;t?(this.adapter.addClass(n),this.adapter.removeClass(r)):this.adapter.removeClass(n),this.leadingIcon_&&this.leadingIcon_.setDisabled(t),this.trailingIcon_&&this.trailingIcon_.setDisabled(t)},e.prototype.styleFloating_=function(t){var i=e.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},e}(eq),iL={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},iM={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+iL.ROOT},iP=function(t){function e(i){return t.call(this,eH(eH({},e.defaultAdapter),i))||this}return ej(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return iL},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return iM},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.getId=function(){return this.adapter.getAttr("id")},e.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(iM.ARIA_HIDDEN)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.isPersistent=function(){return this.adapter.hasClass(iL.HELPER_TEXT_PERSISTENT)},e.prototype.setPersistent=function(t){t?this.adapter.addClass(iL.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(iL.HELPER_TEXT_PERSISTENT)},e.prototype.isValidation=function(){return this.adapter.hasClass(iL.HELPER_TEXT_VALIDATION_MSG)},e.prototype.setValidation=function(t){t?this.adapter.addClass(iL.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(iL.HELPER_TEXT_VALIDATION_MSG)},e.prototype.showToScreenReader=function(){this.adapter.removeAttr(iM.ARIA_HIDDEN)},e.prototype.setValidity=function(t){var e=this.adapter.hasClass(iL.HELPER_TEXT_PERSISTENT),i=this.adapter.hasClass(iL.HELPER_TEXT_VALIDATION_MSG)&&!t;i?(this.showToScreenReader(),this.adapter.setAttr(iM.ROLE,"alert")):this.adapter.removeAttr(iM.ROLE),e||i||this.hide_()},e.prototype.hide_=function(){this.adapter.setAttr(iM.ARIA_HIDDEN,"true")},e}(eq),iR=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ej(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new iP({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e}})},e}(eG),iO={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},iD={ROOT:"mdc-text-field__icon"},iB=["click","keydown"],iF=function(t){function e(i){var n=t.call(this,eH(eH({},e.defaultAdapter),i))||this;return n.savedTabIndex_=null,n.interactionHandler_=function(t){return n.handleInteraction(t)},n}return ej(e,t),Object.defineProperty(e,"strings",{get:function(){return iO},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return iD},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),iB.forEach(function(e){t.adapter.registerInteractionHandler(e,t.interactionHandler_)})},e.prototype.destroy=function(){var t=this;iB.forEach(function(e){t.adapter.deregisterInteractionHandler(e,t.interactionHandler_)})},e.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",iO.ICON_ROLE)))},e.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&(t.preventDefault(),this.adapter.notifyIconAction())},e}(eq),iN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ej(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new iF({getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e},registerInteractionHandler:function(e,i){return t.listen(e,i)},deregisterInteractionHandler:function(e,i){return t.unlisten(e,i)},notifyIconAction:function(){return t.emit(iF.strings.ICON_EVENT,{},!0)}})},e}(eG),iV=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ej(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e,i,n,r,a,o){void 0===t&&(t=function(t,e){return new ib(t,e)}),void 0===e&&(e=function(t){return new e7(t)}),void 0===i&&(i=function(t){return new iR(t)}),void 0===n&&(n=function(t){return new iw(t)}),void 0===r&&(r=function(t){return new iN(t)}),void 0===a&&(a=function(t){return new e1(t)}),void 0===o&&(o=function(t){return new io(t)}),this.input_=this.root.querySelector(ik.INPUT_SELECTOR);var s=this.root.querySelector(ik.LABEL_SELECTOR);this.label_=s?a(s):null;var l=this.root.querySelector(ik.LINE_RIPPLE_SELECTOR);this.lineRipple_=l?e(l):null;var c=this.root.querySelector(ik.OUTLINE_SELECTOR);this.outline_=c?o(c):null;var d=iP.strings,u=this.root.nextElementSibling,h=u&&u.classList.contains(iE.HELPER_LINE),p=h&&u&&u.querySelector(d.ROOT_SELECTOR);this.helperText_=p?i(p):null;var m=ix.strings,f=this.root.querySelector(m.ROOT_SELECTOR);!f&&h&&u&&(f=u.querySelector(m.ROOT_SELECTOR)),this.characterCounter_=f?n(f):null;var g=this.root.querySelector(ik.LEADING_ICON_SELECTOR);this.leadingIcon_=g?r(g):null;var _=this.root.querySelector(ik.TRAILING_ICON_SELECTOR);this.trailingIcon_=_?r(_):null,this.prefix_=this.root.querySelector(ik.PREFIX_SELECTOR),this.suffix_=this.root.querySelector(ik.SUFFIX_SELECTOR),this.ripple=this.createRipple_(t)},e.prototype.destroy=function(){this.ripple&&this.ripple.destroy(),this.lineRipple_&&this.lineRipple_.destroy(),this.helperText_&&this.helperText_.destroy(),this.characterCounter_&&this.characterCounter_.destroy(),this.leadingIcon_&&this.leadingIcon_.destroy(),this.trailingIcon_&&this.trailingIcon_.destroy(),this.label_&&this.label_.destroy(),this.outline_&&this.outline_.destroy(),t.prototype.destroy.call(this)},e.prototype.initialSyncWithDOM=function(){this.disabled=this.input_.disabled},Object.defineProperty(e.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"required",{get:function(){return this.input_.required},set:function(t){this.input_.required=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pattern",{get:function(){return this.input_.pattern},set:function(t){this.input_.pattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minLength",{get:function(){return this.input_.minLength},set:function(t){this.input_.minLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this.input_.maxLength},set:function(t){t<0?this.input_.removeAttribute("maxLength"):this.input_.maxLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this.input_.min},set:function(t){this.input_.min=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this.input_.max},set:function(t){this.input_.max=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this.input_.step},set:function(t){this.input_.step=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trailingIconAriaLabel",{set:function(t){this.foundation.setTrailingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trailingIconContent",{set:function(t){this.foundation.setTrailingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useNativeValidation",{set:function(t){this.foundation.setUseNativeValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"prefixText",{get:function(){return this.prefix_?this.prefix_.textContent:null},set:function(t){this.prefix_&&(this.prefix_.textContent=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suffixText",{get:function(){return this.suffix_?this.suffix_.textContent:null},set:function(t){this.suffix_&&(this.suffix_.textContent=t)},enumerable:!0,configurable:!0}),e.prototype.focus=function(){this.input_.focus()},e.prototype.layout=function(){var t=this.foundation.shouldFloat;this.foundation.notchOutline(t)},e.prototype.getDefaultFoundation=function(){return new iz(eH(eH(eH(eH(eH({},this.getRootAdapterMethods_()),this.getInputAdapterMethods_()),this.getLabelAdapterMethods_()),this.getLineRippleAdapterMethods_()),this.getOutlineAdapterMethods_()),this.getFoundationMap_())},e.prototype.getRootAdapterMethods_=function(){var t=this;return{addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},registerTextFieldInteractionHandler:function(e,i){t.listen(e,i)},deregisterTextFieldInteractionHandler:function(e,i){t.unlisten(e,i)},registerValidationAttributeChangeHandler:function(e){var i=new MutationObserver(function(t){return e(t.map(function(t){return t.attributeName}).filter(function(t){return t}))});return i.observe(t.input_,{attributes:!0}),i},deregisterValidationAttributeChangeHandler:function(t){t.disconnect()}}},e.prototype.getInputAdapterMethods_=function(){var t=this;return{getNativeInput:function(){return t.input_},setInputAttr:function(e,i){t.input_.setAttribute(e,i)},removeInputAttr:function(e){t.input_.removeAttribute(e)},isFocused:function(){return document.activeElement===t.input_},registerInputInteractionHandler:function(e,i){t.input_.addEventListener(e,i,eX())},deregisterInputInteractionHandler:function(e,i){t.input_.removeEventListener(e,i,eX())}}},e.prototype.getLabelAdapterMethods_=function(){var t=this;return{floatLabel:function(e){return t.label_&&t.label_.float(e)},getLabelWidth:function(){return t.label_?t.label_.getWidth():0},hasLabel:function(){return!!t.label_},shakeLabel:function(e){return t.label_&&t.label_.shake(e)},setLabelRequired:function(e){return t.label_&&t.label_.setRequired(e)}}},e.prototype.getLineRippleAdapterMethods_=function(){var t=this;return{activateLineRipple:function(){t.lineRipple_&&t.lineRipple_.activate()},deactivateLineRipple:function(){t.lineRipple_&&t.lineRipple_.deactivate()},setLineRippleTransformOrigin:function(e){t.lineRipple_&&t.lineRipple_.setRippleCenter(e)}}},e.prototype.getOutlineAdapterMethods_=function(){var t=this;return{closeOutline:function(){return t.outline_&&t.outline_.closeNotch()},hasOutline:function(){return!!t.outline_},notchOutline:function(e){return t.outline_&&t.outline_.notch(e)}}},e.prototype.getFoundationMap_=function(){return{characterCounter:this.characterCounter_?this.characterCounter_.foundationForTextField:void 0,helperText:this.helperText_?this.helperText_.foundationForTextField:void 0,leadingIcon:this.leadingIcon_?this.leadingIcon_.foundationForTextField:void 0,trailingIcon:this.trailingIcon_?this.trailingIcon_.foundationForTextField:void 0}},e.prototype.createRipple_=function(t){var e=this,i=this.root.classList.contains(iE.TEXTAREA),n=this.root.classList.contains(iE.OUTLINED);if(i||n)return null;var r=eH(eH({},ib.createAdapter(this)),{isSurfaceActive:function(){return eW(e.input_,":active")},registerInteractionHandler:function(t,i){return e.input_.addEventListener(t,i,eX())},deregisterInteractionHandler:function(t,i){return e.input_.removeEventListener(t,i,eX())}});return t(this.root,new i_(r))},e}(eG),iU=function(t,e){return(iU=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i$(t,e){function i(){this.constructor=t}iU(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ij=function(){return(ij=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},iH={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},iq={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function iG(t){return!!t.document&&"function"==typeof t.document.createElement}function iX(t,e){if(iG(t)&&e in iH){var i=t.document.createElement("div"),n=iH[e],r=n.standard,a=n.prefixed;return r in i.style?r:a}return e}function iZ(t,e){if(iG(t)&&e in iq){var i=t.document.createElement("div"),n=iq[e],r=n.standard,a=n.prefixed;return n.cssProperty in i.style?r:a}return e}var iW={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},iY={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",DATA_INDETERMINATE_ATTR:"data-indeterminate",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},iK={ANIM_END_LATCH_MS:250},iJ=function(t){function e(i){var n=t.call(this,ij(ij({},e.defaultAdapter),i))||this;return n.currentCheckState_=iY.TRANSITION_STATE_INIT,n.currentAnimationClass_="",n.animEndLatchTimer_=0,n.enableAnimationEndHandler_=!1,n}return i$(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return iW},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return iY},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return iK},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter.addClass(iW.UPGRADED)},e.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},e.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(iW.DISABLED):this.adapter.removeClass(iW.DISABLED)},e.prototype.handleAnimationEnd=function(){var t=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout(function(){t.adapter.removeClass(t.currentAnimationClass_),t.enableAnimationEndHandler_=!1},iK.ANIM_END_LATCH_MS))},e.prototype.handleChange=function(){this.transitionCheckState_()},e.prototype.transitionCheckState_=function(){if(this.adapter.hasNativeControl()){var t=this.currentCheckState_,e=this.determineCheckState_();if(t!==e){this.updateAriaChecked_();var i=iY.TRANSITION_STATE_UNCHECKED,n=iW.SELECTED;e===i?this.adapter.removeClass(n):this.adapter.addClass(n),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter.forceLayout(),this.adapter.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(t,e),this.currentCheckState_=e,this.adapter.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},e.prototype.determineCheckState_=function(){var t=iY.TRANSITION_STATE_INDETERMINATE,e=iY.TRANSITION_STATE_CHECKED,i=iY.TRANSITION_STATE_UNCHECKED;return this.adapter.isIndeterminate()?t:this.adapter.isChecked()?e:i},e.prototype.getTransitionAnimationClass_=function(t,i){var n=iY.TRANSITION_STATE_INIT,r=iY.TRANSITION_STATE_CHECKED,a=iY.TRANSITION_STATE_UNCHECKED,o=e.cssClasses,s=o.ANIM_UNCHECKED_CHECKED,l=o.ANIM_UNCHECKED_INDETERMINATE,c=o.ANIM_CHECKED_UNCHECKED,d=o.ANIM_CHECKED_INDETERMINATE,u=o.ANIM_INDETERMINATE_CHECKED,h=o.ANIM_INDETERMINATE_UNCHECKED;switch(t){case n:if(i===a)return"";return i===r?u:h;case a:return i===r?s:l;case r:return i===a?c:d;default:return i===r?u:h}},e.prototype.updateAriaChecked_=function(){this.adapter.isIndeterminate()?this.adapter.setNativeControlAttr(iY.ARIA_CHECKED_ATTR,iY.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter.removeNativeControlAttr(iY.ARIA_CHECKED_ATTR)},e}(eq),iQ=["checked","indeterminate"],i0=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ripple_=e.createRipple_(),e}return i$(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.nativeControl_.checked=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indeterminate",{get:function(){return this.nativeControl_.indeterminate},set:function(t){this.nativeControl_.indeterminate=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.nativeControl_.value},set:function(t){this.nativeControl_.value=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var t=iY.DATA_INDETERMINATE_ATTR;this.nativeControl_.indeterminate="true"===this.nativeControl_.getAttribute(t),this.nativeControl_.removeAttribute(t)},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleChange_=function(){return t.foundation.handleChange()},this.handleAnimationEnd_=function(){return t.foundation.handleAnimationEnd()},this.nativeControl_.addEventListener("change",this.handleChange_),this.listen(iZ(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_()},e.prototype.destroy=function(){this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.handleChange_),this.unlisten(iZ(window,"animationend"),this.handleAnimationEnd_),this.uninstallPropertyChangeHooks_(),t.prototype.destroy.call(this)},e.prototype.getDefaultFoundation=function(){var t=this;return new iJ({addClass:function(e){return t.root.classList.add(e)},forceLayout:function(){return t.root.offsetWidth},hasNativeControl:function(){return!!t.nativeControl_},isAttachedToDOM:function(){return!!t.root.parentNode},isChecked:function(){return t.checked},isIndeterminate:function(){return t.indeterminate},removeClass:function(e){t.root.classList.remove(e)},removeNativeControlAttr:function(e){t.nativeControl_.removeAttribute(e)},setNativeControlAttr:function(e,i){t.nativeControl_.setAttribute(e,i)},setNativeControlDisabled:function(e){t.nativeControl_.disabled=e}})},e.prototype.createRipple_=function(){var t=this,e=ij(ij({},ib.createAdapter(this)),{deregisterInteractionHandler:function(e,i){return t.nativeControl_.removeEventListener(e,i,eX())},isSurfaceActive:function(){return eW(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(e,i){return t.nativeControl_.addEventListener(e,i,eX())}});return new ib(this.root,new i_(e))},e.prototype.installPropertyChangeHooks_=function(){var t=this,e=this.nativeControl_,i=Object.getPrototypeOf(e);iQ.forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);if(i1(r)){var a=r.get,o={configurable:r.configurable,enumerable:r.enumerable,get:a,set:function(i){r.set.call(e,i),t.foundation.handleChange()}};Object.defineProperty(e,n,o)}})},e.prototype.uninstallPropertyChangeHooks_=function(){var t=this.nativeControl_,e=Object.getPrototypeOf(t);iQ.forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);i1(n)&&Object.defineProperty(t,i,n)})},Object.defineProperty(e.prototype,"nativeControl_",{get:function(){var t=iY.NATIVE_CONTROL_SELECTOR,e=this.root.querySelector(t);if(!e)throw Error("Checkbox component requires a "+t+" element");return e},enumerable:!0,configurable:!0}),e}(eG);function i1(t){return!!t&&"function"==typeof t.set}var i2=function(t,e){return(i2=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i5(t,e){function i(){this.constructor=t}i2(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var i3=function(){return(i3=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},i4={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},i6={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"},i7=function(t){function e(i){return t.call(this,i3(i3({},e.defaultAdapter),i))||this}return i5(e,t),Object.defineProperty(e,"strings",{get:function(){return i6},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return i4},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!0,configurable:!0}),e.prototype.setChecked=function(t){this.adapter.setNativeControlChecked(t),this.updateAriaChecked_(t),this.updateCheckedStyling_(t)},e.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(i4.DISABLED):this.adapter.removeClass(i4.DISABLED)},e.prototype.handleChange=function(t){var e=t.target;this.updateAriaChecked_(e.checked),this.updateCheckedStyling_(e.checked)},e.prototype.updateCheckedStyling_=function(t){t?this.adapter.addClass(i4.CHECKED):this.adapter.removeClass(i4.CHECKED)},e.prototype.updateAriaChecked_=function(t){this.adapter.setNativeControlAttr(i6.ARIA_CHECKED_ATTR,""+!!t)},e}(eq),i8=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ripple_=e.createRipple_(),e}return i5(e,t),e.attachTo=function(t){return new e(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)},e.prototype.initialSyncWithDOM=function(){var t=this;this.changeHandler_=function(){for(var e,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return(e=t.foundation).handleChange.apply(e,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,a=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}(i))},this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked},e.prototype.getDefaultFoundation=function(){var t=this;return new i7({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},setNativeControlChecked:function(e){return t.nativeControl_.checked=e},setNativeControlDisabled:function(e){return t.nativeControl_.disabled=e},setNativeControlAttr:function(e,i){return t.nativeControl_.setAttribute(e,i)}})},Object.defineProperty(e.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.foundation.setChecked(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),e.prototype.createRipple_=function(){var t=this,e=i7.strings.RIPPLE_SURFACE_SELECTOR,i=this.root.querySelector(e),n=i3(i3({},ib.createAdapter(this)),{addClass:function(t){return i.classList.add(t)},computeBoundingRect:function(){return i.getBoundingClientRect()},deregisterInteractionHandler:function(e,i){t.nativeControl_.removeEventListener(e,i,eX())},isSurfaceActive:function(){return eW(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(e,i){t.nativeControl_.addEventListener(e,i,eX())},removeClass:function(t){i.classList.remove(t)},updateCssVariable:function(t,e){i.style.setProperty(t,e)}});return new ib(this.root,new i_(n))},Object.defineProperty(e.prototype,"nativeControl_",{get:function(){var t=i7.strings.NATIVE_CONTROL_SELECTOR;return this.root.querySelector(t)},enumerable:!0,configurable:!0}),e}(eG),i9=function(t,e){return(i9=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function nt(t,e){function i(){this.constructor=t}i9(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ne=function(){return(ne=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ni={DISABLED:"mdc-slider--disabled",DISCRETE:"mdc-slider--discrete",INPUT:"mdc-slider__input",RANGE:"mdc-slider--range",THUMB:"mdc-slider__thumb",THUMB_KNOB:"mdc-slider__thumb-knob",THUMB_TOP:"mdc-slider__thumb--top",THUMB_WITH_INDICATOR:"mdc-slider__thumb--with-indicator",TICK_MARKS:"mdc-slider--tick-marks",TICK_MARKS_CONTAINER:"mdc-slider__tick-marks",TICK_MARK_ACTIVE:"mdc-slider__tick-mark--active",TICK_MARK_INACTIVE:"mdc-slider__tick-mark--inactive",TRACK:"mdc-slider__track",TRACK_ACTIVE:"mdc-slider__track--active_fill",VALUE_INDICATOR_TEXT:"mdc-slider__value-indicator-text"},nn={STEP_SIZE:1,THUMB_UPDATE_MIN_PX:5},nr={ARIA_VALUETEXT:"aria-valuetext",INPUT_DISABLED:"disabled",INPUT_MIN:"min",INPUT_MAX:"max",INPUT_VALUE:"value",INPUT_STEP:"step"},na={CHANGE:"MDCSlider:change",INPUT:"MDCSlider:input"};!function(t){t[t.ACTIVE=0]="ACTIVE",t[t.INACTIVE=1]="INACTIVE"}(u||(u={})),function(t){t[t.START=1]="START",t[t.END=2]="END"}(h||(h={}));var no="undefined"!=typeof window,ns=function(t){function e(i){var n=t.call(this,ne(ne({},e.defaultAdapter),i))||this;return n.initialStylesRemoved=!1,n.isDisabled=!1,n.isDiscrete=!1,n.step=nn.STEP_SIZE,n.hasTickMarks=!1,n.isRange=!1,n.thumb=null,n.downEventClientX=null,n.startThumbKnobWidth=0,n.endThumbKnobWidth=0,n}return nt(e,t),Object.defineProperty(e,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},getThumbKnobWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.isDisabled=this.adapter.hasClass(ni.DISABLED),this.isDiscrete=this.adapter.hasClass(ni.DISCRETE),this.hasTickMarks=this.adapter.hasClass(ni.TICK_MARKS),this.isRange=this.adapter.hasClass(ni.RANGE);var e=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(nr.INPUT_MIN,this.isRange?h.START:h.END),nr.INPUT_MIN),i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(nr.INPUT_MAX,h.END),nr.INPUT_MAX),n=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(nr.INPUT_VALUE,h.END),nr.INPUT_VALUE),r=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(nr.INPUT_VALUE,h.START),nr.INPUT_VALUE):e;this.validateProperties({min:e,max:i,value:n,valueStart:r}),this.min=e,this.max=i,this.value=n,this.valueStart=r,this.valueBeforeDownEvent=n,this.valueStartBeforeDownEvent=r;var a=this.adapter.getInputAttribute(nr.INPUT_STEP,h.END);if(a&&(this.step=this.convertAttributeValueToNumber(a,nr.INPUT_STEP)),this.step<=0)throw Error("MDCSliderFoundation: step must be a positive number. Current step: "+this.step);this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){t.handleInputChange(h.START)},this.inputEndChangeListener=function(){t.handleInputChange(h.END)},this.inputStartFocusListener=function(){t.handleInputFocus(h.START)},this.inputEndFocusListener=function(){t.handleInputFocus(h.END)},this.inputStartBlurListener=function(){t.handleInputBlur(h.START)},this.inputEndBlurListener=function(){t.handleInputBlur(h.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},e.prototype.destroy=function(){this.deregisterEventHandlers()},e.prototype.getMin=function(){return this.min},e.prototype.getMax=function(){return this.max},e.prototype.getValue=function(){return this.value},e.prototype.setValue=function(t){if(this.isRange&&t<this.valueStart)throw Error("end thumb value ("+t+") must be >= start thumb value ("+this.valueStart+")");this.updateValue(t,h.END)},e.prototype.getValueStart=function(){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");return this.valueStart},e.prototype.setValueStart=function(t){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&t>this.value)throw Error("start thumb value ("+t+") must be <= end thumb value ("+this.value+")");this.updateValue(t,h.START)},e.prototype.getStep=function(){return this.step},e.prototype.getDisabled=function(){return this.isDisabled},e.prototype.setDisabled=function(t){this.isDisabled=t,t?(this.adapter.addClass(ni.DISABLED),this.isRange&&this.adapter.setInputAttribute(nr.INPUT_DISABLED,"",h.START),this.adapter.setInputAttribute(nr.INPUT_DISABLED,"",h.END)):(this.adapter.removeClass(ni.DISABLED),this.isRange&&this.adapter.removeInputAttribute(nr.INPUT_DISABLED,h.START),this.adapter.removeInputAttribute(nr.INPUT_DISABLED,h.END))},e.prototype.getIsRange=function(){return this.isRange},e.prototype.layout=function(t){var e=(void 0===t?{}:t).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(h.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(h.END)),e||this.updateUI()},e.prototype.handleResize=function(){this.layout()},e.prototype.handleDown=function(t){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var e=null!=t.clientX?t.clientX:t.targetTouches[0].clientX;this.downEventClientX=e;var i=this.mapClientXOnSliderScale(e);this.thumb=this.getThumbFromDownEvent(e,i),null!==this.thumb&&(this.handleDragStart(t,i,this.thumb),this.isRange&&i>=this.valueStart&&i<=this.value||this.updateValue(i,this.thumb,{emitInputEvent:!0}))}},e.prototype.handleMove=function(t){if(!this.isDisabled){t.preventDefault();var e=null!=t.clientX?t.clientX:t.targetTouches[0].clientX,i=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(e),null!==this.thumb){var n=this.mapClientXOnSliderScale(e);i||(this.handleDragStart(t,n,this.thumb),this.adapter.emitDragStartEvent(n,this.thumb)),this.updateValue(n,this.thumb,{emitInputEvent:!0})}}},e.prototype.handleUp=function(){if(!this.isDisabled&&null!==this.thumb){var t=this.thumb===h.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent,e=this.thumb===h.START?this.valueStart:this.value;t!==e&&this.adapter.emitChangeEvent(e,this.thumb),this.adapter.emitDragEndEvent(e,this.thumb),this.thumb=null}},e.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(ni.THUMB_WITH_INDICATOR,h.START),this.adapter.addThumbClass(ni.THUMB_WITH_INDICATOR,h.END))},e.prototype.handleThumbMouseleave=function(){this.isDiscrete&&this.isRange&&(this.adapter.isInputFocused(h.START)||this.adapter.isInputFocused(h.END)||(this.adapter.removeThumbClass(ni.THUMB_WITH_INDICATOR,h.START),this.adapter.removeThumbClass(ni.THUMB_WITH_INDICATOR,h.END)))},e.prototype.handleMousedownOrTouchstart=function(t){var e=this,i="mousedown"===t.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(i,this.moveListener);var n=function(){e.handleUp(),e.adapter.deregisterBodyEventHandler(i,e.moveListener),e.adapter.deregisterEventHandler("mouseup",n),e.adapter.deregisterEventHandler("touchend",n)};this.adapter.registerBodyEventHandler("mouseup",n),this.adapter.registerBodyEventHandler("touchend",n),this.handleDown(t)},e.prototype.handlePointerdown=function(t){this.adapter.setPointerCapture(t.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(t)},e.prototype.handleInputChange=function(t){var e=Number(this.adapter.getInputValue(t));t===h.START?this.setValueStart(e):this.setValue(e)},e.prototype.handleInputFocus=function(t){if(this.isDiscrete&&(this.adapter.addThumbClass(ni.THUMB_WITH_INDICATOR,t),this.isRange)){var e=t===h.START?h.END:h.START;this.adapter.addThumbClass(ni.THUMB_WITH_INDICATOR,e)}},e.prototype.handleInputBlur=function(t){if(this.isDiscrete&&(this.adapter.removeThumbClass(ni.THUMB_WITH_INDICATOR,t),this.isRange)){var e=t===h.START?h.END:h.START;this.adapter.removeThumbClass(ni.THUMB_WITH_INDICATOR,e)}},e.prototype.handleDragStart=function(t,e,i){this.adapter.focusInput(i),t.preventDefault(),this.adapter.emitDragStartEvent(e,i)},e.prototype.getThumbFromDownEvent=function(t,e){if(!this.isRange)return h.END;var i=this.adapter.getThumbBoundingClientRect(h.START),n=this.adapter.getThumbBoundingClientRect(h.END),r=t>=i.left&&t<=i.right,a=t>=n.left&&t<=n.right;return r&&a?null:r?h.START:a?h.END:e<this.valueStart?h.START:e>this.value?h.END:null},e.prototype.getThumbFromMoveEvent=function(t){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw Error("`downEventClientX` is null after move event.");return Math.abs(this.downEventClientX-t)<nn.THUMB_UPDATE_MIN_PX?this.thumb:t<this.downEventClientX?this.adapter.isRTL()?h.END:h.START:this.adapter.isRTL()?h.START:h.END},e.prototype.updateUI=function(t){this.updateThumbAndInputAttributes(t),this.updateThumbAndTrackUI(t),this.updateValueIndicatorUI(t),this.updateTickMarksUI()},e.prototype.updateThumbAndInputAttributes=function(t){if(t){var e=this.isRange&&t===h.START?this.valueStart:this.value,i=String(e);this.adapter.setInputAttribute(nr.INPUT_VALUE,i,t),this.isRange&&t===h.START?this.adapter.setInputAttribute(nr.INPUT_MIN,i,h.END):this.isRange&&t===h.END&&this.adapter.setInputAttribute(nr.INPUT_MAX,i,h.START),this.adapter.getInputValue(t)!==i&&this.adapter.setInputValue(i,t);var n=this.adapter.getValueToAriaValueTextFn();n&&this.adapter.setInputAttribute(nr.ARIA_VALUETEXT,n(e),t)}},e.prototype.updateValueIndicatorUI=function(t){if(this.isDiscrete){var e=this.isRange&&t===h.START?this.valueStart:this.value;this.adapter.setValueIndicatorText(e,t===h.START?h.START:h.END),!t&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,h.START)}},e.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var t=(this.valueStart-this.min)/this.step,e=(this.value-this.valueStart)/this.step+1,i=(this.max-this.value)/this.step,n=Array.from({length:t}).fill(u.INACTIVE),r=Array.from({length:e}).fill(u.ACTIVE),a=Array.from({length:i}).fill(u.INACTIVE);this.adapter.updateTickMarks(n.concat(r).concat(a))}},e.prototype.mapClientXOnSliderScale=function(t){var e=(t-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(e=1-e);var i=this.min+e*(this.max-this.min);return i===this.max||i===this.min?i:this.quantize(i)},e.prototype.updateValue=function(t,e,i){var n=void 0===i?{}:i,r=n.emitInputEvent,a=n.emitChangeEvent;if(t=this.clampValue(t,e),this.isRange&&e===h.START){if(this.valueStart===t)return;this.valueStart=t}else{if(this.value===t)return;this.value=t}this.updateUI(e),r&&this.adapter.emitInputEvent(e===h.START?this.valueStart:this.value,e),a&&this.adapter.emitChangeEvent(e===h.START?this.valueStart:this.value,e)},e.prototype.quantize=function(t){return Math.round(t/this.step)*this.step},e.prototype.clampValue=function(t,e){return(t=Math.min(Math.max(t,this.min),this.max),this.isRange&&e===h.START&&t>this.value)?this.value:this.isRange&&e===h.END&&t<this.valueStart?this.valueStart:t},e.prototype.updateThumbAndTrackUI=function(t){var e=this,i=this.max,n=this.min,r=(this.value-this.valueStart)/(i-n),a=r*this.rect.width,o=this.adapter.isRTL(),s=no?iX(window,"transform"):"transform";if(this.isRange){var l=this.adapter.isRTL()?(i-this.value)/(i-n)*this.rect.width:(this.valueStart-n)/(i-n)*this.rect.width,c=l+a;requestAnimationFrame(function(){!o&&t===h.START||o&&t!==h.START?(e.adapter.setTrackActiveStyleProperty("transform-origin","right"),e.adapter.setTrackActiveStyleProperty("left","unset"),e.adapter.setTrackActiveStyleProperty("right",e.rect.width-c+"px")):(e.adapter.setTrackActiveStyleProperty("transform-origin","left"),e.adapter.setTrackActiveStyleProperty("right","unset"),e.adapter.setTrackActiveStyleProperty("left",l+"px")),e.adapter.setTrackActiveStyleProperty(s,"scaleX("+r+")");var i=o?c:l,n=e.adapter.isRTL()?l:c;t!==h.START&&t&&e.initialStylesRemoved||e.adapter.setThumbStyleProperty(s,"translateX("+i+"px)",h.START),t!==h.END&&t&&e.initialStylesRemoved||e.adapter.setThumbStyleProperty(s,"translateX("+n+"px)",h.END),e.removeInitialStyles(o),e.updateOverlappingThumbsUI(i,n,t)})}else requestAnimationFrame(function(){var t=o?e.rect.width-a:a;e.adapter.setThumbStyleProperty(s,"translateX("+t+"px)",h.END),e.adapter.setTrackActiveStyleProperty(s,"scaleX("+r+")"),e.removeInitialStyles(o)})},e.prototype.removeInitialStyles=function(t){if(!this.initialStylesRemoved){var e=t?"right":"left";this.adapter.removeThumbStyleProperty(e,h.END),this.isRange&&this.adapter.removeThumbStyleProperty(e,h.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},e.prototype.resetTrackAndThumbAnimation=function(){var t=this;if(this.isDiscrete){var e=no?iX(window,"transition"):"transition",i="all 0s ease 0s";this.adapter.setThumbStyleProperty(e,i,h.END),this.isRange&&this.adapter.setThumbStyleProperty(e,i,h.START),this.adapter.setTrackActiveStyleProperty(e,i),requestAnimationFrame(function(){t.adapter.removeThumbStyleProperty(e,h.END),t.adapter.removeTrackActiveStyleProperty(e),t.isRange&&t.adapter.removeThumbStyleProperty(e,h.START)})}},e.prototype.updateOverlappingThumbsUI=function(t,e,i){var n=!1;if(this.adapter.isRTL()){var r=t-this.startThumbKnobWidth/2;n=e+this.endThumbKnobWidth/2>=r}else n=t+this.startThumbKnobWidth/2>=e-this.endThumbKnobWidth/2;n?(this.adapter.addThumbClass(ni.THUMB_TOP,i||h.END),this.adapter.removeThumbClass(ni.THUMB_TOP,i===h.START?h.END:h.START)):(this.adapter.removeThumbClass(ni.THUMB_TOP,h.START),this.adapter.removeThumbClass(ni.THUMB_TOP,h.END))},e.prototype.convertAttributeValueToNumber=function(t,e){if(null===t)throw Error("MDCSliderFoundation: `"+e+"` must be non-null.");var i=Number(t);if(isNaN(i))throw Error("MDCSliderFoundation: `"+e+"` value is `"+t+"`, but must be a number.");return i},e.prototype.validateProperties=function(t){var e=t.min,i=t.max,n=t.value,r=t.valueStart;if(e>=i)throw Error("MDCSliderFoundation: min must be strictly less than max. "+("Current: [min: "+e+", max: ")+i+"]");if(this.isRange){if(n<e||n>i||r<e||r>i)throw Error("MDCSliderFoundation: values must be in [min, max] range. "+("Current values: [start value: "+r+", end value: ")+n+"]");if(r>n)throw Error("MDCSliderFoundation: start value must be <= end value. "+("Current values: [start value: "+r+", end value: ")+n+"]")}else if(n<e||n>i)throw Error("MDCSliderFoundation: value must be in [min, max] range. Current value: "+n)},e.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),e.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(h.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(h.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(h.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(h.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(h.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(h.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(h.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(h.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(h.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(h.END,"blur",this.inputEndBlurListener)},e.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),e.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(h.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(h.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(h.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(h.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(h.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(h.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(h.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(h.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(h.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(h.END,"blur",this.inputEndBlurListener)},e.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},e.SUPPORTS_POINTER_EVENTS=no&&!!window.PointerEvent,e}(eq),nl=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.skipInitialUIUpdate=!1,e.valueToAriaValueTextFn=null,e}return nt(e,t),e.attachTo=function(t,i){return void 0===i&&(i={}),new e(t,void 0,i)},e.prototype.getDefaultFoundation=function(){var t=this;return new ns({hasClass:function(e){return t.root.classList.contains(e)},addClass:function(e){t.root.classList.add(e)},removeClass:function(e){t.root.classList.remove(e)},addThumbClass:function(e,i){t.getThumbEl(i).classList.add(e)},removeThumbClass:function(e,i){t.getThumbEl(i).classList.remove(e)},getAttribute:function(e){return t.root.getAttribute(e)},getInputValue:function(e){return t.getInput(e).value},setInputValue:function(e,i){t.getInput(i).value=e},getInputAttribute:function(e,i){return t.getInput(i).getAttribute(e)},setInputAttribute:function(e,i,n){t.getInput(n).setAttribute(e,i)},removeInputAttribute:function(e,i){t.getInput(i).removeAttribute(e)},focusInput:function(e){t.getInput(e).focus()},isInputFocused:function(e){return t.getInput(e)===document.activeElement},getThumbKnobWidth:function(e){return t.getThumbEl(e).querySelector("."+ni.THUMB_KNOB).getBoundingClientRect().width},getThumbBoundingClientRect:function(e){return t.getThumbEl(e).getBoundingClientRect()},getBoundingClientRect:function(){return t.root.getBoundingClientRect()},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction},setThumbStyleProperty:function(e,i,n){t.getThumbEl(n).style.setProperty(e,i)},removeThumbStyleProperty:function(e,i){t.getThumbEl(i).style.removeProperty(e)},setTrackActiveStyleProperty:function(e,i){t.trackActive.style.setProperty(e,i)},removeTrackActiveStyleProperty:function(e){t.trackActive.style.removeProperty(e)},setValueIndicatorText:function(e,i){t.getThumbEl(i).querySelector("."+ni.VALUE_INDICATOR_TEXT).textContent=String(e)},getValueToAriaValueTextFn:function(){return t.valueToAriaValueTextFn},updateTickMarks:function(e){var i=t.root.querySelector("."+ni.TICK_MARKS_CONTAINER);i||((i=document.createElement("div")).classList.add(ni.TICK_MARKS_CONTAINER),t.root.querySelector("."+ni.TRACK).appendChild(i)),e.length!==i.children.length?(i.innerHTML="",t.addTickMarks(i,e)):t.updateTickMarks(i,e)},setPointerCapture:function(e){t.root.setPointerCapture(e)},emitChangeEvent:function(e,i){t.emit(na.CHANGE,{value:e,thumb:i})},emitInputEvent:function(e,i){t.emit(na.INPUT,{value:e,thumb:i})},emitDragStartEvent:function(e,i){t.getRipple(i).activate()},emitDragEndEvent:function(e,i){t.getRipple(i).deactivate()},registerEventHandler:function(e,i){t.listen(e,i)},deregisterEventHandler:function(e,i){t.unlisten(e,i)},registerThumbEventHandler:function(e,i,n){t.getThumbEl(e).addEventListener(i,n)},deregisterThumbEventHandler:function(e,i,n){t.getThumbEl(e).removeEventListener(i,n)},registerInputEventHandler:function(e,i,n){t.getInput(e).addEventListener(i,n)},deregisterInputEventHandler:function(e,i,n){t.getInput(e).removeEventListener(i,n)},registerBodyEventHandler:function(t,e){document.body.addEventListener(t,e)},deregisterBodyEventHandler:function(t,e){document.body.removeEventListener(t,e)},registerWindowEventHandler:function(t,e){window.addEventListener(t,e)},deregisterWindowEventHandler:function(t,e){window.removeEventListener(t,e)}})},e.prototype.initialize=function(t){var e=(void 0===t?{}:t).skipInitialUIUpdate;this.inputs=[].slice.call(this.root.querySelectorAll("."+ni.INPUT)),this.thumbs=[].slice.call(this.root.querySelectorAll("."+ni.THUMB)),this.trackActive=this.root.querySelector("."+ni.TRACK_ACTIVE),this.ripples=this.createRipples(),e&&(this.skipInitialUIUpdate=!0)},e.prototype.initialSyncWithDOM=function(){this.foundation.layout({skipUpdateUI:this.skipInitialUIUpdate})},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getValueStart=function(){return this.foundation.getValueStart()},e.prototype.setValueStart=function(t){this.foundation.setValueStart(t)},e.prototype.getValue=function(){return this.foundation.getValue()},e.prototype.setValue=function(t){this.foundation.setValue(t)},e.prototype.getDisabled=function(){return this.foundation.getDisabled()},e.prototype.setDisabled=function(t){this.foundation.setDisabled(t)},e.prototype.setValueToAriaValueTextFn=function(t){this.valueToAriaValueTextFn=t},e.prototype.getThumbEl=function(t){return t===h.END?this.thumbs[this.thumbs.length-1]:this.thumbs[0]},e.prototype.getInput=function(t){return t===h.END?this.inputs[this.inputs.length-1]:this.inputs[0]},e.prototype.getRipple=function(t){return t===h.END?this.ripples[this.ripples.length-1]:this.ripples[0]},e.prototype.addTickMarks=function(t,e){for(var i=document.createDocumentFragment(),n=0;n<e.length;n++){var r=document.createElement("div"),a=e[n]===u.ACTIVE?ni.TICK_MARK_ACTIVE:ni.TICK_MARK_INACTIVE;r.classList.add(a),i.appendChild(r)}t.appendChild(i)},e.prototype.updateTickMarks=function(t,e){for(var i=Array.from(t.children),n=0;n<i.length;n++)e[n]===u.ACTIVE?(i[n].classList.add(ni.TICK_MARK_ACTIVE),i[n].classList.remove(ni.TICK_MARK_INACTIVE)):(i[n].classList.add(ni.TICK_MARK_INACTIVE),i[n].classList.remove(ni.TICK_MARK_ACTIVE))},e.prototype.createRipples=function(){for(var t=[],e=[].slice.call(this.root.querySelectorAll("."+ni.THUMB)),i=this,n=0;n<e.length;n++)!function(n){var r=e[n],a=i.inputs[n],o=ne(ne({},ib.createAdapter(i)),{addClass:function(t){r.classList.add(t)},computeBoundingRect:function(){return r.getBoundingClientRect()},deregisterInteractionHandler:function(t,e){a.removeEventListener(t,e)},isSurfaceActive:function(){return eW(a,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,e){a.addEventListener(t,e)},removeClass:function(t){r.classList.remove(t)},updateCssVariable:function(t,e){r.style.setProperty(t,e)}}),s=new ib(r,new i_(o));s.unbounded=!0,t.push(s)}(n);return t},e}(eG),nc=function(t,e){return(nc=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function nd(t,e){function i(){this.constructor=t}nc(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var nu=function(){return(nu=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nh={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},np={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:'button:not(:disabled), [href]:not([aria-disabled="true"]), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'},nm={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(p||(p={})),function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(m||(m={}));var nf=function(t,e){return(nf=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function ng(t,e){function i(){this.constructor=t}nf(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n_=function(){return(n_=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nb=function(t,e){return(nb=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function ny(t,e){function i(){this.constructor=t}nb(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var nv=function(){return(nv=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nx={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},nw={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+nx.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+nx.LIST_ITEM_CLASS+" a\n ",FOCUSABLE_CHILD_ELEMENTS:"\n ."+nx.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+nx.LIST_ITEM_CLASS+" a,\n ."+nx.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+nx.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]'},nk={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},nE={UNKNOWN:"Unknown",BACKSPACE:"Backspace",ENTER:"Enter",SPACEBAR:"Spacebar",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",END:"End",HOME:"Home",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",DELETE:"Delete",ESCAPE:"Escape"},nC=new Set;nC.add(nE.BACKSPACE),nC.add(nE.ENTER),nC.add(nE.SPACEBAR),nC.add(nE.PAGE_UP),nC.add(nE.PAGE_DOWN),nC.add(nE.END),nC.add(nE.HOME),nC.add(nE.ARROW_LEFT),nC.add(nE.ARROW_UP),nC.add(nE.ARROW_RIGHT),nC.add(nE.ARROW_DOWN),nC.add(nE.DELETE),nC.add(nE.ESCAPE);var nA={BACKSPACE:8,ENTER:13,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,DELETE:46,ESCAPE:27},nT=new Map;nT.set(nA.BACKSPACE,nE.BACKSPACE),nT.set(nA.ENTER,nE.ENTER),nT.set(nA.SPACEBAR,nE.SPACEBAR),nT.set(nA.PAGE_UP,nE.PAGE_UP),nT.set(nA.PAGE_DOWN,nE.PAGE_DOWN),nT.set(nA.END,nE.END),nT.set(nA.HOME,nE.HOME),nT.set(nA.ARROW_LEFT,nE.ARROW_LEFT),nT.set(nA.ARROW_UP,nE.ARROW_UP),nT.set(nA.ARROW_RIGHT,nE.ARROW_RIGHT),nT.set(nA.ARROW_DOWN,nE.ARROW_DOWN),nT.set(nA.DELETE,nE.DELETE),nT.set(nA.ESCAPE,nE.ESCAPE);var nI=new Set;function nS(t){var e=t.key;if(nC.has(e))return e;var i=nT.get(t.keyCode);return i||nE.UNKNOWN}nI.add(nE.PAGE_UP),nI.add(nE.PAGE_DOWN),nI.add(nE.END),nI.add(nE.HOME),nI.add(nE.ARROW_LEFT),nI.add(nE.ARROW_UP),nI.add(nE.ARROW_RIGHT),nI.add(nE.ARROW_DOWN);var nz=["input","button","textarea","select"],nL=function(t){var e=t.target;if(e){var i=(""+e.tagName).toLowerCase();-1===nz.indexOf(i)&&t.preventDefault()}};function nM(t,e){var i,n=t.nextChar,r=t.focusItemAtIndex,a=t.sortedIndexByFirstChar,o=t.focusedItemIndex,s=t.skipFocus,l=t.isItemAtIndexDisabled;return clearTimeout(e.bufferClearTimeout),e.bufferClearTimeout=setTimeout(function(){nR(e)},nk.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),e.typeaheadBuffer=e.typeaheadBuffer+n,-1===(i=1===e.typeaheadBuffer.length?function(t,e,i,n){var r,a=n.typeaheadBuffer[0],o=t.get(a);if(!o)return -1;if(a===n.currentFirstChar&&o[n.sortedIndexCursor].index===e){n.sortedIndexCursor=(n.sortedIndexCursor+1)%o.length;var s=o[n.sortedIndexCursor].index;if(!i(s))return s}n.currentFirstChar=a;var l=-1;for(r=0;r<o.length;r++)if(!i(o[r].index)){l=r;break}for(;r<o.length;r++)if(o[r].index>e&&!i(o[r].index)){l=r;break}return -1!==l?(n.sortedIndexCursor=l,o[n.sortedIndexCursor].index):-1}(a,o,l,e):function(t,e,i){var n=i.typeaheadBuffer[0],r=t.get(n);if(!r)return -1;var a=r[i.sortedIndexCursor];if(0===a.text.lastIndexOf(i.typeaheadBuffer,0)&&!e(a.index))return a.index;for(var o=(i.sortedIndexCursor+1)%r.length,s=-1;o!==i.sortedIndexCursor;){var l=r[o],c=0===l.text.lastIndexOf(i.typeaheadBuffer,0),d=!e(l.index);if(c&&d){s=o;break}o=(o+1)%r.length}return -1!==s?(i.sortedIndexCursor=s,r[i.sortedIndexCursor].index):-1}(a,l,e))||s||r(i),i}function nP(t){return t.typeaheadBuffer.length>0}function nR(t){t.typeaheadBuffer=""}function nO(t,e){var i=t.event,n=t.isTargetListItem,r=t.focusedItemIndex,a=t.focusItemAtIndex,o=t.sortedIndexByFirstChar,s=t.isItemAtIndexDisabled,l="ArrowLeft"===nS(i),c="ArrowUp"===nS(i),d="ArrowRight"===nS(i),u="ArrowDown"===nS(i),h="Home"===nS(i),p="End"===nS(i),m="Enter"===nS(i),f="Spacebar"===nS(i);if(l||c||d||u||h||p||m)return -1;if(!f&&1===i.key.length){nL(i);var g={focusItemAtIndex:a,focusedItemIndex:r,nextChar:i.key.toLowerCase(),sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:s};return nM(g,e)}if(!f)return -1;if(n&&nL(i),n&&nP(e)){var g={focusItemAtIndex:a,focusedItemIndex:r,nextChar:" ",sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:s};return nM(g,e)}return -1}var nD=function(t){function e(i){var n=t.call(this,nv(nv({},e.defaultAdapter),i))||this;return n.wrapFocus_=!1,n.isVertical_=!0,n.isSingleSelectionList_=!1,n.selectedIndex_=nk.UNSET_INDEX,n.focusedItemIndex=nk.UNSET_INDEX,n.useActivatedClass_=!1,n.useSelectedAttr_=!1,n.ariaCurrentAttrValue_=null,n.isCheckboxList_=!1,n.isRadioList_=!1,n.hasTypeahead=!1,n.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},n.sortedIndexByFirstChar=new Map,n}return ny(e,t),Object.defineProperty(e,"strings",{get:function(){return nw},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return nx},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return nk},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!0,configurable:!0}),e.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList_=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},e.prototype.setWrapFocus=function(t){this.wrapFocus_=t},e.prototype.setVerticalOrientation=function(t){this.isVertical_=t},e.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t,t&&this.maybeInitializeSingleSelection()},e.prototype.maybeInitializeSingleSelection=function(){for(var t=0;t<this.adapter.getListItemCount();t++){var e=this.adapter.listItemAtIndexHasClass(t,nx.LIST_ITEM_SELECTED_CLASS),i=this.adapter.listItemAtIndexHasClass(t,nx.LIST_ITEM_ACTIVATED_CLASS);if(e||i){i&&this.setUseActivatedClass(!0),this.isSingleSelectionList_=!0,this.selectedIndex_=t;return}}},e.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},e.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&nP(this.typeaheadState)},e.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},e.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr_=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex_},e.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},e.prototype.handleFocusIn=function(t,e){e>=0&&(this.focusedItemIndex=e,this.adapter.setAttributeForElementIndex(e,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(e,"0"))},e.prototype.handleFocusOut=function(t,e){var i=this;e>=0&&(this.adapter.setAttributeForElementIndex(e,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(e,"-1")),setTimeout(function(){i.adapter.isFocusInsideList()||i.setTabindexToFirstSelectedOrFocusedItem()},0)},e.prototype.handleKeydown=function(t,e,i){var n=this,r="ArrowLeft"===nS(t),a="ArrowUp"===nS(t),o="ArrowRight"===nS(t),s="ArrowDown"===nS(t),l="Home"===nS(t),c="End"===nS(t),d="Enter"===nS(t),u="Spacebar"===nS(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused()){if(a||c?(t.preventDefault(),this.focusLastElement()):(s||l)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead){var p={event:t,focusItemAtIndex:function(t){n.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return n.adapter.listItemAtIndexHasClass(t,nx.LIST_ITEM_DISABLED_CLASS)}};nO(p,this.typeaheadState)}return}var m=this.adapter.getFocusedElementIndex();if(-1!==m||!((m=i)<0)){if(this.isVertical_&&s||!this.isVertical_&&o)nL(t),this.focusNextElement(m);else if(this.isVertical_&&a||!this.isVertical_&&r)nL(t),this.focusPrevElement(m);else if(l)nL(t),this.focusFirstElement();else if(c)nL(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList_)t.preventDefault(),this.toggleAll(this.selectedIndex_===nk.UNSET_INDEX?[]:this.selectedIndex_);else if((d||u)&&e){var f=t.target;if(f&&"A"===f.tagName&&d||(nL(t),this.adapter.listItemAtIndexHasClass(m,nx.LIST_ITEM_DISABLED_CLASS)))return;this.isTypeaheadInProgress()||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(m),this.adapter.notifyAction(m))}if(this.hasTypeahead){var p={event:t,focusItemAtIndex:function(t){n.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return n.adapter.listItemAtIndexHasClass(t,nx.LIST_ITEM_DISABLED_CLASS)}};nO(p,this.typeaheadState)}}},e.prototype.handleClick=function(t,e){t!==nk.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,nx.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(t,e),this.adapter.notifyAction(t)))},e.prototype.focusNextElement=function(t){var e=this.adapter.getListItemCount(),i=t+1;if(i>=e)if(!this.wrapFocus_)return t;else i=0;return this.focusItemAtIndex(i),i},e.prototype.focusPrevElement=function(t){var e=t-1;if(e<0)if(!this.wrapFocus_)return t;else e=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(e),e},e.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},e.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},e.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},e.prototype.setEnabled=function(t,e){this.isIndexValid_(t)&&(e?(this.adapter.removeClassForElementIndex(t,nx.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,nw.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,nx.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,nw.ARIA_DISABLED,"true")))},e.prototype.setSingleSelectionAtIndex_=function(t){if(this.selectedIndex_!==t){var e=nx.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(e=nx.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==nk.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex_,e),this.setAriaForSingleSelectionAtIndex_(t),this.setTabindexAtIndex(t),t!==nk.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,e),this.selectedIndex_=t}},e.prototype.setAriaForSingleSelectionAtIndex_=function(t){this.selectedIndex_===nk.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(t,nw.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue_,i=e?nw.ARIA_CURRENT:nw.ARIA_SELECTED;if(this.selectedIndex_!==nk.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false"),t!==nk.UNSET_INDEX){var n=e?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(t,i,n)}},e.prototype.getSelectionAttribute=function(){return this.useSelectedAttr_?nw.ARIA_SELECTED:nw.ARIA_CHECKED},e.prototype.setRadioAtIndex_=function(t){var e=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex_!==nk.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,e,"false"),this.adapter.setAttributeForElementIndex(t,e,"true"),this.selectedIndex_=t},e.prototype.setCheckboxAtIndex_=function(t){for(var e=this.getSelectionAttribute(),i=0;i<this.adapter.getListItemCount();i++){var n=!1;t.indexOf(i)>=0&&(n=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(i,n),this.adapter.setAttributeForElementIndex(i,e,n?"true":"false")}this.selectedIndex_=t},e.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===nk.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex_ instanceof Array||this.selectedIndex_===t||this.adapter.setAttributeForElementIndex(this.selectedIndex_,"tabindex","-1"),t!==nk.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},e.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},e.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},e.prototype.getFirstSelectedOrFocusedItemIndex=function(){var t=this.focusedItemIndex>=0?this.focusedItemIndex:0;return this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==nk.UNSET_INDEX?t=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(t=this.selectedIndex_.reduce(function(t,e){return Math.min(t,e)}))),t},e.prototype.isIndexValid_=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList_)throw Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some(function(t){return e.isIndexInRange_(t)})}if("number"!=typeof t)return!1;if(this.isCheckboxList_)throw Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)||this.isSingleSelectionList_&&t===nk.UNSET_INDEX},e.prototype.isIndexInRange_=function(t){var e=this.adapter.getListItemCount();return t>=0&&t<e},e.prototype.setSelectedIndexOnAction_=function(t,e){void 0===e&&(e=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,e):this.setSelectedIndex(t)},e.prototype.toggleCheckboxAtIndex_=function(t,e){var i=this.getSelectionAttribute(),n=this.adapter.isCheckboxCheckedAtIndex(t);e&&(n=!n,this.adapter.setCheckedCheckboxOrRadioAtIndex(t,n)),this.adapter.setAttributeForElementIndex(t,i,n?"true":"false");var r=this.selectedIndex_===nk.UNSET_INDEX?[]:this.selectedIndex_.slice();n?r.push(t):r=r.filter(function(e){return e!==t}),this.selectedIndex_=r},e.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},e.prototype.toggleAll=function(t){var e=this.adapter.getListItemCount();if(t.length===e)this.setCheckboxAtIndex_([]);else{for(var i=[],n=0;n<e;n++)(!this.adapter.listItemAtIndexHasClass(n,nx.LIST_ITEM_DISABLED_CLASS)||t.indexOf(n)>-1)&&i.push(n);this.setCheckboxAtIndex_(i)}},e.prototype.typeaheadMatchItem=function(t,e,i){var n=this;return void 0===i&&(i=!1),nM({focusItemAtIndex:function(t){n.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:i,isItemAtIndexDisabled:function(t){return n.adapter.listItemAtIndexHasClass(t,nx.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},e.prototype.typeaheadInitSortedIndex=function(){return function(t,e){for(var i=new Map,n=0;n<t;n++){var r=e(n).trim();if(r){var a=r[0].toLowerCase();i.has(a)||i.set(a,[]),i.get(a).push({text:r.toLowerCase(),index:n})}}return i.forEach(function(t){t.sort(function(t,e){return t.index-e.index})}),i}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},e.prototype.clearTypeaheadBuffer=function(){nR(this.typeaheadState)},e}(eq),nB=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ny(e,t),Object.defineProperty(e.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listElements",{get:function(){return[].slice.call(this.root.querySelectorAll("."+nx.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){this.handleClick_=this.handleClickEvent_.bind(this),this.handleKeydown_=this.handleKeydownEvent_.bind(this),this.focusInEventListener_=this.handleFocusInEvent_.bind(this),this.focusOutEventListener_=this.handleFocusOutEvent_.bind(this),this.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_),this.listen("focusin",this.focusInEventListener_),this.listen("focusout",this.focusOutEventListener_),this.layout(),this.initializeListType()},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},e.prototype.layout=function(){var t=this.root.getAttribute(nw.ARIA_ORIENTATION);this.vertical=t!==nw.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(t){t.setAttribute("tabindex","-1")}),[].slice.call(this.root.querySelectorAll(nw.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(t){return t.setAttribute("tabindex","-1")}),this.foundation.layout()},e.prototype.getPrimaryText=function(t){var e=t.querySelector("."+nx.LIST_ITEM_PRIMARY_TEXT_CLASS);if(e)return e.textContent||"";var i=t.querySelector("."+nx.LIST_ITEM_TEXT_CLASS);return i&&i.textContent||""},e.prototype.initializeListType=function(){var t=this,e=this.root.querySelectorAll(nw.ARIA_ROLE_CHECKBOX_SELECTOR),i=this.root.querySelector(nw.ARIA_CHECKED_RADIO_SELECTOR);if(e.length){var n=this.root.querySelectorAll(nw.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(n,function(e){return t.listElements.indexOf(e)})}else i&&(this.selectedIndex=this.listElements.indexOf(i))},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},e.prototype.getDefaultFoundation=function(){var t=this;return new nD({addClassForElementIndex:function(e,i){var n=t.listElements[e];n&&n.classList.add(i)},focusItemAtIndex:function(e){var i=t.listElements[e];i&&i.focus()},getAttributeForElementIndex:function(e,i){return t.listElements[e].getAttribute(i)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(e){return t.getPrimaryText(t.listElements[e])},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(nw.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(nw.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(nw.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(e,i){return t.listElements[e].classList.contains(i)},notifyAction:function(e){t.emit(nw.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,i){var n=t.listElements[e];n&&n.classList.remove(i)},setAttributeForElementIndex:function(e,i,n){var r=t.listElements[e];r&&r.setAttribute(i,n)},setCheckedCheckboxOrRadioAtIndex:function(e,i){var n=t.listElements[e].querySelector(nw.CHECKBOX_RADIO_SELECTOR);n.checked=i;var r=document.createEvent("Event");r.initEvent("change",!0,!0),n.dispatchEvent(r)},setTabIndexForListItemChildren:function(e,i){var n=t.listElements[e];[].slice.call(n.querySelectorAll(nw.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(t){return t.setAttribute("tabindex",i)})}})},e.prototype.getListItemIndex_=function(t){var e=eZ(t.target,"."+nx.LIST_ITEM_CLASS+", ."+nx.ROOT);return e&&eW(e,"."+nx.LIST_ITEM_CLASS)?this.listElements.indexOf(e):-1},e.prototype.handleFocusInEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation.handleFocusIn(t,e)},e.prototype.handleFocusOutEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation.handleFocusOut(t,e)},e.prototype.handleKeydownEvent_=function(t){var e=this.getListItemIndex_(t),i=t.target;this.foundation.handleKeydown(t,i.classList.contains(nx.LIST_ITEM_CLASS),e)},e.prototype.handleClickEvent_=function(t){var e=this.getListItemIndex_(t),i=!eW(t.target,nw.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,i)},e}(eG),nF=function(t,e){return(nF=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function nN(t,e){function i(){this.constructor=t}nF(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var nV=function(){return(nV=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nU=function(t){function e(i){var n=t.call(this,nV(nV({},e.defaultAdapter),i))||this;return n.isSurfaceOpen=!1,n.isQuickOpen=!1,n.isHoistedElement=!1,n.isFixedPosition=!1,n.openAnimationEndTimerId=0,n.closeAnimationEndTimerId=0,n.animationRequestId=0,n.anchorCorner=m.TOP_START,n.originCorner=m.TOP_START,n.anchorMargin={top:0,right:0,bottom:0,left:0},n.position={x:0,y:0},n}return nN(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return nh},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return np},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return nm},enumerable:!0,configurable:!0}),Object.defineProperty(e,"Corner",{get:function(){return m},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=e.cssClasses,i=t.ROOT,n=t.OPEN;if(!this.adapter.hasClass(i))throw Error(i+" class required in root element.");this.adapter.hasClass(n)&&(this.isSurfaceOpen=!0)},e.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},e.prototype.setAnchorCorner=function(t){this.anchorCorner=t},e.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^p.RIGHT},e.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},e.prototype.setIsHoisted=function(t){this.isHoistedElement=t},e.prototype.setFixedPosition=function(t){this.isFixedPosition=t},e.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},e.prototype.setQuickOpen=function(t){this.isQuickOpen=t},e.prototype.isOpen=function(){return this.isSurfaceOpen},e.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(e.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(e.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){t.adapter.addClass(e.cssClasses.OPEN),t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.openAnimationEndTimerId=setTimeout(function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(e.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()},nm.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},e.prototype.close=function(t){var i=this;void 0===t&&(t=!1),this.isSurfaceOpen&&(this.isQuickOpen?(this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(e.cssClasses.OPEN),this.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose()):(this.adapter.addClass(e.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){i.adapter.removeClass(e.cssClasses.OPEN),i.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),i.closeAnimationEndTimerId=setTimeout(function(){i.closeAnimationEndTimerId=0,i.adapter.removeClass(e.cssClasses.ANIMATING_CLOSED),i.adapter.notifyClose()},nm.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()))},e.prototype.handleBodyClick=function(t){var e=t.target;this.adapter.isElementInContainer(e)||this.close()},e.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},e.prototype.autoposition=function(){this.measurements=this.getAutoLayoutmeasurements();var t,i=this.getoriginCorner(),n=this.getMenuSurfaceMaxHeight(i),r=this.hasBit(i,p.BOTTOM)?"bottom":"top",a=this.hasBit(i,p.RIGHT)?"right":"left",o=this.getHorizontalOriginOffset(i),s=this.getVerticalOriginOffset(i),l=this.measurements,c=l.anchorSize,d=l.surfaceSize,u=((t={})[a]=o,t[r]=s,t);c.width/d.width>nm.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(a="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(u),this.adapter.setTransformOrigin(a+" "+r),this.adapter.setPosition(u),this.adapter.setMaxHeight(n?n+"px":""),this.hasBit(i,p.BOTTOM)||this.adapter.addClass(e.cssClasses.IS_OPEN_BELOW)},e.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),i=this.adapter.getWindowDimensions(),n=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:i.width-t.right,bottom:i.height-t.bottom,left:t.left},viewportSize:i,windowScroll:n}},e.prototype.getoriginCorner=function(){var t,i,n,r,a=this.originCorner,o=this.measurements,s=o.viewportDistance,l=o.anchorSize,c=o.surfaceSize,d=e.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,p.BOTTOM)?(t=s.top-d+l.height+this.anchorMargin.bottom,i=s.bottom-d-this.anchorMargin.bottom):(t=s.top-d+this.anchorMargin.top,i=s.bottom-d+l.height-this.anchorMargin.top),!(i-c.height>0)&&t>=i&&(a=this.setBit(a,p.BOTTOM));var u=this.adapter.isRtl(),h=this.hasBit(this.anchorCorner,p.FLIP_RTL),m=this.hasBit(this.anchorCorner,p.RIGHT)||this.hasBit(a,p.RIGHT),f=!1;(f=u&&h?!m:m)?(n=s.left+l.width+this.anchorMargin.right,r=s.right-this.anchorMargin.right):(n=s.left+this.anchorMargin.left,r=s.right+l.width-this.anchorMargin.left);var g=n-c.width>0,_=r-c.width>0,b=this.hasBit(a,p.FLIP_RTL)&&this.hasBit(a,p.RIGHT);return _&&b&&u||!g&&b?a=this.unsetBit(a,p.RIGHT):(g&&f&&u||g&&!f&&m||!_&&n>=r)&&(a=this.setBit(a,p.RIGHT)),a},e.prototype.getMenuSurfaceMaxHeight=function(t){var i=this.measurements.viewportDistance,n=0,r=this.hasBit(t,p.BOTTOM),a=this.hasBit(this.anchorCorner,p.BOTTOM),o=e.numbers.MARGIN_TO_EDGE;return r?(n=i.top+this.anchorMargin.top-o,a||(n+=this.measurements.anchorSize.height)):(n=i.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-o,a&&(n-=this.measurements.anchorSize.height)),n},e.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,p.RIGHT),n=this.hasBit(this.anchorCorner,p.RIGHT);if(i){var r=n?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?r-(this.measurements.viewportSize.width-this.measurements.bodySize.width):r}return n?e.width-this.anchorMargin.right:this.anchorMargin.left},e.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,p.BOTTOM),n=this.hasBit(this.anchorCorner,p.BOTTOM);return i?n?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:n?e.height+this.anchorMargin.bottom:this.anchorMargin.top},e.prototype.adjustPositionForHoistedElement=function(t){var e,i,n=this.measurements,r=n.windowScroll,a=n.viewportDistance,o=Object.keys(t);try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),l=s.next();!l.done;l=s.next()){var c=l.value,d=t[c]||0;d+=a[c],this.isFixedPosition||("top"===c?d+=r.y:"bottom"===c?d-=r.y:"left"===c?d+=r.x:d-=r.x),t[c]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}},e.prototype.maybeRestoreFocus=function(){var t=this.adapter.isFocused(),e=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(t||e)&&this.adapter.restoreFocus()},e.prototype.hasBit=function(t,e){return!!(t&e)},e.prototype.setBit=function(t,e){return t|e},e.prototype.unsetBit=function(t,e){return t^e},e.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},e}(eq),n$=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nN(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root.parentElement;this.anchorElement=e&&e.classList.contains(nh.ANCHOR)?e:null,this.root.classList.contains(nh.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleBodyClick=function(e){t.foundation.handleBodyClick(e)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(np.OPENED_EVENT,this.registerBodyClickListener),this.listen(np.CLOSED_EVENT,this.deregisterBodyClickListener)},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(np.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(np.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},e.prototype.isOpen=function(){return this.foundation.isOpen()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!0,configurable:!0}),e.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},e.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},e.prototype.setFixedPosition=function(t){t?this.root.classList.add(nh.FIXED):this.root.classList.remove(nh.FIXED),this.foundation.setFixedPosition(t)},e.prototype.setAbsolutePosition=function(t,e){this.foundation.setAbsolutePosition(t,e),this.setIsHoisted(!0)},e.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new nU({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(nU.strings.CLOSED_EVENT,{})},notifyOpen:function(){return t.emit(nU.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(e){var i,n,r=(i=window,void 0===n&&(n=!1),(void 0===f||n)&&(f="transform"in i.document.createElement("div").style?"transform":"webkitTransform"),f+"-origin");t.root.style.setProperty(r,e)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&t.previousFocus&&t.previousFocus.focus&&t.previousFocus.focus()},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){var i=t.root;i.style.left="left"in e?e.left+"px":"",i.style.right="right"in e?e.right+"px":"",i.style.top="top"in e?e.top+"px":"",i.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root.style.maxHeight=e}})},e}(eG),nj={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},nH={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list",SELECTED_EVENT:"MDCMenu:selected"},nq={FOCUS_ROOT_INDEX:-1};!function(t){t[t.NONE=0]="NONE",t[t.LIST_ROOT=1]="LIST_ROOT",t[t.FIRST_ITEM=2]="FIRST_ITEM",t[t.LAST_ITEM=3]="LAST_ITEM"}(g||(g={}));var nG=function(t){function e(i){var n=t.call(this,n_(n_({},e.defaultAdapter),i))||this;return n.closeAnimationEndTimerId_=0,n.defaultFocusState_=g.LIST_ROOT,n}return ng(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return nj},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nH},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return nq},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return -1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return -1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter.closeSurface()},e.prototype.handleKeydown=function(t){var e=t.key,i=t.keyCode;("Tab"===e||9===i)&&this.adapter.closeSurface(!0)},e.prototype.handleItemAction=function(t){var e=this,i=this.adapter.getElementIndex(t);i<0||(this.adapter.notifySelected({index:i}),this.adapter.closeSurface(),this.closeAnimationEndTimerId_=setTimeout(function(){var i=e.adapter.getElementIndex(t);i>=0&&e.adapter.isSelectableItemAtIndex(i)&&e.setSelectedIndex(i)},nU.numbers.TRANSITION_CLOSE_DURATION))},e.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState_){case g.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case g.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case g.NONE:break;default:this.adapter.focusListRoot()}},e.prototype.setDefaultFocusState=function(t){this.defaultFocusState_=t},e.prototype.setSelectedIndex=function(t){if(this.validatedIndex_(t),!this.adapter.isSelectableItemAtIndex(t))throw Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,nH.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,nj.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,nj.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,nH.ARIA_CHECKED_ATTR,"true")},e.prototype.setEnabled=function(t,e){this.validatedIndex_(t),e?(this.adapter.removeClassFromElementAtIndex(t,nx.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,nH.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,nx.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,nH.ARIA_DISABLED_ATTR,"true"))},e.prototype.validatedIndex_=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw Error("MDCMenuFoundation: No list item at specified index.")},e}(eq),nX=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return ng(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new n$(t)}),void 0===e&&(e=function(t){return new nB(t)}),this.menuSurfaceFactory_=t,this.listFactory_=e},e.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface_=this.menuSurfaceFactory_(this.root);var e=this.root.querySelector(nH.LIST_SELECTOR);e?(this.list_=this.listFactory_(e),this.list_.wrapFocus=!0):this.list_=null,this.handleKeydown_=function(e){return t.foundation.handleKeydown(e)},this.handleItemAction_=function(e){return t.foundation.handleItemAction(t.items[e.detail.index])},this.handleMenuSurfaceOpened_=function(){return t.foundation.handleMenuSurfaceOpened()},this.menuSurface_.listen(nU.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.listen("keydown",this.handleKeydown_),this.listen(nD.strings.ACTION_EVENT,this.handleItemAction_)},e.prototype.destroy=function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten(nU.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(nD.strings.ACTION_EVENT,this.handleItemAction_),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.menuSurface_.isOpen()},set:function(t){t?this.menuSurface_.open():this.menuSurface_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{get:function(){return!!this.list_&&this.list_.wrapFocus},set:function(t){this.list_&&(this.list_.wrapFocus=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.list_&&(this.list_.hasTypeahead=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return!!this.list_&&this.list_.typeaheadInProgress},enumerable:!0,configurable:!0}),e.prototype.typeaheadMatchItem=function(t,e){return this.list_?this.list_.typeaheadMatchItem(t,e):-1},e.prototype.layout=function(){this.list_&&this.list_.layout()},Object.defineProperty(e.prototype,"items",{get:function(){return this.list_?this.list_.listElements:[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.list_&&(this.list_.singleSelection=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.list_?this.list_.selectedIndex:nk.UNSET_INDEX},set:function(t){this.list_&&(this.list_.selectedIndex=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.menuSurface_.quickOpen=t},enumerable:!0,configurable:!0}),e.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},e.prototype.setAnchorCorner=function(t){this.menuSurface_.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.menuSurface_.setAnchorMargin(t)},e.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},e.prototype.getPrimaryTextAtIndex=function(t){var e=this.getOptionByIndex(t);return e&&this.list_&&this.list_.getPrimaryText(e)||""},e.prototype.setFixedPosition=function(t){this.menuSurface_.setFixedPosition(t)},e.prototype.setIsHoisted=function(t){this.menuSurface_.setIsHoisted(t)},e.prototype.setAbsolutePosition=function(t,e){this.menuSurface_.setAbsolutePosition(t,e)},e.prototype.setAnchorElement=function(t){this.menuSurface_.anchorElement=t},e.prototype.getDefaultFoundation=function(){var t=this;return new nG({addClassToElementAtIndex:function(e,i){t.items[e].classList.add(i)},removeClassFromElementAtIndex:function(e,i){t.items[e].classList.remove(i)},addAttributeToElementAtIndex:function(e,i,n){t.items[e].setAttribute(i,n)},removeAttributeFromElementAtIndex:function(e,i){t.items[e].removeAttribute(i)},elementContainsClass:function(t,e){return t.classList.contains(e)},closeSurface:function(e){return t.menuSurface_.close(e)},getElementIndex:function(e){return t.items.indexOf(e)},notifySelected:function(e){return t.emit(nH.SELECTED_EVENT,{index:e.index,item:t.items[e.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(e){return t.items[e].focus()},focusListRoot:function(){return t.root.querySelector(nH.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(e){return!!eZ(t.items[e],"."+nj.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(e){var i=eZ(t.items[e],"."+nj.MENU_SELECTION_GROUP).querySelector("."+nj.MENU_SELECTED_LIST_ITEM);return i?t.items.indexOf(i):-1}})},e}(eG),nZ={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},nW={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},nY={LABEL_SCALE:.75,UNSET_INDEX:-1,CLICK_DEBOUNCE_TIMEOUT_MS:330},nK=function(t){function e(i,n){void 0===n&&(n={});var r=t.call(this,nu(nu({},e.defaultAdapter),i))||this;return r.disabled=!1,r.isMenuOpen=!1,r.useDefaultValidation=!0,r.customValidity=!0,r.lastSelectedIndex=nY.UNSET_INDEX,r.clickDebounceTimeout=0,r.recentlyClicked=!1,r.leadingIcon=n.leadingIcon,r.helperText=n.helperText,r}return nd(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return nZ},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return nY},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nW},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return -1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return -1}}},enumerable:!0,configurable:!0}),e.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},e.prototype.setSelectedIndex=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),t>=this.adapter.getMenuItemCount()||(t===nY.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),e&&this.adapter.closeMenu(),i||this.lastSelectedIndex===t||this.handleChange(),this.lastSelectedIndex=t)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var i=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(i,!1,e)},e.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),e=this.adapter.getMenuItemValues();return t!==nY.UNSET_INDEX?e[t]:""},e.prototype.getDisabled=function(){return this.disabled},e.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(nZ.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(nZ.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},e.prototype.openMenu=function(){this.adapter.addClass(nZ.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},e.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},e.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,e=this.adapter.hasClass(nZ.FOCUSED),i=t||e,n=this.adapter.hasClass(nZ.REQUIRED);this.notchOutline(i),this.adapter.floatLabel(i),this.adapter.setLabelRequired(n)}},e.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(t,!1,!0)},e.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var t=this.getSelectedIndex();this.adapter.focusMenuItemAtIndex(t>=0?t:0)}},e.prototype.handleMenuClosed=function(){this.adapter.removeClass(nZ.ACTIVATED),this.isMenuOpen=!1,this.adapter.setSelectAnchorAttr("aria-expanded","false"),this.adapter.isSelectAnchorFocused()||this.blur()},e.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(nZ.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},e.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},e.prototype.handleFocus=function(){this.adapter.addClass(nZ.FOCUSED),this.layout(),this.adapter.activateBottomLine()},e.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},e.prototype.handleClick=function(t){if(!this.disabled&&!this.recentlyClicked){if(this.setClickDebounceTimeout(),this.isMenuOpen)return void this.adapter.closeMenu();this.adapter.setRippleCenter(t),this.openMenu()}},e.prototype.handleKeydown=function(t){if(!this.isMenuOpen&&this.adapter.hasClass(nZ.FOCUSED)){var e=nS(t)===nE.ENTER,i=nS(t)===nE.SPACEBAR,n=nS(t)===nE.ARROW_UP,r=nS(t)===nE.ARROW_DOWN;if(!i&&t.key&&1===t.key.length||i&&this.adapter.isTypeaheadInProgress()){var a=i?" ":t.key,o=this.adapter.typeaheadMatchItem(a,this.getSelectedIndex());o>=0&&this.setSelectedIndex(o),t.preventDefault();return}(e||i||n||r)&&(n&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):r&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),t.preventDefault())}},e.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var e=this.adapter.hasClass(nZ.FOCUSED);if(t){var i=nY.LABEL_SCALE,n=this.adapter.getLabelWidth()*i;this.adapter.notchOutline(n)}else e||this.adapter.closeOutline()}},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},e.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},e.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(nZ.INVALID),this.adapter.removeMenuClass(nZ.MENU_INVALID)):(this.adapter.addClass(nZ.INVALID),this.adapter.addMenuClass(nZ.MENU_INVALID)),this.syncHelperTextValidity(t)},e.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(nZ.REQUIRED)&&!this.adapter.hasClass(nZ.DISABLED)?this.getSelectedIndex()!==nY.UNSET_INDEX&&(0!==this.getSelectedIndex()||!!this.getValue()):this.customValidity},e.prototype.setRequired=function(t){t?this.adapter.addClass(nZ.REQUIRED):this.adapter.removeClass(nZ.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},e.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},e.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(m.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(nZ.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(nZ.INVALID)),this.layout(),this.layoutOptions()},e.prototype.blur=function(){this.adapter.removeClass(nZ.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(nZ.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},e.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var e=this.helperText.isVisible(),i=this.helperText.getId();e&&i?this.adapter.setSelectAnchorAttr(nW.ARIA_DESCRIBEDBY,i):this.adapter.removeSelectAnchorAttr(nW.ARIA_DESCRIBEDBY)}},e.prototype.setClickDebounceTimeout=function(){var t=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout(function(){t.recentlyClicked=!1},nY.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},e}(eq),nJ={ARIA_HIDDEN:"aria-hidden",ROLE:"role"},nQ={HELPER_TEXT_VALIDATION_MSG:"mdc-select-helper-text--validation-msg",HELPER_TEXT_VALIDATION_MSG_PERSISTENT:"mdc-select-helper-text--validation-msg-persistent"},n0=function(t){function e(i){return t.call(this,nu(nu({},e.defaultAdapter),i))||this}return nd(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return nQ},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nJ},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},getAttr:function(){return null},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.getId=function(){return this.adapter.getAttr("id")},e.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(nJ.ARIA_HIDDEN)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.setValidation=function(t){t?this.adapter.addClass(nQ.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(nQ.HELPER_TEXT_VALIDATION_MSG)},e.prototype.setValidationMsgPersistent=function(t){t?this.adapter.addClass(nQ.HELPER_TEXT_VALIDATION_MSG_PERSISTENT):this.adapter.removeClass(nQ.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},e.prototype.setValidity=function(t){if(this.adapter.hasClass(nQ.HELPER_TEXT_VALIDATION_MSG)){var e=this.adapter.hasClass(nQ.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);if(!t||e){this.showToScreenReader(),t?this.adapter.removeAttr(nJ.ROLE):this.adapter.setAttr(nJ.ROLE,"alert");return}this.adapter.removeAttr(nJ.ROLE),this.hide()}},e.prototype.showToScreenReader=function(){this.adapter.removeAttr(nJ.ARIA_HIDDEN)},e.prototype.hide=function(){this.adapter.setAttr(nJ.ARIA_HIDDEN,"true")},e}(eq),n1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nd(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new n0({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e}})},e}(eG),n2={ICON_EVENT:"MDCSelect:icon",ICON_ROLE:"button"},n5=["click","keydown"],n3=function(t){function e(i){var n=t.call(this,nu(nu({},e.defaultAdapter),i))||this;return n.savedTabIndex_=null,n.interactionHandler_=function(t){return n.handleInteraction(t)},n}return nd(e,t),Object.defineProperty(e,"strings",{get:function(){return n2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),n5.forEach(function(e){t.adapter.registerInteractionHandler(e,t.interactionHandler_)})},e.prototype.destroy=function(){var t=this;n5.forEach(function(e){t.adapter.deregisterInteractionHandler(e,t.interactionHandler_)})},e.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",n2.ICON_ROLE)))},e.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&this.adapter.notifyIconAction()},e}(eq),n4=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nd(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new n3({getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e},registerInteractionHandler:function(e,i){return t.listen(e,i)},deregisterInteractionHandler:function(e,i){return t.unlisten(e,i)},notifyIconAction:function(){return t.emit(n3.strings.ICON_EVENT,{},!0)}})},e}(eG),n6=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nd(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e,i,n,r,a){if(void 0===t&&(t=function(t){return new e1(t)}),void 0===e&&(e=function(t){return new e7(t)}),void 0===i&&(i=function(t){return new io(t)}),void 0===n&&(n=function(t){return new nX(t)}),void 0===r&&(r=function(t){return new n4(t)}),void 0===a&&(a=function(t){return new n1(t)}),this.selectAnchor=this.root.querySelector(nW.SELECT_ANCHOR_SELECTOR),this.selectedText=this.root.querySelector(nW.SELECTED_TEXT_SELECTOR),this.hiddenInput=this.root.querySelector(nW.HIDDEN_INPUT_SELECTOR),!this.selectedText)throw Error("MDCSelect: Missing required element: The following selector must be present: '"+nW.SELECTED_TEXT_SELECTOR+"'");if(this.selectAnchor.hasAttribute(nW.ARIA_CONTROLS)){var o=document.getElementById(this.selectAnchor.getAttribute(nW.ARIA_CONTROLS));o&&(this.helperText=a(o))}this.menuSetup(n);var s=this.root.querySelector(nW.LABEL_SELECTOR);this.label=s?t(s):null;var l=this.root.querySelector(nW.LINE_RIPPLE_SELECTOR);this.lineRipple=l?e(l):null;var c=this.root.querySelector(nW.OUTLINE_SELECTOR);this.outline=c?i(c):null;var d=this.root.querySelector(nW.LEADING_ICON_SELECTOR);d&&(this.leadingIcon=r(d)),this.root.classList.contains(nZ.OUTLINED)||(this.ripple=this.createRipple())},e.prototype.initialSyncWithDOM=function(){var t=this;if(this.handleFocus=function(){t.foundation.handleFocus()},this.handleBlur=function(){t.foundation.handleBlur()},this.handleClick=function(e){t.selectAnchor.focus(),t.foundation.handleClick(t.getNormalizedXCoordinate(e))},this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleMenuItemAction=function(e){t.foundation.handleMenuItemAction(e.detail.index)},this.handleMenuOpened=function(){t.foundation.handleMenuOpened()},this.handleMenuClosed=function(){t.foundation.handleMenuClosed()},this.selectAnchor.addEventListener("focus",this.handleFocus),this.selectAnchor.addEventListener("blur",this.handleBlur),this.selectAnchor.addEventListener("click",this.handleClick),this.selectAnchor.addEventListener("keydown",this.handleKeydown),this.menu.listen(np.CLOSED_EVENT,this.handleMenuClosed),this.menu.listen(np.OPENED_EVENT,this.handleMenuOpened),this.menu.listen(nH.SELECTED_EVENT,this.handleMenuItemAction),this.hiddenInput){if(this.hiddenInput.value){this.foundation.setValue(this.hiddenInput.value,!0),this.foundation.layout();return}this.hiddenInput.value=this.value}},e.prototype.destroy=function(){this.selectAnchor.removeEventListener("focus",this.handleFocus),this.selectAnchor.removeEventListener("blur",this.handleBlur),this.selectAnchor.removeEventListener("keydown",this.handleKeydown),this.selectAnchor.removeEventListener("click",this.handleClick),this.menu.unlisten(np.CLOSED_EVENT,this.handleMenuClosed),this.menu.unlisten(np.OPENED_EVENT,this.handleMenuOpened),this.menu.unlisten(nH.SELECTED_EVENT,this.handleMenuItemAction),this.menu.destroy(),this.ripple&&this.ripple.destroy(),this.outline&&this.outline.destroy(),this.leadingIcon&&this.leadingIcon.destroy(),this.helperText&&this.helperText.destroy(),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.foundation.getDisabled()},set:function(t){this.foundation.setDisabled(t),this.hiddenInput&&(this.hiddenInput.disabled=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useDefaultValidation",{set:function(t){this.foundation.setUseDefaultValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"required",{get:function(){return this.foundation.getRequired()},set:function(t){this.foundation.setRequired(t)},enumerable:!0,configurable:!0}),e.prototype.layout=function(){this.foundation.layout()},e.prototype.layoutOptions=function(){this.foundation.layoutOptions(),this.menu.layout(),this.menuItemValues=this.menu.items.map(function(t){return t.getAttribute(nW.VALUE_ATTR)||""}),this.hiddenInput&&(this.hiddenInput.value=this.value)},e.prototype.getDefaultFoundation=function(){return new nK(nu(nu(nu(nu({},this.getSelectAdapterMethods()),this.getCommonAdapterMethods()),this.getOutlineAdapterMethods()),this.getLabelAdapterMethods()),this.getFoundationMap())},e.prototype.menuSetup=function(t){this.menuElement=this.root.querySelector(nW.MENU_SELECTOR),this.menu=t(this.menuElement),this.menu.hasTypeahead=!0,this.menu.singleSelection=!0,this.menuItemValues=this.menu.items.map(function(t){return t.getAttribute(nW.VALUE_ATTR)||""})},e.prototype.createRipple=function(){var t=this,e=nu(nu({},ib.createAdapter({root:this.selectAnchor})),{registerInteractionHandler:function(e,i){t.selectAnchor.addEventListener(e,i)},deregisterInteractionHandler:function(e,i){t.selectAnchor.removeEventListener(e,i)}});return new ib(this.selectAnchor,new i_(e))},e.prototype.getSelectAdapterMethods=function(){var t=this;return{getMenuItemAttr:function(t,e){return t.getAttribute(e)},setSelectedText:function(e){t.selectedText.textContent=e},isSelectAnchorFocused:function(){return document.activeElement===t.selectAnchor},getSelectAnchorAttr:function(e){return t.selectAnchor.getAttribute(e)},setSelectAnchorAttr:function(e,i){t.selectAnchor.setAttribute(e,i)},removeSelectAnchorAttr:function(e){t.selectAnchor.removeAttribute(e)},addMenuClass:function(e){t.menuElement.classList.add(e)},removeMenuClass:function(e){t.menuElement.classList.remove(e)},openMenu:function(){t.menu.open=!0},closeMenu:function(){t.menu.open=!1},getAnchorElement:function(){return t.root.querySelector(nW.SELECT_ANCHOR_SELECTOR)},setMenuAnchorElement:function(e){t.menu.setAnchorElement(e)},setMenuAnchorCorner:function(e){t.menu.setAnchorCorner(e)},setMenuWrapFocus:function(e){t.menu.wrapFocus=e},getSelectedIndex:function(){var e=t.menu.selectedIndex;return e instanceof Array?e[0]:e},setSelectedIndex:function(e){t.menu.selectedIndex=e},focusMenuItemAtIndex:function(e){t.menu.items[e].focus()},getMenuItemCount:function(){return t.menu.items.length},getMenuItemValues:function(){return t.menuItemValues},getMenuItemTextAtIndex:function(e){return t.menu.getPrimaryTextAtIndex(e)},isTypeaheadInProgress:function(){return t.menu.typeaheadInProgress},typeaheadMatchItem:function(e,i){return t.menu.typeaheadMatchItem(e,i)}}},e.prototype.getCommonAdapterMethods=function(){var t=this;return{addClass:function(e){t.root.classList.add(e)},removeClass:function(e){t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},setRippleCenter:function(e){t.lineRipple&&t.lineRipple.setRippleCenter(e)},activateBottomLine:function(){t.lineRipple&&t.lineRipple.activate()},deactivateBottomLine:function(){t.lineRipple&&t.lineRipple.deactivate()},notifyChange:function(e){var i=t.selectedIndex;t.emit(nW.CHANGE_EVENT,{value:e,index:i},!0),t.hiddenInput&&(t.hiddenInput.value=e)}}},e.prototype.getOutlineAdapterMethods=function(){var t=this;return{hasOutline:function(){return!!t.outline},notchOutline:function(e){t.outline&&t.outline.notch(e)},closeOutline:function(){t.outline&&t.outline.closeNotch()}}},e.prototype.getLabelAdapterMethods=function(){var t=this;return{hasLabel:function(){return!!t.label},floatLabel:function(e){t.label&&t.label.float(e)},getLabelWidth:function(){return t.label?t.label.getWidth():0},setLabelRequired:function(e){t.label&&t.label.setRequired(e)}}},e.prototype.getNormalizedXCoordinate=function(t){var e=t.target.getBoundingClientRect();return(this.isTouchEvent(t)?t.touches[0].clientX:t.clientX)-e.left},e.prototype.isTouchEvent=function(t){return!!t.touches},e.prototype.getFoundationMap=function(){return{helperText:this.helperText?this.helperText.foundationForSelect:void 0,leadingIcon:this.leadingIcon?this.leadingIcon.foundationForSelect:void 0}},e}(eG),n7=function(t,e){return(n7=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function n8(t,e){function i(){this.constructor=t}n7(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n9=function(){return(n9=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rt={ROOT:"mdc-form-field"},re={LABEL_SELECTOR:".mdc-form-field > label"},ri=function(t){function e(i){var n=t.call(this,n9(n9({},e.defaultAdapter),i))||this;return n.click=function(){n.handleClick()},n}return n8(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return rt},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return re},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},e.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},e.prototype.handleClick=function(){var t=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){t.adapter.deactivateInputRipple()})},e}(eq),rn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n8(e,t),e.attachTo=function(t){return new e(t)},e.prototype.labelEl=function(){var t=ri.strings.LABEL_SELECTOR;return this.root.querySelector(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new ri({activateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.activate()},deactivateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.deactivate()},deregisterInteractionHandler:function(e,i){var n=t.labelEl();n&&n.removeEventListener(e,i)},registerInteractionHandler:function(e,i){var n=t.labelEl();n&&n.addEventListener(e,i)}})},e}(eG),rr=function(t,e){return(rr=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function ra(t,e){function i(){this.constructor=t}rr(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ro=function(){return(ro=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rs={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},rl={ARIA_LABEL:"aria-label",ARIA_PRESSED:"aria-pressed",DATA_ARIA_LABEL_OFF:"data-aria-label-off",DATA_ARIA_LABEL_ON:"data-aria-label-on",CHANGE_EVENT:"MDCIconButtonToggle:change"},rc=function(t){function e(i){var n=t.call(this,ro(ro({},e.defaultAdapter),i))||this;return n.hasToggledAriaLabel=!1,n}return ra(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return rs},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return rl},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},getAttr:function(){return null},setAttr:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this.adapter.getAttr(rl.DATA_ARIA_LABEL_ON),e=this.adapter.getAttr(rl.DATA_ARIA_LABEL_OFF);if(t&&e){if(null!==this.adapter.getAttr(rl.ARIA_PRESSED))throw Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");this.hasToggledAriaLabel=!0}else this.adapter.setAttr(rl.ARIA_PRESSED,String(this.isOn()))},e.prototype.handleClick=function(){this.toggle(),this.adapter.notifyChange({isOn:this.isOn()})},e.prototype.isOn=function(){return this.adapter.hasClass(rs.ICON_BUTTON_ON)},e.prototype.toggle=function(t){if(void 0===t&&(t=!this.isOn()),t?this.adapter.addClass(rs.ICON_BUTTON_ON):this.adapter.removeClass(rs.ICON_BUTTON_ON),this.hasToggledAriaLabel){var e=t?this.adapter.getAttr(rl.DATA_ARIA_LABEL_ON):this.adapter.getAttr(rl.DATA_ARIA_LABEL_OFF);this.adapter.setAttr(rl.ARIA_LABEL,e||"")}else this.adapter.setAttr(rl.ARIA_PRESSED,""+t)},e}(eq),rd=rc.strings,ru=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rippleComponent=e.createRipple(),e}return ra(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick=function(){t.foundation.handleClick()},this.listen("click",this.handleClick)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),t.prototype.destroy.call(this)},e.prototype.getDefaultFoundation=function(){var t=this;return new rc({addClass:function(e){return t.root.classList.add(e)},hasClass:function(e){return t.root.classList.contains(e)},notifyChange:function(e){t.emit(rd.CHANGE_EVENT,e)},removeClass:function(e){return t.root.classList.remove(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)}})},Object.defineProperty(e.prototype,"ripple",{get:function(){return this.rippleComponent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"on",{get:function(){return this.foundation.isOn()},set:function(t){this.foundation.toggle(t)},enumerable:!0,configurable:!0}),e.prototype.createRipple=function(){var t=new ib(this.root);return t.unbounded=!0,t},e}(eG);o(243);let rh="important",rp=" !"+rh,rm=eC(class extends eA{constructor(t){var e;if(super(t),t.type!==eE.ATTRIBUTE||"style"!==t.name||(null==(e=t.strings)?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,i)=>{let n=t[i];return null==n?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){let{style:i}=t.element;if(void 0===this.ht){for(let t in this.ht=new Set,e)this.ht.add(t);return this.render(e)}for(let t in this.ht.forEach(t=>{null==e[t]&&(this.ht.delete(t),t.includes("-")?i.removeProperty(t):i[t]="")}),e){let n=e[t];if(null!=n){this.ht.add(t);let e="string"==typeof n&&n.endsWith(rp);t.includes("-")||e?i.setProperty(t,e?n.slice(0,-11):n,e?rh:""):i[t]=n}}return t_}});var rf=o(732),rg=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};let r_=o(41),rb=o(526);class ry extends CustomEvent{constructor(t){super(ry.NAME,{detail:t,bubbles:!0,composed:!0})}}function rv(t,e,i,n,r){switch(n=n||"listbox",t){case _.RADIO:n="radiogroup";break;case _.MULTI_CHECKBOX:n="group"}return tg`
366
- <ul id="list" class="mdc-list${i?" mdc-list--two-line":""}" role="${eD(n)}" @MDCList:action="${t=>r&&r(t)}" aria-hidden="true" aria-orientation="vertical" tabindex="-1">
365
+ `,ee([tN({type:Number,reflect:!0,attribute:!0})],er.prototype,"lat",void 0),ee([tN({type:Number,reflect:!0})],er.prototype,"lng",void 0),ee([tN({type:Number,reflect:!0})],er.prototype,"radius",void 0),ee([tN({reflect:!0})],er.prototype,"displayValue",void 0),ee([tN({reflect:!0})],er.prototype,"direction",void 0),ee([tN({type:Boolean})],er.prototype,"visible",void 0),ee([tN({type:String})],er.prototype,"icon",void 0),ee([tN({type:String})],er.prototype,"color",void 0),ee([tN({type:String})],er.prototype,"activeColor",void 0),ee([tN({type:Boolean})],er.prototype,"interactive",void 0),ee([tN({type:Boolean})],er.prototype,"active",void 0),ee([t$("slot")],er.prototype,"_slot",void 0),er=e=ee([tB("or-map-marker")],er);var ea=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};function eo(t,e){if(t&&e&&t[e])return t[e]}function es(t,e){let i=eo(t,e);if(i)return i.attributeName}let el=class extends(0,m.subscribe)(f())(er){constructor(){super(),this.assetTypeAsIcon=!0,this.visible=!1}set type(t){let e,i=eo(this.config,t);if(i&&i.attributeName&&this.asset&&this.asset.attributes&&this.asset.attributes[i.attributeName]&&i.colours){let t=this.asset.attributes[i.attributeName].value;e={markerConfig:i.colours,currentValue:t}}let n=tQ(t,e);if(!n){this.visible=!1;return}this.assetTypeAsIcon&&(this.icon=n.icon),this.markerColor=Array.isArray(n.color)?n.color[0].colour:n.color||void 0,this.updateColor(this.markerContainer),this.visible=!0}shouldUpdate(t){if(t.has("assetId")&&(this.lat=void 0,this.lng=void 0,this.type=void 0,this.direction=void 0,this.displayValue=void 0,this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1===Object.keys(t).length))return!1;if(t.has("asset"))try{this.onAssetChanged(this.asset)}catch(t){console.error(t)}return super.shouldUpdate(t)}_onEvent(t){if("attribute"===t.eventType)return"location"===t.ref.name?void this._updateLocation(t.value):void(this.asset&&(this.asset=m.Util.updateAsset(this.asset,t),this.requestUpdate()));if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this.onAssetChanged(t.asset);break;case"DELETE":this.onAssetChanged(void 0)}}onAssetChanged(t){var e,i,n,r;return e=this,i=void 0,n=void 0,r=function*(){if(t){this.direction=void 0,this.displayValue=void 0;let e=t.attributes?t.attributes.location:void 0;this._updateLocation(e?e.value:null);let i=eo(this.config,t.type),n=!i||!i.hideDirection,r=i&&!0===i.showLabel&&!!i.attributeName,a=!!(i&&!1!==i.showUnits);if(r&&t.attributes&&t.attributes[null==i?void 0:i.attributeName]){let e=t.attributes[i.attributeName],n=tZ.AssetModelUtil.getAttributeAndValueDescriptors(t.type,e.name,e);this.displayValue=m.Util.getAttributeValueAsString(e,n[0],t.type,a,"-")}if(n&&t.attributes&&t.attributes.direction){let e=t.attributes.direction.value;null!=e&&(this.direction=e.toString())}this.type=t.type}else this.lat=void 0,this.lng=void 0},new(n||(n=Promise))(function(t,a){function o(t){try{l(r.next(t))}catch(t){a(t)}}function s(t){try{l(r.throw(t))}catch(t){a(t)}}function l(e){var i;e.done?t(e.value):((i=e.value)instanceof n?i:new n(function(t){t(i)})).then(o,s)}l((r=r.apply(e,i||[])).next())})}_updateLocation(t){this.lat=t&&t.coordinates?t.coordinates[1]:void 0,this.lng=t&&t.coordinates?t.coordinates[0]:void 0}getColor(){return this.markerColor&&!this.color?"#"+this.markerColor:super.getColor()}getActiveColor(){return this.markerColor&&!this.activeColor?"#"+this.markerColor:super.getActiveColor()}};ea([tN({type:String,reflect:!0,attribute:!0})],el.prototype,"assetId",void 0),ea([tN({type:Object,attribute:!0})],el.prototype,"asset",void 0),ea([tN()],el.prototype,"config",void 0),el=ea([tB("or-map-marker-asset")],el);let{I:ec}={M:Q,P:tt,A:te,C:1,L:tk,R:tA,D:ts,V:tC,I:tT,H:tI,N:tz,U:tL,B:tS,F:tM},ed={ATTRIBUTE:1,CHILD:2},eu=t=>(...e)=>({_$litDirective$:t,values:e});class eh{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}let ep=(t,e)=>{let i=t._$AN;if(void 0===i)return!1;for(let t of i)t._$AO?.(e,!1),ep(t,e);return!0},em=t=>{let e,i;do{if(void 0===(e=t._$AM))break;(i=e._$AN).delete(t),t=e}while(0===i?.size)},ef=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),eb(e)}};function eg(t){void 0!==this._$AN?(em(this),this._$AM=t,ef(this)):this._$AM=t}function e_(t,e=!1,i=0){let n=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(n))for(let t=i;t<n.length;t++)ep(n[t],!1),em(n[t]);else null!=n&&(ep(n,!1),em(n));else ep(this,t)}let eb=t=>{t.type==ed.CHILD&&(t._$AP??=e_,t._$AQ??=eg)};class ey extends eh{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),ef(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(ep(this,t),em(this))}setValue(t){if(void 0===this._$Ct.strings)this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}let ev=new WeakMap;eu(class extends ey{render(t){return ty}update(t,[e]){let i=e!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),ty}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){let e=this.ht??globalThis,i=ev.get(e);void 0===i&&(i=new WeakMap,ev.set(e,i)),void 0!==i.get(this.G)&&this.G.call(this.ht,void 0),i.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?ev.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});let ex=eu(class extends eh{constructor(t){if(super(t),t.type!==ed.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){for(let i in this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t))),e)e[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(e)}let i=t.element.classList;for(let t of this.st)t in e||(i.remove(t),this.st.delete(t));for(let t in e){let n=!!e[t];n===this.st.has(t)||this.nt?.has(t)||(n?(i.add(t),this.st.add(t)):(i.remove(t),this.st.delete(t)))}return tb}});class ew{constructor(t){this.G=t}disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}}class ek{constructor(){this.Y=void 0,this.Z=void 0}get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}}let eE=t=>!(t=>null===t||"object"!=typeof t&&"function"!=typeof t)(t)&&"function"==typeof t.then,eC=eu(class extends ey{constructor(){super(...arguments),this._$Cwt=0x3fffffff,this._$Cbt=[],this._$CK=new ew(this),this._$CX=new ek}render(...t){return t.find(t=>!eE(t))??tb}update(t,e){let i=this._$Cbt,n=i.length;this._$Cbt=e;let r=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){let o=e[t];if(!eE(o))return this._$Cwt=t,o;t<n&&o===i[t]||(this._$Cwt=0x3fffffff,n=0,Promise.resolve(o).then(async t=>{for(;a.get();)await a.get();let e=r.deref();if(void 0!==e){let i=e._$Cbt.indexOf(o);i>-1&&i<e._$Cwt&&(e._$Cwt=i,e.setValue(t))}}))}return tb}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}});var eA=function(t,e){return(eA=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function eT(t,e){function i(){this.constructor=t}eA(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var eI=function(){return(eI=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eS=function(){function t(t){void 0===t&&(t={}),this.adapter=t}return Object.defineProperty(t,"cssClasses",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"numbers",{get:function(){return{}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{}},enumerable:!0,configurable:!0}),t.prototype.init=function(){},t.prototype.destroy=function(){},t}(),ez=function(){function t(t,e){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];this.root=t,this.initialize.apply(this,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,a=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}(i)),this.foundation=void 0===e?this.getDefaultFoundation():e,this.foundation.init(),this.initialSyncWithDOM()}return t.attachTo=function(e){return new t(e,new eS({}))},t.prototype.initialize=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.prototype.getDefaultFoundation=function(){throw Error("Subclasses must override getDefaultFoundation to return a properly configured foundation class")},t.prototype.initialSyncWithDOM=function(){},t.prototype.destroy=function(){this.foundation.destroy()},t.prototype.listen=function(t,e,i){this.root.addEventListener(t,e,i)},t.prototype.unlisten=function(t,e,i){this.root.removeEventListener(t,e,i)},t.prototype.emit=function(t,e,i){var n;void 0===i&&(i=!1),"function"==typeof CustomEvent?n=new CustomEvent(t,{bubbles:i,detail:e}):(n=document.createEvent("CustomEvent")).initCustomEvent(t,i,!1,e),this.root.dispatchEvent(n)},t}();function eL(t){return void 0===t&&(t=window),!!function(t){void 0===t&&(t=window);var e=!1;try{var i={get passive(){return e=!0,!1}},n=function(){};t.document.addEventListener("test",n,i),t.document.removeEventListener("test",n,i)}catch(t){e=!1}return e}(t)&&{passive:!0}}function eM(t,e){if(t.closest)return t.closest(e);for(var i=t;i;){if(eP(i,e))return i;i=i.parentElement}return null}function eP(t,e){return(t.matches||t.webkitMatchesSelector||t.msMatchesSelector).call(t,e)}var eR=function(t,e){return(eR=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function eO(t,e){function i(){this.constructor=t}eR(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var eD=function(){return(eD=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eB={LABEL_FLOAT_ABOVE:"mdc-floating-label--float-above",LABEL_REQUIRED:"mdc-floating-label--required",LABEL_SHAKE:"mdc-floating-label--shake",ROOT:"mdc-floating-label"},eF=function(t){function e(i){var n=t.call(this,eD(eD({},e.defaultAdapter),i))||this;return n.shakeAnimationEndHandler_=function(){return n.handleShakeAnimationEnd_()},n}return eO(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return eB},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},getWidth:function(){return 0},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.registerInteractionHandler("animationend",this.shakeAnimationEndHandler_)},e.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("animationend",this.shakeAnimationEndHandler_)},e.prototype.getWidth=function(){return this.adapter.getWidth()},e.prototype.shake=function(t){var i=e.cssClasses.LABEL_SHAKE;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.float=function(t){var i=e.cssClasses,n=i.LABEL_FLOAT_ABOVE,r=i.LABEL_SHAKE;t?this.adapter.addClass(n):(this.adapter.removeClass(n),this.adapter.removeClass(r))},e.prototype.setRequired=function(t){var i=e.cssClasses.LABEL_REQUIRED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleShakeAnimationEnd_=function(){var t=e.cssClasses.LABEL_SHAKE;this.adapter.removeClass(t)},e}(eS),eN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eO(e,t),e.attachTo=function(t){return new e(t)},e.prototype.shake=function(t){this.foundation.shake(t)},e.prototype.float=function(t){this.foundation.float(t)},e.prototype.setRequired=function(t){this.foundation.setRequired(t)},e.prototype.getWidth=function(){return this.foundation.getWidth()},e.prototype.getDefaultFoundation=function(){var t=this;return new eF({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},getWidth:function(){var e=t.root;if(null!==e.offsetParent)return e.scrollWidth;var i=e.cloneNode(!0);i.style.setProperty("position","absolute"),i.style.setProperty("transform","translate(-9999px, -9999px)"),document.documentElement.appendChild(i);var n=i.scrollWidth;return document.documentElement.removeChild(i),n},registerInteractionHandler:function(e,i){return t.listen(e,i)},deregisterInteractionHandler:function(e,i){return t.unlisten(e,i)}})},e}(ez),eV=function(t,e){return(eV=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function eU(t,e){function i(){this.constructor=t}eV(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var e$=function(){return(e$=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ej={LINE_RIPPLE_ACTIVE:"mdc-line-ripple--active",LINE_RIPPLE_DEACTIVATING:"mdc-line-ripple--deactivating"},eH=function(t){function e(i){var n=t.call(this,e$(e$({},e.defaultAdapter),i))||this;return n.transitionEndHandler_=function(t){return n.handleTransitionEnd(t)},n}return eU(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return ej},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setStyle:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.registerEventHandler("transitionend",this.transitionEndHandler_)},e.prototype.destroy=function(){this.adapter.deregisterEventHandler("transitionend",this.transitionEndHandler_)},e.prototype.activate=function(){this.adapter.removeClass(ej.LINE_RIPPLE_DEACTIVATING),this.adapter.addClass(ej.LINE_RIPPLE_ACTIVE)},e.prototype.setRippleCenter=function(t){this.adapter.setStyle("transform-origin",t+"px center")},e.prototype.deactivate=function(){this.adapter.addClass(ej.LINE_RIPPLE_DEACTIVATING)},e.prototype.handleTransitionEnd=function(t){var e=this.adapter.hasClass(ej.LINE_RIPPLE_DEACTIVATING);"opacity"===t.propertyName&&e&&(this.adapter.removeClass(ej.LINE_RIPPLE_ACTIVE),this.adapter.removeClass(ej.LINE_RIPPLE_DEACTIVATING))},e}(eS),eq=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eU(e,t),e.attachTo=function(t){return new e(t)},e.prototype.activate=function(){this.foundation.activate()},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.setRippleCenter=function(t){this.foundation.setRippleCenter(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new eH({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},setStyle:function(e,i){return t.root.style.setProperty(e,i)},registerEventHandler:function(e,i){return t.listen(e,i)},deregisterEventHandler:function(e,i){return t.unlisten(e,i)}})},e}(ez),eG=function(t,e){return(eG=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function eX(t,e){function i(){this.constructor=t}eG(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var eZ=function(){return(eZ=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},eW={NOTCH_ELEMENT_SELECTOR:".mdc-notched-outline__notch"},eY={NOTCH_ELEMENT_PADDING:8},eK={NO_LABEL:"mdc-notched-outline--no-label",OUTLINE_NOTCHED:"mdc-notched-outline--notched",OUTLINE_UPGRADED:"mdc-notched-outline--upgraded"},eJ=function(t){function e(i){return t.call(this,eZ(eZ({},e.defaultAdapter),i))||this}return eX(e,t),Object.defineProperty(e,"strings",{get:function(){return eW},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return eK},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return eY},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNotchWidthProperty:function(){},removeNotchWidthProperty:function(){}}},enumerable:!0,configurable:!0}),e.prototype.notch=function(t){var i=e.cssClasses.OUTLINE_NOTCHED;t>0&&(t+=eY.NOTCH_ELEMENT_PADDING),this.adapter.setNotchWidthProperty(t),this.adapter.addClass(i)},e.prototype.closeNotch=function(){var t=e.cssClasses.OUTLINE_NOTCHED;this.adapter.removeClass(t),this.adapter.removeNotchWidthProperty()},e}(eS),eQ=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eX(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){this.notchElement_=this.root.querySelector(eW.NOTCH_ELEMENT_SELECTOR);var t=this.root.querySelector("."+eF.cssClasses.ROOT);t?(t.style.transitionDuration="0s",this.root.classList.add(eK.OUTLINE_UPGRADED),requestAnimationFrame(function(){t.style.transitionDuration=""})):this.root.classList.add(eK.NO_LABEL)},e.prototype.notch=function(t){this.foundation.notch(t)},e.prototype.closeNotch=function(){this.foundation.closeNotch()},e.prototype.getDefaultFoundation=function(){var t=this;return new eJ({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},setNotchWidthProperty:function(e){return t.notchElement_.style.setProperty("width",e+"px")},removeNotchWidthProperty:function(){return t.notchElement_.style.removeProperty("width")}})},e}(ez),e0=function(t,e){return(e0=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function e1(t,e){function i(){this.constructor=t}e0(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var e2=function(){return(e2=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},e5={BG_FOCUSED:"mdc-ripple-upgraded--background-focused",FG_ACTIVATION:"mdc-ripple-upgraded--foreground-activation",FG_DEACTIVATION:"mdc-ripple-upgraded--foreground-deactivation",ROOT:"mdc-ripple-upgraded",UNBOUNDED:"mdc-ripple-upgraded--unbounded"},e3={VAR_FG_SCALE:"--mdc-ripple-fg-scale",VAR_FG_SIZE:"--mdc-ripple-fg-size",VAR_FG_TRANSLATE_END:"--mdc-ripple-fg-translate-end",VAR_FG_TRANSLATE_START:"--mdc-ripple-fg-translate-start",VAR_LEFT:"--mdc-ripple-left",VAR_TOP:"--mdc-ripple-top"},e4={DEACTIVATION_TIMEOUT_MS:225,FG_DEACTIVATION_MS:150,INITIAL_ORIGIN_SCALE:.6,PADDING:10,TAP_DELAY_MS:300},e6=["touchstart","pointerdown","mousedown","keydown"],e7=["touchend","pointerup","mouseup","contextmenu"],e8=[],e9=function(t){function e(i){var n=t.call(this,e2(e2({},e.defaultAdapter),i))||this;return n.activationAnimationHasEnded_=!1,n.activationTimer_=0,n.fgDeactivationRemovalTimer_=0,n.fgScale_="0",n.frame_={width:0,height:0},n.initialSize_=0,n.layoutFrame_=0,n.maxRadius_=0,n.unboundedCoords_={left:0,top:0},n.activationState_=n.defaultActivationState_(),n.activationTimerCallback_=function(){n.activationAnimationHasEnded_=!0,n.runDeactivationUXLogicIfReady_()},n.activateHandler_=function(t){return n.activate_(t)},n.deactivateHandler_=function(){return n.deactivate_()},n.focusHandler_=function(){return n.handleFocus()},n.blurHandler_=function(){return n.handleBlur()},n.resizeHandler_=function(){return n.layout()},n}return e1(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return e5},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return e3},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return e4},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},browserSupportsCssVars:function(){return!0},computeBoundingRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},containsEventTarget:function(){return!0},deregisterDocumentInteractionHandler:function(){},deregisterInteractionHandler:function(){},deregisterResizeHandler:function(){},getWindowPageOffset:function(){return{x:0,y:0}},isSurfaceActive:function(){return!0},isSurfaceDisabled:function(){return!0},isUnbounded:function(){return!0},registerDocumentInteractionHandler:function(){},registerInteractionHandler:function(){},registerResizeHandler:function(){},removeClass:function(){},updateCssVariable:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this,i=this.supportsPressRipple_();if(this.registerRootHandlers_(i),i){var n=e.cssClasses,r=n.ROOT,a=n.UNBOUNDED;requestAnimationFrame(function(){t.adapter.addClass(r),t.adapter.isUnbounded()&&(t.adapter.addClass(a),t.layoutInternal_())})}},e.prototype.destroy=function(){var t=this;if(this.supportsPressRipple_()){this.activationTimer_&&(clearTimeout(this.activationTimer_),this.activationTimer_=0,this.adapter.removeClass(e.cssClasses.FG_ACTIVATION)),this.fgDeactivationRemovalTimer_&&(clearTimeout(this.fgDeactivationRemovalTimer_),this.fgDeactivationRemovalTimer_=0,this.adapter.removeClass(e.cssClasses.FG_DEACTIVATION));var i=e.cssClasses,n=i.ROOT,r=i.UNBOUNDED;requestAnimationFrame(function(){t.adapter.removeClass(n),t.adapter.removeClass(r),t.removeCssVars_()})}this.deregisterRootHandlers_(),this.deregisterDeactivationHandlers_()},e.prototype.activate=function(t){this.activate_(t)},e.prototype.deactivate=function(){this.deactivate_()},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})},e.prototype.setUnbounded=function(t){var i=e.cssClasses.UNBOUNDED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.handleFocus=function(){var t=this;requestAnimationFrame(function(){return t.adapter.addClass(e.cssClasses.BG_FOCUSED)})},e.prototype.handleBlur=function(){var t=this;requestAnimationFrame(function(){return t.adapter.removeClass(e.cssClasses.BG_FOCUSED)})},e.prototype.supportsPressRipple_=function(){return this.adapter.browserSupportsCssVars()},e.prototype.defaultActivationState_=function(){return{activationEvent:void 0,hasDeactivationUXRun:!1,isActivated:!1,isProgrammatic:!1,wasActivatedByPointer:!1,wasElementMadeActive:!1}},e.prototype.registerRootHandlers_=function(t){var e=this;t&&(e6.forEach(function(t){e.adapter.registerInteractionHandler(t,e.activateHandler_)}),this.adapter.isUnbounded()&&this.adapter.registerResizeHandler(this.resizeHandler_)),this.adapter.registerInteractionHandler("focus",this.focusHandler_),this.adapter.registerInteractionHandler("blur",this.blurHandler_)},e.prototype.registerDeactivationHandlers_=function(t){var e=this;"keydown"===t.type?this.adapter.registerInteractionHandler("keyup",this.deactivateHandler_):e7.forEach(function(t){e.adapter.registerDocumentInteractionHandler(t,e.deactivateHandler_)})},e.prototype.deregisterRootHandlers_=function(){var t=this;e6.forEach(function(e){t.adapter.deregisterInteractionHandler(e,t.activateHandler_)}),this.adapter.deregisterInteractionHandler("focus",this.focusHandler_),this.adapter.deregisterInteractionHandler("blur",this.blurHandler_),this.adapter.isUnbounded()&&this.adapter.deregisterResizeHandler(this.resizeHandler_)},e.prototype.deregisterDeactivationHandlers_=function(){var t=this;this.adapter.deregisterInteractionHandler("keyup",this.deactivateHandler_),e7.forEach(function(e){t.adapter.deregisterDocumentInteractionHandler(e,t.deactivateHandler_)})},e.prototype.removeCssVars_=function(){var t=this,i=e.strings;Object.keys(i).forEach(function(e){0===e.indexOf("VAR_")&&t.adapter.updateCssVariable(i[e],null)})},e.prototype.activate_=function(t){var e=this;if(!this.adapter.isSurfaceDisabled()){var i=this.activationState_;if(!i.isActivated){var n=this.previousActivationEvent_;if(!(n&&void 0!==t&&n.type!==t.type)){if(i.isActivated=!0,i.isProgrammatic=void 0===t,i.activationEvent=t,i.wasActivatedByPointer=!i.isProgrammatic&&void 0!==t&&("mousedown"===t.type||"touchstart"===t.type||"pointerdown"===t.type),void 0!==t&&e8.length>0&&e8.some(function(t){return e.adapter.containsEventTarget(t)}))return void this.resetActivationState_();void 0!==t&&(e8.push(t.target),this.registerDeactivationHandlers_(t)),i.wasElementMadeActive=this.checkElementMadeActive_(t),i.wasElementMadeActive&&this.animateActivation_(),requestAnimationFrame(function(){e8=[],!i.wasElementMadeActive&&void 0!==t&&(" "===t.key||32===t.keyCode)&&(i.wasElementMadeActive=e.checkElementMadeActive_(t),i.wasElementMadeActive&&e.animateActivation_()),i.wasElementMadeActive||(e.activationState_=e.defaultActivationState_())})}}}},e.prototype.checkElementMadeActive_=function(t){return void 0===t||"keydown"!==t.type||this.adapter.isSurfaceActive()},e.prototype.animateActivation_=function(){var t=this,i=e.strings,n=i.VAR_FG_TRANSLATE_START,r=i.VAR_FG_TRANSLATE_END,a=e.cssClasses,o=a.FG_DEACTIVATION,s=a.FG_ACTIVATION,l=e.numbers.DEACTIVATION_TIMEOUT_MS;this.layoutInternal_();var c="",d="";if(!this.adapter.isUnbounded()){var u=this.getFgTranslationCoordinates_(),h=u.startPoint,p=u.endPoint;c=h.x+"px, "+h.y+"px",d=p.x+"px, "+p.y+"px"}this.adapter.updateCssVariable(n,c),this.adapter.updateCssVariable(r,d),clearTimeout(this.activationTimer_),clearTimeout(this.fgDeactivationRemovalTimer_),this.rmBoundedActivationClasses_(),this.adapter.removeClass(o),this.adapter.computeBoundingRect(),this.adapter.addClass(s),this.activationTimer_=setTimeout(function(){return t.activationTimerCallback_()},l)},e.prototype.getFgTranslationCoordinates_=function(){var t,e=this.activationState_,i=e.activationEvent;return{startPoint:t={x:(t=e.wasActivatedByPointer?function(t,e,i){if(!t)return{x:0,y:0};var n,r,a=e.x,o=e.y,s=a+i.left,l=o+i.top;return"touchstart"===t.type?(n=t.changedTouches[0].pageX-s,r=t.changedTouches[0].pageY-l):(n=t.pageX-s,r=t.pageY-l),{x:n,y:r}}(i,this.adapter.getWindowPageOffset(),this.adapter.computeBoundingRect()):{x:this.frame_.width/2,y:this.frame_.height/2}).x-this.initialSize_/2,y:t.y-this.initialSize_/2},endPoint:{x:this.frame_.width/2-this.initialSize_/2,y:this.frame_.height/2-this.initialSize_/2}}},e.prototype.runDeactivationUXLogicIfReady_=function(){var t=this,i=e.cssClasses.FG_DEACTIVATION,n=this.activationState_,r=n.hasDeactivationUXRun,a=n.isActivated;(r||!a)&&this.activationAnimationHasEnded_&&(this.rmBoundedActivationClasses_(),this.adapter.addClass(i),this.fgDeactivationRemovalTimer_=setTimeout(function(){t.adapter.removeClass(i)},e4.FG_DEACTIVATION_MS))},e.prototype.rmBoundedActivationClasses_=function(){var t=e.cssClasses.FG_ACTIVATION;this.adapter.removeClass(t),this.activationAnimationHasEnded_=!1,this.adapter.computeBoundingRect()},e.prototype.resetActivationState_=function(){var t=this;this.previousActivationEvent_=this.activationState_.activationEvent,this.activationState_=this.defaultActivationState_(),setTimeout(function(){return t.previousActivationEvent_=void 0},e.numbers.TAP_DELAY_MS)},e.prototype.deactivate_=function(){var t=this,e=this.activationState_;if(e.isActivated){var i=e2({},e);e.isProgrammatic?(requestAnimationFrame(function(){return t.animateDeactivation_(i)}),this.resetActivationState_()):(this.deregisterDeactivationHandlers_(),requestAnimationFrame(function(){t.activationState_.hasDeactivationUXRun=!0,t.animateDeactivation_(i),t.resetActivationState_()}))}},e.prototype.animateDeactivation_=function(t){var e=t.wasActivatedByPointer,i=t.wasElementMadeActive;(e||i)&&this.runDeactivationUXLogicIfReady_()},e.prototype.layoutInternal_=function(){this.frame_=this.adapter.computeBoundingRect();var t=Math.max(this.frame_.height,this.frame_.width);this.maxRadius_=this.adapter.isUnbounded()?t:Math.sqrt(Math.pow(this.frame_.width,2)+Math.pow(this.frame_.height,2))+e.numbers.PADDING;var i=Math.floor(t*e.numbers.INITIAL_ORIGIN_SCALE);this.adapter.isUnbounded()&&i%2!=0?this.initialSize_=i-1:this.initialSize_=i,this.fgScale_=""+this.maxRadius_/this.initialSize_,this.updateLayoutCssVars_()},e.prototype.updateLayoutCssVars_=function(){var t=e.strings,i=t.VAR_FG_SIZE,n=t.VAR_LEFT,r=t.VAR_TOP,a=t.VAR_FG_SCALE;this.adapter.updateCssVariable(i,this.initialSize_+"px"),this.adapter.updateCssVariable(a,this.fgScale_),this.adapter.isUnbounded()&&(this.unboundedCoords_={left:Math.round(this.frame_.width/2-this.initialSize_/2),top:Math.round(this.frame_.height/2-this.initialSize_/2)},this.adapter.updateCssVariable(n,this.unboundedCoords_.left+"px"),this.adapter.updateCssVariable(r,this.unboundedCoords_.top+"px"))},e}(eS),it=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.disabled=!1,e}return e1(e,t),e.attachTo=function(t,i){void 0===i&&(i={isUnbounded:void 0});var n=new e(t);return void 0!==i.isUnbounded&&(n.unbounded=i.isUnbounded),n},e.createAdapter=function(t){return{addClass:function(e){return t.root.classList.add(e)},browserSupportsCssVars:function(){return function(t,e){void 0===e&&(e=!1);var n=t.CSS,r=i;if("boolean"==typeof i&&!e)return i;if(!(n&&"function"==typeof n.supports))return!1;var a=n.supports("--css-vars","yes"),o=n.supports("(--css-vars: yes)")&&n.supports("color","#00000000");return r=a||o,e||(i=r),r}(window)},computeBoundingRect:function(){return t.root.getBoundingClientRect()},containsEventTarget:function(e){return t.root.contains(e)},deregisterDocumentInteractionHandler:function(t,e){return document.documentElement.removeEventListener(t,e,eL())},deregisterInteractionHandler:function(e,i){return t.root.removeEventListener(e,i,eL())},deregisterResizeHandler:function(t){return window.removeEventListener("resize",t)},getWindowPageOffset:function(){return{x:window.pageXOffset,y:window.pageYOffset}},isSurfaceActive:function(){return eP(t.root,":active")},isSurfaceDisabled:function(){return!!t.disabled},isUnbounded:function(){return!!t.unbounded},registerDocumentInteractionHandler:function(t,e){return document.documentElement.addEventListener(t,e,eL())},registerInteractionHandler:function(e,i){return t.root.addEventListener(e,i,eL())},registerResizeHandler:function(t){return window.addEventListener("resize",t)},removeClass:function(e){return t.root.classList.remove(e)},updateCssVariable:function(e,i){return t.root.style.setProperty(e,i)}}},Object.defineProperty(e.prototype,"unbounded",{get:function(){return!!this.unbounded_},set:function(t){this.unbounded_=!!t,this.setUnbounded_()},enumerable:!0,configurable:!0}),e.prototype.activate=function(){this.foundation.activate()},e.prototype.deactivate=function(){this.foundation.deactivate()},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getDefaultFoundation=function(){return new e9(e.createAdapter(this))},e.prototype.initialSyncWithDOM=function(){var t=this.root;this.unbounded="mdcRippleIsUnbounded"in t.dataset},e.prototype.setUnbounded_=function(){this.foundation.setUnbounded(!!this.unbounded_)},e}(ez),ie={ROOT:"mdc-text-field-character-counter"},ii={ROOT_SELECTOR:"."+ie.ROOT},ir=function(t){function e(i){return t.call(this,eI(eI({},e.defaultAdapter),i))||this}return eT(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return ie},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return ii},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.setCounterValue=function(t,e){t=Math.min(t,e),this.adapter.setContent(t+" / "+e)},e}(eS),ia=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eT(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new ir({setContent:function(e){t.root.textContent=e}})},e}(ez),io={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",INPUT_SELECTOR:".mdc-text-field__input",LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-text-field__icon--leading",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",OUTLINE_SELECTOR:".mdc-notched-outline",PREFIX_SELECTOR:".mdc-text-field__affix--prefix",SUFFIX_SELECTOR:".mdc-text-field__affix--suffix",TRAILING_ICON_SELECTOR:".mdc-text-field__icon--trailing"},is={DISABLED:"mdc-text-field--disabled",FOCUSED:"mdc-text-field--focused",HELPER_LINE:"mdc-text-field-helper-line",INVALID:"mdc-text-field--invalid",LABEL_FLOATING:"mdc-text-field--label-floating",NO_LABEL:"mdc-text-field--no-label",OUTLINED:"mdc-text-field--outlined",ROOT:"mdc-text-field",TEXTAREA:"mdc-text-field--textarea",WITH_LEADING_ICON:"mdc-text-field--with-leading-icon",WITH_TRAILING_ICON:"mdc-text-field--with-trailing-icon"},il={LABEL_SCALE:.75},ic=["pattern","min","max","required","step","minlength","maxlength"],id=["color","date","datetime-local","month","range","time","week"],iu=["mousedown","touchstart"],ih=["click","keydown"],ip=function(t){function e(i,n){void 0===n&&(n={});var r=t.call(this,eI(eI({},e.defaultAdapter),i))||this;return r.isFocused_=!1,r.receivedUserInput_=!1,r.isValid_=!0,r.useNativeValidation_=!0,r.validateOnValueChange_=!0,r.helperText_=n.helperText,r.characterCounter_=n.characterCounter,r.leadingIcon_=n.leadingIcon,r.trailingIcon_=n.trailingIcon,r.inputFocusHandler_=function(){return r.activateFocus()},r.inputBlurHandler_=function(){return r.deactivateFocus()},r.inputInputHandler_=function(){return r.handleInput()},r.setPointerXOffset_=function(t){return r.setTransformOrigin(t)},r.textFieldInteractionHandler_=function(){return r.handleTextFieldInteraction()},r.validationAttributeChangeHandler_=function(t){return r.handleValidationAttributeChange(t)},r}return eT(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return is},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return io},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return il},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldAlwaysFloat_",{get:function(){var t=this.getNativeInput_().type;return id.indexOf(t)>=0},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldFloat",{get:function(){return this.shouldAlwaysFloat_||this.isFocused_||!!this.getValue()||this.isBadInput_()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"shouldShake",{get:function(){return!this.isFocused_&&!this.isValid()&&!!this.getValue()},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!0},setInputAttr:function(){},removeInputAttr:function(){},registerTextFieldInteractionHandler:function(){},deregisterTextFieldInteractionHandler:function(){},registerInputInteractionHandler:function(){},deregisterInputInteractionHandler:function(){},registerValidationAttributeChangeHandler:function(){return new MutationObserver(function(){})},deregisterValidationAttributeChangeHandler:function(){},getNativeInput:function(){return null},isFocused:function(){return!1},activateLineRipple:function(){},deactivateLineRipple:function(){},setLineRippleTransformOrigin:function(){},shakeLabel:function(){},floatLabel:function(){},setLabelRequired:function(){},hasLabel:function(){return!1},getLabelWidth:function(){return 0},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.adapter.hasLabel()&&this.getNativeInput_().required&&this.adapter.setLabelRequired(!0),this.adapter.isFocused()?this.inputFocusHandler_():this.adapter.hasLabel()&&this.shouldFloat&&(this.notchOutline(!0),this.adapter.floatLabel(!0),this.styleFloating_(!0)),this.adapter.registerInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.registerInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.registerInputInteractionHandler("input",this.inputInputHandler_),iu.forEach(function(e){t.adapter.registerInputInteractionHandler(e,t.setPointerXOffset_)}),ih.forEach(function(e){t.adapter.registerTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)}),this.validationObserver_=this.adapter.registerValidationAttributeChangeHandler(this.validationAttributeChangeHandler_),this.setCharacterCounter_(this.getValue().length)},e.prototype.destroy=function(){var t=this;this.adapter.deregisterInputInteractionHandler("focus",this.inputFocusHandler_),this.adapter.deregisterInputInteractionHandler("blur",this.inputBlurHandler_),this.adapter.deregisterInputInteractionHandler("input",this.inputInputHandler_),iu.forEach(function(e){t.adapter.deregisterInputInteractionHandler(e,t.setPointerXOffset_)}),ih.forEach(function(e){t.adapter.deregisterTextFieldInteractionHandler(e,t.textFieldInteractionHandler_)}),this.adapter.deregisterValidationAttributeChangeHandler(this.validationObserver_)},e.prototype.handleTextFieldInteraction=function(){var t=this.adapter.getNativeInput();t&&t.disabled||(this.receivedUserInput_=!0)},e.prototype.handleValidationAttributeChange=function(t){var e=this;t.some(function(t){return ic.indexOf(t)>-1&&(e.styleValidity_(!0),e.adapter.setLabelRequired(e.getNativeInput_().required),!0)}),t.indexOf("maxlength")>-1&&this.setCharacterCounter_(this.getValue().length)},e.prototype.notchOutline=function(t){if(this.adapter.hasOutline()&&this.adapter.hasLabel())if(t){var e=this.adapter.getLabelWidth()*il.LABEL_SCALE;this.adapter.notchOutline(e)}else this.adapter.closeOutline()},e.prototype.activateFocus=function(){this.isFocused_=!0,this.styleFocused_(this.isFocused_),this.adapter.activateLineRipple(),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.helperText_&&(this.helperText_.isPersistent()||!this.helperText_.isValidation()||!this.isValid_)&&this.helperText_.showToScreenReader()},e.prototype.setTransformOrigin=function(t){if(!(this.isDisabled()||this.adapter.hasOutline())){var e=t.touches,i=e?e[0]:t,n=i.target.getBoundingClientRect(),r=i.clientX-n.left;this.adapter.setLineRippleTransformOrigin(r)}},e.prototype.handleInput=function(){this.autoCompleteFocus(),this.setCharacterCounter_(this.getValue().length)},e.prototype.autoCompleteFocus=function(){this.receivedUserInput_||this.activateFocus()},e.prototype.deactivateFocus=function(){this.isFocused_=!1,this.adapter.deactivateLineRipple();var t=this.isValid();this.styleValidity_(t),this.styleFocused_(this.isFocused_),this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.adapter.shakeLabel(this.shouldShake)),this.shouldFloat||(this.receivedUserInput_=!1)},e.prototype.getValue=function(){return this.getNativeInput_().value},e.prototype.setValue=function(t){if(this.getValue()!==t&&(this.getNativeInput_().value=t),this.setCharacterCounter_(t.length),this.validateOnValueChange_){var e=this.isValid();this.styleValidity_(e)}this.adapter.hasLabel()&&(this.notchOutline(this.shouldFloat),this.adapter.floatLabel(this.shouldFloat),this.styleFloating_(this.shouldFloat),this.validateOnValueChange_&&this.adapter.shakeLabel(this.shouldShake))},e.prototype.isValid=function(){return this.useNativeValidation_?this.isNativeInputValid_():this.isValid_},e.prototype.setValid=function(t){this.isValid_=t,this.styleValidity_(t);var e=!t&&!this.isFocused_&&!!this.getValue();this.adapter.hasLabel()&&this.adapter.shakeLabel(e)},e.prototype.setValidateOnValueChange=function(t){this.validateOnValueChange_=t},e.prototype.getValidateOnValueChange=function(){return this.validateOnValueChange_},e.prototype.setUseNativeValidation=function(t){this.useNativeValidation_=t},e.prototype.isDisabled=function(){return this.getNativeInput_().disabled},e.prototype.setDisabled=function(t){this.getNativeInput_().disabled=t,this.styleDisabled_(t)},e.prototype.setHelperTextContent=function(t){this.helperText_&&this.helperText_.setContent(t)},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon_&&this.leadingIcon_.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon_&&this.leadingIcon_.setContent(t)},e.prototype.setTrailingIconAriaLabel=function(t){this.trailingIcon_&&this.trailingIcon_.setAriaLabel(t)},e.prototype.setTrailingIconContent=function(t){this.trailingIcon_&&this.trailingIcon_.setContent(t)},e.prototype.setCharacterCounter_=function(t){if(this.characterCounter_){var e=this.getNativeInput_().maxLength;if(-1===e)throw Error("MDCTextFieldFoundation: Expected maxlength html property on text input or textarea.");this.characterCounter_.setCounterValue(t,e)}},e.prototype.isBadInput_=function(){return this.getNativeInput_().validity.badInput||!1},e.prototype.isNativeInputValid_=function(){return this.getNativeInput_().validity.valid},e.prototype.styleValidity_=function(t){var i=e.cssClasses.INVALID;if(t?this.adapter.removeClass(i):this.adapter.addClass(i),this.helperText_){if(this.helperText_.setValidity(t),!this.helperText_.isValidation())return;var n=this.helperText_.isVisible(),r=this.helperText_.getId();n&&r?this.adapter.setInputAttr(io.ARIA_DESCRIBEDBY,r):this.adapter.removeInputAttr(io.ARIA_DESCRIBEDBY)}},e.prototype.styleFocused_=function(t){var i=e.cssClasses.FOCUSED;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.styleDisabled_=function(t){var i=e.cssClasses,n=i.DISABLED,r=i.INVALID;t?(this.adapter.addClass(n),this.adapter.removeClass(r)):this.adapter.removeClass(n),this.leadingIcon_&&this.leadingIcon_.setDisabled(t),this.trailingIcon_&&this.trailingIcon_.setDisabled(t)},e.prototype.styleFloating_=function(t){var i=e.cssClasses.LABEL_FLOATING;t?this.adapter.addClass(i):this.adapter.removeClass(i)},e.prototype.getNativeInput_=function(){return(this.adapter?this.adapter.getNativeInput():null)||{disabled:!1,maxLength:-1,required:!1,type:"input",validity:{badInput:!1,valid:!0},value:""}},e}(eS),im={HELPER_TEXT_PERSISTENT:"mdc-text-field-helper-text--persistent",HELPER_TEXT_VALIDATION_MSG:"mdc-text-field-helper-text--validation-msg",ROOT:"mdc-text-field-helper-text"},ig={ARIA_HIDDEN:"aria-hidden",ROLE:"role",ROOT_SELECTOR:"."+im.ROOT},i_=function(t){function e(i){return t.call(this,eI(eI({},e.defaultAdapter),i))||this}return eT(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return im},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return ig},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.getId=function(){return this.adapter.getAttr("id")},e.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(ig.ARIA_HIDDEN)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.isPersistent=function(){return this.adapter.hasClass(im.HELPER_TEXT_PERSISTENT)},e.prototype.setPersistent=function(t){t?this.adapter.addClass(im.HELPER_TEXT_PERSISTENT):this.adapter.removeClass(im.HELPER_TEXT_PERSISTENT)},e.prototype.isValidation=function(){return this.adapter.hasClass(im.HELPER_TEXT_VALIDATION_MSG)},e.prototype.setValidation=function(t){t?this.adapter.addClass(im.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(im.HELPER_TEXT_VALIDATION_MSG)},e.prototype.showToScreenReader=function(){this.adapter.removeAttr(ig.ARIA_HIDDEN)},e.prototype.setValidity=function(t){var e=this.adapter.hasClass(im.HELPER_TEXT_PERSISTENT),i=this.adapter.hasClass(im.HELPER_TEXT_VALIDATION_MSG)&&!t;i?(this.showToScreenReader(),this.adapter.setAttr(ig.ROLE,"alert")):this.adapter.removeAttr(ig.ROLE),e||i||this.hide_()},e.prototype.hide_=function(){this.adapter.setAttr(ig.ARIA_HIDDEN,"true")},e}(eS),ib=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eT(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new i_({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e}})},e}(ez),iy={ICON_EVENT:"MDCTextField:icon",ICON_ROLE:"button"},iv={ROOT:"mdc-text-field__icon"},ix=["click","keydown"],iw=function(t){function e(i){var n=t.call(this,eI(eI({},e.defaultAdapter),i))||this;return n.savedTabIndex_=null,n.interactionHandler_=function(t){return n.handleInteraction(t)},n}return eT(e,t),Object.defineProperty(e,"strings",{get:function(){return iy},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return iv},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),ix.forEach(function(e){t.adapter.registerInteractionHandler(e,t.interactionHandler_)})},e.prototype.destroy=function(){var t=this;ix.forEach(function(e){t.adapter.deregisterInteractionHandler(e,t.interactionHandler_)})},e.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",iy.ICON_ROLE)))},e.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&(t.preventDefault(),this.adapter.notifyIconAction())},e}(eS),ik=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eT(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForTextField",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new iw({getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e},registerInteractionHandler:function(e,i){return t.listen(e,i)},deregisterInteractionHandler:function(e,i){return t.unlisten(e,i)},notifyIconAction:function(){return t.emit(iw.strings.ICON_EVENT,{},!0)}})},e}(ez),iE=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return eT(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e,i,n,r,a,o){void 0===t&&(t=function(t,e){return new it(t,e)}),void 0===e&&(e=function(t){return new eq(t)}),void 0===i&&(i=function(t){return new ib(t)}),void 0===n&&(n=function(t){return new ia(t)}),void 0===r&&(r=function(t){return new ik(t)}),void 0===a&&(a=function(t){return new eN(t)}),void 0===o&&(o=function(t){return new eQ(t)}),this.input_=this.root.querySelector(io.INPUT_SELECTOR);var s=this.root.querySelector(io.LABEL_SELECTOR);this.label_=s?a(s):null;var l=this.root.querySelector(io.LINE_RIPPLE_SELECTOR);this.lineRipple_=l?e(l):null;var c=this.root.querySelector(io.OUTLINE_SELECTOR);this.outline_=c?o(c):null;var d=i_.strings,u=this.root.nextElementSibling,h=u&&u.classList.contains(is.HELPER_LINE),p=h&&u&&u.querySelector(d.ROOT_SELECTOR);this.helperText_=p?i(p):null;var m=ir.strings,f=this.root.querySelector(m.ROOT_SELECTOR);!f&&h&&u&&(f=u.querySelector(m.ROOT_SELECTOR)),this.characterCounter_=f?n(f):null;var g=this.root.querySelector(io.LEADING_ICON_SELECTOR);this.leadingIcon_=g?r(g):null;var _=this.root.querySelector(io.TRAILING_ICON_SELECTOR);this.trailingIcon_=_?r(_):null,this.prefix_=this.root.querySelector(io.PREFIX_SELECTOR),this.suffix_=this.root.querySelector(io.SUFFIX_SELECTOR),this.ripple=this.createRipple_(t)},e.prototype.destroy=function(){this.ripple&&this.ripple.destroy(),this.lineRipple_&&this.lineRipple_.destroy(),this.helperText_&&this.helperText_.destroy(),this.characterCounter_&&this.characterCounter_.destroy(),this.leadingIcon_&&this.leadingIcon_.destroy(),this.trailingIcon_&&this.trailingIcon_.destroy(),this.label_&&this.label_.destroy(),this.outline_&&this.outline_.destroy(),t.prototype.destroy.call(this)},e.prototype.initialSyncWithDOM=function(){this.disabled=this.input_.disabled},Object.defineProperty(e.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.foundation.isDisabled()},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"required",{get:function(){return this.input_.required},set:function(t){this.input_.required=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"pattern",{get:function(){return this.input_.pattern},set:function(t){this.input_.pattern=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minLength",{get:function(){return this.input_.minLength},set:function(t){this.input_.minLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxLength",{get:function(){return this.input_.maxLength},set:function(t){t<0?this.input_.removeAttribute("maxLength"):this.input_.maxLength=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"min",{get:function(){return this.input_.min},set:function(t){this.input_.min=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"max",{get:function(){return this.input_.max},set:function(t){this.input_.max=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"step",{get:function(){return this.input_.step},set:function(t){this.input_.step=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trailingIconAriaLabel",{set:function(t){this.foundation.setTrailingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"trailingIconContent",{set:function(t){this.foundation.setTrailingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useNativeValidation",{set:function(t){this.foundation.setUseNativeValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"prefixText",{get:function(){return this.prefix_?this.prefix_.textContent:null},set:function(t){this.prefix_&&(this.prefix_.textContent=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"suffixText",{get:function(){return this.suffix_?this.suffix_.textContent:null},set:function(t){this.suffix_&&(this.suffix_.textContent=t)},enumerable:!0,configurable:!0}),e.prototype.focus=function(){this.input_.focus()},e.prototype.layout=function(){var t=this.foundation.shouldFloat;this.foundation.notchOutline(t)},e.prototype.getDefaultFoundation=function(){return new ip(eI(eI(eI(eI(eI({},this.getRootAdapterMethods_()),this.getInputAdapterMethods_()),this.getLabelAdapterMethods_()),this.getLineRippleAdapterMethods_()),this.getOutlineAdapterMethods_()),this.getFoundationMap_())},e.prototype.getRootAdapterMethods_=function(){var t=this;return{addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},registerTextFieldInteractionHandler:function(e,i){t.listen(e,i)},deregisterTextFieldInteractionHandler:function(e,i){t.unlisten(e,i)},registerValidationAttributeChangeHandler:function(e){var i=new MutationObserver(function(t){return e(t.map(function(t){return t.attributeName}).filter(function(t){return t}))});return i.observe(t.input_,{attributes:!0}),i},deregisterValidationAttributeChangeHandler:function(t){t.disconnect()}}},e.prototype.getInputAdapterMethods_=function(){var t=this;return{getNativeInput:function(){return t.input_},setInputAttr:function(e,i){t.input_.setAttribute(e,i)},removeInputAttr:function(e){t.input_.removeAttribute(e)},isFocused:function(){return document.activeElement===t.input_},registerInputInteractionHandler:function(e,i){t.input_.addEventListener(e,i,eL())},deregisterInputInteractionHandler:function(e,i){t.input_.removeEventListener(e,i,eL())}}},e.prototype.getLabelAdapterMethods_=function(){var t=this;return{floatLabel:function(e){return t.label_&&t.label_.float(e)},getLabelWidth:function(){return t.label_?t.label_.getWidth():0},hasLabel:function(){return!!t.label_},shakeLabel:function(e){return t.label_&&t.label_.shake(e)},setLabelRequired:function(e){return t.label_&&t.label_.setRequired(e)}}},e.prototype.getLineRippleAdapterMethods_=function(){var t=this;return{activateLineRipple:function(){t.lineRipple_&&t.lineRipple_.activate()},deactivateLineRipple:function(){t.lineRipple_&&t.lineRipple_.deactivate()},setLineRippleTransformOrigin:function(e){t.lineRipple_&&t.lineRipple_.setRippleCenter(e)}}},e.prototype.getOutlineAdapterMethods_=function(){var t=this;return{closeOutline:function(){return t.outline_&&t.outline_.closeNotch()},hasOutline:function(){return!!t.outline_},notchOutline:function(e){return t.outline_&&t.outline_.notch(e)}}},e.prototype.getFoundationMap_=function(){return{characterCounter:this.characterCounter_?this.characterCounter_.foundationForTextField:void 0,helperText:this.helperText_?this.helperText_.foundationForTextField:void 0,leadingIcon:this.leadingIcon_?this.leadingIcon_.foundationForTextField:void 0,trailingIcon:this.trailingIcon_?this.trailingIcon_.foundationForTextField:void 0}},e.prototype.createRipple_=function(t){var e=this,i=this.root.classList.contains(is.TEXTAREA),n=this.root.classList.contains(is.OUTLINED);if(i||n)return null;var r=eI(eI({},it.createAdapter(this)),{isSurfaceActive:function(){return eP(e.input_,":active")},registerInteractionHandler:function(t,i){return e.input_.addEventListener(t,i,eL())},deregisterInteractionHandler:function(t,i){return e.input_.removeEventListener(t,i,eL())}});return t(this.root,new e9(r))},e}(ez),iC=function(t,e){return(iC=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function iA(t,e){function i(){this.constructor=t}iC(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var iT=function(){return(iT=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},iI={animation:{prefixed:"-webkit-animation",standard:"animation"},transform:{prefixed:"-webkit-transform",standard:"transform"},transition:{prefixed:"-webkit-transition",standard:"transition"}},iS={animationend:{cssProperty:"animation",prefixed:"webkitAnimationEnd",standard:"animationend"},animationiteration:{cssProperty:"animation",prefixed:"webkitAnimationIteration",standard:"animationiteration"},animationstart:{cssProperty:"animation",prefixed:"webkitAnimationStart",standard:"animationstart"},transitionend:{cssProperty:"transition",prefixed:"webkitTransitionEnd",standard:"transitionend"}};function iz(t){return!!t.document&&"function"==typeof t.document.createElement}function iL(t,e){if(iz(t)&&e in iI){var i=t.document.createElement("div"),n=iI[e],r=n.standard,a=n.prefixed;return r in i.style?r:a}return e}function iM(t,e){if(iz(t)&&e in iS){var i=t.document.createElement("div"),n=iS[e],r=n.standard,a=n.prefixed;return n.cssProperty in i.style?r:a}return e}var iP={ANIM_CHECKED_INDETERMINATE:"mdc-checkbox--anim-checked-indeterminate",ANIM_CHECKED_UNCHECKED:"mdc-checkbox--anim-checked-unchecked",ANIM_INDETERMINATE_CHECKED:"mdc-checkbox--anim-indeterminate-checked",ANIM_INDETERMINATE_UNCHECKED:"mdc-checkbox--anim-indeterminate-unchecked",ANIM_UNCHECKED_CHECKED:"mdc-checkbox--anim-unchecked-checked",ANIM_UNCHECKED_INDETERMINATE:"mdc-checkbox--anim-unchecked-indeterminate",BACKGROUND:"mdc-checkbox__background",CHECKED:"mdc-checkbox--checked",CHECKMARK:"mdc-checkbox__checkmark",CHECKMARK_PATH:"mdc-checkbox__checkmark-path",DISABLED:"mdc-checkbox--disabled",INDETERMINATE:"mdc-checkbox--indeterminate",MIXEDMARK:"mdc-checkbox__mixedmark",NATIVE_CONTROL:"mdc-checkbox__native-control",ROOT:"mdc-checkbox",SELECTED:"mdc-checkbox--selected",UPGRADED:"mdc-checkbox--upgraded"},iR={ARIA_CHECKED_ATTR:"aria-checked",ARIA_CHECKED_INDETERMINATE_VALUE:"mixed",DATA_INDETERMINATE_ATTR:"data-indeterminate",NATIVE_CONTROL_SELECTOR:".mdc-checkbox__native-control",TRANSITION_STATE_CHECKED:"checked",TRANSITION_STATE_INDETERMINATE:"indeterminate",TRANSITION_STATE_INIT:"init",TRANSITION_STATE_UNCHECKED:"unchecked"},iO={ANIM_END_LATCH_MS:250},iD=function(t){function e(i){var n=t.call(this,iT(iT({},e.defaultAdapter),i))||this;return n.currentCheckState_=iR.TRANSITION_STATE_INIT,n.currentAnimationClass_="",n.animEndLatchTimer_=0,n.enableAnimationEndHandler_=!1,n}return iA(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return iP},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return iR},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return iO},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},forceLayout:function(){},hasNativeControl:function(){return!1},isAttachedToDOM:function(){return!1},isChecked:function(){return!1},isIndeterminate:function(){return!1},removeClass:function(){},removeNativeControlAttr:function(){},setNativeControlAttr:function(){},setNativeControlDisabled:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.currentCheckState_=this.determineCheckState_(),this.updateAriaChecked_(),this.adapter.addClass(iP.UPGRADED)},e.prototype.destroy=function(){clearTimeout(this.animEndLatchTimer_)},e.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(iP.DISABLED):this.adapter.removeClass(iP.DISABLED)},e.prototype.handleAnimationEnd=function(){var t=this;this.enableAnimationEndHandler_&&(clearTimeout(this.animEndLatchTimer_),this.animEndLatchTimer_=setTimeout(function(){t.adapter.removeClass(t.currentAnimationClass_),t.enableAnimationEndHandler_=!1},iO.ANIM_END_LATCH_MS))},e.prototype.handleChange=function(){this.transitionCheckState_()},e.prototype.transitionCheckState_=function(){if(this.adapter.hasNativeControl()){var t=this.currentCheckState_,e=this.determineCheckState_();if(t!==e){this.updateAriaChecked_();var i=iR.TRANSITION_STATE_UNCHECKED,n=iP.SELECTED;e===i?this.adapter.removeClass(n):this.adapter.addClass(n),this.currentAnimationClass_.length>0&&(clearTimeout(this.animEndLatchTimer_),this.adapter.forceLayout(),this.adapter.removeClass(this.currentAnimationClass_)),this.currentAnimationClass_=this.getTransitionAnimationClass_(t,e),this.currentCheckState_=e,this.adapter.isAttachedToDOM()&&this.currentAnimationClass_.length>0&&(this.adapter.addClass(this.currentAnimationClass_),this.enableAnimationEndHandler_=!0)}}},e.prototype.determineCheckState_=function(){var t=iR.TRANSITION_STATE_INDETERMINATE,e=iR.TRANSITION_STATE_CHECKED,i=iR.TRANSITION_STATE_UNCHECKED;return this.adapter.isIndeterminate()?t:this.adapter.isChecked()?e:i},e.prototype.getTransitionAnimationClass_=function(t,i){var n=iR.TRANSITION_STATE_INIT,r=iR.TRANSITION_STATE_CHECKED,a=iR.TRANSITION_STATE_UNCHECKED,o=e.cssClasses,s=o.ANIM_UNCHECKED_CHECKED,l=o.ANIM_UNCHECKED_INDETERMINATE,c=o.ANIM_CHECKED_UNCHECKED,d=o.ANIM_CHECKED_INDETERMINATE,u=o.ANIM_INDETERMINATE_CHECKED,h=o.ANIM_INDETERMINATE_UNCHECKED;switch(t){case n:if(i===a)return"";return i===r?u:h;case a:return i===r?s:l;case r:return i===a?c:d;default:return i===r?u:h}},e.prototype.updateAriaChecked_=function(){this.adapter.isIndeterminate()?this.adapter.setNativeControlAttr(iR.ARIA_CHECKED_ATTR,iR.ARIA_CHECKED_INDETERMINATE_VALUE):this.adapter.removeNativeControlAttr(iR.ARIA_CHECKED_ATTR)},e}(eS),iB=["checked","indeterminate"],iF=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ripple_=e.createRipple_(),e}return iA(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.nativeControl_.checked=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"indeterminate",{get:function(){return this.nativeControl_.indeterminate},set:function(t){this.nativeControl_.indeterminate=t},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.nativeControl_.value},set:function(t){this.nativeControl_.value=t},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var t=iR.DATA_INDETERMINATE_ATTR;this.nativeControl_.indeterminate="true"===this.nativeControl_.getAttribute(t),this.nativeControl_.removeAttribute(t)},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleChange_=function(){return t.foundation.handleChange()},this.handleAnimationEnd_=function(){return t.foundation.handleAnimationEnd()},this.nativeControl_.addEventListener("change",this.handleChange_),this.listen(iM(window,"animationend"),this.handleAnimationEnd_),this.installPropertyChangeHooks_()},e.prototype.destroy=function(){this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.handleChange_),this.unlisten(iM(window,"animationend"),this.handleAnimationEnd_),this.uninstallPropertyChangeHooks_(),t.prototype.destroy.call(this)},e.prototype.getDefaultFoundation=function(){var t=this;return new iD({addClass:function(e){return t.root.classList.add(e)},forceLayout:function(){return t.root.offsetWidth},hasNativeControl:function(){return!!t.nativeControl_},isAttachedToDOM:function(){return!!t.root.parentNode},isChecked:function(){return t.checked},isIndeterminate:function(){return t.indeterminate},removeClass:function(e){t.root.classList.remove(e)},removeNativeControlAttr:function(e){t.nativeControl_.removeAttribute(e)},setNativeControlAttr:function(e,i){t.nativeControl_.setAttribute(e,i)},setNativeControlDisabled:function(e){t.nativeControl_.disabled=e}})},e.prototype.createRipple_=function(){var t=this,e=iT(iT({},it.createAdapter(this)),{deregisterInteractionHandler:function(e,i){return t.nativeControl_.removeEventListener(e,i,eL())},isSurfaceActive:function(){return eP(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(e,i){return t.nativeControl_.addEventListener(e,i,eL())}});return new it(this.root,new e9(e))},e.prototype.installPropertyChangeHooks_=function(){var t=this,e=this.nativeControl_,i=Object.getPrototypeOf(e);iB.forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);if(iN(r)){var a=r.get,o={configurable:r.configurable,enumerable:r.enumerable,get:a,set:function(i){r.set.call(e,i),t.foundation.handleChange()}};Object.defineProperty(e,n,o)}})},e.prototype.uninstallPropertyChangeHooks_=function(){var t=this.nativeControl_,e=Object.getPrototypeOf(t);iB.forEach(function(i){var n=Object.getOwnPropertyDescriptor(e,i);iN(n)&&Object.defineProperty(t,i,n)})},Object.defineProperty(e.prototype,"nativeControl_",{get:function(){var t=iR.NATIVE_CONTROL_SELECTOR,e=this.root.querySelector(t);if(!e)throw Error("Checkbox component requires a "+t+" element");return e},enumerable:!0,configurable:!0}),e}(ez);function iN(t){return!!t&&"function"==typeof t.set}var iV=function(t,e){return(iV=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function iU(t,e){function i(){this.constructor=t}iV(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var i$=function(){return(i$=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ij={CHECKED:"mdc-switch--checked",DISABLED:"mdc-switch--disabled"},iH={ARIA_CHECKED_ATTR:"aria-checked",NATIVE_CONTROL_SELECTOR:".mdc-switch__native-control",RIPPLE_SURFACE_SELECTOR:".mdc-switch__thumb-underlay"},iq=function(t){function e(i){return t.call(this,i$(i$({},e.defaultAdapter),i))||this}return iU(e,t),Object.defineProperty(e,"strings",{get:function(){return iH},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return ij},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},setNativeControlChecked:function(){},setNativeControlDisabled:function(){},setNativeControlAttr:function(){}}},enumerable:!0,configurable:!0}),e.prototype.setChecked=function(t){this.adapter.setNativeControlChecked(t),this.updateAriaChecked_(t),this.updateCheckedStyling_(t)},e.prototype.setDisabled=function(t){this.adapter.setNativeControlDisabled(t),t?this.adapter.addClass(ij.DISABLED):this.adapter.removeClass(ij.DISABLED)},e.prototype.handleChange=function(t){var e=t.target;this.updateAriaChecked_(e.checked),this.updateCheckedStyling_(e.checked)},e.prototype.updateCheckedStyling_=function(t){t?this.adapter.addClass(ij.CHECKED):this.adapter.removeClass(ij.CHECKED)},e.prototype.updateAriaChecked_=function(t){this.adapter.setNativeControlAttr(iH.ARIA_CHECKED_ATTR,""+!!t)},e}(eS),iG=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.ripple_=e.createRipple_(),e}return iU(e,t),e.attachTo=function(t){return new e(t)},e.prototype.destroy=function(){t.prototype.destroy.call(this),this.ripple_.destroy(),this.nativeControl_.removeEventListener("change",this.changeHandler_)},e.prototype.initialSyncWithDOM=function(){var t=this;this.changeHandler_=function(){for(var e,i=[],n=0;n<arguments.length;n++)i[n]=arguments[n];return(e=t.foundation).handleChange.apply(e,function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,r,a=i.call(t),o=[];try{for(;(void 0===e||e-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(t){r={error:t}}finally{try{n&&!n.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return o}(arguments[e]));return t}(i))},this.nativeControl_.addEventListener("change",this.changeHandler_),this.checked=this.checked},e.prototype.getDefaultFoundation=function(){var t=this;return new iq({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},setNativeControlChecked:function(e){return t.nativeControl_.checked=e},setNativeControlDisabled:function(e){return t.nativeControl_.disabled=e},setNativeControlAttr:function(e,i){return t.nativeControl_.setAttribute(e,i)}})},Object.defineProperty(e.prototype,"ripple",{get:function(){return this.ripple_},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"checked",{get:function(){return this.nativeControl_.checked},set:function(t){this.foundation.setChecked(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.nativeControl_.disabled},set:function(t){this.foundation.setDisabled(t)},enumerable:!0,configurable:!0}),e.prototype.createRipple_=function(){var t=this,e=iq.strings.RIPPLE_SURFACE_SELECTOR,i=this.root.querySelector(e),n=i$(i$({},it.createAdapter(this)),{addClass:function(t){return i.classList.add(t)},computeBoundingRect:function(){return i.getBoundingClientRect()},deregisterInteractionHandler:function(e,i){t.nativeControl_.removeEventListener(e,i,eL())},isSurfaceActive:function(){return eP(t.nativeControl_,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(e,i){t.nativeControl_.addEventListener(e,i,eL())},removeClass:function(t){i.classList.remove(t)},updateCssVariable:function(t,e){i.style.setProperty(t,e)}});return new it(this.root,new e9(n))},Object.defineProperty(e.prototype,"nativeControl_",{get:function(){var t=iq.strings.NATIVE_CONTROL_SELECTOR;return this.root.querySelector(t)},enumerable:!0,configurable:!0}),e}(ez),iX=function(t,e){return(iX=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function iZ(t,e){function i(){this.constructor=t}iX(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var iW=function(){return(iW=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},iY={DISABLED:"mdc-slider--disabled",DISCRETE:"mdc-slider--discrete",INPUT:"mdc-slider__input",RANGE:"mdc-slider--range",THUMB:"mdc-slider__thumb",THUMB_KNOB:"mdc-slider__thumb-knob",THUMB_TOP:"mdc-slider__thumb--top",THUMB_WITH_INDICATOR:"mdc-slider__thumb--with-indicator",TICK_MARKS:"mdc-slider--tick-marks",TICK_MARKS_CONTAINER:"mdc-slider__tick-marks",TICK_MARK_ACTIVE:"mdc-slider__tick-mark--active",TICK_MARK_INACTIVE:"mdc-slider__tick-mark--inactive",TRACK:"mdc-slider__track",TRACK_ACTIVE:"mdc-slider__track--active_fill",VALUE_INDICATOR_TEXT:"mdc-slider__value-indicator-text"},iK={STEP_SIZE:1,THUMB_UPDATE_MIN_PX:5},iJ={ARIA_VALUETEXT:"aria-valuetext",INPUT_DISABLED:"disabled",INPUT_MIN:"min",INPUT_MAX:"max",INPUT_VALUE:"value",INPUT_STEP:"step"},iQ={CHANGE:"MDCSlider:change",INPUT:"MDCSlider:input"};!function(t){t[t.ACTIVE=0]="ACTIVE",t[t.INACTIVE=1]="INACTIVE"}(n||(n={})),function(t){t[t.START=1]="START",t[t.END=2]="END"}(r||(r={}));var i0="undefined"!=typeof window,i1=function(t){function e(i){var n=t.call(this,iW(iW({},e.defaultAdapter),i))||this;return n.initialStylesRemoved=!1,n.isDisabled=!1,n.isDiscrete=!1,n.step=iK.STEP_SIZE,n.hasTickMarks=!1,n.isRange=!1,n.thumb=null,n.downEventClientX=null,n.startThumbKnobWidth=0,n.endThumbKnobWidth=0,n}return iZ(e,t),Object.defineProperty(e,"defaultAdapter",{get:function(){return{hasClass:function(){return!1},addClass:function(){},removeClass:function(){},addThumbClass:function(){},removeThumbClass:function(){},getAttribute:function(){return null},getInputValue:function(){return""},setInputValue:function(){},getInputAttribute:function(){return null},setInputAttribute:function(){return null},removeInputAttribute:function(){return null},focusInput:function(){},isInputFocused:function(){return!1},getThumbKnobWidth:function(){return 0},getThumbBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},getBoundingClientRect:function(){return{top:0,right:0,bottom:0,left:0,width:0,height:0}},isRTL:function(){return!1},setThumbStyleProperty:function(){},removeThumbStyleProperty:function(){},setTrackActiveStyleProperty:function(){},removeTrackActiveStyleProperty:function(){},setValueIndicatorText:function(){},getValueToAriaValueTextFn:function(){return null},updateTickMarks:function(){},setPointerCapture:function(){},emitChangeEvent:function(){},emitInputEvent:function(){},emitDragStartEvent:function(){},emitDragEndEvent:function(){},registerEventHandler:function(){},deregisterEventHandler:function(){},registerThumbEventHandler:function(){},deregisterThumbEventHandler:function(){},registerInputEventHandler:function(){},deregisterInputEventHandler:function(){},registerBodyEventHandler:function(){},deregisterBodyEventHandler:function(){},registerWindowEventHandler:function(){},deregisterWindowEventHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.isDisabled=this.adapter.hasClass(iY.DISABLED),this.isDiscrete=this.adapter.hasClass(iY.DISCRETE),this.hasTickMarks=this.adapter.hasClass(iY.TICK_MARKS),this.isRange=this.adapter.hasClass(iY.RANGE);var e=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(iJ.INPUT_MIN,this.isRange?r.START:r.END),iJ.INPUT_MIN),i=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(iJ.INPUT_MAX,r.END),iJ.INPUT_MAX),n=this.convertAttributeValueToNumber(this.adapter.getInputAttribute(iJ.INPUT_VALUE,r.END),iJ.INPUT_VALUE),a=this.isRange?this.convertAttributeValueToNumber(this.adapter.getInputAttribute(iJ.INPUT_VALUE,r.START),iJ.INPUT_VALUE):e;this.validateProperties({min:e,max:i,value:n,valueStart:a}),this.min=e,this.max=i,this.value=n,this.valueStart=a,this.valueBeforeDownEvent=n,this.valueStartBeforeDownEvent=a;var o=this.adapter.getInputAttribute(iJ.INPUT_STEP,r.END);if(o&&(this.step=this.convertAttributeValueToNumber(o,iJ.INPUT_STEP)),this.step<=0)throw Error("MDCSliderFoundation: step must be a positive number. Current step: "+this.step);this.mousedownOrTouchstartListener=this.handleMousedownOrTouchstart.bind(this),this.moveListener=this.handleMove.bind(this),this.pointerdownListener=this.handlePointerdown.bind(this),this.pointerupListener=this.handlePointerup.bind(this),this.thumbMouseenterListener=this.handleThumbMouseenter.bind(this),this.thumbMouseleaveListener=this.handleThumbMouseleave.bind(this),this.inputStartChangeListener=function(){t.handleInputChange(r.START)},this.inputEndChangeListener=function(){t.handleInputChange(r.END)},this.inputStartFocusListener=function(){t.handleInputFocus(r.START)},this.inputEndFocusListener=function(){t.handleInputFocus(r.END)},this.inputStartBlurListener=function(){t.handleInputBlur(r.START)},this.inputEndBlurListener=function(){t.handleInputBlur(r.END)},this.resizeListener=this.handleResize.bind(this),this.registerEventHandlers()},e.prototype.destroy=function(){this.deregisterEventHandlers()},e.prototype.getMin=function(){return this.min},e.prototype.getMax=function(){return this.max},e.prototype.getValue=function(){return this.value},e.prototype.setValue=function(t){if(this.isRange&&t<this.valueStart)throw Error("end thumb value ("+t+") must be >= start thumb value ("+this.valueStart+")");this.updateValue(t,r.END)},e.prototype.getValueStart=function(){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");return this.valueStart},e.prototype.setValueStart=function(t){if(!this.isRange)throw Error("`valueStart` is only applicable for range sliders.");if(this.isRange&&t>this.value)throw Error("start thumb value ("+t+") must be <= end thumb value ("+this.value+")");this.updateValue(t,r.START)},e.prototype.getStep=function(){return this.step},e.prototype.getDisabled=function(){return this.isDisabled},e.prototype.setDisabled=function(t){this.isDisabled=t,t?(this.adapter.addClass(iY.DISABLED),this.isRange&&this.adapter.setInputAttribute(iJ.INPUT_DISABLED,"",r.START),this.adapter.setInputAttribute(iJ.INPUT_DISABLED,"",r.END)):(this.adapter.removeClass(iY.DISABLED),this.isRange&&this.adapter.removeInputAttribute(iJ.INPUT_DISABLED,r.START),this.adapter.removeInputAttribute(iJ.INPUT_DISABLED,r.END))},e.prototype.getIsRange=function(){return this.isRange},e.prototype.layout=function(t){var e=(void 0===t?{}:t).skipUpdateUI;this.rect=this.adapter.getBoundingClientRect(),this.isRange&&(this.startThumbKnobWidth=this.adapter.getThumbKnobWidth(r.START),this.endThumbKnobWidth=this.adapter.getThumbKnobWidth(r.END)),e||this.updateUI()},e.prototype.handleResize=function(){this.layout()},e.prototype.handleDown=function(t){if(!this.isDisabled){this.valueStartBeforeDownEvent=this.valueStart,this.valueBeforeDownEvent=this.value;var e=null!=t.clientX?t.clientX:t.targetTouches[0].clientX;this.downEventClientX=e;var i=this.mapClientXOnSliderScale(e);this.thumb=this.getThumbFromDownEvent(e,i),null!==this.thumb&&(this.handleDragStart(t,i,this.thumb),this.isRange&&i>=this.valueStart&&i<=this.value||this.updateValue(i,this.thumb,{emitInputEvent:!0}))}},e.prototype.handleMove=function(t){if(!this.isDisabled){t.preventDefault();var e=null!=t.clientX?t.clientX:t.targetTouches[0].clientX,i=null!=this.thumb;if(this.thumb=this.getThumbFromMoveEvent(e),null!==this.thumb){var n=this.mapClientXOnSliderScale(e);i||(this.handleDragStart(t,n,this.thumb),this.adapter.emitDragStartEvent(n,this.thumb)),this.updateValue(n,this.thumb,{emitInputEvent:!0})}}},e.prototype.handleUp=function(){if(!this.isDisabled&&null!==this.thumb){var t=this.thumb===r.START?this.valueStartBeforeDownEvent:this.valueBeforeDownEvent,e=this.thumb===r.START?this.valueStart:this.value;t!==e&&this.adapter.emitChangeEvent(e,this.thumb),this.adapter.emitDragEndEvent(e,this.thumb),this.thumb=null}},e.prototype.handleThumbMouseenter=function(){this.isDiscrete&&this.isRange&&(this.adapter.addThumbClass(iY.THUMB_WITH_INDICATOR,r.START),this.adapter.addThumbClass(iY.THUMB_WITH_INDICATOR,r.END))},e.prototype.handleThumbMouseleave=function(){this.isDiscrete&&this.isRange&&(this.adapter.isInputFocused(r.START)||this.adapter.isInputFocused(r.END)||(this.adapter.removeThumbClass(iY.THUMB_WITH_INDICATOR,r.START),this.adapter.removeThumbClass(iY.THUMB_WITH_INDICATOR,r.END)))},e.prototype.handleMousedownOrTouchstart=function(t){var e=this,i="mousedown"===t.type?"mousemove":"touchmove";this.adapter.registerBodyEventHandler(i,this.moveListener);var n=function(){e.handleUp(),e.adapter.deregisterBodyEventHandler(i,e.moveListener),e.adapter.deregisterEventHandler("mouseup",n),e.adapter.deregisterEventHandler("touchend",n)};this.adapter.registerBodyEventHandler("mouseup",n),this.adapter.registerBodyEventHandler("touchend",n),this.handleDown(t)},e.prototype.handlePointerdown=function(t){this.adapter.setPointerCapture(t.pointerId),this.adapter.registerEventHandler("pointermove",this.moveListener),this.handleDown(t)},e.prototype.handleInputChange=function(t){var e=Number(this.adapter.getInputValue(t));t===r.START?this.setValueStart(e):this.setValue(e)},e.prototype.handleInputFocus=function(t){if(this.isDiscrete&&(this.adapter.addThumbClass(iY.THUMB_WITH_INDICATOR,t),this.isRange)){var e=t===r.START?r.END:r.START;this.adapter.addThumbClass(iY.THUMB_WITH_INDICATOR,e)}},e.prototype.handleInputBlur=function(t){if(this.isDiscrete&&(this.adapter.removeThumbClass(iY.THUMB_WITH_INDICATOR,t),this.isRange)){var e=t===r.START?r.END:r.START;this.adapter.removeThumbClass(iY.THUMB_WITH_INDICATOR,e)}},e.prototype.handleDragStart=function(t,e,i){this.adapter.focusInput(i),t.preventDefault(),this.adapter.emitDragStartEvent(e,i)},e.prototype.getThumbFromDownEvent=function(t,e){if(!this.isRange)return r.END;var i=this.adapter.getThumbBoundingClientRect(r.START),n=this.adapter.getThumbBoundingClientRect(r.END),a=t>=i.left&&t<=i.right,o=t>=n.left&&t<=n.right;return a&&o?null:a?r.START:o?r.END:e<this.valueStart?r.START:e>this.value?r.END:null},e.prototype.getThumbFromMoveEvent=function(t){if(null!==this.thumb)return this.thumb;if(null===this.downEventClientX)throw Error("`downEventClientX` is null after move event.");return Math.abs(this.downEventClientX-t)<iK.THUMB_UPDATE_MIN_PX?this.thumb:t<this.downEventClientX?this.adapter.isRTL()?r.END:r.START:this.adapter.isRTL()?r.START:r.END},e.prototype.updateUI=function(t){this.updateThumbAndInputAttributes(t),this.updateThumbAndTrackUI(t),this.updateValueIndicatorUI(t),this.updateTickMarksUI()},e.prototype.updateThumbAndInputAttributes=function(t){if(t){var e=this.isRange&&t===r.START?this.valueStart:this.value,i=String(e);this.adapter.setInputAttribute(iJ.INPUT_VALUE,i,t),this.isRange&&t===r.START?this.adapter.setInputAttribute(iJ.INPUT_MIN,i,r.END):this.isRange&&t===r.END&&this.adapter.setInputAttribute(iJ.INPUT_MAX,i,r.START),this.adapter.getInputValue(t)!==i&&this.adapter.setInputValue(i,t);var n=this.adapter.getValueToAriaValueTextFn();n&&this.adapter.setInputAttribute(iJ.ARIA_VALUETEXT,n(e),t)}},e.prototype.updateValueIndicatorUI=function(t){if(this.isDiscrete){var e=this.isRange&&t===r.START?this.valueStart:this.value;this.adapter.setValueIndicatorText(e,t===r.START?r.START:r.END),!t&&this.isRange&&this.adapter.setValueIndicatorText(this.valueStart,r.START)}},e.prototype.updateTickMarksUI=function(){if(this.isDiscrete&&this.hasTickMarks){var t=(this.valueStart-this.min)/this.step,e=(this.value-this.valueStart)/this.step+1,i=(this.max-this.value)/this.step,r=Array.from({length:t}).fill(n.INACTIVE),a=Array.from({length:e}).fill(n.ACTIVE),o=Array.from({length:i}).fill(n.INACTIVE);this.adapter.updateTickMarks(r.concat(a).concat(o))}},e.prototype.mapClientXOnSliderScale=function(t){var e=(t-this.rect.left)/this.rect.width;this.adapter.isRTL()&&(e=1-e);var i=this.min+e*(this.max-this.min);return i===this.max||i===this.min?i:this.quantize(i)},e.prototype.updateValue=function(t,e,i){var n=void 0===i?{}:i,a=n.emitInputEvent,o=n.emitChangeEvent;if(t=this.clampValue(t,e),this.isRange&&e===r.START){if(this.valueStart===t)return;this.valueStart=t}else{if(this.value===t)return;this.value=t}this.updateUI(e),a&&this.adapter.emitInputEvent(e===r.START?this.valueStart:this.value,e),o&&this.adapter.emitChangeEvent(e===r.START?this.valueStart:this.value,e)},e.prototype.quantize=function(t){return Math.round(t/this.step)*this.step},e.prototype.clampValue=function(t,e){return(t=Math.min(Math.max(t,this.min),this.max),this.isRange&&e===r.START&&t>this.value)?this.value:this.isRange&&e===r.END&&t<this.valueStart?this.valueStart:t},e.prototype.updateThumbAndTrackUI=function(t){var e=this,i=this.max,n=this.min,a=(this.value-this.valueStart)/(i-n),o=a*this.rect.width,s=this.adapter.isRTL(),l=i0?iL(window,"transform"):"transform";if(this.isRange){var c=this.adapter.isRTL()?(i-this.value)/(i-n)*this.rect.width:(this.valueStart-n)/(i-n)*this.rect.width,d=c+o;requestAnimationFrame(function(){!s&&t===r.START||s&&t!==r.START?(e.adapter.setTrackActiveStyleProperty("transform-origin","right"),e.adapter.setTrackActiveStyleProperty("left","unset"),e.adapter.setTrackActiveStyleProperty("right",e.rect.width-d+"px")):(e.adapter.setTrackActiveStyleProperty("transform-origin","left"),e.adapter.setTrackActiveStyleProperty("right","unset"),e.adapter.setTrackActiveStyleProperty("left",c+"px")),e.adapter.setTrackActiveStyleProperty(l,"scaleX("+a+")");var i=s?d:c,n=e.adapter.isRTL()?c:d;t!==r.START&&t&&e.initialStylesRemoved||e.adapter.setThumbStyleProperty(l,"translateX("+i+"px)",r.START),t!==r.END&&t&&e.initialStylesRemoved||e.adapter.setThumbStyleProperty(l,"translateX("+n+"px)",r.END),e.removeInitialStyles(s),e.updateOverlappingThumbsUI(i,n,t)})}else requestAnimationFrame(function(){var t=s?e.rect.width-o:o;e.adapter.setThumbStyleProperty(l,"translateX("+t+"px)",r.END),e.adapter.setTrackActiveStyleProperty(l,"scaleX("+a+")"),e.removeInitialStyles(s)})},e.prototype.removeInitialStyles=function(t){if(!this.initialStylesRemoved){var e=t?"right":"left";this.adapter.removeThumbStyleProperty(e,r.END),this.isRange&&this.adapter.removeThumbStyleProperty(e,r.START),this.initialStylesRemoved=!0,this.resetTrackAndThumbAnimation()}},e.prototype.resetTrackAndThumbAnimation=function(){var t=this;if(this.isDiscrete){var e=i0?iL(window,"transition"):"transition",i="all 0s ease 0s";this.adapter.setThumbStyleProperty(e,i,r.END),this.isRange&&this.adapter.setThumbStyleProperty(e,i,r.START),this.adapter.setTrackActiveStyleProperty(e,i),requestAnimationFrame(function(){t.adapter.removeThumbStyleProperty(e,r.END),t.adapter.removeTrackActiveStyleProperty(e),t.isRange&&t.adapter.removeThumbStyleProperty(e,r.START)})}},e.prototype.updateOverlappingThumbsUI=function(t,e,i){var n=!1;if(this.adapter.isRTL()){var a=t-this.startThumbKnobWidth/2;n=e+this.endThumbKnobWidth/2>=a}else n=t+this.startThumbKnobWidth/2>=e-this.endThumbKnobWidth/2;n?(this.adapter.addThumbClass(iY.THUMB_TOP,i||r.END),this.adapter.removeThumbClass(iY.THUMB_TOP,i===r.START?r.END:r.START)):(this.adapter.removeThumbClass(iY.THUMB_TOP,r.START),this.adapter.removeThumbClass(iY.THUMB_TOP,r.END))},e.prototype.convertAttributeValueToNumber=function(t,e){if(null===t)throw Error("MDCSliderFoundation: `"+e+"` must be non-null.");var i=Number(t);if(isNaN(i))throw Error("MDCSliderFoundation: `"+e+"` value is `"+t+"`, but must be a number.");return i},e.prototype.validateProperties=function(t){var e=t.min,i=t.max,n=t.value,r=t.valueStart;if(e>=i)throw Error("MDCSliderFoundation: min must be strictly less than max. "+("Current: [min: "+e+", max: ")+i+"]");if(this.isRange){if(n<e||n>i||r<e||r>i)throw Error("MDCSliderFoundation: values must be in [min, max] range. "+("Current values: [start value: "+r+", end value: ")+n+"]");if(r>n)throw Error("MDCSliderFoundation: start value must be <= end value. "+("Current values: [start value: "+r+", end value: ")+n+"]")}else if(n<e||n>i)throw Error("MDCSliderFoundation: value must be in [min, max] range. Current value: "+n)},e.prototype.registerEventHandlers=function(){this.adapter.registerWindowEventHandler("resize",this.resizeListener),e.SUPPORTS_POINTER_EVENTS?(this.adapter.registerEventHandler("pointerdown",this.pointerdownListener),this.adapter.registerEventHandler("pointerup",this.pointerupListener)):(this.adapter.registerEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.registerEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.registerThumbEventHandler(r.START,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(r.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(r.START,"change",this.inputStartChangeListener),this.adapter.registerInputEventHandler(r.START,"focus",this.inputStartFocusListener),this.adapter.registerInputEventHandler(r.START,"blur",this.inputStartBlurListener)),this.adapter.registerThumbEventHandler(r.END,"mouseenter",this.thumbMouseenterListener),this.adapter.registerThumbEventHandler(r.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.registerInputEventHandler(r.END,"change",this.inputEndChangeListener),this.adapter.registerInputEventHandler(r.END,"focus",this.inputEndFocusListener),this.adapter.registerInputEventHandler(r.END,"blur",this.inputEndBlurListener)},e.prototype.deregisterEventHandlers=function(){this.adapter.deregisterWindowEventHandler("resize",this.resizeListener),e.SUPPORTS_POINTER_EVENTS?(this.adapter.deregisterEventHandler("pointerdown",this.pointerdownListener),this.adapter.deregisterEventHandler("pointerup",this.pointerupListener)):(this.adapter.deregisterEventHandler("mousedown",this.mousedownOrTouchstartListener),this.adapter.deregisterEventHandler("touchstart",this.mousedownOrTouchstartListener)),this.isRange&&(this.adapter.deregisterThumbEventHandler(r.START,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(r.START,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(r.START,"change",this.inputStartChangeListener),this.adapter.deregisterInputEventHandler(r.START,"focus",this.inputStartFocusListener),this.adapter.deregisterInputEventHandler(r.START,"blur",this.inputStartBlurListener)),this.adapter.deregisterThumbEventHandler(r.END,"mouseenter",this.thumbMouseenterListener),this.adapter.deregisterThumbEventHandler(r.END,"mouseleave",this.thumbMouseleaveListener),this.adapter.deregisterInputEventHandler(r.END,"change",this.inputEndChangeListener),this.adapter.deregisterInputEventHandler(r.END,"focus",this.inputEndFocusListener),this.adapter.deregisterInputEventHandler(r.END,"blur",this.inputEndBlurListener)},e.prototype.handlePointerup=function(){this.handleUp(),this.adapter.deregisterEventHandler("pointermove",this.moveListener)},e.SUPPORTS_POINTER_EVENTS=i0&&!!window.PointerEvent,e}(eS),i2=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.skipInitialUIUpdate=!1,e.valueToAriaValueTextFn=null,e}return iZ(e,t),e.attachTo=function(t,i){return void 0===i&&(i={}),new e(t,void 0,i)},e.prototype.getDefaultFoundation=function(){var t=this;return new i1({hasClass:function(e){return t.root.classList.contains(e)},addClass:function(e){t.root.classList.add(e)},removeClass:function(e){t.root.classList.remove(e)},addThumbClass:function(e,i){t.getThumbEl(i).classList.add(e)},removeThumbClass:function(e,i){t.getThumbEl(i).classList.remove(e)},getAttribute:function(e){return t.root.getAttribute(e)},getInputValue:function(e){return t.getInput(e).value},setInputValue:function(e,i){t.getInput(i).value=e},getInputAttribute:function(e,i){return t.getInput(i).getAttribute(e)},setInputAttribute:function(e,i,n){t.getInput(n).setAttribute(e,i)},removeInputAttribute:function(e,i){t.getInput(i).removeAttribute(e)},focusInput:function(e){t.getInput(e).focus()},isInputFocused:function(e){return t.getInput(e)===document.activeElement},getThumbKnobWidth:function(e){return t.getThumbEl(e).querySelector("."+iY.THUMB_KNOB).getBoundingClientRect().width},getThumbBoundingClientRect:function(e){return t.getThumbEl(e).getBoundingClientRect()},getBoundingClientRect:function(){return t.root.getBoundingClientRect()},isRTL:function(){return"rtl"===getComputedStyle(t.root).direction},setThumbStyleProperty:function(e,i,n){t.getThumbEl(n).style.setProperty(e,i)},removeThumbStyleProperty:function(e,i){t.getThumbEl(i).style.removeProperty(e)},setTrackActiveStyleProperty:function(e,i){t.trackActive.style.setProperty(e,i)},removeTrackActiveStyleProperty:function(e){t.trackActive.style.removeProperty(e)},setValueIndicatorText:function(e,i){t.getThumbEl(i).querySelector("."+iY.VALUE_INDICATOR_TEXT).textContent=String(e)},getValueToAriaValueTextFn:function(){return t.valueToAriaValueTextFn},updateTickMarks:function(e){var i=t.root.querySelector("."+iY.TICK_MARKS_CONTAINER);i||((i=document.createElement("div")).classList.add(iY.TICK_MARKS_CONTAINER),t.root.querySelector("."+iY.TRACK).appendChild(i)),e.length!==i.children.length?(i.innerHTML="",t.addTickMarks(i,e)):t.updateTickMarks(i,e)},setPointerCapture:function(e){t.root.setPointerCapture(e)},emitChangeEvent:function(e,i){t.emit(iQ.CHANGE,{value:e,thumb:i})},emitInputEvent:function(e,i){t.emit(iQ.INPUT,{value:e,thumb:i})},emitDragStartEvent:function(e,i){t.getRipple(i).activate()},emitDragEndEvent:function(e,i){t.getRipple(i).deactivate()},registerEventHandler:function(e,i){t.listen(e,i)},deregisterEventHandler:function(e,i){t.unlisten(e,i)},registerThumbEventHandler:function(e,i,n){t.getThumbEl(e).addEventListener(i,n)},deregisterThumbEventHandler:function(e,i,n){t.getThumbEl(e).removeEventListener(i,n)},registerInputEventHandler:function(e,i,n){t.getInput(e).addEventListener(i,n)},deregisterInputEventHandler:function(e,i,n){t.getInput(e).removeEventListener(i,n)},registerBodyEventHandler:function(t,e){document.body.addEventListener(t,e)},deregisterBodyEventHandler:function(t,e){document.body.removeEventListener(t,e)},registerWindowEventHandler:function(t,e){window.addEventListener(t,e)},deregisterWindowEventHandler:function(t,e){window.removeEventListener(t,e)}})},e.prototype.initialize=function(t){var e=(void 0===t?{}:t).skipInitialUIUpdate;this.inputs=[].slice.call(this.root.querySelectorAll("."+iY.INPUT)),this.thumbs=[].slice.call(this.root.querySelectorAll("."+iY.THUMB)),this.trackActive=this.root.querySelector("."+iY.TRACK_ACTIVE),this.ripples=this.createRipples(),e&&(this.skipInitialUIUpdate=!0)},e.prototype.initialSyncWithDOM=function(){this.foundation.layout({skipUpdateUI:this.skipInitialUIUpdate})},e.prototype.layout=function(){this.foundation.layout()},e.prototype.getValueStart=function(){return this.foundation.getValueStart()},e.prototype.setValueStart=function(t){this.foundation.setValueStart(t)},e.prototype.getValue=function(){return this.foundation.getValue()},e.prototype.setValue=function(t){this.foundation.setValue(t)},e.prototype.getDisabled=function(){return this.foundation.getDisabled()},e.prototype.setDisabled=function(t){this.foundation.setDisabled(t)},e.prototype.setValueToAriaValueTextFn=function(t){this.valueToAriaValueTextFn=t},e.prototype.getThumbEl=function(t){return t===r.END?this.thumbs[this.thumbs.length-1]:this.thumbs[0]},e.prototype.getInput=function(t){return t===r.END?this.inputs[this.inputs.length-1]:this.inputs[0]},e.prototype.getRipple=function(t){return t===r.END?this.ripples[this.ripples.length-1]:this.ripples[0]},e.prototype.addTickMarks=function(t,e){for(var i=document.createDocumentFragment(),r=0;r<e.length;r++){var a=document.createElement("div"),o=e[r]===n.ACTIVE?iY.TICK_MARK_ACTIVE:iY.TICK_MARK_INACTIVE;a.classList.add(o),i.appendChild(a)}t.appendChild(i)},e.prototype.updateTickMarks=function(t,e){for(var i=Array.from(t.children),r=0;r<i.length;r++)e[r]===n.ACTIVE?(i[r].classList.add(iY.TICK_MARK_ACTIVE),i[r].classList.remove(iY.TICK_MARK_INACTIVE)):(i[r].classList.add(iY.TICK_MARK_INACTIVE),i[r].classList.remove(iY.TICK_MARK_ACTIVE))},e.prototype.createRipples=function(){for(var t=[],e=[].slice.call(this.root.querySelectorAll("."+iY.THUMB)),i=this,n=0;n<e.length;n++)!function(n){var r=e[n],a=i.inputs[n],o=iW(iW({},it.createAdapter(i)),{addClass:function(t){r.classList.add(t)},computeBoundingRect:function(){return r.getBoundingClientRect()},deregisterInteractionHandler:function(t,e){a.removeEventListener(t,e)},isSurfaceActive:function(){return eP(a,":active")},isUnbounded:function(){return!0},registerInteractionHandler:function(t,e){a.addEventListener(t,e)},removeClass:function(t){r.classList.remove(t)},updateCssVariable:function(t,e){r.style.setProperty(t,e)}}),s=new it(r,new e9(o));s.unbounded=!0,t.push(s)}(n);return t},e}(ez),i5=function(t,e){return(i5=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function i3(t,e){function i(){this.constructor=t}i5(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var i4=function(){return(i4=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},i6={ANCHOR:"mdc-menu-surface--anchor",ANIMATING_CLOSED:"mdc-menu-surface--animating-closed",ANIMATING_OPEN:"mdc-menu-surface--animating-open",FIXED:"mdc-menu-surface--fixed",IS_OPEN_BELOW:"mdc-menu-surface--is-open-below",OPEN:"mdc-menu-surface--open",ROOT:"mdc-menu-surface"},i7={CLOSED_EVENT:"MDCMenuSurface:closed",OPENED_EVENT:"MDCMenuSurface:opened",FOCUSABLE_ELEMENTS:'button:not(:disabled), [href]:not([aria-disabled="true"]), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])'},i8={TRANSITION_OPEN_DURATION:120,TRANSITION_CLOSE_DURATION:75,MARGIN_TO_EDGE:32,ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO:.67};!function(t){t[t.BOTTOM=1]="BOTTOM",t[t.CENTER=2]="CENTER",t[t.RIGHT=4]="RIGHT",t[t.FLIP_RTL=8]="FLIP_RTL"}(a||(a={})),function(t){t[t.TOP_LEFT=0]="TOP_LEFT",t[t.TOP_RIGHT=4]="TOP_RIGHT",t[t.BOTTOM_LEFT=1]="BOTTOM_LEFT",t[t.BOTTOM_RIGHT=5]="BOTTOM_RIGHT",t[t.TOP_START=8]="TOP_START",t[t.TOP_END=12]="TOP_END",t[t.BOTTOM_START=9]="BOTTOM_START",t[t.BOTTOM_END=13]="BOTTOM_END"}(l||(l={}));var i9=function(t,e){return(i9=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function nt(t,e){function i(){this.constructor=t}i9(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var ne=function(){return(ne=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},ni=function(t,e){return(ni=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function nn(t,e){function i(){this.constructor=t}ni(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var nr=function(){return(nr=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},na={LIST_ITEM_ACTIVATED_CLASS:"mdc-list-item--activated",LIST_ITEM_CLASS:"mdc-list-item",LIST_ITEM_DISABLED_CLASS:"mdc-list-item--disabled",LIST_ITEM_SELECTED_CLASS:"mdc-list-item--selected",LIST_ITEM_TEXT_CLASS:"mdc-list-item__text",LIST_ITEM_PRIMARY_TEXT_CLASS:"mdc-list-item__primary-text",ROOT:"mdc-list"},no={ACTION_EVENT:"MDCList:action",ARIA_CHECKED:"aria-checked",ARIA_CHECKED_CHECKBOX_SELECTOR:'[role="checkbox"][aria-checked="true"]',ARIA_CHECKED_RADIO_SELECTOR:'[role="radio"][aria-checked="true"]',ARIA_CURRENT:"aria-current",ARIA_DISABLED:"aria-disabled",ARIA_ORIENTATION:"aria-orientation",ARIA_ORIENTATION_HORIZONTAL:"horizontal",ARIA_ROLE_CHECKBOX_SELECTOR:'[role="checkbox"]',ARIA_SELECTED:"aria-selected",CHECKBOX_RADIO_SELECTOR:'input[type="checkbox"], input[type="radio"]',CHECKBOX_SELECTOR:'input[type="checkbox"]',CHILD_ELEMENTS_TO_TOGGLE_TABINDEX:"\n ."+na.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+na.LIST_ITEM_CLASS+" a\n ",FOCUSABLE_CHILD_ELEMENTS:"\n ."+na.LIST_ITEM_CLASS+" button:not(:disabled),\n ."+na.LIST_ITEM_CLASS+" a,\n ."+na.LIST_ITEM_CLASS+' input[type="radio"]:not(:disabled),\n .'+na.LIST_ITEM_CLASS+' input[type="checkbox"]:not(:disabled)\n ',RADIO_SELECTOR:'input[type="radio"]'},ns={UNSET_INDEX:-1,TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS:300},nl={UNKNOWN:"Unknown",BACKSPACE:"Backspace",ENTER:"Enter",SPACEBAR:"Spacebar",PAGE_UP:"PageUp",PAGE_DOWN:"PageDown",END:"End",HOME:"Home",ARROW_LEFT:"ArrowLeft",ARROW_UP:"ArrowUp",ARROW_RIGHT:"ArrowRight",ARROW_DOWN:"ArrowDown",DELETE:"Delete",ESCAPE:"Escape"},nc=new Set;nc.add(nl.BACKSPACE),nc.add(nl.ENTER),nc.add(nl.SPACEBAR),nc.add(nl.PAGE_UP),nc.add(nl.PAGE_DOWN),nc.add(nl.END),nc.add(nl.HOME),nc.add(nl.ARROW_LEFT),nc.add(nl.ARROW_UP),nc.add(nl.ARROW_RIGHT),nc.add(nl.ARROW_DOWN),nc.add(nl.DELETE),nc.add(nl.ESCAPE);var nd={BACKSPACE:8,ENTER:13,SPACEBAR:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40,DELETE:46,ESCAPE:27},nu=new Map;nu.set(nd.BACKSPACE,nl.BACKSPACE),nu.set(nd.ENTER,nl.ENTER),nu.set(nd.SPACEBAR,nl.SPACEBAR),nu.set(nd.PAGE_UP,nl.PAGE_UP),nu.set(nd.PAGE_DOWN,nl.PAGE_DOWN),nu.set(nd.END,nl.END),nu.set(nd.HOME,nl.HOME),nu.set(nd.ARROW_LEFT,nl.ARROW_LEFT),nu.set(nd.ARROW_UP,nl.ARROW_UP),nu.set(nd.ARROW_RIGHT,nl.ARROW_RIGHT),nu.set(nd.ARROW_DOWN,nl.ARROW_DOWN),nu.set(nd.DELETE,nl.DELETE),nu.set(nd.ESCAPE,nl.ESCAPE);var nh=new Set;function np(t){var e=t.key;if(nc.has(e))return e;var i=nu.get(t.keyCode);return i||nl.UNKNOWN}nh.add(nl.PAGE_UP),nh.add(nl.PAGE_DOWN),nh.add(nl.END),nh.add(nl.HOME),nh.add(nl.ARROW_LEFT),nh.add(nl.ARROW_UP),nh.add(nl.ARROW_RIGHT),nh.add(nl.ARROW_DOWN);var nm=["input","button","textarea","select"],nf=function(t){var e=t.target;if(e){var i=(""+e.tagName).toLowerCase();-1===nm.indexOf(i)&&t.preventDefault()}};function ng(t,e){var i,n=t.nextChar,r=t.focusItemAtIndex,a=t.sortedIndexByFirstChar,o=t.focusedItemIndex,s=t.skipFocus,l=t.isItemAtIndexDisabled;return clearTimeout(e.bufferClearTimeout),e.bufferClearTimeout=setTimeout(function(){nb(e)},ns.TYPEAHEAD_BUFFER_CLEAR_TIMEOUT_MS),e.typeaheadBuffer=e.typeaheadBuffer+n,-1===(i=1===e.typeaheadBuffer.length?function(t,e,i,n){var r,a=n.typeaheadBuffer[0],o=t.get(a);if(!o)return -1;if(a===n.currentFirstChar&&o[n.sortedIndexCursor].index===e){n.sortedIndexCursor=(n.sortedIndexCursor+1)%o.length;var s=o[n.sortedIndexCursor].index;if(!i(s))return s}n.currentFirstChar=a;var l=-1;for(r=0;r<o.length;r++)if(!i(o[r].index)){l=r;break}for(;r<o.length;r++)if(o[r].index>e&&!i(o[r].index)){l=r;break}return -1!==l?(n.sortedIndexCursor=l,o[n.sortedIndexCursor].index):-1}(a,o,l,e):function(t,e,i){var n=i.typeaheadBuffer[0],r=t.get(n);if(!r)return -1;var a=r[i.sortedIndexCursor];if(0===a.text.lastIndexOf(i.typeaheadBuffer,0)&&!e(a.index))return a.index;for(var o=(i.sortedIndexCursor+1)%r.length,s=-1;o!==i.sortedIndexCursor;){var l=r[o],c=0===l.text.lastIndexOf(i.typeaheadBuffer,0),d=!e(l.index);if(c&&d){s=o;break}o=(o+1)%r.length}return -1!==s?(i.sortedIndexCursor=s,r[i.sortedIndexCursor].index):-1}(a,l,e))||s||r(i),i}function n_(t){return t.typeaheadBuffer.length>0}function nb(t){t.typeaheadBuffer=""}function ny(t,e){var i=t.event,n=t.isTargetListItem,r=t.focusedItemIndex,a=t.focusItemAtIndex,o=t.sortedIndexByFirstChar,s=t.isItemAtIndexDisabled,l="ArrowLeft"===np(i),c="ArrowUp"===np(i),d="ArrowRight"===np(i),u="ArrowDown"===np(i),h="Home"===np(i),p="End"===np(i),m="Enter"===np(i),f="Spacebar"===np(i);if(l||c||d||u||h||p||m)return -1;if(!f&&1===i.key.length){nf(i);var g={focusItemAtIndex:a,focusedItemIndex:r,nextChar:i.key.toLowerCase(),sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:s};return ng(g,e)}if(!f)return -1;if(n&&nf(i),n&&n_(e)){var g={focusItemAtIndex:a,focusedItemIndex:r,nextChar:" ",sortedIndexByFirstChar:o,skipFocus:!1,isItemAtIndexDisabled:s};return ng(g,e)}return -1}var nv=function(t){function e(i){var n=t.call(this,nr(nr({},e.defaultAdapter),i))||this;return n.wrapFocus_=!1,n.isVertical_=!0,n.isSingleSelectionList_=!1,n.selectedIndex_=ns.UNSET_INDEX,n.focusedItemIndex=ns.UNSET_INDEX,n.useActivatedClass_=!1,n.useSelectedAttr_=!1,n.ariaCurrentAttrValue_=null,n.isCheckboxList_=!1,n.isRadioList_=!1,n.hasTypeahead=!1,n.typeaheadState={bufferClearTimeout:0,currentFirstChar:"",sortedIndexCursor:0,typeaheadBuffer:""},n.sortedIndexByFirstChar=new Map,n}return nn(e,t),Object.defineProperty(e,"strings",{get:function(){return no},enumerable:!0,configurable:!0}),Object.defineProperty(e,"cssClasses",{get:function(){return na},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return ns},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassForElementIndex:function(){},focusItemAtIndex:function(){},getAttributeForElementIndex:function(){return null},getFocusedElementIndex:function(){return 0},getListItemCount:function(){return 0},hasCheckboxAtIndex:function(){return!1},hasRadioAtIndex:function(){return!1},isCheckboxCheckedAtIndex:function(){return!1},isFocusInsideList:function(){return!1},isRootFocused:function(){return!1},listItemAtIndexHasClass:function(){return!1},notifyAction:function(){},removeClassForElementIndex:function(){},setAttributeForElementIndex:function(){},setCheckedCheckboxOrRadioAtIndex:function(){},setTabIndexForListItemChildren:function(){},getPrimaryTextAtIndex:function(){return""}}},enumerable:!0,configurable:!0}),e.prototype.layout=function(){0!==this.adapter.getListItemCount()&&(this.adapter.hasCheckboxAtIndex(0)?this.isCheckboxList_=!0:this.adapter.hasRadioAtIndex(0)?this.isRadioList_=!0:this.maybeInitializeSingleSelection(),this.hasTypeahead&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex()))},e.prototype.setWrapFocus=function(t){this.wrapFocus_=t},e.prototype.setVerticalOrientation=function(t){this.isVertical_=t},e.prototype.setSingleSelection=function(t){this.isSingleSelectionList_=t,t&&this.maybeInitializeSingleSelection()},e.prototype.maybeInitializeSingleSelection=function(){for(var t=0;t<this.adapter.getListItemCount();t++){var e=this.adapter.listItemAtIndexHasClass(t,na.LIST_ITEM_SELECTED_CLASS),i=this.adapter.listItemAtIndexHasClass(t,na.LIST_ITEM_ACTIVATED_CLASS);if(e||i){i&&this.setUseActivatedClass(!0),this.isSingleSelectionList_=!0,this.selectedIndex_=t;return}}},e.prototype.setHasTypeahead=function(t){this.hasTypeahead=t,t&&(this.sortedIndexByFirstChar=this.typeaheadInitSortedIndex())},e.prototype.isTypeaheadInProgress=function(){return this.hasTypeahead&&n_(this.typeaheadState)},e.prototype.setUseActivatedClass=function(t){this.useActivatedClass_=t},e.prototype.setUseSelectedAttribute=function(t){this.useSelectedAttr_=t},e.prototype.getSelectedIndex=function(){return this.selectedIndex_},e.prototype.setSelectedIndex=function(t){this.isIndexValid_(t)&&(this.isCheckboxList_?this.setCheckboxAtIndex_(t):this.isRadioList_?this.setRadioAtIndex_(t):this.setSingleSelectionAtIndex_(t))},e.prototype.handleFocusIn=function(t,e){e>=0&&(this.focusedItemIndex=e,this.adapter.setAttributeForElementIndex(e,"tabindex","0"),this.adapter.setTabIndexForListItemChildren(e,"0"))},e.prototype.handleFocusOut=function(t,e){var i=this;e>=0&&(this.adapter.setAttributeForElementIndex(e,"tabindex","-1"),this.adapter.setTabIndexForListItemChildren(e,"-1")),setTimeout(function(){i.adapter.isFocusInsideList()||i.setTabindexToFirstSelectedOrFocusedItem()},0)},e.prototype.handleKeydown=function(t,e,i){var n=this,r="ArrowLeft"===np(t),a="ArrowUp"===np(t),o="ArrowRight"===np(t),s="ArrowDown"===np(t),l="Home"===np(t),c="End"===np(t),d="Enter"===np(t),u="Spacebar"===np(t),h="A"===t.key||"a"===t.key;if(this.adapter.isRootFocused()){if(a||c?(t.preventDefault(),this.focusLastElement()):(s||l)&&(t.preventDefault(),this.focusFirstElement()),this.hasTypeahead){var p={event:t,focusItemAtIndex:function(t){n.focusItemAtIndex(t)},focusedItemIndex:-1,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return n.adapter.listItemAtIndexHasClass(t,na.LIST_ITEM_DISABLED_CLASS)}};ny(p,this.typeaheadState)}return}var m=this.adapter.getFocusedElementIndex();if(-1!==m||!((m=i)<0)){if(this.isVertical_&&s||!this.isVertical_&&o)nf(t),this.focusNextElement(m);else if(this.isVertical_&&a||!this.isVertical_&&r)nf(t),this.focusPrevElement(m);else if(l)nf(t),this.focusFirstElement();else if(c)nf(t),this.focusLastElement();else if(h&&t.ctrlKey&&this.isCheckboxList_)t.preventDefault(),this.toggleAll(this.selectedIndex_===ns.UNSET_INDEX?[]:this.selectedIndex_);else if((d||u)&&e){var f=t.target;if(f&&"A"===f.tagName&&d||(nf(t),this.adapter.listItemAtIndexHasClass(m,na.LIST_ITEM_DISABLED_CLASS)))return;this.isTypeaheadInProgress()||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(m),this.adapter.notifyAction(m))}if(this.hasTypeahead){var p={event:t,focusItemAtIndex:function(t){n.focusItemAtIndex(t)},focusedItemIndex:this.focusedItemIndex,isTargetListItem:e,sortedIndexByFirstChar:this.sortedIndexByFirstChar,isItemAtIndexDisabled:function(t){return n.adapter.listItemAtIndexHasClass(t,na.LIST_ITEM_DISABLED_CLASS)}};ny(p,this.typeaheadState)}}},e.prototype.handleClick=function(t,e){t!==ns.UNSET_INDEX&&(this.adapter.listItemAtIndexHasClass(t,na.LIST_ITEM_DISABLED_CLASS)||(this.isSelectableList_()&&this.setSelectedIndexOnAction_(t,e),this.adapter.notifyAction(t)))},e.prototype.focusNextElement=function(t){var e=this.adapter.getListItemCount(),i=t+1;if(i>=e)if(!this.wrapFocus_)return t;else i=0;return this.focusItemAtIndex(i),i},e.prototype.focusPrevElement=function(t){var e=t-1;if(e<0)if(!this.wrapFocus_)return t;else e=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(e),e},e.prototype.focusFirstElement=function(){return this.focusItemAtIndex(0),0},e.prototype.focusLastElement=function(){var t=this.adapter.getListItemCount()-1;return this.focusItemAtIndex(t),t},e.prototype.focusInitialElement=function(){var t=this.getFirstSelectedOrFocusedItemIndex();return this.focusItemAtIndex(t),t},e.prototype.setEnabled=function(t,e){this.isIndexValid_(t)&&(e?(this.adapter.removeClassForElementIndex(t,na.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,no.ARIA_DISABLED,"false")):(this.adapter.addClassForElementIndex(t,na.LIST_ITEM_DISABLED_CLASS),this.adapter.setAttributeForElementIndex(t,no.ARIA_DISABLED,"true")))},e.prototype.setSingleSelectionAtIndex_=function(t){if(this.selectedIndex_!==t){var e=na.LIST_ITEM_SELECTED_CLASS;this.useActivatedClass_&&(e=na.LIST_ITEM_ACTIVATED_CLASS),this.selectedIndex_!==ns.UNSET_INDEX&&this.adapter.removeClassForElementIndex(this.selectedIndex_,e),this.setAriaForSingleSelectionAtIndex_(t),this.setTabindexAtIndex(t),t!==ns.UNSET_INDEX&&this.adapter.addClassForElementIndex(t,e),this.selectedIndex_=t}},e.prototype.setAriaForSingleSelectionAtIndex_=function(t){this.selectedIndex_===ns.UNSET_INDEX&&(this.ariaCurrentAttrValue_=this.adapter.getAttributeForElementIndex(t,no.ARIA_CURRENT));var e=null!==this.ariaCurrentAttrValue_,i=e?no.ARIA_CURRENT:no.ARIA_SELECTED;if(this.selectedIndex_!==ns.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,i,"false"),t!==ns.UNSET_INDEX){var n=e?this.ariaCurrentAttrValue_:"true";this.adapter.setAttributeForElementIndex(t,i,n)}},e.prototype.getSelectionAttribute=function(){return this.useSelectedAttr_?no.ARIA_SELECTED:no.ARIA_CHECKED},e.prototype.setRadioAtIndex_=function(t){var e=this.getSelectionAttribute();this.adapter.setCheckedCheckboxOrRadioAtIndex(t,!0),this.selectedIndex_!==ns.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(this.selectedIndex_,e,"false"),this.adapter.setAttributeForElementIndex(t,e,"true"),this.selectedIndex_=t},e.prototype.setCheckboxAtIndex_=function(t){for(var e=this.getSelectionAttribute(),i=0;i<this.adapter.getListItemCount();i++){var n=!1;t.indexOf(i)>=0&&(n=!0),this.adapter.setCheckedCheckboxOrRadioAtIndex(i,n),this.adapter.setAttributeForElementIndex(i,e,n?"true":"false")}this.selectedIndex_=t},e.prototype.setTabindexAtIndex=function(t){this.focusedItemIndex===ns.UNSET_INDEX&&0!==t?this.adapter.setAttributeForElementIndex(0,"tabindex","-1"):this.focusedItemIndex>=0&&this.focusedItemIndex!==t&&this.adapter.setAttributeForElementIndex(this.focusedItemIndex,"tabindex","-1"),this.selectedIndex_ instanceof Array||this.selectedIndex_===t||this.adapter.setAttributeForElementIndex(this.selectedIndex_,"tabindex","-1"),t!==ns.UNSET_INDEX&&this.adapter.setAttributeForElementIndex(t,"tabindex","0")},e.prototype.isSelectableList_=function(){return this.isSingleSelectionList_||this.isCheckboxList_||this.isRadioList_},e.prototype.setTabindexToFirstSelectedOrFocusedItem=function(){var t=this.getFirstSelectedOrFocusedItemIndex();this.setTabindexAtIndex(t)},e.prototype.getFirstSelectedOrFocusedItemIndex=function(){var t=this.focusedItemIndex>=0?this.focusedItemIndex:0;return this.isSelectableList_()&&("number"==typeof this.selectedIndex_&&this.selectedIndex_!==ns.UNSET_INDEX?t=this.selectedIndex_:this.selectedIndex_ instanceof Array&&this.selectedIndex_.length>0&&(t=this.selectedIndex_.reduce(function(t,e){return Math.min(t,e)}))),t},e.prototype.isIndexValid_=function(t){var e=this;if(t instanceof Array){if(!this.isCheckboxList_)throw Error("MDCListFoundation: Array of index is only supported for checkbox based list");return 0===t.length||t.some(function(t){return e.isIndexInRange_(t)})}if("number"!=typeof t)return!1;if(this.isCheckboxList_)throw Error("MDCListFoundation: Expected array of index for checkbox based list but got number: "+t);return this.isIndexInRange_(t)||this.isSingleSelectionList_&&t===ns.UNSET_INDEX},e.prototype.isIndexInRange_=function(t){var e=this.adapter.getListItemCount();return t>=0&&t<e},e.prototype.setSelectedIndexOnAction_=function(t,e){void 0===e&&(e=!0),this.isCheckboxList_?this.toggleCheckboxAtIndex_(t,e):this.setSelectedIndex(t)},e.prototype.toggleCheckboxAtIndex_=function(t,e){var i=this.getSelectionAttribute(),n=this.adapter.isCheckboxCheckedAtIndex(t);e&&(n=!n,this.adapter.setCheckedCheckboxOrRadioAtIndex(t,n)),this.adapter.setAttributeForElementIndex(t,i,n?"true":"false");var r=this.selectedIndex_===ns.UNSET_INDEX?[]:this.selectedIndex_.slice();n?r.push(t):r=r.filter(function(e){return e!==t}),this.selectedIndex_=r},e.prototype.focusItemAtIndex=function(t){this.adapter.focusItemAtIndex(t),this.focusedItemIndex=t},e.prototype.toggleAll=function(t){var e=this.adapter.getListItemCount();if(t.length===e)this.setCheckboxAtIndex_([]);else{for(var i=[],n=0;n<e;n++)(!this.adapter.listItemAtIndexHasClass(n,na.LIST_ITEM_DISABLED_CLASS)||t.indexOf(n)>-1)&&i.push(n);this.setCheckboxAtIndex_(i)}},e.prototype.typeaheadMatchItem=function(t,e,i){var n=this;return void 0===i&&(i=!1),ng({focusItemAtIndex:function(t){n.focusItemAtIndex(t)},focusedItemIndex:e||this.focusedItemIndex,nextChar:t,sortedIndexByFirstChar:this.sortedIndexByFirstChar,skipFocus:i,isItemAtIndexDisabled:function(t){return n.adapter.listItemAtIndexHasClass(t,na.LIST_ITEM_DISABLED_CLASS)}},this.typeaheadState)},e.prototype.typeaheadInitSortedIndex=function(){return function(t,e){for(var i=new Map,n=0;n<t;n++){var r=e(n).trim();if(r){var a=r[0].toLowerCase();i.has(a)||i.set(a,[]),i.get(a).push({text:r.toLowerCase(),index:n})}}return i.forEach(function(t){t.sort(function(t,e){return t.index-e.index})}),i}(this.adapter.getListItemCount(),this.adapter.getPrimaryTextAtIndex)},e.prototype.clearTypeaheadBuffer=function(){nb(this.typeaheadState)},e}(eS),nx=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nn(e,t),Object.defineProperty(e.prototype,"vertical",{set:function(t){this.foundation.setVerticalOrientation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"listElements",{get:function(){return[].slice.call(this.root.querySelectorAll("."+na.LIST_ITEM_CLASS))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{set:function(t){this.foundation.setWrapFocus(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return this.foundation.isTypeaheadInProgress()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.foundation.setHasTypeahead(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.foundation.setSingleSelection(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){this.handleClick_=this.handleClickEvent_.bind(this),this.handleKeydown_=this.handleKeydownEvent_.bind(this),this.focusInEventListener_=this.handleFocusInEvent_.bind(this),this.focusOutEventListener_=this.handleFocusOutEvent_.bind(this),this.listen("keydown",this.handleKeydown_),this.listen("click",this.handleClick_),this.listen("focusin",this.focusInEventListener_),this.listen("focusout",this.focusOutEventListener_),this.layout(),this.initializeListType()},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten("click",this.handleClick_),this.unlisten("focusin",this.focusInEventListener_),this.unlisten("focusout",this.focusOutEventListener_)},e.prototype.layout=function(){var t=this.root.getAttribute(no.ARIA_ORIENTATION);this.vertical=t!==no.ARIA_ORIENTATION_HORIZONTAL,[].slice.call(this.root.querySelectorAll(".mdc-list-item:not([tabindex])")).forEach(function(t){t.setAttribute("tabindex","-1")}),[].slice.call(this.root.querySelectorAll(no.FOCUSABLE_CHILD_ELEMENTS)).forEach(function(t){return t.setAttribute("tabindex","-1")}),this.foundation.layout()},e.prototype.getPrimaryText=function(t){var e=t.querySelector("."+na.LIST_ITEM_PRIMARY_TEXT_CLASS);if(e)return e.textContent||"";var i=t.querySelector("."+na.LIST_ITEM_TEXT_CLASS);return i&&i.textContent||""},e.prototype.initializeListType=function(){var t=this,e=this.root.querySelectorAll(no.ARIA_ROLE_CHECKBOX_SELECTOR),i=this.root.querySelector(no.ARIA_CHECKED_RADIO_SELECTOR);if(e.length){var n=this.root.querySelectorAll(no.ARIA_CHECKED_CHECKBOX_SELECTOR);this.selectedIndex=[].map.call(n,function(e){return t.listElements.indexOf(e)})}else i&&(this.selectedIndex=this.listElements.indexOf(i))},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.typeaheadMatchItem=function(t,e){return this.foundation.typeaheadMatchItem(t,e,!0)},e.prototype.getDefaultFoundation=function(){var t=this;return new nv({addClassForElementIndex:function(e,i){var n=t.listElements[e];n&&n.classList.add(i)},focusItemAtIndex:function(e){var i=t.listElements[e];i&&i.focus()},getAttributeForElementIndex:function(e,i){return t.listElements[e].getAttribute(i)},getFocusedElementIndex:function(){return t.listElements.indexOf(document.activeElement)},getListItemCount:function(){return t.listElements.length},getPrimaryTextAtIndex:function(e){return t.getPrimaryText(t.listElements[e])},hasCheckboxAtIndex:function(e){return!!t.listElements[e].querySelector(no.CHECKBOX_SELECTOR)},hasRadioAtIndex:function(e){return!!t.listElements[e].querySelector(no.RADIO_SELECTOR)},isCheckboxCheckedAtIndex:function(e){return t.listElements[e].querySelector(no.CHECKBOX_SELECTOR).checked},isFocusInsideList:function(){return t.root!==document.activeElement&&t.root.contains(document.activeElement)},isRootFocused:function(){return document.activeElement===t.root},listItemAtIndexHasClass:function(e,i){return t.listElements[e].classList.contains(i)},notifyAction:function(e){t.emit(no.ACTION_EVENT,{index:e},!0)},removeClassForElementIndex:function(e,i){var n=t.listElements[e];n&&n.classList.remove(i)},setAttributeForElementIndex:function(e,i,n){var r=t.listElements[e];r&&r.setAttribute(i,n)},setCheckedCheckboxOrRadioAtIndex:function(e,i){var n=t.listElements[e].querySelector(no.CHECKBOX_RADIO_SELECTOR);n.checked=i;var r=document.createEvent("Event");r.initEvent("change",!0,!0),n.dispatchEvent(r)},setTabIndexForListItemChildren:function(e,i){var n=t.listElements[e];[].slice.call(n.querySelectorAll(no.CHILD_ELEMENTS_TO_TOGGLE_TABINDEX)).forEach(function(t){return t.setAttribute("tabindex",i)})}})},e.prototype.getListItemIndex_=function(t){var e=eM(t.target,"."+na.LIST_ITEM_CLASS+", ."+na.ROOT);return e&&eP(e,"."+na.LIST_ITEM_CLASS)?this.listElements.indexOf(e):-1},e.prototype.handleFocusInEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation.handleFocusIn(t,e)},e.prototype.handleFocusOutEvent_=function(t){var e=this.getListItemIndex_(t);this.foundation.handleFocusOut(t,e)},e.prototype.handleKeydownEvent_=function(t){var e=this.getListItemIndex_(t),i=t.target;this.foundation.handleKeydown(t,i.classList.contains(na.LIST_ITEM_CLASS),e)},e.prototype.handleClickEvent_=function(t){var e=this.getListItemIndex_(t),i=!eP(t.target,no.CHECKBOX_RADIO_SELECTOR);this.foundation.handleClick(e,i)},e}(ez),nw=function(t,e){return(nw=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function nk(t,e){function i(){this.constructor=t}nw(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var nE=function(){return(nE=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nC=function(t){function e(i){var n=t.call(this,nE(nE({},e.defaultAdapter),i))||this;return n.isSurfaceOpen=!1,n.isQuickOpen=!1,n.isHoistedElement=!1,n.isFixedPosition=!1,n.openAnimationEndTimerId=0,n.closeAnimationEndTimerId=0,n.animationRequestId=0,n.anchorCorner=l.TOP_START,n.originCorner=l.TOP_START,n.anchorMargin={top:0,right:0,bottom:0,left:0},n.position={x:0,y:0},n}return nk(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return i6},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return i7},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return i8},enumerable:!0,configurable:!0}),Object.defineProperty(e,"Corner",{get:function(){return l},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},hasAnchor:function(){return!1},isElementInContainer:function(){return!1},isFocused:function(){return!1},isRtl:function(){return!1},getInnerDimensions:function(){return{height:0,width:0}},getAnchorDimensions:function(){return null},getWindowDimensions:function(){return{height:0,width:0}},getBodyDimensions:function(){return{height:0,width:0}},getWindowScroll:function(){return{x:0,y:0}},setPosition:function(){},setMaxHeight:function(){},setTransformOrigin:function(){},saveFocus:function(){},restoreFocus:function(){},notifyClose:function(){},notifyOpen:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=e.cssClasses,i=t.ROOT,n=t.OPEN;if(!this.adapter.hasClass(i))throw Error(i+" class required in root element.");this.adapter.hasClass(n)&&(this.isSurfaceOpen=!0)},e.prototype.destroy=function(){clearTimeout(this.openAnimationEndTimerId),clearTimeout(this.closeAnimationEndTimerId),cancelAnimationFrame(this.animationRequestId)},e.prototype.setAnchorCorner=function(t){this.anchorCorner=t},e.prototype.flipCornerHorizontally=function(){this.originCorner=this.originCorner^a.RIGHT},e.prototype.setAnchorMargin=function(t){this.anchorMargin.top=t.top||0,this.anchorMargin.right=t.right||0,this.anchorMargin.bottom=t.bottom||0,this.anchorMargin.left=t.left||0},e.prototype.setIsHoisted=function(t){this.isHoistedElement=t},e.prototype.setFixedPosition=function(t){this.isFixedPosition=t},e.prototype.setAbsolutePosition=function(t,e){this.position.x=this.isFinite(t)?t:0,this.position.y=this.isFinite(e)?e:0},e.prototype.setQuickOpen=function(t){this.isQuickOpen=t},e.prototype.isOpen=function(){return this.isSurfaceOpen},e.prototype.open=function(){var t=this;this.isSurfaceOpen||(this.adapter.saveFocus(),this.isQuickOpen?(this.isSurfaceOpen=!0,this.adapter.addClass(e.cssClasses.OPEN),this.dimensions=this.adapter.getInnerDimensions(),this.autoposition(),this.adapter.notifyOpen()):(this.adapter.addClass(e.cssClasses.ANIMATING_OPEN),this.animationRequestId=requestAnimationFrame(function(){t.adapter.addClass(e.cssClasses.OPEN),t.dimensions=t.adapter.getInnerDimensions(),t.autoposition(),t.openAnimationEndTimerId=setTimeout(function(){t.openAnimationEndTimerId=0,t.adapter.removeClass(e.cssClasses.ANIMATING_OPEN),t.adapter.notifyOpen()},i8.TRANSITION_OPEN_DURATION)}),this.isSurfaceOpen=!0))},e.prototype.close=function(t){var i=this;void 0===t&&(t=!1),this.isSurfaceOpen&&(this.isQuickOpen?(this.isSurfaceOpen=!1,t||this.maybeRestoreFocus(),this.adapter.removeClass(e.cssClasses.OPEN),this.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),this.adapter.notifyClose()):(this.adapter.addClass(e.cssClasses.ANIMATING_CLOSED),requestAnimationFrame(function(){i.adapter.removeClass(e.cssClasses.OPEN),i.adapter.removeClass(e.cssClasses.IS_OPEN_BELOW),i.closeAnimationEndTimerId=setTimeout(function(){i.closeAnimationEndTimerId=0,i.adapter.removeClass(e.cssClasses.ANIMATING_CLOSED),i.adapter.notifyClose()},i8.TRANSITION_CLOSE_DURATION)}),this.isSurfaceOpen=!1,t||this.maybeRestoreFocus()))},e.prototype.handleBodyClick=function(t){var e=t.target;this.adapter.isElementInContainer(e)||this.close()},e.prototype.handleKeydown=function(t){var e=t.keyCode;("Escape"===t.key||27===e)&&this.close()},e.prototype.autoposition=function(){this.measurements=this.getAutoLayoutmeasurements();var t,i=this.getoriginCorner(),n=this.getMenuSurfaceMaxHeight(i),r=this.hasBit(i,a.BOTTOM)?"bottom":"top",o=this.hasBit(i,a.RIGHT)?"right":"left",s=this.getHorizontalOriginOffset(i),l=this.getVerticalOriginOffset(i),c=this.measurements,d=c.anchorSize,u=c.surfaceSize,h=((t={})[o]=s,t[r]=l,t);d.width/u.width>i8.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO&&(o="center"),(this.isHoistedElement||this.isFixedPosition)&&this.adjustPositionForHoistedElement(h),this.adapter.setTransformOrigin(o+" "+r),this.adapter.setPosition(h),this.adapter.setMaxHeight(n?n+"px":""),this.hasBit(i,a.BOTTOM)||this.adapter.addClass(e.cssClasses.IS_OPEN_BELOW)},e.prototype.getAutoLayoutmeasurements=function(){var t=this.adapter.getAnchorDimensions(),e=this.adapter.getBodyDimensions(),i=this.adapter.getWindowDimensions(),n=this.adapter.getWindowScroll();return t||(t={top:this.position.y,right:this.position.x,bottom:this.position.y,left:this.position.x,width:0,height:0}),{anchorSize:t,bodySize:e,surfaceSize:this.dimensions,viewportDistance:{top:t.top,right:i.width-t.right,bottom:i.height-t.bottom,left:t.left},viewportSize:i,windowScroll:n}},e.prototype.getoriginCorner=function(){var t,i,n,r,o=this.originCorner,s=this.measurements,l=s.viewportDistance,c=s.anchorSize,d=s.surfaceSize,u=e.numbers.MARGIN_TO_EDGE;this.hasBit(this.anchorCorner,a.BOTTOM)?(t=l.top-u+c.height+this.anchorMargin.bottom,i=l.bottom-u-this.anchorMargin.bottom):(t=l.top-u+this.anchorMargin.top,i=l.bottom-u+c.height-this.anchorMargin.top),!(i-d.height>0)&&t>=i&&(o=this.setBit(o,a.BOTTOM));var h=this.adapter.isRtl(),p=this.hasBit(this.anchorCorner,a.FLIP_RTL),m=this.hasBit(this.anchorCorner,a.RIGHT)||this.hasBit(o,a.RIGHT),f=!1;(f=h&&p?!m:m)?(n=l.left+c.width+this.anchorMargin.right,r=l.right-this.anchorMargin.right):(n=l.left+this.anchorMargin.left,r=l.right+c.width-this.anchorMargin.left);var g=n-d.width>0,_=r-d.width>0,b=this.hasBit(o,a.FLIP_RTL)&&this.hasBit(o,a.RIGHT);return _&&b&&h||!g&&b?o=this.unsetBit(o,a.RIGHT):(g&&f&&h||g&&!f&&m||!_&&n>=r)&&(o=this.setBit(o,a.RIGHT)),o},e.prototype.getMenuSurfaceMaxHeight=function(t){var i=this.measurements.viewportDistance,n=0,r=this.hasBit(t,a.BOTTOM),o=this.hasBit(this.anchorCorner,a.BOTTOM),s=e.numbers.MARGIN_TO_EDGE;return r?(n=i.top+this.anchorMargin.top-s,o||(n+=this.measurements.anchorSize.height)):(n=i.bottom-this.anchorMargin.bottom+this.measurements.anchorSize.height-s,o&&(n-=this.measurements.anchorSize.height)),n},e.prototype.getHorizontalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,a.RIGHT),n=this.hasBit(this.anchorCorner,a.RIGHT);if(i){var r=n?e.width-this.anchorMargin.left:this.anchorMargin.right;return this.isHoistedElement||this.isFixedPosition?r-(this.measurements.viewportSize.width-this.measurements.bodySize.width):r}return n?e.width-this.anchorMargin.right:this.anchorMargin.left},e.prototype.getVerticalOriginOffset=function(t){var e=this.measurements.anchorSize,i=this.hasBit(t,a.BOTTOM),n=this.hasBit(this.anchorCorner,a.BOTTOM);return i?n?e.height-this.anchorMargin.top:-this.anchorMargin.bottom:n?e.height+this.anchorMargin.bottom:this.anchorMargin.top},e.prototype.adjustPositionForHoistedElement=function(t){var e,i,n=this.measurements,r=n.windowScroll,a=n.viewportDistance,o=Object.keys(t);try{for(var s=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(o),l=s.next();!l.done;l=s.next()){var c=l.value,d=t[c]||0;d+=a[c],this.isFixedPosition||("top"===c?d+=r.y:"bottom"===c?d-=r.y:"left"===c?d+=r.x:d-=r.x),t[c]=d}}catch(t){e={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}},e.prototype.maybeRestoreFocus=function(){var t=this.adapter.isFocused(),e=document.activeElement&&this.adapter.isElementInContainer(document.activeElement);(t||e)&&this.adapter.restoreFocus()},e.prototype.hasBit=function(t,e){return!!(t&e)},e.prototype.setBit=function(t,e){return t|e},e.prototype.unsetBit=function(t,e){return t^e},e.prototype.isFinite=function(t){return"number"==typeof t&&isFinite(t)},e}(eS),nA=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nk(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root.parentElement;this.anchorElement=e&&e.classList.contains(i6.ANCHOR)?e:null,this.root.classList.contains(i6.FIXED)&&this.setFixedPosition(!0),this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleBodyClick=function(e){t.foundation.handleBodyClick(e)},this.registerBodyClickListener=function(){document.body.addEventListener("click",t.handleBodyClick,{capture:!0})},this.deregisterBodyClickListener=function(){document.body.removeEventListener("click",t.handleBodyClick,{capture:!0})},this.listen("keydown",this.handleKeydown),this.listen(i7.OPENED_EVENT,this.registerBodyClickListener),this.listen(i7.CLOSED_EVENT,this.deregisterBodyClickListener)},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown),this.unlisten(i7.OPENED_EVENT,this.registerBodyClickListener),this.unlisten(i7.CLOSED_EVENT,this.deregisterBodyClickListener),t.prototype.destroy.call(this)},e.prototype.isOpen=function(){return this.foundation.isOpen()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=!1),this.foundation.close(t)},Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.foundation.setQuickOpen(t)},enumerable:!0,configurable:!0}),e.prototype.setIsHoisted=function(t){this.foundation.setIsHoisted(t)},e.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},e.prototype.setFixedPosition=function(t){t?this.root.classList.add(i6.FIXED):this.root.classList.remove(i6.FIXED),this.foundation.setFixedPosition(t)},e.prototype.setAbsolutePosition=function(t,e){this.foundation.setAbsolutePosition(t,e),this.setIsHoisted(!0)},e.prototype.setAnchorCorner=function(t){this.foundation.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.foundation.setAnchorMargin(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new nC({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(nC.strings.CLOSED_EVENT,{})},notifyOpen:function(){return t.emit(nC.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root).getPropertyValue("direction")},setTransformOrigin:function(e){var i,n,r=(i=window,void 0===n&&(n=!1),(void 0===c||n)&&(c="transform"in i.document.createElement("div").style?"transform":"webkitTransform"),c+"-origin");t.root.style.setProperty(r,e)},isFocused:function(){return document.activeElement===t.root},saveFocus:function(){t.previousFocus=document.activeElement},restoreFocus:function(){t.root.contains(document.activeElement)&&t.previousFocus&&t.previousFocus.focus&&t.previousFocus.focus()},getInnerDimensions:function(){return{width:t.root.offsetWidth,height:t.root.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){var i=t.root;i.style.left="left"in e?e.left+"px":"",i.style.right="right"in e?e.right+"px":"",i.style.top="top"in e?e.top+"px":"",i.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root.style.maxHeight=e}})},e}(ez),nT={MENU_SELECTED_LIST_ITEM:"mdc-menu-item--selected",MENU_SELECTION_GROUP:"mdc-menu__selection-group",ROOT:"mdc-menu"},nI={ARIA_CHECKED_ATTR:"aria-checked",ARIA_DISABLED_ATTR:"aria-disabled",CHECKBOX_SELECTOR:'input[type="checkbox"]',LIST_SELECTOR:".mdc-list",SELECTED_EVENT:"MDCMenu:selected"},nS={FOCUS_ROOT_INDEX:-1};!function(t){t[t.NONE=0]="NONE",t[t.LIST_ROOT=1]="LIST_ROOT",t[t.FIRST_ITEM=2]="FIRST_ITEM",t[t.LAST_ITEM=3]="LAST_ITEM"}(d||(d={}));var nz=function(t){function e(i){var n=t.call(this,ne(ne({},e.defaultAdapter),i))||this;return n.closeAnimationEndTimerId_=0,n.defaultFocusState_=d.LIST_ROOT,n}return nt(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return nT},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nI},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return nS},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClassToElementAtIndex:function(){},removeClassFromElementAtIndex:function(){},addAttributeToElementAtIndex:function(){},removeAttributeFromElementAtIndex:function(){},elementContainsClass:function(){return!1},closeSurface:function(){},getElementIndex:function(){return -1},notifySelected:function(){},getMenuItemCount:function(){return 0},focusItemAtIndex:function(){},focusListRoot:function(){},getSelectedSiblingOfItemAtIndex:function(){return -1},isSelectableItemAtIndex:function(){return!1}}},enumerable:!0,configurable:!0}),e.prototype.destroy=function(){this.closeAnimationEndTimerId_&&clearTimeout(this.closeAnimationEndTimerId_),this.adapter.closeSurface()},e.prototype.handleKeydown=function(t){var e=t.key,i=t.keyCode;("Tab"===e||9===i)&&this.adapter.closeSurface(!0)},e.prototype.handleItemAction=function(t){var e=this,i=this.adapter.getElementIndex(t);i<0||(this.adapter.notifySelected({index:i}),this.adapter.closeSurface(),this.closeAnimationEndTimerId_=setTimeout(function(){var i=e.adapter.getElementIndex(t);i>=0&&e.adapter.isSelectableItemAtIndex(i)&&e.setSelectedIndex(i)},nC.numbers.TRANSITION_CLOSE_DURATION))},e.prototype.handleMenuSurfaceOpened=function(){switch(this.defaultFocusState_){case d.FIRST_ITEM:this.adapter.focusItemAtIndex(0);break;case d.LAST_ITEM:this.adapter.focusItemAtIndex(this.adapter.getMenuItemCount()-1);break;case d.NONE:break;default:this.adapter.focusListRoot()}},e.prototype.setDefaultFocusState=function(t){this.defaultFocusState_=t},e.prototype.setSelectedIndex=function(t){if(this.validatedIndex_(t),!this.adapter.isSelectableItemAtIndex(t))throw Error("MDCMenuFoundation: No selection group at specified index.");var e=this.adapter.getSelectedSiblingOfItemAtIndex(t);e>=0&&(this.adapter.removeAttributeFromElementAtIndex(e,nI.ARIA_CHECKED_ATTR),this.adapter.removeClassFromElementAtIndex(e,nT.MENU_SELECTED_LIST_ITEM)),this.adapter.addClassToElementAtIndex(t,nT.MENU_SELECTED_LIST_ITEM),this.adapter.addAttributeToElementAtIndex(t,nI.ARIA_CHECKED_ATTR,"true")},e.prototype.setEnabled=function(t,e){this.validatedIndex_(t),e?(this.adapter.removeClassFromElementAtIndex(t,na.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,nI.ARIA_DISABLED_ATTR,"false")):(this.adapter.addClassToElementAtIndex(t,na.LIST_ITEM_DISABLED_CLASS),this.adapter.addAttributeToElementAtIndex(t,nI.ARIA_DISABLED_ATTR,"true"))},e.prototype.validatedIndex_=function(t){var e=this.adapter.getMenuItemCount();if(!(t>=0&&t<e))throw Error("MDCMenuFoundation: No list item at specified index.")},e}(eS),nL=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nt(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e){void 0===t&&(t=function(t){return new nA(t)}),void 0===e&&(e=function(t){return new nx(t)}),this.menuSurfaceFactory_=t,this.listFactory_=e},e.prototype.initialSyncWithDOM=function(){var t=this;this.menuSurface_=this.menuSurfaceFactory_(this.root);var e=this.root.querySelector(nI.LIST_SELECTOR);e?(this.list_=this.listFactory_(e),this.list_.wrapFocus=!0):this.list_=null,this.handleKeydown_=function(e){return t.foundation.handleKeydown(e)},this.handleItemAction_=function(e){return t.foundation.handleItemAction(t.items[e.detail.index])},this.handleMenuSurfaceOpened_=function(){return t.foundation.handleMenuSurfaceOpened()},this.menuSurface_.listen(nC.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.listen("keydown",this.handleKeydown_),this.listen(nv.strings.ACTION_EVENT,this.handleItemAction_)},e.prototype.destroy=function(){this.list_&&this.list_.destroy(),this.menuSurface_.destroy(),this.menuSurface_.unlisten(nC.strings.OPENED_EVENT,this.handleMenuSurfaceOpened_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(nv.strings.ACTION_EVENT,this.handleItemAction_),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.menuSurface_.isOpen()},set:function(t){t?this.menuSurface_.open():this.menuSurface_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"wrapFocus",{get:function(){return!!this.list_&&this.list_.wrapFocus},set:function(t){this.list_&&(this.list_.wrapFocus=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasTypeahead",{set:function(t){this.list_&&(this.list_.hasTypeahead=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"typeaheadInProgress",{get:function(){return!!this.list_&&this.list_.typeaheadInProgress},enumerable:!0,configurable:!0}),e.prototype.typeaheadMatchItem=function(t,e){return this.list_?this.list_.typeaheadMatchItem(t,e):-1},e.prototype.layout=function(){this.list_&&this.list_.layout()},Object.defineProperty(e.prototype,"items",{get:function(){return this.list_?this.list_.listElements:[]},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"singleSelection",{set:function(t){this.list_&&(this.list_.singleSelection=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.list_?this.list_.selectedIndex:ns.UNSET_INDEX},set:function(t){this.list_&&(this.list_.selectedIndex=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.menuSurface_.quickOpen=t},enumerable:!0,configurable:!0}),e.prototype.setDefaultFocusState=function(t){this.foundation.setDefaultFocusState(t)},e.prototype.setAnchorCorner=function(t){this.menuSurface_.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.menuSurface_.setAnchorMargin(t)},e.prototype.setSelectedIndex=function(t){this.foundation.setSelectedIndex(t)},e.prototype.setEnabled=function(t,e){this.foundation.setEnabled(t,e)},e.prototype.getOptionByIndex=function(t){return t<this.items.length?this.items[t]:null},e.prototype.getPrimaryTextAtIndex=function(t){var e=this.getOptionByIndex(t);return e&&this.list_&&this.list_.getPrimaryText(e)||""},e.prototype.setFixedPosition=function(t){this.menuSurface_.setFixedPosition(t)},e.prototype.setIsHoisted=function(t){this.menuSurface_.setIsHoisted(t)},e.prototype.setAbsolutePosition=function(t,e){this.menuSurface_.setAbsolutePosition(t,e)},e.prototype.setAnchorElement=function(t){this.menuSurface_.anchorElement=t},e.prototype.getDefaultFoundation=function(){var t=this;return new nz({addClassToElementAtIndex:function(e,i){t.items[e].classList.add(i)},removeClassFromElementAtIndex:function(e,i){t.items[e].classList.remove(i)},addAttributeToElementAtIndex:function(e,i,n){t.items[e].setAttribute(i,n)},removeAttributeFromElementAtIndex:function(e,i){t.items[e].removeAttribute(i)},elementContainsClass:function(t,e){return t.classList.contains(e)},closeSurface:function(e){return t.menuSurface_.close(e)},getElementIndex:function(e){return t.items.indexOf(e)},notifySelected:function(e){return t.emit(nI.SELECTED_EVENT,{index:e.index,item:t.items[e.index]})},getMenuItemCount:function(){return t.items.length},focusItemAtIndex:function(e){return t.items[e].focus()},focusListRoot:function(){return t.root.querySelector(nI.LIST_SELECTOR).focus()},isSelectableItemAtIndex:function(e){return!!eM(t.items[e],"."+nT.MENU_SELECTION_GROUP)},getSelectedSiblingOfItemAtIndex:function(e){var i=eM(t.items[e],"."+nT.MENU_SELECTION_GROUP).querySelector("."+nT.MENU_SELECTED_LIST_ITEM);return i?t.items.indexOf(i):-1}})},e}(ez),nM={ACTIVATED:"mdc-select--activated",DISABLED:"mdc-select--disabled",FOCUSED:"mdc-select--focused",INVALID:"mdc-select--invalid",MENU_INVALID:"mdc-select__menu--invalid",OUTLINED:"mdc-select--outlined",REQUIRED:"mdc-select--required",ROOT:"mdc-select",WITH_LEADING_ICON:"mdc-select--with-leading-icon"},nP={ARIA_CONTROLS:"aria-controls",ARIA_DESCRIBEDBY:"aria-describedby",ARIA_SELECTED_ATTR:"aria-selected",CHANGE_EVENT:"MDCSelect:change",HIDDEN_INPUT_SELECTOR:'input[type="hidden"]',LABEL_SELECTOR:".mdc-floating-label",LEADING_ICON_SELECTOR:".mdc-select__icon",LINE_RIPPLE_SELECTOR:".mdc-line-ripple",MENU_SELECTOR:".mdc-select__menu",OUTLINE_SELECTOR:".mdc-notched-outline",SELECTED_TEXT_SELECTOR:".mdc-select__selected-text",SELECT_ANCHOR_SELECTOR:".mdc-select__anchor",VALUE_ATTR:"data-value"},nR={LABEL_SCALE:.75,UNSET_INDEX:-1,CLICK_DEBOUNCE_TIMEOUT_MS:330},nO=function(t){function e(i,n){void 0===n&&(n={});var r=t.call(this,i4(i4({},e.defaultAdapter),i))||this;return r.disabled=!1,r.isMenuOpen=!1,r.useDefaultValidation=!0,r.customValidity=!0,r.lastSelectedIndex=nR.UNSET_INDEX,r.clickDebounceTimeout=0,r.recentlyClicked=!1,r.leadingIcon=n.leadingIcon,r.helperText=n.helperText,r}return i3(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return nM},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return nR},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nP},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},activateBottomLine:function(){},deactivateBottomLine:function(){},getSelectedIndex:function(){return -1},setSelectedIndex:function(){},hasLabel:function(){return!1},floatLabel:function(){},getLabelWidth:function(){return 0},setLabelRequired:function(){},hasOutline:function(){return!1},notchOutline:function(){},closeOutline:function(){},setRippleCenter:function(){},notifyChange:function(){},setSelectedText:function(){},isSelectAnchorFocused:function(){return!1},getSelectAnchorAttr:function(){return""},setSelectAnchorAttr:function(){},removeSelectAnchorAttr:function(){},addMenuClass:function(){},removeMenuClass:function(){},openMenu:function(){},closeMenu:function(){},getAnchorElement:function(){return null},setMenuAnchorElement:function(){},setMenuAnchorCorner:function(){},setMenuWrapFocus:function(){},focusMenuItemAtIndex:function(){},getMenuItemCount:function(){return 0},getMenuItemValues:function(){return[]},getMenuItemTextAtIndex:function(){return""},isTypeaheadInProgress:function(){return!1},typeaheadMatchItem:function(){return -1}}},enumerable:!0,configurable:!0}),e.prototype.getSelectedIndex=function(){return this.adapter.getSelectedIndex()},e.prototype.setSelectedIndex=function(t,e,i){void 0===e&&(e=!1),void 0===i&&(i=!1),t>=this.adapter.getMenuItemCount()||(t===nR.UNSET_INDEX?this.adapter.setSelectedText(""):this.adapter.setSelectedText(this.adapter.getMenuItemTextAtIndex(t).trim()),this.adapter.setSelectedIndex(t),e&&this.adapter.closeMenu(),i||this.lastSelectedIndex===t||this.handleChange(),this.lastSelectedIndex=t)},e.prototype.setValue=function(t,e){void 0===e&&(e=!1);var i=this.adapter.getMenuItemValues().indexOf(t);this.setSelectedIndex(i,!1,e)},e.prototype.getValue=function(){var t=this.adapter.getSelectedIndex(),e=this.adapter.getMenuItemValues();return t!==nR.UNSET_INDEX?e[t]:""},e.prototype.getDisabled=function(){return this.disabled},e.prototype.setDisabled=function(t){this.disabled=t,this.disabled?(this.adapter.addClass(nM.DISABLED),this.adapter.closeMenu()):this.adapter.removeClass(nM.DISABLED),this.leadingIcon&&this.leadingIcon.setDisabled(this.disabled),this.disabled?this.adapter.removeSelectAnchorAttr("tabindex"):this.adapter.setSelectAnchorAttr("tabindex","0"),this.adapter.setSelectAnchorAttr("aria-disabled",this.disabled.toString())},e.prototype.openMenu=function(){this.adapter.addClass(nM.ACTIVATED),this.adapter.openMenu(),this.isMenuOpen=!0,this.adapter.setSelectAnchorAttr("aria-expanded","true")},e.prototype.setHelperTextContent=function(t){this.helperText&&this.helperText.setContent(t)},e.prototype.layout=function(){if(this.adapter.hasLabel()){var t=this.getValue().length>0,e=this.adapter.hasClass(nM.FOCUSED),i=t||e,n=this.adapter.hasClass(nM.REQUIRED);this.notchOutline(i),this.adapter.floatLabel(i),this.adapter.setLabelRequired(n)}},e.prototype.layoutOptions=function(){var t=this.adapter.getMenuItemValues().indexOf(this.getValue());this.setSelectedIndex(t,!1,!0)},e.prototype.handleMenuOpened=function(){if(0!==this.adapter.getMenuItemValues().length){var t=this.getSelectedIndex();this.adapter.focusMenuItemAtIndex(t>=0?t:0)}},e.prototype.handleMenuClosed=function(){this.adapter.removeClass(nM.ACTIVATED),this.isMenuOpen=!1,this.adapter.setSelectAnchorAttr("aria-expanded","false"),this.adapter.isSelectAnchorFocused()||this.blur()},e.prototype.handleChange=function(){this.layout(),this.adapter.notifyChange(this.getValue()),this.adapter.hasClass(nM.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},e.prototype.handleMenuItemAction=function(t){this.setSelectedIndex(t,!0)},e.prototype.handleFocus=function(){this.adapter.addClass(nM.FOCUSED),this.layout(),this.adapter.activateBottomLine()},e.prototype.handleBlur=function(){this.isMenuOpen||this.blur()},e.prototype.handleClick=function(t){if(!this.disabled&&!this.recentlyClicked){if(this.setClickDebounceTimeout(),this.isMenuOpen)return void this.adapter.closeMenu();this.adapter.setRippleCenter(t),this.openMenu()}},e.prototype.handleKeydown=function(t){if(!this.isMenuOpen&&this.adapter.hasClass(nM.FOCUSED)){var e=np(t)===nl.ENTER,i=np(t)===nl.SPACEBAR,n=np(t)===nl.ARROW_UP,r=np(t)===nl.ARROW_DOWN;if(!i&&t.key&&1===t.key.length||i&&this.adapter.isTypeaheadInProgress()){var a=i?" ":t.key,o=this.adapter.typeaheadMatchItem(a,this.getSelectedIndex());o>=0&&this.setSelectedIndex(o),t.preventDefault();return}(e||i||n||r)&&(n&&this.getSelectedIndex()>0?this.setSelectedIndex(this.getSelectedIndex()-1):r&&this.getSelectedIndex()<this.adapter.getMenuItemCount()-1&&this.setSelectedIndex(this.getSelectedIndex()+1),this.openMenu(),t.preventDefault())}},e.prototype.notchOutline=function(t){if(this.adapter.hasOutline()){var e=this.adapter.hasClass(nM.FOCUSED);if(t){var i=nR.LABEL_SCALE,n=this.adapter.getLabelWidth()*i;this.adapter.notchOutline(n)}else e||this.adapter.closeOutline()}},e.prototype.setLeadingIconAriaLabel=function(t){this.leadingIcon&&this.leadingIcon.setAriaLabel(t)},e.prototype.setLeadingIconContent=function(t){this.leadingIcon&&this.leadingIcon.setContent(t)},e.prototype.setUseDefaultValidation=function(t){this.useDefaultValidation=t},e.prototype.setValid=function(t){this.useDefaultValidation||(this.customValidity=t),this.adapter.setSelectAnchorAttr("aria-invalid",(!t).toString()),t?(this.adapter.removeClass(nM.INVALID),this.adapter.removeMenuClass(nM.MENU_INVALID)):(this.adapter.addClass(nM.INVALID),this.adapter.addMenuClass(nM.MENU_INVALID)),this.syncHelperTextValidity(t)},e.prototype.isValid=function(){return this.useDefaultValidation&&this.adapter.hasClass(nM.REQUIRED)&&!this.adapter.hasClass(nM.DISABLED)?this.getSelectedIndex()!==nR.UNSET_INDEX&&(0!==this.getSelectedIndex()||!!this.getValue()):this.customValidity},e.prototype.setRequired=function(t){t?this.adapter.addClass(nM.REQUIRED):this.adapter.removeClass(nM.REQUIRED),this.adapter.setSelectAnchorAttr("aria-required",t.toString()),this.adapter.setLabelRequired(t)},e.prototype.getRequired=function(){return"true"===this.adapter.getSelectAnchorAttr("aria-required")},e.prototype.init=function(){var t=this.adapter.getAnchorElement();t&&(this.adapter.setMenuAnchorElement(t),this.adapter.setMenuAnchorCorner(l.BOTTOM_START)),this.adapter.setMenuWrapFocus(!1),this.setDisabled(this.adapter.hasClass(nM.DISABLED)),this.syncHelperTextValidity(!this.adapter.hasClass(nM.INVALID)),this.layout(),this.layoutOptions()},e.prototype.blur=function(){this.adapter.removeClass(nM.FOCUSED),this.layout(),this.adapter.deactivateBottomLine(),this.adapter.hasClass(nM.REQUIRED)&&this.useDefaultValidation&&this.setValid(this.isValid())},e.prototype.syncHelperTextValidity=function(t){if(this.helperText){this.helperText.setValidity(t);var e=this.helperText.isVisible(),i=this.helperText.getId();e&&i?this.adapter.setSelectAnchorAttr(nP.ARIA_DESCRIBEDBY,i):this.adapter.removeSelectAnchorAttr(nP.ARIA_DESCRIBEDBY)}},e.prototype.setClickDebounceTimeout=function(){var t=this;clearTimeout(this.clickDebounceTimeout),this.clickDebounceTimeout=setTimeout(function(){t.recentlyClicked=!1},nR.CLICK_DEBOUNCE_TIMEOUT_MS),this.recentlyClicked=!0},e}(eS),nD={ARIA_HIDDEN:"aria-hidden",ROLE:"role"},nB={HELPER_TEXT_VALIDATION_MSG:"mdc-select-helper-text--validation-msg",HELPER_TEXT_VALIDATION_MSG_PERSISTENT:"mdc-select-helper-text--validation-msg-persistent"},nF=function(t){function e(i){return t.call(this,i4(i4({},e.defaultAdapter),i))||this}return i3(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return nB},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nD},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},removeClass:function(){},hasClass:function(){return!1},setAttr:function(){},getAttr:function(){return null},removeAttr:function(){},setContent:function(){}}},enumerable:!0,configurable:!0}),e.prototype.getId=function(){return this.adapter.getAttr("id")},e.prototype.isVisible=function(){return"true"!==this.adapter.getAttr(nD.ARIA_HIDDEN)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.setValidation=function(t){t?this.adapter.addClass(nB.HELPER_TEXT_VALIDATION_MSG):this.adapter.removeClass(nB.HELPER_TEXT_VALIDATION_MSG)},e.prototype.setValidationMsgPersistent=function(t){t?this.adapter.addClass(nB.HELPER_TEXT_VALIDATION_MSG_PERSISTENT):this.adapter.removeClass(nB.HELPER_TEXT_VALIDATION_MSG_PERSISTENT)},e.prototype.setValidity=function(t){if(this.adapter.hasClass(nB.HELPER_TEXT_VALIDATION_MSG)){var e=this.adapter.hasClass(nB.HELPER_TEXT_VALIDATION_MSG_PERSISTENT);if(!t||e){this.showToScreenReader(),t?this.adapter.removeAttr(nD.ROLE):this.adapter.setAttr(nD.ROLE,"alert");return}this.adapter.removeAttr(nD.ROLE),this.hide()}},e.prototype.showToScreenReader=function(){this.adapter.removeAttr(nD.ARIA_HIDDEN)},e.prototype.hide=function(){this.adapter.setAttr(nD.ARIA_HIDDEN,"true")},e}(eS),nN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i3(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new nF({addClass:function(e){return t.root.classList.add(e)},removeClass:function(e){return t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e}})},e}(ez),nV={ICON_EVENT:"MDCSelect:icon",ICON_ROLE:"button"},nU=["click","keydown"],n$=function(t){function e(i){var n=t.call(this,i4(i4({},e.defaultAdapter),i))||this;return n.savedTabIndex_=null,n.interactionHandler_=function(t){return n.handleInteraction(t)},n}return i3(e,t),Object.defineProperty(e,"strings",{get:function(){return nV},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{getAttr:function(){return null},setAttr:function(){},removeAttr:function(){},setContent:function(){},registerInteractionHandler:function(){},deregisterInteractionHandler:function(){},notifyIconAction:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this;this.savedTabIndex_=this.adapter.getAttr("tabindex"),nU.forEach(function(e){t.adapter.registerInteractionHandler(e,t.interactionHandler_)})},e.prototype.destroy=function(){var t=this;nU.forEach(function(e){t.adapter.deregisterInteractionHandler(e,t.interactionHandler_)})},e.prototype.setDisabled=function(t){this.savedTabIndex_&&(t?(this.adapter.setAttr("tabindex","-1"),this.adapter.removeAttr("role")):(this.adapter.setAttr("tabindex",this.savedTabIndex_),this.adapter.setAttr("role",nV.ICON_ROLE)))},e.prototype.setAriaLabel=function(t){this.adapter.setAttr("aria-label",t)},e.prototype.setContent=function(t){this.adapter.setContent(t)},e.prototype.handleInteraction=function(t){var e="Enter"===t.key||13===t.keyCode;("click"===t.type||e)&&this.adapter.notifyIconAction()},e}(eS),nj=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i3(e,t),e.attachTo=function(t){return new e(t)},Object.defineProperty(e.prototype,"foundationForSelect",{get:function(){return this.foundation},enumerable:!0,configurable:!0}),e.prototype.getDefaultFoundation=function(){var t=this;return new n$({getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)},removeAttr:function(e){return t.root.removeAttribute(e)},setContent:function(e){t.root.textContent=e},registerInteractionHandler:function(e,i){return t.listen(e,i)},deregisterInteractionHandler:function(e,i){return t.unlisten(e,i)},notifyIconAction:function(){return t.emit(n$.strings.ICON_EVENT,{},!0)}})},e}(ez),nH=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i3(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t,e,i,n,r,a){if(void 0===t&&(t=function(t){return new eN(t)}),void 0===e&&(e=function(t){return new eq(t)}),void 0===i&&(i=function(t){return new eQ(t)}),void 0===n&&(n=function(t){return new nL(t)}),void 0===r&&(r=function(t){return new nj(t)}),void 0===a&&(a=function(t){return new nN(t)}),this.selectAnchor=this.root.querySelector(nP.SELECT_ANCHOR_SELECTOR),this.selectedText=this.root.querySelector(nP.SELECTED_TEXT_SELECTOR),this.hiddenInput=this.root.querySelector(nP.HIDDEN_INPUT_SELECTOR),!this.selectedText)throw Error("MDCSelect: Missing required element: The following selector must be present: '"+nP.SELECTED_TEXT_SELECTOR+"'");if(this.selectAnchor.hasAttribute(nP.ARIA_CONTROLS)){var o=document.getElementById(this.selectAnchor.getAttribute(nP.ARIA_CONTROLS));o&&(this.helperText=a(o))}this.menuSetup(n);var s=this.root.querySelector(nP.LABEL_SELECTOR);this.label=s?t(s):null;var l=this.root.querySelector(nP.LINE_RIPPLE_SELECTOR);this.lineRipple=l?e(l):null;var c=this.root.querySelector(nP.OUTLINE_SELECTOR);this.outline=c?i(c):null;var d=this.root.querySelector(nP.LEADING_ICON_SELECTOR);d&&(this.leadingIcon=r(d)),this.root.classList.contains(nM.OUTLINED)||(this.ripple=this.createRipple())},e.prototype.initialSyncWithDOM=function(){var t=this;if(this.handleFocus=function(){t.foundation.handleFocus()},this.handleBlur=function(){t.foundation.handleBlur()},this.handleClick=function(e){t.selectAnchor.focus(),t.foundation.handleClick(t.getNormalizedXCoordinate(e))},this.handleKeydown=function(e){t.foundation.handleKeydown(e)},this.handleMenuItemAction=function(e){t.foundation.handleMenuItemAction(e.detail.index)},this.handleMenuOpened=function(){t.foundation.handleMenuOpened()},this.handleMenuClosed=function(){t.foundation.handleMenuClosed()},this.selectAnchor.addEventListener("focus",this.handleFocus),this.selectAnchor.addEventListener("blur",this.handleBlur),this.selectAnchor.addEventListener("click",this.handleClick),this.selectAnchor.addEventListener("keydown",this.handleKeydown),this.menu.listen(i7.CLOSED_EVENT,this.handleMenuClosed),this.menu.listen(i7.OPENED_EVENT,this.handleMenuOpened),this.menu.listen(nI.SELECTED_EVENT,this.handleMenuItemAction),this.hiddenInput){if(this.hiddenInput.value){this.foundation.setValue(this.hiddenInput.value,!0),this.foundation.layout();return}this.hiddenInput.value=this.value}},e.prototype.destroy=function(){this.selectAnchor.removeEventListener("focus",this.handleFocus),this.selectAnchor.removeEventListener("blur",this.handleBlur),this.selectAnchor.removeEventListener("keydown",this.handleKeydown),this.selectAnchor.removeEventListener("click",this.handleClick),this.menu.unlisten(i7.CLOSED_EVENT,this.handleMenuClosed),this.menu.unlisten(i7.OPENED_EVENT,this.handleMenuOpened),this.menu.unlisten(nI.SELECTED_EVENT,this.handleMenuItemAction),this.menu.destroy(),this.ripple&&this.ripple.destroy(),this.outline&&this.outline.destroy(),this.leadingIcon&&this.leadingIcon.destroy(),this.helperText&&this.helperText.destroy(),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"value",{get:function(){return this.foundation.getValue()},set:function(t){this.foundation.setValue(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this.foundation.getSelectedIndex()},set:function(t){this.foundation.setSelectedIndex(t,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"disabled",{get:function(){return this.foundation.getDisabled()},set:function(t){this.foundation.setDisabled(t),this.hiddenInput&&(this.hiddenInput.disabled=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconAriaLabel",{set:function(t){this.foundation.setLeadingIconAriaLabel(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"leadingIconContent",{set:function(t){this.foundation.setLeadingIconContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"helperTextContent",{set:function(t){this.foundation.setHelperTextContent(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"useDefaultValidation",{set:function(t){this.foundation.setUseDefaultValidation(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"valid",{get:function(){return this.foundation.isValid()},set:function(t){this.foundation.setValid(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"required",{get:function(){return this.foundation.getRequired()},set:function(t){this.foundation.setRequired(t)},enumerable:!0,configurable:!0}),e.prototype.layout=function(){this.foundation.layout()},e.prototype.layoutOptions=function(){this.foundation.layoutOptions(),this.menu.layout(),this.menuItemValues=this.menu.items.map(function(t){return t.getAttribute(nP.VALUE_ATTR)||""}),this.hiddenInput&&(this.hiddenInput.value=this.value)},e.prototype.getDefaultFoundation=function(){return new nO(i4(i4(i4(i4({},this.getSelectAdapterMethods()),this.getCommonAdapterMethods()),this.getOutlineAdapterMethods()),this.getLabelAdapterMethods()),this.getFoundationMap())},e.prototype.menuSetup=function(t){this.menuElement=this.root.querySelector(nP.MENU_SELECTOR),this.menu=t(this.menuElement),this.menu.hasTypeahead=!0,this.menu.singleSelection=!0,this.menuItemValues=this.menu.items.map(function(t){return t.getAttribute(nP.VALUE_ATTR)||""})},e.prototype.createRipple=function(){var t=this,e=i4(i4({},it.createAdapter({root:this.selectAnchor})),{registerInteractionHandler:function(e,i){t.selectAnchor.addEventListener(e,i)},deregisterInteractionHandler:function(e,i){t.selectAnchor.removeEventListener(e,i)}});return new it(this.selectAnchor,new e9(e))},e.prototype.getSelectAdapterMethods=function(){var t=this;return{getMenuItemAttr:function(t,e){return t.getAttribute(e)},setSelectedText:function(e){t.selectedText.textContent=e},isSelectAnchorFocused:function(){return document.activeElement===t.selectAnchor},getSelectAnchorAttr:function(e){return t.selectAnchor.getAttribute(e)},setSelectAnchorAttr:function(e,i){t.selectAnchor.setAttribute(e,i)},removeSelectAnchorAttr:function(e){t.selectAnchor.removeAttribute(e)},addMenuClass:function(e){t.menuElement.classList.add(e)},removeMenuClass:function(e){t.menuElement.classList.remove(e)},openMenu:function(){t.menu.open=!0},closeMenu:function(){t.menu.open=!1},getAnchorElement:function(){return t.root.querySelector(nP.SELECT_ANCHOR_SELECTOR)},setMenuAnchorElement:function(e){t.menu.setAnchorElement(e)},setMenuAnchorCorner:function(e){t.menu.setAnchorCorner(e)},setMenuWrapFocus:function(e){t.menu.wrapFocus=e},getSelectedIndex:function(){var e=t.menu.selectedIndex;return e instanceof Array?e[0]:e},setSelectedIndex:function(e){t.menu.selectedIndex=e},focusMenuItemAtIndex:function(e){t.menu.items[e].focus()},getMenuItemCount:function(){return t.menu.items.length},getMenuItemValues:function(){return t.menuItemValues},getMenuItemTextAtIndex:function(e){return t.menu.getPrimaryTextAtIndex(e)},isTypeaheadInProgress:function(){return t.menu.typeaheadInProgress},typeaheadMatchItem:function(e,i){return t.menu.typeaheadMatchItem(e,i)}}},e.prototype.getCommonAdapterMethods=function(){var t=this;return{addClass:function(e){t.root.classList.add(e)},removeClass:function(e){t.root.classList.remove(e)},hasClass:function(e){return t.root.classList.contains(e)},setRippleCenter:function(e){t.lineRipple&&t.lineRipple.setRippleCenter(e)},activateBottomLine:function(){t.lineRipple&&t.lineRipple.activate()},deactivateBottomLine:function(){t.lineRipple&&t.lineRipple.deactivate()},notifyChange:function(e){var i=t.selectedIndex;t.emit(nP.CHANGE_EVENT,{value:e,index:i},!0),t.hiddenInput&&(t.hiddenInput.value=e)}}},e.prototype.getOutlineAdapterMethods=function(){var t=this;return{hasOutline:function(){return!!t.outline},notchOutline:function(e){t.outline&&t.outline.notch(e)},closeOutline:function(){t.outline&&t.outline.closeNotch()}}},e.prototype.getLabelAdapterMethods=function(){var t=this;return{hasLabel:function(){return!!t.label},floatLabel:function(e){t.label&&t.label.float(e)},getLabelWidth:function(){return t.label?t.label.getWidth():0},setLabelRequired:function(e){t.label&&t.label.setRequired(e)}}},e.prototype.getNormalizedXCoordinate=function(t){var e=t.target.getBoundingClientRect();return(this.isTouchEvent(t)?t.touches[0].clientX:t.clientX)-e.left},e.prototype.isTouchEvent=function(t){return!!t.touches},e.prototype.getFoundationMap=function(){return{helperText:this.helperText?this.helperText.foundationForSelect:void 0,leadingIcon:this.leadingIcon?this.leadingIcon.foundationForSelect:void 0}},e}(ez),nq=function(t,e){return(nq=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function nG(t,e){function i(){this.constructor=t}nq(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var nX=function(){return(nX=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},nZ={ROOT:"mdc-form-field"},nW={LABEL_SELECTOR:".mdc-form-field > label"},nY=function(t){function e(i){var n=t.call(this,nX(nX({},e.defaultAdapter),i))||this;return n.click=function(){n.handleClick()},n}return nG(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return nZ},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return nW},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},e.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},e.prototype.handleClick=function(){var t=this;this.adapter.activateInputRipple(),requestAnimationFrame(function(){t.adapter.deactivateInputRipple()})},e}(eS),nK=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return nG(e,t),e.attachTo=function(t){return new e(t)},e.prototype.labelEl=function(){var t=nY.strings.LABEL_SELECTOR;return this.root.querySelector(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new nY({activateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.activate()},deactivateInputRipple:function(){t.input&&t.input.ripple&&t.input.ripple.deactivate()},deregisterInteractionHandler:function(e,i){var n=t.labelEl();n&&n.removeEventListener(e,i)},registerInteractionHandler:function(e,i){var n=t.labelEl();n&&n.addEventListener(e,i)}})},e}(ez),nJ=function(t,e){return(nJ=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function nQ(t,e){function i(){this.constructor=t}nJ(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var n0=function(){return(n0=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},n1={ICON_BUTTON_ON:"mdc-icon-button--on",ROOT:"mdc-icon-button"},n2={ARIA_LABEL:"aria-label",ARIA_PRESSED:"aria-pressed",DATA_ARIA_LABEL_OFF:"data-aria-label-off",DATA_ARIA_LABEL_ON:"data-aria-label-on",CHANGE_EVENT:"MDCIconButtonToggle:change"},n5=function(t){function e(i){var n=t.call(this,n0(n0({},e.defaultAdapter),i))||this;return n.hasToggledAriaLabel=!1,n}return nQ(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return n1},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return n2},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addClass:function(){},hasClass:function(){return!1},notifyChange:function(){},removeClass:function(){},getAttr:function(){return null},setAttr:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){var t=this.adapter.getAttr(n2.DATA_ARIA_LABEL_ON),e=this.adapter.getAttr(n2.DATA_ARIA_LABEL_OFF);if(t&&e){if(null!==this.adapter.getAttr(n2.ARIA_PRESSED))throw Error("MDCIconButtonToggleFoundation: Button should not set `aria-pressed` if it has a toggled aria label.");this.hasToggledAriaLabel=!0}else this.adapter.setAttr(n2.ARIA_PRESSED,String(this.isOn()))},e.prototype.handleClick=function(){this.toggle(),this.adapter.notifyChange({isOn:this.isOn()})},e.prototype.isOn=function(){return this.adapter.hasClass(n1.ICON_BUTTON_ON)},e.prototype.toggle=function(t){if(void 0===t&&(t=!this.isOn()),t?this.adapter.addClass(n1.ICON_BUTTON_ON):this.adapter.removeClass(n1.ICON_BUTTON_ON),this.hasToggledAriaLabel){var e=t?this.adapter.getAttr(n2.DATA_ARIA_LABEL_ON):this.adapter.getAttr(n2.DATA_ARIA_LABEL_OFF);this.adapter.setAttr(n2.ARIA_LABEL,e||"")}else this.adapter.setAttr(n2.ARIA_PRESSED,""+t)},e}(eS),n3=n5.strings,n4=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.rippleComponent=e.createRipple(),e}return nQ(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this;this.handleClick=function(){t.foundation.handleClick()},this.listen("click",this.handleClick)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick),this.ripple.destroy(),t.prototype.destroy.call(this)},e.prototype.getDefaultFoundation=function(){var t=this;return new n5({addClass:function(e){return t.root.classList.add(e)},hasClass:function(e){return t.root.classList.contains(e)},notifyChange:function(e){t.emit(n3.CHANGE_EVENT,e)},removeClass:function(e){return t.root.classList.remove(e)},getAttr:function(e){return t.root.getAttribute(e)},setAttr:function(e,i){return t.root.setAttribute(e,i)}})},Object.defineProperty(e.prototype,"ripple",{get:function(){return this.rippleComponent},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"on",{get:function(){return this.foundation.isOn()},set:function(t){this.foundation.toggle(t)},enumerable:!0,configurable:!0}),e.prototype.createRipple=function(){var t=new it(this.root);return t.unbounded=!0,t},e}(ez);o(243);let n6="important",n7=" !"+n6,n8=eu(class extends eh{constructor(t){if(super(t),t.type!==ed.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,i)=>{let n=t[i];return null==n?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${n};`},"")}update(t,[e]){let{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(let t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(let t in e){let n=e[t];if(null!=n){this.ft.add(t);let e="string"==typeof n&&n.endsWith(n7);t.includes("-")||e?i.setProperty(t,e?n.slice(0,-11):n,e?n6:""):i[t]=n}}return tb}});var n9=o(732),rt=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};let re=o(41),ri=o(526);class rn extends CustomEvent{constructor(t){super(rn.NAME,{detail:t,bubbles:!0,composed:!0})}}function rr(t,e,i,n,r){switch(n=n||"listbox",t){case u.RADIO:n="radiogroup";break;case u.MULTI_CHECKBOX:n="group"}return t_`
366
+ <ul id="list" class="mdc-list${i?" mdc-list--two-line":""}" role="${n??ty}" @MDCList:action="${t=>r&&r(t)}" aria-hidden="true" aria-orientation="vertical" tabindex="-1">
367
367
  ${e}
368
368
  </ul>
369
- `}function rx(t,e,i,n,r,a){let o,s,l;if(null===t)return tg`<li role="separator" class="mdc-list-divider"></li>`;let c=n===_.MULTI_CHECKBOX||n===_.MULTI_TICK,d=t.value,u=n!==_.PLAIN&&i.length>0&&i.some(t=>t===d),h=void 0!==t.text?t.text:t.value,p=t.secondaryText,m="menuitem",f="",g="",b="",y=t.icon,v="mdc-list-item--selected";switch(r=r||t.translate,c&&n===_.MULTI_TICK&&(y=u?"checkbox-marked":"checkbox-blank-outline"),(n===_.MULTI_TICK||y)&&(g=tg`
369
+ `}function ra(t,e,i,n,r,a){let o,s,l;if(null===t)return t_`<li role="separator" class="mdc-list-divider"></li>`;let c=n===u.MULTI_CHECKBOX||n===u.MULTI_TICK,d=t.value,h=n!==u.PLAIN&&i.length>0&&i.some(t=>t===d),p=void 0!==t.text?t.text:t.value,m=t.secondaryText,f="menuitem",g="",_="",b="",y=t.icon,v="mdc-list-item--selected";switch(r=r||t.translate,c&&n===u.MULTI_TICK&&(y=h?"checkbox-marked":"checkbox-blank-outline"),(n===u.MULTI_TICK||y)&&(_=t_`
370
370
  <span class="mdc-list-item__graphic">
371
371
  <or-icon icon="${y}"></or-icon>
372
372
  </span>
373
- `),t.trailingIcon&&(b=tg`
373
+ `),t.trailingIcon&&(b=t_`
374
374
  <span class="mdc-list-item__meta" aria-hidden="true">
375
375
  <or-icon icon="${t.trailingIcon}"></or-icon>
376
376
  </span>
377
- `),n){case _.SELECT:o=u?"true":"false",l=u||(!i||0===i.length)&&0===e?"0":void 0,m="option";break;case _.RADIO:s=u?"true":"false",m="radio",g=tg`
377
+ `),n){case u.SELECT:o=h?"true":"false",l=h||(!i||0===i.length)&&0===e?"0":void 0,f="option";break;case u.RADIO:s=h?"true":"false",f="radio",_=t_`
378
378
  <span class="mdc-list-item__graphic">
379
379
  <div class="mdc-radio">
380
380
  <input class="mdc-radio__native-control" id="radio-item-${e+1}" type="radio" value="${d}" />
@@ -384,7 +384,7 @@ uniform ${i} ${n} u_${r};
384
384
  </div>
385
385
  </div>
386
386
  </span>
387
- `;break;case _.MULTI_CHECKBOX:s=u?"true":"false",m="checkbox",g=tg`
387
+ `;break;case u.MULTI_CHECKBOX:s=h?"true":"false",f="checkbox",_=t_`
388
388
  <div class="mdc-checkbox">
389
389
  <input type="checkbox" class="mdc-checkbox__native-control" />
390
390
  <div class="mdc-checkbox__background">
@@ -394,23 +394,23 @@ uniform ${i} ${n} u_${r};
394
394
  <div class="mdc-checkbox__mixedmark"></div>
395
395
  </div>
396
396
  </div>
397
- `;break;case _.MULTI_TICK:s=u?"true":"false",v="mdc-list-item--selected"}return h&&(f=void 0!==p?tg`
397
+ `;break;case u.MULTI_TICK:s=h?"true":"false",v="mdc-list-item--selected"}return p&&(g=void 0!==m?t_`
398
398
  <span class="mdc-list-item__text">
399
- <span class="mdc-list-item__primary-text">${r&&h?tg`<or-translate value="${h}"></or-translate>`:h}</span>
400
- <span class="mdc-list-item__secondary-text">${r&&p?tg`<or-translate value="${p}"></or-translate>`:p}</span>
399
+ <span class="mdc-list-item__primary-text">${r&&p?t_`<or-translate value="${p}"></or-translate>`:p}</span>
400
+ <span class="mdc-list-item__secondary-text">${r&&m?t_`<or-translate value="${m}"></or-translate>`:m}</span>
401
401
  </span>
402
- `:n===_.RADIO?tg`<label class="mdc-list-item__text" for="radio-item-${e+1}">${r&&h?tg`<or-translate value="${h}"></or-translate>`:h}</label>`:tg`<span class="mdc-list-item__text" title="${r&&h?rf.i18next.t(h):h}">${r&&h?tg`<or-translate value="${h}"></or-translate>`:h}</span>`),tg`
403
- <li @click="${e=>{a&&a(e,t)}}" style="${t.styleMap?rm(t.styleMap):""}" class="mdc-list-item ${u?v:""}" role="${eD(m)}" tabindex="${eD(l)}" aria-checked="${eD(s)}" aria-selected="${eD(o)}" data-value="${d}">
402
+ `:n===u.RADIO?t_`<label class="mdc-list-item__text" for="radio-item-${e+1}">${r&&p?t_`<or-translate value="${p}"></or-translate>`:p}</label>`:t_`<span class="mdc-list-item__text" title="${r&&p?n9.i18next.t(p):p}">${r&&p?t_`<or-translate value="${p}"></or-translate>`:p}</span>`),t_`
403
+ <li @click="${e=>{a&&a(e,t)}}" style="${t.styleMap?n8(t.styleMap):""}" class="mdc-list-item ${h?v:""}" role="${f??ty}" tabindex="${l??ty}" aria-checked="${s??ty}" aria-selected="${o??ty}" data-value="${d}">
404
404
  <span class="mdc-list-item__ripple"></span>
405
+ ${_}
405
406
  ${g}
406
- ${f}
407
407
  ${b}
408
408
  </li>
409
- `}ry.NAME="or-mwc-list-changed",function(t){t.PLAIN="PLAIN",t.SELECT="SELECT",t.RADIO="RADIO",t.MULTI_CHECKBOX="MULTI_CHECKBOX",t.MULTI_TICK="MULTI_TICK"}(_||(_={}));let rw=tV`
409
+ `}rn.NAME="or-mwc-list-changed",function(t){t.PLAIN="PLAIN",t.SELECT="SELECT",t.RADIO="RADIO",t.MULTI_CHECKBOX="MULTI_CHECKBOX",t.MULTI_TICK="MULTI_TICK"}(u||(u={}));let ro=R`
410
410
  :host {
411
411
  white-space: nowrap;
412
- --internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${tN(v.DefaultColor4)}));
413
- --internal-or-mwc-input-text-color: var(--or-mwc-input-text-color, var(--or-app-color8, ${tN(v.DefaultColor8)}));
412
+ --internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${P(m.DefaultColor4)}));
413
+ --internal-or-mwc-input-text-color: var(--or-mwc-input-text-color, var(--or-app-color8, ${P(m.DefaultColor8)}));
414
414
 
415
415
  --mdc-theme-primary: var(--internal-or-mwc-input-color);
416
416
  --mdc-theme-on-primary: var(--internal-or-mwc-input-text-color);
@@ -425,12 +425,12 @@ uniform ${i} ${n} u_${r};
425
425
  text-decoration: none;
426
426
  color: rgba(0, 0, 0, 0.87);
427
427
  }
428
- `,rk=class extends tK{static get styles(){return[tV`${tN(r_)}`,tV`${tN(rb)}`,rw]}constructor(){super(),this.type=_.SELECT}disconnectedCallback(){super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}shouldUpdate(t){if(this._mdcComponent&&t.has("values")&&!v.Util.objectsEqual(this.values,t.get("values"))){let t=this.values?Array.isArray(this.values)?this.values:[this.values]:[];this.setSelectedItems(this.values&&this.listItems?this.listItems.filter(e=>e&&(null==t?void 0:t.includes(e.value))):void 0)}return!0}render(){let t=this.listItems?tg`${this.listItems.map((t,e)=>rx(t,e,Array.isArray(this.values)?this.values:this.values?[this.values]:[],this.type))}`:tg``,e=this.listItems&&this.listItems.some(t=>t&&!!t.secondaryText);return rv(this.type,t,e,void 0,t=>this._onSelected(t))}firstUpdated(t){super.firstUpdated(t),this._mdcElem&&(this._mdcComponent=new nB(this._mdcElem),(this.type===_.SELECT||this.type===_.RADIO)&&(this._mdcComponent.singleSelection=!0))}get selectedItems(){if(!this._mdcComponent)return[];let t=Array.isArray(this._mdcComponent.selectedIndex)?this._mdcComponent.selectedIndex:[this._mdcComponent.selectedIndex],e=this.listItems?this.listItems.filter(t=>null!==t):[];return t.map(t=>e[t])}setSelectedItems(t){if(!this._mdcComponent||!this.listItems)return;if(!t){this._mdcComponent.selectedIndex=-1;return}let e=(!Array.isArray(t)?[t]:t).map(t=>"string"==typeof t?t:t.value),i=this.listItems.filter(t=>null!==t).reduce((t,i,n)=>(i&&e.includes(i.value)&&t.push(n),t),[]);this._mdcComponent.selectedIndex=this.type===_.MULTI_CHECKBOX?i:i.length>=1?i[0]:-1}_onSelected(t){this.values=this.selectedItems.map(t=>t.value),t.stopPropagation(),this.dispatchEvent(new ry(this.selectedItems))}};rg([t0({type:Array})],rk.prototype,"listItems",void 0),rg([t0({type:Array})],rk.prototype,"values",void 0),rg([t0({type:String,attribute:!0})],rk.prototype,"type",void 0),rg([t2("#wrapper")],rk.prototype,"_wrapperElem",void 0),rg([t2("#list")],rk.prototype,"_mdcElem",void 0),rk=rg([tQ("or-mwc-list")],rk);var rE=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o},rC=function(t,e,i,n){return new(i||(i=Promise))(function(r,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(o,s)}l((n=n.apply(t,e||[])).next())})};let rA=o(444),rT=o(202),rI=o(584),rS=o(224),rz=o(174),rL=o(140),rM=o(611),rP=o(229),rR=o(526),rO=o(816),rD=o(439),rB=o(332),rF=o(41),rN=o(401),rV=o(172),rU=o(881);class r$ extends CustomEvent{constructor(t,e,i){super(r$.NAME,{detail:{value:t,previousValue:e,enterPressed:i},bubbles:!0,composed:!0})}}r$.NAME="or-mwc-input-changed",function(t){t.BUTTON="button",t.BUTTON_TOGGLE="button-toggle",t.BUTTON_MOMENTARY="button-momentary",t.CHECKBOX="checkbox",t.CHECKBOX_LIST="checkbox-list",t.COLOUR="color",t.DATE="date",t.DATETIME="datetime-local",t.EMAIL="email",t.JSON="json",t.JSON_OBJECT="json-object",t.MONTH="month",t.NUMBER="number",t.BIG_INT="big-int",t.PASSWORD="password",t.RADIO="radio",t.SWITCH="switch",t.RANGE="range",t.TELEPHONE="tel",t.TEXT="text",t.TEXTAREA="textarea",t.TIME="time",t.URL="url",t.WEEK="week",t.SELECT="select",t.LIST="list",t.CRON="cron",t.DURATION="duration",t.DURATION_TIME="duration-time",t.DURATION_PERIOD="duration-period"}(b||(b={}));let rj=tV`
428
+ `,rs=class extends tO{static get styles(){return[R`${P(re)}`,R`${P(ri)}`,ro]}constructor(){super(),this.type=u.SELECT}disconnectedCallback(){super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}shouldUpdate(t){if(this._mdcComponent&&t.has("values")&&!m.Util.objectsEqual(this.values,t.get("values"))){let t=this.values?Array.isArray(this.values)?this.values:[this.values]:[];this.setSelectedItems(this.values&&this.listItems?this.listItems.filter(e=>e&&(null==t?void 0:t.includes(e.value))):void 0)}return!0}render(){let t=this.listItems?t_`${this.listItems.map((t,e)=>ra(t,e,Array.isArray(this.values)?this.values:this.values?[this.values]:[],this.type))}`:t_``,e=this.listItems&&this.listItems.some(t=>t&&!!t.secondaryText);return rr(this.type,t,e,void 0,t=>this._onSelected(t))}firstUpdated(t){super.firstUpdated(t),this._mdcElem&&(this._mdcComponent=new nx(this._mdcElem),(this.type===u.SELECT||this.type===u.RADIO)&&(this._mdcComponent.singleSelection=!0))}get selectedItems(){if(!this._mdcComponent)return[];let t=Array.isArray(this._mdcComponent.selectedIndex)?this._mdcComponent.selectedIndex:[this._mdcComponent.selectedIndex],e=this.listItems?this.listItems.filter(t=>null!==t):[];return t.map(t=>e[t])}setSelectedItems(t){if(!this._mdcComponent||!this.listItems)return;if(!t){this._mdcComponent.selectedIndex=-1;return}let e=(!Array.isArray(t)?[t]:t).map(t=>"string"==typeof t?t:t.value),i=this.listItems.filter(t=>null!==t).reduce((t,i,n)=>(i&&e.includes(i.value)&&t.push(n),t),[]);this._mdcComponent.selectedIndex=this.type===u.MULTI_CHECKBOX?i:i.length>=1?i[0]:-1}_onSelected(t){this.values=this.selectedItems.map(t=>t.value),t.stopPropagation(),this.dispatchEvent(new rn(this.selectedItems))}};rt([tN({type:Array})],rs.prototype,"listItems",void 0),rt([tN({type:Array})],rs.prototype,"values",void 0),rt([tN({type:String,attribute:!0})],rs.prototype,"type",void 0),rt([t$("#wrapper")],rs.prototype,"_wrapperElem",void 0),rt([t$("#list")],rs.prototype,"_mdcElem",void 0),rs=rt([tB("or-mwc-list")],rs);var rl=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o},rc=function(t,e,i,n){return new(i||(i=Promise))(function(r,a){function o(t){try{l(n.next(t))}catch(t){a(t)}}function s(t){try{l(n.throw(t))}catch(t){a(t)}}function l(t){var e;t.done?r(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(o,s)}l((n=n.apply(t,e||[])).next())})};let rd=o(444),ru=o(202),rh=o(584),rp=o(224),rm=o(174),rf=o(140),rg=o(611),r_=o(229),rb=o(526),ry=o(816),rv=o(439),rx=o(332),rw=o(41),rk=o(401),rE=o(172),rC=o(881);class rA extends CustomEvent{constructor(t,e,i){super(rA.NAME,{detail:{value:t,previousValue:e,enterPressed:i},bubbles:!0,composed:!0})}}rA.NAME="or-mwc-input-changed",function(t){t.BUTTON="button",t.BUTTON_TOGGLE="button-toggle",t.BUTTON_MOMENTARY="button-momentary",t.CHECKBOX="checkbox",t.CHECKBOX_LIST="checkbox-list",t.COLOUR="color",t.DATE="date",t.DATETIME="datetime-local",t.EMAIL="email",t.JSON="json",t.JSON_OBJECT="json-object",t.MONTH="month",t.NUMBER="number",t.BIG_INT="big-int",t.PASSWORD="password",t.RADIO="radio",t.SWITCH="switch",t.RANGE="range",t.TELEPHONE="tel",t.TEXT="text",t.TEXTAREA="textarea",t.TIME="time",t.URL="url",t.WEEK="week",t.SELECT="select",t.LIST="list",t.CRON="cron",t.DURATION="duration",t.DURATION_TIME="duration-time",t.DURATION_PERIOD="duration-period"}(h||(h={}));let rT=R`
429
429
 
430
430
  :host {
431
431
  display: inline-block;
432
- --internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${tN(v.DefaultColor4)}));
433
- --internal-or-mwc-input-text-color: var(--or-mwc-input-text-color, var(--or-app-color8, ${tN(v.DefaultColor8)}));
432
+ --internal-or-mwc-input-color: var(--or-mwc-input-color, var(--or-app-color4, ${P(m.DefaultColor4)}));
433
+ --internal-or-mwc-input-text-color: var(--or-mwc-input-text-color, var(--or-app-color8, ${P(m.DefaultColor8)}));
434
434
 
435
435
  --mdc-theme-primary: var(--internal-or-mwc-input-color);
436
436
  --mdc-theme-on-primary: var(--internal-or-mwc-input-text-color);
@@ -521,7 +521,7 @@ uniform ${i} ${n} u_${r};
521
521
 
522
522
  #select-searchable {
523
523
  background-color: transparent;
524
- border: 1px solid var(--or-app-color5, ${tN(v.DefaultColor5)});
524
+ border: 1px solid var(--or-app-color5, ${P(m.DefaultColor5)});
525
525
  margin: 8px;
526
526
  width: calc(100% - 16px);
527
527
  border-radius: 4px;
@@ -623,14 +623,14 @@ uniform ${i} ${n} u_${r};
623
623
  .mdc-list-item__graphic > or-icon {
624
624
  pointer-events: none;
625
625
  }
626
- `,rH=class extends tK{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.searchLabel="search",this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this.censored=!1,this.advertised=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[tV`${tN(rI)}`,tV`${tN(rA)}`,tV`${tN(rT)}`,tV`${tN(rS)}`,tV`${tN(rz)}`,tV`${tN(rL)}`,tV`${tN(rM)}`,tV`${tN(rP)}`,tV`${tN(rR)}`,tV`${tN(rO)}`,tV`${tN(rD)}`,tV`${tN(rB)}`,tV`${tN(rF)}`,tV`${tN(rV)}`,tV`${tN(rN)}`,tV`${tN(rU)}`,rj]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,e;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null==(t=this._menuObserver)||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null==(e=this._menuObserver)||e.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===b.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===b.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===b.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=b.DATETIME:"boolean"==typeof this.value?this.type=b.CHECKBOX:"number"==typeof this.value?this.type=b.NUMBER:"string"==typeof this.value?this.type=b.TEXT:this.type=b.JSON),!0}focus(){this.type===b.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){let t=!this.fullWidth&&this.label,e=!this.fullWidth&&this.outlined,i=!!this.helperText,n=!this.isUiValid&&(!!this.errorMessage||!!this.validationMessage),r={"mdc-text-field-helper-text--persistent":!n&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":n},a=null!==this.value&&void 0!==this.value||!1===this.value,o=t?tg`<span class="mdc-floating-label ${a?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case b.RADIO:let s=this.resolveOptions(this.options);return this._selectedIndex=-1,tg`
626
+ `,rI=class extends tO{constructor(){super(...arguments),this.readonly=!1,this.required=!1,this.checked=!1,this.indeterminate=!1,this.multiple=!1,this.searchLabel="search",this.compact=!1,this.comfortable=!1,this.raised=!1,this.action=!1,this.unElevated=!1,this.outlined=!1,this.rounded=!1,this.disableSliderNumberInput=!1,this.fullWidth=!1,this.helperPersistent=!1,this.autoValidate=!1,this.charCounter=!1,this.disabled=!1,this.continuous=!1,this.resizeVertical=!1,this.censored=!1,this.advertised=!1,this._selectedIndex=-1,this.isUiValid=!0}static get styles(){return[R`${P(rh)}`,R`${P(rd)}`,R`${P(ru)}`,R`${P(rp)}`,R`${P(rm)}`,R`${P(rf)}`,R`${P(rg)}`,R`${P(r_)}`,R`${P(rb)}`,R`${P(ry)}`,R`${P(rv)}`,R`${P(rx)}`,R`${P(rw)}`,R`${P(rE)}`,R`${P(rk)}`,R`${P(rC)}`,rT]}get nativeValue(){if(this._mdcComponent)return this._mdcComponent.value}disconnectedCallback(){var t,e;super.disconnectedCallback(),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0,null==(t=this._menuObserver)||t.disconnect()),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0,null==(e=this._menuObserver)||e.disconnect())}shouldUpdate(t){return t.has("indeterminate")&&this._mdcComponent&&this.type===h.CHECKBOX&&(this._mdcComponent.indeterminate=this.indeterminate),t.has("disabled")&&(this._mdcComponent&&(this._mdcComponent.disabled=this.disabled),this.type===h.RANGE&&this._mdcComponent2&&(this._mdcComponent2.disabled=this.disabled)),t.has("readonly")&&(this._mdcComponent&&(this._mdcComponent.readonly=this.readonly),this.type===h.RANGE&&this._mdcComponent2&&(this._mdcComponent2.readonly=this.readonly)),!this.type&&this.value&&(this.value instanceof Date?this.type=h.DATETIME:"boolean"==typeof this.value?this.type=h.CHECKBOX:"number"==typeof this.value?this.type=h.NUMBER:"string"==typeof this.value?this.type=h.TEXT:this.type=h.JSON),!0}focus(){this.type===h.RANGE&&this._mdcComponent2?this._mdcComponent2.focus():this._mdcComponent&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}render(){if(this.type){let a=!this.fullWidth&&this.label,o=!this.fullWidth&&this.outlined,s=!!this.helperText,l=!this.isUiValid&&(!!this.errorMessage||!!this.validationMessage),c={"mdc-text-field-helper-text--persistent":!l&&this.helperPersistent,"mdc-text-field-helper-text--validation-msg":l},d=null!==this.value&&void 0!==this.value||!1===this.value,p=a?t_`<span class="mdc-floating-label ${d?"mdc-floating-label--float-above":""}" id="label">${this.label}</span>`:void 0;switch(this.type){case h.RADIO:let f=this.resolveOptions(this.options);return this._selectedIndex=-1,t_`
627
627
  <div class="mdc-radio-container">
628
- ${s?s.map(([t,e],i)=>(this.value===t&&(this._selectedIndex=i),tg`
628
+ ${f?f.map(([t,e],i)=>(this.value===t&&(this._selectedIndex=i),t_`
629
629
  <div id="field" class="mdc-form-field">
630
630
  <div class="mdc-radio">
631
631
  <input type="radio"
632
632
  id="elem-${t}"
633
- name="${eD(this.name)}"
633
+ name="${this.name??ty}"
634
634
  value="${t}"
635
635
  ?checked="${this.value&&this.value.includes(t)}"
636
636
  ?required="${this.required}"
@@ -648,10 +648,10 @@ uniform ${i} ${n} u_${r};
648
648
 
649
649
  `)):""}
650
650
  </div>
651
- `;case b.SWITCH:let l={"mdc-switch--disabled":this.disabled||this.readonly,"mdc-switch--full-width":this.fullWidth,"mdc-switch--checked":this.value};return tg`
651
+ `;case h.SWITCH:let g={"mdc-switch--disabled":this.disabled||this.readonly,"mdc-switch--full-width":this.fullWidth,"mdc-switch--checked":this.value};return t_`
652
652
  <span id="wrapper">
653
- ${this.label?tg`<label for="elem" class="${this.disabled?"mdc-switch--disabled":""}">${this.label}</label>`:""}
654
- <div id="component" class="mdc-switch ${eO(l)}">
653
+ ${this.label?t_`<label for="elem" class="${this.disabled?"mdc-switch--disabled":""}">${this.label}</label>`:""}
654
+ <div id="component" class="mdc-switch ${ex(g)}">
655
655
  <div class="mdc-switch__track"></div>
656
656
  <div class="mdc-switch__thumb-underlay">
657
657
  <div class="mdc-switch__thumb">
@@ -665,23 +665,23 @@ uniform ${i} ${n} u_${r};
665
665
  </div>
666
666
  </div>
667
667
  </span>
668
- `;case b.LIST:let c={"mdc-select--outlined":e,"mdc-select--disabled":this.disabled,"mdc-select--required":this.required,"mdc-select--dense":!1,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon},d=this.resolveOptions(this.options);return this._selectedIndex=-1,tg`
669
- <div id="component" class="mdc-list mdc-select ${eO(c)}" @MDCList:action="${t=>this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(this.options[t.detail.index])?this.options[t.detail.index][0]:this.options[t.detail.index])}">
668
+ `;case h.LIST:let _={"mdc-select--outlined":o,"mdc-select--disabled":this.disabled,"mdc-select--required":this.required,"mdc-select--dense":!1,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon},b=this.resolveOptions(this.options);return this._selectedIndex=-1,t_`
669
+ <div id="component" class="mdc-list mdc-select ${ex(_)}" @MDCList:action="${t=>this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(this.options[t.detail.index])?this.options[t.detail.index][0]:this.options[t.detail.index])}">
670
670
  <ul class="mdc-list">
671
- ${d?d.map(([t,e],i)=>(this.value===t&&(this._selectedIndex=i),tg`<li class="${eO({"mdc-list-item":!0,"mdc-list-item--selected":this.value===t})}" role="option" data-value="${t}"><or-translate value="${e}"></or-translate></li>`)):""}
671
+ ${b?b.map(([t,e],i)=>(this.value===t&&(this._selectedIndex=i),t_`<li class="${ex({"mdc-list-item":!0,"mdc-list-item--selected":this.value===t})}" role="option" data-value="${t}"><or-translate value="${e}"></or-translate></li>`)):""}
672
672
  </ul>
673
673
  </div>
674
- `;case b.SELECT:let u,h={"mdc-select--outlined":e,"mdc-select--filled":!e,"mdc-select--disabled":this.disabled||this.readonly,"mdc-select--required":this.required,"mdc-select--dense":!1,"dense-comfortable":this.comfortable,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon,"or-mwc-input--rounded":this.rounded};u=void 0!=this.searchProvider?this.searchProvider(this.searchableValue):this.resolveOptions(this.options);let p=(t,e)=>{var i;let n=e.value;if(this.multiple){t.stopPropagation();let e=null!=(i=this._tempValue)?i:Array.isArray(this.value)?[...this.value]:void 0!==this.value?[this.value]:[],r=e.findIndex(t=>t===n);r>=0?e.splice(r,1):e.push(n);let a=t.composedPath()[0].closest("li"),o=a.getElementsByTagName("or-icon")[0];a&&(r>=0?a.classList.remove("mdc-list-item--selected"):a.classList.add("mdc-list-item--selected")),o&&(o.icon=r>=0?"checkbox-blank-outline":"checkbox-marked"),this._tempValue=e}else void 0==this.searchProvider&&Array.isArray(u)||this.onValueChange(void 0,e.value)},m=()=>{var t;let e=null!=(t=this._tempValue)?t:this.value;if(window.setTimeout(()=>{this._mdcComponent&&this._mdcComponent.foundation.adapter.floatLabel(e&&(!Array.isArray(e)||e.length>0))}),!this._tempValue)return;let i=[...this._tempValue];this._tempValue=void 0,this.onValueChange(void 0,i)},f=t=>void 0==this.searchProvider||t&&0!=t.length?rv(this.multiple?_.MULTI_TICK:_.SELECT,tg`${null==t?void 0:t.map(([t,e],i)=>rx({text:e,value:t},i,Array.isArray(this.value)?this.value:this.value?[this.value]:[],this.multiple?_.MULTI_TICK:_.SELECT,!1,p))}`,!1,void 0):tg`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${rf.i18next.t("noResults")}</span>`;return tg`
674
+ `;case h.SELECT:var t,e,i,n,r;let y,v={"mdc-select--outlined":o,"mdc-select--filled":!o,"mdc-select--disabled":this.disabled||this.readonly,"mdc-select--required":this.required,"mdc-select--dense":!1,"dense-comfortable":this.comfortable,"mdc-select--no-label":!this.label,"mdc-select--with-leading-icon":!!this.icon,"or-mwc-input--rounded":this.rounded};y=void 0!=this.searchProvider?this.searchProvider(this.searchableValue):this.resolveOptions(this.options);let x=(t,e)=>{var i;let n=e.value;if(this.multiple){t.stopPropagation();let e=null!=(i=this._tempValue)?i:Array.isArray(this.value)?[...this.value]:void 0!==this.value?[this.value]:[],r=e.findIndex(t=>t===n);r>=0?e.splice(r,1):e.push(n);let a=t.composedPath()[0].closest("li"),o=a.getElementsByTagName("or-icon")[0];a&&(r>=0?a.classList.remove("mdc-list-item--selected"):a.classList.add("mdc-list-item--selected")),o&&(o.icon=r>=0?"checkbox-blank-outline":"checkbox-marked"),this._tempValue=e}else void 0==this.searchProvider&&Array.isArray(y)||this.onValueChange(void 0,e.value)},w=()=>{var t;let e=null!=(t=this._tempValue)?t:this.value;if(window.setTimeout(()=>{this._mdcComponent&&this._mdcComponent.foundation.adapter.floatLabel(e&&(!Array.isArray(e)||e.length>0))}),!this._tempValue)return;let i=[...this._tempValue];this._tempValue=void 0,this.onValueChange(void 0,i)},k=t=>void 0==this.searchProvider||t&&0!=t.length?rr(this.multiple?u.MULTI_TICK:u.SELECT,t_`${null==t?void 0:t.map(([t,e],i)=>ra({text:e,value:t},i,Array.isArray(this.value)?this.value:this.value?[this.value]:[],this.multiple?u.MULTI_TICK:u.SELECT,!1,x))}`,!1,void 0):t_`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${n9.i18next.t("noResults")}</span>`;return t_`
675
675
  <div id="component"
676
- class="mdc-select ${eO(h)}"
677
- @MDCSelect:change="${t=>rC(this,void 0,void 0,function*(){let e=Array.isArray(u)?u:yield u;this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(e[t.detail.index])?e[t.detail.index][0]:e[t.detail.index])})}">
676
+ class="mdc-select ${ex(v)}"
677
+ @MDCSelect:change="${t=>rc(this,void 0,void 0,function*(){let e=Array.isArray(y)?y:yield y;this.onValueChange(void 0,-1===t.detail.index?void 0:Array.isArray(e[t.detail.index])?e[t.detail.index][0]:e[t.detail.index])})}">
678
678
  <div class="mdc-select__anchor" role="button"
679
679
  aria-haspopup="listbox"
680
680
  aria-expanded="false"
681
681
  aria-disabled="${""+(this.disabled||this.readonly)}"
682
682
  aria-labelledby="label selected-text">
683
- ${!e?tg`<span class="mdc-select__ripple"></span>`:void 0}
684
- ${e?this.renderOutlined(o):o}
683
+ ${!o?t_`<span class="mdc-select__ripple"></span>`:void 0}
684
+ ${o?this.renderOutlined(p):p}
685
685
  <span class="mdc-select__selected-text-container">
686
686
  <span id="selected-text" class="mdc-select__selected-text"></span>
687
687
  </span>
@@ -703,10 +703,10 @@ uniform ${i} ${n} u_${r};
703
703
  </polygon>
704
704
  </svg>
705
705
  </span>
706
- ${!e?tg`<div class="mdc-line-ripple"></div>`:""}
706
+ ${!o?t_`<div class="mdc-line-ripple"></div>`:""}
707
707
  </div>
708
- <div id="mdc-select-menu" class="mdc-select__menu mdc-menu mdc-menu-surface mdc-menu-surface--fixed ${void 0!=this.searchProvider?"mdc-menu__searchable":void 0}" @MDCMenuSurface:closed="${m}">
709
- ${eB(void 0!=this.searchProvider,()=>tg`
708
+ <div id="mdc-select-menu" class="mdc-select__menu mdc-menu mdc-menu-surface mdc-menu-surface--fixed ${void 0!=this.searchProvider?"mdc-menu__searchable":void 0}" @MDCMenuSurface:closed="${w}">
709
+ ${t=void 0!=this.searchProvider,e=()=>t_`
710
710
  <label id="select-searchable" class="mdc-text-field mdc-text-field--filled">
711
711
  <span class="mdc-floating-label" style="color: rgba(0, 0, 0, 0.6); text-transform: capitalize; visibility: ${this.searchableValue?"hidden":"visible"}" id="my-label-id">
712
712
  <or-translate .value="${this.searchLabel}"></or-translate>
@@ -715,36 +715,36 @@ uniform ${i} ${n} u_${r};
715
715
  @keyup="${t=>this.searchableValue=t.target.value}"
716
716
  />
717
717
  </label>
718
- `)}
719
- ${eB(Array.isArray(u),()=>f(u),()=>eU(new Promise(t=>rC(this,void 0,void 0,function*(){t(f((yield u)))})),tg`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${rf.i18next.t("loading")}</span>`))}
718
+ `,t?e(t):void 0}
719
+ ${i=Array.isArray(y),n=()=>k(y),r=()=>eC(new Promise(t=>rc(this,void 0,void 0,function*(){t(k((yield y)))})),t_`<span class="mdc-text-field-helper-line" style="margin: 8px 8px 8px 0;">${n9.i18next.t("loading")}</span>`),i?n(i):r?.(i)}
720
720
  </div>
721
- ${i||n?tg`
722
- <p id="component-helper-text" class="mdc-select-helper-text ${eO(r)}" aria-hidden="true">
723
- ${n?this.errorMessage||this.validationMessage:this.helperText}
721
+ ${s||l?t_`
722
+ <p id="component-helper-text" class="mdc-select-helper-text ${ex(c)}" aria-hidden="true">
723
+ ${l?this.errorMessage||this.validationMessage:this.helperText}
724
724
  </p>`:""}
725
725
  </div>
726
- `;case b.BUTTON_TOGGLE:return tg`
726
+ `;case h.BUTTON_TOGGLE:return t_`
727
727
  <button id="component" class="mdc-icon-button ${this.value?"mdc-icon-button--on":""}"
728
728
  ?readonly="${this.readonly}"
729
729
  ?disabled="${this.disabled}"
730
730
  @MDCIconButtonToggle:change="${t=>this.onValueChange(void 0,t.detail.isOn)}">
731
- ${this.icon?tg`<or-icon class="mdc-icon-button__icon" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
732
- ${this.iconOn?tg`<or-icon class="mdc-icon-button__icon mdc-icon-button__icon--on" aria-hidden="true" icon="${this.iconOn}"></or-icon>`:""}
731
+ ${this.icon?t_`<or-icon class="mdc-icon-button__icon" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
732
+ ${this.iconOn?t_`<or-icon class="mdc-icon-button__icon mdc-icon-button__icon--on" aria-hidden="true" icon="${this.iconOn}"></or-icon>`:""}
733
733
  </button>
734
- `;case b.BUTTON:case b.BUTTON_MOMENTARY:{let t=t=>{this.disabled&&t.stopPropagation(),n&&this.dispatchEvent(new r$(!0,null))},e=t=>{this.disabled&&t.stopPropagation(),n&&this.dispatchEvent(new r$(!1,!0))},i=t=>{this.disabled&&t.stopPropagation(),n||this.dispatchEvent(new r$(!0,null))},n=this.type===b.BUTTON_MOMENTARY,r=!this.action&&!this.label;!r||this.iconTrailing||this.icon||(this.icon="circle");let a={"mdc-icon-button":r,"mdc-fab":!r&&this.action,"mdc-fab--extended":!r&&this.action&&!!this.label,"mdc-fab--mini":!r&&this.action&&(this.compact||this.comfortable),"mdc-button":!r&&!this.action,"mdc-button--raised":!r&&!this.action&&this.raised,"mdc-button--unelevated":!r&&!this.action&&this.unElevated,"mdc-button--outlined":!r&&!this.action&&(this.outlined||n),"mdc-button--rounded":!r&&!this.action&&this.rounded,"mdc-button--fullwidth":this.fullWidth};return tg`
735
- <button id="component" class="${eO(a)}"
734
+ `;case h.BUTTON:case h.BUTTON_MOMENTARY:{let t=t=>{this.disabled&&t.stopPropagation(),n&&this.dispatchEvent(new rA(!0,null))},e=t=>{this.disabled&&t.stopPropagation(),n&&this.dispatchEvent(new rA(!1,!0))},i=t=>{this.disabled&&t.stopPropagation(),n||this.dispatchEvent(new rA(!0,null))},n=this.type===h.BUTTON_MOMENTARY,r=!this.action&&!this.label;!r||this.iconTrailing||this.icon||(this.icon="circle");let a={"mdc-icon-button":r,"mdc-fab":!r&&this.action,"mdc-fab--extended":!r&&this.action&&!!this.label,"mdc-fab--mini":!r&&this.action&&(this.compact||this.comfortable),"mdc-button":!r&&!this.action,"mdc-button--raised":!r&&!this.action&&this.raised,"mdc-button--unelevated":!r&&!this.action&&this.unElevated,"mdc-button--outlined":!r&&!this.action&&(this.outlined||n),"mdc-button--rounded":!r&&!this.action&&this.rounded,"mdc-button--fullwidth":this.fullWidth};return t_`
735
+ <button id="component" class="${ex(a)}"
736
736
  ?readonly="${this.readonly}"
737
737
  ?disabled="${this.disabled}"
738
738
  @click="${t=>i(t)}"
739
739
  @mousedown="${e=>t(e)}" @mouseup="${t=>e(t)}">
740
- ${!r?tg`<div class="mdc-button__ripple"></div>`:""}
741
- ${this.icon?tg`<or-icon class="${r?"":this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
742
- ${this.label?tg`<span class="${this.action?"mdc-fab__label":"mdc-button__label"}"><or-translate .value="${this.label}"></or-translate></span>`:""}
743
- ${!r&&this.iconTrailing?tg`<or-icon class="${this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
740
+ ${!r?t_`<div class="mdc-button__ripple"></div>`:""}
741
+ ${this.icon?t_`<or-icon class="${r?"":this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
742
+ ${this.label?t_`<span class="${this.action?"mdc-fab__label":"mdc-button__label"}"><or-translate .value="${this.label}"></or-translate></span>`:""}
743
+ ${!r&&this.iconTrailing?t_`<or-icon class="${this.action?"mdc-fab__icon":"mdc-button__icon"}" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
744
744
  </button>
745
- `}case b.CHECKBOX_LIST:Array.isArray(this.value)||(null===this.value||void 0===this.value?this.value=[]:this.value=[this.value]);let g=this.resolveOptions(this.options);return this._selectedIndex=-1,tg`
745
+ `}case h.CHECKBOX_LIST:Array.isArray(this.value)||(null===this.value||void 0===this.value?this.value=[]:this.value=[this.value]);let E=this.resolveOptions(this.options);return this._selectedIndex=-1,t_`
746
746
  <div class="mdc-checkbox-list">
747
- ${g?g.map(([t,e],i)=>(this.value===t&&(this._selectedIndex=i),tg`
747
+ ${E?E.map(([t,e],i)=>(this.value===t&&(this._selectedIndex=i),t_`
748
748
  <div id="field" class="mdc-form-field">
749
749
  <div id="component" class="mdc-checkbox">
750
750
  <input type="checkbox"
@@ -762,9 +762,9 @@ uniform ${i} ${n} u_${r};
762
762
 
763
763
  `)):""}
764
764
  </div>
765
- `;case b.CHECKBOX:let y={"mdc-checkbox":!0,"mdc-checkbox--disabled":this.disabled||this.readonly};return tg`
765
+ `;case h.CHECKBOX:let C={"mdc-checkbox":!0,"mdc-checkbox--disabled":this.disabled||this.readonly};return t_`
766
766
  <div id="field" class="mdc-form-field">
767
- <div id="component" class="${eO(y)}">
767
+ <div id="component" class="${ex(C)}">
768
768
  <input type="checkbox"
769
769
  id="elem"
770
770
  data-indeterminate="${this.indeterminate}"
@@ -783,7 +783,7 @@ uniform ${i} ${n} u_${r};
783
783
  </div>
784
784
  <label class="mdc-checkbox-circle" for="elem">${this.label}</label>
785
785
  </div>
786
- `;case b.COLOUR:return tg`
786
+ `;case h.COLOUR:return t_`
787
787
  <div id="component" style="width: 100%; display: inline-flex; align-items: center; padding: 8px 0;">
788
788
  <input type="color" id="elem" style="border: none; height: 31px; width: 31px; padding: 1px 3px; min-height: 22px; min-width: 30px;cursor: pointer" value="${this.value}"
789
789
  ?disabled="${this.disabled||this.readonly}"
@@ -792,42 +792,42 @@ uniform ${i} ${n} u_${r};
792
792
  />
793
793
  <label style="margin-left: 10px; cursor: pointer" for="elem">${this.label}</label>
794
794
  </div>
795
- `;case b.NUMBER:case b.RANGE:case b.DATE:case b.DATETIME:case b.TIME:case b.MONTH:case b.WEEK:case b.EMAIL:case b.PASSWORD:case b.TELEPHONE:case b.URL:case b.TEXT:case b.TEXTAREA:case b.JSON:case b.JSON_OBJECT:{let t,s=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(s.some(t=>"string"!=typeof t))if(this.type===b.JSON||this.type===b.JSON_OBJECT)if(void 0!==s[0]){if("string"!=typeof s[0]||null===s[0])try{s[0]=JSON.stringify(s[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),s[0]=""}}else s[0]="";else{let t=this.format?Object.assign({},this.format):{};switch(this.type){case b.TIME:t.asDate=!0,t.hour12=!1,t.timeStyle=this.step&&this.step<60?"medium":"short";break;case b.DATE:t.asDate=!0,t.momentJsFormat="YYYY-MM-DD";break;case b.WEEK:t.asDate=!0,t.momentJsFormat="YYYY-[W]WW";break;case b.MONTH:t.asDate=!0,t.momentJsFormat="YYYY-MM";break;case b.DATETIME:t.asDate=!0,t.momentJsFormat="YYYY-MM-DDTHH:mm";break;case b.NUMBER:null!=t.maximumFractionDigits||(t.maximumFractionDigits=20)}t.useGrouping=!1,s=s.map(e=>void 0!==e?v.Util.getValueAsString(e,()=>t,"en-GB"):void 0)}let l=this.label,c=this.type,d="component";if(this.type===b.RANGE&&(l=void 0,e=!1,i=!1,c=b.NUMBER,d="number"),!(this.type===b.RANGE&&this.disableSliderNumberInput)){this.censored&&(c=b.PASSWORD),this.type===b.PASSWORD&&this.advertised&&(c=b.TEXT);let u={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!e,"mdc-text-field--outlined":e,"mdc-text-field--textarea":c===b.TEXTAREA||c===b.JSON||c===b.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!e,"dense-comfortable":this.comfortable&&c!==b.TEXTAREA&&c!==b.JSON&&c!==b.JSON_OBJECT,"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":a,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};t=c===b.TEXTAREA||c===b.JSON||c===b.JSON_OBJECT?tg`
795
+ `;case h.NUMBER:case h.RANGE:case h.DATE:case h.DATETIME:case h.TIME:case h.MONTH:case h.WEEK:case h.EMAIL:case h.PASSWORD:case h.TELEPHONE:case h.URL:case h.TEXT:case h.TEXTAREA:case h.JSON:case h.JSON_OBJECT:{let t,e=[void 0===this.value||null===this.value?void 0:this.value,this.min,this.max];if(e.some(t=>"string"!=typeof t))if(this.type===h.JSON||this.type===h.JSON_OBJECT)if(void 0!==e[0]){if("string"!=typeof e[0]||null===e[0])try{e[0]=JSON.stringify(e[0],null,2)}catch(t){console.warn("Failed to parse JSON expression for input control"),e[0]=""}}else e[0]="";else{let t=this.format?Object.assign({},this.format):{};switch(this.type){case h.TIME:t.asDate=!0,t.hour12=!1,t.timeStyle=this.step&&this.step<60?"medium":"short";break;case h.DATE:t.asDate=!0,t.momentJsFormat="YYYY-MM-DD";break;case h.WEEK:t.asDate=!0,t.momentJsFormat="YYYY-[W]WW";break;case h.MONTH:t.asDate=!0,t.momentJsFormat="YYYY-MM";break;case h.DATETIME:t.asDate=!0,t.momentJsFormat="YYYY-MM-DDTHH:mm";break;case h.NUMBER:null!=t.maximumFractionDigits||(t.maximumFractionDigits=20)}t.useGrouping=!1,e=e.map(e=>void 0!==e?m.Util.getValueAsString(e,()=>t,"en-GB"):void 0)}let i=this.label,n=this.type,r="component";if(this.type===h.RANGE&&(i=void 0,o=!1,s=!1,n=h.NUMBER,r="number"),!(this.type===h.RANGE&&this.disableSliderNumberInput)){this.censored&&(n=h.PASSWORD),this.type===h.PASSWORD&&this.advertised&&(n=h.TEXT);let a={"mdc-text-field":!0,"mdc-text-field--invalid":!this.valid,"mdc-text-field--filled":!o,"mdc-text-field--outlined":o,"mdc-text-field--textarea":n===h.TEXTAREA||n===h.JSON||n===h.JSON_OBJECT,"mdc-text-field--disabled":this.disabled,"mdc-text-field--fullwidth":this.fullWidth&&!o,"dense-comfortable":this.comfortable&&n!==h.TEXTAREA&&n!==h.JSON&&n!==h.JSON_OBJECT,"dense-compact":!this.comfortable&&this.compact,"mdc-text-field--label-floating":d,"mdc-text-field--no-label":!this.label,"mdc-text-field--with-leading-icon":!!this.icon,"mdc-text-field--with-trailing-icon":!!this.iconTrailing,"or-mwc-input--rounded":this.rounded};t=n===h.TEXTAREA||n===h.JSON||n===h.JSON_OBJECT?t_`
796
796
  <textarea id="elem" class="mdc-text-field__input ${this.resizeVertical?"resize-vertical":""}" ?required="${this.required}"
797
- ?readonly="${this.readonly}" ?disabled="${this.disabled}" minlength="${eD(this.minLength)}"
798
- maxlength="${eD(this.maxLength)}" rows="${this.rows?this.rows:5}"
799
- cols="${eD(this.cols)}" aria-label="${eD(l)}"
800
- aria-labelledby="${eD(l?"label":void 0)}"
801
- @change="${t=>this.onValueChange(t.target,t.target.value)}">${s[0]?s[0]:""}</textarea>`:tg`
802
- <input type="${c}" id="elem" aria-labelledby="${eD(l?"label":void 0)}"
797
+ ?readonly="${this.readonly}" ?disabled="${this.disabled}" minlength="${this.minLength??ty}"
798
+ maxlength="${this.maxLength??ty}" rows="${this.rows?this.rows:5}"
799
+ cols="${this.cols??ty}" aria-label="${i??ty}"
800
+ aria-labelledby="${(i?"label":void 0)??ty}"
801
+ @change="${t=>this.onValueChange(t.target,t.target.value)}">${e[0]?e[0]:""}</textarea>`:t_`
802
+ <input type="${n}" id="elem" aria-labelledby="${(i?"label":void 0)??ty}"
803
803
  class="mdc-text-field__input" ?required="${this.required}" ?readonly="${this.readonly}"
804
- ?disabled="${this.disabled}" min="${eD(s[1])}" max="${eD(s[2])}"
805
- step="${this.step?this.step:"any"}" minlength="${eD(this.minLength)}" pattern="${eD(this.pattern)}"
806
- maxlength="${eD(this.maxLength)}" placeholder="${eD(this.placeHolder)}"
807
- .value="${null!==s[0]&&void 0!==s[0]?s[0]:""}"
804
+ ?disabled="${this.disabled}" min="${e[1]??ty}" max="${e[2]??ty}"
805
+ step="${this.step?this.step:"any"}" minlength="${this.minLength??ty}" pattern="${this.pattern??ty}"
806
+ maxlength="${this.maxLength??ty}" placeholder="${this.placeHolder??ty}"
807
+ .value="${null!==e[0]&&void 0!==e[0]?e[0]:""}"
808
808
  @keydown="${t=>{("Enter"===t.code||"NumpadEnter"===t.code)&&this.onValueChange(t.target,t.target.value,!0)}}"
809
809
  @blur="${t=>{""===t.target.value&&this.reportValidity()}}"
810
- @change="${t=>this.onValueChange(t.target,t.target.value)}" />`,t=tg`
811
- <label id="${d}" class="${eO(u)}">
812
- ${this.icon?tg`<or-icon class="mdc-text-field__icon mdc-text-field__icon--leading" style="color: ${this.iconColor?"#"+this.iconColor:"unset"}" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
813
- ${e?"":tg`<span class="mdc-text-field__ripple"></span>`}
810
+ @change="${t=>this.onValueChange(t.target,t.target.value)}" />`,t=t_`
811
+ <label id="${r}" class="${ex(a)}">
812
+ ${this.icon?t_`<or-icon class="mdc-text-field__icon mdc-text-field__icon--leading" style="color: ${this.iconColor?"#"+this.iconColor:"unset"}" aria-hidden="true" icon="${this.icon}"></or-icon>`:""}
813
+ ${o?"":t_`<span class="mdc-text-field__ripple"></span>`}
814
814
  ${t}
815
- ${e?this.renderOutlined(o):o}
816
- ${e?"":tg`<span class="mdc-line-ripple"></span>`}
817
- ${this.type===b.PASSWORD&&!this.censored?tg`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon=${this.advertised?"eye":"eye-off"} style="pointer-events: auto;" @click=${()=>this.advertised=!this.advertised}></or-icon>`:""}
818
- ${this.iconTrailing?tg`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
815
+ ${o?this.renderOutlined(p):p}
816
+ ${o?"":t_`<span class="mdc-line-ripple"></span>`}
817
+ ${this.type===h.PASSWORD&&!this.censored?t_`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon=${this.advertised?"eye":"eye-off"} style="pointer-events: auto;" @click=${()=>this.advertised=!this.advertised}></or-icon>`:""}
818
+ ${this.iconTrailing?t_`<or-icon class="mdc-text-field__icon mdc-text-field__icon--trailing" aria-hidden="true" icon="${this.iconTrailing}"></or-icon>`:""}
819
819
  </label>
820
- ${i||n?tg`
820
+ ${s||l?t_`
821
821
  <div class="mdc-text-field-helper-line">
822
- <div class="mdc-text-field-helper-text ${eO(r)}">${n?this.errorMessage||this.validationMessage:this.helperText}</div>
823
- ${this.charCounter&&!this.readonly?tg`<div class="mdc-text-field-character-counter"></div>`:""}
822
+ <div class="mdc-text-field-helper-text ${ex(c)}">${l?this.errorMessage||this.validationMessage:this.helperText}</div>
823
+ ${this.charCounter&&!this.readonly?t_`<div class="mdc-text-field-character-counter"></div>`:""}
824
824
  </div>
825
825
  `:""}
826
- `}if(this.type===b.RANGE){let e={"mdc-slider":!0,"mdc-slider--range":this.continuous,"mdc-slider--discreet":!this.continuous,"mdc-slider--disabled":this.disabled||this.readonly};t=tg`
826
+ `}if(this.type===h.RANGE){let i={"mdc-slider":!0,"mdc-slider--range":this.continuous,"mdc-slider--discreet":!this.continuous,"mdc-slider--disabled":this.disabled||this.readonly};t=t_`
827
827
  <span id="wrapper">
828
- ${this.label?tg`<label for="component" class="${this.disabled?"mdc-switch--disabled":""}">${this.label}</label>`:""}
829
- <div id="component" class="${eO(e)}" @MDCSlider:change="${t=>this.onValueChange(void 0,t.detail.value)}">
830
- <input id="elem" class="mdc-slider__input" type="range" min="${eD(s[1])}" max="${eD(s[2])}" value="${s[0]||s[1]||0}" name="slider" step="${this.step||1}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" aria-label="${eD(this.label)}" />
828
+ ${this.label?t_`<label for="component" class="${this.disabled?"mdc-switch--disabled":""}">${this.label}</label>`:""}
829
+ <div id="component" class="${ex(i)}" @MDCSlider:change="${t=>this.onValueChange(void 0,t.detail.value)}">
830
+ <input id="elem" class="mdc-slider__input" type="range" min="${e[1]??ty}" max="${e[2]??ty}" value="${e[0]||e[1]||0}" name="slider" step="${this.step||1}" ?readonly="${this.readonly}" ?disabled="${this.disabled}" aria-label="${this.label??ty}" />
831
831
  <div class="mdc-slider__track">
832
832
  <div class="mdc-slider__track--inactive"></div>
833
833
  <div class="mdc-slider__track--active">
@@ -835,7 +835,7 @@ uniform ${i} ${n} u_${r};
835
835
  </div>
836
836
  </div>
837
837
  <div class="mdc-slider__thumb">
838
- ${!this.continuous?tg`<div class="mdc-slider__value-indicator-container" aria-hidden="true">
838
+ ${!this.continuous?t_`<div class="mdc-slider__value-indicator-container" aria-hidden="true">
839
839
  <div class="mdc-slider__value-indicator">
840
840
  <span class="mdc-slider__value-indicator-text">
841
841
  50
@@ -845,19 +845,19 @@ uniform ${i} ${n} u_${r};
845
845
  <div class="mdc-slider__thumb-knob"></div>
846
846
  </div>
847
847
  </div>
848
- ${t?tg`<div style="min-width: 70px; width: 70px;">${t}</div>`:""}
848
+ ${t?t_`<div style="min-width: 70px; width: 70px;">${t}</div>`:""}
849
849
  </span>
850
- `}return t}}}return tg`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){let t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){var e,i;if(super.updated(t),t.has("type")){let t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case b.LIST:let e=new nB(t);this._mdcComponent=e,e.selectedIndex=this._selectedIndex;break;case b.SELECT:let i=new n6(t);this._mdcComponent=i,(null===this.value||void 0===this.value)&&(i.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return -1;let t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),i.useDefaultValidation=!this.multiple,i.valid=!this.required||!this.multiple&&i.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let n=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(n),this._mdcComponent.foundation.adapter.floatLabel(!!n),this._menuObserver||(this._menuObserver=new IntersectionObserver((t,e)=>{var i,n;t[0].target.style.minWidth!=(null==(i=t[0].target.parentElement)?void 0:i.clientWidth)+"px"&&(t[0].target.style.minWidth=(null==(n=t[0].target.parentElement)?void 0:n.clientWidth)+"px")}),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));let r=void 0!==this.searchProvider,a=this.multiple;i.menu.menuSurface_.foundation.handleBodyClick=function(t){let e=t.composedPath()[0];if(this.adapter.isElementInContainer(e)){if(!r)return;else if(e instanceof Element&&!e.className.includes("mdc-list-item"))return;else if(a)return}i.menu.menuSurface_.close()};break;case b.RADIO:case b.CHECKBOX_LIST:case b.COLOUR:break;case b.BUTTON:case b.BUTTON_MOMENTARY:let o=!this.action&&!this.label,s=new ib(t);o&&(s.unbounded=!0),this._mdcComponent=s;break;case b.BUTTON_TOGGLE:this._mdcComponent=new ru(t);break;case b.CHECKBOX:this._mdcComponent=new i0(t);let l=this.shadowRoot.getElementById("field");if(l){let t=new rn(l);t.input=this._mdcComponent,this._mdcComponent2=t}break;case b.SWITCH:this._mdcComponent=new i8(t);break;case b.RANGE:this._mdcComponent=new nl(t);let c=this.shadowRoot.getElementById("number");if(c){let t=new iV(c);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:let d=new iV(t);d.useNativeValidation=!1,this._mdcComponent=d}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===b.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!!(this.disabled||this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let e=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(e),this._mdcComponent.foundation.adapter.floatLabel(!!e)}else if(this.type===b.RANGE&&this._mdcComponent){let t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===b.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===b.CHECKBOX&&this._mdcComponent){let t=this._mdcComponent;t.checked=!!this.value,t.disabled=!!(this.disabled||this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}t.has("label")&&(null==(i=null==(e=this._mdcComponent)?void 0:e.layout)||i.call(e)),this.autoValidate&&this.reportValidity()}renderOutlined(t){return tg`
850
+ `}return t}}}return t_`<span>INPUT TYPE NOT IMPLEMENTED</span>`}_getFormat(){if(this.format)return this.format}update(t){if(t.has("autoValidate")&&this._mdcComponent){let t=this._mdcComponent;t.foundation&&t.foundation.setValidateOnValueChange&&t.foundation.setValidateOnValueChange(this.autoValidate)}super.update(t)}firstUpdated(t){super.firstUpdated(t),this.autoValidate&&this.reportValidity()}updated(t){var e,i;if(super.updated(t),t.has("type")){let t=this.shadowRoot.getElementById("component");if(this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this._mdcComponent2&&(this._mdcComponent2.destroy(),this._mdcComponent2=void 0),t&&this.type){switch(this.type){case h.LIST:let e=new nx(t);this._mdcComponent=e,e.selectedIndex=this._selectedIndex;break;case h.SELECT:let i=new nH(t);this._mdcComponent=i,(null===this.value||void 0===this.value)&&(i.selectedIndex=-1),this.multiple&&(this._mdcComponent.foundation.adapter.getSelectedIndex=()=>{if(!Array.isArray(this.value)||0===this.value.length)return -1;let t=this.value[0];return this._mdcComponent.foundation.adapter.getMenuItemValues().indexOf(t)}),i.useDefaultValidation=!this.multiple,i.valid=!this.required||!this.multiple&&i.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let n=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(n),this._mdcComponent.foundation.adapter.floatLabel(!!n),this._menuObserver||(this._menuObserver=new IntersectionObserver((t,e)=>{var i,n;t[0].target.style.minWidth!=(null==(i=t[0].target.parentElement)?void 0:i.clientWidth)+"px"&&(t[0].target.style.minWidth=(null==(n=t[0].target.parentElement)?void 0:n.clientWidth)+"px")}),this._menuObserver.observe(this.shadowRoot.getElementById("mdc-select-menu")));let r=void 0!==this.searchProvider,a=this.multiple;i.menu.menuSurface_.foundation.handleBodyClick=function(t){let e=t.composedPath()[0];if(this.adapter.isElementInContainer(e)){if(!r)return;else if(e instanceof Element&&!e.className.includes("mdc-list-item"))return;else if(a)return}i.menu.menuSurface_.close()};break;case h.RADIO:case h.CHECKBOX_LIST:case h.COLOUR:break;case h.BUTTON:case h.BUTTON_MOMENTARY:let o=!this.action&&!this.label,s=new it(t);o&&(s.unbounded=!0),this._mdcComponent=s;break;case h.BUTTON_TOGGLE:this._mdcComponent=new n4(t);break;case h.CHECKBOX:this._mdcComponent=new iF(t);let l=this.shadowRoot.getElementById("field");if(l){let t=new nK(l);t.input=this._mdcComponent,this._mdcComponent2=t}break;case h.SWITCH:this._mdcComponent=new iG(t);break;case h.RANGE:this._mdcComponent=new i2(t);let c=this.shadowRoot.getElementById("number");if(c){let t=new iE(c);t.useNativeValidation=!1,this._mdcComponent2=t}break;default:let d=new iE(t);d.useNativeValidation=!1,this._mdcComponent=d}this._mdcComponent&&this.focused&&"function"==typeof this._mdcComponent.focus&&this._mdcComponent.focus()}}else{if(this.type===h.SELECT&&this._mdcComponent){t.has("options")&&this._mdcComponent.layoutOptions(),this._mdcComponent.disabled=!!(this.disabled||this.readonly),this._mdcComponent.useDefaultValidation=!this.multiple,this._mdcComponent.valid=!this.required||!this.multiple&&this._mdcComponent.valid||this.multiple&&Array.isArray(this.value)&&this.value.length>0;let e=this.getSelectedTextValue();this._mdcComponent.foundation.adapter.setSelectedText(e),this._mdcComponent.foundation.adapter.floatLabel(!!e)}else if(this.type===h.RANGE&&this._mdcComponent){let t=this._mdcComponent;t.setDisabled(this.disabled||this.readonly),t.setValue(this.value)}else if(this.type===h.SWITCH&&this._mdcComponent)this._mdcComponent.checked=this.value;else if(this.type===h.CHECKBOX&&this._mdcComponent){let t=this._mdcComponent;t.checked=!!this.value,t.disabled=!!(this.disabled||this.readonly)}this._mdcComponent&&(this._mdcComponent.required=!!this.required)}t.has("label")&&(null==(i=null==(e=this._mdcComponent)?void 0:e.layout)||i.call(e)),this.autoValidate&&this.reportValidity()}renderOutlined(t){return t_`
851
851
  <span class="mdc-notched-outline">
852
852
  <span class="mdc-notched-outline__leading"></span>
853
- ${t?tg`
853
+ ${t?t_`
854
854
  <span class="mdc-notched-outline__notch">
855
855
  ${t}
856
856
  </span>
857
857
  `:""}
858
858
  <span class="mdc-notched-outline__trailing"></span>
859
859
  </span>
860
- `}setCustomValidity(t){this.errorMessage=t;let e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){let t=this.shadowRoot.getElementById("elem"),e=!0;return t&&t.validity&&(e=t.validity.valid),e&&(this.type===b.JSON||this.type===b.JSON_OBJECT)&&void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){let t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,i){var n,r;let a,o=this.value;if("undefined"===e&&(o=null,e=void 0),"null"===e&&(o=void 0,e=null),"string"==typeof e)switch(this.type){case b.CHECKBOX:case b.SWITCH:e="on"===e;break;case b.JSON:case b.JSON_OBJECT:case b.NUMBER:case b.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type===b.JSON_OBJECT&&("object"!=typeof e||Array.isArray(e))&&(e=this.value,a=rf.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,a=this.type===b.JSON||this.type==b.JSON_OBJECT?rf.i18next.t("validation.invalidJSON"):rf.i18next.t("validation.invalidNumber")}break;case b.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,a=rf.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(a),this.reportValidity(),this.type!==b.CHECKBOX_LIST&&e!==o&&(this.type===b.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new r$(this.value,o,i))),void 0!=this.searchProvider&&this.type===b.SELECT){let t=null==(r=null==(n=this.shadowRoot)?void 0:n.getElementById("select-searchable"))?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==b.CHECKBOX_LIST||v.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new r$(e,o,i))}get valid(){let t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){let t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map(t=>{if(Array.isArray(t))return t;{let e=""+t;return[t,rf.i18next.t(e,{defaultValue:v.Util.camelCaseToSentenceCase(e)})]}})),e}getSelectedTextValue(t){let e=this.value,i=Array.isArray(e)?e:null!=e?[e]:void 0;if(!i)return"";let n=t||this.resolveOptions(this.options);return n&&i?i.map(t=>n.find(([e,i],n)=>t===e)).map(t=>t?t[1]:"").join(", "):""}};rE([t0({type:Boolean})],rH.prototype,"focused",void 0),rE([t0()],rH.prototype,"value",void 0),rE([t0({type:String})],rH.prototype,"type",void 0),rE([t0({type:String})],rH.prototype,"name",void 0),rE([t0({type:Boolean})],rH.prototype,"readonly",void 0),rE([t0({type:Boolean})],rH.prototype,"required",void 0),rE([t0()],rH.prototype,"max",void 0),rE([t0()],rH.prototype,"min",void 0),rE([t0({type:Number})],rH.prototype,"step",void 0),rE([t0({type:Boolean})],rH.prototype,"checked",void 0),rE([t0({type:Boolean})],rH.prototype,"indeterminate",void 0),rE([t0({type:Number})],rH.prototype,"maxLength",void 0),rE([t0({type:Number})],rH.prototype,"minLength",void 0),rE([t0({type:Number})],rH.prototype,"rows",void 0),rE([t0({type:Number})],rH.prototype,"cols",void 0),rE([t0({type:Boolean})],rH.prototype,"multiple",void 0),rE([t0({type:String,attribute:!0,reflect:!1})],rH.prototype,"pattern",void 0),rE([t0({type:String})],rH.prototype,"placeHolder",void 0),rE([t0({type:Array})],rH.prototype,"options",void 0),rE([t0({type:Boolean})],rH.prototype,"autoSelect",void 0),rE([t0({type:Object})],rH.prototype,"searchProvider",void 0),rE([t0({type:String})],rH.prototype,"searchLabel",void 0),rE([t0({type:String})],rH.prototype,"icon",void 0),rE([t0({type:String})],rH.prototype,"iconColor",void 0),rE([t0({type:String})],rH.prototype,"iconOn",void 0),rE([t0({type:String})],rH.prototype,"iconTrailing",void 0),rE([t0({type:Boolean})],rH.prototype,"compact",void 0),rE([t0({type:Boolean})],rH.prototype,"comfortable",void 0),rE([t0({type:Boolean})],rH.prototype,"raised",void 0),rE([t0({type:Boolean})],rH.prototype,"action",void 0),rE([t0({type:Boolean})],rH.prototype,"unElevated",void 0),rE([t0({type:Boolean})],rH.prototype,"outlined",void 0),rE([t0({type:Boolean})],rH.prototype,"rounded",void 0),rE([t0({type:Object})],rH.prototype,"format",void 0),rE([t0({type:Boolean})],rH.prototype,"disableSliderNumberInput",void 0),rE([t0({type:Boolean})],rH.prototype,"fullWidth",void 0),rE([t0({type:String})],rH.prototype,"helperText",void 0),rE([t0({type:Boolean})],rH.prototype,"helperPersistent",void 0),rE([t0({type:String,attribute:!0})],rH.prototype,"validationMessage",void 0),rE([t0({type:Boolean})],rH.prototype,"autoValidate",void 0),rE([t0({type:Boolean})],rH.prototype,"charCounter",void 0),rE([t0({type:String})],rH.prototype,"label",void 0),rE([t0({type:Boolean})],rH.prototype,"disabled",void 0),rE([t0({type:Boolean})],rH.prototype,"continuous",void 0),rE([t0({type:Boolean})],rH.prototype,"resizeVertical",void 0),rE([t0({type:Boolean})],rH.prototype,"censored",void 0),rE([t0({type:Boolean,reflect:!0})],rH.prototype,"advertised",void 0),rE([t1()],rH.prototype,"isUiValid",void 0),rE([t1()],rH.prototype,"searchableValue",void 0),rE([t1()],rH.prototype,"errorMessage",void 0),rH=rE([tQ("or-mwc-input")],rH);var rq=function(t,e){return(rq=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function rG(t,e){function i(){this.constructor=t}rq(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var rX=function(){return(rX=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rZ="mdc-dom-focus-sentinel",rW=function(){function t(t,e){void 0===e&&(e={}),this.root=t,this.options=e,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+rZ)).forEach(function(t){t.parentElement.removeChild(t)}),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,e){var i=this.createSentinel(),n=this.createSentinel();i.addEventListener("focus",function(){e.length>0&&e[e.length-1].focus()}),n.addEventListener("focus",function(){e.length>0&&e[0].focus()}),t.insertBefore(i,t.children[0]),t.appendChild(n)},t.prototype.focusInitialElement=function(t,e){var i=0;e&&(i=Math.max(t.indexOf(e),0)),t[i].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter(function(t){var e="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),i=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(rZ)&&!e,n=!1;if(i){var r=getComputedStyle(t);n="none"===r.display||"hidden"===r.visibility}return i&&!n})},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(rZ),t},t}(),rY={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},rK={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:"textarea, .mdc-menu .mdc-list-item",SURFACE_SELECTOR:".mdc-dialog__surface"},rJ={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},rQ=function(t){function e(i){var n=t.call(this,rX(rX({},e.defaultAdapter),i))||this;return n.isOpen_=!1,n.animationFrame_=0,n.animationTimer_=0,n.layoutFrame_=0,n.escapeKeyAction_=rK.CLOSE_ACTION,n.scrimClickAction_=rK.CLOSE_ACTION,n.autoStackButtons_=!0,n.areButtonsStacked_=!1,n.suppressDefaultPressSelector=rK.SUPPRESS_DEFAULT_PRESS_SELECTOR,n}return rG(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return rY},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return rK},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return rJ},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.hasClass(rY.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(rK.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},e.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(rY.OPENING),this.runNextAnimationFrame_(function(){t.adapter.addClass(rY.OPEN),t.adapter.addBodyClass(rY.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout(function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()},rJ.DIALOG_ANIMATION_OPEN_TIME_MS)})},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(rY.CLOSING),this.adapter.removeClass(rY.OPEN),this.adapter.removeBodyClass(rY.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout(function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)},rJ.DIALOG_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},e.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},e.prototype.getScrimClickAction=function(){return this.scrimClickAction_},e.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},e.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},e.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},e.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},e.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})},e.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,rK.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},e.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var i=t.composedPath?t.composedPath()[0]:t.target,n=!this.adapter.eventTargetMatches(i,this.suppressDefaultPressSelector);e&&n&&this.adapter.clickDefaultButton()}},e.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},e.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(rY.OPENING),this.adapter.removeClass(rY.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame(function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)})},e.prototype.detectStackedButtons_=function(){this.adapter.removeClass(rY.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(rY.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(rY.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(rY.SCROLLABLE)},e}(eq),r0=rQ.strings,r1=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rG(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){void 0===t&&(t=function(t,e){return new rW(t,e)});var e,i,n=this.root.querySelector(r0.CONTAINER_SELECTOR);if(!n)throw Error("Dialog component requires a "+r0.CONTAINER_SELECTOR+" container element");this.container_=n,this.content_=this.root.querySelector(r0.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(r0.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+r0.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.buttons_),a=r.next();!a.done;a=r.next()){var o=a.value;this.buttonRipples_.push(new ib(o))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}},e.prototype.initialSyncWithDOM=function(){var t,e=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var i=["resize","orientationchange"];this.handleOpening_=function(){i.forEach(function(t){return window.addEventListener(t,e.handleLayout_)}),document.addEventListener("keydown",e.handleDocumentKeydown_)},this.handleClosing_=function(){i.forEach(function(t){return window.removeEventListener(t,e.handleLayout_)}),document.removeEventListener("keydown",e.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(r0.OPENING_EVENT,this.handleOpening_),this.listen(r0.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(r0.OPENING_EVENT,this.handleOpening_),this.unlisten(r0.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach(function(t){return t.destroy()}),t.prototype.destroy.call(this)},e.prototype.layout=function(){this.foundation.layout()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new rQ({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(e){return t.root.classList.add(e)},areButtonsStacked:function(){var e,i;return e=t.buttons_,i=new Set,[].forEach.call(e,function(t){return i.add(t.offsetTop)}),i.size>1},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,e){return!!t&&eW(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=eZ(t.target,"["+r0.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(r0.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(e){return t.root.classList.contains(e)},isContentScrollable:function(){var e;return!!(e=t.content_)&&e.scrollHeight>e.offsetHeight},notifyClosed:function(e){return t.emit(r0.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(r0.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(r0.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(r0.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(e){return t.root.classList.remove(e)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach(function(t){t.parentElement.appendChild(t)})},trapFocus:function(){return t.focusTrap_.trapFocus()}})},e.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+r0.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(eG),r2=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};let r5=o(253),r3=o(41);class r4 extends CustomEvent{constructor(){super(r4.NAME,{bubbles:!0,composed:!0})}}r4.NAME="or-mwc-dialog-opened";class r6 extends CustomEvent{constructor(t){super(r6.NAME,{detail:t,bubbles:!0,composed:!0})}}r6.NAME="or-mwc-dialog-closed";let r7=tV`
860
+ `}setCustomValidity(t){this.errorMessage=t;let e=this.shadowRoot.getElementById("elem");e&&e.setCustomValidity&&e.setCustomValidity(null!=t?t:""),this.reportValidity()}checkValidity(){let t=this.shadowRoot.getElementById("elem"),e=!0;return t&&t.validity&&(e=t.validity.valid),e&&(this.type===h.JSON||this.type===h.JSON_OBJECT)&&void 0!==this.value&&null!==this.value&&""===this._mdcComponent.value&&(e=!1),e}reportValidity(){let t=this.checkValidity();return this.isUiValid=t,this._mdcComponent&&(this._mdcComponent.valid=t),t}onValueChange(t,e,i){var n,r;let a,o=this.value;if("undefined"===e&&(o=null,e=void 0),"null"===e&&(o=void 0,e=null),"string"==typeof e)switch(this.type){case h.CHECKBOX:case h.SWITCH:e="on"===e;break;case h.JSON:case h.JSON_OBJECT:case h.NUMBER:case h.RANGE:if(""===e)e=null;else try{e=JSON.parse(e),this.type===h.JSON_OBJECT&&("object"!=typeof e||Array.isArray(e))&&(e=this.value,a=n9.i18next.t("validation.invalidJSON"))}catch(t){e=this.value,a=this.type===h.JSON||this.type==h.JSON_OBJECT?n9.i18next.t("validation.invalidJSON"):n9.i18next.t("validation.invalidNumber")}break;case h.DATETIME:if(""===e)e=null;else try{e=Date.parse(e)}catch(t){e=this.value,a=n9.i18next.t("validation.invalidDate")}}if(this.value=e,this.setCustomValidity(a),this.reportValidity(),this.type!==h.CHECKBOX_LIST&&e!==o&&(this.type===h.RANGE&&(this._mdcComponent.setValue(e),this._mdcComponent2&&(this._mdcComponent2.value=e)),this.dispatchEvent(new rA(this.value,o,i))),void 0!=this.searchProvider&&this.type===h.SELECT){let t=null==(r=null==(n=this.shadowRoot)?void 0:n.getElementById("select-searchable"))?void 0:r.children[1];t&&(this.searchableValue=void 0,t.value="")}this.type!==h.CHECKBOX_LIST||m.Util.objectsEqual(e,o,!0)||this.dispatchEvent(new rA(e,o,i))}get valid(){let t=this.shadowRoot.getElementById("elem");return!t||!t.checkValidity||t.checkValidity()}get currentValue(){let t=this.shadowRoot.getElementById("elem");if(t&&t.value)return t.value}resolveOptions(t){let e;return t&&t.length>0&&(e=t.map(t=>{if(Array.isArray(t))return t;{let e=""+t;return[t,n9.i18next.t(e,{defaultValue:m.Util.camelCaseToSentenceCase(e)})]}})),e}getSelectedTextValue(t){let e=this.value,i=Array.isArray(e)?e:null!=e?[e]:void 0;if(!i)return"";let n=t||this.resolveOptions(this.options);return n&&i?i.map(t=>n.find(([e,i],n)=>t===e)).map(t=>t?t[1]:"").join(", "):""}};rl([tN({type:Boolean})],rI.prototype,"focused",void 0),rl([tN()],rI.prototype,"value",void 0),rl([tN({type:String})],rI.prototype,"type",void 0),rl([tN({type:String})],rI.prototype,"name",void 0),rl([tN({type:Boolean})],rI.prototype,"readonly",void 0),rl([tN({type:Boolean})],rI.prototype,"required",void 0),rl([tN()],rI.prototype,"max",void 0),rl([tN()],rI.prototype,"min",void 0),rl([tN({type:Number})],rI.prototype,"step",void 0),rl([tN({type:Boolean})],rI.prototype,"checked",void 0),rl([tN({type:Boolean})],rI.prototype,"indeterminate",void 0),rl([tN({type:Number})],rI.prototype,"maxLength",void 0),rl([tN({type:Number})],rI.prototype,"minLength",void 0),rl([tN({type:Number})],rI.prototype,"rows",void 0),rl([tN({type:Number})],rI.prototype,"cols",void 0),rl([tN({type:Boolean})],rI.prototype,"multiple",void 0),rl([tN({type:String,attribute:!0,reflect:!1})],rI.prototype,"pattern",void 0),rl([tN({type:String})],rI.prototype,"placeHolder",void 0),rl([tN({type:Array})],rI.prototype,"options",void 0),rl([tN({type:Boolean})],rI.prototype,"autoSelect",void 0),rl([tN({type:Object})],rI.prototype,"searchProvider",void 0),rl([tN({type:String})],rI.prototype,"searchLabel",void 0),rl([tN({type:String})],rI.prototype,"icon",void 0),rl([tN({type:String})],rI.prototype,"iconColor",void 0),rl([tN({type:String})],rI.prototype,"iconOn",void 0),rl([tN({type:String})],rI.prototype,"iconTrailing",void 0),rl([tN({type:Boolean})],rI.prototype,"compact",void 0),rl([tN({type:Boolean})],rI.prototype,"comfortable",void 0),rl([tN({type:Boolean})],rI.prototype,"raised",void 0),rl([tN({type:Boolean})],rI.prototype,"action",void 0),rl([tN({type:Boolean})],rI.prototype,"unElevated",void 0),rl([tN({type:Boolean})],rI.prototype,"outlined",void 0),rl([tN({type:Boolean})],rI.prototype,"rounded",void 0),rl([tN({type:Object})],rI.prototype,"format",void 0),rl([tN({type:Boolean})],rI.prototype,"disableSliderNumberInput",void 0),rl([tN({type:Boolean})],rI.prototype,"fullWidth",void 0),rl([tN({type:String})],rI.prototype,"helperText",void 0),rl([tN({type:Boolean})],rI.prototype,"helperPersistent",void 0),rl([tN({type:String,attribute:!0})],rI.prototype,"validationMessage",void 0),rl([tN({type:Boolean})],rI.prototype,"autoValidate",void 0),rl([tN({type:Boolean})],rI.prototype,"charCounter",void 0),rl([tN({type:String})],rI.prototype,"label",void 0),rl([tN({type:Boolean})],rI.prototype,"disabled",void 0),rl([tN({type:Boolean})],rI.prototype,"continuous",void 0),rl([tN({type:Boolean})],rI.prototype,"resizeVertical",void 0),rl([tN({type:Boolean})],rI.prototype,"censored",void 0),rl([tN({type:Boolean,reflect:!0})],rI.prototype,"advertised",void 0),rl([tV()],rI.prototype,"isUiValid",void 0),rl([tV()],rI.prototype,"searchableValue",void 0),rl([tV()],rI.prototype,"errorMessage",void 0),rI=rl([tB("or-mwc-input")],rI);var rS=function(t,e){return(rS=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])})(t,e)};function rz(t,e){function i(){this.constructor=t}rS(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}var rL=function(){return(rL=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}).apply(this,arguments)},rM="mdc-dom-focus-sentinel",rP=function(){function t(t,e){void 0===e&&(e={}),this.root=t,this.options=e,this.elFocusedBeforeTrapFocus=null}return t.prototype.trapFocus=function(){var t=this.getFocusableElements(this.root);if(0===t.length)throw Error("FocusTrap: Element must have at least one focusable child.");this.elFocusedBeforeTrapFocus=document.activeElement instanceof HTMLElement?document.activeElement:null,this.wrapTabFocus(this.root,t),this.options.skipInitialFocus||this.focusInitialElement(t,this.options.initialFocusEl)},t.prototype.releaseFocus=function(){[].slice.call(this.root.querySelectorAll("."+rM)).forEach(function(t){t.parentElement.removeChild(t)}),this.elFocusedBeforeTrapFocus&&this.elFocusedBeforeTrapFocus.focus()},t.prototype.wrapTabFocus=function(t,e){var i=this.createSentinel(),n=this.createSentinel();i.addEventListener("focus",function(){e.length>0&&e[e.length-1].focus()}),n.addEventListener("focus",function(){e.length>0&&e[0].focus()}),t.insertBefore(i,t.children[0]),t.appendChild(n)},t.prototype.focusInitialElement=function(t,e){var i=0;e&&(i=Math.max(t.indexOf(e),0)),t[i].focus()},t.prototype.getFocusableElements=function(t){return[].slice.call(t.querySelectorAll("[autofocus], [tabindex], a, input, textarea, select, button")).filter(function(t){var e="true"===t.getAttribute("aria-disabled")||null!=t.getAttribute("disabled")||null!=t.getAttribute("hidden")||"true"===t.getAttribute("aria-hidden"),i=t.tabIndex>=0&&t.getBoundingClientRect().width>0&&!t.classList.contains(rM)&&!e,n=!1;if(i){var r=getComputedStyle(t);n="none"===r.display||"hidden"===r.visibility}return i&&!n})},t.prototype.createSentinel=function(){var t=document.createElement("div");return t.setAttribute("tabindex","0"),t.setAttribute("aria-hidden","true"),t.classList.add(rM),t},t}(),rR={CLOSING:"mdc-dialog--closing",OPEN:"mdc-dialog--open",OPENING:"mdc-dialog--opening",SCROLLABLE:"mdc-dialog--scrollable",SCROLL_LOCK:"mdc-dialog-scroll-lock",STACKED:"mdc-dialog--stacked"},rO={ACTION_ATTRIBUTE:"data-mdc-dialog-action",BUTTON_DEFAULT_ATTRIBUTE:"data-mdc-dialog-button-default",BUTTON_SELECTOR:".mdc-dialog__button",CLOSED_EVENT:"MDCDialog:closed",CLOSE_ACTION:"close",CLOSING_EVENT:"MDCDialog:closing",CONTAINER_SELECTOR:".mdc-dialog__container",CONTENT_SELECTOR:".mdc-dialog__content",DESTROY_ACTION:"destroy",INITIAL_FOCUS_ATTRIBUTE:"data-mdc-dialog-initial-focus",OPENED_EVENT:"MDCDialog:opened",OPENING_EVENT:"MDCDialog:opening",SCRIM_SELECTOR:".mdc-dialog__scrim",SUPPRESS_DEFAULT_PRESS_SELECTOR:"textarea, .mdc-menu .mdc-list-item",SURFACE_SELECTOR:".mdc-dialog__surface"},rD={DIALOG_ANIMATION_CLOSE_TIME_MS:75,DIALOG_ANIMATION_OPEN_TIME_MS:150},rB=function(t){function e(i){var n=t.call(this,rL(rL({},e.defaultAdapter),i))||this;return n.isOpen_=!1,n.animationFrame_=0,n.animationTimer_=0,n.layoutFrame_=0,n.escapeKeyAction_=rO.CLOSE_ACTION,n.scrimClickAction_=rO.CLOSE_ACTION,n.autoStackButtons_=!0,n.areButtonsStacked_=!1,n.suppressDefaultPressSelector=rO.SUPPRESS_DEFAULT_PRESS_SELECTOR,n}return rz(e,t),Object.defineProperty(e,"cssClasses",{get:function(){return rR},enumerable:!0,configurable:!0}),Object.defineProperty(e,"strings",{get:function(){return rO},enumerable:!0,configurable:!0}),Object.defineProperty(e,"numbers",{get:function(){return rD},enumerable:!0,configurable:!0}),Object.defineProperty(e,"defaultAdapter",{get:function(){return{addBodyClass:function(){},addClass:function(){},areButtonsStacked:function(){return!1},clickDefaultButton:function(){},eventTargetMatches:function(){return!1},getActionFromEvent:function(){return""},getInitialFocusEl:function(){return null},hasClass:function(){return!1},isContentScrollable:function(){return!1},notifyClosed:function(){},notifyClosing:function(){},notifyOpened:function(){},notifyOpening:function(){},releaseFocus:function(){},removeBodyClass:function(){},removeClass:function(){},reverseButtons:function(){},trapFocus:function(){}}},enumerable:!0,configurable:!0}),e.prototype.init=function(){this.adapter.hasClass(rR.STACKED)&&this.setAutoStackButtons(!1)},e.prototype.destroy=function(){this.isOpen_&&this.close(rO.DESTROY_ACTION),this.animationTimer_&&(clearTimeout(this.animationTimer_),this.handleAnimationTimerEnd_()),this.layoutFrame_&&(cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=0)},e.prototype.open=function(){var t=this;this.isOpen_=!0,this.adapter.notifyOpening(),this.adapter.addClass(rR.OPENING),this.runNextAnimationFrame_(function(){t.adapter.addClass(rR.OPEN),t.adapter.addBodyClass(rR.SCROLL_LOCK),t.layout(),t.animationTimer_=setTimeout(function(){t.handleAnimationTimerEnd_(),t.adapter.trapFocus(t.adapter.getInitialFocusEl()),t.adapter.notifyOpened()},rD.DIALOG_ANIMATION_OPEN_TIME_MS)})},e.prototype.close=function(t){var e=this;void 0===t&&(t=""),this.isOpen_&&(this.isOpen_=!1,this.adapter.notifyClosing(t),this.adapter.addClass(rR.CLOSING),this.adapter.removeClass(rR.OPEN),this.adapter.removeBodyClass(rR.SCROLL_LOCK),cancelAnimationFrame(this.animationFrame_),this.animationFrame_=0,clearTimeout(this.animationTimer_),this.animationTimer_=setTimeout(function(){e.adapter.releaseFocus(),e.handleAnimationTimerEnd_(),e.adapter.notifyClosed(t)},rD.DIALOG_ANIMATION_CLOSE_TIME_MS))},e.prototype.isOpen=function(){return this.isOpen_},e.prototype.getEscapeKeyAction=function(){return this.escapeKeyAction_},e.prototype.setEscapeKeyAction=function(t){this.escapeKeyAction_=t},e.prototype.getScrimClickAction=function(){return this.scrimClickAction_},e.prototype.setScrimClickAction=function(t){this.scrimClickAction_=t},e.prototype.getAutoStackButtons=function(){return this.autoStackButtons_},e.prototype.setAutoStackButtons=function(t){this.autoStackButtons_=t},e.prototype.getSuppressDefaultPressSelector=function(){return this.suppressDefaultPressSelector},e.prototype.setSuppressDefaultPressSelector=function(t){this.suppressDefaultPressSelector=t},e.prototype.layout=function(){var t=this;this.layoutFrame_&&cancelAnimationFrame(this.layoutFrame_),this.layoutFrame_=requestAnimationFrame(function(){t.layoutInternal_(),t.layoutFrame_=0})},e.prototype.handleClick=function(t){if(this.adapter.eventTargetMatches(t.target,rO.SCRIM_SELECTOR)&&""!==this.scrimClickAction_)this.close(this.scrimClickAction_);else{var e=this.adapter.getActionFromEvent(t);e&&this.close(e)}},e.prototype.handleKeydown=function(t){var e="Enter"===t.key||13===t.keyCode;if(e&&!this.adapter.getActionFromEvent(t)){var i=t.composedPath?t.composedPath()[0]:t.target,n=!this.adapter.eventTargetMatches(i,this.suppressDefaultPressSelector);e&&n&&this.adapter.clickDefaultButton()}},e.prototype.handleDocumentKeydown=function(t){("Escape"===t.key||27===t.keyCode)&&""!==this.escapeKeyAction_&&this.close(this.escapeKeyAction_)},e.prototype.layoutInternal_=function(){this.autoStackButtons_&&this.detectStackedButtons_(),this.detectScrollableContent_()},e.prototype.handleAnimationTimerEnd_=function(){this.animationTimer_=0,this.adapter.removeClass(rR.OPENING),this.adapter.removeClass(rR.CLOSING)},e.prototype.runNextAnimationFrame_=function(t){var e=this;cancelAnimationFrame(this.animationFrame_),this.animationFrame_=requestAnimationFrame(function(){e.animationFrame_=0,clearTimeout(e.animationTimer_),e.animationTimer_=setTimeout(t,0)})},e.prototype.detectStackedButtons_=function(){this.adapter.removeClass(rR.STACKED);var t=this.adapter.areButtonsStacked();t&&this.adapter.addClass(rR.STACKED),t!==this.areButtonsStacked_&&(this.adapter.reverseButtons(),this.areButtonsStacked_=t)},e.prototype.detectScrollableContent_=function(){this.adapter.removeClass(rR.SCROLLABLE),this.adapter.isContentScrollable()&&this.adapter.addClass(rR.SCROLLABLE)},e}(eS),rF=rB.strings,rN=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return rz(e,t),Object.defineProperty(e.prototype,"isOpen",{get:function(){return this.foundation.isOpen()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"escapeKeyAction",{get:function(){return this.foundation.getEscapeKeyAction()},set:function(t){this.foundation.setEscapeKeyAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"scrimClickAction",{get:function(){return this.foundation.getScrimClickAction()},set:function(t){this.foundation.setScrimClickAction(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"autoStackButtons",{get:function(){return this.foundation.getAutoStackButtons()},set:function(t){this.foundation.setAutoStackButtons(t)},enumerable:!0,configurable:!0}),e.attachTo=function(t){return new e(t)},e.prototype.initialize=function(t){void 0===t&&(t=function(t,e){return new rP(t,e)});var e,i,n=this.root.querySelector(rF.CONTAINER_SELECTOR);if(!n)throw Error("Dialog component requires a "+rF.CONTAINER_SELECTOR+" container element");this.container_=n,this.content_=this.root.querySelector(rF.CONTENT_SELECTOR),this.buttons_=[].slice.call(this.root.querySelectorAll(rF.BUTTON_SELECTOR)),this.defaultButton_=this.root.querySelector("["+rF.BUTTON_DEFAULT_ATTRIBUTE+"]"),this.focusTrapFactory_=t,this.buttonRipples_=[];try{for(var r=function(t){var e="function"==typeof Symbol&&Symbol.iterator,i=e&&t[e],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}(this.buttons_),a=r.next();!a.done;a=r.next()){var o=a.value;this.buttonRipples_.push(new it(o))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}},e.prototype.initialSyncWithDOM=function(){var t,e=this;this.focusTrap_=(t=this.container_,(0,this.focusTrapFactory_)(t,{initialFocusEl:this.getInitialFocusEl_()||void 0})),this.handleClick_=this.foundation.handleClick.bind(this.foundation),this.handleKeydown_=this.foundation.handleKeydown.bind(this.foundation),this.handleDocumentKeydown_=this.foundation.handleDocumentKeydown.bind(this.foundation),this.handleLayout_=this.layout.bind(this);var i=["resize","orientationchange"];this.handleOpening_=function(){i.forEach(function(t){return window.addEventListener(t,e.handleLayout_)}),document.addEventListener("keydown",e.handleDocumentKeydown_)},this.handleClosing_=function(){i.forEach(function(t){return window.removeEventListener(t,e.handleLayout_)}),document.removeEventListener("keydown",e.handleDocumentKeydown_)},this.listen("click",this.handleClick_),this.listen("keydown",this.handleKeydown_),this.listen(rF.OPENING_EVENT,this.handleOpening_),this.listen(rF.CLOSING_EVENT,this.handleClosing_)},e.prototype.destroy=function(){this.unlisten("click",this.handleClick_),this.unlisten("keydown",this.handleKeydown_),this.unlisten(rF.OPENING_EVENT,this.handleOpening_),this.unlisten(rF.CLOSING_EVENT,this.handleClosing_),this.handleClosing_(),this.buttonRipples_.forEach(function(t){return t.destroy()}),t.prototype.destroy.call(this)},e.prototype.layout=function(){this.foundation.layout()},e.prototype.open=function(){this.foundation.open()},e.prototype.close=function(t){void 0===t&&(t=""),this.foundation.close(t)},e.prototype.getDefaultFoundation=function(){var t=this;return new rB({addBodyClass:function(t){return document.body.classList.add(t)},addClass:function(e){return t.root.classList.add(e)},areButtonsStacked:function(){var e,i;return e=t.buttons_,i=new Set,[].forEach.call(e,function(t){return i.add(t.offsetTop)}),i.size>1},clickDefaultButton:function(){return t.defaultButton_&&t.defaultButton_.click()},eventTargetMatches:function(t,e){return!!t&&eP(t,e)},getActionFromEvent:function(t){if(!t.target)return"";var e=eM(t.target,"["+rF.ACTION_ATTRIBUTE+"]");return e&&e.getAttribute(rF.ACTION_ATTRIBUTE)},getInitialFocusEl:function(){return t.getInitialFocusEl_()},hasClass:function(e){return t.root.classList.contains(e)},isContentScrollable:function(){var e;return!!(e=t.content_)&&e.scrollHeight>e.offsetHeight},notifyClosed:function(e){return t.emit(rF.CLOSED_EVENT,e?{action:e}:{})},notifyClosing:function(e){return t.emit(rF.CLOSING_EVENT,e?{action:e}:{})},notifyOpened:function(){return t.emit(rF.OPENED_EVENT,{})},notifyOpening:function(){return t.emit(rF.OPENING_EVENT,{})},releaseFocus:function(){return t.focusTrap_.releaseFocus()},removeBodyClass:function(t){return document.body.classList.remove(t)},removeClass:function(e){return t.root.classList.remove(e)},reverseButtons:function(){t.buttons_.reverse(),t.buttons_.forEach(function(t){t.parentElement.appendChild(t)})},trapFocus:function(){return t.focusTrap_.trapFocus()}})},e.prototype.getInitialFocusEl_=function(){return this.root.querySelector("["+rF.INITIAL_FOCUS_ATTRIBUTE+"]")},e}(ez),rV=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};let rU=o(253),r$=o(41);class rj extends CustomEvent{constructor(){super(rj.NAME,{bubbles:!0,composed:!0})}}rj.NAME="or-mwc-dialog-opened";class rH extends CustomEvent{constructor(t){super(rH.NAME,{detail:t,bubbles:!0,composed:!0})}}rH.NAME="or-mwc-dialog-closed";let rq=R`
861
861
  :host {
862
862
  position: relative;
863
863
  }
@@ -884,8 +884,8 @@ uniform ${i} ${n} u_${r};
884
884
  max-width: 1024px;
885
885
  }
886
886
  }
887
- `,r8=class extends tK{constructor(){super(...arguments),this._open=!1,this._popstateEventBind=t=>this._onBrowserNavigate(t)}static get styles(){return[tV`${tN(r5)}`,tV`${tN(r3)}`,r7]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(t){return this._open=!0,this}setHeading(t){return this.heading=t,this}setContent(t){return this.content=t,this}setActions(t){return this.actions=t,this}setDismissAction(t){return this.dismissAction=t,this}setStyles(t){return this.styles=t,this}setAvatar(t){return this.avatar=t,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new r1(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(t){this._mdcComponent&&this._mdcComponent.close(t)}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._popstateEventBind)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._popstateEventBind),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return tg`
888
- ${"string"==typeof this.styles?tg`<style>${this.styles}</style>`:this.styles||""}
887
+ `,rG=class extends tO{constructor(){super(...arguments),this._open=!1,this._popstateEventBind=t=>this._onBrowserNavigate(t)}static get styles(){return[R`${P(rU)}`,R`${P(r$)}`,rq]}get isOpen(){return!!this._mdcComponent&&this._mdcComponent.isOpen}setOpen(t){return this._open=!0,this}setHeading(t){return this.heading=t,this}setContent(t){return this.content=t,this}setActions(t){return this.actions=t,this}setDismissAction(t){return this.dismissAction=t,this}setStyles(t){return this.styles=t,this}setAvatar(t){return this.avatar=t,this}open(){this._mdcElem&&!this._mdcComponent&&(this._mdcComponent=new rN(this._mdcElem),this._mdcComponent.scrimClickAction=this.dismissAction||null===this.dismissAction?"close":""),this._mdcComponent&&this._mdcComponent.open()}close(t){this._mdcComponent&&this._mdcComponent.close(t)}connectedCallback(){super.connectedCallback(),window.addEventListener("popstate",this._popstateEventBind)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("popstate",this._popstateEventBind),this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0)}render(){return t_`
888
+ ${"string"==typeof this.styles?t_`<style>${this.styles}</style>`:this.styles||""}
889
889
 
890
890
  <div id="dialog"
891
891
  class="mdc-dialog"
@@ -897,49 +897,49 @@ uniform ${i} ${n} u_${r};
897
897
  @MDCDialog:closed="${t=>this._onDialogClosed(t.detail.action)}">
898
898
  <div class="mdc-dialog__container">
899
899
  <div class="mdc-dialog__surface" tabindex="0">
900
- ${"string"==typeof this.heading?tg`<h2 class="mdc-dialog__title" id="dialog-title"><or-translate value="${this.heading}"></or-translate></h2>`:this.heading?tg`<span class="mdc-dialog__title" id="dialog-title">${this.heading}</span>`:""}
901
- ${this.content?tg`
900
+ ${"string"==typeof this.heading?t_`<h2 class="mdc-dialog__title" id="dialog-title"><or-translate value="${this.heading}"></or-translate></h2>`:this.heading?t_`<span class="mdc-dialog__title" id="dialog-title">${this.heading}</span>`:""}
901
+ ${this.content?t_`
902
902
  <div class="dialog-container mdc-dialog__content" id="dialog-content">
903
903
  ${"function"==typeof this.content?this.content():this.content}
904
904
  </div>
905
905
  <footer class="mdc-dialog__actions">
906
- ${this.actions?this.actions.map(t=>tg`
906
+ ${this.actions?this.actions.map(t=>t_`
907
907
  <div class="mdc-button mdc-dialog__button" ?data-mdc-dialog-button-default="${t.default}" data-mdc-dialog-action="${t.disabled?void 0:t.actionName}">
908
- ${"string"==typeof t.content?tg`<or-mwc-input .type="${b.BUTTON}" @or-mwc-input-changed="${t=>{t.currentTarget.disabled&&t.stopPropagation()}}" .disabled="${t.disabled}" .label="${t.content}"></or-mwc-input>`:t.content}
908
+ ${"string"==typeof t.content?t_`<or-mwc-input .type="${h.BUTTON}" @or-mwc-input-changed="${t=>{t.currentTarget.disabled&&t.stopPropagation()}}" .disabled="${t.disabled}" .label="${t.content}"></or-mwc-input>`:t.content}
909
909
  </div>`):""}
910
910
  </footer>
911
- `:tg`
911
+ `:t_`
912
912
  <ul class="mdc-list ${this.avatar?"mdc-list--avatar-list":""}">
913
- ${!this.actions?"":this.actions.map((t,e)=>tg`<li class="mdc-list-item" data-mdc-dialog-action="${t.actionName}"><span class="mdc-list-item__text">${t.content}</span></li>`)}
913
+ ${!this.actions?"":this.actions.map((t,e)=>t_`<li class="mdc-list-item" data-mdc-dialog-action="${t.actionName}"><span class="mdc-list-item__text">${t.content}</span></li>`)}
914
914
  </ul>
915
915
  `}
916
916
  </div>
917
917
  </div>
918
918
  <div class="mdc-dialog__scrim"></div>
919
919
  </div>
920
- `}updated(t){super.updated(t),t.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new r4)}_onDialogClosed(t){if("close"===t&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(t&&this.actions){let e=this.actions.find(e=>e.actionName===t);e&&e.action&&e.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new r6(t))}_onBrowserNavigate(t){this.close("close")}};r2([t0({type:String})],r8.prototype,"heading",void 0),r2([t0({type:Object,attribute:!1})],r8.prototype,"content",void 0),r2([t0({type:Array,attribute:!1})],r8.prototype,"actions",void 0),r2([t0({type:Object,attribute:!1})],r8.prototype,"dismissAction",void 0),r2([t0({type:Boolean})],r8.prototype,"avatar",void 0),r2([t0()],r8.prototype,"styles",void 0),r2([t0({attribute:!1})],r8.prototype,"_open",void 0),r2([t2("#dialog")],r8.prototype,"_mdcElem",void 0),r8=r2([tQ("or-mwc-dialog")],r8);var r9=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class at extends CustomEvent{constructor(t){super(at.NAME,{bubbles:!0,composed:!0,detail:t})}}at.NAME="or-map-asset-card-load-asset";let ae={default:{exclude:["notes"]},assetTypes:{}},ai=class extends(0,v.subscribe)(x())(tK){constructor(){super(...arguments),this.useAssetColor=!0}static get styles(){return em}shouldUpdate(t){return(!t.has("assetId")||(this.title="",this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1!==t.size))&&super.shouldUpdate(t)}_onEvent(t){if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this.asset=t.asset;break;case"DELETE":this.asset=void 0}"attribute"===t.eventType&&this.asset&&(this.asset=v.Util.updateAsset(this.asset,t),this.requestUpdate())}getCardConfig(){let t=this.config||ae;return this.asset&&t.assetTypes&&t.assetTypes.hasOwnProperty(this.asset.type)?t.assetTypes[this.asset.type]:t.default}render(){if(!this.asset)return tg``;let t=this.getIcon(),e=this.getColor(),i=this.getCardConfig(),n=Object.values(this.asset.attributes).filter(t=>"location"!==t.name),r=i&&i.include?i.include:void 0,a=i&&i.exclude?i.exclude:[],o=n.filter(t=>(!r||r.indexOf(t.name)>=0)&&(!a||0>a.indexOf(t.name))&&(!t.meta||!t.meta.hasOwnProperty("showOnDashboard")||!!v.Util.getMetaValue("showOnDashboard",t))).sort(v.Util.sortByString(t=>t.name)),s=ex(this.markerconfig,this.asset.type);return tg`
920
+ `}updated(t){super.updated(t),t.has("_open")&&this._open&&this.open()}_onDialogOpened(){this.dispatchEvent(new rj)}_onDialogClosed(t){if("close"===t&&this.dismissAction&&this.dismissAction.action)this.dismissAction.action(this);else if(t&&this.actions){let e=this.actions.find(e=>e.actionName===t);e&&e.action&&e.action(this)}this._mdcComponent&&(this._mdcComponent.destroy(),this._mdcComponent=void 0),this.dispatchEvent(new rH(t))}_onBrowserNavigate(t){this.close("close")}};rV([tN({type:String})],rG.prototype,"heading",void 0),rV([tN({type:Object,attribute:!1})],rG.prototype,"content",void 0),rV([tN({type:Array,attribute:!1})],rG.prototype,"actions",void 0),rV([tN({type:Object,attribute:!1})],rG.prototype,"dismissAction",void 0),rV([tN({type:Boolean})],rG.prototype,"avatar",void 0),rV([tN()],rG.prototype,"styles",void 0),rV([tN({attribute:!1})],rG.prototype,"_open",void 0),rV([t$("#dialog")],rG.prototype,"_mdcElem",void 0),rG=rV([tB("or-mwc-dialog")],rG);var rX=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class rZ extends CustomEvent{constructor(t){super(rZ.NAME,{bubbles:!0,composed:!0,detail:t})}}rZ.NAME="or-map-asset-card-load-asset";let rW={default:{exclude:["notes"]},assetTypes:{}},rY=class extends(0,m.subscribe)(f())(tO){constructor(){super(...arguments),this.useAssetColor=!0}static get styles(){return et}shouldUpdate(t){return(!t.has("assetId")||(this.title="",this.assetIds=this.assetId&&this.assetId.length>0?[this.assetId]:void 0,1!==t.size))&&super.shouldUpdate(t)}_onEvent(t){if("asset"===t.eventType)switch(t.cause){case"READ":case"CREATE":case"UPDATE":this.asset=t.asset;break;case"DELETE":this.asset=void 0}"attribute"===t.eventType&&this.asset&&(this.asset=m.Util.updateAsset(this.asset,t),this.requestUpdate())}getCardConfig(){let t=this.config||rW;return this.asset&&t.assetTypes&&t.assetTypes.hasOwnProperty(this.asset.type)?t.assetTypes[this.asset.type]:t.default}render(){if(!this.asset)return t_``;let t=this.getIcon(),e=this.getColor(),i=this.getCardConfig(),n=Object.values(this.asset.attributes).filter(t=>"location"!==t.name),r=i&&i.include?i.include:void 0,a=i&&i.exclude?i.exclude:[],o=n.filter(t=>(!r||r.indexOf(t.name)>=0)&&(!a||0>a.indexOf(t.name))&&(!t.meta||!t.meta.hasOwnProperty("showOnDashboard")||!!m.Util.getMetaValue("showOnDashboard",t))).sort(m.Util.sortByString(t=>t.name)),s=es(this.markerconfig,this.asset.type);return t_`
921
921
  <div id="card-container" style="${e?"--internal-or-map-asset-card-header-color: #"+e+";":""}">
922
922
  <div id="header">
923
- ${t?tg`<or-icon icon="${t}"></or-icon>`:""}
923
+ ${t?t_`<or-icon icon="${t}"></or-icon>`:""}
924
924
  <span id="title">${this.asset.name}</span>
925
925
  </div>
926
926
  <div id="attribute-list">
927
927
  <ul>
928
- ${o.map(t=>{if(!this.asset||!this.asset.type)return;let e=t8.AssetModelUtil.getAttributeAndValueDescriptors(this.asset.type,t.name,t);if(e&&e.length){let i=v.Util.getAttributeLabel(t,e[0],this.asset.type,!0),n=v.Util.getAttributeValueAsString(t,e[0],this.asset.type,!1,"-"),r={highlighted:s===t.name};return tg`<li class="${eO(r)}"><span class="attribute-name">${i}</span><span class="attribute-value">${n}</span></li>`}})}
928
+ ${o.map(t=>{if(!this.asset||!this.asset.type)return;let e=tZ.AssetModelUtil.getAttributeAndValueDescriptors(this.asset.type,t.name,t);if(e&&e.length){let i=m.Util.getAttributeLabel(t,e[0],this.asset.type,!0),n=m.Util.getAttributeValueAsString(t,e[0],this.asset.type,!1,"-"),r={highlighted:s===t.name};return t_`<li class="${ex(r)}"><span class="attribute-name">${i}</span><span class="attribute-value">${n}</span></li>`}})}
929
929
  </ul>
930
930
  </div>
931
- ${i&&i.hideViewAsset?tg``:tg`
931
+ ${i&&i.hideViewAsset?t_``:t_`
932
932
  <div id="footer">
933
- <or-mwc-input .type="${b.BUTTON}" label="viewAsset" @or-mwc-input-changed="${t=>{t.preventDefault(),this._loadAsset(this.asset.id)}}"></or-mwc-input>
933
+ <or-mwc-input .type="${h.BUTTON}" label="viewAsset" @or-mwc-input-changed="${t=>{t.preventDefault(),this._loadAsset(this.asset.id)}}"></or-mwc-input>
934
934
  </div>
935
935
  `}
936
936
  </div>
937
- `}_loadAsset(t){this.dispatchEvent(new at(t))}getIcon(){var t;if(this.asset)return(null==(t=en(t8.AssetModelUtil.getAssetDescriptor(this.asset.type)))?void 0:t.icon)||void 0}getColor(){var t;if(this.asset){let e=null==(t=en(t8.AssetModelUtil.getAssetDescriptor(this.asset.type)))?void 0:t.color;if(e)return"string"==typeof e?e:e[0].colour}}};r9([t0({type:String,reflect:!0,attribute:!0})],ai.prototype,"assetId",void 0),r9([t0({type:Object,attribute:!0})],ai.prototype,"asset",void 0),r9([t0({type:Object})],ai.prototype,"config",void 0),r9([t0({type:Object})],ai.prototype,"markerconfig",void 0),r9([t0({type:Boolean,attribute:!0})],ai.prototype,"useAssetColor",void 0),ai=r9([tQ("or-map-asset-card")],ai);var an=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class ar extends CustomEvent{constructor(){super(ar.NAME,{bubbles:!0,composed:!0})}}ar.NAME="or-map-loaded";class aa extends CustomEvent{constructor(t,e=!1){super(aa.NAME,{detail:{doubleClick:e,lngLat:t},bubbles:!0,composed:!0})}}aa.NAME="or-map-clicked";class ao extends CustomEvent{constructor(t){super(ao.NAME,{detail:{doubleClick:!1,lngLat:t},bubbles:!0,composed:!0})}}ao.NAME="or-map-long-press";class as extends CustomEvent{constructor(t){super(as.NAME,{detail:{geocode:t},bubbles:!0,composed:!0})}}as.NAME="or-map-geocoder-change";class al{onAdd(t){this.map=t;let e=document.createElement("div");e.classList.add("maplibregl-ctrl"),e.classList.add("maplibregl-ctrl-group");let i=document.createElement("button");i.className="maplibregl-ctrl-compass",i.addEventListener("click",e=>t.flyTo({center:this.pos,zoom:t.getZoom()}));let n=document.createElement("span");return n.className="maplibregl-ctrl-icon",i.appendChild(n),e.appendChild(i),this.elem=e,e}onRemove(t){this.map=void 0,this.elem=void 0}}let ac="^[ ]*(?:Lat: )?(-?\\d+\\.?\\d*)[, ]+(?:Lng: )?(-?\\d+\\.?\\d*)[ ]*$";function ad(t){return e=>{if("Enter"===e.code||"NumpadEnter"===e.code){let i=e.target.value,n=i?{}:void 0;if(i){let t=i.split(/[ ,]/).filter(t=>!!t);2===t.length&&(n=new t5.LngLat(Number.parseFloat(t[0]),Number.parseFloat(t[1])))}t(n)}}}class au{constructor(t=!1,e){this._readonly=!1,this._readonly=t,this._valueChangedHandler=e}onAdd(t){this.map=t;let e=document.createElement("div");e.classList.add("maplibregl-ctrl"),e.classList.add("maplibregl-ctrl-group");let i=new rH;return i.type=b.TEXT,i.outlined=!0,i.compact=!0,i.readonly=this._readonly,i.icon="crosshairs-gps",i.value=this._value,i.pattern=ac,i.onkeyup=ad(this._valueChangedHandler),e.appendChild(i),this.elem=e,this.input=i,e}onRemove(t){this.map=void 0,this.elem=void 0}set readonly(t){this._readonly=t,this.input&&(this.input.readonly=t)}set value(t){this._value=t,this.input&&(this.input.value=t)}}let ah=(t,e,i,n,r,a)=>{let o,s=!!(a&&a.disabled),l=!!(a&&a.readonly),c=!!(a&&a.compact),d=!!(a&&a.comfortable),u=new al,h=t=>{r&&(void 0!==t?r({value:t?et(t):null}):r(void 0))},p=new au(s,h);return{templateFunction:(e,i,n,r,a,m)=>{let f,g;e&&(f=(o=t9(e))?Object.values(o):void 0);let _=f?f.join(", "):void 0;u.pos=o||void 0,p.readonly=s||l||r||n,p.value=_;let y=en(t),v=t=>{if(!l&&!s)if(o=t?t9(t):null,g){let t=g.shadowRoot.getElementById("geo-json-point-marker");t.lng=o?o.lng:void 0,t.lat=o?o.lat:void 0,p.value=(f=o?Object.values(o):void 0)?f.join(", "):void 0}else h(o)},x=[[u,"bottom-left"],[p,"top-right"]];if(!l){let t=new t5.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!1,showUserLocation:!1});t.on("geolocate",t=>{v(new t5.LngLat(t.coords.longitude,t.coords.latitude))}),t.on("outofmaxbounds",t=>{v(new t5.LngLat(t.coords.longitude,t.coords.latitude))}),x.push([t,"bottom-left"])}let w=tg`
938
- <or-map id="geo-json-point-map" class="or-map" @or-map-long-press="${t=>{v(t.detail.lngLat)}}" .center="${f}" .controls="${x}" .showGeoCodingControl=${!l}>
937
+ `}_loadAsset(t){this.dispatchEvent(new rZ(t))}getIcon(){var t;if(this.asset)return(null==(t=tQ(tZ.AssetModelUtil.getAssetDescriptor(this.asset.type)))?void 0:t.icon)||void 0}getColor(){var t;if(this.asset){let e=null==(t=tQ(tZ.AssetModelUtil.getAssetDescriptor(this.asset.type)))?void 0:t.color;if(e)return"string"==typeof e?e:e[0].colour}}};rX([tN({type:String,reflect:!0,attribute:!0})],rY.prototype,"assetId",void 0),rX([tN({type:Object,attribute:!0})],rY.prototype,"asset",void 0),rX([tN({type:Object})],rY.prototype,"config",void 0),rX([tN({type:Object})],rY.prototype,"markerconfig",void 0),rX([tN({type:Boolean,attribute:!0})],rY.prototype,"useAssetColor",void 0),rY=rX([tB("or-map-asset-card")],rY);var rK=function(t,e,i,n){var r,a=arguments.length,o=a<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(o=(a<3?r(o):a>3?r(e,i,o):r(e,i))||o);return a>3&&o&&Object.defineProperty(e,i,o),o};class rJ extends CustomEvent{constructor(){super(rJ.NAME,{bubbles:!0,composed:!0})}}rJ.NAME="or-map-loaded";class rQ extends CustomEvent{constructor(t,e=!1){super(rQ.NAME,{detail:{doubleClick:e,lngLat:t},bubbles:!0,composed:!0})}}rQ.NAME="or-map-clicked";class r0 extends CustomEvent{constructor(t){super(r0.NAME,{detail:{doubleClick:!1,lngLat:t},bubbles:!0,composed:!0})}}r0.NAME="or-map-long-press";class r1 extends CustomEvent{constructor(t){super(r1.NAME,{detail:{geocode:t},bubbles:!0,composed:!0})}}r1.NAME="or-map-geocoder-change";class r2{onAdd(t){this.map=t;let e=document.createElement("div");e.classList.add("maplibregl-ctrl"),e.classList.add("maplibregl-ctrl-group");let i=document.createElement("button");i.className="maplibregl-ctrl-compass",i.addEventListener("click",e=>t.flyTo({center:this.pos,zoom:t.getZoom()}));let n=document.createElement("span");return n.className="maplibregl-ctrl-icon",i.appendChild(n),e.appendChild(i),this.elem=e,e}onRemove(t){this.map=void 0,this.elem=void 0}}let r5="^[ ]*(?:Lat: )?(-?\\d+\\.?\\d*)[, ]+(?:Lng: )?(-?\\d+\\.?\\d*)[ ]*$";function r3(t){return e=>{if("Enter"===e.code||"NumpadEnter"===e.code){let i=e.target.value,n=i?{}:void 0;if(i){let t=i.split(/[ ,]/).filter(t=>!!t);2===t.length&&(n=new tj.LngLat(Number.parseFloat(t[0]),Number.parseFloat(t[1])))}t(n)}}}class r4{constructor(t=!1,e){this._readonly=!1,this._readonly=t,this._valueChangedHandler=e}onAdd(t){this.map=t;let e=document.createElement("div");e.classList.add("maplibregl-ctrl"),e.classList.add("maplibregl-ctrl-group");let i=new rI;return i.type=h.TEXT,i.outlined=!0,i.compact=!0,i.readonly=this._readonly,i.icon="crosshairs-gps",i.value=this._value,i.pattern=r5,i.onkeyup=r3(this._valueChangedHandler),e.appendChild(i),this.elem=e,this.input=i,e}onRemove(t){this.map=void 0,this.elem=void 0}set readonly(t){this._readonly=t,this.input&&(this.input.readonly=t)}set value(t){this._value=t,this.input&&(this.input.value=t)}}let r6=(t,e,i,n,r,a)=>{let o,s=!!(a&&a.disabled),l=!!(a&&a.readonly),c=!!(a&&a.compact),d=!!(a&&a.comfortable),u=new r2,p=t=>{r&&(void 0!==t?r({value:t?tY(t):null}):r(void 0))},m=new r4(s,p);return{templateFunction:(e,i,n,r,a,f)=>{let g,_;e&&(g=(o=tW(e))?Object.values(o):void 0);let b=g?g.join(", "):void 0;u.pos=o||void 0,m.readonly=s||l||r||n,m.value=b;let y=tQ(t),v=t=>{if(!l&&!s)if(o=t?tW(t):null,_){let t=_.shadowRoot.getElementById("geo-json-point-marker");t.lng=o?o.lng:void 0,t.lat=o?o.lat:void 0,m.value=(g=o?Object.values(o):void 0)?g.join(", "):void 0}else p(o)},x=[[u,"bottom-left"],[m,"top-right"]];if(!l){let t=new tj.GeolocateControl({positionOptions:{enableHighAccuracy:!0},showAccuracyCircle:!1,showUserLocation:!1});t.on("geolocate",t=>{v(new tj.LngLat(t.coords.longitude,t.coords.latitude))}),t.on("outofmaxbounds",t=>{v(new tj.LngLat(t.coords.longitude,t.coords.latitude))}),x.push([t,"bottom-left"])}let w=t_`
938
+ <or-map id="geo-json-point-map" class="or-map" @or-map-long-press="${t=>{v(t.detail.lngLat)}}" .center="${g}" .controls="${x}" .showGeoCodingControl=${!l}>
939
939
  <or-map-marker id="geo-json-point-marker" active .lng="${o?o.lng:void 0}" .lat="${o?o.lat:void 0}" .icon="${y?y.icon:void 0}" .activeColor="${y?"#"+y.color:void 0}" .colour="${y?"#"+y.color:void 0}"></or-map-marker>
940
940
  </or-map>
941
- <span class="long-press-msg">${rf.i18next.t("longPressSetLoc")}</span>
942
- `;if(c){let t=w;w=tg`
941
+ <span class="long-press-msg">${n9.i18next.t("longPressSetLoc")}</span>
942
+ `;if(c){let t=w;w=t_`
943
943
  <style>
944
944
  #geo-json-point-input-compact-wrapper {
945
945
  display: table-cell;
@@ -949,8 +949,8 @@ uniform ${i} ${n} u_${r};
949
949
  }
950
950
  </style>
951
951
  <div id="geo-json-point-input-compact-wrapper">
952
- <or-mwc-input style="width: auto;" .comfortable="${d}" .type="${b.TEXT}" .value="${_}" .pattern="${ac}" @keyup="${t=>ad(h)(t)}"></or-mwc-input>
953
- <or-mwc-input style="width: auto;" .type="${b.BUTTON}" compact icon="crosshairs-gps" @or-mwc-input-changed="${()=>{g=function(t,e){return e||(e=r8.DialogHostElement||document.body),t.setOpen(!0),t.addEventListener(r4.NAME,t=>{t.stopPropagation()}),t.addEventListener(r6.NAME,e=>{e.stopPropagation(),window.setTimeout(()=>{t.parentElement&&t.parentElement.removeChild(t)},0)}),e.append(t),t}(new r8().setContent(t).setStyles(tg`
952
+ <or-mwc-input style="width: auto;" .comfortable="${d}" .type="${h.TEXT}" .value="${b}" .pattern="${r5}" @keyup="${t=>r3(p)(t)}"></or-mwc-input>
953
+ <or-mwc-input style="width: auto;" .type="${h.BUTTON}" compact icon="crosshairs-gps" @or-mwc-input-changed="${()=>{_=function(t,e){return e||(e=rG.DialogHostElement||document.body),t.setOpen(!0),t.addEventListener(rj.NAME,t=>{t.stopPropagation()}),t.addEventListener(rH.NAME,e=>{e.stopPropagation(),window.setTimeout(()=>{t.parentElement&&t.parentElement.removeChild(t)},0)}),e.append(t),t}(new rG().setContent(t).setStyles(t_`
954
954
  <style>
955
955
  .dialog-container {
956
956
  flex-direction: column !important;
@@ -964,9 +964,9 @@ uniform ${i} ${n} u_${r};
964
964
  min-height: 600px !important;
965
965
  }
966
966
  </style>
967
- `).setActions([{actionName:"none",content:"none",action:()=>{v(null),h(o)}},{actionName:"ok",content:"ok",action:()=>{h(o)}},{default:!0,actionName:"cancel",content:"cancel"}]))}}"></or-mwc-input>
967
+ `).setActions([{actionName:"none",content:"none",action:()=>{v(null),p(o)}},{actionName:"ok",content:"ok",action:()=>{p(o)}},{default:!0,actionName:"cancel",content:"cancel"}]))}}"></or-mwc-input>
968
968
  </div>
969
- `}return w},supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!o||void 0!==o.lat&&null!==o.lat&&void 0!==o.lng&&null!==o.lng}},ap=class extends tK{constructor(){super(),this.type=x().mapType,this._markerStyles=[],this.showGeoCodingControl=!1,this.showBoundaryBoxControl=!1,this.useZoomControl=!0,this.showGeoJson=!0,this.boundary=[],this._loaded=!1,this._markers=[],this.addEventListener(eg.NAME,this._onMarkerChangedEvent)}firstUpdated(t){super.firstUpdated(t),x().ready&&this.loadMap()}get markers(){return this._markers}connectedCallback(){super.connectedCallback()}disconnectedCallback(){var t;super.disconnectedCallback(),this._observer&&this._observer.disconnect(),this._resizeObserver&&this._resizeObserver.disconnect(),null==(t=this._map)||t.unload()}render(){return tg`
969
+ `}return w},supportsHelperText:!1,supportsLabel:!1,supportsSendButton:!1,validator:()=>!o||void 0!==o.lat&&null!==o.lat&&void 0!==o.lng&&null!==o.lng}},r7=class extends tO{constructor(){super(),this.type=f().mapType,this._markerStyles=[],this.showGeoCodingControl=!1,this.showBoundaryBoxControl=!1,this.useZoomControl=!0,this.showGeoJson=!0,this.boundary=[],this._loaded=!1,this._markers=[],this.addEventListener(ei.NAME,this._onMarkerChangedEvent)}firstUpdated(t){super.firstUpdated(t),f().ready&&this.loadMap()}get markers(){return this._markers}connectedCallback(){super.connectedCallback()}disconnectedCallback(){var t;super.disconnectedCallback(),this._observer&&this._observer.disconnect(),this._resizeObserver&&this._resizeObserver.disconnect(),null==(t=this._map)||t.unload()}render(){return t_`
970
970
  <div id="container">
971
971
  <div id="map"></div>
972
972
  <slot></slot>
@@ -974,5 +974,5 @@ uniform ${i} ${n} u_${r};
974
974
  <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAP+Hj8y/AAAESUlEQVRIx5XVbWzdZRnH8c//f07POe36sK7SrYXZjYGzbBokOqd4QtKATdnMDFFSkoFzmWGRQOAFSoYnsBSzxBdmGsN4Y7LEFwZkUdHpDoja/AnJjBvp1sm2upW5PtAV+zBS+7Tz//tiLe0emPF+d9/39fvmunJf9+8K3HBF1drFzurVn5+5XkTwPwBNOt1s0pCjDnnT+Xzy/wOa5jaXnLLfLwzlF0WENwaYckyvUTHS1tnjl+6JFqk+JoMOqqy2JqjPVpXP1k7U1+Ty8paBPk97NX/pYwEdgZUetNkdlirDrHGnyv6y5r3lm4M2WVzwpJfz8XUBHTntnrJO6qqLWE9u/125zBNq0WebN/PXAjqq/cBOVWDasCEsd5MsmEzt/3xP+S6fwNsezPdfBejI6fCEDMa95oAT/t31pVxDQ6p6oy2WYSb18w0D2V3Klez2w3y8CNAR2G6vShxXUCxMkXLvS7Y6E/5+3emaJ92JqezzG+8M2nHW/flTi59xladU4phtfluYgnsDWUt8Nv7+8UfO73UUuenvDLxuCKu0RQt90BFo14wxzzpamD8uExtHSsu5HSP7XMCtZ5uTPyO0SdVCBlXahHjNG4WFrGY9Y4tXzODL7zb7NYJS64eHzWK92xYAa9yBKa8Wphf0xaQ4XOz0qF9JhMnXh//mIm4dnDSMOusWALepwQUnrm2t4pi9hrGyP+ccloxV6kOZFemoWi2mOpclaQycqGlt9R8XHS/GixinnVWvbDpjDEEpNpdnWrtd+HvZWzMQT9xjj1iXzUau6MPS9X9NKOeTmqzPpZWwfMkEKnza2ivimqxCKZjQa9BMmFI2D+gxibql4z7EiobYOSy1o7V6Xt1aYacGvD/7lse1+GZ9t0Zc8kHaGcOa1K6o+FePL1iy7K7wYHy70FZa9+qVWOm7tgslfpecKcy46GS0xXKM6g6d14VU+RfTnRJ8Y223w8j4tkMOOeR1j6nAMT8tzkCUcvlbn3ImbJn0RyWC+1af1Iv6ukcbf+aIRKDR3b5ipVCiy+PenaupWRsSfzCWim0ftUmdiqrJwWLpbmk3196UfXG0X6NKIWKDXva0I0UQZT2nRaDfc/mhgCj0PS9ImZzefbg5fliIvuTA++/0ZaYDTDqqpzhn6lHoW36iSuLHnslfCiBqdMBGDI6/0LUhfkgGiWFbC29c+epRaJMX3YJuD+R75l15wG4DaKh5dsPJsj0GXLaawavkWY/MyUcU/JOPHCkK7fAjNZiIf/PeX/vWx1814muF0Y/EKWs95mFVuKhgX352EYAoY5vnNSDRF/9p/MgHfQ2dldNIqbPeJm2aBBix20vzg26RpUUpLfb43FxZU4YMmEJGoxXKQeIfCg4uzMkrTDVitZ0ecst1B05i0Cv26Vk8H68JjFKabXa/Zkul5w5Lxp120EHdlyu/AQCiQI1P+YxaGcwY1+20kasnM/wXCa5/Ik1hKTEAAAAldEVYdGRhdGU6Y3JlYXRlADIwMTktMDgtMjBUMTU6MTc6NTUrMDA6MDCwJSdSAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE5LTA4LTIwVDE1OjE3OjU1KzAwOjAwwXif7gAAAABJRU5ErkJggg==" />
975
975
  </a>
976
976
  </div>
977
- `}updated(t){var e;super.updated(t),(t.has("center")||t.has("zoom"))&&this.flyTo(this.center,this.zoom),t.has("boundary")&&this.showBoundaryBoxControl&&(null==(e=this._map)||e.createBoundaryBox(this.boundary))}refresh(){this._map&&this._map.loadViewSettings().then(()=>{this._map&&(this._map.setCenter(),this._map.flyTo())})}loadMap(){this._loaded||(this._mapContainer&&this._slotElement&&(this._map=new ed(this.type,this.shadowRoot,this._mapContainer,this.showGeoCodingControl,this.showBoundaryBoxControl,this.useZoomControl,this.showGeoJson).setCenter(this.center).setZoom(this.zoom).setControls(this.controls).setGeoJson(this.geoJson),this._map.load().then(()=>{this._observer=new P(this._slotElement,t=>{this._processNewMarkers(t.addedNodes),this._processRemovedMarkers(t.removedNodes)}),null==(t=this._resizeObserver)||t.disconnect(),this._resizeObserver=new ResizeObserver((0,t7.debounce)(()=>{this.resize()},200));var t,e,i=null==(e=this._mapContainer)?void 0:e.parentElement;i&&this._resizeObserver.observe(i)})),this._loaded=!0)}resize(){this._map&&this._map.resize()}flyTo(t,e){this._map&&this._map.flyTo(t,e)}_onMarkerChangedEvent(t){this._map&&this._map.onMarkerChanged(t.detail.marker,t.detail.property)}_processNewMarkers(t){t.forEach(t=>{if(this._map&&t instanceof eb){this._markers.push(t);let e=t.constructor.name;if(0>this._markerStyles.indexOf(e)){let i=t.constructor.styles,n=[];i&&(Array.isArray(i)?n=i:n.push(i),n.forEach(t=>{let e=document.createElement("style");e.textContent=String(t.toString()),this._mapContainer.children.length>0?this._mapContainer.insertBefore(e,this._mapContainer.children[0]):this._mapContainer.appendChild(e)})),this._markerStyles.push(e)}this._map.addMarker(t)}})}_processRemovedMarkers(t){t.forEach(t=>{if(this._map&&t instanceof eb){let e=this._markers.indexOf(t);e>=0&&this._markers.splice(e,1),this._map.removeMarker(t)}})}};ap.styles=ep,an([t0({type:String})],ap.prototype,"type",void 0),an([t0({type:String,converter:{fromAttribute(t,e){if(!t)return;let i=t.split(",");if(2!==i.length)return;let n=Number(i[0]),r=Number(i[1]);return new t5.LngLat(n,r)},toAttribute(t,e){let i=t9(t);return i?""+i.lng+","+i.lat:""}}})],ap.prototype,"center",void 0),an([t0({type:Number})],ap.prototype,"zoom",void 0),an([t0({type:Boolean})],ap.prototype,"showGeoCodingControl",void 0),an([t0({type:Boolean})],ap.prototype,"showBoundaryBoxControl",void 0),an([t0({type:Boolean})],ap.prototype,"useZoomControl",void 0),an([t0({type:Object})],ap.prototype,"geoJson",void 0),an([t0({type:Boolean})],ap.prototype,"showGeoJson",void 0),an([t0({type:Array})],ap.prototype,"boundary",void 0),an([t2("#map")],ap.prototype,"_mapContainer",void 0),an([t2("slot")],ap.prototype,"_slotElement",void 0),ap=an([tQ("or-map")],ap)})(),s})());
977
+ `}updated(t){var e;super.updated(t),(t.has("center")||t.has("zoom"))&&this.flyTo(this.center,this.zoom),t.has("boundary")&&this.showBoundaryBoxControl&&(null==(e=this._map)||e.createBoundaryBox(this.boundary))}refresh(){this._map&&this._map.loadViewSettings().then(()=>{this._map&&(this._map.setCenter(),this._map.flyTo())})}loadMap(){this._loaded||(this._mapContainer&&this._slotElement&&(this._map=new t6(this.type,this.shadowRoot,this._mapContainer,this.showGeoCodingControl,this.showBoundaryBoxControl,this.useZoomControl,this.showGeoJson).setCenter(this.center).setZoom(this.zoom).setControls(this.controls).setGeoJson(this.geoJson),this._map.load().then(()=>{this._observer=new A(this._slotElement,t=>{this._processNewMarkers(t.addedNodes),this._processRemovedMarkers(t.removedNodes)}),null==(t=this._resizeObserver)||t.disconnect(),this._resizeObserver=new ResizeObserver((0,tX.debounce)(()=>{this.resize()},200));var t,e,i=null==(e=this._mapContainer)?void 0:e.parentElement;i&&this._resizeObserver.observe(i)})),this._loaded=!0)}resize(){this._map&&this._map.resize()}flyTo(t,e){this._map&&this._map.flyTo(t,e)}_onMarkerChangedEvent(t){this._map&&this._map.onMarkerChanged(t.detail.marker,t.detail.property)}_processNewMarkers(t){t.forEach(t=>{if(this._map&&t instanceof er){this._markers.push(t);let e=t.constructor.name;if(0>this._markerStyles.indexOf(e)){let i=t.constructor.styles,n=[];i&&(Array.isArray(i)?n=i:n.push(i),n.forEach(t=>{let e=document.createElement("style");e.textContent=String(t.toString()),this._mapContainer.children.length>0?this._mapContainer.insertBefore(e,this._mapContainer.children[0]):this._mapContainer.appendChild(e)})),this._markerStyles.push(e)}this._map.addMarker(t)}})}_processRemovedMarkers(t){t.forEach(t=>{if(this._map&&t instanceof er){let e=this._markers.indexOf(t);e>=0&&this._markers.splice(e,1),this._map.removeMarker(t)}})}};r7.styles=t9,rK([tN({type:String})],r7.prototype,"type",void 0),rK([tN({type:String,converter:{fromAttribute(t,e){if(!t)return;let i=t.split(",");if(2!==i.length)return;let n=Number(i[0]),r=Number(i[1]);return new tj.LngLat(n,r)},toAttribute(t,e){let i=tW(t);return i?""+i.lng+","+i.lat:""}}})],r7.prototype,"center",void 0),rK([tN({type:Number})],r7.prototype,"zoom",void 0),rK([tN({type:Boolean})],r7.prototype,"showGeoCodingControl",void 0),rK([tN({type:Boolean})],r7.prototype,"showBoundaryBoxControl",void 0),rK([tN({type:Boolean})],r7.prototype,"useZoomControl",void 0),rK([tN({type:Object})],r7.prototype,"geoJson",void 0),rK([tN({type:Boolean})],r7.prototype,"showGeoJson",void 0),rK([tN({type:Array})],r7.prototype,"boundary",void 0),rK([t$("#map")],r7.prototype,"_mapContainer",void 0),rK([t$("slot")],r7.prototype,"_slotElement",void 0),r7=rK([tB("or-map")],r7)})(),s})());
978
978
  //# sourceMappingURL=index.bundle.js.map