geoproject-app/public/site/plugins/map-editor/index.js

612 lines
800 KiB
JavaScript
Raw Normal View History

(function(){"use strict";function sd(d){return d&&d.__esModule&&Object.prototype.hasOwnProperty.call(d,"default")?d.default:d}var Bo={exports:{}},od=Bo.exports,xu;function ld(){return xu||(xu=1,(function(d,S){(function(M,L){d.exports=L()})(od,(function(){var M,L,R;function ee(l,ue){if(!M)M=ue;else if(!L)L=ue;else{var X="var sharedChunk = {}; ("+M+")(sharedChunk); ("+L+")(sharedChunk);",Fe={};M(Fe),R=ue(Fe),typeof window<"u"&&(R.workerUrl=window.URL.createObjectURL(new Blob([X],{type:"text/javascript"})))}}ee(["exports"],(function(l){function ue(i,e,r,a){return new(r||(r=Promise))((function(o,p){function f(v){try{y(a.next(v))}catch(w){p(w)}}function m(v){try{y(a.throw(v))}catch(w){p(w)}}function y(v){var w;v.done?o(v.value):(w=v.value,w instanceof r?w:new r((function(A){A(w)}))).then(f,m)}y((a=a.apply(i,e||[])).next())}))}function X(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}typeof SuppressedError=="function"&&SuppressedError;var Fe=be;function be(i,e){this.x=i,this.y=e}be.prototype={clone:function(){return new be(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,e){return this.clone()._rotateAround(i,e)},matMult:function(i){return this.clone()._matMult(i)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var e=i.x-this.x,r=i.y-this.y;return e*e+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,e){return Math.atan2(this.x*e-this.y*i,this.x*i+this.y*e)},_matMult:function(i){var e=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=e,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var e=Math.cos(i),r=Math.sin(i),a=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=a,this},_rotateAround:function(i,e){var r=Math.cos(i),a=Math.sin(i),o=e.y+a*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-a*(this.y-e.y),this.y=o,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},be.convert=function(i){return i instanceof be?i:Array.isArray(i)?new be(i[0],i[1]):i};var ye=X(Fe),we=Re;function Re(i,e,r,a){this.cx=3*i,this.bx=3*(r-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(a-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=e,this.p2x=r,this.p2y=a}Re.prototype={sampleCurveX:function(i){return((this.ax*i+this.bx)*i+this.cx)*i},sampleCurveY:function(i){return((this.ay*i+this.by)*i+this.cy)*i},sampleCurveDerivativeX:function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},solveCurveX:function(i,e){if(e===void 0&&(e=1e-6),i<0)return 0;if(i>1)return 1;for(var r=i,a=0;a<8;a++){var o=this.sampleCurveX(r)-i;if(Math.abs(o)<e)return r;var p=this.sampleCurveDerivativeX(r);if(Math.abs(p)<1e-6)break;r-=o/p}var f=0,m=1;for(r=i,a=0;a<20&&(o=this.sampleCurveX(r),!(Math.abs(o-i)<e));a++)i>o?f=r:m=r,r=.5*(m-f)+f;return r},solve:function(i,e){return this.sampleCurveY(this.solveCurveX(i,e))}};var We=X(we);let nt,st;function tt(){return nt==null&&(nt=type
Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(A[1])} }\`.`)];const k=[];return i.layerType==="symbol"&&(m==="text-field"&&o&&!o.glyphs&&k.push(new Ie(r,f,'use of "text-field" requires a style "glyphs" property')),m==="text-font"&&Bt(bn(f))&&$t(f.type)==="identity"&&k.push(new Ie(r,f,'"text-font" does not support identity functions'))),k.concat(a({key:i.key,value:f,valueSpec:w,style:o,styleSpec:p,expressionContext:"property",propertyType:e,propertyKey:m}))}function hl(i){return ul(i,"paint")}function pl(i){return ul(i,"layout")}function dl(i){let e=[];const r=i.value,a=i.key,o=i.style,p=i.styleSpec;r.type||r.ref||e.push(new Ie(a,r,'either "type" or "ref" is required'));let f=$t(r.type);const m=$t(r.ref);if(r.id){const y=$t(r.id);for(let v=0;v<i.arrayIndex;v++){const w=o.layers[v];$t(w.id)===y&&e.push(new Ie(a,r.id,`duplicate layer id "${r.id}", previously used at line ${w.id.__line__}`))}}if("ref"in r){let y;["type","source","source-layer","filter","layout"].forEach((v=>{v in r&&e.push(new Ie(a,r[v],`"${v}" is prohibited for ref layers`))})),o.layers.forEach((v=>{$t(v.id)===m&&(y=v)})),y?y.ref?e.push(new Ie(a,r.ref,"ref cannot reference another ref layer")):f=$t(y.type):e.push(new Ie(a,r.ref,`ref layer "${m}" not found`))}else if(f!=="background")if(r.source){const y=o.sources&&o.sources[r.source],v=y&&$t(y.type);y?v==="vector"&&f==="raster"?e.push(new Ie(a,r.source,`layer "${r.id}" requires a raster source`)):v!=="raster-dem"&&f==="hillshade"?e.push(new Ie(a,r.source,`layer "${r.id}" requires a raster-dem source`)):v==="raster"&&f!=="raster"?e.push(new Ie(a,r.source,`layer "${r.id}" requires a vector source`)):v!=="vector"||r["source-layer"]?v==="raster-dem"&&f!=="hillshade"?e.push(new Ie(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):f!=="line"||!r.paint||!r.paint["line-gradient"]||v==="geojson"&&y.lineMetrics||e.push(new Ie(a,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new Ie(a,r,`layer "${r.id}" must specify a "source-layer"`)):e.push(new Ie(a,r.source,`source "${r.source}" not found`))}else e.push(new Ie(a,r,'missing required property "source"'));return e=e.concat(zi({key:a,value:r,valueSpec:p.layer,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,objectElementValidators:{"*":()=>[],type:()=>i.validateSpec({key:`${a}.type`,value:r.type,valueSpec:p.layer.type,style:i.style,styleSpec:i.styleSpec,validateSpec:i.validateSpec,object:r,objectKey:"type"}),filter:Xn,layout:y=>zi({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":v=>pl(vr({layerType:f},v))}}),paint:y=>zi({layer:r,key:y.key,value:y.value,style:y.style,styleSpec:y.styleSpec,validateSpec:y.validateSpec,objectElementValidators:{"*":v=>hl(vr({layerType:f},v))}})}})),e}function wr(i){const e=i.value,r=i.key,a=_t(e);return a!=="string"?[new Ie(r,e,`string expected, ${a} found`)]:[]}const ba={promoteId:function({key:i,value:e}){if(_t(e)==="string")return wr({key:i,value:e});{const r=[];for(const a in e)r.push(...wr({key:`${i}.${a}`,value:e[a]}));return r}}};function Zi(i){const e=i.value,r=i.key,a=i.styleSpec,o=i.style,p=i.validateSpec;if(!e.type)return[new Ie(r,e,'"type" is required')];const f=$t(e.type);let m;switch(f){case"vector":case"raster":return m=zi({key:r,value:e,valueSpec:a[`source_${f.replace("-","_")}`],style:i.style,styleSpec:a,objectElementValidators:ba,validateSpec:p}),m;case"raster-dem":return m=(function(y){var v;const w=(v=y.sourceName)!==null&&v!==void 0?v:"",A=y.value,k=y.styleSpec,z=k.source_raster_dem,D=y.style;let O=[];const q=_t(A);if(A===void 0)return O;if(q!=="object")return O.push(new Ie("source_raster_dem",A,`object expected, ${q} found`)),O;const H=$t(A.encoding)==="custom",re=["redFactor","greenFactor","blueFactor","baseShift"],Y=y.value.encoding?`"${y.value.encoding}"`:"Default";for(const ae in A)!H&&re.includes(ae)?O.push(new Ie(ae,A[ae],`In "${w}": "${ae}" is only valid when "encoding" is se
precision mediump float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif
`,`#ifdef GL_ES
precision highp float;
#else
#if !defined(lowp)
#define lowp
#endif
#if !defined(mediump)
#define mediump
#endif
#if !defined(highp)
#define highp
#endif
#endif
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}
#ifdef TERRAIN3D
uniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;
#endif
const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {
#ifdef TERRAIN3D
highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));
#else
return 1.0;
#endif
}float calculate_visibility(vec4 pos) {
#ifdef TERRAIN3D
vec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;
#else
return 1.0;
#endif
}float ele(vec2 pos) {
#ifdef TERRAIN3D
vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
#else
return 0.0;
#endif
}float get_elevation(vec2 pos) {
#ifdef TERRAIN3D
vec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;
#else
return 0.0;
#endif
}`),background:gt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:gt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:gt(`varying vec3 v_data;varying float v_visibility;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define mediump float radius
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define highp vec4 stroke_color
#pragma mapbox: define mediump float stroke_width
#pragma mapbox: define lowp float stroke_opacity
void main(void) {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize mediump float radius
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize highp vec4 stroke_color
#pragma mapbox: initialize mediump float stroke_width
#pragma mapbox: initialize lowp float stroke_opacity
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:gt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:gt(`uniform highp float u_intensity;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#define GAUSS_COEF 0.3989422804014327
void main() {
#pragma mapbox: initialize highp float weight
float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;
#pragma mapbox: define highp float weight
#pragma mapbox: define mediump float radius
const highp float ZERO=1.0/255.0/16.0;
#define GAUSS_COEF 0.3989422804014327
void main(void) {
#pragma mapbox: initialize highp float weight
#pragma mapbox: initialize mediump float radius
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),heatmapTexture:gt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(0.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:gt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:gt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:gt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:gt(`#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_FragColor=color*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:gt(`varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
#pragma mapbox: define highp vec4 outline_color
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 outline_color
#pragma mapbox: initialize lowp float opacity
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:gt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillPattern:gt(`#ifdef GL_ES
precision highp float;
#endif
uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),fillExtrusion:gt(`varying vec4 v_color;void main() {gl_FragColor=v_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
#ifdef TERRAIN3D
attribute vec2 a_centroid;
#endif
varying vec4 v_color;
#pragma mapbox: define highp float base
#pragma mapbox: define highp float height
#pragma mapbox: define highp vec4 color
void main() {
#pragma mapbox: initialize highp float base
#pragma mapbox: initialize highp float height
#pragma mapbox: initialize highp vec4 color
vec3 normal=a_normal_ed.xyz;
#ifdef TERRAIN3D
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
#else
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
#endif
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),fillExtrusionPattern:gt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;
#ifdef TERRAIN3D
attribute vec2 a_centroid;
#endif
varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
#pragma mapbox: define lowp float base
#pragma mapbox: define lowp float height
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float base
#pragma mapbox: initialize lowp float height
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;
#ifdef TERRAIN3D
float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
#else
float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
#endif
base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
? a_pos
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),hillshadePrepare:gt(`#ifdef GL_ES
precision highp float;
#endif
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:gt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
#define PI 3.141592653589793
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:gt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_width2=vec2(outset,inset);}`),lineGradient:gt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_width2=vec2(outset,inset);}`),linePattern:gt(`#ifdef GL_ES
precision highp float;
#endif
uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
#pragma mapbox: define lowp vec4 pattern_from
#pragma mapbox: define lowp vec4 pattern_to
#pragma mapbox: define lowp float pixel_ratio_from
#pragma mapbox: define lowp float pixel_ratio_to
void main() {
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
#pragma mapbox: initialize mediump vec4 pattern_from
#pragma mapbox: initialize mediump vec4 pattern_to
#pragma mapbox: initialize lowp float pixel_ratio_from
#pragma mapbox: initialize lowp float pixel_ratio_to
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:gt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`
#define scale 0.015873016
#define LINE_DISTANCE_SCALE 2.0
attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
#pragma mapbox: define highp vec4 color
#pragma mapbox: define lowp float blur
#pragma mapbox: define lowp float opacity
#pragma mapbox: define mediump float gapwidth
#pragma mapbox: define lowp float offset
#pragma mapbox: define mediump float width
#pragma mapbox: define lowp float floorwidth
void main() {
#pragma mapbox: initialize highp vec4 color
#pragma mapbox: initialize lowp float blur
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize mediump float gapwidth
#pragma mapbox: initialize lowp float offset
#pragma mapbox: initialize mediump float width
#pragma mapbox: initialize lowp float floorwidth
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;
#ifdef TERRAIN3D
v_gamma_scale=1.0;
#else
float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;
#endif
v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:gt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:gt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;
#pragma mapbox: define lowp float opacity
void main() {
#pragma mapbox: initialize lowp float opacity
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),z,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}`),symbolSDF:gt(`#define SDF_PX 8.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),symbolTextAndIcon:gt(`#define SDF_PX 8.0
#define SDF 1.0
#define ICON 0.0
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
return;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);
#ifdef OVERDRAW_INSPECTOR
gl_FragColor=vec4(1.0);
#endif
}`,`const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;
#pragma mapbox: define highp vec4 fill_color
#pragma mapbox: define highp vec4 halo_color
#pragma mapbox: define lowp float opacity
#pragma mapbox: define lowp float halo_width
#pragma mapbox: define lowp float halo_blur
void main() {
#pragma mapbox: initialize highp vec4 fill_color
#pragma mapbox: initialize highp vec4 halo_color
#pragma mapbox: initialize lowp float opacity
#pragma mapbox: initialize lowp float halo_width
#pragma mapbox: initialize lowp float halo_blur
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,ele,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
camera_to_anchor_distance/u_camera_to_center_distance :
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),ele,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`),terrain:gt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",jn),terrainDepth:gt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",jn),terrainCoords:gt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",jn)};function gt(u,t){const n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=t.match(/attribute ([\w]+) ([\w]+)/g),c=u.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),h=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),g=h?h.concat(c):c,_={};return{fragmentSource:u=u.replace(n,((x,b,T,I,P)=>(_[P]=!0,b==="define"?`
#ifndef HAS_UNIFORM_u_${P}
varying ${T} ${I} ${P};
#else
uniform ${T} ${I} u_${P};
#endif
`:`
#ifdef HAS_UNIFORM_u_${P}
${T} ${I} ${P} = u_${P};
#endif
`))),vertexSource:t=t.replace(n,((x,b,T,I,P)=>{const V=I==="float"?"vec2":"vec4",N=P.match(/color/)?"color":V;return _[P]?b==="define"?`
#ifndef HAS_UNIFORM_u_${P}
uniform lowp float u_${P}_t;
attribute ${T} ${V} a_${P};
varying ${T} ${I} ${P};
#else
uniform ${T} ${I} u_${P};
#endif
`:N==="vec4"?`
#ifndef HAS_UNIFORM_u_${P}
${P} = a_${P};
#else
${T} ${I} ${P} = u_${P};
#endif
`:`
#ifndef HAS_UNIFORM_u_${P}
${P} = unpack_mix_${N}(a_${P}, u_${P}_t);
#else
${T} ${I} ${P} = u_${P};
#endif
`:b==="define"?`
#ifndef HAS_UNIFORM_u_${P}
uniform lowp float u_${P}_t;
attribute ${T} ${V} a_${P};
#else
uniform ${T} ${I} u_${P};
#endif
`:N==="vec4"?`
#ifndef HAS_UNIFORM_u_${P}
${T} ${I} ${P} = a_${P};
#else
${T} ${I} ${P} = u_${P};
#endif
`:`
#ifndef HAS_UNIFORM_u_${P}
${T} ${I} ${P} = unpack_mix_${N}(a_${P}, u_${P}_t);
#else
${T} ${I} ${P} = u_${P};
#endif
`})),staticAttributes:s,staticUniforms:g}}class _n{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,n,s,c,h,g,_,x,b){this.context=t;let T=this.boundPaintVertexBuffers.length!==c.length;for(let I=0;!T&&I<c.length;I++)this.boundPaintVertexBuffers[I]!==c[I]&&(T=!0);!this.vao||this.boundProgram!==n||this.boundLayoutVertexBuffer!==s||T||this.boundIndexBuffer!==h||this.boundVertexOffset!==g||this.boundDynamicVertexBuffer!==_||this.boundDynamicVertexBuffer2!==x||this.boundDynamicVertexBuffer3!==b?this.freshBind(n,s,c,h,g,_,x,b):(t.bindVertexArray.set(this.vao),_&&_.bind(),h&&h.dynamicDraw&&h.bind(),x&&x.bind(),b&&b.bind())}freshBind(t,n,s,c,h,g,_,x){const b=t.numAttributes,T=this.context,I=T.gl;this.vao&&this.destroy(),this.vao=T.createVertexArray(),T.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=n,this.boundPaintVertexBuffers=s,this.boundIndexBuffer=c,this.boundVertexOffset=h,this.boundDynamicVertexBuffer=g,this.boundDynamicVertexBuffer2=_,this.boundDynamicVertexBuffer3=x,n.enableAttributes(I,t);for(const P of s)P.enableAttributes(I,t);g&&g.enableAttributes(I,t),_&&_.enableAttributes(I,t),x&&x.enableAttributes(I,t),n.bind(),n.setVertexAttribPointers(I,t,h);for(const P of s)P.bind(),P.setVertexAttribPointers(I,t,h);g&&(g.bind(),g.setVertexAttribPointers(I,t,h)),c&&c.bind(),_&&(_.bind(),_.setVertexAttribPointers(I,t,h)),x&&(x.bind(),x.setVertexAttribPointers(I,t,h)),T.currentNumAttributes=b}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}function Ut(u){const t=[];for(let n=0;n<u.length;n++){if(u[n]===null)continue;const s=u[n].split(" ");t.push(s.pop())}return t}class $a{constructor(t,n,s,c,h,g){const _=t.gl;this.program=_.createProgram();const x=Ut(n.staticAttributes),b=s?s.getBinderAttributes():[],T=x.concat(b),I=Rt.prelude.staticUniforms?Ut(Rt.prelude.staticUniforms):[],P=n.staticUniforms?Ut(n.staticUniforms):[],V=s?s.getBinderUniforms():[],N=I.concat(P).concat(V),$=[];for(const ce of N)$.indexOf(ce)<0&&$.push(ce);const B=s?s.defines():[];h&&B.push("#define OVERDRAW_INSPECTOR;"),g&&B.push("#define TERRAIN3D;");const Q=B.concat(Rt.prelude.fragmentSource,n.fragmentSource).join(`
`),se=B.concat(Rt.prelude.vertexSource,n.vertexSource).join(`
`),G=_.createShader(_.FRAGMENT_SHADER);if(_.isContextLost())return void(this.failedToCreate=!0);if(_.shaderSource(G,Q),_.compileShader(G),!_.getShaderParameter(G,_.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${_.getShaderInfoLog(G)}`);_.attachShader(this.program,G);const te=_.createShader(_.VERTEX_SHADER);if(_.isContextLost())return void(this.failedToCreate=!0);if(_.shaderSource(te,se),_.compileShader(te),!_.getShaderParameter(te,_.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${_.getShaderInfoLog(te)}`);_.attachShader(this.program,te),this.attributes={};const le={};this.numAttributes=T.length;for(let ce=0;ce<this.numAttributes;ce++)T[ce]&&(_.bindAttribLocation(this.program,ce,T[ce]),this.attributes[T[ce]]=ce);if(_.linkProgram(this.program),!_.getProgramParameter(this.program,_.LINK_STATUS))throw new Error(`Program failed to link: ${_.getProgramInfoLog(this.program)}`);_.deleteShader(te),_.deleteShader(G);for(let ce=0;ce<$.length;ce++){const fe=$[ce];if(fe&&!le[fe]){const xe=_.getUniformLocation(this.program,fe);xe&&(le[fe]=xe)}}this.fixedUniforms=c(t,le),this.terrainUniforms=((ce,fe)=>({u_depth:new l.aL(ce,fe.u_depth),u_terrain:new l.aL(ce,fe.u_terrain),u_terrain_dim:new l.aM(ce,fe.u_terrain_dim),u_terrain_matrix:new l.aN(ce,fe.u_terrain_matrix),u_terrain_unpack:new l.aO(ce,fe.u_terrain_unpack),u_terrain_exaggeration:new l.aM(ce,fe.u_terrain_exaggeration)}))(t,le),this.binderUniforms=s?s.getUniforms(t,le):[]}draw(t,n,s,c,h,g,_,x,b,T,I,P,V,N,$,B,Q,se){const G=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(s),t.setStencilMode(c),t.setColorMode(h),t.setCullFace(g),x){t.activeTexture.set(G.TEXTURE2),G.bindTexture(G.TEXTURE_2D,x.depthTexture),t.activeTexture.set(G.TEXTURE3),G.bindTexture(G.TEXTURE_2D,x.texture);for(const le in this.terrainUniforms)this.terrainUniforms[le].set(x[le])}for(const le in this.fixedUniforms)this.fixedUniforms[le].set(_[le]);$&&$.setUniforms(t,this.binderUniforms,V,{zoom:N});let te=0;switch(n){case G.LINES:te=2;break;case G.TRIANGLES:te=3;break;case G.LINE_STRIP:te=1}for(const le of P.get()){const ce=le.vaos||(le.vaos={});(ce[b]||(ce[b]=new _n)).bind(t,this,T,$?$.getPaintVertexBuffers():[],I,le.vertexOffset,B,Q,se),G.drawElements(n,le.primitiveLength*te,G.UNSIGNED_SHORT,le.primitiveOffset*te*2)}}}function nr(u,t,n){const s=1/J(n,1,t.transform.tileZoom),c=Math.pow(2,n.tileID.overscaledZ),h=n.tileSize*Math.pow(2,t.transform.tileZoom)/c,g=h*(n.tileID.canonical.x+n.tileID.wrap*c),_=h*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,u.fromScale,u.toScale],u_fade:u.t,u_pixel_coord_upper:[g>>16,_>>16],u_pixel_coord_lower:[65535&g,65535&_]}}const Ps=(u,t,n,s)=>{const c=t.style.light,h=c.properties.get("position"),g=[h.x,h.y,h.z],_=(function(){var b=new l.A(9);return l.A!=Float32Array&&(b[1]=0,b[2]=0,b[3]=0,b[5]=0,b[6]=0,b[7]=0),b[0]=1,b[4]=1,b[8]=1,b})();c.properties.get("anchor")==="viewport"&&(function(b,T){var I=Math.sin(T),P=Math.cos(T);b[0]=P,b[1]=I,b[2]=0,b[3]=-I,b[4]=P,b[5]=0,b[6]=0,b[7]=0,b[8]=1})(_,-t.transform.angle),(function(b,T,I){var P=T[0],V=T[1],N=T[2];b[0]=P*I[0]+V*I[3]+N*I[6],b[1]=P*I[1]+V*I[4]+N*I[7],b[2]=P*I[2]+V*I[5]+N*I[8]})(g,g,_);const x=c.properties.get("color");return{u_matrix:u,u_lightpos:g,u_lightintensity:c.properties.get("intensity"),u_lightcolor:[x.r,x.g,x.b],u_vertical_gradient:+n,u_opacity:s}},Jr=(u,t,n,s,c,h,g)=>l.e(Ps(u,t,n,s),nr(h,t,g),{u_height_factor:-Math.pow(2,c.overscaledZ)/g.tileSize/8}),Zo=u=>({u_matrix:u}),zs=(u,t,n,s)=>l.e(Zo(u),nr(n,t,s)),ja=(u,t)=>({u_matrix:u,u_world:t}),qa=(u,t,n,s,c)=>l.e(zs(u,t,n,s),{u_world:c}),Qr=(u,t,n,s)=>{const c=u.transform;let h,g;if(s.paint.get("circle-pitch-alignment")==="map"){const _=J(n,1,c.zoom);h=!0,g=[_,_]}else h=!1,g=c.pixelsToGLUnits;return{u_camera_to_center_distance:c.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:u.translatePosMatrix(t.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+h,u_device_pixel_ratio:u.pi
<div class="maplibregl-desktop-message">${u}</div>
<div class="maplibregl-mobile-message">${typeof this._cooperativeGestures!="boolean"&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>
`,this._cooperativeGesturesScreen.setAttribute("aria-hidden","true"),this._canvasContainer.addEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.add("maplibregl-cooperative-gestures")}_destroyCooperativeGestures(){X.remove(this._cooperativeGesturesScreen),this._canvasContainer.removeEventListener("wheel",this._cooperativeGesturesOnWheel,!1),this._canvasContainer.classList.remove("maplibregl-cooperative-gestures")}_resizeCanvas(u,t,n){this._canvas.width=Math.floor(n*u),this._canvas.height=Math.floor(n*t),this._canvas.style.width=`${u}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const u={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let t=null;this._canvas.addEventListener("webglcontextcreationerror",(s=>{t={requestedAttributes:u},s&&(t.statusMessage=s.statusMessage,t.type=s.type)}),{once:!0});const n=this._canvas.getContext("webgl2",u)||this._canvas.getContext("webgl",u);if(!n){const s="Failed to initialize WebGL";throw t?(t.message=s,new Error(JSON.stringify(t))):new Error(s)}this.painter=new bn(n,this.transform),Fe.testSupport(n)}_onCooperativeGesture(u,t,n){return!t&&n<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout((()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")}),100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(u){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||u,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(u){return this._update(),this._renderTaskQueue.add(u)}_cancelRenderFrame(u){this._renderTaskQueue.remove(u)}_render(u){const t=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(u),this._removed)return;let n=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const c=this.transform.zoom,h=l.h.now();this.style.zoomHistory.update(c,h);const g=new l.a8(c,{now:h,fadeDuration:t,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),_=g.crossFadingFactor();_===1&&_===this._crossFadingFactor||(n=!0,this._crossFadingFactor=_),this.style.update(g)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform._minEleveationForCurrentTile=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._minEleveationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,t,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:t,showPadding:this.showPadding}),this.fire(new l.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,l.bg.mark(l.bh.load),this.fire(new l.k("load"))),this.style&&(this.style.hasTransitions()||n)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const s=this._sourcesDirty||this._styleDirty||this._placementDirty;return s||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.k("idle")),!this._loaded||this._fullyLoaded||s||(this._fullyLoaded=!0,l.bg.mark(l.bh.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){var u;this._hash&&this._hash.remove();for(const n of this._controls)n.onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),
`+d.mark.snippet),L+" "+M):L}function Is(d,S){Error.call(this),this.name="YAMLException",this.reason=d,this.mark=S,this.message=wu(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Is.prototype=Object.create(Error.prototype),Is.prototype.constructor=Is,Is.prototype.toString=function(S){return this.name+": "+wu(this,S)};var Vi=Is;function Jl(d,S,M,L,R){var ee="",K="",l=Math.floor(R/2)-1;return L-S>l&&(ee=" ... ",S=L-l+ee.length),M-L>l&&(K=" ...",M=L+l-K.length),{str:ee+d.slice(S,M).replace(/\t/g,"→")+K,pos:L-S+ee.length}}function Ql(d,S){return li.repeat(" ",S-d.length)+d}function Pd(d,S){if(S=Object.create(S||null),!d.buffer)return null;S.maxLength||(S.maxLength=79),typeof S.indent!="number"&&(S.indent=1),typeof S.linesBefore!="number"&&(S.linesBefore=3),typeof S.linesAfter!="number"&&(S.linesAfter=2);for(var M=/\r?\n|\r|\0/g,L=[0],R=[],ee,K=-1;ee=M.exec(d.buffer);)R.push(ee.index),L.push(ee.index+ee[0].length),d.position<=ee.index&&K<0&&(K=L.length-2);K<0&&(K=L.length-1);var l="",ue,X,Fe=Math.min(d.line+S.linesAfter,R.length).toString().length,be=S.maxLength-(S.indent+Fe+3);for(ue=1;ue<=S.linesBefore&&!(K-ue<0);ue++)X=Jl(d.buffer,L[K-ue],R[K-ue],d.position-(L[K]-L[K-ue]),be),l=li.repeat(" ",S.indent)+Ql((d.line-ue+1).toString(),Fe)+" | "+X.str+`
`+l;for(X=Jl(d.buffer,L[K],R[K],d.position,be),l+=li.repeat(" ",S.indent)+Ql((d.line+1).toString(),Fe)+" | "+X.str+`
`,l+=li.repeat("-",S.indent+Fe+3+X.pos)+`^
`,ue=1;ue<=S.linesAfter&&!(K+ue>=R.length);ue++)X=Jl(d.buffer,L[K+ue],R[K+ue],d.position-(L[K]-L[K+ue]),be),l+=li.repeat(" ",S.indent)+Ql((d.line+ue+1).toString(),Fe)+" | "+X.str+`
`;return l.replace(/\n$/,"")}var zd=Pd,Dd=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Ld=["scalar","sequence","mapping"];function Fd(d){var S={};return d!==null&&Object.keys(d).forEach(function(M){d[M].forEach(function(L){S[String(L)]=M})}),S}function Rd(d,S){if(S=S||{},Object.keys(S).forEach(function(M){if(Dd.indexOf(M)===-1)throw new Vi('Unknown option "'+M+'" is met in definition of "'+d+'" YAML type.')}),this.options=S,this.tag=d,this.kind=S.kind||null,this.resolve=S.resolve||function(){return!0},this.construct=S.construct||function(M){return M},this.instanceOf=S.instanceOf||null,this.predicate=S.predicate||null,this.represent=S.represent||null,this.representName=S.representName||null,this.defaultStyle=S.defaultStyle||null,this.multi=S.multi||!1,this.styleAliases=Fd(S.styleAliases||null),Ld.indexOf(this.kind)===-1)throw new Vi('Unknown kind "'+this.kind+'" is specified for "'+d+'" YAML type.')}var vi=Rd;function Su(d,S){var M=[];return d[S].forEach(function(L){var R=M.length;M.forEach(function(ee,K){ee.tag===L.tag&&ee.kind===L.kind&&ee.multi===L.multi&&(R=K)}),M[R]=L}),M}function Bd(){var d={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},S,M;function L(R){R.multi?(d.multi[R.kind].push(R),d.multi.fallback.push(R)):d[R.kind][R.tag]=d.fallback[R.tag]=R}for(S=0,M=arguments.length;S<M;S+=1)arguments[S].forEach(L);return d}function ec(d){return this.extend(d)}ec.prototype.extend=function(S){var M=[],L=[];if(S instanceof vi)L.push(S);else if(Array.isArray(S))L=L.concat(S);else if(S&&(Array.isArray(S.implicit)||Array.isArray(S.explicit)))S.implicit&&(M=M.concat(S.implicit)),S.explicit&&(L=L.concat(S.explicit));else throw new Vi("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");M.forEach(function(ee){if(!(ee instanceof vi))throw new Vi("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(ee.loadKind&&ee.loadKind!=="scalar")throw new Vi("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(ee.multi)throw new Vi("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),L.forEach(function(ee){if(!(ee instanceof vi))throw new Vi("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var R=Object.create(ec.prototype);return R.implicit=(this.implicit||[]).concat(M),R.explicit=(this.explicit||[]).concat(L),R.compiledImplicit=Su(R,"implicit"),R.compiledExplicit=Su(R,"explicit"),R.compiledTypeMap=Bd(R.compiledImplicit,R.compiledExplicit),R};var Tu=ec,Iu=new vi("tag:yaml.org,2002:str",{kind:"scalar",construct:function(d){return d!==null?d:""}}),Au=new vi("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(d){return d!==null?d:[]}}),Cu=new vi("tag:yaml.org,2002:map",{kind:"mapping",construct:function(d){return d!==null?d:{}}}),ku=new Tu({explicit:[Iu,Au,Cu]});function Od(d){if(d===null)return!0;var S=d.length;return S===1&&d==="~"||S===4&&(d==="null"||d==="Null"||d==="NULL")}function Nd(){return null}function Vd(d){return d===null}var Mu=new vi("tag:yaml.org,2002:null",{kind:"scalar",resolve:Od,construct:Nd,predicate:Vd,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Ud(d){if(d===null)return!1;var S=d.length;return S===4&&(d==="true"||d==="True"||d==="TRUE")||S===5&&(d==="false"||d==="False"||d==="FALSE")}function $d(d){return d==="true"||d==="True"||d==="TRUE"}function jd(d){return Object.prototype.toString.call(d)==="[object Boolean]"}var Eu=new vi("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Ud,construct:$d,predicate:jd,represent:{lowercase:function(d){return d?"true":"false"},uppercase:function(d){return d?"TRUE":"FALSE"},camelcase:function(d){return d?"True":"False"}},defaultStyle:"lowercase
\r`;function of(d){if(d===null)return!1;var S,M,L=0,R=d.length,ee=tc;for(M=0;M<R;M++)if(S=ee.indexOf(d.charAt(M)),!(S>64)){if(S<0)return!1;L+=6}return L%8===0}function lf(d){var S,M,L=d.replace(/[\r\n=]/g,""),R=L.length,ee=tc,K=0,l=[];for(S=0;S<R;S++)S%4===0&&S&&(l.push(K>>16&255),l.push(K>>8&255),l.push(K&255)),K=K<<6|ee.indexOf(L.charAt(S));return M=R%4*6,M===0?(l.push(K>>16&255),l.push(K>>8&255),l.push(K&255)):M===18?(l.push(K>>10&255),l.push(K>>2&255)):M===12&&l.push(K>>4&255),new Uint8Array(l)}function cf(d){var S="",M=0,L,R,ee=d.length,K=tc;for(L=0;L<ee;L++)L%3===0&&L&&(S+=K[M>>18&63],S+=K[M>>12&63],S+=K[M>>6&63],S+=K[M&63]),M=(M<<8)+d[L];return R=ee%3,R===0?(S+=K[M>>18&63],S+=K[M>>12&63],S+=K[M>>6&63],S+=K[M&63]):R===2?(S+=K[M>>10&63],S+=K[M>>4&63],S+=K[M<<2&63],S+=K[64]):R===1&&(S+=K[M>>2&63],S+=K[M<<4&63],S+=K[64],S+=K[64]),S}function uf(d){return Object.prototype.toString.call(d)==="[object Uint8Array]"}var Nu=new vi("tag:yaml.org,2002:binary",{kind:"scalar",resolve:of,construct:lf,predicate:uf,represent:cf}),hf=Object.prototype.hasOwnProperty,pf=Object.prototype.toString;function df(d){if(d===null)return!0;var S=[],M,L,R,ee,K,l=d;for(M=0,L=l.length;M<L;M+=1){if(R=l[M],K=!1,pf.call(R)!=="[object Object]")return!1;for(ee in R)if(hf.call(R,ee))if(!K)K=!0;else return!1;if(!K)return!1;if(S.indexOf(ee)===-1)S.push(ee);else return!1}return!0}function ff(d){return d!==null?d:[]}var Vu=new vi("tag:yaml.org,2002:omap",{kind:"sequence",resolve:df,construct:ff}),mf=Object.prototype.toString;function gf(d){if(d===null)return!0;var S,M,L,R,ee,K=d;for(ee=new Array(K.length),S=0,M=K.length;S<M;S+=1){if(L=K[S],mf.call(L)!=="[object Object]"||(R=Object.keys(L),R.length!==1))return!1;ee[S]=[R[0],L[R[0]]]}return!0}function _f(d){if(d===null)return[];var S,M,L,R,ee,K=d;for(ee=new Array(K.length),S=0,M=K.length;S<M;S+=1)L=K[S],R=Object.keys(L),ee[S]=[R[0],L[R[0]]];return ee}var Uu=new vi("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:gf,construct:_f}),yf=Object.prototype.hasOwnProperty;function xf(d){if(d===null)return!0;var S,M=d;for(S in M)if(yf.call(M,S)&&M[S]!==null)return!1;return!0}function vf(d){return d!==null?d:{}}var $u=new vi("tag:yaml.org,2002:set",{kind:"mapping",resolve:xf,construct:vf}),ic=Lu.extend({implicit:[Bu,Ou],explicit:[Nu,Vu,Uu,$u]}),Dn=Object.prototype.hasOwnProperty,Oo=1,ju=2,qu=3,No=4,rc=1,bf=2,Zu=3,wf=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Sf=/[\x85\u2028\u2029]/,Tf=/[,\[\]\{\}]/,Gu=/^(?:!|!!|![a-z\-]+!)$/i,Hu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Wu(d){return Object.prototype.toString.call(d)}function qr(d){return d===10||d===13}function oa(d){return d===9||d===32}function Ji(d){return d===9||d===32||d===10||d===13}function Da(d){return d===44||d===91||d===93||d===123||d===125}function If(d){var S;return 48<=d&&d<=57?d-48:(S=d|32,97<=S&&S<=102?S-97+10:-1)}function Af(d){return d===120?2:d===117?4:d===85?8:0}function Cf(d){return 48<=d&&d<=57?d-48:-1}function Xu(d){return d===48?"\0":d===97?"\x07":d===98?"\b":d===116||d===9?" ":d===110?`
`:d===118?"\v":d===102?"\f":d===114?"\r":d===101?"\x1B":d===32?" ":d===34?'"':d===47?"/":d===92?"\\":d===78?"…":d===95?" ":d===76?"\u2028":d===80?"\u2029":""}function kf(d){return d<=65535?String.fromCharCode(d):String.fromCharCode((d-65536>>10)+55296,(d-65536&1023)+56320)}function Ku(d,S,M){S==="__proto__"?Object.defineProperty(d,S,{configurable:!0,enumerable:!0,writable:!0,value:M}):d[S]=M}for(var Yu=new Array(256),Ju=new Array(256),La=0;La<256;La++)Yu[La]=Xu(La)?1:0,Ju[La]=Xu(La);function Mf(d,S){this.input=d,this.filename=S.filename||null,this.schema=S.schema||ic,this.onWarning=S.onWarning||null,this.legacy=S.legacy||!1,this.json=S.json||!1,this.listener=S.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=d.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Qu(d,S){var M={name:d.filename,buffer:d.input.slice(0,-1),position:d.position,line:d.line,column:d.position-d.lineStart};return M.snippet=zd(M),new Vi(S,M)}function Xe(d,S){throw Qu(d,S)}function Vo(d,S){d.onWarning&&d.onWarning.call(null,Qu(d,S))}var eh={YAML:function(S,M,L){var R,ee,K;S.version!==null&&Xe(S,"duplication of %YAML directive"),L.length!==1&&Xe(S,"YAML directive accepts exactly one argument"),R=/^([0-9]+)\.([0-9]+)$/.exec(L[0]),R===null&&Xe(S,"ill-formed argument of the YAML directive"),ee=parseInt(R[1],10),K=parseInt(R[2],10),ee!==1&&Xe(S,"unacceptable YAML version of the document"),S.version=L[0],S.checkLineBreaks=K<2,K!==1&&K!==2&&Vo(S,"unsupported YAML version of the document")},TAG:function(S,M,L){var R,ee;L.length!==2&&Xe(S,"TAG directive accepts exactly two arguments"),R=L[0],ee=L[1],Gu.test(R)||Xe(S,"ill-formed tag handle (first argument) of the TAG directive"),Dn.call(S.tagMap,R)&&Xe(S,'there is a previously declared suffix for "'+R+'" tag handle'),Hu.test(ee)||Xe(S,"ill-formed tag prefix (second argument) of the TAG directive");try{ee=decodeURIComponent(ee)}catch{Xe(S,"tag prefix is malformed: "+ee)}S.tagMap[R]=ee}};function Ln(d,S,M,L){var R,ee,K,l;if(S<M){if(l=d.input.slice(S,M),L)for(R=0,ee=l.length;R<ee;R+=1)K=l.charCodeAt(R),K===9||32<=K&&K<=1114111||Xe(d,"expected valid JSON character");else wf.test(l)&&Xe(d,"the stream contains non-printable characters");d.result+=l}}function th(d,S,M,L){var R,ee,K,l;for(li.isObject(M)||Xe(d,"cannot merge mappings; the provided source object is unacceptable"),R=Object.keys(M),K=0,l=R.length;K<l;K+=1)ee=R[K],Dn.call(S,ee)||(Ku(S,ee,M[ee]),L[ee]=!0)}function Fa(d,S,M,L,R,ee,K,l,ue){var X,Fe;if(Array.isArray(R))for(R=Array.prototype.slice.call(R),X=0,Fe=R.length;X<Fe;X+=1)Array.isArray(R[X])&&Xe(d,"nested arrays are not supported inside keys"),typeof R=="object"&&Wu(R[X])==="[object Object]"&&(R[X]="[object Object]");if(typeof R=="object"&&Wu(R)==="[object Object]"&&(R="[object Object]"),R=String(R),S===null&&(S={}),L==="tag:yaml.org,2002:merge")if(Array.isArray(ee))for(X=0,Fe=ee.length;X<Fe;X+=1)th(d,S,ee[X],M);else th(d,S,ee,M);else!d.json&&!Dn.call(M,R)&&Dn.call(S,R)&&(d.line=K||d.line,d.lineStart=l||d.lineStart,d.position=ue||d.position,Xe(d,"duplicated mapping key")),Ku(S,R,ee),delete M[R];return S}function nc(d){var S;S=d.input.charCodeAt(d.position),S===10?d.position++:S===13?(d.position++,d.input.charCodeAt(d.position)===10&&d.position++):Xe(d,"a line break is expected"),d.line+=1,d.lineStart=d.position,d.firstTabInLine=-1}function oi(d,S,M){for(var L=0,R=d.input.charCodeAt(d.position);R!==0;){for(;oa(R);)R===9&&d.firstTabInLine===-1&&(d.firstTabInLine=d.position),R=d.input.charCodeAt(++d.position);if(S&&R===35)do R=d.input.charCodeAt(++d.position);while(R!==10&&R!==13&&R!==0);if(qr(R))for(nc(d),R=d.input.charCodeAt(d.position),L++,d.lineIndent=0;R===32;)d.lineIndent++,R=d.input.charCodeAt(++d.position);else break}return M!==-1&&L!==0&&d.lineIndent<M&&Vo(d,"deficient indentation"),L}function Uo(d){var S=d.position,M;return M=d.input.charCodeAt(S),!!((M===45||M===46)&&M===d.input.charCodeAt(S+1)&&M===d.input.charCodeAt(S+2)&&(S+=3,M=d.input.charCodeAt(S),M===0
`,S-1))}function Ef(d,S,M){var L,R,ee,K,l,ue,X,Fe,be=d.kind,ye=d.result,we;if(we=d.input.charCodeAt(d.position),Ji(we)||Da(we)||we===35||we===38||we===42||we===33||we===124||we===62||we===39||we===34||we===37||we===64||we===96||(we===63||we===45)&&(R=d.input.charCodeAt(d.position+1),Ji(R)||M&&Da(R)))return!1;for(d.kind="scalar",d.result="",ee=K=d.position,l=!1;we!==0;){if(we===58){if(R=d.input.charCodeAt(d.position+1),Ji(R)||M&&Da(R))break}else if(we===35){if(L=d.input.charCodeAt(d.position-1),Ji(L))break}else{if(d.position===d.lineStart&&Uo(d)||M&&Da(we))break;if(qr(we))if(ue=d.line,X=d.lineStart,Fe=d.lineIndent,oi(d,!1,-1),d.lineIndent>=S){l=!0,we=d.input.charCodeAt(d.position);continue}else{d.position=K,d.line=ue,d.lineStart=X,d.lineIndent=Fe;break}}l&&(Ln(d,ee,K,!1),ac(d,d.line-ue),ee=K=d.position,l=!1),oa(we)||(K=d.position+1),we=d.input.charCodeAt(++d.position)}return Ln(d,ee,K,!1),d.result?!0:(d.kind=be,d.result=ye,!1)}function Pf(d,S){var M,L,R;if(M=d.input.charCodeAt(d.position),M!==39)return!1;for(d.kind="scalar",d.result="",d.position++,L=R=d.position;(M=d.input.charCodeAt(d.position))!==0;)if(M===39)if(Ln(d,L,d.position,!0),M=d.input.charCodeAt(++d.position),M===39)L=d.position,d.position++,R=d.position;else return!0;else qr(M)?(Ln(d,L,R,!0),ac(d,oi(d,!1,S)),L=R=d.position):d.position===d.lineStart&&Uo(d)?Xe(d,"unexpected end of the document within a single quoted scalar"):(d.position++,R=d.position);Xe(d,"unexpected end of the stream within a single quoted scalar")}function zf(d,S){var M,L,R,ee,K,l;if(l=d.input.charCodeAt(d.position),l!==34)return!1;for(d.kind="scalar",d.result="",d.position++,M=L=d.position;(l=d.input.charCodeAt(d.position))!==0;){if(l===34)return Ln(d,M,d.position,!0),d.position++,!0;if(l===92){if(Ln(d,M,d.position,!0),l=d.input.charCodeAt(++d.position),qr(l))oi(d,!1,S);else if(l<256&&Yu[l])d.result+=Ju[l],d.position++;else if((K=Af(l))>0){for(R=K,ee=0;R>0;R--)l=d.input.charCodeAt(++d.position),(K=If(l))>=0?ee=(ee<<4)+K:Xe(d,"expected hexadecimal character");d.result+=kf(ee),d.position++}else Xe(d,"unknown escape sequence");M=L=d.position}else qr(l)?(Ln(d,M,L,!0),ac(d,oi(d,!1,S)),M=L=d.position):d.position===d.lineStart&&Uo(d)?Xe(d,"unexpected end of the document within a double quoted scalar"):(d.position++,L=d.position)}Xe(d,"unexpected end of the stream within a double quoted scalar")}function Df(d,S){var M=!0,L,R,ee,K=d.tag,l,ue=d.anchor,X,Fe,be,ye,we,Re=Object.create(null),We,nt,st,tt;if(tt=d.input.charCodeAt(d.position),tt===91)Fe=93,we=!1,l=[];else if(tt===123)Fe=125,we=!0,l={};else return!1;for(d.anchor!==null&&(d.anchorMap[d.anchor]=l),tt=d.input.charCodeAt(++d.position);tt!==0;){if(oi(d,!0,S),tt=d.input.charCodeAt(d.position),tt===Fe)return d.position++,d.tag=K,d.anchor=ue,d.kind=we?"mapping":"sequence",d.result=l,!0;M?tt===44&&Xe(d,"expected the node content, but found ','"):Xe(d,"missed comma between flow collection entries"),nt=We=st=null,be=ye=!1,tt===63&&(X=d.input.charCodeAt(d.position+1),Ji(X)&&(be=ye=!0,d.position++,oi(d,!0,S))),L=d.line,R=d.lineStart,ee=d.position,Ra(d,S,Oo,!1,!0),nt=d.tag,We=d.result,oi(d,!0,S),tt=d.input.charCodeAt(d.position),(ye||d.line===L)&&tt===58&&(be=!0,tt=d.input.charCodeAt(++d.position),oi(d,!0,S),Ra(d,S,Oo,!1,!0),st=d.result),we?Fa(d,l,Re,nt,We,st,L,R,ee):be?l.push(Fa(d,null,Re,nt,We,st,L,R,ee)):l.push(We),oi(d,!0,S),tt=d.input.charCodeAt(d.position),tt===44?(M=!0,tt=d.input.charCodeAt(++d.position)):M=!1}Xe(d,"unexpected end of the stream within a flow collection")}function Lf(d,S){var M,L,R=rc,ee=!1,K=!1,l=S,ue=0,X=!1,Fe,be;if(be=d.input.charCodeAt(d.position),be===124)L=!1;else if(be===62)L=!0;else return!1;for(d.kind="scalar",d.result="";be!==0;)if(be=d.input.charCodeAt(++d.position),be===43||be===45)rc===R?R=be===43?Zu:bf:Xe(d,"repeat of a chomping mode identifier");else if((Fe=Cf(be))>=0)Fe===0?Xe(d,"bad explicit indentation width of a block scalar; it cannot be less than one"):K?Xe(d,"repeat of an indentation width identifier"):(l=S+Fe-1,K=!0);else break;if(oa(be)){do be=d.input.charCodeAt(++d.position);while(oa(be));if(be===35)do be=
`,ee?1+ue:ue):R===rc&&ee&&(d.result+=`
`);break}for(L?oa(be)?(X=!0,d.result+=li.repeat(`
`,ee?1+ue:ue)):X?(X=!1,d.result+=li.repeat(`
`,ue+1)):ue===0?ee&&(d.result+=" "):d.result+=li.repeat(`
`,ue):d.result+=li.repeat(`
`,ee?1+ue:ue),ee=!0,K=!0,ue=0,M=d.position;!qr(be)&&be!==0;)be=d.input.charCodeAt(++d.position);Ln(d,M,d.position,!1)}return!0}function ih(d,S){var M,L=d.tag,R=d.anchor,ee=[],K,l=!1,ue;if(d.firstTabInLine!==-1)return!1;for(d.anchor!==null&&(d.anchorMap[d.anchor]=ee),ue=d.input.charCodeAt(d.position);ue!==0&&(d.firstTabInLine!==-1&&(d.position=d.firstTabInLine,Xe(d,"tab characters must not be used in indentation")),!(ue!==45||(K=d.input.charCodeAt(d.position+1),!Ji(K))));){if(l=!0,d.position++,oi(d,!0,-1)&&d.lineIndent<=S){ee.push(null),ue=d.input.charCodeAt(d.position);continue}if(M=d.line,Ra(d,S,qu,!1,!0),ee.push(d.result),oi(d,!0,-1),ue=d.input.charCodeAt(d.position),(d.line===M||d.lineIndent>S)&&ue!==0)Xe(d,"bad indentation of a sequence entry");else if(d.lineIndent<S)break}return l?(d.tag=L,d.anchor=R,d.kind="sequence",d.result=ee,!0):!1}function Ff(d,S,M){var L,R,ee,K,l,ue,X=d.tag,Fe=d.anchor,be={},ye=Object.create(null),we=null,Re=null,We=null,nt=!1,st=!1,tt;if(d.firstTabInLine!==-1)return!1;for(d.anchor!==null&&(d.anchorMap[d.anchor]=be),tt=d.input.charCodeAt(d.position);tt!==0;){if(!nt&&d.firstTabInLine!==-1&&(d.position=d.firstTabInLine,Xe(d,"tab characters must not be used in indentation")),L=d.input.charCodeAt(d.position+1),ee=d.line,(tt===63||tt===58)&&Ji(L))tt===63?(nt&&(Fa(d,be,ye,we,Re,null,K,l,ue),we=Re=We=null),st=!0,nt=!0,R=!0):nt?(nt=!1,R=!0):Xe(d,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),d.position+=1,tt=L;else{if(K=d.line,l=d.lineStart,ue=d.position,!Ra(d,M,ju,!1,!0))break;if(d.line===ee){for(tt=d.input.charCodeAt(d.position);oa(tt);)tt=d.input.charCodeAt(++d.position);if(tt===58)tt=d.input.charCodeAt(++d.position),Ji(tt)||Xe(d,"a whitespace character is expected after the key-value separator within a block mapping"),nt&&(Fa(d,be,ye,we,Re,null,K,l,ue),we=Re=We=null),st=!0,nt=!1,R=!1,we=d.tag,Re=d.result;else if(st)Xe(d,"can not read an implicit mapping pair; a colon is missed");else return d.tag=X,d.anchor=Fe,!0}else if(st)Xe(d,"can not read a block mapping entry; a multiline key may not be an implicit key");else return d.tag=X,d.anchor=Fe,!0}if((d.line===ee||d.lineIndent>S)&&(nt&&(K=d.line,l=d.lineStart,ue=d.position),Ra(d,S,No,!0,R)&&(nt?Re=d.result:We=d.result),nt||(Fa(d,be,ye,we,Re,We,K,l,ue),we=Re=We=null),oi(d,!0,-1),tt=d.input.charCodeAt(d.position)),(d.line===ee||d.lineIndent>S)&&tt!==0)Xe(d,"bad indentation of a mapping entry");else if(d.lineIndent<S)break}return nt&&Fa(d,be,ye,we,Re,null,K,l,ue),st&&(d.tag=X,d.anchor=Fe,d.kind="mapping",d.result=be),st}function Rf(d){var S,M=!1,L=!1,R,ee,K;if(K=d.input.charCodeAt(d.position),K!==33)return!1;if(d.tag!==null&&Xe(d,"duplication of a tag property"),K=d.input.charCodeAt(++d.position),K===60?(M=!0,K=d.input.charCodeAt(++d.position)):K===33?(L=!0,R="!!",K=d.input.charCodeAt(++d.position)):R="!",S=d.position,M){do K=d.input.charCodeAt(++d.position);while(K!==0&&K!==62);d.position<d.length?(ee=d.input.slice(S,d.position),K=d.input.charCodeAt(++d.position)):Xe(d,"unexpected end of the stream within a verbatim tag")}else{for(;K!==0&&!Ji(K);)K===33&&(L?Xe(d,"tag suffix cannot contain exclamation marks"):(R=d.input.slice(S-1,d.position+1),Gu.test(R)||Xe(d,"named tag handle cannot contain such characters"),L=!0,S=d.position+1)),K=d.input.charCodeAt(++d.position);ee=d.input.slice(S,d.position),Tf.test(ee)&&Xe(d,"tag suffix cannot contain flow indicator characters")}ee&&!Hu.test(ee)&&Xe(d,"tag name cannot contain such characters: "+ee);try{ee=decodeURIComponent(ee)}catch{Xe(d,"tag name is malformed: "+ee)}return M?d.tag=ee:Dn.call(d.tagMap,R)?d.tag=d.tagMap[R]+ee:R==="!"?d.tag="!"+ee:R==="!!"?d.tag="tag:yaml.org,2002:"+ee:Xe(d,'undeclared tag handle "'+R+'"'),!0}function Bf(d){var S,M;if(M=d.input.charCodeAt(d.position),M!==38)return!1;for(d.anchor!==null&&Xe(d,"duplication of an anchor property"),M=d.input.charCodeAt(++d.position),S=d.position;M!==0&&!Ji(M)&&!Da(M);)M=d.input.charCodeAt(++d.position);return d.position===S&&Xe(d,"name of an anchor node must contain at least one character"),d.ancho
`),d.charCodeAt(0)===65279&&(d=d.slice(1)));var M=new Mf(d,S),L=d.indexOf("\0");for(L!==-1&&(M.position=L,Xe(M,"null byte is not allowed in input")),M.input+="\0";M.input.charCodeAt(M.position)===32;)M.lineIndent+=1,M.position+=1;for(;M.position<M.length-1;)Nf(M);return M.documents}function Vf(d,S,M){S!==null&&typeof S=="object"&&typeof M>"u"&&(M=S,S=null);var L=rh(d,M);if(typeof S!="function")return L;for(var R=0,ee=L.length;R<ee;R+=1)S(L[R])}function Uf(d,S){var M=rh(d,S);if(M.length!==0){if(M.length===1)return M[0];throw new Vi("expected a single document in the stream, but found more")}}var $f=Vf,jf=Uf,nh={loadAll:$f,load:jf},ah=Object.prototype.toString,sh=Object.prototype.hasOwnProperty,sc=65279,qf=9,As=10,Zf=13,Gf=32,Hf=33,Wf=34,oc=35,Xf=37,Kf=38,Yf=39,Jf=42,oh=44,Qf=45,$o=58,em=61,tm=62,im=63,rm=64,lh=91,ch=93,nm=96,uh=123,am=124,hh=125,Mi={};Mi[0]="\\0",Mi[7]="\\a",Mi[8]="\\b",Mi[9]="\\t",Mi[10]="\\n",Mi[11]="\\v",Mi[12]="\\f",Mi[13]="\\r",Mi[27]="\\e",Mi[34]='\\"',Mi[92]="\\\\",Mi[133]="\\N",Mi[160]="\\_",Mi[8232]="\\L",Mi[8233]="\\P";var sm=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],om=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function lm(d,S){var M,L,R,ee,K,l,ue;if(S===null)return{};for(M={},L=Object.keys(S),R=0,ee=L.length;R<ee;R+=1)K=L[R],l=String(S[K]),K.slice(0,2)==="!!"&&(K="tag:yaml.org,2002:"+K.slice(2)),ue=d.compiledTypeMap.fallback[K],ue&&sh.call(ue.styleAliases,l)&&(l=ue.styleAliases[l]),M[K]=l;return M}function cm(d){var S,M,L;if(S=d.toString(16).toUpperCase(),d<=255)M="x",L=2;else if(d<=65535)M="u",L=4;else if(d<=4294967295)M="U",L=8;else throw new Vi("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+M+li.repeat("0",L-S.length)+S}var um=1,Cs=2;function hm(d){this.schema=d.schema||ic,this.indent=Math.max(1,d.indent||2),this.noArrayIndent=d.noArrayIndent||!1,this.skipInvalid=d.skipInvalid||!1,this.flowLevel=li.isNothing(d.flowLevel)?-1:d.flowLevel,this.styleMap=lm(this.schema,d.styles||null),this.sortKeys=d.sortKeys||!1,this.lineWidth=d.lineWidth||80,this.noRefs=d.noRefs||!1,this.noCompatMode=d.noCompatMode||!1,this.condenseFlow=d.condenseFlow||!1,this.quotingType=d.quotingType==='"'?Cs:um,this.forceQuotes=d.forceQuotes||!1,this.replacer=typeof d.replacer=="function"?d.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function ph(d,S){for(var M=li.repeat(" ",S),L=0,R=-1,ee="",K,l=d.length;L<l;)R=d.indexOf(`
`,L),R===-1?(K=d.slice(L),L=l):(K=d.slice(L,R+1),L=R+1),K.length&&K!==`
`&&(ee+=M),ee+=K;return ee}function lc(d,S){return`
`+li.repeat(" ",d.indent*S)}function pm(d,S){var M,L,R;for(M=0,L=d.implicitTypes.length;M<L;M+=1)if(R=d.implicitTypes[M],R.resolve(S))return!0;return!1}function jo(d){return d===Gf||d===qf}function ks(d){return 32<=d&&d<=126||161<=d&&d<=55295&&d!==8232&&d!==8233||57344<=d&&d<=65533&&d!==sc||65536<=d&&d<=1114111}function dh(d){return ks(d)&&d!==sc&&d!==Zf&&d!==As}function fh(d,S,M){var L=dh(d),R=L&&!jo(d);return(M?L:L&&d!==oh&&d!==lh&&d!==ch&&d!==uh&&d!==hh)&&d!==oc&&!(S===$o&&!R)||dh(S)&&!jo(S)&&d===oc||S===$o&&R}function dm(d){return ks(d)&&d!==sc&&!jo(d)&&d!==Qf&&d!==im&&d!==$o&&d!==oh&&d!==lh&&d!==ch&&d!==uh&&d!==hh&&d!==oc&&d!==Kf&&d!==Jf&&d!==Hf&&d!==am&&d!==em&&d!==tm&&d!==Yf&&d!==Wf&&d!==Xf&&d!==rm&&d!==nm}function fm(d){return!jo(d)&&d!==$o}function Ms(d,S){var M=d.charCodeAt(S),L;return M>=55296&&M<=56319&&S+1<d.length&&(L=d.charCodeAt(S+1),L>=56320&&L<=57343)?(M-55296)*1024+L-56320+65536:M}function mh(d){var S=/^\n* /;return S.test(d)}var gh=1,cc=2,_h=3,yh=4,Ba=5;function mm(d,S,M,L,R,ee,K,l){var ue,X=0,Fe=null,be=!1,ye=!1,we=L!==-1,Re=-1,We=dm(Ms(d,0))&&fm(Ms(d,d.length-1));if(S||K)for(ue=0;ue<d.length;X>=65536?ue+=2:ue++){if(X=Ms(d,ue),!ks(X))return Ba;We=We&&fh(X,Fe,l),Fe=X}else{for(ue=0;ue<d.length;X>=65536?ue+=2:ue++){if(X=Ms(d,ue),X===As)be=!0,we&&(ye=ye||ue-Re-1>L&&d[Re+1]!==" ",Re=ue);else if(!ks(X))return Ba;We=We&&fh(X,Fe,l),Fe=X}ye=ye||we&&ue-Re-1>L&&d[Re+1]!==" "}return!be&&!ye?We&&!K&&!R(d)?gh:ee===Cs?Ba:cc:M>9&&mh(d)?Ba:K?ee===Cs?Ba:cc:ye?yh:_h}function gm(d,S,M,L,R){d.dump=(function(){if(S.length===0)return d.quotingType===Cs?'""':"''";if(!d.noCompatMode&&(sm.indexOf(S)!==-1||om.test(S)))return d.quotingType===Cs?'"'+S+'"':"'"+S+"'";var ee=d.indent*Math.max(1,M),K=d.lineWidth===-1?-1:Math.max(Math.min(d.lineWidth,40),d.lineWidth-ee),l=L||d.flowLevel>-1&&M>=d.flowLevel;function ue(X){return pm(d,X)}switch(mm(S,l,d.indent,K,ue,d.quotingType,d.forceQuotes&&!L,R)){case gh:return S;case cc:return"'"+S.replace(/'/g,"''")+"'";case _h:return"|"+xh(S,d.indent)+vh(ph(S,ee));case yh:return">"+xh(S,d.indent)+vh(ph(_m(S,K),ee));case Ba:return'"'+ym(S)+'"';default:throw new Vi("impossible error: invalid scalar style")}})()}function xh(d,S){var M=mh(d)?String(S):"",L=d[d.length-1]===`
`,R=L&&(d[d.length-2]===`
`||d===`
`),ee=R?"+":L?"":"-";return M+ee+`
`}function vh(d){return d[d.length-1]===`
`?d.slice(0,-1):d}function _m(d,S){for(var M=/(\n+)([^\n]*)/g,L=(function(){var X=d.indexOf(`
`);return X=X!==-1?X:d.length,M.lastIndex=X,bh(d.slice(0,X),S)})(),R=d[0]===`
`||d[0]===" ",ee,K;K=M.exec(d);){var l=K[1],ue=K[2];ee=ue[0]===" ",L+=l+(!R&&!ee&&ue!==""?`
`:"")+bh(ue,S),R=ee}return L}function bh(d,S){if(d===""||d[0]===" ")return d;for(var M=/ [^ ]/g,L,R=0,ee,K=0,l=0,ue="";L=M.exec(d);)l=L.index,l-R>S&&(ee=K>R?K:l,ue+=`
`+d.slice(R,ee),R=ee+1),K=l;return ue+=`
`,d.length-R>S&&K>R?ue+=d.slice(R,K)+`
`+d.slice(K+1):ue+=d.slice(R),ue.slice(1)}function ym(d){for(var S="",M=0,L,R=0;R<d.length;M>=65536?R+=2:R++)M=Ms(d,R),L=Mi[M],!L&&ks(M)?(S+=d[R],M>=65536&&(S+=d[R+1])):S+=L||cm(M);return S}function xm(d,S,M){var L="",R=d.tag,ee,K,l;for(ee=0,K=M.length;ee<K;ee+=1)l=M[ee],d.replacer&&(l=d.replacer.call(M,String(ee),l)),(cn(d,S,l,!1,!1)||typeof l>"u"&&cn(d,S,null,!1,!1))&&(L!==""&&(L+=","+(d.condenseFlow?"":" ")),L+=d.dump);d.tag=R,d.dump="["+L+"]"}function wh(d,S,M,L){var R="",ee=d.tag,K,l,ue;for(K=0,l=M.length;K<l;K+=1)ue=M[K],d.replacer&&(ue=d.replacer.call(M,String(K),ue)),(cn(d,S+1,ue,!0,!0,!1,!0)||typeof ue>"u"&&cn(d,S+1,null,!0,!0,!1,!0))&&((!L||R!=="")&&(R+=lc(d,S)),d.dump&&As===d.dump.charCodeAt(0)?R+="-":R+="- ",R+=d.dump);d.tag=ee,d.dump=R||"[]"}function vm(d,S,M){var L="",R=d.tag,ee=Object.keys(M),K,l,ue,X,Fe;for(K=0,l=ee.length;K<l;K+=1)Fe="",L!==""&&(Fe+=", "),d.condenseFlow&&(Fe+='"'),ue=ee[K],X=M[ue],d.replacer&&(X=d.replacer.call(M,ue,X)),cn(d,S,ue,!1,!1)&&(d.dump.length>1024&&(Fe+="? "),Fe+=d.dump+(d.condenseFlow?'"':"")+":"+(d.condenseFlow?"":" "),cn(d,S,X,!1,!1)&&(Fe+=d.dump,L+=Fe));d.tag=R,d.dump="{"+L+"}"}function bm(d,S,M,L){var R="",ee=d.tag,K=Object.keys(M),l,ue,X,Fe,be,ye;if(d.sortKeys===!0)K.sort();else if(typeof d.sortKeys=="function")K.sort(d.sortKeys);else if(d.sortKeys)throw new Vi("sortKeys must be a boolean or a function");for(l=0,ue=K.length;l<ue;l+=1)ye="",(!L||R!=="")&&(ye+=lc(d,S)),X=K[l],Fe=M[X],d.replacer&&(Fe=d.replacer.call(M,X,Fe)),cn(d,S+1,X,!0,!0,!0)&&(be=d.tag!==null&&d.tag!=="?"||d.dump&&d.dump.length>1024,be&&(d.dump&&As===d.dump.charCodeAt(0)?ye+="?":ye+="? "),ye+=d.dump,be&&(ye+=lc(d,S)),cn(d,S+1,Fe,!0,be)&&(d.dump&&As===d.dump.charCodeAt(0)?ye+=":":ye+=": ",ye+=d.dump,R+=ye));d.tag=ee,d.dump=R||"{}"}function Sh(d,S,M){var L,R,ee,K,l,ue;for(R=M?d.explicitTypes:d.implicitTypes,ee=0,K=R.length;ee<K;ee+=1)if(l=R[ee],(l.instanceOf||l.predicate)&&(!l.instanceOf||typeof S=="object"&&S instanceof l.instanceOf)&&(!l.predicate||l.predicate(S))){if(M?l.multi&&l.representName?d.tag=l.representName(S):d.tag=l.tag:d.tag="?",l.represent){if(ue=d.styleMap[l.tag]||l.defaultStyle,ah.call(l.represent)==="[object Function]")L=l.represent(S,ue);else if(sh.call(l.represent,ue))L=l.represent[ue](S,ue);else throw new Vi("!<"+l.tag+'> tag resolver accepts not "'+ue+'" style');d.dump=L}return!0}return!1}function cn(d,S,M,L,R,ee,K){d.tag=null,d.dump=M,Sh(d,M,!1)||Sh(d,M,!0);var l=ah.call(d.dump),ue=L,X;L&&(L=d.flowLevel<0||d.flowLevel>S);var Fe=l==="[object Object]"||l==="[object Array]",be,ye;if(Fe&&(be=d.duplicates.indexOf(M),ye=be!==-1),(d.tag!==null&&d.tag!=="?"||ye||d.indent!==2&&S>0)&&(R=!1),ye&&d.usedDuplicates[be])d.dump="*ref_"+be;else{if(Fe&&ye&&!d.usedDuplicates[be]&&(d.usedDuplicates[be]=!0),l==="[object Object]")L&&Object.keys(d.dump).length!==0?(bm(d,S,d.dump,R),ye&&(d.dump="&ref_"+be+d.dump)):(vm(d,S,d.dump),ye&&(d.dump="&ref_"+be+" "+d.dump));else if(l==="[object Array]")L&&d.dump.length!==0?(d.noArrayIndent&&!K&&S>0?wh(d,S-1,d.dump,R):wh(d,S,d.dump,R),ye&&(d.dump="&ref_"+be+d.dump)):(xm(d,S,d.dump),ye&&(d.dump="&ref_"+be+" "+d.dump));else if(l==="[object String]")d.tag!=="?"&&gm(d,d.dump,S,ee,ue);else{if(l==="[object Undefined]")return!1;if(d.skipInvalid)return!1;throw new Vi("unacceptable kind of an object to dump "+l)}d.tag!==null&&d.tag!=="?"&&(X=encodeURI(d.tag[0]==="!"?d.tag.slice(1):d.tag).replace(/!/g,"%21"),d.tag[0]==="!"?X="!"+X:X.slice(0,18)==="tag:yaml.org,2002:"?X="!!"+X.slice(18):X="!<"+X+">",d.dump=X+" "+d.dump)}return!0}function wm(d,S){var M=[],L=[],R,ee;for(uc(d,M,L),R=0,ee=L.length;R<ee;R+=1)S.duplicates.push(M[L[R]]);S.usedDuplicates=new Array(ee)}function uc(d,S,M){var L,R,ee;if(d!==null&&typeof d=="object")if(R=S.indexOf(d),R!==-1)M.indexOf(R)===-1&&M.push(R);else if(S.push(d),Array.isArray(d))for(R=0,ee=d.length;R<ee;R+=1)uc(d[R],S,M);else for(L=Object.keys(d),R=0,ee=L.length;R<ee;R+=1)uc(d[L[R]],S,M)}function Sm(d,S){S=S||{};var M=new hm(S);M.noRefs||wm(d,M);var L=d;return M.replacer&&(L=M.replacer.call({"":L},"",L)),cn(M,0,L,!0,!0)?M.dump+`
`:""}var Tm=Sm,Im={dump:Tm};function hc(d,S){return function(){throw new Error("Function yaml."+d+" is removed in js-yaml 4. Use yaml."+S+" instead, which is now safe by default.")}}var Am=vi,Cm=Tu,km=ku,Mm=Du,Em=Lu,Pm=ic,zm=nh.load,Dm=nh.loadAll,Lm=Im.dump,Fm=Vi,Rm={binary:Nu,float:zu,map:Cu,null:Mu,pairs:Uu,set:$u,timestamp:Bu,bool:Eu,int:Pu,merge:Ou,omap:Vu,seq:Au,str:Iu},Bm=hc("safeLoad","load"),Om=hc("safeLoadAll","loadAll"),Nm=hc("safeDump","dump"),Th={Type:Am,Schema:Cm,FAILSAFE_SCHEMA:km,JSON_SCHEMA:Mm,CORE_SCHEMA:Em,DEFAULT_SCHEMA:Pm,load:zm,loadAll:Dm,dump:Lm,YAMLException:Fm,types:Rm,safeLoad:Bm,safeLoadAll:Om,safeDump:Nm};const Vm={components:{MapPreview:fd,MarkerEditor:xd},props:{value:String,name:String,label:String,help:String,disabled:Boolean,defaultCenter:{type:Array,default:()=>[43.836699,4.360054]},defaultZoom:{type:Number,default:13},maxMarkers:{type:Number,default:50}},setup(d,{emit:S}){const M=Vue.ref({lat:d.defaultCenter[0],lon:d.defaultCenter[1]}),L=Vue.ref(d.defaultZoom),R=Vue.ref([]),ee=Vue.ref(null),K=Vue.ref(!1),l=Vue.ref(null),ue=Vue.ref(null),X=Vue.ref(null);Vue.onMounted(async()=>{Fe(),await Vue.nextTick(),K.value=!0}),Vue.onBeforeUnmount(()=>{l.value&&clearTimeout(l.value)}),Vue.watch(R,()=>{be()},{deep:!0});function Fe(){if(!(!d.value||d.value.trim()===""))try{const it=Th.load(d.value);it&&(it.center&&(M.value={lat:it.center.lat,lon:it.center.lon}),it.zoom!==void 0&&(L.value=it.zoom),it.markers&&Array.isArray(it.markers)&&(R.value=it.markers))}catch(it){console.error("Error loading map data:",it)}}function be(){l.value&&clearTimeout(l.value),l.value=setTimeout(()=>{ye()},300)}function ye(){const it={background:{type:"osm"},center:{lat:M.value.lat,lon:M.value.lon},zoom:L.value,markers:R.value},It=Th.dump(it,{indent:2,lineWidth:-1,noRefs:!0});S("input",It)}function we(){return`marker_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}function Re(){if(R.value.length>=d.maxMarkers)return;let it={lat:M.value.lat,lon:M.value.lon};ue.value&&ue.value.getCurrentCenter&&(it=ue.value.getCurrentCenter());const It={id:we(),position:{lat:it.lat,lon:it.lon},icon:{type:"default"},title:"",description:"",content:[]};R.value=[...R.value,It],ee.value=It.id}function We(it){if(R.value.length>=d.maxMarkers)return;const It={id:we(),position:{lat:it.lat,lon:it.lng},icon:{type:"default"},title:"",description:"",content:[]};R.value=[...R.value,It],ee.value=It.id}function nt(it){confirm("Êtes-vous sûr de vouloir supprimer ce marqueur ?")&&(R.value=R.value.filter(It=>It.id!==it),ee.value===it&&(ee.value=null))}function st(it){ee.value=it;const It=R.value.find(vt=>vt.id===it);It&&ue.value&&ue.value.centerOnPosition&&ue.value.centerOnPosition(It.position.lat,It.position.lon)}function tt({markerId:it,position:It}){const vt=R.value.findIndex(_r=>_r.id===it);if(vt!==-1){const _r=[...R.value];_r[vt]={..._r[vt],position:{lat:It.lat,lon:It.lng}},R.value=_r}}function gr(it){const It=R.value.find(vt=>vt.id===it);It&&(X.value=JSON.parse(JSON.stringify(It)))}function un(it){const It=R.value.findIndex(vt=>vt.id===it.id);if(It!==-1){const vt=[...R.value];vt[It]=it,R.value=vt}}function Zr(){X.value=null}return{center:M,zoom:L,markers:R,selectedMarkerId:ee,mapReady:K,mapPreview:ue,editingMarker:X,addMarkerAtCenter:Re,handleMapClick:We,deleteMarker:nt,selectMarker:st,handleMarkerMoved:tt,editMarker:gr,handleMarkerSave:un,closeEditor:Zr}}};var Um=function(){var S=this,M=S._self._c;return M("k-field",S._b({staticClass:"k-map-editor-field"},"k-field",S.$props,!1),[M("div",{staticClass:"map-editor-container"},[M("div",{staticClass:"map-content"},[M("div",{staticClass:"marker-list-sidebar"},[M("div",{staticClass:"marker-list-header"},[M("h3",[S._v("Marqueurs ("+S._s(S.markers.length)+"/"+S._s(S.maxMarkers)+")")]),M("button",{staticClass:"k-button k-button-icon",attrs:{type:"button",disabled:S.markers.length>=S.maxMarkers,title:"Ajouter un marqueur"},on:{click:S.addMarkerAtCenter}},[M("k-icon",{attrs:{type:"add"}})],1)]),M("div",{staticClass:"marker-list-items"},[S._l(S.markers,function(L,R){return M("div",{key:L.id,staticClass:"m