PageSourceSearch

https://nickmuchi-article-text-summarizer.hf.space/static/js/1877.811eec79.chunk.js

js nickmuchi-article-text-summarizer.hf.space collected 2026-10-03 10:22:06 UTC 2,091,041 bytes, 2 lines download raw bytes

1/*! For license information please see 1877.811eec79.chunk.js.LICENSE.txt */
2(self.webpackChunk_streamlit_app=self.webpackChunk_streamlit_app||[]).push([[1877],{12879:(t,e,i)=>{"use strict";i.r(e),i.d(e,{AGGREGATION_OPERATION:()=>y,CPUGridLayer:()=>Jt,ContourLayer:()=>ii,GPUGridLayer:()=>hi,GridLayer:()=>pi,HeatmapLayer:()=>Ci,HexagonLayer:()=>te,ScreenGridLayer:()=>kt,_AggregationLayer:()=>ot,_BinSorter:()=>wt,_CPUAggregator:()=>jt,_GPUGridAggregator:()=>V});var n=i(64649),r=i(21970),o=i(70353),s=i(12308),a=i(28007),l=i(56474),c=i(94557),u=i(17225);function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=Math.fround(t),r=t-n;return e[i]=n,e[i+1]=r,e}function d(t){return t-Math.fround(t)}function p(t){const e=new Float32Array(32);for(let i=0;i<4;++i)for(let n=0;n<4;++n){const r=4*i+n;h(t[4*n+i],e,2*r)}return e}const A={ONE:1};const f={name:"fp64-arithmetic",vs:"uniform float ONE;\nvec2 split(float a) {\n  const float SPLIT = 4097.0;\n  float t = a * SPLIT;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float a_hi = t * ONE - (t - a);\n  float a_lo = a * ONE - a_hi;\n#else\n  float a_hi = t - (t - a);\n  float a_lo = a - a_hi;\n#endif\n  return vec2(a_hi, a_lo);\n}\nvec2 split2(vec2 a) {\n  vec2 b = split(a.x);\n  b.y += a.y;\n  return b;\n}\nvec2 quickTwoSum(float a, float b) {\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float sum = (a + b) * ONE;\n  float err = b - (sum - a) * ONE;\n#else\n  float sum = a + b;\n  float err = b - (sum - a);\n#endif\n  return vec2(sum, err);\n}\nvec2 twoSum(float a, float b) {\n  float s = (a + b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float v = (s * ONE - a) * ONE;\n  float err = (a - (s - v) * ONE) * ONE * ONE * ONE + (b - v);\n#else\n  float v = s - a;\n  float err = (a - (s - v)) + (b - v);\n#endif\n  return vec2(s, err);\n}\n\nvec2 twoSub(float a, float b) {\n  float s = (a - b);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float v = (s * ONE - a) * ONE;\n  float err = (a - (s - v) * ONE) * ONE * ONE * ONE - (b + v);\n#else\n  float v = s - a;\n  float err = (a - (s - v)) - (b + v);\n#endif\n  return vec2(s, err);\n}\n\nvec2 twoSqr(float a) {\n  float prod = a * a;\n  vec2 a_fp64 = split(a);\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  float err = ((a_fp64.x * a_fp64.x - prod) * ONE + 2.0 * a_fp64.x *\n    a_fp64.y * ONE * ONE) + a_fp64.y * a_fp64.y * ONE * ONE * ONE;\n#else\n  float err = ((a_fp64.x * a_fp64.x - prod) + 2.0 * a_fp64.x * a_fp64.y) + a_fp64.y * a_fp64.y;\n#endif\n  return vec2(prod, err);\n}\n\nvec2 twoProd(float a, float b) {\n  float prod = a * b;\n  vec2 a_fp64 = split(a);\n  vec2 b_fp64 = split(b);\n  float err = ((a_fp64.x * b_fp64.x - prod) + a_fp64.x * b_fp64.y +\n    a_fp64.y * b_fp64.x) + a_fp64.y * b_fp64.y;\n  return vec2(prod, err);\n}\n\nvec2 sum_fp64(vec2 a, vec2 b) {\n  vec2 s, t;\n  s = twoSum(a.x, b.x);\n  t = twoSum(a.y, b.y);\n  s.y += t.x;\n  s = quickTwoSum(s.x, s.y);\n  s.y += t.y;\n  s = quickTwoSum(s.x, s.y);\n  return s;\n}\n\nvec2 sub_fp64(vec2 a, vec2 b) {\n  vec2 s, t;\n  s = twoSub(a.x, b.x);\n  t = twoSub(a.y, b.y);\n  s.y += t.x;\n  s = quickTwoSum(s.x, s.y);\n  s.y += t.y;\n  s = quickTwoSum(s.x, s.y);\n  return s;\n}\n\nvec2 mul_fp64(vec2 a, vec2 b) {\n  vec2 prod = twoProd(a.x, b.x);\n  prod.y += a.x * b.y;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  prod = split2(prod);\n#endif\n  prod = quickTwoSum(prod.x, prod.y);\n  prod.y += a.y * b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  prod = split2(prod);\n#endif\n  prod = quickTwoSum(prod.x, prod.y);\n  return prod;\n}\n\nvec2 div_fp64(vec2 a, vec2 b) {\n  float xn = 1.0 / b.x;\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  vec2 yn = mul_fp64(a, vec2(xn, 0));\n#else\n  vec2 yn = a * xn;\n#endif\n  float diff = (sub_fp64(a, mul_fp64(b, yn))).x;\n  vec2 prod = twoProd(xn, diff);\n  return sum_fp64(yn, prod);\n}\n\nvec2 sqrt_fp64(vec2 a) {\n  if (a.x == 0.0 && a.y == 0.0) return vec2(0.0, 0.0);\n  if (a.x < 0.0) return vec2(0.0 / 0.0, 0.0 / 0.0);\n\n  float x = 1.0 / sqrt(a.x);\n  float yn = a.x * x;\n#if defined(LUMA_FP64_CODE_ELIMINATION_WORKAROUND)\n  vec2 yn_sqr = twoSqr(yn) * ONE;\n#else\n  vec2 yn_sqr = twoSqr(yn);\n#endif\n  float diff = sub_fp64(a, yn_sqr).x;\n  vec2 prod = twoProd(x * 0.5, diff);\n#if defined(LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND)\n  return sum_fp64(split(yn), prod);
2\n#else\n  return sum_fp64(vec2(yn, 0.0), prod);\n#endif\n}\n",fs:null,getUniforms:function(){return A},fp64ify:h,fp64LowPart:d,fp64ifyMatrix4:p};var g=i(46802),m=i(2123);const y={SUM:1,MEAN:2,MIN:3,MAX:4};function v(t,e){return t+e}function _(t,e){return e>t?e:t}function b(t,e){return e<t?e:t}function x(t,e,i){const n=y[t]||y.SUM;switch(e=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isFinite(t))return t;return i=>(e.index=i.index,t(i.source,e))}(e,i),n){case y.MIN:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const i=t.map(e).filter(Number.isFinite);return i.length?i.reduce(b,1/0):null}(t,e);case y.SUM:return t=>function(t,e){if(Number.isFinite(e))return t.length?t.length*e:null;const i=t.map(e).filter(Number.isFinite);return i.length?i.reduce(v,0):null}(t,e);case y.MEAN:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const i=t.map(e).filter(Number.isFinite);return i.length?i.reduce(v,0)/i.length:null}(t,e);case y.MAX:return t=>function(t,e){if(Number.isFinite(e))return t.length?e:null;const i=t.map(e).filter(Number.isFinite);return i.length?i.reduce(_,-1/0):null}(t,e);default:return null}}function w(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return i=>(e.indices=i.map((t=>t.index)),t(i.map((t=>t.source)),e))}const C={projectPoints:!1,viewport:null,createBufferObjects:!0,moduleSettings:{}},B=3402823466e29,E=[32775,32774],S=[32776,32774],T=[32776,32775],M={[y.SUM]:32774,[y.MEAN]:32774,[y.MIN]:E,[y.MAX]:S},I={size:1,operation:y.SUM,needMin:!1,needMax:!1,combineMaxMin:!1},P="#define SHADER_NAME gpu-aggregation-to-grid-vs\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute vec3 weights;\nuniform vec2 cellSize;\nuniform vec2 gridSize;\nuniform bool projectPoints;\nuniform vec2 translation;\nuniform vec3 scaling;\n\nvarying vec3 vWeights;\n\nvec2 project_to_pixel(vec4 pos) {\n  vec4 result;\n  pos.xy = pos.xy/pos.w;\n  result = pos + vec4(translation, 0., 0.);\n  result.xy = scaling.z > 0. ? result.xy * scaling.xy : result.xy;\n  return result.xy;\n}\n\nvoid main(void) {\n\n  vWeights = weights;\n\n  vec4 windowPos = vec4(positions, 1.);\n  if (projectPoints) {\n    windowPos = project_position_to_clipspace(positions, positions64Low, vec3(0));\n  }\n\n  vec2 pos = project_to_pixel(windowPos);\n\n  vec2 pixelXY64[2];\n  pixelXY64[0] = vec2(pos.x, 0.);\n  pixelXY64[1] = vec2(pos.y, 0.);\n  vec2 gridXY64[2];\n  gridXY64[0] = div_fp64(pixelXY64[0], vec2(cellSize.x, 0));\n  gridXY64[1] = div_fp64(pixelXY64[1], vec2(cellSize.y, 0));\n  float x = floor(gridXY64[0].x);\n  float y = floor(gridXY64[1].x);\n  pos = vec2(x, y);\n  pos = (pos * (2., 2.) / (gridSize)) - (1., 1.);\n  vec2 offset = 1.0 / gridSize;\n  pos = pos + offset;\n\n  gl_Position = vec4(pos, 0.0, 1.0);\n  gl_PointSize = 1.0;\n}\n",D="#define SHADER_NAME gpu-aggregation-to-grid-fs\n\nprecision highp float;\n\nvarying vec3 vWeights;\n\nvoid main(void) {\n  gl_FragColor = vec4(vWeights, 1.0);\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",L="#version 300 es\n#define SHADER_NAME gpu-aggregation-all-vs-64\n\nin vec2 position;\nuniform ivec2 gridSize;\nout vec2 vTextureCoord;\n\nvoid main(void) {\n  vec2 pos = vec2(-1.0, -1.0);\n  vec2 offset = 1.0 / vec2(gridSize);\n  pos = pos + offset;\n\n  gl_Position = vec4(pos, 0.0, 1.0);\n\n  int yIndex = gl_InstanceID / gridSize[0];\n  int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n  vec2 yIndexFP64 = vec2(float(yIndex), 0.);\n  vec2 xIndexFP64 = vec2(float(xIndex), 0.);\n  vec2 gridSizeYFP64 = vec2(gridSize[1], 0.);\n  vec2 gridSizeXFP64 = vec2(gridSize[0], 0.);\n\n  vec2 texCoordXFP64 = div_fp64(yIndexFP64, gridSizeYFP64);\n  vec2 texCoordYFP64 = div_fp64(xIndexFP64, gridSizeXFP64);\n\n  vTextureCoord = vec2(texCoordYFP64.x, texCoordXFP64.x);\n  gl_PointSize = 1.0;\n}\n",O="#version 300 es\n#define SHADER_NAME gpu-aggregation-all-fs\n\nprecision highp float;\n\nin vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform bool combineMaxMin;\nout vec4 fragColor;\nvoid main(void) {\n  vec4 textureColor = texture(uSampler, vec2(vTextureCoord.s, vTextureCoord.t));\n  if (textureColor.a == 0.) {\n    discard;\n  }\n  fragColor.rgb = textureColor.rgb;\n  fragColor.a = combineMaxMin ? textureColor.r : textureColor.a;\n}\n",F="#define SHADER_NAME gpu-aggregation-transform-mean-vs\nattribute vec4 aggregationValues;\nvarying vec4 meanValues;\n\nvoid main()\n{\n  bool isCellValid = bool(aggregationValues.w > 0.);\n  meanValues.xyz = isCellValid ? aggregationValues.xyz/aggregationValues.w : vec3(0, 0, 0);\n  meanValues.w = aggregationValues.w;\n  gl_PointSize = 1.0;\n}\n";var R=i(58300),k=i(79078);const z={10240:9728,10241:9728};function U(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:i=1,height:n=1,data:r=null,unpackFlipY:o=!0,parameters:s=z}=e;return new R.Z(t,{data:r,format:(0,a.D0)(t)?34836:6408,type:5126,border:0,mipmaps:!1,parameters:s,dataFormat:6408,width:i,height:n,unpackFlipY:o})}function N(t,e){const{id:i,width:n=1,height:r=1,texture:o}=e;return new k.Z(t,{id:i,width:n,height:r,attachments:{36064:o}})}const G=["aggregationBuffer","maxMinBuffer","minBuffer","maxBuffer"],Z={maxData:"maxBuffer",minData:"minBuffer",maxMinData:"maxMinBuffer"},j=[o.h.WEBGL2,o.h.COLOR_ATTACHMENT_RGBA32F,o.h.BLEND_EQUATION_MINMAX,o.h.FLOAT_BLEND,o.h.TEXTURE_FLOAT];class V{static getAggregationData(t){let{aggregationData:e,maxData:i,minData:n,maxMinData:r,pixelIndex:o}=t;const s=4*o,a={};return e&&(a.cellCount=e[s+3],a.cellWeight=e[s]),r?(a.maxCellWieght=r[0],a.minCellWeight=r[3]):(i&&(a.maxCellWieght=i[0],a.totalCount=i[3]),n&&(a.minCellWeight=n[0],a.totalCount=i[3])),a}static getCellData(t){let{countsData:e,size:i=1}=t;const n=e.length/4,r=new Float32Array(n*i),o=new Uint32Array(n);for(let s=0;s<n;s++){for(let t=0;t<i;t++)r[s*i+t]=e[4*s+t];o[s]=e[4*s+3]}return{cellCounts:o,cellWeights:r}}static isSupported(t){return(0,s.ag)(t,j)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.id=e.id||"gpu-grid-aggregator",this.gl=t,this.state={weightAttributes:{},textures:{},meanTextures:{},buffers:{},framebuffers:{},maxMinFramebuffers:{},minFramebuffers:{},maxFramebuffers:{},equations:{},resources:{},results:{}},this._hasGPUSupport=(0,a.D0)(t)&&(0,s.ag)(this.gl,o.h.BLEND_EQUATION_MINMAX,o.h.COLOR_ATTACHMENT_RGBA32F,o.h.TEXTURE_FLOAT),this._hasGPUSupport&&this._setupModels()}delete(){const{gridAggregationModel:t,allAggregationModel:e,meanTransform:i}=this,{textures:n,framebuffers:r,maxMinFramebuffers:o,minFramebuffers:s,maxFramebuffers:a,meanTextures:l,resources:c}=this.state;null===t||void 0===t||t.delete(),null===e||void 0===e||e.delete(),null===i||void 0===i||i.delete(),function(t){t=Array.isArray(t)?t:[t],t.forEach((t=>{for(const e in t)t[e].delete()}))}([r,n,o,s,a,l,c])}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({results:{}});const e=this._normalizeAggregationParams(t);return this._hasGPUSupport||r.Z.log(1,"GPUGridAggregator: not supported")(),this._runAggregation(e)}getData(t){const e={},i=this.state.results;i[t].aggregationData||(i[t].aggregationData=i[t].aggregationBuffer.getData()),e.aggregationData=i[t].aggregationData;for(const n in Z){const r=Z[n];(i[t][n]||i[t][r])&&(i[t][n]=i[t][n]||i[t][r].getData(),e[n]=i[t][n])}return e}updateShaders(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.setState({shaderOptions:t,modelDirty:!0})}_normalizeAggregationParams(t){const e={...C,...t},{weights:i}=e;return i&&(e.weights=function(t){const e={};for(const i in t)e[i]={...I,...t[i]};return e}(i)),e}setState(t){Object.assign(this.state,t)}_getAggregateData(t){const e={},{textures:i,framebuffers:n,maxMinFramebuffers:r,minFramebuffers:o,maxFramebuffers:s,resources:a}=this.state,{weights:c}=t;
2for(const u in c){e[u]={};const{needMin:t,needMax:h,combineMaxMin:d}=c[u];e[u].aggregationTexture=i[u],e[u].aggregationBuffer=(0,l.Jb)(n[u],{target:c[u].aggregationBuffer,sourceType:5126}),t&&h&&d?(e[u].maxMinBuffer=(0,l.Jb)(r[u],{target:c[u].maxMinBuffer,sourceType:5126}),e[u].maxMinTexture=a["".concat(u,"-maxMinTexture")]):(t&&(e[u].minBuffer=(0,l.Jb)(o[u],{target:c[u].minBuffer,sourceType:5126}),e[u].minTexture=a["".concat(u,"-minTexture")]),h&&(e[u].maxBuffer=(0,l.Jb)(s[u],{target:c[u].maxBuffer,sourceType:5126}),e[u].maxTexture=a["".concat(u,"-maxTexture")]))}return this._trackGPUResultBuffers(e,c),e}_renderAggregateData(t){const{cellSize:e,projectPoints:i,attributes:n,moduleSettings:r,numCol:o,numRow:s,weights:a,translation:l,scaling:c}=t,{maxMinFramebuffers:u,minFramebuffers:h,maxFramebuffers:d}=this.state,p=[o,s],A={blend:!0,depthTest:!1,blendFunc:[1,1]},f={cellSize:e,gridSize:p,projectPoints:i,translation:l,scaling:c};for(const g in a){const{needMin:t,needMax:e}=a[g],i=t&&e&&a[g].combineMaxMin;this._renderToWeightsTexture({id:g,parameters:A,moduleSettings:r,uniforms:f,gridSize:p,attributes:n,weights:a}),i?this._renderToMaxMinTexture({id:g,parameters:{...A,blendEquation:T},gridSize:p,minOrMaxFb:u[g],clearParams:{clearColor:[0,0,0,B]},combineMaxMin:i}):(t&&this._renderToMaxMinTexture({id:g,parameters:{...A,blendEquation:E},gridSize:p,minOrMaxFb:h[g],clearParams:{clearColor:[B,B,B,0]},combineMaxMin:i}),e&&this._renderToMaxMinTexture({id:g,parameters:{...A,blendEquation:S},gridSize:p,minOrMaxFb:d[g],clearParams:{clearColor:[0,0,0,0]},combineMaxMin:i}))}}_renderToMaxMinTexture(t){const{id:e,parameters:i,gridSize:n,minOrMaxFb:r,combineMaxMin:o,clearParams:s={}}=t,{framebuffers:l}=this.state,{gl:c,allAggregationModel:u}=this;(0,a.s8)(c,{...s,framebuffer:r,viewport:[0,0,n[0],n[1]]},(()=>{c.clear(16384),u.draw({parameters:i,uniforms:{uSampler:l[e].texture,gridSize:n,combineMaxMin:o}})}))}_renderToWeightsTexture(t){const{id:e,parameters:i,moduleSettings:n,uniforms:r,gridSize:o,weights:s}=t,{framebuffers:l,equations:c,weightAttributes:h}=this.state,{gl:d,gridAggregationModel:p}=this,{operation:A}=s[e],f=A===y.MIN?[B,B,B,0]:[0,0,0,0];if((0,a.s8)(d,{framebuffer:l[e],viewport:[0,0,o[0],o[1]],clearColor:f},(()=>{d.clear(16384);const t={weights:h[e]};p.draw({parameters:{...i,blendEquation:c[e]},moduleSettings:n,uniforms:r,attributes:t})})),A===y.MEAN){const{meanTextures:t,textures:i}=this.state,n={_sourceTextures:{aggregationValues:t[e]},_targetTexture:i[e],elementCount:i[e].width*i[e].height};this.meanTransform?this.meanTransform.update(n):this.meanTransform=function(t,e){return new u.Z(t,{vs:F,_targetTextureVarying:"meanValues",...e})}(d,n),this.meanTransform.run({parameters:{blend:!1,depthTest:!1}}),l[e].attach({36064:i[e]})}}_runAggregation(t){this._updateModels(t),this._setupFramebuffers(t),this._renderAggregateData(t);const e=this._getAggregateData(t);return this.setState({results:e}),e}_setupFramebuffers(t){const{textures:e,framebuffers:i,maxMinFramebuffers:n,minFramebuffers:r,maxFramebuffers:o,meanTextures:s,equations:a}=this.state,{weights:l}=t,{numCol:c,numRow:u}=t,h={width:c,height:u};for(const d in l){const{needMin:t,needMax:p,combineMaxMin:A,operation:f}=l[d];e[d]=l[d].aggregationTexture||e[d]||U(this.gl,{id:"".concat(d,"-texture"),width:c,height:u}),e[d].resize(h);let g=e[d];f===y.MEAN&&(s[d]=s[d]||U(this.gl,{id:"".concat(d,"-mean-texture"),width:c,height:u}),s[d].resize(h),g=s[d]),i[d]?i[d].attach({36064:g}):i[d]=N(this.gl,{id:"".concat(d,"-fb"),width:c,height:u,texture:g}),i[d].resize(h),a[d]=M[f]||M.SUM,(t||p)&&(t&&p&&A?n[d]||(g=l[d].maxMinTexture||this._getMinMaxTexture("".concat(d,"-maxMinTexture")),n[d]=N(this.gl,{id:"".concat(d,"-maxMinFb"),texture:g})):(t&&(r[d]||(g=l[d].minTexture||this._getMinMaxTexture("".concat(d,"-minTexture")),r[d]=N(this.gl,{id:"".concat(d,"-minFb"),texture:g}))),p&&(o[d]||(g=l[d].maxTexture||this._getMinMaxTexture("".concat(d,"-maxTexture")),o[d]=N(this.gl,{id:"".concat(d,"-maxFb"),texture:g})))))}}_getMinMaxTexture(t){const{resources:e}=this.state;return e[t]||(e[t]=U(this.gl,{id:"resourceName"})),e[t]}_setupModels(){let{numCol:t=0,numRow:e=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var i;const{gl:n}=this,{shaderOptions:r}=this.state;if(null===(i=this.gridAggregationModel)||void 0===i||i.delete(),this.gridAggregationModel=function(t,e){const i=(0,g.l)({vs:P,fs:D,modules:[f,m.Z]},e);return new c.Z(t,{id:"Gird-Aggregation-Model",vertexCount:1,drawMode:0,...i})}(n,r),!this.allAggregationModel){const i=t*e;this.allAggregationModel=function(t,e){return new c.Z(t,{id:"All-Aggregation-Model",vs:L,fs:O,modules:[f],vertexCount:1,drawMode:0,isInstanced:!0,instanceCount:e,attributes:{position:[0,0]}})}(n,i)}}_setupWeightAttributes(t){const{weightAttributes:e}=this.state,{weights:i}=t;
2for(const n in i)e[n]=t.attributes[n]}_trackGPUResultBuffers(t,e){const{resources:i}=this.state;for(const n in t)if(t[n])for(const r of G)if(t[n][r]&&e[n][r]!==t[n][r]){const e="gpu-result-".concat(n,"-").concat(r);i[e]&&i[e].delete(),i[e]=t[n][r]}}_updateModels(t){const{vertexCount:e,attributes:i,numCol:n,numRow:r}=t,{modelDirty:o}=this.state;o&&(this._setupModels(t),this.setState({modelDirty:!1})),this._setupWeightAttributes(t),this.gridAggregationModel.setVertexCount(e),this.gridAggregationModel.setAttributes(i),this.allAggregationModel.setInstanceCount(n*r)}}var H=i(69296),J=i(90031),W=i(2578);const Q=[[255,255,178],[254,217,118],[254,178,76],[253,141,60],[240,59,32],[189,0,38]];function q(t){let e,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Float32Array;if(Number.isFinite(t[0]))e=new n(t);else{e=new n(4*t.length);let i=0;for(let n=0;n<t.length;n++){const r=t[n];e[i++]=r[0],e[i++]=r[1],e[i++]=r[2],e[i++]=Number.isFinite(r[3])?r[3]:255}}if(i)for(let r=0;r<e.length;r++)e[r]/=255;return e}const K=[0,0,0,0],X=[0,255,0,255],Y=["minColor","maxColor","colorRange","colorDomain"],$={cellSizePixels:{value:100,min:1},cellMarginPixels:{value:2,min:0,max:5},colorDomain:null,colorRange:Q};class tt extends J.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}static isSupported(t){return(0,s.ag)(t,[o.h.TEXTURE_FLOAT])}getShaders(){return{vs:"#define SHADER_NAME screen-grid-layer-vertex-shader\n#define RANGE_COUNT 6\n\nattribute vec3 positions;\nattribute vec3 instancePositions;\nattribute vec4 instanceCounts;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform vec3 cellScale;\nuniform vec4 minColor;\nuniform vec4 maxColor;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 colorDomain;\nuniform bool shouldUseMinMax;\nuniform sampler2D maxTexture;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n  vec4 outColor = vec4(0., 0., 0., 0.);\n  if (value >= domain.x && value <= domain.y) {\n    float domainRange = domain.y - domain.x;\n    if (domainRange <= 0.) {\n      outColor = colorRange[0];\n    } else {\n      float rangeCount = float(RANGE_COUNT);\n      float rangeStep = domainRange / rangeCount;\n      float idx = floor((value - domain.x) / rangeStep);\n      idx = clamp(idx, 0., rangeCount - 1.);\n      int intIdx = int(idx);\n      outColor = colorRange[intIdx];\n    }\n  }\n  outColor = outColor / 255.;\n  return outColor;\n}\n\nvoid main(void) {\n  vSampleCount = instanceCounts.a;\n\n  float weight = instanceCounts.r;\n  float maxWeight = texture2D(maxTexture, vec2(0.5)).r;\n\n  float step = weight / maxWeight;\n  vec4 minMaxColor = mix(minColor, maxColor, step) / 255.;\n\n  vec2 domain = colorDomain;\n  float domainMaxValid = float(colorDomain.y != 0.);\n  domain.y = mix(maxWeight, colorDomain.y, domainMaxValid);\n  vec4 rangeColor = quantizeScale(domain, colorRange, weight);\n\n  float rangeMinMax = float(shouldUseMinMax);\n  vec4 color = mix(rangeColor, minMaxColor, rangeMinMax);\n  vColor = vec4(color.rgb, color.a * opacity);\n\n  // Set color to be rendered to picking fbo (also used to check for selection highlight).\n  picking_setPickingColor(instancePickingColors);\n\n  gl_Position = vec4(instancePositions + positions * cellScale, 1.);\n}\n",fs:"#define SHADER_NAME screen-grid-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying float vSampleCount;\n\nvoid main(void) {\n  if (vSampleCount <= 0.0) {\n    discard;\n  }\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[W.Z]}}initializeState(){const{gl:t}=this.context;this.getAttributeManager().addInstanced({instancePositions:{size:3,update:this.calculateInstancePositions},instanceCounts:{size:4,noAlloc:!0}}),this.setState({model:this._getModel(t)})}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){super.updateState(t);const{oldProps:e,props:i,changeFlags:n}=t,r=this.getAttributeManager();i.numInstances!==e.numInstances?r.invalidateAll():e.cellSizePixels!==i.cellSizePixels&&r.invalidate("instancePositions"),this._updateUniforms(e,i,n)}draw(t){let{uniforms:e}=t;const{parameters:i,maxTexture:n}=this.props,r=this.props.minColor||K,o=this.props.maxColor||X,s=this.props.colorDomain||[1,0],{model:a}=this.state;a.setUniforms(e).setUniforms({minColor:r,maxColor:o,maxTexture:n,colorDomain:s}).draw({parameters:{depthTest:!1,depthMask:!1,...i}})}calculateInstancePositions(t,e){let{numInstances:i}=e;const{width:n,height:r}=this.context.viewport,{cellSizePixels:o}=this.props,s=Math.ceil(n/o),{value:a,size:l}=t;for(let c=0;c<i;c++){const t=c%s,e=Math.floor(c/s);a[c*l+0]=t*o/n*2-1,a[c*l+1]=1-e*o/r*2,a[c*l+2]=0}}
vendor: 9,476 bytes, line 2
2_getModel(t){return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new H.Z({drawMode:6,attributes:{positions:new Float32Array([0,0,0,1,0,0,1,1,0,0,1,0])}}),isInstanced:!0})}_shouldUseMinMax(){const{minColor:t,maxColor:e,colorDomain:i,colorRange:n}=this.props;return t||e?(r.Z.deprecated("ScreenGridLayer props: minColor and maxColor","colorRange, colorDomain")(),!0):!i&&!n}_updateUniforms(t,e,i){const{model:n}=this.state;if(Y.some((i=>t[i]!==e[i]))&&n.setUniforms({shouldUseMinMax:this._shouldUseMinMax()}),t.colorRange!==e.colorRange&&n.setUniforms({colorRange:q(e.colorRange)}),t.cellMarginPixels!==e.cellMarginPixels||t.cellSizePixels!==e.cellSizePixels||i.viewportChanged){const{width:t,height:e}=this.context.viewport,{cellSizePixels:i,cellMarginPixels:r}=this.props,o=i>r?r:0,s=new Float32Array([(i-o)/t*2,-(i-o)/e*2,1]);n.setUniforms({cellScale:s})}}}(0,n.Z)(tt,"layerName","ScreenGridCellLayer"),(0,n.Z)(tt,"defaultProps",$);var et=i(79366),it=i(49473),nt=i(96684);function rt(t,e){const i={};for(const n in t)e.includes(n)||(i[n]=t[n]);return i}class ot extends et.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}initializeAggregationLayer(t){super.initializeState(this.context),this.setState({ignoreProps:rt(this.constructor._propTypes,t.data.props),dimensions:t})}updateState(t){super.updateState(t);const{changeFlags:e}=t;if(e.extensionsChanged){const t=this.getShaders({});t&&t.defines&&(t.defines.NON_INSTANCED_MODEL=1),this.updateShaders(t)}this._updateAttributes()}updateAttributes(t){this.setState({changedAttributes:t})}getAttributes(){return this.getAttributeManager().getShaderAttributes()}getModuleSettings(){const{viewport:t,mousePosition:e,gl:i}=this.context;return Object.assign(Object.create(this.props),{viewport:t,mousePosition:e,pickingActive:0,devicePixelRatio:(0,a.w)(i)})}updateShaders(t){}isAggregationDirty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{props:i,oldProps:n,changeFlags:r}=t,{compareAll:o=!1,dimension:s}=e,{ignoreProps:a}=this.state,{props:l,accessors:c=[]}=s,{updateTriggersChanged:u}=r;if(r.dataChanged)return!0;if(u){if(u.all)return!0;for(const t of c)if(u[t])return!0}if(o)return!!r.extensionsChanged||(0,it.tg)({oldProps:n,newProps:i,ignoreProps:a,propTypes:this.constructor._propTypes});for(const h of l)if(i[h]!==n[h])return!0;return!1}isAttributeChanged(t){const{changedAttributes:e}=this.state;return t?e&&void 0!==e[t]:!function(t){let e=!0;for(const i in t){e=!1;break}return e}(e)}_getAttributeManager(){return new nt.Z(this.context.gl,{id:this.props.id,stats:this.context.stats})}}(0,n.Z)(ot,"layerName","AggregationLayer");var st=i(33839);function at(t,e,i){const n=i;return n.domain=()=>t,n.range=()=>e,n}function lt(t,e){return at(t,e,(i=>function(t,e,i){const n=t[1]-t[0];if(n<=0)return r.Z.warn("quantizeScale: invalid domain, returning range[0]")(),e[0];const o=n/e.length,s=Math.floor((i-t[0])/o),a=Math.max(Math.min(s,e.length-1),0);return e[a]}(t,e,i)))}function ct(t,e){return at(t,e,(i=>function(t,e,i){return(i-t[0])/(t[1]-t[0])*(e[1]-e[0])+e[0]}(t,e,i)))}function ut(t,e){const i=t.sort(ht);let n=0;const r=Math.max(1,e.length),o=new Array(r-1);for(;++n<r;)o[n-1]=dt(i,n/r);const s=t=>function(t,e,i){return e[function(t,e){let i=0,n=t.length;for(;i<n;){const r=i+n>>>1;ht(t[r],e)>0?n=r:i=r+1}return i}(t,i)]}(o,e,t);return s.thresholds=()=>o,at(t,e,s)}function ht(t,e){return t-e}function dt(t,e){const i=t.length;if(e<=0||i<2)return t[0];if(e>=1)return t[i-1];const n=(i-1)*e,r=Math.floor(n),o=t[r];return o+(t[r+1]-o)*(n-r)}function pt(t,e){const i=new Map,n=[];for(const r of t){const t="".concat(r);i.has(t)||i.set(t,n.push(r))}return at(t,e,(t=>function(t,e,i,n){const r="".concat(n);let o=e.get(r);return void 0===o&&(o=t.push(n),e.set(r,o)),i[(o-1)%i.length]}(n,i,e,t)))}function At(t){return void 0!==t&&null!==t}function ft(t,e){return("function"===typeof e?t.map(e):t).filter(At)}function gt(t,e){return ft(t,e)}function mt(t,e){return function(t){const e=[];return t.forEach((t=>{!e.includes(t)&&At(t)&&e.push(t)})),e}(ft(t,e))}const yt=t=>t.length,vt=t=>t.points,_t=t=>t.index,bt=(t,e)=>t<e?-1:t>e?1:t>=e?0:NaN,xt={getValue:yt,getPoints:vt,getIndex:_t,filterData:null};class wt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xt;(0,n.Z)(this,"maxCount",void 0),(0,n.Z)(this,"maxValue",void 0),(0,n.Z)(this,"minValue",void 0),(0,n.Z)(this,"totalCount",void 0),(0,n.Z)(this,"aggregatedBins",void 0),(0,n.Z)(this,"sortedBins",void 0),(0,n.Z)(this,"binMap",void 0),this.aggregatedBins=this.getAggregatedBins(t,e),this._updateMinMaxValues(),this.binMap=this.getBinMap()}getAggregatedBins(t,e){const{getValue:i=yt,getPoints:n=vt,getIndex:r=_t,filterData:o}=e,s="function"===typeof o,a=t.length,l=[];let c=0;for(let u=0;u<a;u++){const e=t[u],a=n(e),h=r(e),d=s?a.filter(o):a;e.filteredPoints=s?d:null;const p=d.length?i(d):null;null!==p&&void 0!==p&&(l[c]={i:Number.isFinite(h)?h:u,value:p,counts:d.length},c++)}return l}_percentileToIndex(t){const e=this.sortedBins.length;if(e<2)return[0,0];const[i,n]=t.map((t=>{return e=t,i=0,n=100,Math.max(i,Math.min(n,e));var e,i,n}));return[Math.ceil(i/100*(e-1)),Math.floor(n/100*(e-1))]}getBinMap(){const t={};for(const e of this.aggregatedBins)t[e.i]=e;return t}_updateMinMaxValues(){let t=0,e=0,i=3402823466e29,n=0;for(const r of this.aggregatedBins)t=t>r.counts?t:r.counts,e=e>r.value?e:r.value,i=i<r.value?i:r.value,n+=r.counts;this.maxCount=t,this.maxValue=e,this.minValue=i,this.totalCount=n}getValueRange(t){if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(((t,e)=>bt(t.value,e.value)))),!this.sortedBins.length)return[];let e=0,i=this.sortedBins.length-1;if(Array.isArray(t)){const n=this._percentileToIndex(t);e=n[0],i=n[1]}return[this.sortedBins[e].value,this.sortedBins[i].value]}getValueDomainByScale(t){let[e=0,i=100]=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(this.sortedBins||(this.sortedBins=this.aggregatedBins.sort(((t,e)=>bt(t.value,e.value)))),!this.sortedBins.length)return[];const n=this._percentileToIndex([e,i]);return this._getScaleDomain(t,n)}_getScaleDomain(t,e){let[i,n]=e;const r=this.sortedBins;switch(t){case"quantize":case"linear":default:return[r[i].value,r[n].value];case"quantile":return gt(r.slice(i,n+1),(t=>t.value));case"ordinal":return mt(r,(t=>t.value))}}}var Ct=i(73115),Bt=i(18252);const Et=6378e3;function St(t){return Number.isFinite(t)?t:0}function Tt(t,e){const i=t.positions.value;let n,r,o=1/0,s=-1/0,a=1/0,l=-1/0;for(let c=0;c<e;c++)r=i[3*c],n=i[3*c+1],o=n<o?n:o,s=n>s?n:s,a=r<a?r:a,l=r>l?r:l;return{xMin:St(a),xMax:St(l),yMin:St(o),yMax:St(s)}}function Mt(t,e){const i=t<0?-1:1;let n=i<0?Math.abs(t)+e:Math.abs(t);return n=Math.floor(n/e)*e,n*i}function It(t,e){if(!(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]))return{xOffset:e,yOffset:e};const{yMin:i,yMax:n}=t;return function(t,e){const i=(s=t,s/Et*(180/Math.PI)),n=(r=e,o=t,o/Et*(180/Math.PI)/Math.cos(r*Math.PI/180));var r,o;var s;return{yOffset:i,xOffset:n}}(e,(i+n)/2)}function Pt(t,e,i,n){const o=It(t,e,n!==Bt.Df.CARTESIAN),s=function(t,e,i,n){const{width:o,height:s}=n,a=i===Bt.Df.CARTESIAN?[-o/2,-s/2]:[-180,-90];r.Z.assert(i===Bt.Df.CARTESIAN||i===Bt.Df.LNGLAT||i===Bt.Df.DEFAULT);const{xMin:l,yMin:c}=t;return[-1*(Mt(l-a[0],e.xOffset)+a[0]),-1*(Mt(c-a[1],e.yOffset)+a[1])]}(t,o,n,i),{xMin:a,yMin:l,xMax:c,yMax:u}=t,h=c-a+o.xOffset,d=u-l+o.yOffset;return{gridOffset:o,translation:s,width:h,height:d,numCol:Math.ceil(h/o.xOffset),numRow:Math.ceil(d/o.yOffset)}}function Dt(t,e){const i=function(t,e){const{data:i=[],cellSize:n}=t,{attributes:r,viewport:o,projectPoints:s,numInstances:a}=e,l=r.positions.value,{size:c}=r.positions.getAccessor(),u=e.boundingBox||function(t,e){const i=t.value,{size:n}=t.getAccessor();let r,o,s=1/0,a=-1/0,l=1/0,c=-1/0;for(let u=0;u<e;u++)o=i[u*n],r=i[u*n+1],Number.isFinite(o)&&Number.isFinite(r)&&(s=r<s?r:s,a=r>a?r:a,l=o<l?o:l,c=o>c?o:c);return{xMin:l,xMax:c,yMin:s,yMax:a}}(r.positions,a),h=e.posOffset||[180,90],d=e.gridOffset||It(u,n);if(d.xOffset<=0||d.yOffset<=0)return{gridHash:{},gridOffset:d};const{width:p,height:A}=o,f=Math.ceil(p/d.xOffset),g=Math.ceil(A/d.yOffset),m={},{iterable:y,objectInfo:v}=(0,Ct.jB)(i),_=new Array(3);for(const b of y){v.index++,_[0]=l[v.index*c],_[1]=l[v.index*c+1],_[2]=c>=3?l[v.index*c+2]:0;const[t,e]=s?o.project(_):_;if(Number.isFinite(t)&&Number.isFinite(e)){const i=Math.floor((e+h[1])/d.yOffset),n=Math.floor((t+h[0])/d.xOffset);if(!s||n>=0&&n<f&&i>=0&&i<g){const t="".concat(i,"-").concat(n);m[t]=m[t]||{count:0,points:[],lonIdx:n,latIdx:i},m[t].count+=1,m[t].points.push({source:b,index:v.index})}}}return{gridHash:m,gridOffset:d,offsets:[-1*h[0],-1*h[1]]}}(t,e),n=function(t){let{gridHash:e,gridOffset:i,offsets:n}=t;const r=new Array(Object.keys(e).length);let o=0;for(const s in e){const t=s.split("-"),a=parseInt(t[0],10),l=parseInt(t[1],10),c=o++;r[c]={index:c,position:[n[0]+i.xOffset*l,n[1]+i.yOffset*a],...e[s]}}return r}(i);return{gridHash:i.gridHash,gridOffset:i.gridOffset,data:n}}class Lt extends ot{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}initializeAggregationLayer(t){let{dimensions:e}=t;const{gl:i}=this.context;super.initializeAggregationLayer(e),this.setState({layerData:{},gpuGridAggregator:new V(i,{id:"".concat(this.id,"-gpu-aggregator")}),cpuGridAggregator:Dt})}updateState(t){super.updateState(t),this.updateAggregationState(t);
2const{aggregationDataDirty:e,aggregationWeightsDirty:i,gpuAggregation:n}=this.state;if(this.getNumInstances()<=0)return;let r=!1;(e||n&&i)&&(this._updateAggregation(t),r=!0),n||!e&&!i||(this._updateWeightBins(),this._uploadAggregationResults(),r=!0),this.setState({aggregationDirty:r})}finalizeState(t){var e;const{count:i}=this.state.weights;i&&i.aggregationBuffer&&i.aggregationBuffer.delete(),null===(e=this.state.gpuGridAggregator)||void 0===e||e.delete(),super.finalizeState(t)}updateShaders(t){this.state.gpuAggregation&&this.state.gpuGridAggregator.updateShaders(t)}updateAggregationState(t){r.Z.assert(!1)}allocateResources(t,e){if(this.state.numRow!==t||this.state.numCol!==e){const i=e*t*4*4,n=this.context.gl,{weights:r}=this.state;for(const t in r){const e=r[t];e.aggregationBuffer&&e.aggregationBuffer.delete(),e.aggregationBuffer=new st.Z(n,{byteLength:i,accessor:{size:4,type:5126,divisor:1}})}}}updateResults(t){let{aggregationData:e,maxMinData:i,maxData:n,minData:r}=t;const{count:o}=this.state.weights;o&&(o.aggregationData=e,o.maxMinData=i,o.maxData=n,o.minData=r)}_updateAggregation(t){const{cpuGridAggregator:e,gpuGridAggregator:i,gridOffset:n,posOffset:r,translation:o=[0,0],scaling:s=[0,0,0],boundingBox:a,projectPoints:l,gpuAggregation:c,numCol:u,numRow:h}=this.state,{props:d}=t,{viewport:p}=this.context,A=this.getAttributes(),f=this.getNumInstances();if(c){const{weights:t}=this.state;i.run({weights:t,cellSize:[n.xOffset,n.yOffset],numCol:u,numRow:h,translation:o,scaling:s,vertexCount:f,projectPoints:l,attributes:A,moduleSettings:this.getModuleSettings()})}else{const t=e(d,{gridOffset:n,projectPoints:l,attributes:A,viewport:p,posOffset:r,boundingBox:a});this.setState({layerData:t})}}_updateWeightBins(){const{getValue:t}=this.state,e=new wt(this.state.layerData.data||[],{getValue:t});this.setState({sortedBins:e})}_uploadAggregationResults(){const{numCol:t,numRow:e}=this.state,{data:i}=this.state.layerData,{aggregatedBins:n,minValue:r,maxValue:o,totalCount:s}=this.state.sortedBins,a=new Float32Array(t*e*4).fill(0);for(const h of n){const{lonIdx:e,latIdx:n}=i[h.i],{value:r,counts:o}=h,s=4*(e+n*t);a[s]=r,a[s+4-1]=o}const l=new Float32Array([o,0,0,r]),c=new Float32Array([o,0,0,s]),u=new Float32Array([r,0,0,s]);this.updateResults({aggregationData:a,maxMinData:l,maxData:c,minData:u})}}(0,n.Z)(Lt,"layerName","GridAggregationLayer");const Ot={...tt.defaultProps,getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM"},Ft="positions",Rt={data:{props:["cellSizePixels"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class kt extends Lt{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}initializeState(){const{gl:t}=this.context;if(!tt.isSupported(t))return this.setState({supported:!1}),void r.Z.error("ScreenGridLayer: ".concat(this.id," is not supported on this browser"))();super.initializeAggregationLayer({dimensions:Rt,getCellSize:t=>t.cellSizePixels});const e={count:{size:1,operation:y.SUM,needMax:!0,maxTexture:U(t,{id:"".concat(this.id,"-max-texture")})}};this.setState({supported:!0,projectPoints:!0,weights:e,subLayerData:{attributes:{}},maxTexture:e.count.maxTexture,positionAttributeName:"positions",posOffset:[0,0],translation:[1,-1]});this.getAttributeManager().add({[Ft]:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}shouldUpdateState(t){let{changeFlags:e}=t;return this.state.supported&&e.somethingChanged}updateState(t){super.updateState(t)}renderLayers(){if(!this.state.supported)return[];const{maxTexture:t,numRow:e,numCol:i,weights:n}=this.state,{updateTriggers:r}=this.props,{aggregationBuffer:o}=n.count;return new(this.getSubLayerClass("cells",tt))(this.props,this.getSubLayerProps({id:"cell-layer",updateTriggers:r}),{data:{attributes:{instanceCounts:o}},maxTexture:t,numInstances:e*i})}finalizeState(t){super.finalizeState(t);const{aggregationBuffer:e,maxBuffer:i,maxTexture:n}=this.state;null===e||void 0===e||e.delete(),null===i||void 0===i||i.delete(),null===n||void 0===n||n.delete()}getPickingInfo(t){let{info:e}=t;const{index:i}=e;if(i>=0){const{gpuGridAggregator:t,gpuAggregation:n,weights:r}=this.state,o=n?t.getData("count"):r.count;e.object=V.getAggregationData({pixelIndex:i,...o})}return e}updateResults(t){let{aggregationData:e,maxData:i}=t;const{count:n}=this.state.weights;n.aggregationData=e,n.aggregationBuffer.setData({data:e}),n.maxData=i,n.maxTexture.setImageData({data:i})}updateAggregationState(t){const e=t.props.cellSizePixels,i=t.oldProps.cellSizePixels!==e,{viewportChanged:n}=t.changeFlags;let o=t.props.gpuAggregation;this.state.gpuAggregation!==t.props.gpuAggregation&&o&&!V.isSupported(this.context.gl)&&(r.Z.warn("GPU Grid Aggregation not supported, falling back to CPU")(),o=!1);const s=o!==this.state.gpuAggregation;this.setState({gpuAggregation:o});const a=this.isAttributeChanged(Ft),{dimensions:l}=this.state,{data:c,weights:u}=l,h=a||s||n||this.isAggregationDirty(t,{compareAll:o,dimension:c}),d=this.isAggregationDirty(t,{dimension:u});
vendor: 29,375 bytes, line 2
2this.setState({aggregationDataDirty:h,aggregationWeightsDirty:d});const{viewport:p}=this.context;if(n||i){const{width:t,height:i}=p,n=Math.ceil(t/e),r=Math.ceil(i/e);this.allocateResources(r,n),this.setState({scaling:[t/2,-i/2,1],gridOffset:{xOffset:e,yOffset:e},width:t,height:i,numCol:n,numRow:r})}d&&this._updateAccessors(t),(h||d)&&this._resetResults()}_updateAccessors(t){const{getWeight:e,aggregation:i,data:n}=t.props,{count:r}=this.state.weights;r&&(r.getWeight=e,r.operation=y[i]),this.setState({getValue:x(i,e,{data:n})})}_resetResults(){const{count:t}=this.state.weights;t&&(t.aggregationData=null)}}(0,n.Z)(kt,"layerName","ScreenGridLayer"),(0,n.Z)(kt,"defaultProps",Ot);var zt=i(90555);function Ut(){}const Nt=["getBins","getDomain","getScaleFunc"],Gt=[{key:"fillColor",accessor:"getFillColor",pickingInfo:"colorValue",getBins:{triggers:{value:{prop:"getColorValue",updateTrigger:"getColorValue"},weight:{prop:"getColorWeight",updateTrigger:"getColorWeight"},aggregation:{prop:"colorAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"lowerPercentile"},upperPercentile:{prop:"upperPercentile"},scaleType:{prop:"colorScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"colorDomain"},range:{prop:"colorRange"}},onSet:{props:"onSetColorDomain"}},nullValue:[0,0,0,0]},{key:"elevation",accessor:"getElevation",pickingInfo:"elevationValue",getBins:{triggers:{value:{prop:"getElevationValue",updateTrigger:"getElevationValue"},weight:{prop:"getElevationWeight",updateTrigger:"getElevationWeight"},aggregation:{prop:"elevationAggregation"},filterData:{prop:"_filterData",updateTrigger:"_filterData"}}},getDomain:{triggers:{lowerPercentile:{prop:"elevationLowerPercentile"},upperPercentile:{prop:"elevationUpperPercentile"},scaleType:{prop:"elevationScaleType"}}},getScaleFunc:{triggers:{domain:{prop:"elevationDomain"},range:{prop:"elevationRange"}},onSet:{props:"onSetElevationDomain"}},nullValue:-1}],Zt=t=>t.cellSize;class jt{constructor(t){this.state={layerData:{},dimensions:{}},this.changeFlags={},this.dimensionUpdaters={},this._getCellSize=t.getCellSize||Zt,this._getAggregator=t.getAggregator,this._addDimension(t.dimensions||Gt)}static defaultDimensions(){return Gt}updateState(t,e){const{oldProps:i,props:n,changeFlags:r}=t;this.updateGetValueFuncs(i,n,r);const o=this.needsReProjectPoints(i,n,r);let s=!1;if(r.dataChanged||o)this.getAggregatedData(n,e),s=!0;else{(this.getDimensionChanges(i,n,r)||[]).forEach((t=>"function"===typeof t&&t())),s=!0}return this.setState({aggregationDirty:s}),this.state}setState(t){this.state={...this.state,...t}}setDimensionState(t,e){this.setState({dimensions:{...this.state.dimensions,[t]:{...this.state.dimensions[t],...e}}})}normalizeResult(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.hexagons?{data:t.hexagons,...t}:t.layerData?{data:t.layerData,...t}:t}getAggregatedData(t,e){const i=this._getAggregator(t)(t,e);this.setState({layerData:this.normalizeResult(i)}),this.changeFlags={layerData:!0},this.getSortedBins(t)}updateGetValueFuncs(t,e,i){for(const n in this.dimensionUpdaters){const{value:r,weight:o,aggregation:s}=this.dimensionUpdaters[n].getBins.triggers;let a=e[r.prop];this.needUpdateDimensionStep(this.dimensionUpdaters[n].getBins,t,e,i)&&(a=a?w(a,{data:e.data}):x(e[s.prop],e[o.prop],{data:e.data})),a&&this.setDimensionState(n,{getValue:a})}}needsReProjectPoints(t,e,i){return this._getCellSize(t)!==this._getCellSize(e)||this._getAggregator(t)!==this._getAggregator(e)||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPosition)}addDimension(t){this._addDimension(t)}_addDimension(){(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>{const{key:e}=t;this.dimensionUpdaters[e]=this.getDimensionUpdaters(t),this.state.dimensions[e]={getValue:null,domain:null,sortedBins:null,scaleFunc:Ut}}))}getDimensionUpdaters(t){let{key:e,accessor:i,pickingInfo:n,getBins:r,getDomain:o,getScaleFunc:s,nullValue:a}=t;return{key:e,accessor:i,pickingInfo:n,getBins:{updater:this.getDimensionSortedBins,...r},getDomain:{updater:this.getDimensionValueDomain,...o},getScaleFunc:{updater:this.getDimensionScale,...s},attributeAccessor:this.getSubLayerDimensionAttribute(e,a)}}needUpdateDimensionStep(t,e,i,n){return Object.values(t.triggers).some((t=>t.updateTrigger?n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged[t.updateTrigger]):e[t.prop]!==i[t.prop]))}getDimensionChanges(t,e,i){const n=[];for(const r in this.dimensionUpdaters){const o=Nt.find((n=>this.needUpdateDimensionStep(this.dimensionUpdaters[r][n],t,e,i)));o&&n.push(this.dimensionUpdaters[r][o].updater.bind(this,e,this.dimensionUpdaters[r]))}return n.length?n:null}getUpdateTriggers(t){const e=t.updateTriggers||{},i={};for(const n in this.dimensionUpdaters){const{accessor:r}=this.dimensionUpdaters[n];i[r]={},Nt.forEach((o=>{Object.values(this.dimensionUpdaters[n][o].triggers).forEach((n=>{let{prop:o,updateTrigger:s}=n;if(s){const t=e[s];"object"!==typeof t||Array.isArray(t)?void 0!==t&&(i[r][o]=t):Object.assign(i[r],t)}else i[r][o]=t[o]}))}))}return i}getSortedBins(t){for(const e in this.dimensionUpdaters)this.getDimensionSortedBins(t,this.dimensionUpdaters[e])}getDimensionSortedBins(t,e){const{key:i}=e,{getValue:n}=this.state.dimensions[i],r=new wt(this.state.layerData.data||[],{getValue:n,filterData:t._filterData});this.setDimensionState(i,{sortedBins:r}),this.getDimensionValueDomain(t,e)}getDimensionValueDomain(t,e){const{getDomain:i,key:n}=e,{triggers:{lowerPercentile:r,upperPercentile:o,scaleType:s}}=i,a=this.state.dimensions[n].sortedBins.getValueDomainByScale(t[s.prop],[t[r.prop],t[o.prop]]);this.setDimensionState(n,{valueDomain:a}),this.getDimensionScale(t,e)}getDimensionScale(t,e){const{key:i,getScaleFunc:n,getDomain:r}=e,{domain:o,range:s}=n.triggers,{scaleType:a}=r.triggers,{onSet:l}=n,c=t[s.prop],u=t[o.prop]||this.state.dimensions[i].valueDomain,h=function(t){switch(t){case"quantize":default:return lt;case"linear":return ct;case"quantile":return ut;case"ordinal":return pt}}(a&&t[a.prop]),d=h(u,c);"object"===typeof l&&"function"===typeof t[l.props]&&t[l.props](d.domain()),this.setDimensionState(i,{scaleFunc:d})}getSubLayerDimensionAttribute(t,e){return i=>{const{sortedBins:n,scaleFunc:r}=this.state.dimensions[t],o=n.binMap[i.index];if(o&&0===o.counts)return e;const s=o&&o.value,a=r.domain();return s>=a[0]&&s<=a[a.length-1]?r(s):e}}getSubLayerAccessors(t){const e={};for(const i in this.dimensionUpdaters){const{accessor:n}=this.dimensionUpdaters[i];e[n]=this.getSubLayerDimensionAttribute(t,i)}return e}getPickingInfo(t){let{info:e}=t;let i=null;if(e.picked&&e.index>-1){const t=this.state.layerData.data[e.index],n={};for(const e in this.dimensionUpdaters){const{pickingInfo:i}=this.dimensionUpdaters[e],{sortedBins:r}=this.state.dimensions[e],o=r.binMap[t.index]&&r.binMap[t.index].value;n[i]=o}i=Object.assign(n,t,{points:t.filteredPoints||t.points})}return e.picked=Boolean(i),e.object=i,e}getAccessor(t){return this.dimensionUpdaters.hasOwnProperty(t)?this.dimensionUpdaters[t].attributeAccessor:Ut}}function Vt(){}const Ht={colorDomain:null,colorRange:Q,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",min:0,max:100,value:0},upperPercentile:{type:"number",min:0,max:100,value:100},colorScaleType:"quantize",onSetColorDomain:Vt,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",min:0,max:100,value:0},elevationUpperPercentile:{type:"number",min:0,max:100,value:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:Vt,gridAggregator:Dt,cellSize:{type:"number",min:0,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:t=>t.position},extruded:!1,material:!0,_filterData:{type:"function",value:null,optional:!0}};class Jt extends ot{initializeState(){const t=new jt({getAggregator:t=>t.gridAggregator,getCellSize:t=>t.cellSize});this.state={cpuAggregator:t,aggregatorState:t.state};this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"}})}updateState(t){super.updateState(t),this.setState({aggregatorState:this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes(),numInstances:this.getNumInstances()})})}getPickingInfo(t){let{info:e}=t;return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}_onGetSublayerElevation(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:t,extruded:e,cellSize:i,coverage:n,material:r,transitions:o}=this.props,{cpuAggregator:s}=this.state,a=this.getSubLayerClass("grid-cell",zt.Z),l=this._getSublayerUpdateTriggers();return new a({cellSize:i,coverage:n,material:r,elevationScale:t,extruded:e,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:o&&{getFillColor:o.getColorValue||o.getColorWeight,getElevation:o.getElevationValue||o.getElevationWeight}},this.getSubLayerProps({id:"grid-cell",updateTriggers:l}),{data:s.state.layerData.data})}}(0,n.Z)(Jt,"layerName","CPUGridLayer"),(0,n.Z)(Jt,"defaultProps",Ht);var Wt=i(35387),Qt=Math.PI/3,qt=[0,Qt,2*Qt,3*Qt,4*Qt,5*Qt];function Kt(t){return t[0]}function Xt(t){return t[1]}function Yt(){}const $t={colorDomain:null,colorRange:Q,getColorValue:{type:"accessor",value:null},getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",lowerPercentile:{type:"number",value:0,min:0,max:100},upperPercentile:{type:"number",value:100,min:0,max:100},colorScaleType:"quantize",onSetColorDomain:Yt,elevationDomain:null,elevationRange:[0,1e3],getElevationValue:{type:"accessor",value:null},getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationLowerPercentile:{type:"number",value:0,min:0,max:100},elevationUpperPercentile:{type:"number",value:100,min:0,max:100},elevationScale:{type:"number",min:0,value:1},elevationScaleType:"linear",onSetElevationDomain:Yt,radius:{type:"number",value:1e3,min:1},coverage:{type:"number",min:0,max:1,value:1},extruded:!1,hexagonAggregator:function(t,e){const{data:i,radius:n}=t,{viewport:o,attributes:s}=e,a=i.length?function(t,e){const{attributes:i}=e,n=i.positions.value,{size:r}=i.positions.getAccessor();let o,s=1/0,a=1/0,l=-1/0,c=-1/0;for(o=0;o<r*t.length;o+=r){const t=n[o],e=n[o+1];Number.isFinite(t)&&Number.isFinite(e)&&(s=Math.min(t,s),l=Math.max(t,l),a=Math.min(e,a),c=Math.max(e,c))}return[s,a,l,c].every(Number.isFinite)?[(s+l)/2,(a+c)/2]:null}(i,e):null,l=function(t,e,i){const{unitsPerMeter:n}=e.getDistanceScales(i);return t*n[0]}(n,o,a),c=[],{iterable:u,objectInfo:h}=(0,Ct.jB)(i),d=s.positions.value,{size:p}=s.positions.getAccessor();for(const f of u){h.index++;const t=h.index*p,e=[d[t],d[t+1]];Number.isFinite(e[0])&&Number.isFinite(e[1])?c.push({screenCoord:o.projectFlat(e),source:f,index:h.index}):r.Z.warn("HexagonLayer: invalid position")()}const A=function(){var t,e,i,n=0,r=0,o=1,s=1,a=Kt,l=Xt;function c(t){var n,r={},o=[],s=t.length;for(n=0;n<s;++n)if(!isNaN(u=+a.call(null,c=t[n],n,t))&&!isNaN(h=+l.call(null,c,n,t))){var c,u,h,d=Math.round(h/=i),p=Math.round(u=u/e-(1&d)/2),A=h-d;if(3*Math.abs(A)>1){var f=u-p,g=p+(u<p?-1:1)/2,m=d+(h<d?-1:1),y=u-g,v=h-m;f*f+A*A>y*y+v*v&&(p=g+(1&d?1:-1)/2,d=m)}var _=p+"-"+d,b=r[_];b?b.push(c):(o.push(b=r[_]=[c]),b.x=(p+(1&d)/2)*e,b.y=d*i)}return o}function u(t){var e=0,i=0;return qt.map((function(n){var r=Math.sin(n)*t,o=-Math.cos(n)*t,s=r-e,a=o-i;return e=r,i=o,[s,a]}))}return c.hexagon=function(e){return"m"+u(null==e?t:+e).join("l")+"z"},c.centers=function(){for(var a=[],l=Math.round(r/i),c=Math.round(n/e),u=l*i;u<s+t;u+=i,++l)for(var h=c*e+(1&l)*e/2;h<o+e/2;h+=e)a.push([h,u]);return a},c.mesh=function(){var e=u(t).slice(0,4).join("l");return c.centers().map((function(t){return"M"+t+"m"+e})).join("")},c.x=function(t){return arguments.length?(a=t,c):a},c.y=function(t){return arguments.length?(l=t,c):l},c.radius=function(n){return arguments.length?(e=2*(t=+n)*Math.sin(Qt),i=1.5*t,c):t},c.size=function(t){return arguments.length?(n=r=0,o=+t[0],s=+t[1],c):[o-n,s-r]},c.extent=function(t){return arguments.length?(n=+t[0][0],r=+t[0][1],o=+t[1][0],s=+t[1][1],c):[[n,r],[o,s]]},c.radius(1)}().radius(l).x((t=>t.screenCoord[0])).y((t=>t.screenCoord[1]));return{hexagons:A(c).map(((t,e)=>({position:o.unprojectFlat([t.x,t.y]),points:t,index:e}))),radiusCommon:l}},getPosition:{type:"accessor",value:t=>t.position},material:!0,_filterData:{type:"function",value:null,optional:!0}};class te extends ot{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}initializeState(){const t=new jt({getAggregator:t=>t.hexagonAggregator,getCellSize:t=>t.radius});this.state={cpuAggregator:t,aggregatorState:t.state,vertices:null};this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"}})}updateState(t){if(super.updateState(t),t.changeFlags.propsOrDataChanged){const e=this.state.cpuAggregator.updateState(t,{viewport:this.context.viewport,attributes:this.getAttributes()});if(this.state.aggregatorState.layerData!==e.layerData){const{hexagonVertices:t}=e.layerData||{};this.setState({vertices:t&&this.convertLatLngToMeterOffset(t)})}this.setState({aggregatorState:e})}}convertLatLngToMeterOffset(t){const{viewport:e}=this.context;if(Array.isArray(t)&&6===t.length){const i=t[0],n=t[3],r=[(i[0]+n[0])/2,(i[1]+n[1])/2],o=e.projectFlat(r),{metersPerUnit:s}=e.getDistanceScales(r);return t.map((t=>{const i=e.projectFlat(t);return[(i[0]-o[0])*s[0],(i[1]-o[1])*s[1]]}))}return r.Z.error("HexagonLayer: hexagonVertices needs to be an array of 6 points")(),null}getPickingInfo(t){let{info:e}=t;return this.state.cpuAggregator.getPickingInfo({info:e})}_onGetSublayerColor(t){return this.state.cpuAggregator.getAccessor("fillColor")(t)}_onGetSublayerElevation(t){return this.state.cpuAggregator.getAccessor("elevation")(t)}_getSublayerUpdateTriggers(){return this.state.cpuAggregator.getUpdateTriggers(this.props)}renderLayers(){const{elevationScale:t,extruded:e,coverage:i,material:n,transitions:r}=this.props,{aggregatorState:o,vertices:s}=this.state,a=this.getSubLayerClass("hexagon-cell",Wt.Z),l=this._getSublayerUpdateTriggers();return new a({...s?{vertices:s,radius:1}:{radius:o.layerData.radiusCommon||1,radiusUnits:"common",angle:90},diskResolution:6,elevationScale:t,extruded:e,coverage:i,material:n,getFillColor:this._onGetSublayerColor.bind(this),getElevation:this._onGetSublayerElevation.bind(this),transitions:r&&{getFillColor:r.getColorValue||r.getColorWeight,getElevation:r.getElevationValue||r.getElevationWeight}},this.getSubLayerProps({id:"hexagon-cell",updateTriggers:l}),{data:o.layerData.data})}}(0,n.Z)(te,"layerName","HexagonLayer"),(0,n.Z)(te,"defaultProps",$t);var ee=i(24985),ie=i(3453);const ne=.5,re=1/6,oe={N:[0,ne],E:[ne,0],S:[0,-.5],W:[-.5,0],NE:[ne,ne],NW:[-.5,ne],SE:[ne,-.5],SW:[-.5,-.5]},se=[oe.W,oe.SW,oe.S],ae=[oe.S,oe.SE,oe.E],le=[oe.E,oe.NE,oe.N],ce=[oe.NW,oe.W,oe.N],ue=[[-.5,re],[-.5,-re],[-re,-.5],[re,-.5]],he=[[-re,-.5],[re,-.5],[ne,-re],[ne,re]],de=[[ne,-re],[ne,re],[re,ne],[-re,ne]],pe=[[-.5,re],[-.5,-re],[re,ne],[-re,ne]],Ae=[oe.W,oe.SW,oe.SE,oe.E],fe=[oe.S,oe.SE,oe.NE,oe.N],ge=[oe.NW,oe.W,oe.E,oe.NE],me=[oe.NW,oe.SW,oe.S,oe.N],ye=[[-.5,re],[-.5,-re],[ne,-re],[ne,re]],ve=[[-re,-.5],[re,-.5],[re,ne],[-re,ne]],_e=[oe.NW,oe.SW,oe.SE,oe.NE],be=[oe.NW,oe.SW,oe.SE,oe.E,oe.N],xe=[oe.W,oe.SW,oe.SE,oe.NE,oe.N],we=[oe.NW,oe.W,oe.S,oe.SE,oe.NE],Ce=[oe.NW,oe.SW,oe.S,oe.E,oe.NE],Be=[oe.NW,oe.W,[ne,-re],[ne,re],oe.N],Ee=[[-re,-.5],[re,-.5],oe.E,oe.NE,oe.N],Se=[[-.5,re],[-.5,-re],oe.S,oe.SE,oe.E],Te=[oe.W,oe.SW,oe.S,[re,ne],[-re,ne]],Me=[oe.NW,oe.W,[-re,-.5],[re,-.5],oe.N],Ie=[[-.5,re],[-.5,-re],oe.E,oe.NE,oe.N],Pe=[oe.S,oe.SE,oe.E,[re,ne],[-re,ne]],De=[oe.W,oe.SW,oe.S,[ne,-re],[ne,re]],Le=[oe.W,oe.SW,oe.SE,oe.E,[re,ne],[-re,ne]],Oe=[[-.5,re],[-.5,-re],oe.S,oe.SE,oe.NE,oe.N],Fe=[oe.NW,oe.W,[-re,-.5],[re,-.5],oe.E,oe.NE],Re=[oe.NW,oe.SW,oe.S,[ne,-re],[ne,re],oe.N],ke=[oe.W,oe.SW,oe.S,oe.E,oe.NE,oe.N],ze=[oe.NW,oe.W,oe.S,oe.SE,oe.E,oe.N],Ue=[[-.5,re],[-.5,-re],[-re,-.5],[re,-.5],oe.E,oe.NE,oe.N],Ne=[oe.W,oe.SW,oe.S,[ne,-re],[ne,re],[re,ne],[-re,ne]],Ge=[oe.NW,oe.W,[-re,-.5],[re,-.5],[ne,-re],[ne,re],oe.N],Ze=[[-.5,re],[-.5,-re],oe.S,oe.SE,oe.E,[re,ne],[-re,ne]],je=[[-.5,re],[-.5,-re],[-re,-.5],[re,-.5],[ne,-re],[ne,re],[re,ne],[-re,ne]],Ve={0:[],1:[[oe.W,oe.S]],2:[[oe.S,oe.E]],3:[[oe.W,oe.E]],4:[[oe.N,oe.E]],5:{0:[[oe.W,oe.S],[oe.N,oe.E]],1:[[oe.W,oe.N],[oe.S,oe.E]]},6:[[oe.N,oe.S]],7:[[oe.W,oe.N]],8:[[oe.W,oe.N]],9:[[oe.N,oe.S]],10:{0:[[oe.W,oe.N],[oe.S,oe.E]],1:[[oe.W,oe.S],[oe.N,oe.E]]},11:[[oe.N,oe.E]],12:[[oe.W,oe.E]],13:[[oe.S,oe.E]],14:[[oe.W,oe.S]],15:[]};function He(t){return parseInt(t,4)}const Je={[He("0000")]:[],[He("2222")]:[],[He("2221")]:[se],[He("2212")]:[ae],[He("2122")]:[le],[He("1222")]:[ce],[He("0001")]:[se],[He("0010")]:[ae],[He("0100")]:[le],[He("1000")]:[ce],[He("2220")]:[ue],[He("2202")]:[he],[He("2022")]:[de],[He("0222")]:[pe],[He("0002")]:[ue],[He("0020")]:[he],[He("0200")]:[de],[He("2000")]:[pe],[He("0011")]:[Ae],[He("0110")]:[fe],[He("1100")]:[ge],[He("1001")]:[me],[He("2211")]:[Ae],[He("2112")]:[fe],[He("1122")]:[ge],[He("1221")]:[me],[He("2200")]:[ye],[He("2002")]:[ve],[He("0022")]:[ye],[He("0220")]:[ve],[He("1111")]:[_e],[He("1211")]:[be],[He("2111")]:[xe],[He("1112")]:[we],[He("1121")]:[Ce],[He("1011")]:[be],[He("0111")]:[xe],[He("1110")]:[we],[He("1101")]:[Ce],[He("1200")]:[Be],[He("0120")]:[Ee],[He("0012")]:[Se],[He("2001")]:[Te],[He("1022")]:[Be],[He("2102")]:[Ee],[He("2210")]:[Se],[He("0221")]:[Te],[He("1002")]:[Me],[He("2100")]:[Ie],[He("0210")]:[Pe],[He("0021")]:[De],[He("1220")]:[Me],[He("0122")]:[Ie],[He("2012")]:[Pe],[He("2201")]:[De],[He("0211")]:[Le],[He("2110")]:[Oe],[He("1102")]:[Fe],[He("1021")]:[Re],[He("2011")]:[Le],[He("0112")]:[Oe],[He("1120")]:[Fe],[He("1201")]:[Re],[He("2101")]:[ke],[He("0121")]:[ke],[He("1012")]:[ze],[He("1210")]:[ze],[He("0101")]:{0:[se,le],1:[ke],2:[ke]},[He("1010")]:{0:[ce,ae],1:[ze],2:[ze]},[He("2121")]:{0:[ke],1:[ke],2:[se,le]},[He("1212")]:{0:[ze],1:[ze],2:[ce,ae]},[He("2120")]:{0:[Ue],1:[Ue],2:[ue,le]},[He("2021")]:{0:[Ne],1:[Ne],2:[se,de]},[He("1202")]:{0:[Ge],1:[Ge],2:[ce,he]},[He("0212")]:{0:[Ze],1:[Ze],2:[ae,pe]},[He("0102")]:{0:[ue,le],1:[Ue],2:[Ue]},[He("0201")]:{0:[se,de],1:[Ne],2:[Ne]},[He("1020")]:{0:[ce,he],1:[Ge],2:[Ge]},[He("2010")]:{0:[ae,pe],1:[Ze],2:[Ze]},[He("2020")]:{0:[pe,he],1:[je],2:[ue,de]},[He("0202")]:{0:[de,ue],1:[je],2:[pe,he]}},We={ISO_LINES:1,ISO_BANDS:2},Qe={zIndex:0,zOffset:.005};function qe(t,e){return Array.isArray(e)?t<e[0]?0:t<e[1]?1:2:t>=e?1:0}function Ke(t){const{cellWeights:e,x:i,y:n,width:o,height:s}=t;let a=t.threshold;t.thresholdValue&&(r.Z.deprecated("thresholdValue","threshold")(),a=t.thresholdValue);const l=i<0,c=i>=o-1,u=n<0,h=n>=s-1,d=l||c||u||h,p={},A={};l||h?A.top=0:(p.top=e[(n+1)*o+i],A.top=qe(p.top,a)),c||h?A.topRight=0:(p.topRight=e[(n+1)*o+i+1],A.topRight=qe(p.topRight,a)),c||u?A.right=0:(p.right=e[n*o+i+1],A.right=qe(p.right,a)),l||u?A.current=0:(p.current=e[n*o+i],A.current=qe(p.current,a));const{top:f,topRight:g,right:m,current:y}=A;let v=-1;Number.isFinite(a)&&(v=f<<3|g<<2|m<<1|y),Array.isArray(a)&&(v=f<<6|g<<4|m<<2|y);let _=0;return d||(_=qe((p.top+p.topRight+p.right+p.current)/4,a)),{code:v,meanCode:_}}function Xe(t){const{gridOrigin:e,cellSize:i,x:n,y:r,code:o,meanCode:s,type:a=We.ISO_LINES}=t,l={...Qe,...t.thresholdData};let c=a===We.ISO_BANDS?Je[o]:Ve[o];Array.isArray(c)||(c=c[s]);const u=l.zIndex*l.zOffset,h=(n+1)*i[0],d=(r+1)*i[1],p=e[0]+h,A=e[1]+d;if(a===We.ISO_BANDS){const t=[];return c.forEach((e=>{const n=[];e.forEach((t=>{const e=p+t[0]*i[0],r=A+t[1]*i[1];n.push([e,r,u])})),t.push(n)})),t}const f=[];return c.forEach((t=>{t.forEach((t=>{const e=p+t[0]*i[0],n=A+t[1]*i[1];f.push([e,n,u])}))})),f}const Ye=[255,255,255,255],$e={cellSize:{type:"number",min:1,max:1e3,value:1e3},getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},gpuAggregation:!0,aggregation:"SUM",contours:[{threshold:1}],zOffset:.005},ti="positions",ei={data:{props:["cellSize"]},weights:{props:["aggregation"],accessors:["getWeight"]}};class ii extends Lt{initializeState(){super.initializeAggregationLayer({dimensions:ei}),this.setState({contourData:{},projectPoints:!1,weights:{count:{size:1,operation:y.SUM}}});this.getAttributeManager().add({[ti]:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},count:{size:3,accessor:"getWeight"}})}updateState(t){super.updateState(t);let e=!1;const{oldProps:i,props:n}=t,{aggregationDirty:r}=this.state;i.contours===n.contours&&i.zOffset===n.zOffset||(e=!0,this._updateThresholdData(t.props)),this.getNumInstances()>0&&(r||e)&&this._generateContours()}renderLayers(){const{contourSegments:t,contourPolygons:e}=this.state.contourData,i=this.getSubLayerClass("lines",ee.Z),n=this.getSubLayerClass("bands",ie.Z);return[t&&t.length>0&&new i(this.getSubLayerProps({id:"lines"}),{data:this.state.contourData.contourSegments,getSourcePosition:t=>t.start,getTargetPosition:t=>t.end,getColor:t=>t.contour.color||Ye,getWidth:t=>t.contour.strokeWidth||1}),e&&e.length>0&&new n(this.getSubLayerProps({id:"bands"}),{data:this.state.contourData.contourPolygons,getPolygon:t=>t.vertices,getFillColor:t=>t.contour.color||Ye})]}updateAggregationState(t){const{props:e,oldProps:i}=t,{cellSize:n,coordinateSystem:o}=e,{viewport:s}=this.context,a=i.cellSize!==n;let l=e.gpuAggregation;this.state.gpuAggregation!==e.gpuAggregation&&l&&!V.isSupported(this.context.gl)&&(r.Z.warn("GPU Grid Aggregation not supported, falling back to CPU")(),l=!1);const c=l!==this.state.gpuAggregation;this.setState({gpuAggregation:l});const{dimensions:u}=this.state,h=this.isAttributeChanged(ti),{data:d,weights:p}=u;let{boundingBox:A}=this.state;if(h&&(A=Tt(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:A})),h||a){const{gridOffset:t,translation:e,width:i,height:r,numCol:a,numRow:l}=Pt(A,n,s,o);this.allocateResources(l,a),this.setState({gridOffset:t,boundingBox:A,translation:e,posOffset:e.slice(),gridOrigin:[-1*e[0],-1*e[1]],width:i,height:r,numCol:a,numRow:l})}const f=h||c||this.isAggregationDirty(t,{dimension:d,compareAll:l}),g=this.isAggregationDirty(t,{dimension:p});g&&this._updateAccessors(t),(f||g)&&this._resetResults(),this.setState({aggregationDataDirty:f,aggregationWeightsDirty:g})}_updateAccessors(t){const{getWeight:e,aggregation:i,data:n}=t.props,{count:r}=this.state.weights;r&&(r.getWeight=e,r.operation=y[i]),this.setState({getValue:x(i,e,{data:n})})}_resetResults(){const{count:t}=this.state.weights;t&&(t.aggregationData=null)}_generateContours(){const{numCol:t,numRow:e,gridOrigin:i,gridOffset:n,thresholdData:r}=this.state,{count:o}=this.state.weights;let{aggregationData:s}=o;s||(s=o.aggregationBuffer.getData(),o.aggregationData=s);const{cellWeights:a}=V.getCellData({countsData:s}),l=function(t){let{thresholdData:e,cellWeights:i,gridSize:n,gridOrigin:r,cellSize:o}=t;const s=[],a=[],l=n[0],c=n[1];let u=0,h=0;for(const d of e){const{contour:t}=d,{threshold:e}=t;for(let n=-1;n<l;n++)for(let p=-1;p<c;p++){const{code:A,meanCode:f}=Ke({cellWeights:i,threshold:e,x:n,y:p,width:l,height:c}),g={type:We.ISO_BANDS,gridOrigin:r,cellSize:o,x:n,y:p,width:l,height:c,code:A,meanCode:f,thresholdData:d};if(Array.isArray(e)){g.type=We.ISO_BANDS;const e=Xe(g);for(const i of e)a[h++]={vertices:i,contour:t}}else{g.type=We.ISO_LINES;const e=Xe(g);for(let i=0;i<e.length;i+=2)s[u++]={start:e[i],end:e[i+1],contour:t}}}}return{contourSegments:s,contourPolygons:a}}({thresholdData:r,cellWeights:a,gridSize:[t,e],gridOrigin:i,cellSize:[n.xOffset,n.yOffset]});this.setState({contourData:l})}_updateThresholdData(t){const{contours:e,zOffset:i}=t,n=e.length,r=new Array(n);for(let o=0;o<n;o++){const t=e[o];r[o]={contour:t,zIndex:t.zIndex||o,zOffset:i}}this.setState({thresholdData:r})}}(0,n.Z)(ii,"layerName","ContourLayer"),(0,n.Z)(ii,"defaultProps",$e);var ni=i(54976),ri=i(64441),oi=i(34819);const si={colorDomain:null,colorRange:Q,elevationDomain:null,elevationRange:[0,1e3],elevationScale:{type:"number",min:0,value:1},gridSize:{type:"array",value:[1,1]},gridOrigin:{type:"array",value:[0,0]},gridOffset:{type:"array",value:[0,0]},cellSize:{type:"number",min:0,max:1e3,value:1e3},offset:{type:"array",value:[1,1]},coverage:{type:"number",min:0,max:1,value:1},extruded:!0,material:!0};class ai extends J.Z{getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-vertex-shader\n#define RANGE_COUNT 6\n\nin vec3 positions;\nin vec3 normals;\n\nin vec4 colors;\nin vec4 elevations;\nin vec3 instancePickingColors;\n\n// Custom uniforms\nuniform vec2 offset;\nuniform bool extruded;\nuniform float cellSize;\nuniform float coverage;\nuniform float opacity;\nuniform float elevationScale;\n\nuniform ivec2 gridSize;\nuniform vec2 gridOrigin;\nuniform vec2 gridOriginLow;\nuniform vec2 gridOffset;\nuniform vec2 gridOffsetLow;\nuniform vec4 colorRange[RANGE_COUNT];\nuniform vec2 elevationRange;\n\n// Domain uniforms\nuniform vec2 colorDomain;\nuniform bool colorDomainValid;\nuniform vec2 elevationDomain;\nuniform bool elevationDomainValid;\n\nlayout(std140) uniform;\nuniform ColorData\n{\n  vec4 maxMinCount;\n} colorData;\nuniform ElevationData\n{\n  vec4 maxMinCount;\n} elevationData;\n\n#define EPSILON 0.00001\n\n// Result\nout vec4 vColor;\n\nvec4 quantizeScale(vec2 domain, vec4 range[RANGE_COUNT], float value) {\n  vec4 outColor = vec4(0., 0., 0., 0.);\n  if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n    float domainRange = domain.y - domain.x;\n    if (domainRange <= 0.) {\n      outColor = colorRange[0];\n    } else {\n      float rangeCount = float(RANGE_COUNT);\n      float rangeStep = domainRange / rangeCount;\n      float idx = floor((value - domain.x) / rangeStep);\n      idx = clamp(idx, 0., rangeCount - 1.);\n      int intIdx = int(idx);\n      outColor = colorRange[intIdx];\n    }\n  }\n  return outColor;\n}\n\nfloat linearScale(vec2 domain, vec2 range, float value) {\n  if (value >= (domain.x - EPSILON) && value <= (domain.y + EPSILON)) {\n    return ((value - domain.x) / (domain.y - domain.x)) * (range.y - range.x) + range.x;\n  }\n  return -1.;\n}\n\nvoid main(void) {\n  vec2 clrDomain = colorDomainValid ? colorDomain : vec2(colorData.maxMinCount.a, colorData.maxMinCount.r);\n  vec4 color = quantizeScale(clrDomain, colorRange, colors.r);\n\n  float elevation = 0.0;\n\n  if (extruded) {\n    vec2 elvDomain = elevationDomainValid ? elevationDomain : vec2(elevationData.maxMinCount.a, elevationData.maxMinCount.r);\n    elevation = linearScale(elvDomain, elevationRange, elevations.r);\n    elevation = elevation  * (positions.z + 1.0) / 2.0 * elevationScale;\n  }\n\n  // if aggregated color or elevation is 0 do not render\n  float shouldRender = float(color.r > 0.0 && elevations.r >= 0.0);\n  float dotRadius = cellSize / 2. * coverage * shouldRender;\n\n  int yIndex = (gl_InstanceID / gridSize[0]);\n  int xIndex = gl_InstanceID - (yIndex * gridSize[0]);\n\n  vec2 instancePositionXFP64 = mul_fp64(vec2(gridOffset[0], gridOffsetLow[0]), vec2(float(xIndex), 0.));\n  instancePositionXFP64 = sum_fp64(instancePositionXFP64, vec2(gridOrigin[0], gridOriginLow[0]));\n  vec2 instancePositionYFP64 = mul_fp64(vec2(gridOffset[1], gridOffsetLow[1]), vec2(float(yIndex), 0.));\n  instancePositionYFP64 = sum_fp64(instancePositionYFP64, vec2(gridOrigin[1], gridOriginLow[1]));\n\n  vec3 centroidPosition = vec3(instancePositionXFP64[0], instancePositionYFP64[0], elevation);\n  vec3 centroidPosition64Low = vec3(instancePositionXFP64[1], instancePositionYFP64[1], 0.0);\n  geometry.worldPosition = centroidPosition;\n  vec3 pos = vec3(project_size(positions.xy + offset) * dotRadius, 0.);\n\n  // Set color to be rendered to picking fbo (also used to check for selection highlight).\n  picking_setPickingColor(instancePickingColors);\n\n  gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n\n  // Light calculations\n  // Worldspace is the linear space after Mercator projection\n\n  vec3 normals_commonspace = project_normal(normals);\n\n   if (extruded) {\n    vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace);\n    vColor = vec4(lightColor, color.a * opacity) / 255.;\n  } else {\n    vColor = vec4(color.rgb, color.a * opacity) / 255.;\n  }\n}\n",fs:"#version 300 es\n#define SHADER_NAME gpu-grid-cell-layer-fragment-shader\n\nprecision highp float;\n\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  fragColor = vColor;\n  fragColor = picking_filterColor(fragColor);\n}\n",modules:[m.Z,ni.N,W.Z,f]})}initializeState(t){let{gl:e}=t;this.getAttributeManager().addInstanced({colors:{size:4,noAlloc:!0},elevations:{size:4,noAlloc:!0}});const i=this._getModel(e);this._setupUniformBuffer(i),this.setState({model:i})}
2_getModel(t){return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new oi.Z,isInstanced:!0})}draw(t){let{uniforms:e}=t;const{cellSize:i,offset:n,extruded:r,elevationScale:o,coverage:s,gridSize:a,gridOrigin:l,gridOffset:c,elevationRange:u,colorMaxMinBuffer:h,elevationMaxMinBuffer:d}=this.props,p=[(0,ri.Ks)(l[0]),(0,ri.Ks)(l[1])],A=[(0,ri.Ks)(c[0]),(0,ri.Ks)(c[1])],f=this.getDomainUniforms(),g=q(this.props.colorRange);this.bindUniformBuffers(h,d),this.state.model.setUniforms(e).setUniforms(f).setUniforms({cellSize:i,offset:n,extruded:r,elevationScale:o,coverage:s,gridSize:a,gridOrigin:l,gridOriginLow:p,gridOffset:c,gridOffsetLow:A,colorRange:g,elevationRange:u}).draw(),this.unbindUniformBuffers(h,d)}bindUniformBuffers(t,e){t.bind({target:35345,index:0}),e.bind({target:35345,index:1})}unbindUniformBuffers(t,e){t.unbind({target:35345,index:0}),e.unbind({target:35345,index:1})}getDomainUniforms(){const{colorDomain:t,elevationDomain:e}=this.props,i={};return null!==t?(i.colorDomainValid=!0,i.colorDomain=t):i.colorDomainValid=!1,null!==e?(i.elevationDomainValid=!0,i.elevationDomain=e):i.elevationDomainValid=!1,i}_setupUniformBuffer(t){const e=this.context.gl,i=t.program.handle,n=e.getUniformBlockIndex(i,"ColorData"),r=e.getUniformBlockIndex(i,"ElevationData");e.uniformBlockBinding(i,n,0),e.uniformBlockBinding(i,r,1)}}(0,n.Z)(ai,"layerName","GPUGridCellLayer"),(0,n.Z)(ai,"defaultProps",si);const li={colorDomain:null,colorRange:Q,getColorWeight:{type:"accessor",value:1},colorAggregation:"SUM",elevationDomain:null,elevationRange:[0,1e3],getElevationWeight:{type:"accessor",value:1},elevationAggregation:"SUM",elevationScale:{type:"number",min:0,value:1},cellSize:{type:"number",min:1,max:1e3,value:1e3},coverage:{type:"number",min:0,max:1,value:1},getPosition:{type:"accessor",value:t=>t.position},extruded:!1,material:!0},ci={data:{props:["cellSize","colorAggregation","elevationAggregation"]}},ui="positions";class hi extends Lt{initializeState(t){let{gl:e}=t;const i=V.isSupported(e);i||r.Z.error("GPUGridLayer is not supported on this browser, use GridLayer instead")(),super.initializeAggregationLayer({dimensions:ci}),this.setState({gpuAggregation:!0,projectPoints:!1,isSupported:i,weights:{color:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new st.Z(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})},elevation:{needMin:!0,needMax:!0,combineMaxMin:!0,maxMinBuffer:new st.Z(e,{byteLength:16,accessor:{size:4,type:5126,divisor:1}})}},positionAttributeName:"positions"});this.getAttributeManager().add({[ui]:{size:3,accessor:"getPosition",type:5130,fp64:this.use64bitPositions()},color:{size:3,accessor:"getColorWeight"},elevation:{size:3,accessor:"getElevationWeight"}})}updateState(t){if(!1===this.state.isSupported)return;super.updateState(t);const{aggregationDirty:e}=this.state;e&&this.setState({gridHash:null})}getHashKeyForIndex(t){const{numRow:e,numCol:i,boundingBox:n,gridOffset:r}=this.state,o=[i,e],s=[n.xMin,n.yMin],a=[r.xOffset,r.yOffset],l=Math.floor(t/o[0]),c=t-l*o[0],u=Math.floor((l*a[1]+s[1]+90+a[1]/2)/a[1]),h=Math.floor((c*a[0]+s[0]+180+a[0]/2)/a[0]);return"".concat(u,"-").concat(h)}getPositionForIndex(t){const{numRow:e,numCol:i,boundingBox:n,gridOffset:r}=this.state,o=[i,e],s=[n.xMin,n.yMin],a=[r.xOffset,r.yOffset],l=Math.floor(t/o[0]);return[(t-l*o[0])*a[0]+s[0],l*a[1]+s[1]]}getPickingInfo(t){let{info:e,mode:i}=t;const{index:n}=e;let r=null;if(n>=0){const{gpuGridAggregator:t}=this.state,e=this.getPositionForIndex(n),o=V.getAggregationData({pixelIndex:n,...t.getData("color")}),s=V.getAggregationData({pixelIndex:n,...t.getData("elevation")});if(r={colorValue:o.cellWeight,elevationValue:s.cellWeight,count:o.cellCount||s.cellCount,position:e,totalCount:o.totalCount||s.totalCount},"hover"!==i){const{props:t}=this;let{gridHash:e}=this.state;if(!e){const{gridOffset:i,translation:n,boundingBox:r}=this.state,{viewport:o}=this.context;e=Dt(t,{gridOffset:i,attributes:this.getAttributes(),viewport:o,translation:n,boundingBox:r}).gridHash,this.setState({gridHash:e})}const i=e[this.getHashKeyForIndex(n)];Object.assign(r,i)}}return e.picked=Boolean(r),e.object=r,e}renderLayers(){if(!this.state.isSupported)return null;const{elevationScale:t,extruded:e,cellSize:i,coverage:n,material:r,elevationRange:o,colorDomain:s,elevationDomain:a}=this.props,{weights:l,numRow:c,numCol:u,gridOrigin:h,gridOffset:d}=this.state,{color:p,elevation:A}=l,f=q(this.props.colorRange);return new(this.getSubLayerClass("gpu-grid-cell",ai))({gridSize:[u,c],gridOrigin:h,gridOffset:[d.xOffset,d.yOffset],colorRange:f,elevationRange:o,colorDomain:s,elevationDomain:a,cellSize:i,coverage:n,material:r,elevationScale:t,extruded:e}
2,this.getSubLayerProps({id:"gpu-grid-cell"}),{data:{attributes:{colors:p.aggregationBuffer,elevations:A.aggregationBuffer}},colorMaxMinBuffer:p.maxMinBuffer,elevationMaxMinBuffer:A.maxMinBuffer,numInstances:u*c})}finalizeState(t){const{color:e,elevation:i}=this.state.weights;[e,i].forEach((t=>{const{aggregationBuffer:e,maxMinBuffer:i}=t;i.delete(),null===e||void 0===e||e.delete()})),super.finalizeState(t)}updateAggregationState(t){const{props:e,oldProps:i}=t,{cellSize:n,coordinateSystem:r}=e,{viewport:o}=this.context,s=i.cellSize!==n,{dimensions:a}=this.state,l=this.isAttributeChanged(ui),c=l||this.isAttributeChanged();let{boundingBox:u}=this.state;if(l&&(u=Tt(this.getAttributes(),this.getNumInstances()),this.setState({boundingBox:u})),l||s){const{gridOffset:t,translation:e,width:i,height:s,numCol:a,numRow:l}=Pt(u,n,o,r);this.allocateResources(l,a),this.setState({gridOffset:t,translation:e,gridOrigin:[-1*e[0],-1*e[1]],width:i,height:s,numCol:a,numRow:l})}const h=c||this.isAggregationDirty(t,{dimension:a.data,compareAll:!0});h&&this._updateAccessors(t),this.setState({aggregationDataDirty:h})}_updateAccessors(t){const{colorAggregation:e,elevationAggregation:i}=t.props,{color:n,elevation:r}=this.state.weights;n.operation=y[e],r.operation=y[i]}}(0,n.Z)(hi,"layerName","GPUGridLayer"),(0,n.Z)(hi,"defaultProps",li);const di={...hi.defaultProps,...Jt.defaultProps,gpuAggregation:!1};class pi extends et.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}initializeState(){this.state={useGPUAggregation:!0}}updateState(t){let{props:e}=t;this.setState({useGPUAggregation:this.canUseGPUAggregation(e)})}renderLayers(){const{data:t,updateTriggers:e}=this.props,i=this.state.useGPUAggregation?"GPU":"CPU";return new(this.state.useGPUAggregation?this.getSubLayerClass("GPU",hi):this.getSubLayerClass("CPU",Jt))(this.props,this.getSubLayerProps({id:i,updateTriggers:e}),{data:t})}canUseGPUAggregation(t){const{gpuAggregation:e,lowerPercentile:i,upperPercentile:n,getColorValue:r,getElevationValue:o,colorScaleType:s}=t;return!!e&&(!!V.isSupported(this.context.gl)&&(0===i&&100===n&&(null===r&&null===o&&("quantile"!==s&&"ordinal"!==s))))}}(0,n.Z)(pi,"layerName","GridLayer"),(0,n.Z)(pi,"defaultProps",di);const Ai=new Float32Array(12);function fi(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=0;for(const n of t)for(let t=0;t<e;t++)Ai[i++]=n[t]||0;return Ai}class gi extends J.Z{getShaders(){return{vs:"#define SHADER_NAME heatp-map-layer-vertex-shader\n\nuniform sampler2D maxTexture;\nuniform float intensity;\nuniform vec2 colorDomain;\nuniform float threshold;\nuniform float aggregationMode;\n\nattribute vec3 positions;\nattribute vec2 texCoords;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvoid main(void) {\n  gl_Position = project_position_to_clipspace(positions, vec3(0.0), vec3(0.0));\n  vTexCoords = texCoords;\n  vec4 maxTexture = texture2D(maxTexture, vec2(0.5));\n  float maxValue = aggregationMode < 0.5 ? maxTexture.r : maxTexture.g;\n  float minValue = maxValue * threshold;\n  if (colorDomain[1] > 0.) {\n    // if user specified custom domain use it.\n    maxValue = colorDomain[1];\n    minValue = colorDomain[0];\n  }\n  vIntensityMax = intensity / maxValue;\n  vIntensityMin = intensity / minValue;\n}\n",fs:"#define SHADER_NAME triangle-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D texture;\nuniform sampler2D colorTexture;\nuniform float aggregationMode;\n\nvarying vec2 vTexCoords;\nvarying float vIntensityMin;\nvarying float vIntensityMax;\n\nvec4 getLinearColor(float value) {\n  float factor = clamp(value * vIntensityMax, 0., 1.);\n  vec4 color = texture2D(colorTexture, vec2(factor, 0.5));\n  color.a *= min(value * vIntensityMin, 1.0);\n  return color;\n}\n\nvoid main(void) {\n  vec4 weights = texture2D(texture, vTexCoords);\n  float weight = weights.r;\n\n  if (aggregationMode > 0.5) {\n    weight /= max(1.0, weights.a);\n  }\n\n  // discard pixels with 0 weight.\n  if (weight <= 0.) {\n     discard;\n  }\n\n  vec4 linearColor = getLinearColor(weight);\n  linearColor.a *= opacity;\n  gl_FragColor =linearColor;\n}\n",modules:[m.Z]}}initializeState(t){let{gl:e}=t;this.getAttributeManager().add({positions:{size:3,noAlloc:!0},texCoords:{size:2,noAlloc:!0}}),this.setState({model:this._getModel(e)})}_getModel(t){const{vertexCount:e}=this.props;
2return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new H.Z({drawMode:6,vertexCount:e})})}draw(t){let{uniforms:e}=t;const{model:i}=this.state,{texture:n,maxTexture:r,colorTexture:o,intensity:s,threshold:a,aggregationMode:l,colorDomain:c}=this.props;i.setUniforms({...e,texture:n,maxTexture:r,colorTexture:o,intensity:s,threshold:a,aggregationMode:l,colorDomain:c}).draw()}}(0,n.Z)(gi,"layerName","TriangleLayer");const mi={mipmaps:!1,parameters:{10240:9729,10241:9729,10242:33071,10243:33071},dataFormat:6408},yi=[0,0],vi={SUM:0,MEAN:1},_i={getPosition:{type:"accessor",value:t=>t.position},getWeight:{type:"accessor",value:1},intensity:{type:"number",min:0,value:1},radiusPixels:{type:"number",min:1,max:100,value:50},colorRange:Q,threshold:{type:"number",min:0,max:1,value:.05},colorDomain:{type:"array",value:null,optional:!0},aggregation:"SUM",weightsTextureSize:{type:"number",min:128,max:2048,value:2048},debounceTimeout:{type:"number",min:0,max:1e3,value:500}},bi=[o.h.BLEND_EQUATION_MINMAX,o.h.TEXTURE_FLOAT],xi=[o.h.COLOR_ATTACHMENT_RGBA32F,o.h.FLOAT_BLEND],wi={data:{props:["radiusPixels"]}};class Ci extends ot{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}initializeState(){const{gl:t}=this.context;if(!(0,s.ag)(t,bi))return this.setState({supported:!1}),void r.Z.error("HeatmapLayer: ".concat(this.id," is not supported on this browser"))();super.initializeAggregationLayer(wi),this.setState({supported:!0,colorDomain:yi}),this._setupTextureParams(),this._setupAttributes(),this._setupResources()}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){this.state.supported&&(super.updateState(t),this._updateHeatmapState(t))}_updateHeatmapState(t){const{props:e,oldProps:i}=t,n=this._getChangeFlags(t);(n.dataChanged||n.viewportChanged)&&(n.boundsChanged=this._updateBounds(n.dataChanged),this._updateTextureRenderingBounds()),n.dataChanged||n.boundsChanged?(clearTimeout(this.state.updateTimer),this.setState({isWeightMapDirty:!0})):n.viewportZoomChanged&&this._debouncedUpdateWeightmap(),e.colorRange!==i.colorRange&&this._updateColorTexture(t),this.state.isWeightMapDirty&&this._updateWeightmap(),this.setState({zoom:t.context.viewport.zoom})}renderLayers(){if(!this.state.supported)return[];const{weightsTexture:t,triPositionBuffer:e,triTexCoordBuffer:i,maxWeightsTexture:n,colorTexture:r,colorDomain:o}=this.state,{updateTriggers:s,intensity:a,threshold:l,aggregation:c}=this.props;return new(this.getSubLayerClass("triangle",gi))(this.getSubLayerProps({id:"triangle-layer",updateTriggers:s}),{coordinateSystem:Bt.Df.DEFAULT,data:{attributes:{positions:e,texCoords:i}},vertexCount:4,maxTexture:n,colorTexture:r,aggregationMode:vi[c]||0,texture:t,intensity:a,threshold:l,colorDomain:o})}finalizeState(t){super.finalizeState(t);const{weightsTransform:e,weightsTexture:i,maxWeightTransform:n,maxWeightsTexture:r,triPositionBuffer:o,triTexCoordBuffer:s,colorTexture:a,updateTimer:l}=this.state;null===e||void 0===e||e.delete(),null===i||void 0===i||i.delete(),null===n||void 0===n||n.delete(),null===r||void 0===r||r.delete(),null===o||void 0===o||o.delete(),null===s||void 0===s||s.delete(),null===a||void 0===a||a.delete(),l&&clearTimeout(l)}_getAttributeManager(){return new nt.Z(this.context.gl,{id:this.props.id,stats:this.context.stats})}_getChangeFlags(t){const e={},{dimensions:i}=this.state;e.dataChanged=this.isAttributeChanged()||this.isAggregationDirty(t,{compareAll:!0,dimension:i.data}),e.viewportChanged=t.changeFlags.viewportChanged;const{zoom:n}=this.state;return t.context.viewport&&t.context.viewport.zoom===n||(e.viewportZoomChanged=!0),e}_createTextures(){const{gl:t}=this.context,{textureSize:e,format:i,type:n}=this.state;this.setState({weightsTexture:new R.Z(t,{width:e,height:e,format:i,type:n,...mi}),maxWeightsTexture:new R.Z(t,{format:i,type:n,...mi})})}_setupAttributes(){this.getAttributeManager().add({positions:{size:3,type:5130,accessor:"getPosition"},weights:{size:1,accessor:"getWeight"}}),this.setState({positionAttributeName:"positions"})}_setupTextureParams(){const{gl:t}=this.context,{weightsTextureSize:e}=this.props,i=Math.min(e,(0,a.ZS)(t,3379)),n=(0,s.ag)(t,xi),{format:o,type:l}=function(t){let{gl:e,floatTargetSupport:i}=t;return i?{format:(0,a.D0)(e)?34836:6408,type:5126}:{format:6408,type:5121}}({gl:t,floatTargetSupport:n}),c=n?1:1/255;this.setState({textureSize:i,format:o,type:l,weightsScale:c}),n||r.Z.warn("HeatmapLayer: ".concat(this.id," rendering to float texture not supported, fallingback to low precession format"))()}getShaders(t){return super.getShaders("max-weights-transform"===t?{vs:"attribute vec4 inTexture;\nvarying vec4 outTexture;\n\nvoid main()\n{\noutTexture = inTexture;\ngl_Position = vec4(0, 0, 0, 1.);\n// Enforce default value for ANGLE issue (https://bugs.chromium.org/p/angleproject/issues/detail?id=3941)\ngl_PointSize = 1.0;\n}\n",_fs:"varying vec4 outTexture;\nvoid main() {\n  gl_FragColor = outTexture;\n  gl_FragColor.g = outTexture.r / max(1.0, outTexture.a);\n}\n"}:{vs:"attribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float weights;\nvarying vec4 weightsTexture;\nuniform float radiusPixels;\nuniform float textureWidth;\nuniform vec4 commonBounds;\nuniform float weightsScale;\nvoid main()\n{\n  weightsTexture = vec4(weights * weightsScale, 0., 0., 1.);\n\n  float radiusTexels  = project_pixel_size(radiusPixels) * textureWidth / (commonBounds.z - commonBounds.x);\n  gl_PointSize = radiusTexels * 2.;\n\n  vec3 commonPosition = project_position(positions, positions64Low);\n\n  // map xy from commonBounds to [-1, 1]\n  gl_Position.xy = (commonPosition.xy - commonBounds.xy) / (commonBounds.zw - commonBounds.xy) ;\n  gl_Position.xy = (gl_Position.xy * 2.) - (1.);\n}\n",_fs:"varying vec4 weightsTexture;
2\n// Epanechnikov function, keeping for reference\n// float epanechnikovKDE(float u) {\n//   return 0.75 * (1.0 - u * u);\n// }\nfloat gaussianKDE(float u){\n  return pow(2.71828, -u*u/0.05555)/(1.77245385*0.166666);\n}\nvoid main()\n{\n  float dist = length(gl_PointCoord - vec2(0.5, 0.5));\n  if (dist > 0.5) {\n    discard;\n  }\n  gl_FragColor = weightsTexture * gaussianKDE(2. * dist);\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"})}_createWeightsTransform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;const{gl:i}=this.context;let{weightsTransform:n}=this.state;const{weightsTexture:r}=this.state;null===(e=n)||void 0===e||e.delete(),n=new u.Z(i,{id:"".concat(this.id,"-weights-transform"),elementCount:1,_targetTexture:r,_targetTextureVarying:"weightsTexture",...t}),this.setState({weightsTransform:n})}_setupResources(){const{gl:t}=this.context;this._createTextures();const{textureSize:e,weightsTexture:i,maxWeightsTexture:n}=this.state,r=this.getShaders("weights-transform");this._createWeightsTransform(r);const o=this.getShaders("max-weights-transform"),s=new u.Z(t,{id:"".concat(this.id,"-max-weights-transform"),_sourceTextures:{inTexture:i},_targetTexture:n,_targetTextureVarying:"outTexture",...o,elementCount:e*e});this.setState({weightsTexture:i,maxWeightsTexture:n,maxWeightTransform:s,zoom:null,triPositionBuffer:new st.Z(t,{byteLength:48,accessor:{size:3}}),triTexCoordBuffer:new st.Z(t,{byteLength:48,accessor:{size:2}})})}updateShaders(t){this._createWeightsTransform(t)}_updateMaxWeightValue(){const{maxWeightTransform:t}=this.state;t.run({parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32776}})}_updateBounds(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const{viewport:e}=this.context,i=[e.unproject([0,0]),e.unproject([e.width,0]),e.unproject([e.width,e.height]),e.unproject([0,e.height])].map((t=>t.map(Math.fround))),n=function(t){const e=t.map((t=>t[0])),i=t.map((t=>t[1])),n=Math.min.apply(null,e),r=Math.max.apply(null,e);return[n,Math.min.apply(null,i),r,Math.max.apply(null,i)]}(i),r={visibleWorldBounds:n,viewportCorners:i};let o=!1;if(t||!this.state.worldBounds||(s=this.state.worldBounds,!((a=n)[0]>=s[0]&&a[2]<=s[2]&&a[1]>=s[1]&&a[3]<=s[3]))){const t=this._worldToCommonBounds(n),e=this._commonToWorldBounds(t);this.props.coordinateSystem===Bt.Df.LNGLAT&&(e[1]=Math.max(e[1],-85.051129),e[3]=Math.min(e[3],85.051129),e[0]=Math.max(e[0],-360),e[2]=Math.min(e[2],360));const i=this._worldToCommonBounds(e);r.worldBounds=e,r.normalizedCommonBounds=i,o=!0}var s,a;return this.setState(r),o}_updateTextureRenderingBounds(){const{triPositionBuffer:t,triTexCoordBuffer:e,normalizedCommonBounds:i,viewportCorners:n}=this.state,{viewport:r}=this.context;t.subData(fi(n,3));const o=n.map((t=>function(t,e){const[i,n,r,o]=e;return[(t[0]-i)/(r-i),(t[1]-n)/(o-n)]}(r.projectPosition(t),i)));e.subData(fi(o,2))}_updateColorTexture(t){const{colorRange:e}=t.props;let{colorTexture:i}=this.state;const n=q(e,!1,Uint8Array);i?i.setImageData({data:n,width:e.length}):i=new R.Z(this.context.gl,{data:n,width:e.length,height:1,...mi}),this.setState({colorTexture:i})}_updateWeightmap(){const{radiusPixels:t,colorDomain:e,aggregation:i}=this.props,{weightsTransform:n,worldBounds:r,textureSize:o,weightsTexture:s,weightsScale:l}=this.state;this.state.isWeightMapDirty=!1;const c=this._worldToCommonBounds(r,{useLayerCoordinateSystem:!0});if(e&&"SUM"===i){const{viewport:t}=this.context,i=t.distanceScales.metersPerUnit[2]*(c[2]-c[0])/o;this.state.colorDomain=e.map((t=>t*i*l))}else this.state.colorDomain=e||yi;const u={radiusPixels:t,commonBounds:c,textureWidth:o,weightsScale:l};n.update({elementCount:this.getNumInstances()}),(0,a.s8)(this.context.gl,{clearColor:[0,0,0,0]},(()=>{n.run({uniforms:u,parameters:{blend:!0,depthTest:!1,blendFunc:[1,1],blendEquation:32774},clearRenderTarget:!0,attributes:this.getAttributes(),moduleSettings:this.getModuleSettings()})})),this._updateMaxWeightValue(),s.setParameters({10240:9729,10241:9729})}_debouncedUpdateWeightmap(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{updateTimer:e}=this.state;const{debounceTimeout:i}=this.props;t?(e=null,this._updateBounds(!0),this._updateTextureRenderingBounds(),this.setState({isWeightMapDirt
2y:!0})):(this.setState({isWeightMapDirty:!1}),clearTimeout(e),e=setTimeout(this._debouncedUpdateWeightmap.bind(this,!0),i)),this.setState({updateTimer:e})}_worldToCommonBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{useLayerCoordinateSystem:i=!1}=e,[n,r,o,s]=t,{viewport:a}=this.context,{textureSize:l}=this.state,{coordinateSystem:c}=this.props,u=i&&(c===Bt.Df.LNGLAT_OFFSETS||c===Bt.Df.METER_OFFSETS),h=u?a.projectPosition(this.props.coordinateOrigin):[0,0],d=2*l/a.scale;let p,A;return i&&!u?(p=this.projectPosition([n,r,0]),A=this.projectPosition([o,s,0])):(p=a.projectPosition([n,r,0]),A=a.projectPosition([o,s,0])),function(t,e,i){const[n,r,o,s]=t,a=o-n,l=s-r;let c=a,u=l;a/l<e/i?c=e/i*l:u=i/e*a,c<e&&(c=e,u=i);const h=(o+n)/2,d=(s+r)/2;return[h-c/2,d-u/2,h+c/2,d+u/2]}([p[0]-h[0],p[1]-h[1],A[0]-h[0],A[1]-h[1]],d,d)}_commonToWorldBounds(t){const[e,i,n,r]=t,{viewport:o}=this.context,s=o.unprojectPosition([e,i]),a=o.unprojectPosition([n,r]);return s.slice(0,2).concat(a.slice(0,2))}}(0,n.Z)(Ci,"layerName","HeatmapLayer"),(0,n.Z)(Ci,"defaultProps",_i)},23427:(t,e,i)=>{"use strict";i.d(e,{Z:()=>s,z:()=>o});var n=i(21970);let r={};function o(t){r=t}function s(t,e,i,o){n.Z.level>0&&r[t]&&r[t].call(null,e,i,o)}},96684:(t,e,i)=>{"use strict";i.d(e,{Z:()=>P});var n=i(64649),r=i(12308),o=i(70353),s=i(33839);class a{constructor(t,e){(0,n.Z)(this,"opts",void 0),(0,n.Z)(this,"source",void 0),this.opts=e,this.source=t}get value(){return this.source.value}getValue(){const t=this.source.getBuffer(),e=this.getAccessor();if(t)return[t,e];const{value:i}=this.source,{size:n}=e;let r=i;if(i&&i.length!==n){r=new Float32Array(n);const t=e.elementOffset||0;for(let e=0;e<n;++e)r[e]=i[t+e]}return r}getAccessor(){return{...this.source.getAccessor(),...this.opts}}}var l=i(28321),c=i(64441),u=i(21970);function h(t){return t.stride||t.size*t.bytesPerElement}function d(t,e){e.offset&&u.Z.removed("shaderAttribute.offset","vertexOffset, elementOffset")();const i=h(t),n=(void 0!==e.vertexOffset?e.vertexOffset:t.vertexOffset||0)*i+(e.elementOffset||0)*t.bytesPerElement+(t.offset||0);return{...e,offset:n,stride:i}
2}class p{constructor(t,e,i){(0,n.Z)(this,"gl",void 0),(0,n.Z)(this,"id",void 0),(0,n.Z)(this,"size",void 0),(0,n.Z)(this,"settings",void 0),(0,n.Z)(this,"value",void 0),(0,n.Z)(this,"doublePrecision",void 0),(0,n.Z)(this,"_buffer",void 0),(0,n.Z)(this,"state",void 0),this.gl=t,this.id=e.id||"",this.size=e.size||1;const s=e.logicalType||e.type,a=5130===s;let l,{defaultValue:c}=e;c=Number.isFinite(c)?[c]:c||new Array(this.size).fill(0),l=a?5126:!s&&e.isIndexed?t&&(0,r.U6)(t,o.h.ELEMENT_INDEX_UINT32)?5125:5123:s||5126;let u=function(t){switch(t){case 5126:return Float32Array;case 5130:return Float64Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return Uint8ClampedArray;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Unknown GL type")}}(s||l||5126);this.doublePrecision=a,a&&!1===e.fp64&&(u=Float32Array),this.value=null,this.settings={...e,defaultType:u,defaultValue:c,logicalType:s,type:l,size:this.size,bytesPerElement:u.BYTES_PER_ELEMENT},this.state={...i,externalBuffer:null,bufferAccessor:this.settings,allocatedValue:null,numInstances:0,bounds:null,constant:!1},this._buffer=null}get isConstant(){return this.state.constant}get buffer(){if(!this._buffer){const{isIndexed:t,type:e}=this.settings;this._buffer=new s.Z(this.gl,{id:this.id,target:t?34963:34962,accessor:{type:e}})}return this._buffer}get byteOffset(){const t=this.getAccessor();return t.vertexOffset?t.vertexOffset*h(t):0}get numInstances(){return this.state.numInstances}set numInstances(t){this.state.numInstances=t}delete(){this._buffer&&(this._buffer.delete(),this._buffer=null),l.Z.release(this.state.allocatedValue)}getShaderAttributes(t,e){if(this.doublePrecision){const i={},n=this.value instanceof Float64Array,r=function(t,e){const i=d(t,e);return{high:i,low:{...i,offset:i.offset+4*t.size}}}(this.getAccessor(),e||{});return i[t]=new a(this,r.high),i["".concat(t,"64Low")]=n?new a(this,r.low):new Float32Array(this.size),i}if(e){const i=d(this.getAccessor(),e);return{[t]:new a(this,i)}}return{[t]:this}}getBuffer(){return this.state.constant?null:this.state.externalBuffer||this._buffer}getValue(){return this.state.constant?this.value:[this.getBuffer(),this.getAccessor()]}getAccessor(){return this.state.bufferAccessor}getBounds(){if(this.state.bounds)return this.state.bounds;let t=null;if(this.state.constant&&this.value){const e=Array.from(this.value);t=[e,e]}else{const{value:e,numInstances:i,size:n}=this,r=i*n;if(e&&r&&e.length>=r){const i=new Array(n).fill(1/0),o=new Array(n).fill(-1/0);for(let t=0;t<r;)for(let r=0;r<n;r++){const n=e[t++];n<i[r]&&(i[r]=n),n>o[r]&&(o[r]=n)}t=[i,o]}}return this.state.bounds=t,t}setData(t){const{state:e}=this;let i;i=ArrayBuffer.isView(t)?{value:t}:t instanceof s.Z?{buffer:t}:t;const n={...this.settings,...i};if(e.bufferAccessor=n,e.bounds=null,i.constant){let t=i.value;t=this._normalizeValue(t,[],0),this.settings.normalized&&(t=this.normalizeConstant(t));if(!(!e.constant||!this._areValuesEqual(t,this.value)))return!1;e.externalBuffer=null,e.constant=!0,this.value=t}else if(i.buffer){const t=i.buffer;e.externalBuffer=t,e.constant=!1,this.value=i.value||null;const r=i.value instanceof Float64Array;n.type=i.type||t.accessor.type,n.bytesPerElement=t.accessor.BYTES_PER_ELEMENT*(r?2:1),n.stride=h(n)}else if(i.value){this._checkExternalBuffer(i);let t=i.value;e.externalBuffer=null,e.constant=!1,this.value=t,n.bytesPerElement=t.BYTES_PER_ELEMENT,n.stride=h(n);const{buffer:r,byteOffset:o}=this;this.doublePrecision&&t instanceof Float64Array&&(t=(0,c.TK)(t,n));const s=t.byteLength+o+2*n.stride;r.byteLength<s&&r.reallocate(s),r.setAccessor(null),r.subData({data:t,offset:o}),n.type=i.type||r.accessor.type}return!0}updateSubBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.state.bounds=null;const e=this.value,{startOffset:i=0,endOffset:n}=t;this.buffer.subData({data:this.doublePrecision&&e instanceof Float64Array?(0,c.TK)(e,{size:this.size,startIndex:i,endIndex:n}):e.subarray(i,n),offset:i*e.BYTES_PER_ELEMENT+this.byteOffset})}allocate(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{state:i}=this,n=i.allocatedValue,r=l.Z.allocate(n,t+1,{size:this.size,type:this.settings.defaultType,copy:e});this.value=r;const{buffer:o,byteOffset:s}=this;return o.byteLength<r.byteLength+s&&(o.reallocate(r.byteLength+s),e&&n&&o.subData({data:n instanceof Float64Array?(0,c.TK)(n,this):n,offset:s})),i.allocatedValue=r,i.constant=!1,i.externalBuffer=null,i.bufferAccessor=this.settings,!0}_checkExternalBuffer(t){const{value:e}=t;if(!ArrayBuffer.isView(e))throw new Error("Attribute ".concat(this.id," value is not TypedArray"));const i=this.settings.defaultType;let n=!1;if(this.doublePrecision&&(n=e.BYTES_PER_ELEMENT<4),n)throw new Error("Attribute ".concat(this.id," does not support ").concat(e.constructor.name));e instanceof i||!this.settings.normalized||"normalized"in t||u.Z.warn("Attribute ".concat(this.id," is normalized"))()}normalizeConstant(t){switch(this.settings.type){case 5120:return new Float32Array(t).map((t=>(t+128)/255*2-1));case 5122:return new Float32Array(t).map((t=>(t+32768)/65535*2-1));case 5121:return new Float32Array(t).map((t=>t/255));case 5123:return new Float32Array(t).map((t=>t/65535));default:return t}}_normalizeValue(t,e,i){const{defaultValue:n,size:r}=this.settings;if(Number.isFinite(t))return e[i]=t,e;if(!t)return e[i]=n[0],e;switch(r){case 4:e[i+3]=Number.isFinite(t[3])?t[3]:n[3];case 3:e[i+2]=Number.isFinite(t[2])?t[2]:n[2];case 2:e[i+1]=Number.isFinite(t[1])?t[1]:n[1];case 1:e[i+0]=Number.isFinite(t[0])?t[0]:n[0];break;default:let o=r;for(;--o>=0;
vendor: 5,449 bytes, line 2
2)e[i+o]=Number.isFinite(t[o])?t[o]:n[o]}return e}_areValuesEqual(t,e){if(!t||!e)return!1;const{size:i}=this;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}}var A=i(12997),f=i(73115),g=i(18757);const m=[],y=[[0,1/0]];var v=i(41894);class _ extends p{constructor(t,e){super(t,e,{startIndices:null,lastExternalBuffer:null,binaryValue:null,binaryAccessor:null,needsUpdate:!0,needsRedraw:!1,updateRanges:y}),(0,n.Z)(this,"constant",!1),this.settings.update=e.update||(e.accessor?this._autoUpdater:void 0),Object.seal(this.settings),Object.seal(this.state),this._validateAttributeUpdaters()}get startIndices(){return this.state.startIndices}set startIndices(t){this.state.startIndices=t}needsUpdate(){return this.state.needsUpdate}needsRedraw(){let{clearChangedFlags:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.state.needsRedraw;return this.state.needsRedraw=e&&!t,e}getUpdateTriggers(){const{accessor:t}=this.settings;return[this.id].concat("function"!==typeof t&&t||[])}supportsTransition(){return Boolean(this.settings.transition)}getTransitionSetting(t){if(!t||!this.supportsTransition())return null;const{accessor:e}=this.settings,i=this.settings.transition,n=Array.isArray(e)?t[e.find((e=>t[e]))]:t[e];return(0,v.M0)(n,i)}setNeedsUpdate(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id,e=arguments.length>1?arguments[1]:void 0;if(this.state.needsUpdate=this.state.needsUpdate||t,this.setNeedsRedraw(t),e){const{startRow:t=0,endRow:i=1/0}=e;this.state.updateRanges=function(t,e){if(t===y)return t;if(e[0]<0&&(e[0]=0),e[0]>=e[1])return t;const i=[],n=t.length;let r=0;for(let o=0;o<n;o++){const n=t[o];n[1]<e[0]?(i.push(n),r=o+1):n[0]>e[1]?i.push(n):e=[Math.min(n[0],e[0]),Math.max(n[1],e[1])]}return i.splice(r,0,e),i}(this.state.updateRanges,[t,i])}else this.state.updateRanges=y}clearNeedsUpdate(){this.state.needsUpdate=!1,this.state.updateRanges=m}setNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.id;this.state.needsRedraw=this.state.needsRedraw||t}allocate(t){const{state:e,settings:i}=this;return!i.noAlloc&&(!!i.update&&(super.allocate(t,e.updateRanges!==y),!0))}updateBuffer(t){let{numInstances:e,data:i,props:n,context:r}=t;if(!this.needsUpdate())return!1;const{state:{updateRanges:o},settings:{update:s,noAlloc:a}}=this;let l=!0;if(s){for(const[t,a]of o)s.call(r,this,{data:i,startRow:t,endRow:a,props:n,numInstances:e});if(this.value)if(this.constant||this.buffer.byteLength<this.value.byteLength+this.byteOffset)this.setData({value:this.value,constant:this.constant}),this.constant=!1;else for(const[t,i]of o){const n=Number.isFinite(t)?this.getVertexOffset(t):0,r=Number.isFinite(i)?this.getVertexOffset(i):a||!Number.isFinite(e)?this.value.length:e*this.size;super.updateSubBuffer({startOffset:n,endOffset:r})}else;this._checkAttributeArray()}else l=!1;return this.clearNeedsUpdate(),this.setNeedsRedraw(),l}setConstantValue(t){if(void 0===t||"function"===typeof t)return!1;return this.setData({constant:!0,value:t})&&this.setNeedsRedraw(),this.clearNeedsUpdate(),!0}setExternalBuffer(t){const{state:e}=this;return t?(this.clearNeedsUpdate(),e.lastExternalBuffer===t||(e.lastExternalBuffer=t,this.setNeedsRedraw(),this.setData(t)),!0):(e.lastExternalBuffer=null,!1)}setBinaryValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const{state:i,settings:n}=this;if(!t)return i.binaryValue=null,i.binaryAccessor=null,!1;if(n.noAlloc)return!1;if(i.binaryValue===t)return this.clearNeedsUpdate(),!0;i.binaryValue=t,this.setNeedsRedraw();if(n.transform||e!==this.startIndices){ArrayBuffer.isView(t)&&(t={value:t});const r=t;(0,A.Z)(ArrayBuffer.isView(r.value),"invalid ".concat(n.accessor));const o=Boolean(r.size)&&r.size!==this.size;return i.binaryAccessor=(0,f.jr)(r.value,{size:r.size||this.size,stride:r.stride,offset:r.offset,startIndices:e,nested:o}),!1}return this.clearNeedsUpdate(),this.setData(t),!0}getVertexOffset(t){const{startIndices:e}=this;return(e?t<e.length?e[t]:this.numInstances:t)*this.size}getShaderAttributes(){const t=this.settings.shaderAttributes||{[this.id]:null},e={};for(const i in t)Object.assign(e,super.getShaderAttributes(i,t[i]));return e}_autoUpdater(t,e){let{data:i,startRow:n,endRow:r,props:o,numInstances:s}=e;if(t.constant)return;const{settings:a,state:l,value:c,size:u,startIndices:h}=t,{accessor:d,transform:p}=a,m=l.binaryAccessor||("function"===typeof d?d:o[d]);(0,A.Z)("function"===typeof m,'accessor "'.concat(d,'" is not a function'));let y=t.getVertexOffset(n);const{iterable:v,objectInfo:_}=(0,f.jB)(i,n,r);for(const A of v){_.index++;let e=m(A,_);if(p&&(e=p.call(this,e)),h){const i=(_.index<h.length-1?h[_.index+1]:s)-h[_.index];if(e&&Array.isArray(e[0])){let i=y;for(const n of e)t._normalizeValue(n,c,i),i+=u}else e&&e.length>u?c.set(e,y):(t._normalizeValue(e,_.target,0),(0,g.k)({target:c,source:_.target,start:y,count:i}));y+=i*u}else t._normalizeValue(e,c,y),y+=u}}_validateAttributeUpdaters(){const{settings:t}=this;if(!(t.noAlloc||"function"===typeof t.update))throw new Error("Attribute ".concat(this.id," missing update or accessor"))}_checkAttributeArray(){const{value:t}=this,e=Math.min(4,this.size);if(t&&t.length>=e){let i=!0;switch(e){case 4:i=i&&Number.isFinite(t[3]);case 3:i=i&&Number.isFinite(t[2]);case 2:i=i&&Number.isFinite(t[1]);case 1:i=i&&Number.isFinite(t[0]);break;default:i=!1}if(!i)throw new Error("Illegal attribute generated for ".concat(this.id
2))}}}var b=i(23427),x=i(17225),w=i(99188);const C="\n#define SHADER_NAME interpolation-transition-vertex-shader\n\nuniform float time;\nattribute ATTRIBUTE_TYPE aFrom;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vCurrent;\n\nvoid main(void) {\n  vCurrent = mix(aFrom, aTo, time);\n  gl_Position = vec4(0.0);\n}\n";var B=i(56474),E=i(58300),S=i(79078);const T={interpolation:class{constructor(t){let{gl:e,attribute:i,timeline:r}=t;(0,n.Z)(this,"gl",void 0),(0,n.Z)(this,"type","interpolation"),(0,n.Z)(this,"attributeInTransition",void 0),(0,n.Z)(this,"settings",void 0),(0,n.Z)(this,"attribute",void 0),(0,n.Z)(this,"transition",void 0),(0,n.Z)(this,"currentStartIndices",void 0),(0,n.Z)(this,"currentLength",void 0),(0,n.Z)(this,"transform",void 0),(0,n.Z)(this,"buffers",void 0),this.gl=e,this.transition=new w.Z(r),this.attribute=i,this.attributeInTransition=new _(e,i.settings),this.currentStartIndices=i.startIndices,this.currentLength=0,this.transform=function(t,e){const i=(0,v.w)(e.size);return new x.Z(t,{vs:C,defines:{ATTRIBUTE_TYPE:i},varyings:["vCurrent"]})}(e,i);const o={byteLength:0,usage:35050};this.buffers=[new s.Z(e,o),new s.Z(e,o)]}get inProgress(){return this.transition.inProgress}start(t,e){if(t.duration<=0)return void this.transition.cancel();this.settings=t;const{gl:i,buffers:n,attribute:r}=this;(0,v.DY)(n);const o={numInstances:e,attribute:r,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)(0,v.IV)({buffer:s,...o});this.currentStartIndices=r.startIndices,this.currentLength=(0,v.pi)(r,e),this.attributeInTransition.setData({buffer:n[1],value:r.value}),this.transition.start(t),this.transform.update({elementCount:Math.floor(this.currentLength/r.size),sourceBuffers:{aFrom:n[0],aTo:(0,v.AQ)(i,r)},feedbackBuffers:{vCurrent:n[1]}})}update(){const t=this.transition.update();if(t){const{duration:t,easing:e}=this.settings,{time:i}=this.transition;let n=i/t;e&&(n=e(n)),this.transform.run({uniforms:{time:n}})}return t}cancel(){this.transition.cancel(),this.transform.delete();for(const t of this.buffers)t.delete();this.buffers.length=0}},spring:class{constructor(t){let{gl:e,attribute:i,timeline:r}=t;(0,n.Z)(this,"gl",void 0),(0,n.Z)(this,"type","spring"),(0,n.Z)(this,"attributeInTransition",void 0),(0,n.Z)(this,"settings",void 0),(0,n.Z)(this,"attribute",void 0),(0,n.Z)(this,"transition",void 0),(0,n.Z)(this,"currentStartIndices",void 0),(0,n.Z)(this,"currentLength",void 0),(0,n.Z)(this,"texture",void 0),(0,n.Z)(this,"framebuffer",void 0),(0,n.Z)(this,"transform",void 0),(0,n.Z)(this,"buffers",void 0),this.gl=e,this.type="spring",this.transition=new w.Z(r),this.attribute=i,this.attributeInTransition=new _(e,{...i.settings,normalized:!1}),this.currentStartIndices=i.startIndices,this.currentLength=0,this.texture=function(t){return new E.Z(t,{data:new Uint8Array(4),format:6408,type:5121,border:0,mipmaps:!1,dataFormat:6408,width:1,height:1})}(e),this.framebuffer=function(t,e){return new S.Z(t,{id:"spring-transition-is-transitioning-framebuffer",width:1,height:1,attachments:{36064:e}})}(e,this.texture),this.transform=function(t,e,i){const n=(0,v.w)(e.size);return new x.Z(t,{framebuffer:i,vs:"\n#define SHADER_NAME spring-transition-vertex-shader\n\n#define EPSILON 0.00001\n\nuniform float stiffness;\nuniform float damping;\nattribute ATTRIBUTE_TYPE aPrev;\nattribute ATTRIBUTE_TYPE aCur;\nattribute ATTRIBUTE_TYPE aTo;\nvarying ATTRIBUTE_TYPE vNext;\nvarying float vIsTransitioningFlag;\n\nATTRIBUTE_TYPE getNextValue(ATTRIBUTE_TYPE cur, ATTRIBUTE_TYPE prev, ATTRIBUTE_TYPE dest) {\n  ATTRIBUTE_TYPE velocity = cur - prev;\n  ATTRIBUTE_TYPE delta = dest - cur;\n  ATTRIBUTE_TYPE spring = delta * stiffness;\n  ATTRIBUTE_TYPE damper = velocity * -1.0 * damping;\n  return spring + damper + velocity + cur;\n}\n\nvoid main(void) {\n  bool isTransitioning = length(aCur - aPrev) > EPSILON || length(aTo - aCur) > EPSILON;\n  vIsTransitioningFlag = isTransitioning ? 1.0 : 0.0;\n\n  vNext = getNextValue(aCur, aPrev, aTo);\n  gl_Position = vec4(0, 0, 0, 1);\n  gl_PointSize = 100.0;\n}\n",fs:"\n#define SHADER_NAME spring-transition-is-transitioning-fragment-shader\n\nvarying float vIsTransitioningFlag;\n\nvoid main(void) {\n  if (vIsTransitioningFlag == 0.0) {\n    discard;\n  }\n  gl_FragColor = vec4(1.0);\n}",defines:{ATTRIBUTE_TYPE:n},varyings:["vNext"]})}(e,i,this.framebuffer);const o={byteLength:0,usage:35050};this.buffers=[new s.Z(e,o),new s.Z(e,o),new s.Z(e,o)]}get inProgress(){return this.transition.inProgress}start(t,e){const{gl:i,buffers:n,attribute:r}=this,o={numInstances:e,attribute:r,fromLength:this.currentLength,fromStartIndices:this.currentStartIndices,getData:t.enter};for(const s of n)(0,v.IV)({buffer:s,...o});this.settings=t,this.currentStartIndices=r.startIndices,this.currentLength=(0,v.pi)(r,e),this.attributeInTransition.setData({buffer:n[1],value:r.value}),this.transition.start({...t,duration:1/0}),this.transform.update({elementCount:Math.floor(this.currentLength/r.size),sourceBuffers:{aTo:(0,v.AQ)(i,r)}})}update(){const{buffers:t,transform:e,framebuffer:i,transition:n}=this;if(!n.update())return!1;const r=this.settings;e.update({sourceBuffers:{aPrev:t[0],aCur:t[1]},feedbackBuffers:{vNext:t[2]}}),e.run({framebuffer:i,discard:!1,clearRenderTarget:!0,uniforms:{stiffness:r.stiffness,damping:r.damping},parameters:{depthTest:!1,blend:!0,viewport:[0,0,1,1],blendFunc:[1,1],blendEquation:[32776,32776]}}),(0,v.DY)(t),this.attributeInTransition.setData({buffer:t[1],value:this.attribute.value});return(0,B.z6)(i)[0]>0||n.end(),!0}cancel(){this.transition.cancel(),this.transform.delete();for(const t of this.buffers)t.delete();this.buffers.length=0,this.texture.delete(),this.framebuffer.delete()}}};class M{constructor(t,e){let{id:i,timeline:r}=e;(0,n.Z)(this,"id",void 0),(0,n.Z)(this,"isSupported",void 0),(0,n.Z)(this,"gl",void 0),(0,n.Z)(this,"timeline",void 0),(0,n.Z)(this,"transitions",void 0),(0,n.Z)(this,"needsRedraw",void 0),(0,n.Z)(this,"numInstances",void 0),this.id=i,this.gl=t,this.timeline=r,this.transitions={},this.needsRedraw=!1,this.numInstances=1,this.isSupported=x.Z.isSupported(t)}finalize(){for(const t in this.transitions)this._removeTransition(t)}update(t){let{attributes:e,transitions:i,numInstances:n}=t;this.numInstances=n||1;for(const r in e){const t=e[r],n=t.getTransitionSetting(i);n&&this._updateAttribute(r,t,n)}for(const r in this.transitions){const t=e[r];t&&t.getTransitionSetting(i)||this._removeTransition(r)}}hasAttribute(t){const e=this.transitions[t];return e&&e.inProgress}getAttributes(){const t={};for(const e in this.transitions){const i=this.transitions[e];i.inProgress&&(t[e]=i.attributeInTransition)}return t}run(){if(!this.isSupported||0===this.numInstances)return!1;for(const e in this.transitions){this.transitions[e].update()&&(this.needsRedraw=!0)}const t=this.needsRedraw;return this.needsRedraw=!1,t}_removeTransition(t){this.transitions[t].cancel(),delete this.transitions[t]}_updateAttribute(t,e,i){const n=this.transitions[t];let r=!n||n.type!==i.type;if(r){if(!this.isSupported)return void u.Z.warn("WebGL2 not supported by this browser. Transition for ".concat(t," is disabled."))();n&&this._removeTransition(t);const o=T[i.type];o?this.transitions[t]=new o({attribute:e,timeline:this.timeline,gl:this.gl}):(u.Z.error("unsupported transition type '".concat(i.type,"'"))(),r=!1)}(r||e.needsRedraw())&&(this.needsRedraw=!0,this.transitions[t].start(i,this.numInstances))}}const I="attributeManager.invalidate";class P{constructor(t){let{id:e="attribute-manager",stats:i,timeline:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.Z)(this,"id",void 0),(0,n.Z)(this,"gl",void 0),(0,n.Z)(this,"attributes",void 0),(0,n.Z)(this,"updateTriggers",void 0),(0,n.Z)(this,"needsRedraw",void 0),(0,n.Z)(this,"userData",void 0),(0,n.Z)(this,"stats",void 0),(0,n.Z)(this,"attributeTransitionManager",void 0),this.id=e,this.gl=t,this.attributes={},this.updateTriggers={},this.needsRedraw=!0,this.userData={},this.stats=i,this.attributeTransitionManager=new M(t,{id:"".concat(e,"-transitions"),timeline:r}),Object.seal(this)}finalize(){for(const t in this.attributes)this.attributes[t].delete();this.attributeTransitionManager.finalize()}getNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this.needsRedraw;return this.needsRedraw=this.needsRedraw&&!t.clearRedrawFlags,e&&this.id}setNeedsRedraw(){this.needsRedraw=!0}add(t){this._add(t)}addInstanced(t){this._add(t,{instanced:1})}remove(t){for(const e of t)void 0!==this.attributes[e]&&(this.attributes[e].delete(),delete this.attributes[e])}invalidate(t,e){const i=this._invalidateTrigger(t,e);(0,b.Z)(I,this,t,i)}invalidateAll(t){for(const e in this.attributes)this.attributes[e].setNeedsUpdate(e,t);(0,b.Z)(I,this,"all")}update(t){let{data:e,numInstances:i,startIndices:n=null,transitions:r,props:o={},buffers:s={},context:a={}}=t,l=!1;(0,b.Z)("attributeManager.updateStart",this),this.stats&&this.stats.get("Update Attributes").timeStart();for(const c in this.attributes){const t=this.attributes[c],r=t.settings.accessor;t.startIndices=n,t.numInstances=i,o[c]&&u.Z.removed("props.".concat(c),"data.attributes.".concat(c))(),t.setExternalBuffer(s[c])||t.setBinaryValue("string"===typeof r?s[r]:void 0,e.startIndices)||"string"===typeof r&&!s[r]&&t.setConstantValue(o[r])||t.needsUpdate()&&(l=!0,this._updateAttribute({attribute:t,numInstances:i,data:e,props:o,context:a})),this.needsRedraw=this.needsRedraw||t.needsRedraw()}l&&(0,b.Z)("attributeManager.updateEnd",this,i),this.stats&&this.stats.get("Update Attributes").timeEnd(),this.attributeTransitionManager.update({attributes:this.attributes,numInstances:i,transitions:r})}updateTransition(){const{attributeTransitionManager:t}=this,e=t.run();return this.needsRedraw=this.needsRedraw||e,e}getAttributes(){return this.attributes}getChangedAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearChangedFlags:!1};const{attributes:e,attributeTransitionManager:i}=this,n={...i.getAttributes()};for(const r in e){const o=e[r];o.needsRedraw(t)&&!i.hasAttribute(r)&&(n[r]=o)}return n}getShaderAttributes(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t||(t=this.getAttributes());const i={};for(const n in t)e[n]||Object.assign(i,t[n].getShaderAttributes());return i}_add(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(const i in t){const n=t[i];this.attributes[i]=this._createAttribute(i,n,e)}this._mapUpdateTriggersToAttributes()}_createAttribute(t,e,i){const n={...e,id:t,size:(e.isIndexed?1:e.size)||1,divisor:i.instanced?1:e.divisor||0};return new _(this.gl,n)}_mapUpdateTriggersToAttributes(){const t={};for(const e in this.attributes){this.attributes[e].getUpdateTriggers().forEac
2h((i=>{t[i]||(t[i]=[]),t[i].push(e)}))}this.updateTriggers=t}_invalidateTrigger(t,e){const{attributes:i,updateTriggers:n}=this,r=n[t];return r&&r.forEach((t=>{const n=i[t];n&&n.setNeedsUpdate(n.id,e)})),r}_updateAttribute(t){const{attribute:e,numInstances:i}=t;if((0,b.Z)("attribute.updateStart",e),e.constant)return void e.setConstantValue(e.value);e.allocate(i)&&(0,b.Z)("attribute.allocate",e,i);e.updateBuffer(t)&&(this.needsRedraw=!0,(0,b.Z)("attribute.updateEnd",e,i))}}},41894:(t,e,i)=>{"use strict";function n(t){const{source:e,target:i,start:n=0,size:r,getData:o}=t,s=t.end||i.length,a=e.length,l=s-n;if(a>l)return void i.set(e.subarray(0,l),n);if(i.set(e,n),!o)return;let c=a;for(;c<l;){const t=o(c,e);for(let e=0;e<r;e++)i[n+c]=t[e]||0,c++}}i.d(e,{DY:()=>l,pi:()=>c,w:()=>a,AQ:()=>s,M0:()=>o,IV:()=>u});const r={interpolation:{duration:0,easing:t=>t},spring:{stiffness:.05,damping:.5}};function o(t,e){if(!t)return null;Number.isFinite(t)&&(t={type:"interpolation",duration:t});const i=t.type||"interpolation";return{...r[i],...e,...t,type:i}}function s(t,e){const i=e.getBuffer();return i?[i,{divisor:0,size:e.size,normalized:e.settings.normalized}]:e.value}function a(t){switch(t){case 1:return"float";case 2:return"vec2";case 3:return"vec3";case 4:return"vec4";default:throw new Error('No defined attribute type for size "'.concat(t,'"'))}}function l(t){t.push(t.shift())}function c(t,e){const{doublePrecision:i,settings:n,value:r,size:o}=t,s=i&&r instanceof Float64Array?2:1;return(n.noAlloc?r.length:e*o)*s}function u(t){let{buffer:e,numInstances:i,attribute:r,fromLength:o,fromStartIndices:s,getData:a=(t=>t)}=t;const l=r.doublePrecision&&r.value instanceof Float64Array?2:1,u=r.size*l,h=r.byteOffset,d=r.startIndices,p=s&&d,A=c(r,i),f=r.isConstant;if(!p&&o>=A)return;const g=f?r.value:r.getBuffer().getData({srcByteOffset:h});if(r.settings.normalized&&!f){const t=a;a=(e,i)=>r.normalizeConstant(t(e,i))}const m=f?(t,e)=>a(g,e):(t,e)=>a(g.subarray(t,t+u),e),y=e.getData({length:o}),v=new Float32Array(A);!function(t){let{source:e,target:i,size:r,getData:o,sourceStartIndices:s,targetStartIndices:a}=t;if(!Array.isArray(a))return n({source:e,target:i,size:r,getData:o}),i;let l=0,c=0;const u=o&&((t,e)=>o(t+c,e)),h=Math.min(s.length,a.length);for(let d=1;d<h;d++){const t=s[d]*r,o=a[d]*r;n({source:e.subarray(l,t),target:i,start:c,end:o,size:r,getData:u}),l=t,c=o}c<i.length&&n({source:[],target:i,start:c,size:r,getData:u})}({source:y,target:v,sourceStartIndices:s,targetStartIndices:d,size:u,getData:m}),e.byteLength<v.byteLength+h&&e.reallocate(v.byteLength+h),e.subData({data:v,offset:h})}},79366:(t,e,i)=>{"use strict";i.d(e,{Z:()=>a});var n=i(64649),r=i(90031),o=i(23427),s=i(18757);class a extends r.Z{get isComposite(){return!0}get isLoaded(){return super.isLoaded&&this.getSubLayers().every((t=>t.isLoaded))}getSubLayers(){return this.internalState&&this.internalState.subLayers||[]}initializeState(t){}setState(t){super.setState(t),this.setNeedsUpdate()}getPickingInfo(t){let{info:e}=t;const{object:i}=e;return i&&i.__source&&i.__source.parent&&i.__source.parent.id===this.id?(e.object=i.__source.object,e.index=i.__source.index,e):e}filterSubLayer(t){return!0}shouldRenderSubLayer(t,e){return e&&e.length}getSubLayerClass(t,e){const{_subLayerProps:i}=this.props;return i&&i[t]&&i[t].type||e}getSubLayerRow(t,e,i){return t.__source={parent:this,object:e,index:i},t}getSubLayerAccessor(t){if("function"===typeof t){const e={index:-1,data:this.props.data,target:[]};return(i,n)=>i&&i.__source?(e.index=i.__source.index,t(i.__source.object,e)):t(i,n)}return t}getSubLayerProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var e;const{opacity:i,pickable:n,visible:r,parameters:o,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:l,highlightColor:c,coordinateSystem:u,coordinateOrigin:h,wrapLongitude:d,positionFormat:p,modelMatrix:A,extensions:f,fetch:g,operation:m,_subLayerProps:y}=this.props,v={id:"",updateTriggers:{},opacity:i,pickable:n,visible:r,parameters:o,getPolygonOffset:s,highlightedObjectIndex:a,autoHighlight:l,highlightColor:c,coordinateSystem:u,coordinateOrigin:h,wrapLongitude:d,positionFormat:p,modelMatrix:A,extensions:f,fetch:g,operation:m},_=y&&t.id&&y[t.id],b=_&&_.updateTriggers,x=t.id||"sublayer";if(_){const e=this.constructor._propTypes,i=t.type?t.type._propTypes:{};for(const t in _){const n=i[t]||e[t];n&&"accessor"===n.type&&(_[t]=this.getSubLayerAccessor(_[t]))}}Object.assign(v,t,_),v.id="".concat(this.props.id,"-").concat(x),v.updateTriggers={all:null===(e=this.props.updateTriggers)||void 0===e?void 0:e.all,...t.updateTriggers,...b};for(const w of f){const t=w.getSubLayerProps.call(this,w);t&&Object.assign(v,t,{updateTriggers:Object.assign(v.updateTriggers,t.updateTriggers)})}return v}
vendor: 4,193 bytes, line 2
2_updateAutoHighlight(t){for(const e of this.getSubLayers())e.updateAutoHighlight(t)}_getAttributeManager(){return null}_postUpdate(t,e){let i=this.internalState.subLayers;const n=!i||this.needsUpdate();if(n){const t=this.renderLayers();i=(0,s.x)(t,Boolean),this.internalState.subLayers=i}(0,o.Z)("compositeLayer.renderLayers",this,n,i);for(const r of i)r.parent=this}}(0,n.Z)(a,"layerName","CompositeLayer")},18252:(t,e,i)=>{"use strict";i.d(e,{Df:()=>r,FP:()=>a,iI:()=>s,k8:()=>l,zG:()=>o});var n=i(21970);const r={DEFAULT:-1,LNGLAT:1,METER_OFFSETS:2,LNGLAT_OFFSETS:3,CARTESIAN:0};Object.defineProperty(r,"IDENTITY",{get:()=>(n.Z.deprecated("COORDINATE_SYSTEM.IDENTITY","COORDINATE_SYSTEM.CARTESIAN")(),0)});const o={WEB_MERCATOR:1,GLOBE:2,WEB_MERCATOR_AUTO_OFFSET:4,IDENTITY:0},s={common:0,meters:1,pixels:2},a={click:{handler:"onClick"},panstart:{handler:"onDragStart"},panmove:{handler:"onDrag"},panend:{handler:"onDragEnd"}},l={DRAW:"draw",MASK:"mask"}},90031:(t,e,i)=>{"use strict";i.d(e,{Z:()=>st});var n=i(64649),r=i(18252),o=i(96684),s=i(41894),a=i(47410),l=i(99188);class c extends l.Z{get value(){return this._value}_onUpdate(){const{time:t,settings:{fromValue:e,toValue:i,duration:n,easing:r}}=this,o=r(t/n);this._value=(0,a.t7)(e,i,o)}}const u=1e-5;function h(t,e,i,n,r){const o=e-t;return(i-e)*r+-o*n+o+e}function d(t,e){if(Array.isArray(t)){let i=0;for(let n=0;n<t.length;n++){const r=t[n]-e[n];i+=r*r}return Math.sqrt(i)}return Math.abs(t-e)}class p extends l.Z{get value(){return this._currValue}_onUpdate(){const{fromValue:t,toValue:e,damping:i,stiffness:n}=this.settings,{_prevValue:r=t,_currValue:o=t}=this;let s=function(t,e,i,n,r){if(Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++)o[s]=h(t[s],e[s],i[s],n,r);return o}return h(t,e,i,n,r)}(r,o,e,i,n);const a=d(s,e),l=d(s,o);a<u&&l<u&&(s=e,this.end()),this._prevValue=o,this._currValue=s}}var A=i(21970);const f={interpolation:c,spring:p};class g{constructor(t){this.transitions=new Map,this.timeline=t}get active(){return this.transitions.size>0}add(t,e,i,n){const{transitions:r}=this;if(r.has(t)){const i=r.get(t),{value:n=i.settings.fromValue}=i;e=n,this.remove(t)}if(!(n=(0,s.M0)(n)))return;const o=f[n.type];if(!o)return void A.Z.error("unsupported transition type '".concat(n.type,"'"))();const a=new o(this.timeline);a.start({...n,fromValue:e,toValue:i}),r.set(t,a)}remove(t){const{transitions:e}=this;e.has(t)&&(e.get(t).cancel(),e.delete(t))}update(){const t={};for(const[e,i]of this.transitions)i.update(),t[e]=i.value,i.inProgress||this.remove(e);return t}clear(){for(const t of this.transitions.keys())this.remove(t)}}var m=i(49473),y=i(48915);function v(t){if(null===(e=t)||"object"!==typeof e)throw new Error("count(): argument not an object");var e;if("function"===typeof t.count)return t.count();if(Number.isFinite(t.size))return t.size;if(Number.isFinite(t.length))return t.length;if(function(t){return null!==t&&"object"===typeof t&&t.constructor===Object}(t))return Object.keys(t).length;throw new Error("count(): argument not a container")}var _=i(23427),b=i(28007),x=i(12997),w=i(18188),C=i(46802),B=i(70487),E=i(52310),S=i(62220),T=i(99007),M=i(75818);function I(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.projectPosition(t);if(i&&e instanceof E.Z){const[i,r,o=0]=t,s=e.getDistanceScales([i,r]);n[2]=o*s.unitsPerMeter[2]}return n}function P(t,e){let{viewport:i,modelMatrix:n,coordinateSystem:o,coordinateOrigin:s,offsetMode:a}=e,[l,c,u=0]=t;switch(n&&([l,c,u]=S.fF([],[l,c,u,1],n)),o){case r.Df.LNGLAT:return I([l,c,u],i,a);case r.Df.LNGLAT_OFFSETS:return I([l+s[0],c+s[1],u+(s[2]||0)],i,a);case r.Df.METER_OFFSETS:return I((0,M.eG)(s,[l,c,u]),i,a);case r.Df.CARTESIAN:default:return i.isGeospatial?[l+s[0],c+s[1],u+s[2]]:i.projectPosition([l,c,u])}}function D(t,e){const{viewport:i,coordinateSystem:n,coordinateOrigin:o,modelMatrix:s,fromCoordinateSystem:a,fromCoordinateOrigin:l}=function(t){const{viewport:e,modelMatrix:i,coordinateOrigin:n}=t;let{coordinateSystem:o,fromCoordinateSystem:s,fromCoordinateOrigin:a}=t;return o===r.Df.DEFAULT&&(o=e.isGeospatial?r.Df.LNGLAT:r.Df.CARTESIAN),void 0===s&&(s=o),void 0===a&&(a=n),{viewport:e,coordinateSystem:o,c
2oordinateOrigin:n,modelMatrix:i,fromCoordinateSystem:s,fromCoordinateOrigin:a}}(e),{geospatialOrigin:c,shaderCoordinateOrigin:u,offsetMode:h}=(0,B.v)(i,n,o),d=P(t,{viewport:i,modelMatrix:s,coordinateSystem:a,coordinateOrigin:l,offsetMode:h});if(h){const t=i.projectPosition(c||u);T.lu(d,d,t)}return d}var L=i(28321),O=i(73115),F=i(58300);const R={10241:9987,10240:9729,10242:33071,10243:33071},k={};var z=i(98949);const U={boolean:{validate:(t,e)=>!0,equal:(t,e,i)=>Boolean(t)===Boolean(e)},number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},color:{validate:(t,e)=>e.optional&&!t||j(t)&&(3===t.length||4===t.length),equal:(t,e,i)=>N(t,e)},accessor:{validate(t,e){const i=V(t);return"function"===i||i===V(e.value)},equal:(t,e,i)=>"function"===typeof e||N(t,e)},array:{validate:(t,e)=>e.optional&&!t||j(t),equal:(t,e,i)=>i.compare?N(t,e):t===e},object:{equal:(t,e,i)=>i.compare?(0,z.v)(t,e):t===e},function:{validate:(t,e)=>e.optional&&!t||"function"===typeof t,equal:(t,e,i)=>!i.compare||t===e},data:{transform:(t,e,i)=>{const{dataTransform:n}=i.props;return n&&t?n(t):t}},image:{transform:(t,e,i)=>function(t,e){const i=t.context&&t.context.gl;if(!i||!e)return null;if(e instanceof F.Z)return e;e.constructor&&"Object"!==e.constructor.name&&(e={data:e});let n=null;e.compressed&&(n={10241:e.data.length>1?9985:9729});const r=new F.Z(i,{...e,parameters:{...R,...n,...t.props.textureParameters}});return k[r.id]=!0,r}(i,t),release:t=>{var e;(e=t)&&e instanceof F.Z&&k[e.id]&&(e.delete(),delete k[e.id])}}};function N(t,e){if(t===e)return!0;if(!j(t)||!j(e))return!1;const i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function G(t,e){switch(V(e)){case"object":return Z(t,e);case"array":return Z(t,{type:"array",value:e,compare:!1});case"boolean":return Z(t,{type:"boolean",value:e});case"number":return Z(t,{type:"number",value:e});case"function":return Z(t,{type:"function",value:e,compare:!0});default:return{name:t,type:"unknown",value:e}}}function Z(t,e){return"type"in e?{name:t,...U[e.type],...e}:"value"in e?{name:t,type:V(e.value),...e}:{name:t,type:"object",value:e}}function j(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function V(t){return j(t)?"array":null===t?"null":typeof t}function H(t){const e=Q(t,"_mergedDefaultProps");return e||(function(t){const e=t.prototype;if(!e)return;const i=Object.getPrototypeOf(t),n=H(i),r=Q(t,"defaultProps")||{},o=function(t){const e={},i={},n={};for(const[r,o]of Object.entries(t)){const t=null===o||void 0===o?void 0:o.deprecatedFor;if(t)n[r]=Array.isArray(t)?t:[t];else{const t=G(r,o);e[r]=t,i[r]=t.value}}return{propTypes:e,defaultProps:i,deprecatedProps:n}}(r),s=function(t,e,i){const n=Object.create(null);Object.assign(n,e,t);const r=function(t){const e=Q(t,"layerName")||Q(t,"componentName");e||A.Z.once(0,"".concat(t.name,".componentName not specified"))();return e||t.name}(i);return delete t.id,Object.defineProperties(n,{id:{writable:!0,value:r}}),n}(o.defaultProps,n,t),a={...i._propTypes,...o.propTypes};!function(t,e){const i={},n={};for(const r in e){const t=e[r],{name:o,value:s}=t;t.async&&(i[o]=s,n[o]=J(o))}t[y.lY]=i,t[y.fO]={},Object.defineProperties(t,n)}(s,a);const l={...i._deprecatedProps,...o.deprecatedProps};(function(t,e){for(const i in e)Object.defineProperty(t,i,{enumerable:!1,set(t){const n="".concat(this.id,": ").concat(i);for(const r of e[i])W(this,r)||(this[r]=t);A.Z.deprecated(n,e[i].join("/"))()}})})(s,l),t._mergedDefaultProps=s,t._propTypes=a,t._deprecatedProps=l}(t),t._mergedDefaultProps)}function J(t){return{enumerable:!0,set(e){"string"===typeof e||e instanceof Promise||(0,O.D0)(e)?this[y.fO][t]=e:this[y.bN][t]=e}
vendor: 3,912 bytes, line 2
2,get(){if(this[y.bN]){if(t in this[y.bN]){return this[y.bN][t]||this[y.lY][t]}if(t in this[y.fO]){const e=this[y.fm]&&this[y.fm].internalState;if(e&&e.hasAsyncProp(t))return e.getAsyncProp(t)||this[y.lY][t]}}return this[y.lY][t]}}}function W(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Q(t,e){return W(t,e)&&t[e]}let q=0;class K{constructor(){(0,n.Z)(this,"id",void 0),(0,n.Z)(this,"props",void 0),(0,n.Z)(this,"count",void 0);for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];this.props=function(t,e){const i=H(t.constructor),n=Object.create(i);n[y.fm]=t,n[y.fO]={},n[y.bN]={};for(let r=0;r<e.length;++r){const t=e[r];for(const e in t)n[e]=t[e]}return Object.freeze(n),n}(this,e),this.id=this.props.id,this.count=q++}clone(t){const{props:e}=this,i={};for(const n in e[y.lY])n in e[y.bN]?i[n]=e[y.bN][n]:n in e[y.fO]&&(i[n]=e[y.fO][n]);return new this.constructor({...e,...i,...t})}}(0,n.Z)(K,"componentName","Component"),(0,n.Z)(K,"defaultProps",{});const X=Object.freeze({});class Y{constructor(t){(0,n.Z)(this,"component",void 0),(0,n.Z)(this,"onAsyncPropUpdated",void 0),(0,n.Z)(this,"asyncProps",void 0),(0,n.Z)(this,"oldProps",void 0),(0,n.Z)(this,"oldAsyncProps",void 0),this.component=t,this.asyncProps={},this.onAsyncPropUpdated=()=>{},this.oldProps=null,this.oldAsyncProps=null}finalize(){for(const t in this.asyncProps){const e=this.asyncProps[t];e&&e.type&&e.type.release&&e.type.release(e.resolvedValue,e.type,this.component)}}getOldProps(){return this.oldAsyncProps||this.oldProps||X}resetOldProps(){this.oldAsyncProps=null,this.oldProps=this.component.props}hasAsyncProp(t){return t in this.asyncProps}getAsyncProp(t){const e=this.asyncProps[t];return e&&e.resolvedValue}isAsyncPropLoading(t){if(t){const e=this.asyncProps[t];return Boolean(e&&e.pendingLoadCount>0&&e.pendingLoadCount!==e.resolvedLoadCount)}for(const e in this.asyncProps)if(this.isAsyncPropLoading(e))return!0;return!1}reloadAsyncProp(t,e){this._watchPromise(t,Promise.resolve(e))}setAsyncProps(t){const e=t[y.bN]||{},i=t[y.fO]||t,n=t[y.lY]||{};for(const r in e){const t=e[r];this._createAsyncPropData(r,n[r]),this._updateAsyncProp(r,t),e[r]=this.getAsyncProp(r)}for(const r in i){const t=i[r];this._createAsyncPropData(r,n[r]),this._updateAsyncProp(r,t)}}_fetch(t,e){return null}_onResolve(t,e){}_onError(t,e){}_updateAsyncProp(t,e){this._didAsyncInputValueChange(t,e)&&("string"===typeof e&&(e=this._fetch(t,e)),e instanceof Promise?this._watchPromise(t,e):(0,O.D0)(e)?this._resolveAsyncIterable(t,e):this._setPropValue(t,e))}_freezeAsyncOldProps(){if(!this.oldAsyncProps&&this.oldProps){this.oldAsyncProps=Object.create(this.oldProps);for(const t in this.asyncProps)Object.defineProperty(this.oldAsyncProps,t,{enumerable:!0,value:this.oldProps[t]})}}_didAsyncInputValueChange(t,e){const i=this.asyncProps[t];return e!==i.resolvedValue&&e!==i.lastValue&&(i.lastValue=e,!0)}_setPropValue(t,e){this._freezeAsyncOldProps();const i=this.asyncProps[t];i&&(e=this._postProcessValue(i,e),i.resolvedValue=e,i.pendingLoadCount++,i.resolvedLoadCount=i.pendingLoadCount)}_setAsyncPropValue(t,e,i){const n=this.asyncProps[t];n&&i>=n.resolvedLoadCount&&void 0!==e&&(this._freezeAsyncOldProps(),n.resolvedValue=e,n.resolvedLoadCount=i,this.onAsyncPropUpdated(t,e))}_watchPromise(t,e){const i=this.asyncProps[t];if(i){i.pendingLoadCount++;const n=i.pendingLoadCount;e.then((e=>{e=this._postProcessValue(i,e),this._setAsyncPropValue(t,e,n),this._onResolve(t,e)})).catch((e=>{this._onError(t,e)}))}}async _resolveAsyncIterable(t,e){if("data"!==t)return void this._setPropValue(t,e);const i=this.asyncProps[t];if(!i)return;i.pendingLoadCount++;const n=i.pendingLoadCount;let r=[],o=0;for await(const s of e){const{dataTransform:e}=this.component.props;r=e?e(s,r):r.concat(s),Object.defineProperty(r,"__diff",{enumerable:!1,value:[{startRow:o,endRow:r.length}]}),o=r.length,this._setAsyncPropValue(t,r,n)}
2this._onResolve(t,r)}_postProcessValue(t,e){const i=t.type;return i&&(i.release&&i.release(t.resolvedValue,i,this.component),i.transform)?i.transform(e,i,this.component):e}_createAsyncPropData(t,e){if(!this.asyncProps[t]){const i=this.component&&this.component.constructor._propTypes;this.asyncProps[t]={type:i&&i[t],lastValue:null,resolvedValue:e,pendingLoadCount:0,resolvedLoadCount:0}}}}class $ extends Y{constructor(t){let{attributeManager:e,layer:i}=t;super(i),(0,n.Z)(this,"attributeManager",void 0),(0,n.Z)(this,"needsRedraw",void 0),(0,n.Z)(this,"needsUpdate",void 0),(0,n.Z)(this,"subLayers",void 0),(0,n.Z)(this,"usesPickingColorCache",void 0),(0,n.Z)(this,"changeFlags",void 0),(0,n.Z)(this,"viewport",void 0),(0,n.Z)(this,"uniformTransitions",void 0),(0,n.Z)(this,"propsInTransition",void 0),this.attributeManager=e,this.needsRedraw=!0,this.needsUpdate=!0,this.subLayers=null,this.usesPickingColorCache=!1}get layer(){return this.component}set layer(t){this.component=t}_fetch(t,e){const i=this.component.props.fetch;return i?i(e,{propName:t,layer:this.layer}):super._fetch(t,e)}_onResolve(t,e){const i=this.component.props.onDataLoad;"data"===t&&i&&i(e,{propName:t,layer:this.layer})}_onError(t,e){this.layer.raiseError(e,"loading ".concat(t," of ").concat(this.layer))}}var tt=i(65959);const et=2**24-1,it=Object.freeze([]),nt=(0,w.Z)((t=>{let{oldViewport:e,viewport:i}=t;return e.equals(i)}));let rt=new Uint8ClampedArray(0);const ot={data:{type:"data",value:it,async:!0},dataComparator:{type:"function",value:null,compare:!1,optional:!0},_dataDiff:{type:"function",value:t=>t&&t.__diff,compare:!1,optional:!0},dataTransform:{type:"function",value:null,compare:!1,optional:!0},onDataLoad:{type:"function",value:null,compare:!1,optional:!0},onError:{type:"function",value:null,compare:!1,optional:!0},fetch:{type:"function",value:(t,e)=>{let{propName:i,layer:n,loaders:r,loadOptions:o,signal:s}=e;const{resourceManager:a}=n.context;var l;(o=o||n.getLoadOptions(),r=r||n.props.loaders,s)&&(o={...o,fetch:{...null===(l=o)||void 0===l?void 0:l.fetch,signal:s}});let c=a.contains(t);return c||o||(a.add({resourceId:t,data:(0,tt.z)(t,r),persistent:!1}),c=!0),c?a.subscribe({resourceId:t,onChange:t=>{var e;return null===(e=n.internalState)||void 0===e?void 0:e.reloadAsyncProp(i,t)},consumerId:n.id,requestId:i}):(0,tt.z)(t,r,o)},compare:!1},updateTriggers:{},visible:!0,pickable:!1,opacity:{type:"number",min:0,max:1,value:1},operation:r.k8.DRAW,onHover:{type:"function",value:null,compare:!1,optional:!0},onClick:{type:"function",value:null,compare:!1,optional:!0},onDragStart:{type:"function",value:null,compare:!1,optional:!0},onDrag:{type:"function",value:null,compare:!1,optional:!0},onDragEnd:{type:"function",value:null,compare:!1,optional:!0},coordinateSystem:r.Df.DEFAULT,coordinateOrigin:{type:"array",value:[0,0,0],compare:!0},modelMatrix:{type:"array",value:null,compare:!0,optional:!0},wrapLongitude:!1,positionFormat:"XYZ",colorFormat:"RGBA",parameters:{type:"object",value:{},optional:!0,compare:!0},transitions:null,extensions:[],loaders:{type:"array",value:[],optional:!0,compare:!0},getPolygonOffset:{type:"function",value:t=>{let{layerIndex:e}=t;return[0,100*-e]},compare:!1},highlightedObjectIndex:null,autoHighlight:!1,highlightColor:{type:"accessor",value:[0,0,128,128]}};class st extends K{constructor(){super(...arguments),(0,n.Z)(this,"internalState",null),(0,n.Z)(this,"lifecycle",y.dt.NO_STATE),(0,n.Z)(this,"context",void 0),(0,n.Z)(this,"state",void 0),(0,n.Z)(this,"parent",null)}get root(){let t=this;for(;t.parent;)t=t.parent;return t}toString(){const t=this.constructor.layerName||this.constructor.name;return"".concat(t,"({id: '").concat(this.props.id,"'})")}project(t){(0,x.Z)(this.internalState);const e=this.internalState.viewport||this.context.viewport,i=P(t,{viewport:e,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem}),[n,r,o]=(0,M.aW)(i,e.pixelProjectionMatrix);return 2===t.length?[n,r]:[n,r,o]}unproject(t){(0,x.Z)(this.internalState);return(this.internalState.viewport||this.context.viewport).unproject(t)}projectPosition(t,e){(0,x.Z)(this.internalState);return D(t,{viewport:this.internalState.viewport||this.context.viewport,modelMatrix:this.props.modelMatrix,coordinateOrigin:this.props.coordinateOrigin,coordinateSystem:this.props.coordinateSystem,...e})}get isComposite(){return!1}setState(t){this.setChangeFlags({stateChanged:!0}),Object.assign(this.state,t),this.setNeedsRedraw()}setNeedsRedraw(){this.internalState&&(this.internalState.needsRedraw=!0)}setNeedsUpdate(){this.internalState&&(this.context.layerManager.setNeedsUpdate(String(this)),this.internalState.needsUpdate=!0)}get isLoaded(){return!!this.internalState&&!this.internalState.isAsyncPropLoading()}get wrapLongitude(){return this.props.wrapLongitude}isPickable(){return this.props.pickable&&this.props.visible}getModels(){return this.state&&(this.state.models||this.state.model&&[this.state.model])||[]}setModuleParameters(t){for(const e of this.getModels())e.updateModuleSettings(t)}getAttributeManager(){return this.internalState&&this.internalState.attributeManager}getCurrentLayer(){return this.internalState&&this.internalState.layer}getLoadOptions(){return this.props.loadOptions}use64bitPositions(){const{coordinateSystem:t}=this.props;return t===r.Df.DEFAULT||t===r.Df.LNGLAT||t===r.Df.CARTESIAN}onHover(t,e){return this.props.onHover&&this.props.onHover(t,e)||!1}onClick(t,e){return this.props.onClick&&this.props.onClick(t,e)||!1}nullPickingColor(){return[0,0,0]}encodePickingColor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e[0]=t+1&255,e[1]=t+1>>8&255,e[2]=t+1>>8>>8&255,e}decodePickingColor(t){(0,x.Z)(t instanceof Uint8Array);const[e,i,n]=t;return e+256*i+65536*n-1}getNumInstances(){return Number.isFinite(this.props.numInstances)?this.props.numInstances:this.state&&void 0!==this.state.numInstances?this.state.numInstances:v(this.props.data)}getStartIndices(){return this.props.startIndices?this.props.startIndices:this.state&&this.state.startIndices?this.state.startIndices:null}getBounds(){var t;const e=this.getAttributeManager();if(!e)return null;const{positions:i,instancePositions:n}=e.attributes;return null===(t=i||n)||void 0===t?void 0:t.getBounds()}getShaders(t){for(const e of this.props.extensions)t=(0,C.l)(t,e.getShaders.call(this,e));return t}shouldUpdateState(t){return t.changeFlags.propsOrDataChanged}updateState(t){const e=this.getAttributeManager(),{dataChanged:i}=t.changeFlags;if(i&&e)if(Array.isArray(i))for(const a of i)e.invalidateAll(a);
2else e.invalidateAll();const{props:n,oldProps:r}=t,o=Number.isInteger(r.highlightedObjectIndex)||r.pickable,s=Number.isInteger(n.highlightedObjectIndex)||n.pickable;if(o!==s&&e){const{pickingColors:t,instancePickingColors:i}=e.attributes,n=t||i;n&&(s&&n.constant&&(n.constant=!1,e.invalidate(n.id)),n.value||s||(n.constant=!0,n.value=[0,0,0]))}}finalizeState(t){for(const i of this.getModels())i.delete();const e=this.getAttributeManager();e&&e.finalize(),this.context&&this.context.resourceManager.unsubscribe({consumerId:this.id}),this.internalState&&(this.internalState.uniformTransitions.clear(),this.internalState.finalize())}draw(t){for(const e of this.getModels())e.draw(t)}getPickingInfo(t){let{info:e,mode:i,sourceLayer:n}=t;const{index:r}=e;return r>=0&&Array.isArray(this.props.data)&&(e.object=this.props.data[r]),e}raiseError(t,e){var i,n,r,o;(e&&(t.message="".concat(e,": ").concat(t.message)),null!==(i=(n=this.props).onError)&&void 0!==i&&i.call(n,t))||(null===(r=this.context)||void 0===r||null===(o=r.onError)||void 0===o||o.call(r,t,this))}getNeedsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};return this._getNeedsRedraw(t)}needsUpdate(){return!!this.internalState&&(this.internalState.needsUpdate||this.hasUniformTransition()||this.shouldUpdateState(this._getUpdateParams()))}hasUniformTransition(){var t;return(null===(t=this.internalState)||void 0===t?void 0:t.uniformTransitions.active)||!1}activateViewport(t){if(!this.internalState)return;const e=this.internalState.viewport;this.internalState.viewport=t,e&&nt({oldViewport:e,viewport:t})||(this.setChangeFlags({viewportChanged:!0}),this.isComposite?this.needsUpdate()&&this.setNeedsUpdate():this._update())}invalidateAttribute(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"all";const e=this.getAttributeManager();e&&("all"===t?e.invalidateAll():e.invalidate(t))}updateAttributes(t){for(const e of this.getModels())this._setModelAttributes(e,t)}_updateAttributes(){const t=this.getAttributeManager();if(!t)return;const e=this.props,i=this.getNumInstances(),n=this.getStartIndices();t.update({data:e.data,numInstances:i,startIndices:n,props:e,transitions:e.transitions,buffers:e.data.attributes,context:this});const r=t.getChangedAttributes({clearChangedFlags:!0});this.updateAttributes(r)}_updateAttributeTransition(){const t=this.getAttributeManager();t&&t.updateTransition()}_updateUniformTransition(){const{uniformTransitions:t}=this.internalState;if(t.active){const e=t.update(),i=Object.create(this.props);for(const t in e)Object.defineProperty(i,t,{value:e[t]});return i}return this.props}calculateInstancePickingColors(t,e){let{numInstances:i}=e;if(t.constant)return;const n=Math.floor(rt.length/3);if(this.internalState.usesPickingColorCache=!0,n<i){i>et&&A.Z.warn("Layer has too many data objects. Picking might not be able to distinguish all objects.")(),rt=L.Z.allocate(rt,i,{size:3,copy:!0,maxCount:Math.max(i,et)});const t=Math.floor(rt.length/3),e=[];for(let i=n;i<t;i++)this.encodePickingColor(i,e),rt[3*i+0]=e[0],rt[3*i+1]=e[1],rt[3*i+2]=e[2]}t.value=rt.subarray(0,3*i)}_setModelAttributes(t,e){const i=this.getAttributeManager(),n=t.userData.excludeAttributes||{},r=i.getShaderAttributes(e,n);t.setAttributes(r)}disablePickingIndex(t){this._disablePickingIndex(t)}_disablePickingIndex(t){const{pickingColors:e,instancePickingColors:i}=this.getAttributeManager().attributes,n=e||i;if(!n)return;const r=n.getVertexOffset(t),o=n.getVertexOffset(t+1);n.buffer.subData({data:new Uint8Array(o-r),offset:r})}restorePickingColors(){const{pickingColors:t,instancePickingColors:e}=this.getAttributeManager().attributes,i=t||e;i&&(this.internalState.usesPickingColorCache&&i.value.buffer!==rt.buffer&&(i.value=rt.subarray(0,i.value.length)),i.updateSubBuffer({startOffset:0}))}_initialize(){(0,x.Z)(!this.internalState),(0,x.Z)(Number.isFinite(this.props.coordinateSystem)),(0,_.Z)("layer.initialize",this);const t=this._getAttributeManager();t&&t.addInstanced({instancePickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateInstancePickingColors}}),this.internalState=new $({attributeManager:t,layer:this}),this._clearChangeFlags(),this.state={},Object.defineProperty(this.state,"attributeManager",{get:()=>(A.Z.deprecated("layer.state.attributeManager","layer.getAttributeManager()")(),t)}),this.internalState.layer=this,this.internalState.uniformTransitions=new g(this.context.timeline),this.internalState.onAsyncPropUpdated=this._onAsyncPropUpdated.bind(this),this.internalState.setAsyncProps(this.props),this.initializeState(this.context);for(const e of this.props.extensions)e.initializeState.call(this,this.context,e);this.setChangeFlags({dataChanged:"init",propsChanged:"init",viewportChanged:!0,extensionsChanged:!0}),this._update()}_transferState(t){(0,_.Z)("layer.matched",this,this===t);const{state:e,internalState:i}=t;this!==t&&(this.internalState=i,this.internalState.layer=this,this.state=e,this.internalState.setAsyncProps(this.props),this._diffProps(this.props,this.internalState.getOldProps()))}
2_update(){const t=this.needsUpdate();if((0,_.Z)("layer.update",this,t),!t)return;const e=this.props,i=this.context,n=this.internalState,r=i.viewport,o=this._updateUniformTransition();n.propsInTransition=o,i.viewport=n.viewport||r,this.props=o;try{const t=this._getUpdateParams(),e=this.getModels();if(i.gl)this.updateState(t);else try{this.updateState(t)}catch(s){}for(const i of this.props.extensions)i.updateState.call(this,t,i);const n=this.getModels()[0]!==e[0];this._postUpdate(t,n)}finally{i.viewport=r,this.props=e,this._clearChangeFlags(),n.needsUpdate=!1,n.resetOldProps()}}_finalize(){(0,_.Z)("layer.finalize",this),this.finalizeState(this.context);for(const t of this.props.extensions)t.finalizeState.call(this,t)}_drawLayer(t){let{moduleParameters:e=null,uniforms:i={},parameters:n={}}=t;this._updateAttributeTransition();const r=this.props,o=this.context;this.props=this.internalState.propsInTransition||r;const s=this.props.opacity;i.opacity=Math.pow(s,1/2.2);try{e&&this.setModuleParameters(e);const{getPolygonOffset:t}=this.props,r=t&&t(i)||[0,0];(0,b.dR)(o.gl,{polygonOffset:r}),(0,b.s8)(o.gl,n,(()=>{const t={moduleParameters:e,uniforms:i,parameters:n,context:o};for(const e of this.props.extensions)e.draw.call(this,t,e);this.draw(t)}))}finally{this.props=r}}getChangeFlags(){var t;return null===(t=this.internalState)||void 0===t?void 0:t.changeFlags}setChangeFlags(t){if(!this.internalState)return;const{changeFlags:e}=this.internalState;for(const n in t)if(t[n]){let i=!1;if("dataChanged"===n){const r=t[n],o=e[n];r&&Array.isArray(o)&&(e.dataChanged=Array.isArray(r)?o.concat(r):r,i=!0)}e[n]||(e[n]=t[n],i=!0),i&&(0,_.Z)("layer.changeFlag",this,n,t)}const i=Boolean(e.dataChanged||e.updateTriggersChanged||e.propsChanged||e.extensionsChanged);e.propsOrDataChanged=i,e.somethingChanged=i||e.viewportChanged||e.stateChanged}_clearChangeFlags(){this.internalState.changeFlags={dataChanged:!1,propsChanged:!1,updateTriggersChanged:!1,viewportChanged:!1,stateChanged:!1,extensionsChanged:!1,propsOrDataChanged:!1,somethingChanged:!1}}_diffProps(t,e){const i=(0,m.Yt)(t,e);if(i.updateTriggersChanged)for(const r in i.updateTriggersChanged)i.updateTriggersChanged[r]&&this.invalidateAttribute(r);if(i.transitionsChanged)for(const r in i.transitionsChanged){var n;this.internalState.uniformTransitions.add(r,e[r],t[r],null===(n=t.transitions)||void 0===n?void 0:n[r])}return this.setChangeFlags(i)}validateProps(){(0,m.eQ)(this.props)}updateAutoHighlight(t){this.props.autoHighlight&&!Number.isInteger(this.props.highlightedObjectIndex)&&this._updateAutoHighlight(t)}_updateAutoHighlight(t){const e={pickingSelectedColor:t.picked?t.color:null},{highlightColor:i}=this.props;t.picked&&"function"===typeof i&&(e.pickingHighlightColor=i(t)),this.setModuleParameters(e),this.setNeedsRedraw()}_getAttributeManager(){const t=this.context;return new o.Z(t.gl,{id:this.props.id,stats:t.stats,timeline:t.timeline})}_postUpdate(t,e){const{props:i,oldProps:n}=t;this.setNeedsRedraw(),this._updateAttributes();const{model:r}=this.state;null===r||void 0===r||r.setInstanceCount(this.getNumInstances());const{autoHighlight:o,highlightedObjectIndex:s,highlightColor:a}=i;if(e||n.autoHighlight!==o||n.highlightedObjectIndex!==s||n.highlightColor!==a){const t={};o||(t.pickingSelectedColor=null),Array.isArray(a)&&(t.pickingHighlightColor=a),(e||s!==n.highlightedObjectIndex)&&(t.pickingSelectedColor=Number.isFinite(s)&&s>=0?this.encodePickingColor(s):null),this.setModuleParameters(t)}}_getUpdateParams(){return{props:this.props,oldProps:this.internalState.getOldProps(),context:this.context,changeFlags:this.internalState.changeFlags}}_getNeedsRedraw(t){if(!this.internalState)return!1;let e=!1;e=e||this.internalState.needsRedraw&&this.id,this.internalState.needsRedraw=this.internalState.needsRedraw&&!t.clearRedrawFlags;const i=this.getAttributeManager(),n=!!i&&i.getNeedsRedraw(t);return e=e||n,e}_onAsyncPropUpdated(){this._diffProps(this.props,this.internalState.getOldProps()),this.setNeedsUpdate()}}(0,n.Z)(st,"defaultProps",ot),(0,n.Z)(st,"layerName","Layer")},48915:(t,e,i)=>{"use strict";i.d(e,{bN:()=>a,dt:()=>n,fO:()=>s,fm:()=>r,lY:()=>o});const n={NO_STATE:"Awaiting state",MATCHED:"Matched. State transferred from previous layer",INITIALIZED:"Initialized",AWAITING_GC:"Discarded. Awaiting garbage collection",AWAITING_FINALIZATION:"No longer matched. Awaiting garbage collection",FINALIZED:"Finalized! Awaiting garbage collection"},r=Symbol.for("component"),o=Symbol.for("asyncPropDefaults"),s=Symbol.for("asyncPropOriginal"),a=Symbol.for("asyncPropResolved")},49473:(t,e,i)=>{"use strict";i.d(e,{Yt:()=>o,eQ:()=>r,tg:()=>a});var n=i(48915);function r(t){const e=h(t);for(const i in e){const n=e[i],{validate:r}=n;if(r&&!r(t[i],n))throw new Error("Invalid prop ".concat(i,": ").concat(t[i]))}}
2function o(t,e){const i=a({newProps:t,oldProps:e,propTypes:h(t),ignoreProps:{data:null,updateTriggers:null,extensions:null,transitions:null}}),n=function(t,e){if(null===e)return"oldProps is null, initial diff";let i=!1;const{dataComparator:n,_dataDiff:r}=t;n?n(t.data,e.data)||(i="Data comparator detected a change"):t.data!==e.data&&(i="A new data container was supplied");i&&r&&(i=r(t.data,e.data)||i);return i}(t,e);let r=!1;return n||(r=function(t,e){if(null===e)return{all:!0};if("all"in t.updateTriggers){if(u(t,e,"all"))return{all:!0}}const i={};let n=!1;for(const r in t.updateTriggers)if("all"!==r){u(t,e,r)&&(i[r]=!0,n=!0)}return!!n&&i}(t,e)),{dataChanged:n,propsChanged:i,updateTriggersChanged:r,extensionsChanged:c(t,e),transitionsChanged:s(t,e)}}function s(t,e){if(!t.transitions)return!1;const i={},n=h(t);let r=!1;for(const o in t.transitions){const s=n[o],a=s&&s.type;("number"===a||"color"===a||"array"===a)&&l(t[o],e[o],s)&&(i[o]=!0,r=!0)}return!!r&&i}function a(t){let{newProps:e,oldProps:i,ignoreProps:n={},propTypes:r={},triggerName:o="props"}=t;if(i===e)return!1;if("object"!==typeof e||null===e)return"".concat(o," changed shallowly");if("object"!==typeof i||null===i)return"".concat(o," changed shallowly");for(const s of Object.keys(e))if(!(s in n)){if(!(s in i))return"".concat(o,".").concat(s," added");const t=l(e[s],i[s],r[s]);if(t)return"".concat(o,".").concat(s," ").concat(t)}for(const s of Object.keys(i))if(!(s in n)){if(!(s in e))return"".concat(o,".").concat(s," dropped");if(!Object.hasOwnProperty.call(e,s)){const t=l(e[s],i[s],r[s]);if(t)return"".concat(o,".").concat(s," ").concat(t)}}return!1}function l(t,e,i){let n=i&&i.equal;return n&&!n(t,e,i)?"changed deeply":n||(n=t&&e&&t.equals,!n||n.call(t,e))?n||e===t?null:"changed shallowly":"changed deeply"}function c(t,e){if(null===e)return!0;const i=e.extensions,{extensions:n}=t;if(n===i)return!1;if(!i||!n)return!0;if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++)if(!n[r].equals(i[r]))return!0;return!1}function u(t,e,i){let n=t.updateTriggers[i];n=void 0===n||null===n?{}:n;let r=e.updateTriggers[i];r=void 0===r||null===r?{}:r;return a({oldProps:r,newProps:n,triggerName:i})}function h(t){const e=t[n.fm],i=e&&e.constructor;return i?i._propTypes:{}}},2578:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});const n={pickingSelectedColor:null,pickingHighlightColor:new Uint8Array([0,255,255,255]),pickingActive:!1,pickingAttribute:!1};const r={inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n    // for picking depth values\n    picking_setPickingAttribute(position.z / position.w);\n  ","vs:DECKGL_FILTER_COLOR":"\n  picking_setPickingColor(geometry.pickingColor);\n  ","fs:DECKGL_FILTER_COLOR":{order:99,injection:"\n  // use highlight color if this fragment belongs to the selected object.\n  color = picking_filterHighlightColor(color);\n\n  // use picking color if rendering to picking FBO.\n  color = picking_filterPickingColor(color);\n    "}},...{name:"picking",vs:"uniform bool picking_uActive;\nuniform bool picking_uAttribute;\nuniform vec3 picking_uSelectedColor;\nuniform bool picking_uSelectedColorValid;\n\nout vec4 picking_vRGBcolor_Avalid;\n\nconst float COLOR_SCALE = 1. / 255.;\n\nbool picking_isColorValid(vec3 color) {\n  return dot(color, vec3(1.0)) > 0.001;\n}\n\nbool isVertexPicked(vec3 vertexColor) {\n  return\n    picking_uSelectedColorValid &&\n    !picking_isColorValid(abs(vertexColor - picking_uSelectedColor));\n}\n\nvoid picking_setPickingColor(vec3 pickingColor) {\n  if (picking_uActive) {\n    picking_vRGBcolor_Avalid.a = float(picking_isColorValid(pickingColor));\n\n    if (!picking_uAttribute) {\n      picking_vRGBcolor_Avalid.rgb = pickingColor * COLOR_SCALE;\n    }\n  } else {\n    picking_vRGBcolor_Avalid.a = float(isVertexPicked(pickingColor));\n  }\n}\n\nvoid picking_setPickingAttribute(float value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Avalid.r = value;\n  }\n}\nvoid picking_setPickingAttribute(vec2 value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Avalid.rg = value;\n  }\n}\nvoid picking_setPickingAttribute(vec3 value) {\n  if (picking_uAttribute) {\n    picking_vRGBcolor_Aval
2id.rgb = value;\n  }\n}\n",fs:"uniform bool picking_uActive;\nuniform vec3 picking_uSelectedColor;\nuniform vec4 picking_uHighlightColor;\n\nin vec4 picking_vRGBcolor_Avalid;\nvec4 picking_filterHighlightColor(vec4 color) {\n  if (picking_uActive) {\n    return color;\n  }\n  bool selected = bool(picking_vRGBcolor_Avalid.a);\n\n  if (selected) {\n    float highLightAlpha = picking_uHighlightColor.a;\n    float blendedAlpha = highLightAlpha + color.a * (1.0 - highLightAlpha);\n    float highLightRatio = highLightAlpha / blendedAlpha;\n\n    vec3 blendedRGB = mix(color.rgb, picking_uHighlightColor.rgb, highLightRatio);\n    return vec4(blendedRGB, blendedAlpha);\n  } else {\n    return color;\n  }\n}\nvec4 picking_filterPickingColor(vec4 color) {\n  if (picking_uActive) {\n    if (picking_vRGBcolor_Avalid.a == 0.0) {\n      discard;\n    }\n    return picking_vRGBcolor_Avalid;\n  }\n  return color;\n}\nvec4 picking_filterColor(vec4 color) {\n  vec4 highightColor = picking_filterHighlightColor(color);\n  return picking_filterPickingColor(highightColor);\n}\n\n",getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n;const e={};if(void 0!==t.pickingSelectedColor)if(t.pickingSelectedColor){const i=t.pickingSelectedColor.slice(0,3);e.picking_uSelectedColorValid=1,e.picking_uSelectedColor=i}else e.picking_uSelectedColorValid=0;if(t.pickingHighlightColor){const i=Array.from(t.pickingHighlightColor,(t=>t/255));Number.isFinite(i[3])||(i[3]=1),e.picking_uHighlightColor=i}return void 0!==t.pickingActive&&(e.picking_uActive=Boolean(t.pickingActive),e.picking_uAttribute=Boolean(t.pickingAttribute)),e}}}},66199:(t,e,i)=>{"use strict";i.d(e,{Z:()=>p});const n={name:"fp32",vs:"#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\nconst float TWO_PI = 6.2831854820251465;\nconst float PI_2 = 1.5707963705062866;\nconst float PI_16 = 0.1963495463132858;\n\nconst float SIN_TABLE_0 = 0.19509032368659973;\nconst float SIN_TABLE_1 = 0.3826834261417389;\nconst float SIN_TABLE_2 = 0.5555702447891235;\nconst float SIN_TABLE_3 = 0.7071067690849304;\n\nconst float COS_TABLE_0 = 0.9807852506637573;\nconst float COS_TABLE_1 = 0.9238795042037964;\nconst float COS_TABLE_2 = 0.8314695954322815;\nconst float COS_TABLE_3 = 0.7071067690849304;\n\nconst float INVERSE_FACTORIAL_3 = 1.666666716337204e-01;\nconst float INVERSE_FACTORIAL_5 = 8.333333767950535e-03;\nconst float INVERSE_FACTORIAL_7 = 1.9841270113829523e-04;\nconst float INVERSE_FACTORIAL_9 = 2.75573188446287533e-06;\n\nfloat sin_taylor_fp32(float a) {\n  float r, s, t, x;\n\n  if (a == 0.0) {\n    return 0.0;\n  }\n\n  x = -a * a;\n  s = a;\n  r = a;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_3;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_5;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_7;\n  s = s + t;\n\n  r = r * x;\n  t = r * INVERSE_FACTORIAL_9;\n  s = s + t;\n\n  return s;\n}\n\nvoid sincos_taylor_fp32(float a, out float sin_t, out float cos_t) {\n  if (a == 0.0) {\n    sin_t = 0.0;\n    cos_t = 1.0;\n  }\n  sin_t = sin_taylor_fp32(a);\n  cos_t = sqrt(1.0 - sin_t * sin_t);\n}\n\nfloat tan_taylor_fp32(float a) {\n    float sin_a;\n    float cos_a;\n\n    if (a == 0.0) {\n        return 0.0;\n    }\n    float z = floor(a / TWO_PI);\n    float r = a - TWO_PI * z;\n\n    float t;\n    float q = floor(r / PI_2 + 0.5);\n    int j = int(q);\n\n    if (j < -2 || j > 2) {\n        return 1.0 / 0.0;\n    }\n\n    t = r - PI_2 * q;\n\n    q = floor(t / PI_16 + 0.5);\n    int k = int(q);\n    int abs_k = int(abs(float(k)));\n\n    if (abs_k > 4) {\n        return 1.0 / 0.0;\n    } else {\n        t = t - PI_16 * q;\n    }\n\n    float u = 0.0;\n    float v = 0.0;\n\n    float sin_t, cos_t;\n    float s, c;\n    sincos_taylor_fp32(t, sin_t, cos_t);\n\n    if (k == 0) {\n        s = sin_t;\n        c = cos_t;\n    } else {\n        if (abs(float(abs_k) - 1.0) < 0.5) {\n            u = COS_TABLE_0;\n            v = SIN_TABLE_0;\n        } else if (abs(float(abs_k) - 2.0) < 0.5) {\n            u = COS_TABLE_1;\n            v = SIN_TABLE_1;\n        } else if (abs(float(abs_k) - 3.0) < 0.5) {\n            u = COS_TABLE_2;\n            v = SIN_TABLE_2;\n        } else if (abs(float(abs_k) - 4.0) < 0.5) {\n            u = COS_TABLE_3;\n            v = SIN_TABLE_3;\n        }\n        if (k > 0) {\n            s = u * sin_t + v * cos_t;\n            c = u * cos_t - v * sin_t;\n        } else {\n            s = u * sin_t - v * cos_t;\n            c = u * cos_t + v * sin_t;\n        }\n    }\n\n    if (j == 0) {\n        sin_a = s;\n        cos_a = c;\n    } else if (j == 1) {\n        sin_a = c;\n        cos_a = -s;\n    } else if (j == -1) {\n        sin_a = -c;\n        cos_a = s;\n    } else {\n        sin_a = -s;\n        cos_a = -c;\n    }\n    return sin_a / cos_a;\n}\n#endif\n\nfloat tan_fp32(float a) {\n#ifdef LUMA_FP32_TAN_PRECISION_WORKAROUND\n  return tan_taylor_fp32(a);\n#else\n  return tan(a);\n#endif\n}\n",fs:null},r="#define SMOOTH_EDGE_RADIUS 0.5",o={name:"geometry",vs:"\n".concat(r,"\n\nstruct VertexGeometry {\n  vec4 position;\n  vec3 worldPosition;\n  vec3 worldPositionAlt;\n  vec3 normal;\n  vec2 uv;\n  vec3 pickingColor;\n}
2 geometry = VertexGeometry(\n  vec4(0.0, 0.0, 1.0, 0.0),\n  vec3(0.0),\n  vec3(0.0),\n  vec3(0.0),\n  vec2(0.0),\n  vec3(0.0)\n);\n"),fs:"\n".concat(r,"\n\nstruct FragmentGeometry {\n  vec2 uv;\n} geometry;\n\nfloat smoothedge(float edge, float x) {\n  return smoothstep(edge - SMOOTH_EDGE_RADIUS, edge + SMOOTH_EDGE_RADIUS, x);\n}\n")};var s=i(18252);const a=Object.keys(s.Df).map((t=>"const int COORDINATE_SYSTEM_".concat(t," = ").concat(s.Df[t],";"))).join(""),l=Object.keys(s.zG).map((t=>"const int PROJECTION_MODE_".concat(t," = ").concat(s.zG[t],";"))).join(""),c=Object.keys(s.iI).map((t=>"const int UNIT_".concat(t.toUpperCase()," = ").concat(s.iI[t],";"))).join(""),u="".concat(a,"\n").concat(l,"\n").concat(c,'\n\nuniform int project_uCoordinateSystem;\nuniform int project_uProjectionMode;\nuniform float project_uScale;\nuniform bool project_uWrapLongitude;\nuniform vec3 project_uCommonUnitsPerMeter;\nuniform vec3 project_uCommonUnitsPerWorldUnit;\nuniform vec3 project_uCommonUnitsPerWorldUnit2;\nuniform vec4 project_uCenter;\nuniform mat4 project_uModelMatrix;\nuniform mat4 project_uViewProjectionMatrix;\nuniform vec2 project_uViewportSize;\nuniform float project_uDevicePixelRatio;\nuniform float project_uFocalDistance;\nuniform vec3 project_uCameraPosition;\nuniform vec3 project_uCoordinateOrigin;\nuniform vec3 project_uCommonOrigin;\nuniform bool project_uPseudoMeters;\n\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / (PI * 2.0);\nconst vec3 ZERO_64_LOW = vec3(0.0);\nconst float EARTH_RADIUS = 6370972.0; // meters\nconst float GLOBE_RADIUS = 256.0;\n\n// returns an adjustment factor for uCommonUnitsPerMeter\nfloat project_size_at_latitude(float lat) {\n  float y = clamp(lat, -89.9, 89.9);\n  return 1.0 / cos(radians(y));\n}\n\nfloat project_size() {\n  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR &&\n    project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT &&\n    project_uPseudoMeters == false) {\n\n    // uCommonUnitsPerMeter in low-zoom Web Mercator is non-linear\n    // Adjust by 1 / cos(latitude)\n    // If geometry.position (vertex in common space) is populated, use it\n    // Otherwise use geometry.worldPosition (anchor in world space)\n    \n    if (geometry.position.w == 0.0) {\n      return project_size_at_latitude(geometry.worldPosition.y);\n    }\n\n    // latitude from common y: 2.0 * (atan(exp(y / TILE_SIZE * 2.0 * PI - PI)) - PI / 4.0)\n    // Taylor series of 1 / cos(latitude)\n    // Max error < 0.003\n  \n    float y = geometry.position.y / TILE_SIZE * 2.0 - 1.0;\n    float y2 = y * y;\n    float y4 = y2 * y2;\n    float y6 = y4 * y2;\n    return 1.0 + 4.9348 * y2 + 4.0587 * y4 + 1.5642 * y6;\n  }\n  return 1.0;\n}\n\nfloat project_size_at_latitude(float meters, float lat) {\n  return meters * project_uCommonUnitsPerMeter.z * project_size_at_latitude(lat);\n}\n\n//\n// Scaling offsets - scales meters to "world distance"\n// Note the scalar version of project_size is for scaling the z component only\n//\nfloat project_size(float meters) {\n  return meters * project_uCommonUnitsPerMeter.z * project_size();\n}\n\nvec2 project_size(vec2 meters) {\n  return meters * project_uCommonUnitsPerMeter.xy * project_size();\n}\n\nvec3 project_size(vec3 meters) {\n  return meters * project_uCommonUnitsPerMeter * project_size();\n}\n\nvec4 project_size(vec4 meters) {\n  return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w);\n}\n\n// Get rotation matrix that aligns the z axis with the given up vector\n// Find 3 unit vectors ux, uy, uz that are perpendicular to each other and uz == up\nmat3 project_get_orientation_matrix(vec3 up) {\n  vec3 uz = normalize(up);\n  // Tangent on XY plane\n  vec3 ux = abs(uz.z) == 1.0 ? vec3(1.0, 0.0, 0.0) : normalize(vec3(uz.y, -uz.x, 0));\n  vec3 uy = cross(uz, ux);\n  return mat3(ux, uy, uz);\n}\n\nbool project_needs_rotation(vec3 commonPosition, out mat3 transform) {\n  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n    transform = project_get_orientation_matrix(commonPosition);\n    return true;\n  }\n  return false;\n}\n\n//\n// Projecting normal - transform deltas from current coordinate system to\n// normals in the worldspace\n//\nvec3 project_normal(vec3 vector) {\n  // Apply model matrix\n  vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0);\n  vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter);\n  mat3 rotation;\n  if (project_needs_rotation(geometry.position.xyz, rotation)) {\n    n = rotation * n;\n  }\n  return n;\n}\n\nvec4 project_offset_(vec4 offset) {\n  float dy = offset.y;\n  vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy;\n  return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w);\n}\n\n//\n// Projecting positions - non-linear projection: lnglats => unit tile [0-1, 0-1]\n//\nvec2 project_mercator_(vec2 lnglat) {\n  float x = lnglat.x;
2\n  if (project_uWrapLongitude) {\n    x = mod(x + 180., 360.0) - 180.;\n  }\n  float y = clamp(lnglat.y, -89.9, 89.9);\n  return vec2(\n    radians(x) + PI,\n    PI + log(tan_fp32(PI * 0.25 + radians(y) * 0.5))\n  ) * WORLD_SCALE;\n}\n\nvec3 project_globe_(vec3 lnglatz) {\n  float lambda = radians(lnglatz.x);\n  float phi = radians(lnglatz.y);\n  float cosPhi = cos(phi);\n  float D = (lnglatz.z / EARTH_RADIUS + 1.0) * GLOBE_RADIUS;\n\n  return vec3(\n    sin(lambda) * cosPhi,\n    -cos(lambda) * cosPhi,\n    sin(phi)\n  ) * D;\n}\n\n//\n// Projects positions (defined by project_uCoordinateSystem) to common space (defined by project_uProjectionMode)\n//\nvec4 project_position(vec4 position, vec3 position64Low) {\n  vec4 position_world = project_uModelMatrix * position;\n\n  // Work around for a Mac+NVIDIA bug https://github.com/visgl/deck.gl/issues/4145\n  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) {\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      return vec4(\n        project_mercator_(position_world.xy),\n        project_size_at_latitude(position_world.z, position_world.y),\n        position_world.w\n      );\n    }\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) {\n      position_world.xyz += project_uCoordinateOrigin;\n    }\n  }\n  if (project_uProjectionMode == PROJECTION_MODE_GLOBE) {\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      return vec4(\n        project_globe_(position_world.xyz),\n        position_world.w\n      );\n    }\n  }\n  if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n    if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n      if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) {\n        // Too far from the projection center for offset mode to be accurate\n        // Only use high parts\n        return vec4(\n          project_mercator_(position_world.xy) - project_uCommonOrigin.xy,\n          project_size(position_world.z),\n          position_world.w\n        );\n      }\n    }\n  }\n  if (project_uProjectionMode == PROJECTION_MODE_IDENTITY ||\n    (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET &&\n    (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n     project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) {\n    // Subtract high part of 64 bit value. Convert remainder to float32, preserving precision.\n    position_world.xyz -= project_uCoordinateOrigin;\n  }\n\n  // Translation is already added to the high parts\n  return project_offset_(position_world + project_uModelMatrix * vec4(position64Low, 0.0));\n}\n\nvec4 project_position(vec4 position) {\n  return project_position(position, ZERO_64_LOW);\n}\n\nvec3 project_position(vec3 position, vec3 position64Low) {\n  vec4 projected_position = project_position(vec4(position, 1.0), position64Low);\n  return projected_position.xyz;\n}\n\nvec3 project_position(vec3 position) {\n  vec4 projected_position = project_position(vec4(position, 1.0), ZERO_64_LOW);\n  return projected_position.xyz;\n}\n\nvec2 project_position(vec2 position) {\n  vec4 projected_position = project_position(vec4(position, 0.0, 1.0), ZERO_64_LOW);\n  return projected_position.xy;\n}\n\nvec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatrix, vec4 center) {\n  return viewProjectionMatrix * position + center;\n}\n\n//\n// Projects from common space coordinates to clip space.\n// Uses project_uViewProjectionMatrix\n//\nvec4 project_common_position_to_clipspace(vec4 position) {\n  return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter);\n}\n\n// Returns a clip space offset that corresponds to a given number of screen pixels\nvec2 project_pixel_size_to_clipspace(vec2 pixels) {\n  vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0;\n  return offset * project_uFocalDistance;\n}\n\nfloat project_size_to_pixel(float meters) {\n  return project_size(meters) * project_uScale;\n}\nfloat project_size_to_pixel(float size, int unit) {\n  if (unit == UNIT_METERS) return project_size_to_pixel(size);\n  if (unit == UNIT_COMMON) return size * project_uScale;\n  // UNIT_PIXELS\n  return size;\n}\nfloat project_pixel_size(float pixels) {\n  return pixels / project_uScale;\n}
2\nvec2 project_pixel_size(vec2 pixels) {\n  return pixels / project_uScale;\n}\n');var h=i(70487);const d={};const p={name:"project",dependencies:[n,o],vs:u,getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d;return"viewport"in t?(0,h.C)(t):{}}}},70487:(t,e,i)=>{"use strict";i.d(e,{C:()=>A,v:()=>p});var n=i(83367),r=i(62220),o=i(18252),s=i(18188);const a=[0,0,0,0],l=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0],c=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],u=[0,0,0],h=[0,0,0],d=(0,s.Z)((function(t){let{viewport:e,devicePixelRatio:i,coordinateSystem:s,coordinateOrigin:h}=t;const{projectionCenter:d,viewProjectionMatrix:A,originCommon:f,cameraPosCommon:g,shaderCoordinateOrigin:m,geospatialOrigin:y}=function(t,e,i){const{viewMatrixUncentered:o,projectionMatrix:s}=t;let{viewMatrix:c,viewProjectionMatrix:u}=t,h=a,d=a,A=t.cameraPosition;const{geospatialOrigin:f,shaderCoordinateOrigin:g,offsetMode:m}=p(t,e,i);m&&(d=t.projectPosition(f||g),A=[A[0]-d[0],A[1]-d[1],A[2]-d[2]],d[3]=1,h=r.fF([],d,u),c=o||c,u=n.Jp([],s,c),u=n.Jp([],u,l));return{viewMatrix:c,viewProjectionMatrix:u,projectionCenter:h,originCommon:d,cameraPosCommon:A,shaderCoordinateOrigin:g,geospatialOrigin:f}}(e,s,h),v=e.getDistanceScales(),_=[e.width*i,e.height*i],b=r.fF([],[0,0,-e.focalDistance,1],e.projectionMatrix)[3]||1,x={project_uCoordinateSystem:s,project_uProjectionMode:e.projectionMode,project_uCoordinateOrigin:m,project_uCommonOrigin:f.slice(0,3),project_uCenter:d,project_uPseudoMeters:Boolean(e._pseudoMeters),project_uViewportSize:_,project_uDevicePixelRatio:i,project_uFocalDistance:b,project_uCommonUnitsPerMeter:v.unitsPerMeter,project_uCommonUnitsPerWorldUnit:v.unitsPerMeter,project_uCommonUnitsPerWorldUnit2:u,project_uScale:e.scale,project_uWrapLongitude:!1,project_uViewProjectionMatrix:A,project_uModelMatrix:c,project_uCameraPosition:g};if(y){const t=e.getDistanceScales(y);switch(s){case o.Df.METER_OFFSETS:x.project_uCommonUnitsPerWorldUnit=t.unitsPerMeter,x.project_uCommonUnitsPerWorldUnit2=t.unitsPerMeter2;break;case o.Df.LNGLAT:case o.Df.LNGLAT_OFFSETS:e._pseudoMeters||(x.project_uCommonUnitsPerMeter=t.unitsPerMeter),x.project_uCommonUnitsPerWorldUnit=t.unitsPerDegree,x.project_uCommonUnitsPerWorldUnit2=t.unitsPerDegree2;break;case o.Df.CARTESIAN:x.project_uCommonUnitsPerWorldUnit=[1,1,t.unitsPerMeter[2]],x.project_uCommonUnitsPerWorldUnit2=[0,0,t.unitsPerMeter2[2]]}}return x}));function p(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h;i.length<3&&(i=[i[0],i[1],0]);let n,r=i,s=!0;switch(n=e===o.Df.LNGLAT_OFFSETS||e===o.Df.METER_OFFSETS?i:t.isGeospatial?[Math.fround(t.longitude),Math.fround(t.latitude),0]:null,t.projectionMode){case o.zG.WEB_MERCATOR:e!==o.Df.LNGLAT&&e!==o.Df.CARTESIAN||(n=[0,0,0],s=!1);break;case o.zG.WEB_MERCATOR_AUTO_OFFSET:e===o.Df.LNGLAT?r=n:e===o.Df.CARTESIAN&&(r=[Math.fround(t.center[0]),Math.fround(t.center[1]),0],n=t.unprojectPosition(r),r[0]-=i[0],r[1]-=i[1],r[2]-=i[2]);break;case o.zG.IDENTITY:r=t.position.map(Math.fround),r[2]=r[2]||0;break;case o.zG.GLOBE:s=!1,n=null;break;default:s=!1}return{geospatialOrigin:n,shaderCoordinateOrigin:r,offsetMode:s}}function A(t){let{viewport:e,devicePixelRatio:i=1,modelMatrix:n=null,coordinateSystem:r=o.Df.DEFAULT,coordinateOrigin:s=h,autoWrapLongitude:a=!1}=t;r===o.Df.DEFAULT&&(r=e.isGeospatial?o.Df.LNGLAT:o.Df.CARTESIAN);const l=d({viewport:e,devicePixelRatio:i,coordinateSystem:r,coordinateOrigin:s});return l.project_uWrapLongitude=a,l.project_uModelMatrix=n||c,l}},2123:(t,e,i)=>{"use strict";i.d(e,{Z:()=>n});const n={name:"project32",dependencies:[i(66199).Z],vs:"\nvec4 project_position_to_clipspace(\n  vec3 position, vec3 position64Low, vec3 offset, out vec4 commonPosition\n) {\n  vec3 projectedPosition = project_position(position, position64Low);\n  mat3 rotation;\n  if (project_needs_rotation(projectedPosition, rotation)) {\n    // offset is specified as ENU\n    // when in globe projection, rotate offset so that the ground alighs with the surface of the globe\n    offset = rotation * offset;\n  }\n  commonPosition = vec4(projectedPosition + offset, 1.0);\n  return project_common_position_to_clipspace(commonPosition);\n}\n\nvec4 project_position_to_clipspace(\n  vec3 position, vec3 position64Low, vec3 offset\n
2) {\n  vec4 commonPosition;\n  return project_position_to_clipspace(position, position64Low, offset, commonPosition);\n}\n"}},99188:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(64649);class r{constructor(t){(0,n.Z)(this,"_inProgress",void 0),(0,n.Z)(this,"_handle",void 0),(0,n.Z)(this,"_timeline",void 0),(0,n.Z)(this,"time",void 0),(0,n.Z)(this,"settings",void 0),this._inProgress=!1,this._handle=null,this._timeline=t,this.time=0,this.settings={duration:0}}get inProgress(){return this._inProgress}start(t){var e,i;this.cancel(),this.settings=t,this._inProgress=!0,null===(e=(i=this.settings).onStart)||void 0===e||e.call(i,this)}end(){var t,e;this._inProgress&&(this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1,null===(t=(e=this.settings).onEnd)||void 0===t||t.call(e,this))}cancel(){var t,e;this._inProgress&&(null===(t=(e=this.settings).onInterrupt)||void 0===t||t.call(e,this),this._timeline.removeChannel(this._handle),this._handle=null,this._inProgress=!1)}update(){var t,e;if(!this._inProgress)return!1;if(null===this._handle){const{_timeline:t,settings:e}=this;this._handle=t.addChannel({delay:t.getTime(),duration:e.duration})}return this.time=this._timeline.getTime(this._handle),this._onUpdate(),null===(t=(e=this.settings).onUpdate)||void 0===t||t.call(e,this),this._timeline.isFinished(this._handle)&&this.end(),!0}_onUpdate(){}}},12997:(t,e,i)=>{"use strict";function n(t,e){if(!t)throw new Error(e||"deck.gl: assertion failed.")}i.d(e,{Z:()=>n})},98949:(t,e,i)=>{"use strict";function n(t,e){if(t===e)return!0;if(!t||!e)return!1;for(const i in t){const r=t[i],o=e[i];if(!(r===o||Array.isArray(r)&&Array.isArray(o)&&n(r,o)))return!1}return!0}i.d(e,{v:()=>n})},18757:(t,e,i)=>{"use strict";function n(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>!0;return Array.isArray(t)?r(t,e,[]):e(t)?[t]:[]}function r(t,e,i){let n=-1;for(;++n<t.length;){const o=t[n];Array.isArray(o)?r(o,e,i):e(o)&&i.push(o)}return i}function o(t){let{target:e,source:i,start:n=0,count:r=1}=t;const o=i.length,s=r*o;let a=0;for(let l=n;a<o;a++)e[l++]=i[a];for(;a<s;)a<s-a?(e.copyWithin(n+a,n,n+a),a*=2):(e.copyWithin(n+a,n,n+s-a),a=s);return e}i.d(e,{k:()=>o,x:()=>n})},73115:(t,e,i)=>{"use strict";i.d(e,{D0:()=>s,jB:()=>o,jr:()=>a});const n=[],r=[];function o(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,o=n;const s={index:-1,data:t,target:[]};return t?"function"===typeof t[Symbol.iterator]?o=t:t.length>0&&(r.length=t.length,o=r):o=n,(e>0||Number.isFinite(i))&&(o=(Array.isArray(o)?o:Array.from(o)).slice(e,i),s.index=e-1),{iterable:o,objectInfo:s}}function s(t){return t&&t[Symbol.asyncIterator]}function a(t,e){const{size:i,stride:n,offset:r,startIndices:o,nested:s}=e,a=t.BYTES_PER_ELEMENT,l=n?n/a:i,c=r?r/a:0,u=Math.floor((t.length-c)/l);return(e,n)=>{let{index:r,target:a}=n;if(!o){const e=r*l+c;for(let n=0;n<i;n++)a[n]=t[e+n];return a}const h=o[r],d=o[r+1]||u;let p;if(s){p=new Array(d-h);for(let e=h;e<d;e++){const n=e*l+c;a=new Array(i);for(let e=0;e<i;e++)a[e]=t[n+e];p[e-h]=a}}else if(l===i)p=t.subarray(h*i+c,d*i+c);else{p=new t.constructor((d-h)*i);let e=0;for(let n=h;n<d;n++){const r=n*l+c;for(let n=0;n<i;n++)p[e++]=t[r+n]}}return p}}},21970:(t,e,i)=>{"use strict";i.d(e,{Z:()=>n});const n=new(i(87294).Z)({id:"deck"})},64441:(t,e,i)=>{"use strict";i.d(e,{Du:()=>l,Ks:()=>h,TK:()=>p,Xt:()=>a,bS:()=>o,wQ:()=>s});var n=i(28321),r=i(431);function o(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(t,e){const i=t%e;return i<0?e+i:i}function a(t){return[t[12],t[13],t[14]]}function l(t){return{left:u(t[3]+t[0],t[7]+t[4],t[11]+t[8],t[15]+t[12]),right:u(t[3]-t[0],t[7]-t[4],t[11]-t[8],t[15]-t[12]),bottom:u(t[3]+t[1],t[7]+t[5],t[11]+t[9],t[15]+t[13]),top:u(t[3]-t[1],t[7]-t[5],t[11]-t[9],t[15]-t[13]),near:u(t[3]+t[2],t[7]+t[6],t[11]+t[10],t[15]+t[14]),far:u(t[3]-t[2],t[7]-t[6],t[11]-t[10],t[15]-t[14])}}const c=new r.Z;function u(t,e,i,n){c.set(t,e,i);const o=c.len();return{distance:n/o,normal:new r.Z(-t/o,-e/o,-i/o)}}function h(t){return t-Math.fround(t)}let d;function p(t,e){const{size:i=1,startIndex:r=0}=e,o=void 0!==e.endIndex?e.endIndex:t.length,s=(o-r)/i;d=n.Z.allocate(d,s,{type:Float32Array,size:2*i});let a=r,l=0;for(;a<o;){for(let e=0;e<i;e++){const n=t[a++];d[l+e]=n,d[l+e+i]=h(n)}l+=2*i}return d.subarray(0,s*i*2)}},18188:(t,e,i)=>{"use strict";function n(t,e){if(t===e)return!0;
vendor: 15,226 bytes, line 2
2if(Array.isArray(t)){const i=t.length;if(!e||e.length!==i)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}return!1}function r(t){let e,i={};return r=>{for(const o in r)if(!n(r[o],i[o])){e=t(r),i=r;break}return e}}i.d(e,{Z:()=>r})},46802:(t,e,i)=>{"use strict";function n(t,e){if(!e)return t;const i={...t,...e};if("defines"in e&&(i.defines={...t.defines,...e.defines}),"modules"in e&&(i.modules=(t.modules||[]).concat(e.modules),e.modules.some((t=>"project64"===t.name)))){const t=i.modules.findIndex((t=>"project32"===t.name));t>=0&&i.modules.splice(t,1)}if("inject"in e)if(t.inject){const n={...t.inject};for(const t in e.inject)n[t]=(n[t]||"")+e.inject[t];i.inject=n}else i.inject=e.inject;return i}i.d(e,{l:()=>n})},55678:(t,e,i)=>{"use strict";i.d(e,{Z:()=>l});var n=i(64649),r=i(73115),o=i(28321),s=i(12997),a=i(33839);class l{constructor(t){(0,n.Z)(this,"opts",void 0),(0,n.Z)(this,"typedArrayManager",void 0),(0,n.Z)(this,"indexStarts",[0]),(0,n.Z)(this,"vertexStarts",[0]),(0,n.Z)(this,"vertexCount",0),(0,n.Z)(this,"instanceCount",0),(0,n.Z)(this,"attributes",void 0),(0,n.Z)(this,"_attributeDefs",void 0),(0,n.Z)(this,"data",void 0),(0,n.Z)(this,"getGeometry",void 0),(0,n.Z)(this,"geometryBuffer",void 0),(0,n.Z)(this,"buffers",void 0),(0,n.Z)(this,"positionSize",void 0),(0,n.Z)(this,"normalize",void 0);const{attributes:e={}}=t;this.typedArrayManager=o.Z,this.attributes={},this._attributeDefs=e,this.opts=t,this.updateGeometry(t)}updateGeometry(t){Object.assign(this.opts,t);const{data:e,buffers:i={},getGeometry:n,geometryBuffer:r,positionFormat:o,dataChanged:a,normalize:l=!0}=this.opts;if(this.data=e,this.getGeometry=n,this.positionSize=r&&r.size||("XY"===o?2:3),this.buffers=i,this.normalize=l,r&&((0,s.Z)(e.startIndices),this.getGeometry=this.getGeometryFromBuffer(r),l||(i.positions=r)),this.geometryBuffer=i.positions,Array.isArray(a))for(const s of a)this._rebuildGeometry(s);else this._rebuildGeometry()}updatePartialGeometry(t){let{startRow:e,endRow:i}=t;this._rebuildGeometry({startRow:e,endRow:i})}getGeometryFromBuffer(t){const e=t.value||t;return ArrayBuffer.isView(e)?(0,r.jr)(e,{size:this.positionSize,offset:t.offset,stride:t.stride,startIndices:this.data.startIndices}):null}_allocate(t,e){const{attributes:i,buffers:n,_attributeDefs:r,typedArrayManager:o}=this;for(const s in r)if(s in n)o.release(i[s]),i[s]=null;else{const n=r[s];n.copy=e,i[s]=o.allocate(i[s],t,n)}}_forEachGeometry(t,e,i){const{data:n,getGeometry:o}=this,{iterable:s,objectInfo:a}=(0,r.jB)(n,e,i);for(const r of s){a.index++;t(o?o(r,a):null,a.index)}}_rebuildGeometry(t){if(!this.data)return;let{indexStarts:e,vertexStarts:i,instanceCount:n}=this;const{data:r,geometryBuffer:o}=this,{startRow:s=0,endRow:l=1/0}=t||{},c={};if(t||(e=[0],i=[0]),this.normalize||!o)this._forEachGeometry(((t,e)=>{const n=t&&this.normalizeGeometry(t);c[e]=n,i[e+1]=i[e]+(n?this.getGeometrySize(n):0)}),s,l),n=i[i.length-1];else if(i=r.startIndices,n=i[r.length]||0,ArrayBuffer.isView(o))n=n||o.length/this.positionSize;else if(o instanceof a.Z){const t=o.accessor.stride||4*this.positionSize;n=n||o.byteLength/t}else if(o.buffer){const t=o.stride||4*this.positionSize;n=n||o.buffer.byteLength/t}else if(o.value){const t=o.value,e=o.stride/t.BYTES_PER_ELEMENT||this.positionSize;n=n||t.length/e}this._allocate(n,Boolean(t)),this.indexStarts=e,this.vertexStarts=i,this.instanceCount=n;const u={};this._forEachGeometry(((t,r)=>{const o=c[r]||t;u.vertexStart=i[r],u.indexStart=e[r];const s=r<i.length-1?i[r+1]:n;u.geometrySize=s-i[r],u.geometryIndex=r,this.updateGeometryAttributes(o,u)}),s,l),this.vertexCount=e[e.length-1]}}},28321:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(64649);const r=new class{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.Z)(this,"_pool",[]),(0,n.Z)(this,"opts",{overAlloc:2,poolSize:100}),this.setOptions(t)}setOptions(t){Object.assign(this.opts,t)}allocate(t,e,i){let{size:n=1,type:r,padding:o=0,copy:s=!1,initialize:a=!1,maxCount:l}=i;const c=r||t&&t.constructor||Float32Array,u=e*n+o;if(ArrayBuffer.isView(t)){if(u<=t.length)return t;if(u*t.BYTES_PER_ELEMENT<=t.buffer.byteLength)return new c(t.buffer,0,u)}let h=1/0;l&&(h=l*n+o);const d=this._allocate(c,u,a,h);return t&&s?d.set(t):a||d.fill(0,0,4),this._release(t),d}release(t){this._release(t)}_allocate(t,e,i,n){let r=Math.max(Math.ceil(e*this.opts.overAlloc),1);r>n&&(r=n);const o=this._pool,s=t.BYTES_PER_ELEMENT*r,a=o.findIndex((t=>t.byteLength>=s));if(a>=0){const e=new t(o.splice(a,1)[0],0,r);return i&&e.fill(0),e}return new t(r)}_release(t){if(!ArrayBuffer.isView(t))return;const e=this._pool,{buffer:i}=t,{byteLength:n}=i,r=e.findIndex((t=>t.byteLength>=n));r<0?e.push(i):(r>0||e.length<this.opts.poolSize)&&e.splice(r,0,i),e.length>this.opts.poolSize&&e.shift()}}},83427:(t,e,i)=>{"use strict";i.d(e,{Z:()=>g});var n=i(64649),r=i(21970),o=i(64441),s=i(12987),a=i(47410),l=i(431),c=i(83367),u=i(75818),h=i(18252);const d=Math.PI/180,p=(0,o.bS)(),A=[0,0,0],f={unitsPerMeter:[1,1,1],metersPerUnit:[1,1,1]};class g{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,n.Z)(this,"id",void 0),(0,n.Z)(this,"x",void 0),(0,n.Z)(this,"y",void 0),(0,n.Z)(this,"width",void 0),(0,n.Z)(this,"height",void 0),(0,n.Z)(this,"padding",void 0),(0,n.Z)(this,"isGeospatial",void 0),(0,n.Z)(this,"zoom",void 0),(0,n.Z)(this,"focalDistance",void 0),(0,n.Z)(this,"position",void 0),(0,n.Z)(this,"modelMatrix",void 0),(0,n.Z)(this,"distanceScales",void 0),(0,n.Z)(this,"scale",void 0),(0,n.Z)(this,"center",void 0),(0,n.Z)(this,"cameraPosition",void 0),(0,n.Z)(this,"projectionMatrix",void 0),(0,n.Z)(this,"viewMatrix",void 0),(0,n.Z)(this,"viewMatrixUncentered",void 0),(0,n.Z)(this,"viewMatrixInverse",void 0),(0,n.Z)(this,"viewProjectionMatrix",void 0),(0,n.Z)(this,"pixelProjectionMatrix",void 0),(0,n.Z)(this,"pixelUnprojectionMatrix",void 0),(0,n.Z)(this,"resolution",void 0),(0,n.Z)(this,"_frustumPlanes",{}),this.id=t.id||this.constructor.displayName||"viewport",this.x=t.x||0,this.y=t.y||0,this.width=t.width||1,this.height=t.height||1,this.zoom=t.zoom||0,this.padding=t.padding,this.distanceScales=t.distanceScales||f,this.focalDistance=t.focalDistance||1,this.position=t.position||A,this.modelMatrix=t.modelMatrix||null;const{longitude:e,latitude:i}=t;this.isGeospatial=Number.isFinite(i)&&Number.isFinite(e),this._initProps(t),this._initMatrices(t),this.equals=this.equals.bind(this),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.projectPosition=this.projectPosition.bind(this),this.unprojectPosition=this.unprojectPosition.bind(this),this.projectFlat=this.projectFlat.bind(this),this.unprojectFlat=this.unprojectFlat.bind(this)}get metersPerPixel(){return this.distanceScales.metersPerUnit[2]/this.scale}get projectionMode(){return this.isGeospatial?this.zoom<12?h.zG.WEB_MERCATOR:h.zG.WEB_MERCATOR_AUTO_OFFSET:h.zG.IDENTITY}equals(t){return t instanceof g&&(this===t||t.width===this.width&&t.height===this.height&&t.scale===this.scale&&(0,a.fS)(t.projectionMatrix,this.projectionMatrix)&&(0,a.fS)(t.viewMatrix,this.viewMatrix))}project(t){let{topLeft:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=this.projectPosition(t),n=(0,u.aW)(i,this.pixelProjectionMatrix),[r,o]=n,s=e?o:this.height-o;return 2===t.length?[r,s]:[r,s,n[2]]}unproject(t){let{topLeft:e=!0,targetZ:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,r,o]=t,s=e?r:this.height-r,a=i&&i*this.distanceScales.unitsPerMeter[2],l=(0,u.CT)([n,s,o],this.pixelUnprojectionMatrix,a),[c,h,d]=this.unprojectPosition(l);return Number.isFinite(o)?[c,h,d]:Number.isFinite(i)?[c,h,i]:[c,h]}projectPosition(t){const[e,i]=this.projectFlat(t);return[e,i,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]}unprojectPosition(t){const[e,i]=this.unprojectFlat(t);return[e,i,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}projectFlat(t){if(this.isGeospatial){const e=(0,u.w5)(t);return e[1]=(0,a.uZ)(e[1],-318,830),e}return t}unprojectFlat(t){return this.isGeospatial?(0,u.es)(t):t}getBounds(){const t={targetZ:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0},e=this.unproject([0,0],t),i=this.unproject([this.width,0],t),n=this.unproject([0,this.height],t),r=this.unproject([this.width,this.height],t);return[Math.min(e[0],i[0],n[0],r[0]),Math.min(e[1],i[1],n[1],r[1]),Math.max(e[0],i[0],n[0],r[0]),Math.max(e[1],i[1],n[1],r[1])]}getDistanceScales(t){return t?(0,u.ro)({longitude:t[0],latitude:t[1],highPrecision:!0}):this.distanceScales}containsPixel(t){let{x:e,y:i,width:n=1,height:r=1}=t;return e<this.x+this.width&&this.x<e+n&&i<this.y+this.height&&this.y<i+r}getFrustumPlanes(){return this._frustumPlanes.near||Object.assign(this._frustumPlanes,(0,o.Du)(this.viewProjectionMatrix)),this._frustumPlanes}panByPosition(t,e){return null}_initProps(t){const e=t.longitude,i=t.latitude;this.isGeospatial&&(Number.isFinite(t.zoom)||(this.zoom=(0,u.Bf)({latitude:i})+Math.log2(this.focalDistance)),this.distanceScales=t.distanceScales||(0,u.ro)({latitude:i,longitude:e}));const n=Math.pow(2,this.zoom);this.scale=n;const{position:r,modelMatrix:o}=t;let a=A;if(r&&(a=o?new s.Z(o).transformAsVector(r,[]):r),this.isGeospatial){const t=this.projectPosition([e,i,0]);this.center=new l.Z(a).scale(this.distanceScales.unitsPerMeter).add(t)}else this.center=this.projectPosition(a)}_initMatrices(t){const{viewMatrix:e=p,projectionMatrix:i=null,orthographic:n=!1,fovyRadians:u,fovy:h=75,near:A=.1,far:f=1e3,padding:g=null,focalDistance:m=1}=t;this.viewMatrixUncentered=e,this.viewMatrix=(new s.Z).multiplyRight(e).translate(new l.Z(this.center).negate()),this.projectionMatrix=i||function(t){let{width:e,height:i,orthographic:n,fovyRadians:r,focalDistance:o,padding:l,near:c,far:u}=t;const h=e/i,d=n?(new s.Z).orthographic({fovy:r,aspect:h,focalDistance:o,near:c,far:u}):(new s.Z).perspective({fovy:r,aspect:h,near:c,far:u});if(l){const{left:t=0,right:n=0,top:r=0,bottom:o=0}=l,s=(0,a.uZ)((t+e-n)/2,0,e)-e/2,c=(0,a.uZ)((r+i-o)/2,0,i)-i/2;d[8]-=2*s/e,d[9]+=2*c/i}return d}({width:this.width,height:this.height,orthographic:n,fovyRadians:u||h*d,focalDistance:m,padding:g,near:A,far:f});const y=(0,o.bS)();c.Jp(y,y,this.projectionMatrix),c.Jp(y,y,this.viewMatrix),this.viewProjectionMatrix=y,this.viewMatrixInverse=c.U_([],this.viewMatrix)||this.viewMatrix,this.cameraPosition=(0,o.Xt)(this.viewMatrixInverse);const v=(0,o.bS)(),_=(0,o.bS)();c.bA(v,v,[this.width/2,-this.height/2,1]),c.Iu(v,v,[1,-1,0]),c.Jp(_,v,this.viewProjectionMatrix),this.pixelProjectionMatrix=_,this.pixelUnprojectionMatrix=c.U_((0,o.bS)(),this.pixelProjectionMatrix),this.pixelUnprojectionMatrix||r.Z.warn("Pixel project matrix not invertible")()}}(0,n.Z)(g,"displayName","Viewport")},52310:(t,e,i)=>{"use strict";i.d(e,{Z:()=>u});var n=i(64649),r=i(83427),o=i(75818),s=i(77548),a=i(12987);const l=Math.PI/180;function c(t){return 512/4003e4/Math.cos(t*l)}class u extends r.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{latitude:e=0,longitude:i=0,zoom:r=0,pitch:s=0,bearing:l=0,nearZMultiplier:c=.1,farZMultiplier:u=1.01,orthographic:h=!1,projectionMatrix:d,repeat:p=!1,worldOffset:A=0,legacyMeterSizes:f=!1}=t;let{width:g,height:m,altitude:y=1.5}=t;const v=Math.pow(2,r);let _;g=g||1,m=m||1;let b=null;d?(y=d[5]/2,_=(0,o.Lu)(y)):(t.fovy?(_=t.fovy,y=(0,o.sj)(_)):_=(0,o.Lu)(y),b=(0,o.wl)({width:g,height:m,pitch:s,fovy:_,nearZMultiplier:c,farZMultiplier:u}));let x=(0,o.lf)({height:m,pitch:s,bearing:l,scale:v,altitude:y});if(A){x=(new a.Z).translate([512*A,0,0]).multiplyLeft(x)}super({...t,width:g,height:m,viewMatrix:x,longitude:i,latitude:e,zoom:r,...b,fovy:_,focalDistance:y}),(0,n.Z)(this,"longitude",void 0),(0,n.Z)(this,"latitude",void 0),(0,n.Z)(this,"pitch",void 0),(0,n.Z)(this,"bearing",void 0),(0,n.Z)(this,"altitude",void 0),(0,n.Z)(this,"fovy",void 0),(0,n.Z)(this,"orthographic",void 0),(0,n.Z)(this,"_subViewports",void 0),(0,n.Z)(this,"_pseudoMeters",void 0),this.latitude=e,this.longitude=i,this.zoom=r,this.pitch=s,this.bearing=l,this.altitude=y,this.fovy=_,this.orthographic=h,this._subViewports=p?[]:null,this._pseudoMeters=f,Object.freeze(this)}get subViewports(){if(this._subViewports&&!this._subViewports.length){const t=this.getBounds(),e=Math.floor((t[0]+180)/360),i=Math.ceil((t[2]-180)/360);for(let n=e;n<=i;n++){const t=n?new u({...this,worldOffset:n}):this;this._subViewports.push(t)}}return this._subViewports}projectPosition(t){if(this._pseudoMeters)return super.projectPosition(t);const[e,i]=this.projectFlat(t);return[e,i,(t[2]||0)*c(t[1])]}unprojectPosition(t){if(this._pseudoMeters)return super.unprojectPosition(t);const[e,i]=this.unprojectFlat(t);return[e,i,(t[2]||0)/c(i)]}addMetersToLngLat(t,e){return(0,o.eG)(t,e)}panByPosition(t,e){const i=(0,o.CT)(e,this.pixelUnprojectionMatrix),n=this.projectFlat(t),r=s.IH([],n,s.tk([],i)),a=s.IH([],this.center,r),[l,c]=this.unprojectFlat(a);return{longitude:l,latitude:c}}getBounds(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=(0,o.zX)(this,t.z||0);return[Math.min(e[0][0],e[1][0],e[2][0],e[3][0]),Math.min(e[0][1],e[1][1],e[2][1],e[3][1]),Math.max(e[0][0],e[1][0],e[2][0],e[3][0]),Math.max(e[0][1],e[1][1],e[2][1],e[3][1])]}fitBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:i,height:n}=this,{longitude:r,latitude:s,zoom:a}=(0,o.Xg)({width:i,height:n,bounds:t,...e});return new u({width:i,height:n,longitude:r,latitude:s,zoom:a})}}(0,n.Z)(u,"displayName","WebMercatorViewport")},44948:(t,e,i)=>{"use strict";i.r(e),i.d(e,{GeohashLayer:()=>Yu,GreatCircleLayer:()=>d,H3ClusterLayer:()=>Mi,H3HexagonLayer:()=>Ti,MVTLayer:()=>Nu,QuadkeyLayer:()=>F,S2Layer:()=>P,TerrainLayer:()=>Ec,Tile3DLayer:()=>_c,TileLayer:()=>Ne,TripsLayer:()=>Ze,_GeoCellLayer:()=>g,_Tile2DHeader:()=>U,_Tileset2D:()=>Re,_getURLFromTemplate:()=>be});var n={};i.r(n),i.d(n,{decode:()=>Ua,name:()=>za});var r={};i.r(r),i.d(r,{name:()=>Ha,preprocess:()=>Ja});var o={};i.r(o),i.d(o,{name:()=>Qa,preprocess:()=>qa});var s={};i.r(s),i.d(s,{decode:()=>tl,encode:()=>el,name:()=>Ya,preprocess:()=>$a});var a={};i.r(a),i.d(a,{decode:()=>al,encode:()=>ll,name:()=>sl});var l={};i.r(l),i.d(l,{decode:()=>hl,encode:()=>dl,name:()=>ul});var c={};i.r(c),i.d(c,{decode:()=>fl,encode:()=>gl,name:()=>Al});var u=i(64649),h=i(73351);class d extends h.Z{}(0,u.Z)(d,"layerName","GreatCircleLayer"),(0,u.Z)(d,"defaultProps",{getHeight:{type:"accessor",value:0},greatCircle:!0});var p=i(79366),A=i(94300);const f={...A.Z.defaultProps};class g extends p.Z{indexToBounds(){return null}renderLayers(){const{elevationScale:t,extruded:e,wireframe:i,filled:n,stroked:r,lineWidthUnits:o,lineWidthScale:s,lineWidthMinPixels:a,lineWidthMaxPixels:l,lineJointRounded:c,lineMiterLimit:u,lineDashJustified:h,getElevation:d,getFillColor:p,getLineColor:f,getLineWidth:g}=this.props,{updateTriggers:m,material:y,transitions:v}=this.props;return new(this.getSubLayerClass("cell",A.Z))({filled:n,wireframe:i,extruded:e,elevationScale:t,stroked:r,lineWidthUnits:o,lineWidthScale:s,lineWidthMinPixels:a,lineWidthMaxPixels:l,lineJointRounded:c,lineMiterLimit:u,lineDashJustified:h,material:y,transitions:v,getElevation:d,getFillColor:p,getLineColor:f,getLineWidth:g}
2,this.getSubLayerProps({id:"cell",updateTriggers:m&&{getElevation:m.getElevation,getFillColor:m.getFillColor,getLineColor:m.getLineColor,getLineWidth:m.getLineWidth}}),this.indexToBounds())}}(0,u.Z)(g,"layerName","GeoCellLayer"),(0,u.Z)(g,"defaultProps",f);var m=i(84977),y=i.n(m);const v=3,_=61,b=180/Math.PI;function x(t,e,i){const n=1<<e;return[(t[0]+i[0])/n,(t[1]+i[1])/n]}function w(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function C(t){return[w(t[0]),w(t[1])]}function B(t,e){let[i,n]=e;switch(t){case 0:return[1,i,n];case 1:return[-i,1,n];case 2:return[-i,-n,1];case 3:return[-1,-n,-i];case 4:return[n,-1,-i];case 5:return[n,i,-1];default:throw new Error("Invalid face")}}function E(t){let[e,i,n]=t;const r=Math.atan2(n,Math.sqrt(e*e+i*i));return[Math.atan2(i,e)*b,r*b]}function S(t,e,i,n){if(0===n){1===i&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);const n=e[0];e[0]=e[1],e[1]=n}}const T=100;function M(t){if("string"===typeof t){if(t.indexOf("/")>0)return t;t=function(t){const e=t.padEnd(16,"0");return y().fromString(e,16)}(t)}return function(t){let e=y().fromString(t,!0,10).toString(2);for(;e.length<v+_;)e="0"+e;const i=e.lastIndexOf("1"),n=e.substring(0,3),r=e.substring(3,i),o=r.length/2,s=y().fromString(n,!0,2).toString(10);let a=y().fromString(r,!0,2).toString(4);for(;a.length<o;)a="0"+a;return"".concat(s,"/").concat(a)}(t.toString())}function I(t){const e=function(t){const e=t.split("/"),i=parseInt(e[0],10),n=e[1],r=n.length,o=[0,0];let s;for(let a=r-1;a>=0;a--){s=r-a;const t=n[a];let e=0,i=0;"1"===t?i=1:"2"===t?(e=1,i=1):"3"===t&&(e=1);const l=Math.pow(2,s-1);S(l,o,e,i),o[0]+=l*e,o[1]+=l*i}if(i%2===1){const t=o[0];o[0]=o[1],o[1]=t}return{face:i,ij:o,level:s}}(M(t));return function(t){let{face:e,ij:i,level:n}=t;const r=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(T*Math.pow(2,-n))),s=new Float64Array(4*o*2+2);let a=0,l=0;for(let c=0;c<4;c++){const t=r[c].slice(0),u=r[c+1],h=(u[0]-t[0])/o,d=(u[1]-t[1])/o;for(let r=0;r<o;r++){t[0]+=h,t[1]+=d;const r=E(B(e,C(x(i,n,t))));Math.abs(r[1])>89.999&&(r[0]=l);const o=r[0]-l;r[0]+=o>180?-360:o<-180?360:0,s[a++]=r[0],s[a++]=r[1],l=r[0]}}return s[a++]=s[0],s[a++]=s[1],s}(e)}class P extends g{indexToBounds(){const{data:t,getS2Token:e}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,i)=>I(e(t,i))}}}(0,u.Z)(P,"layerName","S2Layer"),(0,u.Z)(P,"defaultProps",{getS2Token:{type:"accessor",value:t=>t.token}});var D=i(75818);const L=512;function O(t){const[e,i]=function(t){let e=0,i=0,n=1<<t.length;const r=n/L;for(let o=0;o<t.length;o++){n>>=1;const r=parseInt(t[o]);r%2&&(e|=n),r>1&&(i|=n)}return[[e/r,L-i/r],[(e+.99)/r,L-(i+.99)/r]]}(t),[n,r]=(0,D.es)(e),[o,s]=(0,D.es)(i);return[o,r,o,s,n,s,n,r,o,r]}class F extends g{indexToBounds(){const{data:t,getQuadkey:e}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,i)=>O(e(t,i))}}}(0,u.Z)(F,"layerName","QuadkeyLayer"),(0,u.Z)(F,"defaultProps",{getQuadkey:{type:"accessor",value:t=>t.quadkey}});var R=i(18757),k=i(43610),z=i(21970);class U{constructor(t){(0,u.Z)(this,"index",void 0),(0,u.Z)(this,"isVisible",void 0),(0,u.Z)(this,"isSelected",void 0),(0,u.Z)(this,"parent",void 0),(0,u.Z)(this,"children",void 0),(0,u.Z)(this,"content",void 0),(0,u.Z)(this,"state",void 0),(0,u.Z)(this,"layers",void 0),(0,u.Z)(this,"id",void 0),(0,u.Z)(this,"bbox",void 0),(0,u.Z)(this,"zoom",void 0),(0,u.Z)(this,"userData",void 0),(0,u.Z)(this,"_abortController",void 0),(0,u.Z)(this,"_loader",void 0),(0,u.Z)(this,"_loaderId",void 0),(0,u.Z)(this,"_isLoaded",void 0),(0,u.Z)(this,"_isCancelled",void 0),(0,u.Z)(this,"_needsReload",void 0),this.index=t,this.isVisible=!1,this.isSelected=!1,this.parent=null,this.children=[],this.content=null,this._loader=void 0,this._abortController=null,this._loaderId=0,this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1}get data(){return this.isLoading&&this._loader?this._loader.then((()=>this.data)):this.content}get isLoaded(){return this._isLoaded&&!this._needsReload}get isLoading(){return Boolean(this._loader)&&!this._isCancelled}get needsReload(){return this._needsReload||this._isCancelled}get byteLength(){const t=this.content?this.content.byteLength:0;return Number.isFinite(t)||z.Z.error("byteLength not defined in tile data")(),t}async _loadData(t){let{getData:e,requestScheduler:i,onLoad:n,onError:r}=t;const{index:o,id:s,bbox:a,userData:l,zoom:c}=this,u=this._loaderId;this._abortController=new AbortController;const{signal:h}=this._abortController,d=await i.scheduleRequest(this,(t=>t.isSelected?1:-1));if(!d)return void(this._isCancelled=!0);if(this._isCancelled)return void d.done();let p,A=null;try{A=await e({index:o,id:s,bbox:a,userData:l,zoom:c,signal:h})}catch(f){p=f||!0}finally{d.done()}u===this._loaderId&&(this._loader=void 0,this.content=A,!this._isCancelled||A?(this._isLoaded=!0,this._isCancelled=!1,p?r(p,this):n(this)):this._isLoaded=!1)}loadData(t){return this._isLoaded=!1,this._isCancelled=!1,this._needsReload=!1,this._loaderId++,this._loader=this._loadData(t),this._loader}setNeedsReload(){this.isLoading&&(this.abort(),this._loader=void 0),this._needsReload=!0}abort(){var t;this.isLoaded||(this._isCancelled=!0,null===(t=this._abortController)||void 0===t||t.abort())}}var N=i(12987),G=i(83427),Z=i(18252),j=i(99007),V=i(62220);const H=Math.PI/180,J=180/Math.PI,W=6370972,Q=256;function q(){const t=4018225162502676e-20,e=Math.PI/180*Q;
vendor: 6,142 bytes, line 2
2return{unitsPerMeter:[t,t,t],unitsPerMeter2:[0,0,0],metersPerUnit:[24886.609375,24886.609375,24886.609375],unitsPerDegree:[e,e,t],unitsPerDegree2:[0,0,0],degreesPerUnit:[1/e,1/e,24886.609375]}}class K extends G.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{latitude:e=0,longitude:i=0,zoom:n=0,nearZMultiplier:r=.1,farZMultiplier:o=2,resolution:s=10}=t;let{height:a,altitude:l=1.5}=t;a=a||1,l=Math.max(.75,l);const c=(new N.Z).lookAt({eye:[0,-l,0],up:[0,0,1]}),h=Math.pow(2,n);c.rotateX(e*H),c.rotateZ(-i*H),c.scale(h/a);const d=Math.atan(.5/l),p=512*h/a;super({...t,height:a,viewMatrix:c,longitude:i,latitude:e,zoom:n,distanceScales:q(),fovyRadians:2*d,focalDistance:l,near:r,far:Math.min(2,1/p+1)*l*o}),(0,u.Z)(this,"longitude",void 0),(0,u.Z)(this,"latitude",void 0),(0,u.Z)(this,"resolution",void 0),this.latitude=e,this.longitude=i,this.resolution=s}get projectionMode(){return Z.zG.GLOBE}getDistanceScales(){return this.distanceScales}getBounds(){const t={targetZ:(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0},e=this.unproject([0,this.height/2],t),i=this.unproject([this.width/2,0],t),n=this.unproject([this.width,this.height/2],t),r=this.unproject([this.width/2,this.height],t);return n[0]<this.longitude&&(n[0]+=360),e[0]>this.longitude&&(e[0]-=360),[Math.min(e[0],n[0],i[0],r[0]),Math.min(e[1],n[1],i[1],r[1]),Math.max(e[0],n[0],i[0],r[0]),Math.max(e[1],n[1],i[1],r[1])]}unproject(t){let{topLeft:e=!0,targetZ:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const[n,r,o]=t,s=e?r:this.height-r,{pixelUnprojectionMatrix:a}=this;let l;if(Number.isFinite(o))l=X(a,[n,s,o,1]);else{const t=X(a,[n,s,-1,1]),e=X(a,[n,s,1,1]),r=((i||0)/W+1)*Q,o=j.x9(j.lu([],t,e)),c=j.x9(t),u=j.x9(e),h=4*((4*c*u-(o-c-u)**2)/16)/o,d=(Math.sqrt(c-h)-Math.sqrt(Math.max(0,r*r-h)))/Math.sqrt(o);l=j.t7([],t,e,d)}const[c,u,h]=this.unprojectPosition(l);return Number.isFinite(o)?[c,u,h]:Number.isFinite(i)?[c,u,i]:[c,u]}projectPosition(t){const[e,i,n=0]=t,r=e*H,o=i*H,s=Math.cos(o),a=(n/W+1)*Q;return[Math.sin(r)*s*a,-Math.cos(r)*s*a,Math.sin(o)*a]}unprojectPosition(t){const[e,i,n]=t,r=j.Zh(t),o=Math.asin(n/r);return[Math.atan2(e,-i)*J,o*J,(r/Q-1)*W]}projectFlat(t){return t}unprojectFlat(t){return t}panByPosition(t,e){const i=this.unproject(e);return{longitude:t[0]-i[0]+this.longitude,latitude:t[1]-i[1]+this.latitude}}}function X(t,e){const i=V.fF([],e,t);return V.bA(i,i,1/i[3]),i}var Y=i(52310);const $=-1,tt=0,et=1;var it=i(431);const nt=new it.Z,rt=new it.Z;class ot{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0],i=arguments.length>2?arguments[2]:void 0;(0,u.Z)(this,"center",void 0),(0,u.Z)(this,"halfDiagonal",void 0),(0,u.Z)(this,"minimum",void 0),(0,u.Z)(this,"maximum",void 0),i=i||nt.copy(t).add(e).scale(.5),this.center=new it.Z(i),this.halfDiagonal=new it.Z(e).subtract(this.center),this.minimum=new it.Z(t),this.maximum=new it.Z(e)}clone(){return new ot(this.minimum,this.maximum,this.center)}equals(t){return this===t||Boolean(t)&&this.minimum.equals(t.minimum)&&this.maximum.equals(t.maximum)}transform(t){return this.center.transformAsPoint(t),this.halfDiagonal.transform(t),this.minimum.transform(t),this.maximum.transform(t),this}intersectPlane(t){const{halfDiagonal:e}=this,i=rt.from(t.normal),n=e.x*Math.abs(i.x)+e.y*Math.abs(i.y)+e.z*Math.abs(i.z),r=this.center.dot(i)+t.distance;return r-n>0?et:r+n<0?$:tt}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=nt.from(t).subtract(this.center),{halfDiagonal:i}=this;let n,r=0;return n=Math.abs(e.x)-i.x,n>0&&(r+=n*n),n=Math.abs(e.y)-i.y,n>0&&(r+=n*n),n=Math.abs(e.z)-i.z,n>0&&(r+=n*n),r}}var st=i(83367);const at=new it.Z,lt=new it.Z;class ct{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,u.Z)(this,"center",void 0),(0,u.Z)(this,"radius",void 0),this.radius=-0,this.center=new it.Z,this.fromCenterRadius(t,e)}fromCenterRadius(t,e){return this.center.from(t),this.radius=e,this}fromCornerPoints(t,e){return e=at.from(e),this.center=(new it.Z).from(t).add(e).scale(.5),this.radius=this.center.distance(e),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new ct(this.center,this.radius)}union(t){const e=this.center,i=this.radius,n=t.center,r=t.radius,o=at.copy(n).subtract(e),s=o.magnitude();if(i>=s+r)return this.clone();if(r>=s+i)return t.clone();const a=.5*(i+s+r);return lt.copy(o).scale((-i+a)/s).add(e),this.center.copy(lt),this.radius=a,this}expand(t){const e=at.from(t).subtract(this.center).magnitude();return e>this.radius&&(this.radius=e),this}transform(t){this.center.transform(t);const e=st.Q$(at,t);return this.radius=Math.max(e[0],Math.max(e[1],e[2]))*this.radius,this}distanceSquaredTo(t){const e=this.distanceTo(t);return e*e}distanceTo(t){const e=at.from(t).subtract(this.center);return Math.max(0,e.len()-this.radius)}intersectPlane(t){const e=this.center,i=this.radius,n=t.normal.dot(e)+t.distance;return n<-i?$:n<i?tt:et}}var ut,ht=i(53209),dt=i(69801),pt=i(63986),At=i(24645),ft=i(77548);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"}(ut||(ut={}));const gt=Object.freeze([1,0,0,0,1,0,0,0,1]);class mt extends ht.Z{static get IDENTITY(){return function(){vt||(vt=new mt,Object.freeze(vt));return vt}()}static get ZERO(){return function(){yt||(yt=new mt([0,0,0,0,0,0,0,0,0]),Object.freeze(yt));return yt}()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ut}constructor(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];super(-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):i.length>0?this.copy([t,...i]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5
2]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(gt)}fromObject(t){return this.check()}fromQuaternion(t){return At.en(this,t),this.check()}set(t,e,i,n,r,o,s,a,l){return this[0]=t,this[1]=e,this[2]=i,this[3]=n,this[4]=r,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this.check()}setRowMajor(t,e,i,n,r,o,s,a,l){return this[0]=t,this[1]=n,this[2]=s,this[3]=e,this[4]=r,this[5]=a,this[6]=i,this[7]=o,this[8]=l,this.check()}determinant(){return At.GH(this)}transpose(){return At.p4(this,this),this.check()}invert(){return At.U_(this,this),this.check()}multiplyLeft(t){return At.Jp(this,t,this),this.check()}multiplyRight(t){return At.Jp(this,this,t),this.check()}rotate(t){return At.U1(this,this,t),this.check()}scale(t){return Array.isArray(t)?At.bA(this,this,t):At.bA(this,this,[t,t]),this.check()}translate(t){return At.Iu(this,this,t),this.check()}transform(t,e){let i;switch(t.length){case 2:i=ft.kK(e||[-0,-0],t,this);break;case 3:i=j.kK(e||[-0,-0,-0],t,this);break;case 4:i=(0,pt._x)(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,dt.IL)(i,t.length),i}transformVector(t,e){return this.transform(t,e)}transformVector2(t,e){return this.transform(t,e)}transformVector3(t,e){return this.transform(t,e)}}let yt,vt;var _t=i(34980);const bt=new it.Z,xt=new it.Z,wt=new it.Z,Ct=new it.Z,Bt=new it.Z,Et=new it.Z,St=new it.Z,Tt=0,Mt=1,It=2,Pt=3,Dt=4,Lt=5,Ot=6,Ft=7,Rt=8;class kt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,0],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0,0,0,0,0,0,0];(0,u.Z)(this,"center",void 0),(0,u.Z)(this,"halfAxes",void 0),this.center=(new it.Z).from(t),this.halfAxes=new mt(e)}get halfSize(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2);return[new it.Z(t).len(),new it.Z(e).len(),new it.Z(i).len()]}get quaternion(){const t=this.halfAxes.getColumn(0),e=this.halfAxes.getColumn(1),i=this.halfAxes.getColumn(2),n=new it.Z(t).normalize(),r=new it.Z(e).normalize(),o=new it.Z(i).normalize();return(new _t.Z).fromMatrix3(new mt([...n,...r,...o]))}fromCenterHalfSizeQuaternion(t,e,i){const n=new _t.Z(i),r=(new mt).fromQuaternion(n);return r[0]=r[0]*e[0],r[1]=r[1]*e[0],r[2]=r[2]*e[0],r[3]=r[3]*e[1],r[4]=r[4]*e[1],r[5]=r[5]*e[1],r[6]=r[6]*e[2],r[7]=r[7]*e[2],r[8]=r[8]*e[2],this.center=(new it.Z).from(t),this.halfAxes=r,this}clone(){return new kt(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new ct;const e=this.halfAxes,i=e.getColumn(0,wt),n=e.getColumn(1,Ct),r=e.getColumn(2,Bt),o=bt.copy(i).add(n).add(r);return t.center.copy(this.center),t.radius=o.magnitude(),t}intersectPlane(t){const e=this.center,i=t.normal,n=this.halfAxes,r=i.x,o=i.y,s=i.z,a=Math.abs(r*n[Tt]+o*n[Mt]+s*n[It])+Math.abs(r*n[Pt]+o*n[Dt]+s*n[Lt])+Math.abs(r*n[Ot]+o*n[Ft]+s*n[Rt]),l=i.dot(e)+t.distance;return l<=-a?$:l>=a?et:tt}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){const e=xt.from(t).subtract(this.center),i=this.halfAxes,n=i.getColumn(0,wt),r=i.getColumn(1,Ct),o=i.getColumn(2,Bt),s=n.magnitude(),a=r.magnitude(),l=o.magnitude();n.normalize(),r.normalize(),o.normalize();let c,u=0;return c=Math.abs(e.dot(n))-s,c>0&&(u+=c*c),c=Math.abs(e.dot(r))-a,c>0&&(u+=c*c),c=Math.abs(e.dot(o))-l,c>0&&(u+=c*c),u}computePlaneDistances(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[-0,-0],n=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;const o=this.center,s=this.halfAxes,a=s.getColumn(0,wt),l=s.getColumn(1,Ct),c=s.getColumn(2,Bt),u=Et.copy(a).add(l).add(c).add(o),h=St.copy(u).subtract(t);let d=e.dot(h);return n=Math.min(d,n),r=Math.max(d,r),u.copy(o).add(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),n=Math.min(d,n),r=Math.max(d,r),u.copy(o).add(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),n=Math.min(d,n),r=Math.max(d,r),u.copy(o).add(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),n=Math.min(d,n),r=Math.max(d,r),o.copy(u).subtract(a).add(l).add(c),h.copy(u).subtract(t),d=e.dot(h),n=Math.min(d,n),r=Math.max(d,r),o.copy(u).subtract(a).add(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),n=Math.min(d,n),r=Math.max(d,r),o.copy(u).subtract(a).subtract(l).add(c),h.copy(u).subtract(t),d=e.dot(h),n=Math.min(d,n),r=Math.max(d,r),o.copy(u).subtract(a).subtract(l).subtract(c),h.copy(u).subtract(t),d=e.dot(h),n=Math.min(d,n),r=Math.max(d,r),i[0]=n,i[1]=r,i}transform(t){this.center.transformAsPoint(t);const e=this.halfAxes.getColumn(0,wt);e.transformAsPoint(t);const i=this.halfAxes.getColumn(1,Ct);i.transformAsPoint(t);const n=this.halfAxes.getColumn(2,Bt);return n.transformAsPoint(t),this.halfAxes=new mt([...e,...i,...n]),this}getTransform(){throw new Error("not implemented")}}var zt=i(45903),Ut=i(47410);
vendor: 11,830 bytes, line 2
2const Nt=new it.Z,Gt=new it.Z;class Zt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[0,0,1],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,u.Z)(this,"normal",void 0),(0,u.Z)(this,"distance",void 0),this.normal=new it.Z,this.distance=-0,this.fromNormalDistance(t,e)}fromNormalDistance(t,e){return(0,zt.Z)(Number.isFinite(e)),this.normal.from(t).normalize(),this.distance=e,this}fromPointNormal(t,e){t=Nt.from(t),this.normal.from(e).normalize();const i=-this.normal.dot(t);return this.distance=i,this}fromCoefficients(t,e,i,n){return this.normal.set(t,e,i),(0,zt.Z)((0,Ut.fS)(this.normal.len(),1)),this.distance=n,this}clone(){return new Zt(this.normal,this.distance)}equals(t){return(0,Ut.fS)(this.distance,t.distance)&&(0,Ut.fS)(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){const e=Gt.copy(this.normal).transformAsVector(t).normalize(),i=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(i,e)}projectPointOntoPlane(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];t=Nt.from(t);const i=this.getPointDistance(t),n=Gt.copy(this.normal).scale(i);return t.subtract(n).to(e)}}const jt=[new it.Z([1,0,0]),new it.Z([0,1,0]),new it.Z([0,0,1])],Vt=new it.Z,Ht=new it.Z;new Zt(new it.Z(1,0,0),0);class Jt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,u.Z)(this,"planes",void 0),this.planes=t}fromBoundingSphere(t){this.planes.length=2*jt.length;const e=t.center,i=t.radius;let n=0;for(const r of jt){let t=this.planes[n],o=this.planes[n+1];t||(t=this.planes[n]=new Zt),o||(o=this.planes[n+1]=new Zt);const s=Vt.copy(r).scale(-i).add(e);r.dot(s);t.fromPointNormal(s,r);const a=Vt.copy(r).scale(i).add(e),l=Ht.copy(r).negate();l.dot(a);o.fromPointNormal(a,l),n+=2}return this}computeVisibility(t){let e=et;for(const i of this.planes){switch(t.intersectPlane(i)){case $:return $;case tt:e=tt}}return e}computeVisibilityWithPlaneMask(t,e){if((0,zt.Z)(Number.isFinite(e),"parentPlaneMask is required."),e===Jt.MASK_OUTSIDE||e===Jt.MASK_INSIDE)return e;let i=Jt.MASK_INSIDE;const n=this.planes;for(let r=0;r<this.planes.length;++r){const o=r<31?1<<r:0;if(r<31&&0===(e&o))continue;const s=n[r],a=t.intersectPlane(s);if(a===$)return Jt.MASK_OUTSIDE;a===tt&&(i|=o)}return i}}(0,u.Z)(Jt,"MASK_OUTSIDE",4294967295),(0,u.Z)(Jt,"MASK_INSIDE",0),(0,u.Z)(Jt,"MASK_INDETERMINATE",2147483647);new it.Z,new it.Z,new it.Z,new it.Z,new it.Z;new it.Z,new it.Z,new it.Z,new it.Z,new it.Z,new it.Z,new it.Z,new it.Z,new it.Z,new it.Z,new it.Z,new it.Z,Math.PI;const Wt={EPSILON1:.1,EPSILON2:.01,EPSILON3:.001,EPSILON4:1e-4,EPSILON5:1e-5,EPSILON6:1e-6,EPSILON7:1e-7,EPSILON8:1e-8,EPSILON9:1e-9,EPSILON10:1e-10,EPSILON11:1e-11,EPSILON12:1e-12,EPSILON13:1e-13,EPSILON14:1e-14,EPSILON15:1e-15,EPSILON16:1e-16,EPSILON17:1e-17,EPSILON18:1e-18,EPSILON19:1e-19,EPSILON20:1e-20,PI_OVER_TWO:Math.PI/2,PI_OVER_FOUR:Math.PI/4,PI_OVER_SIX:Math.PI/6,TWO_PI:2*Math.PI},Qt=new mt,qt=new mt,Kt=new mt,Xt=new mt,Yt=new mt;function $t(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=Wt.EPSILON20;let n=0,r=0;const o=qt,s=Kt;o.identity(),s.copy(t);const a=i*function(t){let e=0;for(let i=0;i<9;++i){const n=t[i];e+=n*n}return Math.sqrt(e)}(s);for(;r<10&&ie(s)>a;)ne(s,Xt),Yt.copy(Xt).transpose(),s.multiplyRight(Xt),s.multiplyLeft(Yt),o.multiplyRight(Xt),++n>2&&(++r,n=0);return e.unitary=o.toTarget(e.unitary),e.diagonal=s.toTarget(e.diagonal),e}const te=[1,0,0],ee=[2,2,1];function ie(t){let e=0;for(let i=0;i<3;++i){const n=t[Qt.getElementIndex(ee[i],te[i])];e+=2*n*n}return Math.sqrt(e)}function ne(t,e){const i=Wt.EPSILON15;let n=0,r=1;for(let c=0;c<3;++c){const e=Math.abs(t[Qt.getElementIndex(ee[c],te[c])]);e>n&&(r=c,n=e)}const o=te[r],s=ee[r];let a=1,l=0;if(Math.abs(t[Qt.getElementIndex(s,o)])>i){const e=(t[Qt.getElementIndex(s,s)]-t[Qt.getElementIndex(o,o)])/2/t[Qt.getElementIndex(s,o)];let i;i=e<0?-1/(-e+Math.sqrt(1+e*e)):1/(e+Math.sqrt(1+e*e)),a=1/Math.sqrt(1+i*i),l=i*a}return mt.IDENTITY.to(e),e[Qt.getElementIndex(o,o)]=e[Qt.getElementIndex(s,s)]=a,e[Qt.getElementIndex(s,o)]=l,e[Qt.getElementIndex(o,s)]=-l,e}const re=new it.Z,oe=new it.Z,se=new it.Z,ae=new it.Z,le=new it.Z,ce=new mt,ue={diagonal:new mt,unitary:new mt};const he=512,de=3,pe=[[.5,.5],[0,0],[0,1],[1,0],[1,1]],Ae=pe.concat([[0,.5],[.5,0],[1,.5],[.5,1]]),fe=Ae.concat([[.25,.5],[.75,.5]]);class ge{constructor(t,e,i){(0,u.Z)(this,"x",void 0),(0,u.Z)(this,"y",void 0),(0,u.Z)(this,"z",void 0),(0,u.Z)(this,"childVisible",void 0),(0,u.Z)(this,"selected",void 0),(0,u.Z)(this,"_children",void 0),this.x=t,this.y=e,this.z=i}get children(){if(!this._children){const t=2*this.x,e=2*this.y,i=this.z+1;this._children=[new ge(t,e,i),new ge(t,e+1,i),new ge(t+1,e,i),new ge(t+1,e+1,i)]}return this._children}update(t){const{viewport:e,cullingVolume:i,elevationBounds:n,minZ:r,maxZ:o,bounds:s,offset:a,project:l}=t,c=this.getBoundingVolume(n,a,l);if(s&&!this.insideBounds(s))return!1;if(i.computeVisibility(c)<0)return!1;if(!this.childVisible){let{z:t}=this;if(t<o&&t>=r){const i=c.distanceTo(e.cameraPosition)*e.scale/e.height;t+=Math.floor(Math.log2(i))}if(t>=o)return this.selected=!0,!0}this.selected=!1,this.childVisible=!0;for(const u of this.children)u.update(t);return!0}getSelected(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(this.selected&&t.push(this),this._children)for(const e of this._children)e.getSelected(t);return t}insideBounds(t){let[e,i,n,r]=t;const o=Math.pow(2,this.z),s=he/o;return this.x*s<n&&this.y*s<r&&(this.x+1)*s>e&&(this.y+1)*s>i}getBoundingVolume(t,e,i){if(i){const e=this.z<1?fe:this.z<2?Ae:pe,n=[];for(const r of e){const e=Ce(this.x+r[0],this.y+r[1],this.z);e[2]=t[0],n.push(i(e)),t[0]!==t[1]&&(e[2]=t[1],n.push(i(e)))}return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new kt;if(!t||0===t.length)return e.halfAxes=new mt([0,0,0,0,0,0,0,0,0]),e.center=new it.Z,e;const i=t.length,n=new it.Z(0,0,0);for(const B of t)n.add(B);const r=1/i;n.multiplyByScalar(r);let o=0,s=0,a=0,l=0,c=0,u=0;for(const B of t){const t=re.copy(B).subtract(n);o+=t.x*t.x,s+=t.x*t.y,a+=t.x*t.z,l+=t.y*t.y,c+=t.y*t.z,u+=t.z*t.z}o*=r,s*=r,a*=r,l*=r,c*=r,u*=r;const h=ce;h[0]=o,h[1]=s,h[2]=a,h[3]=s,h[4]=l,h[5]=c,h[6]=a,h[7]=c,h[8]=u;const{unitary:d}=$t(h,ue),p=e.halfAxes.copy(d);let A=p.getColumn(0,se),f=p.getColumn(1,ae),g=p.getColumn(2,le),m=-Number.MAX_VALUE,y=-Number.MAX_VALUE,v=-Number.MAX_VALUE,_=Number.MAX_VALUE,b=Number.MAX_VALUE,x=Number.MAX_VALUE;for(const B of t)re.copy(B),m=Math.max(re.dot(A),m),y=Math.max(re.dot(f),y),v=Math.max(re.dot(g),v),_=Math.min(re.dot(A),_),b=Math.min(re.dot(f),b),x=Math.min(re.dot(g),x);A=A.multiplyByScalar(.5*(_+m)),f=f.multiplyByScalar(.5*(b+y)),g=g.multiplyByScalar(.5*(x+v)),e.center.copy(A).add(f).add(g);const w=oe.set(m-_,y-b,v-x).multiplyByScalar(.5),C=new mt([w[0],0,0,0,w[1],0,0,0,w[2]]);return e.halfAxes.multiplyRight(C),e}(n)}const n=Math.pow(2,this.z),r=he/n,o=this.x*r+e*he,s=he-(this.y+1)*r;return new ot([o,s,t[0]],[o+r,s+r,t[1]])}}const me=512,ye=[-1/0,-1/0,1/0,1/0],ve={type:"url",value:null,validate:(t,e)=>e.optional&&null===t||"string"===typeof t||Array.isArray(t)&&t.every((t=>"string"===typeof t)),equals:(t,e)=>{if(t===e)return!0;if(!Array.isArray(t)||!Array.isArray(e))return!1;const i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}};function _e(t,e){const i=[e.transformAsPoint([t[0],t[1]]),e.transformAsPoint([t[2],t[1]]),e.transformAsPoint([t[0],t[3]]),e.transformAsPoint([t[2],t[3]])],n=[Math.min(...i.map((t=>t[0]))),Math.min(...i.map((t=>t[1]))),Math.max(...i.map((t=>t[0]))),Math.max(...i.map((t=>t[1])))];return n}function be(t,e){if(!t||!t.length)return null;const{index:i,id:n}=e;if(Array.isArray(t)){t=t[(r=n,Math.abs(r.split("").reduce(((t,e)=>(t<<5)-t+e.charCodeAt(0)|0),0))%t.length)]}var r;let o=t;for(const s of Object.keys(i)){const t=new RegExp("{".concat(s,"}"),"g");o=o.replace(t,String(i[s]))}return Number.isInteger(i.y)&&Number.isInteger(i.z)&&(o=o.replace(/\{-y\}/g,String(Math.pow(2,i.z)-i.y-1))),o}function xe(t){let{viewport:e,z:i,cullRect:n}=t;const r=n.x-e.x,o=n.y-e.y,{width:s,height:a}=n;if(!Array.isArray(i)){const t={targetZ:i||0},n=e.unproject([r,o],t),l=e.unproject([r+s,o],t),c=e.unproject([r,o+a],t),u=e.unproject([r+s,o+a],t);return[Math.min(n[0],l[0],c[0],u[0]),Math.min(n[1],l[1],c[1],u[1]),Math.max(n[0],l[0],c[0],u[0]),Math.max(n[1],l[1],c[1],u[1])]}const l=xe({viewport:e,z:i[0],cullRect:n}),c=xe({viewport:e,z:i[1],cullRect:n});return[Math.min(l[0],c[0]),Math.min(l[1],c[1]),Math.max(l[2],c[2]),Math.max(l[3],c[3])]}function we(t,e){return Math.pow(2,t)*me/e}function Ce(t,e,i){const n=we(i,me),r=t/n*360-180,o=Math.PI-2*Math.PI*e/n;return[r,180/Math.PI*Math.atan(.5*(Math.exp(o)-Math.exp(-o)))]}function Be(t,e,i,n){const r=we(i,n);return[t/r*me,e/r*me]}function Ee(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:me;if(t.isGeospatial){const[t,r]=Ce(e,i,n),[o,s]=Ce(e+1,i+1,n);return{west:t,north:r,east:o,south:s}}const[o,s]=Be(e,i,n,r),[a,l]=Be(e+1,i+1,n,r);return{left:o,top:s,right:a,bottom:l}}function Se(t,e,i,n,r){const o=function(t,e,i){let n;if(e&&2===e.length){const[i,r]=e,o=t.getBounds({z:i}),s=t.getBounds({z:r});n=[Math.min(o[0],s[0]),Math.min(o[1],s[1]),Math.max(o[2],s[2]),Math.max(o[3],s[3])]}else n=t.getBounds();return t.isGeospatial?[Math.max(n[0],i[0]),Math.max(n[1],i[1]),Math.min(n[2],i[2]),Math.min(n[3],i[3])]:[Math.max(Math.min(n[0],i[2]),i[0]),Math.max(Math.min(n[1],i[3]),i[1]),Math.min(Math.max(n[2],i[0]),i[2]),Math.min(Math.max(n[3],i[1]),i[3])]}(t,null,n),s=we(e,i),[a,l,c,u]=function(t,e,i){if(i){const n=_e(t,i).map((t=>t*e/me));return n}return t.map((t=>t*e/me))}(o,s,r),h=[];for(let d=Math.floor(a);d<c;d++)for(let t=Math.floor(l);t<u;t++)h.push({x:d,y:t,z:e});return h}function Te(t){let{viewport:e,maxZoom:i,minZoom:n,zRange:r,extent:o,tileSize:s=me,modelMatrix:a,modelMatrixInverse:l,zoomOffset:c=0}=t,u=e.isGeospatial?Math.round(e.zoom+Math.log2(me/s))+c:Math.ceil(e.zoom)+c;if("number"===typeof n&&Number.isFinite(n)&&u<n){if(!o)return[];u=n}"number"===typeof i&&Number.isFinite(i)&&u>i&&(u=i);let h=o;return a&&l&&o&&!e.isGeospatial&&(h=_e(o,a)),e.isGeospatial?function(t,e,i,n){const r=t instanceof K&&t.resolution?t.projectPosition:null,o=Object.values(t.getFrustumPlanes()).map((t=>{let{normal:e,distance:i}=t;return new Zt(e.clone().negate(),i)})),s=new Jt(o),a=t.distanceScales.unitsPerMeter[2],l=i&&i[0]*a||0,c=i&&i[1]*a||0,u=t instanceof Y.Z&&t.pitch<=60?e:0;if(n){const[t,e,i,r]=n,o=(0,D.w5)([t,r]),s=(0,D.w5)([i,e]);n=[o[0],he-o[1],s[0],he-s[1]]}const h=new ge(0,0,0),d={viewport:t,project:r,cullingVolume:s,elevationBounds:[l,c],minZ:u,maxZ:e,bounds:n,offset:0};if(h.update(d),t instanceof Y.Z&&t.subViewports&&t.subViewports.length>1){for(d.offset=-1;h.update(d)&&!(--d.offset<-de););for(d.offset=1;h.update(d)&&!(++d.offset>de););}return h.getSelected()}(e,u,r,o):Se(e,u,s,h||ye,l)}var Me=i(92138);const Ie={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class Pe{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,u.Z)(this,"props",void 0),(0,u.Z)(this,"stats",void 0),(0,u.Z)(this,"activeRequestCount",0),(0,u.Z)(this,"requestQueue",[]),(0,u.Z)(this,"requestMap",new Map),(0,u.Z)(this,"deferredUpdate",null),this.props={...Ie,...t},this.stats=new Me.Z({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);
2const i={handle:t,priority:0,getPriority:e},n=new Promise((t=>(i.resolve=t,i)));return this.requestQueue.push(i),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){const{handle:e,resolve:i}=t;let n=!1;const r=()=>{n||(n=!0,this.requestMap.delete(e),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,i?i({done:r}):Promise.resolve({done:r})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout((()=>this._issueNewRequestsAsync()),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;e<t;++e){const t=this.requestQueue.shift();t&&this._issueRequest(t)}}}_updateAllRequests(){const t=this.requestQueue;for(let e=0;e<t.length;++e){const i=t[e];this._updateRequest(i)||(t.splice(e,1),this.requestMap.delete(i.handle),e--)}t.sort(((t,e)=>t.priority-e.priority))}_updateRequest(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}var De=i(18188);const Le=2,Oe="best-available",Fe={[Oe]:function(t){for(const e of t)e.state=0;for(const e of t)e.isSelected&&!ke(e)&&ze(e);for(const e of t)e.isVisible=Boolean(e.state&Le)},"no-overlap":function(t){for(const i of t)i.state=0;for(const i of t)i.isSelected&&ke(i);const e=Array.from(t).sort(((t,e)=>t.zoom-e.zoom));for(const i of e)if(i.isVisible=Boolean(i.state&Le),i.children&&(i.isVisible||1&i.state))for(const t of i.children)t.state=1;else i.isSelected&&ze(i)},never:()=>{}};class Re{constructor(t){(0,u.Z)(this,"opts",void 0),(0,u.Z)(this,"_requestScheduler",void 0),(0,u.Z)(this,"_cache",void 0),(0,u.Z)(this,"_dirty",void 0),(0,u.Z)(this,"_tiles",void 0),(0,u.Z)(this,"_cacheByteSize",void 0),(0,u.Z)(this,"_viewport",void 0),(0,u.Z)(this,"_zRange",void 0),(0,u.Z)(this,"_selectedTiles",void 0),(0,u.Z)(this,"_frameNumber",void 0),(0,u.Z)(this,"_modelMatrix",void 0),(0,u.Z)(this,"_modelMatrixInverse",void 0),(0,u.Z)(this,"_maxZoom",void 0),(0,u.Z)(this,"_minZoom",void 0),(0,u.Z)(this,"onTileLoad",void 0),(0,u.Z)(this,"_getCullBounds",(0,De.Z)(xe)),this.opts=t,this.onTileLoad=t=>{this.opts.onTileLoad(t),this.opts.maxCacheByteSize&&(this._cacheByteSize+=t.byteLength,this._resizeCache())},this._requestScheduler=new Pe({maxRequests:t.maxRequests,throttleRequests:t.maxRequests>0}),this._cache=new Map,this._tiles=[],this._dirty=!1,this._cacheByteSize=0,this._viewport=null,this._selectedTiles=null,this._frameNumber=0,this._modelMatrix=new N.Z,this._modelMatrixInverse=new N.Z,this.setOptions(t)}get tiles(){return this._tiles}get selectedTiles(){return this._selectedTiles}get isLoaded(){return null!==this._selectedTiles&&this._selectedTiles.every((t=>t.isLoaded))}get needsReload(){return null!==this._selectedTiles&&this._selectedTiles.some((t=>t.needsReload))}setOptions(t){Object.assign(this.opts,t),Number.isFinite(t.maxZoom)&&(this._maxZoom=Math.floor(t.maxZoom)),Number.isFinite(t.minZoom)&&(this._minZoom=Math.ceil(t.minZoom))}finalize(){for(const t of this._cache.values())t.isLoading&&t.abort();this._cache.clear(),this._tiles=[],this._selectedTiles=null}reloadAll(){for(const t of this._cache.keys()){const e=this._cache.get(t);this._selectedTiles&&this._selectedTiles.includes(e)?e.setNeedsReload():this._cache.delete(t)}}update(t){let{zRange:e,modelMatrix:i}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new N.Z(i),r=!n.equals(this._modelMatrix);if(this._viewport&&t.equals(this._viewport)&&(0,Ut.fS)(this._zRange,e)&&!r)this.needsReload&&(this._selectedTiles=this._selectedTiles.map((t=>this._getTile(t.index,!0))));else{r&&(this._modelMatrixInverse=n.clone().invert(),this._modelMatrix=n),this._viewport=t,this._zRange=e;const i=this.getTileIndices({viewport:t,maxZoom:this._maxZoom,minZoom:this._minZoom,zRange:e,modelMatrix:this._modelMatrix,modelMatrixInverse:this._modelMatrixInverse});this._selectedTiles=i.map((t=>this._getTile(t,!0))),this._dirty&&this._rebuildTree()}const o=this.updateTileStates();return this._pruneRequests(),this._dirty&&this._resizeCache(),o&&this._frameNumber++,this._frameNumber}isTileVisible(t,e){if(!t.isVisible)return!1;
2if(e&&this._viewport){const[i,n,r,o]=xe({viewport:this._viewport,z:this._zRange,cullRect:e}),{bbox:s}=t;if("west"in s)return s.west<r&&s.east>i&&s.south<o&&s.north>n;const a=Math.min(s.top,s.bottom),l=Math.max(s.top,s.bottom);return s.left<r&&s.right>i&&a<o&&l>n}return!0}getTileIndices(t){let{viewport:e,maxZoom:i,minZoom:n,zRange:r,modelMatrix:o,modelMatrixInverse:s}=t;const{tileSize:a,extent:l,zoomOffset:c}=this.opts;return Te({viewport:e,maxZoom:i,minZoom:n,zRange:r,tileSize:a,extent:l,modelMatrix:o,modelMatrixInverse:s,zoomOffset:c})}getTileId(t){return"".concat(t.x,"-").concat(t.y,"-").concat(t.z)}getTileZoom(t){return t.z}getTileMetadata(t){const{tileSize:e}=this.opts;return{bbox:Ee(this._viewport,t.x,t.y,t.z,e)}}getParentIndex(t){return{x:Math.floor(t.x/2),y:Math.floor(t.y/2),z:t.z-1}}updateTileStates(){const t=this.opts.refinementStrategy||Oe,e=new Array(this._cache.size);let i=0;for(const n of this._cache.values())e[i++]=n.isVisible,n.isSelected=!1,n.isVisible=!1;for(const n of this._selectedTiles)n.isSelected=!0,n.isVisible=!0;("function"===typeof t?t:Fe[t])(Array.from(this._cache.values())),i=0;for(const n of this._cache.values())if(e[i++]!==n.isVisible)return!0;return!1}_pruneRequests(){const{maxRequests:t}=this.opts,e=[];let i=0;for(const n of this._cache.values())n.isLoading&&(i++,n.isSelected||n.isVisible||e.push(n));for(;t>0&&i>t&&e.length>0;){e.shift().abort(),i--}}_rebuildTree(){const{_cache:t}=this;for(const e of t.values())e.parent=null,e.children&&(e.children.length=0);for(const e of t.values()){const t=this._getNearestAncestor(e);e.parent=t,null!==t&&void 0!==t&&t.children&&t.children.push(e)}}_resizeCache(){const{_cache:t,opts:e}=this,i=e.maxCacheSize||(e.maxCacheByteSize?1/0:5*this.selectedTiles.length),n=e.maxCacheByteSize||1/0;if(t.size>i||this._cacheByteSize>n){for(const[r,o]of t)if(o.isVisible||o.isSelected||(this._cacheByteSize-=e.maxCacheByteSize?o.byteLength:0,t.delete(r),this.opts.onTileUnload(o)),t.size<=i&&this._cacheByteSize<=n)break;this._rebuildTree(),this._dirty=!0}this._dirty&&(this._tiles=Array.from(this._cache.values()).sort(((t,e)=>t.zoom-e.zoom)),this._dirty=!1)}_getTile(t,e){const i=this.getTileId(t);let n=this._cache.get(i),r=!1;return!n&&e?(n=new U(t),Object.assign(n,this.getTileMetadata(n.index)),Object.assign(n,{id:i,zoom:this.getTileZoom(n.index)}),r=!0,this._cache.set(i,n),this._dirty=!0):n&&n.needsReload&&(r=!0),n&&r&&n.loadData({getData:this.opts.getTileData,requestScheduler:this._requestScheduler,onLoad:this.onTileLoad,onError:this.opts.onTileError}),n}_getNearestAncestor(t){const{_minZoom:e=0}=this;let i=t.index;for(;this.getTileZoom(i)>e;){i=this.getParentIndex(i);const t=this._getTile(i);if(t)return t}return null}}function ke(t){let e=t;for(;e;){if(e.isLoaded||e.content)return e.state|=Le,!0;e=e.parent}return!1}function ze(t){for(const e of t.children)e.isLoaded||e.content?e.state|=Le:ze(e)}const Ue={TilesetClass:Re,data:{type:"data",value:[]},dataComparator:ve.equals,renderSubLayers:{type:"function",value:t=>new k.Z(t),compare:!1},getTileData:{type:"function",optional:!0,value:null,compare:!1},onViewportLoad:{type:"function",optional:!0,value:null,compare:!1},onTileLoad:{type:"function",value:t=>{},compare:!1},onTileUnload:{type:"function",value:t=>{},compare:!1},onTileError:{type:"function",value:t=>console.error(t),compare:!1},extent:{type:"array",optional:!0,value:null,compare:!0},tileSize:512,maxZoom:null,minZoom:0,maxCacheSize:null,maxCacheByteSize:null,refinementStrategy:Oe,zRange:null,maxRequests:6,zoomOffset:0};class Ne extends p.Z{initializeState(){this.state={tileset:null,isLoaded:!1}}finalizeState(){var t,e;null===(t=this.state)||void 0===t||null===(e=t.tileset)||void 0===e||e.finalize()}get isLoaded(){var t,e;return null===(t=this.state)||void 0===t||null===(e=t.tileset)||void 0===e?void 0:e.selectedTiles.every((t=>t.isLoaded&&t.layers&&t.layers.every((t=>t.isLoaded))))}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){let{changeFlags:e}=t,{tileset:i}=this.state;const n=e.propsOrDataChanged||e.updateTriggersChanged,r=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getTileData);i?n&&(i.setOptions(this._getTilesetOptions()),r?i.reloadAll():this.state.tileset.tiles.forEac
2h((t=>{t.layers=null}))):(i=new this.props.TilesetClass(this._getTilesetOptions()),this.setState({tileset:i})),this._updateTileset()}_getTilesetOptions(){const{tileSize:t,maxCacheSize:e,maxCacheByteSize:i,refinementStrategy:n,extent:r,maxZoom:o,minZoom:s,maxRequests:a,zoomOffset:l}=this.props;return{maxCacheSize:e,maxCacheByteSize:i,maxZoom:o,minZoom:s,tileSize:t,refinementStrategy:n,extent:r,maxRequests:a,zoomOffset:l,getTileData:this.getTileData.bind(this),onTileLoad:this._onTileLoad.bind(this),onTileError:this._onTileError.bind(this),onTileUnload:this._onTileUnload.bind(this)}}_updateTileset(){const{tileset:t}=this.state,{zRange:e,modelMatrix:i}=this.props,n=t.update(this.context.viewport,{zRange:e,modelMatrix:i}),{isLoaded:r}=t,o=this.state.isLoaded!==r,s=this.state.frameNumber!==n;r&&(o||s)&&this._onViewportLoad(),s&&this.setState({frameNumber:n}),this.state.isLoaded=r}_onViewportLoad(){const{tileset:t}=this.state,{onViewportLoad:e}=this.props;e&&e(t.selectedTiles)}_onTileLoad(t){this.props.onTileLoad(t),t.layers=null,this.setNeedsUpdate()}_onTileError(t,e){this.props.onTileError(t),e.layers=null,this.setNeedsUpdate()}_onTileUnload(t){this.props.onTileUnload(t)}getTileData(t){const{data:e,getTileData:i,fetch:n}=this.props,{signal:r}=t;return t.url="string"===typeof e||Array.isArray(e)?be(e,t):null,i?i(t):n&&t.url?n(t.url,{propName:"data",layer:this,signal:r}):null}renderSubLayers(t){return this.props.renderSubLayers(t)}getSubLayerPropsByTile(t){return null}getPickingInfo(t){let{info:e,sourceLayer:i}=t;return e.picked&&(e.tile=i.props.tile),e}_updateAutoHighlight(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}renderLayers(){return this.state.tileset.tiles.map((t=>{const e=this.getSubLayerPropsByTile(t);if(t.isLoaded||t.content)if(t.layers)e&&t.layers[0]&&Object.keys(e).some((i=>t.layers[0].props[i]!==e[i]))&&(t.layers=t.layers.map((t=>t.clone(e))));else{const i=this.renderSubLayers({...this.props,id:"".concat(this.id,"-").concat(t.id),data:t.content,_offset:0,tile:t});t.layers=(0,R.x)(i,Boolean).map((i=>i.clone({tile:t,...e})))}else;return t.layers}))}filterSubLayer(t){let{layer:e,cullRect:i}=t;const{tile:n}=e.props;return this.state.tileset.isTileVisible(n,i)}}(0,u.Z)(Ne,"defaultProps",Ue),(0,u.Z)(Ne,"layerName","TileLayer");var Ge=i(69554);class Ze extends Ge.Z{getShaders(){const t=super.getShaders();return t.inject={"vs:#decl":"uniform float trailLength;\nattribute float instanceTimestamps;\nattribute float instanceNextTimestamps;\nvarying float vTime;\n","vs:#main-end":"vTime = instanceTimestamps + (instanceNextTimestamps - instanceTimestamps) * vPathPosition.y / vPathLength;\n","fs:#decl":"uniform bool fadeTrail;\nuniform float trailLength;\nuniform float currentTime;\nvarying float vTime;\n","fs:#main-start":"if(vTime > currentTime || (fadeTrail && (vTime < currentTime - trailLength))) {\n  discard;\n}\n","fs:DECKGL_FILTER_COLOR":"if(fadeTrail) {\n  color.a *= 1.0 - (currentTime - vTime) / trailLength;\n}\n"},t}initializeState(){super.initializeState();this.getAttributeManager().addInstanced({timestamps:{size:1,accessor:"getTimestamps",shaderAttributes:{instanceTimestamps:{vertexOffset:0},instanceNextTimestamps:{vertexOffset:1}}}})}draw(t){const{fadeTrail:e,trailLength:i,currentTime:n}=this.props;t.uniforms={...t.uniforms,fadeTrail:e,trailLength:i,currentTime:n},super.draw(t)}}(0,u.Z)(Ze,"layerName","TripsLayer"),(0,u.Z)(Ze,"defaultProps",{fadeTrail:!0,trailLength:{type:"number",value:120,min:0},currentTime:{type:"number",value:0,min:0},getTimestamps:{type:"accessor",value:t=>t.timestamps}});var je=function(t){var e,i="undefined"!==typeof(t=t||{})?t:{},n={};for(e in i)i.hasOwnProperty(e)&&(n[e]=i[e]);var r,o=[],s="";document.currentScript&&(s=document.currentScript.src),s=0!==s.indexOf("blob:")?s.substr(0,s.lastIndexOf("/")+1):"",r=function(t,e,i){var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=function(){if(200==n.status||0==n.status&&n.response)e(n.response);else{var r=q(t);r?e(r.buffer):i()}},n.onerror=i,n.send(null)};var a=i.print||console.log.bind(console),l=i.printErr||console.warn.bind(console);for(e in n)n.hasOwnProperty(e)&&(i[e]=n[e]);n=null,i.arguments&&(o=i.arguments);var c=0,u=function(){return c};var h=!1;function d(t){var e,n=i["_"+t];return e="Cannot call unknown function "+t+", make sure it is exported",n||ct("Assertion failed: "+e),n}
vendor: 5,411 bytes, line 2
2function p(t,e,i,n,r){var o={string:function(t){var e=0;if(null!==t&&void 0!==t&&0!==t){var i=1+(t.length<<2);(function(t,e,i){(function(t,e,i,n){if(!(n>0))return 0;for(var r=i,o=i+n-1,s=0;s<t.length;++s){var a=t.charCodeAt(s);if(a>=55296&&a<=57343)a=65536+((1023&a)<<10)|1023&t.charCodeAt(++s);if(a<=127){if(i>=o)break;e[i++]=a}else if(a<=2047){if(i+1>=o)break;e[i++]=192|a>>6,e[i++]=128|63&a}else if(a<=65535){if(i+2>=o)break;e[i++]=224|a>>12,e[i++]=128|a>>6&63,e[i++]=128|63&a}else{if(i+3>=o)break;e[i++]=240|a>>18,e[i++]=128|a>>12&63,e[i++]=128|a>>6&63,e[i++]=128|63&a}}e[i]=0})(t,y,e,i)})(t,e=et(i),i)}return e},array:function(t){var e=et(t.length);return function(t,e){m.set(t,e)}(t,e),e}};var s=d(t),a=[],l=0;if(n)for(var c=0;c<n.length;c++){var u=o[i[c]];u?(0===l&&(l=nt()),a[c]=u(n[c])):a[c]=n[c]}var h=s.apply(null,a);return h=function(t){return"string"===e?f(t):"boolean"===e?Boolean(t):t}(h),0!==l&&it(l),h}var A="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;function f(t,e){return t?function(t,e,i){for(var n=e+i,r=e;t[r]&&!(r>=n);)++r;if(r-e>16&&t.subarray&&A)return A.decode(t.subarray(e,r));for(var o="";e<r;){var s=t[e++];if(128&s){var a=63&t[e++];if(192!=(224&s)){var l=63&t[e++];if((s=224==(240&s)?(15&s)<<12|a<<6|l:(7&s)<<18|a<<12|l<<6|63&t[e++])<65536)o+=String.fromCharCode(s);else{var c=s-65536;o+=String.fromCharCode(55296|c>>10,56320|1023&c)}}else o+=String.fromCharCode((31&s)<<6|a)}else o+=String.fromCharCode(s)}return o}(y,t,e):""}var g,m,y,v,_,b,x;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");function w(t,e){return t%e>0&&(t+=e-t%e),t}function C(t){g=t,i.HEAP8=m=new Int8Array(t),i.HEAP16=v=new Int16Array(t),i.HEAP32=_=new Int32Array(t),i.HEAPU8=y=new Uint8Array(t),i.HEAPU16=new Uint16Array(t),i.HEAPU32=new Uint32Array(t),i.HEAPF32=b=new Float32Array(t),i.HEAPF64=x=new Float64Array(t)}var B=i.TOTAL_MEMORY||33554432;function E(t){for(;t.length>0;){var e=t.shift();if("function"!=typeof e){var n=e.func;"number"===typeof n?void 0===e.arg?i.dynCall_v(n):i.dynCall_vi(n,e.arg):n(void 0===e.arg?null:e.arg)}else e()}}B=(g=i.buffer?i.buffer:new ArrayBuffer(B)).byteLength,C(g),_[6004]=5266928;var S=[],T=[],M=[],I=[];var P=Math.abs,D=Math.ceil,L=Math.floor,O=Math.min,F=0,R=null,k=null;i.preloadedImages={},i.preloadedAudios={};var z,U,N=null,G="data:application/octet-stream;base64,";function Z(t){return String.prototype.startsWith?t.startsWith(G):0===t.indexOf(G)}N="data:application/octet-stream;base64,AAAAAAAAAAACAAAAAwAAAAEAAAAFAAAABAAAAAYAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAYAAAABAAAABAAAAAMAAAAGAAAABQAAAAIAAAAAAAAAAgAAAAMAAAABAAAABAAAAAYAAAAAAAAABQAAAAMAAAAGAAAABAAAAAUAAAAAAAAAAQAAAAIAAAAEAAAABQAAAAYAAAAAAAAAAgAAAAMAAAABAAAABQAAAAIAAAAAAAAAAQAAAAMAAAAGAAAABAAAAAYAAAAAAAAABQAAAAIAAAABAAAABAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAgAAAAMAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABgAAAAAAAAAFAAAAAAAAAAAAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABgAAAAAAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAEAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAACAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAwAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAQAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAFAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABgAAAAAAAAABAAAAAgAAAAMAAAAEAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAAAAAAABgAAAAAAAAADAAAAAgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAUAAAAEAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAEAAAAAAAAAAYAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAUAAAACAAAABAAAAAMAAAAIAAAAAQAAAAcAAAAGAAAACQAAAAAAAAADAAAAAgAAAAIAAAAGAAAACgAAAAsAAAAAAAAAAQAAAAUAAAADAAAADQAAAAEAAAAHAAAABAAAAAwAAAAAAAAABAAAAH8AAAAPAAAACAAAAAMAAAAAAAAADAAAAAUAAAACAAAAEgAAAAoAAAAIAAAAAAAAABAAAAAGAAAADgAAAAsAAAARAAAAAQAAAAkAAAACAAAABwAAABUAAAAJAAAAEwAAAAMAAAANAAAAAQAAAAgAAAAFAAAAFgAAABAAAAAEAAAAAAAAAA8AAAAJAAAAEwAAAA4AAAAUAAAAAQAAAAcAAAAGAAAACgAAAAsAAAAYAAAAFwAAAAUAAAACAAAAEgAAAAsAAAARAAAAFwAAABkAAAACAAAABgAAAAoAAAAMAAAAHAAAAA0AAAAaAAAABAAAAA8AAAADAAAADQAAABoAAAAVAAAAHQAAAAMAAAAMAAAABwAAAA4AAAB/AAAAEQAAABsAAAAJAAAAFAAAAAYAAAAPAAAAFgAAABwAAAAfAAAABAAAAAgAAAAMAAAAEAAAABIAAAAhAAAAHgAAAAgAAAAFAAAAFgAAABEAAAALAAAADgAAAAYAAAAjAAAAGQAAABsAAAASAAAAGAAAAB4AAAAgAAAABQAAAAoAAAAQAAAAEwAAACIAAAAUAAAAJAAAAAcAAAAVAAAACQAAABQAAAAOAAAAEwAAAAkAAAAoAAAAGwAAACQAAAAVAAAAJgAAABMAAAAiAAAADQAAAB0AAAAHAAAAFgAAABAAAAApAAAAIQAAAA8AAAAIAAAAHwAAABcAAAAYAAAACwAAAAoAAAAnAAAAJQAAABkAAAAYAAAAfwAAACAAAAAlAAAACgAAABcAAAASAAAAGQAAABcAAAARAAAACwAAAC0AAAAnAAAAIwAAABoAAAAqAAAAHQAAACsAAAAMAAAAHAAAAA0AAAAbAAAAKAAAACMAAAAuAAAADgAAABQAAAARAAAAHAAAAB8AAAAqAAAALAAAAAwAAAAPAAAAGgAAAB0AAAArAAAAJgAAAC8AAAANAAAAGgAAABUAAAAeAAAAIAAAADAAAAAyAAAAEAAAABIAAAAhAAAAHwAAACkAAAAsAAAANQAAAA8AAAAWAAAAHAAAACAAAAAeAAAAGAAAABIAAAA0AAAAMgAAACUAAAAhAAAAHgAAADEAAAAwAAAAFgAAABAAAAApAAAAIgAAABMAAAAmAAAAFQAAADYAAAAkAAAAMwAAACMAAAAuAAAALQAAADgAAAARAAAAGwAAABkAAAAkAAAAFAAAACIAAAATAAAANwAAACgAAAA2AAAAJQAAACcAAAA0AAAAOQAAABgAAAAXAAAAIAAAACYAAAB/AAAAIgAAADMAAAAdAAAALwAAABUAAAAnAAAAJQAAABkAAAAXAAAAOwAAADkAAAAtAAAAKAAAABsAAAAkAAAAFAAAADwAAAAuAAAANwAAACkAAAAxAAAANQAAAD0AAAAWAAAAIQAAAB8AAAAqAAAAOgAAACsAAAA+AAAAHAAAACwAAAAaAAAAKwAAAD4AAAAvAAAAQAAAABoAAAAqAAAAHQAAACwAAAA1AAAAOgAAAEEAAAAcAAAAHwAAACoAAAAtAAAAJwAAACMAAAAZAAAAPwAAADsAAAA4AAAALgAAADwAAAA4AAAARAAAABsAAAAoAAAAIwAAAC8AAAAmAAAAKwAAAB0AAAB
2FAAAAMwAAAEAAAAAwAAAAMQAAAB4AAAAhAAAAQwAAAEIAAAAyAAAAMQAAAH8AAAA9AAAAQgAAACEAAAAwAAAAKQAAADIAAAAwAAAAIAAAAB4AAABGAAAAQwAAADQAAAAzAAAARQAAADYAAABHAAAAJgAAAC8AAAAiAAAANAAAADkAAABGAAAASgAAACAAAAAlAAAAMgAAADUAAAA9AAAAQQAAAEsAAAAfAAAAKQAAACwAAAA2AAAARwAAADcAAABJAAAAIgAAADMAAAAkAAAANwAAACgAAAA2AAAAJAAAAEgAAAA8AAAASQAAADgAAABEAAAAPwAAAE0AAAAjAAAALgAAAC0AAAA5AAAAOwAAAEoAAABOAAAAJQAAACcAAAA0AAAAOgAAAH8AAAA+AAAATAAAACwAAABBAAAAKgAAADsAAAA/AAAATgAAAE8AAAAnAAAALQAAADkAAAA8AAAASAAAAEQAAABQAAAAKAAAADcAAAAuAAAAPQAAADUAAAAxAAAAKQAAAFEAAABLAAAAQgAAAD4AAAArAAAAOgAAACoAAABSAAAAQAAAAEwAAAA/AAAAfwAAADgAAAAtAAAATwAAADsAAABNAAAAQAAAAC8AAAA+AAAAKwAAAFQAAABFAAAAUgAAAEEAAAA6AAAANQAAACwAAABWAAAATAAAAEsAAABCAAAAQwAAAFEAAABVAAAAMQAAADAAAAA9AAAAQwAAAEIAAAAyAAAAMAAAAFcAAABVAAAARgAAAEQAAAA4AAAAPAAAAC4AAABaAAAATQAAAFAAAABFAAAAMwAAAEAAAAAvAAAAWQAAAEcAAABUAAAARgAAAEMAAAA0AAAAMgAAAFMAAABXAAAASgAAAEcAAABZAAAASQAAAFsAAAAzAAAARQAAADYAAABIAAAAfwAAAEkAAAA3AAAAUAAAADwAAABYAAAASQAAAFsAAABIAAAAWAAAADYAAABHAAAANwAAAEoAAABOAAAAUwAAAFwAAAA0AAAAOQAAAEYAAABLAAAAQQAAAD0AAAA1AAAAXgAAAFYAAABRAAAATAAAAFYAAABSAAAAYAAAADoAAABBAAAAPgAAAE0AAAA/AAAARAAAADgAAABdAAAATwAAAFoAAABOAAAASgAAADsAAAA5AAAAXwAAAFwAAABPAAAATwAAAE4AAAA/AAAAOwAAAF0AAABfAAAATQAAAFAAAABEAAAASAAAADwAAABjAAAAWgAAAFgAAABRAAAAVQAAAF4AAABlAAAAPQAAAEIAAABLAAAAUgAAAGAAAABUAAAAYgAAAD4AAABMAAAAQAAAAFMAAAB/AAAASgAAAEYAAABkAAAAVwAAAFwAAABUAAAARQAAAFIAAABAAAAAYQAAAFkAAABiAAAAVQAAAFcAAABlAAAAZgAAAEIAAABDAAAAUQAAAFYAAABMAAAASwAAAEEAAABoAAAAYAAAAF4AAABXAAAAUwAAAGYAAABkAAAAQwAAAEYAAABVAAAAWAAAAEgAAABbAAAASQAAAGMAAABQAAAAaQAAAFkAAABhAAAAWwAAAGcAAABFAAAAVAAAAEcAAABaAAAATQAAAFAAAABEAAAAagAAAF0AAABjAAAAWwAAAEkAAABZAAAARwAAAGkAAABYAAAAZwAAAFwAAABTAAAATgAAAEoAAABsAAAAZAAAAF8AAABdAAAATwAAAFoAAABNAAAAbQAAAF8AAABqAAAAXgAAAFYAAABRAAAASwAAAGsAAABoAAAAZQAAAF8AAABcAAAATwAAAE4AAABtAAAAbAAAAF0AAABgAAAAaAAAAGIAAABuAAAATAAAAFYAAABSAAAAYQAAAH8AAABiAAAAVAAAAGcAAABZAAAAbwAAAGIAAABuAAAAYQAAAG8AAABSAAAAYAAAAFQAAABjAAAAUAAAAGkAAABYAAAAagAAAFoAAABxAAAAZAAAAGYAAABTAAAAVwAAAGwAAAByAAAAXAAAAGUAAABmAAAAawAAAHAAAABRAAAAVQAAAF4AAABmAAAAZQAAAFcAAABVAAAAcgAAAHAAAABkAAAAZwAAAFsAAABhAAAAWQAAAHQAAABpAAAAbwAAAGgAAABrAAAAbgAAAHMAAABWAAAAXgAAAGAAAABpAAAAWAAAAGcAAABbAAAAcQAAAGMAAAB0AAAAagAAAF0AAABjAAAAWgAAAHUAAABtAAAAcQAAAGsAAAB/AAAAZQAAAF4AAABzAAAAaAAAAHAAAABsAAAAZAAAAF8AAABcAAAAdgAAAHIAAABtAAAAbQAAAGwAAABdAAAAXwAAAHUAAAB2AAAAagAAAG4AAABiAAAAaAAAAGAAAAB3AAAAbwAAAHMAAABvAAAAYQAAAG4AAABiAAAAdAAAAGcAAAB3AAAAcAAAAGsAAABmAAAAZQAAAHgAAABzAAAAcgAAAHEAAABjAAAAdAAAAGkAAAB1AAAAagAAAHkAAAByAAAAcAAAAGQAAABmAAAAdgAAAHgAAABsAAAAcwAAAG4AAABrAAAAaAAAAHgAAAB3AAAAcAAAAHQAAABnAAAAdwAAAG8AAABxAAAAaQAAAHkAAAB1AAAAfwAAAG0AAAB2AAAAcQAAAHkAAABqAAAAdgAAAHgAAABsAAAAcgAAAHUAAAB5AAAAbQAAAHcAAABvAAAAcwAAAG4AAAB5AAAAdAAAAHgAAAB4AAAAcwAAAHIAAABwAAAAeQAAAHcAAAB2AAAAeQAAAHQAAAB4AAAAdwAAAHUAAABxAAAAdgAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAIAAAAFAAAAAQAAAAAAAAD/////AQAAAAAAAAADAAAABAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAUAAAABAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAFAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAQAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAABAAAAAwAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAADAAAABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAUAAAAFAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAADAAAAAAAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAAAAAADAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAwAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAAAAAP////8DAAAAAAAAAAUAAAACAAAAAAAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAADAAAAAQAAAAAAAAABAAAAAAAAAAAAAAADAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAMAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAMAAAADAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAADAAAAAAAAAAAAAAD/////AwAAAAAAAAAFAAAAAgAAAAAAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAADAAAAAAAAAAMAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAwAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAADAAAABQAAAAEAAAAAAAAA/////wMAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAEAAAABQAAAAEAAAAAAAAAAwAAAAMAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgAAAAUAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAABQAAAAAAAAAAAAAABQAAAAUAAAAAAAAAAAAAAP////8BAAAAAAAAAAMAAAAEAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAAAAAAAAAAAAAUAAAAFAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAABQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAQAAAP//////////AQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAIAAAAAAAAAAAAAAAEAAAACAAAABgAAAAQAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAoAAAACAAAAAAAAAAAAAAABAAAAAQAAAAUAAAAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAsAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAIAAAAAAAAAAAAAAAEAAAADAAAABwAAAAYAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAAAAAAAAAAAAQAAAAAAAAAJAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAwAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAgAAAAAAAAAAAAAAAQAAAAQAAAAIAAAACgAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAYAAAACAAAAAAAAAAAAAAABAAAACwAAAA8AAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAgAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAFAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcAAAACAAAAAAAAAAAAAAABAAAADAAAABAAAAAMAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA8AAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAANAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAIAAAAAAAAAAAAAAAEAAAAKAAAAEwAAAAgAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABAAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAJAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAgAAAAAAAAAAAAAAAQAAAA0AAAARAAAADQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAARAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAAAAAAAAAAAAAEAAAAOAAAAEgAAAA8AAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAPAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAABAAAAAQAAAAAAAAAAAAAAAAAAABIAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAATAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAEQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAAAAABMAAAACAAAAAAAAAAAAAAABAAAA//////
2////8TAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAASAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABIAAAAAAAAAGAAAAAAAAAAhAAAAAAAAAB4AAAAAAAAAIAAAAAMAAAAxAAAAAQAAADAAAAADAAAAMgAAAAMAAAAIAAAAAAAAAAUAAAAFAAAACgAAAAUAAAAWAAAAAAAAABAAAAAAAAAAEgAAAAAAAAApAAAAAQAAACEAAAAAAAAAHgAAAAAAAAAEAAAAAAAAAAAAAAAFAAAAAgAAAAUAAAAPAAAAAQAAAAgAAAAAAAAABQAAAAUAAAAfAAAAAQAAABYAAAAAAAAAEAAAAAAAAAACAAAAAAAAAAYAAAAAAAAADgAAAAAAAAAKAAAAAAAAAAsAAAAAAAAAEQAAAAMAAAAYAAAAAQAAABcAAAADAAAAGQAAAAMAAAAAAAAAAAAAAAEAAAAFAAAACQAAAAUAAAAFAAAAAAAAAAIAAAAAAAAABgAAAAAAAAASAAAAAQAAAAoAAAAAAAAACwAAAAAAAAAEAAAAAQAAAAMAAAAFAAAABwAAAAUAAAAIAAAAAQAAAAAAAAAAAAAAAQAAAAUAAAAQAAAAAQAAAAUAAAAAAAAAAgAAAAAAAAAHAAAAAAAAABUAAAAAAAAAJgAAAAAAAAAJAAAAAAAAABMAAAAAAAAAIgAAAAMAAAAOAAAAAQAAABQAAAADAAAAJAAAAAMAAAADAAAAAAAAAA0AAAAFAAAAHQAAAAUAAAABAAAAAAAAAAcAAAAAAAAAFQAAAAAAAAAGAAAAAQAAAAkAAAAAAAAAEwAAAAAAAAAEAAAAAgAAAAwAAAAFAAAAGgAAAAUAAAAAAAAAAQAAAAMAAAAAAAAADQAAAAUAAAACAAAAAQAAAAEAAAAAAAAABwAAAAAAAAAaAAAAAAAAACoAAAAAAAAAOgAAAAAAAAAdAAAAAAAAACsAAAAAAAAAPgAAAAMAAAAmAAAAAQAAAC8AAAADAAAAQAAAAAMAAAAMAAAAAAAAABwAAAAFAAAALAAAAAUAAAANAAAAAAAAABoAAAAAAAAAKgAAAAAAAAAVAAAAAQAAAB0AAAAAAAAAKwAAAAAAAAAEAAAAAwAAAA8AAAAFAAAAHwAAAAUAAAADAAAAAQAAAAwAAAAAAAAAHAAAAAUAAAAHAAAAAQAAAA0AAAAAAAAAGgAAAAAAAAAfAAAAAAAAACkAAAAAAAAAMQAAAAAAAAAsAAAAAAAAADUAAAAAAAAAPQAAAAMAAAA6AAAAAQAAAEEAAAADAAAASwAAAAMAAAAPAAAAAAAAABYAAAAFAAAAIQAAAAUAAAAcAAAAAAAAAB8AAAAAAAAAKQAAAAAAAAAqAAAAAQAAACwAAAAAAAAANQAAAAAAAAAEAAAABAAAAAgAAAAFAAAAEAAAAAUAAAAMAAAAAQAAAA8AAAAAAAAAFgAAAAUAAAAaAAAAAQAAABwAAAAAAAAAHwAAAAAAAAAyAAAAAAAAADAAAAAAAAAAMQAAAAMAAAAgAAAAAAAAAB4AAAADAAAAIQAAAAMAAAAYAAAAAwAAABIAAAADAAAAEAAAAAMAAABGAAAAAAAAAEMAAAAAAAAAQgAAAAMAAAA0AAAAAwAAADIAAAAAAAAAMAAAAAAAAAAlAAAAAwAAACAAAAAAAAAAHgAAAAMAAABTAAAAAAAAAFcAAAADAAAAVQAAAAMAAABKAAAAAwAAAEYAAAAAAAAAQwAAAAAAAAA5AAAAAQAAADQAAAADAAAAMgAAAAAAAAAZAAAAAAAAABcAAAAAAAAAGAAAAAMAAAARAAAAAAAAAAsAAAADAAAACgAAAAMAAAAOAAAAAwAAAAYAAAADAAAAAgAAAAMAAAAtAAAAAAAAACcAAAAAAAAAJQAAAAMAAAAjAAAAAwAAABkAAAAAAAAAFwAAAAAAAAAbAAAAAwAAABEAAAAAAAAACwAAAAMAAAA/AAAAAAAAADsAAAADAAAAOQAAAAMAAAA4AAAAAwAAAC0AAAAAAAAAJwAAAAAAAAAuAAAAAwAAACMAAAADAAAAGQAAAAAAAAAkAAAAAAAAABQAAAAAAAAADgAAAAMAAAAiAAAAAAAAABMAAAADAAAACQAAAAMAAAAmAAAAAwAAABUAAAADAAAABwAAAAMAAAA3AAAAAAAAACgAAAAAAAAAGwAAAAMAAAA2AAAAAwAAACQAAAAAAAAAFAAAAAAAAAAzAAAAAwAAACIAAAAAAAAAEwAAAAMAAABIAAAAAAAAADwAAAADAAAALgAAAAMAAABJAAAAAwAAADcAAAAAAAAAKAAAAAAAAABHAAAAAwAAADYAAAADAAAAJAAAAAAAAABAAAAAAAAAAC8AAAAAAAAAJgAAAAMAAAA+AAAAAAAAACsAAAADAAAAHQAAAAMAAAA6AAAAAwAAACoAAAADAAAAGgAAAAMAAABUAAAAAAAAAEUAAAAAAAAAMwAAAAMAAABSAAAAAwAAAEAAAAAAAAAALwAAAAAAAABMAAAAAwAAAD4AAAAAAAAAKwAAAAMAAABhAAAAAAAAAFkAAAADAAAARwAAAAMAAABiAAAAAwAAAFQAAAAAAAAARQAAAAAAAABgAAAAAwAAAFIAAAADAAAAQAAAAAAAAABLAAAAAAAAAEEAAAAAAAAAOgAAAAMAAAA9AAAAAAAAADUAAAADAAAALAAAAAMAAAAxAAAAAwAAACkAAAADAAAAHwAAAAMAAABeAAAAAAAAAFYAAAAAAAAATAAAAAMAAABRAAAAAwAAAEsAAAAAAAAAQQAAAAAAAABCAAAAAwAAAD0AAAAAAAAANQAAAAMAAABrAAAAAAAAAGgAAAADAAAAYAAAAAMAAABlAAAAAwAAAF4AAAAAAAAAVgAAAAAAAABVAAAAAwAAAFEAAAADAAAASwAAAAAAAAA5AAAAAAAAADsAAAAAAAAAPwAAAAMAAABKAAAAAAAAAE4AAAADAAAATwAAAAMAAABTAAAAAwAAAFwAAAADAAAAXwAAAAMAAAAlAAAAAAAAACcAAAADAAAALQAAAAMAAAA0AAAAAAAAADkAAAAAAAAAOwAAAAAAAABGAAAAAwAAAEoAAAAAAAAATgAAAAMAAAAYAAAAAAAAABcAAAADAAAAGQAAAAMAAAAgAAAAAwAAACUAAAAAAAAAJwAAAAMAAAAyAAAAAwAAADQAAAAAAAAAOQAAAAAAAAAuAAAAAAAAADwAAAAAAAAASAAAAAMAAAA4AAAAAAAAAEQAAAADAAAAUAAAAAMAAAA/AAAAAwAAAE0AAAADAAAAWgAAAAMAAAAbAAAAAAAAACgAAAADAAAANwAAAAMAAAAjAAAAAAAAAC4AAAAAAAAAPAAAAAAAAAAtAAAAAwAAADgAAAAAAAAARAAAAAMAAAAOAAAAAAAAABQAAAADAAAAJAAAAAMAAAARAAAAAwAAABsAAAAAAAAAKAAAAAMAAAAZAAAAAwAAACMAAAAAAAAALgAAAAAAAABHAAAAAAAAAFkAAAAAAAAAYQAAAAMAAABJAAAAAAAAAFsAAAADAAAAZwAAAAMAAABIAAAAAwAAAFgAAAADAAAAaQAAAAMAAAAzAAAAAAAAAEUAAAADAAAAVAAAAAMAAAA2AAAAAAAAAEcAAAAAAAAAWQAAAAAAAAA3AAAAAwAAAEkAAAAAAAAAWwAAAAMAAAAmAAAAAAAAAC8AAAADAAAAQAAAAAMAAAAiAAAAAwAAADMAAAAAAAAARQAAAAMAAAAkAAAAAwAAADYAAAAAAAAARwAAAAAAAABgAAAAAAAAAGgAAAAAAAAAawAAAAMAAABiAAAAAAAAAG4AAAADAAAAcwAAAAMAAABhAAAAAwAAAG8AAAADAAAAdwAAAAMAAABMAAAAAAAAAFYAAAADAAAAXgAAAAMAAABSAAAAAAAAAGAAAAAAAAAAaAAAAAAAAABUAAAAAwAAAGIAAAAAAAAAbgAAAAMAAAA6AAAAAAAAAEEAAAADAAAASwAAAAMAAAA+AAAAAwAAAEwAAAAAAAAAVgAAAAMAAABAAAAAAwAAAFIAAAAAAAAAYAAAAAAAAABVAAAAAAAAAFcAAAAAAAAAUwAAAAMAAABlAAAAAAAAAGYAAAADAAAAZAAAAAMAAABrAAAAAwAAAHAAAAADAAAAcgAAAAMAAABCAAAAAAAAAEMAAAADAAAARgAAAAMAAABRAAAAAAAAAFUAAAAAAAAAVwAAAAAAAABeAAAAAwAAAGUAAAAAAAAAZgAAAAMAAAAxAAAAAAAAADAAAAADAAAAMgAAAAMAAAA9AAAAAwAAAEIAAAAAAAAAQwAAAAMAAABLAAAAAwAAAFEAAAAAAAAAVQAAAAAAAABfAAAAAAAAAFwAAAAAAAAAUwAAAAAAAABPAAAAAAAAAE4AAAAAAAAASgAAAAMAAAA/AAAAAQAAADsAAAADAAAAOQAAAAMAAABtAAAAAAAAAGwAAAAAAAAAZAAAAAUAAABdAAAAAQAAAF8AAAAAAAAAXAAAAAAAAABNAAAAAQAAAE8AAAAAAAAATgAAAAAAAAB1AAAABAAAAHYAAAAFAAAAcgAAAAUAAABqAAAAAQAAAG0AAAAAAAAAbAAAAAAAAABaAAAAAQAAAF0AAAABAAAAXwAAAAAAAABaAAAAAAAAAE0AAAAAAAAAPwAAAAAAAABQAAAAAAAAAEQAAAAAAAAAOAAAAAMAAABIAAAAAQAAADwAAAADAAAALgAAAAMAAABqAAAAAAAAAF0AAAAAAAAATwAAAAUAAABjAAAAAQAAAFoAAAAAAAAATQAAAAAAAABYAAAAAQAAAFAAAAAAAAAARAAAAAAAAAB1AAAAAwAAAG0AAAAFAAAAXwAAAAUAAABxAAAAAQAAAGoAAAAAAAAAXQAAAAAAAABpAAAAAQAAAGMAAAABAAAAWgAAAAAAAABpAAAAAAAAAFgAAAAAAAAASAAAAAAAAABnAAAAAAAAAFsAAAAAAAAASQAAAAMAAABhAAAAAQAAAFkAAAADAAAARwAAAAMAAABxAAAAAAAAAGMAAAAAAAAAUAAAAAUAAAB0AAAAAQAAAGkAAAAAAAAAWAAAAAAAAABvAAAAAQAAAGcAAAAAAAAAWwAAAAAAAAB1AAAAAgAAAGoAAAAFAAAAWgAAAAUAAAB5AAAAAQAAAHEAAAAAAAAAYwAAAAAAAAB3AAAAAQAAAHQAAAABAAAAaQAAAAAAAAB3AAAAAAAAAG8AAAAAAAAAYQAAAAAAAABzAAAAAAAAAG4AAAAAAAAAYgAAAAMAAABrAAAAAQAAAGgAAAADAAAAYAAAAAMAAAB5AAAAAAAAAHQAAAAAAAAAZwAAAAUAAAB4AAAAAQAAAHcAAAAAAAAAbwAAAAAAAABwAAAAAQAAAHMAAAAAAAAAbgAAAAAAAAB1AAAAAQAAAHEAAAAFAAAAaQAAAAUAAAB2AAAAAQAAAHkAAAAAAAAAdAAAAAAAAAByAAAAAQAAAHgAAAABAAAAdwAAAAAAAAByAAAAAAAAAHAAAAAAAAAAawAAAAAAAABkAAAAAAAAAGYAAAAAAAAAZQAAAAMAAABTAAAAAQAAAFcAAAADAAAAVQAAAAMAAAB2AAAAAAAAAHgAAAAAAAAAcwAAAAUAAABsAAAAAQAAAHIAAAAAAAAAcAAAAAAAAABcAAAAAQAAAGQAAAAAAAAAZgAAAAAAAAB1AAAAAAAAAHkAAAAFAAAAdwAAAAUAAABtAAAAAQAAAHYAAAAAAAAAeAAAAAAAAABfAAAAAQAAAGwAAAABAAAAcgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAAAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAB+ogX28rbpPxqumpJv+fM/165tC4ns9D+XaEnTqUsEQFrOtNlC4PA/3U+0XG6P9b9TdUUBxTTjP4PUp8ex1ty/B1rD/EN43z+lcDi6LLrZP/a45NWEHMY/oJ5ijLDZ+j/xw3rjxWPjP2B8A46ioQdAotff3wla2z+FMSpA1jj+v6b5Y1mtPbS/cIu8K0F457/2esiyJpDNv98k5Ts2NeA/pvljWa09tD88ClUJ60MDQPZ6yLImkM0/4ONKxa0UBcD2uOTVhBzGv5G7JRxGave/8cN648Vj47+HCwtkjAXIv6LX398JWtu/qyheaCAL9D9TdUUBxTTjv4gyTxslhwVAB1rD/EN4378EH/28teoFwH6iBfbytum/F6ztFYdK/r/Xrm0Liez0vwcS6wNGWeO/Ws602ULg8L9TCtRLiLT8P8pi5RexJsw/BlIKPVwR5T95Wyu0/QjnP5PjoT7YYcu/mBhKZ6zrwj8wRYS7NebuP3qW6geh+Ls/SLrixebL3r+pcyymN9XrPwmkNHp7xec/GWNMZVAA17+82s+x2BLiPwn2ytbJ9ek/LgEH1sMS1j8yp/2LhTfeP+SnWwtQBbu/d38gkp5X7z8ytsuHaADGPzUYObdf1+m/7IauECWhwz+cjSACjzniP76Z+wUhN9K/1+GEKzup67+/GYr/04baPw6idWOvsuc/ZedTWsRa5b/EJQOuRzi0v/OncYhHPes/h49PixY53j+i8wWfC03Nvw2idWOvsue/ZedTWsRa5T/EJQOuRzi0P/KncYhHPeu/iY9PixY53r+i8wWfC03NP9anWwtQBbs/d38gkp5X778ytsuHaADGvzUYObdf1+k/74auECWhw7+cjSACjzniv8CZ+wUhN9I/1uGEKzup6z+/GYr/04bavwmkNHp7xee/F2NMZVAA1z+82s+x2BLivwr2ytbJ9em/KwEH1sMS1r8yp/2LhTfev81i5
2RexJsy/BlIKPVwR5b95Wyu0/Qjnv5DjoT7YYcs/nBhKZ6zrwr8wRYS7Nebuv3OW6geh+Lu/SLrixebL3j+pcyymN9Xrv8rHIFfWehZAMBwUdlo0DECTUc17EOb2PxpVB1SWChdAzjbhb9pTDUDQhmdvECX5P9FlMKCC9+g/IIAzjELgE0DajDngMv8GQFhWDmDPjNs/y1guLh96EkAxPi8k7DIEQJCc4URlhRhA3eLKKLwkEECqpNAyTBD/P6xpjXcDiwVAFtl//cQm4z+Ibt3XKiYTQM7mCLUb3QdAoM1t8yVv7D8aLZv2Nk8UQEAJPV5nQwxAtSsfTCoE9z9TPjXLXIIWQBVanC5W9AtAYM3d7Adm9j++5mQz1FoWQBUThyaVBghAwH5muQsV7T89Q1qv82MUQJoWGOfNuBdAzrkClkmwDkDQjKq77t37Py+g0dtitsE/ZwAMTwVPEUBojepluNwBQGYbtuW+t9w/HNWIJs6MEkDTNuQUSlgEQKxktPP5TcQ/ixbLB8JjEUCwuWjXMQYCQAS/R09FkRdAowpiZjhhDkB7LmlczD/7P01iQmhhsAVAnrtTwDy84z/Z6jfQ2TgTQChOCXMnWwpAhrW3daoz8z/HYJvVPI4VQLT3ik5FcA5Angi7LOZd+z+NNVzDy5gXQBXdvVTFUA1AYNMgOeYe+T8+qHXGCwkXQKQTOKwa5AJA8gFVoEMW0T+FwzJyttIRQAEAAAD/////BwAAAP////8xAAAA/////1cBAAD/////YQkAAP////+nQQAA/////5HLAQD/////95AMAP/////B9lcAAAAAAAAAAAAAAAAAAgAAAP////8OAAAA/////2IAAAD/////rgIAAP/////CEgAA/////06DAAD/////IpcDAP/////uIRkA/////4LtrwAAAAAAAAAAAAAAAAAAAAAAAgAAAP//////////AQAAAAMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////////////////////wEAAAAAAAAAAgAAAP///////////////wMAAAD//////////////////////////////////////////////////////////wIAAAD//////////wEAAAAAAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA/////////////////////wEAAAD///////////////8CAAAA////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAA////////////////AgAAAAEAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AQAAAAIAAAD///////////////8AAAAA/////////////////////wMAAAD///////////////////////////////8CAAAA////////////////AQAAAP////////////////////8AAAAA/////////////////////wMAAAD/////////////////////////////////////////////////////AwAAAP////////////////////8AAAAAAQAAAP//////////AgAAAP//////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAP///////////////wIAAAAAAAAAAQAAAP//////////////////////////////////////////////////////////////////////////AwAAAAEAAAD//////////wIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAgAAAAAAAAACAAAAAQAAAAEAAAACAAAAAgAAAAAAAAAFAAAABQAAAAAAAAACAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAAAAAAUAAAAGAAAAAAAAAAIAAAACAAAAAwAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAIAAAAAAAAAAgAAAAEAAAADAAAAAgAAAAIAAAAAAAAABQAAAAcAAAAAAAAAAgAAAAIAAAADAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAgAAAAAAAAACAAAAAQAAAAQAAAACAAAAAgAAAAAAAAAFAAAACAAAAAAAAAACAAAAAgAAAAMAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAUAAAAJAAAAAAAAAAIAAAACAAAAAwAAAAUAAAAAAAAAAAAAAAAAAAAAAAAACgAAAAIAAAACAAAAAAAAAAMAAAAOAAAAAgAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAgAAAAIAAAADAAAABgAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAgAAAAIAAAAAAAAAAwAAAAoAAAACAAAAAAAAAAIAAAADAAAAAQAAAAAAAAACAAAAAgAAAAMAAAAHAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAACAAAAAgAAAAAAAAADAAAACwAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAIAAAACAAAAAwAAAAgAAAAAAAAAAAAAAAAAAAAAAAAADQAAAAIAAAACAAAAAAAAAAMAAAAMAAAAAgAAAAAAAAACAAAAAwAAAAMAAAAAAAAAAgAAAAIAAAADAAAACQAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAgAAAAIAAAAAAAAAAwAAAA0AAAACAAAAAAAAAAIAAAADAAAABAAAAAAAAAACAAAAAgAAAAMAAAAKAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAACAAAAAgAAAAAAAAADAAAABgAAAAIAAAAAAAAAAgAAAAMAAAAPAAAAAAAAAAIAAAACAAAAAwAAAAsAAAAAAAAAAAAAAAAAAAAAAAAABgAAAAIAAAACAAAAAAAAAAMAAAAHAAAAAgAAAAAAAAACAAAAAwAAABAAAAAAAAAAAgAAAAIAAAADAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAgAAAAIAAAAAAAAAAwAAAAgAAAACAAAAAAAAAAIAAAADAAAAEQAAAAAAAAACAAAAAgAAAAMAAAANAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAACAAAAAgAAAAAAAAADAAAACQAAAAIAAAAAAAAAAgAAAAMAAAASAAAAAAAAAAIAAAACAAAAAwAAAA4AAAAAAAAAAAAAAAAAAAAAAAAACQAAAAIAAAACAAAAAAAAAAMAAAAFAAAAAgAAAAAAAAACAAAAAwAAABMAAAAAAAAAAgAAAAIAAAADAAAADwAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAgAAAAAAAAACAAAAAQAAABMAAAACAAAAAgAAAAAAAAAFAAAACgAAAAAAAAACAAAAAgAAAAMAAAAQAAAAAAAAAAAAAAAAAAAAAAAAABEAAAACAAAAAAAAAAIAAAABAAAADwAAAAIAAAACAAAAAAAAAAUAAAALAAAAAAAAAAIAAAACAAAAAwAAABEAAAAAAAAAAAAAAAAAAAAAAAAAEgAAAAIAAAAAAAAAAgAAAAEAAAAQAAAAAgAAAAIAAAAAAAAABQAAAAwAAAAAAAAAAgAAAAIAAAADAAAAEgAAAAAAAAAAAAAAAAAAAAAAAAATAAAAAgAAAAAAAAACAAAAAQAAABEAAAACAAAAAgAAAAAAAAAFAAAADQAAAAAAAAACAAAAAgAAAAMAAAATAAAAAAAAAAAAAAAAAAAAAAAAAA8AAAACAAAAAAAAAAIAAAABAAAAEgAAAAIAAAACAAAAAAAAAAUAAAAOAAAAAAAAAAIAAAACAAAAAwAAAAIAAAABAAAAAAAAAAEAAAACAAAAAAAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAAAAAAAgAAAAEAAAAAAAAAAQAAAAIAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAFAAAABAAAAAAAAAABAAAABQAAAAAAAAAAAAAABQAAAAQAAAAAAAAAAQAAAAUAAAAEAAAAAAAAAAUAAAAFAAAAAAAAAAEAAAAAAAAAAAAAAMuhRbbsNlBBYqHW9OmHIkF9XBuqnS31QAK37uYhNMhAOSo3UUupm0DC+6pc6JxvQHV9eseEEEJAzURsCyqlFEB8BQ4NMJjnPyy3tBoS97o/xawXQznRjj89J2K2CZxhP6vX43RIIDQ/S8isgygEBz+LvFHQkmzaPjFFFO7wMq4+AADMLkTtjkIAAOgkJqxhQgAAU7B0MjRCAADwpBcVB0IAAACYP2HaQQAAAIn/Ja5BzczM4Eg6gUHNzMxMU7BTQTMzMzNfgCZBAAAAAEi3+UAAAAAAwGPNQDMzMzMzy6BAmpmZmZkxc0AzMzMzM/N
2FQDMzMzMzMxlAzczMzMzM7D+ygXSx2U6RQKimJOvQKnpA23hmONTHY0A/AGcxyudNQNb3K647mzZA+S56rrwWIUAm4kUQ+9UJQKre9hGzh/M/BLvoy9WG3T+LmqMf8VHGP2m3nYNV37A/gbFHcyeCmT+cBPWBckiDP61tZACjKW0/q2RbYVUYVj8uDypVyLNAP6jGS5cA5zBBwcqhBdCNGUEGEhQ/JVEDQT6WPnRbNO1AB/AWSJgT1kDfUWNCNLDAQNk+5C33OqlAchWL34QSk0DKvtDIrNV8QNF0G3kFzGVASSeWhBl6UED+/0mNGuk4QGjA/dm/1CJALPLPMql6DEDSHoDrwpP1P2jouzWST+A/egAAAAAAAABKAwAAAAAAAPoWAAAAAAAAyqAAAAAAAAB6ZQQAAAAAAErGHgAAAAAA+mvXAAAAAADK8+MFAAAAAHqqOykAAAAASqmhIAEAAAD6oGvkBwAAAMpm8T43AAAAes+ZuIIBAABKrDQMkwoAAPq1cFUFSgAAyvkUViUGAgAAAAAAAwAAAAYAAAACAAAABQAAAAEAAAAEAAAAAAAAAAAAAAAFAAAAAwAAAAEAAAAGAAAABAAAAAIAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAA/////wAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAP////8AAAAAAAAAAAEAAAABAAAAAAAAAAAAAAD/////AAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAA/////wUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAP////8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/////////////////////////////////////AAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/////////////////////////////////////wAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAUAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP////////////////////////////////////8AAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAFAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEBAAAAAAABAAEAAAEBAAAAAAABAAAAAQAAAAEAAQAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAAAAAACAAAAAQAAAAMAAAAOAAAABgAAAAsAAAACAAAABwAAAAEAAAAYAAAABQAAAAoAAAABAAAABgAAAAAAAAAmAAAABwAAAAwAAAADAAAACAAAAAIAAAAxAAAACQAAAA4AAAAAAAAABQAAAAQAAAA6AAAACAAAAA0AAAAEAAAACQAAAAMAAAA/AAAACwAAAAYAAAAPAAAACgAAABAAAABIAAAADAAAAAcAAAAQAAAACwAAABEAAABTAAAACgAAAAUAAAATAAAADgAAAA8AAABhAAAADQAAAAgAAAARAAAADAAAABIAAABrAAAADgAAAAkAAAASAAAADQAAABMAAAB1AAAADwAAABMAAAARAAAAEgAAABAAAAAHAAAABwAAAAEAAAACAAAABAAAAAMAAAAAAAAAAAAAAAcAAAADAAAAAQAAAAIAAAAFAAAABAAAAAAAAAAAAAAAYWxnb3MuYwBfcG9seWZpbGxJbnRlcm5hbABhZGphY2VudEZhY2VEaXJbdG1wRmlqay5mYWNlXVtmaWprLmZhY2VdID09IEtJAGZhY2VpamsuYwBfZmFjZUlqa1BlbnRUb0dlb0JvdW5kYXJ5AGFkamFjZW50RmFjZURpcltjZW50ZXJJSksuZmFjZV1bZmFjZTJdID09IEtJAF9mYWNlSWprVG9HZW9Cb3VuZGFyeQBwb2x5Z29uLT5uZXh0ID09IE5VTEwAbGlua2VkR2VvLmMAYWRkTmV3TGlua2VkUG9seWdvbgBuZXh0ICE9IE5VTEwAbG9vcCAhPSBOVUxMAGFkZE5ld0xpbmtlZExvb3AAcG9seWdvbi0+Zmlyc3QgPT0gTlVMTABhZGRMaW5rZWRMb29wAGNvb3JkICE9IE5VTEwAYWRkTGlua2VkQ29vcmQAbG9vcC0+Zmlyc3QgPT0gTlVMTABpbm5lckxvb3BzICE9IE5VTEwAbm9ybWFsaXplTXVsdGlQb2x5Z29uAGJib3hlcyAhPSBOVUxMAGNhbmRpZGF0ZXMgIT0gTlVMTABmaW5kUG9seWdvbkZvckhvbGUAY2FuZGlkYXRlQkJveGVzICE9IE5VTEwAcmV2RGlyICE9IElOVkFMSURfRElHSVQAbG9jYWxpai5jAGgzVG9Mb2NhbElqawBiYXNlQ2VsbCAhPSBvcmlnaW5CYXNlQ2VsbAAhKG9yaWdpbk9uUGVudCAmJiBpbmRleE9uUGVudCkAcGVudGFnb25Sb3RhdGlvbnMgPj0gMABkaXJlY3Rpb25Sb3RhdGlvbnMgPj0gMABiYXNlQ2VsbCA9PSBvcmlnaW5CYXNlQ2VsbABiYXNlQ2VsbCAhPSBJTlZBTElEX0JBU0VfQ0VMTABsb2NhbElqa1RvSDMAIV9pc0Jhc2VDZWxsUGVudGFnb24oYmFzZUNlbGwpAGJhc2VDZWxsUm90YXRpb25zID49IDAAd2l0aGluUGVudGFnb25Sb3RhdGlvbnMgPj0gMABncmFwaC0+YnVja2V0cyAhPSBOVUxMAHZlcnRleEdyYXBoLmMAaW5pdFZlcnRleEdyYXBoAG5vZGUgIT0gTlVMTABhZGRWZXJ0ZXhOb2Rl";function j(t){return t}function V(t){return t.replace(/\b__Z[\w\d_]+/g,(function(t){return t===t?t:t+" ["+t+"]"}))}function H(){var t=new Error;if(!t.stack){try{throw new Error(0)}catch(e){t=e}if(!t.stack)return"(no stack trace available)"}return t.stack.toString()}function J(){return m.length}function W(t){try{var e=new ArrayBuffer(t);if(e.byteLength!=t)return;return new Int8Array(e).set(m),tt(e),C(e),1}catch(i){}}var Q="function"===typeof atob?atob:function(t){var e,i,n,r,o,s,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l="",c=0;t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{e=a.indexOf(t.charAt(c++))<<2|(r=a.indexOf(t.charAt(c++)))>>4,i=(15&r)<<4|(o=a.indexOf(t.charAt(c++)))>>2,n=(3&o)<<6|(s=a.indexOf(t.charAt(c++))),l+=String.fromCharCode(e),64!==o&&(l+=String.fromCharCode(i)),64!==s&&(l+=String.fromCharCode(n))}while(c<t.length);return l};function q(t){if(Z(t))return function(t){try{for(var e=Q(t),i=new Uint8Array(e.length),n=0;n<e.length;++n)i[n]=e.charCodeAt(n);return i}catch(r){throw new Error("Converting base64 string to bytes failed.")}}(t.slice(G.length))}var K,X,Y={a:ct,b:function(t){c=t}
2,c:u,d:function(t,e,i,n){ct("Assertion failed: "+f(t)+", at: "+[e?f(e):"unknown filename",i,n?f(n):"unknown function"])},e:function(t){return i.___errno_location&&(_[i.___errno_location()>>2]=t),t},f:J,g:function(t,e,i){y.set(y.subarray(e,e+i),t)},h:function(t){var e=J(),i=16777216,n=2130706432;if(t>n)return!1;for(var r=Math.max(e,16777216);r<t;)r=r<=536870912?w(2*r,i):Math.min(w((3*r+2147483648)/4,i),n);return!!W(r)},i:function(t){ct("OOM")},j:j,k:V,l:W,m:H,n:function(){var t=H();return i.extraStackTrace&&(t+="\n"+i.extraStackTrace()),V(t)},o:24032,p:24016},$=function(t,e,i){var n=new t.Int8Array(i),r=new t.Int32Array(i),o=(new t.Uint8Array(i),new t.Float32Array(i),new t.Float64Array(i)),s=0|e.p,a=t.Math.floor,l=t.Math.abs,c=t.Math.sqrt,u=t.Math.pow,h=t.Math.cos,d=t.Math.sin,p=t.Math.tan,A=t.Math.acos,f=t.Math.asin,g=t.Math.atan,m=t.Math.atan2,y=t.Math.ceil,v=t.Math.imul,_=t.Math.min,b=t.Math.clz32,x=e.b,w=e.c,C=e.d,B=e.e,E=e.f,S=e.g,T=e.h,M=e.i,I=24048;function P(t,e,i,n){var r,o;0|D(t|=0,e|=0,i|=0,n|=0,0)&&(Me(0|n,0,(o=1+(0|v(3*i|0,i+1|0))|0)<<3|0),(r=0|ve(o,4))&&(L(t,e,i,n,r,o,0),ye(r)))}function D(t,e,i,n,o){t|=0,e|=0,i|=0,o|=0;var s,a=0,l=0,c=0,u=0,h=0,d=0,p=0,A=0;if(s=I,I=I+16|0,A=s,r[(a=n|=0)>>2]=t,r[a+4>>2]=e,(a=0!=(0|o))&&(r[o>>2]=0),0|Ot(t,e))return I=s,0|(A=1);r[A>>2]=0;t:do{if((0|i)>=1)if(a)for(h=0,d=1,p=1,l=0,a=t;;){if(!(l|h)){if(0==(0|(a=0|O(a,e,4,A)))&0==(0|(e=0|w()))){a=2;break t}if(0|Ot(a,e)){a=1;break t}}if(0==(0|(a=0|O(a,e,0|r[16+(h<<2)>>2],A)))&0==(0|(e=0|w()))){a=2;break t}if(r[(t=n+(p<<3)|0)>>2]=a,r[t+4>>2]=e,r[o+(p<<2)>>2]=d,t=(0|(l=l+1|0))==(0|d),u=6==(0|(c=h+1|0)),0|Ot(a,e)){a=1;break t}if((0|(d=d+(u&t&1)|0))>(0|i)){a=0;break}h=t?u?0:c:h,p=p+1|0,l=t?0:l}else for(h=0,d=1,p=1,l=0,a=t;;){if(!(l|h)){if(0==(0|(a=0|O(a,e,4,A)))&0==(0|(e=0|w()))){a=2;break t}if(0|Ot(a,e)){a=1;break t}}if(0==(0|(a=0|O(a,e,0|r[16+(h<<2)>>2],A)))&0==(0|(e=0|w()))){a=2;break t}if(r[(t=n+(p<<3)|0)>>2]=a,r[t+4>>2]=e,t=(0|(l=l+1|0))==(0|d),u=6==(0|(c=h+1|0)),0|Ot(a,e)){a=1;break t}if((0|(d=d+(u&t&1)|0))>(0|i)){a=0;break}h=t?u?0:c:h,p=p+1|0,l=t?0:l}else a=0}while(0);return I=s,0|(A=a)}function L(t,e,i,n,o,s,a){i|=0,n|=0,o|=0,s|=0,a|=0;var l,c,u=0,h=0,d=0,p=0,A=0;if(c=I,I=I+16|0,l=c,0==(0|(t|=0))&0==(0|(e|=0)))I=c;else{if(u=0|we(0|t,0|e,0|s,((0|s)<0)<<31>>31|0),w(),!(0==(0|(A=0|r[(p=h=n+(u<<3)|0)>>2]))&0==(0|(p=0|r[p+4>>2]))|(d=(0|A)==(0|t)&(0|p)==(0|e))))do{d=(0|(p=0|r[(A=h=n+((u=(u+1|0)%(0|s)|0)<<3)|0)>>2]))==(0|t)&(0|(A=0|r[A+4>>2]))==(0|e)}while(!(0==(0|p)&0==(0|A)|d));u=o+(u<<2)|0,d&&(0|r[u>>2])<=(0|a)||(r[(A=h)>>2]=t,r[A+4>>2]=e,r[u>>2]=a,(0|a)>=(0|i)||(A=a+1|0,r[l>>2]=0,L(p=0|O(t,e,2,l),0|w(),i,n,o,s,A),r[l>>2]=0,L(p=0|O(t,e,3,l),0|w(),i,n,o,s,A),r[l>>2]=0,L(p=0|O(t,e,1,l),0|w(),i,n,o,s,A),r[l>>2]=0,L(p=0|O(t,e,5,l),0|w(),i,n,o,s,A),r[l>>2]=0,L(p=0|O(t,e,4,l),0|w(),i,n,o,s,A),r[l>>2]=0,L(p=0|O(t,e,6,l),0|w(),i,n,o,s,A))),I=c}}function O(t,e,i,n){t|=0,e|=0,i|=0;var o,s,a=0,l=0,c=0,u=0,h=0,d=0,p=0;if((0|r[(n|=0)>>2])>0){a=0;do{i=0|lt(i),a=a+1|0}while((0|a)<(0|r[n>>2]))}o=0|Ce(0|t,0|e,45),w(),s=127&o,l=0|Ft(t,e),a=0|Ce(0|t,0|e,52),w(),a&=15;t:do{if(a)for(;;){if(d=0|Ce(0|t,0|e,0|(h=3*(15-a|0)|0)),w(),d&=7,p=0==(0|Nt(a)),a=a+-1|0,u=0|Be(7,0,0|h),e&=~(0|w()),t=(h=0|Be(0|r[(p?464:48)+(28*d|0)+(i<<2)>>2],0,0|h))|t&~u,e|=0|w(),!(i=0|r[(p?672:256)+(28*d|0)+(i<<2)>>2])){i=0;break t}if(!a){c=6;break}}else c=6}while(0);6==(0|c)&&(t|=d=0|Be(0|(p=0|r[880+(28*s|0)+(i<<2)>>2]),0,45),e=0|w()|-1040385&e,i=0|r[4304+(28*s|0)+(i<<2)>>2],127==(127&p|0)&&(p=0|Be(0|r[880+(28*s|0)+20>>2],0,45),e=0|w()|-1040385&e,i=0|r[4304+(28*s|0)+20>>2],t=0|kt(p|t,e),e=0|w(),r[n>>2]=1+(0|r[n>>2]))),c=0|Ce(0|t,0|e,45),w(),c&=127;t:do{if(0|R(c)){e:do{if(1==(0|Ft(t,e))){if((0|s)!=(0|c)){if(0|N(c,0|r[7728+(28*s|0)>>2])){t=0|Ut(t,e),l=1,e=0|w();break}t=0|kt(t,e),l=1,e=0|w();break}switch(0|l){case 5:t=0|Ut(t,e),e=0|w(),r[n>>2]=5+(0|r[n>>2]),l=0;break e;case 3:t=0|kt(t,e),e=0|w(),r[n>>2]=1+(0|r[n>>2]),l=0;break e;default:return p=0,x(0|(d=0)),0|p}}else l=0}while(0);if((0|i)>0){a=0;do{t=0|Rt(t,e),e=0|w(),a=a+1|0}while((0|a)!=(0|i))}if((0|s)!=(0|c)){if(!(0|k(c))){if(0!=(0|l)|5!=(0|Ft(t,e)))break;r[n>>2]=1+(0|r[n>>2]);break}switch(127&o){case 8:case 118:break t}3!=(0|Ft(t,e))&&(r[n>>2]=1+(0|r[n>>2]))}}else if((0|i)>0){a=0;do{t=0|kt(t,e),e=0|w(),a=a+1|0}while((0|a)!=(0|i))}}while(0);return r[n>>2]=((0|r[n>>2])+i|0)%6|0,p=t,x(0|(d=e)),0|p}function F(t,e,i,n,s,a){e|=0,i|=0,n|=0,s|=0,a|=0;var l,c,u,h,d,p,A,f,g,m=0,y=0,v=0,_=0,b=0,x=0,C=0,B=0,E=0,S=0,T=0,M=0,P=0,D=0;if(g=I,I=I+48|0,p=g+32|0,A=g+16|0,f=g,(0|(m=0|r[(t|=0)>>2]))<=0)return I=g,0|(M=0);l=t+4|0,c=p+8|0,u=A+8|0,h=f+8|0,d=((0|e)<0)<<31>>31,T=0;t:for(;;){E=(y=0|r[l>>2])+(T<<4)|0,r[p>>2]=r[E>>2],r[p+4>>2]=r[E+4>>2],r[p+8>>2]=r[E+8>>2],r[p+12>>2]=r[E+12>>2],(0|T)==(m+-1|0)?(r[A>>2]=r[y>>2],r[A+4>>2]=r[y+4>>2],r[A+8>>2]=r[y+8>>2],r[A+12>>2]=r[y+12>>2]):(E=y+(T+1<<4)|0,r[A>>2]=r[E>>2],r[A+4>>2]=r[E+4>>2],r[A+8>>2]=r[E+8>>2],r[A+12>>2]=r[E+12>>2]),E=0|J(p,A,i);e:do{if((0|E)>0){S=+(0|E),B=0;i:for(;;){D=+(E-B|0),P=+(0|B),o[f>>3]=+o[p>>3]*D/S+ +o[A>>3]*P/S,o[h>>3]=+o[c>>3]*D/S+ +o[u>>3]*P/S,y=0|we(0|(x=0|Gt(f,i)),0|(C=0|w()),0|e,0|d),w(),_=0|r[(v=m=a+(y<<3)|0)>>2],v=0|r[v+4>>2];
2n:do{if(0==(0|_)&0==(0|v))M=14;else for(b=0;;){if((0|b)>(0|e)){m=1;break n}if((0|_)==(0|x)&(0|v)==(0|C)){m=7;break n}if(0==(0|(_=0|r[(v=m=a+((y=(y+1|0)%(0|e)|0)<<3)|0)>>2]))&0==(0|(v=0|r[v+4>>2]))){M=14;break}b=b+1|0}}while(0);switch(14==(0|M)&&(M=0,0==(0|x)&0==(0|C)?m=7:(r[m>>2]=x,r[m+4>>2]=C,m=0|r[n>>2],r[(b=s+(m<<3)|0)>>2]=x,r[b+4>>2]=C,r[n>>2]=m+1,m=0)),7&m){case 7:case 0:break;default:break i}if((0|E)<=(0|(B=B+1|0))){M=8;break e}}if(0|m){m=-1,M=20;break t}}else M=8}while(0);if(8==(0|M)&&(M=0),(0|(T=T+1|0))>=(0|(m=0|r[t>>2]))){m=0,M=20;break}}return 20==(0|M)?(I=g,0|m):0}function R(t){return 0|r[7728+(28*(t|=0)|0)+16>>2]}function k(t){return 4==(0|(t|=0))|117==(0|t)|0}function z(t){return 0|r[11152+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)>>2]}function U(t){return 0|r[11152+(216*(0|r[(t|=0)>>2])|0)+(72*(0|r[t+4>>2])|0)+(24*(0|r[t+8>>2])|0)+(r[t+12>>2]<<3)+4>>2]}function N(t,e){return e|=0,(0|r[7728+(28*(t|=0)|0)+20>>2])==(0|e)?0|(e=1):0|(e=(0|r[7728+(28*t|0)+24>>2])==(0|e))}function G(t,e){return 0|r[880+(28*(t|=0)|0)+((e|=0)<<2)>>2]}function Z(t,e){return e|=0,(0|r[880+(28*(t|=0)|0)>>2])==(0|e)?0|(e=0):(0|r[880+(28*t|0)+4>>2])==(0|e)?0|(e=1):(0|r[880+(28*t|0)+8>>2])==(0|e)?0|(e=2):(0|r[880+(28*t|0)+12>>2])==(0|e)?0|(e=3):(0|r[880+(28*t|0)+16>>2])==(0|e)?0|(e=4):(0|r[880+(28*t|0)+20>>2])==(0|e)?0|(e=5):0|((0|r[880+(28*t|0)+24>>2])==(0|e)?6:7)}function j(t){return+o[(t|=0)+16>>3]<+o[t+24>>3]|0}function V(t,e){t|=0;var i,n,r=0;return(r=+o[(e|=0)>>3])>=+o[t+8>>3]&&r<=+o[t>>3]?(i=+o[t+16>>3],r=+o[t+24>>3],e=(n=+o[e+8>>3])>=r,t=n<=i&1,i<r?e&&(t=1):e||(t=0),0|(e=0!=(0|t))):0|(e=0)}function H(t,e){t|=0,e|=0;var i,n,s,a,c,u,h=0,d=0;a=I,I=I+288|0,i=a+264|0,n=a+96|0,d=(h=s=a)+96|0;do{r[h>>2]=0,h=h+4|0}while((0|h)<(0|d));return Jt(e,s),Vt(d=0|r[(h=s)>>2],h=0|r[h+4>>2],i),Ht(d,h,n),c=+Tt(i,n+8|0),o[i>>3]=+o[t>>3],o[(h=i+8|0)>>3]=+o[t+16>>3],o[n>>3]=+o[t+8>>3],o[(d=n+8|0)>>3]=+o[t+24>>3],u=+Tt(i,n),d=~~+y(+u*u/+Ee(+ +l(+(+o[h>>3]-+o[d>>3])/(+o[i>>3]-+o[n>>3])),3)/(c*(2.59807621135*c)*.8)),I=a,0|(0==(0|d)?1:d)}function J(t,e,i){t|=0,e|=0,i|=0;var n,o,s,a,l,c=0,u=0;a=I,I=I+288|0,n=a+264|0,o=a+96|0,u=(c=s=a)+96|0;do{r[c>>2]=0,c=c+4|0}while((0|c)<(0|u));return Jt(i,s),Vt(c=0|r[(u=s)>>2],u=0|r[u+4>>2],n),Ht(c,u,o),l=+Tt(n,o+8|0),u=~~+y(+ +Tt(t,e)/(2*l)),I=a,0|(0==(0|u)?1:u)}function W(t,e,i,n){e|=0,i|=0,n|=0,r[(t|=0)>>2]=e,r[t+4>>2]=i,r[t+8>>2]=n}function Q(t,e){t|=0;var i,n,s,a,c=0,u=0,h=0,d=0,p=0,A=0,f=0;r[(a=(e|=0)+8|0)>>2]=0,n=+o[t>>3],d=+l(+n),s=+o[t+8>>3],d+=.5*(p=+l(+s)/.8660254037844386),d-=+(0|(c=~~d)),p-=+(0|(t=~~p));do{if(d<.5){if(d<.3333333333333333){if(r[e>>2]=c,p<.5*(d+1)){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(t=(1&!(p<(f=1-d)))+t|0,r[e+4>>2]=t,f<=p&p<2*d){c=c+1|0,r[e>>2]=c;break}r[e>>2]=c;break}if(!(d<.6666666666666666)){if(c=c+1|0,r[e>>2]=c,p<.5*d){r[e+4>>2]=t;break}t=t+1|0,r[e+4>>2]=t;break}if(p<1-d){if(r[e+4>>2]=t,2*d-1<p){r[e>>2]=c;break}}else t=t+1|0,r[e+4>>2]=t;c=c+1|0,r[e>>2]=c}while(0);do{if(n<0){if(1&t){c=~~(+(0|c)-(2*(+((A=0|_e(0|c,((0|c)<0)<<31>>31|0,0|(A=(t+1|0)/2|0),((0|A)<0)<<31>>31|0))>>>0)+4294967296*+(0|w()))+1)),r[e>>2]=c;break}c=~~(+(0|c)-2*(+((A=0|_e(0|c,((0|c)<0)<<31>>31|0,0|(A=(0|t)/2|0),((0|A)<0)<<31>>31|0))>>>0)+4294967296*+(0|w()))),r[e>>2]=c;break}}while(0);A=e+4|0,s<0&&(c=c-((1|t<<1)/2|0)|0,r[e>>2]=c,t=0-t|0,r[A>>2]=t),u=t-c|0,(0|c)<0?(h=0-c|0,r[A>>2]=u,r[a>>2]=h,r[e>>2]=0,t=u,c=0):h=0,(0|t)<0&&(c=c-t|0,r[e>>2]=c,h=h-t|0,r[a>>2]=h,r[A>>2]=0,t=0),i=c-h|0,u=t-h|0,(0|h)<0&&(r[e>>2]=i,r[A>>2]=u,r[a>>2]=0,t=u,c=i,h=0),(0|(u=(0|h)<(0|(u=(0|t)<(0|c)?t:c))?h:u))<=0||(r[e>>2]=c-u,r[A>>2]=t-u,r[a>>2]=h-u)}function q(t){var e,i=0,n=0,o=0,s=0,a=0;i=0|r[(t|=0)>>2],n=0|r[(e=t+4|0)>>2],(0|i)<0&&(n=n-i|0,r[e>>2]=n,r[(a=t+8|0)>>2]=(0|r[a>>2])-i,r[t>>2]=0,i=0),(0|n)<0?(i=i-n|0,r[t>>2]=i,s=(0|r[(a=t+8|0)>>2])-n|0,r[a>>2]=s,r[e>>2]=0,n=0):(a=s=t+8|0,s=0|r[s>>2]),(0|s)<0&&(i=i-s|0,r[t>>2]=i,n=n-s|0,r[e>>2]=n,r[a>>2]=0,s=0),(0|(o=(0|s)<(0|(o=(0|n)<(0|i)?n:i))?s:o))<=0||(r[t>>2]=i-o,r[e>>2]=n-o,r[a>>2]=s-o)}function K(t,e){e|=0;var i,n;n=0|r[(t|=0)+8>>2],i=+((0|r[t+4>>2])-n|0),o[e>>3]=+((0|r[t>>2])-n|0)-.5*i,o[e+8>>3]=.8660254037844386*i}
vendor: 16,908 bytes, line 2
2function X(t,e,i){t|=0,e|=0,r[(i|=0)>>2]=(0|r[e>>2])+(0|r[t>>2]),r[i+4>>2]=(0|r[e+4>>2])+(0|r[t+4>>2]),r[i+8>>2]=(0|r[e+8>>2])+(0|r[t+8>>2])}function Y(t,e,i){t|=0,e|=0,r[(i|=0)>>2]=(0|r[t>>2])-(0|r[e>>2]),r[i+4>>2]=(0|r[t+4>>2])-(0|r[e+4>>2]),r[i+8>>2]=(0|r[t+8>>2])-(0|r[e+8>>2])}function $(t,e){e|=0;var i,n=0;n=0|v(0|r[(t|=0)>>2],e),r[t>>2]=n,i=0|v(0|r[(n=t+4|0)>>2],e),r[n>>2]=i,e=0|v(0|r[(t=t+8|0)>>2],e),r[t>>2]=e}function tt(t){var e,i,n=0,o=0,s=0,a=0,l=0;l=(0|(i=0|r[(t|=0)>>2]))<0,t=(t=(o=(0|(a=((e=(0|(s=(0|r[t+4>>2])-(l?i:0)|0))<0)?0-s|0:0)+((0|r[t+8>>2])-(l?i:0))|0))<0)?0:a)-((s=(0|(o=(0|t)<(0|(o=(0|(n=(e?0:s)-(o?a:0)|0))<(0|(a=(l?0:i)-(e?s:0)-(o?a:0)|0))?n:a))?t:o))>0)?o:0)|0,n=n-(s?o:0)|0;t:do{switch(a-(s?o:0)|0){case 0:switch(0|n){case 0:return 0|(l=0==(0|t)?0:1==(0|t)?1:7);case 1:return 0|(l=0==(0|t)?2:1==(0|t)?3:7);default:break t}case 1:switch(0|n){case 0:return 0|(l=0==(0|t)?4:1==(0|t)?5:7);case 1:if(t)break t;return 0|(t=6);default:break t}}}while(0);return 0|(l=7)}function et(t){var e,i,n=0,o=0,s=0,a=0,l=0;o=0|r[(e=(t|=0)+8|0)>>2],s=0|ge(+((3*(n=(0|r[t>>2])-o|0)|0)-(o=(0|r[(i=t+4|0)>>2])-o|0)|0)/7),r[t>>2]=s,n=0|ge(+((o<<1)+n|0)/7),r[i>>2]=n,r[e>>2]=0,o=n-s|0,(0|s)<0?(l=0-s|0,r[i>>2]=o,r[e>>2]=l,r[t>>2]=0,n=o,s=0,o=l):o=0,(0|n)<0&&(s=s-n|0,r[t>>2]=s,o=o-n|0,r[e>>2]=o,r[i>>2]=0,n=0),l=s-o|0,a=n-o|0,(0|o)<0?(r[t>>2]=l,r[i>>2]=a,r[e>>2]=0,n=a,a=l,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|n)<(0|a)?n:a))?o:s))<=0||(r[t>>2]=a-s,r[i>>2]=n-s,r[e>>2]=o-s)}function it(t){var e,i,n=0,o=0,s=0,a=0,l=0;o=0|r[(e=(t|=0)+8|0)>>2],s=0|ge(+(((n=(0|r[t>>2])-o|0)<<1)+(o=(0|r[(i=t+4|0)>>2])-o|0)|0)/7),r[t>>2]=s,n=0|ge(+((3*o|0)-n|0)/7),r[i>>2]=n,r[e>>2]=0,o=n-s|0,(0|s)<0?(l=0-s|0,r[i>>2]=o,r[e>>2]=l,r[t>>2]=0,n=o,s=0,o=l):o=0,(0|n)<0&&(s=s-n|0,r[t>>2]=s,o=o-n|0,r[e>>2]=o,r[i>>2]=0,n=0),l=s-o|0,a=n-o|0,(0|o)<0?(r[t>>2]=l,r[i>>2]=a,r[e>>2]=0,n=a,a=l,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|n)<(0|a)?n:a))?o:s))<=0||(r[t>>2]=a-s,r[i>>2]=n-s,r[e>>2]=o-s)}function nt(t){var e,i,n,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],s=0|r[(i=t+4|0)>>2],a=0|r[(n=t+8|0)>>2],l=s+(3*o|0)|0,r[t>>2]=l,s=a+(3*s|0)|0,r[i>>2]=s,o=(3*a|0)+o|0,r[n>>2]=o,a=s-l|0,(0|l)<0?(o=o-l|0,r[i>>2]=a,r[n>>2]=o,r[t>>2]=0,s=a,a=0):a=l,(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[n>>2]=o,r[i>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[i>>2]=l,r[n>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[i>>2]=l-s,r[n>>2]=o-s)}function rt(t){var e,i,n,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=(3*(o=0|r[(i=t+4|0)>>2])|0)+l|0,l=(s=0|r[(n=t+8|0)>>2])+(3*l|0)|0,r[t>>2]=l,r[i>>2]=a,o=(3*s|0)+o|0,r[n>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[i>>2]=s,r[n>>2]=o,r[t>>2]=0,l=0):s=a,(0|s)<0&&(l=l-s|0,r[t>>2]=l,o=o-s|0,r[n>>2]=o,r[i>>2]=0,s=0),e=l-o|0,a=s-o|0,(0|o)<0?(r[t>>2]=e,r[i>>2]=a,r[n>>2]=0,l=e,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|a)<(0|l)?a:l))?o:s))<=0||(r[t>>2]=l-s,r[i>>2]=a-s,r[n>>2]=o-s)}function ot(t,e){t|=0;var i,n,o,s=0,a=0,l=0;((e|=0)+-1|0)>>>0>=6||(l=(0|r[15472+(12*e|0)>>2])+(0|r[t>>2])|0,r[t>>2]=l,o=t+4|0,a=(0|r[15472+(12*e|0)+4>>2])+(0|r[o>>2])|0,r[o>>2]=a,n=t+8|0,e=(0|r[15472+(12*e|0)+8>>2])+(0|r[n>>2])|0,r[n>>2]=e,s=a-l|0,(0|l)<0?(e=e-l|0,r[o>>2]=s,r[n>>2]=e,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,e=e-s|0,r[n>>2]=e,r[o>>2]=0,s=0),i=a-e|0,l=s-e|0,(0|e)<0?(r[t>>2]=i,r[o>>2]=l,r[n>>2]=0,a=i,e=0):l=s,(0|(s=(0|e)<(0|(s=(0|l)<(0|a)?l:a))?e:s))<=0||(r[t>>2]=a-s,r[o>>2]=l-s,r[n>>2]=e-s))}function st(t){var e,i,n,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=(o=0|r[(i=t+4|0)>>2])+l|0,l=(s=0|r[(n=t+8|0)>>2])+l|0,r[t>>2]=l,r[i>>2]=a,o=s+o|0,r[n>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[i>>2]=s,r[n>>2]=o,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[n>>2]=o,r[i>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[i>>2]=l,r[n>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[i>>2]=l-s,r[n>>2]=o-s)}function at(t){var e,i,n,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],a=0|r[(i=t+4|0)>>2],s=0|r[(n=t+8|0)>>2],l=a+o|0,r[t>>2]=l,a=s+a|0,r[i>>2]=a,o=s+o|0,r[n>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[i>>2]=s,r[n>>2]=o,r[t>>2]=0,a=0):(s=a,a=l),(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[n>>2]=o,r[i>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[i>>2]=l,r[n>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[i>>2]=l-s,r[n>>2]=o-s)}function lt(t){switch(0|(t|=0)){case 1:t=5;break;case 5:t=4;break;case 4:t=6;break;case 6:t=2;break;case 2:t=3;break;case 3:t=1}return 0|t}function ct(t){switch(0|(t|=0)){case 1:t=3;break;case 3:t=2;break;case 2:t=6;break;case 6:t=4;break;case 4:t=5;break;case 5:t=1}return 0|t}function ut(t){var e,i,n,o=0,s=0,a=0,l=0;o=0|r[(t|=0)>>2],s=0|r[(i=t+4|0)>>2],a=0|r[(n=t+8|0)>>2],l=s+(o<<1)|0,r[t>>2]=l,s=a+(s<<1)|0,r[i>>2]=s,o=(a<<1)+o|0,r[n>>2]=o,a=s-l|0,(0|l)<0?(o=o-l|0,r[i>>2]=a,r[n>>2]=o,r[t>>2]=0,s=a,a=0):a=l,(0|s)<0&&(a=a-s|0,r[t>>2]=a,o=o-s|0,r[n>>2]=o,r[i>>2]=0,s=0),e=a-o|0,l=s-o|0,(0|o)<0?(r[t>>2]=e,r[i>>2]=l,r[n>>2]=0,a=e,o=0):l=s,(0|(s=(0|o)<(0|(s=(0|l)<(0|a)?l:a))?o:s))<=0||(r[t>>2]=a-s,r[i>>2]=l-s,r[n>>2]=o-s)}function ht(t){var e,i,n,o=0,s=0,a=0,l=0;l=0|r[(t|=0)>>2],a=((o=0|r[(i=t+4|0)>>2])<<1)+l|0,l=(s=0|r[(n=t+8|0)>>2])+(l<<1)|0,r[t>>2]=l,r[i>>2]=a,o=(s<<1)+o|0,r[n>>2]=o,s=a-l|0,(0|l)<0?(o=o-l|0,r[i>>2]=s,r[n>>2]=o,r[t>>2]=0,l=0):s=a,(0|s)<0&&(l=l-s|0,r[t>>2]=l,o=o-s|0,r[n>>2]=o,r[i>>2]=0,s=0),e=l-o|0,a=s-o|0,(0|o)<0?(r[t>>2]=e,r[i>>2]=a,r[n>>2]=0,l=e,o=0):a=s,(0|(s=(0|o)<(0|(s=(0|a)<(0|l)?a:l))?o:s))<=0||(r[t>>2]=l-s,r[i>>2]=a-s,r[n>>2]=o-s)}function dt(t,e){e|=0;var i,n,o,s=0,a=0,l=0;return o=(0|(n=(0|r[(t|=0)>>2])-(0|r[e>>2])|0))<0,i=(0|(a=(0|r[t+4>>2])-(0|r[e+4>>2])-(o?n:0)|0))<0,e=(e=(t=(0|(l=(o?0-n|0:0)+(0|r[t+8>>2])-(0|r[e+8>>2])+(i?0-a|0:0)|0))<0)?0:l)-((a=(0|(t=(0|e)<(0|(t=(0|(s=(i?0:a)-(t?l:0)|0))<(0|(l=(o?0:n)-(i?a:0)-(t?l:0)|0))?s:l))?e:t))>0)?t:0)|0,s=s-(a?t:0)|0,0|((0|(t=(0|(t=l-(a?t:0)|0))>-1?t:0-t|0))>(0|(e=(0|(s=(0|s)>-1?s:0-s|0))>(0|(e=(0|e)>-1?e:0-e|0))?s:e))?t:e)}function pt(t,e){e|=0;var i;i=0|r[(t|=0)+8>>2],r[e>>2]=(0|r[t>>2])-i,r[e+4>>2]=(0|r[t+4>>2])-i}function At(t,e){e|=0;var i,n,o,s=0,a=0,l=0;a=0|r[(t|=0)>>2],r[e>>2]=a,t=0|r[t+4>>2],r[(n=e+4|0)>>2]=t,r[(o=e+8|0)>>2]=0,s=t-a|0,(0|a)<0?(t=0-a|0,r[n>>2]=s,r[o>>2]=t,r[e>>2]=0,a=0):(s=t,t=0),(0|s)<0&&(a=a-s|0,r[e>>2]=a,t=t-s|0,r[o>>2]=t,r[n>>2]=0,s=0),i=a-t|0,l=s-t|0,(0|t)<0?(r[e>>2]=i,r[n>>2]=l,r[o>>2]=0,s=l,l=i,t=0):l=a,(0|(a=(0|t)<(0|(a=(0|s)<(0|l)?s:l))?t:a))<=0||(r[e>>2]=l-a,r[n>>2]=s-a,r[o>>2]=t-a)}function ft(t){var e,i,n,o;i=(o=0|r[(e=(t|=0)+8|0)>>2])-(0|r[t>>2])|0,r[t>>2]=i,t=(0|r[(n=t+4|0)>>2])-o|0,r[n>>2]=t,r[e>>2]=0-(t+i)}function gt(t){var e,i,n=0,o=0,s=0,a=0,l=0;n=0-(o=0|r[(t|=0)>>2])|0,r[t>>2]=n,r[(e=t+8|0)>>2]=0,a=(s=0|r[(i=t+4|0)>>2])+o|0,(0|o)>0?(r[i>>2]=a,r[e>>2]=o,r[t>>2]=0,n=0,s=a):o=0,(0|s)<0?(l=n-s|0,r[t>>2]=l,o=o-s|0,r[e>>2]=o,r[i>>2]=0,a=l-o|0,n=0-o|0,(0|o)<0?(r[t>>2]=a,r[i>>2]=n,r[e>>2]=0,s=n,o=0):(s=0,a=l)):a=n,(0|(n=(0|o)<(0|(n=(0|s)<(0|a)?s:a))?o:n))<=0||(r[t>>2]=a-n,r[i>>2]=s-n,r[e>>2]=o-n)}function mt(t,e,i,n){e|=0,i|=0,n|=0;var s,a=0,l=0,c=0,u=0;if(s=I,I=I+32|0,function(t,e){t|=0,e|=0;var i=0,n=0,r=0;i=+o[t>>3],n=+h(+i),i=+d(+i),o[e+16>>3]=i,i=+o[t+8>>3],r=n*+h(+i),o[e>>3]=r,i=n*+d(+i),o[e+8>>3]=i}(t|=0,l=s),r[i>>2]=0,a=+le(15888,l),(c=+le(15912,l))<a&&(r[i>>2]=1,a=c),(c=+le(15936,l))<a&&(r[i>>2]=2,a=c),(c=+le(15960,l))<a&&(r[i>>2]=3,a=c),(c=+le(15984,l))<a&&(r[i>>2]=4,a=c),(c=+le(16008,l))<a&&(r[i>>2]=5,a=c),(c=+le(16032,l))<a&&(r[i>>2]=6,a=c),(c=+le(16056,l))<a&&(r[i>>2]=7,a=c),(c=+le(16080,l))<a&&(r[i>>2]=8,a=c),(c=+le(16104,l))<a&&(r[i>>2]=9,a=c),(c=+le(16128,l))<a&&(r[i>>2]=10,a=c),(c=+le(16152,l))<a&&(r[i>>2]=11,a=c),(c=+le(16176,l))<a&&(r[i>>2]=12,a=c),(c=+le(16200,l))<a&&(r[i>>2]=13,a=c),(c=+le(16224,l))<a&&(r[i>>2]=14,a=c),(c=+le(16248,l))<a&&(r[i>>2]=15,a=c),(c=+le(16272,l))<a&&(r[i>>2]=16,a=c),(c=+le(16296,l))<a&&(r[i>>2]=17,a=c),(c=+le(16320,l))<a&&(r[i>>2]=18,a=c),(c=+le(16344,l))<a&&(r[i>>2]=19,a=c),(c=+A(+(1-.5*a)))<1e-16)return r[n>>2]=0,r[n+4>>2]=0,r[n+8>>2]=0,r[n+12>>2]=0,void(I=s);if(i=0|r[i>>2],a=+Et((a=+o[16368+(24*i|0)>>3])-+Et(+function(t,e){t|=0,e|=0;var i=0,n=0,r=0,s=0,a=0;return s=+o[e>>3],n=+h(+s),r=+o[e+8>>3]-+o[t+8>>3],a=n*+d(+r),i=+o[t>>3],+ +m(+a,+(+d(+s)*+h(+i)-+h(+r)*(n*+d(+i))))}(15568+(i<<4)|0,t))),u=0|Nt(e)?+Et(a+-.3334731722518321):a,a=+p(+c)/.381966011250105,(0|e)>0){l=0;do{a*=2.6457513110645907,l=l+1|0}while((0|l)!=(0|e))}c=+h(+u)*a,o[n>>3]=c,u=+d(+u)*a,o[n+8>>3]=u,I=s}function yt(t,e,i,n,s){e|=0,i|=0,n|=0,s|=0;var a=0,u=0;if(a=+function(t){t|=0;var e=0,i=0;return i=+o[t>>3],e=+o[t+8>>3],+ +c(+(i*i+e*e))}(t|=0),a<1e-16)return e=15568+(e<<4)|0,r[s>>2]=r[e>>2],r[s+4>>2]=r[e+4>>2],r[s+8>>2]=r[e+8>>2],void(r[s+12>>2]=r[e+12>>2]);if(u=+m(+ +o[t+8>>3],+ +o[t>>3]),(0|i)>0){t=0;do{a/=2.6457513110645907,t=t+1|0}while((0|t)!=(0|i))}n?(a/=3,i=0==(0|Nt(i)),a=+g(.381966011250105*(i?a:a/2.6457513110645907))):(a=+g(.381966011250105*a),0|Nt(i)&&(u=+Et(u+.3334731722518321))),function(t,e,i,n){t|=0,e=+e,i=+i,n|=0;var s=0,a=0,c=0,u=0;if(i<1e-16)return r[n>>2]=r[t>>2],r[n+4>>2]=r[t+4>>2],r[n+8>>2]=r[t+8>>2],void(r[n+12>>2]=r[t+12>>2]);a=e<0?e+6.283185307179586:e,a=e>=6.283185307179586?a+-6.283185307179586:a;do{if(!(a<1e-16)){if(s=+l(+(a+-3.141592653589793))<1e-16,e=+o[t>>3],s){e-=i,o[n>>3]=e,s=n;break}if(c=+h(+i),i=+d(+i),e=c*+d(+e)+ +h(+a)*(i*+h(+e)),e=+f(+((e=e>1?1:e)<-1?-1:e)),o[n>>3]=e,+l(+(e+-1.5707963267948966))<1e-16)return o[n>>3]=1.5707963267948966,void(o[n+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return o[n>>3]=-1.5707963267948966,void(o[n+8>>3]=0);if(u=+h(+e),a=i*+d(+a)/u,i=+o[t>>3],e=(c-+d(+e)*+d(+i))/+h(+i)/u,c=a>1?1:a,e=e>1?1:e,(e=+o[t+8>>3]+ +m(+(c<-1?-1:c),+(e<-1?-1:e)))>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);return void(o[n+8>>3]=e)}e=+o[t>>3]+i,o[n>>3]=e,s=n}while(0);if(+l(+(e+-1.5707963267948966))<1e-16)return o[s>>3]=1.5707963267948966,void(o[n+8>>3]=0);if(+l(+(e+1.5707963267948966))<1e-16)return o[s>>3]=-1.5707963267948966,void(o[n+8>>3]=0);if(e=+o[t+8>>3],e>3.141592653589793)do{e+=-6.283185307179586}while(e>3.141592653589793);if(e<-3.141592653589793)do{e+=6.283185307179586}while(e<-3.141592653589793);o[n+8>>3]=e}(15568+(e<<4)|0,+Et(+o[16368+(24*e|0)>>3]-u),a,s)}function vt(t,e,i){e|=0,i|=0;var n,o;n=I,I=I+16|0,K((t|=0)+4|0,o=n),yt(o,0|r[t>>2],e,0,i),I=n}function _t(t,e,i,n,s){t|=0,e|=0,i|=0,n|=0,s|=0;var a,l,c,u,h,d,p,A,f,g,m,y,v,_,b,x,w,B,E,S,T,M,P=0,D=0,L=0,O=0,F=0,R=0;if(M=I,I=I+272|0,O=M+240|0,E=M,S=M+224|0,T=M+208|0,m=M+176|0,y=M+160|0,v=M+192|0,_=M+144|0,b=M+128|0,x=M+112|0,w=M+96|0,B=M+80|0,r[(P=M+256|0)>>2]=e,r[O>>2]=r[t>>2],r[O+4>>2]=r[t+4>>2],r[O+8>>2]=r[t+8>>2],r[O+12>>2]=r[t+12>>2],bt(O,P,E),r[s>>2]=0,(0|(O=n+i+(5==(0|n)&1)|0))<=(0|i))I=M;else{l=S+4|0,c=m+4|0,u=i+5|0,h=16848+((a=0|r[P>>2])<<2)|0,d=16928+(a<<2)|0,p=b+8|0,A=x+8|0,f=w+8|0,g=T+4|0,L=i;t:for(;;){D=E+(((0|L)%5|0)<<4)|0,r[T>>2]=r[D>>2],r[T+4>>2]=r[D+4>>2],r[T+8>>2]=r[D+8>>2],r[T+12>>2]=r[D+12>>2];do{}while(2==(0|xt(T,a,0,1)));if((0|L)>(0|i)&0!=(0|Nt(e))){if(r[m>>2]=r[T>>2],r[m+4>>2]=r[T+4>>2],r[m+8>>2]=r[T+8>>2],r[m+12>>2]=r[T+12>>2],K(l,y),n=0|r[m>>2],P=0|r[17008+(80*n|0)+(r[S>>2]<<2)>>2],r[m>>2]=r[18608+(80*n|0)+(20*P|0)>>2],(0|(D=0|r[18608+(80*n|0)+(20*P|0)+16>>2]))>0){t=0;do{st(c),t=t+1|0}while((0|t)<(0|D))}switch(D=18608+(80*n|0)+(20*P|0)+4|0,r[v>>2]=r[D>>2],r[v+4>>2]=r[D+4>>2],r[v+8>>2]=r[D+8>>2],$(v,3*(0|r[h>>2])|0),X(c,v,c),q(c),K(c,_),F=+(0|r[d>>2]),o[b>>3]=3*F,o[p>>3]=0,R=-1.5*F,o[x>>3]=R,o[A>>3]=2.598076211353316*F,o[w>>3]=R,o[f>>3]=-2.598076211353316*F,0|r[17008+(80*(0|r[m>>2])|0)+(r[T>>2]<<2)>>2]){case 1:t=x,n=b;break;case 3:t=w,n=x;break;case 2:t=b,n=w;break;default:t=12;break t}se(y,_,n,t,B),yt(B,0|r[m>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])}if((0|L)<(0|u)&&(K(g,m),yt(m,0|r[T>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])),r[S>>2]=r[T>>2],r[S+4>>2]=r[T+4>>2],r[S+8>>2]=r[T+8>>2],r[S+12>>2]=r[T+12>>2],(0|(L=L+1|0))>=(0|O)){t=3;break}}3!=(0|t)?12==(0|t)&&C(22474,22521,581,22531):I=M}}function bt(t,e,i){t|=0,e|=0,i|=0;var n,o=0,s=0,a=0,l=0,c=0;n=I,I=I+128|0,s=n,l=20208,c=(a=o=n+64|0)+60|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));l=20272,c=(a=s)+60|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));o=(c=0==(0|Nt(0|r[e>>2])))?o:s,ut(s=t+4|0),ht(s),0|Nt(0|r[e>>2])&&(rt(s),r[e>>2]=1+(0|r[e>>2])),r[i>>2]=r[t>>2],X(s,o,e=i+4|0),q(e),r[i+16>>2]=r[t>>2],X(s,o+12|0,e=i+20|0),q(e),r[i+32>>2]=r[t>>2],X(s,o+24|0,e=i+36|0),q(e),r[i+48>>2]=r[t>>2],X(s,o+36|0,e=i+52|0),q(e),r[i+64>>2]=r[t>>2],X(s,o+48|0,i=i+68|0),q(i),I=n}function xt(t,e,i,n){i|=0,n|=0;var o,s,a,l,c,u,h=0,d=0,p=0,A=0,f=0;if(u=I,I=I+32|0,c=u+12|0,s=u,f=(t|=0)+4|0,A=0|r[16928+((e|=0)<<2)>>2],A=(l=0!=(0|n))?3*A|0:A,h=0|r[f>>2],o=0|r[(a=t+8|0)>>2],l){if((0|(h=o+h+(n=0|r[(d=t+12|0)>>2])|0))==(0|A))return I=u,0|(f=1);p=d}else h=o+h+(n=0|r[(p=t+12|0)>>2])|0;if((0|h)<=(0|A))return I=u,0|(f=0);do{if((0|n)>0){if(n=0|r[t>>2],(0|o)>0){d=18608+(80*n|0)+60|0,n=t;break}n=18608+(80*n|0)+40|0,i?(W(c,A,0,0),Y(f,c,s),at(s),X(s,c,f),d=n,n=t):(d=n,n=t)}else d=18608+(80*(0|r[t>>2])|0)+20|0,n=t}while(0);if(r[n>>2]=r[d>>2],(0|r[(h=d+16|0)>>2])>0){n=0;do{st(f),n=n+1|0}while((0|n)<(0|r[h>>2]))}return t=d+4|0,r[c>>2]=r[t>>2],r[c+4>>2]=r[t+4>>2],r[c+8>>2]=r[t+8>>2],e=0|r[16848+(e<<2)>>2],$(c,l?3*e|0:e),X(f,c,f),q(f),n=l&&((0|r[a>>2])+(0|r[f>>2])+(0|r[p>>2])|0)==(0|A)?1:2,I=u,0|(f=n)}function wt(t,e){t|=0,e|=0;var i=0;do{i=0|xt(t,e,0,1)}while(2==(0|i));return 0|i}function Ct(t,e,i,n,s){t|=0,e|=0,i|=0,n|=0,s|=0;var a,l,c,u,h,d,p,A,f,g,m,y,v,_,b,x,w,B,E=0,S=0,T=0,M=0,P=0;if(B=I,I=I+240|0,_=B+208|0,b=B,x=B+192|0,w=B+176|0,f=B+160|0,g=B+144|0,m=B+128|0,y=B+112|0,v=B+96|0,r[(E=B+224|0)>>2]=e,r[_>>2]=r[t>>2],r[_+4>>2]=r[t+4>>2],r[_+8>>2]=r[t+8>>2],r[_+12>>2]=r[t+12>>2],Bt(_,E,b),r[s>>2]=0,(0|(A=n+i+(6==(0|n)&1)|0))<=(0|i))I=B;else{l=i+6|0,c=16928+((a=0|r[E>>2])<<2)|0,u=g+8|0,h=m+8|0,d=y+8|0,p=x+4|0,S=0,T=i,n=-1;t:for(;;){if(t=b+((E=(0|T)%6|0)<<4)|0,r[x>>2]=r[t>>2],r[x+4>>2]=r[t+4>>2],r[x+8>>2]=r[t+8>>2],r[x+12>>2]=r[t+12>>2],t=S,S=0|xt(x,a,0,1),(0|T)>(0|i)&0!=(0|Nt(e))&&(1!=(0|t)&&(0|r[x>>2])!=(0|n))){switch(K(b+(((E+5|0)%6|0)<<4)+4|0,w),K(b+(E<<4)+4|0,f),M=+(0|r[c>>2]),o[g>>3]=3*M,o[u>>3]=0,P=-1.5*M,o[m>>3]=P,o[h>>3]=2.598076211353316*M,o[y>>3]=P,o[d>>3]=-2.598076211353316*M,E=0|r[_>>2],0|r[17008+(80*E|0)+(((0|n)==(0|E)?0|r[x>>2]:n)<<2)>>2]){case 1:t=m,n=g;break;case 3:t=y,n=m;break;case 2:t=g,n=y;break;default:t=8;break t}se(w,f,n,t,v),0|ae(w,v)||0|ae(f,v)||(yt(v,0|r[_>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2]))}if((0|T)<(0|l)&&(K(p,w),yt(w,0|r[x>>2],a,1,s+8+(r[s>>2]<<4)|0),r[s>>2]=1+(0|r[s>>2])),(0|(T=T+1|0))>=(0|A)){t=3;break}n=0|r[x>>2]}3!=(0|t)?8==(0|t)&&C(22557,22521,746,22602):I=B}}function Bt(t,e,i){t|=0,e|=0,i|=0;var n,o=0,s=0,a=0,l=0,c=0;n=I,I=I+160|0,s=n,l=20336,c=(a=o=n+80|0)+72|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));l=20416,c=(a=s)+72|0;do{r[a>>2]=r[l>>2],a=a+4|0,l=l+4|0}while((0|a)<(0|c));o=(c=0==(0|Nt(0|r[e>>2])))?o:s,ut(s=t+4|0),ht(s),0|Nt(0|r[e>>2])&&(rt(s),r[e>>2]=1+(0|r[e>>2])),r[i>>2]=r[t>>2],X(s,o,e=i+4|0),q(e),r[i+16>>2]=r[t>>2],X(s,o+12|0,e=i+20|0),q(e),r[i+32>>2]=r[t>>2],X(s,o+24|0,e=i+36|0),q(e),r[i+48>>2]=r[t>>2],X(s,o+36|0,e=i+52|0),q(e),r[i+64>>2]=r[t>>2],X(s,o+48|0,e=i+68|0),q(e),r[i+80>>2]=r[t>>2],X(s,o+60|0,i=i+84|0),q(i),I=n}function Et(t){var e;return e=(t=+t)<0?t+6.283185307179586:t,+(t>=6.283185307179586?e+-6.283185307179586:e)}function St(t,e){return e|=0,+l(+(+o[(t|=0)>>3]-+o[e>>3]))<17453292519943298e-27?0|(e=+l(+(+o[t+8>>3]-+o[e+8>>3]))<17453292519943298e-27):0|(e=0)}function Tt(t,e){t|=0;var i,n,r,s=0;return n=+o[(e|=0)>>3],i=+o[t>>3],s=(r=+d(.5*(n-i)))*r+(s=+d(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+n)*+h(+i)*s),2*+m(+ +c(+s),+ +c(+(1-s)))*6371.007180918475}function Mt(t,e,i){t|=0,i|=0;var n,r,s,a,l=0,u=0,A=0,f=0,y=0,v=0;return v=+o[(e|=0)>>3],s=+o[t>>3],y=+d(.5*(v-s)),A=+o[e+8>>3],r=+o[t+8>>3],f=+d(.5*(A-r)),n=+h(+s),a=+h(+v),f=2*+m(+ +c(+(f=y*y+f*(a*n*f))),+ +c(+(1-f))),y=+o[i>>3],v=+d(.5*(y-v)),l=+o[i+8>>3],A=+d(.5*(l-A)),u=+h(+y),A=2*+m(+ +c(+(A=v*v+A*(a*u*A))),+ +c(+(1-A))),y=+d(.5*(s-y)),l=+d(.5*(r-l)),l=2*+m(+ +c(+(l=y*y+l*(n*u*l))),+ +c(+(1-l))),4*+g(+ +c(+ +p(.5*(u=.5*(f+A+l)))*+p(.5*(u-f))*+p(.5*(u-A))*+p(.5*(u-l))))}function It(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),45),w(),127&e|0}function Pt(t,e){var i=0,n=0,r=0,o=0,s=0,a=0;if(!(!0&134217728==(-16777216&(e|=0)|0)))return 0|(e=0);if(s=0|Ce(0|(t|=0),0|e,45),w(),(s&=127)>>>0>121)return 0|(e=0);i=0|Ce(0|t,0|e,52),w(),i&=15;do{if(0|i){for(r=1,n=0;;){if(o=0|Ce(0|t,0|e,3*(15-r|0)|0),w(),0!=(0|(o&=7))&(1^n)){if(1==(0|o)&0!=(0|R(s))){a=0,n=13;break}n=1}if(7==(0|o)){a=0,n=13;break}if(!(r>>>0<i>>>0)){n=9;break}r=r+1|0}if(9==(0|n)){if(15!=(0|i))break;return 0|(a=1)}if(13==(0|n))return 0|a}}while(0);for(;;){if(a=0|Ce(0|t,0|e,3*(14-i|0)|0),w(),!(7==(7&a|0)&!0)){a=0,n=13;break}if(!(i>>>0<14)){a=1,n=13;break}i=i+1|0}return 13==(0|n)?0|a:0}function Dt(t,e,i){i|=0;var n=0,r=0;if(n=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|(n&=15))>
2=(0|i)){if((0|n)!=(0|i))if(i>>>0<=15){if(t|=r=0|Be(0|i,0,52),e=0|w()|-15728641&e,(0|n)>(0|i))do{r=0|Be(7,0,3*(14-i|0)|0),i=i+1|0,t|=r,e=0|w()|e}while((0|i)<(0|n))}else e=0,t=0}else e=0,t=0;return x(0|e),0|t}function Lt(t,e,i,n){i|=0,n|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0;if(l=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|i)<16&(0|(l&=15))<=(0|i)){if((0|l)==(0|i))return r[(i=n)>>2]=t,void(r[i+4>>2]=e);if(o=(0|(u=0|ee(7,i-l|0)))/7|0,c=0|Ce(0|t,0|e,45),w(),0|R(127&c)){t:do{if(l)for(a=1;;){if(s=0|Ce(0|t,0|e,3*(15-a|0)|0),w(),0|(s&=7))break t;if(!(a>>>0<l>>>0)){s=0;break}a=a+1|0}else s=0}while(0);a=0==(0|s)}else a=0;if(h=0|Be(l+1|0,0,52),s=0|w()|-15728641&e,Lt(e=(h|t)&~(e=0|Be(7,0,0|(c=3*(14-l|0)|0))),l=s&~(0|w()),i,n),s=n+(o<<3)|0,!a)return Lt((h=0|Be(1,0,0|c))|e,0|w()|l,i,s),h=s+(o<<3)|0,Lt((u=0|Be(2,0,0|c))|e,0|w()|l,i,h),h=h+(o<<3)|0,Lt((u=0|Be(3,0,0|c))|e,0|w()|l,i,h),h=h+(o<<3)|0,Lt((u=0|Be(4,0,0|c))|e,0|w()|l,i,h),h=h+(o<<3)|0,Lt((u=0|Be(5,0,0|c))|e,0|w()|l,i,h),void Lt((u=0|Be(6,0,0|c))|e,0|w()|l,i,h+(o<<3)|0);a=s+(o<<3)|0,(0|u)>6&&(Me(0|s,0,(h=(a>>>0>(u=s+8|0)>>>0?a:u)+-1+(0-s)|0)+8&-8|0),s=u+(h>>>3<<3)|0),Lt((h=0|Be(2,0,0|c))|e,0|w()|l,i,s),h=s+(o<<3)|0,Lt((u=0|Be(3,0,0|c))|e,0|w()|l,i,h),h=h+(o<<3)|0,Lt((u=0|Be(4,0,0|c))|e,0|w()|l,i,h),h=h+(o<<3)|0,Lt((u=0|Be(5,0,0|c))|e,0|w()|l,i,h),Lt((u=0|Be(6,0,0|c))|e,0|w()|l,i,h+(o<<3)|0)}}function Ot(t,e){var i=0,n=0,r=0;if(r=0|Ce(0|(t|=0),0|(e|=0),45),w(),!(0|R(127&r)))return 0|(r=0);r=0|Ce(0|t,0|e,52),w(),r&=15;t:do{if(r)for(n=1;;){if(i=0|Ce(0|t,0|e,3*(15-n|0)|0),w(),0|(i&=7))break t;if(!(n>>>0<r>>>0)){i=0;break}n=n+1|0}else i=0}while(0);return 0|(r=0==(0|i)&1)}function Ft(t,e){var i=0,n=0,r=0;if(r=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(r&=15))return 0|(r=0);for(n=1;;){if(i=0|Ce(0|t,0|e,3*(15-n|0)|0),w(),0|(i&=7)){n=5;break}if(!(n>>>0<r>>>0)){i=0,n=5;break}n=n+1|0}return 5==(0|n)?0|i:0}function Rt(t,e){var i=0,n=0,r=0,o=0,s=0,a=0,l=0;if(l=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(l&=15))return l=t,x(0|(a=e)),0|l;for(a=1,i=0;;){n=0|Be(7,0,0|(o=3*(15-a|0)|0)),r=0|w(),s=0|Ce(0|t,0|e,0|o),w(),t=(o=0|Be(0|lt(7&s),0,0|o))|t&~n,e=(s=0|w())|e&~r;t:do{if(!i)if(0==(o&n|0)&0==(s&r|0))i=0;else if(n=0|Ce(0|t,0|e,52),w(),n&=15){i=1;e:for(;;){switch(s=0|Ce(0|t,0|e,3*(15-i|0)|0),w(),7&s){case 1:break e;case 0:break;default:i=1;break t}if(!(i>>>0<n>>>0)){i=1;break t}i=i+1|0}for(i=1;;){if(r=0|Ce(0|t,0|e,0|(s=3*(15-i|0)|0)),w(),o=0|Be(7,0,0|s),e&=~(0|w()),t=t&~o|(s=0|Be(0|lt(7&r),0,0|s)),e=0|e|w(),!(i>>>0<n>>>0)){i=1;break}i=i+1|0}}else i=1}while(0);if(!(a>>>0<l>>>0))break;a=a+1|0}return x(0|e),0|t}function kt(t,e){var i=0,n=0,r=0,o=0,s=0;if(n=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(n&=15))return n=t,x(0|(i=e)),0|n;for(i=1;s=0|Ce(0|t,0|e,0|(o=3*(15-i|0)|0)),w(),r=0|Be(7,0,0|o),e&=~(0|w()),t=(o=0|Be(0|lt(7&s),0,0|o))|t&~r,e=0|w()|e,i>>>0<n>>>0;)i=i+1|0;return x(0|e),0|t}function zt(t,e){var i=0,n=0,r=0,o=0,s=0,a=0,l=0;if(l=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(l&=15))return l=t,x(0|(a=e)),0|l;for(a=1,i=0;;){n=0|Be(7,0,0|(o=3*(15-a|0)|0)),r=0|w(),s=0|Ce(0|t,0|e,0|o),w(),t=(o=0|Be(0|ct(7&s),0,0|o))|t&~n,e=(s=0|w())|e&~r;t:do{if(!i)if(0==(o&n|0)&0==(s&r|0))i=0;else if(n=0|Ce(0|t,0|e,52),w(),n&=15){i=1;e:for(;;){switch(s=0|Ce(0|t,0|e,3*(15-i|0)|0),w(),7&s){case 1:break e;case 0:break;default:i=1;break t}if(!(i>>>0<n>>>0)){i=1;break t}i=i+1|0}for(i=1;;){if(o=0|Be(7,0,0|(r=3*(15-i|0)|0)),s=e&~(0|w()),e=0|Ce(0|t,0|e,0|r),w(),t=t&~o|(e=0|Be(0|ct(7&e),0,0|r)),e=0|s|w(),!(i>>>0<n>>>0)){i=1;break}i=i+1|0}}else i=1}while(0);if(!(a>>>0<l>>>0))break;a=a+1|0}return x(0|e),0|t}function Ut(t,e){var i=0,n=0,r=0,o=0,s=0;if(n=0|Ce(0|(t|=0),0|(e|=0),52),w(),!(n&=15))return n=t,x(0|(i=e)),0|n;for(i=1;o=0|Be(7,0,0|(s=3*(15-i|0)|0)),r=e&~(0|w()),e=0|Ce(0|t,0|e,0|s),w(),t=(e=0|Be(0|ct(7&e),0,0|s))|t&~o,e=0|
2w()|r,i>>>0<n>>>0;)i=i+1|0;return x(0|e),0|t}function Nt(t){return 0|(0|(t|=0))%2}function Gt(t,e){t|=0;var i,n;return n=I,I=I+16|0,i=n,(e|=0)>>>0<=15&&2146435072!=(2146435072&r[t+4>>2]|0)&&2146435072!=(2146435072&r[t+8+4>>2]|0)?(!function(t,e,i){var n,r;n=I,I=I+16|0,mt(t|=0,e|=0,i|=0,r=n),Q(r,i+4|0),I=n}(t,e,i),e=0|function(t,e){t|=0;var i,n=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0;if(i=I,I=I+64|0,c=i+40|0,o=i+24|0,s=i+12|0,a=i,Be(0|(e|=0),0,52),n=134225919|w(),!e)return(0|r[t+4>>2])>2||(0|r[t+8>>2])>2||(0|r[t+12>>2])>2?(c=0,x(0|(l=0)),I=i,0|c):(Be(0|z(t),0,45),l=0|w()|n,c=-1,x(0|l),I=i,0|c);if(r[c>>2]=r[t>>2],r[c+4>>2]=r[t+4>>2],r[c+8>>2]=r[t+8>>2],r[c+12>>2]=r[t+12>>2],l=c+4|0,(0|e)>0)for(t=-1;r[o>>2]=r[l>>2],r[o+4>>2]=r[l+4>>2],r[o+8>>2]=r[l+8>>2],1&e?(et(l),r[s>>2]=r[l>>2],r[s+4>>2]=r[l+4>>2],r[s+8>>2]=r[l+8>>2],nt(s)):(it(l),r[s>>2]=r[l>>2],r[s+4>>2]=r[l+4>>2],r[s+8>>2]=r[l+8>>2],rt(s)),Y(o,s,a),q(a),u=0|Be(7,0,0|(h=3*(15-e|0)|0)),n&=~(0|w()),t=(h=0|Be(0|tt(a),0,0|h))|t&~u,n=0|w()|n,(0|e)>1;)e=e+-1|0;else t=-1;t:do{if((0|r[l>>2])<=2&&(0|r[c+8>>2])<=2&&(0|r[c+12>>2])<=2){if(e=0|Be(0|(o=0|z(c)),0,45),e|=t,t=0|w()|-1040385&n,a=0|U(c),!(0|R(o))){if((0|a)<=0)break;for(s=0;;
2){if(o=0|Ce(0|e,0|t,52),w(),o&=15)for(n=1;c=0|Ce(0|e,0|t,0|(h=3*(15-n|0)|0)),w(),u=0|Be(7,0,0|h),t&=~(0|w()),e=e&~u|(h=0|Be(0|lt(7&c),0,0|h)),t=0|t|w(),n>>>0<o>>>0;)n=n+1|0;if((0|(s=s+1|0))==(0|a))break t}}s=0|Ce(0|e,0|t,52),w(),s&=15;e:do{if(s){n=1;i:for(;;){switch(h=0|Ce(0|e,0|t,3*(15-n|0)|0),w(),7&h){case 1:break i;case 0:break;default:break e}if(!(n>>>0<s>>>0))break e;n=n+1|0}if(0|N(o,0|r[c>>2]))for(n=1;u=0|Be(7,0,0|(c=3*(15-n|0)|0)),h=t&~(0|w()),t=0|Ce(0|e,0|t,0|c),w(),e=e&~u|(t=0|Be(0|ct(7&t),0,0|c)),t=0|h|w(),n>>>0<s>>>0;)n=n+1|0;else for(n=1;c=0|Ce(0|e,0|t,0|(h=3*(15-n|0)|0)),w(),u=0|Be(7,0,0|h),t&=~(0|w()),e=e&~u|(h=0|Be(0|lt(7&c),0,0|h)),t=0|t|w(),n>>>0<s>>>0;)n=n+1|0}}while(0);if((0|a)>0){n=0;do{e=0|Rt(e,t),t=0|w(),n=n+1|0}while((0|n)!=(0|a))}}else e=0,t=0}while(0);return h=e,x(0|(u=t)),I=i,0|h}(i,e),t=0|w()):(t=0,e=0),x(0|t),I=n,0|e}function Zt(t,e,i){var n,o=0,s=0,a=0;if(n=(i|=0)+4|0,s=0|Ce(0|(t|=0),0|(e|=0),52),w(),s&=15,a=0|Ce(0|t,0|e,45),w(),o=0==(0|s),0|R(127&a)){if(o)return 0|(a=1);o=1}else{if(o)return 0|(a=0);o=0==(0|r[n>>2])&&0==(0|r[i+8>>2])?0!=(0|r[i+12>>2])&1:1}for(i=1;1&i?nt(n):rt(n),a=0|Ce(0|t,0|e,3*(15-i|0)|0),w(),ot(n,7&a),i>>>0<s>>>0;)i=i+1|0;return 0|o}function jt(t,e,i){i|=0;var n,o,s=0,a=0,l=0,c=0,u=0,h=0;o=I,I=I+16|0,n=o,h=0|Ce(0|(t|=0),0|(e|=0),45),w(),h&=127;t:do{if(0!=(0|R(h))&&(l=0|Ce(0|t,0|e,52),w(),0!=(0|(l&=15)))){s=1;e:for(;;){switch(u=0|Ce(0|t,0|e,3*(15-s|0)|0),w(),7&u){case 5:break e;case 0:break;default:s=e;break t}if(!(s>>>0<l>>>0)){s=e;break t}s=s+1|0}for(a=1,s=e;c=0|Be(7,0,0|(e=3*(15-a|0)|0)),u=s&~(0|w()),s=0|Ce(0|t,0|s,0|e),w(),t=t&~c|(s=0|Be(0|ct(7&s),0,0|e)),s=0|u|w(),a>>>0<l>>>0;)a=a+1|0}else s=e}while(0);if(u=7728+(28*h|0)|0,r[i>>2]=r[u>>2],r[i+4>>2]=r[u+4>>2],r[i+8>>2]=r[u+8>>2],r[i+12>>2]=r[u+12>>2],0|Zt(t,s,i)){if(c=i+4|0,r[n>>2]=r[c>>2],r[n+4>>2]=r[c+4>>2],r[n+8>>2]=r[c+8>>2],l=0|Ce(0|t,0|s,52),w(),u=15&l,1&l?(rt(c),l=u+1|0):l=u,0|R(h)){t:do{if(u)for(e=1;;){if(a=0|Ce(0|t,0|s,3*(15-e|0)|0),w(),0|(a&=7)){s=a;break t}if(!(e>>>0<u>>>0)){s=0;break}e=e+1|0}else s=0}while(0);s=4==(0|s)&1}else s=0;if(0|xt(i,l,s,0)){if(0|R(h))do{}while(0!=(0|xt(i,l,0,0)));(0|l)!=(0|u)&&it(c)}else(0|l)!=(0|u)&&(r[c>>2]=r[n>>2],r[c+4>>2]=r[n+4>>2],r[c+8>>2]=r[n+8>>2]);I=o}else I=o}function Vt(t,e,i){i|=0;var n,r;n=I,I=I+16|0,jt(t|=0,e|=0,r=n),e=0|Ce(0|t,0|e,52),w(),vt(r,15&e,i),I=n}function Ht(t,e,i){i|=0;var n,r,o=0,s=0;r=I,I=I+16|0,jt(t|=0,e|=0,n=r),o=0|Ce(0|t,0|e,45),w(),o=0==(0|R(127&o)),s=0|Ce(0|t,0|e,52),w(),s&=15;t:do{if(!o){if(0|s)for(o=1;;){if(!(0==((0|Be(7,0,3*(15-o|0)|0))&t|0)&0==((0|w())&e|0)))break t;if(!(o>>>0<s>>>0))break;o=o+1|0}return _t(n,s,0,5,i),void(I=r)}}while(0);Ct(n,s,0,6,i),I=r}function Jt(t,e){e|=0;var i,n=0,o=0,s=0,a=0,l=0,c=0;if(Be(0|(t|=0),0,52),i=134225919|w(),(0|t)<1){o=0,n=0;do{0|R(o)&&(Be(0|o,0,45),l=0|i|w(),r[(t=e+(n<<3)|0)>>2]=-1,r[t+4>>2]=l,n=n+1|0),o=o+1|0}while(122!=(0|o))}else{l=0,n=0;do{if(0|R(l)){for(Be(0|l,0,45),o=1,s=-1,a=0|i|w();s&=~(c=0|Be(7,0,3*(15-o|0)|0)),a&=~(0|w()),(0|o)!=(0|t);)o=o+1|0;r[(c=e+(n<<3)|0)>>2]=s,r[c+4>>2]=a,n=n+1|0}l=l+1|0}while(122!=(0|l))}}function Wt(t,e,i,n){var o,s=0,a=0,l=0,c=0,u=0;if(o=I,I=I+64|0,l=o,(0|(t|=0))==(0|(i|=0))&(0|(e|=0))==(0|(n|=0))|!1|134217728!=(2013265920&e|0)|!1|134217728!=(2013265920&n|0))return I=o,0|(l=0);if(s=0|Ce(0|t,0|e,52),w(),s&=15,a=0|Ce(0|i,0|n,52),w(),(0|s)!=(15&a|0))return I=o,0|(l=0);if(a=s+-1|0,s>>>0>1&&(u=0|Dt(t,e,a),c=0|w(),(0|u)==(0|(a=0|Dt(i,n,a)))&(0|c)==(0|w()))){if(s=0|Ce(0|t,0|e,0|(a=3*(15^s)|0)),w(),s&=7,a=0|Ce(0|i,0|n,0|a),w(),0==(0|s)|0==(0|(a&=7)))return I=o,0|(u=1);if((0|r[21136+(s<<2)>>2])==(0|a))return I=o,0|(u=1);if((0|r[21168+(s<<2)>>2])==(0|a))return I=o,0|(u=1)}a=(s=l)+56|0;do{r[s>>2]=0,s=s+4|0}while((0|s)<(0|a));return P(t,e,1,l),s=(0|r[(u=l)>>2])==(0|i)&&(0|r[u+4>>2])==(0|n)||(0|r[(u=l+8|0)>>2])==(0|i)&&(0|r[u+4>>2])==(0|n)||(0|r[(u=l+16|0)>>2])==(0|i)&&(0|r[u+4>>2])==(0|n)||(0|r[(u=l+24|0)>>2])==(0|i)&&(0|r[u+4>>2])==(0|n)||(0|r[(u=l+32|0)>>2])==(0|i)&&(0|r[u+4>>2])==(0|n)||(0|r[(u=l+40|0)>>2])==(0|i)&&(0|r[u+4>>2])==(0|n)?1:1&((0|r[(s=l+48|0)>>2])==(0|i)?(0|r[s+4>>2])==(0|n):0),I=o,0|(u=s)}function Qt(t,e,i){i|=0;var n,o,s,a,l=0;if(s=I,I=I+16|0,o=s,l=0|Ce(0|(t|=0),0|(e|=0),56),w(),e=0|function(t,e,
2i){t|=0,e|=0,i|=0;var n=0,o=0;if(n=0|Ot(t,e),(i+-1|0)>>>0>5)return 0|(i=-1);if(o=0!=(0|n),1==(0|i)&o)return 0|(i=-1);return n=0|function(t,e){t|=0,e|=0;var i=0,n=0,o=0,s=0,a=0,l=0,c=0,u=0;if(u=I,I=I+32|0,o=u+16|0,s=u,jt(t,e,o),a=0|It(t,e),c=0|Ft(t,e),function(t,e){t=7728+(28*(t|=0)|0)|0,r[(e|=0)>>2]=r[t>>2],r[e+4>>2]=r[t+4>>2],r[e+8>>2]=r[t+8>>2],r[e+12>>2]=r[t+12>>2]}(a,s),e=0|function(t,e){t|=0;var i=0,n=0;if((e|=0)>>>0>20)return-1;do{if((0|r[11152+(216*e|0)>>2])!=(0|t))if((0|r[11152+(216*e|0)+8>>2])!=(0|t))if((0|r[11152+(216*e|0)+16>>2])!=(0|t))if((0|r[11152+(216*e|0)+24>>2])!=(0|t))if((0|r[11152+(216*e|0)+32>>2])!=(0|t))if((0|r[11152+(216*e|0)+40>>2])!=(0|t))if((0|r[11152+(216*e|0)+48>>2])!=(0|t))if((0|r[11152+(216*e|0)+56>>2])!=(0|t))if((0|r[11152+(216*e|0)+64>>2])!=(0|t))if((0|r[11152+(216*e|0)+72>>2])!=(0|t))if((0|r[11152+(216*e|0)+80>>2])!=(0|t))if((0|r[11152+(216*e|0)+88>>2])!=(0|t))if((0|r[11152+(216*e|0)+96>>2])!=(0|t))if((0|r[11152+(216*e|0)+104>>2])!=(0|t))if((0|r[11152+(216*e|0)+112>>2])!=(0|t))if((0|r[11152+(216*e|0)+120>>2])!=(0|t))if((0|r[11152+(216*e|0)+128>>2])!=(0|t)){if((0|r[11152+(216*e|0)+136>>2])!=(0|t)){if((0|r[11152+(216*e|0)+144>>2])==(0|t)){t=0,i=2,n=0;break}if((0|r[11152+(216*e|0)+152>>2])==(0|t)){t=0,i=2,n=1;break}if((0|r[11152+(216*e|0)+160>>2])==(0|t)){t=0,i=2,n=2;break}if((0|r[11152+(216*e|0)+168>>2])==(0|t)){t=1,i=2,n=0;break}if((0|r[11152+(216*e|0)+176>>2])==(0|t)){t=1,i=2,n=1;break}if((0|r[11152+(216*e|0)+184>>2])==(0|t)){t=1,i=2,n=2;break}if((0|r[11152+(216*e|0)+192>>2])==(0|t)){t=2,i=2,n=0;break}if((0|r[11152+(216*e|0)+200>>2])==(0|t)){t=2,i=2,n=1;break}if((0|r[11152+(216*e|0)+208>>2])==(0|t)){t=2,i=2,n=2;break}return-1}t=2,i=1,n=2}else t=2,i=1,n=1;else t=2,i=1,n=0;else t=1,i=1,n=2;else t=1,i=1,n=1;else t=1,i=1,n=0;else t=0,i=1,n=2;else t=0,i=1,n=1;else t=0,i=1,n=0;else t=2,i=0,n=2;else t=2,i=0,n=1;else t=2,i=0,n=0;else t=1,i=0,n=2;else t=1,i=0,n=1;else t=1,i=0,n=0;else t=0,i=0,n=2;else t=0,i=0,n=1;else t=0,i=0,n=0}while(0);return 0|r[11152+(216*e|0)+(72*i|0)+(24*t|0)+(n<<3)+4>>2]}(a,0|r[o>>2]),!(0|R(a)))return I=u,0|(c=e);switch(0|a){case 4:t=0,i=14;break;case 14:t=1,i=14;break;case 24:t=2,i=14;break;case 38:t=3,i=14;break;case 49:t=4,i=14;break;case 58:t=5,i=14;break;case 63:t=6,i=14;break;case 72:t=7,i=14;break;case 83:t=8,i=14;break;case 97:t=9,i=14;break;case 107:t=10,i=14;break;case 117:t=11,i=14;break;default:l=0,n=0}14==(0|i)&&(l=0|r[22096+(24*t|0)+8>>2],n=0|r[22096+(24*t|0)+16>>2]);t=0|r[o>>2],(0|t)!=(0|r[s>>2])&&(a=0|k(a))|(0|(t=0|r[o>>2]))==(0|n)&&(e=(e+1|0)%6|0);if(3==(0|c)&(0|t)==(0|n))return I=u,0|(c=(e+5|0)%6|0);if(!(5==(0|c)&(0|t)==(0|l)))return I=u,0|(c=e);return c=(e+1|0)%6|0,I=u,0|c}(t,e),o?0|(i=(5-n+(0|r[22384+(i<<2)>>2])|0)%5|0):0|(i=(6-n+(0|r[22416+(i<<2)>>2])|0)%6|0)}(n=(a=!0&268435456==(2013265920&e|0))?t:0,t=a?-2130706433&e|134217728:0,7&l),-1==(0|e))return r[i>>2]=0,void(I=s);jt(n,t,o),l=0|Ce(0|n,0|t,52),w(),l&=15,0|Ot(n,t)?_t(o,l,e,2,i):Ct(o,l,e,2,i),I=s}function qt(t){t|=0;var e,i,n=0;return(e=0|ve(1,12))||C(22691,22646,49,22704),0|(n=0|r[(i=t+4|0)>>2])?(r[(n=n+8|0)>>2]=e,r[i>>2]=e,0|e):(0|r[t>>2]&&C(22721,22646,61,22744),r[(n=t)>>2]=e,r[i>>2]=e,0|e)}function Kt(t,e){t|=0,e|=0;var i,n;return(n=0|me(24))||C(22758,22646,78,22772),r[n>>2]=r[e>>2],r[n+4>>2]=r[e+4>>2],r[n+8>>2]=r[e+8>>2],r[n+12>>2]=r[e+12>>2],r[n+16>>2]=0,0|(i=0|r[(e=t+4|0)>>2])?(r[i+16>>2]=n,r[e>>2]=n,0|n):(0|r[t>>2]&&C(22787,22646,82,22772),r[t>>2]=n,r[e>>2]=n,0|n)}function Xt(t){var e,i,n=0,s=0,a=0,c=0,u=0,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,B=0,E=0,S=0,T=0,M=0,I=0,P=0,D=0,L=0,O=0,F=0,R=0;if(0|r[(c=(t|=0)+8|0)>>2])return 0|(R=1);if(!(a=0|r[t>>2]))return 0|(R=0);n=a,s=0;do{s=s+1|0,n=0|r[n+8>>2]}while(0!=(0|n));if(s>>>0<2)return 0|(R=0);(i=0|me(s<<2))||C(22807,22646,317,22826),(e=0|me(s<<5))||C(22848,22646,321,22826),r[t>>2]=0,r[(T=t+4|0)>>2]=0,r[c>>2]=0,s=0,O=0,S=0,g=0;t:for(;;){if(f=0|r[a>>2]){u=0,h=f;do{if(p=+o[h+8>>3],n=h,h=0|r[h+16>>2],d=+o[(c=(A=0==(0|h))?f:h)+8>>3],+l(+(p-d))>3.141592653589793){R=14;break}u+=(d-p)*(+o[n>>3]+ +o[c>>3])}while(!A);if(14==(0|R)){R=0,u=0,n=f;do{E=+o[n+8>>3],D=0|r[(L=n+16|0)>>2],B=+o[(D=0==(0|D)?f:D)+8>>3],u+=(+o[n>>3]+ +o[D>>3])*((B<0?B+6.283185307179586:B)-(E<0?E+6.283185307179586:E)),n=0|r[(0==(0|n)?a:L)>>2]}while(0!=(0|n))}u>0?(r[i+(O<<2)>>2]=a,O=O+1|0,c=S,n=g):R=19}else R=19;if(19==(0|R)){R=0;
vendor: 4,877 bytes, line 2
2do{if(!s){if(g){c=T,h=g+8|0,n=a,s=t;break}if(0|r[t>>2]){R=27;break t}c=T,h=t,n=a,s=t;break}if(0|r[(n=s+8|0)>>2]){R=21;break t}if(!(s=0|ve(1,12))){R=23;break t}r[n>>2]=s,c=s+4|0,h=s,n=g}while(0);if(r[h>>2]=a,r[c>>2]=a,h=e+(S<<5)|0,A=0|r[a>>2]){for(o[(f=e+(S<<5)+8|0)>>3]=17976931348623157e292,o[(g=e+(S<<5)+24|0)>>3]=17976931348623157e292,o[h>>3]=-17976931348623157e292,o[(m=e+(S<<5)+16|0)>>3]=-17976931348623157e292,x=17976931348623157e292,w=-17976931348623157e292,c=0,y=A,p=17976931348623157e292,_=17976931348623157e292,b=-17976931348623157e292,d=-17976931348623157e292;u=+o[y>>3],E=+o[y+8>>3],y=0|r[y+16>>2],B=+o[((v=0==(0|y))?A:y)+8>>3],u<p&&(o[f>>3]=u,p=u),E<_&&(o[g>>3]=E,_=E),u>b?o[h>>3]=u:u=b,E>d&&(o[m>>3]=E,d=E),x=E>0&E<x?E:x,w=E<0&E>w?E:w,c|=+l(+(E-B))>3.141592653589793,!v;)b=u;c&&(o[m>>3]=w,o[g>>3]=x)}else r[h>>2]=0,r[h+4>>2]=0,r[h+8>>2]=0,r[h+12>>2]=0,r[h+16>>2]=0,r[h+20>>2]=0,r[h+24>>2]=0,r[h+28>>2]=0;c=S+1|0}if(a=0|r[(L=a+8|0)>>2],r[L>>2]=0,!a){R=45;break}S=c,g=n}if(21==(0|R))C(22624,22646,35,22658);else if(23==(0|R))C(22678,22646,37,22658);else if(27==(0|R))C(22721,22646,61,22744);else if(45==(0|R)){t:do{if((0|O)>0){for(L=0==(0|c),P=c<<2,D=0==(0|t),I=0,n=0;;){if(M=0|r[i+(I<<2)>>2],L)R=73;else{if(!(S=0|me(P))){R=50;break}if(!(T=0|me(P))){R=52;break}e:do{if(D)s=0;else{for(c=0,s=0,h=t;a=e+(c<<5)|0,0|Yt(0|r[h>>2],a,0|r[M>>2])?(r[S+(s<<2)>>2]=h,r[T+(s<<2)>>2]=a,v=s+1|0):v=s,h=0|r[h+8>>2];)c=c+1|0,s=v;if((0|v)>0)if(a=0|r[S>>2],1==(0|v))s=a;else for(m=0,y=-1,s=a,g=a;;){for(A=0|r[g>>2],a=0,h=0;f=(0|(c=0|r[r[S+(h<<2)>>2]>>2]))==(0|A)?a:a+(1&(0|Yt(c,0|r[T+(h<<2)>>2],0|r[A>>2])))|0,(0|(h=h+1|0))!=(0|v);)a=f;if(s=(c=(0|f)>(0|y))?g:s,(0|(a=m+1|0))==(0|v))break e;m=a,y=c?f:y,g=0|r[S+(a<<2)>>2]}else s=0}}while(0);if(ye(S),ye(T),s){if(a=0|r[(c=s+4|0)>>2])s=a+8|0;else if(0|r[s>>2]){R=70;break}r[s>>2]=M,r[c>>2]=M}else R=73}if(73==(0|R)){if(R=0,0|(n=0|r[M>>2]))do{T=n,n=0|r[n+16>>2],ye(T)}while(0!=(0|n));ye(M),n=2}if((0|(I=I+1|0))>=(0|O)){F=n;break t}}50==(0|R)?C(22863,22646,249,22882):52==(0|R)?C(22901,22646,252,22882):70==(0|R)&&C(22721,22646,61,22744)}else F=0}while(0);return ye(i),ye(e),0|(R=F)}return 0}function Yt(t,e,i){t|=0;var n,s=0,a=0,l=0,c=0,u=0,h=0,d=0;if(!(0|V(e|=0,i|=0)))return 0|(t=0);if(e=0|j(e),n=+o[i>>3],s=e&(s=+o[i+8>>3])<0?s+6.283185307179586:s,!(t=0|r[t>>2]))return 0|(t=0);if(e){e=0,i=t;t:for(;;){for(;c=+o[i>>3],h=+o[i+8>>3],d=0|r[(i=i+16|0)>>2],l=+o[(d=0==(0|d)?t:d)>>3],a=+o[d+8>>3],c>l?(u=c,c=h):(u=l,l=c,c=a,a=h),n<l|n>u;)if(!(i=0|r[i>>2])){i=22;break t}if(s=(c=c<0?c+6.283185307179586:c)==s|(h=a<0?a+6.283185307179586:a)==s?s+-2220446049250313e-31:s,((h+=(n-l)/(u-l)*(c-h))<0?h+6.283185307179586:h)>s&&(e^=1),!(i=0|r[i>>2])){i=22;break}}if(22==(0|i))return 0|e}else{e=0,i=t;t:for(;;){for(;c=+o[i>>3],h=+o[i+8>>3],d=0|r[(i=i+16|0)>>2],l=+o[(d=0==(0|d)?t:d)>>3],a=+o[d+8>>3],c>l?(u=c,c=h):(u=l,l=c,c=a,a=h),n<l|n>u;)if(!(i=0|r[i>>2])){i=22;break t}if(a+(n-l)/(u-l)*(c-a)>(s=c==s|a==s?s+-2220446049250313e-31:s)&&(e^=1),!(i=0|r[i>>2])){i=22;break}}if(22==(0|i))return 0|e}return 0}function $t(t,e,i,o,s){i|=0,o|=0,s|=0;var a,l,c,u,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0,_=0;if(u=I,I=I+32|0,_=u+16|0,c=u,h=0|Ce(0|(t|=0),0|(e|=0),52),w(),h&=15,m=0|Ce(0|i,0|o,52),w(),(0|h)!=(15&m|0))return I=u,0|(_=1);if(f=0|Ce(0|t,0|e,45),w(),f&=127,g=0|Ce(0|i,0|o,45),w(),m=(0|f)!=(0|(g&=127))){if(7==(0|(p=0|Z(f,g))))return I=u,0|(_=2);7==(0|(A=0|Z(g,f)))?C(22925,22949,151,22959):(y=p,d=A)}else y=0,d=0;a=0|R(f),l=0|R(g),r[_>>2]=0,r[_+4>>2]=0,r[_+8>>2]=0,r[_+12>>2]=0;do{if(y){if(p=(0|(g=0|r[4304+(28*f|0)+(y<<2)>>2]))>0,l)if(p){f=0,A=i,p=o;do{A=0|zt(A,p),p=0|w(),1==(0|(d=0|ct(d)))&&(d=0|ct(1)),f=f+1|0}while((0|f)!=(0|g));g=d,f=A,A=p}else g=d,f=i,A=o;else if(p){f=0,A=i,p=o;do{A=0|Ut(A,p),p=0|w(),d=0|ct(d),f=f+1|0}while((0|f)!=(0|g));g=d,f=A,A=p}else g=d,f=i,A=o;if(Zt(f,A,_),m||C(22972,22949,181,22959),(p=0!=(0|a))&(d=0!=(0|l))&&C(22999,22949,182,22959),p){if(d=0|Ft(t,e),0|n[22032+(7*d|0)+y>>0]){h=3;break}f=A=0|r[21200+(28*d|0)+(y<<2)>>2],v=26}else if(d){if(d=0|Ft(f,A),0|n[22032+(7*d|0)+g>>0]){h=4;break}f=0,A=0|r[21200+(28*g|0)+(d<<2)>>2],v=26}else d=0;if(26==(0|v))if((0|A)<=-1&&C(23030,22949,212,22959),(0|f)<=-1&&C(23053,22949,213,22959),(0|A)>0){p=_+4|0,d=0;do{at(p),d=d+1|0}while((0|d)!=(0|A));d=f}else d=f;if(r[c>>2]=0,r[c+4>>2]=0,r[c+8>>2]=0,ot(c,y),0|h)for(;0|Nt(h)?nt(c):rt(c),(0|h)>1;)h=h+-1|0;if((0|d)>0){h=0;do{at(c),h=h+1|0}while((0|h)!=(0|d))}X(v=_+4|0,c,v),q(v),v=50}else if(Zt(i,o,_),0!=(0|a)&0!=(0|l))if((0|g)!=(0|f)&&C(23077,22949,243,22959),d=0|Ft(t,e),h=0|Ft(i,o),0|n[22032+(7*d|0)+h>>0])h=5;else if((0|(d=0|r[21200+(28*d|0)+(h<<2)>>2]))>0){p=_+4|0,h=0;do{at(p),h=h+1|0}while((0|h)!=(0|d));v=50}else v=50;else v=50}while(0);return 50==(0|v)&&(h=_+4|0,r[s>>2]=r[h>>2],r[s+4>>2]=r[h+4>>2],r[s+8>>2]=r[h+8>>2],h=0),I=u,0|(_=h)}function te(t,e,i,n){i|=0,n|=0;var o,s,a=0,l=0,c=0,u=0,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0;
2if(s=I,I=I+48|0,c=s+36|0,u=s+24|0,h=s+12|0,d=s,l=0|Ce(0|(t|=0),0|(e|=0),52),w(),l&=15,A=0|Ce(0|t,0|e,45),w(),o=0|R(A&=127),Be(0|l,0,52),m=134225919|w(),r[(g=n)>>2]=-1,r[g+4>>2]=m,!l)return(0|r[i>>2])>1||(0|r[i+4>>2])>1||(0|r[i+8>>2])>1||127==(0|(a=0|G(A,0|tt(i))))?(I=s,0|(m=1)):(f=0|Be(0|a,0,45),g=0|w(),g=-1040385&r[(A=n)+4>>2]|g,r[(m=n)>>2]=r[A>>2]|f,r[m+4>>2]=g,I=s,0|(m=0));for(r[c>>2]=r[i>>2],r[c+4>>2]=r[i+4>>2],r[c+8>>2]=r[i+8>>2];r[u>>2]=r[c>>2],r[u+4>>2]=r[c+4>>2],r[u+8>>2]=r[c+8>>2],0|Nt(l)?(et(c),r[h>>2]=r[c>>2],r[h+4>>2]=r[c+4>>2],r[h+8>>2]=r[c+8>>2],nt(h)):(it(c),r[h>>2]=r[c>>2],r[h+4>>2]=r[c+4>>2],r[h+8>>2]=r[c+8>>2],rt(h)),Y(u,h,d),q(d),y=0|r[(g=n)>>2],g=0|r[g+4>>2],i=0|Be(7,0,0|(v=3*(15-l|0)|0)),g&=~(0|w()),v=0|Be(0|tt(d),0,0|v),g=0|w()|g,r[(m=n)>>2]=v|y&~i,r[m+4>>2]=g,(0|l)>1;)l=l+-1|0;t:do{if((0|r[c>>2])<=1&&(0|r[c+4>>2])<=1&&(0|r[c+8>>2])<=1){d=127==(0|(u=0|G(A,l=0|tt(c))))?0:0|R(u);e:do{if(l){if(o){if(c=21408+(28*(0|Ft(t,e))|0)+(l<<2)|0,(0|(c=0|r[c>>2]))>0){i=0;do{l=0|lt(l),i=i+1|0}while((0|i)!=(0|c))}if(1==(0|l)){a=3;break t}127==(0|(i=0|G(A,l)))&&C(23104,22949,376,23134),0|R(i)?C(23147,22949,377,23134):(f=c,p=l,a=i)}else f=0,p=l,a=u;if((0|(h=0|r[4304+(28*A|0)+(p<<2)>>2]))<=-1&&C(23178,22949,384,23134),!d){if((0|f)<=-1&&C(23030,22949,417,23134),0|f){l=0,i=0|r[(c=n)>>2],c=0|r[c+4>>2];do{i=0|kt(i,c),c=0|w(),r[(v=n)>>2]=i,r[v+4>>2]=c,l=l+1|0}while((0|l)<(0|f))}if((0|h)<=0){l=54;break}for(l=0,i=0|r[(c=n)>>2],c=0|r[c+4>>2];;)if(i=0|kt(i,c),c=0|w(),r[(v=n)>>2]=i,r[v+4>>2]=c,(0|(l=l+1|0))==(0|h)){l=54;break e}}if(7==(0|(u=0|Z(a,A)))&&C(22925,22949,393,23134),i=0|r[(l=n)>>2],l=0|r[l+4>>2],(0|h)>0){c=0;do{i=0|kt(i,l),l=0|w(),r[(v=n)>>2]=i,r[v+4>>2]=l,c=c+1|0}while((0|c)!=(0|h))}if(i=0|Ft(i,l),v=0|k(a),(0|(i=0|r[(v?21824:21616)+(28*u|0)+(i<<2)>>2]))<=-1&&C(23030,22949,412,23134),i){l=0,c=0|r[(u=n)>>2],u=0|r[u+4>>2];do{c=0|Rt(c,u),u=0|w(),r[(v=n)>>2]=c,r[v+4>>2]=u,l=l+1|0}while((0|l)<(0|i));l=54}else l=54}else if(0!=(0|o)&0!=(0|d))if(l=21408+(28*(v=0|Ft(t,e))|0)+((0|Ft(0|r[(l=n)>>2],0|r[l+4>>2]))<<2)|0,(0|(l=0|r[l>>2]))<=-1&&C(23201,22949,433,23134),l){a=0,i=0|r[(c=n)>>2],c=0|r[c+4>>2];do{i=0|kt(i,c),c=0|w(),r[(v=n)>>2]=i,r[v+4>>2]=c,a=a+1|0}while((0|a)<(0|l));a=u,l=54}else a=u,l=55;else a=u,l=54}while(0);if(54==(0|l)&&d&&(l=55),55==(0|l)&&1==(0|Ft(0|r[(v=n)>>2],0|r[v+4>>2]))){a=4;break}m=0|r[(v=n)>>2],v=-1040385&r[v+4>>2],y=0|Be(0|a,0,45),v=0|v|w(),r[(a=n)>>2]=m|y,r[a+4>>2]=v,a=0}else a=2}while(0);return I=s,0|(v=a)}function ee(t,e){var i=0;if(!(e|=0))return 0|(i=1);i=t|=0,t=1;do{t=0|v(0==(1&e|0)?1:i,t),e>>=1,i=0|v(i,i)}while(0!=(0|e));return 0|t}function ie(t,e,i){t|=0;var n,s,a=0,l=0,c=0,u=0,h=0,d=0,p=0,A=0;if(!(0|V(e|=0,i|=0)))return 0|(A=0);if(e=0|j(e),s=+o[i>>3],a=e&(a=+o[i+8>>3])<0?a+6.283185307179586:a,(0|(A=0|r[t>>2]))<=0)return 0|(A=0);if(n=0|r[t+4>>2],e){e=0,i=-1,t=0;t:for(;;){for(p=t;u=+o[n+(p<<4)>>3],d=+o[n+(p<<4)+8>>3],c=+o[n+((t=(i+2|0)%(0|A)|0)<<4)>>3],l=+o[n+(t<<4)+8>>3],u>c?(h=u,u=d):(h=c,c=u,u=l,l=d),s<c|s>h;){if(!((0|(i=p+1|0))<(0|A))){i=22;break t}t=p,p=i,i=t}if(a=(u=u<0?u+6.283185307179586:u)==a|(d=l<0?l+6.283185307179586:l)==a?a+-2220446049250313e-31:a,((d+=(s-c)/(h-c)*(u-d))<0?d+6.283185307179586:d)>a&&(e^=1),(0|(t=p+1|0))>=(0|A)){i=22;break}i=p}if(22==(0|i))return 0|e}else{e=0,i=-1,t=0;t:for(;;){for(p=t;u=+o[n+(p<<4)>>3],d=+o[n+(p<<4)+8>>3],c=+o[n+((t=(i+2|0)%(0|A)|0)<<4)>>3],l=+o[n+(t<<4)+8>>3],u>c?(h=u,u=d):(h=c,c=u,u=l,l=d),s<c|s>h;){if(!((0|(i=p+1|0))<(0|A))){i=22;break t}t=p,p=i,i=t}
vendor: 4,356 bytes, line 2
2if(l+(s-c)/(h-c)*(u-l)>(a=u==a|l==a?a+-2220446049250313e-31:a)&&(e^=1),(0|(t=p+1|0))>=(0|A)){i=22;break}i=p}if(22==(0|i))return 0|e}return 0}function ne(t,e){e|=0;var i,n,s,a,c,u=0,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0,_=0,b=0;if(!(n=0|r[(t|=0)>>2]))return r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,void(r[e+28>>2]=0);if(o[(s=e+8|0)>>3]=17976931348623157e292,o[(a=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(c=e+16|0)>>3]=-17976931348623157e292,!((0|n)<=0)){for(i=0|r[t+4>>2],m=17976931348623157e292,y=-17976931348623157e292,v=0,t=-1,p=17976931348623157e292,A=17976931348623157e292,g=-17976931348623157e292,h=-17976931348623157e292,_=0;u=+o[i+(_<<4)>>3],f=+o[i+(_<<4)+8>>3],d=+o[i+(((0|(t=t+2|0))==(0|n)?0:t)<<4)+8>>3],u<p&&(o[s>>3]=u,p=u),f<A&&(o[a>>3]=f,A=f),u>g?o[e>>3]=u:u=g,f>h&&(o[c>>3]=f,h=f),m=f>0&f<m?f:m,y=f<0&f>y?f:y,v|=+l(+(f-d))>3.141592653589793,(0|(t=_+1|0))!=(0|n);)b=_,g=u,_=t,t=b;v&&(o[c>>3]=y,o[a>>3]=m)}}function re(t,e){e|=0;var i,n=0,s=0,a=0,c=0,u=0,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,C=0,B=0,E=0;if(y=0|r[(t|=0)>>2]){if(o[(v=e+8|0)>>3]=17976931348623157e292,o[(_=e+24|0)>>3]=17976931348623157e292,o[e>>3]=-17976931348623157e292,o[(b=e+16|0)>>3]=-17976931348623157e292,(0|y)>0){for(a=0|r[t+4>>2],g=17976931348623157e292,m=-17976931348623157e292,s=0,n=-1,d=17976931348623157e292,p=17976931348623157e292,f=-17976931348623157e292,u=-17976931348623157e292,x=0;c=+o[a+(x<<4)>>3],A=+o[a+(x<<4)+8>>3],h=+o[a+(((0|(B=n+2|0))==(0|y)?0:B)<<4)+8>>3],c<d&&(o[v>>3]=c,d=c),A<p&&(o[_>>3]=A,p=A),c>f?o[e>>3]=c:c=f,A>u&&(o[b>>3]=A,u=A),g=A>0&A<g?A:g,m=A<0&A>m?A:m,s|=+l(+(A-h))>3.141592653589793,(0|(n=x+1|0))!=(0|y);)B=x,f=c,x=n,n=B;s&&(o[b>>3]=m,o[_>>3]=g)}}else r[e>>2]=0,r[e+4>>2]=0,r[e+8>>2]=0,r[e+12>>2]=0,r[e+16>>2]=0,r[e+20>>2]=0,r[e+24>>2]=0,r[e+28>>2]=0;if(!((0|(n=0|r[(B=t+8|0)>>2]))<=0)){i=t+12|0,C=0;do{if(a=0|r[i>>2],s=C,_=e+((C=C+1|0)<<5)|0,b=0|r[a+(s<<3)>>2]){if(o[(x=e+(C<<5)+8|0)>>3]=17976931348623157e292,o[(t=e+(C<<5)+24|0)>>3]=17976931348623157e292,o[_>>3]=-17976931348623157e292,o[(w=e+(C<<5)+16|0)>>3]=-17976931348623157e292,(0|b)>0){for(y=0|r[a+(s<<3)+4>>2],g=17976931348623157e292,m=-17976931348623157e292,a=0,s=-1,v=0,d=17976931348623157e292,p=17976931348623157e292,A=-17976931348623157e292,u=-17976931348623157e292;c=+o[y+(v<<4)>>3],f=+o[y+(v<<4)+8>>3],h=+o[y+(((0|(s=s+2|0))==(0|b)?0:s)<<4)+8>>3],c<d&&(o[x>>3]=c,d=c),f<p&&(o[t>>3]=f,p=f),c>A?o[_>>3]=c:c=A,f>u&&(o[w>>3]=f,u=f),g=f>0&f<g?f:g,m=f<0&f>m?f:m,a|=+l(+(f-h))>3.141592653589793,(0|(s=v+1|0))!=(0|b);)E=v,v=s,A=c,s=E;a&&(o[w>>3]=m,o[t>>3]=g)}}else r[_>>2]=0,r[_+4>>2]=0,r[_+8>>2]=0,r[_+12>>2]=0,r[_+16>>2]=0,r[_+20>>2]=0,r[_+24>>2]=0,r[_+28>>2]=0,n=0|r[B>>2]}while((0|C)<(0|n))}}function oe(t,e,i){var n=0,o=0,s=0;if(!(0|ie(t|=0,e|=0,i|=0)))return 0|(o=0);if((0|r[(o=t+8|0)>>2])<=0)return 0|(o=1);for(n=t+12|0,t=0;;){if(s=t,t=t+1|0,0|ie((0|r[n>>2])+(s<<3)|0,e+(t<<5)|0,i)){t=0,n=6;break}if((0|t)>=(0|r[o>>2])){t=1,n=6;break}}return 6==(0|n)?0|t:0}function se(t,e,i,n,r){e|=0,i|=0,n|=0,r|=0;var s,a,l,c,u,h,d,p=0;c=+o[(t|=0)>>3],l=+o[e>>3]-c,a=+o[t+8>>3],s=+o[e+8>>3]-a,h=+o[i>>3],p=((p=+o[n>>3]-h)*(a-(d=+o[i+8>>3]))-(c-h)*(u=+o[n+8>>3]-d))/(l*u-s*p),o[r>>3]=c+l*p,o[r+8>>3]=a+s*p}function ae(t,e){return e|=0,+o[(t|=0)>>3]!=+o[e>>3]?0|(e=0):0|(e=+o[t+8>>3]==+o[e+8>>3])}function le(t,e){e|=0;var i,n,r;return+((r=+o[(t|=0)>>3]-+o[e>>3])*r+(n=+o[t+8>>3]-+o[e+8>>3])*n+(i=+o[t+16>>3]-+o[e+16>>3])*i)}function ce(t,e,i){t|=0,i|=0;var n=0;(0|(e|=0))>0?(n=0|ve(e,4),r[t>>2]=n,n||C(23230,23253,40,23267)):r[t>>2]=0,r[t+4>>2]=e,r[t+8>>2]=0,r[t+12>>2]=i}function ue(t){var e,i,n,s=0,a=0,c=0,h=0;e=(t|=0)+4|0,i=t+12|0,n=t+8|0;t:for(;;){for(a=0|r[e>>2],s=0;;){if((0|s)>=(0|a))break t;if(c=0|r[t>>2],h=0|r[c+(s<<2)>>2])break;s=s+1|0}s=c+(~~(+l(+ +u(10,+ +(15-(0|r[i>>2])|0))*(+o[h>>3]+ +o[h+8>>3]))%+(0|a))>>>0<<2)|0,a=0|r[s>>2];e:do{if(0|a){if(c=h+32|0,(0|a)==(0|h))r[s>>2]=r[c>>2];else{if(!(s=0|r[(a=a+32|0)>>2]))break;for(;(0|s)!=(0|h);)if(!(s=0|r[(a=s+32|0)>>2]))break e;r[a>>2]=r[c>>2]}ye(h),r[n>>2]=(0|r[n>>2])-1}}while(0)}ye(0|r[t>>2])}function he(t){var e,i=0,n=0;for(e=0|r[(t|=0)+4>>2],n=0;;){if((0|n)>=(0|e)){i=0,n=4;break}if(i=0|r[(0|r[t>>2])+(n<<2)>>2]){n=4;break}n=n+1|0}return 4==(0|n)?0|i:0}function de(t,e){e|=0;var i=0,n=0,s=0,a=0;if(i=~~(+l(+ +u(10,+ +(15-(0|r[(t|=0)+12>>
vendor: 20,669 bytes, line 2
22])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,i=(0|r[t>>2])+(i<<2)|0,!(n=0|r[i>>2]))return 0|(a=1);a=e+32|0;do{if((0|n)!=(0|e)){if(!(i=0|r[n+32>>2]))return 0|(a=1);for(s=i;;){if((0|s)==(0|e)){s=8;break}if(!(i=0|r[s+32>>2])){i=1,s=10;break}n=s,s=i}if(8==(0|s)){r[n+32>>2]=r[a>>2];break}if(10==(0|s))return 0|i}else r[i>>2]=r[a>>2]}while(0);return ye(e),r[(a=t+8|0)>>2]=(0|r[a>>2])-1,0|(a=0)}function pe(t,e,i){t|=0,e|=0,i|=0;var n,s=0,a=0,c=0;(n=0|me(40))||C(23283,23253,98,23296),r[n>>2]=r[e>>2],r[n+4>>2]=r[e+4>>2],r[n+8>>2]=r[e+8>>2],r[n+12>>2]=r[e+12>>2],r[(a=n+16|0)>>2]=r[i>>2],r[a+4>>2]=r[i+4>>2],r[a+8>>2]=r[i+8>>2],r[a+12>>2]=r[i+12>>2],r[n+32>>2]=0,a=~~(+l(+ +u(10,+ +(15-(0|r[t+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,a=(0|r[t>>2])+(a<<2)|0,s=0|r[a>>2];do{if(s){for(;!(0|St(s,e)&&0|St(s+16|0,i));)if(a=0|r[s+32>>2],!(0|r[(s=0==(0|a)?s:a)+32>>2])){c=10;break}if(10==(0|c)){r[s+32>>2]=n;break}return ye(n),0|(c=s)}r[a>>2]=n}while(0);return r[(c=t+8|0)>>2]=1+(0|r[c>>2]),0|(c=n)}function Ae(t,e,i){e|=0,i|=0;var n=0,s=0;if(s=~~(+l(+ +u(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(s=0|r[(0|r[t>>2])+(s<<2)>>2]))return 0|(i=0);if(!i){for(t=s;;){if(0|St(t,e)){n=10;break}if(!(t=0|r[t+32>>2])){t=0,n=10;break}}if(10==(0|n))return 0|t}for(t=s;;){if(0|St(t,e)&&0|St(t+16|0,i)){n=10;break}if(!(t=0|r[t+32>>2])){t=0,n=10;break}}return 10==(0|n)?0|t:0}function fe(t,e){e|=0;var i=0;if(i=~~(+l(+ +u(10,+ +(15-(0|r[(t|=0)+12>>2])|0))*(+o[e>>3]+ +o[e+8>>3]))%+(0|r[t+4>>2]))>>>0,!(t=0|r[(0|r[t>>2])+(i<<2)>>2]))return 0|(i=0);for(;;){if(0|St(t,e)){e=5;break}if(!(t=0|r[t+32>>2])){t=0,e=5;break}}return 5==(0|e)?0|t:0}function ge(t){return 0|~~+function(t){return+ +Ie(+(t=+t))}(t=+t)}function me(t){t|=0;var e,i=0,n=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0;e=I,I=I+16|0,A=e;do{if(t>>>0<245){if(t=(h=t>>>0<11?16:t+11&-8)>>>3,3&(n=(p=0|r[5829])>>>t)|0)return o=0|r[(n=(t=23356+((i=(1&n^1)+t|0)<<1<<2)|0)+8|0)>>2],(0|(a=0|r[(s=o+8|0)>>2]))==(0|t)?r[5829]=p&~(1<<i):(r[a+12>>2]=t,r[n>>2]=a),x=i<<3,r[o+4>>2]=3|x,r[(x=o+x+4|0)>>2]=1|r[x>>2],I=e,0|(x=s);if(h>>>0>(d=0|r[5831])>>>0){if(0|n)return i=((i=n<<t&((i=2<<t)|0-i))&0-i)-1|0,a=0|r[(t=(i=23356+((o=((n=(i>>>=c=i>>>12&16)>>>5&8)|c|(a=(i>>>=n)>>>2&4)|(t=(i>>>=a)>>>1&2)|(o=(i>>>=t)>>>1&1))+(i>>>o)|0)<<1<<2)|0)+8|0)>>2],(0|(n=0|r[(c=a+8|0)>>2]))==(0|i)?(t=p&~(1<<o),r[5829]=t):(r[n+12>>2]=i,r[t>>2]=n,t=p),l=(x=o<<3)-h|0,r[a+4>>2]=3|h,r[(s=a+h|0)+4>>2]=1|l,r[a+x>>2]=l,0|d&&(o=0|r[5834],n=23356+((i=d>>>3)<<1<<2)|0,t&(i=1<<i)?i=0|r[(t=n+8|0)>>2]:(r[5829]=t|i,i=n,t=n+8|0),r[t>>2]=o,r[i+12>>2]=o,r[o+8>>2]=i,r[o+12>>2]=n),r[5831]=l,r[5834]=s,I=e,0|(x=c);if(a=0|r[5830]){for(n=(a&0-a)-1|0,n=u=0|r[23620+(((o=(n>>>=s=n>>>12&16)>>>5&8)|s|(l=(n>>>=o)>>>2&4)|(c=(n>>>=l)>>>1&2)|(u=(n>>>=c)>>>1&1))+(n>>>u)<<2)>>2],c=u,u=(-8&r[u+4>>2])-h|0;(t=0|r[n+16>>2])||(t=0|r[n+20>>2]);)n=t,c=(s=(l=(-8&r[t+4>>2])-h|0)>>>0<u>>>0)?t:c,u=s?l:u;if((l=c+h|0)>>>0>c>>>0){s=0|r[c+24>>2],i=0|r[c+12>>2];do{if((0|i)==(0|c)){if(!(i=0|r[(t=c+20|0)>>2])&&!(i=0|r[(t=c+16|0)>>2])){n=0;break}for(;;)if(n=0|r[(o=i+20|0)>>2])i=n,t=o;else{if(!(n=0|r[(o=i+16|0)>>2]))break;i=n,t=o}r[t>>2]=0,n=i}else n=0|r[c+8>>2],r[n+12>>2]=i,r[i+8>>2]=n,n=i}while(0);do{if(0|s){if(i=0|r[c+28>>2],(0|c)==(0|r[(t=23620+(i<<2)|0)>>2])){if(r[t>>2]=n,!n){r[5830]=a&~(1<<i);break}}else if(r[((0|r[(x=s+16|0)>>2])==(0|c)?x:s+20|0)>>2]=n,!n)break;r[n+24>>2]=s,0|(i=0|r[c+16>>2])&&(r[n+16>>2]=i,r[i+24>>2]=n),0|(i=0|r[c+20>>2])&&(r[n+20>>2]=i,r[i+24>>2]=n)}}while(0);return u>>>0<16?(x=u+h|0,r[c+4>>2]=3|x,r[(x=c+x+4|0)>>2]=1|r[x>>2]):(r[c+4>>2]=3|h,r[l+4>>2]=1|u,r[l+u>>2]=u,0|d&&(o=0|r[5834],n=23356+((i=d>>>3)<<1<<2)|0,(i=1<<i)&p?i=0|r[(t=n+8|0)>>2]:(r[5829]=i|p,i=n,t=n+8|0),r[t>>2]=o,r[i+12>>2]=o,r[o+8>>2]=i,r[o+12>>2]=n),r[5831]=u,r[5834]=l),I=e,0|(x=c+8|0)}p=h}else p=h}else p=h}else if(t>>>0<=4294967231)if(h=-8&(t=t+11|0),o=0|r[5830]){s=0-h|0,u=(t>>>=8)?h>>>0>16777215?31:h>>>((u=14-((c=((m=t<<(p=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|p|(u=((m<<=c)+245760|0)>>>16&2))+(m<<u>>>15)|0)+7|0)&1|u<<1:0,n=0|r[23620+(u<<2)>>2];t:do{if(n)for(t=0,c=h<<(31==(0|u)?0:25-(u>>>1)|0),a=0;;){if((l=(-8&r[n+4>>2])-h|0)>>>0<s>>>0){if(!l){t=n,s=0,m=65;break t}t=n,s=l}if(a=0==(0|(m=0|r[n+20>>2]))|(0|m)==(0|(n=0|r[n+16+(c>>>31<<2)>>2]))?a:m,!n){n=a,m=61;break}c<<=1}else n=0,t=0,m=61}while(0);if(61==(0|m)){if(0==(0|n)&0==(0|t)){if(!(t=((t=2<<u)|0-t)&o)){p=h;break}p=(t&0-t)-1|0,t=0,n=0|r[23620+(((a=(p>>>=l=p>>>12&16)>>>5&8)|l|(c=(p>>>=a)>>>2&4)|(u=(p>>>=c)>>>1&2)|(n=(p>>>=u)>>>1&1))+(p>>>n)<<2)>>2]}n?m=65:(c=t,l=s)}if(65==(0|m))for(a=n;;){if(s=(n=(p=(-8&r[a+4>>2])-h|0)>>>0<s>>>0)?p:s,t=n?a:t,(n=0|r[a+16>>2])||(n=0|r[a+20>>2]),!n){c=t,l=s;break}a=n}if(0!=(0|c)&&l>>>0<((0|r[5831])-h|0)>>>0&&(d=c+h|0)>>>0>c>>>0){a=0|r[c+24>>2],i=0|r[c+12>>2];do{if((0|i)==(0|c)){if(!(i=0|r[(t=c+20|0)>>2])&&!(i=0|r[(t=c+16|0)>>2])){i=0;break}for(;;)if(n=0|r[(s=i+20|0)>>2])i=n,t=s;else{if(!(n=0|r[(s=i+16|0)>>2]))break;i=n,t=s}r[t>>2]=0}else x=0|r[c+8>>2],r[x+12>>2]=i,r[i+8>>2]=x}while(0);do{if(a){if(t=0|r[c+28>>2],(0|c)==(0|r[(n=23620+(t<<2)|0)>>2])){if(r[n>>2]=i,!i){o&=~(1<<t),r[5830]=o;break}}else if(r[((0|r[(x=a+16|0)>>2])==(0|c)?x:a+20|0)>>2]=i,!i)break;r[i+24>>2]=a,0|(t=0|r[c+16>>2])&&(r[i+16>>2]=t,r[t+24>>2]=i),(t=0|r[c+20>>2])&&(r[i+20>>2]=t,r[t+24>>2]=i)}}while(0);t:do{if(l>>>0<16)x=l+h|0,r[c+4>>2]=3|x,r[(x=c+x+4|0)>>2]=1|r[x>>2];else{if(r[c+4>>2]=3|h,r[d+4>>2]=1|l,r[d+l>>2]=l,i=l>>>3,l>>>0<256){n=23356+(i<<1<<2)|0,(t=0|r[5829])&(i=1<<i)?i=0|r[(t=n+8|0)>>2]:(r[5829]=t|i,i=n,t=n+8|0),r[t>>2]=d,r[i+12>>2]=d,r[d+8>>2]=i,r[d+12>>2]=n;break}if(i=23620+((n=(i=l>>>8)?l>>>0>16777215?31:l>>>((n=14-((_=((x=i<<(b=(i+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(n=((x<<=_)+245760|0)>>>16&2))+(x<<n>>>15)|0)+7|0)&1|n<<1:0)<<2)|0,r[d+28>>2]=n,r[(t=d+16|0)+4>>2]=0,r[t>>2]=0,!(o&(t=1<<n))){r[5830]=o|t,r[i>>2]=d,r[d+24>>2]=i,r[d+12>>2]=d,r[d+8>>2]=d;break}i=0|r[i>>2];e:do{if((-8&r[i+4>>2]|0)!=(0|l)){for(o=l<<(31==(0|n)?0:25-(n>>>1)|0);t=0|r[(n=i+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2]|0)==(0|l)){i=t;break e}o<<=1,i=t}r[n>>2]=d,r[d+24>>2]=i,r[d+12>>2]=d,r[d+8>>2]=d;break t}}while(0);x=0|r[(b=i+8|0)>>2],r[x+12>>2]=d,r[b>>2]=d,r[d+8>>2]=x,r[d+12>>2]=i,r[d+24>>2]=0}}while(0);return I=e,0|(x=c+8|0)}p=h}else p=h;else p=-1}while(0);if((n=0|r[5831])>>>0>=p>>>0)return i=n-p|0,t=0|r[5834],i>>>0>15?(x=t+p|0,r[5834]=x,r[5831]=i,r[x+4>>2]=1|i,r[t+n>>2]=i,r[t+4>>2]=3|p):(r[5831]=0,r[5834]=0,r[t+4>>2]=3|n,r[(x=t+n+4|0)>>2]=1|r[x>>2]),I=e,0|(x=t+8|0);if((l=0|r[5832])>>>0>p>>>0)return _=l-p|0,r[5832]=_,b=(x=0|r[5835])+p|0,r[5835]=b,r[b+4>>2]=1|_,r[x+4>>2]=3|p,I=e,0|(x=x+8|0);if(0|r[5947]?t=0|r[5949]:(r[5949]=4096,r[5948]=4096,r[5950]=-1,r[5951]=-1,r[5952]=0,r[5940]=0,r[5947]=-16&A^1431655768,t=4096),c=p+48|0,(h=(a=t+(u=p+47|0)|0)&(s=0-t|0))>>>0<=p>>>0)return I=e,0|(x=0);if(0|(t=0|r[5939])&&(A=(d=0|r[5937])+h|0)>>>0<=d>>>0|A>>>0>t>>>0)return I=e,0|(x=0);t:do{if(4&r[5940])i=0,m=143;else{n=0|r[5835];e:do{if(n){for(o=23764;!((A=0|r[o>>2])>>>0<=n>>>0&&(A+(0|r[o+4>>2])|0)>>>0>n>>>0);){if(!(t=0|r[o+8>>2])){m=128;break e}o=t}if((i=a-l&s)>>>0<2147483647)if((0|(t=0|Pe(0|i)))==((0|r[o>>2])+(0|r[o+4>>2])|0)){if(-1!=(0|t)){l=i,a=t,m=145;break t}}else o=t,m=136;else i=0}else m=128}while(0);do{if(128==(0|m))if(-1!=(0|(n=0|Pe(0)))&&(i=n,g=(i=(0==((g=(f=0|r[5948])+-1|0)&i|0)?0:(g+i&0-f)-i|0)+h|0)+(f=0|r[5937])|0,i>>>0>p>>>0&i>>>0<2147483647)){if(0|(A=0|r[5939])&&g>>>0<=f>>>0|g>>>0>A>>>0){i=0;break}if((0|(t=0|Pe(0|i)))==(0|n)){l=i,a=n,m=145;break t}o=t,m=136}else i=0}while(0);do{if(136==(0|m)){if(n=0-i|0,!(c>>>0>i>>>0&i>>>0<2147483647&-1!=(0|o))){if(-1==(0|o)){i=0;break}l=i,a=o,m=145;break t}if((t=u-i+(t=0|r[5949])&0-t)>>>0>=2147483647){l=i,a=o,m=145;break t}if(-1==(0|Pe(0|t))){Pe(0|n),i=0;break}l=t+i|0,a=o,m=145;break t}}while(0);r[5940]=4|r[5940],m=143}}while(0);if(143==(0|m)&&h>>>0<2147483647&&!(-1==(0|(_=0|Pe(0|h)))|1^(v=(y=(g=0|Pe(0))-_|0)>>>0>(p+40|0)>>>0)|_>>>0<g>>>0&-1!=(0|_)&-1!=(0|g)^1)&&(l=v?y:i,a=_,m=145),145==(0|m)){i=(0|r[5937])+l|0,r[5937]=i,i>>>0>(0|r[5938])>>>0&&(r[5938]=i),u=0|r[5835];t:do{if(u){for(i=23764;;){if((0|a)==((t=0|r[i>>2])+(n=0|r[i+4>>2])|0)){m=154;break}if(!(o=0|r[i+8>>2]))break;i=o}if(154==(0|m)&&(b=i+4|0,0==(8&r[i+12>>2]|0))&&a>>>0>u>>>0&t>>>0<=u>>>0){r[b>>2]=n+l,b=u+(_=0==(7&(_=u+8|0)|0)?0:0-_&7)|0,_=(x=(0|r[5832])+l|0)-_|0,r[5835]=b,r[5832]=_,r[b+4>>2]=1|_,r[u+x+4>>2]=40,r[5836]=r[5951];break}for(a>>>0<(0|r[5833])>>>0&&(r[5833]=a),n=a+l|0,i=23764;;){if((0|r[i>>2])==(0|n)){m=162;break}if(!(t=0|r[i+8>>2]))break;i=t}if(162==(0|m)&&0==(8&r[i+12>>2]|0)){r[i>>2]=a,r[(d=i+4|0)>>2]=(0|r[d>>2])+l,h=(d=a+(0==(7&(d=a+8|0)|0)?0:0-d&7)|0)+p|0,c=(i=n+(0==(7&(i=n+8|0)|0)?0:0-i&7)|0)-d-p|0,r[d+4>>2]=3|p;e:do{if((0|u)==(0|i))x=(0|r[5832])+c|0,r[5832]=x,r[5835]=h,r[h+4>>2]=1|x;else{if((0|r[5834])==(0|i)){x=(0|r[5831])+c|0,r[5831]=x,r[5834]=h,r[h+4>>2]=1|x,r[h+x>>2]=x;break}if(1==(3&(t=0|r[i+4>>2])|0)){l=-8&t,o=t>>>3;i:do{if(t>>>0<256){if(t=0|r[i+8>>2],(0|(n=0|r[i+12>>2]))==(0|t)){r[5829]=r[5829]&~(1<<o);break}r[t+12>>2]=n,r[n+8>>2]=t;break}a=0|r[i+24>>2],t=0|r[i+12>>2];do{if((0|t)==(0|i)){if(t=0|r[(o=(n=i+16|0)+4|0)>>2])n=o;else if(!(t=0|r[n>>2])){t=0;break}for(;;)if(o=0|r[(s=t+20|0)>>2])t=o,n=s;else{if(!(o=0|r[(s=t+16|0)>>2]))break;t=o,n=s}r[n>>2]=0}else x=0|r[i+8>>2],r[x+12>>2]=t,r[t+8>>2]=x}while(0);if(!a)break;o=23620+((n=0|r[i+28>>2])<<2)|0;do{if((0|r[o>>2])==(0|i)){if(r[o>>2]=t,0|t)break;r[5830]=r[5830]&~(1<<n);break i}if(r[((0|r[(x=a+16|0)>>2])==(0|i)?x:a+20|0)>>2]=t,!t)break i}while(0);if(r[t+24>>2]=a,0|(o=0|r[(n=i+16|0)>>2])&&(r[t+16>>2]=o,r[o+24>>2]=t),!(n=0|r[n+4>>2]))break;r[t+20>>2]=n,r[n+24>>2]=t}while(0);i=i+l|0,s=l+c|0}else s=c;if(r[(i=i+4|0)>>2]=-2&r[i>>2],r[h+4>>2]=1|s,r[h+s>>2]=s,i=s>>>3,s>>>0<256){n=23356+(i<<1<<2)|0,(t=0|r[5829])&(i=1<<i)?i=0|r[(t=n+8|0)>>2]:(r[5829]=t|i,i=n,t=n+8|0),r[t>>2]=h,r[i+12>>2]=h,r[h+8>>2]=i,r[h+12>>2]=n;break}i=s>>>8;do{if(i){if(s>>>0>16777215){o=31;break}o=s>>>((o=14-((_=((x=i<<(b=(i+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((x<<=_)+245760|0)>>>16&2))+(x<<o>>>15)|0)+7|0)&1|o<<1}else o=0}while(0);if(i=23620+(o<<2)|0,r[h+28>>2]=o,r[(t=h+16|0)+4>>2]=0,r[t>>2]=0,!((t=0|r[5830])&(n=1<<o))){r[5830]=t|n,r[i>>2]=h,r[h+24>>2]=i,r[h+12>>2]=h,r[h+8>>2]=h;break}i=0|r[i>>2];i:do{if((-8&r[i+4>>2]|0)!=(0|s)){for(o=s<<(31==(0|o)?0:25-(o>>>1)|0);t=0|r[(n=i+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2]|0)==(0|s)){i=t;break i}o<<=1,i=t}r[n>>2]=h,r[h+24>>2]=i,r[h+12>>2]=h,r[h+8>>2]=h;break e}}while(0);x=0|r[(b=i+8|0)>>2],r[x+12>>2]=h,r[b>>2]=h,r[h+8>>2]=x,r[h+12>>2]=i,r[h+24>>2]=0}}while(0);return I=e,0|(x=d+8|0)}for(i=23764;!((t=0|r[i>>2])>>>0<=u>>>0&&(x=t+(0|r[i+4>>2])|0)>>>0>u>>>0);)i=0|r[i+8>>2];i=(t=(t=(s=x+-47|0)+(0==(7&(t=s+8|0)|0)?0:0-t&7)|0)>>>0<(s=u+16|0)>>>0?u:t)+8|0,b=a+(_=0==(7&(_=a+8|0)|0)?0:0-_&7)|0,_=(n=l+-40|0)-_|0,r[5835]=b,r[5832]=_,r[b+4>>2]=1|_,r[a+n+4>>2]=40,r[5836]=r[5951],r[(n=t+4|0)>>2]=27,r[i>>2]=r[5941],r[i+4>>2]=r[5942],r[i+8>>2]=r[5943],r[i+12>>2]=r[5944],r[5941]=a,r[5942]=l,r[5944]=0,r[5943]=i,i=t+24|0;do{b=i,r[(i=i+4|0)>>2]=7}while((b+8|0)>>>0<x>>>0);if((0|t)!=(0|u)){if(a=t-u|0,r[n>>2]=-2&r[n>>2],r[u+4>>2]=1|a,r[t>>2]=a,i=a>>>3,a>>>0<256){n=23356+(i<<1<<2)|0,(t=0|r[5829])&(i=1<<i)?i=0|r[(t=n+8|0)>>2]:(r[5829]=t|i,i=n,t=n+8|0),r[t>>2]=u,r[i+12>>2]=u,r[u+8>>2]=i,r[u+12>>2]=n;break}if(n=23620+((o=(i=a>>>8)?a>>>0>16777215?31:a>>>((o=14-((_=((x=i<<(b=(i+1048320|0)>>>16&8))+520192|0)>>>16&4)|b|(o=((x<<=_)+245760|0)>>>16&2))+(x<<o>>>15)|0)+7|0)&1|o<<1:0)<<2)|0,r[u+28>>2]=o,r[u+20>>2]=0,r[s>>2]=0,!((i=0|r[5830])&(t=1<<o))){r[5830]=i|t,r[n>>2]=u,r[u+24>>2]=n,r[u+12>>2]=u,r[u+8>>2]=u;break}i=0|r[n>>2];e:do{if((-8&r[i+4>>2]|0)!=(0|a)){for(o=a<<(31==(0|o)?0:25-(o>>>1)|0);t=0|r[(n=i+16+(o>>>31<<2)|0)>>2];){if((-8&r[t+4>>2]|0)==(0|a)){i=t;break e}o<<=1,i=t}r[n>>2]=u,r[u+24>>2]=i,r[u+12>>2]=u,r[u+8>>2]=u;break t}}while(0);x=0|r[(b=i+8|0)>>2],r[x+12>>2]=u,r[b>>2]=u,r[u+8>>2]=x,r[u+12>>2]=i,r[u+24>>2]=0}}else 0==(0|(x=0|r[5833]))|a>>>0<x>>>0&&(r[5833]=a),r[5941]=a,r[5942]=l,r[5944]=0,r[5838]=r[5947],r[5837]=-1,r[5842]=23356,r[5841]=23356,r[5844]=23364,r[5843]=23364,r[5846]=23372,r[5845]=23372,r[5848]=23380,r[5847]=23380,r[5850]=23388,r[5849]=23388,r[5852]=23396,r[5851]=23396,r[5854]=23404,r[5853]=23404,r[5856]=23412,r[5855]=23412,r[5858]=23420,r[5857]=23420,r[5860]=23428,r[5859]=23428,r[5862]=23436,r[5861]=23436,r[5864]=23444,r[5863]=23444,r[5866]=23452,r[5865]=23452,r[5868]=23460,r[5867]=23460,r[5870]=23468,r[5869]=23468,r[5872]=23476,r[5871]=23476,r[5874]=23484,r[5873]=23484,r[5876]=23492,r[5875]=23492,r[5878]=23500,r[5877]=23500,r[5880]=23508,r[5879]=23508,r[5882]=23516,r[5881]=23516,r[5884]=23524,r[5883]=23524,r[5886]=23532,r[5885]=23532,r[5888]=23540,r[5887]=23540,r[5890]=23548,r[5889]=23548,r[5892]=23556,r[5891]=23556,r[5894]=23564,r[5893]=23564,r[5896]=23572,r[5895]=23572,r[5898]=23580,r[5897]=23580,r[5900]=23588,r[5899]=23588,r[5902]=23596,r[5901]=23596,r[5904]=23604,r[5903]=23604,b=a+(_=0==(7&(_=a+8|0)|0)?0:0-_&7)|0,_=(x=l+-40|0)-_|0,r[5835]=b,r[5832]=_,r[b+4>>2]=1|_,r[a+x+4>>2]=40,r[5836]=r[5951]}while(0);if((i=0|r[5832])>>>0>p>>>0)return _=i-p|0,r[5832]=_,b=(x=0|r[5835])+p|0,r[5835]=b,r[b+4>>2]=1|_,r[x+4>>2]=3|p,I=e,0|(x=x+8|0)}return r[(x=23312)>>2]=12,I=e,0|(x=0)}function ye(t){var e=0,i=0,n=0,o=0,s=0,a=0,l=0,c=0;if(t|=0){i=t+-8|0,o=0|r[5833],c=i+(e=-8&(t=0|r[t+-4>>2]))|0;do{if(1&t)l=i,a=i;else{if(n=0|r[i>>2],!(3&t))return;if(s=n+e|0,(a=i+(0-n)|0)>>>0<o>>>0)return;if((0|r[5834])==(0|a)){if(3!=(3&(e=0|r[(t=c+4|0)>>2])|0)){l=a,e=s;break}return r[5831]=s,r[t>>2]=-2&e,r[a+4>>2]=1|s,void(r[a+s>>2]=s)}if(i=n>>>3,n>>>0<256){if(t=0|r[a+8>>2],(0|(e=0|r[a+12>>2]))==(0|t)){r[5829]=r[5829]&~(1<<i),l=a,e=s;break}r[t+12>>2]=e,r[e+8>>2]=t,l=a,e=s;break}o=0|r[a+24>>2],t=0|r[a+12>>2];do{if((0|t)==(0|a)){if(t=0|r[(i=(e=a+16|0)+4|0)>>2])e=i;else if(!(t=0|r[e>>2])){t=0;break}for(;;)if(i=0|r[(n=t+20|0)>>2])t=i,e=n;else{if(!(i=0|r[(n=t+16|0)>>2]))break;t=i,e=n}r[e>>2]=0}else l=0|r[a+8>>2],r[l+12>>2]=t,r[t+8>>2]=l}while(0);if(o){if(e=0|r[a+28>>2],(0|r[(i=23620+(e<<2)|0)>>2])==(0|a)){if(r[i>>2]=t,!t){r[5830]=r[5830]&~(1<<e),l=a,e=s;break}}else if(r[((0|r[(l=o+16|0)>>2])==(0|a)?l:o+20|0)>>2]=t,!t){l=a,e=s;break}r[t+24>>2]=o,0|(i=0|r[(e=a+16|0)>>2])&&(r[t+16>>2]=i,r[i+24>>2]=t),(e=0|r[e+4>>2])?(r[t+20>>2]=e,r[e+24>>2]=t,l=a,e=s):(l=a,e=s)}else l=a,e=s}}while(0);if(!(a>>>0>=c>>>0)&&1&(n=0|r[(t=c+4|0)>>2])){if(2&n)r[t>>2]=-2&n,r[l+4>>2]=1|e,r[a+e>>2]=e,o=e;else{if((0|r[5835])==(0|c)){if(c=(0|r[5832])+e|0,r[5832]=c,r[5835]=l,r[l+4>>2]=1|c,(0|l)!=(0|r[5834]))return;return r[5834]=0,void(r[5831]=0)}if((0|r[5834])==(0|c))return c=(0|r[5831])+e|0,r[5831]=c,r[5834]=a,r[l+4>>2]=1|c,void(r[a+c>>2]=c);o=(-8&n)+e|0,i=n>>>3;do{if(n>>>0<256){if(e=0|r[c+8>>2],(0|(t=0|r[c+12>>2]))==(0|e)){r[5829]=r[5829]&~(1<<i);break}r[e+12>>2]=t,r[t+8>>2]=e;break}s=0|r[c+24>>2],t=0|r[c+12>>2];do{if((0|t)==(0|c)){if(t=0|r[(i=(e=c+16|0)+4|0)>>2])e=i;else if(!(t=0|r[e>>2])){i=0;break}for(;;)if(i=0|r[(n=t+20|0)>>2])t=i,e=n;else{if(!(i=0|r[(n=t+16|0)>>2]))break;t=i,e=n}r[e>>2]=0,i=t}else i=0|r[c+8>>2],r[i+12>>2]=t,r[t+8>>2]=i,i=t}while(0);if(0|s){if(t=0|r[c+28>>2],(0|r[(e=23620+(t<<2)|0)>>2])==(0|c)){if(r[e>>2]=i,!i){r[5830]=r[5830]&~(1<<t);break}}else if(r[((0|r[(n=s+16|0)>>2])==(0|c)?n:s+20|0)>>2]=i,!i)break;r[i+24>>2]=s,0|(e=0|r[(t=c+16|0)>>2])&&(r[i+16>>2]=e,r[e+24>>2]=i),0|(t=0|r[t+4>>2])&&(r[i+20>>2]=t,r[t+24>>2]=i)}}while(0);if(r[l+4>>2]=1|o,r[a+o>>2]=o,(0|l)==(0|r[5834]))return void(r[5831]=o)}if(t=o>>>3,o>>>0<256)return i=23356+(t<<1<<2)|0,(e=0|r[5829])&(t=1<<t)?t=0|r[(e=i+8|0)>>2]:(r[5829]=e|t,t=i,e=i+8|0),r[e>>2]=l,r[t+12>>2]=l,r[l+8>>2]=t,void(r[l+12>>2]=i);t=23620+((n=(t=o>>>8)?o>>>0>16777215?31:o>>>((n=14-((s=((c=t<<(a=(t+1048320|0)>>>16&8))+520192|0)>>>16&4)|a|(n=((c<<=s)+245760|0)>>>16&2))+(c<<n>>>15)|0)+7|0)&1|n<<1:0)<<2)|0,r[l+28>>2]=n,r[l+20>>2]=0,r[l+16>>2]=0,e=0|r[5830],i=1<<n;t:do{if(e&i){t=0|r[t>>2];e:do{if((-8&r[t+4>>2]|0)!=(0|o)){for(n=o<<(31==(0|n)?0:25-(n>>>1)|0);e=0|r[(i=t+16+(n>>>31<<2)|0)>>2];){if((-8&r[e+4>>2]|0)==(0|o)){t=e;break e}n<<=1,t=e}r[i>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l;break t}}while(0);c=0|r[(a=t+8|0)>>2],r[c+12>>2]=l,r[a>>2]=l,r[l+8>>2]=c,r[l+12>>2]=t,r[l+24>>2]=0}else r[5830]=e|i,r[t>>2]=l,r[l+24>>2]=t,r[l+12>>2]=l,r[l+8>>2]=l}while(0);if(c=(0|r[5837])-1|0,r[5837]=c,!(0|c)){for(t=23772;t=0|r[t>>2];)t=t+8|0;r[5837]=-1}}}}function ve(t,e){e|=0;var i=0;return(t|=0)?(i=0|v(e,t),(e|t)>>>0>65535&&(i=(0|(i>>>0)/(t>>>0))==(0|e)?i:-1)):i=0,(t=0|me(i))&&3&r[t+-4>>2]?(Me(0|t,0,0|i),0|t):0|t}function _e(t,e,i,n){return 0|(x(0|(n=(e|=0)-(n|=0)-((i|=0)>>>0>(t|=0)>>>0|0)>>>0)),t-i>>>0|0)}function be(t){return 0|((t|=0)?31-(0|b(t^t-1))|0:32)}function xe(t,e,i,n,o){o|=0;var s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,A=0,f=0;if(h=t|=0,a=i|=0,l=p=n|=0,!(u=c=e|=0))return s=0!=(0|o),l?s?(r[o>>2]=0|t,r[o+4>>2]=0&e,o=0,0|(x(0|(p=0)),o)):(o=0,0|(x(0|(p=0)),o)):(s&&(r[o>>2]=(h>>>0)%(a>>>0),r[o+4>>2]=0),o=(h>>>0)/(a>>>0)>>>0,0|(x(0|(p=0)),o));s=0==(0|l);do{if(a){if(!s){if((s=(0|b(0|l))-(0|b(0|u))|0)>>>0<=31){a=d=s+1|0,t=h>>>(d>>>0)&(e=s-31>>31)|u<<(l=31-s|0),e&=u>>>(d>>>0),s=0,l=h<<l;break}return o?(r[o>>2]=0|t,r[o+4>>2]=c|0&e,o=0,0|(x(0|(p=0)),o)):(o=0,0|(x(0|(p=0)),o))}if((s=a-1|0)&a|0){a=l=33+(0|b(0|a))-(0|b(0|u))|0,t=(d=32-l|0)-1>>31&u>>>((A=l-32|0)>>>0)|(u<<d|h>>>(l>>>0))&(e=A>>31),e&=u>>>(l>>>0),s=h<<(f=64-l|0)&(c=d>>31),l=(u<<f|h>>>(A>>>0))&c|h<<d&l-33>>31;break}return 0|o&&(r[o>>2]=s&h,r[o+4>>2]=0),1==(0|a)?(f=0|t,0|(x(0|(A=c|0&e)),f)):(A=u>>>((f=0|be(0|a))>>>0)|0,f=u<<32-f|h>>>(f>>>0)|0,0|(x(0|A),f))}if(s)return 0|o&&(r[o>>2]=(u>>>0)%(a>>>0),r[o+4>>2]=0),f=(u>>>0)/(a>>>0)>>>0,0|(x(0|(A=0)),f);if(!h)return 0|o&&(r[o>>2]=0,r[o+4>>2]=(u>>>0)%(l>>>0)),f=(u>>>0)/(l>>>0)>>>0,0|(x(0|(A=0)),f);if(!((s=l-1|0)&l))return 0|o&&(r[o>>2]=0|t,r[o+4>>2]=s&u|0&e),A=0,f=u>>>((0|be(0|l))>>>0),0|(x(0|A),f);if((s=(0|b(0|l))-(0|b(0|u))|0)>>>0<=30){a=e=s+1|0,t=u<<(l=31-s|0)|h>>>(e>>>0),e=u>>>(e>>>0),s=0,l=h<<l;break}return o?(r[o>>2]=0|t,r[o+4>>2]=c|0&e,f=0,0|(x(0|(A=0)),f)):(f=0,0|(x(0|(A=0)),f))}while(0);if(a){u=0|function(t,e,i,n){return 0|(x((e|=0)+(n|=0)+((i=(t|=0)+(i|=0)>>>0)>>>0<t>>>0|0)>>>0|0),0|i)}(0|(d=0|i),0|(h=p|0&n),-1,-1),i=0|w(),c=l,l=0;do{n=c,c=s>>>31|c<<1,s=l|s<<1,_e(0|u,0|i,0|(n=t<<1|n>>>31|0),0|(p=t>>>31|e<<1|0)),l=1&(A=(f=0|w())>>31|((0|f)<0?-1:0)<<1),t=0|_e(0|n,0|p,A&d|0,(((0|f)<0?-1:0)>>31|((0|f)<0?-1:0)<<1)&h|0),e=0|w(),a=a-1|0}while(0!=(0|a));u=c,c=0}else u=l,c=0,l=0;return a=0,0|o&&(r[o>>2]=t,r[o+4>>2]=e),f=-2&(s<<1|0)|l,0|(x(0|(A=(0|s)>>>31|(u|a)<<1|0&(a<<1|s>>>31)|c)),f)}function we(t,e,i,n){var o,s;return s=I,I=I+16|0,xe(t|=0,e|=0,i|=0,n|=0,o=0|s),I=s,0|(x(0|r[o+4>>2]),0|r[o>>2])}function Ce(t,e,i){return t|=0,e|=0,(0|(i|=0))<32?(x(e>>>i|0),t>>>i|(e&(1<<i)-1)<<32-i):(x(0),e>>>i-32|0)}function Be(t,e,i){return t|=0,e|=0,(0|(i|=0))<32?(x(e<<i|(t&(1<<i)-1<<32-i)>>>32-i|0),t<<i):(x(t<<i-32|0),0)}function Ee(t,e){return e=+e,(t=+t)!=t?+e:e!=e?+t:+_(+t,+e)}function Se(t){return(t=+t)>=0?+a(t+.5):+y(t-.5)}function Te(t,e,i){t|=0,e|=0;var o,s,a=0;if((0|(i|=0))>=8192)return S(0|t,0|e,0|i),0|t;if(s=0|t,o=t+i|0,(3&t)==(3&e)){for(;3&t;){if(!i)return 0|s;n[t>>0]=0|n[e>>0],t=t+1|0,e=e+1|0,i=i-1|0}for(a=(i=-4&o|0)-64|0;(0|t)<=(0|a);)r[t>>2]=r[e>>2],r[t+4>>2]=r[e+4>>2],r[t+8>>2]=r[e+8>>2],r[t+12>>2]=r[e+12>>2],r[t+16>>2]=r[e+16>>2],r[t+20>>2]=r[e+20>>2],r[t+24>>2]=r[e+24>>2],r[t+28>>2]=r[e+28>>2],r[t+32>>2]=r[e+32>>2],r[t+36>>2]=r[e+36>>2],r[t+40>>2]=r[e+40>>2],r[t+44>>2]=r[e+44>>2],r[t+48>>2]=r[e+48>>2],r[t+52>>2]=r[e+52>>2],r[t+56>>2]=r[e+56>>2],r[t+60>>2]=r[e+60>>2],t=t+64|0,e=e+64|0;for(;(0|t)<(0|i);)r[t>>2]=r[e>>2],t=t+4|0,e=e+4|0}else for(i=o-4|0;(0|t)<(0|i);)n[t>>0]=0|n[e>>0],n[t+1>>0]=0|n[e+1>>0],n[t+2>>0]=0|n[e+2>>0],n[t+3>>0]=0|n[e+3>>0],t=t+4|0,e=e+4|0;for(;(0|t)<(0|o);)n[t>>0]=0|n[e>>0],t=t+1|0,e=e+1|0;return 0|s}function Me(t,e,i){e|=0;var o,s=0,a=0,l=0;if(o=(t|=0)+(i|=0)|0,e&=255,(0|i)>=67){for(;3&t;)n[t>>0]=e,t=t+1|0;for(l=e|e<<8|e<<16|e<<24,a=(s=-4&o|0)-64|0;(0|t)<=(0|a);)r[t>>2]=l,r[t+4>>2]=l,r[t+8>>2]=l,r[t+12>>2]=l,r[t+16>>2]=l,r[t+20>>2]=l,r[t+24>>2]=l,r[t+28>>2]=l,r[t+32>>2]=l,r[t+36>>2]=l,r[t+40>>2]=l,r[t+44>>2]=l,r[t+48>>2]=l,r[t+52>>2]=l,r[t+56>>2]=l,r[t+60>>2]=l,t=t+64|0;for(;(0|t)<(0|s);)r[t>>2]=l,t=t+4|0}for(;(0|t)<(0|o);)n[t>>0]=e,t=t+1|0;return o-i|0}function Ie(t){return(t=+t)>=0?+a(t+.5):+y(t-.5)}function Pe(t){t|=0;var e,i,n;return n=0|E(),(0|t)>0&(0|(e=(i=0|r[s>>2])+t|0))<(0|i)|(0|e)<0?(M(0|e),B(12),-1):(0|e)>(0|n)&&!(0|T(0|e))?(B(12),-1):(r[s>>2]=e,0|i)}return{___uremdi3:we,_bitshift64Lshr:Ce,_bitshift64Shl:Be,_calloc:ve,_cellAreaKm2:function(t,e){var i,n,o,s=0;if(o=I,I=I+192|0,n=o,Vt(t|=0,e|=0,i=o+168|0),Ht(t,e,n),(0|(e=0|r[n>>2]))>0){if(s=+Mt(n+8|0,n+8+((1!=(0|e)&1)<<4)|0,i)+0,1!=(0|e)){t=1;
2do{s+=+Mt(n+8+(t<<4)|0,n+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,i)}while((0|t)<(0|e))}}else s=0;return I=o,6371.007180918475*s*6371.007180918475},_cellAreaM2:function(t,e){var i,n,o,s=0;if(o=I,I=I+192|0,n=o,Vt(t|=0,e|=0,i=o+168|0),Ht(t,e,n),(0|(e=0|r[n>>2]))>0){if(s=+Mt(n+8|0,n+8+((1!=(0|e)&1)<<4)|0,i)+0,1!=(0|e)){t=1;do{s+=+Mt(n+8+(t<<4)|0,n+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,i)}while((0|t)<(0|e))}}else s=0;return I=o,6371.007180918475*s*6371.007180918475*1e3*1e3},_cellAreaRads2:function(t,e){var i,n,o,s=0;if(o=I,I=I+192|0,n=o,Vt(t|=0,e|=0,i=o+168|0),Ht(t,e,n),(0|(e=0|r[n>>2]))<=0)return I=o,+(s=0);if(s=+Mt(n+8|0,n+8+((1!=(0|e)&1)<<4)|0,i)+0,1==(0|e))return I=o,+s;t=1;do{s+=+Mt(n+8+(t<<4)|0,n+8+(((0|(t=t+1|0))%(0|e)|0)<<4)|0,i)}while((0|t)<(0|e));return I=o,+s},_compact:function(t,e,i){e|=0;var n,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,C=0,B=0,E=0;if(!(i|=0))return 0|(B=0);if(o=0|r[(s=t|=0)>>2],!0&0==(15728640&(s=0|r[s+4>>2])|0)){if((0|i)<=0)return 0|(B=0);if(r[(B=e)>>2]=o,r[B+4>>2]=s,1==(0|i))return 0|(B=0);o=1;do{C=0|r[(x=t+(o<<3)|0)+4>>2],r[(B=e+(o<<3)|0)>>2]=r[x>>2],r[B+4>>2]=C,o=o+1|0}while((0|o)!=(0|i));return 0|(o=0)}if(!(C=0|me(x=i<<3)))return 0|(B=-3);if(Te(0|C,0|t,0|x),!(n=0|ve(i,8)))return ye(C),0|(B=-3);o=i;t:for(;;){_=0|Ce(0|(d=0|r[(l=C)>>2]),0|(l=0|r[l+4>>2]),52),w(),b=(_&=15)+-1|0,v=(0|o)>0;e:do{if(v){if(y=((0|o)<0)<<31>>31,g=0|Be(0|b,0,52),m=0|w(),b>>>0>15)for(s=0,t=d,i=l;;){if(!(0==(0|t)&0==(0|i))){if(a=0|Ce(0|t,0|i,52),w(),c=(0|(a&=15))<(0|b),a=(0|a)==(0|b),i=0|we(0|(h=c?0:a?t:0),0|(t=c?0:a?i:0),0|o,0|y),w(),0==(0|(u=0|r[(c=a=n+(i<<3)|0)>>2]))&0==(0|(c=0|r[c+4>>2])))i=h;else for(g=0,f=i,A=c,i=h;;){if((0|g)>(0|o)){B=41;break t}if((0|u)==(0|i)&(-117440513&A|0)==(0|t)){h=0|Ce(0|u,0|A,56),w(),p=(h&=7)+1|0,m=0|Ce(0|u,0|A,45),w();i:do{if(0|R(127&m)){if(u=0|Ce(0|u,0|A,52),w(),!(u&=15)){c=6;break}for(c=1;;){if(!(0==((m=0|Be(7,0,3*(15-c|0)|0))&i|0)&0==((0|w())&t|0))){c=7;break i}if(!(c>>>0<u>>>0)){c=6;break}c=c+1|0}}else c=7}while(0);if((h+2|0)>>>0>c>>>0){B=51;break t}m=0|Be(0|p,0,56),t=0|w()|-117440513&t,r[(c=a)>>2]=0,r[c+4>>2]=0,c=f,i|=m}else c=(f+1|0)%(0|o)|0;if(0==(0|(u=0|r[(A=a=n+(c<<3)|0)>>2]))&0==(0|(A=0|r[A+4>>2])))break;g=g+1|0,f=c}r[(m=a)>>2]=i,r[m+4>>2]=t}if((0|(s=s+1|0))>=(0|o))break e;t=0|r[(i=C+(s<<3)|0)>>2],i=0|r[i+4>>2]}for(s=0,t=d,i=l;;){if(!(0==(0|t)&0==(0|i))){if(c=0|Ce(0|t,0|i,52),w(),(0|(c&=15))>=(0|b)){if((0|c)!=(0|b)&&(t|=g,i=-15728641&i|m,c>>>0>=_>>>0)){a=b;do{f=0|Be(7,0,3*(14-a|0)|0),a=a+1|0,t|=f,i=0|w()|i}while(a>>>0<c>>>0)}}else t=0,i=0;if(c=0|we(0|t,0|i,0|o,0|y),w(),!(0==(0|(h=0|r[(u=a=n+(c<<3)|0)>>2]))&0==(0|(u=0|r[u+4>>2]))))for(f=0;;){if((0|f)>(0|o)){B=41;break t}if((0|h)==(0|t)&(-117440513&u|0)==(0|i)){p=0|Ce(0|h,0|u,56),w(),A=(p&=7)+1|0,E=0|Ce(0|h,0|u,45),w();i:do{if(0|R(127&E)){if(h=0|Ce(0|h,0|u,52),w(),!(h&=15)){u=6;break}for(u=1;;){if(!(0==((E=0|Be(7,0,3*(15-u|0)|0))&t|0)&0==((0|w())&i|0))){u=7;break i}if(!(u>>>0<h>>>0)){u=6;break}u=u+1|0}}else u=7}while(0);if((p+2|0)>>>0>u>>>0){B=51;break t}E=0|Be(0|A,0,56),i=0|w()|-117440513&i,r[(A=a)>>2]=0,r[A+4>>2]=0,t|=E}else c=(c+1|0)%(0|o)|0;if(0==(0|(h=0|r[(u=a=n+(c<<3)|0)>>2]))&0==(0|(u=0|r[u+4>>2])))break;f=f+1|0}r[(E=a)>>2]=t,r[E+4>>2]=i}if((0|(s=s+1|0))>=(0|o))break e;t=0|r[(i=C+(s<<3)|0)>>2],i=0|r[i+4>>2]}}}while(0);if((o+5|0)>>>0<11){B=99;break}if(!(m=0|ve((0|o)/6|0,8))){B=58;break}e:do{if(v){f=0,A=0;do{if(!(0==(0|(s=0|r[(t=c=n+(f<<3)|0)>>2]))&0==(0|(t=0|r[t+4>>2])))){u=0|Ce(0|s,0|t,56),w(),i=(u&=7)+1|0,h=-117440513&t,E=0|Ce(0|s,0|t,45),w();i:do{if(0|R(127&E)){if(p=0|Ce(0|s,0|t,52),w(),0|(p&=15))for(a=1;;){if(!(0==(s&(E=0|Be(7,0,3*(15-a|0)|0))|0)&0==(h&(0|w())|0)))break i;if(!(a>>>0<p>>>0))break;a=a+1|0}s|=t=0|Be(0|i,0,56),t=0|w()|h,r[(i=c)>>2]=s,r[i+4>>2]=t,i=u+2|0}}while(0);7==(0|i)&&(r[(E=m+(A<<3)|0)>>2]=s,r[E+4>>2]=-117440513&t,A=A+1|0)}f=f+1|0}while((0|f)!=(0|o));if(v){if(g=((0|o)<0)<<31>>31,p=0|Be(0|b,0,52),f=0|w(),b>>>0>15)for(t=0,s=0;;){do{if(!(0==(0|d)&0==(0|l))){for(u=0|Ce(0|d,0|l,52),w(),a=(0|(u&=15))<(0|b),u=(0|u)==(0|b),a=0|we(0|(c=a?0:u?d:0),0|(u=a?0:u?l:0),0|o,0|g),w(),i=0;;){if((0|i)>(0|o)){B=98;break t}if((-117440513&(h=0|r[(E=n+(a<<3)|0)+4>>2])|0)==(0|u)&&(0|r[E>>2])==(0|c)){B=70;break}if((0|r[(E=n+((a=(a+1|0)%(0|o)|0)<<3)|0)>>2])==(0|c)&&(0|r[E+4>>2])==(0|u))break;i=i+1|0}if(70==(0|B)&&(B=0,!0&100663296==(117440512&h|0)))break;r[(E=e+(s<<3)|0)>>2]=d,r[E+4>>2]=l,s=s+1|0}}while(0);
2if((0|(t=t+1|0))>=(0|o)){o=A;break e}d=0|r[(l=C+(t<<3)|0)>>2],l=0|r[l+4>>2]}for(t=0,s=0;;){do{if(!(0==(0|d)&0==(0|l))){if(u=0|Ce(0|d,0|l,52),w(),(0|(u&=15))>=(0|b))if((0|u)!=(0|b))if(i=d|p,a=-15728641&l|f,u>>>0<_>>>0)u=a;else{c=b;do{E=0|Be(7,0,3*(14-c|0)|0),c=c+1|0,i|=E,a=0|w()|a}while(c>>>0<u>>>0);u=a}else i=d,u=l;else i=0,u=0;for(c=0|we(0|i,0|u,0|o,0|g),w(),a=0;;){if((0|a)>(0|o)){B=98;break t}if((-117440513&(h=0|r[(E=n+(c<<3)|0)+4>>2])|0)==(0|u)&&(0|r[E>>2])==(0|i)){B=93;break}if((0|r[(E=n+((c=(c+1|0)%(0|o)|0)<<3)|0)>>2])==(0|i)&&(0|r[E+4>>2])==(0|u))break;a=a+1|0}if(93==(0|B)&&(B=0,!0&100663296==(117440512&h|0)))break;r[(E=e+(s<<3)|0)>>2]=d,r[E+4>>2]=l,s=s+1|0}}while(0);if((0|(t=t+1|0))>=(0|o)){o=A;break e}d=0|r[(l=C+(t<<3)|0)>>2],l=0|r[l+4>>2]}}else s=0,o=A}else s=0,o=0}while(0);if(Me(0|n,0,0|x),Te(0|C,0|m,o<<3|0),ye(m),!o)break;e=e+(s<<3)|0}return 41==(0|B)?(ye(C),ye(n),0|(E=-1)):51==(0|B)?(ye(C),ye(n),0|(E=-2)):58==(0|B)?(ye(C),ye(n),0|(E=-3)):98==(0|B)?(ye(m),ye(C),ye(n),0|(E=-1)):(99==(0|B)&&Te(0|e,0|C,o<<3|0),ye(C),ye(n),0|(E=0))},_destroyLinkedPolygon:function(t){var e=0,i=0,n=0,o=0;if(t|=0)for(n=1;;){if(0|(e=0|r[t>>2]))do{if(0|(i=0|r[e>>2]))do{o=i,i=0|r[i+16>>2],ye(o)}while(0!=(0|i));o=e,e=0|r[e+8>>2],ye(o)}while(0!=(0|e));if(e=t,t=0|r[t+8>>2],n||ye(e),!t)break;n=0}},_edgeLengthKm:function(t){return+ +o[20752+((t|=0)<<3)>>3]},_edgeLengthM:function(t){return+ +o[20880+((t|=0)<<3)>>3]},_emscripten_replace_memory:function(t){return n=new Int8Array(t),new Uint8Array(t),r=new Int32Array(t),new Float32Array(t),o=new Float64Array(t),i=t,!0},_exactEdgeLengthKm:function(t,e){var i,n,s=0,a=0,l=0,u=0,p=0,A=0;if(n=I,I=I+176|0,Qt(t|=0,e|=0,i=n),(0|(t=0|r[i>>2]))<=1)return I=n,+(l=0);e=t+-1|0,t=0,s=0,a=+o[i+8>>3],l=+o[i+16>>3];do{p=a,a=+o[i+8+((t=t+1|0)<<4)>>3],A=+d(.5*(a-p)),u=l,l=+o[i+8+(t<<4)+8>>3],u=A*A+(u=+d(.5*(l-u)))*(+h(+p)*+h(+a)*u),s+=2*+m(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return I=n,+(A=6371.007180918475*s)},_exactEdgeLengthM:function(t,e){var i,n,s=0,a=0,l=0,u=0,p=0,A=0;if(n=I,I=I+176|0,Qt(t|=0,e|=0,i=n),(0|(t=0|r[i>>2]))<=1)return I=n,+(l=0);e=t+-1|0,t=0,s=0,a=+o[i+8>>3],l=+o[i+16>>3];do{p=a,a=+o[i+8+((t=t+1|0)<<4)>>3],A=+d(.5*(a-p)),u=l,l=+o[i+8+(t<<4)+8>>3],u=A*A+(u=+d(.5*(l-u)))*(+h(+p)*+h(+a)*u),s+=2*+m(+ +c(+u),+ +c(+(1-u)))}while((0|t)!=(0|e));return I=n,+(A=6371.007180918475*s*1e3)},_exactEdgeLengthRads:function(t,e){var i,n,s=0,a=0,l=0,u=0,p=0,A=0;if(n=I,I=I+176|0,Qt(t|=0,e|=0,i=n),(0|(t=0|r[i>>2]))<=1)return I=n,+(l=0);e=t+-1|0,t=0,s=0,a=+o[i+8>>3],l=+o[i+16>>3];do{p=a,a=+o[i+8+((t=t+1|0)<<4)>>3],A=+d(.5*(a-p)),u=l,l=+o[i+8+(t<<4)+8>>3],u=A*A+(u=+d(.5*(l-u)))*(+h(+a)*+h(+p)*u),s+=2*+m(+ +c(+u),+ +c(+(1-u)))}while((0|t)<(0|e));return I=n,+s},_experimentalH3ToLocalIj:function(t,e,i,n,r){var o,s;return r|=0,s=I,I=I+16|0,(t=0|$t(t|=0,e|=0,i|=0,n|=0,o=s))||(pt(o,r),t=0),I=s,0|t},_experimentalLocalIjToH3:function(t,e,i,n){var r,o;return t|=0,e|=0,n|=0,r=I,I=I+16|0,At(i|=0,o=r),n=0|te(t,e,o,n),I=r,0|n},_free:ye,_geoToH3:Gt,_getDestinationH3IndexFromUnidirectionalEdge:function(t,e){t|=0;var i,n,o=0;return i=I,I=I+16|0,o=i,!0&268435456==(2013265920&(e|=0)|0)?(n=0|Ce(0|t,0|e,56),w(),r[o>>2]=0,o=0|O(t,-2130706433&e|134217728,7&n,o),e=0|w(),x(0|e),I=i,0|o):(o=0,x(0|(e=0)),I=i,0|o)},_getH3IndexesFromUnidirectionalEdge:function(t,e,i){t|=0;var n,o,s,a,l=0;s=I,I=I+16|0,n=s,a=!0&268435456==(2013265920&(e|=0)|0),o=-2130706433&e|134217728,r[(l=i|=0)>>2]=a?t:0,r[l+4>>2]=a?o:0,a?(e=0|Ce(0|t,0|e,56),w(),r[n>>2]=0,t=0|O(t,o,7&e,n),e=0|w()):(t=0,e=0),r[(l=i+8|0)>>2]=t,r[l+4>>2]=e,I=s},_getH3UnidirectionalEdge:function(t,e,i,n){var o,s,a=0,l=0,c=0,u=0,h=0;if(s=I,I=I+16|0,o=s,!(0|Wt(t|=0,e|=0,i|=0,n|=0)))return u=0,x(0|(c=0)),I=s,0|u;for(c=-2130706433&e,a=(a=0==(0|Ot(t,e)))?1:2;r[o>>2]=0,l=a+1|0,!((0|(h=0|O(t,e,a,o)))==(0|i)&(0|w())==(0|n));){if(!(l>>>0<7)){a=0,t=0,u=6;break}a=l}return 6==(0|u)?(x(0|a),I=s,0|t):(h=0|Be(0|a,0,56),u=0|c|w()|268435456,h|=t,x(0|u),I=s,0|h)},_getH3UnidirectionalEdgeBoundary:Qt,_getH3UnidirectionalEdgesFromHexagon:function(t,e,i){i|=0;var n,o=0;n=0==(0|Ot(t|=0,e|=0)),e&=-2130706433,r[(o=i)>>2]=n?t:0,r[o+4>>2]=n?285212672|e:0,r[(o=i+8|0)>>2]=t,r[o+4>>2]=301989888|e,r[(o=i+16|0)>>2]=t,r[o+4>>2]=318767104|e,r[(o=i+24|0)>>2]=t,r[o+4>>2]=335544320|e,r[(o=i+32|0)>>2]=t,r[o+4>>2]=352321536|e,r[(i=i+40|0)>>2]=t,r[i+4>>2]=369098752|e},_getOriginH3IndexFromUnidirectionalEdge:function(t,e){var i;return t|=0,x(0|((i=!0&268435456==(2013265920&(e|=0)|0))?-2130706433&e|134217728:0)),0|(i?t:0)},_getPentagonIndexes:Jt,_getRes0Indexes:function(t){t|=0;var e=0,i=0,n=0;e=0;do{Be(0|e,0,45),n=134225919|w(),r[(i=t+(e<<3)|0)>>2]=-1,r[i+4>>2]=n,e=e+1|0}while(122!=(0|e))}
2,_h3Distance:function(t,e,i,n){var r,o,s;return i|=0,n|=0,s=I,I=I+32|0,o=s,t=0==(0|$t(t|=0,e|=0,t,e,r=s+12|0))&&0==(0|$t(t,e,i,n,o))?0|dt(r,o):-1,I=s,0|t},_h3GetBaseCell:It,_h3GetFaces:function t(e,i,n){n|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0;o=I,I=I+128|0,d=o+112|0,l=o+96|0,p=o,a=0|Ce(0|(e|=0),0|(i|=0),52),w(),u=15&a,r[d>>2]=u,c=0|Ce(0|e,0|i,45),w(),c&=127;t:do{if(0|R(c)){if(0|u)for(s=1;;){if(!(0==((h=0|Be(7,0,3*(15-s|0)|0))&e|0)&0==((0|w())&i|0))){a=0;break t}if(!(s>>>0<u>>>0))break;s=s+1|0}if(!(1&a))return h=0|Be(u+1|0,0,52),p=0|w()|-15728641&i,t((h|e)&~(d=0|Be(7,0,3*(14-u|0)|0)),p&~(0|w()),n),void(I=o);a=1}else a=0}while(0);jt(e,i,l),a?(bt(l,d,p),h=5):(Bt(l,d,p),h=6);t:do{if(0|R(c))if(u)for(s=1;;){if(!(0==((c=0|Be(7,0,3*(15-s|0)|0))&e|0)&0==((0|w())&i|0))){s=8;break t}if(!(s>>>0<u>>>0)){s=20;break}s=s+1|0}else s=20;else s=8}while(0);if(Me(0|n,-1,0|s),a){a=0;do{for(wt(l=p+(a<<4)|0,0|r[d>>2]),l=0|r[l>>2],s=0;!(-1==(0|(u=0|r[(c=n+(s<<2)|0)>>2]))|(0|u)==(0|l));)s=s+1|0;r[c>>2]=l,a=a+1|0}while((0|a)!=(0|h))}else{a=0;do{for(xt(l=p+(a<<4)|0,0|r[d>>2],0,1),l=0|r[l>>2],s=0;!(-1==(0|(u=0|r[(c=n+(s<<2)|0)>>2]))|(0|u)==(0|l));)s=s+1|0;r[c>>2]=l,a=a+1|0}while((0|a)!=(0|h))}I=o},_h3GetResolution:function(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),52),w(),15&e|0},_h3IndexesAreNeighbors:Wt,_h3IsPentagon:Ot,_h3IsResClassIII:function(t,e){return e=0|Ce(0|(t|=0),0|(e|=0),52),w(),1&e|0},_h3IsValid:Pt,_h3Line:function(t,e,i,n,o){i|=0,n|=0,o|=0;var s,a=0,c=0,u=0,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,w=0,C=0;if(s=I,I=I+48|0,c=s+12|0,w=s,0==(0|$t(t|=0,e|=0,t,e,a=s+24|0))&&0==(0|$t(t,e,i,n,c))){if((0|(x=0|dt(a,c)))<0)return I=s,0|(w=x);for(r[a>>2]=0,r[a+4>>2]=0,r[a+8>>2]=0,r[c>>2]=0,r[c+4>>2]=0,r[c+8>>2]=0,$t(t,e,t,e,a),$t(t,e,i,n,c),ft(a),ft(c),x?(g=+(0|x),b=a,i=p=0|r[a>>2],n=A=0|r[(v=a+4|0)>>2],a=f=0|r[(_=a+8|0)>>2],m=+((0|r[c>>2])-p|0)/g,y=+((0|r[c+4>>2])-A|0)/g,g=+((0|r[c+8>>2])-f|0)/g):(v=n=a+4|0,_=f=a+8|0,b=a,i=0|r[a>>2],n=0|r[n>>2],a=0|r[f>>2],m=0,y=0,g=0),r[w>>2]=i,r[(f=w+4|0)>>2]=n,r[(A=w+8|0)>>2]=a,p=0;;){C=m*(h=+(0|p))+ +(0|i),u=y*h+ +(0|r[v>>2]),h=g*h+ +(0|r[_>>2]),n=~~+Se(+C),c=~~+Se(+u),i=~~+Se(+h),C=+l(+(+(0|n)-C)),u=+l(+(+(0|c)-u)),h=+l(+(+(0|i)-h));do{if(!(C>u&C>h)){if(d=0-n|0,u>h){a=d-i|0;break}a=c,i=d-c|0;break}n=0-(c+i)|0,a=c}while(0);if(r[w>>2]=n,r[f>>2]=a,r[A>>2]=i,gt(w),te(t,e,w,o+(p<<3)|0),(0|p)==(0|x))break;p=p+1|0,i=0|r[b>>2]}return I=s,0|(w=0)}return I=s,0|(w=-1)},_h3LineSize:function(t,e,i,n){var r,o,s;return i|=0,n|=0,s=I,I=I+32|0,o=s,t=0==(0|$t(t|=0,e|=0,t,e,r=s+12|0))&&0==(0|$t(t,e,i,n,o))?0|dt(r,o):-1,I=s,(t>>>31^1)+t|0},_h3SetToLinkedGeo:function(t,e,i){i|=0;var n,o,s,a=0;if(s=I,I=I+32|0,n=s,function(t,e,i){t|=0,i|=0;var n,o,s=0,a=0,l=0,c=0,u=0;if(o=I,I=I+176|0,n=o,(0|(e|=0))<1)return ce(i,0,0),void(I=o);c=0|Ce(0|r[(c=t)>>2],0|r[c+4>>2],52),w(),ce(i,(0|e)>6?e:6,15&c),c=0;do{if(Ht(0|r[(s=t+(c<<3)|0)>>2],0|r[s+4>>2],n),(0|(s=0|r[n>>2]))>0){u=0;do{l=n+8+(u<<4)|0,(a=0|Ae(i,s=n+8+(((0|(u=u+1|0))%(0|s)|0)<<4)|0,l))?de(i,a):pe(i,l,s),s=0|r[n>>2]}while((0|u)<(0|s))}c=c+1|0}while((0|c)!=(0|e));I=o}(t|=0,e|=0,o=s+16|0),r[i>>2]=0,r[i+4>>2]=0,r[i+8>>2]=0,!(t=0|he(o)))return Xt(i),ue(o),void(I=s);do{e=0|qt(i);do{Kt(e,t),a=t+16|0,r[n>>2]=r[a>>2],r[n+4>>2]=r[a+4>>2],r[n+8>>2]=r[a+8>>2],r[n+12>>2]=r[a+12>>2],de(o,t),t=0|fe(o,n)}while(0!=(0|t));t=0|he(o)}while(0!=(0|t));Xt(i),ue(o),I=s},_h3ToCenterChild:function(t,e,i){i|=0;var n=0,r=0;if(n=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|i)<16&(0|(n&=15))<=(0|i)){if((0|n)!=(0|i)&&(t|=r=0|Be(0|i,0,52),e=0|w()|-15728641&e,(0|n)<(0|i)))do{r=0|Be(7,0,3*(14-n|0)|0),n=n+1|0,t&=~r,e&=~(0|w())}while((0|n)<(0|i))}else e=0,t=0;return x(0|e),0|t},_h3ToChildren:Lt,_h3ToGeo:Vt,_h3ToGeoBoundary:Ht,_h3ToParent:Dt,_h3UnidirectionalEdgeIsValid:function(t,e){var i=0;if(!(!0&268435456==(2013265920&(e|=0)|0)))return 0|(i=0);switch(i=0|Ce(0|(t|=0),0|e,56),w(),7&i){case 0:case 7:return 0|(i=0)}return!0&16777216==(117440512&e|0)&0!=(0|Ot(t,i=-2130706433&e|134217728))?0|(i=0):0|(i=0|Pt(t,i))},_hexAreaKm2:function(t){return+ +o[20496+((t|=0)<<3)>>3]},_hexAreaM2:function(t){return+ +o[20624+((t|=0)<<3)>>3]}
2,_hexRing:function(t,e,i,n){t|=0,e|=0,n|=0;var o,s=0,a=0,l=0,c=0,u=0,h=0,d=0;if(o=I,I=I+16|0,d=o,!(i|=0))return r[(d=n)>>2]=t,r[d+4>>2]=e,I=o,0|(d=0);r[d>>2]=0;t:do{if(0|Ot(t,e))t=1;else{if(a=(0|i)>0){s=0,h=t;do{if(0==(0|(h=0|O(h,e,4,d)))&0==(0|(e=0|w()))){t=2;break t}if(s=s+1|0,0|Ot(h,e)){t=1;break t}}while((0|s)<(0|i));if(r[(u=n)>>2]=h,r[u+4>>2]=e,u=i+-1|0,a){a=0,l=1,s=h,t=e;do{if(0==(0|(s=0|O(s,t,2,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(c=n+(l<<3)|0)>>2]=s,r[c+4>>2]=t,l=l+1|0,0|Ot(s,t)){t=1;break t}a=a+1|0}while((0|a)<(0|i));c=0,a=l;do{if(0==(0|(s=0|O(s,t,3,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(l=n+(a<<3)|0)>>2]=s,r[l+4>>2]=t,a=a+1|0,0|Ot(s,t)){t=1;break t}c=c+1|0}while((0|c)<(0|i));l=0;do{if(0==(0|(s=0|O(s,t,1,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(c=n+(a<<3)|0)>>2]=s,r[c+4>>2]=t,a=a+1|0,0|Ot(s,t)){t=1;break t}l=l+1|0}while((0|l)<(0|i));l=0;do{if(0==(0|(s=0|O(s,t,5,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(c=n+(a<<3)|0)>>2]=s,r[c+4>>2]=t,a=a+1|0,0|Ot(s,t)){t=1;break t}l=l+1|0}while((0|l)<(0|i));l=0;do{if(0==(0|(s=0|O(s,t,4,d)))&0==(0|(t=0|w()))){t=2;break t}if(r[(c=n+(a<<3)|0)>>2]=s,r[c+4>>2]=t,a=a+1|0,0|Ot(s,t)){t=1;break t}l=l+1|0}while((0|l)<(0|i));for(l=0;;){if(0==(0|(s=0|O(s,t,6,d)))&0==(0|(t=0|w()))){t=2;break t}if((0|l)!=(0|u)){if(r[(c=n+(a<<3)|0)>>2]=s,r[c+4>>2]=t,0|Ot(s,t)){t=1;break t}a=a+1|0}if((0|(l=l+1|0))>=(0|i)){l=h,a=e;break}}}else l=h,s=h,a=e,t=e}else r[(l=n)>>2]=t,r[l+4>>2]=e,l=t,s=t,a=e,t=e;t=1&((0|l)!=(0|s)|(0|a)!=(0|t))}}while(0);return I=o,0|(d=t)},_i64Subtract:_e,_kRing:P,_kRingDistances:function(t,e,i,n,r){var o;if(0|D(t|=0,e|=0,i|=0,n|=0,r|=0)){if(Me(0|n,0,(o=1+(0|v(3*i|0,i+1|0))|0)<<3|0),0|r)return Me(0|r,0,o<<2|0),void L(t,e,i,n,r,o,0);(r=0|ve(o,4))&&(L(t,e,i,n,r,o,0),ye(r))}},_llvm_minnum_f64:Ee,_llvm_round_f64:Se,_malloc:me,_maxFaceCount:function(t,e){var i=0,n=0;if(n=0|Ce(0|(t|=0),0|(e|=0),45),w(),!(0|R(127&n)))return 0|(n=2);if(n=0|Ce(0|t,0|e,52),w(),!(n&=15))return 0|(n=5);for(i=1;;){if(!(0==((0|Be(7,0,3*(15-i|0)|0))&t|0)&0==((0|w())&e|0))){i=2,t=6;break}if(!(i>>>0<n>>>0)){i=5,t=6;break}i=i+1|0}return 6==(0|t)?0|i:0},_maxH3ToChildrenSize:function(t,e,i){return i|=0,t=0|Ce(0|(t|=0),0|(e|=0),52),w(),(0|i)<16&(0|(t&=15))<=(0|i)?0|(i=0|ee(7,i-t|0)):0|(i=0)},_maxKringSize:function(t){return 1+(0|v(3*(t|=0)|0,t+1|0))|0},_maxPolyfillSize:function(t,e){e|=0;var i,n=0,o=0,s=0,a=0,l=0;if(i=I,I=I+48|0,s=i+8|0,o=i,a=0|r[(l=t|=0)+4>>2],r[(n=o)>>2]=r[l>>2],r[n+4>>2]=a,ne(o,s),s=0|H(s,e),e=0|r[o>>2],(0|(o=0|r[t+8>>2]))<=0)return I=i,0|(l=(l=(a=(0|s)<(0|(l=e)))?l:s)+12|0);n=0|r[t+12>>2],t=0;do{e=(0|r[n+(t<<3)>>2])+e|0,t=t+1|0}while((0|t)<(0|o));return I=i,0|(l=(l=(l=(0|s)<(0|e))?e:s)+12|0)},_maxUncompactSize:function(t,e,i){t|=0,i|=0;var n=0,o=0,s=0,a=0;if((0|(e|=0))<=0)return 0|(i=0);if((0|i)>=16){for(n=0;;){if(!(0==(0|r[(a=t+(n<<3)|0)>>2])&0==(0|r[a+4>>2]))){n=-1,o=13;break}if((0|(n=n+1|0))>=(0|e)){n=0,o=13;break}}if(13==(0|o))return 0|n}n=0,a=0;t:for(;;){s=0|r[(o=t+(a<<3)|0)>>2],o=0|r[o+4>>2];do{if(!(0==(0|s)&0==(0|o))){if(o=0|Ce(0|s,0|o,52),w(),(0|(o&=15))>(0|i)){n=-1,o=13;break t}if((0|o)==(0|i)){n=n+1|0;break}n=(0|ee(7,i-o|0))+n|0;break}}while(0);if((0|(a=a+1|0))>=(0|e)){o=13;break}}return 13==(0|o)?0|n:0},_memcpy:Te,_memset:Me,_numHexagons:function(t){var e;return t=0|r[(e=21008+((t|=0)<<3)|0)>>2],x(0|r[e+4>>2]),0|t},_pentagonIndexCount:function(){return 12},_pointDistKm:Tt,_pointDistM:function(t,e){t|=0;var i,n,r,s=0;return n=+o[(e|=0)>>3],i=+o[t>>3],s=(r=+d(.5*(n-i)))*r+(s=+d(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+n)*+h(+i)*s),2*+m(+ +c(+s),+ +c(+(1-s)))*6371.007180918475*1e3},_pointDistRads:function(t,e){t|=0;var i,n,r,s=0;return n=+o[(e|=0)>>3],i=+o[t>>3],s=(r=+d(.5*(n-i)))*r+(s=+d(.5*(+o[e+8>>3]-+o[t+8>>3])))*(+h(+n)*+h(+i)*s),2*+m(+ +c(+s),+ +c(+(1-s)))},_polyfill:function(t,e,i){var n,o=0,s=0,a=0,l=0,c=0;if(n=I,I=I+48|0,o=n+8|0,s=n,0|function(t,e,i){t|=0,e|=0,i|=0;var n=0,o=0,s=0,a=0,l=0,c=0,u=0,h=0,d=0,p=0,A=0,f=0,g=0,m=0,y=0,v=0,_=0,b=0,x=0,B=0,E=0,S=0,T=0,M=0,P=0,O=0,R=0,k=0,z=0,U=0;U=I,I=I+112|0,O=U+80|0,c=U+72|0,R=U,k=U+56|0,u=t+8|0,z=0|me(32+(r[u>>2]<<5)|0),z||C(22848,22448,800,22456);if(re(t,z),s=t,n=0|r[s+4>>2],l=c,r[l>>2]=r[s>>2],r[l+4>>2]=n,ne(c,O),l=0|H(O,e),n=0|r[c>>2],s=0|r[u>>2],(0|s)>0){a=0|r[t+12>>2],o=0;do{n=(0|r[a+(o<<3)>>2])+n|0,o=o+1|0}while((0|o)!=(0|s))}if(l=(0|l)<(0|n)?n:l,P=l+12|0,o=0|ve(P,8),h=0|ve(P,8),r[O>>2]=0,T=t,M=0|r[T+4>>2],n=c,r[n>>2]=r[T>>2],r[n+4>>2]=M,n=0|F(c,P,e,O,o,h),0|n)return ye(o),ye(h),ye(z),I=U,0|(z=n);t:do{if((0|r[u>>2])>0){for(s=t+12|0,n=0;a=0|F((0|r[s>>2])+(n<<3)|0,P,e,O,o,h),n=n+1|0,!(0|a);)if((0|n)>=(0|r[u>>2]))break t;return ye(o),ye(h),ye(z),I=U,0|(z=a)}}while(0);(0|l)>-12&&Me(0|h,0,((0|P)>1?P:1)<<3|0);t:do{if((0|r[O>>2])>0){M=((0|P)<0)<<31>>
231,b=o,x=h,B=o,E=o,S=h,T=o,n=o,m=o,y=h,v=h,_=h,o=h;e:for(;;){for(g=0|r[O>>2],A=0,f=0,s=0;;){l=(a=R)+56|0;do{r[a>>2]=0,a=a+4|0}while((0|a)<(0|l));if(0|D(c=0|r[(e=b+(A<<3)|0)>>2],e=0|r[e+4>>2],1,R,0)){l=(a=R)+56|0;do{r[a>>2]=0,a=a+4|0}while((0|a)<(0|l));0|(a=0|ve(7,4))&&(L(c,e,1,R,a,7,0),ye(a))}p=0;do{h=0|r[(d=R+(p<<3)|0)>>2],d=0|r[d+4>>2];i:do{if(!(0==(0|h)&0==(0|d))){if(c=0|we(0|h,0|d,0|P,0|M),w(),!(0==(0|(e=0|r[(l=a=i+(c<<3)|0)>>2]))&0==(0|(l=0|r[l+4>>2]))))for(u=0;;){if((0|u)>(0|P))break e;if((0|e)==(0|h)&(0|l)==(0|d))break i;if(0==(0|(e=0|r[(l=a=i+((c=(c+1|0)%(0|P)|0)<<3)|0)>>2]))&0==(0|(l=0|r[l+4>>2])))break;u=u+1|0}0==(0|h)&0==(0|d)||(Vt(h,d,k),0|oe(t,z,k)&&(r[(u=a)>>2]=h,r[u+4>>2]=d,r[(u=x+(s<<3)|0)>>2]=h,r[u+4>>2]=d,s=s+1|0))}}while(0);p=p+1|0}while(p>>>0<7);if((0|(f=f+1|0))>=(0|g))break;A=A+1|0}if((0|g)>0&&Me(0|B,0,g<<3|0),r[O>>2]=s,!((0|s)>0))break t;h=o,d=_,p=T,A=v,f=y,g=x,o=m,_=n,v=E,y=B,m=h,n=d,T=S,S=p,E=A,B=f,x=b,b=g}return ye(E),ye(S),ye(z),I=U,0|(z=-1)}n=h}while(0);return ye(z),ye(o),ye(n),z=0,I=U,0|z}(t|=0,e|=0,i|=0)){if(a=0|r[(c=t)+4>>2],r[(l=s)>>2]=r[c>>2],r[l+4>>2]=a,ne(s,o),l=0|H(o,e),e=0|r[s>>2],(0|(a=0|r[t+8>>2]))>0){s=0|r[t+12>>2],o=0;do{e=(0|r[s+(o<<3)>>2])+e|0,o=o+1|0}while((0|o)!=(0|a))}(0|(e=(0|l)<(0|e)?e:l))<=-12||Me(0|i,0,8+(((0|(c=e+11|0))>0?c:0)<<3)|0),I=n}else I=n},_res0IndexCount:function(){return 122},_round:Ie,_sbrk:Pe,_sizeOfCoordIJ:function(){return 8},_sizeOfGeoBoundary:function(){return 168},_sizeOfGeoCoord:function(){return 16},_sizeOfGeoPolygon:function(){return 16},_sizeOfGeofence:function(){return 8},_sizeOfH3Index:function(){return 8},_sizeOfLinkedGeoPolygon:function(){return 12},_uncompact:function(t,e,i,n,o){t|=0,i|=0,n|=0,o|=0;var s=0,a=0,l=0,c=0,u=0,h=0;if((0|(e|=0))<=0)return 0|(o=0);if((0|o)>=16){for(s=0;;){if(!(0==(0|r[(h=t+(s<<3)|0)>>2])&0==(0|r[h+4>>2]))){s=14;break}if((0|(s=s+1|0))>=(0|e)){a=0,s=16;break}}if(14==(0|s))return 0|((0|n)>0?-2:-1);if(16==(0|s))return 0|a}s=0,h=0;t:for(;;){a=0|r[(l=u=t+(h<<3)|0)>>2],l=0|r[l+4>>2];do{if(!(0==(0|a)&0==(0|l))){if((0|s)>=(0|n)){a=-1,s=16;break t}if(c=0|Ce(0|a,0|l,52),w(),(0|(c&=15))>(0|o)){a=-2,s=16;break t}if((0|c)==(0|o)){r[(u=i+(s<<3)|0)>>2]=a,r[u+4>>2]=l,s=s+1|0;break}if((0|(a=(0|ee(7,o-c|0))+s|0))>(0|n)){a=-1,s=16;break t}Lt(0|r[u>>2],0|r[u+4>>2],o,i+(s<<3)|0),s=a}}while(0);if((0|(h=h+1|0))>=(0|e)){a=0,s=16;break}}return 16==(0|s)?0|a:0},establishStackSpace:function(t,e){I=t|=0},stackAlloc:function(t){var e;return e=I,I=(I=I+(t|=0)|0)+15&-16,0|e},stackRestore:function(t){I=t|=0},stackSave:function(){return 0|I}}}({Math:Math,Int8Array:Int8Array,Int32Array:Int32Array,Uint8Array:Uint8Array,Float32Array:Float32Array,Float64Array:Float64Array},Y,g),tt=(i.___uremdi3=$.___uremdi3,i._bitshift64Lshr=$._bitshift64Lshr,i._bitshift64Shl=$._bitshift64Shl,i._calloc=$._calloc,i._cellAreaKm2=$._cellAreaKm2,i._cellAreaM2=$._cellAreaM2,i._cellAreaRads2=$._cellAreaRads2,i._compact=$._compact,i._destroyLinkedPolygon=$._destroyLinkedPolygon,i._edgeLengthKm=$._edgeLengthKm,i._edgeLengthM=$._edgeLengthM,i._emscripten_replace_memory=$._emscripten_replace_memory),et=(i._exactEdgeLengthKm=$._exactEdgeLengthKm,i._exactEdgeLengthM=$._exactEdgeLengthM,i._exactEdgeLengthRads=$._exactEdgeLengthRads,i._experimentalH3ToLocalIj=$._experimentalH3ToLocalIj,i._experimentalLocalIjToH3=$._experimentalLocalIjToH3,i._free=$._free,i._geoToH3=$._geoToH3,i._getDestinationH3IndexFromUnidirectionalEdge=$._getDestinationH3IndexFromUnidirectionalEdge,i._getH3IndexesFromUnidirectionalEdge=$._getH3IndexesFromUnidirectionalEdge,i._getH3UnidirectionalEdge=$._getH3UnidirectionalEdge,i._getH3UnidirectionalEdgeBoundary=$._getH3UnidirectionalEdgeBoundary,i._getH3UnidirectionalEdgesFromHexagon=$._getH3UnidirectionalEdgesFromHexagon,i._getOriginH3IndexFromUnidirectionalEdge=$._getOriginH3IndexFromUnidirectionalEdge,i._getPentagonIndexes=$._getPentagonIndexes,i._getRes0Indexes=$._getRes0Indexes,i._h3Distance=$._h3Distance,i._h3GetBaseCell=$._h3GetBaseCell,i._h3GetFaces=$._h3GetFaces,i._h3GetResolution=$._h3GetResolution,i._h3IndexesAreNeighbors=$._h3IndexesAreNeighbors,i._h3IsPentagon=$._h3IsPentagon,i._h3IsResClassIII=$._h3IsResClassIII,i._h3IsValid=$._h3IsValid,i._h3Line=$._h3Line,i._h3LineSize=$._h3LineSize,i._h3SetToLinkedGeo=$._h3SetToLinkedGeo,i._h3ToCenterChild=$._h3ToCenterChild,i._h3ToChildren=$._h3ToChildren,i._h3ToGeo=$._h3ToGeo,i._h3ToGeoBoundary=$._h3ToGeoBoundary,i._h3ToParent=$._h3ToParent,i._h3UnidirectionalEdgeIsValid=$._h3UnidirectionalEdgeIsValid,i._hexAreaKm2=$._hexAreaKm2,i._hexAreaM2=$._hexAreaM2,i._hexRing=$._hexRing,i._i64Subtract=$._i64Subtract,i._kRing=$._kRing,i._kRingDistances=$._kRingDistances,i._llvm_minnum_f64=$._llvm_minnum_f64,i._llvm_round_f64=$._llvm_round_f64,i._malloc=$._malloc,i._maxFaceCount=$._maxFaceCount,i._maxH3ToChildrenSize=$._maxH3ToChildrenSize,i._maxKringSize=$._maxKringSize,i._maxPolyfillSize=$._maxPolyfillSize,i._maxUncompactSize=$._maxUncompactSize,i._memcpy=$._memcpy,i._memset=$._memset,i._numHexagons=$._numHexagons,i._pentagonIndexCount=$._pentagonIndexCount,i._pointDistKm=$._pointDistKm,i._pointDistM=$._pointDistM,i._pointDistRads=$._pointDistRads,i._polyfill=$._polyfill,i._res0IndexCount=$._res0IndexCount,i._round=$._round,i._sbrk=$._sbrk,i._sizeOfCoordIJ=$._sizeOfCoordIJ,i._sizeOfGeoBoundary=$._sizeOfGeoBoundary,i._sizeOfGeoCoord=$._sizeOfGeoCoord,i._sizeOfGeoPolygon=$._sizeOfGeoPolygon,i._sizeOfGeofence=$._sizeOfGeofence,i._sizeOfH3Index=$._sizeOfH3Index,i._sizeOfLinkedGeoPolygon=$._sizeOfLinkedGeoPolygon,i._uncompact=$._uncompact,i.establishStackSpace=$.establishStackSpace,i.stackAlloc=$.stackAlloc),it=i.stackRestore=$.stackRestore,nt=i.stackSave=$.stackSave;
vendor: 4,771 bytes, line 2
2if(i.asm=$,i.cwrap=function(t,e,i,n){var r=(i=i||[]).every((function(t){return"number"===t}));return"string"!==e&&r&&!n?d(t):function(){return p(t,e,i,arguments)}},i.setValue=function(t,e,i,n){switch("*"===(i=i||"i8").charAt(i.length-1)&&(i="i32"),i){case"i1":case"i8":m[t>>0]=e;break;case"i16":v[t>>1]=e;break;case"i32":_[t>>2]=e;break;case"i64":U=[e>>>0,(z=e,+P(z)>=1?z>0?(0|O(+L(z/4294967296),4294967295))>>>0:~~+D((z-+(~~z>>>0))/4294967296)>>>0:0)],_[t>>2]=U[0],_[t+4>>2]=U[1];break;case"float":b[t>>2]=e;break;case"double":x[t>>3]=e;break;default:ct("invalid type for setValue: "+i)}},i.getValue=function(t,e,i){switch("*"===(e=e||"i8").charAt(e.length-1)&&(e="i32"),e){case"i1":case"i8":return m[t>>0];case"i16":return v[t>>1];case"i32":case"i64":return _[t>>2];case"float":return b[t>>2];case"double":return x[t>>3];default:ct("invalid type for getValue: "+e)}return null},i.getTempRet0=u,N){Z(N)||(K=N,N=i.locateFile?i.locateFile(K,s):s+K),F++,i.monitorRunDependencies&&i.monitorRunDependencies(F);var rt=function(t){t.byteLength&&(t=new Uint8Array(t)),y.set(t,8),i.memoryInitializerRequest&&delete i.memoryInitializerRequest.response,function(t){if(F--,i.monitorRunDependencies&&i.monitorRunDependencies(F),0==F&&(null!==R&&(clearInterval(R),R=null),k)){var e=k;k=null,e()}}()},ot=function(){r(N,rt,(function(){throw"could not load memory initializer "+N}))},st=q(N);if(st)rt(st.buffer);else if(i.memoryInitializerRequest){var at=function(){var t=i.memoryInitializerRequest,e=t.response;if(200!==t.status&&0!==t.status){var n=q(i.memoryInitializerRequestURL);if(!n)return console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+t.status+", retrying "+N),void ot();e=n.buffer}rt(e)};i.memoryInitializerRequest.response?setTimeout(at,0):i.memoryInitializerRequest.addEventListener("load",at)}else ot()}function lt(t){function e(){X||(X=!0,h||(E(T),E(M),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)t=i.postRun.shift(),I.unshift(t);var t;E(I)}()))}t=t||o,F>0||(!function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)t=i.preRun.shift(),S.unshift(t);var t;E(S)}(),F>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),e()}),1)):e()))}function ct(t){throw i.onAbort&&i.onAbort(t),a(t+=""),l(t),h=!0,"abort("+t+"). Build with -s ASSERTIONS=1 for more info."}if(k=function t(){X||lt(),X||(k=t)},i.run=lt,i.abort=ct,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return lt(),t}("object"===typeof je?je:{}),Ve="number",He={};[["sizeOfH3Index",Ve],["sizeOfGeoCoord",Ve],["sizeOfGeoBoundary",Ve],["sizeOfGeoPolygon",Ve],["sizeOfGeofence",Ve],["sizeOfLinkedGeoPolygon",Ve],["sizeOfCoordIJ",Ve],["h3IsValid",Ve,[Ve,Ve]],["geoToH3",Ve,[Ve,Ve,Ve]],["h3ToGeo",null,[Ve,Ve,Ve]],["h3ToGeoBoundary",null,[Ve,Ve,Ve]],["maxKringSize",Ve,[Ve]],["kRing",null,[Ve,Ve,Ve,Ve]],["kRingDistances",null,[Ve,Ve,Ve,Ve,Ve]],["hexRing",null,[Ve,Ve,Ve,Ve]],["maxPolyfillSize",Ve,[Ve,Ve]],["polyfill",null,[Ve,Ve,Ve]],["h3SetToLinkedGeo",null,[Ve,Ve,Ve]],["destroyLinkedPolygon",null,[Ve]],["compact",Ve,[Ve,Ve,Ve]],["uncompact",Ve,[Ve,Ve,Ve,Ve,Ve]],["maxUncompactSize",Ve,[Ve,Ve,Ve]],["h3IsPentagon",Ve,[Ve,Ve]],["h3IsResClassIII",Ve,[Ve,Ve]],["h3GetBaseCell",Ve,[Ve,Ve]],["h3GetResolution",Ve,[Ve,Ve]],["maxFaceCount",Ve,[Ve,Ve]],["h3GetFaces",null,[Ve,Ve,Ve]],["h3ToParent",Ve,[Ve,Ve,Ve]],["h3ToChildren",null,[Ve,Ve,Ve,Ve]],["h3ToCenterChild",Ve,[Ve,Ve,Ve]],["maxH3ToChildrenSize",Ve,[Ve,Ve,Ve]],["h3IndexesAreNeighbors",Ve,[Ve,Ve,Ve,Ve]],["getH3UnidirectionalEdge",Ve,[Ve,Ve,Ve,Ve]],["getOriginH3IndexFromUnidirectionalEdge",Ve,[Ve,Ve]],["getDestinationH3IndexFromUnidirectionalEdge",Ve,[Ve,Ve]],["h3UnidirectionalEdgeIsValid",Ve,[Ve,Ve]],["getH3IndexesFromUnidirectionalEdge",null,[Ve,Ve,Ve]],["getH3UnidirectionalEdgesFromHexagon",null,[Ve,Ve,Ve]],["getH3UnidirectionalEdgeBoundary",null,[Ve,Ve,Ve]],["h3Distance",Ve,[Ve,Ve,Ve,Ve]],["h3Line",Ve,[Ve,Ve,Ve,Ve,Ve]],["h3LineSize",Ve,[Ve,Ve,Ve,Ve]],["experimentalH3ToLocalIj",Ve,[Ve,Ve,Ve,Ve,Ve]],["experimentalLocalIjToH3",Ve,[Ve,Ve,Ve,Ve]],["hexAreaM2",Ve,[Ve]],["hexAreaKm2",Ve,[Ve]],["edgeLengthM",Ve,[Ve]],["edgeLengthKm",Ve,[Ve]],["pointDistM",Ve,[Ve,Ve]],["pointDistKm",Ve,[Ve,Ve]],["pointDistRads",Ve,[Ve,Ve]],["cellAreaM2",Ve,[Ve,Ve]],["cellAreaKm2",Ve,[Ve,Ve]],["cellAreaRads2",Ve,[Ve,Ve]],["exactEdgeLengthM",Ve,[Ve,Ve]],["exactEdgeLengthKm",Ve,[Ve,Ve]],["exactEdgeLengthRads",Ve,[Ve,Ve]],["numHexagons",Ve,[Ve]],["getRes0Indexes",null,[Ve]],["res0IndexCount",Ve],["getPentagonIndexes",null,[Ve,Ve]],["pentagonIndexCount",Ve]].forEac
2h((function(t){He[t[0]]=je.cwrap.apply(je,t)}));var Je=16,We=4,Qe=4,qe=8,Ke=He.sizeOfH3Index(),Xe=He.sizeOfGeoCoord(),Ye=He.sizeOfGeoBoundary(),$e=(He.sizeOfGeoPolygon(),He.sizeOfGeofence(),He.sizeOfLinkedGeoPolygon()),ti=(He.sizeOfCoordIJ(),"m"),ei="km";function ii(t){if("number"!==typeof t||t<0||t>15||Math.floor(t)!==t)throw new Error("Invalid resolution: "+t)}var ni=/[^0-9a-fA-F]/;function ri(t){if(Array.isArray(t)&&2===t.length&&Number.isInteger(t[0])&&Number.isInteger(t[1]))return t;if("string"!==typeof t||ni.test(t))return[0,0];var e=parseInt(t.substring(0,t.length-8),Je);return[parseInt(t.substring(t.length-8),Je),e]}function oi(t){if(t>=0)return t.toString(Je);var e=ai(8,(t&=2147483647).toString(Je));return e=(parseInt(e[0],Je)+8).toString(Je)+e.substring(1)}function si(t,e){return oi(e)+ai(8,oi(t))}function ai(t,e){for(var i=t-e.length,n="",r=0;r<i;r++)n+="0";return n+=e}function li(t){return[t,je.getTempRet0()]}function ci(t){var e=li(t),i=e[0],n=e[1];return n?si(i,n):null}function ui(t,e,i){je.HEAPU32.set(ri(t),e/We+2*i)}function hi(t,e){for(var i=e.length,n=0;n<i;n++)ui(e[n],t,n)}function di(t){return 180*je.getValue(t,"double")/Math.PI}function pi(t){return[di(t),di(t+qe)]}function Ai(t){return[di(t+qe),di(t)]}function fi(t,e,i){for(var n=je.getValue(t,"i32"),r=t+qe,o=[],s=e?Ai:pi,a=0;a<2*n;a+=2)o.push(s(r+qe*a));return i&&o.push(o[0]),o}function gi(t){var e=ri(t),i=e[0],n=e[1];return Boolean(He.h3IsPentagon(i,n))}function mi(t){var e=ri(t),i=e[0],n=e[1];return He.h3IsValid(i,n)?He.h3GetResolution(i,n):-1}function yi(t){var e=je._malloc(Xe),i=ri(t),n=i[0],r=i[1];He.h3ToGeo(n,r,e);var o=pi(e);return je._free(e),o}function vi(t,e){if(!t||!t.length)return[];var i=t.length,n=je._calloc(i,Ke);hi(n,t);var r=je._calloc($e),o=r;He.h3SetToLinkedGeo(n,i,r);var s=function(t,e){for(var i,n,r,o,s=[],a=e?Ai:pi;t;){for(s.push(i=[]),n=je.getValue(t,"i8*");n;){for(i.push(r=[]),o=je.getValue(n,"i8*");o;)r.push(a(o)),o=je.getValue(o+2*qe,"i8*");e&&r.push(r[0]),n=je.getValue(n+2*Qe,"i8*")}t=je.getValue(t+2*Qe,"i8*")}return s}(r,e);return He.destroyLinkedPolygon(o),je._free(o),je._free(n),s}function _i(t,e){switch(ii(t),e){case ti:return He.edgeLengthM(t);case ei:return He.edgeLengthKm(t);default:throw new Error("Unknown unit: "+e)}}function bi(t){return t*Math.PI/180}var xi=i(73115),wi=i(35387);function Ci(t,e){e=void 0===e?t[0][0]:e;for(const i of t){const t=i[0]-e;t>180?i[0]-=360:t<-180&&(i[0]+=360)}}function Bi(t,e,i){const n=t(e,i),[r,o]=yi(n);return[o,r]}function Ei(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=function(t,e){var i=je._malloc(Ye),n=ri(t),r=n[0],o=n[1];He.h3ToGeoBoundary(r,o,i);var s=fi(i,e,e);return je._free(i),s}(t,!0);return 1!==e?function(t,e,i){const[n,r]=yi(t),o=e.length;Ci(e,r);const s=e[0]===e[o-1]?o-1:o;for(let a=0;a<s;a++)e[a][0]=(0,Ut.t7)(r,e[a][0],i),e[a][1]=(0,Ut.t7)(n,e[a][1],i)}(t,i,e):Ci(i),i}const Si={...A.Z.defaultProps,highPrecision:"auto",coverage:{type:"number",min:0,max:1,value:1},centerHexagon:null,getHexagon:{type:"accessor",value:t=>t.hexagon},extruded:!0};class Ti extends p.Z{constructor(){super(...arguments),(0,u.Z)(this,"state",void 0)}initializeState(){Ti._checkH3Lib(),this.state={edgeLengthKM:0,resolution:-1}}shouldUpdateState(t){let{changeFlags:e}=t;return this._shouldUseHighPrecision()?e.propsOrDataChanged:e.somethingChanged}updateState(t){let{props:e,changeFlags:i}=t;if(!0!==e.highPrecision&&(i.dataChanged||i.updateTriggersChanged&&i.updateTriggersChanged.getHexagon)){const t=this._calculateH3DataProps();this.setState(t)}this._updateVertices(this.context.viewport)}_calculateH3DataProps(){let t=-1,e=!1,i=!1;const{iterable:n,objectInfo:r}=(0,xi.jB)(this.props.data);for(const o of n){r.index++;const n=this.props.getHexagon(o,r),s=mi(n);if(t<0){if(t=s,!this.props.highPrecision)break}else if(t!==s){i=!0;break}if(gi(n)){e=!0;break}}return{resolution:t,edgeLengthKM:t>=0?_i(t,"km"):0,hasMultipleRes:i,hasPentagon:e}}_shouldUseHighPrecision(){if("auto"===this.props.highPrecision){const{resolution:t,hasPentagon:e,hasMultipleRes:i}=this.state,{viewport:n}=this.context;return Boolean(null===n||void 0===n?void 0:n.resolution)||i||e||t>=0&&t<=5}return this.props.highPrecision}_updateVertices(t){if(this._shouldUseHighPrecision())return;const{resolution:e,edgeLengthKM:i,centerHex:n}=this.state;if(e<0)return;
2const r=this.props.centerHexagon||function(t,e,i){var n=je._malloc(Xe);je.HEAPF64.set([t,e].map(bi),n/qe);var r=ci(He.geoToH3(n,i));return je._free(n),r}(t.latitude,t.longitude,e);if(n===r)return;if(n){const t=function(t,e){var i=ri(t),n=i[0],r=i[1],o=ri(e),s=o[0],a=o[1];return He.h3Distance(n,r,s,a)}(n,r);if(t>=0&&t*i<10)return}const{unitsPerMeter:o}=t.distanceScales;let s=Ei(r);const[a,l]=yi(r),[c,u]=t.projectFlat([l,a]);s=s.map((e=>{const i=t.projectFlat(e);return[(i[0]-c)/o[0],(i[1]-u)/o[1]]})),this.setState({centerHex:r,vertices:s})}renderLayers(){return this._shouldUseHighPrecision()?this._renderPolygonLayer():this._renderColumnLayer()}_getForwardProps(){const{elevationScale:t,material:e,coverage:i,extruded:n,wireframe:r,stroked:o,filled:s,lineWidthUnits:a,lineWidthScale:l,lineWidthMinPixels:c,lineWidthMaxPixels:u,getFillColor:h,getElevation:d,getLineColor:p,getLineWidth:A,transitions:f,updateTriggers:g}=this.props;return{elevationScale:t,extruded:n,coverage:i,wireframe:r,stroked:o,filled:s,lineWidthUnits:a,lineWidthScale:l,lineWidthMinPixels:c,lineWidthMaxPixels:u,material:e,getElevation:d,getFillColor:h,getLineColor:p,getLineWidth:A,transitions:f,updateTriggers:{getFillColor:g.getFillColor,getElevation:g.getElevation,getLineColor:g.getLineColor,getLineWidth:g.getLineWidth}}}_renderPolygonLayer(){const{data:t,getHexagon:e,updateTriggers:i,coverage:n}=this.props,r=this.getSubLayerClass("hexagon-cell-hifi",A.Z),o=this._getForwardProps();return o.updateTriggers.getPolygon=function(t,e){let i;return i=void 0===t||null===t?e:"object"===typeof t?{...t,coverage:e}:{getHexagon:t,coverage:e},i}(i.getHexagon,n),new r(o,this.getSubLayerProps({id:"hexagon-cell-hifi",updateTriggers:o.updateTriggers}),{data:t,_normalize:!1,_windingOrder:"CCW",positionFormat:"XY",getPolygon:(t,i)=>function(t){const e=new Float64Array(2*t.length);let i=0;for(const n of t)e[i++]=n[0],e[i++]=n[1];return e}(Ei(e(t,i),n))})}_renderColumnLayer(){const{data:t,getHexagon:e,updateTriggers:i}=this.props,n=this.getSubLayerClass("hexagon-cell",wi.Z),r=this._getForwardProps();return r.updateTriggers.getPosition=i.getHexagon,new n(r,this.getSubLayerProps({id:"hexagon-cell",flatShading:!0,updateTriggers:r.updateTriggers}),{data:t,diskResolution:6,radius:1,vertices:this.state.vertices,getPosition:Bi.bind(null,e)})}}(0,u.Z)(Ti,"defaultProps",Si),(0,u.Z)(Ti,"layerName","H3HexagonLayer"),(0,u.Z)(Ti,"_checkH3Lib",(()=>{}));class Mi extends g{initializeState(){Ti._checkH3Lib()}updateState(t){let{props:e,changeFlags:i}=t;if(i.dataChanged||i.updateTriggersChanged&&i.updateTriggersChanged.getHexagons){const{data:t,getHexagons:i}=e,n=[],{iterable:r,objectInfo:o}=(0,xi.jB)(t);for(const e of r){o.index++;const t=vi(i(e,o),!0);for(const i of t)n.push(this.getSubLayerRow({polygon:i},e,o.index))}this.setState({polygons:n})}}indexToBounds(){return{data:this.state.polygons,getPolygon:t=>t.polygon}}}(0,u.Z)(Mi,"layerName","H3ClusterLayer"),(0,u.Z)(Mi,"defaultProps",{getHexagons:{type:"accessor",value:t=>t.hexagons}});var Ii=i(69296),Pi=i(11162),Di=i(57309),Li=i(92086),Oi=i(78032),Fi=i(94557),Ri=i(36800);class ki extends Ri.Z{getShaders(){const t=super.getShaders();return t.modules.push(Oi.b),{...t,vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nuniform bool pickFeatureIds;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec4 uvRegions;\nin vec3 featureIdsPickingColors;\n\n// Instance attributes\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvec2 applyUVRegion(vec2 uv) {\n  #ifdef HAS_UV_REGIONS\n    // https://github.com/Esri/i3s-spec/blob/master/docs/1.7/geometryUVRegion.cmn.md\n    return fract(uv) * (uvRegions.zw - uvRegions.xy) + uvRegions.xy;\n  #else\n    return uv;\n  #endif\n}\n\nvoid main(void) {\n  vec2 uv = applyUVRegion(texCoords);\n  geometry.uv = uv;\n\n  if (pickFeatureIds) {\n    geometry.pickingColor = featureIdsPickingColors;\n  } else {\n    geometry.pickingColor = instancePickingColors;\n  }\n\n  vTexCoord = uv;\n  cameraPosition = project_uCameraPosition;\n  vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n  vec3 pos = (instanceModelMatrix * positions) * sizeScale;\n  vec3 projectedPosition = project_position(positions);
2\n  position_commonspace = vec4(projectedPosition, 1.0);\n  gl_Position = project_common_position_to_clipspace(position_commonspace);\n\n  geometry.position = position_commonspace;\n  normals_commonspace = project_normal(instanceModelMatrix * normals);\n  geometry.normal = normals_commonspace;\n\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  #ifdef MODULE_PBR\n    // set PBR data\n    pbr_vPosition = geometry.position.xyz;\n    #ifdef HAS_NORMALS\n      pbr_vNormal = geometry.normal;\n    #endif\n\n    #ifdef HAS_UV\n      pbr_vUV = uv;\n    #else\n      pbr_vUV = vec2(0., 0.);\n    #endif\n    geometry.uv = pbr_vUV;\n  #endif\n\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  \n#ifdef MODULE_PBR\n\n  fragColor = vColor * pbr_filterColor(vec4(0));\n  geometry.uv = pbr_vUV;\n  fragColor.a *= opacity;\n\n#else\n\n  geometry.uv = vTexCoord;\n\n  vec3 normal;\n  if (flatShading) {\n\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\n#ifdef DERIVATIVES_AVAILABLE\n    normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n    normal = vec3(0.0, 0.0, 1.0);\n#endif\n  } else {\n    normal = normals_commonspace;\n  }\n\n  vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n  vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n  fragColor = vec4(lightColor, color.a * opacity);\n\n#endif\n\n  DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n"}}initializeState(){const{featureIds:t}=this.props;super.initializeState();const e=this.getAttributeManager();t&&e.add({featureIdsPickingColors:{type:5121,size:3,noAlloc:!0,update:this.calculateFeatureIdsPickingColors}})}updateState(t){super.updateState(t);const{props:e,oldProps:i}=t;e.pbrMaterial!==i.pbrMaterial&&this.updatePbrMaterialUniforms(e.pbrMaterial)}draw(t){const{featureIds:e}=this.props;this.state.model&&(this.state.model.setUniforms({u_Camera:this.state.model.getUniforms().project_uCameraPosition,pickFeatureIds:Boolean(e)}),super.draw(t))}getModel(t){const{id:e,pbrMaterial:i}=this.props,n=this.parseMaterial(i,t);this.setState({materialParser:n});const r=this.getShaders();var o;(o=t.attributes).COLOR_0||o.colors||(o.colors={constant:!0,value:new Float32Array([1,1,1])});return new Fi.Z(this.context.gl,{...this.getShaders(),id:e,geometry:t,defines:{...r.defines,...null===n||void 0===n?void 0:n.defines,HAS_UV_REGIONS:t.attributes.uvRegions},parameters:null===n||void 0===n?void 0:n.parameters,isInstanced:!0})}updatePbrMaterialUniforms(t){const{model:e}=this.state;if(e){const{mesh:i}=this.props,n=this.parseMaterial(t,i);this.setState({materialParser:n}),e.setUniforms(n.uniforms)}}parseMaterial(t,e){var i;const n=Boolean(t.pbrMetallicRoughness&&t.pbrMetallicRoughness.baseColorTexture);return null===(i=this.state.materialParser)||void 0===i||i.delete(),new Li.Z(this.context.gl,{attributes:{NORMAL:e.attributes.normals,TEXCOORD_0:e.attributes.texCoords},material:{unlit:n,...t},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1})}calculateFeatureIdsPickingColors(t){const e=this.props.featureIds,i=new Uint8ClampedArray(e.length*t.size),n=[];for(let r=0;r<e.length;r++)this.encodePickingColor(e[r],n),i[3*r]=n[0],i[3*r+1]=n[1],i[3*r+2]=n[2];t.value=i}finalizeState(t){var e;super.finalizeState(t),null===(e=this.state.materialParser)||void 0===e||e.delete(),this.setState({materialParser:null})}}(0,u.Z)(ki,"layerName","MeshLayer"),(0,u.Z)(ki,"defaultProps",{pbrMaterial:{type:"object",value:null},featureIds:{type:"array",value:null,optional:!0}});var zi=i(65959);const Ui=6378137,Ni=6378137,Gi=6356752.314245179;Math.max(Ui,Ni,Gi);function Zi(t){return t}new it.Z;function ji(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zi;return"longitude"in t?(e[0]=i(t.longitude),e[1]=i(t.latitude),e[2]=t.height):"x"in t?(e[0]=i(t.x),e[1]=i(t.y),e[2]=t.z):(e[0]=i(t[0]),e[1]=i(t[1]),e[2]=t[2]),e}function Vi(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Zi;return"longitude"in e?(e.longitude=i(t[0]),e.latitude=i(t[1]),e.height=t[2]):"x"in e?(e.x=i(t[0]),e.y=i(t[1]),e.z=t[2]):(e[0]=i(t[0]),e[1]=i(t[1]),e[2]=t[2]),e}const Hi=new it.Z,Ji=new it.Z,Wi=new it.Z;const Qi=new it.Z,qi={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Ki={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Xi={east:new it.Z,north:new it.Z,up:new it.Z,west:new it.Z,south:new it.Z,down:new it.Z},Yi=new it.Z,$i=new it.Z,tn=new it.Z;function en(t,e,i,n,r,o){const s=qi[e]&&qi[e][i];let a,l,c;(0,zt.Z)(s&&(!n||n===s));const u=Qi.copy(r);if((0,Ut.fS)(u.x,0,1e-14)&&(0,Ut.fS)(u.y,0,1e-14)){const t=Math.sign(u.z);a=Yi.fromArray(Ki[e]),"east"!==e&&"west"!==e&&a.scale(t),l=$i.fromArray(Ki[i]),"east"!==i&&"west"!==i&&l.scale(t),c=tn.fromArray(Ki[n]),"east"!==n&&"west"!==n&&c.scale(t)}else{const{up:r,east:o,north:s}=Xi;o.set(-u.y,u.x,0).normalize(),t.geodeticSurfaceNormal(u,r),s.copy(r).cross(o);const{down:h,west:d,south:p}=Xi;h.copy(r).scale(-1),d.copy(o).scale(-1),p.copy(s).scale(-1),a=Xi[e],l=Xi[i],c=Xi[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=l.x,o[5]=l.y,o[6]=l.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=u.x,o[13]=u.y,o[14]=u.z,o[15]=1,o}const nn=new it.Z,rn=new it.Z,on=new it.Z,sn=new it.Z,an=new it.Z,ln=new it.Z;class cn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;(0,u.Z)(this,"radii",void 0),(0,u.Z)(this,"radiiSquared",void 0),(0,u.Z)(this,"radiiToTheFourth",void 0),(0,u.Z)(this,"oneOverRadii",void 0),(0,u.Z)(this,"oneOverRadiiSquared",void 0),(0,u.Z)(this,"minimumRadius",void 0),(0,u.Z)(this,"maximumRadius",void 0),(0,u.Z)(this,"centerToleranceSquared",Wt.EPSILON1),(0,u.Z)(this,"squaredXOverSquaredZ",void 0),(0,zt.Z)(t>=0),(0,zt.Z)(e>=0),(0,zt.Z)(i>
vendor: 4,674 bytes, line 2
2=0),this.radii=new it.Z(t,e,i),this.radiiSquared=new it.Z(t*t,e*e,i*i),this.radiiToTheFourth=new it.Z(t*t*t*t,e*e*e*e,i*i*i*i),this.oneOverRadii=new it.Z(0===t?0:1/t,0===e?0:1/e,0===i?0:1/i),this.oneOverRadiiSquared=new it.Z(0===t?0:1/(t*t),0===e?0:1/(e*e),0===i?0:1/(i*i)),this.minimumRadius=Math.min(t,e,i),this.maximumRadius=Math.max(t,e,i),0!==this.radiiSquared.z&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const i=rn,n=on,[,,r]=t;this.geodeticSurfaceNormalCartographic(t,i),n.copy(this.radiiSquared).scale(i);const o=Math.sqrt(i.dot(n));return n.scale(1/o),i.scale(r),n.add(i),n.to(e)}cartesianToCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];ln.from(t);const i=this.scaleToGeodeticSurface(ln,sn);if(!i)return;const n=this.geodeticSurfaceNormal(i,rn),r=an;r.copy(ln).subtract(i);return function(t,e){return Vi(t,e,Ut.vc._cartographicRadians?Zi:Ut.Ux)}([Math.atan2(n.y,n.x),Math.asin(n.z),Math.sign(j.AK(r,ln))*j.kE(r)],e)}eastNorthUpToFixedFrame(t){return en(this,"east","north","up",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:new N.Z)}localFrameToFixedFrame(t,e,i,n){return en(this,t,e,i,n,arguments.length>4&&void 0!==arguments[4]?arguments[4]:new N.Z)}geocentricSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return nn.from(t).normalize().to(e)}geodeticSurfaceNormalCartographic(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const i=function(t){return ji(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],Ut.vc._cartographicRadians?Zi:Ut.Yr)}(t),n=i[0],r=i[1],o=Math.cos(r);return nn.set(o*Math.cos(n),o*Math.sin(n),Math.sin(r)).normalize(),nn.to(e)}geodeticSurfaceNormal(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return nn.from(t).scale(this.oneOverRadiiSquared).normalize().to(e)}scaleToGeodeticSurface(t,e){return function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{oneOverRadii:n,oneOverRadiiSquared:r,centerToleranceSquared:o}=e;Hi.from(t);const s=Hi.x,a=Hi.y,l=Hi.z,c=n.x,u=n.y,h=n.z,d=s*s*c*c,p=a*a*u*u,A=l*l*h*h,f=d+p+A,g=Math.sqrt(1/f);if(!Number.isFinite(g))return;const m=Ji;if(m.copy(t).scale(g),f<o)return m.to(i);const y=r.x,v=r.y,_=r.z,b=Wi;b.set(m.x*y*2,m.y*v*2,m.z*_*2);let x,w,C,B,E=(1-g)*Hi.len()/(.5*b.len()),S=0;do{E-=S,x=1/(1+E*y),w=1/(1+E*v),C=1/(1+E*_);const t=x*x,e=w*w,i=C*C;B=d*t+p*e+A*i-1,S=B/(-2*(d*(t*x)*y+p*(e*w)*v+A*(i*C)*_))}while(Math.abs(B)>Wt.EPSILON12);return Hi.scale([x,w,C]).to(i)}(t,this,e)}scaleToGeocentricSurface(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];sn.from(t);const i=sn.x,n=sn.y,r=sn.z,o=this.oneOverRadiiSquared,s=1/Math.sqrt(i*i*o.x+n*n*o.y+r*r*o.z);return sn.multiplyScalar(s).to(e)}transformPositionToScaledSpace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return sn.from(t).scale(this.oneOverRadii).to(e)}transformPositionFromScaledSpace(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];return sn.from(t).scale(this.radii).to(e)}getSurfaceNormalIntersectionWithZAxis(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[0,0,0];(0,zt.Z)((0,Ut.fS)(this.radii.x,this.radii.y,Wt.EPSILON15)),(0,zt.Z)(this.radii.z>0),sn.from(t);const n=sn.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(n)>=this.radii.z-e))return sn.set(0,0,n).to(i)}}function un(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function hn(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(0,e):""}(0,u.Z)(cn,"WGS84",new cn(Ui,Ni,Gi));const dn={id:"request-scheduler",throttleRequests:!0,maxRequests:6};class pn{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,u.Z)(this,"props",void 0),(0,u.Z)(this,"stats",void 0),(0,u.Z)(this,"activeRequestCount",0),(0,u.Z)(this,"requestQueue",[]),(0,u.Z)(this,"requestMap",new Map),(0,u.Z)(this,"deferredUpdate",null),this.props={...dn,...t},this.stats=new Me.Z({id:this.props.id}),this.stats.get("Queued Requests"),this.stats.get("Active Requests"),this.stats.get("Cancelled Requests"),this.stats.get("Queued Requests Ever"),this.stats.get("Active Requests Ever")}scheduleRequest(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>0;if(!this.props.throttleRequests)return Promise.resolve({done:()=>{}});if(this.requestMap.has(t))return this.requestMap.get(t);
2const i={handle:t,priority:0,getPriority:e},n=new Promise((t=>(i.resolve=t,i)));return this.requestQueue.push(i),this.requestMap.set(t,n),this._issueNewRequests(),n}_issueRequest(t){const{handle:e,resolve:i}=t;let n=!1;const r=()=>{n||(n=!0,this.requestMap.delete(e),this.activeRequestCount--,this._issueNewRequests())};return this.activeRequestCount++,i?i({done:r}):Promise.resolve({done:r})}_issueNewRequests(){this.deferredUpdate||(this.deferredUpdate=setTimeout((()=>this._issueNewRequestsAsync()),0))}_issueNewRequestsAsync(){this.deferredUpdate=null;const t=Math.max(this.props.maxRequests-this.activeRequestCount,0);if(0!==t){this._updateAllRequests();for(let e=0;e<t;++e){const t=this.requestQueue.shift();t&&this._issueRequest(t)}}}_updateAllRequests(){const t=this.requestQueue;for(let e=0;e<t.length;++e){const i=t[e];this._updateRequest(i)||(t.splice(e,1),this.requestMap.delete(i.handle),e--)}t.sort(((t,e)=>t.priority-e.priority))}_updateRequest(t){return t.priority=t.getPriority(t.handle),!(t.priority<0)||(t.resolve(null),!1)}}class An{constructor(t,e,i){(0,u.Z)(this,"item",void 0),(0,u.Z)(this,"previous",void 0),(0,u.Z)(this,"next",void 0),this.item=t,this.previous=e,this.next=i}}class fn{constructor(){(0,u.Z)(this,"head",null),(0,u.Z)(this,"tail",null),(0,u.Z)(this,"_length",0)}get length(){return this._length}add(t){const e=new An(t,this.tail,null);return this.tail?(this.tail.next=e,this.tail=e):(this.head=e,this.tail=e),++this._length,e}remove(t){t&&(t.previous&&t.next?(t.previous.next=t.next,t.next.previous=t.previous):t.previous?(t.previous.next=null,this.tail=t.previous):t.next?(t.next.previous=null,this.head=t.next):(this.head=null,this.tail=null),t.next=null,t.previous=null,--this._length)}splice(t,e){t!==e&&(this.remove(e),this._insert(t,e))}_insert(t,e){const i=t.next;t.next=e,this.tail===t?this.tail=e:i.previous=e,e.next=i,e.previous=t,++this._length}}function gn(t){return void 0!==t&&null!==t}class mn{constructor(){(0,u.Z)(this,"_list",void 0),(0,u.Z)(this,"_sentinel",void 0),(0,u.Z)(this,"_trimTiles",void 0),this._list=new fn,this._sentinel=this._list.add("sentinel"),this._trimTiles=!1}reset(){this._list.splice(this._list.tail,this._sentinel)}touch(t){const e=t._cacheNode;gn(e)&&this._list.splice(this._sentinel,e)}add(t,e,i){gn(e._cacheNode)||(e._cacheNode=this._list.add(e),i&&i(t,e))}unloadTile(t,e,i){const n=e._cacheNode;gn(n)&&(this._list.remove(n),e._cacheNode=void 0,i&&i(t,e))}unloadTiles(t,e){const i=this._trimTiles;this._trimTiles=!1;const n=this._list,r=1024*t.maximumMemoryUsage*1024,o=this._sentinel;let s=n.head;for(;s!==o&&(t.gpuMemoryUsageInBytes>r||i);){const i=s.item;s=s.next,this.unloadTile(t,i,e)}}trim(){this._trimTiles=!0}}const yn=new it.Z,vn=new it.Z,_n=new Jt([new Zt,new Zt,new Zt,new Zt,new Zt,new Zt]);function bn(t,e){const{cameraDirection:i,cameraUp:n,height:r}=t,{metersPerUnit:o}=t.distanceScales,s=wn(t,t.center),a=cn.WGS84.eastNorthUpToFixedFrame(s),l=t.unprojectPosition(t.cameraPosition),c=cn.WGS84.cartographicToCartesian(l,new it.Z),u=new it.Z(a.transformAsVector(new it.Z(i).scale(o))).normalize(),h=new it.Z(a.transformAsVector(new it.Z(n).scale(o))).normalize();!function(t){const e=t.getFrustumPlanes(),i=xn(e.near,t.cameraPosition),n=wn(t,i),r=wn(t,t.cameraPosition,vn);let o=0;_n.planes[o++].fromPointNormal(n,yn.copy(n).subtract(r));for(const s in e){if("near"===s)continue;const r=wn(t,xn(e[s],i,vn),vn);_n.planes[o++].fromPointNormal(r,yn.copy(n).subtract(r))}}(t);const d=t.constructor,{longitude:p,latitude:A,width:f,bearing:g,zoom:m}=t;return{camera:{position:c,direction:u,up:h},viewport:t,topDownViewport:new d({longitude:p,latitude:A,height:r,width:f,bearing:g,zoom:m,pitch:0}),height:r,cullingVolume:_n,frameNumber:e,sseDenominator:1.15}}function xn(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new it.Z;const n=t.normal.dot(e);return i.copy(t.normal).scale(t.distance-n).add(e),i}function wn(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new it.Z;const n=t.unprojectPosition(e);return cn.WGS84.cartographicToCartesian(n,i)}const Cn=6356752.314245179,Bn=new it.Z;function En(t,e){if(t instanceof kt){const{halfAxes:i}=t,n=function(t){t.getColumn(0,Bn);const e=t.getColumn(1),i=t.getColumn(2),n=Bn.add(e).add(i);return n.len()}(i);return Math.log2(Cn/(n+e[2]))}if(t instanceof ct){const{radius:i}=t;return Math.log2(Cn/(i+e[2]))}if(t.width&&t.height){const{width:e,height:i}=t;return(Math.log2(6378137/e)+Math.log2(6378137/i))/2}return 1}
2function Sn(t,e,i){const n=cn.WGS84.cartographicToCartesian([t.xmax,t.ymax,t.zmax],new it.Z),r=Math.sqrt(Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2)+Math.pow(n[2]-i[2],2));return Math.log2(Cn/(r+e[2]))}const Tn=0,Mn=1,In=3,Pn=4,Dn=5,Ln={ADD:1,REPLACE:2},On={EMPTY:"empty",SCENEGRAPH:"scenegraph",POINTCLOUD:"pointcloud",MESH:"mesh"},Fn={I3S:"I3S",TILES3D:"TILES3D"},Rn={GEOMETRIC_ERROR:"geometricError",MAX_SCREEN_THRESHOLD:"maxScreenThreshold"},kn=1;function zn(t){return void 0!==t&&null!==t}const Un=new it.Z,Nn=new it.Z,Gn=new it.Z;function Zn(t,e,i){if(un(t,"3D Tile: boundingVolume must be defined"),t.box)return function(t,e,i){const n=new it.Z(t[0],t[1],t[2]);e.transform(n,n);let r=[];if(10===t.length){const e=t.slice(3,6),i=new _t.Z;i.fromArray(t,6);const n=new it.Z([1,0,0]),o=new it.Z([0,1,0]),s=new it.Z([0,0,1]);n.transformByQuaternion(i),n.scale(e[0]),o.transformByQuaternion(i),o.scale(e[1]),s.transformByQuaternion(i),s.scale(e[2]),r=[...n.toArray(),...o.toArray(),...s.toArray()]}else r=[...t.slice(3,6),...t.slice(6,9),...t.slice(9,12)];const o=e.transformAsVector(r.slice(0,3)),s=e.transformAsVector(r.slice(3,6)),a=e.transformAsVector(r.slice(6,9)),l=new mt([o[0],o[1],o[2],s[0],s[1],s[2],a[0],a[1],a[2]]);if(zn(i))return i.center=n,i.halfAxes=l,i;return new kt(n,l)}(t.box,e,i);
2if(t.region){const[e,i,n,r,o,s]=t.region,a=cn.WGS84.cartographicToCartesian([(0,Ut.RW)(e),(0,Ut.RW)(r),o],Nn),l=cn.WGS84.cartographicToCartesian([(0,Ut.RW)(n),(0,Ut.RW)(i),s],Gn),c=(new it.Z).addVectors(a,l).multiplyScalar(.5),u=(new it.Z).subVectors(a,l).len()/2;return jn([c[0],c[1],c[2],u],new N.Z)}if(t.sphere)return jn(t.sphere,e,i);throw new Error("3D Tile: boundingVolume must contain a sphere, region, or box")}function jn(t,e,i){const n=new it.Z(t[0],t[1],t[2]);e.transform(n,n);const r=e.getScale(Un),o=Math.max(Math.max(r[0],r[1]),r[2]),s=t[3]*o;return zn(i)?(i.center=n,i.radius=s,i):new ct(n,s)}new it.Z,new it.Z,new N.Z,new it.Z,new it.Z,new it.Z;function Vn(t,e){if(t.dynamicScreenSpaceError&&t.dynamicScreenSpaceErrorComputedDensity){const i=t.dynamicScreenSpaceErrorComputedDensity,n=t.dynamicScreenSpaceErrorFactor,r=function(t,e){const i=t*e;return 1-Math.exp(-i*i)}(e,i)*n;return r}return 0}const Hn=new it.Z,Jn=new it.Z,Wn=new it.Z,Qn=new it.Z,qn=new it.Z,Kn=new N.Z,Xn=new N.Z;function Yn(t,e){const{topDownViewport:i}=e,n=t.header.mbs[1],r=t.header.mbs[0],o=t.header.mbs[2],s=t.header.mbs[3],a=[...t.boundingVolume.center],l=i.unprojectPosition(i.cameraPosition);cn.WGS84.cartographicToCartesian(l,Hn),Jn.copy(Hn).subtract(a).normalize(),cn.WGS84.eastNorthUpToFixedFrame(a,Kn),Xn.copy(Kn).invert(),Wn.copy(Hn).transform(Xn);const c=Math.sqrt(Wn[0]*Wn[0]+Wn[1]*Wn[1]),u=c*c/Wn[2];Qn.copy([Wn[0],Wn[1],u]);const h=Qn.transform(Kn).subtract(a).normalize(),d=Jn.cross(h).normalize().scale(s).add(a),p=cn.WGS84.cartesianToCartographic(d),A=i.project([r,n,o]),f=i.project(p);return qn.copy(A).subtract(f).magnitude()}class $n{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,u.Z)(this,"_map",new Map),(0,u.Z)(this,"_array",void 0),(0,u.Z)(this,"_length",void 0),this._array=new Array(t),this._length=t}get length(){return this._length}set length(t){this._length=t,t>this._array.length&&(this._array.length=t)}get values(){return this._array}get(t){return un(t<this._array.length),this._array[t]}set(t,e){un(t>=0),t>=this.length&&(this.length=t+1),this._map.has(this._array[t])&&this._map.delete(this._array[t]),this._array[t]=e,this._map.set(e,t)}delete(t){const e=this._map.get(t);e>=0&&(this._array.splice(e,1),this._map.delete(t),this.length--)}peek(){return this._array[this._length-1]}push(t){if(!this._map.has(t)){const e=this.length++;this._array[e]=t,this._map.set(t,e)}}pop(){const t=this._array[--this.length];return this._map.delete(t),t}reserve(t){un(t>=0),t>this._array.length&&(this._array.length=t)}resize(t){un(t>=0),this.length=t}trim(t){null!==t&&void 0!==t||(t=this.length),this._array.length=t}reset(){this._array=[],this._map=new Map,this._length=0}find(t){return this._map.has(t)}}const tr={loadSiblings:!1,skipLevelOfDetail:!1,maximumScreenSpaceError:2,updateTransforms:!0,onTraversalEnd:()=>{},viewportTraversersMap:{},basePath:""};class er{traversalFinished(t){return!0}constructor(t){(0,u.Z)(this,"options",void 0),(0,u.Z)(this,"root",void 0),(0,u.Z)(this,"requestedTiles",void 0),(0,u.Z)(this,"selectedTiles",void 0),(0,u.Z)(this,"emptyTiles",void 0),(0,u.Z)(this,"lastUpdate",(new Date).getTime()),(0,u.Z)(this,"updateDebounceTime",1e3),(0,u.Z)(this,"_traversalStack",void 0),(0,u.Z)(this,"_emptyTraversalStack",void 0),(0,u.Z)(this,"_frameNumber",void 0),this.options={...tr,...t},this._traversalStack=new $n,this._emptyTraversalStack=new $n,this._frameNumber=null,this.root=null,this.selectedTiles={},this.requestedTiles={},this.emptyTiles={}}traverse(t,e,i){this.root=t,this.options={...this.options,...i},this.reset(),this.updateTile(t,e),this._frameNumber=e.frameNumber,this.executeTraversal(t,e)}reset(){this.requestedTiles={},this.selectedTiles={},this.emptyTiles={},this._traversalStack.reset(),this._emptyTraversalStack.reset()}executeTraversal(t,e){const i=this._traversalStack;for(t._selectionDepth=1,i.push(t);i.length>0;){const t=i.pop();let n=!1;this.canTraverse(t,e)&&(this.updateChildTiles(t,e),n=this.updateAndPushChildren(t,e,i,t.hasRenderContent?t._selectionDepth+1:t._selectionDepth));const r=t.parent,o=Boolean(!r||r._shouldRefine),s=!n;t.hasRenderContent?t.refine===Ln.ADD?(this.loadTile(t,e),this.selectTile(t,e)):t.refine===Ln.REPLACE&&(this.loadTile(t,e),s&&this.selectTile(t,e)):(this.emptyTiles[t.id]=t,this.loadTile(t,e),s&&this.selectTile(t,e)),this.touchTile(t,e),t._shouldRefine=n&&o}const n=(new Date).getTime();(this.traversalFinished(e)||n-this.lastUpdate>this.updateDebounceTime)&&(this.lastUpdate=n,this.options.onTraversalEnd(e))}updateChildTiles(t,e){const i=t.children;for(const n of i)this.updateTile(n,e);return!0}updateAndPushChildren(t,e,i,n){const{loadSiblings:r,skipLevelOfDetail:o}=this.options,s=t.children;s.sort(this.compareDistanceToCamera.bind(this));const a=t.refine===Ln.REPLACE&&t.hasRenderContent&&!o;let l=!1,c=!0;for(const u of s)if(u._selectionDepth=n,u.isVisibleAndInRequestVolume?(i.find(u)&&i.delete(u),i.push(u),l=!0):(a||r)&&(this.loadTile(u,e),this.touchTile(u,e)),a){let t;if(t=!!u._inRequestVolume&&(u.hasRenderContent?u.contentAvailable:this.executeEmptyTraversal(u,e)),c=c&&t,!c)return!1}return l||(c=!1),c}updateTile(t,e){this.updateTileVisibility(t,e)}selectTile(t,e){this.shouldSelectTile(t)&&(t._selectedFrame=e.frameNumber,this.selectedTiles[t.id]=t)}loadTile(t,e){this.shouldLoadTile(t)&&(t._requestedFrame=e.frameNumber,t._priority=t._getPri
2ority(),this.requestedTiles[t.id]=t)}touchTile(t,e){t.tileset._cache.touch(t),t._touchedFrame=e.frameNumber}canTraverse(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!t.hasChildren&&(t.hasTilesetContent?!t.contentExpired:!(!n&&!t.isVisibleAndInRequestVolume)&&this.shouldRefine(t,e,i))}shouldLoadTile(t){return t.hasUnloadedContent||t.contentExpired}shouldSelectTile(t){return t.contentAvailable&&!this.options.skipLevelOfDetail}shouldRefine(t,e,i){let n=t._screenSpaceError;return i&&(n=t.getScreenSpaceError(e,!0)),n>this.options.maximumScreenSpaceError}updateTileVisibility(t,e){const i=[];if(this.options.viewportTraversersMap)for(const n in this.options.viewportTraversersMap){this.options.viewportTraversersMap[n]===e.viewport.id&&i.push(n)}else i.push(e.viewport.id);t.updateVisibility(e,i)}compareDistanceToCamera(t,e){return t._distanceToCamera-e._distanceToCamera}anyChildrenVisible(t,e){let i=!1;for(const n of t.children)n.updateVisibility(e),i=i||n.isVisibleAndInRequestVolume;return i}executeEmptyTraversal(t,e){let i=!0;const n=this._emptyTraversalStack;for(n.push(t);n.length>0&&i;){const t=n.pop();this.updateTile(t,e),t.isVisibleAndInRequestVolume||this.loadTile(t,e),this.touchTile(t,e);if(!t.hasRenderContent&&this.canTraverse(t,e,!1,!0)){const e=t.children;for(const t of e)n.find(t)&&n.delete(t),n.push(t)}else t.contentAvailable||(i=!1)}return i}}const ir=new it.Z;class nr{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";(0,u.Z)(this,"tileset",void 0),(0,u.Z)(this,"header",void 0),(0,u.Z)(this,"id",void 0),(0,u.Z)(this,"url",void 0),(0,u.Z)(this,"parent",void 0),(0,u.Z)(this,"refine",void 0),(0,u.Z)(this,"type",void 0),(0,u.Z)(this,"contentUrl",void 0),(0,u.Z)(this,"lodMetricType",void 0),(0,u.Z)(this,"lodMetricValue",void 0),(0,u.Z)(this,"boundingVolume",void 0),(0,u.Z)(this,"content",void 0),(0,u.Z)(this,"contentState",void 0),(0,u.Z)(this,"gpuMemoryUsageInBytes",void 0),(0,u.Z)(this,"children",void 0),(0,u.Z)(this,"depth",void 0),(0,u.Z)(this,"viewportIds",void 0),(0,u.Z)(this,"transform",void 0),(0,u.Z)(this,"extensions",void 0),(0,u.Z)(this,"userData",void 0),(0,u.Z)(this,"computedTransform",void 0),(0,u.Z)(this,"hasEmptyContent",void 0),(0,u.Z)(this,"hasTilesetContent",void 0),(0,u.Z)(this,"traverser",void 0),(0,u.Z)(this,"_cacheNode",void 0),(0,u.Z)(this,"_frameNumber",void 0),(0,u.Z)(this,"_lodJudge",void 0),(0,u.Z)(this,"_expireDate",void 0),(0,u.Z)(this,"_expiredContent",void 0),(0,u.Z)(this,"_shouldRefine",void 0),(0,u.Z)(this,"_distanceToCamera",void 0),(0,u.Z)(this,"_centerZDepth",void 0),(0,u.Z)(this,"_screenSpaceError",void 0),(0,u.Z)(this,"_visibilityPlaneMask",void 0),(0,u.Z)(this,"_visible",void 0),(0,u.Z)(this,"_inRequestVolume",void 0),(0,u.Z)(this,"_stackLength",void 0),(0,u.Z)(this,"_selectionDepth",void 0),(0,u.Z)(this,"_touchedFrame",void 0),(0,u.Z)(this,"_visitedFrame",void 0),(0,u.Z)(this,"_selectedFrame",void 0),(0,u.Z)(this,"_requestedFrame",void 0),(0,u.Z)(this,"_priority",void 0),(0,u.Z)(this,"_contentBoundingVolume",void 0),(0,u.Z)(this,"_viewerRequestVolume",void 0),(0,u.Z)(this,"_initialTransform",void 0),this.header=e,this.tileset=t,this.id=n||e.id,this.url=e.url,this.parent=i,this.refine=this._getRefine(e.refine),this.type=e.type,this.contentUrl=e.contentUrl,this.lodMetricType="geometricError",this.lodMetricValue=0,this.boundingVolume=null,this.content=null,this.contentState=Tn,this.gpuMemoryUsageInBytes=0,this.children=[],this.hasEmptyContent=!1,this.hasTilesetContent=!1,this.depth=0,this.viewportIds=[],this.userData={},this.extensions=null,this._priority=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._screenSpaceError=0,this._cacheNode=null,this._frameNumber=null,this._cacheNode=null,this.traverser=new er({}),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._initialTransform=new N.Z,this.transform=new N.Z,this._initializeLodMetric(e),this._initializeTransforms(e),this._initializeBoundingVolumes(e),this._initializeContent(e),this._initializeRenderingState(e),this._lodJudge=null,this._expireDate=null,this._expiredContent=null,Object.seal(this)}destroy(){this.header=null}isDestroyed(){return null===this.header}get selected(){return this._selectedFrame===this.tileset._frameNumber}get isVisible(){return this._visible}get isVisibleAndInRequestVolume(){return this._visible&&this._inRequestVolume}get hasRenderContent(){return!this.hasEmptyContent&&!this.hasTilesetContent}get hasChildren(){return this.children.length>0||this.header.children&&this.header.children.length>0}get contentReady(){return this.contentState===In||this.hasEmptyContent}
vendor: 7,716 bytes, line 2
2get contentAvailable(){return Boolean(this.contentReady&&this.hasRenderContent||this._expiredContent&&!this.contentFailed)}get hasUnloadedContent(){return this.hasRenderContent&&this.contentUnloaded}get contentUnloaded(){return this.contentState===Tn}get contentExpired(){return this.contentState===Pn}get contentFailed(){return this.contentState===Dn}getScreenSpaceError(t,e){switch(this.tileset.type){case Fn.I3S:return Yn(this,t);case Fn.TILES3D:return function(t,e,i){const n=t.tileset,r=t.parent&&t.parent.lodMetricValue||t.lodMetricValue,o=i?r:t.lodMetricValue;if(0===o)return 0;const s=Math.max(t._distanceToCamera,1e-7),{height:a,sseDenominator:l}=e,{viewDistanceScale:c}=n.options;let u=o*a*(c||1)/(s*l);return u-=Vn(n,s),u}(this,t,e);default:throw new Error("Unsupported tileset type")}}unselect(){this._selectedFrame=0}_getPriority(){const t=this.tileset._traverser,{skipLevelOfDetail:e}=t.options,i=this.refine===Ln.ADD||e;if(i&&!this.isVisible&&void 0!==this._visible)return-1;if(this.tileset._frameNumber-this._touchedFrame>=1)return-1;if(this.contentState===Tn)return-1;const n=this.parent,r=n&&(!i||0===this._screenSpaceError||n.hasTilesetContent)?n._screenSpaceError:this._screenSpaceError,o=t.root?t.root._screenSpaceError:0;return Math.max(o-r,0)}async loadContent(){if(this.hasEmptyContent)return!1;if(this.content)return!0;this.contentExpired&&(this._expireDate=null),this.contentState=Mn;const t=await this.tileset._requestScheduler.scheduleRequest(this.id,this._getPriority.bind(this));if(!t)return this.contentState=Tn,!1;try{const t=this.tileset.getTileUrl(this.contentUrl),e=this.tileset.loader,i={...this.tileset.loadOptions,[e.id]:{...this.tileset.loadOptions[e.id],isTileset:"json"===this.type,...this._getLoaderSpecificOptions(e.id)}};return this.content=await(0,zi.z)(t,e,i),this.tileset.options.contentLoader&&await this.tileset.options.contentLoader(this),this._isTileset()&&this.tileset._initializeTileHeaders(this.content,this),this.contentState=In,this._onContentLoaded(),!0}catch(e){throw this.contentState=Dn,e}finally{t.done()}}unloadContent(){return this.content&&this.content.destroy&&this.content.destroy(),this.content=null,this.header.content&&this.header.content.destroy&&this.header.content.destroy(),this.header.content=null,this.contentState=Tn,!0}updateVisibility(t,e){if(this._frameNumber===t.frameNumber)return;const i=this.parent,n=i?i._visibilityPlaneMask:Jt.MASK_INDETERMINATE;if(this.tileset._traverser.options.updateTransforms){const t=i?i.computedTransform:this.tileset.modelMatrix;this._updateTransform(t)}this._distanceToCamera=this.distanceToTile(t),this._screenSpaceError=this.getScreenSpaceError(t,!1),this._visibilityPlaneMask=this.visibility(t,n),this._visible=this._visibilityPlaneMask!==Jt.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(t),this._frameNumber=t.frameNumber,this.viewportIds=e}visibility(t,e){const{cullingVolume:i}=t,{boundingVolume:n}=this;return i.computeVisibilityWithPlaneMask(n,e)}contentVisibility(){return!0}distanceToTile(t){const e=this.boundingVolume;return Math.sqrt(Math.max(e.distanceSquaredTo(t.camera.position),0))}cameraSpaceZDepth(t){let{camera:e}=t;const i=this.boundingVolume;return ir.subVectors(i.center,e.position),e.direction.dot(ir)}insideViewerRequestVolume(t){const e=this._viewerRequestVolume;return!e||e.distanceSquaredTo(t.camera.position)<=0}updateExpiration(){if(function(t){return void 0!==t&&null!==t}(this._expireDate)&&this.contentReady&&!this.hasEmptyContent){const t=Date.now();Date.lessThan(this._expireDate,t)&&(this.contentState=Pn,this._expiredContent=this.content)}}get extras(){return this.header.extras}_initializeLodMetric(t){"lodMetricType"in t?this.lodMetricType=t.lodMetricType:(this.lodMetricType=this.parent&&this.parent.lodMetricType||this.tileset.lodMetricType,console.warn("3D Tile: Required prop lodMetricType is undefined. Using parent lodMetricType")),"lodMetricValue"in t?this.lodMetricValue=t.lodMetricValue:(this.lodMetricValue=this.parent&&this.parent.lodMetricValue||this.tileset.lodMetricValue,console.warn("3D Tile: Required prop lodMetricValue is undefined. Using parent lodMetricValue"))}_initializeTransforms(t){this.transform=t.transform?new N.Z(t.transform):new N.Z;const e=this.parent,i=this.tileset,n=e&&e.computedTransform?e.computedTransform.clone():i.modelMatrix.clone();this.computedTransform=new N.Z(n).multiplyRight(this.transform);const r=e&&e._initialTransform?e._initialTransform.clone():new N.Z;this._initialTransform=new N.Z(r).multiplyRight(this.transform)}_initializeBoundingVolumes(t){this._contentBoundingVolume=null,this._viewerRequestVolume=null,this._updateBoundingVolume(t)}_initializeContent(t){this.content={_tileset:this.tileset,_tile:this},this.hasEmptyContent=!0,this.contentState=Tn,this.hasTilesetContent=!1,t.contentUrl&&(this.content=null,this.hasEmptyContent=!1)}_initializeRenderingState(t){this.depth=t.level||(this.parent?this.parent.depth+1:0),this._shouldRefine=!1,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._visibilityPlaneMask=Jt.MASK_INDETERMINATE,this._visible=void 0,this._inRequestVolume=!1,this._stackLength=0,this._selectionDepth=0,this._frameNumber=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._priority=0}_getRefine(t){return t||this.parent&&this.parent.refine||Ln.REPLACE}_isTileset(){return-1!==this.contentUrl.indexOf(".json")}_onContentLoaded(){switch(this.content&&this.content.type){case"vctr":case"geom":this.tileset._traverser.disableSkipLevelOfDetail=!0}this._isTileset()&&(this.hasTilesetContent=!0)}_updateBoundingVolume(t){this.boundingVolume=Zn(t.boundingVolume,this.computedTransform,this.boundingVolume);const e=t.content;e&&(e.boundingVolume&&(this._contentBoundingVolume=Zn(e.boundingVolume,this.computedTransform,this._contentBoundingVolume)),t.viewerRequestVolume&&(this._viewerRequestVolume=Zn(t.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)))}_updateTransform(){const t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:new N.Z).clone().multiplyRight(this.transform);!t.equals(this.computedTransform)&&(this.computedTransform=t,this._updateBoundingVolume(this.header))}_getLoaderSpecificOptions(t){return"i3s"===t?{...this.tileset.options.i3s,tile:this.header,tileset:this.tileset.tileset,isTileHeader:!1}:{assetGltfUpAxis:(e=this.tileset.tileset).asset&&e.asset.gltfUpAxis||"Y"};var e}}class rr extends er{compareDistanceToCamera(t,e){return 0===e._distanceToCamera&&0===t._distanceToCamera?e._centerZDepth-t._centerZDepth:e._distanceToCamera-t._distanceToCamera}updateTileVisibility(t,e){if(super.updateTileVisibility(t,e),!t.isVisibleAndInRequestVolume)return;const i=t.children.length>0;if(t.hasTilesetContent&&i){const i=t.children[0];return this.updateTileVisibility(i,e),void(t._visible=i._visible)}if(this.meetsScreenSpaceErrorEarly(t,e))return void(t._visible=!1);const n=t.refine===Ln.REPLACE,r=t._optimChildrenWithinParent===kn;n&&r&&i&&!this.anyChildrenVisible(t,e)&&(t._visible=!1)}meetsScreenSpaceErrorEarly(t,e){const{parent:i}=t;return!(!i||i.hasTilesetContent||i.refine!==Ln.ADD)&&!this.shouldRefine(t,e,!0)}}class or{constructor(){(0,u.Z)(this,"frameNumberMap",new Map)}register(t,e){const i=this.frameNumberMap.get(t)||new Map,n=i.get(e)||0;i.set(e,n+1),this.frameNumberMap.set(t,i)}deregister(t,e){const i=this.frameNumberMap.get(t);if(!i)return;const n=i.get(e)||1;i.set(e,n-1)}isZero(t,e){var i;return 0===((null===(i=this.frameNumberMap.get(t))||void 0===i?void 0:i.get(e))||0)}}const sr="REQUESTED",ar="COMPLETED",lr="ERROR";class cr{constructor(){(0,u.Z)(this,"_statusMap",void 0),(0,u.Z)(this,"pendingTilesRegister",new or),this._statusMap={}}
2add(t,e,i,n){if(!this._statusMap[e]){const{frameNumber:r,viewport:{id:o}}=n;this._statusMap[e]={request:t,callback:i,key:e,frameState:n,status:sr},this.pendingTilesRegister.register(o,r),t().then((t=>{this._statusMap[e].status=ar;const{frameNumber:i,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,i),this._statusMap[e].callback(t,n)})).catch((t=>{this._statusMap[e].status=lr;const{frameNumber:n,viewport:{id:r}}=this._statusMap[e].frameState;this.pendingTilesRegister.deregister(r,n),i(t)}))}}update(t,e){if(this._statusMap[t]){const{frameNumber:i,viewport:{id:n}}=this._statusMap[t].frameState;this.pendingTilesRegister.deregister(n,i);const{frameNumber:r,viewport:{id:o}}=e;this.pendingTilesRegister.register(o,r),this._statusMap[t].frameState=e}}find(t){return this._statusMap[t]}hasPendingTiles(t,e){return!this.pendingTilesRegister.isZero(t,e)}}class ur extends er{traversalFinished(t){return!this._tileManager.hasPendingTiles(t.viewport.id,this._frameNumber||0)}constructor(t){super(t),(0,u.Z)(this,"_tileManager",void 0),this._tileManager=new cr}shouldRefine(t,e){return t._lodJudge=function(t,e){if(0===t.lodMetricValue||isNaN(t.lodMetricValue))return"DIG";const i=2*Yn(t,e);return i<2?"OUT":!t.header.children||i<=t.lodMetricValue?"DRAW":t.header.children?"DIG":"OUT"}(t,e),"DIG"===t._lodJudge}updateChildTiles(t,e){const i=t.header.children||[],n=t.children,r=t.tileset;for(const o of i){const i="".concat(o.id,"-").concat(e.viewport.id),s=n&&n.find((t=>t.id===i));if(s)s&&this.updateTile(s,e);else{let n=()=>this._loadTile(o.id,r);this._tileManager.find(i)?this._tileManager.update(i,e):(r.tileset.nodePages&&(n=()=>r.tileset.nodePagesTile.formTileFromNodePages(o.id)),this._tileManager.add(n,i,(e=>this._onTileLoad(e,t,i)),e))}}return!1}async _loadTile(t,e){const{loader:i}=e,n=e.getTileUrl("".concat(e.url,"/nodes/").concat(t)),r={...e.loadOptions,i3s:{...e.loadOptions.i3s,isTileHeader:!0,loadContent:!1}};return await(0,zi.z)(n,i,r)}_onTileLoad(t,e,i){const n=new nr(e.tileset,t,e,i);e.children.push(n);const r=this._tileManager.find(n.id).frameState;this.updateTile(n,r),this._frameNumber===r.frameNumber&&(this.traversalFinished(r)||(new Date).getTime()-this.lastUpdate>this.updateDebounceTime)&&this.executeTraversal(n,r)}}const hr={description:"",ellipsoid:cn.WGS84,modelMatrix:new N.Z,throttleRequests:!0,maxRequests:64,maximumMemoryUsage:32,maximumTilesSelected:0,debounceTime:0,onTileLoad:()=>{},onTileUnload:()=>{},onTileError:()=>{},onTraversalComplete:t=>t,contentLoader:void 0,viewDistanceScale:1,maximumScreenSpaceError:8,loadTiles:!0,updateTransforms:!0,viewportTraversersMap:null,loadOptions:{fetch:{}},attributions:[],basePath:"",i3s:{}},dr="Tiles In Tileset(s)",pr="Tiles In Memory",Ar="Tiles In View",fr="Tiles To Render",gr="Tiles Loaded",mr="Tiles Loading",yr="Tiles Unloaded",vr="Failed Tile Loads",_r="Points/Vertices",br="Tile Memory Use";class xr{constructor(t,e){(0,u.Z)(this,"options",void 0),(0,u.Z)(this,"loadOptions",void 0),(0,u.Z)(this,"type",void 0),(0,u.Z)(this,"tileset",void 0),(0,u.Z)(this,"loader",void 0),(0,u.Z)(this,"url",void 0),(0,u.Z)(this,"basePath",void 0),(0,u.Z)(this,"modelMatrix",void 0),(0,u.Z)(this,"ellipsoid",void 0),(0,u.Z)(this,"lodMetricType",void 0),(0,u.Z)(this,"lodMetricValue",void 0),(0,u.Z)(this,"refine",void 0),(0,u.Z)(this,"root",void 0),(0,u.Z)(this,"roots",void 0),(0,u.Z)(this,"asset",void 0),(0,u.Z)(this,"description",void 0),(0,u.Z)(this,"properties",void 0),(0,u.Z)(this,"extras",void 0),(0,u.Z)(this,"attributions",void 0),(0,u.Z)(this,"credits",void 0),(0,u.Z)(this,"stats",void 0),(0,u.Z)(this,"traverseCounter",void 0),(0,u.Z)(this,"geometricError",void 0),(0,u.Z)(this,"selectedTiles",void 0),(0,u.Z)(this,"updatePromise",null),(0,u.Z)(this,"tilesetInitializationPromise",void 0),(0,u.Z)(this,"cartographicCenter",void 0),(0,u.Z)(this,"cartesianCenter",void 0),(0,u.Z)(this,"zoom",void 0),(0,u.Z)(this,"boundingVolume",void 0),(0,u.Z)(this,"gpuMemoryUsageInBytes",void 0),(0,u.Z)(this,"dynamicScreenSpaceErrorComputedDensity",void 0),(0,u.Z)(this,"_traverser",void 0),(0,u.Z)(this,"_cache",void 0),(0,u.Z)(this,"_requestScheduler",void 0),(0,u.Z)(this,"_frameNumber",void 0),(0,u.Z)(this,"_queryParamsString",void 0),(0,u.Z)(this,"_queryParams",void 0),(0,u.Z)(this,"_extensionsUsed",void 0),(0,u.Z)(this,"_tiles",void 0),(0,u.Z)(this,"_pendingCount",void 0),(0,u.Z)(this,"lastUpdatedVieports",void 0),(0,u.Z)(this,"_requestedTiles",void 0),(0,u.Z)(this,"_emptyTiles",void 0),(0,u.Z)(this,"frameStateData",void 0),(0,u.Z)(this,"maximumMemoryUsage",void 0),un(t),this.options={...hr,...e},this.tileset=t,this.loader=t.loader,this.type=t.type,this.url=t.url,this.basePath=t.basePath||hn(this.url),this.modelMatrix=this.options.modelMatrix,this.ellipsoid=this.options.ellipsoid,this.lodMetricType=t.lodMetricType,this.lodMetricValue=t.lodMetricValue,this.refine=t.root.refine,this.loadOptions=this.options.loadOptions||{},this.root=null,this.roots={},this.cartographicCenter=null,this.cartesianCenter=null,this.zoom=1,this.boundingVolume=null,this.traverseCounter=0,this.geometricError=0,this._traverser=this._initializeTraverser(),this._cache=new mn,this._requestScheduler
2=new pn({throttleRequests:this.options.throttleRequests,maxRequests:this.options.maxRequests}),this._frameNumber=0,this._pendingCount=0,this._tiles={},this.selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this.frameStateData={},this.lastUpdatedVieports=null,this._queryParams={},this._queryParamsString="",this.maximumMemoryUsage=this.options.maximumMemoryUsage||32,this.gpuMemoryUsageInBytes=0,this.stats=new Me.Z({id:this.url}),this._initializeStats(),this._extensionsUsed=void 0,this.dynamicScreenSpaceErrorComputedDensity=0,this.extras=null,this.asset={},this.credits={},this.description=this.options.description||"",this.tilesetInitializationPromise=this._initializeTileSet(t)}destroy(){this._destroy()}isLoaded(){return 0===this._pendingCount&&0!==this._frameNumber&&0===this._requestedTiles.length}get tiles(){return Object.values(this._tiles)}get frameNumber(){return this._frameNumber}get queryParams(){return this._queryParamsString||(this._queryParamsString=function(t){const e=[];for(const i of Object.keys(t))e.push("".concat(i,"=").concat(t[i]));switch(e.length){case 0:return"";case 1:return"?".concat(e[0]);default:return"?".concat(e.join("&"))}}(this._queryParams)),this._queryParamsString}setProps(t){this.options={...this.options,...t}}setOptions(t){this.options={...this.options,...t}}getTileUrl(t){return t.startsWith("data:")?t:"".concat(t).concat(this.queryParams)}hasExtension(t){return Boolean(this._extensionsUsed&&this._extensionsUsed.indexOf(t)>-1)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this.tilesetInitializationPromise.then((()=>{!t&&this.lastUpdatedVieports?t=this.lastUpdatedVieports:this.lastUpdatedVieports=t,t&&this.doUpdate(t)}))}async selectTiles(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return await this.tilesetInitializationPromise,t&&(this.lastUpdatedVieports=t),this.updatePromise||(this.updatePromise=new Promise((t=>{setTimeout((()=>{this.lastUpdatedVieports&&this.doUpdate(this.lastUpdatedVieports),t(this._frameNumber),this.updatePromise=null}),this.options.debounceTime)}))),this.updatePromise}doUpdate(t){if("loadTiles"in this.options&&!this.options.loadTiles)return;if(this.traverseCounter>0)return;const e=t instanceof Array?t:[t];this._cache.reset(),this._frameNumber++,this.traverseCounter=e.length;const i=[];for(const n of e){const t=n.id;this._needTraverse(t)?i.push(t):this.traverseCounter--}for(const n of e){const t=n.id;if(this.roots[t]||(this.roots[t]=this._initializeTileHeaders(this.tileset,null)),!i.includes(t))continue;const e=bn(n,this._frameNumber);this._traverser.traverse(this.roots[t],e,this.options)}}_needTraverse(t){let e=t;return this.options.viewportTraversersMap&&(e=this.options.viewportTraversersMap[t]),e===t}_onTraversalEnd(t){const e=t.viewport.id;this.frameStateData[e]||(this.frameStateData[e]={selectedTiles:[],_requestedTiles:[],_emptyTiles:[]});const i=this.frameStateData[e],n=Object.values(this._traverser.selectedTiles),[r,o]=function(t,e,i){if(0===i||t.length<=i)return[t,[]];const n=[],{longitude:r,latitude:o}=e.viewport;for(const[c,u]of t.entries()){const[t,e]=u.header.mbs,i=Math.abs(r-t),s=Math.abs(o-e),a=Math.sqrt(s*s+i*i);n.push([c,a])}const s=n.sort(((t,e)=>t[1]-e[1])),a=[];for(let c=0;c<i;c++)a.push(t[s[c][0]]);const l=[];for(let c=i;c<s.length;c++)l.push(t[s[c][0]]);return[a,l]}(n,t,this.options.maximumTilesSelected);i.selectedTiles=r;for(const s of o)s.unselect();i._requestedTiles=Object.values(this._traverser.requestedTiles),i._emptyTiles=Object.values(this._traverser.emptyTiles),this.traverseCounter--,this.traverseCounter>0||this._updateTiles()}_updateTiles(){this.selectedTiles=[],this._requestedTiles=[],this._emptyTiles=[];for(const t in this.frameStateData){const e=this.frameStateData[t];this.selectedTiles=this.selectedTiles.concat(e.selectedTiles),this._requestedTiles=this._requestedTiles.concat(e._requestedTiles),this._emptyTiles=this._emptyTiles.concat(e._emptyTiles)}this.selectedTiles=this.options.onTraversalComplete(this.selectedTiles);for(const t of this.selectedTiles)this._tiles[t.id]=t;this._loadTiles(),this._unloadTiles(),this._updateStats()}_tilesChanged(t,e){if(t.length!==e.length)return!0;const i=new Set(t.map((t=>t.id))),n=new Set(e.map((t=>t.id)));let r=t.filter((t=>!n.has(t.id))).length>0;return r=r||e.filter((t=>!i.has(t.id))).length>0,r}_loadTiles(){for(const t of this._requestedTiles)t.contentUnloaded&&this._loadTile(t)}_unloadTiles(){this._cache.unloadTiles(this,((t,e)=>t._unloadTile(e)))}_updateStats(){let t=0,e=0;for(const i of this.selectedTiles)i.contentAvailable&&i.content&&(t++,i.c
2ontent.pointCount?e+=i.content.pointCount:e+=i.content.vertexCount);this.stats.get(Ar).count=this.selectedTiles.length,this.stats.get(fr).count=t,this.stats.get(_r).count=e}async _initializeTileSet(t){this.type===Fn.I3S&&(this.calculateViewPropsI3S(),t.root=await t.root),this.root=this._initializeTileHeaders(t,null),this.type===Fn.TILES3D&&(this._initializeTiles3DTileset(t),this.calculateViewPropsTiles3D()),this.type===Fn.I3S&&this._initializeI3STileset()}calculateViewPropsI3S(){var t;const e=this.tileset.fullExtent;if(e){const{xmin:t,xmax:i,ymin:n,ymax:r,zmin:o,zmax:s}=e;return this.cartographicCenter=new it.Z(t+(i-t)/2,n+(r-n)/2,o+(s-o)/2),this.cartesianCenter=cn.WGS84.cartographicToCartesian(this.cartographicCenter,new it.Z),void(this.zoom=Sn(e,this.cartographicCenter,this.cartesianCenter))}const i=null===(t=this.tileset.store)||void 0===t?void 0:t.extent;if(i){const[t,e,n,r]=i;return this.cartographicCenter=new it.Z(t+(n-t)/2,e+(r-e)/2,0),this.cartesianCenter=cn.WGS84.cartographicToCartesian(this.cartographicCenter,new it.Z),void(this.zoom=function(t,e,i){const[n,r,o,s]=t;return Sn({xmin:n,xmax:o,ymin:r,ymax:s,zmin:0,zmax:0},e,i)}(i,this.cartographicCenter,this.cartesianCenter))}console.warn("Extent is not defined in the tileset header"),this.cartographicCenter=new it.Z,this.zoom=1}calculateViewPropsTiles3D(){const t=this.root;un(t);const{center:e}=t.boundingVolume;if(!e)return console.warn("center was not pre-calculated for the root tile"),this.cartographicCenter=new it.Z,void(this.zoom=1);0!==e[0]||0!==e[1]||0!==e[2]?this.cartographicCenter=cn.WGS84.cartesianToCartographic(e,new it.Z):this.cartographicCenter=new it.Z(0,0,-cn.WGS84.radii[0]),this.cartesianCenter=e,this.zoom=En(t.boundingVolume,this.cartographicCenter)}_initializeStats(){this.stats.get(dr),this.stats.get(mr),this.stats.get(pr),this.stats.get(Ar),this.stats.get(fr),this.stats.get(gr),this.stats.get(yr),this.stats.get(vr),this.stats.get(_r),this.stats.get(br,"memory")}_initializeTileHeaders(t,e){const i=new nr(this,t.root,e);if(e&&(e.children.push(i),i.depth=e.depth+1),this.type===Fn.TILES3D){const t=[];for(t.push(i);t.length>0;){const e=t.pop();this.stats.get(dr).incrementCount();const i=e.header.children||[];for(const n of i){const i=new nr(this,n,e);e.children.push(i),i.depth=e.depth+1,t.push(i)}}}return i}_initializeTraverser(){let t;switch(this.type){case Fn.TILES3D:t=rr;break;case Fn.I3S:t=ur;break;default:t=er}return new t({basePath:this.basePath,onTraversalEnd:this._onTraversalEnd.bind(this)})}_destroyTileHeaders(t){this._destroySubtree(t)}async _loadTile(t){let e;try{this._onStartTileLoading(),e=await t.loadContent()}catch(i){this._onTileLoadError(t,i)}finally{this._onEndTileLoading(),this._onTileLoad(t,e)}}_onTileLoadError(t,e){this.stats.get(vr).incrementCount();const i=e.message||e.toString(),n=t.url;console.error("A 3D tile failed to load: ".concat(t.url," ").concat(i)),this.options.onT
2ileError(t,i,n)}_onTileLoad(t,e){if(e){if(this.type===Fn.I3S){var i,n;const t=(null===(i=this.tileset)||void 0===i||null===(n=i.nodePagesTile)||void 0===n?void 0:n.nodesInNodePages)||0;this.stats.get(dr).reset(),this.stats.get(dr).addCount(t)}t&&t.content&&function(t,e){un(t),un(e);const{rtcCenter:i,gltfUpAxis:n}=e,{computedTransform:r,boundingVolume:{center:o}}=t;let s=new N.Z(r);switch(i&&s.translate(i),n){case"Z":default:break;case"Y":const t=(new N.Z).rotateX(Math.PI/2);s=s.multiplyRight(t);break;case"X":const e=(new N.Z).rotateY(-Math.PI/2);s=s.multiplyRight(e)}e.isQuantized&&s.translate(e.quantizedVolumeOffset).scale(e.quantizedVolumeScale);const a=new it.Z(o);e.cartesianModelMatrix=s,e.cartesianOrigin=a;const l=cn.WGS84.cartesianToCartographic(a,new it.Z),c=cn.WGS84.eastNorthUpToFixedFrame(a).invert();e.cartographicModelMatrix=c.multiplyRight(s),e.cartographicOrigin=l,e.coordinateSystem||(e.modelMatrix=e.cartographicModelMatrix)}(t,t.content),this._addTileToCache(t),this.options.onTileLoad(t)}}_onStartTileLoading(){this._pendingCount++,this.stats.get(mr).incrementCount()}_onEndTileLoading(){this._pendingCount--,this.stats.get(mr).decrementCount()}_addTileToCache(t){this._cache.add(this,t,(e=>e._updateCacheStats(t)))}_updateCacheStats(t){this.stats.get(gr).incrementCount(),this.stats.get(pr).incrementCount(),this.gpuMemoryUsageInBytes+=t.content.byteLength||0,this.stats.get(br).count=this.gpuMemoryUsageInBytes}_unloadTile(t){this.gpuMemoryUsageInBytes-=t.content&&t.content.byteLength||0,this.stats.get(pr).decrementCount(),this.stats.get(yr).incrementCount(),this.stats.get(br).count=this.gpuMemoryUsageInBytes,this.options.onT
2ileUnload(t),t.unloadContent()}_destroy(){const t=[];for(this.root&&t.push(this.root);t.length>0;){const e=t.pop();for(const i of e.children)t.push(i);this._destroyTile(e)}this.root=null}_destroySubtree(t){const e=t,i=[];for(i.push(e);i.length>0;){t=i.pop();for(const e of t.children)i.push(e);t!==e&&this._destroyTile(t)}e.children=[]}_destroyTile(t){this._cache.unloadTile(this,t),this._unloadTile(t),t.destroy()}_initializeTiles3DTileset(t){if(this.asset=t.asset,!this.asset)throw new Error("Tileset must have an asset property.");if("0.0"!==this.asset.version&&"1.0"!==this.asset.version)throw new Error("The tileset must be 3D Tiles version 0.0 or 1.0.");"tilesetVersion"in this.asset&&(this._queryParams.v=this.asset.tilesetVersion),this.credits={attributions:this.options.attributions||[]},this.description=this.options.description||"",this.properties=t.properties,this.geometricError=t.geometricError,this._extensionsUsed=t.extensionsUsed,this.extras=t.extras}_initializeI3STileset(){this.loadOptions.i3s&&"token"in this.loadOptions.i3s&&(this._queryParams.token=this.loadOptions.i3s.token)}}const wr="3.2.12",Cr={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"};Object.keys(Cr);function Br(t,e,i){un(t instanceof ArrayBuffer);const n=new TextDecoder("utf8"),r=new Uint8Array(t,e,i);return n.decode(r)}const Er="3.2.12",Sr={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:Er,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};class Tr{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;(0,u.Z)(this,"name",void 0),(0,u.Z)(this,"type",void 0),(0,u.Z)(this,"nullable",void 0),(0,u.Z)(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=i,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new Tr(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let Mr,Ir,Pr,Dr,Lr,Or,Fr,Rr,kr;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(Mr||(Mr={}));class zr{static isNull(t){return t&&t.typeId===Mr.Null}static isInt(t){return t&&t.typeId===Mr.Int}static isFloat(t){return t&&t.typeId===Mr.Float}static isBinary(t){return t&&t.typeId===Mr.Binary}static isUtf8(t){return t&&t.typeId===Mr.Utf8}static isBool(t){return t&&t.typeId===Mr.Bool}static isDecimal(t){return t&&t.typeId===Mr.Decimal}static isDate(t){return t&&t.typeId===Mr.Date}static isTime(t){return t&&t.typeId===Mr.Time}static isTimestamp(t){return t&&t.typeId===Mr.Timestamp}static isInterval(t){return t&&t.typeId===Mr.Interval}static isList(t){return t&&t.typeId===Mr.List}static isStruct(t){return t&&t.typeId===Mr.Struct}static isUnion(t){return t&&t.typeId===Mr.Union}static isFixedSizeBinary(t){return t&&t.typeId===Mr.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===Mr.FixedSizeList}static isMap(t){return t&&t.typeId===Mr.Map}static isDictionary(t){return t&&t.typeId===Mr.Dictionary}get typeId(){return Mr.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;Ir=Symbol.toStringTag;class Ur extends zr{constructor(t,e){super(),(0,u.Z)(this,"isSigned",void 0),(0,u.Z)(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return Mr.Int}get[Ir](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class Nr extends Ur{constructor(){super(!0,8)}}class Gr extends Ur{constructor(){super(!0,16)}}class Zr extends Ur{constructor(){super(!0,32)}}class jr extends Ur{constructor(){super(!1,8)}}class Vr extends Ur{constructor(){super(!1,16)}}class Hr extends Ur{constructor(){super(!1,32)}}const Jr=32,Wr=64;Pr=Symbol.toStringTag;class Qr extends zr{constructor(t){super(),(0,u.Z)(this,"precision",void 0),this.precision=t}get typeId(){return Mr.Float}get[Pr](){return"Float"}toString(){return"Float".concat(this.precision)}}class qr extends Qr{constructor(){super(Jr)}}class Kr extends Qr{constructor(){super(Wr)}}Symbol.toStringTag;Symbol.toStringTag;Dr=Symbol.toStringTag;Lr=Symbol.toStringTag;Or=Symbol.toStringTag;Fr=Symbol.toStringTag;Rr=Symbol.toStringTag;class Xr extends zr{constructor(t,e){super(),(0,u.Z)(this,"listSize",void 0),(0,u.Z)(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return Mr.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Rr](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}kr=Symbol.toStringTag;function Yr(t,e,i){const n=function(t){switch(t.constructor){case Int8Array:return new Nr;case Uint8Array:return new jr;case Int16Array:return new Gr;case Uint16Array:return new Vr;case Int32Array:return new Zr;case Uint32Array:return new Hr;case Float32Array:return new qr;case Float64Array:return new Kr;default:throw new Error("array type not supported")}}(e.value),r=i||function(t){const e=new Map;"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10));"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10));"normalized"in t&&e.set("normalized",t.normalized.toString());return e}(e);return new Tr(t,new Xr(e.size,new Tr("value",n)),!1,r)}class $r{constructor(t,e){(0,u.Z)(this,"fields",void 0),(0,u.Z)(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const i of t)e[i.name]&&console.warn("Schema: duplicated field name",i.name,i),e[i.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(){const t=Object.create(null);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];for(const o of i)t[o]=!0;const r=this.fields.filter((e=>t[e.name]));return new $r(r,this.metadata)}selectAt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];const n=e.map((t=>
2this.fields[t])).filter(Boolean);return new $r(n,this.metadata)}assign(t){let e,i=this.metadata;if(t instanceof $r){const n=t;e=n.fields,i=to(to(new Map,this.metadata),n.metadata)}else e=t;const n=Object.create(null);for(const o of this.fields)n[o.name]=o;for(const o of e)n[o.name]=o;const r=Object.values(n);return new $r(r,i)}}function to(t,e){return new Map([...t||new Map,...e||new Map])}function eo(t,e,i){return Yr(t,e,i?io(i.metadata):void 0)}function io(t){const e=new Map;for(const i in t)e.set("".concat(i,".string"),JSON.stringify(t[i]));return e}const no={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},ro={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class oo{constructor(t){(0,u.Z)(this,"draco",void 0),(0,u.Z)(this,"decoder",void 0),(0,u.Z)(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const n=this.decoder.GetEncodedGeometryType(i),r=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(n){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(i,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(i,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e="DRACO decompression failed: ".concat(t.error_msg());throw new Error(e)}const o=this._getDracoLoaderData(r,n,e),s=this._getMeshData(r,o,e),a=function(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;c<l;c+=3){const t=a[c],l=a[c+1],u=a[c+2];e=t<e?t:e,i=l<i?l:i,n=u<n?u:n,r=t>r?t:r,o=l>o?l:o,s=u>s?u:s}return[[e,i,n],[r,o,s]]}(s.attributes),l=function(t,e,i){const n=io(e.metadata),r=[],o=function(t){const e={};for(const i in t){const n=t[i];e[n.name||"undefined"]=n}return e}(e.attributes);for(const s in t){const e=eo(s,t[s],o[s]);r.push(e)}if(i){const t=eo("indices",i);r.push(t)}return new $r(r,n)}(s.attributes,o,s.indices);return{loader:"draco",loaderData:o,header:{vertexCount:r.num_points(),boundingBox:a},...s,schema:l}}finally{this.draco.destroy(i),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,i){const n=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,i);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:n,attributes:r}}_getDracoAttributes(t,e){const i={};for(let n=0;n<t.num_attributes();n++){const r=this.decoder.GetAttribute(t,n),o=this._getAttributeMetadata(t,n);i[r.unique_id()]={unique_id:r.unique_id(),attribute_type:r.attribute_type(),data_type:r.data_type(),num_components:r.num_components(),byte_offset:r.byte_offset(),byte_stride:r.byte_stride(),normalized:r.normalized(),attribute_index:n,metadata:o};const s=this._getQuantizationTransform(r,e);s&&(i[r.unique_id()].quantization_transform=s);const a=this._getOctahedronTransform(r,e);a&&(i[r.unique_id()].octahedron_transform=a)}return i}_getMeshData(t,e,i){const n=this._getMeshAttributes(e,t,i);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?"triangle-strip"===i.topology?{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(t,e,i){const n={};for(const r of Object.values(t.attributes)){const t=this._deduceAttributeName(r,i);r.name=t;const{value:o,size:s}=this._getAttributeValues(e,r);n[t]={value:o,size:s,byteOffset:r.byte_offset,byteStride:r.byte_stride,normalized:r.normalized}}return n}_getTriangleListIndices(t){const e=3*t.num_faces(),i=4*e,n=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,n),new Uint32Array(this.draco.HEAPF32.buffer,n,e).slice()}finally{this.draco._free(n)}}
2_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),i=new Int32Array(e);for(let n=0;n<e;n++)i[n]=t.GetValue(n);return i}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const i=ro[e.data_type],n=e.num_components,r=t.num_points()*n,o=r*i.BYTES_PER_ELEMENT,s=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,i);let a;const l=this.draco._malloc(o);try{const n=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,n,s,o,l),a=new i(this.draco.HEAPF32.buffer,l,r).slice()}finally{this.draco._free(l)}return{value:a,size:n}}_deduceAttributeName(t,e){const i=t.unique_id;for(const[o,s]of Object.entries(e.extraAttributes||{}))if(s===i)return o;const n=t.attribute_type;for(const o in no){if(this.draco[o]===n)return no[o]}const r=e.attributeNameEntry||"name";return t.metadata[r]?t.metadata[r].string:"CUSTOM_ATTRIBUTE_".concat(i)}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const i=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(i)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},i=this.metadataQuerier.NumEntries(t);for(let n=0;n<i;n++){const i=this.metadataQuerier.GetEntryName(t,n);e[i]=this._getDracoMetadataField(t,i)}return e}_getDracoMetadataField(t,e){const i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,i);const n=function(t){const e=t.size(),i=new Int32Array(e);for(let n=0;n<e;n++)i[n]=t.GetValue(n);return i}(i);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:n}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:i=[]}=t,n=[...e,...i];for(const r of n)this.decoder.SkipAttributeTransform(this.draco[r])}_getQuantizationTransform(t,e){const{quantizedAttributes:i=[]}=e,n=t.attribute_type();if(i.map((t=>this.decoder[t])).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map((t=>e.min_value(t)))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:i=[]}=e,n=t.attribute_type();if(i.map((t=>this.decoder[t])).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}const so={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof i.g&&i.g,document:"undefined"!==typeof document&&document},ao=so.global||so.self||so.window||{},lo="object"!==typeof process||"[object process]"!==String(process)||process.browser,co="function"===typeof importScripts,uo=("undefined"!==typeof window&&window.orientation,"undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version));uo&&parseFloat(uo[1]);var ho=i(20035);const po="3.2.12",Ao={};async function fo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e,i){if(t.startsWith("http"))return t;const n=i.modules||{};if(n[t])return n[t];if(!lo)return"modules/".concat(e,"/dist/libs/").concat(t);if(i.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(e,"@").concat(po,"/dist/libs/").concat(t);if(co)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),Ao[t]=Ao[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!lo)try{return ho&&ho.requireFromFile&&await ho.requireFromFile(t)}catch{return null}if(co)return importScripts(t);const e=await fetch(t);return function(t,e){if(!lo)return ho.requireFromString&&ho.requireFromString(t,e);if(co)return eval.call(ao,t),null;const i=document.createElement("script");i.id=e;try{i.appendChild(document.createTextNode(t))}catch(n){i.text=t}return document.body.appendChild(i),null}(await e.text(),t)}(t),await Ao[t]}
2const go="1.4.1",mo="https://www.gstatic.com/draco/versioned/decoders/".concat(go,"/draco_decoder.js"),yo="https://www.gstatic.com/draco/versioned/decoders/".concat(go,"/draco_wasm_wrapper.js"),vo="https://www.gstatic.com/draco/versioned/decoders/".concat(go,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat(go,"/javascript/draco_encoder.js");let _o;async function bo(t){const e=t.modules||{};return _o=e.draco3d?_o||e.draco3d.createDecoderModule({}).then((t=>({draco:t}))):_o||async function(t){let e,i;if("js"===(t.draco&&t.draco.decoderType))e=await fo(mo,"draco",t);else[e,i]=await Promise.all([await fo(yo,"draco",t),await fo(vo,"draco",t)]);return e=e||globalThis.DracoDecoderModule,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t({...i,onModuleLoaded:t=>e({draco:t})})}))}(e,i)}(t),await _o}const xo={...Sr,parse:async function(t,e){const{draco:i}=await bo(e),n=new oo(i);try{return n.parseSync(t,null===e||void 0===e?void 0:e.draco)}finally{n.destroy()}}};const wo={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},Co={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,...wo},Bo={[wo.DOUBLE]:Float64Array,[wo.FLOAT]:Float32Array,[wo.UNSIGNED_SHORT]:Uint16Array,[wo.UNSIGNED_INT]:Uint32Array,[wo.UNSIGNED_BYTE]:Uint8Array,[wo.BYTE]:Int8Array,[wo.SHORT]:Int16Array,[wo.INT]:Int32Array},Eo={DOUBLE:wo.DOUBLE,FLOAT:wo.FLOAT,UNSIGNED_SHORT:wo.UNSIGNED_SHORT,UNSIGNED_INT:wo.UNSIGNED_INT,UNSIGNED_BYTE:wo.UNSIGNED_BYTE,BYTE:wo.BYTE,SHORT:wo.SHORT,INT:wo.INT},So="Failed to convert GL type";class To{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(const e in Bo){if(Bo[e]===t)return e}throw new Error(So)}static fromName(t){const e=Eo[t];if(!e)throw new Error(So);return e}static getArrayType(t){switch(t){case wo.UNSIGNED_SHORT_5_6_5:case wo.UNSIGNED_SHORT_4_4_4_4:case wo.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:const e=Bo[t];if(!e)throw new Error(So);return e}}static getByteSize(t){return To.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(To.getArrayType(t))}static createTypedArray(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;void 0===n&&(n=(e.byteLength-i)/To.getByteSize(t));return new(To.getArrayType(t))(e,i,n)}}class Mo{constructor(t,e){(0,u.Z)(this,"json",void 0),(0,u.Z)(this,"buffer",void 0),(0,u.Z)(this,"featuresLength",0),(0,u.Z)(this,"_cachedTypedArrays",{}),this.json=t,this.buffer=e}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Co.UNSIGNED_INT,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?this._getTypedArrayFromBinary(t,e,i,1,n.byteOffset):n}getPropertyArray(t,e,i){const n=this.json[t];return n&&Number.isFinite(n.byteOffset)?("componentType"in n&&(e=To.fromName(n.componentType)),this._getTypedArrayFromBinary(t,e,i,this.featuresLength,n.byteOffset)):this._getTypedArrayFromArray(t,e,n)}getProperty(t,e,i,n,r){const o=this.json[t];if(!o)return o;const s=this.getPropertyArray(t,e,i);if(1===i)return s[n];for(let a=0;a<i;++a)r[a]=s[i*n+a];return r}_getTypedArrayFromBinary(t,e,i,n,r){const o=this._cachedTypedArrays;let s=o[t];return s||(s=To.createTypedArray(e,this.buffer.buffer,this.buffer.byteOffset+r,n*i),o[t]=s),s}_getTypedArrayFromArray(t,e,i){const n=this._cachedTypedArrays;let r=n[t];return r||(r=To.createTypedArray(e,i),n[t]=r),r}}const Io={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Po={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>
vendor: 6,517 bytes, line 2
2[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},Do={SCALAR:(t,e,i)=>{e[i]=t},VEC2:(t,e,i)=>{e[2*i+0]=t[0],e[2*i+1]=t[1]},VEC3:(t,e,i)=>{e[3*i+0]=t[0],e[3*i+1]=t[1],e[3*i+2]=t[2]},VEC4:(t,e,i)=>{e[4*i+0]=t[0],e[4*i+1]=t[1],e[4*i+2]=t[2],e[4*i+3]=t[3]},MAT2:(t,e,i)=>{e[4*i+0]=t[0],e[4*i+1]=t[1],e[4*i+2]=t[2],e[4*i+3]=t[3]},MAT3:(t,e,i)=>{e[9*i+0]=t[0],e[9*i+1]=t[1],e[9*i+2]=t[2],e[9*i+3]=t[3],e[9*i+4]=t[4],e[9*i+5]=t[5],e[9*i+6]=t[6],e[9*i+7]=t[7],e[9*i+8]=t[8],e[9*i+9]=t[9]},MAT4:(t,e,i)=>{e[16*i+0]=t[0],e[16*i+1]=t[1],e[16*i+2]=t[2],e[16*i+3]=t[3],e[16*i+4]=t[4],e[16*i+5]=t[5],e[16*i+6]=t[6],e[16*i+7]=t[7],e[16*i+8]=t[8],e[16*i+9]=t[9],e[16*i+10]=t[10],e[16*i+11]=t[11],e[16*i+12]=t[12],e[16*i+13]=t[13],e[16*i+14]=t[14],e[16*i+15]=t[15]}};const Lo=t=>void 0!==t;function Oo(t,e,i){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy");const r=e.HIERARCHY;return r&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=r,n=r),n?function(t,e){let i,n,r;const o=t.instancesLength,s=t.classes;let a,l=t.classIds,c=t.parentCounts,u=t.parentIds,h=o;Lo(l.byteOffset)&&(l.componentType=defaultValue(l.componentType,GL.UNSIGNED_SHORT),l.type=AttributeType.SCALAR,r=getBinaryAccessor(l),l=r.createArrayBufferView(e.buffer,e.byteOffset+l.byteOffset,o));if(Lo(c))for(Lo(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,r=getBinaryAccessor(c),c=r.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,o)),a=new Uint16Array(o),h=0,i=0;i<o;++i)a[i]=h,h+=c[i];Lo(u)&&Lo(u.byteOffset)&&(u.componentType=defaultValue(u.componentType,GL.UNSIGNED_SHORT),u.type=AttributeType.SCALAR,r=getBinaryAccessor(u),u=r.createArrayBufferView(e.buffer,e.byteOffset+u.byteOffset,h));const d=s.length;for(i=0;i<d;++i){const t=s[i].length,n=s[i].instances,r=getBinaryProperties(t,n,e);s[i].instances=combine(r,n)}const p=new Array(d).fill(0),A=new Uint16Array(o);for(i=0;i<o;++i)n=l[i],A[i]=p[n],++p[n];const f={classes:s,classIds:l,classIndexes:A,parentCounts:c,parentIndexes:a,parentIds:u};return function(t){const e=t.classIds,i=e.length;for(let n=0;n<i;++n)Ro(t,n,stack)}(f),f}(n,i):null}function Fo(t,e,i){if(!t)return;const n=t.parentCounts;return t.parentIds?i(t,e):n>0?function(t,e,i){const n=t.classIds,r=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=n.length,l=scratchVisited;l.length=Math.max(l.length,a);const c=++marker,u=scratchStack;u.length=0,u.push(e);for(;u.length>0;){if(l[e=u.pop()]===c)continue;l[e]=c;const n=i(t,e);if(Lo(n))return n;const a=r[e],h=s[e];for(let t=0;t<a;++t){const i=o[h+t];i!==e&&u.push(i)}}return null}(t,e,i):function(t,e,i){let n=!0;for(;n;){const r=i(t,e);if(Lo(r))return r;const o=t.parentIds[e];n=o!==e,e=o}throw new Error("traverseHierarchySingleParent")}(t,e,i)}function Ro(t,e,i){const n=t.parentCounts,r=t.parentIds,o=t.parentIndexes,s=t.classIds.length;if(!Lo(r))return;assert(e<s,"Parent index ".concat(e," exceeds the total number of instances: ").concat(s)),assert(-1===i.indexOf(e),"Circular dependency detected in the batch table hierarchy."),i.push(e);const a=Lo(n)?n[e]:1,l=Lo(n)?o[e]:e;for(let c=0;c<a;++c){const n=r[l+c];n!==e&&Ro(t,n,i)}i.pop(e)}function ko(t){return void 0!==t&&null!==t}const zo=(t,e)=>t,Uo={HIERARCHY:!0,extensions:!0,extras:!0};class No{constructor(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};var r;(0,u.Z)(this,"json",void 0),(0,u.Z)(this,"binary",void 0),(0,u.Z)(this,"featureCount",void 0),(0,u.Z)(this,"_extensions",void 0),(0,u.Z)(this,"_properties",void 0),(0,u.Z)(this,"_binaryProperties",void 0),(0,u.Z)(this,"_hierarchy",void 0),un(i>=0),this.json=t||{},this.binary=e,this.featureCount=i,this._extensions=(null===(r=this.json)||void 0===r?void 0:r.extensions)||{},this._properties={};for(const o in this.json)Uo[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),n["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Oo(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,e){if(this._checkBatchId(t),un("string"===typeof e,e),this._hierarchy){return ko(Fo(this._hierarchy,t,((t,i)=>{const n=t.classIds[i];return t.classes[n].name===e})))}return!1}isExactClass(t,e){return un("string"===typeof e,e),this.getExactClassName(t)===e}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){const e=this._hierarchy.classIds[t];return this._hierarchy.classes[e].name}}hasProperty(t,e){return this._checkBatchId(t),un("string"===typeof e,e),ko(this._properties[e])||this._hasPropertyInHierarchy(t,e)}getPropertyNames(t,e){this._checkBatchId(t),(e=ko(e)?e:[]).length=0;const i=Object.keys(this._properties);return e.push(...i),this._hierarchy&&this._getPropertyNamesInHierarchy(t,e),e}getProperty(t,e){if(this._checkBatchId(t),un("string"===typeof e,e),this._binaryProperties){const i=this._binaryProperties[e];if(ko(i))return this._getBinaryProperty(i,t)}const i=this._properties[e];if(ko(i))return zo(i[t]);if(this._hierarchy){const i=this._getHierarchyProperty(t,e);if(ko(i))return i}}setProperty(t,e,i){const n=this.featureCount;if(this._checkBatchId(t),un("string"===typeof e,e),this._binaryProperties){const n=this._binaryProperties[e];if(n)return void this._setBinaryProperty(n,t,i)}if(this._hierarchy&&this._setHierarchyProperty(this,t,e,i))return;let r=this._properties[e];ko(r)||(this._properties[e]=new Array(n),r=this._properties[e]),r[t]=zo(i)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,e){return t.unpack(t.typedArray,e)}_setBinaryProperty(t,e,i){t.pack(i,t.typedArray,e)}_initializeBinaryProperties(){let t=null;for(const e in this._properties){const i=this._properties[e],n=this._initializeBinaryProperty(e,i);n&&(t=t||{},t[e]=n)}return t}_initializeBinaryProperty(t,e){if("byteOffset"in e){const i=e;un(this.binary,"Property ".concat(t," requires a batch table binary.")),un(i.type,"Property ".concat(t," requires a type."));
2const n=function(t,e,i,n){const{componentType:r}=t;un(t.componentType);const o="string"===typeof r?To.fromName(r):r,s=Io[t.type],a=Po[t.type],l=Do[t.type];return i+=t.byteOffset,{values:To.createTypedArray(o,e,i,s*n),type:o,size:s,unpacker:a,packer:l}}(i,this.binary.buffer,0|this.binary.byteOffset,this.featureCount);return{typedArray:n.values,componentCount:n.size,unpack:n.unpacker,pack:n.packer}}return null}_hasPropertyInHierarchy(t,e){if(!this._hierarchy)return!1;const i=Fo(this._hierarchy,t,((t,i)=>{const n=t.classIds[i];return ko(t.classes[n].instances[e])}));return ko(i)}_getPropertyNamesInHierarchy(t,e){Fo(this._hierarchy,t,((t,i)=>{const n=t.classIds[i],r=t.classes[n].instances;for(const o in r)r.hasOwnProperty(o)&&-1===e.indexOf(o)&&e.push(o)}))}_getHierarchyProperty(t,e){return Fo(this._hierarchy,t,((t,i)=>{const n=t.classIds[i],r=t.classes[n],o=t.classIndexes[i],s=r.instances[e];return ko(s)?ko(s.typedArray)?this._getBinaryProperty(s,o):zo(s[o]):null}))}_setHierarchyProperty(t,e,i,n){const r=Fo(this._hierarchy,e,((t,r)=>{const o=t.classIds[r],s=t.classes[o],a=t.classIndexes[r],l=s.instances[i];return!!ko(l)&&(un(r===e,'Inherited property "'.concat(i,'" is read-only.')),ko(l.typedArray)?this._setBinaryProperty(l,a,n):l[a]=zo(n),!0)}));return ko(r)}}const Go=4;function Zo(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const n=new DataView(e);if(t.magic=n.getUint32(i,!0),i+=Go,t.version=n.getUint32(i,!0),i+=Go,t.byteLength=n.getUint32(i,!0),i+=Go,1!==t.version)throw new Error("3D Tile Version ".concat(t.version," not supported"));return i}const jo=4,Vo="b3dm tile in legacy format.";function Ho(t,e,i){const n=new DataView(e);let r;t.header=t.header||{};let o=n.getUint32(i,!0);i+=jo;let s=n.getUint32(i,!0);i+=jo;let a=n.getUint32(i,!0);i+=jo;let l=n.getUint32(i,!0);return i+=jo,a>=570425344?(i-=2*jo,r=o,a=s,l=0,o=0,s=0,console.warn(Vo)):l>=570425344&&(i-=jo,r=a,a=o,l=s,o=0,s=0,console.warn(Vo)),t.header.featureTableJsonByteLength=o,t.header.featureTableBinaryByteLength=s,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=l,t.header.batchLength=r,i}function Jo(t,e,i,n){return i=function(t,e,i,n){const{featureTableJsonByteLength:r,featureTableBinaryByteLength:o,batchLength:s}=t.header;if(t.featureTableJson={BATCH_LENGTH:s||0},r>0){const n=Br(e,i,r);t.featureTableJson=JSON.parse(n)}return i+=r,t.featureTableBinary=new Uint8Array(e,i,o),i+=o,i}(t,e,i),i=function(t,e,i,n){const{batchTableJsonByteLength:r,batchTableBinaryByteLength:o}=t.header;if(r>0){const n=Br(e,i,r);t.batchTableJson=JSON.parse(n),i+=r,o>0&&(t.batchTableBinary=new Uint8Array(e,i,o),t.batchTableBinary=new Uint8Array(t.batchTableBinary),i+=o)}return i}(t,e,i),i}function Wo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[0,0,0];const i=t>>11&31,n=t>>5&63,r=31&t;return e[0]=i<<3,e[1]=n<<2,e[2]=r<<3,e}function Qo(t,e,i){if(!e&&(!t||!t.batchIds||!i))return null;const{batchIds:n,isRGB565:r,pointCount:o}=t;if(n&&i){const t=new Uint8ClampedArray(3*o);for(let e=0;e<o;e++){const r=n[e],o=i.getProperty(r,"dimensions").map((t=>255*t));t[3*e]=o[0],t[3*e+1]=o[1],t[3*e+2]=o[2]}return{type:Co.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}if(r){const t=new Uint8ClampedArray(3*o);for(let i=0;i<o;i++){const n=Wo(e[i]);t[3*i]=n[0],t[3*i+1]=n[1],t[3*i+2]=n[2]}return{type:Co.UNSIGNED_BYTE,value:t,size:3,normalized:!0}}return e&&e.length===3*o?{type:Co.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:Co.UNSIGNED_BYTE,value:e,size:4,normalized:!0}}var qo=i(95282);class Ko extends qo.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;super(2),(0,Ut.kJ)(t)&&1===arguments.length?this.copy(t):(Ut.vc.debug&&((0,dt.u5)(t),(0,dt.u5)(e)),this[0]=t,this[1]=e)}set(t,e){return this[0]=t,this[1]=e,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return Ut.vc.debug&&((0,dt.u5)(t.x),(0,dt.u5)(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return ft.fF(this,this,t),this.check()}transformAsVector(t){return(0,pt.pb)(this,this,t),this.check()}transformByMatrix3(t){return ft.kK(this,this,t),this.check()}transformByMatrix2x3(t){return ft.iu(this,this,t),this.check()}transformByMatrix2(t){return ft.c(this,this,t),this.check()}}
vendor: 4,389 bytes, line 2
2new Ko,new it.Z,new Ko,new Ko,new Uint8Array(1);function Xo(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:255;return(0,Ut.uZ)(t,0,e)/e*2-1}function Yo(t){return t<0?-1:1}function $o(t,e,i,n){if(function(t,e){if(!t)throw new Error("math.gl assertion failed. ".concat(e))}(n),t<0||t>i||e<0||e>i)throw new Error("x and y must be unsigned normalized integers between 0 and ".concat(i));if(n.x=Xo(t,i),n.y=Xo(e,i),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){const t=n.x;n.x=(1-Math.abs(n.y))*Yo(t),n.y=(1-Math.abs(t))*Yo(n.y)}return n.normalize()}function ts(t,e,i){return $o(t,e,255,i)}const es=new it.Z;function is(t,e,i){return t.isQuantized?i["3d-tiles"]&&i["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,function(t,e){const i=new it.Z,n=new Float32Array(3*t.pointCount);for(let r=0;r<t.pointCount;r++)i.set(e[3*r],e[3*r+1],e[3*r+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,3*r);return n}(t,e)):{type:Co.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}async function ns(t,e,i,n,r){i=Jo(t,e,i=Ho(t,e,i=Zo(t,e,i))),function(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}(t);const{featureTable:o,batchTable:s}=function(t){const e=new Mo(t.featureTableJson,t.featureTableBinary),i=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(i))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=i,t.featuresLength=i,t.pointsLength=i,t.pointCount=i,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",Co.FLOAT,3);const n=function(t,e){let i=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",Co.UNSIGNED_SHORT,1),t.batchIds)){const n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");const{batchTableJson:r,batchTableBinary:o}=t;i=new No(r,o,n)}return i}(t,e);return{featureTable:e,batchTable:n}}(t);return await async function(t,e,i,n,r){let o,s,a;const l=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];l&&(a=l.properties);const c=e.getExtension("3DTILES_draco_point_compression");if(c){s=c.properties;const e=c.byteOffset,i=c.byteLength;if(!s||!Number.isFinite(e)||!i)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=t.featureTableBinary.slice(e,e+i),t.hasPositions=Number.isFinite(s.POSITION),t.hasColors=Number.isFinite(s.RGB)||Number.isFinite(s.RGBA),t.hasNormals=Number.isFinite(s.NORMAL),t.hasBatchIds=Number.isFinite(s.BATCH_ID),t.isTranslucent=Number.isFinite(s.RGBA)}if(!o)return!0;const u={buffer:o,properties:{...s,...a},featureTableProperties:s,batchTableProperties:a,dequantizeInShader:!1};return await async function(t,e,i,n){const{parse:r}=n,o={...i,draco:{...i.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];const s=await r(e.buffer,xo,o),a=s.attributes.POSITION&&s.attributes.POSITION.value,l=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,c=s.attributes.NORMAL&&s.attributes.NORMAL.value,u=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=a&&s.attributes.POSITION.value.quantization,d=c&&s.attributes.NORMAL.value.quantization;if(h){const e=s.POSITION.data.quantization,i=e.range;t.quantizedVolumeScale=new it.Z(i,i,i),t.quantizedVolumeOffset=new it.Z(e.minValues),t.quantizedRange=(1<<e.quantizationBits)-1,t.isQuantizedDraco=!0}d&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);const p={};if(e.batchTableProperties)for(const A of Object.keys(e.batchTableProperties))s.attributes[A]&&s.attributes[A].value&&(p[A.toLowerCase()]=s.attributes[A].value);t.attributes={positions:a,colors:Qo(t,l,void 0),normals:c,batchIds:u,...p}}(t,u,n,r)}(t,o,0,n,r),function(t,e,i){if(!t.attributes.positions)if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",Co.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){const n=e.getPropertyArray("POSITION_QUANTIZED",Co.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=65535,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Co.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OF
2FSET",Co.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=is(t,n,i)}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}(t,o,n),function(t,e,i){if(!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",Co.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",Co.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",Co.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Qo(t,n,i)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",Co.UNSIGNED_BYTE,4))}(t,o,s),function(t,e){if(!t.attributes.normals){let i=null;e.hasProperty("NORMAL")?i=e.getPropertyArray("NORMAL",Co.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(i=e.getPropertyArray("NORMAL_OCT16P",Co.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=function(t,e){if(!e)return null;if(t.isOctEncoded16P){const i=new Float32Array(3*t.pointsLength);for(let n=0;n<t.pointsLength;n++)ts(e[2*n],e[2*n+1],es),es.toArray(i,3*n);return{type:Co.FLOAT,size:2,value:i}}return{type:Co.FLOAT,size:2,value:e}}(t,i)}}(t,o),i}const rs={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof i.g&&i.g,document:"undefined"!==typeof document&&document},os=rs.global||rs.self||rs.window||{},ss="object"!==typeof process||"[object process]"!==String(process)||process.browser,as="function"===typeof importScripts,ls=("undefined"!==typeof window&&window.orientation,"undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version));ls&&parseFloat(ls[1]);var cs=i(2090);const us="3.2.12",hs={};async function ds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e,i){if(t.startsWith("http"))return t;const n=i.modules||{};if(n[t])return n[t];if(!ss)return"modules/".concat(e,"/dist/libs/").concat(t);if(i.CDN)return function(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(e,"@").concat(us,"/dist/libs/").concat(t);if(as)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),hs[t]=hs[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!ss)try{return cs&&cs.requireFromFile&&await cs.requireFromFile(t)}catch{return null}if(as)return importScripts(t);const e=await fetch(t);return function(t,e){if(!ss)return cs.requireFromString&&cs.requireFromString(t,e);if(as)return eval.call(os,t),null;const i=document.createElement("script");i.id=e;try{i.appendChild(document.createTextNode(t))}catch(n){i.text=t}return document.body.appendChild(i),null}(await e.text(),t)}(t),await hs[t]}const ps="3.2.12",As="https://unpkg.com/@loaders.gl/textures@".concat(ps,"/dist/libs/basis_encoder.wasm"),fs="https://unpkg.com/@loaders.gl/textures@".concat(ps,"/dist/libs/basis_encoder.js");let gs,ms;async function ys(t){const e=t.modules||{};return e.basis?e.basis:(gs=gs||async function(t){let e=null,i=null;return[e,i]=await Promise.all([await ds("basis_transcoder.js","textures",t),await ds("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t(i).then((t=>{const{BasisFile:i,initializeBasis:n}=t;n(),e({BasisFile:i})}))}))}(e,i)}(t),await gs)}async function vs(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(ms=ms||async function(t){let e=null,i=null;return[e,i]=await Promise.all([await ds(fs,"textures",t),await ds(As,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t(i).then((t=>{const{BasisFile:i,KTX2File:n,initializeBasis:r,BasisEncoder:o}=t;r(),e({BasisFile:i,KTX2File:n,BasisEncoder:o})}))}))}(e,i)}(t),await ms)}const _s=33776,bs=33779,xs=35840,ws=35842,Cs=36196,Bs=37808,Es=["","WEBKIT_","MOZ_"],Ss={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let Ts=null;function Ms(t){if(!Ts){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,Ts=new Set;for(const e of Es)for(const i in Ss)if(t&&t.getExtension("".concat(e).concat(i))){const t=Ss[i];Ts.add(t)}}return Ts}i(88687);const Is=[171,75,84,88,32,50,48,187,13,10,26,10];const Ps={etc1:{basisFormat:0,compressed:!0,format:Cs},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:_s},bc3:{basisFormat:3,compressed:!0,format:bs},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:xs},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:ws},"astc-4x4":{basisFormat:10,compressed:!0,format:Bs},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function Ds(t,e,i){const n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");const t=n.getNumImages(),e=[];for(let r=0;r<t;r++){const t=n.getNumLevels(r),o=[];for(let e=0;e<t;e++)o.push(Ls(n,r,e,i));e.push(o)}return e}finally{n.close(),n.delete()}}
2function Ls(t,e,i,n){const r=t.getImageWidth(e,i),o=t.getImageHeight(e,i),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=Rs(n,s),u=t.getImageTranscodedSizeInBytes(e,i,c),h=new Uint8Array(u);if(!t.transcodeImage(h,e,i,c,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:o,data:h,compressed:a,format:l,hasAlpha:s}}function Os(t,e,i){const n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");const t=n.getLevels(),e=[];for(let r=0;r<t;r++){e.push(Fs(n,r,i));break}return[e]}finally{n.close(),n.delete()}}function Fs(t,e,i){const{alphaFlag:n,height:r,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=Rs(i,n),c=t.getImageTranscodedSizeInBytes(e,0,0,l),u=new Uint8Array(c);if(!t.transcodeImage(u,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:r,data:u,compressed:s,hasAlpha:n,format:a}}function Rs(t,e){let i=t&&t.basis&&t.basis.format;return"auto"===i&&(i=ks()),"object"===typeof i&&(i=e?i.alpha:i.noAlpha),i=i.toLowerCase(),Ps[i]}function ks(){const t=Ms();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const zs={name:"Basis",id:"basis",module:"textures",version:"3.2.12",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Us={...zs,parse:async function(t,e){if("auto"===e.basis.containerFormat){if(function(t){const e=new Uint8Array(t);return!(e.byteLength<Is.length||e[0]!==Is[0]||e[1]!==Is[1]||e[2]!==Is[2]||e[3]!==Is[3]||e[4]!==Is[4]||e[5]!==Is[5]||e[6]!==Is[6]||e[7]!==Is[7]||e[8]!==Is[8]||e[9]!==Is[9]||e[10]!==Is[10]||e[11]!==Is[11])}(t)){return Os((await vs(e)).KTX2File,t,e)}const{BasisFile:i}=await ys(e);return Ds(i,t,e)}if("encoder"===e.basis.module){const i=await vs(e);return"ktx2"===e.basis.containerFormat?Os(i.KTX2File,t,e):Ds(i.BasisFile,t,e)}{const{BasisFile:i}=await ys(e);return Ds(i,t,e)}}},Ns=("undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof i.g&&i.g,"undefined"!==typeof document&&document,Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser)),Gs="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version),{_parseImageNode:Zs}=(Gs&&parseFloat(Gs[1]),globalThis),js="undefined"!==typeof Image,Vs="undefined"!==typeof ImageBitmap,Hs=Boolean(Zs),Js=!!Ns||Hs;function Ws(t){const e=qs(t);if(!e)throw new Error("Not an image");return e}function Qs(t){switch(Ws(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("getImageData");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0),i.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function qs(t){return"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!==typeof Image&&t instanceof Image?"image":t&&"object"===typeof t&&t.data&&t.width&&t.height?"data":null}const Ks=/^data:image\/svg\+xml/,Xs=/\.svg((\?|#).*)?$/;function Ys(t){return t&&(Ks.test(t)||Xs.test(t))}function $s(t,e){if(Ys(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function ta(t,e,i){const n=function(t,e){if(Ys(e)){let e=(new TextDecoder).decode(t);try{"function"===typeof unescape&&"function"===typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(i){throw new Error(i.message)}return"data:image/svg+xml;base64,".concat(btoa(e))}return $s(t,e)}(t,i),r=self.URL||self.webkitURL,o="string"!==typeof n&&r.createObjectURL(n);try{return await async function(t,e){const i=new Image;if(i.src=t,e.image&&e.image.decode&&i.decode)return await i.decode(),i;return await new Promise(((e,n)=>{try{i.onload=()=>e(i),i.onerror=e=>n(new Error("Could not load image ".concat(t,": ").concat(e)))}catch(r){n(r)}}))}(o||n,e)}finally{o&&r.revokeObjectURL(o)}}const ea={};let ia=!0;async function na(t,e,i){let n;if(Ys(i)){n=await ta(t,e,i)}else n=$s(t,i);const r=e&&e.imagebitmap;return await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(t){for(const e in t||ea)return!1;return!0}(e)&&ia||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(i){console.warn(i),ia=!1}return await createImageBitmap(t)}(n,r)}const ra=!1,oa=!0;
2function sa(t){const e=aa(t);return function(t){const e=aa(t),i=e.byteLength>=24&&2303741511===e.getUint32(0,ra);if(!i)return null;return{mimeType:"image/png",width:e.getUint32(16,ra),height:e.getUint32(20,ra)}}(e)||function(t){const e=aa(t),i=e.byteLength>=3&&65496===e.getUint16(0,ra)&&255===e.getUint8(2);if(!i)return null;const{tableMarkers:n,sofMarkers:r}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let i=65504;i<65520;++i)t.add(i);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let o=2;for(;o+9<e.byteLength;){const t=e.getUint16(o,ra);if(r.has(t))return{mimeType:"image/jpeg",height:e.getUint16(o+5,ra),width:e.getUint16(o+7,ra)};if(!n.has(t))return null;o+=2,o+=e.getUint16(o,ra)}return null}(e)||function(t){const e=aa(t),i=e.byteLength>=10&&1195984440===e.getUint32(0,ra);if(!i)return null;return{mimeType:"image/gif",width:e.getUint16(6,oa),height:e.getUint16(8,oa)}}(e)||function(t){const e=aa(t),i=e.byteLength>=14&&16973===e.getUint16(0,ra)&&e.getUint32(2,oa)===e.byteLength;if(!i)return null;return{mimeType:"image/bmp",width:e.getUint32(18,oa),height:e.getUint32(22,oa)}}(e)}function aa(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}const la={id:"image",module:"images",name:"Images",version:"3.2.12",mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(t,e,i){const n=((e=e||{}).image||{}).type||"auto",{url:r}=i||{};let o;switch(function(t){switch(t){case"auto":case"data":return function(){if(Vs)return"imagebitmap";if(js)return"image";if(Js)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return Vs||js||Js;case"imagebitmap":return Vs;case"image":return js;case"data":return Js;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}(n)){case"imagebitmap":o=await na(t,e,r);break;case"image":o=await ta(t,e,r);break;case"data":o=await async function(t,e){const{mimeType:i}=sa(t)||{},n=globalThis._parseImageNode;return un(n),await n(t,i)}(t);break;default:un(!1)}return"data"===n&&(o=Qs(o)),o},tests:[t=>Boolean(sa(new DataView(t)))],options:{image:{type:"auto",decode:!0}}};function ca(t,e,i){if(t.byteLength<=e+i)return"";const n=new DataView(t);let r="";for(let o=0;o<i;o++)r+=String.fromCharCode(n.getUint8(e+o));return r}function ua(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return ca(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer)return ca(t,0,e);return""}(t),'"'))}}function ha(t,e,i){const n=void 0!==i?new Uint8Array(t).subarray(e,e+i):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function da(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function pa(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const i=e.baseUri||e.uri;if(!i)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return i.substr(0,i.lastIndexOf("/")+1)+t}
2function Aa(t,e,i){const n=t.bufferViews[i];da(n);const r=e[n.buffer];da(r);const o=(n.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,n.byteLength)}function fa(t,e){return un(t>=0),un(e>0),t+(e-1)&~(e-1)}function ga(t,e,i){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{const e=t.byteOffset,i=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,e,i)}return e.set(n,i),i+fa(n.byteLength,4)}const ma=["SCALAR","VEC2","VEC3","VEC4"],ya=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],va=new Map(ya),_a={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ba={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},xa={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function wa(t){return ma[t-1]||ma[0]}function Ca(t){const e=va.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Ba(t,e){const i=xa[t.componentType],n=_a[t.type],r=ba[t.componentType],o=t.count*n,s=t.count*n*r;return da(s>=0&&s<=e.byteLength),{ArrayType:i,length:o,byteLength:s}}const Ea={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class Sa{constructor(t){(0,u.Z)(this,"gltf",void 0),(0,u.Z)(this,"sourceBuffers",void 0),(0,u.Z)(this,"byteLength",void 0),this.gltf=t||{json:{...Ea},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find((e=>e===t)),i=this.json.extensions||{};return e?i[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find((e=>e===t))?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"===typeof e)return e;const i=this.json[t]&&this.json[t][e];if(!i)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return i}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,i=this.gltf.buffers[e];da(i);const n=(t.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,n,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),i=this.getBuffer(e.buffer).data,{ArrayType:n,length:r}=Ba(t,e);return new n(i,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),i=this.getBuffer(e.buffer).data,n=e.byteOffset||0;return new Uint8Array(i,n,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,i){return t.extensions=t.extensions||{},t.extensions[e]=i,this.registerUsedExtension(e),this}setObjectExtension(t,e,i){(t.extensions||{})[e]=i}removeObjectExtension(t,e){const i=t.extensions||{},n=i[e];return delete i[e],n}addExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return da(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}addRequiredExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return da(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((e=>e===t))||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((e=>e===t))||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:i}=t;this.json.nodes=this.json.nodes||[];const n={mesh:e};return i&&(n.matrix=i),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:i,material:n,mode:r=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(i){const t=this._addIndices(i);o.primitives[0].indices=t}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const i=sa(t),n=e||(null===i||void 0===i?void 0:i.mimeType),r={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;da(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const i={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=fa(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(t,e){const i={bufferView:t,type:wa(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const i=this.addBufferView(t);let n={min:e.min,max:e.max};n.min&&n.max||(n=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:Ca(t),count:Math.round(t.length/e.size),min:n.min,max:n.max};return this.addAccessor(i,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,i={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}
2addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const i=this.byteLength,n=new ArrayBuffer(i),r=new Uint8Array(n);let o=0;for(const s of this.sourceBuffers||[])o=ga(s,r,o);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(t,e){let i=!0;for(;i;){const n=t.indexOf(e);n>-1?t.splice(n,1):i=!1}}_addAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={};for(const i in t){const n=t[i],r=this._getGltfAttributeName(i),o=this.addBinaryBuffer(n.value,n);e[r]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const i={min:null,max:null};if(t.length<e)return i;i.min=[],i.max=[];const n=t.subarray(0,e);for(const r of n)i.min.push(r),i.max.push(r);for(let r=e;r<t.length;r+=e)for(let n=0;n<e;n++)i.min[0+n]=Math.min(i.min[0+n],t[r+n]),i.max[0+n]=Math.max(i.max[0+n],t[r+n]);return i}}const Ta="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9
2LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",Ma
vendor: 10,662 bytes, line 2
2="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",
2Ia=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Pa=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Da={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},La={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let Oa;async function Fa(){return Oa||(Oa=async function(){let t=Ta;WebAssembly.validate(Ia)&&(t=Ma,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(function(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;++n){const i=t.charCodeAt(n);e[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let i=0;for(let n=0;n<t.length;++n)e[i++]=e[n]<60?Pa[e[n]]:64*(e[n]-60)+e[++n];return e.buffer.slice(0,i)}(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}()),Oa}function Ra(t,e,i,n,r,o,s){const a=t.exports.sbrk,l=n+3&-4,c=a(l*r),u=a(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,u);const d=e(c,n,r,u,o.length);if(0===d&&s&&s(c,l,r),i.set(h.subarray(c,c+n*r)),a(c-a(0)),0!==d)throw new Error("Malformed buffer data: ".concat(d))}const ka="EXT_meshopt_compression",za=ka;async function Ua(t,e){var i;const n=new Sa(t);if(null===e||void 0===e||null===(i=e.gltf)||void 0===i||!i.decompressMeshes)return;const r=[];for(const o of t.json.bufferViews||[])r.push(Na(n,o));await Promise.all(r),n.removeExtension(ka)}async function Na(t,e){const i=t.getObjectExtension(e,ka);if(i){const{byteOffset:n=0,byteLength:r=0,byteStride:o,count:s,mode:a,filter:l="NONE",buffer:c}=i,u=t.gltf.buffers[c],h=new Uint8Array(u.arrayBuffer,u.byteOffset+n,r),d=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);return await async function(t,e,i,n,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const s=await Fa();Ra(s,s.exports[La[r]],t,e,i,n,s.exports[Da[o||"NONE"]])}(d,s,o,h,a,l),d}return null}const Ga=["image/png","image/jpeg","image/gif"],Za={};function ja(t){return void 0===Za[t]&&(Za[t]=function(t){switch(t){case"image/webp":return function(){if(!Ns)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch{return!1}}();case"image/svg":return Ns;default:if(!Ns){const{_parseImageNode:e}=globalThis;return Boolean(e)&&Ga.includes(t)}return!0}}(t)),Za[t]}const Va="EXT_texture_webp",Ha=Va;function Ja(t,e){const i=new Sa(t);if(!ja("image/webp")){if(i.getRequiredExtensions().includes(Va))throw new Error("gltf: Required extension ".concat(Va," not supported by browser"));return}const{json:n}=i;for(const r of n.textures||[]){const t=i.getObjectExtension(r,Va);t&&(r.source=t.source),i.removeObjectExtension(r,Va)}i.removeExtension(Va)}const Wa="KHR_texture_basisu",Qa=Wa;function qa(t,e){const i=new Sa(t),{json:n}=i;for(const r of n.textures||[]){const t=i.getObjectExtension(r,Wa);t&&(r.source=t.source),i.removeObjectExtension(r,Wa)}i.removeExtension(Wa)}function Ka(t){const{buffer:e,size:i,count:n}=function(t){let e=t,i=1,n=0;t&&t.value&&(e=t.value,i=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(i&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),n=e.length/i);return{buffer:e,size:i,count:n}}(t);return{value:e,size:i,byteOffset:0,count:n,type:wa(i),componentType:Ca(e)}}const Xa="KHR_draco_mesh_compression",Ya=Xa;function $a(t,e,i){const n=new Sa(t);for(const r of rl(n))n.getObjectExtension(r,Xa)}async function tl(t,e,i){var n;if(null===e||void 0===e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const r=new Sa(t),o=[];for(const s of rl(r))r.getObjectExtension(s,Xa)&&o.push(il(r,s,e,i));await Promise.all(o),r.removeExtension(Xa)}function el(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new Sa(t);for(const n of i.json.meshes||[])nl(n,e),i.addRequiredExtension(Xa)}async function il(t,e,i,n){const r=t.getObjectExtension(e,Xa);if(!r)return;const o=t.getTypedArrayForBufferView(r.bufferView),s=ha(o.buffer,o.byteOffset),{parse:a}=n,l={...i};delete l["3d-tiles"];const c=await a(s,xo,l,n),u=function(t){const e={};for(const i in t){const n=t[i];if("indices"!==i){const t=Ka(n);e[i]=t}}return e}(c.attributes);for(const[h,d]of Object.entries(u))if(h in e.attributes){const i=e.attributes[h],n=t.getAccessor(i);null!==n&&void 0!==n&&n.min&&null!==n&&void 0!==n&&n.max&&(d.min=n.min,d.max=n.max)}e.attributes=u,c.indices&&(e.indices=Ka(c.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function nl(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;var o;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const s=n.DracoWriter.encodeSync({attributes:t}),a=null===r||void 0===r||null===(o=r.parseSync)||void 0===o?void 0:o.call(r,{attributes:t}),l=n._addFauxAttributes(a.attributes),c=n.addBufferView(s);return{primitives:[{attributes:l,mode:i,extensions:{[Xa]:{bufferView:c,attributes:l}}}]}}function*rl(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}const ol="KHR_lights_punctual",sl=ol;async function al(t){const e=new Sa(t),{json:i}=e,n=e.getExtension(ol);n&&(e.json.lights=n.lights,e.removeExtension(ol));for(const r of i.nodes||[]){const t=e.getObjectExtension(r,ol);t&&(r.light=t.light),e.removeObjectExtension(r,ol)}}async function ll(t){const e=new Sa(t),{json:i}=e;if(i.lights){const t=e.addExtension(ol);da(!t.lights),t.lights=i.lights,delete i.lights}if(e.json.lights){for(const t of e.json.lights){const i=t.node;e.addObjectExtension(i,ol,t)}delete e.json.lights}}const cl="KHR_materials_unlit",ul=cl;async function hl(t){const e=new Sa(t),{json:i}=e;e.removeExtension(cl);for(const n of i.materials||[]){n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,cl)}}function dl(t){const e=new Sa(t),{json:i}=e;if(e.materials)for(const n of i.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,cl,{}),e.addExtension(cl))}const pl="KHR_techniques_webgl",Al=pl;async function fl(t){const e=new Sa(t),{json:i}=e,n=e.getExtension(pl);if(n){const t=function(t,e){const{programs:i=[],shaders:n=[],techniques:r=[]}=t,o=new TextDecoder;
2return n.forEach((t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))})),i.forEach((t=>{t.fragmentShader=n[t.fragmentShader],t.vertexShader=n[t.vertexShader]})),r.forEach((t=>{t.program=i[t.program]})),r}(n,e);for(const n of i.materials||[]){const i=e.getObjectExtension(n,pl);i&&(n.technique=Object.assign({},i,t[i.technique]),n.technique.values=ml(n.technique,e)),e.removeObjectExtension(n,pl)}e.removeExtension(pl)}}async function gl(t,e){}function ml(t,e){const i=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((e=>{t.uniforms[e].value&&!(e in i)&&(i[e]=t.uniforms[e].value)})),Object.keys(i).forEach((t=>{"object"===typeof i[t]&&void 0!==i[t].index&&(i[t].texture=e.getTexture(i[t].index))})),i}const yl=[n,r,o,s,a,l,c];function vl(t,e){var i;const n=(null===e||void 0===e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};return!(t in n&&!n[t])}const _l="KHR_binary_glTF";const bl={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},xl={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class wl{constructor(){(0,u.Z)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),(0,u.Z)(this,"json",void 0)}normalize(t,e){this.json=t.json;const i=t.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(i.asset.version))}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(t){const e=new Sa(t),{json:i}=e;for(const n of i.images||[]){const t=e.getObjectExtension(n,_l);t&&Object.assign(n,t),e.removeObjectExtension(n,_l)}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,e.removeExtension(_l)}(t),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in bl)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const i=t[e];if(i&&!Array.isArray(i)){t[e]=[];for(const n in i){const r=i[n];r.id=r.id||n;const o=t[e].length;t[e].push(r),this.idToIndexMap[e][n]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in bl)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:i,material:n}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");i&&(e.indices=this._convertIdToIndex(i,"accessor")),n&&(e.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map((t=>this._convertIdToIndex(t,"node")))),t.meshes&&(t.meshes=t.meshes.map((t=>this._convertIdToIndex(t,"mesh"))))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map((t=>this._convertIdToIndex(t,"node"))))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);for(const i of t[e])for(const t in i){const e=i[t],n=this._convertIdToIndex(e,t);i[t]=n}}_convertIdToIndex(t,e){const i=xl[e];if(i in this.idToIndexMap){const n=this.idToIndexMap[i][t];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(e," with i
2d ").concat(t));return n}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const r of t.materials){var e,i,n;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const o=(null===(e=r.values)||void 0===e?void 0:e.tex)||(null===(i=r.values)||void 0===i?void 0:i.texture2d_0)||(null===(n=r.values)||void 0===n?void 0:n.diffuseTex),s=t.textures.findIndex((t=>t.id===o));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}}const Cl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Bl={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},El=10240,Sl=10241,Tl=10242,Ml=10243,Il=10497,Pl={magFilter:El,minFilter:Sl,wrapS:Tl,wrapT:Ml},Dl={[El]:9729,[Sl]:9986,[Tl]:Il,[Ml]:Il};class Ll{constructor(){(0,u.Z)(this,"baseUri",""),(0,u.Z)(this,"json",{}),(0,u.Z)(this,"buffers",[]),(0,u.Z)(this,"images",[])}postProcess(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:i,buffers:n=[],images:r=[],baseUri:o=""}=t;return da(i),this.baseUri=o,this.json=i,this.buffers=n,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t){t.bufferViews&&(t.bufferViews=t.bufferViews.map(((t,e)=>this._resolveBufferView(t,e)))),t.images&&(t.images=t.images.map(((t,e)=>this._resolveImage(t,e)))),t.samplers&&(t.samplers=t.samplers.map(((t,e)=>this._resolveSampler(t,e)))),t.textures&&(t.textures=t.textures.map(((t,e)=>this._resolveTexture(t,e)))),t.accessors&&(t.accessors=t.accessors.map(((t,e)=>this._resolveAccessor(t,e)))),t.materials&&(t.materials=t.materials.map(((t,e)=>this._resolveMaterial(t,e)))),t.meshes&&(t.meshes=t.meshes.map(((t,e)=>this._resolveMesh(t,e)))),t.nodes&&(t.nodes=t.nodes.map(((t,e)=>this._resolveNode(t,e)))),t.skins&&(t.skins=t.skins.map(((t,e)=>this._resolveSkin(t,e)))),t.scenes&&(t.scenes=t.scenes.map(((t,e)=>this._resolveScene(t,e)))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"===typeof e)return e;const i=this.json[t]&&this.json[t][e];return i||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),i}_resolveScene(t,e){return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((t=>this.getNode(t))),t}_resolveNode(t,e){return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((t=>this.getNode(t)))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce(((t,e)=>{const i=this.getMesh(e);return t.id=i.id,t.primitives=t.primitives.concat(i.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((t=>{const e=(t={...t}).attributes;t.attributes={};for(const i in e)t.attributes[i]=this.getAccessor(e[i]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t}))),t}_resolveMaterial(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var i,n;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(i=t.componentType,Bl[i]),t.components=(n=t.type,Cl[n]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:i,byteLength:n}=Ba(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset;let o=e.arrayBuffer.slice(r,r+n);t.bufferView.byteStride&&(o=this._getValueFromInterleavedBuffer(e,r,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new i(o)}return t}_getValueFromInterleavedBuffer(t,e,i,n,r){const o=new Uint8Array(r*n);for(let s=0;s<r;s++){const r=e+s*i;o.set(new Uint8Array(t.arrayBuffer.slice(r,r+n)),s*n)}return o.buffer}_resolveTexture(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.get
2Sampler(t.sampler):Dl,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-".concat(e),t.parameters={};for(const i in t){const e=this._enumSamplerParameter(i);void 0!==e&&(t.parameters[e]=t[i])}return t}_enumSamplerParameter(t){return Pl[t]}_resolveImage(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const i=this.images[e];return i&&(t.image=i),t}_resolveBufferView(t,e){const i=t.buffer,n={id:"bufferView-".concat(e),...t,buffer:this.buffers[i]},r=this.buffers[i].arrayBuffer;let o=this.buffers[i].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),n.data=new Uint8Array(r,o,t.byteLength),n}_resolveCamera(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}const Ol=1735152710,Fl=12,Rl=8,kl=1313821514,zl=5130562,Ul=0,Nl=1,Gl=0,Zl=!0;function jl(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=new DataView(e),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}(r,i+0),s=r.getUint32(i+4,Zl),a=r.getUint32(i+8,Zl);switch(Object.assign(t,{header:{byteOffset:i,byteLength:a,hasBinChunk:!1},type:o,version:s,json:{},binChunks:[]}),i+=Fl,t.version){case 1:return function(t,e,i){un(t.header.byteLength>Fl+Rl);const n=e.getUint32(i+0,Zl),r=e.getUint32(i+4,Zl);return i+=Rl,un(r===Gl),Vl(t,e,i,n),i+=n,i+=Hl(t,e,i,t.header.byteLength),i}(t,r,i);case 2:return function(t,e,i,n){return un(t.header.byteLength>Fl+Rl),function(t,e,i,n){for(;i+8<=t.header.byteLength;){const r=e.getUint32(i+0,Zl),o=e.getUint32(i+4,Zl);switch(i+=Rl,o){case kl:Vl(t,e,i,r);break;case zl:Hl(t,e,i,r);break;case Ul:n.strict||Vl(t,e,i,r);break;case Nl:n.strict||Hl(t,e,i,r)}i+=fa(r,4)}}(t,e,i,n),i+t.header.byteLength}(t,r,i,n={});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function Vl(t,e,i,n){const r=new Uint8Array(e.buffer,i,n),o=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(o),fa(n,4)}function Hl(t,e,i,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:i,byteLength:n,arrayBuffer:e.buffer}),fa(n,4)}async function Jl(t,e){let i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;var r,o,s,a;!function(t,e,i,n){n.uri&&(t.baseUri=n.uri);if(e instanceof ArrayBuffer&&!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new DataView(t),{magic:r=Ol}=i,o=n.getUint32(e,!1);return o===r||o===Ol}(e,i,n)){e=(new TextDecoder).decode(e)}if("string"===typeof e)t.json=ua(e);else if(e instanceof ArrayBuffer){const r={};i=jl(r,e,i,n.glb),da("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),t._glb=r,t.json=r.json}else da(!1,"GLTF: must be ArrayBuffer or string");const r=t.json.buffers||[];if(t.buffers=new Array(r.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new wl).normalize(t,e)}(t,{normalize:null===i||void 0===i||null===(r=i.gltf)||void 0===r?void 0:r.normalize}),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=yl.filter((t=>vl(t.name,e)));for(const o of n){var r;null===(r=o.preprocess)||void 0===r||r.call(o,t,e,i)}}(t,i,n);const l=[];if(null!==i&&void 0!==i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&await async function(t,e,i){const n=t.json.buffers||[];for(let s=0;s<n.length;++s){const a=n[s];if(a.uri){var r,o;const{fetch:n}=i;da(n);const l=pa(a.uri,e),c=await(null===i||void 0===i||null===(r=i.fetch)||void 0===r?void 0:r.call(i,l)),u=await(null===c||void 0===c||null===(o=c.arrayBuffer)||void 0===o?void 0:o.call(c));t.buffers[s]={arrayBuffer:u,byteOffset:0,byteLength:u.byteLength},delete a.uri}else null===t.buffers[s]&&(t.buffers[s]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}(t,i,n),null!==i&&void 0!==i&&null!==(s=i.gltf)&&void 0!==s&&s.loadImages){const e=async function(t,e,
2i){const n=function(t){const e=new Set,i=t.json.textures||[];for(const n of i)void 0!==n.source&&e.add(n.source);return Array.from(e).sort()}(t),r=t.json.images||[],o=[];for(const s of n)o.push(Wl(t,r[s],s,e,i));return await Promise.all(o)}(t,i,n);l.push(e)}const c=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=yl.filter((t=>vl(t.name,e)));for(const o of n){var r;await(null===(r=o.decode)||void 0===r?void 0:r.call(o,t,e,i))}}(t,i,n);return l.push(c),await Promise.all(l),null!==i&&void 0!==i&&null!==(a=i.gltf)&&void 0!==a&&a.postProcess?function(t,e){return(new Ll).postProcess(t,e)}(t,i):t}async function Wl(t,e,i,n,r){const{fetch:o,parse:s}=r;let a;if(e.uri&&!e.hasOwnProperty("bufferView")){const t=pa(e.uri,n),i=await o(t);a=await i.arrayBuffer()}if(Number.isFinite(e.bufferView)){const i=Aa(t.json,t.buffers,e.bufferView);a=ha(i.buffer,i.byteOffset,i.byteLength)}da(a,"glTF image has no data");let l=await s(a,[la,Us],{mimeType:e.mimeType,basis:n.basis||{format:ks()}},r);l&&l[0]&&(l={compressed:!0,mipmaps:!1,width:l[0].width,height:l[0].height,data:l[0]}),t.images=t.images||[],t.images[i]=l}const Ql={name:"glTF",id:"gltf",module:"gltf",version:"3.2.12",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;e={...Ql.options,...e},e.gltf={...Ql.options.gltf,...e.gltf};const{byteOffset:n=0}=e;return await Jl({},t,n,e,i)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}};const ql={URI:0,EMBEDDED:1};function Kl(t,e,i,n){t.rotateYtoZ=!0;const r=t.byteOffset+t.byteLength-i;if(0===r)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=ha(e,i,r),t.gltfByteOffset=0,t.gltfByteLength=r,i%4===0||console.warn("".concat(t.type,": embedded glb is not aligned to a 4-byte boundary.")),t.byteOffset+t.byteLength}async function Xl(t,e,i,n){const r=i["3d-tiles"]||{};if(function(t,e,i){switch(e){case ql.URI:const e=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),i=(new TextDecoder).decode(e);t.gltfUrl=i.replace(/[\s\0]+$/,""),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case ql.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}(t,e),r.loadGLTF){const{parse:e,fetch:r}=n;t.gltfUrl&&(t.gltfArrayBuffer=await r(t.gltfUrl,i),t.gltfByteOffset=0),t.gltfArrayBuffer&&(t.gltf=await e(t.gltfArrayBuffer,Ql,i,n),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength)}}async function Yl(t,e,i,n,r){var o;i=function(t,e,i,n,r){i=Zo(t,e,i),i=Ho(t,e,i),i=Jo(t,e,i),i=Kl(t,e,i,n);const o=new Mo(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=o.getGlobalProperty("RTC_CENTER",Co.FLOAT,3),i}(t,e,i,n),await Xl(t,ql.EMBEDDED,n,r);const s=null===t||void 0===t||null===(o=t.gltf)||void 0===o?void 0:o.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),i}async function $l(t,e,i,n,r){return i=function(t,e,i,n,r){if(i=Zo(t,e,i),1!==t.version)throw new Error("Instanced 3D Model version ".concat(t.version," is not supported"));i=Ho(t,e,i);const o=new DataView(e);if(t.gltfFormat=o.getUint32(i,!0),i+=4,i=Jo(t,e,i),i=Kl(t,e,i,n),0===t.featureTableJsonByteLength)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");const s=new Mo(t.featureTableJson,t.featureTableBinary),a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=s.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=s.getGlobalProperty("RTC_CENTER",Co.FLOAT,3);new No(t.batchTableJson,t.batchTableBinary,a);
2return function(t,e,i,n){const r={instances:new Array(n),batchTable:t._batchTable,cull:!1,url:void 0,gltf:void 0,basePath:void 0,incrementallyLoadTextures:!1,forwardAxis:[1,0,0]},o=r.instances,s=new it.Z,a=new it.Z,l=new it.Z,c=new it.Z,u=new mt,h=new _t.Z,d=new it.Z,p={},A=new N.Z,f=[],g=[],m=new it.Z,y=new it.Z;for(let v=0;v<n;v++){let i;if(e.hasProperty("POSITION"))i=e.getProperty("POSITION",Co.FLOAT,3,v,s);else if(e.hasProperty("POSITION_QUANTIZED")){i=e.getProperty("POSITION_QUANTIZED",Co.UNSIGNED_SHORT,3,v,s);const t=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Co.FLOAT,3,m);if(!t)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");const n=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Co.FLOAT,3,y);if(!n)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");const r=65535;for(let e=0;e<3;e++)i[e]=i[e]/r*n[e]+t[e]}if(!i)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");s.copy(i),p.translation=s,t.normalUp=e.getProperty("NORMAL_UP",Co.FLOAT,3,v,f),t.normalRight=e.getProperty("NORMAL_RIGHT",Co.FLOAT,3,v,g);const n=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",Co.UNSIGNED_SHORT,2,f),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",Co.UNSIGNED_SHORT,2,g),t.octNormalUp){if(!t.octNormalRight)throw new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");throw new Error("i3dm: oct-encoded orientation not implemented")}t.eastNorthUp?(cn.WGS84.eastNorthUpToFixedFrame(s,A),A.getRotationMatrix3(u)):u.identity()}n&&(c.copy(a).cross(l).normalize(),u.setColumn(0,a),u.setColumn(1,l),u.setColumn(2,c)),h.fromMatrix3(u),p.rotation=h,d.set(1,1,1);const r=e.getProperty("SCALE",Co.FLOAT,1,v);Number.isFinite(r)&&d.multiplyByScalar(r);const _=e.getProperty("SCALE_NON_UNIFORM",Co.FLOAT,3,v,f);_&&d.scale(_),p.scale=d;let b=e.getProperty("BATCH_ID",Co.UNSIGNED_SHORT,1,v);void 0===b&&(b=v);const x=(new N.Z).fromQuaternion(p.rotation);A.identity(),A.translate(p.translation),A.multiplyRight(x),A.scale(p.scale);const w=A.clone();o[v]={modelMatrix:w,batchId:b}}t.instances=o}(t,s,0,a),i}(t,e,i,n),await Xl(t,t.gltfFormat,n,r),i}async function tc(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};switch(r.byteOffset=e,r.type=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=new DataView(t);return"".concat(String.fromCharCode(i.getUint8(e+0))).concat(String.fromCharCode(i.getUint8(e+1))).concat(String.fromCharCode(i.getUint8(e+2))).concat(String.fromCharCode(i.getUint8(e+3)))}(t,e),r.type){case Cr.COMPOSITE:return await async function(t,e,i,n,r,o){i=Zo(t,e,i);const s=new DataView(e);for(t.tilesLength=s.getUint32(i,!0),i+=4,t.tiles=[];t.tiles.length<t.tilesLength&&t.byteLength-i>12;){const s={};t.tiles.push(s),i=await o(e,i,n,r,s)}return i}(r,t,e,i,n,tc);case Cr.BATCHED_3D_MODEL:return await Yl(r,t,e,i,n);case Cr.GLTF:return await async function(t,e,i,n){t.rotateYtoZ=!0,t.gltfUpAxis=i["3d-tiles"]&&i["3d-tiles"].assetGltfUpAxis?i["3d-tiles"].assetGltfUpAxis:"Y";const{parse:r}=n;t.gltf=await r(e,Ql,i,n)}(r,t,i,n);case Cr.INSTANCED_3D_MODEL:return await $l(r,t,e,i,n);case Cr.POINT_CLOUD:return await ns(r,t,e,i,n);default:throw new Error("3DTileLoader: unknown type ".concat(r.type))}}var ec=i(6386);async function ic(t,e,i){const n=t[e].bufferView,r=t.bufferViews[n],o=t.buffers[r.buffer];if(o.uri){const t=await(0,ec.d)(o.uri),e=await t.arrayBuffer();return new Uint8Array(e,r.byteOffset,r.byteLength)}return new Uint8Array(i,r.byteOffset,r.byteLength)}function nc(t){const e=new DataView(t);return e.getUint32(0,!0)+2**32*e.getUint32(4,!0)}const rc={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:wr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:async function(t){if(1952609651!==new Uint32Array(t.slice(0,4))[0])throw new Error("Wrong subtree file magic number");if(1!==new Uint32Array(t.slice(4,8))[0])throw new Error("Wrong subtree file verson, must be 1");const e=nc(t.slice(8,16)),i=new Uint8Array(t,24,e),n=new TextDecoder("utf8").decode(i),r=J
2SON.parse(n),o=nc(t.slice(16,24));let s=new ArrayBuffer(0);return o&&(s=t.slice(24+e)),"bufferView"in r.tileAvailability&&(r.tileAvailability.explicitBitstream=await ic(r,"tileAvailability",s)),"bufferView"in r.contentAvailability&&(r.contentAvailability.explicitBitstream=await ic(r,"contentAvailability",s)),"bufferView"in r.childSubtreeAvailability&&(r.childSubtreeAvailability.explicitBitstream=await ic(r,"childSubtreeAvailability",s)),r},options:{}},oc={QUADTREE:4,OCTREE:8};async function sc(t){const{options:e,parentData:i={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,globalData:r={level:0,mortonIndex:0,x:0,y:0,z:0}}=t;let{subtree:o,level:s=0}=t;const{subdivisionScheme:a,subtreeLevels:l,maximumLevel:c,contentUrlTemplate:u,subtreesUriTemplate:h,basePath:d}=e,p={children:[],lodMetricValue:0,contentUrl:""},A=oc[a],f=1&n,g=n>>1&1,m=n>>2&1,y=(A**s-1)/(A-1);let v=cc(i.mortonIndex,n),_=y+v,b=cc(i.x,f),x=cc(i.y,g),w=cc(i.z,m),C=!1;s+1>l&&(C=ac(o.childSubtreeAvailability,v));const B=cc(r.x,b),E=cc(r.y,x),S=cc(r.z,w),T=s+r.level;if(C){const t=uc("".concat(d,"/").concat(h),T,B,E,S);o=await(0,zi.z)(t,rc),r.mortonIndex=v,r.x=b,r.y=x,r.z=w,r.level=s,v=0,_=0,b=0,x=0,w=0,s=0}if(!ac(o.tileAvailability,_)||s>c)return p;ac(o.contentAvailability,_)&&(p.contentUrl=uc(u,T,B,E,S));const M=s+1,I={mortonIndex:v,x:b,y:x,z:w};for(let P=0;P<A;P++){const t=await sc({subtree:o,options:e,parentData:I,childIndex:P,level:M,globalData:r});if(t.contentUrl||t.children.length){const i=lc(t,T+1,{childTileX:b,childTileY:x,childTileZ:w},e);p.children.push(i)}}return p}function ac(t,e){return"constant"in t?Boolean(t.constant):!!t.explicitBitstream&&function(t,e){const i=Math.floor(t/8),n=t%8;return 1===(e[i]>>n&1)}(e,t.explicitBitstream)}function lc(t,e,i,n){const{basePath:r,refine:o,getRefine:s,lodMetricType:a,getTileType:l,rootLodMetricValue:c,rootBoundingVolume:u}=n,h=t.contentUrl&&t.contentUrl.replace("".concat(r,"/"),""),d=c/2**e,p=function(t,e,i){if(e.region){const{childTileX:n,childTileY:r,childTileZ:o}=i,[s,a,l,c,u,h]=e.region,d=2**t,p=(l-s)/d,A=(c-a)/d,f=(h-u)/d,[g,m]=[s+p*n,s+p*(n+1)],[y,v]=[a+A*r,a+A*(r+1)],[_,b]=[u+f*o,u+f*(o+1)];return{region:[g,y,m,v,_,b]}}return console.warn("Unsupported bounding volume type: ",e),null}(e,u,i);return{children:t.children,contentUrl:t.contentUrl,content:{uri:h},id:t.contentUrl,refine:s(o),type:l(t),lodMetricType:a,lodMetricValue:d,boundingVolume:p}}function cc(t,e){return parseInt(t.toString(2)+e.toString(2),2)}function uc(t,e,i,n,r){const o=function(t){const e={};for(const i in t)e["{".concat(i,"}")]=t[i];return e}({level:e,x:i,y:n,z:r});return t.replace(/{level}|{x}|{y}|{z}/gi,(t=>o[t]))}function hc(t){if(!t.contentUrl)return On.EMPTY;const e=t.contentUrl.split(".").pop();switch(e){case"pnts":return On.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return On.SCENEGRAPH;default:return e}}function dc(t){switch(t){case"REPLACE":case"replace":return Ln.REPLACE;case"ADD":case"add":return Ln.ADD;default:return t}}function pc(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){const i=new URL(t,"".concat(e,"/"));return decodeURI(i.toString())}return t.startsWith("/")?t:"".concat(e,"/").concat(t)}function Ac(t,e){if(!t)return null;if(t.content){const i=t.content.uri||t.content.url;t.contentUrl=pc(i,e.basePath)}return t.id=t.contentUrl,t.lodMetricType=Rn.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform,t.type=hc(t),t.refine=dc(t.refine),t}async function fc(t){if(!t.root)return null;const e=t.basePath,i=t.root.extensions["3DTILES_implicit_tiling"],{subdivisionScheme:n,maximumLevel:r,subtreeLevels:o,subtrees:{uri:s}}=i,a=pc(uc(s,0,0,0,0),e),l=await(0,zi.z)(a,rc),c=pc(t.root.content.uri,e),u=t.root.refine,h=t.root.geometricError,d=t.root.boundingVolume,p={contentUrlTemplate:c,subtreesUriTemplate:s,subdivisionScheme:n,subtreeLevels:o,maximumLevel:r,refine:u,basePath:e,lodMetricType:Rn.GEOMETRIC_ERROR,rootLodMetricValue:h,rootBoundingVolume:d,getTileType:hc,getRefine:dc};return await async function(t,e,i){if(!t)return null;t.lodMetricType=Rn.GEOMETRIC_ERROR,t.lodMetricValue=t.geometricError,t.transformMatrix=t.transform;const{children:n,contentUrl:r}=await sc({subtree:e,options:i});r&&(t.contentUrl=r,t.content={uri:r.replace("".concat(i.basePath,"/"),"")});
2return t.refine=dc(t.refine),t.type=hc(t),t.children=n,t.id=t.contentUrl,t}(t.root,l,p)}const gc="3DTILES_implicit_tiling",mc={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:wr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:async function(t,e,i){const n=e["3d-tiles"]||{};let r;r="auto"===n.isTileset?i.url&&-1!==i.url.indexOf(".json"):n.isTileset;t=r?await async function(t,e,i){var n;const r=JSON.parse((new TextDecoder).decode(t));return r.loader=e.loader||mc,r.url=i.url,r.basePath=function(t){return hn(t.url)}(r),r.root=function(t){var e,i;return(null===t||void 0===t||null===(e=t.extensionsRequired)||void 0===e?void 0:e.includes(gc))&&(null===t||void 0===t||null===(i=t.extensionsUsed)||void 0===i?void 0:i.includes(gc))}(r)?await fc(r):function(t){const e=t.basePath,i=Ac(t.root,t),n=[];for(n.push(i);n.length>0;){const t=(n.pop()||{}).children||[];for(const i of t)Ac(i,{basePath:e}),n.push(i)}return i}(r),r.type=Fn.TILES3D,r.lodMetricType=Rn.GEOMETRIC_ERROR,r.lodMetricValue=(null===(n=r.root)||void 0===n?void 0:n.lodMetricValue)||0,r}(t,e,i):await async function(t,e,i){const n={content:{featureIds:null}},r=0;return await tc(t,r,e,i,n.content),n.content}(t,e,i);return t},options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};const yc=[0],vc={getPointColor:{type:"accessor",value:[0,0,0,255]},pointSize:1,data:null,loader:mc,onTilesetLoad:{type:"function",value:t=>{},compare:!1},onTileLoad:{type:"function",value:t=>{},compare:!1},onTileUnload:{type:"function",value:t=>{},compare:!1},onTileError:{type:"function",value:(t,e,i)=>{},compare:!1},_getMeshColor:{type:"function",value:t=>[255,255,255],compare:!1}};class _c extends p.Z{constructor(){super(...arguments),(0,u.Z)(this,"state",void 0)}initializeState(){"onTileLoadFail"in this.props&&z.Z.removed("onTileLoadFail","onTileError")(),this.state={layerMap:{},tileset3d:null,activeViewports:{},lastUpdatedViewports:null}}get isLoaded(){const{tileset3d:t}=this.state;return null!==t&&t.isLoaded()}shouldUpdateState(t){let{changeFlags:e}=t;return e.somethingChanged}updateState(t){let{props:e,oldProps:i,changeFlags:n}=t;if(e.data&&e.data!==i.data&&this._loadTileset(e.data),n.viewportChanged){const{activeViewports:t}=this.state;Object.keys(t).length&&(this._updateTileset(t),this.state.lastUpdatedViewports=t,this.state.activeViewports={})}if(n.propsChanged){const{layerMap:t}=this.state;for(const e in t)t[e].needsUpdate=!0}}activateViewport(t){const{activeViewports:e,lastUpdatedViewports:i}=this.state;this.internalState.viewport=t,e[t.id]=t;const n=null===i||void 0===i?void 0:i[t.id];n&&t.equals(n)||(this.setChangeFlags({viewportChanged:!0}),this.setNeedsUpdate())}getPickingInfo(t){let{info:e,sourceLayer:i}=t;const{layerMap:n}=this.state,r=i&&i.id;if(r){const t=r.substring(this.id.length+1),i=t.substring(t.indexOf("-")+1);e.object=n[i]&&n[i].tile}return e}filterSubLayer(t){let{layer:e,viewport:i}=t;const{tile:n}=e.props,{id:r}=i;return n.selected&&n.viewportIds.includes(r)}_updateAutoHighlight(t){t.sourceLayer&&t.sourceLayer.updateAutoHighlight(t)}async _loadTileset(t){const{loadOptions:e={}}=this.props;let i=this.props.loader||this.props.loaders;Array.isArray(i)&&(i=i[0]);const n={loadOptions:{...e}};if(i.preload){const r=await i.preload(t,e);r.headers&&(n.loadOptions.fetch={...n.loadOptions.fetch,headers:r.headers}),Object.assign(n,r)}const r=await(0,zi.z)(t,i,n.loadOptions),o=new xr(r,{onTileLoad:this._onTileLoad.bind(this),onTileUnload:this._onTileUnload.bind(this),onTileError:this.props.onTileError,...n});this.setState({tileset3d:o,layerMap:{}}),this._updateTileset(this.state.activeViewports),this.props.onTilesetLoad(o)}_onTileLoad(t){const{lastUpdatedViewports:e}=this.state;this.props.onTileLoad(t),this._updateTileset(e),this.setNeedsUpdate()}_onTileUnload(t){delete this.state.layerMap[t.id],this.props.onTileUnload(t)}_updateTileset(t){if(!t)return;const{tileset3d:e}=this.state,{timeline:i}=this.context,n=Object.keys(t).length;i&&n&&e&&e.selectTiles(Object.values(t)).then((t=>{this.state.frameNumber!==t&&this.setState({frameNumber:t})}))}_getSubLayer(t,e){if(!t.content)return null;switch(t.type){case On.POINTCLOUD:return this._makePointCloudLayer(t,e);case On.SCENEGRAPH:return this._make3DModelLayer(t);case On.MESH:return this._makeSimpleMeshLayer(t,e);default:throw new Error("Tile3DLayer: Failed to render layer of type ".concat(t.content.type))}}_makePointCloudLayer(t,e){const{attributes:i,pointCount:n,constantRGBA:r,cartographicOrigin:o,modelMatrix:s}=t.content,{positions:a,normals:l,colors:c}=i;if(!a)return null;const u=e&&e.props.data||{header:{vertexCount:n},attributes:{POSITION:a,NORMAL:l,COLOR_0:c}
2},{pointSize:h,getPointColor:d}=this.props;return new(this.getSubLayerClass("pointcloud",Pi.Z))({pointSize:h},this.getSubLayerProps({id:"pointcloud"}),{id:"".concat(this.id,"-pointcloud-").concat(t.id),tile:t,data:u,coordinateSystem:Z.Df.METER_OFFSETS,coordinateOrigin:o,modelMatrix:s,getColor:r||d,_offset:0})}_make3DModelLayer(t){const{gltf:e,instances:i,cartographicOrigin:n,modelMatrix:r}=t.content;return new(this.getSubLayerClass("scenegraph",Di.Z))({_lighting:"pbr"},this.getSubLayerProps({id:"scenegraph"}),{id:"".concat(this.id,"-scenegraph-").concat(t.id),tile:t,data:i||yc,scenegraph:e,coordinateSystem:Z.Df.METER_OFFSETS,coordinateOrigin:n,modelMatrix:r,getTransformMatrix:t=>t.modelMatrix,getPosition:[0,0,0],_offset:0})}_makeSimpleMeshLayer(t,e){const i=t.content,{attributes:n,indices:r,modelMatrix:o,cartographicOrigin:s,coordinateSystem:a=Z.Df.METER_OFFSETS,material:l,featureIds:c}=i,{_getMeshColor:u}=this.props,h=e&&e.props.mesh||new Ii.Z({drawMode:4,attributes:bc(n),indices:r});return new(this.getSubLayerClass("mesh",ki))(this.getSubLayerProps({id:"mesh"}),{id:"".concat(this.id,"-mesh-").concat(t.id),tile:t,mesh:h,data:yc,getColor:u(t),pbrMaterial:l,modelMatrix:o,coordinateOrigin:s,coordinateSystem:a,featureIds:c,_offset:0})}renderLayers(){const{tileset3d:t,layerMap:e}=this.state;return t?t.tiles.map((t=>{const i=e[t.id]=e[t.id]||{tile:t};let{layer:n}=i;return t.selected&&(n?i.needsUpdate&&(n=this._getSubLayer(t,n),i.needsUpdate=!1):n=this._getSubLayer(t)),i.layer=n,n})).filter(Boolean):null}}function bc(t){const e={};return e.positions={...t.positions,value:new Float32Array(t.positions.value)},t.normals&&(e.normals=t.normals),t.texCoords&&(e.texCoords=t.texCoords),t.colors&&(e.colors=t.colors),t.uvRegions&&(e.uvRegions=t.uvRegions),e}(0,u.Z)(_c,"defaultProps",vc),(0,u.Z)(_c,"layerName","Tile3DLayer");const xc={name:"Terrain",id:"terrain",module:"terrain",version:"3.2.12",worker:!0,extensions:["png","pngraw","jpg","jpeg","gif","webp","bmp"],mimeTypes:["image/png","image/jpeg","image/gif","image/webp","image/bmp"],options:{terrain:{tesselator:"auto",bounds:null,meshMaxError:10,elevationDecoder:{rScaler:1,gScaler:0,bScaler:0,offset:0},skirtHeight:null}}},wc=[1],Cc={...Ne.defaultProps,elevationData:ve,texture:{...ve,optional:!0},meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:{type:"string",value:null},wireframe:!1,material:!0,loaders:[xc]};function Bc(t){return Array.isArray(t)?t.join(";"):t||""}class Ec extends p.Z{constructor(){super(...arguments),(0,u.Z)(this,"state",void 0)}updateState(t){let{props:e,oldProps:i}=t;const n=e.elevationData!==i.elevationData;if(n){const{elevationData:t}=e,i=t&&(Array.isArray(t)||t.includes("{x}")&&t.includes("{y}"));this.setState({isTiled:i})}const r=n||e.meshMaxError!==i.meshMaxError||e.elevationDecoder!==i.elevationDecoder||e.bounds!==i.bounds;if(!this.state.isTiled&&r){const t=this.loadTerrain(e);this.setState({terrain:t})}e.workerUrl&&z.Z.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain(t){let{elevationData:e,bounds:i,elevationDecoder:n,meshMaxError:r,signal:o}=t;var s;if(!e)return null;let a=this.getLoadOptions();a={...a,terrain:{skirtHeight:this.state.isTiled?2*r:0,...null===(s=a)||void 0===s?void 0:s.terrain,bounds:i,meshMaxError:r,elevationDecoder:n}};const{fetch:l}=this.props;return l(e,{propName:"elevationData",layer:this,loadOptions:a,signal:o})}getTiledTerrainData(t){const{elevationData:e,fetch:i,texture:n,elevationDecoder:r,meshMaxError:o}=this.props,{viewport:s}=this.context,a=be(e,t),l=n&&be(n,t),{signal:c}=t;let u=[0,0],h=[0,0];if(s.isGeospatial){const e=t.bbox;u=s.projectFlat([e.west,e.south]),h=s.projectFlat([e.east,e.north])}else{const e=t.bbox;u=[e.left,e.bottom],h=[e.right,e.top]}const d=[u[0],u[1],h[0],h[1]],p=this.loadTerrain({elevationData:a,bounds:d,elevationDecoder:r,meshMaxError:o,signal:c}),A=l?i(l,{propName:"texture",layer:this,loaders:[],signal:c}).catch((t=>null)):Promise.resolve(null);return Promise.all([p,A])}renderSubLayers(t){const e=this.getSubLayerClass("mesh",Ri.Z),{color:i,wireframe:n,material:r}=this.props,{data:o}=t;if(!o)return null;const[s,a]=o;return new e(t,{data:wc,mesh:s,texture:a,_instanced:!1,coordinateSystem:Z.Df.CARTESIAN,getPosition:t=>[0,0,0],getColor:i,wireframe:n,material:r})}onViewportLoad(t){if(!t)return;const{zRange:e}=this.state,i=t.map((t=>
2t.content)).filter(Boolean).map((t=>t[0].header.boundingBox.map((t=>t[2]))));if(0===i.length)return;const n=Math.min(...i.map((t=>t[0]))),r=Math.max(...i.map((t=>t[1])));(!e||n<e[0]||r>e[1])&&this.setState({zRange:[n,r]})}renderLayers(){const{color:t,material:e,elevationData:i,texture:n,wireframe:r,meshMaxError:o,elevationDecoder:s,tileSize:a,maxZoom:l,minZoom:c,extent:u,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:A,maxCacheSize:f,maxCacheByteSize:g,refinementStrategy:m}=this.props;if(this.state.isTiled)return new Ne(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:Bc(i),texture:Bc(n),meshMaxError:o,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:a,maxZoom:l,minZoom:c,extent:u,maxRequests:h,onTileLoad:d,onTileUnload:p,onTileError:A,maxCacheSize:f,maxCacheByteSize:g,refinementStrategy:m});return new(this.getSubLayerClass("mesh",Ri.Z))(this.getSubLayerProps({id:"mesh"}),{data:wc,mesh:this.state.terrain,texture:n,_instanced:!1,getPosition:t=>[0,0,0],getColor:t,material:e,wireframe:r})}}(0,u.Z)(Ec,"defaultProps",Cc),(0,u.Z)(Ec,"layerName","TerrainLayer");var Sc=i(23595);function Tc(t,e,i){const n=Mc(t),r=Object.keys(n).filter((t=>n[t]!==Array));return function(t,e,i){const{pointPositionsCount:n,pointFeaturesCount:r,linePositionsCount:o,linePathsCount:s,lineFeaturesCount:a,polygonPositionsCount:l,polygonObjectsCount:c,polygonRingsCount:u,polygonFeaturesCount:h,propArrayTypes:d,coordLength:p}=e,{numericPropKeys:A=[],PositionDataType:f=Float32Array}=i,g=t[0]&&"id"in t[0],m=t.length>65535?Uint32Array:Uint16Array,y={type:"Point",positions:new f(n*p),globalFeatureIds:new m(n),featureIds:r>65535?new Uint32Array(n):new Uint16Array(n),numericProps:{},properties:[],fields:[]},v={type:"LineString",pathIndices:o>65535?new Uint32Array(s+1):new Uint16Array(s+1),positions:new f(o*p),globalFeatureIds:new m(o),featureIds:a>65535?new Uint32Array(o):new Uint16Array(o),numericProps:{},properties:[],fields:[]},_={type:"Polygon",polygonIndices:l>65535?new Uint32Array(c+1):new Uint16Array(c+1),primitivePolygonIndices:l>65535?new Uint32Array(u+1):new Uint16Array(u+1),positions:new f(l*p),triangles:[],globalFeatureIds:new m(l),featureIds:h>65535?new Uint32Array(l):new Uint16Array(l),numericProps:{},properties:[],fields:[]};for(const x of[y,v,_])for(const t of A){const e=d[t];x.numericProps[t]=new e(x.positions.length/p)}v.pathIndices[s]=o,_.polygonIndices[c]=l,_.primitivePolygonIndices[u]=l;const b={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(const x of t){const t=x.geometry,e=x.properties||{};switch(t.type){case"Point":Ic(t,y,b,p,e),y.properties.push(Rc(e,A)),g&&y.fields.push({id:x.id}),b.pointFeature++;break;case"LineString":Pc(t,v,b,p,e),v.properties.push(Rc(e,A)),g&&v.fields.push({id:x.id}),b.lineFeature++;break;case"Polygon":Dc(t,_,b,p,e),_.properties.push(Rc(e,A)),g&&_.fields.push({id:x.id}),b.polygonFeature++;break;default:throw new Error("Invalid geometry type")}b.feature++}return function(t,e,i,n){return{points:{...t,positions:{value:t.positions,size:n},globalFeatureIds:{value:t.globalFeatureIds,size:1},featureIds:{value:t.featureIds,size:1},numericProps:Oc(t.numericProps,1)},lines:{...e,positions:{value:e.positions,size:n},pathIndices:{value:e.pathIndices,size:1},globalFeatureIds:{value:e.globalFeatureIds,size:1},featureIds:{value:e.featureIds,size:1},numericProps:Oc(e.numericProps,1)},polygons:{...i,positions:{value:i.positions,size:n},polygonIndices:{value:i.polygonIndices,size:1},primitivePolygonIndices:{value:i.primitivePolygonIndices,size:1},triangles:{value:new Uint32Array(i.triangles),size:1},globalFeatureIds:{value:i.globalFeatureIds,size:1},featureIds:{value:i.featureIds,size:1},numericProps:Oc(i.numericProps,1)}}}(y,v,_,p)}(t,{propArrayTypes:n,...e},{numericPropKeys:i&&i.numericPropKeys||r,PositionDataType:i?i.PositionDataType:Float32Array})}function Mc(t){const e={};for(const i of t)if(i.properties)for(const t in i.properties){const n=i.properties[t];e[t]=kc(n,e[t])}return e}function Ic(t,e,i,n,r){e.positions.set(t.data,i.pointPosition*n);const o=t.data.length/n;Fc(e,r,i.pointPosition,o),e.globalFeatureIds.fill(i.feature,i.pointPosition,i.pointPosition+o),e.featureIds.fill(i.pointFeature,i.pointPosition,i.pointPosition+o),i.pointPosition+=o}function Pc(t,e,i,n,r){e.positions.set(t.data,i.linePosition*n);const o=t.data.length/n;Fc(e,r,i.linePosition,o),e.globalFeatureIds.fill(i.feature,i.linePosition,i.linePosition+o),e.featureIds.fill(i.lineFeature,i.linePosition,i.linePosition+o);for(let s=0,a=t.indices.length;s<a;++s){const r=t.indices[s],o=s===a-1?t.data.length:t.indices[s+1];e.pathIndices[i.linePath++]=i.linePosition,i.linePosition+=(o-r)/n}}function Dc(t,e,i,n,r){e.positions.set(t.data,i.polygonPosition*n);const o=t.data.length/n;Fc(e,r,i.polygonPosition,o),e.globalFeatureIds.fill(i.feature,i.polygonPosition,i.polygonPosition+o),e.featureIds.fill(i.polygonFeature,i.polygonPosition,i.polygonPosition+o);for(let s=0,a=t.indices.length;s<a;++s){const r=i.polygonPosition;e.polygonIndices[i.polygonObject++]=r;const o=t.areas[s],a=t.indices[s],l=t.indices[s+1];for(let s=0,c=a.length;s<c;++s){const r=a[s],o=s===c-1?void 0===l?t.data.length:l[0]:a[s+1];e.primitivePolygonIndices[i.polygonRing++]=i.polygonPosition,i.polygonPosition+=(o-r)/n}Lc(e,o,a,{startPosition:r,endPosition:i.polygonPosition,coordLength:n})}}function Lc(t,e,i,n){let{startPosition:r,endPosition:o,coordLength:s}=n;const a=r*s,l=o*s,c=t.positions.subarray(a,l),u=i[0],h=i.slice(1).map((t=>(t-u)/s)),d=(0,Sc.OT)(c,h,s,e);for(let p=0,A=d.length;p<A;
2++p)t.triangles.push(r+d[p])}function Oc(t,e){const i={};for(const n in t)i[n]={value:t[n],size:e};return i}function Fc(t,e,i,n){for(const r in t.numericProps)if(r in e){const o=e[r];t.numericProps[r].fill(o,i,i+n)}}function Rc(t,e){const i={};for(const n in t)e.includes(n)||(i[n]=t[n]);return i}function kc(t,e){return e!==Array&&Number.isFinite(t)?e===Float64Array||Math.fround(t)!==t?Float64Array:Float32Array:Array}var zc=i(32408),Uc=i.n(zc);function Nc(t){let e=0;for(let i,n,r=0,o=t.length-1;r<t.length;o=r++)i=t[r],n=t[o],e+=(n[0]-i[0])*(i[1]+n[1]);return e}function Gc(t,e,i){e&&i&&(1===t?e.id=i.readVarint():2===t?function(t,e){const i=t.readVarint()+t.pos;for(;t.pos<i;){const i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}(i,e):3===t?e.type=i.readVarint():4===t&&(e._geometry=i.pos))}class Zc{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(t,e,i,n,r){(0,u.Z)(this,"properties",void 0),(0,u.Z)(this,"extent",void 0),(0,u.Z)(this,"type",void 0),(0,u.Z)(this,"id",void 0),(0,u.Z)(this,"_pbf",void 0),(0,u.Z)(this,"_geometry",void 0),(0,u.Z)(this,"_keys",void 0),(0,u.Z)(this,"_values",void 0),this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=n,this._values=r,t.readFields(Gc,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let i=1,n=0,r=0,o=0;const s=[];let a;for(;t.pos<e;){if(n<=0){const e=t.readVarint();i=7&e,n=e>>3}if(n--,1===i||2===i)r+=t.readSVarint(),o+=t.readSVarint(),1===i&&(a&&s.push(a),a=[]),a&&a.push([r,o]);else{if(7!==i)throw new Error("unknown command ".concat(i));a&&a.push(a[0].slice())}}return a&&s.push(a),s}bbox(){const t=this._pbf;t.pos=this._geometry;const e=t.readVarint()+t.pos;let i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;for(;t.pos<e;){if(n<=0){const e=t.readVarint();i=7&e,n=e>>3}if(n--,1===i||2===i)r+=t.readSVarint(),o+=t.readSVarint(),r<s&&(s=r),r>a&&(a=r),o<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error("unknown command ".concat(i))}return[s,l,a,c]}_toGeoJSON(t){let e,i,n=this.loadGeometry(),r=Zc.types[this.type];switch(this.type){case 1:const r=[];for(e=0;e<n.length;e++)r[e]=n[e][0];n=r,t(n,this);break;case 2:for(e=0;e<n.length;e++)t(n[e],this);break;case 3:for(n=function(t){const e=t.length;if(e<=1)return[t];const i=[];let n,r;for(let o=0;o<e;o++){const e=Nc(t[o]);0!==e&&(void 0===r&&(r=e<0),r===e<0?(n&&i.push(n),n=[t[o]]):n&&n.push(t[o]))}return n&&i.push(n),i}(n),e=0;e<n.length;e++)for(i=0;i<n[e].length;i++)t(n[e][i],this)}1===n.length?n=n[0]:r="Multi".concat(r);const o={type:"Feature",geometry:{type:r,coordinates:n},properties:this.properties};return null!==this.id&&(o.id=this.id),o}toGeoJSON(t){if("function"===typeof t)return this._toGeoJSON(t);const{x:e,y:i,z:n}=t,r=this.extent*Math.pow(2,n),o=this.extent*e,s=this.extent*i;return this._toGeoJSON((function(t){for(let e=0;e<t.length;e++){const i=t[e];i[0]=360*(i[0]+o)/r-180;const n=180-360*(i[1]+s)/r;i[1]=360/Math.PI*Math.atan(Math.exp(n*Math.PI/180))-90}}))}}class jc{constructor(t,e){(0,u.Z)(this,"version",void 0),(0,u.Z)(this,"name",void 0),(0,u.Z)(this,"extent",void 0),(0,u.Z)(this,"length",void 0),(0,u.Z)(this,"_pbf",void 0),(0,u.Z)(this,"_keys",void 0),(0,u.Z)(this,"_values",void 0),(0,u.Z)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Vc,this,e),this.length=this._features.length}feature(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const e=this._pbf.readVarint()+this._pbf.pos;return new Zc(this._pbf,e,this.extent,this._keys,this._values)}}function Vc(t,e,i){e&&i&&(15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){let e=null;const i=t.readVarint()+t.pos;for(;t.pos<i;){const i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(i)))}class Hc{constructor(t,e){(0,u.Z)(this,"layers",void 0),this.layers=t.readFields(Jc,{},e)}}
2function Jc(t,e,i){if(3===t&&i){const t=new jc(i,i.readVarint()+i.pos);t.length&&e&&(e[t.name]=t)}}function Wc(t){const e=t.indices.length,i="Polygon";if(e<=1)return{type:i,data:t.data,areas:[[(0,Sc.ap)(t.data)]],indices:[t.indices]};const n=[],r=[];let o,s=[],a=[],l=0;for(let c,u,h=0;h<e;h++){u=t.indices[h]-l,c=t.indices[h+1]-l||t.data.length;const e=t.data.slice(u,c),i=(0,Sc.ap)(e);if(0!==i)void 0===o&&(o=i<0),o===i<0?(a.length&&(n.push(s),r.push(a)),a=[u],s=[i]):(s.push(i),a.push(u));else{const e=t.data.slice(0,u),i=t.data.slice(c);t.data=e.concat(i),l+=c-u}}return s&&n.push(s),a.length&&r.push(a),{type:i,areas:n,indices:r,data:t.data}}function Qc(t,e,i){e&&i&&(1===t?e.id=i.readVarint():2===t?function(t,e){const i=t.readVarint()+t.pos;for(;t.pos<i;){const i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}(i,e):3===t?e.type=i.readVarint():4===t&&(e._geometry=i.pos))}let qc,Kc,Xc,Yc,$c,tu,eu;class iu{constructor(t,e,i,n,r,o){(0,u.Z)(this,"properties",void 0),(0,u.Z)(this,"extent",void 0),(0,u.Z)(this,"type",void 0),(0,u.Z)(this,"id",void 0),(0,u.Z)(this,"_pbf",void 0),(0,u.Z)(this,"_geometry",void 0),(0,u.Z)(this,"_keys",void 0),(0,u.Z)(this,"_values",void 0),(0,u.Z)(this,"_geometryInfo",void 0),this.properties={},this.extent=i,this.type=0,this.id=null,this._pbf=t,this._geometry=-1,this._keys=n,this._values=r,this._geometryInfo=o,t.readFields(Qc,this,e)}loadGeometry(){const t=this._pbf;t.pos=this._geometry,qc=t.readVarint()+t.pos,Kc=1,Yc=0,$c=0,tu=0,eu=0;const e=[],i=[];for(;t.pos<qc;)if(Yc<=0&&(Xc=t.readVarint(),Kc=7&Xc,Yc=Xc>>3),Yc--,1===Kc||2===Kc)$c+=t.readSVarint(),tu+=t.readSVarint(),1===Kc&&e.push(eu),i.push($c,tu),eu+=2;else{if(7!==Kc)throw new Error("unknown command ".concat(Kc));if(eu>0){const t=e[e.length-1];i.push(i[t],i[t+1]),eu+=2}}return{data:i,indices:e}}_toBinaryCoordinates(t){const e=this.loadGeometry();let i;t(e.data,this);switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=e.indices.length,i={type:"Point",...e};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=e.indices.length,this._geometryInfo.linePositionsCount+=e.data.length/2,i={type:"LineString",...e};break;case 3:i=Wc(e),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=i.indices.length;for(const t of i.indices)this._geometryInfo.polygonRingsCount+=t.length;this._geometryInfo.polygonPositionsCount+=i.data.length/2;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}const n={type:"Feature",geometry:i,properties:this.properties};return null!==this.id&&(n.id=this.id),n}toBinaryCoordinates(t){if("function"===typeof t)return this._toBinaryCoordinates(t);const{x:e,y:i,z:n}=t,r=this.extent*Math.pow(2,n),o=this.extent*e,s=this.extent*i;return this._toBinaryCoordinates((t=>function(t,e,i,n){for(let r=0,o=t.length;r<o;r+=2){t[r]=360*(t[r]+e)/n-180;const o=180-360*(t[r+1]+i)/n;t[r+1]=360/Math.PI*Math.atan(Math.exp(o*Math.PI/180))-90}}(t,o,s,r)))}}class nu{constructor(t,e){(0,u.Z)(this,"version",void 0),(0,u.Z)(this,"name",void 0),(0,u.Z)(this,"extent",void 0),(0,u.Z)(this,"length",void 0),(0,u.Z)(this,"_pbf",void 0),(0,u.Z)(this,"_keys",void 0),(0,u.Z)(this,"_values",void 0),(0,u.Z)(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ru,this,e),this.length=this._features.length}feature(t,e){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];const i=this._pbf.readVarint()+this._pbf.pos;return new iu(this._pbf,i,this.extent,this._keys,this._values,e)}}function ru(t,e,i){e&&i&&(15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){let e=null;const i=t.readVarint()+t.pos;for(;t.pos<i;){const i=t.readVarint()>>3;e=1===i?t.readString():2===i?t.readFloat():3===i?t.readDouble():4===i?t.readVarint64():5===i?t.readVarint():6===i?t.readSVarint():7===i?t.readBoolean():null}return e}(i)))}class ou{constructor(t,e){(0,u.Z)(this,"layers",void 0),this.layers=t.readFields(su,{},e)}}function su(t,e,i){if(3===t&&i){const t=new nu(i,i.readVarint()+i.pos);t.length&&e&&(e[t.name]=t)}}function au(t,e){var i,n;const r=function(t){var e;if(null===t||void 0===t||!t.mvt)throw new Error("mvt options required");const i="wgs84"===(null===(e=t.mvt)||void 0===e?void 0:e.coordinates),{tileIndex:n}=t.mvt,r=n&&Number.isFinite(n.x)&&Number.isFinite(n.y)&&Number.isFinite(n.z);
2if(i&&!r)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return t.mvt}(e),o=(null===e||void 0===e||null===(i=e.gis)||void 0===i?void 0:i.format)||(null===e||void 0===e||null===(n=e.mvt)||void 0===n?void 0:n.shape);switch(o){case"columnar-table":return{shape:"columnar-table",data:lu(t,r)};case"geojson-row-table":return{shape:"geojson-row-table",data:cu(t,r)};case"geojson":return cu(t,r);case"binary-geometry":case"binary":return lu(t,r);default:throw new Error(o)}}function lu(t,e){const[i,n]=function(t,e){const i=[],n={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(t.byteLength<=0)return[i,n];const r=new ou(new(Uc())(t)),o=e&&Array.isArray(e.layers)?e.layers:Object.keys(r.layers);return o.forEach((t=>{const o=r.layers[t];if(o)for(let r=0;r<o.length;r++){const s=hu(o.feature(r,n),e,t);i.push(s)}})),[i,n]}(t,e),r=Tc(i,n);return r.byteLength=t.byteLength,r}function cu(t,e){if(t.byteLength<=0)return[];const i=[],n=new Hc(new(Uc())(t));return(Array.isArray(e.layers)?e.layers:Object.keys(n.layers)).forEach((t=>{const r=n.layers[t];if(r)for(let n=0;n<r.length;n++){const o=uu(r.feature(n),e,t);i.push(o)}})),i}function uu(t,e,i){const n=t.toGeoJSON("wgs84"===e.coordinates?e.tileIndex:du);return e.layerProperty&&(n.properties[e.layerProperty]=i),n}function hu(t,e,i){const n=t.toBinaryCoordinates("wgs84"===e.coordinates?e.tileIndex:pu);return e.layerProperty&&n.properties&&(n.properties[e.layerProperty]=i),n}function du(t,e){const{extent:i}=e;for(let n=0;n<t.length;n++){const e=t[n];e[0]/=i,e[1]/=i}}function pu(t,e){const{extent:i}=e;for(let n=0,r=t.length;n<r;++n)t[n]/=i}const Au={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:"3.2.12",extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:{mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}}};function fu(t,e){const i=null===e||void 0===e?void 0:e.globalFeatureId;return void 0!==i?function(t,e){const i=yu(t);for(const n of i){let t=0,i=n.featureIds.value[0];for(let r=0;r<n.featureIds.value.length;r++){const o=n.featureIds.value[r];if(o!==i){if(e===n.globalFeatureIds.value[t])return vu(n,t,r);t=r,i=o}}if(e===n.globalFeatureIds.value[t])return vu(n,t,n.featureIds.value.length)}throw new Error("featureId:".concat(e," not found"))}(t,i):gu(t,null===e||void 0===e?void 0:e.type)}function gu(t,e){return function(t){const e=[];for(const i of t){if(0===i.featureIds.value.length)continue;let t=0,n=i.featureIds.value[0];for(let r=0;r<i.featureIds.value.length;r++){const o=i.featureIds.value[r];o!==n&&(e.push(vu(i,t,r)),t=r,n=o)}e.push(vu(i,t,i.featureIds.value.length))}return e}(yu(t,e))}function mu(t,e,i){switch(t.type){case"Point":return function(t,e,i){const{positions:n}=t,r=bu(n,e,i);if(r.length>1)return{type:"MultiPoint",coordinates:r};return{type:"Point",coordinates:r[0]}}(t,e,i);case"LineString":return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;const{positions:n}=t,r=t.pathIndices.value.filter((t=>t>=e&&t<=i));if(!(r.length>2)){return{type:"LineString",coordinates:bu(n,r[0],r[1])}}const o=[];for(let s=0;s<r.length-1;s++){const t=bu(n,r[s],r[s+1]);o.push(t)}return{type:"MultiLineString",coordinates:o}}(t,e,i);case"Polygon":return _u(t,e,i);default:throw new Error("Unsupported geometry type: ".concat(null===t||void 0===t?void 0:t.type))}}function yu(t,e){if(!Boolean(t.points||t.lines||t.polygons))return t.type=e||function(t){if(t.pathIndices)return"LineString";if(t.polygonIndices)return"Polygon";return"Point"}(t),[t];const i=[];return t.points&&(t.points.type="Point",i.push(t.points)),t.lines&&(t.lines.type="LineString",i.push(t.lines)),t.polygons&&(t.polygons.type="Polygon",i.push(t.polygons)),i}function vu(t,e,i){const n=mu(t,e,i),r=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=Object.assign({},t.properties[t.featureIds.value[e]]);for(const n in t.numericProps)i[n]=t.numericProps[n].value[e];return i}(t,e,i),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.fields&&t.fields[t.featureIds.value[e]]}(t,e,i);return{type:"Feature",geometry:n,properties:r,...o}}function _u(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1/0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;const{positions:n}=t,r=t.polygonIndices.value.filter((t=>t>=e&&t<=i)),o=t.primitivePolygonIndices.value.filter((t=>t>=e&&t<=i));if(!(r.length>2)){const t=[];for(let e=0;e<o.length-1;e++){const i=bu(n,o[e],o[e+1]);t.push(i)}return{type:"Polygon",coordinates:t}}const s=[];for(let a=0;a<r.length-1;a++){const e=_u(t,r[a],r[a+1]).coordinates;s.push(e)}return{type:"MultiPolygon",coordinates:s}}function bu(t,e,i){e=e||0,i=i||t.value.length/t.size;const n=[];for(let r=e;r<i;r++){const e=Array();for(let i=r*t.size;i<(r+1)*t.size;i++)e.push(Number(t.value[i]));n.push(e)}return n}var xu=i(98949);class wu{constructor(t){(0,u.Z)(this,"opts",void 0),t&&(this.opts=t)}equals(t){return this===t||this.constructor===t.constructor&&(0,xu.v)(this.opts,t.opts)}getShaders(t){return null}getSubLayerProps(t){const{defaultProps:e}=t.constructor,i={updateTriggers:{}};
2for(const n in e)if(n in this.props){const t=e[n],r=this.props[n];i[n]=r,t&&"accessor"===t.type&&(i.updateTriggers[n]=this.props.updateTriggers[n],"function"===typeof r&&(i[n]=this.getSubLayerAccessor(r)))}return i}initializeState(t,e){}updateState(t,e){}draw(t,e){}finalizeState(t,e){}}(0,u.Z)(wu,"defaultProps",{});const Cu={clipBounds:[0,0,1,1]},Bu="\nuniform vec4 clip_bounds;\n\nbool clip_isInBounds(vec2 position) {\n  return position.x >= clip_bounds[0] && position.y >= clip_bounds[1] && position.x < clip_bounds[2] && position.y < clip_bounds[3];\n}\n",Eu={name:"clip-vs",vs:Bu},Su={"vs:#decl":"\nvarying float clip_isVisible;\n","vs:DECKGL_FILTER_GL_POSITION":"\n  clip_isVisible = float(clip_isInBounds(geometry.worldPosition.xy));\n","fs:#decl":"\nvarying float clip_isVisible;\n","fs:DECKGL_FILTER_COLOR":"\n  if (clip_isVisible < 0.5) discard;\n"},Tu={name:"clip-fs",fs:Bu},Mu={"vs:#decl":"\nvarying vec2 clip_commonPosition;\n","vs:DECKGL_FILTER_GL_POSITION":"\n  clip_commonPosition = geometry.position.xy;\n","fs:#decl":"\nvarying vec2 clip_commonPosition;\n","fs:DECKGL_FILTER_COLOR":"\n  if (!clip_isInBounds(clip_commonPosition)) discard;\n"};class Iu extends wu{getShaders(){let t="instancePositions"in this.getAttributeManager().attributes;return"clipByInstance"in this.props&&(t=this.props.clipByInstance),this.state.clipByInstance=t,t?{modules:[Eu],inject:Su}:{modules:[Tu],inject:Mu}}draw(t){let{uniforms:e}=t;const{clipBounds:i=Cu.clipBounds}=this.props;if(this.state.clipByInstance)e.clip_bounds=i;else{const t=this.projectPosition([i[0],i[1],0]),n=this.projectPosition([i[2],i[3],0]);e.clip_bounds=[Math.min(t[0],n[0]),Math.min(t[1],n[1]),Math.max(t[0],n[0]),Math.max(t[1],n[1])]}}}(0,u.Z)(Iu,"defaultProps",Cu),(0,u.Z)(Iu,"extensionName","ClipExtension");const Pu={Point:Du,MultiPoint:function(t,e,i){return Lu(t,e,i)},LineString:Ou,MultiLineString:function(t,e,i){return t.map((t=>Ou(t,e,i)))},Polygon:Fu,MultiPolygon:function(t,e,i){return t.map((t=>Fu(t,e,i)))}};function Du(t,e,i){let[n,r]=t,[o,s]=e;const a=(0,Ut.t7)(o[0],s[0],n),l=(0,Ut.t7)(o[1],s[1],r);return i.unprojectFlat([a,l])}function Lu(t,e,i){return t.map((t=>Du(t,e,i)))}function Ou(t,e,i){return Lu(t,e,i)}function Fu(t,e,i){return t.map((t=>Lu(t,e,i)))}const Ru=["points","lines","polygons"];function ku(t,e,i,n){const r=t.featureIds.value;if(!r.length)return-1;let o=0,s=r[r.length-1]+1;if(n){const e=function(t,e){if(!t.__layers){const e={},{properties:i}=t;for(let t=0;t<i.length;t++){const{layerName:n}=i[t];n&&(e[n]?e[n][1]=t:e[n]=[t,t])}t.__layers=e}return t.__layers[e]}(t,n);if(!e)return-1;o=e[0],s=e[1]+1}let a=-1;if(e in t.numericProps){const n=t.numericProps[e].value.findIndex(((t,e)=>t===i&&r[e]>=o&&r[e]<s));return n>=0?t.globalFeatureIds.value[n]:-1}return e?a=zu(t.properties,(t=>t[e]===i),o,s):t.fields&&(a=zu(t.fields,(t=>t.id===i),o,s)),a>=0?function(t,e){if(!t.__ids){const e=[],i=t.featureIds.value,n=t.globalFeatureIds.value;for(let t=0;t<i.length;t++)e[i[t]]=n[t];t.__ids=e}return t.__ids[e]}(t,a):-1}function zu(t,e,i,n){for(let r=i;r<n;r++)if(e(t[r],r))return r;return-1}const Uu={...k.Z.defaultProps,onDataLoad:{type:"function",value:null,optional:!0,compare:!1},uniqueIdProperty:"",highlightedFeatureId:null,loaders:[Au],binary:!0};class Nu extends Ne{initializeState(){super.initializeState();const t=void 0===this.context.viewport.resolution&&this.props.binary;this.setState({binary:t,data:null,tileJSON:null})}get isLoaded(){return this.state&&this.state.data&&this.state.tileset&&super.isLoaded}updateState(t){let{props:e,oldProps:i,context:n,changeFlags:r}=t;var o;r.dataChanged&&this._updateTileData(),null!==(o=this.state)&&void 0!==o&&o.data&&(super.updateState({props:e,oldProps:i,context:n,changeFlags:r}),this._setWGS84PropertyForTiles());const{highlightColor:s}=e;s!==i.highlightColor&&Array.isArray(s)&&this.setState({highlightColor:s})}async _updateTileData(){let t=this.props.data,e=null;if("string"!==typeof t||/(?=.*{z})(?=.*{x})(?=.*({y}|{-y}))/.test(t))t.tilejson&&(e=t);else{const{onDataLoad:n,fetch:r}=this.props;this.setState({data:null,tileJSON:null});try{e=await r(t,{propName:"data",layer:this,loaders:[]})}catch(i){this.raiseError(i,"loading TileJSON"),t=null}n&&n(e,{propName:"data",layer:this})}e&&(t=e.tiles),this.setState({data:t,tileJSON:e})}_getTilesetOptions(){const t=super._getTilesetOptions(),e=this.state.tileJSON,{minZoom:i,maxZoom:n}=this.props;return e&&(Number.isFinite(e.minzoom)&&e.minzoom>i&&(t.minZoom=e.minzoom),Number.isFinite(e.maxzoom)&&(!Number.isFinite(n)||e.maxzoom<n)&&(t.maxZoom=e.maxzoom)),t}renderLayers(){var t;return null!==(t=this.state)&&void 0!==t&&t.data?super.renderLayers():null}getTileData(t){var e;const{data:i,binary:n}=this.state,{index:r,signal:o}=t,s=be(i,t);if(!s)return Promise.reject("Invalid URL");let a=this.getLoadOptions();const{fetch:l}=this.props;return a={...a,mimeType:"application/x-protobuf",mvt:{...null===(e=a)||void 0===e?void 0:e.mvt,coordinates:this.context.viewport.resolution?"wgs84":"local",tileIndex:r},gis:n?{format:"binary"}:{}},l(s,{propName:"data",layer:this,loadOptions:a,signal:o})}renderSubLayers(t){const{x:e,y:i,z:n}=t.tile.index,r=Math.pow(2,n),o=512/r,s=-o,a=512*e/r,l=512*(1-i/r),c=(new N.Z).scale([o,s,1]);t.autoHighlight=!1,this.context.viewport.resolution||(t.modelMatrix=c,t.co
2ordinateOrigin=[a,l,0],t.coordinateSystem=Z.Df.CARTESIAN,t.extensions=[...t.extensions||[],new Iu]);const u=super.renderSubLayers(t);return!this.state.binary||u instanceof k.Z||z.Z.warn("renderSubLayers() must return GeoJsonLayer when using binary:true")(),u}_updateAutoHighlight(t){const{uniqueIdProperty:e}=this.props,{hoveredFeatureId:i,hoveredFeatureLayerName:n}=this.state,r=t.object;let o,s;r&&(o=Gu(r,e),s=Zu(r));let{highlightColor:a}=this.props;"function"===typeof a&&(a=a(t)),i===o&&n===s||this.setState({highlightColor:a,hoveredFeatureId:o,hoveredFeatureLayerName:s})}getPickingInfo(t){const e=super.getPickingInfo(t),i=Boolean(this.context.viewport.resolution);if(this.state.binary&&-1!==e.index){const{data:i}=t.sourceLayer.props;e.object=fu(i,{globalFeatureId:e.index})}return e.object&&!i&&(e.object=Vu(e.object,e.tile.bbox,this.context.viewport)),e}getSubLayerPropsByTile(t){return{highlightedObjectIndex:this.getHighlightedObjectIndex(t),highlightColor:this.state.highlightColor}}getHighlightedObjectIndex(t){const{hoveredFeatureId:e,hoveredFeatureLayerName:i,binary:n}=this.state,{uniqueIdProperty:r,highlightedFeatureId:o}=this.props,s=t.content,a=ju(o);if(!(ju(e)||a))return-1;const l=a?o:e;return Array.isArray(s)?s.findIndex((t=>{const e=Gu(t,r)===l,n=a||Zu(t)===i;return e&&n})):s&&n?function(t,e,i,n){for(const r of Ru){const o=t[r]&&ku(t[r],e,i,n);if(o>=0)return o}return-1}(s,r,l,a?"":i):-1}_pickObjects(t){const{deck:e,viewport:i}=this.context,n=i.width,r=i.height,o=i.x,s=i.y,a=[this.id];return e.pickObjects({x:o,y:s,width:n,height:r,layerIds:a,maxObjects:t})}getRenderedFeatures(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;const e=this._pickObjects(t),i=new Set,n=[];for(const r of e){const t=Gu(r.object,this.props.uniqueIdProperty);void 0===t?n.push(r.object):i.has(t)||(i.add(t),n.push(r.object))}return n}_setWGS84PropertyForTiles(){const t="dataInWGS84";this.state.tileset.selectedTiles.forEach((e=>{e.hasOwnProperty(t)||Object.defineProperty(e,t,{get:()=>{if(!e.content)return null;if(this.state.binary&&Array.isArray(e.content)&&!e.content.length)return[];const{bbox:t}=e;if(void 0===e._contentWGS84&&(i=t,Number.isFinite(i.west)&&Number.isFinite(i.north)&&Number.isFinite(i.east)&&Number.isFinite(i.south))){const i=this.state.binary?fu(e.content):e.content;e._contentWGS84=i.map((e=>Vu(e,t,this.context.viewport)))}var i;return e._contentWGS84}})}))}}function Gu(t,e){return t.properties&&e?t.properties[e]:"id"in t?t.id:void 0}function Zu(t){var e;return(null===(e=t.properties)||void 0===e?void 0:e.layerName)||null}function ju(t){return void 0!==t&&null!==t&&""!==t}function Vu(t,e,i){const n={...t,geometry:{type:t.geometry.type}};return Object.defineProperty(n.geometry,"coordinates",{get:()=>{const n=function(t,e,i){const n=[i.projectFlat([e.west,e.north]),i.projectFlat([e.east,e.south])];return{...t,coordinates:Pu[t.type](t.coordinates,n,i)}}(t.geometry,e,i);return n.coordinates}}),n}(0,u.Z)(Nu,"layerName","MVTLayer"),(0,u.Z)(Nu,"defaultProps",Uu);const Hu="0123456789bcdefghjkmnpqrstuvwxyz",Ju={};for(let $u=0;$u<32;$u++)Ju[Hu.charAt($u)]=$u;const Wu=-90,Qu=90,qu=-180,Ku=180;function Xu(t){const[e,i,n,r]=function(t){let e,i=!0,n=Qu,r=Wu,o=Ku,s=qu,a=0;for(let l=0,c=t.length;l<c;l++){const c=t[l].toLowerCase();a=Ju[c];for(let t=4;t>=0;t--){const l=a>>t&1;i?(e=(o+s)/2,1===l?s=e:o=e):(e=(n+r)/2,1===l?r=e:n=e),i=!i}}return[r,s,n,o]}(t);return[r,n,r,e,i,e,i,n,r,n]}class Yu extends g{indexToBounds(){const{data:t,getGeohash:e}=this.props;return{data:t,_normalize:!1,positionFormat:"XY",getPolygon:(t,i)=>Xu(e(t,i))}}}(0,u.Z)(Yu,"layerName","GeohashLayer"),(0,u.Z)(Yu,"defaultProps",{getGeohash:{type:"accessor",value:t=>t.geohash}})},84977:function(t,e){var i,n,r;n=[],void 0===(r="function"===typeof(i=function(){"use strict";function t(t,e,i){this.low=0|t,this.high=0|e,this.unsigned=!!i}function e(t){return!0===(t&&t.__isLong__)}t.prototype.__isLong__,Object.defineProperty(t.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),t.isLong=e;var i={},n={};function r(t,e){var r,o,a;return e?(a=0<=(t>>>=0)&&t<256)&&(o=n[t])?o:(r=s(t,(0|t)<0?-1:0,!0),a&&(n[t]=r),r):(a=-128<=(t|=0)&&t<128)&&(o=i[t])?o:(r=s(t,t<0?-1:0,!1),a&&(i[t]=r),r)}function o(t,e){if(isNaN(t)||!isFinite(t))return e?g:f;if(e){if(t<0)return g;if(t>=d)return b}
vendor: 14,192 bytes, line 2
2else{if(t<=-p)return x;if(t+1>=p)return _}return t<0?o(-t,e).neg():s(t%h|0,t/h|0,e)}function s(e,i,n){return new t(e,i,n)}t.fromInt=r,t.fromNumber=o,t.fromBits=s;var a=Math.pow;function l(t,e,i){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return f;if("number"===typeof e?(i=e,e=!1):e=!!e,(i=i||10)<2||36<i)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(t.substring(1),e,i).neg();for(var r=o(a(i,8)),s=f,c=0;c<t.length;c+=8){var u=Math.min(8,t.length-c),h=parseInt(t.substring(c,c+u),i);if(u<8){var d=o(a(i,u));s=s.mul(d).add(o(h))}else s=(s=s.mul(r)).add(o(h))}return s.unsigned=e,s}function c(e){return e instanceof t?e:"number"===typeof e?o(e):"string"===typeof e?l(e):s(e.low,e.high,e.unsigned)}t.fromString=l,t.fromValue=c;var u=65536,h=u*u,d=h*h,p=d/2,A=r(1<<24),f=r(0);t.ZERO=f;var g=r(0,!0);t.UZERO=g;var m=r(1);t.ONE=m;var y=r(1,!0);t.UONE=y;var v=r(-1);t.NEG_ONE=v;var _=s(-1,2147483647,!1);t.MAX_VALUE=_;var b=s(-1,-1,!0);t.MAX_UNSIGNED_VALUE=b;var x=s(0,-2147483648,!1);t.MIN_VALUE=x;var w=t.prototype;return w.toInt=function(){return this.unsigned?this.low>>>0:this.low},w.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},w.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(x)){var e=o(t),i=this.div(e),n=i.mul(e).sub(this);return i.toString(t)+n.toInt().toString(t)}return"-"+this.neg().toString(t)}for(var r=o(a(t,6),this.unsigned),s=this,l="";;){var c=s.div(r),u=(s.sub(c.mul(r)).toInt()>>>0).toString(t);if((s=c).isZero())return u+l;for(;u.length<6;)u="0"+u;l=""+u+l}},w.getHighBits=function(){return this.high},w.getHighBitsUnsigned=function(){return this.high>>>0},w.getLowBits=function(){return this.low},w.getLowBitsUnsigned=function(){return this.low>>>0},w.getNumBitsAbs=function(){if(this.isNegative())return this.eq(x)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&0==(t&1<<e);e--);return 0!=this.high?e+33:e+1},w.isZero=function(){return 0===this.high&&0===this.low},w.isNegative=function(){return!this.unsigned&&this.high<0},w.isPositive=function(){return this.unsigned||this.high>=0},w.isOdd=function(){return 1===(1&this.low)},w.isEven=function(){return 0===(1&this.low)},w.equals=function(t){return e(t)||(t=c(t)),(this.unsigned===t.unsigned||this.high>>>31!==1||t.high>>>31!==1)&&this.high===t.high&&this.low===t.low},w.eq=w.equals,w.notEquals=function(t){return!this.eq(t)},w.neq=w.notEquals,w.lessThan=function(t){return this.comp(t)<0},w.lt=w.lessThan,w.lessThanOrEqual=function(t){return this.comp(t)<=0},w.lte=w.lessThanOrEqual,w.greaterThan=function(t){return this.comp(t)>0},w.gt=w.greaterThan,w.greaterThanOrEqual=function(t){return this.comp(t)>=0},w.gte=w.greaterThanOrEqual,w.compare=function(t){if(e(t)||(t=c(t)),this.eq(t))return 0;var i=this.isNegative(),n=t.isNegative();return i&&!n?-1:!i&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},w.comp=w.compare,w.negate=function(){return!this.unsigned&&this.eq(x)?x:this.not().add(m)},w.neg=w.negate,w.add=function(t){e(t)||(t=c(t));var i=this.high>>>16,n=65535&this.high,r=this.low>>>16,o=65535&this.low,a=t.high>>>16,l=65535&t.high,u=t.low>>>16,h=0,d=0,p=0,A=0;return p+=(A+=o+(65535&t.low))>>>16,d+=(p+=r+u)>>>16,h+=(d+=n+l)>>>16,h+=i+a,s((p&=65535)<<16|(A&=65535),(h&=65535)<<16|(d&=65535),this.unsigned)},w.subtract=function(t){return e(t)||(t=c(t)),this.add(t.neg())},w.sub=w.subtract,w.multiply=function(t){if(this.isZero())return f;if(e(t)||(t=c(t)),t.isZero())return f;if(this.eq(x))return t.isOdd()?x:f;if(t.eq(x))return this.isOdd()?x:f;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(A)&&t.lt(A))return o(this.toNumber()*t.toNumber(),this.unsigned);var i=this.high>>>16,n=65535&this.high,r=this.low>>>16,a=65535&this.low,l=t.high>>>16,u=65535&t.high,h=t.low>>>16,d=65535&t.low,p=0,g=0,m=0,y=0;return m+=(y+=a*d)>>>16,g+=(m+=r*d)>>>16,m&=65535,g+=(m+=a*h)>>>16,p+=(g+=n*d)>>>16,g&=65535,p+=(g+=r*h)>>>16,g&=65535,p+=(g+=a*u)>>>16,p+=i*d+n*h+r*u+a*l,s((m&=65535)<<16|(y&=65535),(p&=65535)<<16|(g&=65535),this.unsigned)},w.mul=w.multiply,w.divide=function(t){if(e(t)||(t=c(t)),t.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:f;var i,n,r;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return g;if(t.gt(this.shru(1)))return y;r=g}else{if(this.eq(x))return t.eq(m)||t.eq(v)?x:t.eq(x)?m:(i=this.shr(1).div(t).shl(1)).eq(f)?t.isNegative()?m:v:(n=this.sub(t.mul(i)),r=i.add(n.div(t)));if(t.eq(x))return this.unsigned?g:f;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();r=f}for(n=this;n.gte(t);){i=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(i)/Math.LN2),l=s<=48?1:a(2,s-48),u=o(i),h=u.mul(t);h.isNegative()||h.gt(n);)h=(u=o(i-=l,this.unsigned)).mul(t);u.isZero()&&(u=m),r=r.add(u),n=n.sub(h)}return r},w.div=w.divide,w.modulo=function(t){return e(t)||(t=c(t)),this.sub(this.div(t).mul(t))},w.mod=w.modulo,w.not=function(){return s(~this.low,~this.high,this.unsigned)},w.and=function(t){return e(t)||(t=c(t)),s(this.low&t.low,this.high&t.high,this.unsigned)},w.or=function(t){return e(t)||(t=c(t)),s(this.low|t.low,this.high|t.high,this.unsigned)},w.xor=function(t){return e(t)||(t=c(t)),s(this.low^t.low,this.high^t.high,this.unsigned)},w.shiftLeft=function(t){return e(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?s(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):s(0,this.low<<t-32,this.unsigned)},w.shl=w.shiftLeft,w.shiftRight=function(t){return e(t)&&(t=t.toInt()),0===(t&=63)?this:t<32?s(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):s(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},w.shr=w.shiftRight,w.shiftRightUnsigned=function(t){if(e(t)&&(t=t.toInt()),0===(t&=63))return this;var i=this.high;return t<32?s(this.low>>>t|i<<32-t,i>>>t,this.unsigned):s(32===t?i:i>>>t-32,0,this.unsigned)},w.shru=w.shiftRightUnsigned,w.toSigned=function(){return this.unsigned?s(this.low,this.high,!1):this},w.toUnsigned=function(){return this.unsigned?this:s(this.low,this.high,!0)},w.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},w.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24&255,255&t,t>>>8&255,t>>>16&255,t>>>24&255]},w.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24&255,t>>>16&255,t>>>8&255,255&t,e>>>24&255,e>>>16&255,e>>>8&255,255&e]},t})?i.apply(e,n):i)||(t.exports=r)},80248:(t,e,i)=>{"use strict";function n(t){if(!t)throw new Error("JSON conversion error ".concat(arguments.length>1&&void 0!==arguments[1]?arguments[1]:""))}function r(t,e){const i=function(t){if("string"===typeof t){let e=s[t];return e||(e=t.split("."),s[t]=e),e}return Array.isArray(t)?t:[t]}(e);let n=t;for(const r of i)n=o(n)?n[r]:void 0;return n}function o(t){return null!==t&&"object"===typeof t}i.d(e,{Z:()=>b});const s={};var a=i(61521),l=i.n(a);const c={"-":t=>t};function u(t,e){if(t in c)return c[t];let i;const n=l().parse(t);return n.right||n.left||"Identifier"!==n.type?(h(n,(t=>{if("CallExpression"===t.type)throw new Error("Function calls not allowed in JSON expressions")})),i=t=>l().eval(n,t)):i=e=>r(e,t),c[t]=i,i}function h(t,e){if(Array.isArray(t))t.forEach((t=>h(t,e)));else if(t&&"object"===typeof t){t.type&&e(t);for(const i in t)h(t[i],e)}}const d="@@=",p="@@#",A="@@function",f=t=>t&&"object"===typeof t;class g{constructor(){this.typeKey="@@type",this.functionKey=A,this.log=console,this.classes={},this.reactComponents={},this.enumerations={},this.constants={},this.functions={},this.convertFunction=u,this.preProcessClassProps=(t,e)=>e,this.postProcessConvertedJson=t=>t;for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const n of e)this.merge(n)}merge(t){for(const e in t)switch(e){case"layers":case"views":Object.assign(this.classes,t[e]);break;default:if(e in this){const i=t[e];this[e]=f(this[e])?Object.assign(this[e],i):i}}}validate(t){return n(!this.typeKey||"string"===typeof this.typeKey),n(f(this.classes)),!0}}function m(t){return t.replace(d,"")}function y(t,e){const i={};for(const r in t){let e=t[r];"string"===typeof(n=e)&&n.startsWith(d)&&(e=m(e),e=u(e)),i[r]=e}var n;return i}function v(t,e,i){const n=i.classes[t],r=i.reactComponents[t];if(!n&&!r){const{log:n}=i;if(n){const i=JSON.stringify(e,null,0).slice(0,40);n.warn("JSON converter: No registered class of type ".concat(t,"(").concat(i,"...)  "))}return null}return n?function(t,e,i){i.preProcessClassProps&&(e=i.preProcessClassProps(t,e,i));return e=y(e),new t(e)}(n,e,i):function(t,e,i){const{React:n}=i,{children:r=[]}=e;delete e.children,i.preProcessClassProps&&(e=i.preProcessClassProps(t,e,i));return e=y(e),n.createElement(t,e,r)}(r,e,i)}const _=t=>t&&"object"===typeof t;class b{constructor(t){this.log=console,this.configuration={},this.onJSONChange=()=>{},this.json=null,this.convertedJson=null,this.setProps(t)}finalize(){}setProps(t){"configuration"in t&&(this.configuration=t.configuration instanceof g?t.configuration:new g(t.configuration)),"onJSONChange"in t&&(this.onJSONChange=t.onJSONChange)}mergeConfiguration(t){this.configuration.merge(t)}convert(t){if(!t||t===this.json)return this.convertedJson;this.json=t;const e=function(t){return"string"===typeof t?JSON.parse(t):t}(t);let i=function(t,e){return e=new g(e),x(t,"",e)}(e,this.configuration);return i=this.configuration.postProcessConvertedJson(i),this.convertedJson=i,i}convertJson(t){return this.convert(t)}}function x(t,e,i){return Array.isArray(t)?t.map(((t,e)=>x(t,String(e),i))):function(t,e){const{typeKey:i}=e,n=_(t)&&Boolean(t[i]);return n}(t,i)?function(t,e){const{typeKey:i}=e,n=t[i];let r={...t};return delete r[i],r=w(r,e),v(n,r,e)}(t,i):_(t)?A in t?function(t,e){const{functionKey:i}=e,n=t[i];let r={...t};return delete r[i],r=w(r,e),function(t,e,i){const n=i.functions[t];if(!n){const{log:n}=i;if(n){const i=JSON.stringify(e,null,0).slice(0,40);n.warn("JSON converter: No registered function ".concat(t,"(").concat(i,"...)  "))}return null}return n(e)}(n,r,e)}(t,i):w(t,i):"string"===typeof t?function(t,e,i){if(t.startsWith(d)&&i.convertFunction)return t=t.replace(d,""),i.convertFunction(t,i);if(t.startsWith(p)){if(t=t.replace(p,""),i.constants[t])return i.constants[t];const[e,n]=t.split(".");return i.enumerations[e][n]}return t}(t,0,i):t}function w(t,e){n(_(t));const i={};for(const n in t){const r=t[n];i[n]=x(r,0,e)}return i}},73351:(t,e,i)=>{"use strict";i.d(e,{Z:()=>d});var n=i(64649),r=i(90031),o=i(2123),s=i(2578),a=i(18252),l=i(94557),c=i(69296);const u=[0,0,0,255],h={getSourcePosition:{type:"accessor",value:t=>t.sourcePosition},getTargetPosition:{type:"accessor",value:t=>t.targetPosition},getSourceColor:{type:"accessor",value:u},getTargetColor:{type:"accessor",value:u},getWidth:{type:"accessor",value:1},getHeight:{type:"accessor",value:1},getTilt:{type:"accessor",value:0},greatCircle:!1,widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class d extends r.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:"#define SHADER_NAME arc-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec4 instanceSourceColors;\nattribute vec4 instanceTargetColors;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\nattribute float instanceHeights;\nattribute float instanceTilts;\n\nuniform bool greatCircle;\nuniform bool useShortestPath;\nuniform float numSegments;\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int widthUnits;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nfloat paraboloid(float distance, float sourceZ, float targetZ, float ratio) {\n  // d: distance on the xy plane\n  // r: ratio of the current point\n  // p: ratio of the peak of the arc\n  // h: height multiplier\n  // z = f(r) = sqrt(r * (p * 2 - r)) * d * h\n  // f(0) = 0\n  // f(1) = dz\n\n  float deltaZ = targetZ - sourceZ;\n  float dh = distance * instanceHeights;\n  if (dh == 0.0) {\n    return sourceZ + deltaZ * ratio;\n  }\n  float unitZ = deltaZ / dh;\n  float p2 = unitZ * unitZ + 1.0;\n\n  // sqrt does not deal with negative values, manually flip source and target if delta.z < 0\n  float dir = step(deltaZ, 0.0);\n  float z0 = mix(sourceZ, targetZ, dir);\n  float r = mix(ratio, 1.0 - ratio, dir);\n  return sqrt(r * (p2 - r)) * dh + z0;\n}\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n  // normalized direction of the line\n  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n  // rotate by 90 degrees\n  dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n  return dir_screenspace * offset_direction * width / 2.0;\n}\n\nfloat getSegmentRatio(float index) {\n  return smoothstep(0.0, 1.0, index / (numSegments - 1.0));\n}\n\nvec3 interpolateFlat(vec3 source, vec3 target, float segmentRatio) {\n  float distance = length(source.xy - target.xy);\n  float z = paraboloid(distance, source.z, target.z, segmentRatio);\n\n  float tiltAngle = radians(instanceTilts);\n  vec2 tiltDirection = normalize(target.xy - source.xy);\n  vec2 tilt = vec2(-tiltDirection.y, tiltDirection.x) * z * sin(tiltAngle);\n\n  return vec3(\n    mix(source.xy, target.xy, segmentRatio) + tilt,\n    z * cos(tiltAngle)\n  );\n}\n\n/* Great circle interpolation\n * http://www.movable-type.co.uk/scripts/latlong.html\n */\nfloat getAngularDist (ve
2c2 source, vec2 target) {\n  vec2 sourceRadians = radians(source);\n  vec2 targetRadians = radians(target);\n  vec2 sin_half_delta = sin((sourceRadians - targetRadians) / 2.0);\n  vec2 shd_sq = sin_half_delta * sin_half_delta;\n\n  float a = shd_sq.y + cos(sourceRadians.y) * cos(targetRadians.y) * shd_sq.x;\n  return 2.0 * asin(sqrt(a));\n}\n\nvec3 interpolateGreatCircle(vec3 source, vec3 target, vec3 source3D, vec3 target3D, float angularDist, float t) {\n  vec2 lngLat;\n\n  // if the angularDist is PI, linear interpolation is applied. otherwise, use spherical interpolation\n  if(abs(angularDist - PI) < 0.001) {\n    lngLat = (1.0 - t) * source.xy + t * target.xy;\n  } else {\n    float a = sin((1.0 - t) * angularDist);\n    float b = sin(t * angularDist);\n    vec3 p = source3D.yxz * a + target3D.yxz * b;\n    lngLat = degrees(vec2(atan(p.y, -p.x), atan(p.z, length(p.xy))));\n  }\n\n  float z = paraboloid(angularDist * EARTH_RADIUS, source.z, target.z, t);\n\n  return vec3(lngLat, z);\n}\n\n/* END GREAT CIRCLE */\n\nvoid main(void) {\n  geometry.worldPosition = instanceSourcePositions;\n  geometry.worldPositionAlt = instanceTargetPositions;\n\n  float segmentIndex = positions.x;\n  float segmentRatio = getSegmentRatio(segmentIndex);\n  float prevSegmentRatio = getSegmentRatio(max(0.0, segmentIndex - 1.0));\n  float nextSegmentRatio = getSegmentRatio(min(numSegments - 1.0, segmentIndex + 1.0));\n\n  // if it's the first point, use next - current as direction\n  // otherwise use current - prev\n  float indexDir = mix(-1.0, 1.0, step(segmentIndex, 0.0));\n  isValid = 1.0;\n\n  uv = vec2(segmentRatio, positions.y);\n  geometry.uv = uv;\n  geometry.pickingColor = instancePickingColors;\n\n  vec4 curr;\n  vec4 next;\n  vec3 source;\n  vec3 target;\n\n  if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) {\n    source = project_globe_(vec3(instanceSourcePositions.xy, 0.0));\n    target = project_globe_(vec3(instanceTargetPositions.xy, 0.0));\n    float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy);\n\n    vec3 prevPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, prevSegmentRatio);\n    vec3 currPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, segmentRatio);\n    vec3 nextPos = interpolateGreatCircle(instanceSourcePositions, instanceTargetPositions, source, target, angularDist, nextSegmentRatio);\n\n    if (abs(currPos.x - prevPos.x) > 180.0) {\n      indexDir = -1.0;\n      isValid = 0.0;\n    } else if (abs(currPos.x - nextPos.x) > 180.0) {\n      indexDir = 1.0;\n      isValid = 0.0;\n    }\n    nextPos = indexDir < 0.0 ? prevPos : nextPos;\n    nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n\n    if (isValid == 0.0) {\n      // split at the 180th meridian\n      nextPos.x += nextPos.x > 0.0 ? -360.0 : 360.0;\n      float t = ((currPos.x > 0.0 ? 180.0 : -180.0) - currPos.x) / (nextPos.x - currPos.x);\n      currPos = mix(currPos, nextPos, t);\n      segmentRatio = mix(segmentRatio, nextSegmentRatio, t);\n    }\n\n    vec3 currPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, segmentRatio);\n    vec3 nextPos64Low = mix(instanceSourcePositions64Low, instanceTargetPositions64Low, nextSegmentRatio);\n  \n    curr = project_position_to_clipspace(currPos, currPos64Low, vec3(0.0), geometry.position);\n    next = project_position_to_clipspace(nextPos, nextPos64Low, vec3(0.0));\n  \n  } else {\n    vec3 source_world = instanceSourcePositions;\n    vec3 target_world = instanceTargetPositions;\n    if (useShortestPath) {\n      source_world.x = mod(source_world.x + 180., 360.
20) - 180.;\n      target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n\n      float deltaLng = target_world.x - source_world.x;\n      if (deltaLng > 180.) target_world.x -= 360.;\n      if (deltaLng < -180.) source_world.x -= 360.;\n    }\n    source = project_position(source_world, instanceSourcePositions64Low);\n    target = project_position(target_world, instanceTargetPositions64Low);\n\n    // common x at longitude=-180\n    float antiMeridianX = 0.0;\n\n    if (useShortestPath) {\n      if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) {\n        antiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE;\n      }\n      float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x);\n\n      if (prevSegmentRatio <= thresholdRatio && nextSegmentRatio > thresholdRatio) {\n        isValid = 0.0;\n        indexDir = sign(segmentRatio - thresholdRatio);\n        segmentRatio = thresholdRatio;\n      }\n    }\n\n    nextSegmentRatio = indexDir < 0.0 ? prevSegmentRatio : nextSegmentRatio;\n    vec3 currPos = interpolateFlat(source, target, segmentRatio);\n    vec3 nextPos = interpolateFlat(source, target, nextSegmentRatio);\n\n    if (useShortestPath) {\n      if (nextPos.x < antiMeridianX) {\n        currPos.x += TILE_SIZE;\n        nextPos.x += TILE_SIZE;\n      }\n    }\n\n    curr = project_common_position_to_clipspace(vec4(currPos, 1.0));\n    next = project_common_position_to_clipspace(vec4(nextPos, 1.0));\n    geometry.position = vec4(currPos, 1.0);\n  }\n\n  // Multiply out width and clamp to limits\n  // mercator pixels are interpreted as screen pixels\n  float widthPixels = clamp(\n    project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n    widthMinPixels, widthMaxPixels\n  );\n\n  // extrude\n  vec3 offset = vec3(\n    getExtrusionOffset((next.xy - curr.xy) * indexDir, positions.y, widthPixels),\n    0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  gl_Position = curr + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vec4 color = mix(instanceSourceColors, instanceTargetColors, segmentRatio);\n  vColor = vec4(color.rgb, color.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME arc-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\nvarying float isValid;\n\nvoid main(void) {\n  if (isValid == 0.0) {\n    discard;\n  }\n\n  gl_FragColor = vColor;\n  geometry.uv = uv;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceSourceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getSourceColor",defaultValue:u},instanceTargetColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getTargetColor",defaultValue:u},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1},instanceHeights:{size:1,transition:!0,accessor:"getHeight",defaultValue:1},instanceTilts:{size:1,transition:!0,accessor:"getTilt",defaultValue:0}})}updateState(t){if(super.updateState(t),t.changeFlags.extensionsChanged){var e;const{gl:t}=this.context;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw(t){let{uniforms:e}=t;const{widthUnits:i,widthScale:n,widthMinPixels:r,widthMaxPixels:o,greatCircle:s,wrapLongitude:l}=this.props;this.state.model.setUniforms(e).setUniforms({greatCircle:s,widthUnits:a.iI[i],widthScale:n,widthMinPixels:r,widthMaxPixels:o,useShortestPath:l}).draw()}_getModel(t){let e=[];for(let n=0;n<50;n++)e=e.concat([n,1,0,n,-1,0]);const i=new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:5,attributes:{positions:new Float32Array(e)}}),isInstanced:!0});return i.setUniforms({numSegments:50}),i}}(0,n.Z)(d,"layerName","ArcLayer"),(0,n.Z)(d,"defaultProps",h)},35387:(t,e,i)=>{"use strict";i.d(e,{Z:()=>_});var n=i(64649),r=i(90031),o=i(2123),s=i(54976),a=i(2578),l=i(18252),c=i(28007),u=i(12308),h=i(70353),d=i(94557),p=i(21970),A=i(69296),f=i(79666),g=i(23595);class m extends A.Z{constructor(t){const{id:e=(0,f.hQ)("column-geometry")}=t,{indices:i,attributes:n}=function(t){const{radius:e,height:i=1,nradial:n=10}=t;let{vertices:r}=t;r&&(p.Z.assert(r.length>=n),r=r.flatMap((t=>[t[0],t[1]])),(0,g.Ny)(r,g.wG.COUNTER_CLOCKWISE));const o=i>0,s=n+1,a=o?3*s+1:n,l=2*Math.PI/n,c=new Uint16Array(o?3*n*2:0),u=new Float32Array(3*a),h=new Float32Array(3*a);let d=0;if(o){for(let t=0;t<s;t++){const o=t*l,s=t%n,a=Math.sin(o),c=Math.cos(o);for(let t=0;t<2;t++)u[d+0]=r?r[2*s]:c*e,u[d+1]=r?r[2*s+1]:a*e,u[d+2]=(.5-t)*i,h[d+0]=r?r[2*s]:c,h[d+1]=r?r[2*s+1]:a,d+=3}u[d+0]=u[d-3],u[d+1]=u[d-2],u[d+2]=u[d-1],d+=3}for(let p=o?0:1;p<s;p++){const t=Math.floor(p/2)*Math.sign(.5-p%2),o=t*l,s=(t+n)%n,a=Math.sin(o),c=Math.cos(o);u[d+0]=r?r[2*s]:c*e,u[d+1]=r?r[2*s+1]:a*e,u[d+2]=i/2,h[d+2]=1,d+=3}if(o){let t=0;for(let e=0;e<n;e++)c[t++]=2*e+0,c[t++]=2*e+2,c[t++]=2*e+0,c[t++]=2*e+1,c[t++]=2*e+1,c[t++]=2*e+3}return{indices:c,attributes:{POSITION:{size:3,value:u},NORMAL:{size:3,value:h}}}}(t);super({...t,id:e,indices:i,attributes:n}
2)}}const y=[0,0,0,255],v={diskResolution:{type:"number",min:4,value:20},vertices:null,radius:{type:"number",min:0,value:1e3},angle:{type:"number",value:0},offset:{type:"array",value:[0,0]},coverage:{type:"number",min:0,max:1,value:1},elevationScale:{type:"number",min:0,value:1},radiusUnits:"meters",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,extruded:!0,wireframe:!1,filled:!0,stroked:!1,getPosition:{type:"accessor",value:t=>t.position},getFillColor:{type:"accessor",value:y},getLineColor:{type:"accessor",value:y},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0,getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class _ extends r.Z{getShaders(){const{gl:t}=this.context,e=!(0,c.D0)(t),i={},n=this.props.flatShading&&(0,u.U6)(t,h.h.GLSL_DERIVATIVES);return n&&(i.FLAT_SHADING=1),super.getShaders({vs:"#version 300 es\n\n#define SHADER_NAME column-layer-vertex-shader\n\nin vec3 positions;\nin vec3 normals;\n\nin vec3 instancePositions;\nin float instanceElevations;\nin vec3 instancePositions64Low;\nin vec4 instanceFillColors;\nin vec4 instanceLineColors;\nin float instanceStrokeWidths;\n\nin vec3 instancePickingColors;\n\n// Custom uniforms\nuniform float opacity;\nuniform float radius;\nuniform float angle;\nuniform vec2 offset;\nuniform bool extruded;\nuniform bool stroked;\nuniform bool isStroke;\nuniform float coverage;\nuniform float elevationScale;\nuniform float edgeDistance;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform int radiusUnits;\nuniform int widthUnits;\n\n// Result\nout vec4 vColor;\n#ifdef FLAT_SHADING\nout vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n\n  vec4 color = isStroke ? instanceLineColors : instanceFillColors;\n  // rotate primitive position and normal\n  mat2 rotationMatrix = mat2(cos(angle), sin(angle), -sin(angle), cos(angle));\n\n  // calculate elevation, if 3d not enabled set to 0\n  // cylindar gemoetry height are between -1.0 to 1.0, transform it to between 0, 1\n  float elevation = 0.0;\n  // calculate stroke offset\n  float strokeOffsetRatio = 1.0;\n\n  if (extruded) {\n    elevation = instanceElevations * (positions.z + 1.0) / 2.0 * elevationScale;\n  } else if (stroked) {\n    float widthPixels = clamp(\n      project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n      widthMinPixels, widthMaxPixels) / 2.0;\n    float halfOffset = project_pixel_size(widthPixels) / project_size(edgeDistance * coverage * radius);\n    if (isStroke) {\n      strokeOffsetRatio -= sign(positions.z) * halfOffset;\n    } else {\n      strokeOffsetRatio -= halfOffset;\n    }\n  }\n\n  // if alpha == 0.0 or z < 0.0, do not render element\n  float shouldRender = float(color.a > 0.0 && instanceElevations >= 0.0);\n  float dotRadius = radius * coverage * shouldRender;\n\n  geometry.pickingColor = instancePickingColors;\n\n  // project center of column\n  vec3 centroidPosition = vec3(instancePositions.xy, instancePositions.z + elevation);\n  vec3 centroidPosition64Low = instancePositions64Low;\n  vec2 offset = (rotationMatrix * positions.xy * strokeOffsetRatio + offset) * dotRadius;\n  if (radiusUnits == UNIT_METERS) {\n    offset = project_size(offset);\n  }\n  vec3 pos = vec3(offset, 0.);\n  DECKGL_FILTER_SIZE(pos, geometry);\n\n  gl_Position = project_position_to_clipspace(centroidPosition, centroidPosition64Low, pos, geometry.position);\n  geometry.normal = project_normal(vec3(rotationMatrix * normals.xy, normals.z));\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Light calculations\n  if (extruded && !isStroke) {\n#ifdef FLAT_SHADING\n    position_commonspace = geometry.position;\n    vColor = vec4(color.rgb, color.a * opacity);\n#else\n    vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n    vColor = vec4(lightColor, color.a * opacity);\n#endif\n  } else {\n    vColor = vec4(color.rgb, color.a * opacity);\n  }\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME column-layer-fragment-shader\n\nprecision highp float;\n\nuniform vec3 project_uCameraPosition;\nuniform bool extruded;\nuniform bool isStroke;\n\nout vec4 fragColor;\n\nin vec4 vColor;\n#ifdef FLAT_SHADING\nin vec4 position_commonspace;\n#endif\n\nvoid main(void) {\n  fragColor = vColor;\n#ifdef FLAT_SHADING\n  if (extruded && !isStroke && !picking_uActive) {\n    vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n    fragColor.rgb = lighting_getLightColor(vColor.rgb, project_uCameraPosition, position_commonspace.xyz, normal);\n  }\n#endif\n  DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",defines:i,transpileToGLSL100:e,modules:[o.Z,n?s.s:s.N,a.Z]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceElevations:{size:1,transition:!0,accessor:"getElevation"},instanceFillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getFillColor",defaultValue:y},instanceLineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getLineColor",defaultValue:y},instanceStrokeWidths:{size:1,accessor:"getLineWidth",transition:!0}})}updateState(t){super.updateState(t);const{props:e,oldProps:i,changeFlags:n}=t,r=n.extensionsChanged||e.flatShading!==i.flatShading;if(r){var o;const{gl:t}=this.context;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}(r||e.diskResolution!==i.diskResolution||e.vertices!==i.vertices||(e.extruded||e.stroked)!==(i.extruded||i.stroked))&&this._updateGeometry(e)}getGeometry(t,e,i){const n=new m({radius:1,height:i?2:0,vertices:e,nradial:t});let r=0;if(e)for(let o=0;o<t;o++){const i=e[o];r+=Math.sqrt(i[0]*i[0]+i[1]*i[1])/t}else r=1;return this.setState({edgeDistance:Math.cos(Math.PI/t)*r}),n}
2_getModel(t){return new d.Z(t,{...this.getShaders(),id:this.props.id,isInstanced:!0})}_updateGeometry(t){let{diskResolution:e,vertices:i,extruded:n,stroked:r}=t;const o=this.getGeometry(e,i,n||r);this.setState({fillVertexCount:o.attributes.POSITION.value.length/3,wireframeVertexCount:o.indices.value.length}),this.state.model.setProps({geometry:o})}draw(t){let{uniforms:e}=t;const{lineWidthUnits:i,lineWidthScale:n,lineWidthMinPixels:r,lineWidthMaxPixels:o,radiusUnits:s,elevationScale:a,extruded:c,filled:u,stroked:h,wireframe:d,offset:p,coverage:A,radius:f,angle:g}=this.props,{model:m,fillVertexCount:y,wireframeVertexCount:v,edgeDistance:_}=this.state;m.setUniforms(e).setUniforms({radius:f,angle:g/180*Math.PI,offset:p,extruded:c,stroked:h,coverage:A,elevationScale:a,edgeDistance:_,radiusUnits:l.iI[s],widthUnits:l.iI[i],widthScale:n,widthMinPixels:r,widthMaxPixels:o}),c&&d&&(m.setProps({isIndexed:!0}),m.setVertexCount(v).setDrawMode(1).setUniforms({isStroke:!0}).draw()),u&&(m.setProps({isIndexed:!1}),m.setVertexCount(y).setDrawMode(5).setUniforms({isStroke:!1}).draw()),!c&&h&&(m.setProps({isIndexed:!1}),m.setVertexCount(2*y/3).setDrawMode(5).setUniforms({isStroke:!0}).draw())}}(0,n.Z)(_,"layerName","ColumnLayer"),(0,n.Z)(_,"defaultProps",v)},90555:(t,e,i)=>{"use strict";i.d(e,{Z:()=>a});var n=i(64649),r=i(34819),o=i(18252),s=i(35387);class a extends s.Z{getGeometry(t){return new r.Z}draw(t){let{uniforms:e}=t;const{elevationScale:i,extruded:n,offset:r,coverage:s,cellSize:a,angle:l,radiusUnits:c}=this.props;this.state.model.setUniforms(e).setUniforms({radius:a/2,radiusUnits:o.iI[c],angle:l,offset:r,extruded:n,coverage:s,elevationScale:i,edgeDistance:1,isWireframe:!1}).draw()}}(0,n.Z)(a,"layerName","GridCellLayer"),(0,n.Z)(a,"defaultProps",{cellSize:{type:"number",min:0,value:1e3},offset:{type:"array",value:[1,1]}})},43610:(t,e,i)=>{"use strict";i.d(e,{Z:()=>C});var n=i(64649),r=i(79366),o=i(66535);var s=i(32296),a=i(87403),l=i(8086),c=i(69554),u=i(3453);const h={circle:{type:a.Z,props:{filled:"filled",stroked:"stroked",lineWidthMaxPixels:"lineWidthMaxPixels",lineWidthMinPixels:"lineWidthMinPixels",lineWidthScale:"lineWidthScale",lineWidthUnits:"lineWidthUnits",pointRadiusMaxPixels:"radiusMaxPixels",pointRadiusMinPixels:"radiusMinPixels",pointRadiusScale:"radiusScale",pointRadiusUnits:"radiusUnits",pointAntialiasing:"antialiasing",pointBillboard:"billboard",getFillColor:"getFillColor",getLineColor:"getLineColor",getLineWidth:"getLineWidth",getPointRadius:"getRadius"}},icon:{type:s.Z,props:{iconAtlas:"iconAtlas",iconMapping:"iconMapping",iconSizeMaxPixels:"sizeMaxPixels",iconSizeMinPixels:"sizeMinPixels",iconSizeScale:"sizeScale",iconSizeUnits:"sizeUnits",iconAlphaCutoff:"alphaCutoff",iconBillboard:"billboard",getIcon:"getIcon",getIconAngle:"getAngle",getIconColor:"getColor",getIconPixelOffset:"getPixelOffset",getIconSize:"getSize"}},text:{type:l.Z,props:{textSizeMaxPixels:"sizeMaxPixels",textSizeMinPi
vendor: 7,371 bytes, line 2
2xels:"sizeMinPixels",textSizeScale:"sizeScale",textSizeUnits:"sizeUnits",textBackground:"background",textBackgroundPadding:"backgroundPadding",textFontFamily:"fontFamily",textFontWeight:"fontWeight",textLineHeight:"lineHeight",textMaxWidth:"maxWidth",textOutlineColor:"outlineColor",textOutlineWidth:"outlineWidth",textWordBreak:"wordBreak",textCharacterSet:"characterSet",textBillboard:"billboard",textFontSettings:"fontSettings",getText:"getText",getTextAngle:"getAngle",getTextColor:"getColor",getTextPixelOffset:"getPixelOffset",getTextSize:"getSize",getTextAnchor:"getTextAnchor",getTextAlignmentBaseline:"getAlignmentBaseline",getTextBackgroundColor:"getBackgroundColor",getTextBorderColor:"getBorderColor",getTextBorderWidth:"getBorderWidth"}}},d={type:c.Z,props:{lineWidthUnits:"widthUnits",lineWidthScale:"widthScale",lineWidthMinPixels:"widthMinPixels",lineWidthMaxPixels:"widthMaxPixels",lineJointRounded:"jointRounded",lineCapRounded:"capRounded",lineMiterLimit:"miterLimit",lineBillboard:"billboard",getLineColor:"getColor",getLineWidth:"getWidth"}},p={type:u.Z,props:{extruded:"extruded",filled:"filled",wireframe:"wireframe",elevationScale:"elevationScale",material:"material",getElevation:"getElevation",getFillColor:"getFillColor",getLineColor:"getLineColor"}};function A(t){let{type:e,props:i}=t;const n={};for(const r in i)n[r]=e.defaultProps[i[r]];return n}function f(t,e){const{transitions:i,updateTriggers:n}=t.props,r={updateTriggers:{},transitions:i&&{getPosition:i.geometry}};for(const o in e){const s=e[o];let a=t.props[o];o.startsWith("get")&&(a=t.getSubLayerAccessor(a),r.updateTriggers[s]=n[o],i&&(r.transitions[s]=i[o])),r[s]=a}return r}var g=i(21970);function m(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={pointFeatures:[],lineFeatures:[],polygonFeatures:[],polygonOutlineFeatures:[]},{startRow:r=0,endRow:o=t.length}=i;for(let s=r;s<o;s++){const i=t[s],{geometry:r}=i;if(r)if("GeometryCollection"===r.type){g.Z.assert(Array.isArray(r.geometries),"GeoJSON does not have geometries array");const{geometries:t}=r;for(let r=0;r<t.length;r++){y(t[r],n,e,i,s)}}else y(r,n,e,i,s)}return n}function y(t,e,i,n,r){const{type:o,coordinates:s}=t,{pointFeatures:a,lineFeatures:l,polygonFeatures:c,polygonOutlineFeatures:u}=e;if(function(t,e){let i=v[t];g.Z.assert(i,"Unknown GeoJSON type ".concat(t));for(;e&&--i>0;)e=e[0];return e&&Number.isFinite(e[0])}(o,s))switch(o){case"Point":a.push(i({geometry:t},n,r));break;case"MultiPoint":s.forEach((t=>{a.push(i({geometry:{type:"Point",coordinates:t}},n,r))}));break;case"LineString":l.push(i({geometry:t},n,r));break;case"MultiLineString":s.forEach((t=>{l.push(i({geometry:{type:"LineString",coordinates:t}},n,r))}));break;case"Polygon":c.push(i({geometry:t},n,r)),s.forEach((t=>{u.push(i({geometry:{type:"LineString",coordinates:t}},n,r))}));break;case"MultiPolygon":s.forEach((t=>{c.push(i({geometry:{type:"Polygon",coordinates:t}},n,r)),t.forEach((t=>{u.push(i({geometry:{type:"LineString",coordinates:t}},n,r))}))}))}else g.Z.warn("".concat(o," coordinates are malformed"))()}const v={Point:1,MultiPoint:2,LineString:2,MultiLineString:3,Polygon:3,MultiPolygon:4};function _(t){return t.geometry.coordinates}function b(t,e){const i={points:{},lines:{},polygons:{},polygonsOutline:{}},{points:n,lines:r,polygons:o}=t,s=function(t,e){const i={points:null,lines:null,polygons:null};for(const n in i){const r=t[n].globalFeatureIds.value;i[n]=new Uint8ClampedArray(3*r.length);const o=[];for(let t=0;t<r.length;t++)e(r[t],o),i[n][3*t+0]=o[0],i[n][3*t+1]=o[1],i[n][3*t+2]=o[2]}return i}(t,e);return i.points.data={length:n.positions.value.length/n.positions.size,attributes:{...n.attributes,getPosition:n.positions,instancePickingColors:{size:3,value:s.points}},properties:n.properties,numericProps:n.numericProps,featureIds:n.featureIds},i.lines.data={length:r.pathIndices.value.length-1,startIndices:r.pathIndices.value,attributes:{...r.attributes,getPath:r.positions,instancePickingColors:{size:3,value:s.lines}},properties:r.properties,numericProps:r.numericProps,featureIds:r.featureIds},i.lines._pathType="open",i.polygons.data={length:o.polygonIndices.value.length-1,startIndices:o.polygonIndices.value,attributes:{...o.attributes,getPolygon:o.positions,pickingColors:{size:3,value:s.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},i.polygons._normalize=!1,o.triangles&&(i.polygons.data.attributes.indices=o.triangles.value),i.polygonsOutline.data={length:o.primitivePolygonIndices.value.length-1,startIndices:o.primitivePolygonIndices.value,attributes:{...o.attributes,getPath:o.positions,instancePickingColors:{size:3,value:s.polygons}},properties:o.properties,numericProps:o.numericProps,featureIds:o.featureIds},i.polygonsOutline._pathType="open",i}const x=["points","linestrings","polygons"],w={...A(h.circle),...A(h.icon),...A(h.text),...A(d),...A(p),stroked:!0,filled:!0,extruded:!1,wireframe:!1,iconAtlas:{type:"object",value:null},iconMapping:{type:"object",value:{}},getIcon:{type:"accessor",value:t=>t.properties.icon},getText:{type:"accessor",value:t=>t.properties.text},pointType:"circle",getRadius:{deprecatedFor:"getPointRadius"}};class C extends r.Z{initializeState(){this.state={layerProps:{},features:{}}}updateState(t){let{props:e,changeFlags:i}=t;if(!i.dataChanged)return;const{data:n}=this.props,r=n&&"points"in n&&"polygons"in n&&"lines"in n;this.setState({binary:r}),r?this._updateStateBinary({props:e,changeFlags:i}):this._updateStateJSON({props:e,changeFlags:i})}_updateStateBinary(t){let{props:e,changeFlags:i}=t;const n=b(e.data,this.encodePickingColor);this.setState({layerProps:n})}_updateStateJSON(t){let{props:e,changeFlags:i}=t;const n=function(t){if(Array.isArray(t))return t;switch(g.Z.assert(t.type,"GeoJSON does not have type"),t.type){case"Feature":return[t];case"FeatureCollection":return g.Z.assert(Array.isArray(t.features),"GeoJSON does not have features array"),t.features;default:return[{geometry:t}]}}(e.data),r=this.getSubLayerRow.bind(this);let s={};const a={};if(Array.isArray(i.dataChanged)){const t=this.state.features;for(const e in t)s[e]=t[e].slice(),a[e]=[];for(const e of i.dataChanged){const i=m(n,r,e);for(const n in t)a[n].push((0,o.b)({data:s[n],getIndex:t=>t.__source.index,dataRange:e,replace:i[n]}))}}else s=m(n,r);const l=function(t,e){const i={points:{},lines:{},polygons:{},polygonsOutline:{}},{pointFeatures:n,lineFeatures:r,polygonFeatures:o,polygonOutlineFeatures:s}=t;return i.points.data=n,i.points._dataDiff=e.pointFeatures&&(()=>e.pointFeatures),i.points.getPosition=_,i.lines.data=r,i.lines._dataDiff=e.lineFeatures&&(()=>e.lineFeatures),i.lines.getPath=_,i.polygons.data=o,i.polygons._dataDiff=e.polygonFeatures&&(()=>e.polygonFeatures),i.polygons.getPolygon=_,i.polygonsOutline.data=s,i.polygonsOutline._dataDiff=e.polygonOutlineFeatures&&(()=>e.polygonOutlineFeatures),i.polygonsOutline.getPath=_,i}(s,a);this.setState({features:s,featuresDiff:a,layerProps:l})}getPickingInfo(t){const e=super.getPickingInfo(t),{index:i,sourceLayer:n}=e;return e.featureType=x.find((t=>n.id.startsWith("".concat(this.id,"-").concat(t,"-")))),i>=0&&n.id.startsWith("".concat(this.id,"-points-text"))&&this.state.binary&&(e.index=this.props.data.points.globalFeatureIds.value[i]),e}_updateAutoHighlight(t){const e="".concat(this.id,"-points-"),i="points"===t.featureType;
2for(const n of this.getSubLayers())n.id.startsWith(e)===i&&n.updateAutoHighlight(t)}_renderPolygonLayer(){const{extruded:t,wireframe:e}=this.props,{layerProps:i}=this.state,n="polygons-fill",r=this.shouldRenderSubLayer(n,i.polygons.data)&&this.getSubLayerClass(n,p.type);if(r){const o=f(this,p.props),s=t&&e;return s||delete o.getLineColor,o.updateTriggers.lineColors=s,new r(o,this.getSubLayerProps({id:n,updateTriggers:o.updateTriggers}),i.polygons)}return null}_renderLineLayers(){const{extruded:t,stroked:e}=this.props,{layerProps:i}=this.state,n="polygons-stroke",r="linestrings",o=!t&&e&&this.shouldRenderSubLayer(n,i.polygonsOutline.data)&&this.getSubLayerClass(n,d.type),s=this.shouldRenderSubLayer(r,i.lines.data)&&this.getSubLayerClass(r,d.type);if(o||s){const t=f(this,d.props);return[o&&new o(t,this.getSubLayerProps({id:n,updateTriggers:t.updateTriggers}),i.polygonsOutline),s&&new s(t,this.getSubLayerProps({id:r,updateTriggers:t.updateTriggers}),i.lines)]}return null}_renderPointLayers(){const{pointType:t}=this.props,{layerProps:e,binary:i}=this.state;let{highlightedObjectIndex:n}=this.props;!i&&Number.isFinite(n)&&(n=e.points.data.findIndex((t=>t.__source.index===n)));const r=new Set(t.split("+")),o=[];for(const s of r){const t="points-".concat(s),r=h[s],a=r&&this.shouldRenderSubLayer(t,e.points.data)&&this.getSubLayerClass(t,r.type);if(a){const l=f(this,r.props);let c=e.points;if("text"===s&&i){const{instancePickingColors:t,...e}=c.data.attributes;c={...c,data:{...c.data,attributes:e}}}o.push(new a(l,this.getSubLayerProps({id:t,updateTriggers:l.updateTriggers,highlightedObjectIndex:n}),c))}}return o}renderLayers(){const{extruded:t}=this.props,e=this._renderPolygonLayer();return[!t&&e,this._renderLineLayers(),this._renderPointLayers(),t&&e]}getSubLayerAccessor(t){const{binary:e}=this.state;return e&&"function"===typeof t?(e,i)=>{const{data:n,index:r}=i,o=function(t,e){if(!t)return null;const i="startIndices"in t?t.startIndices[e]:e,n=t.featureIds.value[i];return-1!==i?function(t,e,i){const n={properties:{...t.properties[e]}};for(const r in t.numericProps)n.properties[r]=t.numericProps[r].value[i];return n}(t,n,i):null}(n,r);return t(o,i)}:super.getSubLayerAccessor(t)}}(0,n.Z)(C,"layerName","GeoJsonLayer"),(0,n.Z)(C,"defaultProps",w)},32296:(t,e,i)=>{"use strict";i.d(e,{Z:()=>C});var n=i(64649),r=i(90031),o=i(2123),s=i(2578),a=i(18252),l=i(21970),c=i(94557),u=i(69296);var h=i(58300),d=i(56474),p=i(21440),A=i(65959),f=i(73115);const g=()=>{},m={10241:9987,10240:9729,10242:33071,10243:33071};function y(t,e,i,n){return i===e.width&&n===e.height?e:(t.canvas.height=n,t.canvas.width=i,t.clearRect(0,0,t.canvas.width,t.canvas.height),t.drawImage(e,0,0,e.width,e.height,0,0,i,n),t.canvas)}function v(t){return t&&(t.id||t.url)}function _(t,e,i){for(let n=0;n<e.length;n++){const{icon:r,xOffset:o}=e[n];t[v(r)]={...r,x:o,y:i}}}class b{constructor(t,e){let{onUpdate:i=g,onError:r=g}=e;(0,n.Z)(this,"gl",void 0),(0,n.Z)(this,"onUpdate",void 0),(0,n.Z)(this,"onError",void 0),(0,n.Z)(this,"_loadOptions",null),(0,n.Z)(this,"_texture",null),(0,n.Z)(this,"_externalTexture",null),(0,n.Z)(this,"_mapping",{}),(0,n.Z)(this,"_textureParameters",null),(0,n.Z)(this,"_pendingCount",0),(0,n.Z)(this,"_autoPacking",!1),(0,n.Z)(this,"_xOffset",0),(0,n.Z)(this,"_yOffset",0),(0,n.Z)(this,"_rowHeight",0),(0,n.Z)(this,"_buffer",4),(0,n.Z)(this,"_canvasWidth",1024),(0,n.Z)(this,"_canvasHeight",0),(0,n.Z)(this,"_canvas",null),this.gl=t,this.onUpdate=i,this.onError=r}finalize(){var t;null===(t=this._texture)||void 0===t||t.delete()}getTexture(){return this._texture||this._externalTexture}getIconMapping(t){const e=this._autoPacking?v(t):t;return this._mapping[e]||{}}setProps(t){let{loadOptions:e,autoPacking:i,iconAtlas:n,iconMapping:r,textureParameters:o}=t;var s;(e&&(this._loadOptions=e),void 0!==i&&(this._autoPacking=i),r&&(this._mapping=r),n)&&(null===(s=this._texture)||void 0===s||s.delete(),this._texture=null,this._externalTexture=n);o&&(this._textureParameters=o)}get isLoaded(){return 0===this._pendingCount}packIcons(t,e){if(!this._autoPacking||"undefined"===typeof document)return;
2const i=Object.values(function(t,e,i){if(!t||!e)return null;i=i||{};const n={},{iterable:r,objectInfo:o}=(0,f.jB)(t);for(const s of r){o.index++;const t=e(s,o),r=v(t);if(!t)throw new Error("Icon is missing.");if(!t.url)throw new Error("Icon url is missing.");n[r]||i[r]&&t.url===i[r].url||(n[r]={...t,source:s,sourceIndex:o.index})}return n}(t,e,this._mapping)||{});if(i.length>0){const{mapping:t,xOffset:e,yOffset:n,rowHeight:r,canvasHeight:o}=function(t){let{icons:e,buffer:i,mapping:n={},xOffset:r=0,yOffset:o=0,rowHeight:s=0,canvasWidth:a}=t,l=[];for(let u=0;u<e.length;u++){const t=e[u];if(!n[v(t)]){const{height:e,width:c}=t;r+c+i>a&&(_(n,l,o),r=0,o=s+o+i,s=0,l=[]),l.push({icon:t,xOffset:r}),r=r+c+i,s=Math.max(s,e)}}return l.length>0&&_(n,l,o),{mapping:n,rowHeight:s,xOffset:r,yOffset:o,canvasWidth:a,canvasHeight:(c=s+o+i,Math.pow(2,Math.ceil(Math.log2(c))))};var c}({icons:i,buffer:this._buffer,canvasWidth:this._canvasWidth,mapping:this._mapping,rowHeight:this._rowHeight,xOffset:this._xOffset,yOffset:this._yOffset});this._rowHeight=r,this._mapping=t,this._xOffset=e,this._yOffset=n,this._canvasHeight=o,this._texture||(this._texture=new h.Z(this.gl,{width:this._canvasWidth,height:this._canvasHeight,parameters:this._textureParameters||m})),this._texture.height!==this._canvasHeight&&(this._texture=function(t,e,i,n){const r=t.width,o=t.height,s=new h.Z(t.gl,{width:e,height:i,parameters:n});return(0,d.Lv)(t,s,{targetY:0,width:r,height:o}),t.delete(),s}(this._texture,this._canvasWidth,this._canvasHeight,this._textureParameters||m)),this.onUpdate(),this._canvas=this._canvas||document.createElement("canvas"),this._loadIcons(i)}}_loadIcons(t){const e=this._canvas.getContext("2d");for(const i of t)this._pendingCount++,(0,A.z)(i.url,p.S,this._loadOptions).then((t=>{const n=v(i),{x:r,y:o,width:s,height:a}=this._mapping[n],l=y(e,t,s,a);this._texture.setSubImageData({data:l,x:r,y:o,width:s,height:a}),this._texture.generateMipmap(),this.onUpdate()})).catch((t=>{this.onError({url:i.url,source:i.source,sourceIndex:i.sourceIndex,loadOptions:this._loadOptions,error:t})})).finally((()=>{this._pendingCount--}))}}const x=[0,0,0,255],w={iconAtlas:{type:"image",value:null,async:!0},iconMapping:{type:"object",value:{},async:!0},sizeScale:{type:"number",value:1,min:0},billboard:!0,sizeUnits:"pixels",sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},alphaCutoff:{type:"number",value:.05,min:0,max:1},getPosition:{type:"accessor",value:t=>t.position},getIcon:{type:"accessor",value:t=>t.icon},getColor:{type:"accessor",value:x},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},onIconError:{type:"function",value:null,compare:!1,optional:!0}};class C extends r.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:'#define SHADER_NAME icon-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute vec4 instanceIconFrames;\nattribute float instanceColorModes;\nattribute vec2 instanceOffsets;\nattribute vec2 instancePixelOffset;\n\nuniform float sizeScale;\nuniform vec2 iconsTextureDim;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform bool billboard;\nuniform int sizeUnits;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n  float angle_radian = angle * PI / 180.0;\n  float cos_angle = cos(angle_radian);\n  float sin_angle = sin(angle_radian);\n  mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n  return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.uv = positions;\n  geometry.pickingColor = instancePickingColors;\n  uv = positions;\n\n  vec2 iconSize = instanceIconFrames.zw;\n  // convert size in meters to pixels, then scaled and clamp\n \n  // project meters to pixels and clamp to limits \n  float sizePixels = clamp(\n    project_size_to_pixel(instanceSizes * sizeScale, sizeUnits), \n    sizeMinPi
2xels, sizeMaxPixels\n  );\n\n  // scale icon height to match instanceSize\n  float instanceScale = iconSize.y == 0.0 ? 0.0 : sizePixels / iconSize.y;\n\n  // scale and rotate vertex in "pixel" value and convert back to fraction in clipspace\n  vec2 pixelOffset = positions / 2.0 * iconSize + instanceOffsets;\n  pixelOffset = rotate_by_angle(pixelOffset, instanceAngles) * instanceScale;\n  pixelOffset += instancePixelOffset;\n  pixelOffset.y *= -1.0;\n\n  if (billboard)  {\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n    vec3 offset = vec3(pixelOffset, 0.0);\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n\n  } else {\n    vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n    DECKGL_FILTER_SIZE(offset_common, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position); \n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vTextureCoords = mix(\n    instanceIconFrames.xy,\n    instanceIconFrames.xy + iconSize,\n    (positions.xy + 1.0) / 2.0\n  ) / iconsTextureDim;\n\n  vColor = instanceColors;\n  DECKGL_FILTER_COLOR(vColor, geometry);\n\n  vColorMode = instanceColorModes;\n}\n',fs:"#define SHADER_NAME icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float alphaCutoff;\n\nvarying float vColorMode;\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  vec4 texColor = texture2D(iconsTexture, vTextureCoords);\n\n  // if colorMode == 0, use pixel color from the texture\n  // if colorMode == 1 or rendering picking buffer, use texture as transparency mask\n  vec3 color = mix(texColor.rgb, vColor.rgb, vColorMode);\n  // Take the global opacity and the alpha from vColor into account for the alpha component\n  float a = texColor.a * opacity * vColor.a;\n\n  if (a < alphaCutoff) {\n    discard;\n  }\n\n  gl_FragColor = vec4(color, a);\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}initializeState(){this.state={iconManager:new b(this.context.gl,{onUpdate:this._onUpdate.bind(this),onError:this._onError.bind(this)})};this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceOffsets:{size:2,accessor:"getIcon",transform:this.getInstanceOffset},instanceIconFrames:{size:4,accessor:"getIcon",transform:this.getInstanceIconFrame},instanceColorModes:{size:1,type:5121,accessor:"getIcon",transform:this.getInstanceColorMode},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:x},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instancePixelOffset:{size:2,transition:!0,accessor:"getPixelOffset"}})}updateState(t){super.updateState(t);const{props:e,oldProps:i,changeFlags:n}=t,r=this.getAttributeManager(),{iconAtlas:o,iconMapping:s,data:a,getIcon:l,textureParameters:c}=e,{iconManager:u}=this.state,h=o||this.internalState.isAsyncPropLoading("iconAtlas");if(u.setProps({loadOptions:e.loadOptions,autoPacking:!h,iconAtlas:o,iconMapping:h?s:null,textureParameters:c}),h?i.iconMapping!==e.iconMapping&&r.invalidate("getIcon"):(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getIcon))&&u.packIcons(a,l),n.extensionsChanged){var d;const{gl:t}=this.context;null===(d=this.state.model)||void 0===d||d.delete(),this.state.model=this._getModel(t),r.invalidateAll()}}get isLoaded(){return super.isLoaded&&this.state.iconManager.isLoaded}finalizeState(t){super.finalizeState(t),this.state.iconManager.finalize()}draw(t){let{uniforms:e}=t;const{sizeScale:i,sizeMinPixels:n,sizeMaxPixels:r,sizeUnits:o,billboard:s,alphaCutoff:l}=this.props,{iconManager:c}=this.state,u=c.getTexture();u&&this.state.model.setUniforms(e).setUniforms({iconsTexture:u,iconsTextureDim:[u.width,u.height],sizeUnits:a.iI[o],sizeScale:i,sizeMinPi
2xels:n,sizeMaxPixels:r,billboard:s,alphaCutoff:l}).draw()}_getModel(t){return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new u.Z({drawMode:6,attributes:{positions:{size:2,value:new Float32Array([-1,-1,-1,1,1,1,1,-1])}}}),isInstanced:!0})}_onUpdate(){this.setNeedsRedraw()}_onError(t){var e;const i=null===(e=this.getCurrentLayer())||void 0===e?void 0:e.props.onIconError;i?i(t):l.Z.error(t.error.message)()}getInstanceOffset(t){const{width:e,height:i,anchorX:n=e/2,anchorY:r=i/2}=this.state.iconManager.getIconMapping(t);return[e/2-n,i/2-r]}getInstanceColorMode(t){return this.state.iconManager.getIconMapping(t).mask?1:0}getInstanceIconFrame(t){const{x:e,y:i,width:n,height:r}=this.state.iconManager.getIconMapping(t);return[e,i,n,r]}}(0,n.Z)(C,"defaultProps",w),(0,n.Z)(C,"layerName","IconLayer")},43536:(t,e,i)=>{"use strict";i.r(e),i.d(e,{ArcLayer:()=>n.Z,BitmapLayer:()=>v,ColumnLayer:()=>B.Z,GeoJsonLayer:()=>M.Z,GridCellLayer:()=>E.Z,IconLayer:()=>b.Z,LineLayer:()=>x.Z,PathLayer:()=>S.Z,PointCloudLayer:()=>w.Z,PolygonLayer:()=>T.Z,ScatterplotLayer:()=>C.Z,SolidPolygonLayer:()=>P.Z,TextLayer:()=>I.Z,_MultiIconLayer:()=>D.Z,_TextBackgroundLayer:()=>L.Z});var n=i(73351),r=i(64649),o=i(18252),s=i(90031),a=i(2123),l=i(2578),c=i(94557),u=i(69296),h=i(75818),d=i(47410);const p=new Uint16Array([0,2,1,0,3,2]),A=new Float32Array([0,1,0,0,1,0,1,1]);function f(t,e){if(!e)return function(t){const e=new Float64Array(12);for(let i=0;i<t.length;i++)e[3*i+0]=t[i][0],e[3*i+1]=t[i][1],e[3*i+2]=t[i][2]||0;return{vertexCount:6,positions:e,indices:p,texCoords:A}}(t);const i=Math.max(Math.abs(t[0][0]-t[3][0]),Math.abs(t[1][0]-t[2][0])),n=Math.max(Math.abs(t[1][1]-t[0][1]),Math.abs(t[2][1]-t[3][1])),r=Math.ceil(i/e)+1,o=Math.ceil(n/e)+1,s=(r-1)*(o-1)*6,a=new Uint32Array(s),l=new Float32Array(r*o*2),c=new Float64Array(r*o*3);let u=0,h=0;for(let d=0;d<r;d++){const e=d/(r-1);for(let i=0;i<o;i++){const n=i/(o-1),r=g(t,e,n);c[3*u+0]=r[0],c[3*u+1]=r[1],c[3*u+2]=r[2]||0,l[2*u+0]=e,l[2*u+1]=1-n,d>0&&i>0&&(a[h++]=u-o,a[h++]=u-o-1,a[h++]=u-1,a[h++]=u-o,a[h++]=u-1,a[h++]=u),u++}}return{vertexCount:s,positions:c,indices:a,texCoords:l}}function g(t,e,i){return(0,d.t7)((0,d.t7)(t[0],t[1],i),(0,d.t7)(t[3],t[2],i),e)}const m="\n#define SHADER_NAME bitmap-layer-fragment-shader\n\n#ifdef GL_ES\nprecision highp float;\n#endif\n\nuniform sampler2D bitmapTexture;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float desaturate;\nuniform vec4 transparentColor;\nuniform vec3 tintColor;\nuniform float opacity;\n\nuniform float coordinateConversion;\nuniform vec4 bounds;\n\n/* projection utils */\nconst float TILE_SIZE = 512.0;\nconst float PI = 3.1415926536;\nconst float WORLD_SCALE = TILE_SIZE / PI / 2.0;\n\n// from degrees to Web Mercator\nvec2 lnglat_to_mercator(vec2 lnglat) {\n  float x = lnglat.x;\n  float y = clamp(lnglat.y, -89.9, 89.9);\n  return vec2(\n    radians(x) + PI,\n    PI + log(tan(PI * 0.25 + radians(y) * 0.5))\n  ) * WORLD_SCALE;\n}\n\n// from Web Mercator to degrees\nvec2 mercator_to_lnglat(vec2 xy) {\n  xy /= WORLD_SCALE;\n  return degrees(vec2(\n    xy.x - PI,\n    atan(exp(xy.y - PI)) * 2.0 - PI * 0.5\n  ));\n}\n/* End projection utils */\n\n// apply desaturation\nvec3 color_desaturate(vec3 color) {\n  float luminance = (color.r + color.g + color.b) * 0.333333333;\n  return mix(color, vec3(luminance), desaturate);\n}\n\n// apply tint\nvec3 color_tint(vec3 color) {\n  return color * tintColor;\n}\n\n// blend with background color\nvec4 apply_opacity(vec3 color, float alpha) {\n  return mix(transparentColor, vec4(color, 1.0), alpha);\n}\n\nvec2 getUV(vec2 pos) {\n  return vec2(\n    (pos.x - bounds[0]) / (bounds[2] - bounds[0]),\n    (pos.y - bounds[3]) / (bounds[1] - bounds[3])\n  );\n}\n\n".concat("\nvec3 packUVsIntoRGB(vec2 uv) {\n  // Extract the top 8 bits. We want values to be truncated down so we can add a fraction\n  vec2 uv8bit = floor(uv * 256.);\n\n  // Calculate the normalized remainders of u and v parts that do not fit into 8 bits\n  // Scale and clamp to 0-1 range\n  vec2 uvFraction = fract(uv * 256.);\n  vec2 uvFraction4bit = floor(uvFraction * 16.);\n\n  // Remainder can be encoded in blue channel, encode as 4 bits for pixel coordinates\n  float fractions = uvFraction4bit.x + uvFraction4bit.y * 16.;
2\n\n  return vec3(uv8bit, fractions) / 255.;\n}\n","\n\nvoid main(void) {\n  vec2 uv = vTexCoord;\n  if (coordinateConversion < -0.5) {\n    vec2 lnglat = mercator_to_lnglat(vTexPos);\n    uv = getUV(lnglat);\n  } else if (coordinateConversion > 0.5) {\n    vec2 commonPos = lnglat_to_mercator(vTexPos);\n    uv = getUV(commonPos);\n  }\n  vec4 bitmapColor = texture2D(bitmapTexture, uv);\n\n  gl_FragColor = apply_opacity(color_tint(color_desaturate(bitmapColor.rgb)), bitmapColor.a * opacity);\n\n  geometry.uv = uv;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n\n  if (picking_uActive) {\n    // Since instance information is not used, we can use picking color for pixel index\n    gl_FragColor.rgb = packUVsIntoRGB(uv);\n  }\n}\n"),y={image:{type:"image",value:null,async:!0},bounds:{type:"array",value:[1,0,0,1],compare:!0},_imageCoordinateSystem:o.Df.DEFAULT,desaturate:{type:"number",min:0,max:1,value:0},transparentColor:{type:"color",value:[0,0,0,0]},tintColor:{type:"color",value:[255,255,255]}};class v extends s.Z{constructor(){super(...arguments),(0,r.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:"\n#define SHADER_NAME bitmap-layer-vertex-shader\n\nattribute vec2 texCoords;\nattribute vec3 positions;\nattribute vec3 positions64Low;\n\nvarying vec2 vTexCoord;\nvarying vec2 vTexPos;\n\nuniform float coordinateConversion;\n\nconst vec3 pickingColor = vec3(1.0, 0.0, 0.0);\n\nvoid main(void) {\n  geometry.worldPosition = positions;\n  geometry.uv = texCoords;\n  geometry.pickingColor = pickingColor;\n\n  gl_Position = project_position_to_clipspace(positions, positions64Low, vec3(0.0), geometry.position);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  vTexCoord = texCoords;\n\n  if (coordinateConversion < -0.5) {\n    vTexPos = geometry.position.xy + project_uCommonOrigin.xy;\n  } else if (coordinateConversion > 0.5) {\n    vTexPos = geometry.worldPosition.xy;\n  }\n\n  vec4 color = vec4(0.0);\n  DECKGL_FILTER_COLOR(color, geometry);\n}\n",fs:m,modules:[a.Z,l.Z]})}initializeState(){const t=this.getAttributeManager();t.remove(["instancePickingColors"]);const e=!0;t.add({indices:{size:1,isIndexed:!0,update:t=>t.value=this.state.mesh.indices,noAlloc:e},positions:{size:3,type:5130,fp64:this.use64bitPositions(),update:t=>t.value=this.state.mesh.positions,noAlloc:e},texCoords:{size:2,update:t=>t.value=this.state.mesh.texCoords,noAlloc:e}})}updateState(t){let{props:e,oldProps:i,changeFlags:n}=t;const r=this.getAttributeManager();if(n.extensionsChanged){var o;const{gl:t}=this.context;null===(o=this.state.model)||void 0===o||o.delete(),this.state.model=this._getModel(t),r.invalidateAll()}if(e.bounds!==i.bounds){const t=this.state.mesh,e=this._createMesh();this.state.model.setVertexCount(e.vertexCount);for(const i in e)t&&t[i]!==e[i]&&r.invalidate(i);this.setState({mesh:e,...this._getCoordinateUniforms()})}else e._imageCoordinateSystem!==i._imageCoordinateSystem&&this.setState(this._getCoordinateUniforms())}getPickingInfo(t){const{image:e}=this.props,i=t.info;if(!i.color||!e)return i.bitmap=null,i;const{width:n,height:r}=e;i.index=0;const o=function(t){const[e,i,n]=t;return[(e+(15&n)/16)/256,(i+(240&n)/256)/256]}(i.color),s=[Math.floor(o[0]*n),Math.floor(o[1]*r)];return i.bitmap={size:{width:n,height:r},uv:o,pixel:s},i}disablePickingIndex(){this.setState({disablePicking:!0})}restorePickingColors(){this.setState({disablePicking:!1})}_updateAutoHighlight(t){super._updateAutoHighlight({...t,color:this.encodePickingColor(0)})}_createMesh(){const{bounds:t}=this.props;let e=t;return _(t)&&(e=[[t[0],t[1]],[t[0],t[3]],[t[2],t[3]],[t[2],t[1]]]),f(e,this.context.viewport.resolution)}_getModel(t){return t?new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new u.Z({drawMode:4,vertexCount:6}),isInstanced:!1}):null}draw(t){const{uniforms:e,moduleParameters:i}=t,{model:n,coordinateConversion:r,bounds:o,disablePicking:s}=this.state,{image:a,desaturate:l,transparentColor:c,tintColor:u}=this.props;i.pickingActive&&s||a&&n&&n.setUniforms(e).setUniforms({bitmapTexture:a,desaturate:l,transparentColor:c.map((t=>t/255)),tintColor:u.slice(0,3).map((t=>t/255)),coordinateConversion:r,bounds:o}).draw()}_getCoordinateUniforms(){const{LNGLAT:t,CARTESIAN:e,DEFAULT:i}=o.Df;let{_imageCoordinateSystem:n}=this.props;if(n!==i){const{bounds:i}=this.props;if(!_(i))throw new Error("_imageCoordinateSystem only supports rectangular bounds");const r=this.context.viewport.resolution?t:e;if(n=n===t?t:e,n===t&&r===e)return{coordinateConversion:-1,bounds:i};if(n===e&&r===t){const t=(0,h.w5)([i[0],i[1]]),e=(0,h.w5)([i[2],i[3]]);return{coordinateConversion:1,bounds:[t[0],t[1],e[0],e[1]]}}}return{coordinateConversion:0,bounds:[0,0,0,0]}}}function _(t){return Number.isFinite(t[0])}(0,r.Z)(v,"layerName","BitmapLayer"),(0,r.Z)(v,"defaultProps",y);var b=i(32296),x=i(24985),w=i(11162),C=i(87403),B=i(35387),E=i(90555),S=i(69554),T=i(94300),M=i(43610),I=i(8086),P=i(3453),D=i(20377),L=i(56394)},24985:(t,e,i)=>{"use strict";i.d(e,{Z:()=>h});var n=i(64649),r=i(90031),o=i(2123),s=i(2578),a=i(18252),l=i(94557),c=i(69296);const u={getSourcePosition:{type:"accessor",value:t=>t.sourcePosition},getTargetPosition:{type:"accessor",value:t=>t.targetPosition},getColor:{type:"accessor",value:[0,0,0,255]},getWidth:{type:"accessor",value:1},widthUnits:"pixels",widthScale:{type:"number",value:1,min:0},widthMinPixels:{type:"number",value:0,min:0},widthMaxPixels:{type:"number",value:Number.MAX_SAFE_INTEGER,min:0}};class h extends r.Z{getShaders(){return super.getShaders({vs:"#define SHADER_NAME line-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceSourcePositions;\nattribute vec3 instanceTargetPositions;\nattribute vec3 instanceSourcePositions64Low;\nattribute vec3 instanceTargetPositions64Low;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\nattribute float instanceWidths;\n\nuniform float opacity;\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;
2\nuniform float useShortestPath;\nuniform int widthUnits;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\n// offset vector by strokeWidth pixels\n// offset_direction is -1 (left) or 1 (right)\nvec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) {\n  // normalized direction of the line\n  vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize);\n  // rotate by 90 degrees\n  dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x);\n\n  return dir_screenspace * offset_direction * width / 2.0;\n}\n\nvec3 splitLine(vec3 a, vec3 b, float x) {\n  float t = (x - a.x) / (b.x - a.x);\n  return vec3(x, mix(a.yz, b.yz, t));\n}\n\nvoid main(void) {\n  geometry.worldPosition = instanceSourcePositions;\n  geometry.worldPositionAlt = instanceTargetPositions;\n\n  vec3 source_world = instanceSourcePositions;\n  vec3 target_world = instanceTargetPositions;\n  vec3 source_world_64low = instanceSourcePositions64Low;\n  vec3 target_world_64low = instanceTargetPositions64Low;\n\n  if (useShortestPath > 0.5 || useShortestPath < -0.5) {\n    source_world.x = mod(source_world.x + 180., 360.
20) - 180.;\n    target_world.x = mod(target_world.x + 180., 360.0) - 180.;\n    float deltaLng = target_world.x - source_world.x;\n\n    if (deltaLng * useShortestPath > 180.) {\n      source_world.x += 360. * useShortestPath;\n      source_world = splitLine(source_world, target_world, 180. * useShortestPath);\n      source_world_64low = vec3(0.0);\n    } else if (deltaLng * useShortestPath < -180.) {\n      target_world.x += 360. * useShortestPath;\n      target_world = splitLine(source_world, target_world, 180. * useShortestPath);\n      target_world_64low = vec3(0.0);\n    } else if (useShortestPath < 0.) {\n      // Line is not split, abort\n      gl_Position = vec4(0.);\n      return;\n    }\n  }\n\n  // Position\n  vec4 source_commonspace;\n  vec4 target_commonspace;\n  vec4 source = project_position_to_clipspace(source_world, source_world_64low, vec3(0.), source_commonspace);\n  vec4 target = project_position_to_clipspace(target_world, target_world_64low, vec3(0.), target_commonspace);\n  \n  // linear interpolation of source & target to pick right coord\n  float segmentIndex = positions.x;\n  vec4 p = mix(source, target, segmentIndex);\n  geometry.position = mix(source_commonspace, target_commonspace, segmentIndex);\n  uv = positions.xy;\n  geometry.uv = uv;\n  geometry.pickingColor = instancePickingColors;\n\n  // Multiply out width and clamp to limits\n  float widthPixels = clamp(\n    project_size_to_pixel(instanceWidths * widthScale, widthUnits),\n    widthMinPixels, widthMaxPixels\n  );\n\n  // extrude\n  vec3 offset = vec3(\n    getExtrusionOffset(target.xy - source.xy, positions.y, widthPixels),\n    0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n  gl_Position = p + vec4(project_pixel_size_to_clipspace(offset.xy), 0.0, 0.0);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Color\n  vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME line-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({instanceSourcePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getSourcePosition"},instanceTargetPositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getTargetPosition"},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceWidths:{size:1,transition:!0,accessor:"getWidth",defaultValue:1}})}updateState(t){if(super.updateState(t),t.changeFlags.extensionsChanged){var e;const{gl:t}=this.context;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw(t){let{uniforms:e}=t;const{widthUnits:i,widthScale:n,widthMinPixels:r,widthMaxPixels:o,wrapLongitude:s}=this.props;this.state.model.setUniforms(e).setUniforms({widthUnits:a.iI[i],widthScale:n,widthMinPixels:r,widthMaxPixels:o,useShortestPath:s?1:0}).draw(),s&&this.state.model.setUniforms({useShortestPath:-1}).draw()}_getModel(t){return new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:5,attributes:{positions:new Float32Array([0,-1,0,0,1,0,1,-1,0,1,1,0])}}),isInstanced:!0})}}(0,n.Z)(h,"layerName","LineLayer"),(0,n.Z)(h,"defaultProps",u)},69554:(t,e,i)=>{"use strict";i.d(e,{Z:()=>m});var n=i(64649),r=i(90031),o=i(2123),s=i(2578),a=i(18252),l=i(94557),c=i(69296),u=i(55678),h=i(23595);class d extends u.Z{constructor(t){super({...t,attributes:{positions:{size:3,padding:18,initialize:!0,type:t.fp64?Float64Array:Float32Array},segmentTypes:{size:1,type:Uint8ClampedArray}}})}get(t){return this.attributes[t]}getGeometryFromBuffer(t){return this.normalize?super.getGeometryFromBuffer(t):null}normalizeGeometry(t){return this.normalize?function(t,e,i,n){let r;if(Array.isArray(t[0])){const i=t.length*e;r=new Array(i);for(let n=0;n<t.length;n++)for(let i=0;i<e;i++)r[n*e+i]=t[n][i]||0}else r=t;
vendor: 9,498 bytes, line 2
2return i?(0,h.dj)(r,{size:e,gridResolution:i}):n?(0,h.ct)(r,{size:e}):r}(t,this.positionSize,this.opts.resolution,this.opts.wrapLongitude):t}getGeometrySize(t){if(p(t)){let e=0;for(const i of t)e+=this.getGeometrySize(i);return e}const e=this.getPathLength(t);return e<2?0:this.isClosed(t)?e<3?0:e+2:e}updateGeometryAttributes(t,e){if(0!==e.geometrySize)if(t&&p(t))for(const i of t){const t=this.getGeometrySize(i);e.geometrySize=t,this.updateGeometryAttributes(i,e),e.vertexStart+=t}else this._updateSegmentTypes(t,e),this._updatePositions(t,e)}_updateSegmentTypes(t,e){const i=this.attributes.segmentTypes,n=!!t&&this.isClosed(t),{vertexStart:r,geometrySize:o}=e;i.fill(0,r,r+o),n?(i[r]=4,i[r+o-2]=4):(i[r]+=1,i[r+o-2]+=2),i[r+o-1]=4}_updatePositions(t,e){const{positions:i}=this.attributes;if(!i||!t)return;const{vertexStart:n,geometrySize:r}=e,o=new Array(3);for(let s=n,a=0;a<r;s++,a++)this.getPointOnPath(t,a,o),i[3*s]=o[0],i[3*s+1]=o[1],i[3*s+2]=o[2]}getPathLength(t){return t.length/this.positionSize}getPointOnPath(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const{positionSize:n}=this;e*n>=t.length&&(e+=1-t.length/n);const r=e*n;return i[0]=t[r],i[1]=t[r+1],i[2]=3===n&&t[r+2]||0,i}isClosed(t){if(!this.normalize)return Boolean(this.opts.loop);const{positionSize:e}=this,i=t.length-e;return t[0]===t[i]&&t[1]===t[i+1]&&(2===e||t[2]===t[i+2])}}function p(t){return Array.isArray(t[0])}const A=[0,0,0,255],f={widthUnits:"meters",widthScale:{type:"number",min:0,value:1},widthMinPixels:{type:"number",min:0,value:0},widthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},jointRounded:!1,capRounded:!1,miterLimit:{type:"number",min:0,value:4},billboard:!1,_pathType:null,getPath:{type:"accessor",value:t=>t.path},getColor:{type:"accessor",value:A},getWidth:{type:"accessor",value:1},rounded:{deprecatedFor:["jointRounded","capRounded"]}},g={enter:(t,e)=>e.length?e.subarray(e.length-t.length):t};class m extends r.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:"#define SHADER_NAME path-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute float instanceTypes;\nattribute vec3 instanceStartPositions;\nattribute vec3 instanceEndPositions;\nattribute vec3 instanceLeftPositions;\nattribute vec3 instanceRightPositions;\nattribute vec3 instanceLeftPositions64Low;\nattribute vec3 instanceStartPositions64Low;\nattribute vec3 instanceEndPositions64Low;\nattribute vec3 instanceRightPositions64Low;\nattribute float instanceStrokeWidths;\nattribute vec4 instanceColors;\nattribute vec3 instancePickingColors;\n\nuniform float widthScale;\nuniform float widthMinPixels;\nuniform float widthMaxPixels;\nuniform float jointType;\nuniform float capType;\nuniform float miterLimit;\nuniform bool billboard;\nuniform int widthUnits;\n\nuniform float opacity;\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nconst float EPSILON = 0.001;\nconst vec3 ZERO_OFFSET = vec3(0.0);\n\nfloat flipIfTrue(bool flag) {\n  return -(float(flag) * 2. - 1.);\n}\n\n// calculate line join positions\nvec3 lineJoin(\n  vec3 prevPoint, vec3 currPoint, vec3 nextPoint,\n  vec2 width\n) {\n  bool isEnd = positions.x > 0.0;\n  // side of the segment - -1: left, 0: center, 1: right\n  float sideOfPath = positions.y;\n  float isJoint = float(sideOfPath == 0.0);\n\n  vec3 deltaA3 = (currPoint - prevPoint);\n  vec3 deltaB3 = (nextPoint - currPoint);\n\n  mat3 rotationMatrix;\n  bool needsRotation = !billboard && project_needs_rotation(currPoint, rotationMatrix);\n  if (needsRotation) {\n    deltaA3 = deltaA3 * rotationMatrix;\n    deltaB3 = deltaB3 * rotationMatrix;\n  }\n  vec2 deltaA = deltaA3.xy / width;\n  vec2 deltaB = deltaB3.xy / width;\n\n  float lenA = length(deltaA);\n  float lenB = length(deltaB);\n\n  vec2 dirA = lenA > 0. ? normalize(deltaA) : vec2(0.0, 0.0);\n  vec2 dirB = lenB > 0. ? normalize(deltaB) : vec2(0.0, 0.0);\n\n  vec2 perpA = vec2(-dirA.y, dirA.x);\n  vec2 perpB = vec2(-dirB.y, dirB.x);\n\n  // tangent of the corner\n  vec2 tangent = dirA + dirB;\n  tangent = length(tangent) > 0. ? normalize(tangent) : perpA;\n  // direction of the corner\n  vec2 miterVec = vec2(-tangent.y, tangent.x);\n  // direction of the segment\n  vec2 dir = isEnd ? dirA : dirB;\n  // direction of the extrusion\n  vec2 perp = isEnd ? perpA : perpB;\n  // length of the segment\n  float L = isEnd ? lenA : lenB;\n\n  // A = angle of the corner\n  float sinHalfA = abs(dot(miterVec, perp));\n  float cosHalfA = abs(dot(dirA, miterVec));\n\n  // -1: right, 1: left\n  float turnDirection = flipIfTrue(dirA.x * dirB.y >= dirA.y * dirB.x);\n\n  // relative position to the corner:\n  // -1: inside (smaller side of the angle)\n  // 0: center\n  // 1: outside (bigger side of the angle)\n  float cornerPosition = sideOfPath * turnDirection;\n\n  float miterSize = 1.0 / max(sinHalfA, EPSILON);\n  // trim if inside corner extends further than the line segment\n  miterSize = mix(\n    min(miterSize, max(lenA, lenB) / max(cosHalfA, EPSILON)),\n    miterSize,\n    step(0.0, cornerPosition)\n  );\n\n  vec2 offsetVec = mix(miterVec * miterSize, perp, step(0.5, cornerPosition))\n    * (sideOfPath + isJoint * turnDirection);\n\n  // special treatment for start cap and end cap\n  bool isStartCap = lenA == 0.0 || (!isEnd && (instanceTypes == 1.0 || instanceTypes == 3.0));\n  bool isEndCap = lenB == 0.0 || (isEnd && (instanceTypes == 2.0 || instanceTypes == 3.0));\n  bool isCap = isStartCap || isEndCap;\n\n  // extend out a triangle to envelope the round cap\n  if (isCap) {\n    offsetVec = mix(perp * sideOfPath, dir * capType * 4.0 * flipIfTrue(isStartCap), isJoint);\n    vJointType = capType;\n  } else {\n    vJointType = jointType;\n  }\n\n  // Generate variables for fragment shader\n  vPathLength = L;\n  vCornerOffset = offsetVec;\n  vMiterLength = dot(vCornerOffset, miterVec * turnDirection);\n  vMiterLength = isCap ? isJoint : vMiterLength;\n\n  vec2 offsetFromStartOfPath = vCornerOffset + deltaA * float(isEnd);\n  vPathPosition = vec2(\n    dot(offsetFromStartOfPath, perp),\n    dot(offsetFromStartOfPath, dir)\n  );\n  geometry.uv = vPathPosition;\n\n  float isValid = step(instanceTypes, 3.5);\n  vec3 offset = vec3(offsetVec * width * isValid, 0.0);\n\n  if (needsRotation) {\n    offset = rotationMatrix * offset;\n  }\n  return currPoint + offset;\n}\n\n// In clipspace extrusion, if a line extends behind the camera, clip it to avoid visual artifacts\nvoid clipLine(inout vec4 position, vec4 refPosition) {\n  if (position.w < EPSILON) {\n    float r = (EPSILON - refPosition.w) / (position.w - refPosition.w);\n    position = refPosition + (position - refPosition) * r;\n  }\n}\n\nvoid main() {\n  geometry.pickingColor = instancePickingColors;\n\n  vColor = vec4(instanceColors.rgb, instanceColors.a * opacity);\n\n  float isEnd = positions.x;\n\n  vec3 prevPosition = mix(instanceLeftPositions, instanceStartPositions, isEnd);\n  vec3 prevPosition64Low = mix(instanceLeftPositions64Low, instanceStartPositions64Low, isEnd);\n\n  vec3 currPosition = mix(instanceStartPositions, instanceEndPositions, isEnd);\n  vec3 currPosition64Low = mix(instanceStartPositions64Low, instanceEndPositions64Low, isEnd);\n\n  vec3 nextPosition = mix(instanceEndPositions, instanceRightPositions, isEnd);\n  vec3 nextPosition64Low = mix(instanceEndPositions64Low, instanceRightPositions64Low, isEnd);\n\n  geometry.worldPosition = currPosition;\n  vec2 widthPixels = vec2(clamp(\n    project_size_to_pixel(instanceStrokeWidths * widthScale, widthUnits),\n    widthMinPixels, widthMaxPixels) / 2.0);\n  vec3 width;\n\n  if (billboard) {\n    // Extrude in clipspace\n    vec4 prevPositionScreen = project_position_to_clipspace(prevPosition, prevPosition64Low, ZERO_OFFSET);\n    vec4 currPositionScreen = project_position_to_clipspace(currPosition, currPosition64Low, ZERO_OFFSET, geometry.position);\n    vec4 nextPositionScreen = project_position_to_clipspace(nextPosition, nextPosition64Low, ZERO_OFFSET);\n\n    clipLine(prevPositionScreen, currPositionScreen);\n    clipLine(nextPositionScreen, currPositionScreen);\n    clipLine(currPositionScreen, mix(nextPositionScreen, prevPositionScreen, isEnd));\n\n    width = vec3(widthPixels, 0.0);\n    DECKGL_FILTER_SIZE(width, geometry);\n\n    vec3 pos = lineJoin(\n      prevPositionScreen.xyz / prevPositionScreen.w,\n      currPositionScreen.xyz / currPositionScreen.w,\n      nextPositionScreen.xyz / nextPositionScreen.w,\n      project_pixel_size_to_clipspace(width.xy)\n    );\n\n    gl_Position = vec4(pos * currPositionScreen.w, currPositionScreen.w);\n  } else {\n    // Extrude in commonspace\n    prevPosition = project_position(prevPosition, prevPosition64Low);\n    currPosition = project_position(currPosition, currPosition64Low);\n    nextPosition = project_position(nextPosition, nextPosition64Low);\n\n    width = vec3(project_pixel_size(widthPixels), 0.0);\n    DECKGL_FILTER_SIZE(width, geometry);\n\n    vec4 pos = vec4(\n      lineJoin(prevPosition, currPosition, nextPosition, width.xy),\n      1.0);\n    geometry.position = pos;\n    gl_Position = project_common_position_to_clipspace(pos);\n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME path-layer-fragment-shader\n\nprecision highp float;\n\nuniform float miterLimit;
2\n\nvarying vec4 vColor;\nvarying vec2 vCornerOffset;\nvarying float vMiterLength;\n/*\n * vPathPosition represents the relative coordinates of the current fragment on the path segment.\n * vPathPosition.x - position along the width of the path, between [-1, 1]. 0 is the center line.\n * vPathPosition.y - position along the length of the path, between [0, L / width].\n */\nvarying vec2 vPathPosition;\nvarying float vPathLength;\nvarying float vJointType;\n\nvoid main(void) {\n  geometry.uv = vPathPosition;\n\n  if (vPathPosition.y < 0.0 || vPathPosition.y > vPathLength) {\n    // if joint is rounded, test distance from the corner\n    if (vJointType > 0.5 && length(vCornerOffset) > 1.0) {\n      discard;\n    }\n    // trim miter\n    if (vJointType < 0.5 && vMiterLength > miterLimit + 1.0) {\n      discard;\n    }\n  }\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}get wrapLongitude(){return!1}initializeState(){this.getAttributeManager().addInstanced({positions:{size:3,vertexOffset:1,type:5130,fp64:this.use64bitPositions(),transition:g,accessor:"getPath",update:this.calculatePositions,noAlloc:true,shaderAttributes:{instanceLeftPositions:{vertexOffset:0},instanceStartPositions:{vertexOffset:1},instanceEndPositions:{vertexOffset:2},instanceRightPositions:{vertexOffset:3}}},instanceTypes:{size:1,type:5121,update:this.calculateSegmentTypes,noAlloc:true},instanceStrokeWidths:{size:1,accessor:"getWidth",transition:g,defaultValue:1},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,accessor:"getColor",transition:g,defaultValue:A},instancePickingColors:{size:3,type:5121,accessor:(t,e)=>{let{index:i,target:n}=e;return this.encodePickingColor(t&&t.__source?t.__source.index:i,n)}}}),this.setState({pathTesselator:new d({fp64:this.use64bitPositions()})})}updateState(t){super.updateState(t);const{props:e,changeFlags:i}=t,n=this.getAttributeManager();if(i.dataChanged||i.updateTriggersChanged&&(i.updateTriggersChanged.all||i.updateTriggersChanged.getPath)){const{pathTesselator:t}=this.state,r=e.data.attributes||{};t.updateGeometry({data:e.data,geometryBuffer:r.getPath,buffers:r,normalize:!e._pathType,loop:"loop"===e._pathType,getGeometry:e.getPath,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,dataChanged:i.dataChanged}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),i.dataChanged||n.invalidateAll()}if(i.extensionsChanged){var r;const{gl:t}=this.context;null===(r=this.state.model)||void 0===r||r.delete(),this.state.model=this._getModel(t),n.invalidateAll()}}getPickingInfo(t){const e=super.getPickingInfo(t),{index:i}=e,{data:n}=this.props;return n[0]&&n[0].__source&&(e.object=n.find((t=>t.__source.index===i))),e}disablePickingIndex(t){const{data:e}=this.props;if(e[0]&&e[0].__source)for(let i=0;i<e.length;i++)e[i].__source.index===t&&this._disablePickingIndex(i);else this._disablePickingIndex(t)}draw(t){let{uniforms:e}=t;const{jointRounded:i,capRounded:n,billboard:r,miterLimit:o,widthUnits:s,widthScale:l,widthMinPixels:c,widthMaxPixels:u}=this.props;this.state.model.setUniforms(e).setUniforms({jointType:Number(i),capType:Number(n),billboard:r,widthUnits:a.iI[s],widthScale:l,miterLimit:o,widthMinPixels:c,widthMaxPixels:u}).draw()}_getModel(t){return new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:4,attributes:{indices:new Uint16Array([0,1,2,1,4,2,1,3,4,3,5,4]),positions:{value:new Float32Array([0,0,0,-1,0,1,1,-1,1,1,1,0]),size:2}}}),isInstanced:!0})}calculatePositions(t){const{pathTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("positions")}calculateSegmentTypes(t){const{pathTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("segmentTypes")}}(0,n.Z)(m,"defaultProps",f),(0,n.Z)(m,"layerName","PathLayer")},11162:(t,e,i)=>{"use strict";i.d(e,{Z:()=>A});var n=i(64649),r=i(90031),o=i(2123),s=i(54976),a=i(2578),l=i(18252),c=i(94557),u=i(69296);const h=[0,0,0,255],d=[0,0,1],p={sizeUnits:"pixels",pointSize:{type:"number",min:0,value:10},getPosition:{type:"accessor",value:t=>t.position},getNormal:{type:"accessor",value:d},getColor:{type:"accessor",value:h},material:!0,radiusPixels:{deprecatedFor:"pointSize"}};class A extends r.Z{getShaders(){return super.getShaders({vs:"#define SHADER_NAME point-cloud-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 instanceNormals;\nattribute vec4 instanceColors;\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusPixels;\nuniform int sizeUnits;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.normal = project_normal(instanceNormals);\n\n  // position on the containing square in [-1, 1] space\n  unitPosition = positions.xy;\n  geometry.uv = unitPosition;\n  geometry.pickingColor = instancePickingColors;\n\n  // Find the center of the point and add the current vertex\n  vec3 offset = vec3(positions.xy * project_size_to_pixel(radiusPixels, sizeUnits), 0.0);\n  DECKGL_FILTER_SIZE(offset, geometry);\n\n  gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.), geometry.position);\n  gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Apply lighting\n  vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal);\n\n  // Apply opacity to instance color, or return instance picking color\n  vColor = vec4(lightColor, instanceColors.a * opacity);\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#define SHADER_NAME point-cloud-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\nvarying vec2 unitPosition;\n\nvoid main(void) {\n  geometry.uv = unitPosition;\n\n  float distToCenter = length(unitPosition);\n\n  if (distToCenter > 1.0) {\n    discard;\n  }\n\n  gl_FragColor = vColor;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.N,a.Z]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceNormals:{size:3,transition:!0,accessor:"getNormal",defaultValue:d},instanceColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:!0,accessor:"getColor",defaultValue:h}})}updateState(t){const{changeFlags:e,props:i}=t;if(super.updateState(t),e.extensionsChanged){var n;const{gl:t}=this.context;null===(n=this.state.model)||void 0===n||n.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}e.dataChanged&&function(t){const{header:e,attributes:i}=t;e&&i&&(t.length=e.vertexCount,i.POSITION&&(i.instancePositions=i.POSITION),i.NORMAL&&(i.instanceNormals=i.NORMAL),i.
2COLOR_0&&(i.instanceColors=i.COLOR_0))}(i.data)}draw(t){let{uniforms:e}=t;const{pointSize:i,sizeUnits:n}=this.props;this.state.model.setUniforms(e).setUniforms({sizeUnits:l.iI[n],radiusPixels:i}).draw()}_getModel(t){const e=[];for(let i=0;i<3;i++){const t=i/3*Math.PI*2;e.push(2*Math.cos(t),2*Math.sin(t),0)}return new c.Z(t,{...this.getShaders(),id:this.props.id,geometry:new u.Z({drawMode:4,attributes:{positions:new Float32Array(e)}}),isInstanced:!0})}}(0,n.Z)(A,"layerName","PointCloudLayer"),(0,n.Z)(A,"defaultProps",p)},94300:(t,e,i)=>{"use strict";i.d(e,{Z:()=>p});var n=i(64649),r=i(79366),o=i(21970),s=i(73115),a=i(3453),l=i(69554),c=i(32643),u=i(66535);const h=[0,0,0,255],d={stroked:!0,filled:!0,extruded:!1,elevationScale:1,wireframe:!1,_normalize:!0,_windingOrder:"CW",lineWidthUnits:"meters",lineWidthScale:1,lineWidthMinPixels:0,lineWidthMaxPixels:Number.MAX_SAFE_INTEGER,lineJointRounded:!1,lineMiterLimit:4,getPolygon:{type:"accessor",value:t=>t.polygon},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:h},getLineWidth:{type:"accessor",value:1},getElevation:{type:"accessor",value:1e3},material:!0};class p extends r.Z{initializeState(){this.state={paths:[]},this.props.getLineDashArray&&o.Z.removed("getLineDashArray","PathStyleExtension")()}updateState(t){let{changeFlags:e}=t;const i=e.dataChanged||e.updateTriggersChanged&&(e.updateTriggersChanged.all||e.updateTriggersChanged.getPolygon);if(i&&Array.isArray(e.dataChanged)){const t=this.state.paths.slice(),i=e.dataChanged.map((e=>(0,u.b)({data:t,getIndex:t=>t.__source.index,dataRange:e,replace:this._getPaths(e)})));this.setState({paths:t,pathsDiff:i})}else i&&this.setState({paths:this._getPaths(),pathsDiff:null})}_getPaths(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{data:e,getPolygon:i,positionFormat:n,_normalize:r}=this.props,o=[],a="XY"===n?2:3,{startRow:l,endRow:u}=t,{iterable:h,objectInfo:d}=(0,s.jB)(e,l,u);for(const s of h){d.index++;let t=i(s,d);r&&(t=c.Fv(t,a));const{holeIndices:e}=t,n=t.positions||t;if(e)for(let i=0;i<=e.length;i++){const t=n.slice(e[i-1]||0,e[i]||n.length);o.push(this.getSubLayerRow({path:t},s,d.index))}else o.push(this.getSubLayerRow({path:n},s,d.index))}return o}renderLayers(){const{data:t,_dataDiff:e,stroked:i,filled:n,extruded:r,wireframe:o,_normalize:s,_windingOrder:c,elevationScale:u,transitions:d,positionFormat:p}=this.props,{lineWidthUnits:A,lineWidthScale:f,lineWidthMinPixels:g,lineWidthMaxPixels:m,lineJointRounded:y,lineMiterLimit:v,lineDashJustified:_}=this.props,{getFillColor:b,getLineColor:x,getLineWidth:w,getLineDashArray:C,getElevation:B,getPolygon:E,updateTriggers:S,material:T}=this.props,{paths:M,pathsDiff:I}=this.state,P=this.getSubLayerClass("fill",a.Z),D=this.getSubLayerClass("stroke",l.Z),L=this.shouldRenderSubLayer("fill",M)&&new P({_dataDiff:e,extruded:r,elevationScale:u,filled:n,wireframe:o,_normalize:s,_windingOrder:c,getElevation:B,getFillColor:b,getLineColor:r&&o?x:h,material:T,transitions:d}
2,this.getSubLayerProps({id:"fill",updateTriggers:S&&{getPolygon:S.getPolygon,getElevation:S.getElevation,getFillColor:S.getFillColor,lineColors:r&&o,getLineColor:S.getLineColor}}),{data:t,positionFormat:p,getPolygon:E});return[!r&&L,!r&&i&&this.shouldRenderSubLayer("stroke",M)&&new D({_dataDiff:I&&(()=>I),widthUnits:A,widthScale:f,widthMinPixels:g,widthMaxPixels:m,jointRounded:y,miterLimit:v,dashJustified:_,_pathType:"loop",transitions:d&&{getWidth:d.getLineWidth,getColor:d.getLineColor,getPath:d.getPolygon},getColor:this.getSubLayerAccessor(x),getWidth:this.getSubLayerAccessor(w),getDashArray:this.getSubLayerAccessor(C)},this.getSubLayerProps({id:"stroke",updateTriggers:S&&{getWidth:S.getLineWidth,getColor:S.getLineColor,getDashArray:S.getLineDashArray}}),{data:M,positionFormat:p,getPath:t=>t.path}),r&&L]}}(0,n.Z)(p,"layerName","PolygonLayer"),(0,n.Z)(p,"defaultProps",d)},87403:(t,e,i)=>{"use strict";i.d(e,{Z:()=>d});var n=i(64649),r=i(90031),o=i(2123),s=i(2578),a=i(18252),l=i(94557),c=i(69296);const u=[0,0,0,255],h={radiusUnits:"meters",radiusScale:{type:"number",min:0,value:1},radiusMinPixels:{type:"number",min:0,value:0},radiusMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},lineWidthUnits:"meters",lineWidthScale:{type:"number",min:0,value:1},lineWidthMinPixels:{type:"number",min:0,value:0},lineWidthMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},stroked:!1,filled:!0,billboard:!1,antialiasing:!0,getPosition:{type:"accessor",value:t=>t.position},getRadius:{type:"accessor",value:1},getFillColor:{type:"accessor",value:u},getLineColor:{type:"accessor",value:u},getLineWidth:{type:"accessor",value:1},strokeWidth:{deprecatedFor:"getLineWidth"},outline:{deprecatedFor:"stroked"},getColor:{deprecatedFor:["getFillColor","getLineColor"]}};class d extends r.Z{getShaders(){return super.getShaders({vs:"#define SHADER_NAME scatterplot-layer-vertex-shader\n\nattribute vec3 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute float instanceRadius;\nattribute float instanceLineWidths;
2\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform float opacity;\nuniform float radiusScale;\nuniform float radiusMinPixels;\nuniform float radiusMaxPixels;\nuniform float lineWidthScale;\nuniform float lineWidthMinPixels;\nuniform float lineWidthMaxPixels;\nuniform float stroked;\nuniform bool filled;\nuniform bool antialiasing;\nuniform bool billboard;\nuniform int radiusUnits;\nuniform int lineWidthUnits;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n\n  // Multiply out radius and clamp to limits\n  outerRadiusPixels = clamp(\n    project_size_to_pixel(radiusScale * instanceRadius, radiusUnits),\n    radiusMinPixels, radiusMaxPixels\n  );\n  \n  // Multiply out line width and clamp to limits\n  float lineWidthPixels = clamp(\n    project_size_to_pixel(lineWidthScale * instanceLineWidths, lineWidthUnits),\n    lineWidthMinPixels, lineWidthMaxPixels\n  );\n\n  // outer radius needs to offset by half stroke width\n  outerRadiusPixels += stroked * lineWidthPixels / 2.0;\n\n  // Expand geometry to accomodate edge smoothing\n  float edgePadding = antialiasing ? (outerRadiusPixels + SMOOTH_EDGE_RADIUS) / outerRadiusPixels : 1.0;\n\n  // position on the containing square in [-1, 1] space\n  unitPosition = edgePadding * positions.xy;\n  geometry.uv = unitPosition;\n  geometry.pickingColor = instancePickingColors;\n\n  innerUnitRadius = 1.0 - stroked * lineWidthPixels / outerRadiusPixels;\n  \n  if (billboard) {\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n    vec3 offset = edgePadding * positions * outerRadiusPixels;\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n  } else {\n    vec3 offset = edgePadding * positions * project_pixel_size(outerRadiusPixels);\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset, geometry.position);\n  }\n\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Apply opacity to instance color, or return instance picking color\n  vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n  DECKGL_FILTER_COLOR(vFillColor, geometry);\n  vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n  DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME scatterplot-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool filled;\nuniform float stroked;\nuniform bool antialiasing;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying vec2 unitPosition;\nvarying float innerUnitRadius;\nvarying float outerRadiusPixels;\n\nvoid main(void) {\n  geometry.uv = unitPosition;\n\n  float distToCenter = length(unitPosition) * outerRadiusPixels;\n  float inCircle = antialiasing ? \n    smoothedge(distToCenter, outerRadiusPixels) : \n    step(distToCenter, outerRadiusPixels);\n\n  if (inCircle == 0.0) {\n    discard;\n  }\n\n  if (stroked > 0.5) {\n    float isLine = antialiasing ? \n      smoothedge(innerUnitRadius * outerRadiusPixels, distToCenter) :\n      step(innerUnitRadius * outerRadiusPixels, distToCenter);\n\n    if (filled) {\n      gl_FragColor = mix(vFillColor, vLineColor, isLine);\n    } else {\n      if (isLine == 0.0) {\n        discard;\n      }\n      gl_FragColor = vec4(vLineColor.rgb, vLineColor.a * isLine);\n    }\n  } else if (filled) {\n    gl_FragColor = vFillColor;\n  } else {\n    discard;\n  }\n\n  gl_FragColor.a *= inCircle;\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceRadius:{size:1,transition:!0,accessor:"getRadius",defaultValue:1},instanceFillColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:this.props.colorFormat.length,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){if(super.updateState(t),t.changeFlags.extensionsChanged){var e;const{gl:t}=this.context;null===(e=this.state.model)||void 0===e||e.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw(t){let{uniforms:e}=t;const{radiusUnits:i,radiusScale:n,radiusMinPixels:r,radiusMaxPixels:o,stroked:s,filled:l,billboard:c,antialiasing:u,lineWidthUnits:h,lineWidthScale:d,lineWidthMinPixels:p,lineWidthMaxPixels:A}=this.props;this.state.model.setUniforms(e).setUniforms({stroked:s?1:0,filled:l,billboard:c,antialiasing:u,radiusUnits:a.iI[i],radiusScale:n,radiusMinPixels:r,radiusMaxPixels:o,lineWidthUnits:a.iI[h],lineWidthScale:d,lineWidthMinPixels:p,lineWidthMaxPixels:A}).draw()}
2_getModel(t){return new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:6,vertexCount:4,attributes:{positions:{size:3,value:new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0])}}}),isInstanced:!0})}}(0,n.Z)(d,"defaultProps",h),(0,n.Z)(d,"layerName","ScatterplotLayer")},32643:(t,e,i)=>{"use strict";i.d(e,{Fv:()=>p,Gd:()=>u,k8:()=>c,mD:()=>A});var n=i(25880),r=i.n(n),o=i(23595);const s=o.wG.CLOCKWISE,a=o.wG.COUNTER_CLOCKWISE,l={isClosed:!0};function c(t){return"positions"in t?t.positions:t}function u(t){return"holeIndices"in t?t.holeIndices:null}function h(t,e,i,n,r){let s=e;const a=i.length;for(let o=0;o<a;o++)for(let e=0;e<n;e++)t[s++]=i[o][e]||0;if(!function(t){const e=t[0],i=t[t.length-1];return e[0]===i[0]&&e[1]===i[1]&&e[2]===i[2]}(i))for(let o=0;o<n;o++)t[s++]=i[0][o]||0;return l.start=e,l.end=s,l.size=n,(0,o.Ny)(t,r,l),s}function d(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6?arguments[6]:void 0;s=s||i.length;const c=s-r;if(c<=0)return e;let u=e;for(let o=0;o<c;o++)t[u++]=i[r+o];if(!function(t,e,i,n){for(let r=0;r<e;r++)if(t[i+r]!==t[n-e+r])return!1;return!0}(i,n,r,s))for(let o=0;o<n;o++)t[u++]=i[r+o];return l.start=e,l.end=u,l.size=n,(0,o.Ny)(t,a,l),u}function p(t,e){!function(t){if(t=t&&t.positions||t,!Array.isArray(t)&&!ArrayBuffer.isView(t))throw new Error("invalid polygon")}(t);const i=[],n=[];if("positions"in t){const{positions:r,holeIndices:o}=t;if(o){let t=0;for(let l=0;l<=o.length;l++)t=d(i,t,r,e,o[l-1],o[l],0===l?s:a),n.push(t);return n.pop(),{positions:i,holeIndices:n}}t=r}if(!function(t){return Array.isArray(t[0])}(t))return d(i,0,t,e,0,i.length,s),i;if(!function(t){return t.length>=1&&t[0].length>=2&&Number.isFinite(t[0][0])}(t)){let r=0;for(const[o,l]of t.entries())r=h(i,r,l,e,0===o?s:a),n.push(r);return n.pop(),{positions:i,holeIndices:n}}return h(i,0,t,e,s),i}function A(t,e,i){let n=u(t);n&&(n=n.map((t=>t/e)));let o=c(t);if(i){const t=o.length;o=o.slice();const n=[];for(let r=0;r<t;r+=e){n[0]=o[r],n[1]=o[r+1];const t=i(n);o[r]=t[0],o[r+1]=t[1]}}return r()(o,n,e)}},3453:(t,e,i)=>{"use strict";i.d(e,{Z:()=>C});var n=i(64649),r=i(90031),o=i(2123),s=i(54976),a=i(2578),l=i(18252),c=i(12308),u=i(70353),h=i(94557),d=i(69296),p=i(32643),A=i(55678),f=i(23595);class g extends A.Z{constructor(t){const{fp64:e,IndexType:i=Uint32Array}=t;super({...t,attributes:{positions:{size:3,type:e?Float64Array:Float32Array},vertexValid:{type:Uint8ClampedArray,size:1},indices:{type:i,size:1}}})}get(t){const{attributes:e}=this;return"indices"===t?e.indices&&e.indices.subarray(0,this.vertexCount):e[t]}updateGeometry(t){super.updateGeometry(t);const e=this.buffers.indices;if(e)this.vertexCount=(e.value||e).length;else if(this.data&&!this.getGeometry)throw new Error("missing indices buffer")}normalizeGeometry(t){if(this.normalize){const e=p.Fv(t,this.positionSize);return this.opts.resolution?(0,f.WZ)(p.k8(e),p.Gd(e),{size:this.positionSize,gridResolution:this.opts.resolution,edgeTypes:!0}):this.opts.wrapLongitude?(0,f.GU)(p.k8(e),p.Gd(e),{size:this.positionSize,maxLatitude:86,edgeTypes:!0}):e}return t}getGeometrySize(t){if(m(t)){let e=0;for(const i of t)e+=this.getGeometrySize(i);return e}return p.k8(t).length/this.positionSize}getGeometryFromBuffer(t){return this.normalize||!this.buffers.indices?super.getGeometryFromBuffer(t):null}updateGeometryAttributes(t,e){if(t&&m(t))for(const i of t){const t=this.getGeometrySize(i);e.geometrySize=t,this.updateGeometryAttributes(i,e),e.vertexStart+=t,e.indexStart=this.indexStarts[e.geometryIndex+1]}else this._updateIndices(t,e),this._updatePositions(t,e),this._updateVertexValid(t,e)}_updateIndices(t,e){let{geometryIndex:i,vertexStart:n,indexStart:r}=e;const{attributes:o,indexStarts:s,typedArrayManager:a}=this;let l=o.indices;if(!l||!t)return;let c=r;const u=p.mD(t,this.positionSize,this.opts.preproject);l=a.allocate(l,r+u.length,{copy:!0});for(let h=0;h<u.length;h++)l[c++]=u[h]+n;s[i+1]=r+u.length,o.indices=l}_updatePositions(t,e){let{vertexStart:i,geometrySize:n}=e;const{attributes:{positions:r},positionSize:o}=this;if(!r||!t)return;const s=p.k8(t);for(let a=i,l=0;l<n;a++,l++){const t=s[l*o],e=s[l*o+1],i=o>2?s[l*o+2]:0;r[3*a]=t,r[3*a+1]=e,r[3*a+2]=i}}_updateVertexValid(t,e){let{vertexStart:i,geometrySize:n}=e;const{positionSize:r}=this,o=this.attributes.vertexValid,s=t&&p.Gd(t);if(t&&t.edgeTypes?o.set(t.edgeTypes,i):o.fill(1,i,i+n),s)for(let a=0;a<s.length;a++)o[i+s[a]/r-1]=0;o[i+n-1]=0}}function m(t){return Array.isArray(t)&&t.length>0&&!Number.isFinite(t[0])}const y="\nattribute vec2 vertexPositions;\nattribute float vertexValid;\n\nuniform bool extruded;\nuniform bool isWireframe;\nuniform float elevationScale;\nuniform float opacity;\n\nvarying vec4 vColor;\n\nstruct PolygonProps {\n  vec4 fillColors;\n  vec4 lineColors;\n  vec3 positions;\n  vec3 nextPositions;\n  vec3 pickingColors;\n  vec3 positions64Low;\n  vec3 nextPositions64Low;\n  float elevations;\n};\n\nvec3 project_offset_normal(vec3 vector) {\n  if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT ||\n    project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) {\n    // normals generated by the polygon tesselator are in lnglat offsets instead of meters\n    return normalize(vector * project_uCommonUnitsPerWorldUnit);\n  }\n  return project_normal(vector);\n}\n\nvoid calculatePosition(PolygonProps props) {\n#ifdef IS_SIDE_VERTEX\n  if(vertexValid < 0.5){\n    gl_Position = vec4(0.);\n    return;\n  }\n#endif\n\n  vec3 pos;\n  vec3 pos64Low;\n  vec3 normal;\n  vec4 colors = isWireframe ? props.lineColors : props.fillColors;\n\n  geometry.worldPosition = props.positions;\n  geometry.worldPositionAlt = props.nextPositions;\n  geometry.pickingColor = props.pickingColors;\n\n#ifdef IS_SIDE_VERTEX\n  pos = mix(props.positions, props.nextPositions, vertexPositions.x);\n  pos64Low = mix(props.positions64Low, props.nextPositions64Low, vertexPositions.x);\n#else\n  pos = props.positions;\n  pos64Low = props.positions64Low;\n#endif\n\n  if (extruded) {\n    pos.z += props.elevations * vertexPositions.y * elevationScale;\n  }\n  gl_Position = project_position_to_clipspace(pos, pos64Low, vec3(0.), geometry.position);\n\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  if (extruded) {\n  #ifdef IS_SIDE_VERTEX\n    normal = vec3(\n      props.positions.y - props.nextPositions.y + (props.positions64Low.y - props.nextPositions64Low.y),\n      props.nextPositions.x - props.positions.x + (props.nextPositions64Low.x - props.positions64Low.x),\n      0.0);\n    normal = project_offset_normal(normal);\n  #else\n    normal = project_normal(vec3(0.0, 0.0, 1.0));\n  #endif\n    geometry.normal = normal;\n    vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, normal);\n    vColor = vec4(lightColor, colors.a * opacity);\n  } else {\n    vColor = vec4(colors.rgb, colors.a * opacity);\n  }\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",v="#define SHADER_NAME solid-polygon-layer-vertex-shader\n\nattribute vec3 positions;\nattribute vec3 positions64Low;\nattribute float elevations;\nattribute vec4 fillColors;\nattribute vec4 lineColors;\nattribute vec3 pickingColors;\n\n".concat(y,"\n\nvoid main(void) {\n  PolygonProps props;\n\n  props.positions = positions;\n  props.positions64Low = positions64Low;\n  props.elevations = elevations;\n  props.fillColors = fillColors;\n  props.lineColors = lineColors;\n  props.pickingColors = pickingColors;\n\n  calculatePosition(props);\n}\n"),_="#define SHADER_NAME solid-polygon-layer-vertex-shader-side\n#define IS_SIDE_VERTEX\n\n\nattribute vec3 instancePositions;\nattribute vec3 nextPositions;\nattribute vec3 instancePositions64Low;\nattribute vec3 nextPositions64Low;\nattribute float instanceElevations;\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\n".concat(y,"\n\nvoid main(void) {\n  PolygonProps props;\n\n  #if RING_WINDING_ORDER_CW == 1\n    props.positions = instancePositions;\n    props.positions64Low = instancePositions64Low;\n    props.nextPositions = nextPositions;\n    props.nextPositions64Low = nextPositions64Low;\n  #else\n    props.positions = nextPositions;\n    props.positions64Low = nextPositions64Low;\n    props.nextPositions = instancePositions;\n    props.nextPositions64Low = instancePositions64Low;\n  #endif\n  props.elevations = instanceElevations;\n  props.fillColors = instanceFillColors;\n  props.lineColors = instanceLineColors;\n  props.pickingColors = instancePickingColors;\n\n  calculatePosition(props);\n}\n"),b=[0,0,0,255],x={filled:!0,extruded:!1,wireframe:!1,_normalize:!0,_windingOrder:"CW",elevationScale:{type:"number",min:0,value:1},getPolygon:{type:"accessor",value:t=>t.polygon},getElevation:{type:"accessor",value:1e3},getFillColor:{type:"accessor",value:b},getLineColor:{type:"accessor",value:b},material:!0},w={enter:(t,e)=>e.length?e.subarray(e.length-t.length):t};class C extends r.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}getShaders(t){return super.getShaders({vs:"top"===t?v:_,fs:"#define SHADER_NAME solid-polygon-layer-fragment-shader\n\nprecision highp float;\n\nvarying vec4 vColor;\n\nvoid main(void) {\n  gl_FragColor = vColor;\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",defines:{RING_WINDING_ORDER_CW:this.props._normalize||"CCW"!==this.props._windingOrder?1:0},modules:[o.Z,s.N,a.Z]})}get wrapLongitude(){return!1}initializeState(){const{gl:t,viewport:e}=this.context;let{coordinateSystem:i}=this.props;e.isGeospatial&&i===l.Df.DEFAULT&&(i=l.Df.LNGLAT),this.setState({numInstances:0,polygonTesselator:new g({preproject:i===l.Df.LNGLAT&&e.projectFlat.bind(e),fp64:this.use64bitPositions(),IndexType:!t||(0,c.ag)(t,u.h.ELEMENT_INDEX_UINT32)?Uint32Array:Uint16Array})});const n=this.getAttributeManager(),r=!0;n.remove(["instancePickingColors"]),n.add({indices:{size:1,isIndexed:!0,update:this.calculateIndices,noAlloc:r},positions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:w,accessor:"getPolygon",update:this.calculatePositions,noAlloc:r,shaderAttributes:{positions:{vertexOffset:0,divisor:0},instancePositions:{vertexOffset:0,divisor:1},nextPositions:{vertexOffset:1,divisor:1}}},vertexValid:{size:1,divisor:1,type:5121,update:this.calculateVertexValid,noAlloc:r},elevations:{size:1,transition:w,accessor:"getElevation",shaderAttributes:{elevations:{divisor:0},instanceElevations:{divisor:1}}},fillColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:w,accessor:"getFillColor",defaultValue:b,shaderAttributes:{fillColors:{divisor:0},instanceFillColors:{divisor:1}}},lineColors:{size:this.props.colorFormat.length,type:5121,normalized:!0,transition:w,accessor:"getLineColor",defaultValue:b,shaderAttributes:{lineColors:{divisor:0},instanceLineColors:{divisor:1}}},pickingColors:{size:3,type:5121,accessor:(t,e)=>{let{index:i,target:n}=e;return this.encodePickingColor(t&&t.__source?t.__source.index:i,n)},shaderAttributes:{pickingColors:{divisor:0},instancePickingColors:{divisor:1}}}})}getPickingInfo(t){const e=super.getPickingInfo(t),{index:i}=e,{data:n}=this.props;return n[0]&&n[0].__source&&(e.object=n.find((t=>t.__source.index===i))),e}disablePickingIndex(t){const{data:e}=this.props;if(e[0]&&e[0].__source)for(let i=0;i<e.length;i++)e[i].__source.index===t&&this._disablePickingIndex(i);else this._disablePickingIndex(t)}draw(t){let{uniforms:e}=t;const{extruded:i,filled:n,wireframe:r,elevationScale:o}=this.props,{topModel:s,sideModel:a,polygonTesselator:l}=this.state,c={...e,extruded:Boolean(i),elevationScale:o};a&&(a.setInstanceCount(l.instanceCount-1),a.setUniforms(c),r&&(a.setDrawMode(3),a.setUniforms({isWireframe:!0}).draw()),n&&(a.setDrawMode(6),a.setUniforms({isWireframe:!1}).draw())),s&&(s.setVertexCount(l.vertexCount),s.setUniforms(c).draw())}updateState(t){super.updateState(t),this.updateGeometry(t);const{props:e,oldProps:i,changeFlags:n}=t,r=this.getAttributeManager();var o;(n.extensionsChanged||e.filled!==i.filled||e.extruded!==i.extruded)&&(null===(o=this.state.models)||void 0===o||o.forEach((t=>t.delete())),this.setState(this._getModels(this.context.gl)),r.invalidateAll())}updateGeometry(t){let{props:e,oldProps:i,changeFlags:n}=t;if(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getPolygon)){const{polygonTesselator:t}=this.state,i=e.data.attributes||{};t.updateGeometry({data:e.data,normalize:e._normalize,geometryBuffer:i.getPolygon,buffers:i,getGeometry:e.getPolygon,positionFormat:e.positionFormat,wrapLongitude:e.wrapLongitude,resolution:this.context.viewport.resolution,fp64:this.use64bitPositions(),dataChanged:n.dataChanged}),this.setState({numInstances:t.instanceCount,startIndices:t.vertexStarts}),n.dataChanged||this.getAttributeManager().invalidateAll()}}_getModels(t){const{id:e,filled:i,extruded:n}=this.props;let r,o;if(i){const i=this.getShaders("top");i.defines.NON_INSTANCED_MODEL=1,r=new h.Z(t,{...i,id:"".concat(e,"-top"),drawMode:4,attributes:{vertexPositions:new Float32Array([0,1])},uniforms:{isWireframe:!1,isSideVertex:!1},vertexCount:0,isIndexed:!0})}
2return n&&(o=new h.Z(t,{...this.getShaders("side"),id:"".concat(e,"-side"),geometry:new d.Z({drawMode:1,vertexCount:4,attributes:{vertexPositions:{size:2,value:new Float32Array([1,0,0,0,0,1,1,1])}}}),instanceCount:0,isInstanced:1}),o.userData.excludeAttributes={indices:!0}),{models:[o,r].filter(Boolean),topModel:r,sideModel:o}}calculateIndices(t){const{polygonTesselator:e}=this.state;t.startIndices=e.indexStarts,t.value=e.get("indices")}calculatePositions(t){const{polygonTesselator:e}=this.state;t.startIndices=e.vertexStarts,t.value=e.get("positions")}calculateVertexValid(t){t.value=this.state.polygonTesselator.get("vertexValid")}}(0,n.Z)(C,"defaultProps",x),(0,n.Z)(C,"layerName","SolidPolygonLayer")},20377:(t,e,i)=>{"use strict";i.d(e,{Z:()=>a});var n=i(64649),r=i(21970),o=i(32296);const s=[];class a extends o.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}getShaders(){return{...super.getShaders(),fs:"#define SHADER_NAME multi-icon-layer-fragment-shader\n\nprecision highp float;\n\nuniform float opacity;\nuniform sampler2D iconsTexture;\nuniform float gamma;\nuniform bool sdf;\nuniform float alphaCutoff;\nuniform float buffer;\nuniform float outlineBuffer;\nuniform vec4 outlineColor;\n\nvarying vec4 vColor;\nvarying vec2 vTextureCoords;\nvarying vec2 uv;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  if (!picking_uActive) {\n    float alpha = texture2D(iconsTexture, vTextureCoords).a;\n    vec4 color = vColor;\n\n    // if enable sdf (signed distance fields)\n    if (sdf) {\n      float distance = alpha;\n      alpha = smoothstep(buffer - gamma, buffer + gamma, distance);\n\n      if (outlineBuffer > 0.0) {\n        float inFill = alpha;\n        float inBorder = smoothstep(outlineBuffer - gamma, outlineBuffer + gamma, distance);\n        color = mix(outlineColor, vColor, inFill);\n        alpha = inBorder;\n      }\n    }\n\n    // Take the global opacity and the alpha from color into account for the alpha component\n    float a = alpha * color.a;\n    \n    if (a < alphaCutoff) {\n      discard;\n    }\n\n    gl_FragColor = vec4(color.rgb, a * opacity);\n  }\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n"}}initializeState(){super.initializeState();this.getAttributeManager().addInstanced({instanceOffsets:{size:2,accessor:"getIconOffsets"},instancePickingColors:{type:5121,size:3,accessor:(t,e)=>{let{index:i,target:n}=e;return this.encodePickingColor(i,n)}}})}updateState(t){super.updateState(t);const{props:e,oldProps:i}=t;let{outlineColor:n}=e;n!==i.outlineColor&&(n=n.map((t=>t/255)),n[3]=Number.isFinite(n[3])?n[3]:1,this.setState({outlineColor:n})),!e.sdf&&e.outlineWidth&&r.Z.warn("".concat(this.id,": fontSettings.sdf is required to render outline"))()}draw(t){const{sdf:e,smoothing:i,outlineWidth:n}=this.props,{outlineColor:r}=this.state;t.uniforms={...t.uniforms,buffer:.75,outlineBuffer:n?Math.max(i,.75*(1-n)):-1,gamma:i,sdf:Boolean(e),outlineColor:r},super.draw(t)}getInstanceOffset(t){return t?Array.from(t).flatMap((t=>super.getInstanceOffset(t))):s}getInstanceColorMode(t){return 1}getInstanceIconFrame(t){return t?Array.from(t).flatMap((t=>super.getInstanceIconFrame(t))):s}}(0,n.Z)(a,"defaultProps",{getIconOffsets:{type:"accessor",value:t=>t.offsets},alphaCutoff:.001,smoothing:.1,outlineWidth:0,outlineColor:{type:"color",value:[0,0,0,255]}}),(0,n.Z)(a,"layerName","MultiIconLayer")},56394:(t,e,i)=>{"use strict";i.d(e,{Z:()=>h});var n=i(64649),r=i(90031),o=i(2123),s=i(2578),a=i(18252),l=i(94557),c=i(69296);const u={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPixels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,padding:{type:"array",value:[0,0,0,0]},getPosition:{type:"accessor",value:t=>t.position},getSize:{type:"accessor",value:1},getAngle:{type:"accessor",value:0},getPixelOffset:{type:"accessor",value:[0,0]},getBoundingRect:{type:"accessor",value:[0,0,0,0]},getFillColor:{type:"accessor",value:[0,0,0,255]},getLineColor:{type:"accessor",value:[0,0,0,255]},getLineWidth:{type:"accessor",value:1}};class h extends r.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}getShaders(){return super.getShaders({vs:"#define SHADER_NAME text-background-layer-vertex-shader\n\nattribute vec2 positions;\n\nattribute vec3 instancePositions;\nattribute vec3 instancePositions64Low;\nattribute vec4 instanceRects;\nattribute float instanceSizes;\nattribute float instanceAngles;\nattribute vec2 instancePixelOffsets;\nattribute float instanceLineWidths;
2\nattribute vec4 instanceFillColors;\nattribute vec4 instanceLineColors;\nattribute vec3 instancePickingColors;\n\nuniform bool billboard;\nuniform float opacity;\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform vec4 padding;\nuniform int sizeUnits;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvec2 rotate_by_angle(vec2 vertex, float angle) {\n  float angle_radian = radians(angle);\n  float cos_angle = cos(angle_radian);\n  float sin_angle = sin(angle_radian);\n  mat2 rotationMatrix = mat2(cos_angle, -sin_angle, sin_angle, cos_angle);\n  return rotationMatrix * vertex;\n}\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.uv = positions;\n  geometry.pickingColor = instancePickingColors;\n  uv = positions;\n  vLineWidth = instanceLineWidths;\n\n  // convert size in meters to pixels, then scaled and clamp\n\n  // project meters to pixels and clamp to limits\n  float sizePixels = clamp(\n    project_size_to_pixel(instanceSizes * sizeScale, sizeUnits),\n    sizeMinPixels, sizeMaxPixels\n  );\n\n  dimensions = instanceRects.zw * sizePixels + padding.xy + padding.zw;\n\n  vec2 pixelOffset = (positions * instanceRects.zw + instanceRects.xy) * sizePixels + mix(-padding.xy, padding.zw, positions);\n  pixelOffset = rotate_by_angle(pixelOffset, instanceAngles);\n  pixelOffset += instancePixelOffsets;\n  pixelOffset.y *= -1.0;\n\n  if (billboard)  {\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n    vec3 offset = vec3(pixelOffset, 0.0);\n    DECKGL_FILTER_SIZE(offset, geometry);\n    gl_Position.xy += project_pixel_size_to_clipspace(offset.xy);\n  } else {\n    vec3 offset_common = vec3(project_pixel_size(pixelOffset), 0.0);\n    DECKGL_FILTER_SIZE(offset_common, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, offset_common, geometry.position);\n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  // Apply opacity to instance color, or return instance picking color\n  vFillColor = vec4(instanceFillColors.rgb, instanceFillColors.a * opacity);\n  DECKGL_FILTER_COLOR(vFillColor, geometry);\n  vLineColor = vec4(instanceLineColors.rgb, instanceLineColors.a * opacity);\n  DECKGL_FILTER_COLOR(vLineColor, geometry);\n}\n",fs:"#define SHADER_NAME text-background-layer-fragment-shader\n\nprecision highp float;\n\nuniform bool stroked;\n\nvarying vec4 vFillColor;\nvarying vec4 vLineColor;\nvarying float vLineWidth;\nvarying vec2 uv;\nvarying vec2 dimensions;\n\nvoid main(void) {\n  geometry.uv = uv;\n\n  vec2 pixelPosition = uv * dimensions;\n  if (stroked) {\n    float distToEdge = min(\n      min(pixelPosition.x, dimensions.x - pixelPosition.x),\n      min(pixelPosition.y, dimensions.y - pixelPosition.y)\n    );\n    float isBorder = smoothedge(distToEdge, vLineWidth);\n    gl_FragColor = mix(vFillColor, vLineColor, isBorder);\n  } else {\n    gl_FragColor = vFillColor;\n  }\n\n  DECKGL_FILTER_COLOR(gl_FragColor, geometry);\n}\n",modules:[o.Z,s.Z]})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),transition:!0,accessor:"getPosition"},instanceSizes:{size:1,transition:!0,accessor:"getSize",defaultValue:1},instanceAngles:{size:1,transition:!0,accessor:"getAngle"},instanceRects:{size:4,accessor:"getBoundingRect"},instancePixelOffsets:{size:2,transition:!0,accessor:"getPixelOffset"},instanceFillColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getFillColor",defaultValue:[0,0,0,255]},instanceLineColors:{size:4,transition:!0,normalized:!0,type:5121,accessor:"getLineColor",defaultValue:[0,0,0,255]},instanceLineWidths:{size:1,transition:!0,accessor:"getLineWidth",defaultValue:1}})}updateState(t){super.updateState(t);const{changeFlags:e}=t;if(e.extensionsChanged){var i;const{gl:t}=this.context;null===(i=this.state.model)||void 0===i||i.delete(),this.state.model=this._getModel(t),this.getAttributeManager().invalidateAll()}}draw(t){let{uniforms:e}=t;
2const{billboard:i,sizeScale:n,sizeUnits:r,sizeMinPixels:o,sizeMaxPixels:s,getLineWidth:l}=this.props;let{padding:c}=this.props;c.length<4&&(c=[c[0],c[1],c[0],c[1]]),this.state.model.setUniforms(e).setUniforms({billboard:i,stroked:Boolean(l),padding:c,sizeUnits:a.iI[r],sizeScale:n,sizeMinPixels:o,sizeMaxPixels:s}).draw()}_getModel(t){return new l.Z(t,{...this.getShaders(),id:this.props.id,geometry:new c.Z({drawMode:6,vertexCount:4,attributes:{positions:{size:2,value:new Float32Array([0,0,1,0,1,1,0,1])}}}),isInstanced:!0})}}(0,n.Z)(h,"defaultProps",u),(0,n.Z)(h,"layerName","TextBackgroundLayer")},8086:(t,e,i)=>{"use strict";i.d(e,{Z:()=>T});var n=i(64649),r=i(79366),o=i(73115),s=i(20377),a=i(30116),l=i.n(a),c=i(21970);const u=32,h=[];function d(t,e,i,n){let r=0;for(let s=e;s<i;s++){var o;r+=(null===(o=n[t[s]])||void 0===o?void 0:o.width)||0}return r}function p(t,e,i,n,r,o){let s=e,a=0;for(let l=e;l<i;l++){const e=d(t,l,l+1,r);a+e>n&&(s<l&&o.push(l),s=l,a=0),a+=e}return a}function A(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5?arguments[5]:void 0;void 0===o&&(o=t.length);const s=[];return"break-all"===e?p(t,r,o,i,n,s):function(t,e,i,n,r,o){let s=e,a=e,l=e,c=0;for(let u=e;u<i;u++)if(" "===t[u]?l=u+1:" "!==t[u+1]&&u+1!==i||(l=u+1),l>a){let e=d(t,a,l,r);c+e>n&&(s<a&&(o.push(a),s=a,c=0),e>n&&(e=p(t,a,l,n,r,o),s=o[o.length-1])),a=l,c+=e}}(t,r,o,i,n,s),s}function f(t,e,i,n,r,o){let s=0,a=0;for(let l=e;l<i;l++){const e=t[l],i=n[e];i?(a||(a=i.height),r[l]=s+i.width/2,s+=i.width):(c.Z.warn("Missing character: ".concat(e," (").concat(e.codePointAt(0),")"))(),r[l]=s,s+=u)}o[0]=s,o[1]=a}function g(t,e,i,n,r){const o=Array.from(t),s=o.length,a=new Array(s),l=new Array(s),c=new Array(s),u=("break-word"===i||"break-all"===i)&&isFinite(n)&&n>0,d=[0,0],p=[0,0];let g=0,m=0,y=0;for(let v=0;v<=s;v++){const t=o[v];if("\n"!==t&&v!==s||(y=v),y>m){const t=u?A(o,i,n,r,m,y):h;for(let i=0;i<=t.length;i++){const n=0===i?m:t[i-1],s=i<t.length?t[i]:y;f(o,n,s,r,a,p);for(let t=n;t<s;t++)l[t]=g+p[1]/2,c[t]=p[0];g+=p[1]*e,d[0]=Math.max(d[0],p[0])}m=y}"\n"===t&&(a[m]=0,l[m]=0,c[m]=0,m++)}return d[1]=g,{x:a,y:l,rowWidth:c,size:d}}class m{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:5;(0,n.Z)(this,"limit",void 0),(0,n.Z)(this,"_cache",{}),(0,n.Z)(this,"_order",[]),this.limit=t}get(t){const e=this._cache[t];return e&&(this._deleteOrder(t),this._appendOrder(t)),e}set(t,e){this._cache[t]?(this.delete(t),this._cache[t]=e,this._appendOrder(t)):(Object.keys(this._cache).length===this.limit&&this.delete(this._order[0]),this._cache[t]=e,this._appendOrder(t))}delete(t){this._cache[t]&&(delete this._cache[t],this._deleteOrder(t))}_deleteOrder(t){const e=this._order.indexOf(t);e>=0&&this._order.splice(e,1)}_appendOrder(t){this._order.push(t)}}const y={fontFamily:"Monaco, monospace",fontWeight:"normal",characterSet:function(){const t=[];for(let e=32;e<128;e++)t.push(String.fromCharCode(e));return t}(),fontSize:64,buffer:4,sdf:!1,cutoff:.25,radius:12,smoothing:.1};let v=new m(3);function _(t,e){for(let i=0;i<t.length;i++)e.data[4*i+3]=t[i]}function b(t,e,i,n){t.font="".concat(n," ").concat(i,"px ").concat(e),t.fillStyle="#000",t.textBaseline="alphabetic",t.textAlign="left"}class x{constructor(){(0,n.Z)(this,"props",{...y}),(0,n.Z)(this,"_key",void 0),(0,n.Z)(this,"_atlas",void 0)}get texture(){return this._atlas}get mapping(){return this._atlas&&this._atlas.mapping}get scale(){return 1.2}setProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};Object.assign(this.props,t);const e=this._key;this._key=this._getKey();const i=function(t,e){let i;i="string"===typeof e?new Set(Array.from(e)):new Set(e);const n=v.get(t);if(!n)return i;for(const r in n.mapping)i.has(r)&&i.delete(r);return i}(this._key,this.props.characterSet),n=v.get(this._key);if(n&&0===i.size)return void(this._key!==e&&(this._atlas=n));const r=this._generateFontAtlas(this._key,i,n);this._atlas=r,v.set(this._key,r)}_generateFontAtlas(t,e,i){const{fontFamily:n,fontWeight:r,fontSize:o,buffer:s,sdf:a,radius:c,cutoff:u}=this.props;let h=i&&i.data;h||(h=document.createElement("canvas"),h.width=1024);const d=h.getContext("2d");b(d,n,o,r);const{mapping:p,canvasHeight:A,xOffset:f,yOffset:g}=function(t){let{characterSet:e,getFontWidth:i,fontHeight:n,buffer:r,maxCanvasWidth:o,mapping:s={},xOffset:a=0,yOffset:l=0}=t,c=0,u=a;for(const p of e)if(!s[p]){const t=i(p);u+t+2*r>o&&(u=0,c++),s[p]={x:u+r,y:l+c*(n+2*r)+r,width:t,height:n},u+=t+2*r}const h=n+2*r;return{mapping:s,xOffset:u,yOffset:l+c*h,canvasHeight:(d=l+(c+1)*h,Math.pow(2,Math.ceil(Math.log2(d))))};var d}({getFontWidth:t=>d.measureText(t).width,fontHeight:1.2*o,buffer:s,characterSet:e,maxCanvasWidth:1024,...i&&{mapping:i.mapping,xOffset:i.xOffset,yOffset:i.yOffset}});if(h.height!==A){const t=d.getImageData(0,0,h.width,h.height);h.height=A,d.putImageData(t,0,0)}if(b(d,n,o,r),a){const t=new(l())(o,s,c,u,n,r),i=d.getImageData(0,0,t.size,t.size);for(const n of e)_(t.draw(n),i),d.putImageData(i,p[n].x-s,p[n].y+s)}else for(const l of e)d.fillText(l,p[l].x,p[l].y+.9*o);return{xOffset:f,yOffset:g,mapping:p,data:h,width:h.width,height:h.height}}_getKey(){const{fontFamily:t,fontWeight:e,fontSize:i,buffer:n,sdf:r,radius:o,cutoff:s}=this.props;return r?"".concat(t," ").concat(e," ").concat(i," ").concat(n," ").concat(o," ").concat(s):"".concat(t," ").concat(e," ").concat(i," ").concat(n)}}var w=i(56394);const C={start:1,middle:0,end:-1},B={top:1,center:0,bottom:-1},E=[0,0,0,255],S={billboard:!0,sizeScale:1,sizeUnits:"pixels",sizeMinPi
2xels:0,sizeMaxPixels:Number.MAX_SAFE_INTEGER,background:!1,getBackgroundColor:{type:"accessor",value:[255,255,255,255]},getBorderColor:{type:"accessor",value:E},getBorderWidth:{type:"accessor",value:0},backgroundPadding:{type:"array",value:[0,0,0,0]},characterSet:{type:"object",value:y.characterSet},fontFamily:y.fontFamily,fontWeight:y.fontWeight,lineHeight:1,outlineWidth:{type:"number",value:0,min:0},outlineColor:{type:"color",value:E},fontSettings:{},wordBreak:"break-word",maxWidth:{type:"number",value:-1},getText:{type:"accessor",value:t=>t.text},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:E},getSize:{type:"accessor",value:32},getAngle:{type:"accessor",value:0},getTextAnchor:{type:"accessor",value:"middle"},getAlignmentBaseline:{type:"accessor",value:"center"},getPixelOffset:{type:"accessor",value:[0,0]},backgroundColor:{deprecatedFor:["background","getBackgroundColor"]}};class T extends r.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0),(0,n.Z)(this,"getBoundingRect",((t,e)=>{const i=this.state.fontAtlasManager.mapping,n=this.state.getText,{wordBreak:r,maxWidth:o,lineHeight:s,getTextAnchor:a,getAlignmentBaseline:l}=this.props,c=n(t,e)||"",{size:[u,h]}=g(c,s,r,o,i);return[(C["function"===typeof a?a(t,e):a]-1)*u/2,(B["function"===typeof l?l(t,e):l]-1)*h/2,u,h]})),(0,n.Z)(this,"getIconOffsets",((t,e)=>{const i=this.state.fontAtlasManager.mapping,n=this.state.getText,{wordBreak:r,maxWidth:o,lineHeight:s,getTextAnchor:a,getAlignmentBaseline:l}=this.props,c=n(t,e)||"",{x:u,y:h,rowWidth:d,size:[p,A]}=g(c,s,r,o,i),f=C["function"===typeof a?a(t,e):a],m=B["function"===typeof l?l(t,e):l],y=u.length,v=new Array(2*y);let _=0;for(let g=0;g<y;g++){const t=(1-f)*(p-d[g])/2;v[_++]=(f-1)*p/2+t+u[g],v[_++]=(m-1)*A/2+h[g]}return v}))}initializeState(){this.state={styleVersion:0,fontAtlasManager:new x}}updateState(t){const{props:e,oldProps:i,changeFlags:n}=t;(n.dataChanged||n.updateTriggersChanged&&(n.updateTriggersChanged.all||n.updateTriggersChanged.getText))&&this._updateText();(this._updateFontAtlas()||e.lineHeight!==i.lineHeight||e.wordBreak!==i.wordBreak||e.maxWidth!==i.maxWidth)&&this.setState({styleVersion:this.state.styleVersion+1})}getPickingInfo(t){let{info:e}=t;return e.object=e.index>=0?this.props.data[e.index]:null,e}_updateFontAtlas(){const{fontSettings:t,fontFamily:e,fontWeight:i}=this.props,{fontAtlasManager:n,characterSet:r}=this.state,o={...t,characterSet:r,fontFamily:e,fontWeight:i};if(!n.mapping)return n.setProps(o),!0;for(const s in o)if(o[s]!==n.props[s])return n.setProps(o),!0;return!1}_updateText(){var t;const{data:e,characterSet:i}=this.props,n=null===(t=e.attributes)||void 0===t?void 0:t.getText;let r,{getText:s}=this.props,a=e.startIndices;const l="auto"===i&&new Set;if(n&&a){const{texts:t,characterCount:i}=function(t){let{value:e,length:i,stride:n,offset:r,startIndices:o,characterSet:s}=t;const a=e.BYTES_PER_ELEMENT,l=n?n/a:1,c=r?r/a:0,u=o[i]||Math.ceil((e.length-c)/l),h=s&&new Set,d=new Array(i);let p=e;if(l>1||c>0){p=new(0,e.constructor)(u);for(let t=0;t<u;t++)p[t]=e[t*l+c]}for(let A=0;A<i;A++){const t=o[A],e=o[A+1]||u,i=p.subarray(t,e);d[A]=String.fromCodePoint.apply(null,i),h&&i.forEach(h.add,h)}if(h)for(const A of h)s.add(String.fromCodePoint(A));return{texts:d,characterCount:u}}({...ArrayBuffer.isView(n)?{value:n}:n,length:e.length,startIndices:a,characterSet:l});r=i,s=(e,i)=>{let{index:n}=i;return t[n]}}else{const{iterable:t,objectInfo:i}=(0,o.jB)(e);a=[0],r=0;for(const e of t){i.index++;const t=Array.from(s(e,i)||"");l&&t.forEach(l.add,l),r+=t.length,a.push(r)}}this.setState({getText:s,startIndices:a,numInstances:r,characterSet:l||i})}renderLayers(){const{startIndices:t,numInstances:e,getText:i,fontAtlasManager:{scale:n,texture:r,mapping:o},styleVersion:a}=this.state,{data:l,_dataDiff:c,getPosition:u,getColor:h,getSize:d,getAngle:p,getPixelOffset:A,getBackgroundColor:f,getBorderColor:g,getBorderWidth:m,backgroundPadding:v,background:_,billboard:b,fontSettings:x,outlineWidth:C,outlineColor:B,sizeScale:E,sizeUnits:S,sizeMinPi
2xels:T,sizeMaxPixels:M,transitions:I,updateTriggers:P}=this.props,D=this.getSubLayerClass("characters",s.Z),L=this.getSubLayerClass("background",w.Z);return[_&&new L({getFillColor:f,getLineColor:g,getLineWidth:m,padding:v,getPosition:u,getSize:d,getAngle:p,getPixelOffset:A,billboard:b,sizeScale:E/this.state.fontAtlasManager.props.fontSize,sizeUnits:S,sizeMinPixels:T,sizeMaxPixels:M,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getSize:I.getSize,getFillColor:I.getBackgroundColor,getLineColor:I.getBorderColor,getLineWidth:I.getBorderWidth,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"background",updateTriggers:{getPosition:P.getPosition,getAngle:P.getAngle,getSize:P.getSize,getFillColor:P.getBackgroundColor,getLineColor:P.getBorderColor,getLineWidth:P.getBorderWidth,getPixelOffset:P.getPixelOffset,getBoundingRect:{getText:P.getText,getTextAnchor:P.getTextAnchor,getAlignmentBaseline:P.getAlignmentBaseline,styleVersion:a}}}),{data:l.attributes&&l.attributes.background?{length:l.length,attributes:l.attributes.background}:l,_dataDiff:c,autoHighlight:!1,getBoundingRect:this.getBoundingRect}),new D({sdf:x.sdf,smoothing:Number.isFinite(x.smoothing)?x.smoothing:y.smoothing,outlineWidth:C,outlineColor:B,iconAtlas:r,iconMapping:o,getPosition:u,getColor:h,getSize:d,getAngle:p,getPixelOffset:A,billboard:b,sizeScale:E*n,sizeUnits:S,sizeMinPi
2xels:T*n,sizeMaxPixels:M*n,transitions:I&&{getPosition:I.getPosition,getAngle:I.getAngle,getColor:I.getColor,getSize:I.getSize,getPixelOffset:I.getPixelOffset}},this.getSubLayerProps({id:"characters",updateTriggers:{getIcon:P.getText,getPosition:P.getPosition,getAngle:P.getAngle,getColor:P.getColor,getSize:P.getSize,getPixelOffset:P.getPixelOffset,getIconOffsets:{getText:P.getText,getTextAnchor:P.getTextAnchor,getAlignmentBaseline:P.getAlignmentBaseline,styleVersion:a}}}),{data:l,_dataDiff:c,startIndices:t,numInstances:e,getIconOffsets:this.getIconOffsets,getIcon:i})]}static set fontAtlasCacheLimit(t){!function(t){c.Z.assert(Number.isFinite(t)&&t>=3,"Invalid cache limit"),v=new m(t)}(t)}}(0,n.Z)(T,"defaultProps",S),(0,n.Z)(T,"layerName","TextLayer")},66535:(t,e,i)=>{"use strict";function n(t){let{data:e,getIndex:i,dataRange:n,replace:r}=t;const{startRow:o=0,endRow:s=1/0}=n,a=e.length;let l=a,c=a;for(let d=0;d<a;d++){const t=i(e[d]);if(l>d&&t>=o&&(l=d),t>=s){c=d;break}}let u=l;const h=c-l!==r.length?e.slice(c):void 0;for(let d=0;d<r.length;d++)e[u++]=r[d];if(h){for(let t=0;t<h.length;t++)e[u++]=h[t];e.length=u}return{startRow:l,endRow:l+r.length}}i.d(e,{b:()=>n})},47203:(t,e,i)=>{"use strict";i.r(e),i.d(e,{ScenegraphLayer:()=>r.Z,SimpleMeshLayer:()=>n.Z});var n=i(36800),r=i(57309)},57309:(t,e,i)=>{"use strict";i.d(e,{Z:()=>U});var n=i(64649),r=i(90031),o=i(2123),s=i(2578),a=i(21970),l=i(28007),c=i(78032),u=i(431),h=i(12987),d=i(79666),p=i(81301);class A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e}=t;this.id=e||(0,d.hQ)(this.constructor.name),this.display=!0,this.position=new u.Z,this.rotation=new u.Z,this.scale=new u.Z(1,1,1),this.matrix=new h.Z,this.userData={},this.props={},this._setScenegraphNodeProps(t)}delete(){}setProps(t){return this._setScenegraphNodeProps(t),this}toString(){return"{type: ScenegraphNode, id: ".concat(this.id,")}")}setPosition(t){return(0,p.h)(3===t.length,"setPosition requires vector argument"),this.position=t,this}setRotation(t){return(0,p.h)(3===t.length,"setRotation requires vector argument"),this.rotation=t,this}setScale(t){return(0,p.h)(3===t.length,"setScale requires vector argument"),this.scale=t,this}setMatrix(t){!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?this.matrix.copy(t):this.matrix=t}setMatrixComponents(t){let{position:e,rotation:i,scale:n,update:r=!0}=t;return e&&this.setPosition(e),i&&this.setRotation(i),n&&this.setScale(n),r&&this.updateMatrix(),this}updateMatrix(){const t=this.position,e=this.rotation,i=this.scale;return this.matrix.identity(),this.matrix.translate(t),this.matrix.rotateXYZ(e),this.matrix.scale(i),this}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{position:e,rotation:i,scale:n}=t;return e&&this.setPosition(e),i&&this.setRotation(i),n&&this.setScale(n),this.updateMatrix(),this}getCoordinateUniforms(t,e){(0,p.h)(t),e=e||this.matrix;const i=new h.Z(t).multiplyRight(e),n=i.invert(),r=n.transpose();return{viewMatrix:t,modelMatrix:e,objectMatrix:e,worldMatrix:i,worldInverseMatrix:n,worldInverseTransposeMatrix:r}}_setScenegraphNodeProps(t){"display"in t&&(this.display=t.display),"position"in t&&this.setPosition(t.position),"rotation"in t&&this.setRotation(t.rotation),"scale"in t&&this.setScale(t.scale),"matrix"in t&&this.setMatrix(t.matrix),Object.assign(this.props,t)}}var f=i(33839),g=i(77462);class m extends A{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t=Array.isArray(t)?{children:t}:t;const{children:e=[]}=t;l.cM.assert(e.every((t=>t instanceof A)),"every child must an instance of ScenegraphNode"),super(t),this.children=e}add(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const n of e)Array.isArray(n)?this.add(...n):this.children.push(n);return this}remove(t){const e=this.children,i=e.indexOf(t);return i>-1&&e.splice(i,1),this}removeAll(){return this.children=[],this}delete(){this.children.forEach((t=>t.delete())),this.removeAll(),super.delete()}traverse(t){let{worldMatrix:e=new h.Z}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};
2const i=new h.Z(e).multiplyRight(this.matrix);for(const n of this.children)n instanceof m?n.traverse(t,{worldMatrix:i}):t(n,{worldMatrix:i})}}var y=i(34980);const v={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},_={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function b(t){if(!t._animation){const e=_[t.componentType],i=v[t.type],n=i*t.count,{buffer:r,byteOffset:o}=t.bufferView.data,s=new e(r,o+(t.byteOffset||0),n);if(1===i)t._animation=Array.from(s);else{const e=[];for(let t=0;t<s.length;t+=i)e.push(Array.from(s.slice(t,t+i)));t._animation=e}}return t._animation}const x=new h.Z;const w=new y.Z;function C(t,e,i,n){let{input:r,interpolation:o,output:s}=e;const a=t%r[r.length-1],c=r.findIndex((t=>t>=a)),u=Math.max(0,c-1);if(!Array.isArray(i[n]))switch(n){case"translation":i[n]=[0,0,0];break;case"rotation":i[n]=[0,0,0,1];break;case"scale":i[n]=[1,1,1];break;default:l.cM.warn("Bad animation path ".concat(n))()}(0,p.h)(i[n].length===s[u].length);const h=r[u],d=r[c];switch(o){case"STEP":!function(t,e,i){for(let n=0;n<i.length;n++)t[e][n]=i[n]}(i,n,s[u]);break;case"LINEAR":if(d>h){const t=(a-h)/(d-h);!function(t,e,i,n,r){if("rotation"===e){w.slerp({start:i,target:n,ratio:r});for(let i=0;i<w.length;i++)t[e][i]=w[i]}else for(let o=0;o<i.length;o++)t[e][o]=r*n[o]+(1-r)*i[o]}(i,n,s[u],s[c],t)}break;case"CUBICSPLINE":if(d>h){const t=(a-h)/(d-h),e=d-h;!function(t,e,i){let{p0:n,outTangent0:r,inTangent1:o,p1:s,tDiff:a,ratio:l}=i;for(let c=0;c<t[e].length;c++){const i=r[c]*a,u=o[c]*a;t[e][c]=(2*Math.pow(l,3)-3*Math.pow(l,2)+1)*n[c]+(Math.pow(l,3)-2*Math.pow(l,2)+l)*i+(-2*Math.pow(l,3)+3*Math.pow(l,2))*s[c]+(Math.pow(l,3)-Math.pow(l,2))*u}}(i,n,{p0:s[3*u+1],outTangent0:s[3*u+2],inTangent1:s[3*c+0],p1:s[3*c+1],tDiff:e,ratio:t})}break;default:l.cM.warn("Interpolation ".concat(o," not supported"))()}}class B{constructor(t){this.startTime=0,this.playing=!0,this.speed=1,this.channels=[],Object.assign(this,t)}animate(t){if(!this.playing)return;const e=(t/1e3-this.startTime)*this.speed;this.channels.forEach((t=>{let{sampler:i,target:n,path:r}=t;C(e,i,n,r),function(t,e){if(e.matrix.identity(),t.translation&&e.matrix.translate(t.translation),t.rotation){const i=x.fromQuaternion(t.rotation);e.matrix.multiplyRight(i)}t.scale&&e.matrix.scale(t.scale)}(n,n._node)}))}}class E{constructor(t){this.animations=t.animations.map(((e,i)=>{const n=e.name||"Animation-".concat(i),r=e.samplers.map((e=>{let{input:i,interpolation:n="LINEAR",output:r}=e;return{input:b(t.accessors[i]),interpolation:n,output:b(t.accessors[r])}})),o=e.channels.map((e=>{let{sampler:i,target:n}=e;return{sampler:r[i],target:t.nodes[n.node],path:n.path}}));return new B({name:n,channels:o})}))}animate(t){this.setTime(t)}setTime(t){this.animations.forEach((e=>e.animate(t)))}getAnimations(){return this.animations}}var S=i(94557);class T extends A{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(e),this.onBeforeRender=null,this.AfterRender=null,t instanceof S.Z?(this.model=t,this._setModelNodeProps(e)):this.model=new S.Z(t,e),this.managedResources=e.managedResources||[]}setProps(t){return super.setProps(t),this._setModelNodeProps(t),this}delete(){this.model&&(this.model.delete(),this.model=null),this.managedResources.forEach((t=>t.delete())),this.managedResources=[]}draw(){return this.model.draw(...arguments)}setUniforms(){return this.model.setUniforms(...arguments),this}setAttributes(){return this.model.setAttributes(...arguments),this}updateModuleSettings(){return this.model.updateModuleSettings(...arguments),this}_setModelNodeProps(t){this.model.setProps(t)}}var M=i(92086);function I(t,e){return(0,l.D0)(t)?"#version 300 es\n".concat(e):e}const P={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},D={modelOptions:{},pbrDebug:!1,imageBasedLightingEnvironment:null,lights:!0,useTangents:!1};class L{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.options=Object.assign({},D,e)}instantiate(t){this.gltf=t;return(t.scenes||[]).map((t=>this.createScene(t)))}createAnimator(){return Array.isArray(this.gltf.animations)?new E(this.gltf):null}createScene(t){const e=(t.nodes||[]).map((t=>this.createNode(t)));return new m({id:t.name||t.id,children:e})}createNode(t){if(!t._node){const e=(t.children||[]).map((t=>this.createNode(t)));t.mesh&&e.push(this.createMesh(t.mesh));const i=new m({id:t.name||t.id,children:e});if(t.matrix)i.setMatrix(t.matrix);else{if(i.matrix.identity(),t.translation&&i.matrix.translate(t.translation),t.rotation){const e=(new h.Z).fromQuaternion(t.rotation);i.matrix.multiplyRight(e)}t.scale&&i.matrix.scale(t.scale)}t._node=i}return t._node}createMesh(t){if(!t._mesh){const e=(t.primitives||[]).map(((e,i)=>this.createPrimitive(e,i,t))),i=new m({id:t.name||t.id,children:e});t._mesh=i}return t._mesh}getVertexCount(t){l.cM.warn("getVertexCount() not found")()}createPrimitive(t,e,i){return function(t,e){const{id:i,drawMode:n,vertexCount:r,attributes:o,modelOptions:s}=e,a=new M.Z(t,e);l.cM.info(4,"createGLTFModel defines: ",a.defines)();const u=[];u.push(...a.generatedTextures),u.push(...Object.values(o).map((t=>t.buffer)));const h=new T(t,Object.assign({id:i,drawMode:n,vertexCount:r,modules:[c.b],defines:a.defines,parameters:a.parameters,vs:I(t,"\n#if (__VERSION__ < 300)\n  #define _attr attribute\n#else\n  #define _attr in\n#endif\n\n  _attr vec4 POSITION;\n\n  #ifdef HAS_NORMALS\n    _attr vec4 NORMAL;\n  #endif\n\n  #ifdef HAS_TANGENTS\n    _attr vec4 TANGENT;\n  #endif\n\n  #ifdef HAS_UV\n    _attr vec2 TEXCOORD_0;\n  #endif\n\n  void main(void) {\n    vec4 _NORMAL = vec4(0.);\n    vec4 _TANGENT = vec4(0.);\n    vec2 _TEXCOORD_0 = vec2(0.);\n\n    #ifdef HAS_NORMALS\n      _NORMAL = NORMAL;\n    #endif\n\n    #ifdef HAS_TANGENTS\n      _TANGENT = TANGENT;\n    #endif\n\n    #ifdef HAS_UV\n      _TEXCOORD_0 = TEXCOORD_0;\n    #endif\n\n    pbr_setPositionNormalTangentUV(POSITION, _NORMAL, _TANGENT, _TEXCOORD_0);\n    gl_Position = u_MVPMatrix * POSITION;\n  }\n"),fs:I(t,"\n#if (__VERSION__ < 300)\n  #define fragmentColor gl_FragColor\n#else\n  out vec4 fragmentColor;\n#endif\n\n  void main(void) {\n    fragmentColor = pbr_filterColor(vec4(0));\n  }\n"),managedResources:u},s));return h.setProps({attributes:o}),h.setUniforms(a.uniforms),h}(this.gl,Object.assign({id:t.name||"".concat(i.name||i.id,"-primitive-").concat(e),drawMode:t.mode||4,vertexCount:t.indices?t.indices.count:this.getVertexCount(t.attributes),attributes:this.createAttributes(t.attributes,t.indices),material:t.material},this.options))}createAttributes(t,e){const i={};return Object.keys(t).forEach((e=>{i[e]=this.createAccessor(t[e],this.createBuffer(t[e],this.gl.ARRAY_BUFFER))})),e&&(i.indices=this.createAccessor(e,this.createBuffer(e,this.gl.ELEMENT_ARRAY_BUFFER))),l.cM.info(4,"glTF Attributes",{attributes:t,indices:e,generated:i})(),i}createBuffer(t,e){t.bufferView||(t.bufferView={});const{bufferView:i}=t;return i.lumaBuffers||(i.lumaBuffers={}),i.lumaBuffers[e]||(i.lumaBuffers[e]=new f.Z(this.gl,{id:"from-".concat(i.id),data:i.data||t.value,target:e})),i.lumaBuffers[e]}createAccessor(t,e){return new g.Z({buffer:e,offset:t.byteOffset||0,stride:t.bufferView.byteStride||0,type:t.componentType,size:P[t.type]})}createSampler(t){return t}needsPOT(){return!1}}var O=i(82595);async function F(t){const e=[];
2return t.scenes.forEach((t=>{t.traverse((t=>{Object.values(t.model.getUniforms()).forEach((t=>{!1===t.loaded&&e.push(t)}))}))})),await async function(t){for(;t();)await new Promise((t=>requestAnimationFrame(t)))}((()=>e.some((t=>!t.loaded))))}var R=i(7614);const k=[255,255,255,255],z={scenegraph:{type:"object",value:null,async:!0},getScene:t=>t&&t.scenes?"object"===typeof t.scene?t.scene:t.scenes[t.scene||0]:t,getAnimator:t=>t&&t.animator,_animations:null,sizeScale:{type:"number",value:1,min:0},sizeMinPixels:{type:"number",min:0,value:0},sizeMaxPixels:{type:"number",min:0,value:Number.MAX_SAFE_INTEGER},getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:k},_lighting:"flat",_imageBasedLightingEnvironment:null,getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},loaders:[O.E]};class U extends r.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}getShaders(){const t=[o.Z,s.Z];return"pbr"===this.props._lighting&&t.push(c.b),{vs:"#version 300 es\n\n// Instance attributes\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Uniforms\nuniform float sizeScale;\nuniform float sizeMinPixels;\nuniform float sizeMaxPixels;\nuniform mat4 sceneModelMatrix;\nuniform bool composeModelMatrix;\n\n// Attributes\nin vec4 POSITION;\n\n#ifdef HAS_UV\n  in vec2 TEXCOORD_0;\n#endif\n\n#ifdef MODULE_PBR\n  #ifdef HAS_NORMALS\n    in vec4 NORMAL;\n  #endif\n#endif\n\n// Varying\nout vec4 vColor;\n\n// MODULE_PBR contains all the varying definitions needed\n#ifndef MODULE_PBR\n  #ifdef HAS_UV\n    out vec2 vTEXCOORD_0;\n  #endif\n#endif\n\n// Main\nvoid main(void) {\n  #if defined(HAS_UV) && !defined(MODULE_PBR)\n    vTEXCOORD_0 = TEXCOORD_0;\n    geometry.uv = vTEXCOORD_0;\n  #endif\n\n  geometry.worldPosition = instancePositions;\n  geometry.pickingColor = instancePickingColors;\n\n  vec3 normal = vec3(0.0, 0.0, 1.0);\n  #ifdef MODULE_PBR\n    #ifdef HAS_NORMALS\n      normal = instanceModelMatrix * (sceneModelMatrix * vec4(NORMAL.xyz, 0.0)).xyz;\n    #endif\n  #endif\n\n  float originalSize = project_size_to_pixel(sizeScale);
2\n  float clampedSize = clamp(originalSize, sizeMinPixels, sizeMaxPixels);\n\n  vec3 pos = (instanceModelMatrix * (sceneModelMatrix * POSITION).xyz) * sizeScale * (clampedSize / originalSize) + instanceTranslation;\n  if(composeModelMatrix) {\n    DECKGL_FILTER_SIZE(pos, geometry);\n    // using instancePositions as world coordinates\n    // when using globe mode, this branch does not re-orient the model to align with the surface of the earth\n    // call project_normal before setting position to avoid rotation\n    geometry.normal = project_normal(normal);\n    gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), geometry.position);\n  }\n  else {\n    pos = project_size(pos);\n    DECKGL_FILTER_SIZE(pos, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, geometry.position);\n    geometry.normal = project_normal(normal);\n  }\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  #ifdef MODULE_PBR\n    // set PBR data\n    pbr_vPosition = geometry.position.xyz;\n    #ifdef HAS_NORMALS\n      pbr_vNormal = geometry.normal;\n    #endif\n\n    #ifdef HAS_UV\n      pbr_vUV = TEXCOORD_0;\n    #else\n      pbr_vUV = vec2(0., 0.);\n    #endif\n    geometry.uv = pbr_vUV;\n  #endif\n\n  vColor = instanceColors;\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n\n// Uniforms\nuniform float opacity;\n\n// Varying\nin vec4 vColor;\n\nout vec4 fragmentColor;\n\n// MODULE_PBR contains all the varying definitions needed\n#ifndef MODULE_PBR\n  #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n    in vec2 vTEXCOORD_0;\n    uniform sampler2D u_BaseColorSampler;\n  #endif\n#endif\n\nvoid main(void) {\n  #ifdef MODULE_PBR\n    fragmentColor = vColor * pbr_filterColor(vec4(0));\n    geometry.uv = pbr_vUV;\n  #else\n    #if defined(HAS_UV) && defined(HAS_BASECOLORMAP)\n      fragmentColor = vColor * texture2D(u_BaseColorSampler, vTEXCOORD_0);\n      geometry.uv = vTEXCOORD_0;\n    #else\n      fragmentColor = vColor;\n    #endif\n  #endif\n\n  fragmentColor.a *= opacity;\n  DECKGL_FILTER_COLOR(fragmentColor, geometry);\n}\n",modules:t}}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{size:3,type:5130,fp64:this.use64bitPositions(),accessor:"getPosition",transition:!0},instanceColors:{type:5121,size:this.props.colorFormat.length,accessor:"getColor",normalized:!0,defaultValue:k,transition:!0},instanceModelMatrix:R.P})}updateState(t){super.updateState(t);const{props:e,oldProps:i}=t;e.scenegraph!==i.scenegraph?this._updateScenegraph():e._animations!==i._animations&&this._applyAnimationsProp(this.state.scenegraph,this.state.animator,e._animations)}finalizeState(t){super.finalizeState(t),this._deleteScenegraph()}_updateScenegraph(){const t=this.props,{gl:e}=this.context;let i=null;if(t.scenegraph instanceof A)i={scenes:[t.scenegraph]};else if(t.scenegraph&&!t.scenegraph.gltf){const n=t.scenegraph,r=function(t,e,i){const n=new L(t,i);return{scenes:n.instantiate(e),animator:n.createAnimator()}}(e,n,this._getModelOptions());i={gltf:n,...r},F(r).then((()=>this.setNeedsRedraw()))}else t.scenegraph&&(a.Z.deprecated("ScenegraphLayer.props.scenegraph","Use GLTFLoader instead of GLTFScenegraphLoader")(),i=t.scenegraph);const n={layer:this,gl:e},r=t.getScene(i,n),o=t.getAnimator(i,n);r instanceof A?(this._deleteScenegraph(),this._applyAllAttributes(r),this._applyAnimationsProp(r,o,t._animations),this.setState({scenegraph:r,animator:o})):null!==r&&a.Z.warn("invalid scenegraph:",r)()}_applyAllAttributes(t){if(this.state.attributesAvailable){const e=this.getAttributeManager().getAttributes();t.traverse((t=>{this._setModelAttributes(t.model,e)}))}}_applyAnimationsProp(t,e,i){if(!t||!e||!i)return;const n=e.getAnimations();Object.keys(i).sort().forEach((t=>{const e=i[t];if("*"===t)n.forEach((t=>{Object.assign(t,e)}));else if(Number.isFinite(Number(t))){const i=Number(t);i>=0&&i<n.length?Object.assign(n[i],e):a.Z.warn("animation ".concat(t," not found"))()}else{const i=n.find((e=>{let{name:i}=e;return i===t}));i?Object.assign(i,e):a.Z.warn("animation ".concat(t," not found"))()}}))}_deleteScenegraph(){const{scenegraph:t}=this.state;t instanceof A&&t.delete()}_getModelOptions(){const{_imageBasedLightingEnvironment:t}=this.props;let e=null;return t&&(e="function"===typeof t?t({gl:this.context.gl,layer:this}):t),{gl:this.context.gl,waitForFullLoad:!0,imageBasedLightingEnvironment:e,modelOptions:{isInstanced:!0,transpileToGLSL100:!(0,l.D0)(this.context.gl),...this.get
2Shaders()},useTangents:!1}}updateAttributes(t){this.setState({attributesAvailable:!0}),this.state.scenegraph&&this.state.scenegraph.traverse((e=>{this._setModelAttributes(e.model,t)}))}draw(t){let{moduleParameters:e=null,parameters:i={},context:n}=t;if(!this.state.scenegraph)return;this.props._animations&&this.state.animator&&(this.state.animator.animate(n.timeline.getTime()),this.setNeedsRedraw());const{viewport:r}=this.context,{sizeScale:o,sizeMinPixels:s,sizeMaxPixels:a,opacity:l,coordinateSystem:c}=this.props,u=this.getNumInstances();this.state.scenegraph.traverse(((t,n)=>{let{worldMatrix:h}=n;t.model.setInstanceCount(u),t.updateModuleSettings(e),t.draw({parameters:i,uniforms:{sizeScale:o,opacity:l,sizeMinPixels:s,sizeMaxPixels:a,composeModelMatrix:(0,R.X)(r,c),sceneModelMatrix:h,u_Camera:t.model.getUniforms().project_uCameraPosition}})}))}}(0,n.Z)(U,"defaultProps",z),(0,n.Z)(U,"layerName","ScenegraphLayer")},36800:(t,e,i)=>{"use strict";i.d(e,{Z:()=>v});var n=i(64649),r=i(21970),o=i(90031),s=i(2123),a=i(54976),l=i(2578),c=i(69296),u=i(28007),h=i(58300),d=i(94557),p=i(12308),A=i(70353),f=i(7614);function g(t,e){(t.COLOR_0||t.colors)&&e||(t.colors={constant:!0,value:new Float32Array([1,1,1])}),r.Z.assert(t.positions||t.POSITION,'no "postions" or "POSITION" attribute in mesh')}function m(t,e){if(t.attributes)return g(t.attributes,e),t instanceof c.Z?t:new c.Z(t);if(t.positions||t.POSITION)return g(t,e),new c.Z({attributes:t});throw Error("Invalid mesh")}const y={mesh:{type:"object",value:null,async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_useMeshColors:{type:"boolean",value:!1},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:t=>t.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]}};class v extends o.Z{constructor(){super(...arguments),(0,n.Z)(this,"state",void 0)}getShaders(){const t=!(0,u.D0)(this.context.gl),e={};return(0,p.U6)(this.context.gl,A.h.GLSL_DERIVATIVES)&&(e.DERIVATIVES_AVAILABLE=1),super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\n\n// Scale the model\nuniform float sizeScale;\nuniform bool composeModelMatrix;\n\n// Primitive attributes\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\n\n// Instance attributes\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin mat3 instanceModelMatrix;\nin vec3 instanceTranslation;\n\n// Outputs to fragment shader\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\n\nvoid main(void) {\n  geometry.worldPosition = instancePositions;\n  geometry.uv = texCoords;\n  geometry.pickingColor = instancePickingColors;\n\n  vTexCoord = texCoords;\n  cameraPosition = project_uCameraPosition;\n  vColor = vec4(colors * instanceColors.rgb, instanceColors.a);\n\n  vec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\n\n  if (composeModelMatrix) {\n    DECKGL_FILTER_SIZE(pos, geometry);\n    // using instancePositions as world coordinates\n    // when using globe mode, this branch does not re-orient the model to align with the surface of the earth\n    // call project_normal before setting position to avoid rotation\n    normals_commonspace = project_normal(instanceModelMatrix * normals);\n    gl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\n    geometry.position = position_commonspace;\n  }\n  else {\n    pos = project_size(pos);\n    DECKGL_FILTER_SIZE(pos, geometry);\n    gl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\n    geometry.position = position_commonspace;\n    normals_commonspace = project_normal(instanceModelMatrix * normals);\n  }\n\n  geometry.normal = normals_commonspace;\n  DECKGL_FILTER_GL_POSITION(gl_Position, geometry);\n\n  DECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\n\nprecision highp float;\n\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\n\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\n\nout vec4 fragColor;\n\nvoid main(void) {\n  geometry.uv = vTexCoord;\n\n  vec3 normal;\n  if (flatShading) {\n\n// NOTE(Tarek): This is necessary because\n// headless.gl reports the extension as\n// available but does not support it in\n// the shader.\n#ifdef DERIVATIVES_AVAILABLE\n    normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n#else\n    normal = vec3(0.0, 0.0, 1.0);\n#endif\n  } else {\n    normal = normals_commonspace;\n  }\n\n  vec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\n  vec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\n  fragColor = vec4(lightColor, color.a * opacity);\n\n  DECKGL_FILTER_COLOR(fragColor, geometry);\n}\n",modules:[s.Z,a.s,l.Z],transpileToGLSL100:t,defines:e})}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:5130,fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:5121,transition:!0,size:this.props.colorFormat.length,normalized:!0,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:f.P}),this.setState({emptyTexture:new h.Z(this.context.gl,{data:new Uint8Array(4),width:1,height:1})})}updateState(t){super.updateState(t);const{props:e,oldProps:i,changeFlags:n}=t;if(e.mesh!==i.mesh||n.extensionsChanged){var r;if(null===(r=this.state.model)||void 0===r||r.delete(),e.mesh){this.state.model=this.getModel(e.mesh);const t=e.mesh.attributes||e.mesh;this.setState({hasNormals:Boolean(t.NORMAL||t.normals)})}this.getAttributeManager().invalidateAll()}e.texture!==i.texture&&this.setTexture(e.texture),this.state.model&&this.state.model.setDrawMode(this.props.wireframe?3:4)}finalizeState(t){super.finalizeState(t),this.state.emptyTexture.delete()}draw(t){let{uniforms:e}=t;if(!this.state.model)return;const{viewport:i}=this.context,{sizeScale:n,coordinateSystem:r,_instanced:o}=this.props;this.state.model.setUniforms(e).setUniforms({sizeScale:n,composeModelMatrix:!o||(0,f.X)(i,r),flatShading:!this.state.hasNormals}).draw()}
vendor: 12,504 bytes, line 2
2getModel(t){const e=new d.Z(this.context.gl,{...this.getShaders(),id:this.props.id,geometry:m(t,this.props._useMeshColors),isInstanced:!0}),{texture:i}=this.props,{emptyTexture:n}=this.state;return e.setUniforms({sampler:i||n,hasTexture:Boolean(i)}),e}setTexture(t){const{emptyTexture:e,model:i}=this.state;i&&i.setUniforms({sampler:t||e,hasTexture:Boolean(t)})}}(0,n.Z)(v,"defaultProps",y),(0,n.Z)(v,"layerName","SimpleMeshLayer")},7614:(t,e,i)=>{"use strict";i.d(e,{P:()=>u,X:()=>h});var n=i(73115),r=i(18252);const o=Math.PI/180,s=new Float32Array(16),a=new Float32Array(12);function l(t,e,i){const n=e[0]*o,r=e[1]*o,s=e[2]*o,a=Math.sin(s),l=Math.sin(n),c=Math.sin(r),u=Math.cos(s),h=Math.cos(n),d=Math.cos(r),p=i[0],A=i[1],f=i[2];t[0]=p*d*h,t[1]=p*c*h,t[2]=p*-l,t[3]=A*(-c*u+d*l*a),t[4]=A*(d*u+c*l*a),t[5]=A*h*a,t[6]=f*(c*a+d*l*u),t[7]=f*(-d*a+c*l*u),t[8]=f*h*u}function c(t){return t[0]=t[0],t[1]=t[1],t[2]=t[2],t[3]=t[4],t[4]=t[5],t[5]=t[6],t[6]=t[8],t[7]=t[9],t[8]=t[10],t[9]=t[12],t[10]=t[13],t[11]=t[14],t.subarray(0,12)}const u={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrix__LOCATION_0:{size:3,elementOffset:0},instanceModelMatrix__LOCATION_1:{size:3,elementOffset:3},instanceModelMatrix__LOCATION_2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(t,e){let{startRow:i,endRow:r}=e;const{data:o,getOrientation:u,getScale:h,getTranslation:d,getTransformMatrix:p}=this.props,A=Array.isArray(p),f=A&&16===p.length,g=Array.isArray(h),m=Array.isArray(u),y=Array.isArray(d),v=f||!A&&Boolean(p(o[0]));t.constant=v?f:m&&g&&y;const _=t.value;if(t.constant){let e;if(v)s.set(p),e=c(s);else{e=a;l(e,u,h),e.set(d,9)}t.value=new Float32Array(e)}else{let e=i*t.size;const{iterable:A,objectInfo:b}=(0,n.jB)(o,i,r);for(const t of A){let i;if(b.index++,v)s.set(f?p:p(t,b)),i=c(s);else{i=a;l(i,m?u:u(t,b),g?h:h(t,b)),i.set(y?d:d(t,b),9)}_[e++]=i[0],_[e++]=i[1],_[e++]=i[2],_[e++]=i[3],_[e++]=i[4],_[e++]=i[5],_[e++]=i[6],_[e++]=i[7],_[e++]=i[8],_[e++]=i[9],_[e++]=i[10],_[e++]=i[11]}}}};function h(t,e){return e===r.Df.CARTESIAN||e===r.Df.METER_OFFSETS||e===r.Df.DEFAULT&&!t.isGeospatial}},59109:(t,e,i)=>{"use strict";i.d(e,{Z:()=>Ue});var n=i(66845),r=i(64649);let o=1,s=1;class a{constructor(){this.time=0,this.channels=new Map,this.animations=new Map,this.playing=!1,this.lastEngineTime=-1}addChannel(t){const{delay:e=0,duration:i=Number.POSITIVE_INFINITY,rate:n=1,repeat:r=1}=t,s=o++,a={time:0,delay:e,duration:i,rate:n,repeat:r};return this._setChannelTime(a,this.time),this.channels.set(s,a),s}removeChannel(t){this.channels.delete(t);for(const[e,i]of this.animations)i.channel===t&&this.detachAnimation(e)}isFinished(t){const e=this.channels.get(t);return void 0!==e&&this.time>=e.delay+e.duration*e.repeat}getTime(t){if(void 0===t)return this.time;const e=this.channels.get(t);return void 0===e?-1:e.time}setTime(t){this.time=Math.max(0,t);const e=this.channels.values();for(const n of e)this._setChannelTime(n,this.time);const i=this.animations.values();for(const n of i){const{animation:t,channel:e}=n;t.setTime(this.getTime(e))}}play(){this.playing=!0}pause(){this.playing=!1,this.lastEngineTime=-1}reset(){this.setTime(0)}attachAnimation(t,e){const i=s++;return this.animations.set(i,{animation:t,channel:e}),t.setTime(this.getTime(e)),i}detachAnimation(t){this.animations.delete(t)}update(t){this.playing&&(-1===this.lastEngineTime&&(this.lastEngineTime=t),this.setTime(this.time+(t-this.lastEngineTime)),this.lastEngineTime=t)}_setChannelTime(t,e){const i=e-t.delay;i>=t.duration*t.repeat?t.time=t.duration*t.rate:(t.time=Math.max(0,i)%t.duration,t.time*=t.rate)}}var l=i(48915),c=i(21970),u=i(23427),h=i(18757),d=i(92138),p=i(65959);class A{constructor(t,e,i){(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"context",void 0),(0,r.Z)(this,"isLoaded",void 0),(0,r.Z)(this,"persistent",void 0),(0,r.Z)(this,"_loadCount",0),(0,r.Z)(this,"_subscribers",new Set),(0,r.Z)(this,"_data",void 0),(0,r.Z)(this,"_loader",void 0),(0,r.Z)(this,"_error",void 0),(0,r.Z)(this,"_content",void 0),this.id=t,this.context=i,this.setData(e)}subscribe(t){this._subscribers.add(t)}unsubscribe(t){this._subscribers.delete(t)}inUse(){return this._subscribers.size>0}delete(){}getData(){return this.isLoaded?this._error?Promise.reject(this._error):this._content:this._loader.then((()=>this.getData()))}setData(t,e){if(t===this._data&&!e)return;this._data=t;const i=++this._loadCount;let n=t;"string"===typeof t&&(n=(0,p.z)(t)),n instanceof Promise?(this.isLoaded=!1,this._loader=n.then((t=>{this._loadCount===i&&(this.isLoaded=!0,this._error=void 0,this._content=t)})).catch((t=>{this._loadCount===i&&(this.isLoaded=!0,this._error=t||!0)}))):(this.isLoaded=!0,this._error=void 0,this._content=t);for(const r of this._subscribers)r.onChange(this.getData())}}class f{constructor(t){let{gl:e,protocol:i}=t;(0,r.Z)(this,"protocol",void 0),(0,r.Z)(this,"_context",void 0),(0,r.Z)(this,"_resources",void 0),(0,r.Z)(this,"_consumers",void 0),(0,r.Z)(this,"_pruneRequest",void 0),this.protocol=i||"resource://",this._context={gl:e,resourceManager:this},this._resources={},this._consumers={},this._pruneRequest=null}contains(t){return!!t.startsWith(this.protocol)||t in this._resources}add(t){let{resourceId:e,data:i,forceUpdate:n=!1,persistent:r=!0}=t,o=this._resources[e];o?o.setData(i,n):(o=new A(e,i,this._context),this._resources[e]=o),o.persistent=r}remove(t){const e=this._resources[t];e&&(e.delete(),delete this._resources[t])}unsubscribe(t){let{consumerId:e}=t;const i=this._consumers[e];if(i){for(const t in i){const e=i[t],n=this._resources[e.resourceId];n&&n.unsubscribe(e)}delete this._consumers[e],this.prune()}}subscribe(t){let{resourceId:e,onChange:i,consumerId:n,requestId:r="default"}=t;const{_resources:o,protocol:s}=this;e.startsWith(s)&&(e=e.replace(s,""),o[e]||this.add({resourceId:e,data:null,persistent:!1}));const a=o[e];if(this._track(n,r,a,i),a)return a.getData()}prune(){this._pruneRequest||(this._pruneRequest=setTimeout((()=>this._prune()),0))}finalize(){for(const t in this._resources)this._resources[t].delete()}_track(t,e,i,n){const r=this._consumers,o=r[t]=r[t]||{},s=o[e]||{},a=s.resourceId&&this._resources[s.resourceId];a&&(a.unsubscribe(s),this.prune()),i&&(o[e]=s,s.onChange=n,s.resourceId=i.id,i.subscribe(s))}_prune(){this._pruneRequest=null;for(const t of Object.keys(this._resources)){const e=this._resources[t];e.persistent||e.inUse()||(e.delete(),delete this._resources[t])}}}var g=i(83427),m=i(37330),y=i(66199);const v=[y.Z],_=["vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)","vs:DECKGL_FILTER_GL_POSITION(inout vec4 position, VertexGeometry geometry)","vs:DECKGL_FILTER_COLOR(inout vec4 color, VertexGeometry geometry)","fs:DECKGL_FILTER_COLOR(inout vec4 color, FragmentGeometry geometry)"];function b(t){const e=m.Z.getDefaultProgramManager(t);for(const i of v)e.addDefaultModule(i);for(const i of _)e.addShaderHook(i);return e}class x{constructor(t){let{deck:e,stats:i,viewport:n,timeline:o}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.Z)(this,"layers",void 0),(0,r.Z)(this,"context",void 0),(0,r.Z)(this,"resourceManager",void 0),(0,r.Z)(this,"_lastRenderedLayers",[]),(0,r.Z)(this,"_needsRedraw",!1),(0,r.Z)(this,"_needsUpdate",!1),(0,r.Z)(this,"_nextLayers",null),(0,r.Z)(this,"_debug",!1),(0,r.Z)(this,"activateViewport",(t=>{(0,u.Z)("layerManager.activateViewport",this,t),t&&(this.context.viewport=t)})),this.layers=[],this.resourceManager=new f({gl:t,protocol:"deck://"}),this.context={mousePosition:null,userData:{},layerManager:this,gl:t,deck:e,programManager:t&&b(t),stats:i||new d.Z({id:"deck.gl"}),viewport:n||new g.Z({id:"DEFAULT-INITIAL-VIEWPORT"}),timeline:o||new a,resourceManager:this.resourceManager,onError:void 0},Object.seal(this)}finalize(){this.resourceManager.finalize();for(const t of this.layers)this._finalizeLayer(t)}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1},e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);for(const i of this.layers){const n=i.getNeedsRedraw(t);e=e||n}return e}needsUpdate(){return this._nextLayers&&this._nextLayers!==this._lastRenderedLayers?"layers changed":this._needsUpdate}setNeedsRedraw(t){this._needsRedraw=this._needsRedraw||t}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t}getLayers(){let{layerIds:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t?this.layers.filter((e=>t.find((t=>0===e.id.indexOf(t))))):this.layers}setProps(t){"debug"in t&&(this._debug=t.debug),"userData"in t&&(this.context.userData=t.userData),"layers"in t&&(this._nextLayers=t.layers),"onError"in t&&(this.context.onError=t.onError)}setLayers(t,e){(0,u.Z)("layerManager.setLayers",this,e,t),this._lastRenderedLayers=t;const i=(0,h.x)(t,Boolean);for(const n of i)n.context=this.context;this._updateLayers(this.layers,i)}updateLayers(){const t=this.needsUpdate();t&&(this.setNeedsRedraw("updating layers: ".concat(t)),this.setLayers(this._nextLayers||this._lastRenderedLayers,t)),this._nextLayers=null}_handleError(t,e,i){i.raiseError(e,"".concat(t," of ").concat(i))}_updateLayers(t,e){const i={};for(const o of t)i[o.id]?c.Z.warn("Multiple old layers with same id ".concat(o.id))():i[o.id]=o;const n=[];this._updateSublayersRecursively(e,i,n),this._finalizeOldLayers(i);let r=!1;for(const o of n)if(o.hasUniformTransition()){r="Uniform transition in ".concat(o);break}this._needsUpdate=r,this.layers=n}_updateSublayersRecursively(t,e,i){for(const r of t){r.context=this.context;const t=e[r.id];null===t&&c.Z.warn("Multiple new layers with same id ".concat(r.id))(),e[r.id]=null;let o=null;try{this._debug&&t!==r&&r.validateProps(),t?(this._transferLayerState(t,r),this._updateLayer(r)):this._initializeLayer(r),i.push(r),o=r.isComposite?r.getSubLayers():null}catch(n){this._handleError("matching",n,r)}o&&this._updateSublayersRecursively(o,e,i)}}_finalizeOldLayers(t){for(const e in t){const i=t[e];i&&this._finalizeLayer(i)}}_initializeLayer(t){try{t._initialize(),t.lifecycle=l.dt.INITIALIZED}catch(e){this._handleError("initialization",e,t)}}_transferLayerState(t,e){e._transferState(t),e.lifecycle=l.dt.MATCHED,e!==t&&(t.lifecycle=l.dt.AWAITING_GC)}_updateLayer(t){try{t._update()}catch(e){this._handleError("update",e,t)}}_finalizeLayer(t){this._needsRedraw=this._needsRedraw||"finalized ".concat(t),t.lifecycle=l.dt.AWAITING_FINALIZATION;try{t._finalize(),t.lifecycle=l.dt.FINALIZED}catch(e){this._handleError("finalization",e,t)}}}var w=i(98949);class C{constructor(t){(0,r.Z)(this,"width",void 0),(0,r.Z)(this,"height",void 0),(0,r.Z)(this,"views",void 0),(0,r.Z)(this,"viewState",void 0),(0,r.Z)(this,"controllers",void 0),(0,r.Z)(this,"timeline",void 0),(0,r.Z)(this,"_viewports",void 0),(0,r.Z)(this,"_viewportMap",void 0),(0,r.Z)(this,"_isUpdating",void 0),(0,r.Z)(this,"_needsRedraw",void 0),(0,r.Z)(this,"_needsUpdate",void 0),(0,r.Z)(this,"_eventManager",void 0),(0,r.Z)(this,"_eventCallbacks",void 0),this.views=[],this.width=100,this.height=100,this.viewState={},this.controllers={},this.timeline=t.timeline,this._viewports=[],this._viewportMap={},this._isUpdating=!1,this._needsRedraw="First render",this._needsUpdate="Initialize",this._eventManager=t.eventManager,this._eventCallbacks={onViewStateChange:t.onViewStateChange,onInteractionStateChange:t.onInteractionStateChange},Object.seal(this),this.setProps(t)}finalize(){for(const t in this.controllers){const e=this.controllers[t];e&&e.finalize()}this.controllers={}}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}setNeedsUpdate(t){this._needsUpdate=this._needsUpdate||t,this._needsRedraw=this._needsRedraw||t}updateViewStates(){for(const t in this.controllers){const e=this.controllers[t];e&&e.updateTransition()}}getViewports(t){return t?this._viewports.filter((e=>e.containsPixel(t))):this._viewports}getViews(){const t={};return this.views.forEach((e=>{t[e.id]=e})),t}getView(t){return this.views.find((e=>e.id===t))}getViewState(t){const e="string"===typeof t?this.getView(t):t,i=e&&this.viewState[e.getViewStateId()]||this.viewState;return e?e.filterViewState(i):i}getViewport(t){return this._viewportMap[t]}unproject(t,e){const i=this.getViewports(),n={x:t[0],y:t[1]};for(let r=i.length-1;r>=0;--r){const o=i[r];if(o.containsPixel(n)){const i=t.slice();return i[0]-=o.x,i[1]-=o.y,o.unproject(i,e)}}return null}
2setProps(t){t.views&&this._setViews(t.views),t.viewState&&this._setViewState(t.viewState),("width"in t||"height"in t)&&this._setSize(t.width,t.height),this._isUpdating||this._update()}_update(){this._isUpdating=!0,this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._needsUpdate&&(this._needsUpdate=!1,this._rebuildViewports()),this._isUpdating=!1}_setSize(t,e){t===this.width&&e===this.height||(this.width=t,this.height=e,this.setNeedsUpdate("Size changed"))}_setViews(t){t=(0,h.x)(t,Boolean);this._diffViews(t,this.views)&&this.setNeedsUpdate("views changed"),this.views=t}_setViewState(t){if(t){!(0,w.v)(t,this.viewState)&&this.setNeedsUpdate("viewState changed"),this.viewState=t}else c.Z.warn("missing `viewState` or `initialViewState`")()}_onViewStateChange(t,e){this._eventCallbacks.onViewStateChange&&this._eventCallbacks.onViewStateChange({...e,viewId:t})}_createController(t,e){return new(0,e.type)({timeline:this.timeline,eventManager:this._eventManager,onViewStateChange:this._onViewStateChange.bind(this,e.id),onStateChange:this._eventCallbacks.onInteractionStateChange,makeViewport:e=>{var i;return null===(i=this.getView(t.id))||void 0===i?void 0:i.makeViewport({viewState:e,width:this.width,height:this.height})}})}_updateController(t,e,i,n){const r=t.controller;if(r){const o={...e,...r,id:t.id,x:i.x,y:i.y,width:i.width,height:i.height};return n||(n=this._createController(t,o)),n&&n.setProps(o),n}return null}_rebuildViewports(){const{views:t}=this,e=this.controllers;this._viewports=[],this.controllers={};let i=!1;for(let n=t.length;n--;){const r=t[n],o=this.getViewState(r),s=r.makeViewport({viewState:o,width:this.width,height:this.height});let a=e[r.id];const l=Boolean(r.controller);l&&!a&&(i=!0),!i&&l||!a||(a.finalize(),a=null),this.controllers[r.id]=this._updateController(r,o,s,a),this._viewports.unshift(s)}for(const n in e){const t=e[n];t&&!this.controllers[n]&&t.finalize()}this._buildViewportMap()}_buildViewportMap(){this._viewportMap={},this._viewports.forEach((t=>{t.id&&(this._viewportMap[t.id]=this._viewportMap[t.id]||t)}))}_diffViews(t,e){return t.length!==e.length||t.some(((i,n)=>!t[n].equals(e[n])))}}const B=/([0-9]+\.?[0-9]*)(%|px)/;function E(t){switch(typeof t){case"number":return{position:t,relative:!1};case"string":const e=B.exec(t);if(e&&e.length>=3){const t="%"===e[2],i=parseFloat(e[1]);return{position:t?i/100:i,relative:t}}default:throw new Error("Could not parse position string ".concat(t))}}function S(t,e){return t.relative?Math.round(t.position*e):t.position}var T=i(12997);class M{constructor(t){(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"viewportInstance",void 0),(0,r.Z)(this,"_x",void 0),(0,r.Z)(this,"_y",void 0),(0,r.Z)(this,"_width",void 0),(0,r.Z)(this,"_height",void 0),(0,r.Z)(this,"_padding",void 0),(0,r.Z)(this,"props",void 0);const{id:e,x:i=0,y:n=0,width:o="100%",height:s="100%",padding:a=null,viewportInstance:l}=t||{};(0,T.Z)(!l||l instanceof g.Z),this.viewportInstance=l,this.id=e||this.constructor.displayName||"view",this.props={...t,id:this.id},this._x=E(i),this._y=E(n),this._width=E(o),this._height=E(s),this._padding=a&&{left:E(a.left||0),right:E(a.right||0),top:E(a.top||0),bottom:E(a.bottom||0)},this.equals=this.equals.bind(this),Object.seal(this)}equals(t){return this===t||(this.viewportInstance?!!t.viewportInstance&&this.viewportInstance.equals(t.viewportInstance):this.ViewportType===t.ViewportType&&(0,w.v)(this.props,t.props))}makeViewport(t){let{width:e,height:i,viewState:n}=t;if(this.viewportInstance)return this.viewportInstance;n=this.filterViewState(n);const r=this.getDimensions({width:e,height:i});return new this.ViewportType({...n,...this.props,...r})}getViewStateId(){const{viewState:t}=this.props;return"string"===typeof t?t:(null===t||void 0===t?void 0:t.id)||this.id}filterViewState(t){if(this.props.viewState&&"object"===typeof this.props.viewState){if(!this.props.viewState.id)return this.props.viewState;const e={...t};for(const t in this.props.viewState)"id"!==t&&(e[t]=this.props.viewState[t]);return e}return t}getDimensions(t){let{width:e,height:i}=t;const n={x:S(this._x,e),y:S(this._y,i),width:S(this._width,e),height:S(this._height,i)};return this._padding&&(n.padding={left:S(this._padding.left,e),top:S(this._padding.top,i),right:S(this._padding.right,e),bottom:S(this._padding.bottom,i)}),n}get controller(){const t=this.props.controller;return t?!0===t?{type:this.ControllerType}:"function"===typeof t?{type:t}:{type:this.ControllerType,...t}:null}}var I=i(52310),P=i(47410),D=i(99188);const L=()=>{},O=2,F=3,R=t=>t,k=1;class z{constructor(t){(0,r.Z)(this,"getControllerState",void 0),(0,r.Z)(this,"props",void 0),(0,r.Z)(this,"propsInTransition",void 0),(0,r.Z)(this,"transition",void 0),(0,r.Z)(this,"onViewStateChange",void 0),(0,r.Z)(this,"onStateChange",void 0),(0,r.Z)(this,"_onTransitionUpdate",(t=>{const{time:e,settings:{interpolator:i,startProps:n,endProps:r,duration:o,easing:s}}=t,a=s(e/o),l=i.interpolateProps(n,r,a);this.propsInTransition=this.getControllerState({...this.props,...l}).getViewportProps(),this.onViewStateChange({viewState:this.propsInTransition,oldViewState:this.props})})),this.getControllerState=t.getControllerState,this.propsInTransition=null,this.transition=new D.Z(t.timeline),this.onViewStateChange=t.onViewStateChange||L,this.onStateChange=t.onStateChange||L}finalize(){this.transition.cancel()}getViewportInTransition(){return this.propsInTransition}processViewStateChange(t){let e=!1;const i=this.props;if(this.props=t,!i||this._shouldIgnoreViewportChange(i,t))return!1;if(this._isTransitionEnabled(t)){let n=i;if(this.transition.inProgress){const{interruption:t,endProps:e}=this.transition.settings;n={...i,...t===O?e:this.propsInTransition||i}}this._triggerTransition(n,t),e=!0}else this.transition.cancel();return e}updateTransition(){this.transition.update()}_isTransitionEnabled(t){const{transitionDuration:e,transitionInterpolator:i}=t;return(e>0||"auto"===e)&&Boolean(i)}_isUpdateDueToCurrentTransition(t){return!(!this.transition.inProgress||!this.propsInTransition)&&this.transition.settings.interpolator.arePropsEqual(t,this.propsInTransition)}_shouldIgnoreViewportChange(t,e){return this.transition.inProgress?this.transition.settings.interruption===F||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e)}_triggerTransition(t,e){const i=this.getControllerState(t),n=this.getControllerState(e).shortestPathFrom(i),r=e.transitionInterpolator,o=r.getDuration?r.getDuration(t,e):e.transitionDuration;if(0===o)return;const s=r.initializeProps(t,n);this.propsInTransition={};const a={duration:o,easing:e.transitionEasing||R,interpolator:r,interruption:e.transitionInterruption||k,startProps:s.start,endProps:s.end,onStart:e.onTransitionStart,onUpdate:this._onTransitionUpdate,onInterrupt:this._onTransitionEnd(e.onTransitionInterrupt),onEnd:this._onTransitionEnd(e.onTransitionEnd)};this.transition.start(a),this.onStateChange({inTransition:!0}),this.updateTransition()}_onTransitionEnd(t){return e=>{this.propsInTransition=null,this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1}),null===t||void 0===t||t(e)}}}class U{constructor(t){(0,r.Z)(this,"_propsToCompare",void 0),(0,r.Z)(this,"_propsToExtract",void 0),(0,r.Z)(this,"_requiredProps",void 0);const{compare:e,extract:i,required:n}=t;this._propsToCompare=e,this._propsToExtract=i||e,this._requiredProps=n}arePropsEqual(t,e){for(const i of this._propsToCompare)if(!(i in t)||!(i in e)||!(0,P.fS)(t[i],e[i]))return!1;return!0}initializeProps(t,e){const i={},n={};for(const r of this._propsToExtract)(r in t||r in e)&&(i[r]=t[r],n[r]=e[r]);return this._checkRequiredProps(i),this._checkRequiredProps(n),{start:i,end:n}}getDuration(t,e){return e.transitionDuration}_checkRequiredProps(t){this._requiredProps&&this._requiredProps.forEach((e=>{const i=t[e];(0,T.Z)(Number.isFinite(i)||Array.isArray(i),"".concat(e," is required for transition"))}))}}const N=["longitude","latitude","zoom","bearing","pitch"],G=["longitude","latitude","zoom"];class Z extends U{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=Array.isArray(t)?t:t.transitionProps,i=Array.isArray(t)?{}:t;i.transitionProps=Array.isArray(e)?{compare:e,required:e}:e||{compare:N,required:G},super(i.transitionProps),(0,r.Z)(this,"opts",void 0),this.opts=i}initializeProps(t,e){const i=super.initializeProps(t,e),{makeViewport:n,around:r}=this.opts;if(n&&r){const o=n(t),s=n(e),a=o.unproject(r);i.start.around=r,Object.assign(i.end,{around:s.project(a),aroundPosition:a,width:e.width,height:e.height})}return i}
vendor: 15,350 bytes, line 2
2interpolateProps(t,e,i){const n={};for(const r of this._propsToExtract)n[r]=(0,P.t7)(t[r]||0,e[r]||0,i);if(e.aroundPosition&&this.opts.makeViewport){const r=this.opts.makeViewport({...e,...n});Object.assign(n,r.panByPosition(e.aroundPosition,(0,P.t7)(t.around,e.around,i)))}return n}}const j={transitionDuration:0},V=t=>1-(1-t)*(1-t),H=["wheel"],J=["panstart","panmove","panend"],W=["pinchstart","pinchmove","pinchend"],Q=["tripanstart","tripanmove","tripanend"],q=["doubletap"],K=["keydown"],X={};class Y{constructor(t){(0,r.Z)(this,"props",void 0),(0,r.Z)(this,"state",{}),(0,r.Z)(this,"transitionManager",void 0),(0,r.Z)(this,"eventManager",void 0),(0,r.Z)(this,"onViewStateChange",void 0),(0,r.Z)(this,"onStateChange",void 0),(0,r.Z)(this,"makeViewport",void 0),(0,r.Z)(this,"_controllerState",void 0),(0,r.Z)(this,"_events",{}),(0,r.Z)(this,"_interactionState",{isDragging:!1}),(0,r.Z)(this,"_customEvents",[]),(0,r.Z)(this,"_eventStartBlocked",null),(0,r.Z)(this,"_panMove",!1),(0,r.Z)(this,"invertPan",!1),(0,r.Z)(this,"dragMode","rotate"),(0,r.Z)(this,"inertia",0),(0,r.Z)(this,"scrollZoom",!0),(0,r.Z)(this,"dragPan",!0),(0,r.Z)(this,"dragRotate",!0),(0,r.Z)(this,"doubleClickZoom",!0),(0,r.Z)(this,"touchZoom",!0),(0,r.Z)(this,"touchRotate",!1),(0,r.Z)(this,"keyboard",!0),this.transitionManager=new z({...t,getControllerState:t=>new this.ControllerState(t),onViewStateChange:this._onTransition.bind(this),onStateChange:this._setInteractionState.bind(this)}),this.handleEvent=this.handleEvent.bind(this),this.eventManager=t.eventManager,this.onViewStateChange=t.onViewStateChange||(()=>{}),this.onStateChange=t.onStateChange||(()=>{}),this.makeViewport=t.makeViewport}set events(t){this.toggleEvents(this._customEvents,!1),this.toggleEvents(t,!0),this._customEvents=t,this.props&&this.setProps(this.props)}finalize(){for(const e in this._events){var t;if(this._events[e])null===(t=this.eventManager)||void 0===t||t.off(e,this.handleEvent)}this.transitionManager.finalize()}handleEvent(t){this._controllerState=void 0;const e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}get controllerState(){return this._controllerState=this._controllerState||new this.ControllerState({makeViewport:this.makeViewport,...this.props,...this.state}),this._controllerState}getCenter(t){const{x:e,y:i}=this.props,{offsetCenter:n}=t;return[n.x-e,n.y-i]}isPointInBounds(t,e){const{width:i,height:n}=this.props;if(e&&e.handled)return!1;const r=t[0]>=0&&t[0]<=i&&t[1]>=0&&t[1]<=n;return r&&e&&e.stopPropagation(),r}isFunctionKeyPressed(t){const{srcEvent:e}=t;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}isDragging(){return this._interactionState.isDragging||!1}blockEvents(t){const e=setTimeout((()=>{this._eventStartBlocked===e&&(this._eventStartBlocked=null)}),t);this._eventStartBlocked=e}setProps(t){t.dragMode&&(this.dragMode=t.dragMode),this.props=t,"transitionInterpolator"in t||(t.transitionInterpolator=this._getTransitionProps().transitionInterpolator),this.transitionManager.processViewStateChange(t);const{inertia:e}=t;this.inertia=Number.isFinite(e)?e:!0===e?300:0;const{scrollZoom:i=!0,dragPan:n=!0,dragRotate:r=!0,doubleClickZoom:o=!0,touchZoom:s=!0,touchRotate:a=!1,keyboard:l=!0}=t,c=Boolean(this.onViewStateChange);this.toggleEvents(H,c&&i),this.toggleEvents(J,c&&(n||r)),this.toggleEvents(W,c&&(s||a)),this.toggleEvents(Q,c&&a),this.toggleEvents(q,c&&o),this.toggleEvents(K,c&&l),this.scrollZoom=i,this.dragPan=n,this.dragRotate=r,this.doubleClickZoom=o,this.touchZoom=s,this.touchRotate=a,this.keyboard=l}updateTransition(){this.transitionManager.updateTransition()}toggleEvents(t,e){this.eventManager&&t.forEach((t=>{this._events[t]!==e&&(this._events[t]=e,e?this.eventManager.on(t,this.handleEvent):this.eventManager.off(t,this.handleEvent))}))}updateViewport(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n={...t.getViewportProps(),...e},r=this.controllerState!==t;if(this.state=t.getState(),this._setInteractionState(i),r){const t=this.controllerState&&this.controllerState.getViewportProps();this.onViewStateChange&&this.onViewStateChange({viewState:n,interactionState:this._interactionState,oldViewState:t})}}_onTransition(t){this.onViewStateChange({...t,interactionState:this._interactionState})}_setInteractionState(t){Object.assign(this._interactionState,t),this.onStateChange(this._interactionState)}_onPanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;let i=this.isFunctionKeyPressed(t)||t.rightButton||!1;(this.invertPan||"pan"===this.dragMode)&&(i=!i);const n=this.controllerState[i?"panStart":"rotateStart"]({pos:e});return this._panMove=i,this.updateViewport(n,j,{isDragging:!0}),!0}_onPan(t){return!!this.isDragging()&&(this._panMove?this._onPanMove(t):this._onPanRotate(t))}_onPanEnd(t){return!!this.isDragging()&&(this._panMove?this._onPanMoveEnd(t):this._onPanRotateEnd(t))}_onPanMove(t){if(!this.dragPan)return!1;const e=this.getCenter(t),i=this.controllerState.pan({pos:e});return this.updateViewport(i,j,{isDragging:!0,isPanning:!0}),!0}_onPanMoveEnd(t){const{inertia:e}=this;if(this.dragPan&&e&&t.velocity){const i=this.getCenter(t),n=[i[0]+t.velocityX*e/2,i[1]+t.velocityY*e/2],r=this.controllerState.pan({pos:n}).panEnd();this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:V},{isDragging:!1,isPanning:!0})}else{const t=this.controllerState.panEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1})}return!0}_onPanRotate(t){if(!this.dragRotate)return!1;const e=this.getCenter(t),i=this.controllerState.rotate({pos:e});return this.updateViewport(i,j,{isDragging:!0,isRotating:!0}),!0}_onPanRotateEnd(t){const{inertia:e}=this;if(this.dragRotate&&e&&t.velocity){const i=this.getCenter(t),n=[i[0]+t.velocityX*e/2,i[1]+t.velocityY*e/2],r=this.controllerState.rotate({pos:n}).rotateEnd();this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:V},{isDragging:!1,isRotating:!0})}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onWheel(t){if(!this.scrollZoom)return!1;t.srcEvent.preventDefault();const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const{speed:i=.01,smooth:n=!1}=!0===this.scrollZoom?{}:this.scrollZoom,{delta:r}=t;let o=2/(1+Math.exp(-Math.abs(r*i)));r<0&&0!==o&&(o=1/o);const s=this.controllerState.zoom({pos:e,scale:o});return this.updateViewport(s,{...this._getTransitionProps({around:e}),transitionDuration:n?250:1},{isZooming:!0,isPanning:!0}),!0}_onTriplePanStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.controllerState.rotateStart({pos:e});return this.updateViewport(i,j,{isDragging:!0}),!0}_onTriplePan(t){if(!this.touchRotate)return!1;if(!this.isDragging())return!1;const e=this.getCenter(t);e[0]-=t.deltaX;const i=this.controllerState.rotate({pos:e});return this.updateViewport(i,j,{isDragging:!0,isRotating:!0}),!0}_onTriplePanEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this;if(this.touchRotate&&e&&t.velocityY){const i=this.getCenter(t),n=[i[0],i[1]+=t.velocityY*e/2],r=this.controllerState.rotate({pos:n});this.updateViewport(r,{...this._getTransitionProps(),transitionDuration:e,transitionEasing:V},{isDragging:!1,isRotating:!0}),this.blockEvents(e)}else{const t=this.controllerState.rotateEnd();this.updateViewport(t,null,{isDragging:!1,isRotating:!1})}return!0}_onPinchStart(t){const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.controllerState.zoomStart({pos:e}).rotateStart({pos:e});return X._startPinchRotation=t.rotation,X._lastPinchEvent=t,this.updateViewport(i,j,{isDragging:!0}),!0}_onPinch(t){if(!this.touchZoom&&!this.touchRotate)return!1;if(!this.isDragging())return!1;let e=this.controllerState;if(this.touchZoom){const{scale:i}=t,n=this.getCenter(t);e=e.zoom({pos:n,scale:i})}if(this.touchRotate){const{rotation:i}=t;e=e.rotate({deltaAngleX:X._startPinchRotation-i})}return this.updateViewport(e,j,{isDragging:!0,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:this.touchRotate}),X._lastPinchEvent=t,!0}_onPinchEnd(t){if(!this.isDragging())return!1;const{inertia:e}=this,{_lastPinchEvent:i}=X;if(this.touchZoom&&e&&i&&t.scale!==i.scale){const n=this.getCenter(t);let r=this.controllerState.rotateEnd();const o=Math.log2(t.scale),s=(o-Math.log2(i.scale))/(t.deltaTime-i.deltaTime),a=Math.pow(2,o+s*e/2);r=r.zoom({pos:n,scale:a}).zoomEnd(),this.updateViewport(r,{...this._getTransitionProps({around:n}),transitionDuration:e,transitionEasing:V},{isDragging:!1,isPanning:this.touchZoom,isZooming:this.touchZoom,isRotating:!1}),this.blockEvents(e)}else{const t=this.controllerState.zoomEnd().rotateEnd();this.updateViewport(t,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1})}return X._startPinchRotation=null,X._lastPinchEvent=null,!0}_onDoubleTap(t){if(!this.doubleClickZoom)return!1;const e=this.getCenter(t);if(!this.isPointInBounds(e,t))return!1;const i=this.isFunctionKeyPressed(t),n=this.controllerState.zoom({pos:e,scale:i?.5:2});return this.updateViewport(n,this._getTransitionProps({around:e}),{isZooming:!0,isPanning:!0}),this.blockEvents(100),!0}_onKeyDown(t){if(!this.keyboard)return!1;const e=this.isFunctionKeyPressed(t),{zoomSpeed:i,moveSpeed:n,rotateSpeedX:r,rotateSpeedY:o}=!0===this.keyboard?{}:this.keyboard,{controllerState:s}=this;let a;const l={};switch(t.srcEvent.code){case"Minus":a=e?s.zoomOut(i).zoomOut(i):s.zoomOut(i),l.isZooming=!0;break;case"Equal":a=e?s.zoomIn(i).zoomIn(i):s.zoomIn(i),l.isZooming=!0;break;case"ArrowLeft":e?(a=s.rotateLeft(r),l.isRotating=!0):(a=s.moveLeft(n),l.isPanning=!0);break;case"ArrowRight":e?(a=s.rotateRight(r),l.isRotating=!0):(a=s.moveRight(n),l.isPanning=!0);break;case"ArrowUp":e?(a=s.rotateUp(o),l.isRotating=!0):(a=s.moveUp(n),l.isPanning=!0);break;case"ArrowDown":e?(a=s.rotateDown(o),l.isRotating=!0):(a=s.moveDown(n),l.isPanning=!0);break;default:return!1}return this.updateViewport(a,this._getTransitionProps(),l),!0}_getTransitionProps(t){const{transition:e}=this;return e&&e.transitionInterpolator?t?{...e,transitionInterpolator:new Z({...t,...e.transitionInterpolator.opts,makeViewport:this.controllerState.makeViewport})}:e:j}}class ${constructor(t,e){(0,r.Z)(this,"_viewportProps",void 0),(0,r.Z)(this,"_state",void 0),this._viewportProps=this.applyConstraints(t),this._state=e}getViewportProps(){return this._viewportProps}getState(){return this._state}}var tt=i(75818);class et extends ${constructor(t){const{width:e,height:i,latitude:n,longitude:o,zoom:s,bearing:a=0,pitch:l=0,altitude:c=1.5,position:u=[0,0,0],maxZoom:h=20,minZoom:d=0,maxPitch:p=60,minPitch:A=0,startPanLngLat:f,startZoomLngLat:g,startRotatePos:m,startBearing:y,startPitch:v,startZoom:_,normalize:b=!0}=t;(0,T.Z)(Number.isFinite(o)),(0,T.Z)(Number.isFinite(n)),(0,T.Z)(Number.isFinite(s)),super({width:e,height:i,latitude:n,longitude:o,zoom:s,bearing:a,pitch:l,altitude:c,maxZoom:h,minZoom:d,maxPitch:p,minPitch:A,normalize:b,position:u},{startPanLngLat:f,startZoomLngLat:g,startRotatePos:m,startBearing:y,startPitch:v,startZoom:_}),(0,r.Z)(this,"makeViewport",void 0),this.makeViewport=t.makeViewport}panStart(t){let{pos:e}=t;return this._getUpdatedState({startPanLngLat:this._unproject(e)})}pan(t){let{pos:e,startPos:i}=t;const n=this.getState().startPanLngLat||this._unproject(i);if(!n)return this;const r=this.makeViewport(this.getViewportProps()).panByPosition(n,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanLngLat:null})}rotateStart(t){let{pos:e}=t;return this._getUpdatedState({startRotatePos:e,startBearing:this.getViewportProps().bearing,startPitch:this.getViewportProps().pitch})}rotate(t){let{pos:e,deltaAngleX:i=0,deltaAngleY:n=0}=t;const{startRotatePos:r,startBearing:o,startPitch:s}=this.getState();if(!r||void 0===o||void 0===s)return this;let a;return a=e?this._getNewRotation(e,r,s,o):{bearing:o+i,pitch:s+n},this._getUpdatedState(a)}rotateEnd(){return this._getUpdatedState({startBearing:null,startPitch:null})}zoomStart(t){let{pos:e}=t;return this._getUpdatedState({startZoomLngLat:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom(t){let{pos:e,startPos:i,scale:n}=t,{startZoom:r,startZoomLngLat:o}=this.getState();if(o||(r=this.getViewportProps().zoom,o=this._unproject(i)||this._unproject(e)),!o)return this;const{maxZoom:s,minZoom:a}=this.getViewportProps();let l=r+Math.log2(n);l=(0,P.uZ)(l,a,s);const c=this.makeViewport({...this.getViewportProps(),zoom:l});return this._getUpdatedState({zoom:l,...c.panByPosition(o,e)})}zoomEnd(){return this._getUpdatedState({startZoomLngLat:null,startZoom:null})}zoomIn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(t)}zoomOut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._zoomFromCenter(1/t)}moveLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([t,0])}moveRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([-t,0])}moveUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,t])}moveDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;return this._panFromCenter([0,-t])}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing-t})}rotateRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({bearing:this.getViewportProps().bearing+t})}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch+t})}rotateDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({pitch:this.getViewportProps().pitch-t})}shortestPathFrom(t){const e=t.getViewportProps(),i={...this.getViewportProps()},{bearing:n,longitude:r}=i;return Math.abs(n-e.bearing)>180&&(i.bearing=n<0?n+360:n-360),Math.abs(r-e.longitude)>180&&(i.longitude=r<0?r+360:r-360),i}applyConstraints(t){const{maxZoom:e,minZoom:i,zoom:n}=t;t.zoom=(0,P.uZ)(n,i,e);const{maxPitch:r,minPitch:o,pitch:s}=t;t.pitch=(0,P.uZ)(s,o,r);const{normalize:a=!0}=t;return a&&Object.assign(t,(0,tt.QA)(t)),t}_zoomFromCenter(t){const{width:e,height:i}=this.getViewportProps();return this.zoom({pos:[e/2,i/2],scale:t})}_panFromCenter(t){const{width:e,height:i}=this.getViewportProps();return this.pan({startPos:[e/2,i/2],pos:[e/2+t[0],i/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}_unproject(t){const e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}
2_getNewRotation(t,e,i,n){const r=t[0]-e[0],o=t[1]-e[1],s=t[1],a=e[1],{width:l,height:c}=this.getViewportProps(),u=r/l;let h=0;o>0?Math.abs(c-a)>5&&(h=o/(a-c)*1.2):o<0&&a>5&&(h=1-s/a),h=(0,P.uZ)(h,-1,1);const{minPitch:d,maxPitch:p}=this.getViewportProps();let A=i;return h>0?A=i+h*(p-i):h<0&&(A=i-h*(d-i)),{pitch:A,bearing:n+180*u}}}class it extends Y{constructor(){super(...arguments),(0,r.Z)(this,"ControllerState",et),(0,r.Z)(this,"transition",{transitionDuration:300,transitionInterpolator:new Z({transitionProps:{compare:["longitude","latitude","zoom","bearing","pitch","position"],required:["longitude","latitude","zoom"]}})}),(0,r.Z)(this,"dragMode","pan")}setProps(t){t.position=t.position||[0,0,0];const e=this.props;super.setProps(t);(!e||e.height!==t.height)&&this.updateViewport(new this.ControllerState({makeViewport:this.makeViewport,...t,...this.state}))}}class nt extends M{get ViewportType(){return I.Z}get ControllerType(){return it}}(0,r.Z)(nt,"displayName","MapView");var rt=i(58300);const ot=[255,255,255],st=1;let at=0;class lt{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"color",void 0),(0,r.Z)(this,"intensity",void 0),(0,r.Z)(this,"type","ambient");const{color:e=ot}=t,{intensity:i=st}=t;this.id=t.id||"ambient-".concat(at++),this.color=e,this.intensity=i}}var ct=i(431);const ut=[255,255,255],ht=1,dt=[0,0,-1];let pt=0;class At{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"color",void 0),(0,r.Z)(this,"intensity",void 0),(0,r.Z)(this,"type","directional"),(0,r.Z)(this,"direction",void 0),(0,r.Z)(this,"shadow",void 0);const{color:e=ut}=t,{intensity:i=ht}=t,{direction:n=dt}=t,{_shadow:o=!1}=t;this.id=t.id||"directional-".concat(pt++),this.color=e,this.intensity=i,this.type="directional",this.direction=new ct.Z(n).normalize().toArray(),this.shadow=o}getProjectedLight(t){return this}}var ft=i(12987);class gt{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"pass"};(0,r.Z)(this,"id",void 0),(0,r.Z)(this,"gl",void 0),(0,r.Z)(this,"props",void 0);const{id:i}=e;this.id=i,this.gl=t,this.props={...e}}setProps(t){Object.assign(this.props,t)}render(t){}cleanup(){}}var mt=i(28007),yt=i(97756);class vt extends gt{constructor(){super(...arguments),(0,r.Z)(this,"_lastRenderIndex",-1)}render(t){const e=this.gl;return(0,mt.dR)(e,{framebuffer:t.target}),this._drawLayers(t)}_drawLayers(t){const{target:e,moduleParameters:i,viewports:n,views:r,onViewportActive:o,clearStack:s=!0,clearCanvas:a=!0}=t;t.pass=t.pass||"unknown";const l=this.gl;a&&function(t){const e=t.drawingBufferWidth,i=t.drawingBufferHeight;(0,mt.dR)(t,{viewport:[0,0,e,i]}),t.clear(16640)}(l),s&&(this._lastRenderIndex=-1);const c=[];for(const u of n){const n=r&&r[u.id];o(u);const s=this._getDrawLayerParams(u,t),a=u.subViewports||[u];for(const r of a){const o=this._drawLayersInViewport(l,{target:e,moduleParameters:i,viewport:r,view:n,pass:t.pass,layers:t.layers},s);c.push(o)}}return c}_getDrawLayerParams(t,e){let{layers:i,pass:n,layerFilter:r,cullRect:o,effects:s,moduleParameters:a}=e;const l=[],c=_t(this._lastRenderIndex+1),u={layer:i[0],viewport:t,isPicking:n.startsWith("picking"),renderPass:n,cullRect:o},h={};for(let d=0;d<i.length;d++){const e=i[d],o=this._shouldDrawLayer(e,u,r,h),p={shouldDrawLayer:o};o&&(p.layerRenderIndex=c(e,o),p.moduleParameters=this._getModuleParameters(e,s,n,a),p.layerParameters=this.getLayerParameters(e,d,t)),l[d]=p}return l}_drawLayersInViewport(t,e,i){let{layers:n,moduleParameters:r,pass:o,target:s,viewport:a,view:l}=e;const c=function(t,e){let{moduleParameters:i,target:n,viewport:r}=e;const o=n&&"default-framebuffer"!==n.id,s=i&&i.devicePixelRatio||(0,mt.w)(t),a=o?n.height:t.drawingBufferHeight,l=r;return[l.x*s,a-(l.y+l.height)*s,l.width*s,l.height*s]}(t,{moduleParameters:r,target:s,viewport:a});if(l&&l.props.clear){const e=!0===l.props.clear?{color:!0,depth:!0}:l.props.clear;(0,mt.s8)(t,{scissorTest:!0,scissor:c},(()=>(0,yt.Z)(t,e)))}const u={totalCount:n.length,visibleCount:0,compositeCount:0,pickableCount:0};(0,mt.dR)(t,{viewport:c});for(let d=0;d<n.length;d++){const t=n[d],{shouldDrawLayer:e,layerRenderIndex:r,moduleParameters:s,layerParameters:l}=i[d];if(e&&t.props.pickable&&u.pickableCount++,t.isComposite)u.compositeCount++;else if(e){u.visibleCount++,this._lastRenderIndex=Math.max(this._lastRenderIndex,r),s.viewport=a;try{t._drawLayer({moduleParameters:s,uniforms:{layerIndex:r},parameters:l})}catch(h){t.raiseError(h,"drawing ".concat(t," to ").concat(o))}}}return u}shouldDrawLayer(t){return!0}getModuleParameters(t,e){return null}getLayerParameters(t,e,i){return t.props.parameters}_shouldDrawLayer(t,e,i,n){if(!(t.props.visible&&this.shouldDrawLayer(t)))return!1;e.layer=t;let r=t.parent;for(;r;){if(!r.props.visible||!r.filterSubLayer(e))return!1;e.layer=r,r=r.parent}if(i){const t=e.layer.id;if(t in n||(n[t]=i(e)),!n[t])return!1}return t.activateViewport(e.viewport),!0}_getModuleParameters(t,e,i,n){var r;const o=Object.assign(Object.create((null===(r=t.internalState)||void 0===r?void 0:r.propsInTransition)||t.props),{autoWrapLongitude:t.wrapLongitude,viewport:t.context.viewport,mousePosition:t.context.mousePosition,pickingActive:0,devicePixelRatio:(0,mt.w)(this.gl)});if(e)for(const a of e){var s;Object.assign(o,null===(s=a.getModuleParameters)||void 0===s?void 0:s.call(a,t))}return Object.assign(o,this.getModuleParameters(t,e),n)}}function _t(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i={},n=(r,o)=>{const s=r.props._offset,a=r.id,l=r.parent&&r.parent.id;let c;if(l&&!(l in e)&&n(r.parent,!1),l in i){const t=i[l]=i[l]||_t(e[l],e);c=t(r,o),i[a]=t}else Number.isFinite(s)?(c=s+(e[l]||0),i[a]=null):c=t;return o&&c>=t&&(t=c+1),e[a]=c,c};return n}var bt=i(38332),xt=i(79078);class wt extends vt{constructor(t,e){super(t,e),(0,r.Z)(this,"shadowMap",void 0),(0,r.Z)(this,"depthBuffer",void 0),(0,r.Z)(this,"fbo",void 0),this.shadowMap=new rt.Z(t,{width:1,height:1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.depthBuffer=new bt.Z(t,{format:33189,width:1,height:1}),this.fbo=new xt.Z(t,{id:"shadowmap",width:1,height:1,attachments:{36064:this.shadowMap,36096:this.depthBuffer}})}render(t){const e=this.fbo;(0,mt.s8)(this.gl,{depthRange:[0,1],depthTest:!0,blend:!1,clearColor:[1,1,1,1]},(()=>{const i=t.viewports[0],n=(0,mt.w)(this.gl),r=i.width*n,o=i.height*n;r===e.width&&o===e.height||e.resize({width:r,height:o}),super.render({...t,target:e,pass:"shadow"})}))}shouldDrawLayer(t){return!1!==t.props.shadowEnabled}getModuleParameters(){return{drawToShadowMap:!0}}delete(){this.fbo&&(this.fbo.delete(),this.fbo=null),this.shadowMap&&(this.shadowMap.delete(),this.shadowMap=null),this.depthBuffer&&(this.depthBuffer.delete(),this.depthBuffer=null)}}var Ct=i(18252),Bt=i(18188);const Et=(0,Bt.Z)((function(t){let{viewport:e,center:i}=t;return new ft.Z(e.viewProjectionMatrix).invert().transform(i)})),St=(0,Bt.Z)((function(t){let{viewport:e,shadowMatrices:i}=t;const n=[],r=e.pixelUnprojectionMatrix,o=e.isGeospatial?void 0:1,s=[[0,0,o],[e.width,0,o],[0,e.height,o],[e.width,e.height,o],[0,0,-1],[e.width,0,-1],[0,e.height,-1],[e.width,e.height,-1]].map((t=>function(t,e){const[i,n,r]=t,o=(0,tt.CT)([i,n,r],e);if(Number.isFinite(r))return o;return[o[0],o[1],0]}(t,r)));for(const a of i){const t=a.clone().translate(new ct.Z(e.center).negate()),i=s.map((e=>t.transform(e))),r=(new ft.Z).ortho({left:Math.min(...i.map((t=>t[0]))),right:Math.max(...i.map((t=>t[0]))),bottom:Math.min(...i.map((t=>t[1]))),top:Math.max(...i.map((t=>t[1]))),near:Math.min(...i.map((t=>-t[2]))),far:Math.max(...i.map((t=>-t[2])))});n.push(r.multiplyRight(a))}return n})),Tt=[0,0,0,1],Mt=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0];
2const It={name:"shadow",dependencies:[y.Z],vs:"\nconst int max_lights = 2;\nuniform mat4 shadow_uViewProjectionMatrices[max_lights];\nuniform vec4 shadow_uProjectCenters[max_lights];\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform int shadow_uLightId;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nvec4 shadow_setVertexPosition(vec4 position_commonspace) {\n  if (shadow_uDrawShadowMap) {\n    return project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[shadow_uLightId], shadow_uProjectCenters[shadow_uLightId]);\n  }\n  if (shadow_uUseShadowMap) {\n    for (int i = 0; i < max_lights; i++) {\n      if(i < int(shadow_uLightCount)) {\n        vec4 shadowMap_position = project_common_position_to_clipspace(position_commonspace, shadow_uViewProjectionMatrices[i], shadow_uProjectCenters[i]);\n        shadow_vPosition[i] = (shadowMap_position.xyz / shadowMap_position.w + 1.0) / 2.0;\n      }\n    }\n  }\n  return gl_Position;\n}\n",fs:"\nconst int max_lights = 2;\nuniform bool shadow_uDrawShadowMap;\nuniform bool shadow_uUseShadowMap;\nuniform sampler2D shadow_uShadowMap0;\nuniform sampler2D shadow_uShadowMap1;\nuniform vec4 shadow_uColor;\nuniform float shadow_uLightCount;\n\nvarying vec3 shadow_vPosition[max_lights];\n\nconst vec4 bitPackShift = vec4(1.0, 255.0, 65025.0, 16581375.0);\nconst vec4 bitUnpackShift = 1.0 / bitPackShift;\nconst vec4 bitMask = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0,  0.0);\n\nfloat shadow_getShadowWeight(vec3 position, sampler2D shadowMap) {\n  vec4 rgbaDepth = texture2D(shadowMap, position.xy);\n\n  float z = dot(rgbaDepth, bitUnpackShift);\n  return smoothstep(0.001, 0.01, position.z - z);\n}\n\nvec4 shadow_filterShadowColor(vec4 color) {\n  if (shadow_uDrawShadowMap) {\n    vec4 rgbaDepth = fract(gl_FragCoord.z * bitPackShift);\n    rgbaDepth -= rgbaDepth.gbaa * bitMask;\n    return rgbaDepth;\n  }\n  if (shadow_uUseShadowMap) {\n    float shadowAlpha = 0.0;\n    shadowAlpha += shadow_getShadowWeight(shadow_vPosition[0], shadow_uShadowMap0);\n    if(shadow_uLightCount > 1.0) {\n      shadowAlpha += shadow_getShadowWeight(shadow_vPosition[1], shadow_uShadowMap1);\n    }\n    shadowAlpha *= shadow_uColor.a / shadow_uLightCount;\n    float blendedAlpha = shadowAlpha + color.a * (1.0 - shadowAlpha);\n\n    return vec4(\n      mix(color.rgb, shadow_uColor.rgb, shadowAlpha / blendedAlpha),\n      blendedAlpha\n    );\n  }\n  return color;\n}\n",inject:{"vs:DECKGL_FILTER_GL_POSITION":"\n    position = shadow_setVertexPosition(geometry.position);\n    ","fs:DECKGL_FILTER_COLOR":"\n    color = shadow_filterShadowColor(color);\n    "},getUniforms:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"viewport"in t&&(t.drawToShadowMap||t.shadowMaps&&t.shadowMaps.length>0)?function(t,e){const{shadowEnabled:i=!0}=t;if(!i||!t.shadowMatrices||!t.shadowMatrices.length)return{shadow_uDrawShadowMap:!1,shadow_uUseShadowMap:!1};const n={shadow_uDrawShadowMap:Boolean(t.drawToShadowMap),shadow_uUseShadowMap:!!t.shadowMaps&&t.shadowMaps.length>0,shadow_uColor:t.shadowColor||Tt,shadow_uLightId:t.shadowLightId||0,shadow_uLightCount:t.shadowMatrices.length},r=Et({viewport:t.viewport,center:e.project_uCenter}),o=[],s=St({shadowMatrices:t.shadowMatrices,viewport:t.viewport}).slice();for(let a=0;a<t.shadowMatrices.length;a++){const i=s[a],n=i.clone().translate(new ct.Z(t.viewport.center).negate());e.project_uCoordinateSystem===Ct.Df.LNGLAT&&e.project_uProjectionMode===Ct.zG.WEB_MERCATOR?(s[a]=n,o[a]=r):(s[a]=i.clone().multiplyRight(Mt),o[a]=n.transform(r))}for(let a=0;a<s.length;a++)n["shadow_uViewProjectionMatrices[".concat(a,"]")]=s[a],n["shadow_uProjectCenters[".concat(a,"]")]=o[a],t.shadowMaps&&t.shadowMaps.length>0?n["shadow_uShadowMap".concat(a)]=t.shadowMaps[a]:n["shadow_uShadowMap".concat(a)]=t.dummyShadowMap;return n}(t,e):{}}},Pt={color:[255,255,255],intensity:1},Dt=[{color:[255,255,255],intensity:1,direction:[-1,3,-1]},{color:[255,255,255],intensity:.9,direction:[1,-8,-2.5]}],Lt=[0,0,0,200/255];class Ot{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,r.Z)(this,"id","lighting-effect"),(0,r.Z)(this,"props",null),(0,r.Z)(this,"shadowColor",Lt),(0,r.Z)(this,"shadow",void 0),(0,r.Z)(this,"ambientLight",null),(0,r.Z)(this,"directionalLights",[]),(0,r.Z)(this,"pointLights",[]),(0,r.Z)(this,"shadowPasses",[]),(0,r.Z)(this,"shadowMaps",[]),(0,r.Z)(this,"dummyShadowMap",null),(0,r.Z)(this,"programManager",void 0),(0,r.Z)(this,"shadowMatrices",void 0);for(const e in t){const i=t[e];switch(i.type){case"ambient":this.ambientLight=i;break;case"directional":this.directionalLights.push(i);break;case"point":this.pointLights.push(i)}}this._applyDefaultLights(),this.shadow=this.directionalLights.some((t=>t.shadow))}preRender(t,e){let{layers:i,layerFilter:n,viewports:r,onViewportActive:o,views:s}=e;if(this.shadow){this.shadowMatrices=this._calculateMatrices(),0===this.shadowPasses.length&&this._createShadowPasses(t),this.programManager||(this.programManager=m.Z.getDefaultProgramManager(t),It&&this.programManager.addDefaultModule(It)),this.dummyShadowMap||(this.dummyShadowMap=new rt.Z(t,{width:1,height:1}));for(let t=0;t<this.shadowPasses.length;t++){this.shadowPasses[t].render({layers:i,layerFilter:n,viewports:r,onViewportActive:o,views:s,moduleParameters:{shadowLightId:t,dummyShadowMap:this.dummyShadowMap,shadowMatrices:this.shadowMatrices}})}}}getModuleParameters(t){const e=this.shadow?{shadowMaps:this.shadowMaps,dummyShadowMap:this.dummyShadowMap,shadowColor:this.shadowColor,shadowMatrices:this.shadowMatrices}:{};return e.lightSources={ambientLight:this.ambientLight,directionalLights:this.directionalLights.map((e=>e.getProjectedLight({layer:t}))),pointLights:this.pointLights.map((e=>e.getProjectedLight({layer:t})))},e}cleanup(){for(const t of this.shadowPasses)t.delete();this.shadowPasses.length=0,this.shadowMaps.length=0,this.dummyShadowMap&&(this.dummyShadowMap.delete(),this.dummyShadowMap=null),this.shadow&&this.programManager&&(this.programManager.removeDefaultModule(It),this.programManager=null)}_calculateMatrices(){const t=[];for(const e of this.directionalLights){const i=(new ft.Z).lookAt({eye:new ct.Z(e.direction).negate()});t.push(i)}return t}_createShadowPasses(t){for(let e=0;e<this.directionalLights.length;e++){const i=new wt(t);this.shadowPasses[e]=i,this.shadowMaps[e]=i.shadowMap}}_applyDefaultLights(){const{ambientLight:t,pointLights:e,directionalLights:i}=this;t||0!==e.length||0!==i.length||(this.ambientLight=new lt(Pt),this.directionalLights.push(new At(Dt[0]),new At(
2Dt[1])))}}class Ft extends vt{constructor(t,e){super(t,e),(0,r.Z)(this,"maskMap",void 0),(0,r.Z)(this,"fbo",void 0);const{mapSize:i=2048}=e;this.maskMap=new rt.Z(t,{width:i,height:i,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.fbo=new xt.Z(t,{id:"maskmap",width:i,height:i,attachments:{36064:this.maskMap}})}render(t){const e=this.gl,i=[!1,!1,!1,!1];return i[t.channel]=!0,(0,mt.s8)(e,{clearColor:[255,255,255,255],blend:!0,blendFunc:[0,1],blendEquation:32778,colorMask:i,depthTest:!1},(()=>super.render({...t,target:this.fbo,pass:"mask"})))}shouldDrawLayer(t){return t.props.operation===Ct.k8.MASK}delete(){this.fbo.delete(),this.maskMap.delete()}}var Rt=i(77548);const kt=(new ft.Z).lookAt({eye:[0,0,1]});function zt(t){let{width:e,height:i,near:n,far:r,padding:o}=t,s=-e/2,a=e/2,l=-i/2,c=i/2;if(o){const{left:t=0,right:n=0,top:r=0,bottom:u=0}=o,h=(0,P.uZ)((t+e-n)/2,0,e)-e/2,d=(0,P.uZ)((r+i-u)/2,0,i)-i/2;s-=h,a-=h,l+=d,c+=d}return(new ft.Z).ortho({left:s,right:a,bottom:l,top:c,near:n,far:r})}class Ut extends g.Z{constructor(t){const{width:e,height:i,near:n=.1,far:r=1e3,zoom:o=0,target:s=[0,0,0],padding:a=null,flipY:l=!0}=t,c=Array.isArray(o)?o[0]:o,u=Array.isArray(o)?o[1]:o,h=Math.min(c,u),d=Math.pow(2,h);let p;if(c!==u){const t=Math.pow(2,c),e=Math.pow(2,u);p={unitsPerMeter:[t/d,e/d,1],metersPerUnit:[d/t,d/e,1]}}super({...t,longitude:void 0,position:s,viewMatrix:kt.clone().scale([d,d*(l?-1:1),d]),projectionMatrix:zt({width:e||1,height:i||1,padding:a,near:n,far:r}),zoom:h,distanceScales:p})}projectFlat(t){let[e,i]=t;const{unitsPerMeter:n}=this.distanceScales;return[e*n[0],i*n[1]]}unprojectFlat(t){let[e,i]=t;const{metersPerUnit:n}=this.distanceScales;return[e*n[0],i*n[1]]}panByPosition(t,e){const i=(0,tt.CT)(e,this.pixelUnprojectionMatrix),n=this.projectFlat(t),r=Rt.IH([],n,Rt.tk([],i)),o=Rt.IH([],this.center,r);return{target:this.unprojectFlat(o)}}}var Nt=i(64441);class Gt extends ${constructor(t){const{width:e,height:i,rotationX:n=0,rotationOrbit:o=0,target:s=[0,0,0],zoom:a=0,minRotationX:l=-90,maxRotationX:c=90,minZoom:u=-1/0,maxZoom:h=1/0,startPanPosition:d,startRotatePos:p,startRotationX:A,startRotationOrbit:f,startZoomPosition:g,startZoom:m}=t;super({width:e,height:i,rotationX:n,rotationOrbit:o,target:s,zoom:a,minRotationX:l,maxRotationX:c,minZoom:u,maxZoom:h},{startPanPosition:d,startRotatePos:p,startRotationX:A,startRotationOrbit:f,startZoomPosition:g,startZoom:m}),(0,r.Z)(this,"makeViewport",void 0),this.makeViewport=t.makeViewport}panStart(t){let{pos:e}=t;return this._getUpdatedState({startPanPosition:this._unproject(e)})}pan(t){let{pos:e,startPosition:i}=t;const n=this.getState().startPanPosition||i;if(!n)return this;const r=this.makeViewport(this.getViewportProps()).panByPosition(n,e);return this._getUpdatedState(r)}panEnd(){return this._getUpdatedState({startPanPosition:null})}rotateStart(t){let{pos:e}=t;return this._getUpdatedState({startRotatePos:e,startRotationX:this.getViewportProps().rotationX,startRotationOrbit:this.getViewportProps().rotationOrbit})}rotate(t){let{pos:e,deltaAngleX:i=0,deltaAngleY:n=0}=t;const{startRotatePos:r,startRotationX:o,startRotationOrbit:s}=this.getState(),{width:a,height:l}=this.getViewportProps();if(!r||void 0===o||void 0===s)return this;let c;if(e){let t=(e[0]-r[0])/a;(o<-90||o>90)&&(t*=-1),c={rotationX:o+180*((e[1]-r[1])/l),rotationOrbit:s+180*t}}else c={rotationX:o+n,rotationOrbit:s+i};return this._getUpdatedState(c)}rotateEnd(){return this._getUpdatedState({startRotationX:null,startRotationOrbit:null})}shortestPathFrom(t){const e=t.getViewportProps(),i={...this.getViewportProps()},{rotationOrbit:n}=i;return Math.abs(n-e.rotationOrbit)>180&&(i.rotationOrbit=n<0?n+360:n-360),i}zoomStart(t){let{pos:e}=t;return this._getUpdatedState({startZoomPosition:this._unproject(e),startZoom:this.getViewportProps().zoom})}zoom(t){let{pos:e,startPos:i,scale:n}=t,{startZoom:r,startZoomPosition:o}=this.getState();if(o||(r=this.getViewportProps().zoom,o=this._unproject(i)||this._unproject(e)),!o)return this;const s=this._calculateNewZoom({scale:n,startZoom:r}),a=this.makeViewport({...this.getViewportProps(),zoom:s});
2return this._getUpdatedState({zoom:s,...a.panByPosition(o,e)})}zoomEnd(){return this._getUpdatedState({startZoomPosition:null,startZoom:null})}zoomIn(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:t})})}zoomOut(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2;return this._getUpdatedState({zoom:this._calculateNewZoom({scale:1/t})})}moveLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([-t,0])}moveRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([t,0])}moveUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,-t])}moveDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:50;return this._panFromCenter([0,t])}rotateLeft(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit-t})}rotateRight(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return this._getUpdatedState({rotationOrbit:this.getViewportProps().rotationOrbit+t})}rotateUp(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this.getViewportProps().rotationX-t})}rotateDown(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;return this._getUpdatedState({rotationX:this.getViewportProps().rotationX+t})}_unproject(t){const e=this.makeViewport(this.getViewportProps());return t&&e.unproject(t)}_calculateNewZoom(t){let{scale:e,startZoom:i}=t;const{maxZoom:n,minZoom:r}=this.getViewportProps();void 0===i&&(i=this.getViewportProps().zoom);const o=i+Math.log2(e);return(0,P.uZ)(o,r,n)}_panFromCenter(t){const{width:e,height:i,target:n}=this.getViewportProps();return this.pan({startPosition:n,pos:[e/2+t[0],i/2+t[1]]})}_getUpdatedState(t){return new this.constructor({makeViewport:this.makeViewport,...this.getViewportProps(),...this.getState(),...t})}applyConstraints(t){const{maxZoom:e,minZoom:i,zoom:n,maxRotationX:r,minRotationX:o,rotationOrbit:s}=t;return t.zoom=Array.isArray(n)?[(0,P.uZ)(n[0],i,e),(0,P.uZ)(n[1],i,e)]:(0,P.uZ)(n,i,e),t.rotationX=(0,P.uZ)(t.rotationX,o,r),(s<-180||s>180)&&(t.rotationOrbit=(0,Nt.wQ)(s+180,360)-180),t}}class Zt extends Gt{constructor(t){super(t),(0,r.Z)(this,"zoomAxis",void 0),this.zoomAxis=t.zoomAxis||"all"}_calculateNewZoom(t){let{scale:e,startZoom:i}=t;const{maxZoom:n,minZoom:r}=this.getViewportProps();void 0===i&&(i=this.getViewportProps().zoom);let o=Math.log2(e);if(Array.isArray(i)){let[t,e]=i;switch(this.zoomAxis){case"X":t=(0,P.uZ)(t+o,r,n);break;case"Y":e=(0,P.uZ)(e+o,r,n);break;default:let i=Math.min(t+o,e+o);i<r&&(o+=r-i),i=Math.max(t+o,e+o),i>n&&(o+=n-i),t+=o,e+=o}return[t,e]}return(0,P.uZ)(i+o,r,n)}}class jt extends Y{constructor(){super(...arguments),(0,r.Z)(this,"ControllerState",Zt),(0,r.Z)(this,"transition",{transitionDuration:300,transitionInterpolator:new Z(["target","zoom"])}),(0,r.Z)(this,"dragMode","pan")}_onPanRotate(){return!1}}class Vt extends M{get ViewportType(){return Ut}get ControllerType(){return jt}}(0,r.Z)(Vt,"displayName","OrthographicView");class Ht{constructor(){(0,r.Z)(this,"id","mask-effect"),(0,r.Z)(this,"props",null),(0,r.Z)(this,"useInPicking",!0),(0,r.Z)(this,"dummyMaskMap",void 0),(0,r.Z)(this,"channels",[]),(0,r.Z)(this,"masks",null),(0,r.Z)(this,"maskPass",void 0),(0,r.Z)(this,"maskMap",void 0),(0,r.Z)(this,"lastViewport",void 0)}preRender(t,e){let{layers:i,layerFilter:n,viewports:r,onViewportActive:o,views:s}=e;this.dummyMaskMap||(this.dummyMaskMap=new rt.Z(t,{width:1,height:1}));const a=i.filter((t=>t.props.visible&&t.props.operation===Ct.k8.MASK));if(0===a.length)return this.masks=null,void(this.channels.length=0);this.masks={},this.maskPass||(this.maskPass=new Ft(t,{id:"default-mask"}),this.maskMap=this.maskPass.maskMap);const l=this._sortMaskChannels(a),c=r[0],u=!this.lastViewport||!this.lastViewport.equals(c);for(const h in l)this._renderChannel(l[h],{layerFilter:n,onViewportActive:o,views:s,viewport:c,viewportChanged:u})}_renderChannel(t,e){let{layerFilter:i,onViewportActive:n,views:r,viewport:o,viewportChanged:s}=e;const a=this.channels[t.index];if(!a)return;const l=t===a||a.layers.length!==t.layers.length||t.layerBounds.some(((t,e)=>t!==a.layerBounds[e]));
2if(t.bounds=a.bounds,t.maskBounds=a.maskBounds,this.channels[t.index]=t,(l||s)&&(this.lastViewport=o,t.bounds=function(t){let{layers:e,viewport:i}=t,n=null;for(const s of e){const t=s.getBounds();t&&(n?(n[0]=Math.min(n[0],t[0][0]),n[1]=Math.min(n[1],t[0][1]),n[2]=Math.max(n[2],t[1][0]),n[3]=Math.max(n[3],t[1][1])):n=[t[0][0],t[0][1],t[1][0],t[1][1]])}const r=i.getBounds();if(!n)return r;const o=function(t){const e={x:t[2]-t[0],y:t[3]-t[1]},i={x:t[0]+.5*e.x,y:t[1]+.5*e.y};return[i.x-e.x,i.y-e.y,i.x+e.x,i.y+e.y]}(r);return n[2]-n[0]<o[2]-o[0]||n[3]-n[1]<o[3]-o[1]||(n[0]=Math.max(n[0],o[0]),n[1]=Math.max(n[1],o[1]),n[2]=Math.min(n[2],o[2]),n[3]=Math.min(n[3],o[3])),n}({layers:t.layers,viewport:o}),l||!(0,P.fS)(t.bounds,a.bounds))){const{maskPass:e,maskMap:s}=this,a=function(t){let{bounds:e,viewport:i,width:n,height:r}=t;if(e[2]<=e[0]||e[3]<=e[1])return null;if(n-=2,r-=2,i instanceof I.Z){const{longitude:t,latitude:i,zoom:o}=(0,tt.Xg)({width:n,height:r,bounds:[[e[0],e[1]],[e[2],e[3]]],maxZoom:20});return new I.Z({longitude:t,latitude:i,zoom:o,x:1,y:1,width:n,height:r})}const o=[(e[0]+e[2])/2,(e[1]+e[3])/2,0],s=Math.min(20,n/(e[2]-e[0]),r/(e[3]-e[1]));return new Vt({x:1,y:1}).makeViewport({width:n,height:r,viewState:{target:o,zoom:Math.log2(s)}})}({bounds:t.bounds,viewport:o,width:s.width,height:s.height});t.maskBounds=a?a.getBounds():[0,0,1,1],e.render({pass:"mask",channel:t.index,layers:t.layers,layerFilter:i,viewports:a?[a]:[],onViewportActive:n,views:r,moduleParameters:{devicePixelRatio:1}})}this.masks[t.id]={index:t.index,bounds:t.maskBounds,coordinateOrigin:t.coordinateOrigin,coordinateSystem:t.coordinateSystem}}_sortMaskChannels(t){const e={};let i=0;for(const n of t){const{id:t}=n.root;let r=e[t];if(!r){if(++i>4){c.Z.warn("Too many mask layers. The max supported is 4")();continue}r={id:t,index:this.channels.findIndex((e=>(null===e||void 0===e?void 0:e.id)===t)),layers:[],layerBounds:[],coordinateOrigin:n.root.props.coordinateOrigin,coordinateSystem:n.root.props.coordinateSystem},e[t]=r}r.layers.push(n),r.layerBounds.push(n.getBounds())}for(let n=0;n<4;n++){const t=this.channels[n];t&&t.id in e||(this.channels[n]=null)}for(const n in e){const t=e[n];t.index<0&&(t.index=this.channels.findIndex((t=>!t)),this.channels[t.index]=t)}return e}getModuleParameters(){return{maskMap:this.masks?this.maskMap:this.dummyMaskMap,maskChannels:this.masks}}cleanup(){this.dummyMaskMap&&(this.dummyMaskMap.delete(),this.dummyMaskMap=void 0),this.maskPass&&(this.maskPass.delete(),this.maskPass=void 0,this.maskMap=void 0),this.lastViewport=void 0,this.masks=null,this.channels.length=0}}const Jt=new Ot;class Wt{constructor(){(0,r.Z)(this,"effects",void 0),(0,r.Z)(this,"_internalEffects",void 0),(0,r.Z)(this,"_needsRedraw",void 0),this.effects=[],this._internalEffects=[],this._needsRedraw="Initial render",this.setEffects()}setProps(t){"effects"in t&&(t.effects.length===this.effects.length&&(0,w.v)(t.effects,this.effects)||(this.setEffects(t.effects),this._needsRedraw="effects changed"))}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}getEffects(){return this._internalEffects}finalize(){this.cleanup()}setEffects(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.cleanup(),this.effects=t,this._internalEffects=t.slice(),this._internalEffects.push(new Ht),t.some((t=>t instanceof Ot))||this._internalEffects.push(Jt)}cleanup(){for(const t of this.effects)t.cleanup();for(const t of this._internalEffects)t.cleanup();this.effects.length=0,this._internalEffects.length=0}}class Qt extends vt{shouldDrawLayer(t){return t.props.operation===Ct.k8.DRAW}}const qt={blendFunc:[1,0,32771,0],blendEquation:32774};class Kt extends vt{constructor(){super(...arguments),(0,r.Z)(this,"pickZ",void 0),(0,r.Z)(this,"_colors",null)}render(t){return t.pickingFBO?this._drawPickingBuffer(t):super.render(t)}_drawPickingBuffer(t){let{layers:e,layerFilter:i,views:n,viewports:r,onViewportActive:o,pickingFBO:s,deviceRect:{x:a,y:l,width:c,height:u},cullRect:h,effects:d,pass:p="picking",pickZ:A}=t;const f=this.gl;this.pickZ=A;const g=A?null:{byLayer:new Map,byAlpha:[]};this._colors=g;const m=(0,mt.s8)(f,{scissorTest:!0,scissor:[a,l,c,u],clearColor:[0,0,0,0],depthMask:!0,depthTest:!0,depthRange:[0,1],colorMask:[!0,!0,!0,!0],...qt,blend:!A},(()=>super.render({target:s,layers:e,layerFilter:i,views:n,viewports:r,onViewportActive:o,cullRect:h,effects:null===d||void 0===d?void 0:d.filter((t=>t.useInPicking)),pass:p})));this._colors=null;return{decodePickingColor:g&&Xt.bind(null,g),stats:m}}shouldDrawLayer(t){return t.props.pickable&&t.props.operation===Ct.k8.DRAW}getModuleParameters(){return{pickingActive:1,pickingAttribute:this.pickZ,lightSources:{}}}getLayerParameters(t,e,i){const n={...t.props.parameters};return this._colors?(Object.assign(n,qt),n.blend=!0,n.blendColor=function(t,e,
2i){const{byLayer:n,byAlpha:r}=t;let o,s=n.get(e);s?(s.viewports.push(i),o=s.a):(o=n.size+1,o<=255?(s={a:o,layer:e,viewports:[i]},n.set(e,s),r[o]=s):(c.Z.warn("Too many pickable layers, only picking the first 255")(),o=0));return[0,0,0,o/255]}(this._colors,t,i)):n.blend=!1,n}}function Xt(t,e){const i=t.byAlpha[e[3]];return i&&{pickedLayer:i.layer,pickedViewports:i.viewports,pickedObjectIndex:i.layer.decodePickingColor(e)}}class Yt{constructor(t){this.gl=t,this.layerFilter=null,this.drawPickingColors=!1,this.drawLayersPass=new Qt(t),this.pickLayersPass=new Kt(t),this.renderCount=0,this._needsRedraw="Initial render",this.renderBuffers=[],this.lastPostProcessEffect=null}setProps(t){"layerFilter"in t&&this.layerFilter!==t.layerFilter&&(this.layerFilter=t.layerFilter,this._needsRedraw="layerFilter changed"),"drawPickingColors"in t&&this.drawPickingColors!==t.drawPickingColors&&(this.drawPickingColors=t.drawPickingColors,this._needsRedraw="drawPickingColors changed")}renderLayers(t){const e=this.drawPickingColors?this.pickLayersPass:this.drawLayersPass;t.layerFilter=t.layerFilter||this.layerFilter,t.effects=t.effects||[],t.target=t.target||xt.Z.getDefaultFramebuffer(this.gl),this._preRender(t.effects,t);const i=this.lastPostProcessEffect?this.renderBuffers[0]:t.target,n=e.render({...t,target:i});this._postRender(t.effects,t),this.renderCount++,(0,u.Z)("deckRenderer.renderLayers",this,n,t)}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};const e=this._needsRedraw;return t.clearRedrawFlags&&(this._needsRedraw=!1),e}finalize(){const{renderBuffers:t}=this;for(const e of t)e.delete();t.length=0}_preRender(t,e){let i=null;for(const n of t)n.preRender(this.gl,e),n.postRender&&(i=n);i&&this._resizeRenderBuffers(),this.lastPostProcessEffect=i}_resizeRenderBuffers(){const{renderBuffers:t}=this;0===t.length&&t.push(new xt.Z(this.gl),new xt.Z(this.gl));for(const e of t)e.resize()}_postRender(t,e){const{renderBuffers:i}=this,n={inputBuffer:i[0],swapBuffer:i[1],target:null};for(const r of t)if(r.postRender){if(r===this.lastPostProcessEffect){n.target=e.target,r.postRender(this.gl,n);break}const t=r.postRender(this.gl,n);n.inputBuffer=t,n.swapBuffer=t===i[0]?i[1]:i[0]}}}var $t=i(56474);const te={pickedColor:null,pickedObjectIndex:-1};function ee(t){let{pickedColors:e,decodePickingColor:i,deviceX:n,deviceY:r,deviceRadius:o,deviceRect:s}=t;const{x:a,y:l,width:u,height:h}=s;let d=o*o,p=-1,A=0;for(let c=0;c<h;c++){const t=c+l-r,i=t*t;if(i>d)A+=4*u;else for(let r=0;r<u;r++){if(e[A+3]-1>=0){const t=r+a-n,e=t*t+i;e<=d&&(d=e,p=A)}A+=4}}if(p>=0){const t=e.slice(p,p+4),n=i(t);if(n){const e=Math.floor(p/4/u),i=p/4-e*u;return{...n,pickedColor:t,pickedX:a+i,pickedY:l+e}}c.Z.error("Picked non-existent layer. Is picking buffer corrupt?")()}return te}function ie(t){let e,{pickInfo:i,viewports:n,pixelRatio:r,x:o,y:s,z:a}=t,l=n[0];if(n.length>1&&(l=function(t,e){for(let i=t.length-1;i>=0;i--){const n=t[i];if(n.containsPixel(e))return n}return t[0]}((null===i||void 0===i?void 0:i.pickedViewports)||n,{x:o,y:s})),l){const t=[o-l.x,s-l.y];void 0!==a&&(t[2]=a),e=l.unproject(t)}return{color:null,layer:null,viewport:l,index:-1,picked:!1,x:o,y:s,pixel:[o,s],coordinate:e,devicePixel:i&&"pickedX"in i?[i.pickedX,i.pickedY]:void 0,pixelRatio:r}}function ne(t){const{pickInfo:e,lastPickedInfo:i,mode:n,layers:r}=t,{pickedColor:o,pickedLayer:s,pickedObjectIndex:a}=e,l=s?[s]:[];if("hover"===n){const t=i.index,e=i.layerId,n=s?s.props.id:null;if(n!==e||a!==t){if(n!==e){const t=r.find((t=>t.props.id===e));t&&l.unshift(t)}i.layerId=n,i.index=a,i.info=null}}const c=ie(t),u=new Map;return u.set(null,c),l.forEach((t=>{let e={...c};t===s&&(e.color=o,e.index=a,e.picked=!0),e=re({layer:t,info:e,mode:n});const r=e.layer;t===s&&"hover"===n&&(i.info=e),u.set(r.id,e),"hover"===n&&r.updateAutoHighlight(e)})),u}function re(t){let{layer:e,info:i,mode:n}=t;for(;e&&i;){const t=i.layer||null;i.sourceLayer=t,i.layer=e,i=e.getPickingInfo({info:i,mode:n,sourceLayer:t}),e=e.parent}return i}class oe{constructor(t){(0,r.Z)(this,"gl",void 0),(0,r.Z)(this,"pickingFBO",void 0),(0,r.Z)(this,"depthFBO",void 0),(0,r.Z)(this,"pickLayersPass",void 0),(0,r.Z)(this,"layerFilter",void 0),(0,r.Z)(this,"lastPickedInfo",void 0),(0,r.Z)(this,"_pickable",!0),this.gl=t,this.pickLayersPass=new Kt(t),this.lastPickedInfo={index:-1,layerId:null,info:null}}setProps(t){"layerFilter"in t&&(this.layerFilter=t.layerFilter),"_pickable"in t&&(this._pickable=t._pickable)}finalize(){this.pickingFBO&&this.pickingFBO.delete(),this.depthFBO&&(this.depthFBO.color.delete(),this.depthFBO.delete())}
2pickObject(t){return this._pickClosestObject(t)}pickObjects(t){return this._pickVisibleObjects(t)}getLastPickedObject(t){let{x:e,y:i,layers:n,viewports:r}=t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.lastPickedInfo.info;const s=o&&o.layer&&o.layer.id,a=o&&o.viewport&&o.viewport.id,l=s?n.find((t=>t.id===s)):null,c=a&&r.find((t=>t.id===a))||r[0],u=c&&c.unproject([e-c.x,i-c.y]),h={x:e,y:i,viewport:c,coordinate:u,layer:l};return{...o,...h}}_resizeBuffer(){var t,e;const{gl:i}=this;if(!this.pickingFBO&&(this.pickingFBO=new xt.Z(i),xt.Z.isSupported(i,{colorBufferFloat:!0}))){const t=new xt.Z(i);t.attach({36064:new rt.Z(i,{format:(0,mt.D0)(i)?34836:6408,type:5126})}),this.depthFBO=t}null===(t=this.pickingFBO)||void 0===t||t.resize({width:i.canvas.width,height:i.canvas.height}),null===(e=this.depthFBO)||void 0===e||e.resize({width:i.canvas.width,height:i.canvas.height})}_getPickable(t){if(!1===this._pickable)return null;const e=t.filter((t=>t.isPickable()&&!t.isComposite));return e.length?e:null}_pickClosestObject(t){let{layers:e,views:i,viewports:n,x:r,y:o,radius:s=0,depth:a=1,mode:l="query",unproject3D:c,onViewportActive:u,effects:h}=t;const d=this._getPickable(e),p=(0,mt.w)(this.gl);if(!d)return{result:[],emptyInfo:ie({viewports:n,x:r,y:o,pixelRatio:p})};this._resizeBuffer();const A=(0,mt.JY)(this.gl,[r,o],!0),f=[A.x+Math.floor(A.width/2),A.y+Math.floor(A.height/2)],g=Math.round(s*p),{width:m,height:y}=this.pickingFBO,v=this._getPickingRect({deviceX:f[0],deviceY:f[1],deviceRadius:g,deviceWidth:m,deviceHeight:y}),_={x:r-s,y:o-s,width:2*s+1,height:2*s+1};let b;const x=[],w=new Set;for(let C=0;C<a;C++){let t,e;if(v){t=ee({...this._drawAndSample({layers:d,views:i,viewports:n,onViewportActive:u,deviceRect:v,cullRect:_,effects:h,pass:"picking:".concat(l)}),deviceX:f[0],deviceY:f[1],deviceRadius:g,deviceRect:v})}else t={pickedColor:null,pickedObjectIndex:-1};if(t.pickedLayer&&c&&this.depthFBO){e=this._drawAndSample({layers:[t.pickedLayer],views:i,viewports:n,onViewportActive:u,deviceRect:{x:t.pickedX,y:t.pickedY,width:1,height:1},cullRect:_,effects:h,pass:"picking:".concat(l,":z")},!0).pickedColors[0]}t.pickedLayer&&C+1<a&&(w.add(t.pickedLayer),t.pickedLayer.disablePickingIndex(t.pickedObjectIndex)),b=ne({pickInfo:t,lastPickedInfo:this.lastPickedInfo,mode:l,layers:d,viewports:n,x:r,y:o,z:e,pixelRatio:p});for(const i of b.values())i.layer&&x.push(i);if(!t.pickedColor)break}for(const C of w)C.restorePickingColors();return{result:x,emptyInfo:b.get(null)}}_pickVisibleObjects(t){let{layers:e,views:i,viewports:n,x:r,y:o,width:s=1,height:a=1,mode:l="query",maxObjects:u=null,onViewportActive:h,effects:d}=t;const p=this._getPickable(e);if(!p)return[];this._resizeBuffer();const A=(0,mt.w)(this.gl),f=(0,mt.JY)(this.gl,[r,o],!0),g=f.x,m=f.y+f.height,y=(0,mt.JY)(this.gl,[r+s,o+a],!0),v=y.x+y.width,_=y.y,b={x:g,y:_,width:v-g,height:m-_},x=function(t){let{pickedColors:e,decodePickingColor:i}=t;const n=new Map;if(e)for(let r=0;r<e.length;r+=4)if(e[r+3]-1>=0){const t=e.slice(r,r+4),o=t.join(",");if(!n.has(o)){const e=i(t);e?n.set(o,{...e,color:t}):c.Z.error("Picked non-existent layer. Is picking buffer corrupt?")()}}return Array.from(n.values())}(this._drawAndSample({layers:p,views:i,viewports:n,onViewportActive:h,deviceRect:b,cullRect:{x:r,y:o,width:s,height:a},effects:d,pass:"picking:".concat(l)})),w=new Map,C=Number.isFinite(u);for(let c=0;c<x.length&&!(C&&u&&w.size>=u);c++){const t=x[c];let e={color:t.pickedColor,layer:null,index:t.pickedObjectIndex,picked:!0,x:r,y:o,pixelRatio:A};e=re({layer:t.pickedLayer,info:e,mode:l}),w.has(e.object)||w.set(e.object,e)}return Array.from(w.values())}_drawAndSample(t){let{layers:e,views:i,viewports:n,onViewportActive:r,deviceRect:o,cullRect:s,effects:a,pass:l}=t,c=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const u=c?this.depthFBO:this.pickingFBO,{decodePickingColor:h}=this.pickLayersPass.render({layers:e,layerFilter:this.layerFilter,views:i,viewports:n,onViewportActive:r,pickingFBO:u,deviceRect:o,cullRect:s,effects:a,pass:l,pickZ:c}),{x:d,y:p,width:A,height:f}=o,g=new(c?Float32Array:Uint8Array)(A*f*4);return(0,$t.z6)(u,{sourceX:d,sourceY:p,sourceWidth:A,sourceHeight:f,target:g}),{pickedColors:g,decodePickingColor:h}}_getPickingRect(t){let{deviceX:e,deviceY:i,deviceRadius:n,deviceWidth:r,deviceHeight:o}=t;const s=Math.max(0,e-n),a=Math.max(0,i-n),l=Math.min(r,e+n+1)-s,c=Math.min(o,i+n+1)-a;return l<=0||c<=0?null:{x:s,y:a,width:l,height:c}}}const se={zIndex:"1",position:"absolute",pointerEvents:"none",color:"#a0a7b4",backgroundColor:"#29323c",padding:"10px",top:"0",left:"0",display:"none"};class ae{constructor(t){(0,r.Z)(this,"el",null),(0,r.Z)(this,"isVisible",!1);const e=t.parentElement;e&&(this.el=document.createElement("div"),this.el.className="deck-tooltip",Object.assign(this.el.style,se),e.appendChild(this.el))}setTooltip(t,e,i){const n=this.el;if(n){if("string"===typeof t)n.innerText=t;else{if(!t)return this.isVisible=!1,void(n.style.display="none");t.text&&(n.innerText=t.text),t.html&&(n.innerHTML=t.html),t.className&&(n.className=t.className),Object.assign(n.style,t.style)}
2this.isVisible=!0,n.style.display="block",n.style.transform="translate(".concat(e,"px, ").concat(i,"px)")}}remove(){this.el&&(this.el.remove(),this.el=null)}}var le=i(28321),ce=i(19754),ue=i(21440);const he={id:"JSON",name:"JSON",module:"",version:"",options:{},extensions:["json","geojson"],mimeTypes:["application/json","application/geo+json"],testText:function(t){const e=t[0],i=t[t.length-1];return"{"===e&&"}"===i||"["===e&&"]"===i},parseTextSync:JSON.parse},de="8.8.23",pe=globalThis.deck&&globalThis.deck.VERSION;if(pe&&pe!==de)throw new Error("deck.gl - multiple versions detected: ".concat(pe," vs ").concat(de));pe||(c.Z.log(1,"deck.gl ".concat(de))(),globalThis.deck={...globalThis.deck,VERSION:de,version:de,log:c.Z,_registerLoggers:u.z},(0,ce.fh)([he,[ue.S,{imagebitmap:{premultiplyAlpha:"none"}}]]));const Ae=globalThis.deck;var fe=i(93594),ge=i(48546),me=i(81301),ye=i(35572),ve=i(12308),_e=i(70353);class be extends ye.Z{get[Symbol.toStringTag](){return"Query"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const i=(0,mt.D0)(t),n=(0,ve.ag)(t,_e.h.TIMER_QUERY);let r=i||n;for(const o of e)switch(o){case"queries":r=r&&i;break;case"timers":r=r&&n;break;default:(0,me.h)(!1)}return r}constructor(t){super(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),this.target=null,this._queryPending=!1,this._pollingPromise=null,Object.seal(this)}beginTimeElapsedQuery(){return this.begin(35007)}beginOcclusionQuery(){let{conservative:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.begin(t?36202:35887)}beginTransformFeedbackQuery(){return this.begin(35976)}begin(t){return this._queryPending||(this.target=t,this.gl2.beginQuery(this.target,this.handle)),this}end(){return this._queryPending||this.target&&(this.gl2.endQuery(this.target),this.target=null,this._queryPending=!0),this}isResultAvailable(){if(!this._queryPending)return!1;const t=this.gl2.getQueryParameter(this.handle,34919);return t&&(this._queryPending=!1),t}isTimerDisjoint(){return this.gl2.getParameter(36795)}getResult(){return this.gl2.getQueryParameter(this.handle,34918)}getTimerMilliseconds(){return this.getResult()/1e6}createPoll(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.POSITIVE_INFINITY;if(this._pollingPromise)return this._pollingPromise;let e=0;return this._pollingPromise=new Promise(((i,n)=>{const r=()=>{this.isResultAvailable()?(i(this.getResult()),this._pollingPromise=null):e++>t?(n("Timed out"),this._pollingPromise=null):requestAnimationFrame(r)};requestAnimationFrame(r)})),this._pollingPromise}_createHandle(){return be.isSupported(this.gl)?this.gl2.createQuery():null}_deleteHandle(){this.gl2.deleteQuery(this.handle)}}const xe=(0,i(11515).Z)()&&"undefined"!==typeof document;let we=0;class Ce{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{onCreateContext:e=(t=>(0,mt.s9)(t)),onAddHTML:i=null,onInitialize:n=(()=>{}),onRender:r=(()=>{}),onFinalize:o=(()=>{}),onError:s,gl:a=null,glOptions:l={},debug:c=!1,createFramebuffer:u=!1,autoResizeViewport:h=!0,autoResizeDrawingBuffer:d=!0,stats:p=ge.lR.get("animation-loop-".concat(we++))}=t;let{useDevicePixels:A=!0}=t;"useDevicePixelRatio"in t&&(mt.cM.deprecated("useDevicePixelRatio","useDevicePixels")(),A=t.useDevicePixelRatio),this.props={onCreateContext:e,onAddHTML:i,onInitialize:n,onRender:r,onFinalize:o,onError:s,gl:a,glOptions:l,debug:c,createFramebuffer:u},this.gl=a,this.needsRedraw=null,this.timeline=null,this.stats=p,this.cpuTime=this.stats.get("CPU Time"),this.gpuTime=this.stats.get("GPU Time"),this.frameRate=this.stats.get("Frame Rate"),this._initialized=!1,this._running=!1,this._animationFrameId=null,this._nextFramePromise=null,this._resolveNextFrame=null,this._cpuStartTime=0,this.setProps({autoResizeViewport:h,autoResizeDrawingBuffer:d,useDevicePixels:A}),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this._pageLoadPromise=null,this._onMousemove=this._onMousemove.bind(this),this._onMouseleave=this._onMouseleave.bind(this)}delete(){this.stop(),this._setDisplay(null)}setNeedsRedraw(t){return(0,me.h)("string"===typeof t),this.needsRedraw=this.needsRedraw||t,this}setProps(t){return"autoResizeViewport"in t&&(this.autoResizeViewport=t.autoResizeViewport),"autoResizeDrawingBuffer"in t&&(this.autoResizeDrawingBuffer=t.autoResizeDrawingBuffer),"useDevicePixels"in t&&(this.useDevicePixels=t.useDevicePixels),this}start(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(this._running)return this;this._running=!0;const e=this._getPageLoadPromise().then((()=>!this._running||this._initialized?null:(this._createWebGLContext(t),this._createFramebuffer(),this._startEventHandling(),this._initializeCallbackData(),this._updateCallbackData(),this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._gpuTimeQuery=be.isSupported(this.gl,["timers"])?new be(this.gl):null,this._initialized=!0,this.onInitialize(this.animationProps)))).then((t=>{this._running&&(this._addCallbackData(t||{}),!1!==t&&this._startLoop())}));return this.props.onError&&e.catch(this.props.onError),this}redraw(){return this.isContextLost()||(this._beginTimers(),this._setupFrame(),this._updateCallbackData(),this._renderFrame(this.animationProps),this._clearNeedsRedraw(),this.offScreen&&this.gl.commit&&this.gl.commit(),this._resolveNextFrame&&(this._resolveNextFrame(this),this._nextFramePromise=null,this._resolveNextFrame=null),this._endTimers()),this}stop(){return this._running&&(this._finalizeCallbackData(),this._cancelAnimationFrame(this._animationFrameId),this._nextFramePromise=null,this._resolveNextFrame=null,this._animationFrameId=null,this._running=!1),this}attachTimeline(t){return this.timeline=t,this.timeline}detachTimeline(){this.timeline=null}waitForRender(){return this.setNeedsRedraw("waitForRender"),this._nextFramePromise||(this._nextFramePromise=new Promise((t=>{this._resolveNextFrame=t}))),this._nextFramePromise}async toDataURL(){return this.setNeedsRedraw("toDataURL"),await this.waitForRender(),this.gl.canvas.toDataURL()}isContextLost(){return this.gl.isContextLost()}onCreateContext(){return this.props.onCreateContext(...arguments)}onInitialize(){return this.props.onInitialize(...arguments)}onRender(){return this.props.onRender(...arguments)}onFinalize(){return this.props.onFinalize(...arguments)}getHTMLControlValue(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;const i=document.getElementById(t);return i?Number(i.value):e}
2setViewParameters(){return mt.cM.removed("AnimationLoop.setViewParameters","AnimationLoop.setProps")(),this}_startLoop(){const t=()=>{this._running&&(this.redraw(),this._animationFrameId=this._requestAnimationFrame(t))};this._cancelAnimationFrame(this._animationFrameId),this._animationFrameId=this._requestAnimationFrame(t)}_getPageLoadPromise(){return this._pageLoadPromise||(this._pageLoadPromise=xe?new Promise(((t,e)=>{xe&&"complete"===document.readyState?t(document):window.addEventListener("load",(()=>{t(document)}))})):Promise.resolve({})),this._pageLoadPromise}_setDisplay(t){this.display&&(this.display.delete(),this.display.animationLoop=null),t&&(t.animationLoop=this),this.display=t}_cancelAnimationFrame(t){return this.display&&this.display.cancelAnimationFrame?this.display.cancelAnimationFrame(t):(e=t,"undefined"!==typeof window&&window.cancelAnimationFrame?window.cancelAnimationFrame(e):clearTimeout(e));var e}_requestAnimationFrame(t){if(this._running)return this.display&&this.display.requestAnimationFrame?this.display.requestAnimationFrame(t):(e=t,"undefined"!==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame(e):setTimeout(e,1e3/60));var e}_renderFrame(){this.display?this.display._renderFrame(...arguments):this.onRender(...arguments)}_clearNeedsRedraw(){this.needsRedraw=null}_setupFrame(){this._resizeCanvasDrawingBuffer(),this._resizeViewport(),this._resizeFramebuffer()}_initializeCallbackData(){this.animationProps={gl:this.gl,stop:this.stop,canvas:this.gl.canvas,framebuffer:this.framebuffer,useDevicePixels:this.useDevicePixels,needsRedraw:null,startTime:Date.now(),engineTime:0,tick:0,tock:0,time:0,_timeline:this.timeline,_loop:this,_animationLoop:this,_mousePosition:null}}_updateCallbackData(){const{width:t,height:e,aspect:i}=this._getSizeAndAspect();t===this.animationProps.width&&e===this.animationProps.height||this.setNeedsRedraw("drawing buffer resized"),i!==this.animationProps.aspect&&this.setNeedsRedraw("drawing buffer aspect changed"),this.animationProps.width=t,this.animationProps.height=e,this.animationProps.aspect=i,this.animationProps.needsRedraw=this.needsRedraw,this.animationProps.engineTime=Date.now()-this.animationProps.startTime,this.timeline&&this.timeline.update(this.animationProps.engineTime),this.animationProps.tick=Math.floor(this.animationProps.time/1e3*60),this.animationProps.tock++,this.animationProps.time=this.timeline?this.timeline.getTime():this.animationProps.engineTime,this.animationProps._offScreen=this.offScreen}_finalizeCallbackData(){this.onFinalize(this.animationProps)}_addCallbackData(t){"object"===typeof t&&null!==t&&(this.animationProps=Object.assign({},this.animationProps,t))}_createWebGLContext(t){if(this.offScreen=t.canvas&&"undefined"!==typeof OffscreenCanvas&&t.canvas instanceof OffscreenCanvas,t=Object.assign({},t,this.props.glOptions),this.gl=this.props.gl?(0,mt.yW)(this.props.gl,t):this.onCreateContext(t),!(0,mt.UF)(this.gl))throw new Error("AnimationLoop.onCreateContext - illegal context returned");(0,mt.kL)(this.gl),this._createInfoDiv()}_createInfoDiv(){if(this.gl.canvas&&this.props.onAddHTML){const t=document.createElement("div");document.body.appendChild(t),t.style.position="relative";const e=document.createElement("div");e.style.position="absolute",e.style.left="10px",e.style.bottom="10px",e.style.width="300px",e.style.background="white",t.appendChild(this.gl.canvas),t.appendChild(e);const i=this.props.onAddHTML(e);i&&(e.innerHTML=i)}}_getSizeAndAspect(){const t=this.gl.drawingBufferWidth,e=this.gl.drawingBufferHeight;let i=1;const{canvas:n}=this.gl;return n&&n.clientHeight?i=n.clientWidth/n.clientHeight:t>0&&e>0&&(i=t/e),{width:t,height:e,aspect:i}}_resizeViewport(){this.autoResizeViewport&&this.gl.viewport(0,0,this.gl.drawingBufferWidth,this.gl.drawingBufferHeight)}_resizeCanvasDrawingBuffer(){this.autoResizeDrawingBuffer&&(0,mt.aQ)(this.gl,{useDevicePixels:this.useDevicePixels})}_createFramebuffer(){this.props.createFramebuffer&&(this.framebuffer=new xt.Z(this.gl))}_resizeFramebuffer(){this.framebuffer&&this.framebuffer.resize({width:this.gl.drawingBufferWidth,height:this.gl.drawingBufferHeight})}_beginTimers(){this.frameRate.timeEnd(),this.frameRate.timeStart(),this._gpuTimeQuery&&this._gpuTimeQuery.isResultAvailable()&&!this._gpuTimeQuery.isTimerDisjoint(
2)&&this.stats.get("GPU Time").addTime(this._gpuTimeQuery.getTimerMilliseconds()),this._gpuTimeQuery&&this._gpuTimeQuery.beginTimeElapsedQuery(),this.cpuTime.timeStart()}_endTimers(){this.cpuTime.timeEnd(),this._gpuTimeQuery&&this._gpuTimeQuery.end()}_startEventHandling(){const{canvas:t}=this.gl;t&&(t.addEventListener("mousemove",this._onMousemove),t.addEventListener("mouseleave",this._onMouseleave))}_onMousemove(t){this.animationProps._mousePosition=[t.offsetX,t.offsetY]}_onMouseleave(t){this.animationProps._mousePosition=null}}var Be=i(48331);function Ee(){}const Se={id:"",width:"100%",height:"100%",style:null,viewState:null,initialViewState:null,pickingRadius:0,layerFilter:null,glOptions:{},parameters:{},parent:null,gl:null,canvas:null,layers:[],effects:[],views:null,controller:null,useDevicePixels:!0,touchAction:"none",eventRecognizerOptions:{},_framebuffer:null,_animate:!1,_pickable:!0,_typedArrayManagerProps:{},_customRender:null,onWebGLInitialized:Ee,onResize:Ee,onViewStateChange:Ee,onInteractionStateChange:Ee,onBeforeRender:Ee,onAfterRender:Ee,onLoad:Ee,onError:t=>c.Z.error(t.message)(),onHover:null,onClick:null,onDragStart:null,onDrag:null,onDragEnd:null,_onMetrics:null,getCursor:t=>{let{isDragging:e}=t;return e?"grabbing":"grab"},getTooltip:null,debug:!1,drawPickingColors:!1};class Te{constructor(t){(0,r.Z)(this,"props",void 0),(0,r.Z)(this,"width",0),(0,r.Z)(this,"height",0),(0,r.Z)(this,"userData",{}),(0,r.Z)(this,"canvas",null),(0,r.Z)(this,"viewManager",null),(0,r.Z)(this,"layerManager",null),(0,r.Z)(this,"effectManager",null),(0,r.Z)(this,"deckRenderer",null),(0,r.Z)(this,"deckPicker",null),(0,r.Z)(this,"eventManager",null),(0,r.Z)(this,"tooltip",null),(0,r.Z)(this,"metrics",void 0),(0,r.Z)(this,"animationLoop",void 0),(0,r.Z)(this,"stats",void 0),(0,r.Z)(this,"viewState",void 0),(0,r.Z)(this,"cursorState",void 0),(0,r.Z)(this,"_needsRedraw",void 0),(0,r.Z)(this,"_pickRequest",void 0),(0,r.Z)(this,"_lastPointerDownInfo",null),(0,r.Z)(this,"_metricsCounter",void 0),(0,r.Z)(this,"_onPointerMove",(t=>{const{_pickRequest:e}=this;if("pointerleave"===t.type)e.x=-1,e.y=-1,e.radius=0;else{if(t.leftButton||t.rightButton)return;{const i=t.offsetCenter;if(!i)return;e.x=i.x,e.y=i.y,e.radius=this.props.pickingRadius}}this.layerManager&&(this.layerManager.context.mousePosition={x:e.x,y:e.y}),e.event=t})),(0,r.Z)(this,"_onEvent",(t=>{const e=Ct.FP[t.type],i=t.offsetCenter;if(!e||!i||!this.layerManager)return;const n=this.layerManager.getLayers(),r=this.deckPicker.getLastPickedObject({x:i.x,y:i.y,layers:n,viewports:this.getViewports(i)},this._lastPointerDownInfo),{layer:o}=r,s=o&&(o[e.handler]||o.props[e.handler]),a=this.props[e.handler];let l=!1;s&&(l=s.call(o,r,t)),!l&&a&&a(r,t)})),(0,r.Z)(this,"_onPointerDown",(t=>{const e=t.offsetCenter,i=this._pick("pickObject","pickObject Time",{x:e.x,y:e.y,radius:this.props.pickingRadius});this._lastPointerDownInfo=i.result[0]||i.emptyInfo})),this.props={...Se,...t},t=this.props,this._needsRedraw="Initial render",this._pickRequest={mode:"hover",x:-1,y:-1,radius:0,event:null},this.cursorState={isHovering:!1,isDragging:!1},t.viewState&&t.initialViewState&&c.Z.warn("View state tracking is disabled. Use either `initialViewState` for auto update or `viewState` for manual update.")(),"IE"===(0,fe.Z)()&&c.Z.warn("IE 11 is not supported")(),this.viewState=t.initialViewState,t.gl||"undefined"!==typeof document&&(this.canvas=this._createCanvas(t)),this.animationLoop=this._createAnimationLoop(t),this.stats=new d.Z({id:"deck.gl"}),this.metrics={fps:0,setPropsTime:0,updateAttributesTime:0,framesRedrawn:0,pickTime:0,pickCount:0,gpuTime:0,gpuTimePerFrame:0,cpuTime:0,cpuTimePerFrame:0,bufferMemory:0,textureMemory:0,renderbufferMemory:0,gpuMemory:0},this._metricsCounter=0,this.setProps(t),t._typedArrayManagerProps&&le.Z.setOptions(t._typedArrayManagerProps),this.animationLoop.start()}finalize(){var t,e,i,n,r,o,s,a;(this.animationLoop.stop(),this.animationLoop=null,this._lastPointerDownInfo=null,null===(t=this.layerManager)||void 0===t||t.finalize(),this.layerManager=null,null===(e=this.viewManager)||void 0===e||e.finalize(),this.viewManager=null,null===(i=this.effectManager)||void 0===i||i.finalize(),this.effectManager=null,null===(n=this.deckRenderer)||void 0===n||n.finalize(),this.deckRenderer=null,null===(r=this.deckPicker)||void 0===r||r.finalize(),this.deckPicker=null,null===(o=this.eventManager)||void 0===o||o.destroy(),this.eventManager=null,null===(s=this.tooltip)||void 0===s||s.remove(),this.tooltip=null,this.props.canvas||this.props.gl||!this.canvas)||(null===(a=this.canvas.parentElement)||void 0===a||a.removeChild(this.canvas),this.canvas=null)}setProps(t){this.stats.get("setProps Time").timeStart(),"onLayerHover"in t&&c.Z.removed("onLayerHover","onHover")(),"onLayerClick"in t&&c.Z.removed("onLayerClick","onClick")(),t.initialViewState&&!(0,w.v)(this.props.initialViewState,t.initialViewState)&&(this.viewState=t.initialViewState),Object.assign(this.props,t),this._setCanvasSize(this.props);const e=Object.create(this.props);Object.assign(e,{views:this._getViews(),width:this.width,height:this.height,viewState:this._getViewState()}),this.animationLoop.setProps(e),this.layerManager&&(this.viewManager.setProps(e),this.layerManager.activateViewport(this.getViewports()[0]),this.layerManager.setProps(e),this.effectManager.setProps(e),this.deckRenderer.setProps(e),this.deckPicker.setProps(e)),this.stats.get("setProps Time").timeEnd()}needsRedraw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clearRedrawFlags:!1};if(!this.layerManager)return!1;if(this.props._animate)return"Deck._animate";let e=this._needsRedraw;t.clearRedrawFlags&&(this._needsRedraw=!1);const i=this.viewManager.needsRedraw(t),n=this.layerManager.needsRedraw(t),r=this.effectManager.needsRedraw(t),o=this.deckRenderer.needsRedraw(t);return e=e||i||n||r||o,e}redraw(t){if(!this.layerManager)return;let e=this.needsRedraw({clearRedrawFlags:!0});e=t||e,e&&(this.stats.get("Redraw Count").incrementCount(),this.props._customRender?this.props._customRender(e):this._drawLayers(e))}get isInitialized(){return null!==this.viewManager}getViews(){return(0,T.Z)(this.viewManager),this.viewManager.views}getViewports(t){return(0,T.Z)(this.viewManager),this.viewManager.getViewports(t)}pickObject(t){const e=this._pick("pickObject","pickObject Time",t).result;return e.length?e[0]:null}pickMultipleObjects(t){return t.depth=t.depth||10,this._pick("pickObject","pickMultipleObjects Time",t).result}pickObjects(t){return this._pick("pickObjects","pickObjects Time",t)}_addResources(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];for(const i in t)this.layerManager.resourceManager.add({resourceId:i,data:t[i],force
2Update:e})}_removeResources(t){for(const e of t)this.layerManager.resourceManager.remove(e)}_pick(t,e,i){(0,T.Z)(this.deckPicker);const{stats:n}=this;n.get("Pick Count").incrementCount(),n.get(e).timeStart();const r=this.deckPicker[t]({layers:this.layerManager.getLayers(i),views:this.viewManager.getViews(),viewports:this.getViewports(i),onViewportActive:this.layerManager.activateViewport,effects:this.effectManager.getEffects(),...i});return n.get(e).timeEnd(),r}_createCanvas(t){let e=t.canvas;if("string"===typeof e&&(e=document.getElementById(e),(0,T.Z)(e)),!e){e=document.createElement("canvas"),e.id=t.id||"deckgl-overlay";(t.parent||document.body).appendChild(e)}return Object.assign(e.style,t.style),e}_setCanvasSize(t){if(!this.canvas)return;const{width:e,height:i}=t;if(e||0===e){const t=Number.isFinite(e)?"".concat(e,"px"):e;this.canvas.style.width=t}if(i||0===i){var n;const e=Number.isFinite(i)?"".concat(i,"px"):i;this.canvas.style.position=(null===(n=t.style)||void 0===n?void 0:n.position)||"absolute",this.canvas.style.height=e}}_updateCanvasSize(){const{canvas:t}=this;if(!t)return;const e=t.clientWidth||t.width,i=t.clientHeight||t.height;var n;e===this.width&&i===this.height||(this.width=e,this.height=i,null===(n=this.viewManager)||void 0===n||n.setProps({width:e,height:i}),this.props.onResize({width:e,height:i}))}_createAnimationLoop(t){const{width:e,height:i,gl:n,glOptions:r,debug:o,onError:s,onBeforeRender:a,onAfterRender:l,useDevicePixels:c}=t;return new Ce({width:e,height:i,useDevicePixels:c,autoResizeViewport:!1,gl:n,onCreateContext:t=>(0,mt.s9)({...r,...t,canvas:this.canvas,debug:o,onContextLost:()=>this._onContextLost()}),onInitialize:t=>this._setGLContext(t.gl),onRender:this._onRenderFrame.bind(this),onBeforeRender:a,onAfterRender:l,onError:s})}_getViewState(){return this.props.viewState||this.viewState}_getViews(){let t=this.props.views||[new nt({id:"default-view"})];return t=Array.isArray(t)?t:[t],t.length&&this.props.controller&&(t[0].props.controller=this.props.controller),t}_onContextLost(){const{onError:t}=this.props;this.animationLoop&&t&&t(new Error("WebGL context is lost"))}_pickAndCallback(){const{_pickRequest:t}=this;if(t.event){const{result:i,emptyInfo:n}=this._pick("pickObject","pickObject Time",t);this.cursorState.isHovering=i.length>0;let r=n,o=!1;for(const s of i){var e;r=s,o=(null===(e=s.layer)||void 0===e?void 0:e.onHover(s,t.event))||o}if(!o&&this.props.onHover&&this.props.onHover(r,t.event),this.props.getTooltip&&this.tooltip){const t=this.props.getTooltip(r);this.tooltip.setTooltip(t,r.x,r.y)}t.event=null}}_updateCursor(){const t=this.props.parent||this.canvas;t&&(t.style.cursor=this.props.getCursor(this.cursorState))}_setGLContext(t){if(this.layerManager)return;this.canvas||(this.canvas=t.canvas,(0,mt.yW)(t,{enable:!0,copyState:!0})),this.tooltip=new ae(this.canvas),(0,mt.dR)(t,{blend:!0,blendFunc:[770,771,1,771],polygonOffsetFill:!0,depthTest:!0,depthFunc:515}),this.props.onWebGLInitialized(t);const e=new a;e.play(),this.animationLoop.attachTimeline(e),this.eventManager=new Be.Q(this.props.parent||t.canvas,{touchAction:this.props.touchAction,recognizerOptions:this.props.eventRecognizerOptions,events:{pointerdown:this._onPointerDown,pointermove:this._onPointerMove,pointerleave:this._onPointerMove}});for(const n in Ct.FP)this.eventManager.on(n,this._onEvent);this.viewManager=new C({timeline:e,eventManager:this.eventManager,onViewStateChange:this._onViewStateChange.bind(this),onInteractionStateChange:this._onInteractionStateChange.bind(this),views:this._getViews(),viewState:this._getViewState(),width:this.width,height:this.height});const i=this.viewManager.getViewports()[0];this.layerManager=new x(t,{deck:this,stats:this.stats,viewport:i,timeline:e}),this.effectManager=new Wt,this.deckRenderer=new Yt(t),this.deckPicker=new oe(t),this.setProps(this.props),this._updateCanvasSize(),this.props.onLoad()}_drawLayers(t,e){const{gl:i}=this.layerManager.context;(0,mt.dR)(i,this.props.parameters),this.props.onBeforeRender({gl:i}),this.deckRenderer.renderLayers({target:this.props._framebuffer,layers:this.layerManager.getLayers(),viewports:this.viewManager.getViewports(),onViewportActive:this.layerManager.activateViewport,views:this.viewManager.getViews(),pass:"screen",redrawReason:t,effects:this.effectManager.getEffects(),...e}),this.props.onAfterRender({gl:i})}_onRenderFrame(t){this._getFrameStats(),this._metricsCounter++%60===0&&(this._getMetrics(),this.stats.reset(),c.Z.table(4,this.metrics)(),this.props._onMetrics&&this.props._onMetrics(this.metrics)),this._updateCanvasSize(),this._updateCursor(
vendor: 11,983 bytes, line 2
2),this.tooltip.isVisible&&this.viewManager.needsRedraw()&&this.tooltip.setTooltip(null),this.layerManager.updateLayers(),this._pickAndCallback(),this.redraw(),this.viewManager&&this.viewManager.updateViewStates()}_onViewStateChange(t){const e=this.props.onViewStateChange(t)||t.viewState;this.viewState&&(this.viewState={...this.viewState,[t.viewId]:e},this.props.viewState||this.viewManager&&this.viewManager.setProps({viewState:this.viewState}))}_onInteractionStateChange(t){this.cursorState.isDragging=t.isDragging||!1,this.props.onInteractionStateChange(t)}_getFrameStats(){const{stats:t}=this;t.get("frameRate").timeEnd(),t.get("frameRate").timeStart();const e=this.animationLoop.stats;t.get("GPU Time").addTime(e.get("GPU Time").lastTiming),t.get("CPU Time").addTime(e.get("CPU Time").lastTiming)}_getMetrics(){const{metrics:t,stats:e}=this;t.fps=e.get("frameRate").getHz(),t.setPropsTime=e.get("setProps Time").time,t.updateAttributesTime=e.get("Update Attributes").time,t.framesRedrawn=e.get("Redraw Count").count,t.pickTime=e.get("pickObject Time").time+e.get("pickMultipleObjects Time").time+e.get("pickObjects Time").time,t.pickCount=e.get("Pick Count").count,t.gpuTime=e.get("GPU Time").time,t.cpuTime=e.get("CPU Time").time,t.gpuTimePerFrame=e.get("GPU Time").getAverageTime(),t.cpuTimePerFrame=e.get("CPU Time").getAverageTime();const i=ge.lR.get("Memory Usage");t.bufferMemory=i.get("Buffer Memory").count,t.textureMemory=i.get("Texture Memory").count,t.renderbufferMemory=i.get("Renderbuffer Memory").count,t.gpuMemory=i.get("GPU Memory").count}}(0,r.Z)(Te,"defaultProps",Se),(0,r.Z)(Te,"VERSION",Ae.VERSION);const Me="undefined"!==typeof window?n.useLayoutEffect:n.useEffect;function Ie(t,e){for(;t;){if(t===e)return!0;t=Object.getPrototypeOf(t)}return!1}var Pe=i(90031);const De={position:"absolute",zIndex:-1};function Le(t,e){if("function"===typeof t)return t(e);if(Array.isArray(t))return t.map((t=>Le(t,e)));if(Oe(t)){if(function(t){const e=t.type,i=e&&e.defaultProps;return i&&i.mapStyle}(t))return e.style=De,(0,n.cloneElement)(t,e);if(function(t){const e=t.type;return e&&e.deckGLViewProps}(t))return(0,n.cloneElement)(t,e)}return t}function Oe(t){return t&&"object"===typeof t&&"type"in t||!1}function Fe(t){if("function"===typeof t)return(0,n.createElement)(M,{},t);if(Array.isArray(t))return t.map(Fe);if(Oe(t)){if(t.type===n.Fragment)return Fe(t.props.children);if(Ie(t.type,M))return t}return t}const Re={mixBlendMode:null};function ke(t){t.redrawReason&&(t.deck._drawLayers(t.redrawReason),t.redrawReason=null)}const ze=(0,n.forwardRef)(((t,e)=>{const[i,r]=(0,n.useState)(0),o=(0,n.useRef)({control:null,version:i,forceUpdate:()=>r((t=>t+1))}).current,s=(0,n.useRef)(null),a=(0,n.useRef)(null),l=(0,n.useMemo)((()=>function(t){let{children:e,layers:i=[],views:r=null}=t;const o=[],s=[],a={};return n.Children.forEach(Fe(e),(t=>{if(Oe(t)){const e=t.type;if(Ie(e,Pe.Z)){const i=function(t,e){const i={},n=t.defaultProps||{};for(const r in e)n[r]!==e[r]&&(i[r]=e[r]);return new t(i)}(e,t.props);s.push(i)}else o.push(t);if(Ie(e,M)&&e!==M&&t.props.id){const i=new e(t.props);a[i.id]=i}}else t&&o.push(t)})),Object.keys(a).length>0&&(Array.isArray(r)?r.forEach((t=>{a[t.id]=t})):r&&(a[r.id]=r),r=Object.values(a)),i=s.length>0?[...s,...i]:i,{layers:i,children:o,views:r}}(t)),[t.layers,t.views,t.children]);let c=!0;const u=e=>{var i;return c&&t.viewState?(o.viewStateUpdateRequested=e,null):(o.viewStateUpdateRequested=null,null===(i=t.onViewStateChange)||void 0===i?void 0:i.call(t,e))},h=e=>{var i;c?o.interactionStateUpdateRequested=e:(o.interactionStateUpdateRequested=null,null===(i=t.onInteractionStateChange)||void 0===i||i.call(t,e))},d=(0,n.useMemo)((()=>{const e={...t,style:null,width:"100%",height:"100%",parent:s.current,canvas:a.current,layers:l.layers,views:l.views,onViewStateChange:u,onInteractionStateChange:h};return delete e._customRender,o.deck&&o.deck.setProps(e),e}),[t]);(0,n.useEffect)((()=>{const e=t.Deck||Te;return o.deck=function(t,e,i){const n=new e({...i,_customRender:e=>{t.redrawReason=e;const i=n.getViewports();t.lastRenderedViewports!==i?t.forceUpdate():ke(t)}});return n}(o,e,{...d,parent:s.current,canvas:a.current}),()=>{var t;return null===(t=o.deck)||void 0===t?void 0:t.finalize()}}),[]),Me((()=>{ke(o);const{viewStateUpdateRequested:t,interactionStateUpdateRequested:e}=o;t&&u(t),e&&h(e)})),(0,n.useImperativeHandle)(e,(()=>function(t){return{get deck(){return t.deck},pickObject:e=>t.deck.pickObject(e),pickMultipleObjects:e=>t.deck.pickMultipleObjects(e),pickObjects:e=>t.deck.pickObjects(e)}}(o)),[]);const p=o.deck&&o.deck.isInitialized?o.deck.getViewports():void 0,{ContextProvider:A,width:f,height:g,id:m,style:y}=t,{containerStyle:v,canvasStyle:_}=(0,n.useMemo)((()=>function(t){let{width:e,height:i,style:n}=t;const r={position:"absolute",zIndex:0,left:0,top:0,width:e,height:i},o={left:0,top:0};if(n)for(const s in n)s in Re?o[s]=n[s]:r[s]=n[s];return{containerStyle:r,canvasStyle:o}}({width:f,height:g,style:y})),[f,g,y]);if(!o.viewStateUpdateRequested&&o.lastRenderedViewports===p||o.version!==i){o.lastRenderedViewports=p,o.version=i;const t=function(t){let{children:e,deck:i,ContextProvider:r}=t;const{viewManager:o}=i||{};if(!o||!o.views.length)return[];const s={},a=o.views[0].id;for(const n of e){let t=a,e=n;Oe(n)&&Ie(n.type,M)&&(t=n.props.id||a,e=n.props.children);const i=o.getViewport(t),r=o.getViewState(t);if(i){r.padding=i.padding;const{x:n,y:o,width:a,height:l}=i;e=Le(e,{x:n,y:o,width:a,height:l,viewport:i,viewState:r}),s[t]||(s[t]={viewport:i,children:[]}),s[t].children.push(e)}}return Object.keys(s).map((t=>{const{viewport:e,children:o}=s[t],{x:a,y:l,width:c,height:u}=e,h={position:"absolute",left:a,top:l,width:c,height:u},d="view-".concat(t),p=(0,n.createElement)("div",{key:d,id:d,style:h},...o);if(r){const o={viewport:e,container:i.canvas.offsetParent,eventManager:i.eventManager,onViewStateChange:e=>{e.viewId=t,i._onViewStateChange(e)}};return(0,n.createElement)(r,{key:d,value:o},p)}return p}))}({children:l.children,deck:o.deck,ContextProvider:A}),e=(0,n.createElement)("canvas",{key:"canvas",id:m||"deckgl-overlay",ref:a,style:_});o.control=(0,n.createElement)("div",{id:"".concat(m||"deckgl","-wrapper"),ref:s,style:v},[e,t])}return c=!1,o.control}));ze.defaultProps=Te.defaultProps;const Ue=ze},78788:(t,e,i)=>{"use strict";i.d(e,{D0:()=>l,Ew:()=>c,Kn:()=>o,Lj:()=>u,Os:()=>d,Ss:()=>s,TW:()=>a,zH:()=>h});const n=t=>"boolean"===typeof t,r=t=>"function"===typeof t,o=t=>null!==t&&"object"===typeof t,s=t=>o(t)&&t.constructor==={}.constructor,a=t=>t&&"function"===typeof t[Symbol.iterator],l=t=>t&&"function"===typeof t[Symbol.asyncIterator],c=t=>"undefined"!==typeof Response&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,u=t=>"undefined"!==typeof Blob&&t instanceof Blob,h=t=>t&&"object"===typeof t&&t.isBuffer,d=t=>(t=>"undefined"!==typeof ReadableStream&&t instanceof ReadableStream||o(t)&&r(t.tee)&&r(t.cancel)&&r(t.getReader))(t)||(t=>o(t)&&r(t.read)&&r(t.pipe)&&n(t.readable))(t)},65959:(t,e,i)=>{"use strict";i.d(e,{z:()=>K});var n=i(78788),r=i(35669),o=i(74168),s=i(73599);const a="3.2.13";var l=i(89596),c=i(64649);class u{}const h=new Map;function d(t){(0,s.h)(t.source&&!t.url||!t.source&&t.url);let e=h.get(t.source||t.url);return e||(t.url&&(e=function(t){if(!t.startsWith("http"))return t;return p((e=t,"try {\n  importScripts('".concat(e,"');\n} catch (error) {\n  console.error(error);\n  throw error;\n}")));var e}(t.url),h.set(t.url,e)),t.source&&(e=p(t.source),h.set(t.source,e))),(0,s.h)(e),e}function p(t){const e=new Blob([t],{type:"application/javascript"});return URL.createObjectURL(e)}function A(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2?arguments[2]:void 0;const n=i||new Set;if(t){if(f(t))n.add(t);else if(f(t.buffer))n.add(t.buffer);else if(ArrayBuffer.isView(t));else if(e&&"object"===typeof t)for(const r in t)A(t[r],e,n)}else;return void 0===i?Array.from(n):[]}function f(t){return!!t&&(t instanceof ArrayBuffer||("undefined"!==typeof MessagePort&&t instanceof MessagePort||("undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap||"undefined"!==typeof OffscreenCanvas&&t instanceof OffscreenCanvas)))}const g=()=>{};class m{static isSupported(){return"undefined"!==typeof Worker&&l.jU||"undefined"!==typeof u&&!l.jU}constructor(t){(0,c.Z)(this,"name",void 0),(0,c.Z)(this,"source",void 0),(0,c.Z)(this,"url",void 0),(0,c.Z)(this,"terminated",!1),(0,c.Z)(this,"worker",void 0),(0,c.Z)(this,"onMessage",void 0),(0,c.Z)(this,"onError",void 0),(0,c.Z)(this,"_loadableURL","");const{name:e,source:i,url:n}=t;(0,s.h)(i||n),this.name=e,this.source=i,this.url=n,this.onMessage=g,this.onError=t=>console.log(t),this.worker=l.jU?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=g,this.onError=g,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(t,e){e=e||A(t),this.worker.postMessage(t,e)}_getErrorFromErrorEvent(t){let e="Failed to load ";return e+="worker ".concat(this.name," from ").concat(this.url,". "),t.message&&(e+="".concat(t.message," in ")),t.lineno&&(e+=":".concat(t.lineno,":").concat(t.colno)),new Error(e)}_createBrowserWorker(){this._loadableURL=d({source:this.source,url:this.url});const t=new Worker(this._loadableURL,{name:this.name});return t.onmessage=t=>{t.data?this.onMessage(t.data):this.onError(new Error("No data received"))},t.onerror=t=>{this.onError(this._getErrorFromErrorEvent(t)),this.terminated=!0},t.onmessageerror=t=>console.error(t),t}_createNodeWorker(){let t;if(this.url){const e=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);t=new u(e,{eval:!1})}else{if(!this.source)throw new Error("no worker");t=new u(this.source,{eval:!0})}return t.on("message",(t=>{this.onMessage(t)})),t.on("error",(t=>{this.onError(t)})),t.on("exit",(t=>{})),t}}class y{constructor(t,e){(0,c.Z)(this,"name",void 0),(0,c.Z)(this,"workerThread",void 0),(0,c.Z)(this,"isRunning",!0),(0,c.Z)(this,"result",void 0),(0,c.Z)(this,"_resolve",(()=>{})),(0,c.Z)(this,"_reject",(()=>{})),this.name=t,this.workerThread=e,this.result=new Promise(((t,e)=>{this._resolve=t,this._reject=e}))}postMessage(t,e){this.workerThread.postMessage({source:"loaders.gl",type:t,payload:e})}done(t){(0,s.h)(this.isRunning),this.isRunning=!1,this._resolve(t)}error(t){(0,s.h)(this.isRunning),this.isRunning=!1,this._reject(t)}}class v{static isSupported(){return m.isSupported()}constructor(t){(0,c.Z)(this,"name","unnamed"),(0,c.Z)(this,"source",void 0),(0,c.Z)(this,"url",void 0),(0,c.Z)(this,"maxConcurrency",1),(0,c.Z)(this,"maxMobileConcurrency",1),(0,c.Z)(this,"onDebug",(()=>{})),(0,c.Z)(this,"reuseWorkers",!0),(0,c.Z)(this,"props",{}),(0,c.Z)(this,"jobQueue",[]),(0,c.Z)(this,"idleQueue",[]),(0,c.Z)(this,"count",0),(0,c.Z)(this,"isDestroyed",!1),this.source=t.source,this.url=t.url,this.setProps(t)}destroy(){this.idleQueue.forEach((t=>t.destroy())),this.isDestroyed=!0}setProps(t){this.props={...this.props,...t},void 0!==t.name&&(this.name=t.name),void 0!==t.maxConcurrency&&(this.maxConcurrency=t.maxConcurrency),void 0!==t.maxMobileConcurrency&&(this.maxMobileConcurrency=t.maxMobileConcurrency),void 0!==t.reuseWorkers&&(this.reuseWorkers=t.reuseWorkers),void 0!==t.onDebug&&(this.onDebug=t.onDebug)}async startJob(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(t,e,i)=>t.done(i),i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(t,e)=>t.error(e);const n=new Promise((n=>(this.jobQueue.push({name:t,onMessage:e,onError:i,onStart:n}),this)));return this._startQueuedJob(),await n}async _startQueuedJob(){if(!this.jobQueue.length)return;const t=this._getAvailableWorker();if(!t)return;const e=this.jobQueue.shift();if(e){this.onDebug({message:"Starting job",name:e.name,workerThread:t,backlog:this.jobQueue.length});const i=new y(e.name,t);t.onMessage=t=>e.onMessage(i,t.type,t.payload),t.onError=t=>e.onError(i,t),e.onStart(i);try{await i.result}
2finally{this.returnWorkerToQueue(t)}}}returnWorkerToQueue(t){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(t.destroy(),this.count--):this.idleQueue.push(t),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const t="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new m({name:t,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return l.tq?this.maxMobileConcurrency:this.maxConcurrency}}const _={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class b{static isSupported(){return m.isSupported()}static getWorkerFarm(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return b._workerFarm=b._workerFarm||new b({}),b._workerFarm.setProps(t),b._workerFarm}constructor(t){(0,c.Z)(this,"props",void 0),(0,c.Z)(this,"workerPools",new Map),this.props={..._},this.setProps(t),this.workerPools=new Map}destroy(){for(const t of this.workerPools.values())t.destroy();this.workerPools=new Map}setProps(t){this.props={...this.props,...t};for(const e of this.workerPools.values())e.setProps(this._getWorkerPoolProps())}getWorkerPool(t){const{name:e,source:i,url:n}=t;let r=this.workerPools.get(e);return r||(r=new v({name:e,source:i,url:n}),r.setProps(this._getWorkerPoolProps()),this.workerPools.set(e,r)),r}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}(0,c.Z)(b,"_workerFarm",void 0);const x="latest";async function w(t,e,i,n,r){const o=t.id,a=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e[t.id]||{},n="".concat(t.id,"-worker.js");let r=i.workerUrl;if(r||"compression"!==t.id||(r=e.workerUrl),"test"===e._workerType&&(r="modules/".concat(t.module,"/dist/").concat(n)),!r){let e=t.version;"latest"===e&&(e=x);const i=e?"@".concat(e):"";r="https://unpkg.com/@loaders.gl/".concat(t.module).concat(i,"/dist/").concat(n)}return(0,s.h)(r),r}(t,i),l=b.getWorkerFarm(i).getWorkerPool({name:o,url:a});i=JSON.parse(JSON.stringify(i)),n=JSON.parse(JSON.stringify(n||{}));const c=await l.startJob("process-on-worker",C.bind(null,r));c.postMessage("process",{input:e,options:i,context:n});const u=await c.result;return await u.result}async function C(t,e,i,n){switch(i){case"done":e.done(n);break;case"error":e.error(new Error(n.error));break;case"process":const{id:o,input:s,options:a}=n;try{const i=await t(s,a);e.postMessage("done",{id:o,result:i})}catch(r){const t=r instanceof Error?r.message:"unknown error";e.postMessage("error",{id:o,error:t})}break;default:console.warn("parse-with-worker unknown message ".concat(i))}}i(72709);function B(t){return t&&"object"===typeof t&&t.isBuffer}function E(t){if(B(t))return function(t){if(B(t))return new Uint8Array(t.buffer,t.byteOffset,t.length).slice().buffer;return t}(t);if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return 0===t.byteOffset&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if("string"===typeof t){const e=t;return(new TextEncoder).encode(e).buffer}if(t&&"object"===typeof t&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}async function S(t){const e=[];for await(const i of t)e.push(i);return function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];const n=e.map((t=>t instanceof ArrayBuffer?new Uint8Array(t):t)),r=n.reduce(((t,e)=>t+e.byteLength),0),o=new Uint8Array(r);let s=0;for(const a of n)o.set(a,s),s+=a.byteLength;return o.buffer}(...e)}const T=262144;const M=262144;const I=1048576;var P=i(27759);function D(t,e){return P.jU?async function*(t,e){const i=t.getReader();let n;try{for(;;){const t=n||i.read();null!==e&&void 0!==e&&e._streamReadAhead&&(n=i.read());const{done:r,value:o}=await t;if(r)return;yield E(o)}}catch(r){i.releaseLock()}}(t,e):async function*(t,e){for await(const i of t)yield E(i)}(t)}function L(t,e){if("string"===typeof t)return function*(t,e){const i=(null===e||void 0===e?void 0:e.chunkSize)||T;let n=0;const r=new TextEncoder;for(;n<t.length;){const e=Math.min(t.length-n,i),o=t.slice(n,n+e);n+=e,yield r.encode(o)}}(t,e);if(t instanceof ArrayBuffer)return function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return function*(){const{chunkSize:i=M}=e;let n=0;for(;n<t.byteLength;){const e=Math.min(t.byteLength-n,i),r=new ArrayBuffer(e),o=new Uint8Array(t,n,e);new Uint8Array(r).set(o),n+=e,yield r}}()}(t,e);if((0,n.Lj)(t))return async function*(t,e){const i=(null===e||void 0===e?void 0:e.chunkSize)||I;let n=0;for(;n<t.size;){const e=n+i,r=await t.slice(n,e).arrayBuffer();n=e,yield r}}(t,e);if((0,n.Os)(t))return D(t,e);if((0,n.Ew)(t)){return D(t.body,e)}throw new Error("makeIterator")}var O=i(73309);const F="Cannot convert supplied data type";async function R(t,e,i){const r=t instanceof ArrayBuffer||ArrayBuffer.isView(t);
2if("string"===typeof t||r)return function(t,e,i){if(e.text&&"string"===typeof t)return t;if((0,n.zH)(t)&&(t=t.buffer),t instanceof ArrayBuffer){const i=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(i):i}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let i=t.buffer;const n=t.byteLength||t.length;return 0===t.byteOffset&&n===i.byteLength||(i=i.slice(t.byteOffset,t.byteOffset+n)),i}throw new Error(F)}(t,e);if((0,n.Lj)(t)&&(t=await(0,O.L1)(t)),(0,n.Ew)(t)){const i=t;return await(0,O.mm)(i),e.binary?await i.arrayBuffer():await i.text()}if((0,n.Os)(t)&&(t=L(t,i)),(0,n.TW)(t)||(0,n.D0)(t))return S(t);throw new Error(F)}var k=i(44037);const z=new(i(87294).Z)({id:"loaders.gl"});var U=i(19754);const N=/\.([^.]+)$/;function G(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0;if(!Z(t))return null;if(e&&!Array.isArray(e))return(0,r.T)(e);let o=[];e&&(o=o.concat(e)),null!==i&&void 0!==i&&i.ignoreRegisteredLoaders||o.push(...(0,U.kO)()),function(t){for(const e of t)(0,r.T)(e)}(o);const s=function(t,e,i,n){const{url:r,type:o}=(0,k.l)(t),s=r||(null===n||void 0===n?void 0:n.url);let a=null,l="";null!==i&&void 0!==i&&i.mimeType&&(a=V(e,null===i||void 0===i?void 0:i.mimeType),l="match forced by supplied MIME type ".concat(null===i||void 0===i?void 0:i.mimeType));var c;a=a||function(t,e){const i=e&&N.exec(e),n=i&&i[1];return n?function(t,e){e=e.toLowerCase();for(const i of t)for(const t of i.extensions)if(t.toLowerCase()===e)return i;return null}(t,n):null}(e,s),l=l||(a?"matched url ".concat(s):""),a=a||V(e,o),l=l||(a?"matched MIME type ".concat(o):""),a=a||function(t,e){if(!e)return null;for(const i of t)if("string"===typeof e){if(H(e,i))return i}else if(ArrayBuffer.isView(e)){if(J(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer){if(J(e,0,i))return i}return null}(e,t),l=l||(a?"matched initial data ".concat(W(t)):""),a=a||V(e,null===i||void 0===i?void 0:i.fallbackMimeType),l=l||(a?"matched fallback MIME type ".concat(o):""),l&&z.log(1,"selectLoader selected ".concat(null===(c=a)||void 0===c?void 0:c.name,": ").concat(l,"."));return a}(t,o,i,n);if(!s&&(null===i||void 0===i||!i.nothrow))throw new Error(j(t));return s}function Z(t){return!(t instanceof Response&&204===t.status)}function j(t){const{url:e,type:i}=(0,k.l)(t);let n="No valid loader found (";n+=e?"".concat(function(t){const e=t&&t.lastIndexOf("/");return e>=0?t.substr(e+1):""}(e),", "):"no url provided, ",n+="MIME type: ".concat(i?'"'.concat(i,'"'):"not provided",", ");const r=t?W(t):"";return n+=r?' first bytes: "'.concat(r,'"'):"first bytes: not available",n+=")",n}function V(t,e){for(const i of t){if(i.mimeTypes&&i.mimeTypes.includes(e))return i;if(e==="application/x.".concat(i.id))return i}return null}function H(t,e){if(e.testText)return e.testText(t);return(Array.isArray(e.tests)?e.tests:[e.tests]).some((e=>t.startsWith(e)))}function J(t,e,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some((n=>function(t,e,i,n){if(n instanceof ArrayBuffer)return function(t,e,i){if(i=i||t.byteLength,t.byteLength<i||e.byteLength<i)return!1;const n=new Uint8Array(t),r=new Uint8Array(e);for(let o=0;o<n.length;++o)if(n[o]!==r[o])return!1;return!0}(n,t,n.byteLength);switch(typeof n){case"function":return n(t,i);case"string":return n===Q(t,e,n.length);default:return!1}}(t,e,i,n)))}function W(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return Q(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer){return Q(t,0,e)}return""}function Q(t,e,i){if(t.byteLength<e+i)return"";const n=new DataView(t);let r="";for(let o=0;o<i;o++)r+=String.fromCharCode(n.getUint8(e+o));return r}async function q(t,e,i,c){(0,s.h)(!c||"object"===typeof c),!e||Array.isArray(e)||(0,r.C)(e)||(c=void 0,i=e,e=void 0),t=await t,i=i||{};const{url:u}=(0,k.l)(t),h=function(t,e){if(!e&&t&&!Array.isArray(t))return t;let i;if(t&&(i=Array.isArray(t)?t:[t]),e&&e.loaders){const t=Array.isArray(e.loaders)?e.loaders:[e.loaders];i=i?[...i,...t]:t}return i&&i.length?i:null}(e,c),d=await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0;if(!Z(t))return null;let o=G(t,e,{...i,nothrow:!0},r);if(o)return o;if((0,n.Lj)(t)&&(o=G(t=await t.slice(0,10).arrayBuffer(),e,i,r)),!o&&(null===i||void 0===i||!i.nothrow))throw new Error(j(t));return o}(t,h,i);return d?(c=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(i)return i;const n={fetch:(0,o.bV)(e,t),...t};return Array.isArray(n.loaders)||(n.loaders=null),n}({url:u,parse:q,loaders:h}
2,i=(0,o.GR)(i,d,h,u),c),await async function(t,e,i,r){if(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a;(0,s.h)(t,"no worker provided");const i=t.version}(t),(0,n.Ew)(e)){const t=e,{ok:i,redirected:n,status:o,statusText:s,type:a,url:l}=t,c=Object.fromEntries(t.headers.entries());r.response={headers:c,ok:i,redirected:n,status:o,statusText:s,type:a,url:l}}if(e=await R(e,t,i),t.parseTextSync&&"string"===typeof e)return i.dataType="text",t.parseTextSync(e,i,r,t);if(function(t,e){return!!b.isSupported()&&!!(l.jU||null!==e&&void 0!==e&&e._nodeWorkers)&&t.worker&&(null===e||void 0===e?void 0:e.worker)}(t,i))return await w(t,e,i,r,q);if(t.parseText&&"string"===typeof e)return await t.parseText(e,i,r,t);if(t.parse)return await t.parse(e,i,r,t);throw(0,s.h)(!t.parseSync),new Error("".concat(t.id," loader - no parser found and worker is disabled"))}(d,t,i,c)):null}async function K(t,e,i,s){Array.isArray(e)||(0,r.C)(e)||(void 0,i=e,e=void 0);const a=(0,o.bV)(i);let l=t;return"string"===typeof t&&(l=await a(t)),(0,n.Lj)(t)&&(l=await a(t)),await q(l,e,i)}},19754:(t,e,i)=>{"use strict";i.d(e,{fh:()=>s,kO:()=>a});var n=i(35669),r=i(74168);const o=()=>{const t=(0,r.rx)();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function s(t){const e=o();t=Array.isArray(t)?t:[t];for(const i of t){const t=(0,n.T)(i);e.find((e=>t===e))||e.unshift(t)}}function a(){return o()}},6386:(t,e,i)=>{"use strict";i.d(e,{d:()=>s});let n="";const r={};var o=i(73309);async function s(t,e){if("string"===typeof t){t=function(t){for(const e in r)if(t.startsWith(e)){const i=r[e];t=t.replace(e,i)}return t.startsWith("http://")||t.startsWith("https://")||(t="".concat(n).concat(t)),t}(t);let i=e;return null!==e&&void 0!==e&&e.fetch&&"function"!==typeof(null===e||void 0===e?void 0:e.fetch)&&(i=e.fetch),await fetch(t,i)}return await(0,o.L1)(t)}},35669:(t,e,i)=>{"use strict";function n(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function r(t){var e;if(!t)return!1;Array.isArray(t)&&(t=t[0]);return Array.isArray(null===(e=t)||void 0===e?void 0:e.extensions)}function o(t){var e,i;let o;return n(t,"null loader"),n(r(t),"invalid loader"),Array.isArray(t)&&(o=t[1],t=t[0],t={...t,options:{...t.options,...o}}),(null!==(e=t)&&void 0!==e&&e.parseTextSync||null!==(i=t)&&void 0!==i&&i.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}i.d(e,{C:()=>r,T:()=>o})},74168:(t,e,i)=>{"use strict";i.d(e,{bV:()=>A,rx:()=>h,GR:()=>p});var n=i(78788),r=i(6386),o=i(64649);const s=new(i(87294).Z)({id:"loaders.gl"});class a{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}var l=i(27759);const c={fetch:null,mimeType:void 0,nothrow:!1,log:new class{constructor(){(0,o.Z)(this,"console",void 0),this.console=console}log(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.console.log.bind(this.console,...e)}info(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.console.info.bind(this.console,...e)}warn(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.console.warn.bind(this.console,...e)}error(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return this.console.error.bind(this.console,...e)}},CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:l.jU,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},u={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function h(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state=t._state||{},t._state}const d=()=>{const t=h();return t.globalOptions=t.globalOptions||{...c},t.globalOptions};function p(t,e,i,n){return i=i||[],function(t,e){f(t,null,c,u,e);for(const i of e){const n=t&&t[i.id]||{},r=i.options&&i.options[i.id]||{},o=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};f(n,i.id,r,o,e)}}(t,i=Array.isArray(i)?i:[i]),m(e,t,n)}function A(t,e){const i=d(),o=t||i;return"function"===typeof o.fetch?o.fetch:(0,n.Kn)(o.fetch)?t=>(0,r.d)(t,o):null!==e&&void 0!==e&&e.fetch?null===e||void 0===e?void 0:e.fetch:r.d}function f(t,e,i,r,o){const a=e||"Top level",l=e?"".concat(e,"."):"";for(const c in t){const u=!e&&(0,n.Kn)(t[c]);if(!(c in i)&&!("baseUri"===c&&!e)&&!("workerUrl"===c&&e))if(c in r)s.warn("".concat(a," loader option '").concat(l).concat(c,"' no longer supported, use '").concat(r[c],"'"))();else if(!u){const t=g(c,o);s.warn("".concat(a," loader option '").concat(l).concat(c,"' not recognized. ").concat(t))()}}}function g(t,e){const i=t.toLowerCase();let n="";for(const r of e)for(const e in r.options){if(t===e)return"Did you mean '".concat(r.id,".").concat(e,"'?");const o=e.toLowerCase();(i.startsWith(o)||o.startsWith(i))&&(n=n||"Did you mean '".concat(r.id,".").concat(e,"'?"))}return n}function m(t,e,i){const n={...t.options||{}};return function(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}(n,i),null===n.log&&(n.log=new a),y(n,d()),y(n,e),n}function y(t,e){for(const i in e)if(i in e){const r=e[i];(0,n.Ss)(r)&&(0,n.Ss)(t[i])?t[i]={...t[i],...e[i]}:t[i]=e[i]}}},44037:(t,e,i)=>{"use strict";i.d(e,{C:()=>u,l:()=>c});var n=i(78788);const r=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,o=/^([-\w.]+\/[-\w.+]+)/;function s(t){const e=o.exec(t);return e?e[1]:t}function a(t){const e=r.exec(t);return e?e[1]:""}const l=/\?.*/;function c(t){if((0,n.Ew)(t)){const e=h(t.url||"");return{url:e,type:s(t.headers.get("content-type")||"")||a(e)}}return(0,n.Lj)(t)?{url:h(t.name||""),type:t.type||""}:"string"===typeof t?{url:h(t),type:a(t)}:{url:"",type:""}}function u(t){return(0,n.Ew)(t)?t.headers["content-length"]||-1:(0,n.Lj)(t)?t.size:"string"===typeof t?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}function h(t){return t.replace(l,"")}},73309:(t,e,i)=>{"use strict";i.d(e,{L1:()=>o,mm:()=>s});var n=i(78788),r=i(44037);async function o(t){if((0,n.Ew)(t))return t;const e={},i=(0,r.C)(t);i>=0&&(e["content-length"]=String(i));const{url:o,type:s}=(0,r.l)(t);s&&(e["content-type"]=s);const a=await async function(t){const e=5;if("string"===typeof t)return"data:,".concat(t.slice(0,e));if(t instanceof Blob){const e=t.slice(0,5);return await new Promise((t=>{const i=new FileReader;i.onload=e=>{var i;return t(null===e||void 0===e||null===(i=e.target)||void 0===i?void 0:i.result)},i.readAsDataURL(e)}))}if(t instanceof ArrayBuffer){const i=function(t){let e="";const i=new Uint8Array(t);for(let n=0;n<i.byteLength;n++)e+=String.fromCharCode(i[n]);return btoa(e)}(t.slice(0,e));return"data:base64,".concat(i)}return null}(t);a&&(e["x-first-bytes"]=a),"string"===typeof t&&(t=(new TextEncoder).encode(t));const l=new Response(t,{headers:e});return Object.defineProperty(l,"url",{value:o}),l}async function s(t){if(!t.ok){const e=await async function(t){let e="Failed to fetch resource ".concat(t.url," (").concat(t.status,"): ");try{const i=t.headers.get("Content-Type");let n=t.statusText;i.includes("application/json")&&(n+=" ".concat(await t.text())),e+=n,e=e.length>60?"".concat(e.slice(0,60),"..."):e}catch(i){}return e}(t);throw new Error(e)}}},27759:(t,e,i)=>{"use strict";i.d(e,{jU:()=>n});"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof i.g&&i.g,"undefined"!==typeof document&&document;const n=Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser),r="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);r&&parseFloat(r[1])}
2,61355:(t,e,i)=>{"use strict";function n(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const i={};for(let n=0;n<e.length;n++)i[e[n]]=t[n];return i}function r(t,e){if(!t)throw new Error("null row");if(!e)throw new Error("no headers");const i=new Array(e.length);for(let n=0;n<e.length;n++)i[n]=t[e[n]];return i}i.d(e,{w:()=>S});var o=i(64649);let s;class a extends Array{enqueue(t){return this.push(t)}dequeue(){return this.shift()}}s=Symbol.asyncIterator;class l{constructor(){(0,o.Z)(this,"_values",void 0),(0,o.Z)(this,"_settlers",void 0),(0,o.Z)(this,"_closed",void 0),this._values=new a,this._settlers=new a,this._closed=!1}close(){for(;this._settlers.length>0;)this._settlers.dequeue().resolve({done:!0});this._closed=!0}[s](){return this}enqueue(t){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");const e=this._settlers.dequeue();t instanceof Error?e.reject(t):e.resolve({value:t})}else this._values.enqueue(t)}next(){if(this._values.length>0){const t=this._values.dequeue();return t instanceof Error?Promise.reject(t):Promise.resolve({value:t})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0})}return new Promise(((t,e)=>{this._settlers.enqueue({resolve:t,reject:e})}))}}class c{constructor(t,e){if((0,o.Z)(this,"schema",void 0),(0,o.Z)(this,"options",void 0),(0,o.Z)(this,"length",0),(0,o.Z)(this,"rows",null),(0,o.Z)(this,"cursor",0),(0,o.Z)(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}addObjectRow(t,e){Number.isFinite(e)&&(this.cursor=e),this.rows=this.rows||new Array(100),this.rows[this.length]=t,this.length++}getBatch(){let t=this.rows;if(!t)return null;t=t.slice(0,this.length),this.rows=null;return{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}}}class u{constructor(t,e){if((0,o.Z)(this,"schema",void 0),(0,o.Z)(this,"options",void 0),(0,o.Z)(this,"length",0),(0,o.Z)(this,"objectRows",null),(0,o.Z)(this,"arrayRows",null),(0,o.Z)(this,"cursor",0),(0,o.Z)(this,"_headers",[]),this.options=e,this.schema=t,!Array.isArray(t)){this._headers=[];for(const e in t)this._headers[t[e].index]=t[e].name}}rowCount(){return this.length}addArrayRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"object-row-table":const i=n(t,this._headers);this.addObjectRow(i,e);break;case"array-row-table":this.arrayRows=this.arrayRows||new Array(100),this.arrayRows[this.length]=t,this.length++}}addObjectRow(t,e){switch(Number.isFinite(e)&&(this.cursor=e),this.options.shape){case"array-row-table":const i=r(t,this._headers);this.addArrayRow(i,e);break;case"object-row-table":this.objectRows=this.objectRows||new Array(100),this.objectRows[this.length]=t,this.length++}}getBatch(){let t=this.arrayRows||this.objectRows;return t?(t=t.slice(0,this.length),this.arrayRows=null,this.objectRows=null,{shape:this.options.shape,batchType:"data",data:t,length:this.length,schema:this.schema,cursor:this.cursor}):null}}class h{constructor(t,e){(0,o.Z)(this,"schema",void 0),(0,o.Z)(this,"length",0),(0,o.Z)(this,"allocated",0),(0,o.Z)(this,"columns",{}),this.schema=t,this._reallocateColumns()}rowCount(){return this.length}addArrayRow(t){this._reallocateColumns();let e=0;for(const i in this.columns)this.columns[i][this.length]=t[e++];this.length++}addObjectRow(t){this._reallocateColumns();for(const e in t)this.columns[e][this.length]=t[e];this.length++}getBatch(){this._pruneColumns();const t=Array.isArray(this.schema)?this.columns:{};if(!Array.isArray(this.schema))for(const e in this.schema){const i=this.schema[e];t[i.name]=this.columns[i.index]}this.columns={};return{shape:"columnar-table",batchType:"data",data:t,schema:this.schema,length:this.length}}_reallocateColumns(){if(!(this.length<this.allocated)){this.allocated=this.allocated>0?this.allocated*=2:100,this.columns={};for(const t in this.schema){const e=this.schema[t],i=e.type||Float32Array,n=this.columns[e.index];if(n&&ArrayBuffer.isView(n)){const t=new i(this.allocated);t.set(n),this.columns[e.index]=t}else n?(n.length=this.allocated,this.columns[e.index]=n):this.columns[e.index]=new i(this.allocated)}}}_pruneColumns(){for(const[t,e]of Object.entries(this.columns))this.columns[t]=e.slice(0,this.length)}}const d={shape:"array-row-table",batchSize:"auto",batchDebounceMs:0,limit:0,_limitMB:0},p="TableBatchBuilder";class A{constructor(t,e){(0,o.Z)(this,"schema",void 0),(0,o.Z)(this,"options",void 0),(0,o.Z)(this,"aggregator",null),(0,o.Z)(this,"batchCount",0),(0,o.Z)(this,"bytesUsed",0),(0,o.Z)(this,"isChunkComplete",!1),(0,o.Z)(this,"lastBatchEmittedMs",Date.now()),(0,o.Z)(this,"totalLength",0),(0,o.Z)(this,"totalBytes",0),(0,o.Z)(this,"rowBytes",0),this.schema=t,this.options={...d,...e}}limitReached(){var t,e;return!!(Boolean(null===(t=this.options)||void 0===t?void 0:t.limit)&&this.totalLength>=this.options.limit)||!!(Boolean(null===(e=this.options)||void 0===e?void 0:e._limitMB)&&this.totalBytes/1e6>=this.options._limitMB)}addRow(t){this.limitReached()||(this.totalLength++,this.rowBytes=this.rowBytes||this._estimateRowMB(t),this.totalBytes+=this.rowBytes,Array.isArray(t)?this.addArrayRow(t):this.addObjectRow(t))}
2addArrayRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addArrayRow(t)}addObjectRow(t){if(!this.aggregator){const t=this._getTableBatchType();this.aggregator=new t(this.schema,this.options)}this.aggregator.addObjectRow(t)}chunkComplete(t){t instanceof ArrayBuffer&&(this.bytesUsed+=t.byteLength),"string"===typeof t&&(this.bytesUsed+=t.length),this.isChunkComplete=!0}getFullBatch(t){return this._isFull()?this._getBatch(t):null}getFinalBatch(t){return this._getBatch(t)}_estimateRowMB(t){return Array.isArray(t)?8*t.length:8*Object.keys(t).length}_isFull(){if(!this.aggregator||0===this.aggregator.rowCount())return!1;if("auto"===this.options.batchSize){if(!this.isChunkComplete)return!1}else if(this.options.batchSize>this.aggregator.rowCount())return!1;return!(this.options.batchDebounceMs>Date.now()-this.lastBatchEmittedMs)&&(this.isChunkComplete=!1,this.lastBatchEmittedMs=Date.now(),!0)}_getBatch(t){if(!this.aggregator)return null;null!==t&&void 0!==t&&t.bytesUsed&&(this.bytesUsed=t.bytesUsed);const e=this.aggregator.getBatch();return e.count=this.batchCount,e.bytesUsed=this.bytesUsed,Object.assign(e,t),this.batchCount++,this.aggregator=null,e}_getTableBatchType(){switch(this.options.shape){case"row-table":return c;case"array-row-table":case"object-row-table":return u;case"columnar-table":return h;case"arrow-table":if(!A.ArrowBatch)throw new Error(p);return A.ArrowBatch;default:throw new Error(p)}}}(0,o.Z)(A,"ArrowBatch",void 0);const f={parse:function(t,e,i){var n=(e=e||{}).dynamicTyping||!1;w(n)&&(e.dynamicTypingFunction=n,n={});if(e.dynamicTyping=n,e.transform=!!w(e.transform)&&e.transform,e.worker&&f.WORKERS_SUPPORTED){var r=newWorker();return r.userStep=e.step,r.userChunk=e.chunk,r.userComplete=e.complete,r.userError=e.error,e.step=w(e.step),e.chunk=w(e.chunk),e.complete=w(e.complete),e.error=w(e.error),delete e.worker,void r.postMessage({input:t,config:e,workerId:r.id})}var o=null;"string"===typeof t&&(o=new y(e));o||(o=new i(e));return o.stream(t)},unparse:function(t,e){var i=!1,n=!0,r=",",o="\r\n",s='"',a=s+s,l=!1,c=null;!function(){if("object"!==typeof e)return;"string"!==typeof e.delimiter||f.BAD_DELIMITERS.filter((function(t){return-1!==e.delimiter.indexOf(t)})).length||(r=e.delimiter);("boolean"===typeof e.quotes||Array.isArray(e.quotes))&&(i=e.quotes);"boolean"!==typeof e.skipEmptyLines&&"string"!==typeof e.skipEmptyLines||(l=e.skipEmptyLines);"string"===typeof e.newline&&(o=e.newline);"string"===typeof e.quoteChar&&(s=e.quoteChar);"boolean"===typeof e.header&&(n=e.header);if(Array.isArray(e.columns)){if(0===e.columns.length)throw new Error("Option columns is empty");c=e.columns}void 0!==e.escapeChar&&(a=e.escapeChar+s)}();var u=new RegExp(_(s),"g");"string"===typeof t&&(t=JSON.parse(t));if(Array.isArray(t)){if(!t.length||Array.isArray(t[0]))return d(null,t,l);if("object"===typeof t[0])return d(c||h(t[0]),t,l)}else if("object"===typeof t)return"string"===typeof t.data&&(t.data=JSON.parse(t.data)),Array.isArray(t.data)&&(t.fields||(t.fields=t.meta&&t.meta.fields),t.fields||(t.fields=Array.isArray(t.data[0])?t.fields:h(t.data[0])),Array.isArray(t.data[0])||"object"===typeof t.data[0]||(t.data=[t.data])),d(t.fields||[],t.data||[],l);throw new Error("Unable to serialize unrecognized input");function h(t){if("object"!==typeof t)return[];var e=[];for(var i in t)e.push(i);return e}function d(t,e,i){var s="";"string"===typeof t&&(t=JSON.parse(t)),"string"===typeof e&&(e=JSON.parse(e));var a=Array.isArray(t)&&t.length>0,l=!Array.isArray(e[0]);if(a&&n){for(var c=0;c<t.length;c++)c>0&&(s+=r),s+=p(t[c],c);e.length>0&&(s+=o)}for(var u=0;u<e.length;u++){var h=a?t.length:e[u].length,d=!1,A=a?0===Object.keys(e[u]).length:0===e[u].length;if(i&&!a&&(d="greedy"===i?""===e[u].join("").trim():1===e[u].length&&0===e[u][0].length),"greedy"===i&&a){for(var f=[],g=0;g<h;g++){var m=l?t[g]:g;f.push(e[u][m])}d=""===f.join("").trim()}if(!d){for(var y=0;y<h;y++){y>0&&!A&&(s+=r);var v=a&&l?t[y]:y;s+=p(e[u][v],y)}u<e.length-1&&(!i||h>0&&!A)&&(s+=o)}}return s}function p(t,e){if("undefined"===typeof t||null===t)return"";if(t.constructor===Date)return JSON.stringify(t).slice(1,25);t=t.toString().replace(u,a);var n="boolean"===typeof i&&i||Array.isArray(i)&&i[e]||function(t,e){for(var i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return!0;return!1}(t,f.BAD_DELIMITERS)||t.indexOf(r)>-1||" "===t.charAt(0)||" "===t.charAt(t.length-1);return n?s+t+s:t}},RECORD_SEP:String.fromCharCode(30),UNIT_SEP:String.fromCharCode(31),BYTE_ORDER_MARK:"\ufeff",BAD_DELIMITERS:["\r","\n",'"',"\ufeff"],WORKERS_SUPPORTED:!1,NODE_STREAM_INPUT:1,LocalChunkSize:10485760,RemoteChunkSize:5242880,DefaultDelimiter:",",Parser:b,ParserHandle:v,ChunkStreamer:m,StringStreamer:y},g=f;function m(t){this._handle=null,this._finished=!1,this._completed=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(t){var e=x(t);e.chunkSize=parseInt(e.chunkSize),t.step||t.chunk||(e.chunkSize=null);this._handle=new v(e),this._handle.streamer=this,this._config=e}.call(this,t),this.parseChunk=function(t,e){if(this.isFirstChunk&&w(this._config.beforeFirstChunk)){var i=this._config.beforeFirstChunk(t);void 0!==i&&(t=i)}this.isFirstChunk=!1;var n=this._partialLine+t;this._partialLine="";var r=this._handle.parse(n,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var o=r.meta.cursor;this._finished||(this._partialLine=n.substring(o-this._baseIndex),this._baseIndex=o),r&&r.data&&(this._rowCount+=r.data.length);var s=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(w(this._config.chunk)&&!e){if(this._config.chunk(r,this._handle),this._handle.paused()||this._handle.aborted())return;r=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(r.data),this._completeResults.errors=this._completeResults.errors.concat(r.errors),this._completeResults.meta=r.meta),this._completed||!s||!w(this._config.complete)||r&&r.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),s||r&&r.meta.paused||this._nextChunk(),r}},this._sendError=function(t){w(this._config.error)&&this._config.error(t)}}function y(t){var e;t=t||{},m.call(this,t),this.stream=function(t){return e=t,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var t=this._config.chunkSize,i=t?e.substr(0,t):e;return e=t?e.substr(t):"",this._finished=!e,this.parseChunk(i)}}}function v(t){var e,i,n,r=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,o=/(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))/,s=this,a=0,l=0,c=!1,u=!1,h=[],d={data:[],errors:[],meta:{}};if(w(t.step)){var p=t.step;t.step=function(e){if(d=e,m())g();else{if(g(),!d.data||0===d.data.length)return;a+=e.data.length,t.preview&&a>t.preview?i.abort():p(d,s)}}}function A(e){return"greedy"===t.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function g(){if(d&&n&&(v("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+f.DefaultDelimiter+"'"),n=!1),t.skipEmptyLines)for(var e=0;e<d.data.length;e++)A(d.data[e])&&d.data.splice(e--,1);return m()&&function(){if(!d)return;function e(e){w(t.transformHeader)&&(e=t.transformHeader(e)),h.push(e)}if(Array.isArray(d.data[0])){for(var i=0;m()&&i<d.data.length;
2i++)d.data[i].forEach(e);d.data.splice(0,1)}else d.data.forEach(e)}(),function(){if(!d||!d.data||!t.header&&!t.dynamicTyping&&!t.transform)return d;function e(e,i){var n,r=t.header?{}:[];for(n=0;n<e.length;n++){var o=n,s=e[n];t.header&&(o=n>=h.length?"__parsed_extra":h[n]),t.transform&&(s=t.transform(s,o)),s=y(o,s),"__parsed_extra"===o?(r[o]=r[o]||[],r[o].push(s)):r[o]=s}return t.header&&(n>h.length?v("FieldMismatch","TooManyFields","Too many fields: expected "+h.length+" fields but parsed "+n,l+i):n<h.length&&v("FieldMismatch","TooFewFields","Too few fields: expected "+h.length+" fields but parsed "+n,l+i)),r}var i=1;!d.data[0]||Array.isArray(d.data[0])?(d.data=d.data.map(e),i=d.data.length):d.data=e(d.data,0);t.header&&d.meta&&(d.meta.fields=h);return l+=i,d}()}function m(){return t.header&&0===h.length}function y(e,i){return function(e){return t.dynamicTypingFunction&&void 0===t.dynamicTyping[e]&&(t.dynamicTyping[e]=t.dynamicTypingFunction(e)),!0===(t.dynamicTyping[e]||t.dynamicTyping)}(e)?"true"===i||"TRUE"===i||"false"!==i&&"FALSE"!==i&&(r.test(i)?parseFloat(i):o.test(i)?new Date(i):""===i?null:i):i}function v(t,e,i,n){d.errors.push({type:t,code:e,message:i,row:n})}this.parse=function(r,o,s){var a=t.quoteChar||'"';if(t.newline||(t.newline=function(t,e){t=t.substr(0,1048576);var i=new RegExp(_(e)+"([^]*?)"+_(e),"gm");t=t.replace(i,"");var n=t.split("\r"),r=t.split("\n"),o=r.length>1&&r[0].length<n[0].length;if(1===n.length||o)return"\n";for(var s=0,a=0;a<n.length;a++)"\n"===n[a][0]&&s++;return s>=n.length/2?"\r\n":"\r"}(r,a)),n=!1,t.delimiter)w(t.delimiter)&&(t.delimiter=t.delimiter(r),d.meta.delimiter=t.delimiter);else{var l=function(e,i,n,r,o){var s,a,l;o=o||[",","\t","|",";",f.RECORD_SEP,f.UNIT_SEP];for(var c=0;c<o.length;c++){var u=o[c],h=0,d=0,p=0;l=void 0;for(var g=new b({comments:r,delimiter:u,newline:i,preview:10}).parse(e),m=0;m<g.data.length;m++)if(n&&A(g.data[m]))p++;else{var y=g.data[m].length;d+=y,"undefined"!==typeof l?y>1&&(h+=Math.abs(y-l),l=y):l=0}g.data.length>0&&(d/=g.data.length-p),("undefined"===typeof a||h>a)&&d>1.99&&(a=h,s=u)}return t.delimiter=s,{successful:!!s,bestDelimiter:s}}(r,t.newline,t.skipEmptyLines,t.comments,t.delimitersToGuess);l.successful?t.delimiter=l.bestDelimiter:(n=!0,t.delimiter=f.DefaultDelimiter),d.meta.delimiter=t.delimiter}var u=x(t);return t.preview&&t.header&&u.preview++,e=r,i=new b(u),d=i.parse(e,o,s),g(),c?{meta:{paused:!0}}:d||{meta:{paused:!1}}},this.paused=function(){return c},this.pause=function(){c=!0,i.abort(),e=e.substr(i.getCharIndex())},this.resume=function(){c=!1,s.streamer.parseChunk(e,!0)},this.aborted=function(){return u},this.abort=function(){u=!0,i.abort(),d.meta.aborted=!0,w(t.complete)&&t.complete(d),e=""}}function _(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function b(t){var e,i=(t=t||{}).delimiter,n=t.newline,r=t.comments,o=t.step,s=t.preview,a=t.fastMode,l=e=void 0===t.quoteChar?'"':t.quoteChar;if(void 0!==t.escapeChar&&(l=t.escapeChar),("string"!==typeof i||f.BAD_DELIMITERS.indexOf(i)>-1)&&(i=","),r===i)throw new Error("Comment character same as delimiter");!0===r?r="#":("string"!==typeof r||f.BAD_DELIMITERS.indexOf(r)>-1)&&(r=!1),"\n"!==n&&"\r"!==n&&"\r\n"!==n&&(n="\n");var c=0,u=!1;this.parse=function(t,h,d){if("string"!==typeof t)throw new Error("Input must be a string");var p=t.length,A=i.length,f=n.length,g=r.length,m=w(o);c=0;var y=[],v=[],b=[],x=0;if(!t)return R();if(a||!1!==a&&-1===t.indexOf(e)){for(var C=t.split(n),B=0;B<C.length;B++){if(b=C[B],c+=b.length,B!==C.length-1)c+=n.length;else if(d)return R();if(!r||b.substr(0,g)!==r){if(m){if(y=[],D(b.split(i)),k(),u)return R()}else D(b.split(i));if(s&&B>=s)return y=y.slice(0,s),R(!0)}}return R()}for(var E,S=t.indexOf(i,c),T=t.indexOf(n,c),M=new RegExp(_(l)+_(e),"g");;)if(t[c]!==e)if(r&&0===b.length&&t.substr(c,g)===r){if(-1===T)return R();c=T+f,T=t.indexOf(n,c),S=t.indexOf(i,c)}else if(-1!==S&&(S<T||-1===T))b.push(t.substring(c,S)),c=S+A,S=t.indexOf(i,c);else{if(-1===T)break;if(b.push(t.substring(c,T)),F(T+f),m&&(k(),u))return R();if(s&&y.length>=s)return R(!0)}else{for(E=c,c++;;){if(-1===(E=t.indexOf(e,E+1)))return d||v.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:y.length,index:c}),O();if(E===p-1)return O(t.substring(c,E).replace(M,e));if(e!==l||t[E+1]!==l){if(e===l||0===E||t[E-1]!==l){var I=L(-1===T?S:Math.min(S,T));if(t[E+1+I]===i){if(b.push(t.substring(c,E).replace(M,e)),c=E+1+I+A,S=t.indexOf(i,c),T=t.indexOf(n,c),m&&(k(),u))return R();if(s&&y.length>=s)return R(!0);break}var P=L(T);if(t.substr(E+1+P,f)===n){if(b.push(t.substring(c,E).replace(M,e)),F(E+1+P+f),S=t.indexOf(i,c),m&&(k(),u))return R();if(s&&y.length>=s)return R(!0);break}v.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:y.length,index:c}),E++}}else E++}if(m&&(k(),u))return R();if(s&&y.length>=s)return R(!0)}return O();function D(t){y.push(t),x=c}function L(e){var i=0;if(-1!==e){var n=t.substring(E+1,e);n&&""===n.trim()&&(i=n.length)}return i}function O(e){return d||("undefined"===typeof e&&(e=t.substr(c)),b.push(e),c=p,D(b),m&&k()),R()}function F(e){c=e,D(b),b=[],T=t.indexOf(n,c)}function R(t,e){return{data:e||!1?y[0]:y,errors:v,meta:{delimiter:i,linebreak:n,aborted:u,truncated:!!t,cursor:x+(h||0)}}}function k(){o(R(void 0,!0)),y=[],v=[]}},this.abort=function(){u=!0},this.getCharIndex=function(){return c}}function x(t){if("object"!==typeof t||null===t)return t;var e=Array.isArray(t)?[]:{};for(var i in t)e[i]=x(t[i]);return e}function w(t){return"function"===typeof t}y.prototype=Object.create(y.prototype),y.prototype.constructor=y;const{ChunkStreamer:C}=g;function B(t){t=t||{},C.call(this,t),this.textDecoder=new TextDecoder(this._config.encoding),this.stream=async function(t){this._input=t;try{for await(const e of t)this.parseChunk(this.getStringChunk(e));this._finished=!0,this.parseChunk("")}catch(e){this._sendError(e)}},this._nextChunk=function(){}
2,this.getStringChunk=function(t){return"string"===typeof t?t:this.textDecoder.decode(t,{stream:!0})}}B.prototype=Object.create(C.prototype),B.prototype.constructor=B;const E={csv:{shape:"object-row-table",optimizeMemoryUsage:!1,header:"auto",columnPrefix:"column",quoteChar:'"',escapeChar:'"',dynamicTyping:!0,comments:!1,skipEmptyLines:!0,delimitersToGuess:[",","\t","|",";"]}},S={id:"csv",module:"csv",name:"CSV",version:"3.2.13",extensions:["csv","tsv","dsv"],mimeTypes:["text/csv","text/tab-separated-values","text/dsv"],category:"table",parse:async(t,e)=>T((new TextDecoder).decode(t),e),parseText:(t,e)=>T(t,e),parseInBatches:function(t,e){var i;"auto"===(e={...e}).batchSize&&(e.batchSize=4e3);const n={...E.csv,...null===(i=e)||void 0===i?void 0:i.csv},r=new l;let o=!0,s=null,a=null,c=null;const u={...n,header:!1,download:!1,chunkSize:5242880,skipEmptyLines:!1,step(t){let i=t.data;if(n.skipEmptyLines){if(""===i.flat().join("").trim())return}const l=t.meta.cursor;if(o&&!s){if("auto"===n.header?M(i):Boolean(n.header))return void(s=i.map(I()))}o&&(o=!1,s||(s=P(n.columnPrefix,i.length)),c=function(t,e){const i=e?{}:[];for(let n=0;n<t.length;n++){const r=e&&e[n]||n;switch(typeof t[n]){case"number":case"boolean":i[r]={name:String(r),index:n,type:Float32Array};break;default:i[r]={name:String(r),index:n,type:Array}}}return i}(i,s)),n.optimizeMemoryUsage&&(i=JSON.parse(JSON.stringify(i))),a=a||new A(c,{shape:n.shape||"array-row-table",...e});try{a.addRow(i);const t=a&&a.getFullBatch({bytesUsed:l});t&&r.enqueue(t)}catch(u){r.enqueue(u)}},complete(t){try{const e=t.meta.cursor,i=a&&a.getFinalBatch({bytesUsed:e});i&&r.enqueue(i)}catch(e){r.enqueue(e)}r.close()}};return g.parse(t,u,B),r},options:E};async function T(t,e){const i={...E.csv,...null===e||void 0===e?void 0:e.csv},o=function(t){const e=g.parse(t,{download:!1,dynamicTyping:!0,preview:1});return e.data[0]}(t),s="auto"===i.header?M(o):Boolean(i.header),a={...i,header:s,download:!1,transformHeader:s?I():void 0,error:t=>{throw new Error(t)}},l=g.parse(t,a);let{data:c}=l;const u=l.meta.fields||P(i.columnPrefix,o.length);switch(i.shape){case"object-row-table":c=c.map((t=>Array.isArray(t)?n(t,u):t));break;case"array-row-table":c=c.map((t=>Array.isArray(t)?t:r(t,u)))}return c}function M(t){return t&&t.every((t=>"string"===typeof t))}function I(){const t=new Set;return e=>{let i=e,n=1;for(;t.has(i);)i="".concat(e,".").concat(n),n++;return t.add(i),i}}function P(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=[];for(let n=0;n<e;n++)i.push("".concat(t).concat(n+1));return i}},82595:(t,e,i)=>{"use strict";i.d(e,{E:()=>_i});var n={};i.r(n),i.d(n,{decode:()=>wt,name:()=>xt});var r={};i.r(r),i.d(r,{name:()=>It,preprocess:()=>Pt});var o={};i.r(o),i.d(o,{name:()=>Lt,preprocess:()=>Ot});var s={};i.r(s),i.d(s,{decode:()=>Ee,encode:()=>Se,name:()=>Ce,preprocess:()=>Be});var a={};i.r(a),i.d(a,{decode:()=>Le,encode:()=>Oe,name:()=>De});var l={};i.r(l),i.d(l,{decode:()=>ke,encode:()=>ze,name:()=>Re});var c={};i.r(c),i.d(c,{decode:()=>Ge,encode:()=>Ze,name:()=>Ne});var u=i(89596),h=i(72672),d=i(73599);const p="3.2.13",A={};async function f(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return e&&(t=function(t,e,i){if(t.startsWith("http"))return t;const n=i.modules||{};if(n[t])return n[t];if(!u.jU)return"modules/".concat(e,"/dist/libs/").concat(t);if(i.CDN)return(0,d.h)(i.CDN.startsWith("http")),"".concat(i.CDN,"/").concat(e,"@").concat(p,"/dist/libs/").concat(t);if(u.hJ)return"../src/libs/".concat(t);return"modules/".concat(e,"/src/libs/").concat(t)}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:{})),A[t]=A[t]||async function(t){if(t.endsWith("wasm")){const e=await fetch(t);return await e.arrayBuffer()}if(!u.jU)try{return h&&h.requireFromFile&&await h.requireFromFile(t)}catch{return null}if(u.hJ)return importScripts(t);const e=await fetch(t);return function(t,e){if(!u.jU)return h.requireFromString&&h.requireFromString(t,e);if(u.hJ)return eval.call(u.CO,t),null;const i=document.createElement("script");i.id=e;try{i.appendChild(document.createTextNode(t))}catch(n){i.text=t}return document.body.appendChild(i),null}(await e.text(),t)}(t),await A[t]}const g="3.2.13",m="https://unpkg.com/@loaders.gl/textures@".concat(g,"/dist/libs/basis_encoder.wasm"),y="https://unpkg.com/@loaders.gl/textures@".concat(g,"/dist/libs/basis_encoder.js");let v,_;async function b(t){const e=t.modules||{};return e.basis?e.basis:(v=v||async function(t){let e=null,i=null;return[e,i]=await Promise.all([await f("basis_transcoder.js","textures",t),await f("basis_transcoder.wasm","textures",t)]),e=e||globalThis.BASIS,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t(i).then((t=>{const{BasisFile:i,initializeBasis:n}=t;n(),e({BasisFile:i})}
2))}))}(e,i)}(t),await v)}async function x(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(_=_||async function(t){let e=null,i=null;return[e,i]=await Promise.all([await f(y,"textures",t),await f(m,"textures",t)]),e=e||globalThis.BASIS,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t(i).then((t=>{const{BasisFile:i,KTX2File:n,initializeBasis:r,BasisEncoder:o}=t;r(),e({BasisFile:i,KTX2File:n,BasisEncoder:o})}))}))}(e,i)}(t),await _)}const w=33776,C=33779,B=35840,E=35842,S=36196,T=37808,M=["","WEBKIT_","MOZ_"],I={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let P=null;function D(t){if(!P){t=t||function(){try{return document.createElement("canvas").getContext("webgl")}catch(t){return null}}()||void 0,P=new Set;for(const e of M)for(const i in I)if(t&&t.getExtension("".concat(e).concat(i))){const t=I[i];P.add(t)}}return P}i(88687);const L=[171,75,84,88,32,50,48,187,13,10,26,10];const O={etc1:{basisFormat:0,compressed:!0,format:S},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:w},bc3:{basisFormat:3,compressed:!0,format:C},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:B},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:E},"astc-4x4":{basisFormat:10,compressed:!0,format:T},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};function F(t,e,i){const n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");const t=n.getNumImages(),e=[];for(let r=0;r<t;r++){const t=n.getNumLevels(r),o=[];for(let e=0;e<t;e++)o.push(R(n,r,e,i));e.push(o)}return e}finally{n.close(),n.delete()}}function R(t,e,i,n){const r=t.getImageWidth(e,i),o=t.getImageHeight(e,i),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=U(n,s),u=t.getImageTranscodedSizeInBytes(e,i,c),h=new Uint8Array(u);if(!t.transcodeImage(h,e,i,c,0,0))throw new Error("failed to start Basis transcoding");return{width:r,height:o,data:h,compressed:a,format:l,hasAlpha:s}}function k(t,e,i){const n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");const t=n.getLevels(),e=[];for(let r=0;r<t;r++){e.push(z(n,r,i));break}return[e]}finally{n.close(),n.delete()}}function z(t,e,i){const{alphaFlag:n,height:r,width:o}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=U(i,n),c=t.getImageTranscodedSizeInBytes(e,0,0,l),u=new Uint8Array(c);if(!t.transcodeImage(u,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:r,data:u,compressed:s,hasAlpha:n,format:a}}function U(t,e){let i=t&&t.basis&&t.basis.format;return"auto"===i&&(i=N()),"object"===typeof i&&(i=e?i.alpha:i.noAlpha),i=i.toLowerCase(),O[i]}function N(){const t=D();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const G={name:"Basis",id:"basis",module:"textures",version:"3.2.13",worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},Z={...G,parse:async function(t,e){if("auto"===e.basis.containerFormat){if(function(t){const e=new Uint8Array(t);return!(e.byteLength<L.length||e[0]!==L[0]||e[1]!==L[1]||e[2]!==L[2]||e[3]!==L[3]||e[4]!==L[4]||e[5]!==L[5]||e[6]!==L[6]||e[7]!==L[7]||e[8]!==L[8]||e[9]!==L[9]||e[10]!==L[10]||e[11]!==L[11])}(t)){return k((await x(e)).KTX2File,t,e)}const{BasisFile:i}=await b(e);return F(i,t,e)}if("encoder"===e.basis.module){const i=await x(e);return"ktx2"===e.basis.containerFormat?k(i.KTX2File,t,e):F(i.BasisFile,t,e)}{const{BasisFile:i}=await b(e);return F(i,t,e)}}};var j=i(21440);function V(t,e,i){if(t.byteLength<=e+i)return"";const n=new DataView(t);let r="";for(let o=0;o<i;o++)r+=String.fromCharCode(n.getUint8(e+o));return r}function H(t){try{return JSON.parse(t)}catch(e){throw new Error('Failed to parse JSON from data starting with "'.concat(function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5;if("string"===typeof t)return t.slice(0,e);if(ArrayBuffer.isView(t))return V(t.buffer,t.byteOffset,e);if(t instanceof ArrayBuffer)return V(t,0,e);return""}(t),'"'))}}function J(t,e,i){const n=void 0!==i?new Uint8Array(t).subarray(e,e+i):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function W(t,e){if(!t)throw new Error(e||"assert failed: gltf")}function Q(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const i=e.baseUri||e.uri;if(!i)throw new Error("'baseUri' must be provided to resolve relative url ".concat(t));return i.substr(0,i.lastIndexOf("/")+1)+t}function q(t,e,i){const n=t.bufferViews[i];W(n);const r=e[n.buffer];W(r);const o=(n.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,n.byteLength)}var K=i(64649),X=i(43835);function Y(t,e){if(!t)throw new Error(e||"loader assertion failed.")}function $(t,e){return Y(t>=0),Y(e>0),t+(e-1)&~(e-1)}function tt(t,e,i){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{const e=t.byteOffset,i=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,e,i)}return e.set(n,i),i+$(n.byteLength,4)}const et=["SCALAR","VEC2","VEC3","VEC4"],it=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],nt=new Map(it),rt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ot={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},st={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function at(t){return et[t-1]||et[0]}function lt(t){const e=nt.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function ct(t,e){const i=st[t.componentType],n=rt[t.type],r=ot[t.componentType],o=t.count*n,s=t.count*n*r;return W(s>=0&&s<=e.byteLength),{ArrayType:i,length:o,byteLength:s}}const ut={asset:{version:"2.0",generator:"loaders.gl"},buffers:[]};class ht{constructor(t){(0,K.Z)(this,"gltf",void 0),(0,K.Z)(this,"sourceBuffers",void 0),(0,K.Z)(this,"byteLength",void 0),this.gltf=t||{json:{...ut},buffers:[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}getExtension(t){const e=this.getUsedExtensions().find((e=>e===t)),i=this.json.extensions||{};return e?i[t]||!0:null}getRequiredExtension(t){return this.getRequiredExtensions().find((e=>e===t))?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getObjectExtension(t,e){return(t.extensions||{})[e]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,e){if("object"===typeof e)return e;const i=this.json[t]&&this.json[t][e];if(!i)throw new Error("glTF file error: Could not find ".concat(t,"[").concat(e,"]"));return i}getTypedArrayForBufferView(t){const e=(t=this.getBufferView(t)).buffer,i=this.gltf.buffers[e];W(i);const n=(t.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,n,t.byteLength)}getTypedArrayForAccessor(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),i=this.getBuffer(e.buffer).data,{ArrayType:n,length:r}=ct(t,e);return new n(i,e.byteOffset+t.byteOffset,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);const e=this.getBufferView(t.bufferView),i=this.getBuffer(e.buffer).data,n=e.byteOffset||0;return new Uint8Array(i,n,e.byteLength)}addApplicationData(t,e){return this.json[t]=e,this}addExtraData(t,e){return this.json.extras=this.json.extras||{},this.json.extras[t]=e,this}addObjectExtension(t,e,i){return t.extensions=t.extensions||{},t.extensions[e]=i,this.registerUsedExtension(e),this}setObjectExtension(t,e,i){(t.extensions||{})[e]=i}removeObjectExtension(t,e){const i=t.extensions||{},n=i[e];return delete i[e],n}addExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return W(e),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=e,this.registerUsedExtension(t),e}
2addRequiredExtension(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return W(e),this.addExtension(t,e),this.registerRequiredExtension(t),e}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find((e=>e===t))||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find((e=>e===t))||this.json.extensionsRequired.push(t)}removeExtension(t){this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t),this.json.extensions&&delete this.json.extensions[t]}setDefaultScene(t){this.json.scene=t}addScene(t){const{nodeIndices:e}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:e}),this.json.scenes.length-1}addNode(t){const{meshIndex:e,matrix:i}=t;this.json.nodes=this.json.nodes||[];const n={mesh:e};return i&&(n.matrix=i),this.json.nodes.push(n),this.json.nodes.length-1}addMesh(t){const{attributes:e,indices:i,material:n,mode:r=4}=t,o={primitives:[{attributes:this._addAttributes(e),mode:r}]};if(i){const t=this._addIndices(i);o.primitives[0].indices=t}return Number.isFinite(n)&&(o.primitives[0].material=n),this.json.meshes=this.json.meshes||[],this.json.meshes.push(o),this.json.meshes.length-1}addPointCloud(t){const e={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(e),this.json.meshes.length-1}addImage(t,e){const i=(0,X.I)(t),n=e||(null===i||void 0===i?void 0:i.mimeType),r={bufferView:this.addBufferView(t),mimeType:n};return this.json.images=this.json.images||[],this.json.images.push(r),this.json.images.length-1}addBufferView(t){const e=t.byteLength;W(Number.isFinite(e)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);const i={buffer:0,byteOffset:this.byteLength,byteLength:e};return this.byteLength+=$(e,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(t,e){const i={bufferView:t,type:at(e.size),componentType:e.componentType,count:e.count,max:e.max,min:e.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(i),this.json.accessors.length-1}addBinaryBuffer(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{size:3};const i=this.addBufferView(t);let n={min:e.min,max:e.max};n.min&&n.max||(n=this._getAccessorMinMax(t,e.size));const r={size:e.size,componentType:lt(t),count:Math.round(t.length/e.size),min:n.min,max:n.max};return this.addAccessor(i,Object.assign(r,e))}addTexture(t){const{imageIndex:e}=t,i={source:e};return this.json.textures=this.json.textures||[],this.json.textures.push(i),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){var t,e;this.gltf.buffers=[];const i=this.byteLength,n=new ArrayBuffer(i),r=new Uint8Array(n);let o=0;for(const s of this.sourceBuffers||[])o=tt(s,r,o);null!==(t=this.json)&&void 0!==t&&null!==(e=t.buffers)&&void 0!==e&&e[0]?this.json.buffers[0].byteLength=i:this.json.buffers=[{byteLength:i}],this.gltf.binary=n,this.sourceBuffers=[n]}_removeStringFromArray(t,e){let i=!0;for(;i;){const n=t.indexOf(e);n>-1?t.splice(n,1):i=!1}}_addAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={};for(const i in t){const n=t[i],r=this._getGltfAttributeName(i),o=this.addBinaryBuffer(n.value,n);e[r]=o}return e}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,e){const i={min:null,max:null};if(t.length<e)return i;i.min=[],i.max=[];const n=t.subarray(0,e);for(const r of n)i.min.push(r),i.max.push(r);for(let r=e;r<t.length;r+=e)for(let n=0;n<e;n++)i.min[0+n]=Math.min(i.min[0+n],t[r+n]),i.max[0+n]=Math.max(i.max[0+n],t[r+n]);return i}}
2const dt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIA
2LAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",pt=
vendor: 10,661 bytes, line 2
2"B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",
2At=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),ft=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),gt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},mt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};let yt;async function vt(){return yt||(yt=async function(){let t=dt;WebAssembly.validate(At)&&(t=pt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(function(t){const e=new Uint8Array(t.length);for(let n=0;n<t.length;++n){const i=t.charCodeAt(n);e[n]=i>96?i-71:i>64?i-65:i>47?i+4:i>46?63:62}let i=0;for(let n=0;n<t.length;++n)e[i++]=e[n]<60?ft[e[n]]:64*(e[n]-60)+e[++n];return e.buffer.slice(0,i)}(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}()),yt}function _t(t,e,i,n,r,o,s){const a=t.exports.sbrk,l=n+3&-4,c=a(l*r),u=a(o.length),h=new Uint8Array(t.exports.memory.buffer);h.set(o,u);const d=e(c,n,r,u,o.length);if(0===d&&s&&s(c,l,r),i.set(h.subarray(c,c+n*r)),a(c-a(0)),0!==d)throw new Error("Malformed buffer data: ".concat(d))}const bt="EXT_meshopt_compression",xt=bt;async function wt(t,e){var i;const n=new ht(t);if(null===e||void 0===e||null===(i=e.gltf)||void 0===i||!i.decompressMeshes)return;const r=[];for(const o of t.json.bufferViews||[])r.push(Ct(n,o));await Promise.all(r),n.removeExtension(bt)}async function Ct(t,e){const i=t.getObjectExtension(e,bt);if(i){const{byteOffset:n=0,byteLength:r=0,byteStride:o,count:s,mode:a,filter:l="NONE",buffer:c}=i,u=t.gltf.buffers[c],h=new Uint8Array(u.arrayBuffer,u.byteOffset+n,r),d=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);return await async function(t,e,i,n,r){let o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"NONE";const s=await vt();_t(s,s.exports[mt[r]],t,e,i,n,s.exports[gt[o||"NONE"]])}(d,s,o,h,a,l),d}return null}var Bt=i(80285);const Et=["image/png","image/jpeg","image/gif"],St={};function Tt(t){return void 0===St[t]&&(St[t]=function(t){switch(t){case"image/webp":return function(){if(!Bt.jU)return!1;try{return 0===document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp")}catch{return!1}}();case"image/svg":return Bt.jU;default:if(!Bt.jU){const{_parseImageNode:e}=globalThis;return Boolean(e)&&Et.includes(t)}return!0}}(t)),St[t]}const Mt="EXT_texture_webp",It=Mt;function Pt(t,e){const i=new ht(t);if(!Tt("image/webp")){if(i.getRequiredExtensions().includes(Mt))throw new Error("gltf: Required extension ".concat(Mt," not supported by browser"));return}const{json:n}=i;for(const r of n.textures||[]){const t=i.getObjectExtension(r,Mt);t&&(r.source=t.source),i.removeObjectExtension(r,Mt)}i.removeExtension(Mt)}const Dt="KHR_texture_basisu",Lt=Dt;function Ot(t,e){const i=new ht(t),{json:n}=i;for(const r of n.textures||[]){const t=i.getObjectExtension(r,Dt);t&&(r.source=t.source),i.removeObjectExtension(r,Dt)}i.removeExtension(Dt)}const Ft="3.2.13",Rt={name:"Draco",id:"draco",module:"draco",shapes:["mesh"],version:Ft,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:"object"===typeof WebAssembly?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};class kt{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:new Map;(0,K.Z)(this,"name",void 0),(0,K.Z)(this,"type",void 0),(0,K.Z)(this,"nullable",void 0),(0,K.Z)(this,"metadata",void 0),this.name=t,this.type=e,this.nullable=i,this.metadata=n}get typeId(){return this.type&&this.type.typeId}clone(){return new kt(this.name,this.type,this.nullable,this.metadata)}compareTo(t){return this.name===t.name&&this.type===t.type&&this.nullable===t.nullable&&this.metadata===t.metadata}
2toString(){return"".concat(this.type).concat(this.nullable?", nullable":"").concat(this.metadata?", metadata: ".concat(this.metadata):"")}}let zt,Ut,Nt,Gt,Zt,jt,Vt,Ht,Jt;!function(t){t[t.NONE=0]="NONE",t[t.Null=1]="Null",t[t.Int=2]="Int",t[t.Float=3]="Float",t[t.Binary=4]="Binary",t[t.Utf8=5]="Utf8",t[t.Bool=6]="Bool",t[t.Decimal=7]="Decimal",t[t.Date=8]="Date",t[t.Time=9]="Time",t[t.Timestamp=10]="Timestamp",t[t.Interval=11]="Interval",t[t.List=12]="List",t[t.Struct=13]="Struct",t[t.Union=14]="Union",t[t.FixedSizeBinary=15]="FixedSizeBinary",t[t.FixedSizeList=16]="FixedSizeList",t[t.Map=17]="Map",t[t.Dictionary=-1]="Dictionary",t[t.Int8=-2]="Int8",t[t.Int16=-3]="Int16",t[t.Int32=-4]="Int32",t[t.Int64=-5]="Int64",t[t.Uint8=-6]="Uint8",t[t.Uint16=-7]="Uint16",t[t.Uint32=-8]="Uint32",t[t.Uint64=-9]="Uint64",t[t.Float16=-10]="Float16",t[t.Float32=-11]="Float32",t[t.Float64=-12]="Float64",t[t.DateDay=-13]="DateDay",t[t.DateMillisecond=-14]="DateMillisecond",t[t.TimestampSecond=-15]="TimestampSecond",t[t.TimestampMillisecond=-16]="TimestampMillisecond",t[t.TimestampMicrosecond=-17]="TimestampMicrosecond",t[t.TimestampNanosecond=-18]="TimestampNanosecond",t[t.TimeSecond=-19]="TimeSecond",t[t.TimeMillisecond=-20]="TimeMillisecond",t[t.TimeMicrosecond=-21]="TimeMicrosecond",t[t.TimeNanosecond=-22]="TimeNanosecond",t[t.DenseUnion=-23]="DenseUnion",t[t.SparseUnion=-24]="SparseUnion",t[t.IntervalDayTime=-25]="IntervalDayTime",t[t.IntervalYearMonth=-26]="IntervalYearMonth"}(zt||(zt={}));class Wt{static isNull(t){return t&&t.typeId===zt.Null}static isInt(t){return t&&t.typeId===zt.Int}static isFloat(t){return t&&t.typeId===zt.Float}static isBinary(t){return t&&t.typeId===zt.Binary}static isUtf8(t){return t&&t.typeId===zt.Utf8}static isBool(t){return t&&t.typeId===zt.Bool}static isDecimal(t){return t&&t.typeId===zt.Decimal}static isDate(t){return t&&t.typeId===zt.Date}static isTime(t){return t&&t.typeId===zt.Time}static isTimestamp(t){return t&&t.typeId===zt.Timestamp}static isInterval(t){return t&&t.typeId===zt.Interval}static isList(t){return t&&t.typeId===zt.List}static isStruct(t){return t&&t.typeId===zt.Struct}static isUnion(t){return t&&t.typeId===zt.Union}static isFixedSizeBinary(t){return t&&t.typeId===zt.FixedSizeBinary}static isFixedSizeList(t){return t&&t.typeId===zt.FixedSizeList}static isMap(t){return t&&t.typeId===zt.Map}static isDictionary(t){return t&&t.typeId===zt.Dictionary}get typeId(){return zt.NONE}compareTo(t){return this===t}}Symbol.toStringTag;Symbol.toStringTag;Ut=Symbol.toStringTag;class Qt extends Wt{constructor(t,e){super(),(0,K.Z)(this,"isSigned",void 0),(0,K.Z)(this,"bitWidth",void 0),this.isSigned=t,this.bitWidth=e}get typeId(){return zt.Int}get[Ut](){return"Int"}toString(){return"".concat(this.isSigned?"I":"Ui","nt").concat(this.bitWidth)}}class qt extends Qt{constructor(){super(!0,8)}}class Kt extends Qt{constructor(){super(!0,16)}}class Xt extends Qt{constructor(){super(!0,32)}}class Yt extends Qt{constructor(){super(!1,8)}}class $t extends Qt{constructor(){super(!1,16)}}class te extends Qt{constructor(){super(!1,32)}}const ee=32,ie=64;Nt=Symbol.toStringTag;class ne extends Wt{constructor(t){super(),(0,K.Z)(this,"precision",void 0),this.precision=t}get typeId(){return zt.Float}get[Nt](){return"Float"}toString(){return"Float".concat(this.precision)}}class re extends ne{constructor(){super(ee)}}class oe extends ne{constructor(){super(ie)}}Symbol.toStringTag;Symbol.toStringTag;Gt=Symbol.toStringTag;Zt=Symbol.toStringTag;jt=Symbol.toStringTag;Vt=Symbol.toStringTag;Ht=Symbol.toStringTag;class se extends Wt{constructor(t,e){super(),(0,K.Z)(this,"listSize",void 0),(0,K.Z)(this,"children",void 0),this.listSize=t,this.children=[e]}get typeId(){return zt.FixedSizeList}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get[Ht](){return"FixedSizeList"}toString(){return"FixedSizeList[".concat(this.listSize,"]<").concat(this.valueType,">")}}Jt=Symbol.toStringTag;function ae(t,e,i){const n=function(t){switch(t.constructor){case Int8Array:return new qt;case Uint8Array:return new Yt;case Int16Array:return new Kt;case Uint16Array:return new $t;case Int32Array:return new Xt;case Uint32Array:return new te;case Float32Array:return new re;case Float64Array:return new oe;default:throw new Error("array type not supported")}}(e.value),r=i||function(t){const e=new Map;"byteOffset"in t&&e.set("byteOffset",t.byteOffset.toString(10));"byteStride"in t&&e.set("byteStride",t.byteStride.toString(10));"normalized"in t&&e.set("normalized",t.normalized.toString());return e}(e);return new kt(t,new se(e.size,new kt("value",n)),!1,r)}class le{constructor(t,e){(0,K.Z)(this,"fields",void 0),(0,K.Z)(this,"metadata",void 0),function(t,e){if(!t)throw new Error(e||"loader assertion failed.")}(Array.isArray(t)),function(t){const e={};for(const i of t)e[i.name]&&console.warn("Schema: duplicated field name",i.name,i),e[i.name]=!0}(t),this.fields=t,this.metadata=e||new Map}compareTo(t){if(this.metadata!==t.metadata)return!1;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e<this.fields.length;++e)if(!this.fields[e].compareTo(t.fields[e]))return!1;return!0}select(){const t=Object.create(null);for(var e=arguments.length,i=new Array(e),n=0;n<e;n++)i[n]=arguments[n];for(const o of i)t[o]=!0;const r=this.fields.filter((e=>t[e.name]));return new le(r,this.metadata)}selectAt(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];const n=e.map((t=>
2this.fields[t])).filter(Boolean);return new le(n,this.metadata)}assign(t){let e,i=this.metadata;if(t instanceof le){const n=t;e=n.fields,i=ce(ce(new Map,this.metadata),n.metadata)}else e=t;const n=Object.create(null);for(const o of this.fields)n[o.name]=o;for(const o of e)n[o.name]=o;const r=Object.values(n);return new le(r,i)}}function ce(t,e){return new Map([...t||new Map,...e||new Map])}function ue(t,e,i){return ae(t,e,i?he(i.metadata):void 0)}function he(t){const e=new Map;for(const i in t)e.set("".concat(i,".string"),JSON.stringify(t[i]));return e}const de={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},pe={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array};class Ae{constructor(t){(0,K.Z)(this,"draco",void 0),(0,K.Z)(this,"decoder",void 0),(0,K.Z)(this,"metadataQuerier",void 0),this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new this.draco.DecoderBuffer;i.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(e);const n=this.decoder.GetEncodedGeometryType(i),r=n===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let t;switch(n){case this.draco.TRIANGULAR_MESH:t=this.decoder.DecodeBufferToMesh(i,r);break;case this.draco.POINT_CLOUD:t=this.decoder.DecodeBufferToPointCloud(i,r);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!t.ok()||!r.ptr){const e="DRACO decompression failed: ".concat(t.error_msg());throw new Error(e)}const o=this._getDracoLoaderData(r,n,e),s=this._getMeshData(r,o,e),a=function(t){let e=1/0,i=1/0,n=1/0,r=-1/0,o=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;c<l;c+=3){const t=a[c],l=a[c+1],u=a[c+2];e=t<e?t:e,i=l<i?l:i,n=u<n?u:n,r=t>r?t:r,o=l>o?l:o,s=u>s?u:s}return[[e,i,n],[r,o,s]]}(s.attributes),l=function(t,e,i){const n=he(e.metadata),r=[],o=function(t){const e={};for(const i in t){const n=t[i];e[n.name||"undefined"]=n}return e}(e.attributes);for(const s in t){const e=ue(s,t[s],o[s]);r.push(e)}if(i){const t=ue("indices",i);r.push(t)}return new le(r,n)}(s.attributes,o,s.indices);return{loader:"draco",loaderData:o,header:{vertexCount:r.num_points(),boundingBox:a},...s,schema:l}}finally{this.draco.destroy(i),r&&this.draco.destroy(r)}}_getDracoLoaderData(t,e,i){const n=this._getTopLevelMetadata(t),r=this._getDracoAttributes(t,i);return{geometry_type:e,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:n,attributes:r}}_getDracoAttributes(t,e){const i={};for(let n=0;n<t.num_attributes();n++){const r=this.decoder.GetAttribute(t,n),o=this._getAttributeMetadata(t,n);i[r.unique_id()]={unique_id:r.unique_id(),attribute_type:r.attribute_type(),data_type:r.data_type(),num_components:r.num_components(),byte_offset:r.byte_offset(),byte_stride:r.byte_stride(),normalized:r.normalized(),attribute_index:n,metadata:o};const s=this._getQuantizationTransform(r,e);s&&(i[r.unique_id()].quantization_transform=s);const a=this._getOctahedronTransform(r,e);a&&(i[r.unique_id()].octahedron_transform=a)}return i}_getMeshData(t,e,i){const n=this._getMeshAttributes(e,t,i);if(!n.POSITION)throw new Error("DRACO: No position attribute found.");return t instanceof this.draco.Mesh?"triangle-strip"===i.topology?{topology:"triangle-strip",mode:4,attributes:n,indices:{value:this._getTriangleStripIndices(t),size:1}}:{topology:"triangle-list",mode:5,attributes:n,indices:{value:this._getTriangleListIndices(t),size:1}}:{topology:"point-list",mode:0,attributes:n}}_getMeshAttributes(t,e,i){const n={};for(const r of Object.values(t.attributes)){const t=this._deduceAttributeName(r,i);r.name=t;const{value:o,size:s}=this._getAttributeValues(e,r);n[t]={value:o,size:s,byteOffset:r.byte_offset,byteStride:r.byte_stride,normalized:r.normalized}}return n}_getTriangleListIndices(t){const e=3*t.num_faces(),i=4*e,n=this.draco._malloc(i);try{return this.decoder.GetTrianglesUInt32Array(t,i,n),new Uint32Array(this.draco.HEAPF32.buffer,n,e).slice()}finally{this.draco._free(n)}}
2_getTriangleStripIndices(t){const e=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,e),function(t){const e=t.size(),i=new Int32Array(e);for(let n=0;n<e;n++)i[n]=t.GetValue(n);return i}(e)}finally{this.draco.destroy(e)}}_getAttributeValues(t,e){const i=pe[e.data_type],n=e.num_components,r=t.num_points()*n,o=r*i.BYTES_PER_ELEMENT,s=function(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}(this.draco,i);let a;const l=this.draco._malloc(o);try{const n=this.decoder.GetAttribute(t,e.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,n,s,o,l),a=new i(this.draco.HEAPF32.buffer,l,r).slice()}finally{this.draco._free(l)}return{value:a,size:n}}_deduceAttributeName(t,e){const i=t.unique_id;for(const[o,s]of Object.entries(e.extraAttributes||{}))if(s===i)return o;const n=t.attribute_type;for(const o in de){if(this.draco[o]===n)return de[o]}const r=e.attributeNameEntry||"name";return t.metadata[r]?t.metadata[r].string:"CUSTOM_ATTRIBUTE_".concat(i)}_getTopLevelMetadata(t){const e=this.decoder.GetMetadata(t);return this._getDracoMetadata(e)}_getAttributeMetadata(t,e){const i=this.decoder.GetAttributeMetadata(t,e);return this._getDracoMetadata(i)}_getDracoMetadata(t){if(!t||!t.ptr)return{};const e={},i=this.metadataQuerier.NumEntries(t);for(let n=0;n<i;n++){const i=this.metadataQuerier.GetEntryName(t,n);e[i]=this._getDracoMetadataField(t,i)}return e}_getDracoMetadataField(t,e){const i=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,e,i);const n=function(t){const e=t.size(),i=new Int32Array(e);for(let n=0;n<e;n++)i[n]=t.GetValue(n);return i}(i);return{int:this.metadataQuerier.GetIntEntry(t,e),string:this.metadataQuerier.GetStringEntry(t,e),double:this.metadataQuerier.GetDoubleEntry(t,e),intArray:n}}finally{this.draco.destroy(i)}}_disableAttributeTransforms(t){const{quantizedAttributes:e=[],octahedronAttributes:i=[]}=t,n=[...e,...i];for(const r of n)this.decoder.SkipAttributeTransform(this.draco[r])}_getQuantizationTransform(t,e){const{quantizedAttributes:i=[]}=e,n=t.attribute_type();if(i.map((t=>this.decoder[t])).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits(),range:e.range(),min_values:new Float32Array([1,2,3]).map((t=>e.min_value(t)))}}finally{this.draco.destroy(e)}}return null}_getOctahedronTransform(t,e){const{octahedronAttributes:i=[]}=e,n=t.attribute_type();if(i.map((t=>this.decoder[t])).includes(n)){const e=new this.draco.AttributeQuantizationTransform;try{if(e.InitFromAttribute(t))return{quantization_bits:e.quantization_bits()}}finally{this.draco.destroy(e)}}return null}}const fe="1.4.1",ge="https://www.gstatic.com/draco/versioned/decoders/".concat(fe,"/draco_decoder.js"),me="https://www.gstatic.com/draco/versioned/decoders/".concat(fe,"/draco_wasm_wrapper.js"),ye="https://www.gstatic.com/draco/versioned/decoders/".concat(fe,"/draco_decoder.wasm");"https://raw.githubusercontent.com/google/draco/".concat(fe,"/javascript/draco_encoder.js");let ve;async function _e(t){const e=t.modules||{};return ve=e.draco3d?ve||e.draco3d.createDecoderModule({}).then((t=>({draco:t}))):ve||async function(t){let e,i;if("js"===(t.draco&&t.draco.decoderType))e=await f(ge,"draco",t);else[e,i]=await Promise.all([await f(me,"draco",t),await f(ye,"draco",t)]);return e=e||globalThis.DracoDecoderModule,await function(t,e){const i={};e&&(i.wasmBinary=e);return new Promise((e=>{t({...i,onModuleLoaded:t=>e({draco:t})})}))}(e,i)}(t),await ve}u.jU;const be={...Rt,parse:async function(t,e){const{draco:i}=await _e(e),n=new Ae(i);try{return n.parseSync(t,null===e||void 0===e?void 0:e.draco)}finally{n.destroy()}}};function xe(t){const{buffer:e,size:i,count:n}=function(t){let e=t,i=1,n=0;t&&t.value&&(e=t.value,i=t.size||1);e&&(ArrayBuffer.isView(e)||(e=function(t,e){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!t)return null;if(Array.isArray(t))return new e(t);if(i&&!(t instanceof e))return new e(t);return t}(e,Float32Array)),n=e.length/i);return{buffer:e,size:i,count:n}}(t);return{value:e,size:i,byteOffset:0,count:n,type:at(i),componentType:lt(e)}}const we="KHR_draco_mesh_compression",Ce=we;function Be(t,e,i){const n=new ht(t);for(const r of Ie(n))n.getObjectExtension(r,we)}
2async function Ee(t,e,i){var n;if(null===e||void 0===e||null===(n=e.gltf)||void 0===n||!n.decompressMeshes)return;const r=new ht(t),o=[];for(const s of Ie(r))r.getObjectExtension(s,we)&&o.push(Te(r,s,e,i));await Promise.all(o),r.removeExtension(we)}function Se(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=new ht(t);for(const n of i.json.meshes||[])Me(n,e),i.addRequiredExtension(we)}async function Te(t,e,i,n){const r=t.getObjectExtension(e,we);if(!r)return;const o=t.getTypedArrayForBufferView(r.bufferView),s=J(o.buffer,o.byteOffset),{parse:a}=n,l={...i};delete l["3d-tiles"];const c=await a(s,be,l,n),u=function(t){const e={};for(const i in t){const n=t[i];if("indices"!==i){const t=xe(n);e[i]=t}}return e}(c.attributes);for(const[h,d]of Object.entries(u))if(h in e.attributes){const i=e.attributes[h],n=t.getAccessor(i);null!==n&&void 0!==n&&n.min&&null!==n&&void 0!==n&&n.max&&(d.min=n.min,d.max=n.max)}e.attributes=u,c.indices&&(e.indices=xe(c.indices)),function(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}(e)}function Me(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0;var o;if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const s=n.DracoWriter.encodeSync({attributes:t}),a=null===r||void 0===r||null===(o=r.parseSync)||void 0===o?void 0:o.call(r,{attributes:t}),l=n._addFauxAttributes(a.attributes),c=n.addBufferView(s);return{primitives:[{attributes:l,mode:i,extensions:{[we]:{bufferView:c,attributes:l}}}]}}function*Ie(t){for(const e of t.json.meshes||[])for(const t of e.primitives)yield t}const Pe="KHR_lights_punctual",De=Pe;async function Le(t){const e=new ht(t),{json:i}=e,n=e.getExtension(Pe);n&&(e.json.lights=n.lights,e.removeExtension(Pe));for(const r of i.nodes||[]){const t=e.getObjectExtension(r,Pe);t&&(r.light=t.light),e.removeObjectExtension(r,Pe)}}async function Oe(t){const e=new ht(t),{json:i}=e;if(i.lights){const t=e.addExtension(Pe);W(!t.lights),t.lights=i.lights,delete i.lights}if(e.json.lights){for(const t of e.json.lights){const i=t.node;e.addObjectExtension(i,Pe,t)}delete e.json.lights}}const Fe="KHR_materials_unlit",Re=Fe;async function ke(t){const e=new ht(t),{json:i}=e;e.removeExtension(Fe);for(const n of i.materials||[]){n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,Fe)}}function ze(t){const e=new ht(t),{json:i}=e;if(e.materials)for(const n of i.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,Fe,{}),e.addExtension(Fe))}const Ue="KHR_techniques_webgl",Ne=Ue;async function Ge(t){const e=new ht(t),{json:i}=e,n=e.getExtension(Ue);if(n){const t=function(t,e){const{programs:i=[],shaders:n=[],techniques:r=[]}=t,o=new TextDecoder;return n.forEach((t=>{if(!Number.isFinite(t.bufferView))throw new Error("KHR_techniques_webgl: no shader code");t.code=o.decode(e.getTypedArrayForBufferView(t.bufferView))})),i.forEach((t=>{t.fragmentShader=n[t.fragmentShader],t.vertexShader=n[t.vertexShader]})),r.forEach((t=>{t.program=i[t.program]})),r}(n,e);for(const n of i.materials||[]){const i=e.getObjectExtension(n,Ue);i&&(n.technique=Object.assign({},i,t[i.technique]),n.technique.values=je(n.technique,e)),e.removeObjectExtension(n,Ue)}e.removeExtension(Ue)}}async function Ze(t,e){}function je(t,e){const i=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach((e=>{t.uniforms[e].value&&!(e in i)&&(i[e]=t.uniforms[e].value)}
2)),Object.keys(i).forEach((t=>{"object"===typeof i[t]&&void 0!==i[t].index&&(i[t].texture=e.getTexture(i[t].index))})),i}const Ve=[n,r,o,s,a,l,c];function He(t,e){var i;const n=(null===e||void 0===e||null===(i=e.gltf)||void 0===i?void 0:i.excludeExtensions)||{};return!(t in n&&!n[t])}const Je="KHR_binary_glTF";const We={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Qe={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class qe{constructor(){(0,K.Z)(this,"idToIndexMap",{animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}),(0,K.Z)(this,"json",void 0)}normalize(t,e){this.json=t.json;const i=t.json;switch(i.asset&&i.asset.version){case"2.0":return;case void 0:case"1.0":break;default:return void console.warn("glTF: Unknown version ".concat(i.asset.version))}if(!e.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(i),this._convertTopLevelObjectsToArrays(i),function(t){const e=new ht(t),{json:i}=e;for(const n of i.images||[]){const t=e.getObjectExtension(n,Je);t&&Object.assign(n,t),e.removeObjectExtension(n,Je)}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,e.removeExtension(Je)}(t),this._convertObjectIdsToArrayIndices(i),this._updateObjects(i),this._updateMaterial(i)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(const e in We)this._convertTopLevelObjectToArray(t,e)}_convertTopLevelObjectToArray(t,e){const i=t[e];if(i&&!Array.isArray(i)){t[e]=[];for(const n in i){const r=i[n];r.id=r.id||n;const o=t[e].length;t[e].push(r),this.idToIndexMap[e][n]=o}}}_convertObjectIdsToArrayIndices(t){for(const e in We)this._convertIdsToIndices(t,e);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(const e of t.textures)this._convertTextureIds(e);for(const e of t.meshes)this._convertMeshIds(e);for(const e of t.nodes)this._convertNodeIds(e);for(const e of t.scenes)this._convertSceneIds(e)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(const e of t.primitives){const{attributes:t,indices:i,material:n}=e;for(const e in t)t[e]=this._convertIdToIndex(t[e],"accessor");i&&(e.indices=this._convertIdToIndex(i,"accessor")),n&&(e.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map((t=>this._convertIdToIndex(t,"node")))),t.meshes&&(t.meshes=t.meshes.map((t=>this._convertIdToIndex(t,"mesh"))))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map((t=>this._convertIdToIndex(t,"node"))))}_convertIdsToIndices(t,e){t[e]||(console.warn("gltf v1: json doesn't contain attribute ".concat(e)),t[e]=[]);for(const i of t[e])for(const t in i){const e=i[t],n=this._convertIdToIndex(e,t);i[t]=n}}_convertIdToIndex(t,e){const i=Qe[e];if(i in this.idToIndexMap){const n=this.idToIndexMap[i][t];if(!Number.isFinite(n))throw new Error("gltf v1: failed to resolve ".concat(e," with id ").concat(t));return n}return t}_updateObjects(t){for(const e of this.json.buffers)delete e.type}_updateMaterial(t){for(const r of t.materials){var e,i,n;r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const o=(null===(e=r.values)||void 0===e?void 0:e.tex)||(null===(i=r.values)||void 0===i?void 0:i.texture2d_0)||(null===(n=r.values)||void 0===n?void 0:n.diffuseTex),s=t.textures.findIndex((t=>t.id===o));-1!==s&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}}const Ke={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Xe={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ye=10240,$e=10241,ti=10242,ei=10243,ii=10497,ni={magFilter:Ye,minFilter:$e,wrapS:ti,wrapT:ei},ri={[Ye]:9729,[$e]:9986,[ti]:ii,[ei]:ii};class oi{constructor(){(0,K.Z)(this,"baseUri",""),(0,K.Z)(this,"json",{}),(0,K.Z)(this,"buffers",[]),(0,K.Z)(this,"images",[])}postProcess(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{json:i,buffers:n=[],images:r=[],baseUri:o=""}=t;return W(i),this.baseUri=o,this.json=i,this.buffers=n,this.images=r,this._resolveTree(this.json,e),this.json}_resolveTree(t){t.bufferViews&&(t.bufferViews=t.bufferViews.map(((t,e)=>this._resolveBufferView(t,e)))),t.images&&(t.images=t.images.map(((t,e)=>
2this._resolveImage(t,e)))),t.samplers&&(t.samplers=t.samplers.map(((t,e)=>this._resolveSampler(t,e)))),t.textures&&(t.textures=t.textures.map(((t,e)=>this._resolveTexture(t,e)))),t.accessors&&(t.accessors=t.accessors.map(((t,e)=>this._resolveAccessor(t,e)))),t.materials&&(t.materials=t.materials.map(((t,e)=>this._resolveMaterial(t,e)))),t.meshes&&(t.meshes=t.meshes.map(((t,e)=>this._resolveMesh(t,e)))),t.nodes&&(t.nodes=t.nodes.map(((t,e)=>this._resolveNode(t,e)))),t.skins&&(t.skins=t.skins.map(((t,e)=>this._resolveSkin(t,e)))),t.scenes&&(t.scenes=t.scenes.map(((t,e)=>this._resolveScene(t,e)))),void 0!==t.scene&&(t.scene=t.scenes[this.json.scene])}getScene(t){return this._get("scenes",t)}getNode(t){return this._get("nodes",t)}getSkin(t){return this._get("skins",t)}getMesh(t){return this._get("meshes",t)}getMaterial(t){return this._get("materials",t)}getAccessor(t){return this._get("accessors",t)}getCamera(t){return null}getTexture(t){return this._get("textures",t)}getSampler(t){return this._get("samplers",t)}getImage(t){return this._get("images",t)}getBufferView(t){return this._get("bufferViews",t)}getBuffer(t){return this._get("buffers",t)}_get(t,e){if("object"===typeof e)return e;const i=this.json[t]&&this.json[t][e];return i||console.warn("glTF file error: Could not find ".concat(t,"[").concat(e,"]")),i}_resolveScene(t,e){return t.id=t.id||"scene-".concat(e),t.nodes=(t.nodes||[]).map((t=>this.getNode(t))),t}_resolveNode(t,e){return t.id=t.id||"node-".concat(e),t.children&&(t.children=t.children.map((t=>this.getNode(t)))),void 0!==t.mesh?t.mesh=this.getMesh(t.mesh):void 0!==t.meshes&&t.meshes.length&&(t.mesh=t.meshes.reduce(((t,e)=>{const i=this.getMesh(e);return t.id=i.id,t.primitives=t.primitives.concat(i.primitives),t}),{primitives:[]})),void 0!==t.camera&&(t.camera=this.getCamera(t.camera)),void 0!==t.skin&&(t.skin=this.getSkin(t.skin)),t}_resolveSkin(t,e){return t.id=t.id||"skin-".concat(e),t.inverseBindMatrices=this.getAccessor(t.inverseBindMatrices),t}_resolveMesh(t,e){return t.id=t.id||"mesh-".concat(e),t.primitives&&(t.primitives=t.primitives.map((t=>{const e=(t={...t}).attributes;t.attributes={};for(const i in e)t.attributes[i]=this.getAccessor(e[i]);return void 0!==t.indices&&(t.indices=this.getAccessor(t.indices)),void 0!==t.material&&(t.material=this.getMaterial(t.material)),t}))),t}_resolveMaterial(t,e){if(t.id=t.id||"material-".concat(e),t.normalTexture&&(t.normalTexture={...t.normalTexture},t.normalTexture.texture=this.getTexture(t.normalTexture.index)),t.occlusionTexture&&(t.occlustionTexture={...t.occlustionTexture},t.occlusionTexture.texture=this.getTexture(t.occlusionTexture.index)),t.emissiveTexture&&(t.emmisiveTexture={...t.emmisiveTexture},t.emissiveTexture.texture=this.getTexture(t.emissiveTexture.index)),t.emissiveFactor||(t.emissiveFactor=t.emmisiveTexture?[1,1,1]:[0,0,0]),t.pbrMetallicRoughness){t.pbrMetallicRoughness={...t.pbrMetallicRoughness};const e=t.pbrMetallicRoughness;e.baseColorTexture&&(e.baseColorTexture={...e.baseColorTexture},e.baseColorTexture.texture=this.getTexture(e.baseColorTexture.index)),e.metallicRoughnessTexture&&(e.metallicRoughnessTexture={...e.metallicRoughnessTexture},e.metallicRoughnessTexture.texture=this.getTexture(e.metallicRoughnessTexture.index))}return t}_resolveAccessor(t,e){var i,n;if(t.id=t.id||"accessor-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView)),t.bytesPerComponent=(i=t.componentType,Xe[i]),t.components=(n=t.type,Ke[n]),t.bytesPerElement=t.bytesPerComponent*t.components,t.bufferView){const e=t.bufferView.buffer,{ArrayType:i,byteLength:n}=ct(t,t.bufferView),r=(t.bufferView.byteOffset||0)+(t.byteOffset||0)+e.byteOffset;let o=e.arrayBuffer.slice(r,r+n);t.bufferView.byteStride&&(o=this._getValueFromInterleavedBuffer(e,r,t.bufferView.byteStride,t.bytesPerElement,t.count)),t.value=new i(o)}return t}_getValueFromInterleavedBuffer(t,e,i,n,r){const o=new Uint8Array(r*n);for(let s=0;s<r;s++){const r=e+s*i;o.set(new Uint8Array(t.arrayBuffer.slice(r,r+n)),s*n)}return o.buffer}_resolveTexture(t,e){return t.id=t.id||"texture-".concat(e),t.sampler="sampler"in t?this.get
2Sampler(t.sampler):ri,t.source=this.getImage(t.source),t}_resolveSampler(t,e){t.id=t.id||"sampler-".concat(e),t.parameters={};for(const i in t){const e=this._enumSamplerParameter(i);void 0!==e&&(t.parameters[e]=t[i])}return t}_enumSamplerParameter(t){return ni[t]}_resolveImage(t,e){t.id=t.id||"image-".concat(e),void 0!==t.bufferView&&(t.bufferView=this.getBufferView(t.bufferView));const i=this.images[e];return i&&(t.image=i),t}_resolveBufferView(t,e){const i=t.buffer,n={id:"bufferView-".concat(e),...t,buffer:this.buffers[i]},r=this.buffers[i].arrayBuffer;let o=this.buffers[i].byteOffset||0;return"byteOffset"in t&&(o+=t.byteOffset),n.data=new Uint8Array(r,o,t.byteLength),n}_resolveCamera(t,e){return t.id=t.id||"camera-".concat(e),t.perspective,t.orthographic,t}}const si=1735152710,ai=12,li=8,ci=1313821514,ui=5130562,hi=0,di=1,pi=0,Ai=!0;function fi(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const r=new DataView(e),o=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"".concat(String.fromCharCode(t.getUint8(e+0))).concat(String.fromCharCode(t.getUint8(e+1))).concat(String.fromCharCode(t.getUint8(e+2))).concat(String.fromCharCode(t.getUint8(e+3)))}(r,i+0),s=r.getUint32(i+4,Ai),a=r.getUint32(i+8,Ai);switch(Object.assign(t,{header:{byteOffset:i,byteLength:a,hasBinChunk:!1},type:o,version:s,json:{},binChunks:[]}),i+=ai,t.version){case 1:return function(t,e,i){Y(t.header.byteLength>ai+li);const n=e.getUint32(i+0,Ai),r=e.getUint32(i+4,Ai);return i+=li,Y(r===pi),gi(t,e,i,n),i+=n,i+=mi(t,e,i,t.header.byteLength),i}(t,r,i);case 2:return function(t,e,i,n){return Y(t.header.byteLength>ai+li),function(t,e,i,n){for(;i+8<=t.header.byteLength;){const r=e.getUint32(i+0,Ai),o=e.getUint32(i+4,Ai);switch(i+=li,o){case ci:gi(t,e,i,r);break;case ui:mi(t,e,i,r);break;case hi:n.strict||gi(t,e,i,r);break;case di:n.strict||mi(t,e,i,r)}i+=$(r,4)}}(t,e,i,n),i+t.header.byteLength}(t,r,i,n={});default:throw new Error("Invalid GLB version ".concat(t.version,". Only supports v1 and v2."))}}function gi(t,e,i,n){const r=new Uint8Array(e.buffer,i,n),o=new TextDecoder("utf8").decode(r);return t.json=JSON.parse(o),$(n,4)}function mi(t,e,i,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:i,byteLength:n,arrayBuffer:e.buffer}),$(n,4)}async function yi(t,e){let i=arguments.length>3?arguments[3]:void 0,n=arguments.length>4?arguments[4]:void 0;var r,o,s,a;!function(t,e,i,n){n.uri&&(t.baseUri=n.uri);if(e instanceof ArrayBuffer&&!function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=new DataView(t),{magic:r=si}=i,o=n.getUint32(e,!1);return o===r||o===si}(e,i,n)){e=(new TextDecoder).decode(e)}if("string"===typeof e)t.json=H(e);else if(e instanceof ArrayBuffer){const r={};i=fi(r,e,i,n.glb),W("glTF"===r.type,"Invalid GLB magic string ".concat(r.type)),t._glb=r,t.json=r.json}else W(!1,"GLTF: must be ArrayBuffer or string");const r=t.json.buffers||[];if(t.buffers=new Array(r.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:e}=t._glb;t.buffers[0]={arrayBuffer:e[0].arrayBuffer,byteOffset:e[0].byteOffset,byteLength:e[0].byteLength}}const o=t.json.images||[];t.images=new Array(o.length).fill({})}(t,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(new qe).normalize(t,e)}(t,{normalize:null===i||void 0===i||null===(r=i.gltf)||void 0===r?void 0:r.normalize}),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=Ve.filter((t=>He(t.name,e)));for(const o of n){var r;null===(r=o.preprocess)||void 0===r||r.call(o,t,e,i)}}(t,i,n);const l=[];if(null!==i&&void 0!==i&&null!==(o=i.gltf)&&void 0!==o&&o.loadBuffers&&t.json.buffers&&await async function(t,e,i){const n=t.json.buffers||[];for(let s=0;s<n.length;++s){const a=n[s];if(a.uri){var r,o;const{fetch:n}=i;W(n);const l=Q(a.uri,e),c=await(null===i||void 0===i||null===(r=i.fetch)||void 0===r?void 0:r.call(i,l)),u=await(null===c||void 0===c||null===(o=c.arrayBuffer)||void 0===o?void 0:o.call(c));t.buffers[s]={arrayBuffer:u,byteOffset:0,byteLength:u.byteLength},delete a.uri}else null===t.buffers[s]&&(t.buffers[s]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}(t,i,n),null!==i&&void 0!==i&&null!==(s=i.gltf)&&void 0!==s&&s.loadImages){const e=async function(t,e,
2i){const n=function(t){const e=new Set,i=t.json.textures||[];for(const n of i)void 0!==n.source&&e.add(n.source);return Array.from(e).sort()}(t),r=t.json.images||[],o=[];for(const s of n)o.push(vi(t,r[s],s,e,i));return await Promise.all(o)}(t,i,n);l.push(e)}const c=async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;const n=Ve.filter((t=>He(t.name,e)));for(const o of n){var r;await(null===(r=o.decode)||void 0===r?void 0:r.call(o,t,e,i))}}(t,i,n);return l.push(c),await Promise.all(l),null!==i&&void 0!==i&&null!==(a=i.gltf)&&void 0!==a&&a.postProcess?function(t,e){return(new oi).postProcess(t,e)}(t,i):t}async function vi(t,e,i,n,r){const{fetch:o,parse:s}=r;let a;if(e.uri&&!e.hasOwnProperty("bufferView")){const t=Q(e.uri,n),i=await o(t);a=await i.arrayBuffer()}if(Number.isFinite(e.bufferView)){const i=q(t.json,t.buffers,e.bufferView);a=J(i.buffer,i.byteOffset,i.byteLength)}W(a,"glTF image has no data");let l=await s(a,[j.S,Z],{mimeType:e.mimeType,basis:n.basis||{format:N()}},r);l&&l[0]&&(l={compressed:!0,mipmaps:!1,width:l[0].width,height:l[0].height,data:l[0]}),t.images=t.images||[],t.images[i]=l}const _i={name:"glTF",id:"gltf",module:"gltf",version:"3.2.13",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=arguments.length>2?arguments[2]:void 0;e={..._i.options,...e},e.gltf={..._i.options.gltf,...e.gltf};const{byteOffset:n=0}=e;return await yi({},t,n,e,i)},options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0,postProcess:!0},log:console},deprecatedOptions:{fetchImages:"gltf.loadImages",createImages:"gltf.loadImages",decompress:"gltf.decompressMeshes",postProcess:"gltf.postProcess",gltf:{decompress:"gltf.decompressMeshes"}}}},21440:(t,e,i)=>{"use strict";i.d(e,{S:()=>x});function n(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var r=i(80285);const{_parseImageNode:o}=globalThis,s="undefined"!==typeof Image,a="undefined"!==typeof ImageBitmap,l=Boolean(o),c=!!r.jU||l;function u(t){const e=d(t);if(!e)throw new Error("Not an image");return e}function h(t){switch(u(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("getImageData");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0),i.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function d(t){return"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?"imagebitmap":"undefined"!==typeof Image&&t instanceof Image?"image":t&&"object"===typeof t&&t.data&&t.width&&t.height?"data":null}const p=/^data:image\/svg\+xml/,A=/\.svg((\?|#).*)?$/;function f(t){return t&&(p.test(t)||A.test(t))}function g(t,e){if(f(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function m(t,e,i){const n=function(t,e){if(f(e)){let e=(new TextDecoder).decode(t);try{"function"===typeof unescape&&"function"===typeof encodeURIComponent&&(e=unescape(encodeURIComponent(e)))}catch(i){throw new Error(i.message)}return"data:image/svg+xml;base64,".concat(btoa(e))}return g(t,e)}(t,i),r=self.URL||self.webkitURL,o="string"!==typeof n&&r.createObjectURL(n);try{return await async function(t,e){const i=new Image;if(i.src=t,e.image&&e.image.decode&&i.decode)return await i.decode(),i;return await new Promise(((e,n)=>{try{i.onload=()=>e(i),i.onerror=e=>n(new Error("Could not load image ".concat(t,": ").concat(e)))}catch(r){n(r)}}))}(o||n,e)}finally{o&&r.revokeObjectURL(o)}}const y={};let v=!0;async function _(t,e,i){let n;if(f(i)){n=await m(t,e,i)}else n=g(t,i);const r=e&&e.imagebitmap;return await async function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(t){for(const e in t||y)return!1;return!0}(e)&&v||(e=null);if(e)try{return await createImageBitmap(t,e)}catch(i){console.warn(i),v=!1}return await createImageBitmap(t)}(n,r)}var b=i(43835);const x={id:"image",module:"images",name:"Images",version:"3.2.13",mimeTypes:["image/png","image/jpeg","image/gif","
2image/webp","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],extensions:["png","jpg","jpeg","gif","webp","bmp","ico","svg"],parse:async function(t,e,i){const r=((e=e||{}).image||{}).type||"auto",{url:o}=i||{};let l;switch(function(t){switch(t){case"auto":case"data":return function(){if(a)return"imagebitmap";if(s)return"image";if(c)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}();default:return function(t){switch(t){case"auto":return a||s||c;case"imagebitmap":return a;case"image":return s;case"data":return c;default:throw new Error("@loaders.gl/images: image ".concat(t," not supported in this environment"))}}(t),t}}(r)){case"imagebitmap":l=await _(t,e,o);break;case"image":l=await m(t,e,o);break;case"data":l=await async function(t,e){const{mimeType:i}=(0,b.I)(t)||{},r=globalThis._parseImageNode;return n(r),await r(t,i)}(t);break;default:n(!1)}return"data"===r&&(l=h(l)),l},tests:[t=>Boolean((0,b.I)(new DataView(t)))],options:{image:{type:"auto",decode:!0}}}},43835:(t,e,i)=>{"use strict";i.d(e,{I:()=>o});const n=!1,r=!0;function o(t){const e=s(t);return function(t){const e=s(t),i=e.byteLength>=24&&2303741511===e.getUint32(0,n);if(!i)return null;return{mimeType:"image/png",width:e.getUint32(16,n),height:e.getUint32(20,n)}}(e)||function(t){const e=s(t),i=e.byteLength>=3&&65496===e.getUint16(0,n)&&255===e.getUint8(2);if(!i)return null;const{tableMarkers:r,sofMarkers:o}=function(){const t=new Set([65499,65476,65484,65501,65534]);for(let i=65504;i<65520;++i)t.add(i);const e=new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502]);return{tableMarkers:t,sofMarkers:e}}();let a=2;for(;a+9<e.byteLength;){const t=e.getUint16(a,n);if(o.has(t))return{mimeType:"image/jpeg",height:e.getUint16(a+5,n),width:e.getUint16(a+7,n)};if(!r.has(t))return null;a+=2,a+=e.getUint16(a,n)}return null}(e)||function(t){const e=s(t),i=e.byteLength>=10&&1195984440===e.getUint32(0,n);if(!i)return null;return{mimeType:"image/gif",width:e.getUint16(6,r),height:e.getUint16(8,r)}}(e)||function(t){const e=s(t),i=e.byteLength>=14&&16973===e.getUint16(0,n)&&e.getUint32(2,r)===e.byteLength;if(!i)return null;return{mimeType:"image/bmp",width:e.getUint32(18,r),height:e.getUint32(22,r)}}(e)}function s(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}},80285:(t,e,i)=>{"use strict";i.d(e,{jU:()=>n});"undefined"!==typeof self&&self,"undefined"!==typeof window&&window,"undefined"!==typeof i.g&&i.g,"undefined"!==typeof document&&document;const n=Boolean("object"!==typeof process||"[object process]"!==String(process)||process.browser),r="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);r&&parseFloat(r[1])},73599:(t,e,i)=>{"use strict";function n(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}i.d(e,{h:()=>n})},89596:(t,e,i)=>{"use strict";i.d(e,{CO:()=>r,hJ:()=>s,jU:()=>o,tq:()=>a});const n={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof i.g&&i.g,document:"undefined"!==typeof document&&document},r=n.global||n.self||n.window||{},o="object"!==typeof process||"[object process]"!==String(process)||process.browser,s="function"===typeof importScripts,a="undefined"!==typeof window&&"undefined"!==typeof window.orientation,l="undefined"!==typeof process&&process.version&&/v([0-9]*)/.exec(process.version);l&&parseFloat(l[1])},34819:(t,e,i)=>{"use strict";i.d(e,{Z:()=>u});var n=i(69296),r=i(79666);const o=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]),s=new Float32Array([-1,-1,1,1,-1,1,1,1,1,-1,1,1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1,-1,-1,1,-1,-1,1,1,1,1,1,1,1,-1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,-1,1,-1,-1,-1,-1,-1,1,-1,1,1,-1,1,-1]),a=new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,1,0,0,1,0,0,1,0,0,1,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0]),l=new Float32Array([0,0,1,0,1,1,0,1,1,0,1,1,0,1,0,0,0,1,0,0,1,0,1,1,1,1,0,1,0,0,1,0,1,0,1,1,0,1,0,0,0,0,1,0,1,1,0,1]),c={POSITION:{size:3,value:new Float32Array(s)},NORMAL:{size:3,value:new Float32Array(a)},TEXCOORD_0:{size:2,value:new Float32Array(l)}};class u extends n.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=(0,r.hQ)("cube-geometry")}=t;super({...t,id:e,indices:{size:1,value:new Uint16Array(o)},attributes:{...c,...t.attributes}})}}}
2,69296:(t,e,i)=>{"use strict";i.d(e,{Z:()=>s});var n=i(79666),r=i(81301);const o={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6};class s{static get DRAW_MODE(){return o}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{id:e=(0,n.hQ)("geometry"),drawMode:i=o.TRIANGLES,attributes:r={},indices:s=null,vertexCount:a=null}=t;this.id=e,this.drawMode=0|i,this.attributes={},this.userData={},this._setAttributes(r,s),this.vertexCount=a||this._calculateVertexCount(this.attributes,this.indices)}get mode(){return this.drawMode}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(t){return"Geometry ".concat(this.id," attribute ").concat(t)}_setAttributes(t,e){e&&(this.indices=ArrayBuffer.isView(e)?{value:e,size:1}:e);for(const i in t){let e=t[i];e=ArrayBuffer.isView(e)?{value:e}:e,(0,r.h)(ArrayBuffer.isView(e.value),"".concat(this._print(i),": must be typed array or object with value as typed array")),"POSITION"!==i&&"positions"!==i||e.size||(e.size=3),"indices"===i?((0,r.h)(!this.indices),this.indices=e):this.attributes[i]=e}return this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this}_calculateVertexCount(t,e){if(e)return e.value.length;let i=1/0;for(const n in t){const e=t[n],{value:r,size:o,constant:s}=e;!s&&r&&o>=1&&(i=Math.min(i,r.length/o))}return(0,r.h)(Number.isFinite(i)),i}}},94557:(t,e,i)=>{"use strict";i.d(e,{Z:()=>O});var n=i(28007),r=i(37330),o=i(79666),s=i(81301),a=i(97756),l=i(79817),c=i(77462),u=i(33839),h=i(35572);let d=null;function p(t,e){var i;return new t((i=t.BYTES_PER_ELEMENT*e,(!d||d.byteLength<i)&&(d=new ArrayBuffer(i)),d),0,e)}var A=i(93594);class f extends h.Z{get[Symbol.toStringTag](){return"VertexArrayObject"}static isSupported(t){return!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).constantAttributeZero||((0,n.D0)(t)||"Chrome"===(0,A.Z)())}static getDefaultArray(t){return t.luma=t.luma||{},t.luma.defaultVertexArray||(t.luma.defaultVertexArray=new f(t,{handle:null,isDefaultArray:!0})),t.luma.defaultVertexArray}static getMaxAttributes(t){return f.MAX_ATTRIBUTES=f.MAX_ATTRIBUTES||t.getParameter(34921),f.MAX_ATTRIBUTES}static setConstant(t,e,i){switch(i.constructor){case Float32Array:f._setConstantFloatArray(t,e,i);break;case Int32Array:f._setConstantIntArray(t,e,i);break;case Uint32Array:f._setConstantUintArray(t,e,i);break;default:(0,s.h)(!1)}}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e.id||e.program&&e.program.id;super(t,Object.assign({},e,{id:i})),this.buffer=null,this.bufferValue=null,this.isDefaultArray=e.isDefaultArray||!1,this.gl2=t,this.initialize(e),Object.seal(this)}delete(){return super.delete(),this.buffer&&this.buffer.delete(),this}get MAX_ATTRIBUTES(){return f.getMaxAttributes(this.gl)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.setProps(t)}setProps(t){return this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return(0,s.h)(!t||34963===t.target,"elements must be GL.ELEMENT_ARRAY_BUFFER"),this.bind((()=>{this.gl.bindBuffer(34963,t?t.handle:null)})),this}setBuffer(t,e,i){if(34963===e.target)return this.setElementBuffer(e,i);const{size:r,type:o,stride:a,offset:l,normalized:c,integer:u,divisor:h}=i,{gl:d,gl2:p}=this;return t=Number(t),this.bind((()=>{d.bindBuffer(34962,e.handle),u?((0,s.h)((0,n.D0)(d)),p.vertexAttribIPointer(t,r,o,a,l)):d.vertexAttribPointer(t,r,o,c,a,l),d.enableVertexAttribArray(t),p.vertexAttribDivisor(t,h||0)})),this}enable(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return!e&&0===t&&!f.isSupported(this.gl,{constantAttributeZero:!0})||(t=Number(t),this.bind((()=>e?this.gl.enableVertexAttribArray(t):this.gl.disableVertexAttribArray(t)))),this}getConstantBuffer(t,e){const i=this._normalizeConstantArrayValue(e),n=i.byteLength*t,r=i.length*t;let o=!this.buffer;if(this.buffer=this.buffer||new u.Z(this.gl,n),o=o||this.buffer.reallocate(n),o=o||!this._compareConstantArrayValues(i,this.bufferValue),o){const t=p(e.constructor,r);!function(t){let{target:e,source:i,start:n=0,count:r=1}=t;const o=i.length,s=r*o;let a=0;for(let l=n;a<o;a++)e[l++]=i[a];for(;a<s;)a<s-a?(e.copyWithin(n+a,n,n+a),a*=2):(e.copyWithin(n+a,n,n+s-a),a=s)}({target:t,source:i,start:0,count:r}),this.buffer.subData(t),this.bufferValue=e}return this.buffer}_normalizeConstantArrayValue(t){return Array.isArray(t)?new Float32Array(t):t}_compareConstantArrayValues(t,e){if(!t||!e||t.length!==e.length||t.constructor!==e.constructor)return!1;for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}static _setConstantFloatArray(t,e,i){switch(i.length){case 1:t.vertexAttrib1fv(e,i);break;case 2:t.vertexAttrib2fv(e,i);break;case 3:t.vertexAttrib3fv(e,i);break;case 4:t.vertexAttrib4fv(e,i);break;default:(0,s.h)(!1)}}static _setConstantIntArray(t,e,i){switch((0,s.h)((0,n.D0)(t)),i.length){case 1:t.vertexAttribI1iv(e,i);break;case 2:t.vertexAttribI2iv(e,i);break;case 3:t.vertexAttribI3iv(e,i);break;case 4:t.vertexAttribI4iv(e,i);break;default:(0,s.h)(!1)}}static _setConstantUintArray(t,e,i){switch((0,s.h)((0,n.D0)(t)),i.length){case 1:t.vertexAttribI1uiv(e,i);break;case 2:t.vertexAttribI2uiv(e,i);break;case 3:t.vertexAttribI3uiv(e,i);break;case 4:t.vertexAttribI4uiv(e,i);break;default:(0,s.h)(!1)}}_createHandle(){return this.gl.createVertexArray()}_deleteHandle(t){return this.gl2.deleteVertexArray(t),[this.elements]}_bindHandle(t){this.gl2.bindVertexArray(t)}_getParameter(t,e){let{location:i}=e;return(0,s.h)(Number.isFinite(i)),this.bind((()=>34373===t?this.gl.getVertexAttribOffset(i,t):this.gl.getVertexAttrib(i,t)))}}var g=i(69221);const m=/^(.+)__LOCATION_([0-9]+)$/,y=["setBuffers","setGeneric","clearBindings","setLocations","setGenericValues","setDivisor","enable","disable"];class v{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=e.id||e.program&&e.program.id;this.id=i,this.gl=t,this.configuration=null,this.elements=null,this.elementsAccessor=null,this.values=null,this.accessors=null,this.unused=null,this.drawParams=null,this.buffer=null,this.attributes={}
2,this.vertexArrayObject=new f(t),(0,g.F)(this,"VertexArray","v6.0",y),this.initialize(e),Object.seal(this)}delete(){this.buffer&&this.buffer.delete(),this.vertexArrayObject.delete()}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.reset(),this.configuration=null,this.bindOnUse=!1,this.setProps(t)}reset(){this.elements=null,this.elementsAccessor=null;const{MAX_ATTRIBUTES:t}=this.vertexArrayObject;return this.values=new Array(t).fill(null),this.accessors=new Array(t).fill(null),this.unused={},this.drawParams=null,this}setProps(t){return"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"attributes"in t&&this.setAttributes(t.attributes),"elements"in t&&this.setElementBuffer(t.elements),"bindOnUse"in t&&(t=t.bindOnUse),this}clearDrawParams(){this.drawParams=null}getDrawParams(){return this.drawParams=this.drawParams||this._updateDrawParams(),this.drawParams}setAttributes(t){return Object.assign(this.attributes,t),this.vertexArrayObject.bind((()=>{for(const e in t){const i=t[e];this._setAttribute(e,i)}this.gl.bindBuffer(34962,null)})),this}setElementBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.elements=t,this.elementsAccessor=e,this.clearDrawParams(),this.vertexArrayObject.setElementBuffer(t,e),this}setBuffer(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(34963===e.target)return this.setElementBuffer(e,i);const{location:n,accessor:r}=this._resolveLocationAndAccessor(t,e,e.accessor,i);return n>=0&&(this.values[n]=e,this.accessors[n]=r,this.clearDrawParams(),this.vertexArrayObject.setBuffer(n,e,r)),this}setConstant(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{location:n,accessor:r}=this._resolveLocationAndAccessor(t,e,Object.assign({size:e.length},i));return n>=0&&(e=this.vertexArrayObject._normalizeConstantArrayValue(e),this.values[n]=e,this.accessors[n]=r,this.clearDrawParams(),this.vertexArrayObject.enable(n,!1)),this}unbindBuffers(){return this.vertexArrayObject.bind((()=>{this.elements&&this.vertexArrayObject.setElementBuffer(null),this.buffer=this.buffer||new u.Z(this.gl,{accessor:{size:4}});for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++)this.values[t]instanceof u.Z&&(this.gl.disableVertexAttribArray(t),this.gl.bindBuffer(34962,this.buffer.handle),this.gl.vertexAttribPointer(t,1,5126,!1,0,0))})),this}bindBuffers(){return this.vertexArrayObject.bind((()=>{this.elements&&this.setElementBuffer(this.elements);for(let t=0;t<this.vertexArrayObject.MAX_ATTRIBUTES;t++){const e=this.values[t];e instanceof u.Z&&this.setBuffer(t,e)}})),this}bindForDraw(t,e,i){let n;return this.vertexArrayObject.bind((()=>{this._setConstantAttributes(t,e),n=i()})),n}_resolveLocationAndAccessor(t,e,i,r){const o={location:-1,accessor:null},{location:a,name:l}=this._getAttributeIndex(t);if(!Number.isFinite(a)||a<0)return this.unused[t]=e,n.cM.once(3,(()=>"unused value ".concat(t," in ").concat(this.id)))(),o;const u=this._getAttributeInfo(l||a);if(!u)return o;const h=this.accessors[a]||{},d=c.Z.resolve(u.accessor,h,i,r),{size:p,type:A}=d;return(0,s.h)(Number.isFinite(p)&&Number.isFinite(A)),{location:a,accessor:d}}_getAttributeInfo(t){return this.configuration&&this.configuration.getAttributeInfo(t)}_getAttributeIndex(t){const e=Number(t);if(Number.isFinite(e))return{location:e};const i=m.exec(t),n=i?i[1]:t,r=i?Number(i[2]):0;return this.configuration?{location:this.configuration.getAttributeLocation(n)+r,name:n}:{location:-1}}_setAttribute(t,e){if(e instanceof u.Z)this.setBuffer(t,e);else if(Array.isArray(e)&&e.length&&e[0]instanceof u.Z){const i=e[0],n=e[1];this.setBuffer(t,i,n)}else if(ArrayBuffer.isView(e)||Array.isArray(e)){const i=e;this.setConstant(t,i)}else{if(!(e.buffer instanceof u.Z))throw new Error("VertexArray: attributes must be Buffers or constants (i.e. typed array)");{const i=e;this.setBuffer(t,i.buffer,i)}}}_setConstantAttributes(t,e){const i=Math.max(0|t,0|e);let n=this.values[0];ArrayBuffer.isView(n)&&this._setConstantAttributeZero(n,i);for(let r=1;r<this.vertexArrayObject.MAX_ATTRIBUTES;r++)n=this.values[r],ArrayBuffer.isView(n)&&this._setConstantAttribute(r,n)}_setConstantAttributeZero(t,e){if(f.isSupported(this.gl,{constantAttributeZero:!0}))return void this._setConstantAttribute(0,t);const i=this.vertexArrayObject.getConstantBuffer(e,t);
2this.vertexArrayObject.setBuffer(0,i,this.accessors[0])}_setConstantAttribute(t,e){f.setConstant(this.gl,t,e)}_updateDrawParams(){const t={isIndexed:!1,isInstanced:!1,indexCount:1/0,vertexCount:1/0,instanceCount:1/0};for(let e=0;e<this.vertexArrayObject.MAX_ATTRIBUTES;e++)this._updateDrawParamsForLocation(t,e);return this.elements&&(t.elementCount=this.elements.getElementCount(this.elements.accessor),t.isIndexed=!0,t.indexType=this.elementsAccessor.type||this.elements.accessor.type,t.indexOffset=this.elementsAccessor.offset||0),t.indexCount===1/0&&(t.indexCount=0),t.vertexCount===1/0&&(t.vertexCount=0),t.instanceCount===1/0&&(t.instanceCount=0),t}_updateDrawParamsForLocation(t,e){const i=this.values[e],n=this.accessors[e];if(!i)return;const{divisor:r}=n,o=r>0;if(t.isInstanced=t.isInstanced||o,i instanceof u.Z){const e=i;if(o){const i=e.getVertexCount(n);t.instanceCount=Math.min(t.instanceCount,i)}else{const i=e.getVertexCount(n);t.vertexCount=Math.min(t.vertexCount,i)}}}setElements(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return n.cM.deprecated("setElements","setElementBuffer")(),this.setElementBuffer(t,e)}}var _=i(54345),b=i(55888),x=i(83951);function w(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{isInteger:i=!1}=e;if(Array.isArray(t)||ArrayBuffer.isView(t))return function(t,e){const{maxElts:i=16,size:n=1}=e;let r="[";for(let s=0;s<t.length&&s<i;++s)s>0&&(r+=",".concat(s%n===0?" ":"")),r+=w(t[s],e);const o=t.length>i?"...":"]";return"".concat(r).concat(o)}(t,e);if(!Number.isFinite(t))return String(t);if(Math.abs(t)<1e-16)return i?"0":"0.";if(i)return t.toFixed(0);if(Math.abs(t)>100&&Math.abs(t)<1e4)return t.toFixed(0);const n=t.toPrecision(2);return n.indexOf(".0")===n.length-2?n.slice(0,-1):n}function C(t,e,i,n){const{gl:r}=t;if(!e)return{[n]:"null","Format ":"N/A"};let o,s,a,l="NOT PROVIDED",c=1,h=0,d=0;if(i&&(l=i.type,c=i.size,l=String(l).replace("Array",""),o=-1!==l.indexOf("nt")),e instanceof u.Z){const t=e,{data:u,changed:p}=t.getDebugData();let A;if(s=p?"*":"",a=u,d=t.byteLength,h=d/u.BYTES_PER_ELEMENT/c,i){const t=i.divisor>0;A="".concat(t?"I ":"P "," ").concat(h," (x").concat(c,"=").concat(d," bytes ").concat((0,b.km)(r,l),")")}else o=!0,A="".concat(d," bytes");return{[n]:"".concat(s).concat(w(a,{size:c,isInteger:o})),"Format ":A}}return a=e,c=e.length,l=String(e.constructor.name).replace("Array",""),o=-1!==l.indexOf("nt"),{[n]:"".concat(w(a,{size:c,isInteger:o})," (constant)"),"Format ":"".concat(c,"x").concat(l," (constant)")}}function B(t,e){const{type:i,size:n}=e,r=(0,x.jG)(i,n);return r?"".concat(t," (").concat(r.name,")"):t}function E(t){let{header:e="Uniforms",program:i,uniforms:n,undefinedOnly:r=!1}=t;(0,s.h)(i);const o=".*Matrix",a=i._uniformSetters,l={},c=Object.keys(a).sort();let u=0;for(const s of c)s.match(".*_.*")||s.match(o)||S({table:l,header:e,uniforms:n,uniformName:s,undefinedOnly:r})&&u++;for(const s of c)s.match(o)&&S({table:l,header:e,uniforms:n,uniformName:s,undefinedOnly:r})&&u++;for(const s of c)l[s]||S({table:l,header:e,uniforms:n,uniformName:s,undefinedOnly:r})&&u++;let h=0;const d={};if(!r)for(const s in n){const t=n[s];l[s]||(h++,d[s]={Type:"NOT USED: ".concat(t),[e]:w(t)})}return{table:l,count:u,unusedTable:d,unusedCount:h}}function S(t){let{table:e,header:i,uniforms:n,uniformName:r,undefinedOnly:o}=t;const s=n[r],a=function(t){return void 0!==t&&null!==t}(s);return(!o||!a)&&(e[r]={[i]:a?w(s):"N/A","Uniform Type":a?s:"NOT PROVIDED"},!0)}function T(t){const{type:e,size:i}=t.accessor,n=(0,x.jG)(e,i);return n?"".concat(n.name," ").concat(t.name):t.name}const M={POSITION:"positions",NORMAL:"normals",COLOR_0:"colors",TEXCOORD_0:"texCoords",TEXCOORD_1:"texCoords1",TEXCOORD_2:"texCoords2"};function I(t,e){const{attributeMap:i=M}=e||{};return i&&i[t]||t}function P(t,e){let i;switch(t){case"texCoords":case"texCoord1":case"texCoord2":case"texCoord3":i="uvs";break;case"vertices":case"positions":case"normals":case"pickingColors":i="vectors"}switch(i){case"vectors":e.size=e.size||3;break;case"uvs":e.size=e.size||2}(0,s.h)(Number.isFinite(e.size),"attribute ".concat(t," needs size"))}const D=()=>{},L={};class O{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{id:i=(0,o.hQ)("model")}=e;
2(0,s.h)((0,n.UF)(t)),this.id=i,this.gl=t,this.id=e.id||(0,o.hQ)("Model"),this.lastLogTime=0,this.animated=!1,this.initialize(e)}initialize(t){this.props={},this.programManager=t.programManager||r.Z.getDefaultProgramManager(this.gl),this._programManagerState=-1,this._managedProgram=!1;const{program:e=null,vs:i,fs:n,modules:o,defines:a,inject:l,varyings:c,bufferMode:u,transpileToGLSL100:h}=t;this.programProps={program:e,vs:i,fs:n,modules:o,defines:a,inject:l,varyings:c,bufferMode:u,transpileToGLSL100:h},this.program=null,this.vertexArray=null,this._programDirty=!0,this.userData={},this.needsRedraw=!0,this._attributes={},this.attributes={},this.uniforms={},this.pickable=!0,this._checkProgram(),this.setUniforms(Object.assign({},this.getModuleUniforms(t.moduleSettings))),this.drawMode=void 0!==t.drawMode?t.drawMode:4,this.vertexCount=t.vertexCount||0,this.geometryBuffers={},this.isInstanced=t.isInstanced||t.instanced||t.instanceCount>0,this._setModelProps(t),this.geometry={},(0,s.h)(void 0!==this.drawMode&&Number.isFinite(this.vertexCount),"Model needs drawMode and vertexCount")}setProps(t){this._setModelProps(t)}delete(){for(const t in this._attributes)this._attributes[t]!==this.attributes[t]&&this._attributes[t].delete();this._managedProgram&&(this.programManager.release(this.program),this._managedProgram=!1),this.vertexArray.delete(),this._deleteGeometryBuffers()}getDrawMode(){return this.drawMode}getVertexCount(){return this.vertexCount}getInstanceCount(){return this.instanceCount}getAttributes(){return this.attributes}getProgram(){return this.program}setProgram(t){const{program:e,vs:i,fs:n,modules:r,defines:o,inject:s,varyings:a,bufferMode:l,transpileToGLSL100:c}=t;this.programProps={program:e,vs:i,fs:n,modules:r,defines:o,inject:s,varyings:a,bufferMode:l,transpileToGLSL100:c},this._programDirty=!0}getUniforms(){return this.uniforms}setDrawMode(t){return this.drawMode=t,this}setVertexCount(t){return(0,s.h)(Number.isFinite(t)),this.vertexCount=t,this}setInstanceCount(t){return(0,s.h)(Number.isFinite(t)),this.instanceCount=t,this}setGeometry(t){return this.drawMode=t.drawMode,this.vertexCount=t.getVertexCount(),this._deleteGeometryBuffers(),this.geometryBuffers=function(t,e,i){const n={};let r=e.indices;for(const o in e.attributes){const s=e.attributes[o],a=I(o,i);if("indices"===o)r=s;else if(s.constant)n[a]=s.value;else{const e=s.value,i={...s};delete i.value,n[a]=[new u.Z(t,e),i],P(o,i)}}if(r){const e=r.value||r;(0,s.h)(e instanceof Uint16Array||e instanceof Uint32Array,'attribute array for "indices" must be of integer type');const i={size:1,isIndexed:void 0===r.isIndexed||r.isIndexed};n.indices=[new u.Z(t,{data:e,target:34963}),i]}return n}(this.gl,t),this.vertexArray.setAttributes(this.geometryBuffers),this}setAttributes(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,o.nK)(t))return this;const e={};for(const i in t){const n=t[i];e[i]=n.getValue?n.getValue():n}return this.vertexArray.setAttributes(e),this}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign(this.uniforms,t),this}getModuleUniforms(t){this._checkProgram();const e=this.programManager.getUniforms(this.program);return e?e(t):{}}updateModuleSettings(t){const e=this.getModuleUniforms(t||{});return this.setUniforms(e)}clear(t){return(0,a.Z)(this.program.gl,t),this}draw(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._checkProgram();const{moduleSettings:e=null,framebuffer:i,uniforms:r={},attributes:o={},transformFeedback:s=this.transformFeedback,parameters:a={},vertexArray:l=this.vertexArray}=t;let c;this.setAttributes(o),this.updateModuleSettings(e),this.setUniforms(r),n.cM.priority>=2&&(c=this._logDrawCallStart(2));const u=this.vertexArray.getDrawParams(),{isIndexed:h=u.isIndexed,indexType:d=u.indexType,indexOffset:p=u.indexOffset,vertexArrayInstanced:A=u.isInstanced}=this.props;A&&!this.isInstanced&&n.cM.warn("Found instanced attributes on non-instanced model",this.id)();const{isInstanced:f,instanceCount:g}=this,{onBeforeRender:m=D,onAfterRender:y=D}=this.props;m(),this.program.setUniforms(this.uniforms);const v=this.program.draw(Object.assign(L,t,{logPriority:c,uniforms:null,framebuffer:i,parameters:a,drawMode:this.getDrawMode(),vertexCount:this.getVertexCount(),vertexArray:l,transformFeedback:s,isIndexed:h,indexType:d,isInstanced:f,instanceCount:g,offset:h?p:0}));return y(),n.cM.priority>=2&&this._logDrawCallEnd(c,l,i),v}transform(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{discard:e=!0,feedbackBuffers:i,unbindModels:n=[]}=t;let{parameters:r}=t;i&&this._setFeedbackBuffers(i),e&&(r=Object.assign({},r,{35977:e}
2)),n.forEach((t=>t.vertexArray.unbindBuffers()));try{this.draw(Object.assign({},t,{parameters:r}))}finally{n.forEach((t=>t.vertexArray.bindBuffers()))}return this}render(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n.cM.warn("Model.render() is deprecated. Use Model.setUniforms() and Model.draw()")(),this.setUniforms(t).draw()}_setModelProps(t){Object.assign(this.props,t),"uniforms"in t&&this.setUniforms(t.uniforms),"pickable"in t&&(this.pickable=t.pickable),"instanceCount"in t&&(this.instanceCount=t.instanceCount),"geometry"in t&&this.setGeometry(t.geometry),"attributes"in t&&this.setAttributes(t.attributes),"_feedbackBuffers"in t&&this._setFeedbackBuffers(t._feedbackBuffers)}_checkProgram(){if(!(this._programDirty||this.programManager.stateHash!==this._programManagerState))return;let{program:t}=this.programProps;if(t)this._managedProgram=!1;else{const{vs:e,fs:i,modules:n,inject:r,defines:o,varyings:s,bufferMode:a,transpileToGLSL100:l}=this.programProps;t=this.programManager.get({vs:e,fs:i,modules:n,inject:r,defines:o,varyings:s,bufferMode:a,transpileToGLSL100:l}),this.program&&this._managedProgram&&this.programManager.release(this.program),this._programManagerState=this.programManager.stateHash,this._managedProgram=!0}(0,s.h)(t instanceof l.Z,"Model needs a program"),this._programDirty=!1,t!==this.program&&(this.program=t,this.vertexArray?this.vertexArray.setProps({program:this.program,attributes:this.vertexArray.attributes}):this.vertexArray=new v(this.gl,{program:this.program}),this.setUniforms(Object.assign({},this.getModuleUniforms())))}_deleteGeometryBuffers(){for(const t in this.geometryBuffers){const e=this.geometryBuffers[t][0]||this.geometryBuffers[t];e instanceof u.Z&&e.delete()}}_setAnimationProps(t){this.animated&&(0,s.h)(t,"Model.draw(): animated uniforms but no animationProps")}_setFeedbackBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if((0,o.nK)(t))return this;const{gl:e}=this.program;return this.transformFeedback=this.transformFeedback||new _.Z(e,{program:this.program}),this.transformFeedback.setBuffers(t),this}_logDrawCallStart(t){const e=t>3?0:1e4;if(!(Date.now()-this.lastLogTime<e))return this.lastLogTime=Date.now(),n.cM.group(2,">>> DRAWING MODEL ".concat(this.id),{collapsed:n.cM.level<=2})(),t}_logDrawCallEnd(t,e,i,r){if(void 0===t)return;const o=function(t){let{vertexArray:e,header:i="Attributes"}=t;if(!e.configuration)return{};const n={};e.elements&&(n.ELEMENT_ARRAY_BUFFER=C(e,e.elements,null,i));const r=e.values;for(const o in r){const t=e._getAttributeInfo(o);if(t){let s="".concat(o,": ").concat(t.name);const a=e.accessors[t.location];a&&(s="".concat(o,": ").concat(B(t.name,a))),n[s]=C(e,r[o],a,i)}}return n}({vertexArray:e,header:"".concat(this.id," attributes"),attributes:this._attributes}),{table:s,unusedTable:a,unusedCount:l}=E({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,i)}),{table:c,count:u}=E({header:"".concat(this.id," uniforms"),program:this.program,uniforms:Object.assign({},this.program.uniforms,i),undefinedOnly:!0});u>0&&n.cM.log("MISSING UNIFORMS",Object.keys(c))(),l>0&&n.cM.log("UNUSED UNIFORMS",Object.keys(a))();const h=function(t){const e={},i="Accessors for ".concat(t.id);for(const n of t.attributeInfos)if(n){const t=T(n);e["in ".concat(t)]={[i]:JSON.stringify(n.accessor)}}for(const n of t.varyingInfos)if(n){const t=T(n);e["out ".concat(t)]={[i]:JSON.stringify(n.accessor)}}return e}(this.vertexArray.configuration);n.cM.table(t,o)(),n.cM.table(t,s)(),n.cM.table(t+1,h)(),r&&r.log({logLevel:2,message:"Rendered to ".concat(r.id)}),n.cM.groupEnd(2)()}}}
2,37330:(t,e,i)=>{"use strict";i.d(e,{Z:()=>j});var n=i(5740),r=i(17865);const o={number:{validate:(t,e)=>Number.isFinite(t)&&(!("max"in e)||t<=e.max)&&(!("min"in e)||t>=e.min)},array:{validate:(t,e)=>Array.isArray(t)||ArrayBuffer.isView(t)}};function s(t){let e=a(t);return"object"===e?t?"type"in t?Object.assign({},t,o[t.type]):"value"in t?(e=a(t.value),Object.assign({type:e},t,o[e])):{type:"object",value:t}:{type:"object",value:null}:Object.assign({type:e,value:t},o[e])}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)?"array":typeof t}class l{constructor(t){let{name:e,vs:i,fs:n,dependencies:o=[],uniforms:a,getUniforms:l,deprecations:c=[],defines:u={},inject:h={},vertexShader:d,fragmentShader:p}=t;(0,r.Z)("string"===typeof e),this.name=e,this.vs=i||d,this.fs=n||p,this.getModuleUniforms=l,this.dependencies=o,this.deprecations=this._parseDeprecationDefinitions(c),this.defines=u,this.injections=function(t){const e={vs:{},fs:{}};for(const i in t){let n=t[i];"string"===typeof n&&(n={order:0,injection:n}),e[i.slice(0,2)][i]=n}return e}(h),a&&(this.uniforms=function(t){const e={};for(const i in t){const n=s(t[i]);e[i]=n}return e}(a))}getModuleSource(t){let e;switch(t){case"vs":e=this.vs||"";break;case"fs":e=this.fs||"";break;default:(0,r.Z)(!1)}return"#define MODULE_".concat(this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_"),"\n").concat(e,"// END MODULE_").concat(this.name,"\n\n")}getUniforms(t,e){return this.getModuleUniforms?this.getModuleUniforms(t,e):this.uniforms?this._defaultGetUniforms(t):{}}getDefines(){return this.defines}checkDeprecations(t,e){this.deprecations.forEach((i=>{i.regex.test(t)&&(i.deprecated?e.deprecated(i.old,i.new)():e.removed(i.old,i.new)())}))}_parseDeprecationDefinitions(t){return t.forEach((t=>{if("function"===t.type)t.regex=new RegExp("\\b".concat(t.old,"\\("));else t.regex=new RegExp("".concat(t.type," ").concat(t.old,";"))})),t}_defaultGetUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e={},i=this.uniforms;for(const n in i){const o=i[n];n in t&&!o.private?(o.validate&&(0,r.Z)(o.validate(t[n],o),"".concat(this.name,": invalid ").concat(n)),e[n]=t[n]):e[n]=o.value}return e}}function c(t){return u(d(t))}function u(t){const e={},i={};return h({modules:t,level:0,moduleMap:e,moduleDepth:i}),Object.keys(i).sort(((t,e)=>i[e]-i[t])).map((t=>e[t]))}function h(t){let{modules:e,level:i,moduleMap:n,moduleDepth:r}=t;if(i>=5)throw new Error("Possible loop in shader dependency graph");for(const o of e)n[o.name]=o,(void 0===r[o.name]||r[o.name]<i)&&(r[o.name]=i);for(const o of e)o.dependencies&&h({modules:o.dependencies,level:i+1,moduleMap:n,moduleDepth:r})}function d(t,e){return t.map((t=>(t instanceof l||((0,r.Z)("string"!==typeof t,"Shader module use by name is deprecated. Import shader module '".concat(t,"' and use it directly.")),(0,r.Z)(t.name,"shader module has no name"),(t=new l(t)).dependencies=d(t.dependencies)),t)))}const p=7936,A=7937,f=7938,g=35724,m={GLSL_FRAG_DATA:["WEBGL_draw_buffers",!0],GLSL_FRAG_DEPTH:["EXT_frag_depth",!0],GLSL_DERIVATIVES:["OES_standard_derivatives",!0],GLSL_TEXTURE_LOD:["EXT_shader_texture_lod",!0]},y={};Object.keys(m).forEach((t=>{y[t]=t}));const v={};function _(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=m[e];if((0,r.Z)(n,e),!function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e="undefined"!==typeof window&&window.navigator||{},i=t.userAgent||e.userAgent||"",n=-1!==i.indexOf("MSIE "),r=-1!==i.indexOf("Trident/");return n||r}(i))return!0;if(e in v)return v[e];const o=n[0],s=i.behavior||"enable",a="#extension GL_".concat(o," : ").concat(s,"\nvoid main(void) {}"),l=t.createShader(35633);t.shaderSource(l,a),t.compileShader(l);const c=t.getShaderParameter(l,35713);return t.deleteShader(l),v[e]=c,c}function b(t,e){const i=m[e];(0,r.Z)(i,e);const n=function(t){return"undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}(t)&&i[1]||i[0],o="string"===typeof n?Boolean(t.getExtension(n)):n;return(0,r.Z)(!1===o||!0===o),o}function x(t,e){return(e=Array.isArray(e)?e:[e]).every((e=>b(t,e)))}function w(t){const e=function(t){const e=t.getExtension("WEBGL_debug_renderer_info"),i=t.getParameter(e&&e.UNMASKED_VENDOR_WEBGL||p),n=t.getParameter(e&&e.UNMASKED_RENDERER_WEBGL||A);return{gpuVendor:function(t,e){return t.match(/NVIDIA/i)||e.match(/NVIDIA/i)?"NVIDIA":t.match(/INTEL/i)||e.match(/INTEL/i)?"INTEL":t.match(/AMD/i)||e.match(/AMD/i)||t.match(/ATI/i)||e.match(/ATI/i)?"AMD":"UNKNOWN GPU"}(i,n),vendor:i,renderer:n,version:t.getParameter(f),shadingLanguageVersion:t.getParameter(g)}}(t);switch(e.gpuVendor.toLowerCase()){case"nvidia":return"#define NVIDIA_GPU\n// Nvidia optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n// Intel optimizes away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n// Prevent driver from optimizing away the calculation necessary for emulated fp64\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n// Intel's built-in 'tan' function doesn't have acceptable precision\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n// Intel GPU doesn't have full 32 bits precision in same cases, causes overflow\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}var C=i(62574);function B(t){return new RegExp("\\b".concat(t,"[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)"),"g")}const E=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],S=[...E,[B("attribute"),"in $1"],[B("varying"),"out $1"]],T=[...E,[B("varying"),"in $1"]],M=[[/^#version[ \t]+300[ \t]+es/,"#version 100"],[/\btexture(2D|2DProj|Cube)Lod\(/g,"texture$1LodEXT("],[/\btexture\(/g,"texture2D("],[/\btextureLod\(/g,"texture2DLodEXT("]],I=[...M,[B("in"),"attribute $1"],[B("out"),"varying $1"]],P=[...M,[B("in"),"varying $1"]],D="gl_FragColor",L=/\bout[ \t]+vec4[ \t]+(\w+)[ \t]*;\n?/,O=/void\s+main\s*\([^)]*\)\s*\{\n?/;function F(t,e,i){switch(e){case 300:return i?R(t,S):function(t){t=R(t,T);const e=t.match(L);if(e){const i=e[1];t=t.replace(new RegExp("\\b".concat(D,"\\b"),"g"),i)}else{const e="fragmentColor";t=t.replace(O,(t=>"out vec4 ".concat(e,";\n").concat(t))).replace(new RegExp("\\b".concat(D,"\\b"),"g"),e)}return t}(t);case 100:return i?R(t,I):function(t){t=R(t,P);const e=t.match(L);if(e){const i=e[1];t=t.replace(L,"").replace(new RegExp("\\b".concat(i,"\\b"),"g"),D)}return t}(t);default:throw new Error("unknown GLSL version ".concat(e))}}function R(t,e){for(const[i,n]of e)t=t.replace(i,n);return t}const k="\n\n".concat(C.O_,"\n\n"),z={[n.H]:"vertex",[n.Y]:"fragment"},U="precision highp float;\n\n";function N(t,e){let{id:i,source:o,type:s,modules:a,defines:l={},hookFunctions:c=[],inject:u={},transpileToGLSL100:h=!1,prologue:d=!0,log:p}=e;(0,r.Z)("string"===typeof o,"shader source must be a string");const A=s===n.H,f=o.split("\n");let g=100,m="",v=o;0===f[0].indexOf("#version ")?(g=300,m=f[0],v=f.slice(1).join("\n")):m="#ver
2sion ".concat(g);const b={};a.forEach((t=>{Object.assign(b,t.getDefines())})),Object.assign(b,l);let B=d?"".concat(m,"\n").concat(function(t){let{id:e,source:i,type:n}=t;const r=e&&"string"===typeof e&&-1===i.indexOf("SHADER_NAME");return r?"\n#define SHADER_NAME ".concat(e,"_").concat(z[n],"\n\n"):""}({id:i,source:o,type:s}),"\n").concat(function(t){let{type:e}=t;return"\n#define SHADER_TYPE_".concat(z[e].toUpperCase(),"\n")}({type:s}),"\n").concat(w(t),"\n").concat(function(t,e,i){let n="#if (__VERSION__ > 120)\n\n# define FEATURE_GLSL_DERIVATIVES\n# define FEATURE_GLSL_DRAW_BUFFERS\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FEATURE_GLSL_TEXTURE_LOD\n\n// DEPRECATED FLAGS, remove in v9\n# define FRAG_DEPTH\n# define DERIVATIVES\n# define DRAW_BUFFERS\n# define TEXTURE_LOD\n\n#endif // __VERSION\n";return x(t,y.GLSL_FRAG_DEPTH)&&(n+="\n// FRAG_DEPTH => gl_FragDepth is available\n#ifdef GL_EXT_frag_depth\n#extension GL_EXT_frag_depth : enable\n# define FEATURE_GLSL_FRAG_DEPTH\n# define FRAG_DEPTH\n# define gl_FragDepth gl_FragDepthEXT\n#endif\n"),x(t,y.GLSL_DERIVATIVES)&&_(t,y.GLSL_DERIVATIVES)&&(n+="\n// DERIVATIVES => dxdF, dxdY and fwidth are available\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n# define FEATURE_GLSL_DERIVATIVES\n# define DERIVATIVES\n#endif\n"),x(t,y.GLSL_FRAG_DATA)&&_(t,y.GLSL_FRAG_DATA,{behavior:"require"})&&(n+="\n// DRAW_BUFFERS => gl_FragData[] is available\n#ifdef GL_EXT_draw_buffers\n#extension GL_EXT_draw_buffers : require\n#define FEATURE_GLSL_DRAW_BUFFERS\n#define DRAW_BUFFERS\n#endif\n"),x(t,y.GLSL_TEXTURE_LOD)&&(n+="// TEXTURE_LOD => texture2DLod etc are available\n#ifdef GL_EXT_shader_texture_lod\n#extension GL_EXT_shader_texture_lod : enable\n\n# define FEATURE_GLSL_TEXTURE_LOD\n# define TEXTURE_LOD\n\n#endif\n"),n}(t),"\n").concat(function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=0,i="";for(const n in t){0===e&&(i+="\n// APPLICATION DEFINES\n"),e++;const r=t[n];(r||Number.isFinite(r))&&(i+="#define ".concat(n.toUpperCase()," ").concat(t[n],"\n"))}0===e&&(i+="\n");return i}(b),"\n").concat(A?"":U,"\n"):"".concat(m,"\n");const E=function(t){const e={vs:{},fs:{}};return t.forEach((t=>{let i;"string"!==typeof t?(i=t,t=i.hook):i={},t=t.trim();const[n,r]=t.split(":"),o=t.replace(/\(.+/,"");e[n][o]=Object.assign(i,{signature:r})})),e}(c),S={},T={},M={};for(const n in u){const t="string"===typeof u[n]?{injection:u[n],order:0}:u[n],e=n.match(/^(v|f)s:(#)?([\w-]+)$/);if(e){const i=e[2],r=e[3];i?"decl"===r?T[n]=[t]:M[n]=[t]:S[n]=[t]}else M[n]=[t]}for(const n of a){p&&n.checkDeprecations(v,p);B+=n.getModuleSource(s,g);const t=n.injections[s];for(const e in t){const i=e.match(/^(v|f)s:#([\w-]+)$/);if(i){const n="decl"===i[2]?T:M;n[e]=n[e]||[],n[e].push(t[e])}else S[e]=S[e]||[],S[e].push(t[e])}}return B+=k,B=(0,C.ZP)(B,s,T),B+=function(t,e){let i="";for(const n in t){const r=t[n];if(i+="void ".concat(r.signature," {\n"),r.header&&(i+="  ".concat(r.header)),e[n]){const t=e[n];t.sort(((t,e)=>t.order-e.order));for(const e of t)i+="  ".concat(e.injection,"\n")}r.footer&&(i+="  ".concat(r.footer)),i+="}\n"}return i}(E[s],S),B+=v,B=(0,C.ZP)(B,s,M),B=F(B,h?100:g,A),B}function G(t){return function(e){const i={};for(const n of t){const t=n.getUniforms(e,i);Object.assign(i,t)}return i}}var Z=i(79817);class j{static getDefaultProgramManager(t){return t.luma=t.luma||{},t.luma.defaultProgramManager=t.luma.defaultProgramManager||new j(t),t.luma.defaultProgramManager}constructor(t){this.gl=t,this._programCache={},this._getUniforms={},this._registeredModules={},this._hookFunctions=[],this._defaultModules=[],this._hashes={},this._hashCounter=0,this.stateHash=0,this._useCounts={}}addDefaultModule(t){this._defaultModules.find((e=>e.name===t.name))||this._defaultModules.push(t),this.stateHash++}removeDefaultModule(t){const e="string"===typeof t?t:t.name;this._defaultModules=this._defaultModules.filter((t=>t.name!==e)),this.stateHash++}addShaderHook(t,e){e&&(t=Object.assign(e,{hook:t})),this._hookFunctions.push(t),this.stateHash++}get(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{vs:e="",fs:i="",defines:r={},inject:o={},varyings:s=[],bufferMode:a=35981,transpileToGLSL100:l=!1}=t,u=this._getModuleList(t.modules),h=this._getHash(e),d=this._getHash(i),p=u.map((t=>this._getHash(t.name))).sort(),A=s.map((t=>this._getHash(t))),f=Object.keys(r).sort(),g=Object.keys(o).sort(),m=[],y=[];for(const n of f)m.push(this._getHash(n)),m.push(this._getHash(r[n]));for(const n of g)y.push(this._getHash(n)),y.push(this._getHash(o[n]));const v="".concat(h,"/").concat(d,"D").concat(m.join("/"),"M").concat(p.join("/"),"I").concat(y.join("/"),"V").concat(A.join("/"),"H").concat(this.stateHash,"B").concat(a).concat(l?"T":"");
2if(!this._programCache[v]){const t=function(t,e){const{vs:i,fs:r}=e,o=c(e.modules||[]);return{gl:t,vs:N(t,Object.assign({},e,{source:i,type:n.H,modules:o})),fs:N(t,Object.assign({},e,{source:r,type:n.Y,modules:o})),getUniforms:G(o)}}(this.gl,{vs:e,fs:i,modules:u,inject:o,defines:r,hookFunctions:this._hookFunctions,transpileToGLSL100:l});this._programCache[v]=new Z.Z(this.gl,{hash:v,vs:t.vs,fs:t.fs,varyings:s,bufferMode:a}),this._getUniforms[v]=t.getUniforms||(t=>{}),this._useCounts[v]=0}return this._useCounts[v]++,this._programCache[v]}getUniforms(t){return this._getUniforms[t.hash]||null}release(t){const e=t.hash;this._useCounts[e]--,0===this._useCounts[e]&&(this._programCache[e].delete(),delete this._programCache[e],delete this._getUniforms[e],delete this._useCounts[e])}_getHash(t){return void 0===this._hashes[t]&&(this._hashes[t]=this._hashCounter++),this._hashes[t]}_getModuleList(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const e=new Array(this._defaultModules.length+t.length),i={};let n=0;for(let r=0,o=this._defaultModules.length;r<o;++r){const t=this._defaultModules[r],o=t.name;e[n++]=t,i[o]=!0}for(let r=0,o=t.length;r<o;++r){const o=t[r],s=o.name;i[s]||(e[n++]=o,i[s]=!0)}return e.length=n,e}}},17225:(t,e,i)=>{"use strict";i.d(e,{Z:()=>T});var n=i(17865);const r="out vec4 transform_output;\nvoid main() {\n  transform_output = vec4(0);\n}",o="#version 300 es\n".concat(r);function s(t,e){e=Array.isArray(e)?e:[e];const i=t.replace(/^\s+/,"").split(/\s+/),[n,r,o]=i;if(!e.includes(n)||!r||!o)return null;return{qualifier:n,type:r,name:o.split(";")[0]}}function a(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{version:e=100,input:i,inputType:s,output:a}=t;if(!i)return 300===e?o:e>300?"#version ".concat(e,"\n").concat(r):"void main() {gl_FragColor = vec4(0);}";const l=function(t,e){switch(e){case"float":return"vec4(".concat(t,", 0.0, 0.0, 1.0)");case"vec2":return"vec4(".concat(t,", 0.0, 1.0)");case"vec3":return"vec4(".concat(t,", 1.0)");case"vec4":return t;default:return(0,n.Z)(!1),null}}(i,s);return e>=300?"#version ".concat(e," ").concat(300===e?"es":"","\nin ").concat(s," ").concat(i,";\nout vec4 ").concat(a,";\nvoid main() {\n  ").concat(a," = ").concat(l,";\n}"):"varying ".concat(s," ").concat(i,";\nvoid main() {\n  gl_FragColor = ").concat(l,";\n}")}var l=i(28007),c=i(33839),u=i(54345),h=i(81301);class d{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.currentIndex=0,this.feedbackMap={},this.varyings=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}setupResources(t){for(const e of this.bindings)this._setupTransformFeedback(e,t)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyings:e}=this;return e.length>0&&(t=Object.assign({},t,{varyings:e})),t}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this.bindings[this.currentIndex],{sourceBuffers:i,transformFeedback:n}=e;return{attributes:Object.assign({},i,t.attributes),transformFeedback:n}}swap(){return!!this.feedbackMap&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t)}getBuffer(t){const{feedbackBuffers:e}=this.bindings[this.currentIndex],i=t?e[t]:null;return i?i instanceof c.Z?i:i.buffer:null}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{varyingName:e}=t,i=this.getBuffer(e);return i?i.getData():null}delete(){for(const t in this.resources)this.resources[t].delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupBuffers(t),this.varyings=t.varyings||Object.keys(this.bindings[this.currentIndex].feedbackBuffers),this.varyings.length>0&&(0,h.h)((0,l.D0)(this.gl))}_getFeedbackBuffers(t){const{sourceBuffers:e={}}=t,i={};if(this.bindings[this.currentIndex]&&Object.assign(i,this.bindings[this.currentIndex].feedbackBuffers),this.feedbackMap)for(const n in this.feedbackMap){const t=this.feedbackMap[n];n in e&&(i[t]=n)}Object.assign(i,t.feedbackBuffers);for(const n in i){const t=i[n];if("string"===typeof t){const r=e[t],{byteLength:o,usage:s,accessor:a}=r;i[n]=this._createNewBuffer(n,{byteLength:o,usage:s,accessor:a})}}return i}_setupBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e=null}=t;Object.assign(this.feedbackMap,t.feedbackMap);const i=this._getFeedbackBuffers(t);this._updateBindings({sourceBuffers:e,feedbackBuffers:i})}_setupTransformFeedback(t,e){let{model:i}=e;const{program:n}=i;t.transformFeedback=new u.Z(this.gl,{program:n,buffers:t.feedbackBuffers})}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this.feedbackMap){const{sourceBuffers:t,feedbackBuffers:e}=this._swapBuffers(this.bindings[this.currentIndex]),i=this._getNextIndex();this.bindings[i]=this._updateBinding(this.bindings[i],{sourceBuffers:t,feedbackBuffers:e})}}_updateBinding(t,e){return t?(Object.assign(t.sourceBuffers,e.sourceBuffers),Object.assign(t.feedbackBuffers,e.feedbackBuffers),t.transformFeedback&&t.transformFeedback.setBuffers(t.feedbackBuffers),t):{sourceBuffers:Object.assign({},e.sourceBuffers),feedbackBuffers:Object.assign({},e.feedbackBuffers)}}_swapBuffers(t){if(!this.feedbackMap)return null;const e=Object.assign({},t.sourceBuffers),i=Object.assign({},t.feedbackBuffers);for(const n in this.feedbackMap){const r=this.feedbackMap[n];e[n]=t.feedbackBuffers[r],i[r]=t.sourceBuffers[n],(0,h.h)(i[r]instanceof c.Z)}return{sourceBuffers:e,feedbackBuffers:i}}_createNewBuffer(t,e){const i=new c.Z(this.gl,e);return this.resources[t]&&this.resources[t].delete(),this.resources[t]=i,i}_getNextIndex(){return(this.currentIndex+1)%2}}var p=i(56474),A=i(58300),f=i(79078),g=i(17507);function m(t){let e=100;const i=t.match(/[^\s]+/g);if(i.length>=2&&"#version"===i[0]){const t=parseInt(i[1],10);Number.isFinite(t)&&(e=t)}return e}var y=i(62574);const v={name:"transform",vs:"attribute float transform_elementID;\nvec2 transform_getPixelSizeHalf(vec2 size) {\n  return vec2(1.) / (2. * size);\n}\n\nvec2 transform_getPixelIndices(vec2 texSize, vec2 pixelSizeHalf) {\n  float yIndex = floor((transform_elementID / texSize[0]) + pixelSizeHalf[1]);\n  float xIndex = transform_elementID - (yIndex * texSize[0]);\n  return vec2(xIndex, yIndex);\n}\nvec2 transform_getTexCoord(vec2 size) {\n  vec2 pixelSizeHalf = transform_getPixelSizeHalf(size);\n  vec2 indices = transform_getPixelIndices(size, pixelSizeHalf);\n  vec2 coord = indices / size + pixelSizeHalf;\n  return coord;\n}\nvec2 transform_getPos(vec2 size) {\n  vec2 texCoord = transform_getTexCoord(size);\n  vec2 pos = (texCoord * (2.0, 2.0)) - (1., 1.);\n  return pos;\n}\nvec4 transform_getInput(sampler2D texSampler, vec2 size) {\n  vec2 texCoord = transform_getTexCoord(size);\n  vec4 textureColor = texture2D(texSampler, texCoord);\n  return textureColor;\n}\n",fs:null},_="transform_uSampler_",b="transform_uSize_",x="transform_position";function w(t){let{vs:e,sourceTextureMap:i,targetTextureVarying:r,targetTexture:o}=t;let a=Object.keys(i).length,l=null;const c={};let u=e,d={};if(a>0||r){const t=u.split("\n"),e=t.slice();if(t.forEach(((t,o,u)=>{if(a>0){const r=function(t,e){const i={},r=function(t){return s(t,["attribute","in"])}(t);if(!r)return null;const{type:o,name:a}=r;if(a&&e[a]){const e="// ".concat(t," => Replaced by Transform with a sampler"),{samplerName:r,sizeName:s,uniformDeclerations:l}=function(t){const e="".concat(_).concat(t),i="".concat(b).concat(t),n="  uniform sampler2D ".concat(e,";
2\n  uniform vec2 ").concat(i,";");return{samplerName:e,sizeName:i,uniformDeclerations:n}}(a),c=function(t){switch(t){case"float":return"x";case"vec2":return"xy";case"vec3":return"xyz";case"vec4":return"xyzw";default:return(0,n.Z)(!1),null}}(o),u="  ".concat(o," ").concat(a," = transform_getInput(").concat(r,", ").concat(s,").").concat(c,";\n");i[r]=a;return{updatedLine:e,inject:{"vs:#decl":l,"vs:#main-start":u},samplerTextureMap:i}}return null}(t,i);if(r){const{updatedLine:t,inject:i}=r;e[o]=t,d=(0,y.Lm)([d,i]),Object.assign(c,r.samplerTextureMap),a--}}r&&!l&&(l=function(t,e){const i=s(t,["varying","out"]);if(!i)return null;return i.name===e?i.type:null}(t,r))})),r){(0,h.h)(o);const t="".concat(b).concat(r),e={"vs:#decl":"uniform vec2 ".concat(t,";\n"),"vs:#main-start":"     vec2 ".concat(x," = transform_getPos(").concat(t,");\n     gl_Position = vec4(").concat(x,", 0, 1.);\n")};d=(0,y.Lm)([d,e])}u=e.join("\n")}return{vs:u,targetTextureType:l,inject:d,samplerTextureMap:c}}const C={10241:9728,10240:9728,10242:33071,10243:33071};class B{constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.id=this.currentIndex=0,this._swapTexture=null,this.targetTextureVarying=null,this.targetTextureType=null,this.samplerTextureMap=null,this.bindings=[],this.resources={},this._initialize(e),Object.seal(this)}updateModelProps(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._processVertexShader(t);return Object.assign({},t,e)}getDrawOptions(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,sourceTextures:i,framebuffer:n,targetTexture:r}=this.bindings[this.currentIndex],o=Object.assign({},e,t.attributes),s=Object.assign({},t.uniforms),a=Object.assign({},t.parameters);let l=t.discard;if(this.hasSourceTextures||this.hasTargetTexture){o.transform_elementID=this.elementIDBuffer;for(const e in this.samplerTextureMap){const t=this.samplerTextureMap[e];s[e]=i[t]}this._setSourceTextureParameters();const t=function(t){let{sourceTextureMap:e,targetTextureVarying:i,targetTexture:n}=t;const r={};let o,s;i&&(({width:o,height:s}=n),r["".concat(b).concat(i)]=[o,s]);for(const a in e)({width:o,height:s}=e[a]),r["".concat(b).concat(a)]=[o,s];return r}({sourceTextureMap:i,targetTextureVarying:this.targetTextureVarying,targetTexture:r});Object.assign(s,t)}return this.hasTargetTexture&&(l=!1,a.viewport=[0,0,n.width,n.height]),{attributes:o,framebuffer:n,uniforms:s,discard:l,parameters:a}}swap(){return!!this._swapTexture&&(this.currentIndex=this._getNextIndex(),!0)}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._setupTextures(t)}getTargetTexture(){const{targetTexture:t}=this.bindings[this.currentIndex];return t}getData(){let{packed:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{framebuffer:e}=this.bindings[this.currentIndex],i=(0,p.z6)(e);if(!t)return i;const r=i.constructor,o=function(t){switch(t){case"float":return 1;case"vec2":return 2;case"vec3":return 3;case"vec4":return 4;default:return(0,n.Z)(!1),null}}(this.targetTextureType),s=new r(i.length*o/4);let a=0;for(let n=0;n<i.length;n+=4)for(let t=0;t<o;t++)s[a++]=i[n+t];return s}getFramebuffer(){return this.bindings[this.currentIndex].framebuffer}delete(){this.ownTexture&&this.ownTexture.delete(),this.elementIDBuffer&&this.elementIDBuffer.delete()}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{_targetTextureVarying:e,_swapTexture:i}=t;this._swapTexture=i,this.targetTextureVarying=e,this.hasTargetTexture=e,this._setupTextures(t)}_createTargetTexture(t){const{sourceTextures:e,textureOrReference:i}=t;if(i instanceof A.Z)return i;const n=e[i];return n?(this._targetRefTexName=i,this._createNewTexture(n)):null}_setupTextures(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceBuffers:e,_sourceTextures:i={},_targetTexture:n}=t,r=this._createTargetTexture({sourceTextures:i,textureOrReference:n});this.hasSourceTextures=this.hasSourceTextures||i&&Object.keys(i).length>0,this._updateBindings({sourceBuffers:e,sourceTextures:i,targetTexture:r}),"elementCount"in t&&this._updateElementIDBuffer(t.elementCount)}
2_updateElementIDBuffer(t){if("number"!==typeof t||this.elementCount>=t)return;const e=new Float32Array(t);e.forEach(((t,e,i)=>{i[e]=e})),this.elementIDBuffer?this.elementIDBuffer.setData({data:e}):this.elementIDBuffer=new c.Z(this.gl,{data:e,accessor:{size:1}}),this.elementCount=t}_updateBindings(t){if(this.bindings[this.currentIndex]=this._updateBinding(this.bindings[this.currentIndex],t),this._swapTexture){const{sourceTextures:t,targetTexture:e}=this._swapTextures(this.bindings[this.currentIndex]),i=this._getNextIndex();this.bindings[i]=this._updateBinding(this.bindings[i],{sourceTextures:t,targetTexture:e})}}_updateBinding(t,e){const{sourceBuffers:i,sourceTextures:n,targetTexture:r}=e;if(t||(t={sourceBuffers:{},sourceTextures:{},targetTexture:null}),Object.assign(t.sourceTextures,n),Object.assign(t.sourceBuffers,i),r){t.targetTexture=r;const{width:e,height:i}=r,{framebuffer:n}=t;n?(n.update({attachments:{36064:r},resizeAttachments:!1}),n.resize({width:e,height:i})):t.framebuffer=new f.Z(this.gl,{id:"transform-framebuffer",width:e,height:i,attachments:{36064:r}})}return t}_setSourceTextureParameters(){const t=this.currentIndex,{sourceTextures:e}=this.bindings[t];for(const i in e)e[i].setParameters(C)}_swapTextures(t){if(!this._swapTexture)return null;const e=Object.assign({},t.sourceTextures);e[this._swapTexture]=t.targetTexture;return{sourceTextures:e,targetTexture:t.sourceTextures[this._swapTexture]}}_createNewTexture(t){const e=(0,g.h)(t,{parameters:{10241:9728,10240:9728,10242:33071,10243:33071},pixelStore:{37440:!1}});return this.ownTexture&&this.ownTexture.delete(),this.ownTexture=e,e}_getNextIndex(){return(this.currentIndex+1)%2}_processVertexShader(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{sourceTextures:e,targetTexture:i}=this.bindings[this.currentIndex],{vs:n,uniforms:r,targetTextureType:o,inject:s,samplerTextureMap:l}=w({vs:t.vs,sourceTextureMap:e,targetTextureVarying:this.targetTextureVarying,targetTexture:i}),c=(0,y.Lm)([t.inject||{},s]);this.targetTextureType=o,this.samplerTextureMap=l;return{vs:n,fs:t._fs||a({version:m(n),input:this.targetTextureVarying,inputType:o,output:"transform_output"}),modules:this.hasSourceTextures||this.targetTextureVarying?[v].concat(t.modules||[]):t.modules,uniforms:r,inject:c}}}var E=i(79666),S=i(94557);class T{static isSupported(t){return(0,l.D0)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.model=null,this.elementCount=0,this.bufferTransform=null,this.textureTransform=null,this.elementIDBuffer=null,this._initialize(e),Object.seal(this)}delete(){const{model:t,bufferTransform:e,textureTransform:i}=this;t&&t.delete(),e&&e.delete(),i&&i.delete()}run(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clearRenderTarget:e=!0}=t,i=this._updateDrawOptions(t);e&&i.framebuffer&&i.framebuffer.clear({color:!0}),this.model.transform(i)}swap(){let t=!1;const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of e)t=t||i.swap();(0,h.h)(t,"Nothing to swap")}getBuffer(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.bufferTransform&&this.bufferTransform.getBuffer(t)}getData(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of e){const e=i.getData(t);if(e)return e}return null}getFramebuffer(){return this.textureTransform&&this.textureTransform.getFramebuffer()}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"elementCount"in t&&this.model.setVertexCount(t.elementCount);const e=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const i of e)i.update(t)}_initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{gl:e}=this;this._buildResourceTransforms(e,t),t=this._updateModelProps(t),this.model=new S.Z(e,Object.assign({},t,{fs:t.fs||a({version:m(t.vs)}),id:t.id||"transform-model",drawMode:t.drawMode||0,vertexCount:t.elementCount})),this.bufferTransform&&this.bufferTransform.setupResources({model:this.model})}_updateModelProps(t){let e=Object.assign({},t);
2const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of i)e=n.updateModelProps(e);return e}_buildResourceTransforms(t,e){(function(t){if(!(0,E.nK)(t.feedbackBuffers)||!(0,E.nK)(t.feedbackMap)||t.varyings&&t.varyings.length>0)return!0;return!1})(e)&&(this.bufferTransform=new d(t,e)),function(t){if(!(0,E.nK)(t._sourceTextures)||t._targetTexture||t._targetTextureVarying)return!0;return!1}(e)&&(this.textureTransform=new B(t,e)),(0,h.h)(this.bufferTransform||this.textureTransform,"must provide source/feedback buffers or source/target textures")}_updateDrawOptions(t){let e=Object.assign({},t);const i=[this.bufferTransform,this.textureTransform].filter(Boolean);for(const n of i)e=Object.assign(e,n.getDrawOptions(e));return e}}},92086:(t,e,i)=>{"use strict";i.d(e,{Z:()=>a});var n=i(12308),r=i(70353),o=i(58300),s=i(28007);class a{constructor(t,e){let{attributes:i,material:o,pbrDebug:s,imageBasedLightingEnvironment:a,lights:l,useTangents:c}=e;this.gl=t,this.defines={MANUAL_SRGB:1,SRGB_FAST_APPROXIMATION:1},(0,n.U6)(t,r.h.GLSL_TEXTURE_LOD)&&(this.defines.USE_TEX_LOD=1),this.uniforms={u_Camera:[0,0,0],u_MetallicRoughnessValues:[1,1]},this.parameters={},this.generatedTextures=[],a&&(this.uniforms.u_DiffuseEnvSampler=a.getDiffuseEnvSampler(),this.uniforms.u_SpecularEnvSampler=a.getSpecularEnvSampler(),this.uniforms.u_brdfLUT=a.getBrdfTexture(),this.uniforms.u_ScaleIBLAmbient=[1,1]),s&&(this.uniforms.u_ScaleDiffBaseMR=[0,0,0,0],this.uniforms.u_ScaleFGDSpec=[0,0,0,0]),this.defineIfPresent(i.NORMAL,"HAS_NORMALS"),this.defineIfPresent(i.TANGENT&&c,"HAS_TANGENTS"),this.defineIfPresent(i.TEXCOORD_0,"HAS_UV"),this.defineIfPresent(a,"USE_IBL"),this.defineIfPresent(l,"USE_LIGHTS"),this.defineIfPresent(s,"PBR_DEBUG"),o&&this.parseMaterial(o)}defineIfPresent(t,e){t&&(this.defines[e]=1)}parseTexture(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=t.texture&&t.texture.sampler&&t.texture.sampler.parameters||{},r=t.texture.source.image;let s,a={};r.compressed?(s=r,a={[this.gl.TEXTURE_MIN_FILTER]:r.data.length>1?this.gl.LINEAR_MIPMAP_NEAREST:this.gl.LINEAR}):s={data:r};const l=new o.Z(this.gl,{id:t.name||t.id,parameters:{...n,...a},pixelStore:{[this.gl.UNPACK_FLIP_Y_WEBGL]:!1},...s});this.uniforms[e]=l,this.defineIfPresent(i,i),this.generatedTextures.push(l)}parsePbrMetallicRoughness(t){t.baseColorTexture&&this.parseTexture(t.baseColorTexture,"u_BaseColorSampler","HAS_BASECOLORMAP"),this.uniforms.u_BaseColorFactor=t.baseColorFactor||[1,1,1,1],t.metallicRoughnessTexture&&this.parseTexture(t.metallicRoughnessTexture,"u_MetallicRoughnessSampler","HAS_METALROUGHNESSMAP");const{metallicFactor:e=1,roughnessFactor:i=1}=t;this.uniforms.u_MetallicRoughnessValues=[e,i]}parseMaterial(t){if(this.uniforms.pbr_uUnlit=Boolean(t.unlit),t.pbrMetallicRoughness&&this.parsePbrMetallicRoughness(t.pbrMetallicRoughness),t.normalTexture){this.parseTexture(t.normalTexture,"u_NormalSampler","HAS_NORMALMAP");const{scale:e=1}=t.normalTexture;this.uniforms.u_NormalScale=e}if(t.occlusionTexture){this.parseTexture(t.occlusionTexture,"u_OcclusionSampler","HAS_OCCLUSIONMAP");const{strength:e=1}=t.occlusionTexture;this.uniforms.u_OcclusionStrength=e}if(t.emissiveTexture&&(this.parseTexture(t.emissiveTexture,"u_EmissiveSampler","HAS_EMISSIVEMAP"),this.uniforms.u_EmissiveFactor=t.emissiveFactor||[0,0,0]),"MASK"===t.alphaMode){const{alphaCutoff:e=.5}=t;this.defines.ALPHA_CUTOFF=1,this.uniforms.u_AlphaCutoff=e}else"BLEND"===t.alphaMode&&(s.cM.warn("BLEND alphaMode might not work well because it requires mesh sorting")(),Object.assign(this.parameters,{blend:!0,blendEquation:this.gl.FUNC_ADD,blendFunc:[this.gl.SRC_ALPHA,this.gl.ONE_MINUS_SRC_ALPHA,this.gl.ONE,this.gl.ONE_MINUS_SRC_ALPHA]}))}delete(){this.generatedTextures.forEach((t=>t.delete()))}}},28007:(t,e,i)=>{"use strict";i.d(e,{KQ:()=>h,JD:()=>u,s9:()=>tt,JY:()=>Q,w:()=>W,ZS:()=>V,vd:()=>c,yW:()=>et,UF:()=>a,D0:()=>l,cM:()=>n,kL:()=>H,aQ:()=>it,dR:()=>j,s8:()=>J});const n=new(i(87294).Z)({id:"luma.gl"});function r(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}const o="Invalid WebGLRenderingContext",s="Requires WebGL2";function a(t){return"undefined"!==typeof WebGLRenderingContext&&t instanceof WebGLRenderingContext||("undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&Number.isFinite(t._version)))}function l(t){return"undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext||Boolean(t&&2===t._version)}function c(t){return l(t)?t:null}function u(t){return r(a(t),o),t}function h(t){return r(l(t),s),t}const d={};function p(t,e){var i;d[t]=!0,void 0!==e&&(i=e,globalThis.console&&globalThis.console.error&&globalThis.console.error(i))}const A=function t(e){const i=e.gl;this.ext=e,this.isAlive=!0,this.hasBeenBound=!1,this.elementArrayBuffer=null,this.attribs=new Array(e.maxVertexAttribs);for(let n=0;n<this.attribs.length;n++){const e=new t.VertexAttrib(i);this.attribs[n]=e}this.maxAttrib=0};(A.VertexAttrib=function(t){this.enabled=!1,this.buffer=null,this.size=4,this.type=5126,this.normalized=!1,this.stride=16,this.offset=0,this.cached="",this.recache()}).prototype.recache=function(){this.cached=[this.size,this.type,this.normalized,this.stride,this.offset].join(":")};const f=function(t){const e=this;this.gl=t,function(t){const e=t.getError;t.getError=function(){let i;do{i=e.apply(t),0!==i&&(d[i]=!0)}while(0!==i);for(i in d)if(d[i])return delete d[i],parseInt(i,10);return 0}}(t);const i=this.original={getParameter:t.getParameter,enableVertexAttribArray:t.enableVertexAttribArray,disableVertexAttribArray:t.disableVertexAttribArray,bindBuffer:t.bindBuffer,getVertexAttrib:t.getVertexAttrib,vertexAttribPointer:t.vertexAttribPointer};t.getParameter=function(t){return t===e.VERTEX_ARRAY_BINDING_OES?e.currentVertexArrayObject===e.defaultVertexArrayObject?null:e.currentVertexArrayObject:i.getParameter.apply(this,arguments)},t.enableVertexAttribArray=function(t){const n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);return n.attribs[t].enabled=!0,i.enableVertexAttribArray.apply(this,arguments)},t.disableVertexAttribArray=function(t){const n=e.currentVertexArrayObject;n.maxAttrib=Math.max(n.maxAttrib,t);return n.attribs[t].enabled=!1,i.disableVertexAttribArray.apply(this,arguments)},t.bindBuffer=function(t,n){switch(t){case 34962:e.currentArrayBuffer=n;break;case 34963:e.currentVertexArrayObject.elementArrayBuffer=n}return i.bindBuffer.apply(this,arguments)},t.getVertexAttrib=function(t,n){const r=e.currentVertexArrayObject.attribs[t];switch(n){case 34975:return r.buffer;case 34338:return r.enabled;case 34339:return r.size;
2case 34340:return r.stride;case 34341:return r.type;case 34922:return r.normalized;default:return i.getVertexAttrib.apply(this,arguments)}},t.vertexAttribPointer=function(t,n,r,o,s,a){const l=e.currentVertexArrayObject;l.maxAttrib=Math.max(l.maxAttrib,t);const c=l.attribs[t];return c.buffer=e.currentArrayBuffer,c.size=n,c.type=r,c.normalized=o,c.stride=s,c.offset=a,c.recache(),i.vertexAttribPointer.apply(this,arguments)},t.instrumentExtension&&t.instrumentExtension(this,"OES_vertex_array_object"),t.canvas&&t.canvas.addEventListener("webglcontextrestored",(()=>{var t;t="OESVertexArrayObject emulation library context restored",globalThis.console&&globalThis.console.log&&globalThis.console.log(t),e.reset_()}),!0),this.reset_()};f.prototype.VERTEX_ARRAY_BINDING_OES=34229,f.prototype.reset_=function(){if(void 0!==this.vertexArrayObjects)for(let e=0;e<this.vertexArrayObjects.length;++e)this.vertexArrayObjects.isAlive=!1;const t=this.gl;this.maxVertexAttribs=t.getParameter(34921),this.defaultVertexArrayObject=new A(this),this.currentVertexArrayObject=null,this.currentArrayBuffer=null,this.vertexArrayObjects=[this.defaultVertexArrayObject],this.bindVertexArrayOES(null)},f.prototype.createVertexArrayOES=function(){const t=new A(this);return this.vertexArrayObjects.push(t),t},f.prototype.deleteVertexArrayOES=function(t){t.isAlive=!1,this.vertexArrayObjects.splice(this.vertexArrayObjects.indexOf(t),1),this.currentVertexArrayObject===t&&this.bindVertexArrayOES(null)},f.prototype.isVertexArrayOES=function(t){return!!(t&&t instanceof A&&t.hasBeenBound&&t.ext===this)},f.prototype.bindVertexArrayOES=function(t){const e=this.gl;if(t&&!t.isAlive)return void p(1282,"bindVertexArrayOES: attempt to bind deleted arrayObject");const i=this.original,n=this.currentVertexArrayObject;this.currentVertexArrayObject=t||this.defaultVertexArrayObject,this.currentVertexArrayObject.hasBeenBound=!0;const r=this.currentVertexArrayObject;if(n===r)return;n&&r.elementArrayBuffer===n.elementArrayBuffer||i.bindBuffer.call(e,34963,r.elementArrayBuffer);let o=this.currentArrayBuffer;const s=Math.max(n?n.maxAttrib:0,r.maxAttrib);for(let a=0;a<=s;a++){const t=r.attribs[a],s=n?n.attribs[a]:null;if(n&&t.enabled===s.enabled||(t.enabled?i.enableVertexAttribArray.call(e,a):i.disableVertexAttribArray.call(e,a)),t.enabled){let r=!1;n&&t.buffer===s.buffer||(o!==t.buffer&&(i.bindBuffer.call(e,34962,t.buffer),o=t.buffer),r=!0),(r||t.cached!==s.cached)&&i.vertexAttribPointer.call(e,a,t.size,t.type,t.normalized,t.stride,t.offset)}}this.currentArrayBuffer!==o&&i.bindBuffer.call(e,34962,this.currentArrayBuffer)};const g="OES_element_index",m="WEBGL_draw_buffers",y="WEBGL_debug_renderer_info",v=t=>l(t)?void 0:0,_={3074:t=>l(t)?void 0:36064,35723:t=>l(t)?void 0:4352,35977:v,32937:v,36795:(t,e)=>{const i=l(t)?t.getExtension("EXT_disjoint_timer_query_webgl2"):t.getExtension("EXT_disjoint_timer_query");return i&&i.GPU_DISJOINT_EXT?e(i.GPU_DISJOINT_EXT):0},37445:(t,e)=>{const i=t.getExtension(y);return e(i&&i.UNMASKED_VENDOR_WEBGL||7936)},37446:(t,e)=>{const i=t.getExtension(y);return e(i&&i.UNMASKED_RENDERER_WEBGL||7937)},34047:(t,e)=>{const i=t.luma.extensions.EXT_texture_filter_anisotropic;return i?e(i.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1},32883:v,35071:v,37447:v,36063:(t,e)=>{if(!l(t)){const i=t.getExtension(m);return i?e(i.MAX_COLOR_ATTACHMENTS_WEBGL):0}},35379:v,35374:v,35377:v,34852:t=>{if(!l(t)){const e=t.getExtension(m);return e?e.MAX_DRAW_BUFFERS_WEBGL:0}},36203:t=>t.getExtension(g)?2147483647:65535,33001:t=>t.getExtension(g)?16777216:65535,33e3:t=>16777216,37157:v,35373:v,35657:v,36183:v,37137:v,34045:v,35978:v,35979:v,35968:v,35376:v,35375:v,35659:v,37154:v,35371:v,35658:v,35076:v,35077:v,35380:v};const b="ANGLE_instanced_arrays";const x={OES_vertex_array_object:{meta:{suffix:"OES"},createVertexArray:()=>{r(!1,"VertexArray requires WebGL2 or OES_vertex_array_object extension")},deleteVertexArray:()=>{},bindVertexArray:()=>{},isVertexArray:()=>!1},[b]:{meta:{suffix:"ANGLE"},vertexAttribDivisor(t,e){r(0===e,"WebGL instanced rendering not supported")},drawElementsInstanced:()=>{},drawArraysInstanced:()=>{}},WEBGL_draw_buffers:{meta:{suffix:"WEBGL"},drawBuffers:()=>{r(!1)}},EXT_disjoint_timer_query:{meta:{suffix:"EXT"}
2,createQuery:()=>{r(!1)},deleteQuery:()=>{r(!1)},beginQuery:()=>{r(!1)},endQuery:()=>{},getQuery(t,e){return this.getQueryObject(t,e)},getQueryParameter(t,e){return this.getQueryObject(t,e)},getQueryObject:()=>{}}},w={readBuffer:(t,e,i)=>{l(t)&&e(i)},getVertexAttrib:(t,e,i,n)=>{const{webgl2:r,ext:o}=function(t,e){return{webgl2:l(t),ext:t.getExtension(e)}}(t,b);let s;switch(n){case 35069:s=!!r&&void 0;break;case 35070:s=r||o?void 0:0}return void 0!==s?s:e(i,n)},getProgramParameter:(t,e,i,n)=>{if(!l(t))switch(n){case 35967:return 35981;case 35971:case 35382:return 0}return e(i,n)},getInternalformatParameter:(t,e,i,n,r)=>l(t)||32937!==r?t.getInternalformatParameter(i,n,r):new Int32Array([0]),getTexParameter(t,e,i,n){if(34046===n){const{extensions:e}=t.luma,i=e.EXT_texture_filter_anisotropic;n=i&&i.TEXTURE_MAX_ANISOTROPY_EXT||34046}return e(i,n)},getParameter:function(t,e,i){const n=_[i],r="function"===typeof n?n(t,e,i):n;return void 0!==r?r:e(i)},hint:(t,e,i,n)=>e(i,n)};function C(t,e){let{extension:i,target:n,target2:o}=e;const s=x[i];r(s);const{meta:a={}}=s,{suffix:l=""}=a,c=t.getExtension(i);for(const r of Object.keys(s)){const e="".concat(r).concat(l);let i=null;"meta"===r||"function"===typeof t[r]||(c&&"function"===typeof c[e]?i=function(){return c[e](...arguments)}:"function"===typeof s[r]&&(i=s[r].bind(n))),i&&(n[r]=i,o[r]=i)}}globalThis.polyfillContext=function(t){t.luma=t.luma||{};const{luma:e}=t;return e.polyfilled||(!function(t){if("function"===typeof t.createVertexArray)return;const e=t.getSupportedExtensions;t.getSupportedExtensions=function(){const t=e.call(this)||[];return t.indexOf("OES_vertex_array_object")<0&&t.push("OES_vertex_array_object"),t};const i=t.getExtension;t.getExtension=function(e){return i.call(this,e)||("OES_vertex_array_object"!==e?null:(t.__OESVertexArrayObject||(this.__OESVertexArrayObject=new f(this)),this.__OESVertexArrayObject))}}(t),function(t){t.luma.extensions={};const e=t.getSupportedExtensions()||[];for(const i of e)t.luma[i]=t.getExtension(i)}(t),function(t,e){for(const i of Object.getOwnPropertyNames(e))"overrides"!==i&&C(t,{extension:i,target:t.luma,target2:t})}(t,x),function(t,e){let{target:i,target2:n}=e;
2Object.keys(w).forEach((e=>{if("function"===typeof w[e]){const r=t[e]?t[e].bind(t):()=>{},o=w[e].bind(null,t,r);i[e]=o,n[e]=o}}))}(t,{target:e,target2:t}),e.polyfilled=!0),t};const B={3042:!1,32773:new Float32Array([0,0,0,0]),32777:32774,34877:32774,32969:1,32968:0,32971:1,32970:0,3106:new Float32Array([0,0,0,0]),3107:[!0,!0,!0,!0],2884:!1,2885:1029,2929:!1,2931:1,2932:513,2928:new Float32Array([0,1]),2930:!0,3024:!0,36006:null,2886:2305,33170:4352,2849:1,32823:!1,32824:0,10752:0,32938:1,32939:!1,3089:!1,3088:new Int32Array([0,0,1024,1024]),2960:!1,2961:0,2968:4294967295,36005:4294967295,2962:519,2967:0,2963:4294967295,34816:519,36003:0,36004:4294967295,2964:7680,2965:7680,2966:7680,34817:7680,34818:7680,34819:7680,2978:[0,0,1024,1024],3333:4,3317:4,37440:!1,37441:!1,37443:37444,35723:4352,36010:null,35977:!1,3330:0,3332:0,3331:0,3314:0,32878:0,3316:0,3315:0,32877:0},E=(t,e,i)=>e?t.enable(i):t.disable(i),S=(t,e,i)=>t.hint(i,e),T=(t,e,i)=>t.pixelStorei(i,e);function M(t){return Array.isArray(t)||ArrayBuffer.isView(t)}const I={3042:E,32773:(t,e)=>t.blendColor(...e),32777:"blendEquation",34877:"blendEquation",32969:"blendFunc",32968:"blendFunc",32971:"blendFunc",32970:"blendFunc",3106:(t,e)=>t.clearColor(...e),3107:(t,e)=>t.colorMask(...e),2884:E,2885:(t,e)=>t.cullFace(e),2929:E,2931:(t,e)=>t.clearDepth(e),2932:(t,e)=>t.depthFunc(e),2928:(t,e)=>t.depthRange(...e),2930:(t,e)=>t.depthMask(e),3024:E,35723:S,36006:(t,e)=>{const i=l(t)?36009:36160;return t.bindFramebuffer(i,e)},2886:(t,e)=>t.frontFace(e),33170:S,2849:(t,e)=>t.lineWidth(e),32823:E,32824:"polygonOffset",10752:"polygonOffset",35977:E,32938:"sampleCoverage",32939:"sampleCoverage",3089:E,3088:(t,e)=>t.scissor(...e),2960:E,2961:(t,e)=>t.clearStencil(e),2968:(t,e)=>t.stencilMaskSeparate(1028,e),36005:(t,e)=>t.stencilMaskSeparate(1029,e),2962:"stencilFuncFront",2967:"stencilFuncFront",2963:"stencilFuncFront",34816:"stencilFuncBack",36003:"stencilFuncBack",36004:"stencilFuncBack",2964:"stencilOpFront",2965:"stencilOpFront",2966:"stencilOpFront",34817:"stencilOpBack",34818:"stencilOpBack",34819:"stencilOpBack",2978:(t,e)=>t.viewport(...e),3333:T,3317:T,37440:T,37441:T,37443:T,3330:T,3332:T,3331:T,36010:(t,e)=>t.bindFramebuffer(36008,e),3314:T,32878:T,3316:T,3315:T,32877:T,framebuffer:(t,e)=>{const i=e&&"handle"in e?e.handle:e;return t.bindFramebuffer(36160,i)},blend:(t,e)=>e?t.enable(3042):t.disable(3042),blendColor:(t,e)=>t.blendColor(...e),blendEquation:(t,e)=>{e=M(e)?e:[e,e],t.blendEquationSeparate(...e)},blendFunc:(t,e)=>{e=M(e)&&2===e.length?[...e,...e]:e,t.blendFuncSeparate(...e)},clearColor:(t,e)=>t.clearColor(...e),clearDepth:(t,e)=>t.clearDepth(e),clearStencil:(t,e)=>t.clearStencil(e),colorMask:(t,e)=>t.colorMask(...e),cull:(t,e)=>e?t.enable(2884):t.disable(2884),cullFace:(t,e)=>t.cullFace(e),depthTest:(t,e)=>e?t.enable(2929):t.disable(2929),depthFunc:(t,e)=>t.depthFunc(e),depthMask:(t,e)=>t.depthMask(e),depthRange:(t,e)=>t.depthRange(...e),dither:(t,e)=>e?t.enable(3024):t.disable(3024),derivativeHint:(t,e)=>{t.hint(35723,e)},frontFace:(t,e)=>t.frontFace(e),mipmapHint:(t,e)=>t.hint(33170,e),lineWidth:(t,e)=>t.lineWidth(e),polygonOffsetFill:(t,e)=>e?t.enable(32823):t.disable(32823),polygonOffset:(t,e)=>t.polygonOffset(...e),sampleCoverage:(t,e)=>t.sampleCoverage(...e),scissorTest:(t,e)=>e?t.enable(3089):t.disable(3089),scissor:(t,e)=>t.scissor(...e),stencilTest:(t,e)=>e?t.enable(2960):t.disable(2960),stencilMask:(t,e)=>{e=M(e)?e:[e,e];const[i,n]=e;t.stencilMaskSeparate(1028,i),t.stencilMaskSeparate(1029,n)},stencilFunc:(t,e)=>{e=M(e)&&3===e.length?[...e,...e]:e;const[i,n,r,o,s,a]=e;t.stencilFuncSeparate(1028,i,n,r),t.stencilFuncSeparate(1029,o,s,a)},stencilOp:(t,e)=>{e=M(e)&&3===e.length?[...e,...e]:e;const[i,n,r,o,s,a]=e;t.stencilOpSeparate(1028,i,n,r),t.stencilOpSeparate(1029,o,s,a)},viewport:(t,e)=>t.viewport(...e)};function P(t,e,i){return void 0!==e[t]?e[t]:i[t]}const D={blendEquation:(t,e,i)=>t.blendEquationSeparate(P(32777,e,i),P(34877,e,i)),blendFunc:(t,e,i)=>t.blendFuncSeparate(P(32969,e,i),P(32968,e,i),P(32971,e,i),P(32970,e,i)),polygonOffset:(t,e,i)=>t.polygonOffset(P(32824,e,i),P(10752,e,i)),sampleCoverage:(t,e,i)=>
2t.sampleCoverage(P(32938,e,i),P(32939,e,i)),stencilFuncFront:(t,e,i)=>t.stencilFuncSeparate(1028,P(2962,e,i),P(2967,e,i),P(2963,e,i)),stencilFuncBack:(t,e,i)=>t.stencilFuncSeparate(1029,P(34816,e,i),P(36003,e,i),P(36004,e,i)),stencilOpFront:(t,e,i)=>t.stencilOpSeparate(1028,P(2964,e,i),P(2965,e,i),P(2966,e,i)),stencilOpBack:(t,e,i)=>t.stencilOpSeparate(1029,P(34817,e,i),P(34818,e,i),P(34819,e,i))},L={enable:(t,e)=>t({[e]:!0}),disable:(t,e)=>t({[e]:!1}),pixelStorei:(t,e,i)=>t({[e]:i}),hint:(t,e,i)=>t({[e]:i}),bindFramebuffer:(t,e,i)=>{switch(e){case 36160:return t({36006:i,36010:i});case 36009:return t({36006:i});case 36008:return t({36010:i});default:return null}},blendColor:(t,e,i,n,r)=>t({32773:new Float32Array([e,i,n,r])}),blendEquation:(t,e)=>t({32777:e,34877:e}),blendEquationSeparate:(t,e,i)=>t({32777:e,34877:i}),blendFunc:(t,e,i)=>t({32969:e,32968:i,32971:e,32970:i}),blendFuncSeparate:(t,e,i,n,r)=>t({32969:e,32968:i,32971:n,32970:r}),clearColor:(t,e,i,n,r)=>t({3106:new Float32Array([e,i,n,r])}),clearDepth:(t,e)=>t({2931:e}),clearStencil:(t,e)=>t({2961:e}),colorMask:(t,e,i,n,r)=>t({3107:[e,i,n,r]}),cullFace:(t,e)=>t({2885:e}),depthFunc:(t,e)=>t({2932:e}),depthRange:(t,e,i)=>t({2928:new Float32Array([e,i])}),depthMask:(t,e)=>t({2930:e}),frontFace:(t,e)=>t({2886:e}),lineWidth:(t,e)=>t({2849:e}),polygonOffset:(t,e,i)=>t({32824:e,10752:i}),sampleCoverage:(t,e,i)=>t({32938:e,32939:i}),scissor:(t,e,i,n,r)=>t({3088:new Int32Array([e,i,n,r])}),stencilMask:(t,e)=>t({2968:e,36005:e}),stencilMaskSeparate:(t,e,i)=>t({[1028===e?2968:36005]:i}),stencilFunc:(t,e,i,n)=>t({2962:e,2967:i,2963:n,34816:e,36003:i,36004:n}),stencilFuncSeparate:(t,e,i,n,r)=>t({[1028===e?2962:34816]:i,[1028===e?2967:36003]:n,[1028===e?2963:36004]:r}),stencilOp:(t,e,i,n)=>t({2964:e,2965:i,2966:n,34817:e,34818:i,34819:n}),stencilOpSeparate:(t,e,i,n,r)=>t({[1028===e?2964:34817]:i,[1028===e?2965:34818]:n,[1028===e?2966:34819]:r}),viewport:(t,e,i,n,r)=>t({2978:[e,i,n,r]})},O=(t,e)=>t.isEnabled(e),F={3042:O,2884:O,2929:O,3024:O,32823:O,32926:O,32928:O,3089:O,2960:O,35977:O};function R(t){for(const e in t)return!1;return!0}function k(t,e){if(t===e)return!0;const i=Array.isArray(t)||ArrayBuffer.isView(t),n=Array.isArray(e)||ArrayBuffer.isView(e);if(i&&n&&t.length===e.length){for(let i=0;i<t.length;++i)if(t[i]!==e[i])return!1;return!0}return!1}function z(t,e){const i=t[e].bind(t);t[e]=function(){const e=arguments.length<=0?void 0:arguments[0];return e in t.state.cache&&t.state.enable?t.state.cache[e]:i(...arguments)},Object.defineProperty(t[e],"name",{value:"".concat(e,"-from-cache"),configurable:!1})}function U(t,e,i){const n=t[e].bind(t);t[e]=function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];const{valueChanged:s,oldValue:a}=i(t.state._updateCache,...r);return s&&n(...r),a},Object.defineProperty(t[e],"name",{value:"".concat(e,"-to-cache"),configurable:!1})}class N{constructor(t){let{copyState:e=!1,log:i=(()=>{})}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.gl=t,this.program=null,this.stateStack=[],this.enable=!0,this.cache=e?V(t):Object.assign({},B),this.log=i,this._updateCache=this._updateCache.bind(this),Object.seal(this)}push(){this.stateStack.push({})}pop(){r(this.stateStack.length>0);const t=this.stateStack[this.stateStack.length-1];j(this.gl,t),this.stateStack.pop()}_updateCache(t){let e,i=!1;const n=this.stateStack.length>0&&this.stateStack[this.stateStack.length-1];for(const o in t){r(void 0!==o);const s=t[o],a=this.cache[o];k(s,a)||(i=!0,e=a,n&&!(o in n)&&(n[o]=a),this.cache[o]=s)}return{valueChanged:i,oldValue:e}}}function G(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{enable:i=!0,copyState:n}=e;if(r(void 0!==n),!t.state){const{polyfillContext:e}=globalThis;e&&e(t),t.state=new N(t,{copyState:n}),function(t){const e=t.useProgram.bind(t);t.useProgram=function(i){t.state.program!==i&&(e(i),t.state.program=i)}}(t);for(const i in L){U(t,i,L[i])}z(t,"getParameter"),z(t,"isEnabled")}return t.state.enable=i,t}function Z(t){r(t.state),t.state.pop()}function j(t,e){if(r(a(t),"setParameters requires a WebGL context"),R(e))return;const i={};for(const r in e){const n=Number(r),o=I[r];o&&("string"===typeof o?i[o]=!0:o(t,e[r],n))}const n=t.state&&t.state.cache;if(n)for(const r in i){(0,D[r])(t,e,n)}}function V(t,e){if("number"===typeof(e=e||B)){const i=e,n=F[i];return n?n(t,i):t.getParameter(i)}const i=Array.isArray(e)?e:Object.keys(e),n={};for(const r of i){const e=F[r];n[r]=e?e(t,Number(r)):t.getParameter(Number(r))}return n}function H(t){j(t,B)}function J(t,e,i){if(R(e))return i(t);const{nocatch:n=!0}=e;let r;if(function(t){t.state||G(t,{copyState:!1}),t.state.push()}(t),j(t,e),n)r=i(t),Z(t);else try{r=i(t)}finally{Z(t)}return r}function W(t){const{luma:e}=t;if(t.canvas&&e){const{clientWidth:i}=e.canvasSizeInfo;return i?t.drawingBufferWidth/i:1}return 1}function Q(t,e){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];
2return function(t,e,i,n,r){const o=q(t[0],e,i);let s=K(t[1],e,n,r),a=q(t[0]+1,e,i);const l=a===i-1?a:a-1;let c;a=K(t[1]+1,e,n,r),r?(a=0===a?a:a+1,c=s,s=a):c=a===n-1?a:a-1;return{x:o,y:s,width:Math.max(l-o+1,1),height:Math.max(c-s+1,1)}}(e,W(t),t.drawingBufferWidth,t.drawingBufferHeight,i)}function q(t,e,i){return Math.min(Math.round(t*e),i-1)}function K(t,e,i,n){return n?Math.max(0,i-1-Math.round(t*e)):Math.min(Math.round(t*e),i-1)}const X=(0,i(11515).Z)(),Y=X&&"undefined"!==typeof document,$={webgl2:!0,webgl1:!0,throwOnError:!0,manageState:!0,canvas:null,debug:!1,width:800,height:600};function tt(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(X,"createGLContext only available in the browser.\nCreate your own headless context or use 'createHeadlessContext' from @luma.gl/test-utils"),t=Object.assign({},$,t);const{width:e,height:i}=t;function o(e){if(t.throwOnError)throw new Error(e);return console.error(e),null}let s;t.onError=o;const{canvas:a}=t,c=function(t){let e,{canvas:i,width:n=800,height:r=600,onError:o}=t;if("string"===typeof i){Y&&"complete"===document.readyState||o("createGLContext called on canvas '".concat(i,"' before page was loaded")),e=document.getElementById(i)}else i?e=i:(e=document.createElement("canvas"),e.id="lumagl-canvas",e.style.width=Number.isFinite(n)?"".concat(n,"px"):"100%",e.style.height=Number.isFinite(r)?"".concat(r,"px"):"100%",document.body.insertBefore(e,document.body.firstChild));return e}({canvas:a,width:e,height:i,onError:o});return s=function(t,e){const{onError:i}=e;let n=null;const r=t=>n=t.statusMessage||n;t.addEventListener("webglcontextcreationerror",r,!1);const{webgl1:o=!0,webgl2:s=!0}=e;let a=null;s&&(a=a||t.getContext("webgl2",e),a=a||t.getContext("experimental-webgl2",e));o&&(a=a||t.getContext("webgl",e),a=a||t.getContext("experimental-webgl",e));if(t.removeEventListener("webglcontextcreationerror",r,!1),!a)return i("Failed to create ".concat(s&&!o?"WebGL2":"WebGL"," context: ").concat(n||"Unknown error"));e.onContextLost&&t.addEventListener("webglcontextlost",e.onContextLost,!1);e.onContextRestored&&t.addEventListener("webglcontextrestored",e.onContextRestored,!1);return a}(c,t),s?(s=et(s,t),function(t){const e=l(t)?"WebGL2":"WebGL1",i=function(t){const e=t.getParameter(7936),i=t.getParameter(7937),n=t.getExtension("WEBGL_debug_renderer_info"),r=n&&t.getParameter(n.UNMASKED_VENDOR_WEBGL||7936),o=n&&t.getParameter(n.UNMASKED_RENDERER_WEBGL||7937);return{vendor:r||e,renderer:o||i,vendorMasked:e,rendererMasked:i,version:t.getParameter(7938),shadingLanguageVersion:t.getParameter(35724)}}(t),r=i?"(".concat(i.vendor,",").concat(i.renderer,")"):"",o=t.debug?" debug":"";n.info(1,"".concat(e).concat(o," context ").concat(r))()}(s),s):null}function et(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||t._instrumented)return t;t._version=t._version||function(t){if("undefined"!==typeof WebGL2RenderingContext&&t instanceof WebGL2RenderingContext)return 2;return 1}(t),t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{},e=Object.assign({},$,e);const{manageState:i,debug:r}=e;return i&&G(t,{copyState:!1,log:function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return n.log(1,...e)()}}),X&&r&&(globalThis.makeDebugContext?(t=globalThis.makeDebugContext(t,e),n.level=Math.max(n.level,1)):n.warn('WebGL debug mode not activated. import "@luma.gl/debug" to enable.')()),t._instrumented=!0,t}function it(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.canvas){return void function(t,e,i){let r="width"in i?i.width:t.canvas.clientWidth,o="height"in i?i.height:t.canvas.clientHeight;r&&o||(n.log(1,"Canvas clientWidth/clientHeight is 0")(),e=1,r=t.canvas.width||1,o=t.canvas.height||1);t.luma=t.luma||{},t.luma.canvasSizeInfo=t.luma.canvasSizeInfo||{};const s=t.luma.canvasSizeInfo;if(s.clientWidth!==r||s.clientHeight!==o||s.devicePixelRatio!==e){let i=e;const s=Math.floor(r*i),a=Math.floor(o*i);t.canvas.width=s,t.canvas.height=a,t.drawingBufferWidth===s&&t.drawingBufferHeight===a||(n.warn("Device pixel ratio clamped")(),i=Math.min(t.drawingBufferWidth/r,t.drawingBufferHeight/o),t.canvas.width=Math.floor(r*i),t.canvas.height=Math.floor(o*i)),Object.assign(t.luma.canvasSizeInfo,{clientWidth:r,clientHeight:o,devicePixelRatio:e})}}(t,function(t){const e="undefined"===typeof window?1:window.devicePixelRatio||1;return Number.isFinite(t)?t<=0?1:t:t?e:1}(e.useDevicePixels),e)}const i=t.getExtension("STACKGL_resize_drawingbuffer");i&&"width"in e&&"height"in e&&i.resize(e.width,e.height)}}
2,5740:(t,e,i)=>{"use strict";i.d(e,{H:()=>n,Y:()=>r});const n="vs",r="fs"},62574:(t,e,i)=>{"use strict";i.d(e,{O_:()=>s,Lm:()=>h,ZP:()=>u});var n=i(5740),r=i(17865);const o={[n.H]:"#ifdef MODULE_LOGDEPTH\n  logdepth_adjustPosition(gl_Position);\n#endif\n",[n.Y]:"#ifdef MODULE_MATERIAL\n  gl_FragColor = material_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LIGHTING\n  gl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_FOG\n  gl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_PICKING\n  gl_FragColor = picking_filterHighlightColor(gl_FragColor);\n  gl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n\n#ifdef MODULE_LOGDEPTH\n  logdepth_setFragDepth();\n#endif\n"},s="__LUMA_INJECT_DECLARATIONS__",a=/void\s+main\s*\([^)]*\)\s*\{\n?/,l=/}\n?[^{}]*$/,c=[];function u(t,e,i){let r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const u=e===n.H;for(const n in i){const e=i[n];e.sort(((t,e)=>t.order-e.order)),c.length=e.length;for(let t=0,i=e.length;t<i;++t)c[t]=e[t].injection;const r="".concat(c.join("\n"),"\n");switch(n){case"vs:#decl":u&&(t=t.replace(s,r));break;case"vs:#main-start":u&&(t=t.replace(a,(t=>t+r)));break;case"vs:#main-end":u&&(t=t.replace(l,(t=>r+t)));break;case"fs:#decl":u||(t=t.replace(s,r));break;case"fs:#main-start":u||(t=t.replace(a,(t=>t+r)));break;case"fs:#main-end":u||(t=t.replace(l,(t=>r+t)));break;default:t=t.replace(n,(t=>t+r))}}return t=t.replace(s,""),r&&(t=t.replace(/\}\s*$/,(t=>t+o[e]))),t}function h(t){const e={};return(0,r.Z)(Array.isArray(t)&&t.length>1),t.forEach((t=>{for(const i in t)e[i]=e[i]?"".concat(e[i],"\n").concat(t[i]):t[i]})),e}},45986:(t,e,i)=>{"use strict";i.d(e,{H:()=>s});const n="#if (defined(SHADER_TYPE_FRAGMENT) && defined(LIGHTING_FRAGMENT)) || (defined(SHADER_TYPE_VERTEX) && defined(LIGHTING_VERTEX))\n\nstruct AmbientLight {\n vec3 color;\n};\n\nstruct PointLight {\n vec3 color;\n vec3 position;\n vec3 attenuation;\n};\n\nstruct DirectionalLight {\n  vec3 color;\n  vec3 direction;\n};\n\nuniform AmbientLight lighting_uAmbientLight;\nuniform PointLight lighting_uPointLight[MAX_LIGHTS];\nuniform DirectionalLight lighting_uDirectionalLight[MAX_LIGHTS];\nuniform int lighting_uPointLightCount;\nuniform int lighting_uDirectionalLightCount;\n\nuniform bool lighting_uEnabled;\n\nfloat getPointLightAttenuation(PointLight pointLight, float distance) {\n  return pointLight.attenuation.x\n       + pointLight.attenuation.y * distance\n       + pointLight.attenuation.z * distance * distance;\n}\n\n#endif\n",r={lightSources:{}};function o(){let{color:t=[0,0,0],intensity:e=1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t.map((t=>t*e/255))}const s={name:"lights",vs:n,fs:n,getUniforms:function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:r;if("lightSources"in e){const{ambientLight:t,pointLights:i,directionalLights:n}=e.lightSources||{};return t||i&&i.length>0||n&&n.length>0?Object.assign({},function(t){let{ambientLight:e,pointLights:i=[],directionalLights:n=[]}=t;const r={};return r["lighting_uAmbientLight.color"]=e?o(e):[0,0,0],i.forEach(((t,e)=>{r["lighting_uPointLight[".concat(e,"].color")]=o(t),r["lighting_uPointLight[".concat(e,"].position")]=t.position,r["lighting_uPointLight[".concat(e,"].attenuation")]=t.attenuation||[1,0,0]})),r.lighting_uPointLightCount=i.length,n.forEach(((t,e)=>{r["lighting_uDirectionalLight[".concat(e,"].color")]=o(t),r["lighting_uDirectionalLight[".concat(e,"].direction")]=t.direction})),r.lighting_uDirectionalLightCount=n.length,r}({ambientLight:t,pointLights:i,directionalLights:n}),{lighting_uEnabled:!0}):{lighting_uEnabled:!1}}if("lights"in e){const i={pointLights:[],directionalLights:[]};for(const t of e.lights||[])switch(t.type){case"ambient":i.ambientLight=t;break;case"directional":i.directionalLights.push(t);break;case"point":i.pointLights.push(t)}return t({lightSources:i})}return{}},defines:{MAX_LIGHTS:3}}},78032:(t,e,i)=>{"use strict";i.d(e,{b:()=>n});const n={name:"pbr",vs:"uniform mat4 u_MVPMatrix;\nuniform mat4 u_ModelMatrix;\nuniform mat4 u_NormalMatrix;\n\nvarying vec3 pbr_vPosition;\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n# ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n# else\nvarying vec3 pbr_vNormal;\n# endif\n#endif\n\nvoid pbr_setPositionNormalTangentUV(vec4 position, vec4 normal, vec4 tangent, vec2 uv)\n{\n  vec4 pos = u_ModelMatrix * position;\n  pbr_vPosition = vec3(pos.xyz) / pos.w;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\n  vec3 normalW = normalize(vec3(u_NormalMatrix * vec4(normal.xyz, 0.0)));\n  vec3 tangentW = normalize(vec3(u_ModelMatrix * vec4(tangent.xyz, 0.0)));\n  vec3 bitangentW = cross(normalW, tangentW) * tangent.w;\n  pbr_vTBN = mat3(tangentW, bitangentW, normalW);\n#else\n  pbr_vNormal = normalize(vec3(u_ModelMatrix * vec4(normal.xyz, 0.0)));\n#endif\n#endif\n\n#ifdef HAS_UV\n  pbr_vUV = uv;\n#else\n  pbr_vUV = vec2(0.,0.);\n#endif\n}\n",fs:"#if defined(USE_TEX_LOD) && !defined(FEATURE_GLSL_TEXTURE_LOD)\n# error PBR fragment shader: Texture LOD is not available\n#endif\n\n#if !defined(HAS_TANGENTS) && !defined(FEATURE_GLSL_DERIVATIVES)\n# error PBR fragment shader: Derivatives are not available\n#endif\n\n\n#if (__VERSION__ < 300)\n  #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL1COND; INCR)\n#else\n  #define SMART_FOR(INIT, WEBGL1COND, WEBGL2COND, INCR) for (INIT; WEBGL2COND; INCR)\n#endif\n\nprecision highp float;\n\nuniform bool pbr_uUnlit;\n\n#ifdef USE_IBL\nuniform samplerCube u_DiffuseEnvSampler;\nuniform samplerCube u_SpecularEnvSampler;\nuniform sampler2D u_brdfLUT;\nuniform vec2 u_ScaleIBLAmbient;\n#endif\n\n#ifdef HAS_BASECOLORMAP\nuniform sampler2D u_BaseColorSampler;\n#endif\n#ifdef HAS_NORMALMAP\nuniform sampler2D u_NormalSampler;\nuniform float u_NormalScale;\n#endif\n#ifdef HAS_EMISSIVEMAP\nuniform sampler2D u_EmissiveSampler;\nuniform vec3 u_EmissiveFactor;
2\n#endif\n#ifdef HAS_METALROUGHNESSMAP\nuniform sampler2D u_MetallicRoughnessSampler;\n#endif\n#ifdef HAS_OCCLUSIONMAP\nuniform sampler2D u_OcclusionSampler;\nuniform float u_OcclusionStrength;\n#endif\n\n#ifdef ALPHA_CUTOFF\nuniform float u_AlphaCutoff;\n#endif\n\nuniform vec2 u_MetallicRoughnessValues;\nuniform vec4 u_BaseColorFactor;\n\nuniform vec3 u_Camera;\n#ifdef PBR_DEBUG\nuniform vec4 u_ScaleDiffBaseMR;\nuniform vec4 u_ScaleFGDSpec;\n#endif\n\nvarying vec3 pbr_vPosition;\n\nvarying vec2 pbr_vUV;\n\n#ifdef HAS_NORMALS\n#ifdef HAS_TANGENTS\nvarying mat3 pbr_vTBN;\n#else\nvarying vec3 pbr_vNormal;\n#endif\n#endif\n\n\nstruct PBRInfo\n{\n  float NdotL;\n  float NdotV;\n  float NdotH;\n  float LdotH;\n  float VdotH;\n  float perceptualRoughness;\n  float metalness;\n  vec3 reflectance0;\n  vec3 reflectance90;\n  float alphaRoughness;\n  vec3 diffuseColor;\n  vec3 specularColor;\n  vec3 n;\n  vec3 v;\n};\n\nconst float M_PI = 3.141592653589793;\nconst float c_MinRoughness = 0.04;\n\nvec4 SRGBtoLINEAR(vec4 srgbIn)\n{\n#ifdef MANUAL_SRGB\n#ifdef SRGB_FAST_APPROXIMATION\n  vec3 linOut = pow(srgbIn.xyz,vec3(2.2));\n#else\n  vec3 bLess = step(vec3(0.04045),srgbIn.xyz);\n  vec3 linOut = mix( srgbIn.xyz/vec3(12.92), pow((srgbIn.xyz+vec3(0.055))/vec3(1.055),vec3(2.4)), bLess );\n#endif\n  return vec4(linOut,srgbIn.w);;\n#else\n  return srgbIn;\n#endif\n}\n\nvec3 getNormal()\n{\n#ifndef HAS_TANGENTS\n  vec3 pos_dx = dFdx(pbr_vPosition);\n  vec3 pos_dy = dFdy(pbr_vPosition);\n  vec3 tex_dx = dFdx(vec3(pbr_vUV, 0.0));\n  vec3 tex_dy = dFdy(vec3(pbr_vUV, 0.0));\n  vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t);\n\n#ifdef HAS_NORMALS\n  vec3 ng = normalize(pbr_vNormal);\n#else\n  vec3 ng = cross(pos_dx, pos_dy);\n#endif\n\n  t = normalize(t - ng * dot(ng, t));\n  vec3 b = normalize(cross(ng, t));\n  mat3 tbn = mat3(t, b, ng);\n#else\n  mat3 tbn = pbr_vTBN;\n#endif\n\n#ifdef HAS_NORMALMAP\n  vec3 n = texture2D(u_NormalSampler, pbr_vUV).rgb;\n  n = normalize(tbn * ((2.0 * n - 1.0) * vec3(u_NormalScale, u_NormalScale, 1.0)));\n#else\n  vec3 n = normalize(tbn[2].xyz);\n#endif\n\n  return n;\n}\n\n\n#ifdef USE_IBL\nvec3 getIBLContribution(PBRInfo pbrInputs, vec3 n, vec3 reflection)\n{\n  float mipCount = 9.0;\n  float lod = (pbrInputs.perceptualRoughness * mipCount);\n  vec3 brdf = SRGBtoLINEAR(texture2D(u_brdfLUT,\n    vec2(pbrInputs.NdotV, 1.0 - pbrInputs.perceptualRoughness))).rgb;\n  vec3 diffuseLight = SRGBtoLINEAR(textureCube(u_DiffuseEnvSampler, n)).rgb;\n\n#ifdef USE_TEX_LOD\n  vec3 specularLight = SRGBtoLINEAR(textureCubeLod(u_SpecularEnvSampler, reflection, lod)).rgb;\n#else\n  vec3 specularLight = SRGBtoLINEAR(textureCube(u_SpecularEnvSampler, reflection)).rgb;\n#endif\n\n  vec3 diffuse = diffuseLight * pbrInputs.diffuseColor;\n  vec3 specular = specularLight * (pbrInputs.specularColor * brdf.x + brdf.y);\n  diffuse *= u_ScaleIBLAmbient.x;\n  specular *= u_ScaleIBLAmbient.y;\n\n  return diffuse + specular;\n}\n#endif\n\n\nvec3 diffuse(PBRInfo pbrInputs)\n{\n  return pbrInputs.diffuseColor / M_PI;\n}\n\nvec3 specularReflection(PBRInfo pbrInputs)\n{\n  return pbrInputs.reflectance0 +\n    (pbrInputs.reflectance90 - pbrInputs.reflectance0) *\n    pow(clamp(1.0 - pbrInputs.VdotH, 0.0, 1.0), 5.0);\n}\n\n\n\nfloat geometricOcclusion(PBRInfo pbrInputs)\n{\n  float NdotL = pbrInputs.NdotL;\n  float NdotV = pbrInputs.NdotV;\n  float r = pbrInputs.alphaRoughness;\n\n  float attenuationL = 2.0 * NdotL / (NdotL + sqrt(r * r + (1.0 - r * r) * (NdotL * NdotL)));\n  float attenuationV = 2.0 * NdotV / (NdotV + sqrt(r * r + (1.0 - r * r) * (NdotV * NdotV)));\n  return attenuationL * attenuationV;\n}\n\n\n\n\n\nfloat microfacetDistribution(PBRInfo pbrInputs)\n{\n  float roughnessSq = pbrInputs.alphaRoughness * pbrInputs.alphaRoughness;\n  float f = (pbrInputs.NdotH * roughnessSq - pbrInputs.NdotH) * pbrInputs.NdotH + 1.0;\n  return roughnessSq / (M_PI * f * f);\n}\n\nvoid PBRInfo_setAmbientLight(inout PBRInfo pbrInputs) {\n  pbrInputs.NdotL = 1.0;\n  pbrInputs.NdotH = 0.0;\n  pbrInputs.LdotH = 0.0;\n  pbrInputs.VdotH = 1.0;\n}\n\nvoid PBRInfo_setDirectionalLight(inout PBRInfo pbrInputs, vec3 lightDirection) {\n  vec3 n = pbrInputs.n;\n  vec3 v = pbrInputs.v;\n  vec3 l = normalize(lightDirection);\n  vec3 h = normalize(l+v);\n\n  pbrInputs.NdotL = clamp(dot(n, l), 0.001, 1.0);\n  pbrInputs.NdotH = clamp(dot(n, h), 0.0, 1.0);\n  pbrInputs.LdotH = clamp(dot(l, h), 0.0, 1.0);\n  pbrInputs.VdotH = clamp(dot(v, h), 0.0, 1.0);\n}\n\nvoid PBRInfo_setPointLight(inout PBRInfo pbrInputs, PointLight pointLight) {\n  vec3 light_direction = normalize(pointLight.position - pbr_vPosition);\n  PBRInfo_setDirectionalLight(pbrInputs, light_direction);\n}\n\nvec3 calculateFinalColor(PBRInfo pbrInputs, vec3 lightColor) {\n  vec3 F = specularReflection(pbrInputs);\n  float G = geometricOcclusion(pbrInputs);\n  float D = microfacetDistribution(pbrInputs);\n  vec3 diffuseContrib = (1.0 - F) * diffuse(pbrInputs);\n  vec3 specContrib = F * G * D / (4.0 * pbrInputs.NdotL * pbrInputs.NdotV);\n  return pbrInputs.NdotL * lightColor * (diffuseContrib + specContrib);\n}\n\nvec4 pbr_filterColor(vec4 colorUnused)\n{\n#ifdef HAS_BASECOLORMAP\n  vec4 baseColor = SRGBtoLINEAR(texture2D(u_BaseColorSampler, pbr_vUV)) * u_BaseColorFactor;
2\n#else\n  vec4 baseColor = u_BaseColorFactor;\n#endif\n\n#ifdef ALPHA_CUTOFF\n  if (baseColor.a < u_AlphaCutoff) {\n    discard;\n  }\n#endif\n\n  vec3 color = vec3(0, 0, 0);\n\n  if(pbr_uUnlit){\n    color.rgb = baseColor.rgb;\n  }\n  else{\n\n\n    float perceptualRoughness = u_MetallicRoughnessValues.y;\n    float metallic = u_MetallicRoughnessValues.x;\n#ifdef HAS_METALROUGHNESSMAP\n\n    vec4 mrSample = texture2D(u_MetallicRoughnessSampler, pbr_vUV);\n    perceptualRoughness = mrSample.g * perceptualRoughness;\n    metallic = mrSample.b * metallic;\n#endif\n    perceptualRoughness = clamp(perceptualRoughness, c_MinRoughness, 1.0);\n    metallic = clamp(metallic, 0.0, 1.0);\n\n    float alphaRoughness = perceptualRoughness * perceptualRoughness;\n\n    vec3 f0 = vec3(0.04);\n    vec3 diffuseColor = baseColor.rgb * (vec3(1.0) - f0);\n    diffuseColor *= 1.0 - metallic;\n    vec3 specularColor = mix(f0, baseColor.rgb, metallic);\n    float reflectance = max(max(specularColor.r, specularColor.g), specularColor.b);\n\n\n\n    float reflectance90 = clamp(reflectance * 25.0, 0.0, 1.0);\n    vec3 specularEnvironmentR0 = specularColor.rgb;\n    vec3 specularEnvironmentR90 = vec3(1.0, 1.0, 1.0) * reflectance90;\n\n    vec3 n = getNormal();\n    vec3 v = normalize(u_Camera - pbr_vPosition);\n\n    float NdotV = clamp(abs(dot(n, v)), 0.001, 1.0);\n    vec3 reflection = -normalize(reflect(v, n));\n\n    PBRInfo pbrInputs = PBRInfo(\n      0.0,\n      NdotV,\n      0.0,\n      0.0,\n      0.0,\n      perceptualRoughness,\n      metallic,\n      specularEnvironmentR0,\n      specularEnvironmentR90,\n      alphaRoughness,\n      diffuseColor,\n      specularColor,\n      n,\n      v\n    );\n\n#ifdef USE_LIGHTS\n    PBRInfo_setAmbientLight(pbrInputs);\n    color += calculateFinalColor(pbrInputs, lighting_uAmbientLight.color);\n    SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uDirectionalLightCount, i++) {\n      if (i < lighting_uDirectionalLightCount) {\n        PBRInfo_setDirectionalLight(pbrInputs, lighting_uDirectionalLight[i].direction);\n        color += calculateFinalColor(pbrInputs, lighting_uDirectionalLight[i].color);\n      }\n    }\n    SMART_FOR(int i = 0, i < MAX_LIGHTS, i < lighting_uPointLightCount, i++) {\n      if (i < lighting_uPointLightCount) {\n        PBRInfo_setPointLight(pbrInputs, lighting_uPointLight[i]);\n        float attenuation = getPointLightAttenuation(lighting_uPointLight[i], distance(lighting_uPointLight[i].position, pbr_vPosition));\n        color += calculateFinalColor(pbrInputs, lighting_uPointLight[i].color / attenuation);\n      }\n    }\n#endif\n#ifdef USE_IBL\n    color += getIBLContribution(pbrInputs, n, reflection);\n#endif\n#ifdef HAS_OCCLUSIONMAP\n    float ao = texture2D(u_OcclusionSampler, pbr_vUV).r;\n    color = mix(color, color * ao, u_OcclusionStrength);\n#endif\n\n#ifdef HAS_EMISSIVEMAP\n    vec3 emissive = SRGBtoLINEAR(texture2D(u_EmissiveSampler, pbr_vUV)).rgb * u_EmissiveFactor;\n    color += emissive;\n#endif\n\n#ifdef PBR_DEBUG\n\n\n\n\n\n    color = mix(color, baseColor.rgb, u_ScaleDiffBaseMR.y);\n    color = mix(color, vec3(metallic), u_ScaleDiffBaseMR.z);\n    color = mix(color, vec3(perceptualRoughness), u_ScaleDiffBaseMR.w);\n#endif\n\n  }\n\n  return vec4(pow(color,vec3(1.0/2.2)), baseColor.a);\n}\n",defines:{LIGHTING_FRAGMENT:1},dependencies:[i(45986).H]}},54976:(t,e,i)=>{"use strict";i.d(e,{N:()=>a,s:()=>l});var n=i(45986);const r="\nuniform float lighting_uAmbient;\nuniform float lighting_uDiffuse;\nuniform float lighting_uShininess;\nuniform vec3  lighting_uSpecularColor;\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 light_direction, vec3 view_direction, vec3 normal_worldspace, vec3 color) {\n    vec3 halfway_direction = normalize(light_direction + view_direction);\n    float lambertian = dot(light_direction, normal_worldspace);\n    float specular = 0.0;\n    if (lambertian > 0.0) {\n      float specular_angle = max(dot(normal_worldspace, halfway_direction), 0.0);\n      specular = pow(specular_angle, lighting_uShininess);\n    }\n    lambertian = max(lambertian, 0.0);\n    return (lambertian * lighting_uDiffuse * surfaceColor + specular * lighting_uSpecularColor) * color;\n}\n\nvec3 lighting_getLightColor(vec3 surfaceColor, vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n  vec3 lightColor = surfaceColor;\n\n  if (lighting_uEnabled) {\n    vec3 view_direction = normalize(cameraPosition - position_worldspace);\n    lightColor = lighting_uAmbient * surfaceColor * lighting_uAmbientLight.color;\n\n    for (int i = 0; i < MAX_LIGHTS;
2 i++) {\n      if (i >= lighting_uPointLightCount) {\n        break;\n      }\n      PointLight pointLight = lighting_uPointLight[i];\n      vec3 light_position_worldspace = pointLight.position;\n      vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n      lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n    }\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uDirectionalLightCount) {\n        break;\n      }\n      DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n      lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n    }\n  }\n  return lightColor;\n}\n\nvec3 lighting_getSpecularLightColor(vec3 cameraPosition, vec3 position_worldspace, vec3 normal_worldspace) {\n  vec3 lightColor = vec3(0, 0, 0);\n  vec3 surfaceColor = vec3(0, 0, 0);\n\n  if (lighting_uEnabled) {\n    vec3 view_direction = normalize(cameraPosition - position_worldspace);\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uPointLightCount) {\n        break;\n      }\n      PointLight pointLight = lighting_uPointLight[i];\n      vec3 light_position_worldspace = pointLight.position;\n      vec3 light_direction = normalize(light_position_worldspace - position_worldspace);\n      lightColor += lighting_getLightColor(surfaceColor, light_direction, view_direction, normal_worldspace, pointLight.color);\n    }\n\n    for (int i = 0; i < MAX_LIGHTS; i++) {\n      if (i >= lighting_uDirectionalLightCount) {\n        break;\n      }\n      DirectionalLight directionalLight = lighting_uDirectionalLight[i];\n      lightColor += lighting_getLightColor(surfaceColor, -directionalLight.direction, view_direction, normal_worldspace, directionalLight.color);\n    }\n  }\n  return lightColor;\n}\n",o={};function s(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o;if(!("material"in t))return{};const{material:e}=t;return e?function(t){const{ambient:e=.35,diffuse:i=.6,shininess:n=32,specularColor:r=[30,30,30]}=t;return{lighting_uAmbient:e,lighting_uDiffuse:i,lighting_uShininess:n,lighting_uSpecularColor:r.map((t=>t/255))}}(e):{lighting_uEnabled:!1}}const a={name:"gouraud-lighting",dependencies:[n.H],vs:r,defines:{LIGHTING_VERTEX:1},getUniforms:s},l={name:"phong-lighting",dependencies:[n.H],fs:r,defines:{LIGHTING_FRAGMENT:1},getUniforms:s}},17865:(t,e,i)=>{"use strict";function n(t,e){if(!t)throw new Error(e||"shadertools: assertion failed.")}i.d(e,{Z:()=>n})},77462:(t,e,i)=>{"use strict";i.d(e,{Z:()=>l});var n=i(75946),r=i(81301),o=i(80182);const s={offset:0,stride:0,type:5126,size:1,divisor:0,normalized:!1,integer:!1},a={deprecatedProps:{instanced:"divisor",isInstanced:"divisor"}};class l{static getBytesPerElement(t){return(0,n.vN)(t.type||5126).BYTES_PER_ELEMENT}static getBytesPerVertex(t){(0,r.h)(t.size);return(0,n.vN)(t.type||5126).BYTES_PER_ELEMENT*t.size}static resolve(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];return new l(...[s,...e])}constructor(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];e.forEach((t=>this._assign(t))),Object.freeze(this)}toString(){return JSON.stringify(this)}get BYTES_PER_ELEMENT(){return l.getBytesPerElement(this)}get BYTES_PER_VERTEX(){return l.getBytesPerVertex(this)}_assign(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=(0,o.k)("Accessor",t,a),void 0!==t.type&&(this.type=t.type,5124!==t.type&&5125!==t.type||(this.integer=!0)),void 0!==t.size&&(this.size=t.size),void 0!==t.offset&&(this.offset=t.offset),void 0!==t.stride&&(this.stride=t.stride),void 0!==t.normalized&&(this.normalized=t.normalized),void 0!==t.integer&&(this.integer=t.integer),void 0!==t.divisor&&(this.divisor=t.divisor),void 0!==t.buffer&&(this.buffer=t.buffer),void 0!==t.index&&("boolean"===typeof t.index?this.index=t.index?1:0:this.index=t.index),void 0!==t.instanced&&(this.divisor=t.instanced?1:0),void 0!==t.isInstanced&&(this.divisor=t.isInstanced?1:0),this}}},33839:(t,e,i)=>{"use strict";i.d(e,{Z:()=>d});var n=i(35572),r=i(77462),o=i(75946),s=i(28007),a=i(81301),l=i(80182);const c={offset:"accessor.offset",stride:"accessor.stride",type:"accessor.type",size:"accessor.size",divisor:"accessor.divisor",normalized:"accessor.normalized",integer:"accessor.integer",instanced:"accessor.divisor",isInstanced:"accessor.divisor"},u={removedProps:{},replacedProps:{bytes:"byteLength"},deprecatedProps:c},h={removedProps:c};class d extends n.Z{get[Symbol.toStringTag](){return"Buffer"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Buffer","v6.0",["layout","setLayout","getIndexedParameter"]),this.target=e.target||(this.gl.webgl2?36662:34962),this.initialize(e),Object.seal(this)}getElementCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/r.Z.getBytesPerElement(t))}getVertexCount(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.accessor;return Math.round(this.byteLength/r.Z.getBytesPerVertex(t))}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ArrayBuffer.isView(t)&&(t={data:t}),Number.isFinite(t)&&(t={byteLength:t}),t=(0,l.k)("Buffer",t,u),this.usage=t.usage||35044,this.debugData=null,this.setAccessor(Object.assign({},t,t.accessor)),t.data?this._setData(t.data,t.offset,t.byteLength):this._setByteLength(t.byteLength||0),this}setProps(t){return"accessor"in(t=(0,l.k)("Buffer",t,h))&&this.setAccessor(t.accessor),this}setAccessor(t){return delete(t=Object.assign({},t)).buffer,this.accessor=new r.Z(t),this}reallocate(t){return t>this.byteLength?(this._setByteLength(t),!0):(this.bytesUsed=t,!1)}setData(t){return this.initialize(t)}subData(t){ArrayBuffer.isView(t)&&(t={data:t});const{data:e,offset:i=0,srcOffset:n=0}=t,r=t.byteLength||t.length;(0,a.h)(e);const o=this.gl.webgl2?36663:this.target;return this.gl.bindBuffer(o,this.handle),0!==n||void 0!==r?((0,s.KQ)(this.gl),this.gl.bufferSubData(this.target,i,e,n,r)):this.gl.bufferSubData(o,i,e),this.gl.bindBuffer(o,null),this.debugData=null,this._inferType(e),this}copyData(t){let{sourceBuffer:e,readOffset:i=0,writeOffset:n=0,size:r}=t;const{gl:o}=this;return(0,s.KQ)(o),o.bindBuffer(36662,e.handle),o.bindBuffer(36663,this.handle),o.copyBufferSubData(36662,36663,i,n,r),o.bindBuffer(36662,null),o.bindBuffer(36663,null),this.debugData=null,this}getData(){let{dstData:t=null,srcByteOffset:e=0,dstOffset:i=0,length:n=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.KQ)(this.gl);const r=(0,o.vN)(this.accessor.type||5126,{clamped:!1}),l=this._getAvailableElementCount(e),c=i;let u,h;t?(h=t.length,u=h-c):(u=Math.min(l,n||l),h=c+u);const d=Math.min(l,u);return n=n||d,(0,a.h)(n<=d),t=t||new r(h),this.gl.bindBuffer(36662,this.handle),this.gl.getBufferSubData(36662,e,t,i,n),this.gl.bindBuffer(36662,null),t}bind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index,offset:i=0,size:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?void 0!==n?this.gl.bindBufferRange(t,e,this.handle,i,n):((0,a.h)(0===i),this.gl.bindBufferBase(t,e,this.handle)):this.gl.bindBuffer(t,this.handle),this}unbind(){let{target:t=this.target,index:e=this.accessor&&this.accessor.index}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return 35345===t||35982===t?this.gl.bindBufferBase(t,e,null):this.gl.bindBuffer(t,null),this}getDebugData(){return this.debugData?{data:this.debugData,changed:!1}:(this.debugData=this.getData({length:Math.min(10,this.byteLength)}),{data:this.debugData,changed:!0})}invalidateDebugData(){this.debugData=null}_setData(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.byteLength+e;(0,a.h)(ArrayBuffer.isView(t)),this._trackDeallocatedMemory();const n=this._getTarget();this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,i,this.usage),this.gl.bufferSubData(n,e,t),this.gl.bindBuffer(n,null),this.debugData=t.slice(0,10),this.bytesUsed=i,this._trackAllocatedMemory(i);const s=(0,o.O)(t);return(0,a.h)(s),this.setAccessor(new r.Z(this.accessor,{type:s})),this}_setByteLength(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.usage;(0,a.h)(t>=0),this._trackDeallocatedMemory();let i=t;0===t&&(i=new Float32Array(0));const n=this._getTarget();return this.gl.bindBuffer(n,this.handle),this.gl.bufferData(n,i,e),this.gl.bindBuffer(n,null),this.usage=e,this.debugData=null,this.bytesUsed=t,this._trackAllocatedMemory(t),this}_getTarget(){return this.gl.webgl2?36663:this.target}_getAvailableElementCount(t){const e=t/(0,o.vN)(this.accessor.type||5126,{clamped:!1}).BYTES_PER_ELEMENT;return this.getElementCount()-e}_inferType(t){this.accessor.type||this.setAccessor(new r.Z(this.accessor,{type:(0,o.O)(t)}))}_createHandle(){return this.gl.createBuffer()}_deleteHandle(){this.gl.deleteBuffer(this.handle),this._trackDeallocatedMemory()}_getParameter(t){this.gl.bindBuffer(this.target,this.handle);const e=this.gl.getBufferParameter(this.target,t);return this.gl.bindBuffer(this.target,null),e}get type(){return s.cM.deprecated("Buffer.type","Buffer.accessor.type")(),this.accessor.type}get bytes(){return s.cM.deprecated("Buffer.bytes","Buffer.byteLength")(),this.byteLength}setByteLength(t){return s.cM.deprecated("setByteLength","reallocate")(),this.reallocate(t)}updateAccessor(t){return s.cM.deprecated("updateAccessor(...)","setAccessor(new Accessor(buffer.accessor, ...)")(),this.accessor=new r.Z(this.accessor,t),this}}},97756:(t,e,i)=>{"use strict";i.d(e,{$:()=>A,Z:()=>p});var n=i(28007),r=i(81301);const o=256,s=1024,a=16384,l=6144,c=6145,u=6146,h=34041,d="clear: bad arguments";function p(t){let{framebuffer:e=null,color:i=null,depth:l=null,stencil:c=null}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const u={};e&&(u.framebuffer=e);let h=0;i&&(h|=a,!0!==i&&(u.clearColor=i)),l&&(h|=o,!0!==l&&(u.clearDepth=l)),c&&(h|=s,!0!==l&&(u.clearStencil=l)),(0,r.h)(0!==h,d),(0,n.s8)(t,u,(()=>{t.clear(h)}))}function A(t){let{framebuffer:e=null,buffer:i=l,drawBuffer:o=0,value:s=[0,0,0,0]}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.KQ)(t),(0,n.s8)(t,{framebuffer:e},(()=>{switch(i){case l:switch(s.constructor){case Int32Array:t.clearBufferiv(i,o,s);break;case Uint32Array:t.clearBufferuiv(i,o,s);break;
2case Float32Array:default:t.clearBufferfv(i,o,s)}break;case c:t.clearBufferfv(c,0,[s]);break;case u:t.clearBufferiv(u,0,[s]);break;case h:const[e,n]=s;t.clearBufferfi(h,0,e,n);break;default:(0,r.h)(!1,d)}}))}},56474:(t,e,i)=>{"use strict";i.d(e,{Km:()=>p,Lv:()=>A,z6:()=>h,Jb:()=>d});var n=i(33839),r=i(79078),o=i(51055),s=i(28007),a=i(75946),l=i(81301);function c(t){switch(t){case 6406:case 33326:case 6403:return 1;case 33328:case 33319:return 2;case 6407:case 34837:return 3;case 6408:case 34836:return 4;default:return(0,l.h)(!1),0}}var u=i(17507);function h(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sourceX:i=0,sourceY:n=0,sourceFormat:r=6408}=e;let{sourceAttachment:o=36064,target:s=null,sourceWidth:u,sourceHeight:h,sourceType:d}=e;const{framebuffer:p,deleteFramebuffer:A}=f(t);(0,l.h)(p);const{gl:g,handle:m,attachments:y}=p;u=u||p.width,h=h||p.height,36064===o&&null===m&&(o=1028),(0,l.h)(y[o]),d=d||y[o].type,s=function(t,e,i,n,r){if(t)return t;e=e||5121;const o=(0,a.vN)(e,{clamped:!1}),s=c(i);return new o(n*r*s)}(s,d,r,u,h),d=d||(0,a.O)(s);const v=g.bindFramebuffer(36160,m);return g.readPixels(i,n,u,h,r,d,s),g.bindFramebuffer(36160,v||null),A&&p.delete(),s}function d(t,e){let{sourceX:i=0,sourceY:r=0,sourceFormat:o=6408,target:a=null,targetByteOffset:u=0,sourceWidth:h,sourceHeight:d,sourceType:p}=e;const{framebuffer:A,deleteFramebuffer:g}=f(t);(0,l.h)(A),h=h||A.width,d=d||A.height;const m=(0,s.KQ)(A.gl);if(p=p||(a?a.type:5121),!a){const t=c(o),e=function(t){switch(t){case 5121:return 1;case 33635:case 32819:case 32820:return 2;case 5126:return 4;default:return(0,l.h)(!1),0}}(p),i=u+h*d*t*e;a=new n.Z(m,{byteLength:i,accessor:{type:p,size:t}})}return a.bind({target:35051}),(0,s.s8)(m,{framebuffer:A},(()=>{m.readPixels(i,r,h,d,o,p,u)})),a.unbind({target:35051}),g&&A.delete(),a}function p(t){let{sourceAttachment:e=36064,targetMaxHeight:i=Number.MAX_SAFE_INTEGER}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=h(t,{sourceAttachment:e}),{width:r,height:o}=t;for(;o>i;)({data:n,width:r,height:o}=(0,a.KS)({data:n,width:r,height:o}));(0,a.c$)({data:n,width:r,height:o});const s=document.createElement("canvas");s.width=r,s.height=o;const l=s.getContext("2d"),c=l.createImageData(r,o);return c.data.set(n),l.putImageData(c,0,0),s.toDataURL()}function A(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{sourceX:n=0,sourceY:r=0,targetMipmaplevel:a=0,targetInternalFormat:c=6408}=i;let{targetX:u,targetY:h,targetZ:d,width:p,height:A}=i;const{framebuffer:g,deleteFramebuffer:m}=f(t);(0,l.h)(g);const{gl:y,handle:v}=g,_="undefined"!==typeof u||"undefined"!==typeof h||"undefined"!==typeof d;u=u||0,h=h||0,d=d||0;const b=y.bindFramebuffer(36160,v);(0,l.h)(e);let x=null;if(e instanceof o.Z&&(x=e,p=Number.isFinite(p)?p:x.width,A=Number.isFinite(A)?A:x.height,x.bind(0),e=x.target),_)switch(e){case 3553:case 34067:y.copyTexSubImage2D(e,a,u,h,n,r,p,A);break;case 35866:case 32879:(0,s.KQ)(y).copyTexSubImage3D(e,a,u,h,d,n,r,p,A)}else y.copyTexImage2D(e,a,c,n,r,p,A,0);return x&&x.unbind(),y.bindFramebuffer(36160,b||null),m&&g.delete(),x}function f(t){return t instanceof r.Z?{framebuffer:t,deleteFramebuffer:!1}:{framebuffer:(0,u.Y)(t),deleteFramebuffer:!0}}},79078:(t,e,i)=>{"use strict";i.d(e,{Z:()=>p});var n=i(28007),r=i(35572),o=i(58300),s=i(38332),a=i(97756),l=i(56474),c=i(12308),u=i(55888),h=i(81301);const d="Multiple render targets not supported";class p extends r.Z{get[Symbol.toStringTag](){return"Framebuffer"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{colorBufferFloat:i,colorBufferHalfFloat:n}=e;let r=!0;return i&&(r=Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("WEBGL_color_buffer_float")||t.getExtension("OES_texture_float"))),n&&(r=r&&Boolean(t.getExtension("EXT_color_buffer_float")||t.getExtension("EXT_color_buffer_half_float"))),r}static getDefaultFramebuffer(t){return t.luma=t.luma||{},t.luma.defaultFramebuffer=t.luma.defaultFramebuffer||new p(t,{id:"default-framebuffer",handle:null,attachments:{}}),t.luma.defaultFramebuffer}get MAX_COLOR_ATTACHMENTS(){const t=(0,n.KQ)(this.gl);return t.getParameter(t.MAX_COLOR_ATTACHMENTS)}get MAX_DRAW_BUFFERS(){const t=(0,n.KQ)(this.gl);return t.getParameter(t.MAX_DRAW_BUFFERS)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.width=null,this.height=null,this.attachments={},this.readBuffer=36064,this.drawBuffers=[36064],this.ownResources=[],this.initialize(e),Object.seal(this)}get color(){return this.attachments[36064]||null}get texture(){return this.attachments[36064]||null}get depth(){return this.attachments[36096]||this.attachments[33306]||null}get stencil(){return this.attachments[36128]||this.attachments[33306]||null}initialize(t){let{width:e=1,height:i=1,attachments:n=null,color:r=!0,depth:o=!0,stencil:s=!1,check:a=!0,readBuffer:l,drawBuffers:c}=t;if((0,h.h)(e>=0&&i>=0,"Width and height need to be integers"),this.width=e,this.height=i,n)for(const u in n){const t=n[u];(Array.isArray(t)?t[0]:t).resize({width:e,height:i})}else n=this._createDefaultAttachments(r,o,s,e,i);this.update({clearAttachments:!0,attachments:n,readBuffer:l,drawBuffers:c}),n&&a&&this.checkStatus()}delete(){for(const t of this.ownResources)t.delete();return super.delete(),this}update(t){let{attachments:e={},readBuffer:i,drawBuffers:n,clearAttachments:r=!1,resizeAttachments:o=!0}=t;this.attach(e,{clearAttachments:r,resizeAttachments:o});const{gl:s}=this,a=s.bindFramebuffer(36160,this.handle);return i&&this._setReadBuffer(i),n&&this._setDrawBuffers(n),s.bindFramebuffer(36160,a||null),this}resize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{width:e,height:i}=t;if(null===this.handle)return(0,h.h)(void 0===e&&void 0===i),this.width=this.gl.drawingBufferWidth,this.height=this.gl.drawingBufferHeight,this;void 0===e&&(e=this.gl.drawingBufferWidth),void 0===i&&(i=this.gl.drawingBufferHeight),e!==this.width&&i!==this.height&&n.cM.log(2,"Re
2sizing framebuffer ".concat(this.id," to ").concat(e,"x").concat(i))();for(const n in this.attachments)this.attachments[n].resize({width:e,height:i});return this.width=e,this.height=i,this}attach(t){let{clearAttachments:e=!1,resizeAttachments:i=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n={};e&&Object.keys(this.attachments).forEach((t=>{n[t]=null})),Object.assign(n,t);const r=this.gl.bindFramebuffer(36160,this.handle);for(const o in n){(0,h.h)(void 0!==o,"Misspelled framebuffer binding point?");const t=Number(o),e=n[t];let r=e;if(r)if(r instanceof s.Z)this._attachRenderbuffer({attachment:t,renderbuffer:r});else if(Array.isArray(e)){const[i,n=0,o=0]=e;r=i,this._attachTexture({attachment:t,texture:i,layer:n,level:o})}else this._attachTexture({attachment:t,texture:r,layer:0,level:0});else this._unattach(t);i&&r&&r.resize({width:this.width,height:this.height})}this.gl.bindFramebuffer(36160,r||null),Object.assign(this.attachments,t),Object.keys(this.attachments).filter((t=>!this.attachments[t])).forEach((t=>{delete this.attachments[t]}))}checkStatus(){const{gl:t}=this,e=this.getStatus();if(36053!==e)throw new Error(function(t){return(p.STATUS||{})[t]||"Framebuffer error ".concat(t)}(e));return this}getStatus(){const{gl:t}=this,e=t.bindFramebuffer(36160,this.handle),i=t.checkFramebufferStatus(36160);return t.bindFramebuffer(36160,e||null),i}clear(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{color:e,depth:i,stencil:n,drawBuffers:r=[]}=t,o=this.gl.bindFramebuffer(36160,this.handle);return(e||i||n)&&(0,a.Z)(this.gl,{color:e,depth:i,stencil:n}),r.forEach(((t,e)=>{(0,a.$)(this.gl,{drawBuffer:e,value:t})})),this.gl.bindFramebuffer(36160,o||null),this}readPixels(){return n.cM.error("Framebuffer.readPixels() is no logner supported, use readPixelsToArray(framebuffer)")(),null}readPixelsToBuffer(){return n.cM.error("Framebuffer.readPixelsToBuffer()is no logner supported, use readPixelsToBuffer(framebuffer)")(),null}copyToDataUrl(){return n.cM.error("Framebuffer.copyToDataUrl() is no logner supported, use copyToDataUrl(framebuffer)")(),null}copyToImage(){return n.cM.error("Framebuffer.copyToImage() is no logner supported, use copyToImage(framebuffer)")(),null}copyToTexture(){return n.cM.error("Framebuffer.copyToTexture({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}blit(){return n.cM.error("Framebuffer.blit({...}) is no logner supported, use blit(source, target, opts)")(),null}invalidate(t){let{attachments:e=[],x:i=0,y:r=0,width:o,height:s}=t;const a=(0,n.KQ)(this.gl),l=a.bindFramebuffer(36008,this.handle);return 0===i&&0===r&&void 0===o&&void 0===s?a.invalidateFramebuffer(36008,e):a.invalidateFramebuffer(36008,e,i,r,o,s),a.bindFramebuffer(36008,l),this}getAttachmentParameter(t,e,i){let n=this._getAttachmentParameterFallback(e);return null===n&&(this.gl.bindFramebuffer(36160,this.handle),n=this.gl.getFramebufferAttachmentParameter(36160,t,e),this.gl.bindFramebuffer(36160,null)),i&&n>1e3&&(n=(0,u.km)(this.gl,n)),n}getAttachmentParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:36064,e=arguments.length>1?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.constructor.ATTACHMENT_PARAMETERS||[];const n={};for(const r of i){n[e?(0,u.km)(this.gl,r):r]=this.getAttachmentParameter(t,r,e)}return n}getParameters(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const e=Object.keys(this.attachments),i={};for(const n of e){const e=Number(n);i[t?(0,u.km)(this.gl,e):e]=this.getAttachmentParameters(e,t)}return i}show(){return"undefined"!==typeof window&&window.open((0,l.Km)(this),"luma-debug-texture"),this}log(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(t>n.cM.level||"undefined"===typeof window)return this;e=e||"Framebuffer ".concat(this.id);const i=(0,l.Km)(this,{targetMaxHeight:100});return n.cM.image({logLevel:t,message:e,image:i},e)(),this}bind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,this.handle),this}unbind(){let{target:t=36160}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.gl.bindFramebuffer(t,null),this}_createDefaultAttachments(t,e,i,n,r){let a=null;return t&&(a=a||{},a[36064]=new o.Z(this.gl,{id:"".concat(this.id,"-color0"),pixels:null,format:6408,type:5121,width:n,height:r,mipmaps:!1,parameters:{10241:9729,10240:9729,10242:33071,10243:33071}}),this.ownResources.push(a[36064])),e&&i?(a=a||{},a[33306]=new s.Z(this.gl,{id:"".concat(this.id,"-depth-stencil"),format:35056,width:n,height:111}),this.ownResources.push(a[33306])):e?(a=a||{},a[36096]=new s.Z(this.gl,{id:"".concat(this.id,"-depth"),format:33189,width:n,height:r}),this.ownResources.push(a[36096])):i&&(0,h.h)(!1),a}_unattach(t){const e=this.attachments[t];e&&(e instanceof s.Z?this.gl.framebufferRenderbuffer(36160,t,36161,null):this.gl.framebufferTexture2D(36160,t,3553,null,0),delete this.attachments[t])}_attachRenderbuffer(t){let{attachment:e=36064,renderbuffer:i}=t;const{gl:n}=this;n.framebufferRenderbuffer(36160,e,36161,i.handle),this.attachments[e]=i}_attachTexture(t){let{attachment:e=36064,texture:i,layer:r,level:o}=t;const{gl:s}=this;switch(s.bindTexture(i.target,i.handle),i.target){case 35866:case 32879:(0,n.KQ)(s).framebufferTextureLayer(36160,e,i.target,o,r);break;case 34067:const t=function(t){return t<34069?t+34069:t}(r);s.framebufferTexture2D(36160,e,t,i.handle,o);break;case 3553:s.framebufferTexture2D(36160,e,3553,i.handle,o);break;default:(0,h.h)(!1,"Illegal texture type")}s.bindTexture(i.target,null),this.attachments[e]=i}_setReadBuffer(t){const e=(0,n.vd)(this.gl);e?e.readBuffer(t):(0,h.h)(36064===t||1029===t,d),this.readBuffer=t}_setDrawBuffers(t){const{gl:e}=this,i=(0,n.KQ)(e);if(i)i.drawBuffers(t);else{const i=e.getExtension("WEBGL_draw_buffers");i?i.drawBuffersWEBGL(t):(0,h.h)(1===t.length&&(36064===t[0]||1029===t[0]),d)}this.drawBuffers=t}_getAttachmentParameterFallback(t){const e=(0,c.N$)(this.gl);switch(t){case 36052:return e.WEBGL2?null:0;case 33298:case 33299:case 33300:case 33301:case 33302:case 33303:return e.WEBGL2?null:8;case 33297:return e.WEBGL2?null:5125;case 33296:return e.WEBGL2||e.EXT_sRGB?null:9729;default:return null}}_createHandle(){return this.gl.createFramebuffer()}_deleteHandle(){this.gl.deleteFramebuffer(this.handle)}_bindHandle(t){return this.gl.bindFramebuffer(36160,t)}}
2p.ATTACHMENT_PARAMETERS=[36049,36048,33296,33298,33299,33300,33301,33302,33303]},79817:(t,e,i)=>{"use strict";i.d(e,{Z:()=>Z});var n=i(35572),r=i(51055),o=i(79078),s=i(28007),a=i(38332),l=i(81301);const c={5126:w.bind(null,"uniform1fv",f,1,C),35664:w.bind(null,"uniform2fv",f,2,C),35665:w.bind(null,"uniform3fv",f,3,C),35666:w.bind(null,"uniform4fv",f,4,C),5124:w.bind(null,"uniform1iv",g,1,C),35667:w.bind(null,"uniform2iv",g,2,C),35668:w.bind(null,"uniform3iv",g,3,C),35669:w.bind(null,"uniform4iv",g,4,C),35670:w.bind(null,"uniform1iv",g,1,C),35671:w.bind(null,"uniform2iv",g,2,C),35672:w.bind(null,"uniform3iv",g,3,C),35673:w.bind(null,"uniform4iv",g,4,C),35674:w.bind(null,"uniformMatrix2fv",f,4,B),35675:w.bind(null,"uniformMatrix3fv",f,9,B),35676:w.bind(null,"uniformMatrix4fv",f,16,B),35678:x,35680:x,5125:w.bind(null,"uniform1uiv",m,1,C),36294:w.bind(null,"uniform2uiv",m,2,C),36295:w.bind(null,"uniform3uiv",m,3,C),36296:w.bind(null,"uniform4uiv",m,4,C),35685:w.bind(null,"uniformMatrix2x3fv",f,6,B),35686:w.bind(null,"uniformMatrix2x4fv",f,8,B),35687:w.bind(null,"uniformMatrix3x2fv",f,6,B),35688:w.bind(null,"uniformMatrix3x4fv",f,12,B),35689:w.bind(null,"uniformMatrix4x2fv",f,8,B),35690:w.bind(null,"uniformMatrix4x3fv",f,12,B),35678:x,35680:x,35679:x,35682:x,36289:x,36292:x,36293:x,36298:x,36299:x,36300:x,36303:x,36306:x,36307:x,36308:x,36311:x},u={},h={},d={},p=[0];function A(t,e,i,n){1===e&&"boolean"===typeof t&&(t=t?1:0),Number.isFinite(t)&&(p[0]=t,t=p);const r=t.length;if(r%e&&s.cM.warn("Uniform size should be multiples of ".concat(e),t)(),t instanceof i)return t;let o=n[r];o||(o=new i(r),n[r]=o);for(let s=0;s<r;s++)o[s]=t[s];return o}function f(t,e){return A(t,e,Float32Array,u)}function g(t,e){return A(t,e,Int32Array,h)}function m(t,e){return A(t,e,Uint32Array,d)}function y(t,e,i){const n=c[i.type];if(!n)throw new Error("Unknown GLSL uniform type ".concat(i.type));return n().bind(null,t,e)}function v(t){if("]"!==t[t.length-1])return{name:t,length:1,isArray:!1};const e=t.match(/([^[]*)(\[[0-9]+\])?/);if(!e||e.length<2)throw new Error("Failed to parse GLSL uniform name ".concat(t));return{name:e[1],length:e[2]||1,isArray:Boolean(e[2])}}function _(t){return Array.isArray(t)||ArrayBuffer.isView(t)?function(t){if(0===t.length)return!1;const e=Math.min(t.length,16);for(let i=0;i<e;++i)if(!Number.isFinite(t[i]))return!1;return!0}(t):!!isFinite(t)||(!0===t||!1===t||(t instanceof r.Z||(t instanceof a.Z||t instanceof o.Z&&Boolean(t.texture))))}function b(t,e,i){if(Array.isArray(i)||ArrayBuffer.isView(i))if(t[e]){const n=t[e];for(let t=0,e=i.length;t<e;++t)n[t]=i[t]}else t[e]=i.slice();else t[e]=i}function x(){let t=null;return(e,i,n)=>{const r=t!==n;return r&&(e.uniform1i(i,n),t=n),r}}function w(t,e,i,n){let r=null,o=null;return(s,a,c)=>{const u=e(c,i),h=u.length;let d=!1;if(null===r)r=new Float32Array(h),o=h,d=!0;else{(0,l.h)(o===h,"Uniform length cannot change.");for(let t=0;t<h;++t)if(u[t]!==r[t]){d=!0;break}}return d&&(n(s,t,a,u),r.set(u)),d}}function C(t,e,i,n){t[e](i,n)}function B(t,e,i,n){t[e](i,!1,n)}function E(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"unnamed";const i=t.match(/#define[\s*]SHADER_NAME[\s*]([A-Za-z0-9_-]+)[\s*]/);return i?i[1]:e}const S=35632,T=35633;function M(t,e,i,n){const r=t.split(/\r?\n/),o={},s={},a=n||E(e)||"(unnamed)",l="".concat(function(t){switch(t){case S:return"fragment";case T:return"vertex";default:return"unknown type"}}(i)," shader ").concat(a);for(let u=0;u<r.length;u++){const e=r[u];if(e.length<=1)continue;const i=e.split(":"),n=i[0],a=parseInt(i[2],10);if(isNaN(a))throw new Error("GLSL compilation error in ".concat(l,": ").concat(t));"WARNING"!==n?o[a]=e:s[a]=e}const c=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:": ";const n=t.split(/\r?\n/),r=String(n.length+e-1).length;return n.map(((t,n)=>{const o=String(n+e),s=o.length;return P(o,r-s)+i+t}))}(e);return{shaderName:l,errors:I(o,c),warnings:I(s,c)}}function I(t,e){let i="";for(let n=0;n<e.length;n++){const r=e[n];if((t[n+3]||t[n+2]||t[n+1])&&(i+="".concat(r,"\n"),t[n+1])){const e=t[n+1],r=e.split(":",3),o=r[0],s=parseInt(r[1],10)||0,a=e.substring(r.join(":").length+1).trim();i+=P("^^^ ".concat(o,": ").concat(a,"\n\n"),s)}}return i}function P(t,e){let i="";for(let n=0;n<e;++n)i+=" ";
2return"".concat(i).concat(t)}var D=i(79666);class L extends n.Z{get[Symbol.toStringTag](){return"Shader"}static getTypeName(t){switch(t){case 35633:return"vertex-shader";case 35632:return"fragment-shader";default:return(0,l.h)(!1),"unknown"}}constructor(t,e){(0,s.JD)(t),(0,l.h)("string"===typeof e.source,"Shader: GLSL source code must be a JavaScript string");super(t,{id:E(e.source,null)||e.id||(0,D.hQ)("unnamed ".concat(L.getTypeName(e.shaderType)))}),this.shaderType=e.shaderType,this.source=e.source,this.initialize(e)}initialize(t){let{source:e}=t;const i=E(e,null);i&&(this.id=(0,D.hQ)(i)),this._compile(e)}getParameter(t){return this.gl.getShaderParameter(this.handle,t)}toString(){return"".concat(L.getTypeName(this.shaderType),":").concat(this.id)}getName(){return E(this.source)||"unnamed-shader"}getSource(){return this.gl.getShaderSource(this.handle)}getTranslatedSource(){const t=this.gl.getExtension("WEBGL_debug_shaders");return t?t.getTranslatedShaderSource(this.handle):"No translated source available. WEBGL_debug_shaders not implemented"}_compile(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.source;t.startsWith("#version ")||(t="#version 100\n".concat(t)),this.source=t,this.gl.shaderSource(this.handle,this.source),this.gl.compileShader(this.handle);if(!this.getParameter(35713)){const t=this.gl.getShaderInfoLog(this.handle),{shaderName:e,errors:i,warnings:n}=M(t,this.source,this.shaderType,this.id);throw s.cM.error("GLSL compilation errors in ".concat(e,"\n").concat(i))(),s.cM.warn("GLSL compilation warnings in ".concat(e,"\n").concat(n))(),new Error("GLSL compilation errors in ".concat(e))}}_deleteHandle(){this.gl.deleteShader(this.handle)}_getOptsFromHandle(){return{type:this.getParameter(35663),source:this.getSource()}}}class O extends L{get[Symbol.toStringTag](){return"VertexShader"}constructor(t,e){"string"===typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35633}))}_createHandle(){return this.gl.createShader(35633)}}class F extends L{get[Symbol.toStringTag](){return"FragmentShader"}constructor(t,e){"string"===typeof e&&(e={source:e}),super(t,Object.assign({},e,{shaderType:35632}))}_createHandle(){return this.gl.createShader(35632)}}var R=i(77462),k=i(83951);class z{constructor(t){this.id=t.id,this.attributeInfos=[],this.attributeInfosByName={},this.attributeInfosByLocation=[],this.varyingInfos=[],this.varyingInfosByName={},Object.seal(this),this._readAttributesFromProgram(t),this._readVaryingsFromProgram(t)}getAttributeInfo(t){const e=Number(t);return Number.isFinite(e)?this.attributeInfosByLocation[e]:this.attributeInfosByName[t]||null}getAttributeLocation(t){const e=this.getAttributeInfo(t);return e?e.location:-1}getAttributeAccessor(t){const e=this.getAttributeInfo(t);return e?e.accessor:null}getVaryingInfo(t){const e=Number(t);return Number.isFinite(e)?this.varyingInfos[e]:this.varyingInfosByName[t]||null}getVaryingIndex(t){const e=this.getVaryingInfo();return e?e.location:-1}getVaryingAccessor(t){const e=this.getVaryingInfo();return e?e.accessor:null}_readAttributesFromProgram(t){const{gl:e}=t,i=e.getProgramParameter(t.handle,35721);for(let n=0;n<i;n++){const{name:i,type:r,size:o}=e.getActiveAttrib(t.handle,n),s=e.getAttribLocation(t.handle,i);s>=0&&this._addAttribute(s,i,r,o)}this.attributeInfos.sort(((t,e)=>t.location-e.location))}_readVaryingsFromProgram(t){const{gl:e}=t;if(!(0,s.D0)(e))return;const i=e.getProgramParameter(t.handle,35971);for(let n=0;n<i;n++){const{name:i,type:r,size:o}=e.getTransformFeedbackVarying(t.handle,n);this._addVarying(n,i,r,o)}this.varyingInfos.sort(((t,e)=>t.location-e.location))}_addAttribute(t,e,i,n){const{type:r,components:o}=(0,k.hJ)(i),s={type:r,size:n*o};this._inferProperties(t,e,s);const a={location:t,name:e,accessor:new R.Z(s)};this.attributeInfos.push(a),this.attributeInfosByLocation[t]=a,this.attributeInfosByName[a.name]=a}_inferProperties(t,e,i){/instance/i.test(e)&&(i.divisor=1)}_addVarying(t,e,i,n){const{type:r,components:o}=(0,k.hJ)(i),s={location:t,name:e,accessor:new R.Z({type:r,size:n*o})};this.varyingInfos.push(s),this.varyingInfosByName[s.name]=s}}var U=i(55888);const N=35981,G=["setVertexArray","setAttributes","setBuffers","unsetBuffers","use","getUniformCount","getUniformInfo","getUniformLocation","getUniformValue","getVarying","getFragDataLocation","getAttachedShaders","getAttributeCount","getAttributeLocation","getAttributeInfo"];class Z extends n.Z{get[Symbol.toStringTag](){return"Program"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.stubRemovedMethods("Program","v6.0",G),this._isCached=!1,this.initialize(e),Object.seal(this),this._setId(e.id)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{hash:e,vs:i,fs:n,varyings:r,bufferMode:o=N}=t;return this.hash=e||"",this.vs="string"===typeof i?new O(this.gl,{id:"".concat(t.id,"-vs"),source:i}):i,this.fs="string"===typeof n?new F(this.gl,{id:"".concat(t.id,"-fs"),source:n}):n,(0,l.h)(this.vs instanceof O),(0,l.h)(this.fs instanceof F),this.uniforms={},this._textureUniforms={},r&&r.length>0&&((0,s.KQ)(this.gl),this.varyings=r,this.gl2.transformFeedbackVaryings(this.handle,r,o)),this._compileAndLink(),this._readUniformLocationsFromLinkedProgram(),this.configuration=new z(this),this.setProps(t)}delete(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isCached?this:super.delete(t)}setProps(t){return"uniforms"in t&&this.setUniforms(t.uniforms),this}draw(t){let{logPriority:e,drawMode:i=4,vertexCount:n,offset:r=0,start:o,end:a,isIndexed:c=!1,indexType:u=5123,instanceCount:h=0,isInstanced:d=h>0,vertexArray:p=null,transformFeedback:A,framebuffer:f,parameters:g={},uniforms:m,samplers:y}=t;if((m||y)&&(s.cM.deprecated("Program.draw({uniforms})","Program.setUniforms(uniforms)")(),this.setUniforms(m||{})),s.cM.priority>=e){const t=f?f.id:"default",r="mode=".concat((0,U.km)(this.gl,i)," verts=").concat(n," ")+"instances=".concat(h," indexType=").concat((0,U.km)(this.gl,u)," ")+"isInstanced=".concat(d," isIndexed=").concat(c," ")+"Framebuffer=".concat(t);s.cM.log(e,r)()}return(0,l.h)(p),this.gl.useProgram(this.handle),!(!this._areTexturesRenderable()||0===n||d&&0===h)&&(p.bindForDraw(n,h,(()=>{if(void 0!==f&&(g=Object.assign({},g,{framebuffer:f})),A){const t=(0,k.$Z)(i);A.begin(t)}this._bindTextures(),(0,s.s8)(this.gl,g,(()=>{c&&d?this.gl2.drawElementsInstanced(i,n,u,r,h):c&&(0,s.D0)(this.gl)&&!isNaN(o)&&!isNaN(a)?this.gl2.drawRangeElements(i,o,a,n,u,r):c?this.gl.drawElements(i,n,u,r):d?this.gl2.drawArraysInstanced(i,r,n,h):this.gl.drawArrays(i,r,n)})),A&&A.end()})),!0)}setUniforms(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s.cM.priority>
2=2&&function(t,e,i){for(const n in t){const r=t[n];if((!i||Boolean(i[n]))&&!_(r))throw e=e?"".concat(e," "):"",console.error("".concat(e," Bad uniform ").concat(n),r),new Error("".concat(e," Bad uniform ").concat(n))}}(t,this.id,this._uniformSetters),this.gl.useProgram(this.handle);for(const e in t){const i=t[e],n=this._uniformSetters[e];if(n){let t=i,s=!1;if(t instanceof o.Z&&(t=t.texture),t instanceof r.Z)if(s=this.uniforms[e]!==i,s){void 0===n.textureIndex&&(n.textureIndex=this._textureIndexCounter++);const i=t,{textureIndex:r}=n;i.bind(r),t=r,this._textureUniforms[e]=i}else t=n.textureIndex;else this._textureUniforms[e]&&delete this._textureUniforms[e];(n(t)||s)&&b(this.uniforms,e,i)}}return this}_areTexturesRenderable(){let t=!0;for(const e in this._textureUniforms){const i=this._textureUniforms[e];i.update(),t=t&&i.loaded}return t}_bindTextures(){for(const t in this._textureUniforms){const e=this._uniformSetters[t].textureIndex;this._textureUniforms[t].bind(e)}}_createHandle(){return this.gl.createProgram()}_deleteHandle(){this.gl.deleteProgram(this.handle)}_getOptionsFromHandle(t){const e=this.gl.getAttachedShaders(t),i={};for(const n of e){switch(this.gl.getShaderParameter(this.handle,35663)){case 35633:i.vs=new O({handle:n});break;case 35632:i.fs=new F({handle:n})}}return i}_getParameter(t){return this.gl.getProgramParameter(this.handle,t)}_setId(t){if(!t){const t=this._getName();this.id=(0,D.hQ)(t)}}_getName(){let t=this.vs.getName()||this.fs.getName();return t=t.replace(/shader/i,""),t=t?"".concat(t,"-program"):"program",t}_compileAndLink(){const{gl:t}=this;if(t.attachShader(this.handle,this.vs.handle),t.attachShader(this.handle,this.fs.handle),s.cM.time(4,"linkProgram for ".concat(this._getName()))(),t.linkProgram(this.handle),s.cM.timeEnd(4,"linkProgram for ".concat(this._getName()))(),t.debug||s.cM.level>0){if(!t.getProgramParameter(this.handle,35714))throw new Error("Error linking: ".concat(t.getProgramInfoLog(this.handle)));t.validateProgram(this.handle);if(!t.getProgramParameter(this.handle,35715))throw new Error("Error validating: ".concat(t.getProgramInfoLog(this.handle)))}}_readUniformLocationsFromLinkedProgram(){const{gl:t}=this;this._uniformSetters={},this._uniformCount=this._getParameter(35718);for(let e=0;e<this._uniformCount;e++){const i=this.gl.getActiveUniform(this.handle,e),{name:n}=v(i.name);let r=t.getUniformLocation(this.handle,n);if(this._uniformSetters[n]=y(t,r,i),i.size>1)for(let e=0;e<i.size;e++)r=t.getUniformLocation(this.handle,"".concat(n,"[").concat(e,"]")),this._uniformSetters["".concat(n,"[").concat(e,"]")]=y(t,r,i)}this._textureIndexCounter=0}getActiveUniforms(t,e){return this.gl2.getActiveUniforms(this.handle,t,e)}getUniformBlockIndex(t){return this.gl2.getUniformBlockIndex(this.handle,t)}getActiveUniformBlockParameter(t,e){return this.gl2.getActiveUniformBlockParameter(this.handle,t,e)}uniformBlockBinding(t,e){this.gl2.uniformBlockBinding(this.handle,t,e)}}},38332:(t,e,i)=>{"use strict";i.d(e,{Z:()=>l});var n=i(35572);const r="EXT_color_buffer_float",o={33189:{bpp:2},33190:{gl2:!0,bpp:3},36012:{gl2:!0,bpp:4},36168:{bpp:1},34041:{bpp:4},35056:{gl2:!0,bpp:4},36013:{gl2:!0,bpp:5},32854:{bpp:2},36194:{bpp:2},32855:{bpp:2},33321:{gl2:!0,bpp:1},33330:{gl2:!0,bpp:1},33329:{gl2:!0,bpp:1},33332:{gl2:!0,bpp:2},33331:{gl2:!0,bpp:2},33334:{gl2:!0,bpp:4},33333:{gl2:!0,bpp:4},33323:{gl2:!0,bpp:2},33336:{gl2:!0,bpp:2},33335:{gl2:!0,bpp:2},33338:{gl2:!0,bpp:4},33337:{gl2:!0,bpp:4},33340:{gl2:!0,bpp:8},33339:{gl2:!0,bpp:8},32849:{gl2:!0,bpp:3},32856:{gl2:!0,bpp:4},32857:{gl2:!0,bpp:4},36220:{gl2:!0,bpp:4},36238:{gl2:!0,bpp:4},36975:{gl2:!0,bpp:4},36214:{gl2:!0,bpp:8},36232:{gl2:!0,bpp:8},36226:{gl2:!0,bpp:16},36208:{gl2:!0,bpp:16},33325:{gl2:r,bpp:2},33327:{gl2:r,bpp:4},34842:{gl2:r,bpp:8},33326:{gl2:r,bpp:4},33328:{gl2:r,bpp:8},34836:{gl2:r,bpp:16},35898:{gl2:r,bpp:4}};var s=i(28007),a=i(81301);class l extends n.Z{get[Symbol.toStringTag](){return"Renderbuffer"}static isSupported(t){let{format:e}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{format:null};return!e||function(t,e,i){const n=i[e];if(!n)return!1;const r=(0,s.D0)(t)&&n.gl2||n.gl1;return"string"===typeof r?t.getExtension(r):r}(t,e,o)}static getSamplesForFormat(t,e){let{format:i}=e;return t.getInternalformatParameter(36161,i,32937)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(t,e),this.initialize(e),Object.seal(this)}initialize(t){let{format:e,width:i=1,height:n=1,samples:r=0}=t;return(0,a.h)(e,"Needs format"),this._trackDeallocatedMemory(),this.gl.bindRenderbuffer(36161,this.handle),0!==r&&(0,s.D0)(this.gl)?this.gl.renderbufferStorageMultisample(36161,r,e,i,n):this.gl.renderbufferStorage(36161,e,i,n),this.format=e,this.width=i,this.height=n,this.samples=r,this._trackAllocatedMemory(this.width*this.height*(this.samples||1)*o[this.format].bpp),this}resize(t){let{width:e,height:i}=t;return e!==this.width||i!==this.height?this.initialize({width:e,height:i,format:this.format,samples:this.samples}):this}_createHandle(){return this.gl.createRenderbuffer()}_deleteHandle(){this.gl.deleteRenderbuffer(this.handle),this._trackDeallocatedMemory()}_bindHandle(t){this.gl.bindRenderbuffer(36161,t)}_syncHandle(t){this.format=this.getParameter(36164),this.width=this.getParameter(36162),this.height=this.getParameter(36163),this.samples=this.getParameter(36011)}_getParameter(t){this.gl.bindRenderbuffer(36161,this.handle);return this.gl.getRenderbufferParameter(36161,t)}}},35572:(t,e,i)=>{"use strict";i.d(e,{Z:()=>u});var n=i(28007),r=i(48546),o=i(55888),s=i(81301),a=i(79666),l=i(69221);const c="Resource subclass must define virtual methods";class u{get[Symbol.toStringTag](){return"Resource"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.JD)(t);const{id:i,userData:r={}}=e;this.gl=t,this.gl2=t,this.id=i||(0,a.hQ)(this[Symbol.toStringTag]),this.userData=r,this._bound=!1,this._handle=e.handle,void 0===this._handle&&(this._handle=this._createHandle()),this.byteLength=0,this._addStats()}toString(){return"".concat(this[Symbol.toStringTag]||this.constructor.name,"(").concat(this.id,")")}get handle(){return this._handle}delete(){let{deleteChildren:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const e=this._handle&&this._deleteHandle(this._handle);return this._handle&&this._removeStats(),this._handle=null,e&&t&&e.filter(Boolean).forEac
2h((t=>t.delete())),this}bind(){let t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.handle;return"function"!==typeof e?(this._bindHandle(e),this):(this._bound?t=e():(this._bindHandle(this.handle),this._bound=!0,t=e(),this._bound=!1,this._bindHandle(null)),t)}unbind(){this.bind(null)}getParameter(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=(0,o.sF)(this.gl,t),(0,s.h)(t);const i=(this.constructor.PARAMETERS||{})[t];if(i){const t=(0,n.D0)(this.gl);if(!((!("webgl2"in i)||t)&&(!("extension"in i)||this.gl.getExtension(i.extension)))){const e=i.webgl1,n="webgl2"in i?i.webgl2:i.webgl1;return t?n:e}}return this._getParameter(t,e)}getParameters(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{parameters:e,keys:i}=t,r=this.constructor.PARAMETERS||{},s=(0,n.D0)(this.gl),a={},l=e||Object.keys(r);for(const n of l){const e=r[n];if(e&&(!("webgl2"in e)||s)&&(!("extension"in e)||this.gl.getExtension(e.extension))){const r=i?(0,o.km)(this.gl,n):n;a[r]=this.getParameter(n,t),i&&"GLenum"===e.type&&(a[r]=(0,o.km)(this.gl,a[r]))}}return a}setParameter(t,e){t=(0,o.sF)(this.gl,t),(0,s.h)(t);const i=(this.constructor.PARAMETERS||{})[t];if(i){const t=(0,n.D0)(this.gl);if(!((!("webgl2"in i)||t)&&(!("extension"in i)||this.gl.getExtension(i.extension))))throw new Error("Parameter not available on this platform");"GLenum"===i.type&&(e=(0,o.sF)(e))}return this._setParameter(t,e),this}setParameters(t){for(const e in t)this.setParameter(e,t[e]);return this}stubRemovedMethods(t,e,i){return(0,l.F)(this,t,e,i)}initialize(t){}_createHandle(){throw new Error(c)}_deleteHandle(){throw new Error(c)}_bindHandle(t){throw new Error(c)}_getOptsFromHandle(){throw new Error(c)}_getParameter(t,e){throw new Error(c)}_setParameter(t,e){throw new Error(c)}_context(){return this.gl.luma=this.gl.luma||{},this.gl.luma}_addStats(){const t=this[Symbol.toStringTag],e=r.lR.get("Resource Counts");e.get("Resources Created").incrementCount(),e.get("".concat(t,"s Created")).incrementCount(),e.get("".concat(t,"s Active")).incrementCount()}_removeStats(){const t=this[Symbol.toStringTag];r.lR.get("Resource Counts").get("".concat(t,"s Active")).decrementCount()}_trackAllocatedMemory(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag];this._trackAllocatedMemoryForContext(t,e),this._trackAllocatedMemoryForContext(t,e,this.gl.canvas&&this.gl.canvas.id),this.byteLength=t}_trackAllocatedMemoryForContext(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this[Symbol.toStringTag],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=r.lR.get("Memory Usage".concat(i));n.get("GPU Memory").addCount(t),n.get("".concat(e," Memory")).addCount(t)}_trackDeallocatedMemory(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag];this._trackDeallocatedMemoryForContext(t),this._trackDeallocatedMemoryForContext(t,this.gl.canvas&&this.gl.canvas.id),this.byteLength=0}_trackDeallocatedMemoryForContext(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this[Symbol.toStringTag],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const i=r.lR.get("Memory Usage".concat(e));i.get("GPU Memory").subtractCount(this.byteLength),i.get("".concat(t," Memory")).subtractCount(this.byteLength)}}},58300:(t,e,i)=>{"use strict";i.d(e,{Z:()=>a});var n=i(28007),r=i(51055),o=i(81301);let s="";class a extends r.Z{get[Symbol.toStringTag](){return"Texture2D"}static isSupported(t,e){return r.Z.isSupported(t,e)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};var i,r;(0,n.JD)(t),(e instanceof Promise||"string"===typeof e)&&(e={data:e}),"string"===typeof e.data&&(e=Object.assign({},e,{data:(i=e.data,(0,o.h)("string"===typeof i),i=s+i,new Promise(((t,e)=>{try{const n=new Image;n.onload=()=>t(n),n.onerror=()=>e(new Error("Could not load image ".concat(i,"."))),n.crossOrigin=r&&r.crossOrigin||"anonymous",n.src=i}catch(n){e(n)}})))})),super(t,Object.assign({},e,{target:3553})),this.initialize(e),Object.seal(this)}}},29094:(t,e,i)=>{"use strict";i.d(e,{C:()=>o,KR:()=>l,ae:()=>r,br:()=>a,pH:()=>s});var n=i(28007);const r={6407:{dataFormat:6407,types:[5121,33635]},6408:{dataFormat:6408,types:[5121,32819,32820]},6406:{dataFormat:6406,types:[5121]},6409:{dataFormat:6409,types:[5121]},6410:{dataFormat:6410,types:[5121]},33326:{dataFormat:6403,types:[5126],gl2:!0},33328:{dataFormat:33319,types:[5126],gl2:!0},34837:{dataFormat:6407,types:[5126],gl2:!0},34836:{dataFormat:6408,types:[5126],gl2:!0}},o={6403:1,36244:1,33319:2,33320:2,6407:3,36248:3,6408:4,36249:4,6402:1,34041:1,6406:1,6409:1,6410:2},s={5126:4,5125:4,5124:4,5123:2,5122:2,5131:2,5120:1,5121:1};function a(t,e){const i=r[e];if(!i)return!1;
2if(void 0===i.gl1&&void 0===i.gl2)return!0;const o=(0,n.D0)(t)&&i.gl2||i.gl1;return"string"===typeof o?t.getExtension(o):o}function l(t,e){const i=r[e];switch(i&&i.types[0]){case 5126:return t.getExtension("OES_texture_float_linear");case 5131:return t.getExtension("OES_texture_half_float_linear");default:return!0}}},51055:(t,e,i)=>{"use strict";i.d(e,{Z:()=>h});var n=i(28007),r=i(35572),o=i(33839),s=i(29094),a=i(81301),l=i(79666);const c=[9729,9728],u=globalThis.WebGLBuffer||function(){};class h extends r.Z{get[Symbol.toStringTag](){return"Texture"}static isSupported(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{format:i,linearFiltering:n}=e;let r=!0;return i&&(r=r&&(0,s.br)(t,i),r=r&&(!n||(0,s.KR)(t,i))),r}constructor(t,e){const{id:i=(0,l.hQ)("texture"),handle:n,target:r}=e;super(t,{id:i,handle:n}),this.target=r,this.textureUnit=void 0,this.loaded=!1,this.width=void 0,this.height=void 0,this.depth=void 0,this.format=void 0,this.type=void 0,this.dataFormat=void 0,this.border=void 0,this.textureUnit=void 0,this.mipmaps=void 0}toString(){return"Texture(".concat(this.id,",").concat(this.width,"x").concat(this.height,")")}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.data;if(e instanceof Promise)return e.then((e=>this.initialize(Object.assign({},t,{pixels:e,data:e})))),this;const i="undefined"!==typeof HTMLVideoElement&&e instanceof HTMLVideoElement;if(i&&e.readyState<HTMLVideoElement.HAVE_METADATA)return this._video=null,e.addEventListener("loadeddata",(()=>this.initialize(t))),this;const{pixels:r=null,format:o=6408,border:s=0,recreate:a=!1,parameters:l={},pixelStore:c={},textureUnit:u}=t;e||(e=r);let{width:h,height:d,dataFormat:p,type:A,compressed:f=!1,mipmaps:g=!0}=t;const{depth:m=0}=t;return({width:h,height:d,compressed:f,dataFormat:p,type:A}=this._deduceParameters({format:o,type:A,dataFormat:p,compressed:f,data:e,width:h,height:d})),this.width=h,this.height=d,this.depth=m,this.format=o,this.type=A,this.dataFormat=p,this.border=s,this.textureUnit=u,Number.isFinite(this.textureUnit)&&(this.gl.activeTexture(33984+this.textureUnit),this.gl.bindTexture(this.target,this.handle)),g&&this._isNPOT()&&(n.cM.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),g=!1,this._updateForNPOT(l)),this.mipmaps=g,this.setImageData({data:e,width:h,height:d,depth:m,format:o,type:A,dataFormat:p,border:s,mipmaps:g,parameters:c,compressed:f}),g&&this.generateMipmap(),this.setParameters(l),a&&(this.data=e),i&&(this._video={video:e,parameters:l,lastTime:e.readyState>=HTMLVideoElement.HAVE_CURRENT_DATA?e.currentTime:-1}),this}update(){if(this._video){const{video:t,parameters:e,lastTime:i}=this._video;if(i===t.currentTime||t.readyState<HTMLVideoElement.HAVE_CURRENT_DATA)return;this.setSubImageData({data:t,parameters:e}),this.mipmaps&&this.generateMipmap(),this._video.lastTime=t.currentTime}}resize(t){let{height:e,width:i,mipmaps:n=!1}=t;return i!==this.width||e!==this.height?this.initialize({width:i,height:e,format:this.format,type:this.type,dataFormat:this.dataFormat,border:this.border,mipmaps:n}):this}generateMipmap(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._isNPOT()?(n.cM.warn("texture: ".concat(this," is Non-Power-Of-Two, disabling mipmaping"))(),this):(this.mipmaps=!0,this.gl.bindTexture(this.target,this.handle),(0,n.s8)(this.gl,t,(()=>{this.gl.generateMipmap(this.target)})),this.gl.bindTexture(this.target,null),this)}setImageData(t){this._trackDeallocatedMemory("Texture");const{target:e=this.target,pixels:i=null,level:r=0,format:o=this.format,border:l=this.border,offset:c=0,parameters:u={}}=t;let{data:h=null,type:d=this.type,width:p=this.width,height:A=this.height,dataFormat:f=this.dataFormat,compressed:g=!1}=t;h||(h=i),({type:d,dataFormat:f,compressed:g,width:p,height:A}=this._deduceParameters({format:o,type:d,dataFormat:f,compressed:g,data:h,width:p,height:A}));const{gl:m}=this;m.bindTexture(this.target,this.handle);let y,v=null;({data:h,dataType:v}=this._getDataType({data:h,compressed:g}));let _=0;if((0,n.s8)(this.gl,u,(()=>{switch(v){case"null":m.texImage2D(e,r,o,p,A,l,f,d,h);break;case"typed-array":m.texImage2D(e,r,o,p,A,l,f,d,h,c);break;case"buffer":y=(0,n.KQ)(m),y.bindBuffer(35052,h.handle||h),y.texImage2D(e,r,o,p,A,l,f,d,c),y.bindBuffer(35052,null);break;case"browser-object":(0,n.D0)(m)?m.texImage2D(e,r,o,p,A,l,f,d,h):m.texImage2D(e,r,o,f,d,h);break;case"compressed":for(const[t,i]of h.entries())m.compressedTexImage2D(e,t,i.format,i.width,i.height,l,i.data),_+=i.levelSize;break;default:(0,a.h)(!1,"Unknown image data type")}})),"compressed"===v)this._trackAllocatedMemory(_,"Texture");else if(h&&h.byteLength)this._trackAllocatedMemory(h.byteLength,"Texture");
2else{const t=s.C[this.dataFormat]||4,e=s.pH[this.type]||1;this._trackAllocatedMemory(this.width*this.height*t*e,"Texture")}return this.loaded=!0,this}setSubImageData(t){let{target:e=this.target,pixels:i=null,data:r=null,x:s=0,y:l=0,width:c=this.width,height:h=this.height,level:d=0,format:p=this.format,type:A=this.type,dataFormat:f=this.dataFormat,compressed:g=!1,offset:m=0,border:y=this.border,parameters:v={}}=t;if(({type:A,dataFormat:f,compressed:g,width:c,height:h}=this._deduceParameters({format:p,type:A,dataFormat:f,compressed:g,data:r,width:c,height:h})),(0,a.h)(0===this.depth,"texSubImage not supported for 3D textures"),r||(r=i),r&&r.data){const t=r;r=t.data,c=t.shape[0],h=t.shape[1]}r instanceof o.Z&&(r=r.handle),this.gl.bindTexture(this.target,this.handle),(0,n.s8)(this.gl,v,(()=>{if(g)this.gl.compressedTexSubImage2D(e,d,s,l,c,h,p,r);else if(null===r)this.gl.texSubImage2D(e,d,s,l,c,h,f,A,null);else if(ArrayBuffer.isView(r))this.gl.texSubImage2D(e,d,s,l,c,h,f,A,r,m);else if(r instanceof u){const t=(0,n.KQ)(this.gl);t.bindBuffer(35052,r),t.texSubImage2D(e,d,s,l,c,h,f,A,m),t.bindBuffer(35052,null)}else if((0,n.D0)(this.gl)){(0,n.KQ)(this.gl).texSubImage2D(e,d,s,l,c,h,f,A,r)}else this.gl.texSubImage2D(e,d,s,l,f,A,r)})),this.gl.bindTexture(this.target,null)}copyFramebuffer(){return n.cM.error("Texture.copyFramebuffer({...}) is no logner supported, use copyToTexture(source, target, opts})")(),null}getActiveUnit(){return this.gl.getParameter(34016)-33984}bind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,this.handle),t}unbind(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.textureUnit;const{gl:e}=this;return void 0!==t&&(this.textureUnit=t,e.activeTexture(33984+t)),e.bindTexture(this.target,null),t}_getDataType(t){let{data:e,compressed:i=!1}=t;return i?{data:e,dataType:"compressed"}:null===e?{data:e,dataType:"null"}:ArrayBuffer.isView(e)?{data:e,dataType:"typed-array"}:e instanceof o.Z?{data:e.handle,dataType:"buffer"}:e instanceof u?{data:e,dataType:"buffer"}:{data:e,dataType:"browser-object"}}_deduceParameters(t){const{format:e,data:i}=t;let{width:n,height:r,dataFormat:o,type:a,compressed:l}=t;const c=s.ae[e];return o=o||c&&c.dataFormat,a=a||c&&c.types[0],l=l||c&&c.compressed,({width:n,height:r}=this._deduceImageSize(i,n,r)),{dataFormat:o,type:a,compressed:l,width:n,height:r,format:e,data:i}}_deduceImageSize(t,e,i){let n;return n="undefined"!==typeof ImageData&&t instanceof ImageData?{width:t.width,height:t.height}:"undefined"!==typeof HTMLImageElement&&t instanceof HTMLImageElement?{width:t.naturalWidth,height:t.naturalHeight}:"undefined"!==typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!==typeof ImageBitmap&&t instanceof ImageBitmap?{width:t.width,height:t.height}:"undefined"!==typeof HTMLVideoElement&&t instanceof HTMLVideoElement?{width:t.videoWidth,height:t.videoHeight}:t?{width:e,height:i}:{width:e>=0?e:1,height:i>=0?i:1},(0,a.h)(n,"Could not deduced texture size"),(0,a.h)(void 0===e||n.width===e,"Deduced texture width does not match supplied width"),(0,a.h)(void 0===i||n.height===i,"Deduced texture height does not match supplied height"),n}_createHandle(){return this.gl.createTexture()}_deleteHandle(){this.gl.deleteTexture(this.handle),this._trackDeallocatedMemory("Texture")}_getParameter(t){switch(t){case 4096:return this.width;case 4097:return this.height;default:this.gl.bindTexture(this.target,this.handle);const e=this.gl.getTexParameter(this.target,t);return this.gl.bindTexture(this.target,null),e}}_setParameter(t,e){switch(this.gl.bindTexture(this.target,this.handle),e=this._getNPOTParam(t,e),t){case 33082:case 33083:this.gl.texParameterf(this.handle,t,e);break;case 4096:case 4097:(0,a.h)(!1);break;default:this.gl.texParameteri(this.target,t,e)}return this.gl.bindTexture(this.target,null),this}_isNPOT(){return!(0,n.D0)(this.gl)&&(!(!this.width||!this.height)&&(!(0,l.wt)(this.width)||!(0,l.wt)(this.height)))}_updateForNPOT(t){void 0===t[this.gl.TEXTURE_MIN_FILTER]&&(t[this.gl.TEXTURE_MIN_FILTER]=this.gl.LINEAR),void 0===t[this.gl.TEXTURE_WRAP_S]&&(t[this.gl.TEXTURE_WRAP_S]=this.gl.CLAMP_TO_EDGE),void 0===t[this.gl.TEXTURE_WRAP_T]&&(t[this.gl.TEXTURE_WRAP_T]=this.gl.CLAMP_TO_EDGE)}_getNPOTParam(t,e){if(this._isNPOT())switch(t){case 10241:-1===c.indexOf(e)&&(e=9729);break;case 10242:case 10243:33071!==e&&(e=33071)}return e}}},54345:(t,e,i)=>{"use strict";i.d(e,{Z:()=>a});var n=i(28007),r=i(35572),o=i(33839),s=i(79666);class a extends r.Z{get[Symbol.toStringTag](){return"TransformFeedback"}static isSupported(t){return(0,n.D0)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,n.KQ)(t),super(t,e),this.initialize(e),this.stubRemovedMethods("TransformFeedback","v6.0",["pause","resume"]),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.buffers={},this.unused={},this.configuration=null,this.bindOnUse=!0,(0,s.nK)(this.buffers)||this.bind((()=>this._unbindBuffers())),this.setProps(t),this}setProps(t){"program"in t&&(this.configuration=t.program&&t.program.configuration),"configuration"in t&&(this.configuration=t.configuration),"bindOnUse"in t&&(t=t.bindOnUse),"buffers"in t&&this.setBuffers(t.buffers)}setBuffers(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.bind((()=>{for(const e in t)this.setBuffer(e,t[e])})),this}setBuffer(t,e){const i=this._getVaryingIndex(t),{buffer:r,byteSize:o,byteOffset:s}=this._getBufferParams(e);return i<0?(this.unused[t]=r,n.cM.warn("".concat(this.id," unused varying buffer ").concat(t))(),this):(this.buffers[i]=e,this.bindOnUse||this._bindBuffer(i,r,s,o),this)}begin(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.gl.bindTransformFeedback(36386,this.handle),this._bindBuffers(),this.gl.beginTransformFeedback(t),this}end(){return this.gl.endTransformFeedback(),this._unbindBuffers(),this.gl.bindTransformFeedback(36386,null),this}_getBufferParams(t){let e,i,n;return t instanceof o.Z===!1?(n=t.buffer,i=t.byteSize,e=t.byteOffset):n=t,void 0===e&&void 0===i||(e=e||0,i=i||n.byteLength-e),{buffer:n,byteOffset:e,byteSize:i}}_getVaryingInfo(t){return this.configuration&&this.configuration.getVaryingInfo(t)}_getVaryingIndex(t){if(this.configuration)return this.configuration.getVaryingInfo(t).location;const e=Number(t);return Number.isFinite(e)?e:-1}_bindBuffers(){if(this.bindOnUse)for(const t in this.buffers){const{buffer:e,byteSize:i,byteOffset:n}=this._getBufferParams(this.buffers[t]);this._bindBuffer(t,e,n,i)}}_unbindBuffers(){if(this.bindOnUse)for(const t in this.buffers)this._bindBuffer(t,null)}_bindBuffer(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0;const r=e&&e.handle;return r&&void 0!==n?this.gl.bindBufferRange(35982,t,r,i,n):this.gl.bindBufferBase(35982,t,r),this}_createHandle(){return this.gl.createTransformFeedback()}_deleteHandle(){this.gl.deleteTransformFeedback(this.handle)}_bindHandle(t){this.gl.bindTransformFeedback(36386,this.handle)}}},12308:(t,e,i)=>{"use strict";i.d(e,{N$:()=>c,U6:()=>a,ag:()=>l});
2var n=i(70353),r=i(28007),o=i(81301);const s=2;function a(t,e){return l(t,e)}function l(t,e){return(e=Array.isArray(e)?e:[e]).every((e=>u(t,e)))}function c(t){t.luma=t.luma||{},t.luma.caps=t.luma.caps||{};for(const e in n.Z)void 0===t.luma.caps[e]&&(t.luma.caps[e]=u(t,e));return t.luma.caps}function u(t,e){return t.luma=t.luma||{},t.luma.caps=t.luma.caps||{},void 0===t.luma.caps[e]&&(t.luma.caps[e]=function(t,e){const i=n.Z[e];let s;(0,o.h)(i,e);const a=(0,r.D0)(t)&&i[1]||i[0];if("function"===typeof a)s=a(t);else if(Array.isArray(a)){s=!0;for(const e of a)s=s&&Boolean(t.getExtension(e))}else"string"===typeof a?s=Boolean(t.getExtension(a)):"boolean"===typeof a?s=a:(0,o.h)(!1);return s}(t,e)),t.luma.caps[e]||r.cM.log(s,"Feature: ".concat(e," not supported"))(),t.luma.caps[e]}},70353:(t,e,i)=>{"use strict";i.d(e,{Z:()=>s,h:()=>o});var n=i(79078),r=i(58300);const o={WEBGL2:"WEBGL2",VERTEX_ARRAY_OBJECT:"VERTEX_ARRAY_OBJECT",TIMER_QUERY:"TIMER_QUERY",INSTANCED_RENDERING:"INSTANCED_RENDERING",MULTIPLE_RENDER_TARGETS:"MULTIPLE_RENDER_TARGETS",ELEMENT_INDEX_UINT32:"ELEMENT_INDEX_UINT32",BLEND_EQUATION_MINMAX:"BLEND_EQUATION_MINMAX",FLOAT_BLEND:"FLOAT_BLEND",COLOR_ENCODING_SRGB:"COLOR_ENCODING_SRGB",TEXTURE_DEPTH:"TEXTURE_DEPTH",TEXTURE_FLOAT:"TEXTURE_FLOAT",TEXTURE_HALF_FLOAT:"TEXTURE_HALF_FLOAT",TEXTURE_FILTER_LINEAR_FLOAT:"TEXTURE_FILTER_LINEAR_FLOAT",TEXTURE_FILTER_LINEAR_HALF_FLOAT:"TEXTURE_FILTER_LINEAR_HALF_FLOAT",TEXTURE_FILTER_ANISOTROPIC:"TEXTURE_FILTER_ANISOTROPIC",COLOR_ATTACHMENT_RGBA32F:"COLOR_ATTACHMENT_RGBA32F",COLOR_ATTACHMENT_FLOAT:"COLOR_ATTACHMENT_FLOAT",COLOR_ATTACHMENT_HALF_FLOAT:"COLOR_ATTACHMENT_HALF_FLOAT",GLSL_FRAG_DATA:"GLSL_FRAG_DATA",GLSL_FRAG_DEPTH:"GLSL_FRAG_DEPTH",GLSL_DERIVATIVES:"GLSL_DERIVATIVES",GLSL_TEXTURE_LOD:"GLSL_TEXTURE_LOD"};const s={[o.WEBGL2]:[!1,!0],[o.VERTEX_ARRAY_OBJECT]:["OES_vertex_array_object",!0],[o.TIMER_QUERY]:["EXT_disjoint_timer_query","EXT_disjoint_timer_query_webgl2"],[o.INSTANCED_RENDERING]:["ANGLE_instanced_arrays",!0],[o.MULTIPLE_RENDER_TARGETS]:["WEBGL_draw_buffers",!0],[o.ELEMENT_INDEX_UINT32]:["OES_element_index_uint",!0],[o.BLEND_EQUATION_MINMAX]:["EXT_blend_minmax",!0],[o.FLOAT_BLEND]:["EXT_float_blend"],[o.COLOR_ENCODING_SRGB]:["EXT_sRGB",!0],[o.TEXTURE_DEPTH]:["WEBGL_depth_texture",!0],[o.TEXTURE_FLOAT]:["OES_texture_float",!0],[o.TEXTURE_HALF_FLOAT]:["OES_texture_half_float",!0],[o.TEXTURE_FILTER_LINEAR_FLOAT]:["OES_texture_float_linear"],[o.TEXTURE_FILTER_LINEAR_HALF_FLOAT]:["OES_texture_half_float_linear"],[o.TEXTURE_FILTER_ANISOTROPIC]:["EXT_texture_filter_anisotropic"],[o.COLOR_ATTACHMENT_RGBA32F]:[function(t){const e=new r.Z(t,{format:6408,type:5126,dataFormat:6408}),i=new n.Z(t,{id:"test-framebuffer",check:!1,attachments:{36064:e}}),o=i.getStatus();return e.delete(),i.delete(),36053===o},"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_FLOAT]:[!1,"EXT_color_buffer_float"],[o.COLOR_ATTACHMENT_HALF_FLOAT]:["EXT_color_buffer_half_float"],[o.GLSL_FRAG_DATA]:["WEBGL_draw_buffers",!0],[o.GLSL_FRAG_DEPTH]:["EXT_frag_depth",!0],[o.GLSL_DERIVATIVES]:["OES_standard_derivatives",!0],[o.GLSL_TEXTURE_LOD]:["EXT_shader_texture_lod",!0]}},48546:(t,e,i)=>{"use strict";i.d(e,{lR:()=>a});var n=i(28007),r=i(92138),o=i(11515);const s="8.5.18";const a=new class{constructor(){this.stats=new Map}get(t){return this.stats.has(t)||this.stats.set(t,new r.Z({id:t})),this.stats.get(t)}};if(globalThis.luma&&globalThis.luma.VERSION!==s)throw new Error("luma.gl - multiple VERSIONs detected: ".concat(globalThis.luma.VERSION," vs ").concat(s));globalThis.luma||((0,o.Z)()&&n.cM.log(1,"luma.gl ".concat(s," - ").concat("set luma.log.level=1 (or higher) to trace rendering"))(),globalThis.luma=globalThis.luma||{VERSION:s,version:s,log:n.cM,stats:a,globals:{modules:{},nodeIO:{}}});globalThis.luma},81301:(t,e,i)=>{"use strict";function n(t,e){if(!t)throw new Error(e||"luma.gl: assertion failed.")}i.d(e,{h:()=>n})},80182:(t,e,i)=>{"use strict";i.d(e,{k:()=>r});var n=i(28007);function r(t,e,i){const{removedProps:r={},deprecatedProps:o={},replacedProps:s={}}=i;for(const l in r)if(l in e){const e=r[l]?"".concat(t,".").concat(r[l]):"N/A";n.cM.removed("".concat(t,".").concat(l),e)()}for(const l in o)if(l in e){const e=o[l];n.cM.deprecated("".concat(t,".").concat(l),"".concat(t,".").concat(e))()}let a=null;for(const l in s)if(l in e){const i=s[l];n.cM.deprecated("".concat(t,".").concat(l),"".concat(t,".").concat(i))(),a=a||Object.assign({},e),a[i]=e[l],delete a[l]}return a||e}},69221:(t,e,i)=>{"use strict";i.d(e,{F:()=>r});var n=i(28007);function r(t,e,i,r){const o="See luma.gl ".concat(i," Upgrade Guide at https://luma.gl/docs/upgrade-guide"),s=Object.getPrototypeOf(t);r.forEach((t=>{s.methodName||(s[t]=()=>{throw n.cM.removed("Calling removed method ".concat(e,".").concat(t,": "),o)(),new Error(t)})}))}},79666:(t,e,i)=>{"use strict";i.d(e,{hQ:()=>o,nK:()=>a,wt:()=>s});var n=i(81301);const r={};function o(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"id";r[t]=r[t]||1;const e=r[t]++;return"".concat(t,"-").concat(e)}function s(t){return(0,n.h)("number"===typeof t,"Input must be a number"),t&&0===(t&t-1)}function a(t){let e=!0;for(const i in t){e=!1;break}return e}},83951:(t,e,i)=>{"use strict";i.d(e,{$Z:()=>v,hJ:()=>_,jG:()=>b});var n=i(81301);const r=5120,o=5121,s=5122,a=5123,l=0,c=1,u=2,h=3,d=4,p=5,A=6,f=5126,g=5124,m=5125,y={[f]:[f,1,"float"],35664:[f,2,"vec2"],35665:[f,3,"vec3"],35666:[f,4,"vec4"],[g]:[g,1,"int"],35667:[g,2,"ivec2"],35668:[g,3,"ivec3"],35669:[g,4,"ivec4"],[m]:[m,1,"uint"],36294:[m,2,"uvec2"],36295:[m,3,"uvec3"],36296:[m,4,"uvec4"],35670:[f,1,"bool"],35671:[f,2,"bvec2"],35672:[f,3,"bvec3"],35673:[f,4,"bvec4"],35674:[f,8,"mat2"],35685:[f,8,"mat2x3"],35686:[f,8,"mat2x4"],35675:[f,12,"mat3"],35687:[f,12,"mat3x2"],35688:[f,12,"mat3x4"],35676:[f,16,"mat4"],35689:[f,16,"mat4x2"],35690:[f,16,"mat4x3"]};function v(t){switch(t){case l:return l;case c:case h:case u:return c;case d:case p:case A:return d;default:return(0,n.h)(!1),0}}function _(t){const e=y[t];if(!e)return null;const[i,n]=e;return{type:i,components:n}}function b(t,e){switch(t){case r:case o:case s:case a:t=f}for(const i in y){const[n,r,o]=y[i];if(n===t&&r===e)return{glType:i,name:o}}return null}},55888:(t,e,i)=>{"use strict";i.d(e,{km:()=>o,sF:()=>r});var n=i(81301);function r(t,e){if("string"!==typeof e)return e;const i=Number(e);if(!isNaN(i))return i;const r=t[e=e.replace(/^.*\./,"")];return(0,n.h)(void 0!==r,"Accessing undefined constant GL.".concat(e)),r}function o(t,e){e=Number(e);for(const i in t)if(t[i]===e)return"GL.".concat(i);return String(e)}}
2,17507:(t,e,i)=>{"use strict";i.d(e,{h:()=>p,Y:()=>A});var n=i(58300),r=i(28007),o=i(51055);const s=[34069,34070,34071,34072,34073,34074];class a extends o.Z{get[Symbol.toStringTag](){return"TextureCube"}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.JD)(t),super(t,Object.assign({},e,{target:34067})),this.initialize(e),Object.seal(this)}initialize(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{mipmaps:e=!0,parameters:i={}}=t;return this.opts=t,this.setCubeMapImageData(t).then((()=>{this.loaded=!0,e&&this.generateMipmap(t),this.setParameters(i)})),this}subImage(t){let{face:e,data:i,x:n=0,y:r=0,mipmapLevel:o=0}=t;return this._subImage({target:e,data:i,x:n,y:r,mipmapLevel:o})}async setCubeMapImageData(t){let{width:e,height:i,pixels:n,data:o,border:a=0,format:l=6408,type:c=5121}=t;const{gl:u}=this,h=n||o,d=await Promise.all(s.map((t=>{const e=h[t];return Promise.all(Array.isArray(e)?e:[e])})));this.bind(),s.forEach(((t,n)=>{d[n].length>1&&!1!==this.opts.mipmaps&&r.cM.warn("".concat(this.id," has mipmap and multiple LODs."))(),d[n].forEach(((n,r)=>{e&&i?u.texImage2D(t,r,l,e,i,a,l,c,n):u.texImage2D(t,r,l,l,c,n)}))})),this.unbind()}setImageDataForFace(t){const{face:e,width:i,height:n,pixels:r,data:o,border:s=0,format:a=6408,type:l=5121}=t,{gl:c}=this,u=r||o;return this.bind(),u instanceof Promise?u.then((i=>this.setImageDataForFace(Object.assign({},t,{face:e,data:i,pixels:i})))):this.width||this.height?c.texImage2D(e,0,a,i,n,s,a,l,u):c.texImage2D(e,0,a,a,l,u),this}}a.FACES=s;var l=i(29094),c=i(33839);class u extends o.Z{get[Symbol.toStringTag](){return"Texture3D"}static isSupported(t){return(0,r.D0)(t)}constructor(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};(0,r.KQ)(t),e=Object.assign({depth:1},e,{target:32879,unpackFlipY:!1}),super(t,e),this.initialize(e),Object.seal(this)}setImageData(t){let{level:e=0,dataFormat:i=6408,width:n,height:o,depth:s=1,border:a=0,format:u,type:h=5121,offset:d=0,data:p,parameters:A={}}=t;if(this._trackDeallocatedMemory("Texture"),this.gl.bindTexture(this.target,this.handle),(0,r.s8)(this.gl,A,(()=>{ArrayBuffer.isView(p)&&this.gl.texImage3D(this.target,e,i,n,o,s,a,u,h,p),p instanceof c.Z&&(this.gl.bindBuffer(35052,p.handle),this.gl.texImage3D(this.target,e,i,n,o,s,a,u,h,d))})),p&&p.byteLength)this._trackAllocatedMemory(p.byteLength,"Texture");else{const t=l.C[this.dataFormat]||4,e=l.pH[this.type]||1;this._trackAllocatedMemory(this.width*this.height*this.depth*t*e,"Texture")}return this.loaded=!0,this}}var h=i(79078),d=i(81301);function p(t,e){(0,d.h)(t instanceof n.Z||t instanceof a||t instanceof u);const i=t.constructor,{gl:r,width:o,height:s,format:l,type:c,dataFormat:h,border:p,mipmaps:A}=t;return new i(r,Object.assign({width:o,height:s,format:l,type:c,dataFormat:h,border:p,mipmaps:A},e))}function A(t,e){const{gl:i,width:n,height:r,id:o}=t;return new h.Z(i,Object.assign({},e,{id:"framebuffer-for-".concat(o),width:n,height:r,attachments:{36064:t}}))}},75946:(t,e,i)=>{"use strict";i.d(e,{KS:()=>a,O:()=>r,c$:()=>s,vN:()=>o});const n="Failed to deduce GL constant from typed array";function r(t){switch(ArrayBuffer.isView(t)?t.constructor:t){case Float32Array:return 5126;case Uint16Array:return 5123;case Uint32Array:return 5125;case Uint8Array:case Uint8ClampedArray:return 5121;case Int8Array:return 5120;case Int16Array:return 5122;case Int32Array:return 5124;default:throw new Error(n)}}function o(t){let{clamped:e=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(t){case 5126:return Float32Array;case 5123:case 33635:case 32819:case 32820:return Uint16Array;case 5125:return Uint32Array;case 5121:return e?Uint8ClampedArray:Uint8Array;case 5120:return Int8Array;case 5122:return Int16Array;case 5124:return Int32Array;default:throw new Error("Failed to deduce typed array type from GL constant")}}function s(t){let{data:e,width:i,height:n,bytesPerPixel:r=4,temp:o}=t;const s=i*r;o=o||new Uint8Array(s);for(let a=0;a<n/2;++a){const t=a*s,i=(n-a-1)*s;o.set(e.subarray(t,t+s)),e.copyWithin(t,i,i+s),e.set(o,i)}}function a(t){let{data:e,width:i,height:n}=t;const r=Math.round(i/2),o=Math.round(n/2),s=new Uint8Array(r*o*4);for(let a=0;a<o;a++)for(let t=0;t<r;t++)for(let n=0;n<4;n++)s[4*(a*r+t)+n]=e[4*(2*a*i+2*t)+n];return{data:s,width:r,height:o}}},30116:t=>{"use strict";
2t.exports=i,t.exports.default=i;var e=1e20;function i(t,e,i,n,r,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=r||"sans-serif",this.fontWeight=o||"normal",this.radius=i||8;var s=this.size=this.fontSize+2*this.buffer,a=s+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=s,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textAlign="left",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(a*a),this.gridInner=new Float64Array(a*a),this.f=new Float64Array(a),this.z=new Float64Array(a+1),this.v=new Uint16Array(a),this.useMetrics=void 0!==this.ctx.measureText("A").actualBoundingBoxLeft,this.middle=Math.round(s/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function n(t,e,i,n,o,s){for(var a=0;a<e;a++)r(t,a,e,i,n,o,s);for(var l=0;l<i;l++)r(t,l*e,1,e,n,o,s)}function r(t,i,n,r,o,s,a){var l,c,u,h;for(s[0]=0,a[0]=-e,a[1]=e,l=0;l<r;l++)o[l]=t[i+l*n];for(l=1,c=0,u=0;l<r;l++){do{h=s[c],u=(o[l]-o[h]+l*l-h*h)/(l-h)/2}while(u<=a[c]&&--c>-1);s[++c]=l,a[c]=u,a[c+1]=e}for(l=0,c=0;l<r;l++){for(;a[c+1]<l;)c++;h=s[c],t[i+l*n]=o[h]+(l-h)*(l-h)}}i.prototype._draw=function(t,i){var r,o,s,a,l,c,u,h,d,p=this.ctx.measureText(t),A=p.width,f=2*this.buffer;i&&this.useMetrics?(l=Math.floor(p.actualBoundingBoxAscent),h=this.buffer+Math.ceil(p.actualBoundingBoxAscent),c=this.buffer,u=this.buffer,r=(o=Math.min(this.size,Math.ceil(p.actualBoundingBoxRight-p.actualBoundingBoxLeft)))+f,s=(a=Math.min(this.size-c,Math.ceil(p.actualBoundingBoxAscent+p.actualBoundingBoxDescent)))+f,this.ctx.textBaseline="alphabetic"):(r=o=this.size,s=a=this.size,l=19*this.fontSize/24,c=u=0,h=this.middle,this.ctx.textBaseline="middle"),o&&a&&(this.ctx.clearRect(u,c,o,a),this.ctx.fillText(t,this.buffer,h),d=this.ctx.getImageData(u,c,o,a));var g=new Uint8ClampedArray(r*s);return function(t,i,n,r,o,s,a){s.fill(e,0,i*n),a.fill(0,0,i*n);for(var l=(i-r)/2,c=0;c<o;c++)for(var u=0;u<r;u++){var h=(c+l)*i+u+l,d=t.data[4*(c*r+u)+3]/255;if(1===d)s[h]=0,a[h]=e;else if(0===d)s[h]=e,a[h]=0;else{var p=Math.max(0,.5-d),A=Math.max(0,d-.5);s[h]=p*p,a[h]=A*A}}}(d,r,s,o,a,this.gridOuter,this.gridInner),n(this.gridOuter,r,s,this.f,this.v,this.z),n(this.gridInner,r,s,this.f,this.v,this.z),function(t,e,i,n,r,o,s){for(var a=0;a<e*i;a++){var l=Math.sqrt(n[a])-Math.sqrt(r[a]);t[a]=Math.round(255-255*(l/o+s))}}(g,r,s,this.gridOuter,this.gridInner,this.radius,this.cutoff),{data:g,metrics:{width:o,height:a,sdfWidth:r,sdfHeight:s,top:l,left:0,advance:A}}},i.prototype.draw=function(t){return this._draw(t,!1).data},i.prototype.drawWithMetrics=function(t){return this._draw(t,!0)}},97833:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(47410);class r extends(function(t){function e(){var e=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(e,Object.getPrototypeOf(this)),e}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}(Array)){clone(){return(new this.constructor).copy(this)}fromArray(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<this.ELEMENTS;++i)this[i]=t[i+e];return this.check()}toArray(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;for(let i=0;i<this.ELEMENTS;++i)t[e+i]=this[i];return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:(0,n.kJ)(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(n.vc)}formatString(t){let e="";for(let i=0;i<this.ELEMENTS;++i)e+=(i>0?", ":"")+(0,n.Bw)(this[i],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(e,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!(0,n.fS)(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}
vendor: 4,846 bytes, line 2
2lerp(t,e,i){if(void 0===i)return this.lerp(this,t,e);for(let n=0;n<this.ELEMENTS;++n){const r=t[n];this[n]=r+i*(e[n]-r)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],t[i]),e[i]);return this.check()}add(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const n of e)for(let t=0;t<this.ELEMENTS;++t)this[t]+=n[t];return this.check()}subtract(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const n of e)for(let t=0;t<this.ELEMENTS;++t)this[t]-=n[t];return this.check()}scale(t){if("number"===typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(n.vc.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(Math.max(this[i],t),e);return this.check()}get elements(){return this}}},53209:(t,e,i)=>{"use strict";i.d(e,{Z:()=>s});var n=i(97833),r=i(69801),o=i(47410);class s extends n.Z{toString(){let t="[";if(o.vc.printRowMajor){t+="row-major:";for(let e=0;e<this.RANK;++e)for(let i=0;i<this.RANK;++i)t+=" ".concat(this[i*this.RANK+e])}else{t+="column-major:";for(let e=0;e<this.ELEMENTS;++e)t+=" ".concat(this[e])}return t+="]",t}getElementIndex(t,e){return e*this.RANK+t}getElement(t,e){return this[e*this.RANK+t]}setElement(t,e,i){return this[e*this.RANK+t]=(0,r.u5)(i),this}getColumn(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new Array(this.RANK).fill(-0);const i=t*this.RANK;for(let n=0;n<this.RANK;++n)e[n]=this[i+n];return e}setColumn(t,e){const i=t*this.RANK;for(let n=0;n<this.RANK;++n)this[i+n]=e[n];return this}}},95282:(t,e,i)=>{"use strict";i.d(e,{Z:()=>s});var n=i(97833),r=i(69801),o=i(45903);class s extends n.Z{get x(){return this[0]}set x(t){this[0]=(0,r.u5)(t)}get y(){return this[1]}set y(t){this[1]=(0,r.u5)(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let i=0;i<this.ELEMENTS;++i){const n=this[i]-t[i];e+=n*n}return(0,r.u5)(e)}dot(t){let e=0;for(let i=0;i<this.ELEMENTS;++i)e+=this[i]*t[i];return(0,r.u5)(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const n of e)for(let t=0;t<this.ELEMENTS;++t)this[t]*=n[t];return this.check()}divide(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];for(const n of e)for(let t=0;t<this.ELEMENTS;++t)this[t]/=n[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return(0,o.Z)(t>=0&&t<this.ELEMENTS,"index is out of range"),(0,r.u5)(this[t])}setComponent(t,e){return(0,o.Z)(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}},12987:(t,e,i)=>{"use strict";i.d(e,{Z:()=>g});var n,r=i(53209),o=i(69801),s=i(63986),a=i(83367),l=i(77548),c=i(99007),u=i(62220);!function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"}(n||(n={}));const h=45*Math.PI/180,d=1,p=.1,A=500,f=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);
2class g extends r.Z{static get IDENTITY(){return function(){y||(y=new g,Object.freeze(y));return y}()}static get ZERO(){return function(){m||(m=new g([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(m));return m}()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return n}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),1===arguments.length&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f){return this[0]=t,this[1]=e,this[2]=i,this[3]=n,this[4]=r,this[5]=o,this[6]=s,this[7]=a,this[8]=l,this[9]=c,this[10]=u,this[11]=h,this[12]=d,this[13]=p,this[14]=A,this[15]=f,this.check()}setRowMajor(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f){return this[0]=t,this[1]=r,this[2]=l,this[3]=d,this[4]=e,this[5]=o,this[6]=c,this[7]=p,this[8]=i,this[9]=s,this[10]=u,this[11]=A,this[12]=n,this[13]=a,this[14]=h,this[15]=f,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(f)}fromObject(t){return this.check()}fromQuaternion(t){return a.en(this,t),this.check()}frustum(t){const{left:e,right:i,bottom:n,top:r,near:o=p,far:s=A}=t;return s===1/0?function(t,e,i,n,r,o){const s=2*o/(i-e),a=2*o/(r-n),l=(i+e)/(i-e),c=(r+n)/(r-n),u=-1,h=-1,d=-2*o;t[0]=s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=l,t[9]=c,t[10]=u,t[11]=h,t[12]=0,t[13]=0,t[14]=d,t[15]=0}(this,e,i,n,r,o):a.oy(this,e,i,n,r,o,s),this.check()}lookAt(t){const{eye:e,center:i=[0,0,0],up:n=[0,1,0]}=t;return a.zB(this,e,i,n),this.check()}ortho(t){const{left:e,right:i,bottom:n,top:r,near:o=p,far:s=A}=t;return a.M5(this,e,i,n,r,o,s),this.check()}orthographic(t){const{fovy:e=h,aspect:i=d,focalDistance:n=1,near:r=p,far:o=A}=t;v(e);const s=e/2,a=n*Math.tan(s),l=a*i;return this.ortho({left:-l,right:l,bottom:-a,top:a,near:r,far:o})}perspective(t){const{fovy:e=45*Math.PI/180,aspect:i=1,near:n=.1,far:r=500}=t;return v(e),a.G3(this,e,i,n,r),this.check()}determinant(){return a.GH(this)}getScale(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[-0,-0,-0];return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const i=this.getScale(e),n=1/i[0],r=1/i[1],o=1/i[2];return t[0]=this[0]*n,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=0,t[4]=this[4]*n,t[5]=this[5]*r,t[6]=this[6]*o,t[7]=0,t[8]=this[8]*n,t[9]=this[9]*r,t[10]=this[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,e){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],e=e||[-0,-0,-0];const i=this.getScale(e),n=1/i[0],r=1/i[1],o=1/i[2];return t[0]=this[0]*n,t[1]=this[1]*r,t[2]=this[2]*o,t[3]=this[4]*n,t[4]=this[5]*r,t[5]=this[6]*o,t[6]=this[8]*n,t[7]=this[9]*r,t[8]=this[10]*o,t}transpose(){return a.p4(this,this),this.check()}invert(){return a.U_(this,this),this.check()}multiplyLeft(t){return a.Jp(this,t,this),this.check()}multiplyRight(t){return a.Jp(this,this,t),this.check()}rotateX(t){return a.lM(this,this,t),this.check()}rotateY(t){return a.uD(this,this,t),this.check()}rotateZ(t){return a.jI(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,e){return a.U1(this,this,t,e),this.check()}scale(t){return a.bA(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return a.Iu(this,this,t),this.check()}transform(t,e){return 4===t.length?(e=u.fF(e||[-0,-0,-0,-0],t,this),(0,o.IL)(e,4),e):this.transformAsPoint(t,e)}transformAsPoint(t,e){const{length:i}=t;let n;switch(i){case 2:n=l.fF(e||[-0,-0],t,this);break;case 3:n=c.fF(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,o.IL)(n,t.length),n}transformAsVector(t,e){let i;switch(t.length){case 2:i=(0,s.pb)(e||[-0,-0],t,this);break;case 3:i=(0,s.pL)(e||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return(0,o.IL)(i,t.length),i}transformPoint(t,e){return this.transformAsPoint(t,e)}transformVector(t,e){return this.transformAsPoint(t,e)}transformDirection(t,e){return this.transformAsVector(t,e)}makeRotationX(t){return this.identity().rotateX(t)}
2makeTranslation(t,e,i){return this.identity().translate([t,e,i])}}let m,y;function v(t){if(t>2*Math.PI)throw Error("expected radians")}},34980:(t,e,i)=>{"use strict";i.d(e,{Z:()=>T});var n=i(97833),r=i(69801),o=i(95282),s=i(47410),a=i(99007),l=i(63986);let c;class u extends o.Z{static get ZERO(){return c||(c=new u(0,0,0,0),Object.freeze(c)),c}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;super(-0,-0,-0,-0),(0,s.kJ)(t)&&1===arguments.length?this.copy(t):(s.vc.debug&&((0,r.u5)(t),(0,r.u5)(e),(0,r.u5)(i),(0,r.u5)(n)),this[0]=t,this[1]=e,this[2]=i,this[3]=n)}set(t,e,i,n){return this[0]=t,this[1]=e,this[2]=i,this[3]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return s.vc.debug&&((0,r.u5)(t.x),(0,r.u5)(t.y),(0,r.u5)(t.z),(0,r.u5)(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=(0,r.u5)(t)}get w(){return this[3]}set w(t){this[3]=(0,r.u5)(t)}transform(t){return a.fF(this,this,t),this.check()}transformByMatrix3(t){return(0,l._x)(this,this,t),this.check()}transformByMatrix2(t){return(0,l.G7)(this,this,t),this.check()}transformByQuaternion(t){return a.VC(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}}var h=i(60285),d=i(24645),p=i(62220);function A(){var t=new h.WT(4);return h.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function f(t,e,i){i*=.5;var n=Math.sin(i);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(i),t}function g(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=i[0],l=i[1],c=i[2],u=i[3];return t[0]=n*u+s*a+r*c-o*l,t[1]=r*u+s*l+o*a-n*c,t[2]=o*u+s*c+n*l-r*a,t[3]=s*u-n*a-r*l-o*c,t}function m(t,e,i,n){var r,o,s,a,l,c=e[0],u=e[1],d=e[2],p=e[3],A=i[0],f=i[1],g=i[2],m=i[3];return(o=c*A+u*f+d*g+p*m)<0&&(o=-o,A=-A,f=-f,g=-g,m=-m),1-o>h.Ib?(r=Math.acos(o),s=Math.sin(r),a=Math.sin((1-n)*r)/s,l=Math.sin(n*r)/s):(a=1-n,l=n),t[0]=a*c+l*A,t[1]=a*u+l*f,t[2]=a*d+l*g,t[3]=a*p+l*m,t}function y(t,e){var i,n=e[0]+e[4]+e[8];if(n>0)i=Math.sqrt(n+1),t[3]=.5*i,i=.5/i,t[0]=(e[5]-e[7])*i,t[1]=(e[6]-e[2])*i,t[2]=(e[1]-e[3])*i;else{var r=0;e[4]>e[0]&&(r=1),e[8]>e[3*r+r]&&(r=2);var o=(r+1)%3,s=(r+2)%3;i=Math.sqrt(e[3*r+r]-e[3*o+o]-e[3*s+s]+1),t[r]=.5*i,i=.5/i,t[3]=(e[3*o+s]-e[3*s+o])*i,t[o]=(e[3*o+r]+e[3*r+o])*i,t[s]=(e[3*s+r]+e[3*r+s])*i}return t}p.d9,p.al,p.JG,p.t8;var v=p.IH,_=p.bA,b=p.AK,x=p.t7,w=p.kE,C=p.we,B=p.Fv,E=(p.I6,p.fS,function(){var t=a.Ue(),e=a.al(1,0,0),i=a.al(0,1,0);return function(n,r,o){var s=a.AK(r,o);return s<-.999999?(a.kC(t,e,r),a.Zh(t)<1e-6&&a.kC(t,i,r),a.Fv(t,t),f(n,t,Math.PI),n):s>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(a.kC(t,r,o),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+s,B(n,n))}}());(function(){var t=A(),e=A()})(),function(){var t=d.Ue()}();const S=[0,0,0,1];class T extends n.Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,i,n)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,i,n){return this[0]=t,this[1]=e,this[2]=i,this[3]=n,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return y(this,t),this.check()}fromAxisRotation(t,e){return f(this,t,e),this.check()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=(0,r.u5)(t)}get y(){return this[1]}set y(t){this[1]=(0,r.u5)(t)}get z(){return this[2]}set z(t){this[2]=(0,r.u5)(t)}get w(){return this[3]}set w(t){this[3]=(0,r.u5)(t)}len(){return w(this)}lengthSquared(){return C(this)}dot(t){return b(this,t)}rotationTo(t,e){return E(this,t,e),this.check()}add(t){return v(this,this,t),this.check()}calculateW(){return function(t,e){var i=e[0],n=e[1],r=e[2];t[0]=i,t[1]=n,t[2]=r,t[3]=Math.sqrt(Math.abs(1-i*i-n*n-r*r))}(this,this),this.check()}conjugate(){var t,e;return e=this,(t=this)[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],this.check()}invert(){return function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o,a=s?1/s:0;t[0]=-i*a,t[1]=-n*a,t[2]=-r*a,t[3]=o*a}(this,this),this.check()}
vendor: 8,395 bytes, line 2
2lerp(t,e,i){return void 0===i?this.lerp(this,t,e):(x(this,t,e,i),this.check())}multiplyRight(t){return g(this,this,t),this.check()}multiplyLeft(t){return g(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l+s*a,t[1]=r*l+o*a,t[2]=o*l-r*a,t[3]=s*l-n*a}(this,this,t),this.check()}rotateY(t){return function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l-o*a,t[1]=r*l+s*a,t[2]=o*l+n*a,t[3]=s*l-r*a}(this,this,t),this.check()}rotateZ(t){return function(t,e,i){i*=.5;var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);t[0]=n*l+r*a,t[1]=r*l-n*a,t[2]=o*l+s*a,t[3]=s*l-o*a}(this,this,t),this.check()}scale(t){return _(this,this,t),this.check()}slerp(t,e,i){let n,r,o;switch(arguments.length){case 1:({start:n=S,target:r,ratio:o}=t);break;case 2:n=this,r=t,o=e;break;default:n=t,r=e,o=i}return m(this,n,r,o),this.check()}transformVector4(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new u;return p.VC(e,t,this),(0,r.IL)(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}},431:(t,e,i)=>{"use strict";i.d(e,{Z:()=>u});var n=i(95282),r=i(47410),o=i(69801),s=i(99007),a=i(63986);const l=[0,0,0];let c;class u extends n.Z{static get ZERO(){return c||(c=new u(0,0,0),Object.freeze(c)),c}constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;super(-0,-0,-0),1===arguments.length&&(0,r.kJ)(t)?this.copy(t):(r.vc.debug&&((0,o.u5)(t),(0,o.u5)(e),(0,o.u5)(i)),this[0]=t,this[1]=e,this[2]=i)}set(t,e,i){return this[0]=t,this[1]=e,this[2]=i,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return r.vc.debug&&((0,o.u5)(t.x),(0,o.u5)(t.y),(0,o.u5)(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=(0,o.u5)(t)}angle(t){return s.EU(this,t)}cross(t){return s.kC(this,this,t),this.check()}rotateX(t){let{radians:e,origin:i=l}=t;return s.lM(this,this,i,e),this.check()}rotateY(t){let{radians:e,origin:i=l}=t;return s.uD(this,this,i,e),this.check()}rotateZ(t){let{radians:e,origin:i=l}=t;return s.jI(this,this,i,e),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return s.fF(this,this,t),this.check()}transformAsVector(t){return(0,a.pL)(this,this,t),this.check()}transformByMatrix3(t){return s.kK(this,this,t),this.check()}transformByMatrix2(t){return(0,a.eQ)(this,this,t),this.check()}transformByQuaternion(t){return s.VC(this,this,t),this.check()}}},45903:(t,e,i)=>{"use strict";function n(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}i.d(e,{Z:()=>n})},47410:(t,e,i)=>{"use strict";i.d(e,{Bw:()=>s,RW:()=>u,Ux:()=>c,Yr:()=>l,fS:()=>p,kJ:()=>a,t7:()=>d,uZ:()=>h,vc:()=>o});const n=1/Math.PI*180,r=1/180*Math.PI,o={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0};function s(t){let{precision:e=o.precision}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t=function(t){return Math.round(t/o.EPSILON)*o.EPSILON}(t),"".concat(parseFloat(t.toPrecision(e)))}function a(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function l(t){return function(t,e){return A(t,(t=>t*r),e)}(t)}function c(t){return u(t)}function u(t,e){return A(t,(t=>t*n),e)}function h(t,e,i){return A(t,(t=>Math.max(e,Math.min(i,t))))}function d(t,e,i){return a(t)?t.map(((t,n)=>d(t,e[n],i))):i*e+(1-i)*t}function p(t,e,i){const n=o.EPSILON;i&&(o.EPSILON=i);try{if(t===e)return!0;if(a(t)&&a(e)){if(t.length!==e.length)return!1;for(let i=0;i<t.length;++i)if(!p(t[i],e[i]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"===typeof t&&"number"===typeof e&&Math.abs(t-e)<=o.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{o.EPSILON=n}}function A(t,e,i){if(a(t)){const n=t;i=i||function(t){return t.clone?t.clone():new Array(t.length)}(n);for(let r=0;r<i.length&&r<n.length;++r)i[r]=e(t[r],r,i);return i}return e(t)}},63986:(t,e,i)=>{"use strict";function n(t,e,i){const n=e[0],r=e[1],o=i[3]*n+i[7]*r||1;return t[0]=(i[0]*n+i[4]*r)/o,t[1]=(i[1]*n+i[5]*r)/o,t}function r(t,e,i){const n=e[0],r=e[1],o=e[2],s=i[3]*n+i[7]*r+i[11]*o||1;return t[0]=(i[0]*n+i[4]*r+i[8]*o)/s,t[1]=(i[1]*n+i[5]*r+i[9]*o)/s,t[2]=(i[2]*n+i[6]*r+i[10]*o)/s,t}function o(t,e,i){const n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t[2]=e[2],t}function s(t,e,i){const n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t[2]=e[2],t[3]=e[3],t}function a(t,e,i){const n=e[0],r=e[1],o=e[2];return t[0]=i[0]*n+i[3]*r+i[6]*o,t[1]=i[1]*n+i[4]*r+i[7]*o,t[2]=i[2]*n+i[5]*r+i[8]*o,t[3]=e[3],t}i.d(e,{G7:()=>s,_x:()=>a,eQ:()=>o,pL:()=>r,pb:()=>n})},69801:(t,e,i)=>{"use strict";i.d(e,{IL:()=>o,u5:()=>r});var n=i(47410);function r(t){if(!Number.isFinite(t))throw new Error("Invalid number ".concat(t));return t}function o(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(n.vc.debug&&!function(t,e){if(t.length!==e)return!1;for(let i=0;i<t.length;++i)if(!Number.isFinite(t[i]))return!1;return!0}(t,e))throw new Error("math.gl: ".concat(i," some fields set to invalid numbers'"));return t}},23595:(t,e,i)=>{"use strict";i.d(e,{wG:()=>n,WZ:()=>N,GU:()=>W,dj:()=>R,ct:()=>J,OT:()=>s,ap:()=>o,Ny:()=>r});const n={CLOCKWISE:1,COUNTER_CLOCKWISE:-1};function r(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Math.sign(o(t,e))}(t,i);return n!==e&&(function(t,e){const{start:i=0,end:n=t.length,size:r=2}=e,o=(n-i)/r,s=Math.floor(o/2);for(let a=0;a<s;++a){const e=i+a*r,n=i+(o-1-a)*r;for(let i=0;i<r;++i){const r=t[e+i];t[e+i]=t[n+i],t[n+i]=r}}}(t,i),!0)}function o(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{start:i=0,end:n=t.length}=e,r=e.size||2;let o=0;for(let s=i,a=n-r;s<n;s+=r)o+=(t[s]-t[a])*(t[s+1]+t[a+1]),a=s;return o/2}function s(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3?arguments[3]:void 0;const r=e&&e.length,o=r?e[0]*i:t.length;let s=a(t,0,o,i,!0,n&&n[0]);const u=[];if(!s||s.next===s.prev)return u;let h,d,p,g,m,v,_;if(r&&(s=function(t,e,i,n,r){const o=[];let s,c,u,h,d;for(s=0,c=e.length;s<c;s++)u=e[s]*n,h=s<c-1?e[s+1]*n:t.length,d=a(t,u,h,n,!1,r&&r[s+1]),d===d.next&&(d.steiner=!0),o.push(y(d));for(o.sort(A),s=0;s<o.length;s++)f(o[s],i),i=l(i,i.next);return i}(t,e,s,i,n)),t.length>80*i){g=d=t[0],m=p=t[1];for(let e=i;e<o;e+=i)v=t[e],_=t[e+1],v<g&&(g=v),_<m&&(m=_),v>d&&(d=v),_>p&&(p=_);h=Math.max(d-g,p-m),h=0!==h?1/h:0}return c(s,u,i,g,m,h),u}function a(t,e,i,n,r,s){let a,l;if(void 0===s&&(s=o(t,{start:e,end:i,size:n})),r===s<0)for(a=e;a<i;a+=n)l=T(a,t[a],t[a+1],l);else for(a=i-n;a>=e;a-=n)l=T(a,t[a],t[a+1],l);return l&&x(l,l.next)&&(M(l),l=l.next),l}function l(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!x(n,n.next)&&0!==b(n.prev,n,n.next))n=n.next;else{if(M(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function c(t,e,i,n,r,o,s){if(!t)return;!s&&o&&function(t,e,i,n){let r=t;do{null===r.z&&(r.z=m(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){let e,i,n,r,o,s,a,l,c=1;do{for(r=t,t=null,l=null,n=0;r;){for(n++,s=r,o=0,i=0;i<c&&(o++,s=s.nextZ,s);i++);for(a=c;o>0||a>0&&s;)0!==o&&(0===a||!s||r.z<=s.z)?(e=r,r=r.nextZ,o--):(e=s,s=s.nextZ,a--),l?l.nextZ=e:t=e,e.prevZ=l,l=e;r=s}l.nextZ=null,c*=2}while(n>1)}(r)}(t,n,r,o);let a,A,f=t;for(;t.prev!==t.next;)if(a=t.prev,A=t.next,o?h(t,n,r,o):u(t))e.push(a.i/i),e.push(t.i/i),e.push(A.i/i),M(t),t=A.next,f=A.next;else if((t=A)===f){s?1===s?c(t=d(l(t),e,i),e,i,n,r,o,2):2===s&&p(t,e,i,n,r,o):c(l(t),e,i,n,r,o,1);break}}function u(t){const e=t.prev,i=t,n=t.next;if(b(e,i,n)>=0)return!1;let r=t.next.next;for(;r!==t.prev;){if(v(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&b(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}
vendor: 1,707 bytes, line 2
2function h(t,e,i,n){const r=t.prev,o=t,s=t.next;if(b(r,o,s)>=0)return!1;const a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,l=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,c=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,u=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,h=m(a,l,e,i,n),d=m(c,u,e,i,n);let p=t.prevZ,A=t.nextZ;for(;p&&p.z>=h&&A&&A.z<=d;){if(p!==t.prev&&p!==t.next&&v(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;if(p=p.prevZ,A!==t.prev&&A!==t.next&&v(r.x,r.y,o.x,o.y,s.x,s.y,A.x,A.y)&&b(A.prev,A,A.next)>=0)return!1;A=A.nextZ}for(;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&v(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&b(p.prev,p,p.next)>=0)return!1;p=p.prevZ}for(;A&&A.z<=d;){if(A!==t.prev&&A!==t.next&&v(r.x,r.y,o.x,o.y,s.x,s.y,A.x,A.y)&&b(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function d(t,e,i){let n=t;do{const r=n.prev,o=n.next.next;!x(r,o)&&w(r,n,n.next,o)&&E(r,o)&&E(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),M(n),M(n.next),n=t=o),n=n.next}while(n!==t);return l(n)}function p(t,e,i,n,r,o){let s=t;do{let t=s.next.next;for(;t!==s.prev;){if(s.i!==t.i&&_(s,t)){let a=S(s,t);return s=l(s,s.next),a=l(a,a.next),c(s,e,i,n,r,o),void c(a,e,i,n,r,o)}t=t.next}s=s.next}while(s!==t)}function A(t,e){return t.x-e.x}function f(t,e){if(e=function(t,e){let i=e;const n=t.x,r=t.y;let o,s=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>s){if(s=t,t===n){if(r===i.y)return i;if(r===i.next.y)return i.next}o=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!o)return null;if(n===s)return o;const a=o,l=o.x,c=o.y;let u,h=1/0;i=o;do{n>=i.x&&i.x>=l&&n!==i.x&&v(r<c?n:s,r,l,c,r<c?s:n,r,i.x,i.y)&&(u=Math.abs(r-i.y)/(n-i.x),E(i,t)&&(u<h||u===h&&(i.x>
vendor: 10,794 bytes, line 2
2o.x||i.x===o.x&&g(o,i)))&&(o=i,h=u)),i=i.next}while(i!==a);return o}(t,e),e){const i=S(e,t);l(e,e.next),l(i,i.next)}}function g(t,e){return b(t.prev,t,e.prev)<0&&b(e.next,t,t.next)<0}function m(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function y(t){let e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function v(t,e,i,n,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(n-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(r-s)*(n-a)>=0}function _(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&w(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){let i=t,n=!1;const r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!==i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(b(t.prev,t,e.prev)||b(t,e.prev,e))||x(t,e)&&b(t.prev,t,t.next)>0&&b(e.prev,e,e.next)>0)}function b(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function x(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,i,n){const r=B(b(t,e,i)),o=B(b(t,e,n)),s=B(b(i,n,t)),a=B(b(i,n,e));return r!==o&&s!==a||(!(0!==r||!C(t,i,e))||(!(0!==o||!C(t,n,e))||(!(0!==s||!C(i,t,n))||!(0!==a||!C(i,e,n)))))}function C(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function B(t){return t>0?1:t<0?-1:0}function E(t,e){return b(t.prev,t,t.next)<0?b(t,e,t.next)>=0&&b(t,t.prev,e)>=0:b(t,e,t.prev)<0||b(t,t.next,e)<0}function S(t,e){const i=new I(t.i,t.x,t.y),n=new I(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function T(t,e,i,n){const r=new I(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function M(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function I(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function P(t,e,i,n){let r,o,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(8&i)r=(n[3]-t[1])/(e[1]-t[1]),o=3;else if(4&i)r=(n[1]-t[1])/(e[1]-t[1]),o=1;else if(2&i)r=(n[2]-t[0])/(e[0]-t[0]),o=2;else{if(!(1&i))return null;r=(n[0]-t[0])/(e[0]-t[0]),o=0}for(let a=0;a<t.length;a++)s[a]=(1&o)===a?n[o]:r*(e[a]-t[a])+t[a];return s}function D(t,e){let i=0;return t[0]<e[0]?i|=1:t[0]>e[2]&&(i|=2),t[1]<e[1]?i|=4:t[1]>e[3]&&(i|=8),i}function L(t,e){const i=e.length,n=t.length;if(n>0){let r=!0;for(let o=0;o<i;o++)if(t[n-i+o]!==e[o]){r=!1;break}if(r)return!1}for(let r=0;r<i;r++)t[n+r]=e[r];return!0}function O(t,e){const i=e.length;for(let n=0;n<i;n++)t[n]=e[n]}function F(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];const o=n+e*i;for(let s=0;s<i;s++)r[s]=t[o+s];return r}function R(t,e){const{size:i=2,broken:n=!1,gridResolution:r=10,gridOffset:o=[0,0],startIndex:s=0,endIndex:a=t.length}=e||{},l=(a-s)/i;let c=[];const u=[c],h=F(t,0,i,s);let d,p;const A=Z(h,r,o,[]),f=[];L(c,h);for(let g=1;g<l;g++){for(d=F(t,g,i,s,d),p=D(d,A);p;){P(h,d,p,A,f);const t=D(f,A);t&&(P(h,f,t,A,f),p=t),L(c,f),O(h,f),j(A,r,p),n&&c.length>i&&(c=[],u.push(c),L(c,h)),p=D(d,A)}L(c,d),O(h,d)}return n?u:u[0]}const k=0,z=1;function U(t,e){for(let i=0;i<e.length;i++)t.push(e[i]);return t}function N(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0;if(!t.length)return[];const{size:n=2,gridResolution:r=10,gridOffset:o=[0,0],edgeTypes:s=!1}=i||{},a=[],l=[{pos:t,types:s?new Array(t.length/n).fill(z):null,holes:e||[]}],c=[[],[]];let u=[];for(;l.length;){const{pos:t,types:e,holes:i}=l.shift();V(t,n,i[0]||t.length,c),u=Z(c[0],r,o,u);const h=D(c[1],u);if(h){let r=G(t,e,n,0,i[0]||t.length,u,h);const o={pos:r[0].pos,types:r[0].types,holes:[]},a={pos:r[1].pos,types:r[1].types,holes:[]};l.push(o,a);for(let l=0;l<i.length;l++)r=G(t,e,n,i[l],i[l+1]||t.length,u,h),r[0]&&(o.holes.push(o.pos.length),o.pos=U(o.pos,r[0].pos),s&&(o.types=U(o.types,r[0].types))),r[1]&&(a.holes.push(a.pos.length),a.pos=U(a.pos,r[1].pos),s&&(a.types=U(a.types,r[1].types)))}else{const n={positions:t};s&&(n.edgeTypes=e),i.length&&(n.holeIndices=i),a.push(n)}}return a}function G(t,e,i,n,r,o,s){const a=(r-n)/i,l=[],c=[],u=[],h=[],d=[];let p,A,f;const g=F(t,a-1,i,n);let m=Math.sign(8&s?g[1]-o[3]:g[0]-o[2]),y=e&&e[a-1],v=0,_=0;for(let b=0;b<a;b++)p=F(t,b,i,n,p),A=Math.sign(8&s?p[1]-o[3]:p[0]-o[2]),f=e&&e[n/i+b],A&&m&&m!==A&&(P(g,p,s,o,d),L(l,d)&&u.push(y),L(c,d)&&h.push(y)),A<=0?(L(l,p)&&u.push(f),v-=A):u.length&&(u[u.length-1]=k),A>=0?(L(c,p)&&h.push(f),_+=A):h.length&&(h[h.length-1]=k),O(g,p),m=A,y=f;return[v?{pos:l,types:e&&u}:null,_?{pos:c,types:e&&h}:null]}function Z(t,e,i,n){const r=Math.floor((t[0]-i[0])/e)*e+i[0],o=Math.floor((t[1]-i[1])/e)*e+i[1];return n[0]=r,n[1]=o,n[2]=r+e,n[3]=o+e,n}function j(t,e,i){8&i?(t[1]+=e,t[3]+=e):4&i?(t[1]-=e,t[3]-=e):2&i?(t[0]+=e,t[2]+=e):1&i&&(t[0]-=e,t[2]-=e)}function V(t,e,i,n){let r=1/0,o=-1/0,s=1/0,a=-1/0;for(let l=0;l<i;l+=e){const e=t[l],i=t[l+1];r=e<r?e:r,o=e>o?e:o,s=i<s?i:s,a=i>a?i:a}return n[0][0]=r,n[0][1]=s,n[1][0]=o,n[1][1]=a,n}const H=85.051129;function J(t,e){const{size:i=2,startIndex:n=0,endIndex:r=t.length,normalize:o=!0}=e||{},s=t.slice(n,r);K(s,i,0,r-n);const a=R(s,{size:i,broken:!0,gridResolution:360,gridOffset:[-180,-180]});if(o)for(const l of a)X(l,i);return a}function W(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=arguments.length>2?arguments[2]:void 0;const{size:n=2,normalize:r=!0,edgeTypes:o=!1}=i||{};e=e||[];const s=[],a=[];let l=0,c=0;for(let h=0;h<=e.length;h++){const r=e[h]||t.length,o=c,u=Q(t,n,l,r);for(let e=u;e<r;e++)s[c++]=t[e];for(let e=l;e<u;e++)s[c++]=t[e];K(s,n,o,c),q(s,n,o,c,null===i||void 0===i?void 0:i.maxLatitude),l=r,a[h]=c}a.pop();const u=N(s,a,{size:n,gridResolution:360,gridOffset:[-180,-180],edgeTypes:o});if(r)for(const h of u)X(h.positions,n);return u}function Q(t,e,i,n){let r=-1,o=-1;for(let s=i+1;s<n;s+=e){const e=Math.abs(t[s]);e>r&&(r=e,o=s-1)}return o}function q(t,e,i,n){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:H;const o=t[i],s=t[n-e];if(Math.abs(o-s)>180){const n=F(t,0,e,i);n[0]+=360*Math.round((s-o)/360),L(t,n),n[1]=Math.sign(n[1])*r,L(t,n),n[0]=o,L(t,n)}}function K(t,e,i,n){let r,o=t[0];for(let s=i;s<n;s+=e){r=t[s];const e=r-o;(e>180||e<-180)&&(r-=360*Math.round(e/360)),t[s]=o=r}}function X(t,e){let i;const n=t.length/e;for(let o=0;o<n&&(i=t[o*e],(i+180)%360===0);o++);const r=360*-Math.round(i/360);if(0!==r)for(let o=0;o<n;o++)t[o*e]+=r}},75818:(t,e,i)=>{"use strict";i.d(e,{DW:()=>z,eG:()=>S,Lu:()=>I,Xg:()=>O,if:()=>V,sj:()=>P,zX:()=>R,ro:()=>E,up:()=>H,Bf:()=>B,wl:()=>M,lf:()=>T,w5:()=>w,QA:()=>N,CT:()=>L,es:()=>C,aW:()=>D});var n=i(64649),r=i(62220);function o(t,e){const i=(0,r.fF)([],e,t);return(0,r.bA)(i,i,1/i[3]),i}function s(t,e){const i=t%e;return i<0?e+i:i}function a(t,e,i){return t<e?e:t>i?i:t}const l=Math.log2||function(t){return Math.log(t)*Math.LOG2E};var c=i(83367),u=i(77548),h=i(99007);function d(t,e){if(!t)throw new Error(e||"@math.gl/web-mercator: assertion failed.")}const p=Math.PI,A=p/4,f=p/180,g=180/p,m=512,y=4003e4,v=85.051129,_=1.5;function b(t){return Math.pow(2,t)}function x(t){return l(t)}function w(t){const[e,i]=t;d(Number.isFinite(e)),d(Number.isFinite(i)&&i>=-90&&i<=90,"invalid latitude");const n=i*f;return[m*(e*f+p)/(2*p),m*(p+Math.log(Math.tan(A+.5*n)))/(2*p)]}function C(t){const[e,i]=t,n=e/m*(2*p)-p,r=2*(Math.atan(Math.exp(i/m*(2*p)-p))-A);return[n*g,r*g]}function B(t){const{latitude:e}=t;d(Number.isFinite(e));const i=Math.cos(e*f);return x(y*i)-9}function E(t){const{latitude:e,longitude:i,highPrecision:n=!1}=t;d(Number.isFinite(e)&&Number.isFinite(i));const r=m,o=Math.cos(e*f),s=r/360,a=s/o,l=r/y/o,c={unitsPerMeter:[l,l,l],metersPerUnit:[1/l,1/l,1/l],unitsPerDegree:[s,a,l],degreesPerUnit:[1/s,1/a,1/l]};if(n){const t=f*Math.tan(e*f)/o,i=s*t/2,n=r/y*t,u=n/a*l;c.unitsPerDegree2=[0,i,n],c.unitsPerMeter2=[u,0,u]}return c}function S(t,e){const[i,n,r]=t,[o,s,a]=e,{unitsPerMeter:l,unitsPerMeter2:c}=E({longitude:i,latitude:n,highPrecision:!0}),u=w(t);u[0]+=o*(l[0]+c[0]*s),u[1]+=s*(l[1]+c[1]*s);const h=C(u),d=(r||0)+(a||0);return Number.isFinite(r)||Number.isFinite(a)?[h[0],h[1],d]:h}function T(t){const{height:e,pitch:i,bearing:n,altitude:r,scale:o,center:s}=t,a=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];c.Iu(a,a,[0,0,-r]),c.lM(a,a,-i*f),c.jI(a,a,n*f);const l=o/e;return c.bA(a,a,[l,l,l]),s&&c.Iu(a,a,h.tk([],s)),a}function M(t){const{width:e,height:i,altitude:n,pitch:r=0,offset:o,center:s,scale:l,nearZMultiplier:c=1,farZMultiplier:u=1}=t;let{fovy:h=I(_)}=t;void 0!==n&&(h=I(n));const d=h*f,p=r*f,A=P(h);let g=A;s&&(g+=s[2]*l/Math.cos(p)/i);const m=d*(.5+(o?o[1]:0)/i),y=Math.sin(m)*g/Math.sin(a(Math.PI/2-p-m,.01,Math.PI-.01)),v=Math.sin(p)*y+g,b=10*g;return{fov:d,aspect:e/i,focalDistance:A,near:c,far:Math.min(v*u,b)}}function I(t){return 2*Math.atan(.5/t)*g}function P(t){return.5/Math.tan(.5*t*f)}function D(t,e){const[i,n,r=0]=t;return d(Number.isFinite(i)&&Number.isFinite(n)&&Number.isFinite(r)),o(e,[i,n,r,1])}function L(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const[n,r,s]=t;if(d(Number.isFinite(n)&&Number.isFinite(r),"invalid pixel coordinate"),Number.isFinite(s)){return o(e,[n,r,s,1])}const a=o(e,[n,r,0,1]),l=o(e,[n,r,1,1]),c=a[2],h=l[2],p=c===h?0:((i||0)-c)/(h-c);return u.t7([],a,l,p)}function O(t){const{width:e,height:i,bounds:n,minExtent:r=0,maxZoom:o=24,offset:s=[0,0]}=t,[[c,u],[h,p]]=n,A=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("number"===typeof t)return{top:t,bottom:t,left:t,right:t};return d(Number.isFinite(t.top)&&Number.isFinite(t.bottom)&&Number.isFinite(t.left)&&Number.isFinite(t.right)),t}(t.padding),f=w([c,a(p,-v,v)]),g=w([h,a(u,-v,v)]),m=[Math.max(Math.abs(g[0]-f[0]),r),Math.max(Math.abs(g[1]-f[1]),r)],y=[e-A.left-A.right-2*Math.abs(s[0]),i-A.top-A.bottom-2*Math.abs(s[1])];d(y[0]>0&&y[1]>0);const _=y[0]/m[0],b=y[1]/m[1],x=(A.right-A.left)/2/_,B=(A.top-A.bottom)/2/b,E=C([(g[0]+f[0])/2+x,(g[1]+f[1])/2+B]),S=Math.min(o,l(Math.abs(Math.min(_,b))));return d(Number.isFinite(S)),{longitude:E[0],latitude:E[1],zoom:S}}const F=Math.PI/180;function R(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const{width:i,height:n,unproject:r}=t,o={targetZ:e},s=r([0,n],o),a=r([i,n],o);let l,c;return(t.fovy?.5*t.fovy*F:Math.atan(.5/t.altitude))>(90-t.pitch)*F-.01?(l=k(t,0,e),c=k(t,i,e)):(l=r([0,0],o),c=r([i,0],o)),[s,a,c,l]}function k(t,e,i){const{pixelUnprojectionMatrix:n}
2=t,r=o(n,[e,0,1,1]),s=o(n,[e,t.height,1,1]),a=(i*t.distanceScales.unitsPerMeter[2]-r[2])/(s[2]-r[2]),l=C(u.t7([],r,s,a));return l.push(i),l}class z{constructor(){var t=this;let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{width:1,height:1};(0,n.Z)(this,"latitude",void 0),(0,n.Z)(this,"longitude",void 0),(0,n.Z)(this,"zoom",void 0),(0,n.Z)(this,"pitch",void 0),(0,n.Z)(this,"bearing",void 0),(0,n.Z)(this,"altitude",void 0),(0,n.Z)(this,"fovy",void 0),(0,n.Z)(this,"meterOffset",void 0),(0,n.Z)(this,"center",void 0),(0,n.Z)(this,"width",void 0),(0,n.Z)(this,"height",void 0),(0,n.Z)(this,"scale",void 0),(0,n.Z)(this,"distanceScales",void 0),(0,n.Z)(this,"viewMatrix",void 0),(0,n.Z)(this,"projectionMatrix",void 0),(0,n.Z)(this,"viewProjectionMatrix",void 0),(0,n.Z)(this,"pixelProjectionMatrix",void 0),(0,n.Z)(this,"pixelUnprojectionMatrix",void 0),(0,n.Z)(this,"equals",(t=>t instanceof z&&(t.width===this.width&&t.height===this.height&&c.fS(t.projectionMatrix,this.projectionMatrix)&&c.fS(t.viewMatrix,this.viewMatrix)))),(0,n.Z)(this,"project",(function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{topLeft:n=!0}=i,r=D(t.projectPosition(e),t.pixelProjectionMatrix),[o,s]=r,a=n?s:t.height-s;return 2===e.length?[o,a]:[o,a,r[2]]})),(0,n.Z)(this,"unproject",(function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{topLeft:n=!0,targetZ:r}=i,[o,s,a]=e,l=n?s:t.height-s,c=r&&r*t.distanceScales.unitsPerMeter[2],u=L([o,l,a],t.pixelUnprojectionMatrix,c),[h,d,p]=t.unprojectPosition(u);return Number.isFinite(a)?[h,d,p]:Number.isFinite(r)?[h,d,r]:[h,d]})),(0,n.Z)(this,"projectPosition",(t=>{const[e,i]=w(t);return[e,i,(t[2]||0)*this.distanceScales.unitsPerMeter[2]]})),(0,n.Z)(this,"unprojectPosition",(t=>{const[e,i]=C(t);return[e,i,(t[2]||0)*this.distanceScales.metersPerUnit[2]]}));let{width:i,height:r,altitude:o=null,fovy:s=null}=e;const{latitude:a=0,longitude:l=0,zoom:u=0,pitch:d=0,bearing:p=0,position:A=null,nearZMultiplier:f=.02,farZMultiplier:g=1.01}=e;i=i||1,r=r||1,null===s&&null===o?(o=_,s=I(o)):null===s?s=I(o):null===o&&(o=P(s));const m=b(u);o=Math.max(.75,o);const y=E({longitude:l,latitude:a}),v=w([l,a]);v.push(0),A&&h.IH(v,v,h.dC([],A,y.unitsPerMeter)),this.projectionMatrix=function(t){const{fov:e,aspect:i,near:n,far:r}=M(t);return c.G3([],e,i,n,r)}({width:i,height:r,scale:m,center:v,pitch:d,fovy:s,nearZMultiplier:f,farZMultiplier:g}),this.viewMatrix=T({height:r,scale:m,center:v,pitch:d,bearing:p,altitude:o}),this.width=i,this.height=r,this.scale=m,this.latitude=a,this.longitude=l,this.zoom=u,this.pitch=d,this.bearing=p,this.altitude=o,this.fovy=s,this.center=v,this.meterOffset=A||[0,0,0],this.distanceScales=y,this._initMatrices(),Object.freeze(this)}_initMatrices(){const{width:t,height:e,projectionMatrix:i,viewMatrix:n}=this,r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];c.Jp(r,r,i),c.Jp(r,r,n),this.viewProjectionMatrix=r;const o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];c.bA(o,o,[t/2,-e/2,1]),c.Iu(o,o,[1,-1,0]),c.Jp(o,o,r);const s=c.U_([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],o);if(!s)throw new Error("Pixel project matrix not invertible");this.pixelProjectionMatrix=o,this.pixelUnprojectionMatrix=s}projectFlat(t){return w(t)}unprojectFlat(t){return C(t)}getMapCenterByLngLatPosition(t){let{lngLat:e,pos:i}=t;const n=L(i,this.pixelUnprojectionMatrix),r=w(e),o=u.IH([],r,u.tk([],n));return C(u.IH([],this.center,o))}fitBounds(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{width:i,height:n}=this,{longitude:r,latitude:o,zoom:s}=O(Object.assign({width:i,height:n,bounds:t},e));return new z({width:i,height:n,longitude:r,latitude:o,zoom:s})}getBounds(t){const e=this.getBoundingRegion(t),i=Math.min(...e.map((t=>t[0]))),n=Math.max(...e.map((t=>t[0])));return[[i,Math.min(...e.map((t=>t[1])))],[n,Math.max(...e.map((t=>t[1])))]]}getBoundingRegion(){return R(this,(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).z||0)}getLocationAtPoint(t){let{lngLat:e,pos:i}=t;return this.getMapCenterByLngLatPosition({lngLat:e,pos:i})}}const U=512;function N(t){const{width:e,height:i,pitch:n=0}=t;
2let{longitude:r,latitude:o,zoom:a,bearing:c=0}=t;(r<-180||r>180)&&(r=s(r+180,360)-180),(c<-180||c>180)&&(c=s(c+180,360)-180);const u=l(i/U);if(a<=u)a=u,o=0;else{const t=i/2/Math.pow(2,a),e=C([0,t])[1];if(o<e)o=e;else{const e=C([0,U-t])[1];o>e&&(o=e)}}return{width:e,height:i,longitude:r,latitude:o,zoom:a,pitch:n,bearing:c}}const G=.01,Z=["longitude","latitude","zoom"],j={curve:1.414,speed:1.2};function V(t,e,i,n){const{startZoom:r,startCenterXY:o,uDelta:s,w0:a,u1:l,S:c,rho:h,rho2:d,r0:p}=J(t,e,n);if(l<G){const n={};for(const r of Z){const o=t[r],s=e[r];n[r]=(A=i)*s+(1-A)*o}return n}var A;const f=i*c,g=Math.cosh(p)/Math.cosh(p+h*f),m=a*((Math.cosh(p)*Math.tanh(p+h*f)-Math.sinh(p))/d)/l,y=r+x(1/g),v=u.bA([],s,m);u.IH(v,v,o);const _=C(v);return{longitude:_[0],latitude:_[1],zoom:y}}function H(t,e,i){const n={...j,...i},{screenSpeed:r,speed:o,maxDuration:s}=n,{S:a,rho:l}=J(t,e,n),c=1e3*a;let u;return u=Number.isFinite(r)?c/(r/l):c/o,Number.isFinite(s)&&u>s?0:u}function J(t,e,i){const n=(i=Object.assign({},j,i)).curve,r=t.zoom,o=[t.longitude,t.latitude],s=b(r),a=e.zoom,l=[e.longitude,e.latitude],c=b(a-r),h=w(o),d=w(l),p=u.lu([],d,h),A=Math.max(t.width,t.height),f=A/c,g=u.kE(p)*s,m=Math.max(g,G),y=n*n,v=(f*f-A*A+y*y*m*m)/(2*A*y*m),_=(f*f-A*A-y*y*m*m)/(2*f*y*m),x=Math.log(Math.sqrt(v*v+1)-v),C=Math.log(Math.sqrt(_*_+1)-_);return{startZoom:r,startCenterXY:h,uDelta:p,w0:A,u1:g,S:(C-x)/n,rho:n,rho2:y,r0:x,r1:C}}},93594:(t,e,i)=>{"use strict";i.d(e,{Z:()=>s});var n=i(11515),r=i(33568);const o=globalThis;function s(t){if(!t&&!(0,n.Z)())return"Node";if((0,r.Z)(t))return"Electron";const e="undefined"!==typeof navigator?navigator:{},i=t||e.userAgent||"";if(i.indexOf("Edge")>-1)return"Edge";const s=-1!==i.indexOf("MSIE "),a=-1!==i.indexOf("Trident/");return s||a?"IE":o.chrome?"Chrome":o.safari?"Safari":o.mozInnerScreenX?"Firefox":"Unknown"}},11515:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(33568);function r(){return!("object"===typeof process&&"[object process]"===String(process)&&!process.browser)||(0,n.Z)()}},33568:(t,e,i)=>{"use strict";function n(t){if("undefined"!==typeof window&&"object"===typeof window.process&&"renderer"===window.process.type)return!0;if("undefined"!==typeof process&&"object"===typeof process.versions&&Boolean(process.versions.electron))return!0;const e="object"===typeof navigator&&"string"===typeof navigator.userAgent&&navigator.userAgent,i=t||e;return!!(i&&i.indexOf("Electron")>=0)}i.d(e,{Z:()=>n})},87294:(t,e,i)=>{"use strict";i.d(e,{Z:()=>_});var n=i(64649),r=i(11515);const o="undefined"!==typeof __VERSION__?__VERSION__:"untranspiled source";(0,r.Z)();class s{constructor(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"sessionStorage";(0,n.Z)(this,"storage",void 0),(0,n.Z)(this,"id",void 0),(0,n.Z)(this,"config",void 0),this.storage=function(t){try{const e=window[t],i="__storage_test__";return e.setItem(i,i),e.removeItem(i),e}catch(e){return null}}(i),this.id=t,this.config=e,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){const t=JSON.stringify(this.config);this.storage.setItem(this.id,t)}}_loadConfiguration(){let t={};if(this.storage){const e=this.storage.getItem(this.id);t=e?JSON.parse(e):{}}return Object.assign(this.config,t),this}}function a(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:600;const r=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(i=Math.min(i,n/t.width));const o=t.width*i,s=t.height*i,a=["font-size:1px;","padding:".concat(Math.floor(s/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(s,"px;"),"background:url(".concat(r,");"),"background-size:".concat(o,"px ").concat(s,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}let l;function c(t){return"string"===typeof t?l[t.toUpperCase()]||l.WHITE:t}function u(t,e){if(!t)throw new Error(e||"Assertion failed")}!function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"}(l||(l={}));const h={self:"undefined"!==typeof self&&self,window:"undefined"!==typeof window&&window,global:"undefined"!==typeof i.g&&i.g,document:"undefined"!==typeof document&&document,process:"object"===typeof process&&process}
2,d=(globalThis,h.window||h.self||h.global),p=h.process||{};console;function A(){let t;var e,i;if(r.Z&&"performance"in d)t=null===d||void 0===d||null===(e=d.performance)||void 0===e||null===(i=e.now)||void 0===i?void 0:i.call(e);else if("hrtime"in p){var n;const e=null===p||void 0===p||null===(n=p.hrtime)||void 0===n?void 0:n.call(p);t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}const f={debug:r.Z&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},g={enabled:!0,level:0};function m(){}const y={},v={once:!0};class _{constructor(){let{id:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{id:""};(0,n.Z)(this,"id",void 0),(0,n.Z)(this,"VERSION",o),(0,n.Z)(this,"_startTs",A()),(0,n.Z)(this,"_deltaTs",A()),(0,n.Z)(this,"_storage",void 0),(0,n.Z)(this,"userData",{}),(0,n.Z)(this,"LOG_THROTTLE_TIMEOUT",0),this.id=t,this.userData={},this._storage=new s("__probe-".concat(this.id,"__"),g),this.timeStamp("".concat(this.id," started")),function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["constructor"];const i=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(i);for(const r of n)"function"===typeof t[r]&&(e.find((t=>r===t))||(t[r]=t[r].bind(t)))}(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((A()-this._startTs).toPrecision(10))}getDelta(){return Number((A()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,e){this._storage.setConfiguration({[t]:e})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,e){u(t,e)}warn(t){return this._getLogFunction(0,t,f.warn,arguments,v)}error(t){return this._getLogFunction(0,t,f.error,arguments)}deprecated(t,e){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(e,"` instead"))}removed(t,e){return this.error("`".concat(t,"` has been removed. Use `").concat(e,"` instead"))}probe(t,e){return this._getLogFunction(t,e,f.log,arguments,{time:!0,once:!0})}log(t,e){return this._getLogFunction(t,e,f.debug,arguments)}info(t,e){return this._getLogFunction(t,e,console.info,arguments)}once(t,e){for(var i=arguments.length,n=new Array(i>2?i-2:0),r=2;r<i;r++)n[r-2]=arguments[r];return this._getLogFunction(t,e,f.debug||f.info,arguments,v)}table(t,e,i){return e?this._getLogFunction(t,e,console.table||m,i&&[i],{tag:w(e)}):m}image(t){let{logLevel:e,priority:i,image:n,message:o="",scale:s=1}=t;return this._shouldLog(e||i)?r.Z?function(t){let{image:e,message:i="",scale:n=1}=t;if("string"===typeof e){const t=new Image;return t.onload=()=>{const e=a(t,i,n);console.log(...e)},t.src=e,m}const r=e.nodeName||"";if("img"===r.toLowerCase())return console.log(...a(e,i,n)),m;if("canvas"===r.toLowerCase()){const t=new Image;return t.onload=()=>console.log(...a(t,i,n)),t.src=e.toDataURL(),m}return m}({image:n,message:o,scale:s}):function(t){let{image:e,message:i="",scale:n=1}=t;return console.warn("removed"),m}({image:n,message:o,scale:s}):m}time(t,e){return this._getLogFunction(t,e,console.time?console.time:console.info)}timeEnd(t,e){return this._getLogFunction(t,e,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,e){return this._getLogFunction(t,e,console.timeStamp||m)}group(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{collapsed:!1};const n=x({logLevel:t,message:e,opts:i}),{collapsed:r}=i;return n.method=(r?console.groupCollapsed:console.group)||console.info,this._getLogFunction(n)}groupCollapsed(t,e){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.group(t,e,Object.assign({},i,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||m)}
2withGroup(t,e,i){this.group(t,e)();try{i()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=b(t)}_getLogFunction(t,e,i,n,o){if(this._shouldLog(t)){o=x({logLevel:t,message:e,args:n,opts:o}),u(i=i||o.method),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=A();const s=o.tag||o.message;if(o.once){if(y[s])return m;y[s]=A()}return e=function(t,e,i){if("string"===typeof e){const a=i.time?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;const i=Math.max(e-t.length,0);return"".concat(" ".repeat(i)).concat(t)}(function(t){let e;return e=t<10?"".concat(t.toFixed(2),"ms"):t<100?"".concat(t.toFixed(1),"ms"):t<1e3?"".concat(t.toFixed(0),"ms"):"".concat((t/1e3).toFixed(2),"s"),e}(i.total)):"";e=i.time?"".concat(t,": ").concat(a,"  ").concat(e):"".concat(t,": ").concat(e),n=e,o=i.color,s=i.background,r.Z||"string"!==typeof n||(o&&(o=c(o),n="\x1b[".concat(o,"m").concat(n,"\x1b[39m")),s&&(o=c(s),n="\x1b[".concat(s+10,"m").concat(n,"\x1b[49m"))),e=n}var n,o,s;return e}(this.id,o.message,o),i.bind(console,e,...o.args)}return m}}function b(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return u(Number.isFinite(e)&&e>=0),e}function x(t){const{logLevel:e,message:i}=t;t.logLevel=b(e);const n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==i;);switch(typeof e){case"string":case"function":void 0!==i&&n.unshift(i),t.message=e;break;case"object":Object.assign(t,e)}"function"===typeof t.message&&(t.message=t.message());const r=typeof t.message;return u("string"===r||"object"===r),Object.assign(t,{args:n},t.opts)}function w(t){for(const e in t)for(const i in t[e])return i||"untitled";return"empty"}(0,n.Z)(_,"VERSION",o)},92138:(t,e,i)=>{"use strict";i.d(e,{Z:()=>s});var n=i(64649);function r(){let t;if("undefined"!==typeof window&&window.performance)t=window.performance.now();else if("undefined"!==typeof process&&process.hrtime){const e=process.hrtime();t=1e3*e[0]+e[1]/1e6}else t=Date.now();return t}class o{constructor(t,e){(0,n.Z)(this,"name",void 0),(0,n.Z)(this,"type",void 0),(0,n.Z)(this,"sampleSize",1),(0,n.Z)(this,"time",void 0),(0,n.Z)(this,"count",void 0),(0,n.Z)(this,"samples",void 0),(0,n.Z)(this,"lastTiming",void 0),(0,n.Z)(this,"lastSampleTime",void 0),(0,n.Z)(this,"lastSampleCount",void 0),(0,n.Z)(this,"_count",0),(0,n.Z)(this,"_time",0),(0,n.Z)(this,"_samples",0),(0,n.Z)(this,"_startTime",0),(0,n.Z)(this,"_timerPending",!1),this.name=t,this.type=e,this.reset()}setSampleSize(t){return this.sampleSize=t,this}incrementCount(){return this.addCount(1),this}decrementCount(){return this.subtractCount(1),this}addCount(t){return this._count+=t,this._samples++,this._checkSampling(),this}subtractCount(t){return this._count-=t,this._samples++,this._checkSampling(),this}addTime(t){return this._time+=t,this.lastTiming=t,this._samples++,this._checkSampling(),this}timeStart(){return this._startTime=r(),this._timerPending=!0,this}timeEnd(){return this._timerPending?(this.addTime(r()-this._startTime),this._timerPending=!1,this._checkSampling(),this):this}getSampleAverageCount(){return this.sampleSize>0?this.lastSampleCount/this.sampleSize:0}getSampleAverageTime(){return this.sampleSize>0?this.lastSampleTime/this.sampleSize:0}getSampleHz(){return this.lastSampleTime>0?this.sampleSize/(this.lastSampleTime/1e3):0}getAverageCount(){return this.samples>0?this.count/this.samples:0}getAverageTime(){return this.samples>0?this.time/this.samples:0}getHz(){return this.time>0?this.samples/(this.time/1e3):0}reset(){return this.time=0,this.count=0,this.samples=0,this.lastTiming=0,this.lastSampleTime=0,this.lastSampleCount=0,this._count=0,this._time=0,this._samples=0,this._startTime=0,this._timerPending=!1,this}_checkSampling(){this._samples===this.sampleSize&&(this.lastSampleTime=this._time,this.lastSampleCount=this._count,this.count+=this._count,this.time+=this._time,this.samples+=this._samples,this._time=0,this._count=0,this._samples=0)}}class s{constructor(t){(0,n.Z)(this,"id",void 0),(0,n.Z)(this,"stats",{}),this.id=t.id,this.stats={},this._initializeStats(t.stats),Object.seal(this)}get(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"count";return this._getOrCreate({name:t,type:e})}get size(){return Object.keys(this.stats).length}reset(){for(const t in this.stats)this.stats[t].reset();return this}forEach(t){for(const e in this.stats)t(this.stats[e])}getTable(){const t={};return this.forEach((e=>{t[e.name]={time:e.time||0,count:e.count||0,average:e.getAverageTime()||0,hz:e.getHz()||0}})),t}_initializeStats(){(arguments.length>
vendor: 4,594 bytes, line 2
20&&void 0!==arguments[0]?arguments[0]:[]).forEach((t=>this._getOrCreate(t)))}_getOrCreate(t){if(!t||!t.name)return null;const{name:e,type:i}=t;return this.stats[e]||(this.stats[e]=t instanceof o?t:new o(e,i)),this.stats[e]}}},25880:t=>{"use strict";function e(t,e,n){n=n||2;var o,s,a,l,h,d,A,f=e&&e.length,g=f?e[0]*n:t.length,m=i(t,0,g,n,!0),y=[];if(!m||m.next===m.prev)return y;if(f&&(m=function(t,e,n,r){var o,s,a,l=[];for(o=0,s=e.length;o<s;o++)(a=i(t,e[o]*r,o<s-1?e[o+1]*r:t.length,r,!1))===a.next&&(a.steiner=!0),l.push(p(a));for(l.sort(c),o=0;o<l.length;o++)n=u(l[o],n);return n}(t,e,m,n)),t.length>80*n){o=a=t[0],s=l=t[1];for(var v=n;v<g;v+=n)(h=t[v])<o&&(o=h),(d=t[v+1])<s&&(s=d),h>a&&(a=h),d>l&&(l=d);A=0!==(A=Math.max(a-o,l-s))?32767/A:0}return r(m,y,n,o,s,A,0),y}function i(t,e,i,n,r){var o,s;if(r===E(t,e,i,n)>0)for(o=e;o<i;o+=n)s=w(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=w(o,t[o],t[o+1],s);return s&&m(s,s.next)&&(C(s),s=s.next),s}function n(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!m(n,n.next)&&0!==g(n.prev,n,n.next))n=n.next;else{if(C(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function r(t,e,i,c,u,h,p){if(t){!p&&h&&function(t,e,i,n){var r=t;do{0===r.z&&(r.z=d(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,s,a,l,c=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e<c&&(a++,n=n.nextZ);e++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(s>1)}(r)}(t,c,u,h);for(var A,f,g=t;t.prev!==t.next;)if(A=t.prev,f=t.next,h?s(t,c,u,h):o(t))e.push(A.i/i|0),e.push(t.i/i|0),e.push(f.i/i|0),C(t),t=f.next,g=f.next;else if((t=f)===g){p?1===p?r(t=a(n(t),e,i),e,i,c,u,h,2):2===p&&l(t,e,i,c,u,h):r(n(t),e,i,c,u,h,1);break}}}function o(t){var e=t.prev,i=t,n=t.next;if(g(e,i,n)>=0)return!1;for(var r=e.x,o=i.x,s=n.x,a=e.y,l=i.y,c=n.y,u=r<o?r<s?r:s:o<s?o:s,h=a<l?a<c?a:c:l<c?l:c,d=r>o?r>s?r:s:o>s?o:s,p=a>l?a>c?a:c:l>c?l:c,f=n.next;f!==e;){if(f.x>=u&&f.x<=d&&f.y>=h&&f.y<=p&&A(r,a,o,l,s,c,f.x,f.y)&&g(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function s(t,e,i,n){var r=t.prev,o=t,s=t.next;if(g(r,o,s)>=0)return!1;for(var a=r.x,l=o.x,c=s.x,u=r.y,h=o.y,p=s.y,f=a<l?a<c?a:c:l<c?l:c,m=u<h?u<p?u:p:h<p?h:p,y=a>l?a>c?a:c:l>c?l:c,v=u>h?u>p?u:p:h>p?h:p,_=d(f,m,e,i,n),b=d(y,v,e,i,n),x=t.prevZ,w=t.nextZ;x&&x.z>=_&&w&&w.z<=b;){if(x.x>=f&&x.x<=y&&x.y>=m&&x.y<=v&&x!==r&&x!==s&&A(a,u,l,h,c,p,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,w.x>=f&&w.x<=y&&w.y>=m&&w.y<=v&&w!==r&&w!==s&&A(a,u,l,h,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}for(;x&&x.z>=_;){if(x.x>=f&&x.x<=y&&x.y>=m&&x.y<=v&&x!==r&&x!==s&&A(a,u,l,h,c,p,x.x,x.y)&&g(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;w&&w.z<=b;){if(w.x>=f&&w.x<=y&&w.y>=m&&w.y<=v&&w!==r&&w!==s&&A(a,u,l,h,c,p,w.x,w.y)&&g(w.prev,w,w.next)>=0)return!1;w=w.nextZ}return!0}function a(t,e,i){var r=t;do{var o=r.prev,s=r.next.next;!m(o,s)&&y(o,r,r.next,s)&&b(o,s)&&b(s,o)&&(e.push(o.i/i|0),e.push(r.i/i|0),e.push(s.i/i|0),C(r),C(r.next),r=t=s),r=r.next}while(r!==t);return n(r)}function l(t,e,i,o,s,a){var l=t;do{for(var c=l.next.next;c!==l.prev;){if(l.i!==c.i&&f(l,c)){var u=x(l,c);return l=n(l,l.next),u=n(u,u.next),r(l,e,i,o,s,a,0),void r(u,e,i,o,s,a,0)}c=c.next}l=l.next}while(l!==t)}function c(t,e){return t.x-e.x}function u(t,e){var i=function(t,e){var i,n=e,r=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>s&&(s=a,i=n.x<n.next.x?n:n.next,a===r))return i}n=n.next}while(n!==e);if(!i)return null;var l,c=i,u=i.x,d=i.y,p=1/0;n=i;do{r>=n.x&&n.x>=u&&r!==n.x&&A(o<d?r:s,o,u,d,o<d?s:r,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(r-n.x),b(n,t)&&(l<p||l===p&&(n.x>i.x||n.x===i.x&&h(i,n)))&&(i=n,p=l)),n=n.next}while(n!==c);return i}(t,e);if(!i)return e;var r=x(i,t);return n(r,r.next),n(i,i.next)}function h(t,e){return g(t.prev,t,e.prev)<0&&g(e.next,t,t.next)<0}function d(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function p(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function A(t,e,i,n,r,o,s,a){return(r-s)*(e-a)>=(t-s)*(o-a)&&(t-s)*(n-a)>=(i-s)*(e-a)&&(i-s)*(o-a)>=(r-s)*(n-a)}function f(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&y(i,i.next,t,e))return!0;
2i=i.next}while(i!==t);return!1}(t,e)&&(b(t,e)&&b(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!==i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(g(t.prev,t,e.prev)||g(t,e.prev,e))||m(t,e)&&g(t.prev,t,t.next)>0&&g(e.prev,e,e.next)>0)}function g(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function m(t,e){return t.x===e.x&&t.y===e.y}function y(t,e,i,n){var r=_(g(t,e,i)),o=_(g(t,e,n)),s=_(g(i,n,t)),a=_(g(i,n,e));return r!==o&&s!==a||(!(0!==r||!v(t,i,e))||(!(0!==o||!v(t,n,e))||(!(0!==s||!v(i,t,n))||!(0!==a||!v(i,e,n)))))}function v(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function _(t){return t>0?1:t<0?-1:0}function b(t,e){return g(t.prev,t,t.next)<0?g(t,e,t.next)>=0&&g(t,t.prev,e)>=0:g(t,e,t.prev)<0||g(t,t.next,e)<0}function x(t,e){var i=new B(t.i,t.x,t.y),n=new B(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function w(t,e,i,n){var r=new B(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function C(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function B(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function E(t,e,i,n){for(var r=0,o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}t.exports=e,t.exports.default=e,e.deviation=function(t,e,i,n){var r=e&&e.length,o=r?e[0]*i:t.length,s=Math.abs(E(t,0,o,i));if(r)for(var a=0,l=e.length;a<l;a++){var c=e[a]*i,u=a<l-1?e[a+1]*i:t.length;s-=Math.abs(E(t,c,u,i))}var h=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,p=n[a+1]*i,A=n[a+2]*i;h+=Math.abs((t[d]-t[A])*(t[p+1]-t[d+1])-(t[d]-t[p])*(t[A+1]-t[d+1]))}return 0===s&&0===h?0:Math.abs((h-s)/s)},e.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)i.vertices.push(t[r][o][s]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i}},61521:(t,e,i)=>{const n=i(42103),r={"||":function(t,e){return t||e},"&&":function(t,e){return t&&e},"|":function(t,e){return t|e},"^":function(t,e){return t^e},"&":function(t,e){return t&e},"==":function(t,e){return t==e},"!=":function(t,e){return t!=e},"===":function(t,e){return t===e},"!==":function(t,e){return t!==e},"<":function(t,e){return t<e},">":function(t,e){return t>e},"<=":function(t,e){return t<=e},">=":function(t,e){return t>=e},"<<":function(t,e){return t<<e},">>":function(t,e){return t>>e},">>>":function(t,e){return t>>>e},"+":function(t,e){return t+e},"-":function(t,e){return t-e},"*":function(t,e){return t*e},"/":function(t,e){return t/e},"%":function(t,e){return t%e}},o={"-":function(t){return-t},"+":function(t){return+t},"~":function(t){return~t},"!":function(t){return!t}};function s(t,e){return t.map((function(t){return u(t,e)}))}async function a(t,e){return await Promise.all(t.map((t=>h(t,e))))}function l(t,e){const i=u(t.object,e);return t.computed?[i,i[u(t.property,e)]]:[i,i[t.property.name]]}async function c(t,e){const i=await h(t.object,e);return t.computed?[i,i[await h(t.property,e)]]:[i,i[t.property.name]]}function u(t,e){switch(t.type){case"ArrayExpression":return s(t.elements,e);case"BinaryExpression":return r[t.operator](u(t.left,e),u(t.right,e));case"CallExpression":let i,n,a;if("MemberExpression"===t.callee.type?(a=l(t.callee,e),i=a[0],n=a[1]):n=u(t.callee,e),"function"!==typeof n)return;return n.apply(i,s(t.arguments,e));case"ConditionalExpression":return u(t.test,e)?u(t.consequent,e):u(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":return"||"===t.operator?u(t.left,e)||u(t.right,e):"&&"===t.operator?u(t.left,e)&&u(t.right,e):r[t.operator](u(t.left,e),u(t.right,e));case"MemberExpression":return l(t,e)[1];case"ThisExpression":return e;case"UnaryExpression":return o[t.operator](u(t.argument,e));default:return}}async function h(t,e){switch(t.type){case"ArrayExpression":return await a(t.elements,e);case"BinaryExpression":{const[i,n]=await Promise.all([h(t.left,e),h(t.right,e)]);return r[t.operator](i,n)}case"CallExpression":let i,n,s;if("MemberExpression"===t.callee.type?(s=await c(t.callee,e),i=s[0],n=s[1]):n=await h(t.callee,e),"function"!==typeof n)return;return await n.apply(i,await a(t.arguments,e));case"ConditionalExpression":return await h(t.test,e)?await h(t.consequent,e):await h(t.alternate,e);case"Identifier":return e[t.name];case"Literal":return t.value;case"LogicalExpression":{if("||"===t.operator)return await h(t.left,e)||await h(t.right,e);if("&&"===t.operator)return await h(t.left,e)&&await h(t.right,e);const[i,n]=await Promise.all([h(t.left,e),h(t.right,e)]);return r[t.operator](i,n)}case"MemberExpression":return(await c(t,e))[1];case"ThisExpression":return e;case"UnaryExpression":return o[t.operator](await h(t.argument,e));default:return}}t.exports={parse:n,eval:u,evalAsync:h,compile:function(t){return u.bind(null,n(t))},compileAsync:function(t){return h.bind(null,n(t))}}},60285:(t,e,i)=>{"use strict";i.d(e,{Ib:()=>n,WT:()=>r});var n=1e-6,r="undefined"!==typeof Float32Array?Float32Array:Array;Math.random;Math.PI;Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)})},24645:(t,e,i)=>{"use strict";i.d(e,{GH:()=>a,Iu:()=>c,Jp:()=>l,U1:()=>u,U_:()=>s,Ue:()=>r,bA:()=>h,en:()=>d,p4:()=>o});var n=i(60285);function r(){var t=new n.WT(9);return n.WT!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function o(t,e){if(t===e){var i=e[1],n=e[2],r=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=n,t[7]=r}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function s(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*s-a*c,d=-u*o+a*l,p=c*o-s*l,A=i*h+n*d+r*p;return A?(A=1/A,t[0]=h*A,t[1]=(-u*n+r*c)*A,t[2]=(a*n-r*s)*A,t[3]=d*A,t[4]=(u*i-r*l)*A,t[5]=(-a*i+r*o)*A,t[6]=p*A,t[7]=(-c*i+n*l)*A,t[8]=(s*i-n*o)*A,t):null}function a(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*(c*o-s*l)+i*(-c*r+s*a)+n*(l*r-o*a)}function l(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=i[0],p=i[1],A=i[2],f=i[3],g=i[4],m=i[5],y=i[6],v=i[7],_=i[8];return t[0]=d*n+p*s+A*c,t[1]=d*r+p*a+A*u,t[2]=d*o+p*l+A*h,t[3]=f*n+g*s+m*c,t[4]=f*r+g*a+m*u,t[5]=f*o+g*l+m*h,t[6]=y*n+v*s+_*c,t[7]=y*r+v*a+_*u,t[8]=y*o+v*l+_*h,t}function c(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=i[0],p=i[1];return t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=d*n+p*s+c,t[7]=d*r+p*a+u,t[8]=d*o+p*l+h,t}function u(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=Math.sin(i),p=Math.cos(i);
2return t[0]=p*n+d*s,t[1]=p*r+d*a,t[2]=p*o+d*l,t[3]=p*s-d*n,t[4]=p*a-d*r,t[5]=p*l-d*o,t[6]=c,t[7]=u,t[8]=h,t}function h(t,e,i){var n=i[0],r=i[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=r*e[3],t[4]=r*e[4],t[5]=r*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function d(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i+i,a=n+n,l=r+r,c=i*s,u=n*s,h=n*a,d=r*s,p=r*a,A=r*l,f=o*s,g=o*a,m=o*l;return t[0]=1-h-A,t[3]=u-m,t[6]=d+g,t[1]=u+m,t[4]=1-c-A,t[7]=p-f,t[2]=d-g,t[5]=p+f,t[8]=1-c-h,t}},83367:(t,e,i)=>{"use strict";i.d(e,{G3:()=>m,GH:()=>s,Iu:()=>l,Jp:()=>a,M5:()=>y,Q$:()=>A,U1:()=>u,U_:()=>o,bA:()=>c,en:()=>f,fS:()=>_,jI:()=>p,lM:()=>h,oy:()=>g,p4:()=>r,uD:()=>d,zB:()=>v});var n=i(60285);function r(t,e){if(t===e){var i=e[1],n=e[2],r=e[3],o=e[6],s=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=i,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=o,t[11]=e[14],t[12]=r,t[13]=s,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function o(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],A=e[12],f=e[13],g=e[14],m=e[15],y=i*a-n*s,v=i*l-r*s,_=i*c-o*s,b=n*l-r*a,x=n*c-o*a,w=r*c-o*l,C=u*f-h*A,B=u*g-d*A,E=u*m-p*A,S=h*g-d*f,T=h*m-p*f,M=d*m-p*g,I=y*M-v*T+_*S+b*E-x*B+w*C;return I?(I=1/I,t[0]=(a*M-l*T+c*S)*I,t[1]=(r*T-n*M-o*S)*I,t[2]=(f*w-g*x+m*b)*I,t[3]=(d*x-h*w-p*b)*I,t[4]=(l*E-s*M-c*B)*I,t[5]=(i*M-r*E+o*B)*I,t[6]=(g*_-A*w-m*v)*I,t[7]=(u*w-d*_+p*v)*I,t[8]=(s*T-a*E+c*C)*I,t[9]=(n*E-i*T-o*C)*I,t[10]=(A*x-f*_+m*y)*I,t[11]=(h*_-u*x-p*y)*I,t[12]=(a*B-s*S-l*C)*I,t[13]=(i*S-n*B+r*C)*I,t[14]=(f*v-A*b-g*y)*I,t[15]=(u*b-h*v+d*y)*I,t):null}function s(t){var e=t[0],i=t[1],n=t[2],r=t[3],o=t[4],s=t[5],a=t[6],l=t[7],c=t[8],u=t[9],h=t[10],d=t[11],p=t[12],A=t[13],f=t[14],g=t[15];return(e*s-i*o)*(h*g-d*f)-(e*a-n*o)*(u*g-d*A)+(e*l-r*o)*(u*f-h*A)+(i*a-n*s)*(c*g-d*p)-(i*l-r*s)*(c*f-h*p)+(n*l-r*a)*(c*A-u*p)}function a(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],A=e[11],f=e[12],g=e[13],m=e[14],y=e[15],v=i[0],_=i[1],b=i[2],x=i[3];return t[0]=v*n+_*a+b*h+x*f,t[1]=v*r+_*l+b*d+x*g,t[2]=v*o+_*c+b*p+x*m,t[3]=v*s+_*u+b*A+x*y,v=i[4],_=i[5],b=i[6],x=i[7],t[4]=v*n+_*a+b*h+x*f,t[5]=v*r+_*l+b*d+x*g,t[6]=v*o+_*c+b*p+x*m,t[7]=v*s+_*u+b*A+x*y,v=i[8],_=i[9],b=i[10],x=i[11],t[8]=v*n+_*a+b*h+x*f,t[9]=v*r+_*l+b*d+x*g,t[10]=v*o+_*c+b*p+x*m,t[11]=v*s+_*u+b*A+x*y,v=i[12],_=i[13],b=i[14],x=i[15],t[12]=v*n+_*a+b*h+x*f,t[13]=v*r+_*l+b*d+x*g,t[14]=v*o+_*c+b*p+x*m,t[15]=v*s+_*u+b*A+x*y,t}function l(t,e,i){var n,r,o,s,a,l,c,u,h,d,p,A,f=i[0],g=i[1],m=i[2];return e===t?(t[12]=e[0]*f+e[4]*g+e[8]*m+e[12],t[13]=e[1]*f+e[5]*g+e[9]*m+e[13],t[14]=e[2]*f+e[6]*g+e[10]*m+e[14],t[15]=e[3]*f+e[7]*g+e[11]*m+e[15]):(n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],A=e[11],t[0]=n,t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=A,t[12]=n*f+a*g+h*m+e[12],t[13]=r*f+l*g+d*m+e[13],t[14]=o*f+c*g+p*m+e[14],t[15]=s*f+u*g+A*m+e[15]),t}function c(t,e,i){var n=i[0],r=i[1],o=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function u(t,e,i,r){var o,s,a,l,c,u,h,d,p,A,f,g,m,y,v,_,b,x,w,C,B,E,S,T,M=r[0],I=r[1],P=r[2],D=Math.hypot(M,I,P);return D<n.Ib?null:(M*=D=1/D,I*=D,P*=D,o=Math.sin(i),a=1-(s=Math.cos(i)),l=e[0],c=e[1],u=e[2],h=e[3],d=e[4],p=e[5],A=e[6],f=e[7],g=e[8],m=e[9],y=e[10],v=e[11],_=M*M*a+s,b=I*M*a+P*o,x=P*M*a-I*o,w=M*I*a-P*o,C=I*I*a+s,B=P*I*a+M*o,E=M*P*a+I*o,S=I*P*a-M*o,T=P*P*a+s,t[0]=l*_+d*b+g*x,t[1]=c*_+p*b+m*x,t[2]=u*_+A*b+y*x,t[3]=h*_+f*b+v*x,t[4]=l*w+d*C+g*B,t[5]=c*w+p*C+m*B,t[6]=u*w+A*C+y*B,t[7]=h*w+f*C+v*B,t[8]=l*E+d*S+g*T,t[9]=c*E+p*S+m*T,t[10]=u*E+A*S+y*T,t[11]=h*E+f*S+v*T,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function h(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*n,t[5]=s*r+u*n,t[6]=a*r+h*n,t[7]=l*r+d*n,t[8]=c*r-o*n,t[9]=u*r-s*n,t[10]=h*r-a*n,t[11]=d*r-l*n,t}function d(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r-c*n,t[1]=s*r-u*n,t[2]=a*r-h*n,t[3]=l*r-d*n,t[8]=o*n+c*r,t[9]=s*n+u*r,t[10]=a*n+h*r,t[11]=l*n+d*r,t}
2function p(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*n,t[1]=s*r+u*n,t[2]=a*r+h*n,t[3]=l*r+d*n,t[4]=c*r-o*n,t[5]=u*r-s*n,t[6]=h*r-a*n,t[7]=d*r-l*n,t}function A(t,e){var i=e[0],n=e[1],r=e[2],o=e[4],s=e[5],a=e[6],l=e[8],c=e[9],u=e[10];return t[0]=Math.hypot(i,n,r),t[1]=Math.hypot(o,s,a),t[2]=Math.hypot(l,c,u),t}function f(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i+i,a=n+n,l=r+r,c=i*s,u=n*s,h=n*a,d=r*s,p=r*a,A=r*l,f=o*s,g=o*a,m=o*l;return t[0]=1-h-A,t[1]=u+m,t[2]=d-g,t[3]=0,t[4]=u-m,t[5]=1-c-A,t[6]=p+f,t[7]=0,t[8]=d+g,t[9]=p-f,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function g(t,e,i,n,r,o,s){var a=1/(i-e),l=1/(r-n),c=1/(o-s);return t[0]=2*o*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*l,t[6]=0,t[7]=0,t[8]=(i+e)*a,t[9]=(r+n)*l,t[10]=(s+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=s*o*2*c,t[15]=0,t}var m=function(t,e,i,n,r){var o,s=1/Math.tan(e/2);return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(o=1/(n-r),t[10]=(r+n)*o,t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t};var y=function(t,e,i,n,r,o,s){var a=1/(e-i),l=1/(n-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(s+o)*c,t[15]=1,t};function v(t,e,i,r){var o,s,a,l,c,u,h,d,p,A,f=e[0],g=e[1],m=e[2],y=r[0],v=r[1],_=r[2],b=i[0],x=i[1],w=i[2];return Math.abs(f-b)<n.Ib&&Math.abs(g-x)<n.Ib&&Math.abs(m-w)<n.Ib?function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}(t):(h=f-b,d=g-x,p=m-w,o=v*(p*=A=1/Math.hypot(h,d,p))-_*(d*=A),s=_*(h*=A)-y*p,a=y*d-v*h,(A=Math.hypot(o,s,a))?(o*=A=1/A,s*=A,a*=A):(o=0,s=0,a=0),l=d*a-p*s,c=p*o-h*a,u=h*s-d*o,(A=Math.hypot(l,c,u))?(l*=A=1/A,c*=A,u*=A):(l=0,c=0,u=0),t[0]=o,t[1]=l,t[2]=h,t[3]=0,t[4]=s,t[5]=c,t[6]=d,t[7]=0,t[8]=a,t[9]=u,t[10]=p,t[11]=0,t[12]=-(o*f+s*g+a*m),t[13]=-(l*f+c*g+u*m),t[14]=-(h*f+d*g+p*m),t[15]=1,t)}function _(t,e){var i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],l=t[5],c=t[6],u=t[7],h=t[8],d=t[9],p=t[10],A=t[11],f=t[12],g=t[13],m=t[14],y=t[15],v=e[0],_=e[1],b=e[2],x=e[3],w=e[4],C=e[5],B=e[6],E=e[7],S=e[8],T=e[9],M=e[10],I=e[11],P=e[12],D=e[13],L=e[14],O=e[15];return Math.abs(i-v)<=n.Ib*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(r-_)<=n.Ib*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(o-b)<=n.Ib*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(s-x)<=n.Ib*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(a-w)<=n.Ib*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(l-C)<=n.Ib*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(c-B)<=n.Ib*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(u-E)<=n.Ib*Math.max(1,Math.abs(u),Math.abs(E))&&Math.abs(h-S)<=n.Ib*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(d-T)<=n.Ib*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-M)<=n.Ib*Math.max(1,Math.abs(p),Math.abs(M))&&Math.abs(A-I)<=n.Ib*Math.max(1,Math.abs(A),Math.abs(I))&&Math.abs(f-P)<=n.Ib*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(g-D)<=n.Ib*Math.max(1,Math.abs(g),Math.abs(D))&&Math.abs(m-L)<=n.Ib*Math.max(1,Math.abs(m),Math.abs(L))&&Math.abs(y-O)<=n.Ib*Math.max(1,Math.abs(y),Math.abs(O))}},77548:(t,e,i)=>{"use strict";i.d(e,{IH:()=>r,bA:()=>o,c:()=>c,fF:()=>d,iu:()=>u,kE:()=>s,kK:()=>h,lu:()=>p,t7:()=>l,tk:()=>a});var n=i(60285);function r(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function o(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function s(t){var e=t[0],i=t[1];return Math.hypot(e,i)}function a(t,e){return t[0]=-e[0],t[1]=-e[1],t}function l(t,e,i,n){var r=e[0],o=e[1];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t}function c(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r,t[1]=i[1]*n+i[3]*r,t}function u(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[2]*r+i[4],t[1]=i[1]*n+i[3]*r+i[5],t}function h(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[3]*r+i[6],t[1]=i[1]*n+i[4]*r+i[7],t}function d(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t}
2var p=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t};!function(){var t=function(){var t=new n.WT(2);return n.WT!=Float32Array&&(t[0]=0,t[1]=0),t}()}()},99007:(t,e,i)=>{"use strict";i.d(e,{AK:()=>u,EU:()=>v,Fv:()=>c,IH:()=>a,Ue:()=>r,VC:()=>f,Zh:()=>x,al:()=>s,dC:()=>b,fF:()=>p,jI:()=>y,kC:()=>h,kE:()=>o,kK:()=>A,lM:()=>g,lu:()=>_,t7:()=>d,tk:()=>l,uD:()=>m,x9:()=>w});var n=i(60285);function r(){var t=new n.WT(3);return n.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function o(t){var e=t[0],i=t[1],n=t[2];return Math.hypot(e,i,n)}function s(t,e,i){var r=new n.WT(3);return r[0]=t,r[1]=e,r[2]=i,r}function a(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}function l(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function c(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function u(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function h(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return t[0]=r*l-o*a,t[1]=o*s-n*l,t[2]=n*a-r*s,t}function d(t,e,i,n){var r=e[0],o=e[1],s=e[2];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t[2]=s+n*(i[2]-s),t}function p(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[3]*n+i[7]*r+i[11]*o+i[15];return s=s||1,t[0]=(i[0]*n+i[4]*r+i[8]*o+i[12])/s,t[1]=(i[1]*n+i[5]*r+i[9]*o+i[13])/s,t[2]=(i[2]*n+i[6]*r+i[10]*o+i[14])/s,t}function A(t,e,i){var n=e[0],r=e[1],o=e[2];return t[0]=n*i[0]+r*i[3]+o*i[6],t[1]=n*i[1]+r*i[4]+o*i[7],t[2]=n*i[2]+r*i[5]+o*i[8],t}function f(t,e,i){var n=i[0],r=i[1],o=i[2],s=i[3],a=e[0],l=e[1],c=e[2],u=r*c-o*l,h=o*a-n*c,d=n*l-r*a,p=r*d-o*h,A=o*u-n*d,f=n*h-r*u,g=2*s;return u*=g,h*=g,d*=g,p*=2,A*=2,f*=2,t[0]=a+u+p,t[1]=l+h+A,t[2]=c+d+f,t}function g(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0],o[1]=r[1]*Math.cos(n)-r[2]*Math.sin(n),o[2]=r[1]*Math.sin(n)+r[2]*Math.cos(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function m(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[2]*Math.sin(n)+r[0]*Math.cos(n),o[1]=r[1],o[2]=r[2]*Math.cos(n)-r[0]*Math.sin(n),t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function y(t,e,i,n){var r=[],o=[];return r[0]=e[0]-i[0],r[1]=e[1]-i[1],r[2]=e[2]-i[2],o[0]=r[0]*Math.cos(n)-r[1]*Math.sin(n),o[1]=r[0]*Math.sin(n)+r[1]*Math.cos(n),o[2]=r[2],t[0]=o[0]+i[0],t[1]=o[1]+i[1],t[2]=o[2]+i[2],t}function v(t,e){var i=t[0],n=t[1],r=t[2],o=e[0],s=e[1],a=e[2],l=Math.sqrt(i*i+n*n+r*r)*Math.sqrt(o*o+s*s+a*a),c=l&&u(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}var _=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},b=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t},x=o,w=function(t){var e=t[0],i=t[1],n=t[2];return e*e+i*i+n*n};!function(){var t=r()}()},62220:(t,e,i)=>{"use strict";i.d(e,{AK:()=>p,Fv:()=>d,I6:()=>m,IH:()=>l,JG:()=>s,VC:()=>g,al:()=>o,bA:()=>c,d9:()=>r,fF:()=>f,fS:()=>y,kE:()=>u,t7:()=>A,t8:()=>a,we:()=>h});var n=i(60285);function r(t){var e=new n.WT(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function o(t,e,i,r){var o=new n.WT(4);return o[0]=t,o[1]=e,o[2]=i,o[3]=r,o}function s(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function a(t,e,i,n,r){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t}function l(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t[3]=e[3]+i[3],t}function c(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t}function u(t){var e=t[0],i=t[1],n=t[2],r=t[3];return Math.hypot(e,i,n,r)}function h(t){var e=t[0],i=t[1],n=t[2],r=t[3];return e*e+i*i+n*n+r*r}function d(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=i*i+n*n+r*r+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=i*s,t[1]=n*s,t[2]=r*s,t[3]=o*s,t}function p(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function A(t,e,i,n){var r=e[0],o=e[1],s=e[2],a=e[3];return t[0]=r+n*(i[0]-r),t[1]=o+n*(i[1]-o),t[2]=s+n*(i[2]-s),t[3]=a+n*(i[3]-a),t}function f(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*s,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*s,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*s,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*s,t}function g(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2],c=i[3],u=c*n+a*o-l*r,h=c*r+l*n-s*o,d=c*o+s*r-a*n,p=-s*n-a*r-l*o;return t[0]=u*c+p*-s+h*-l-d*-a,t[1]=h*c+p*-a+d*-s-u*-l,t[2]=d*c+p*-l+u*-a-h*-s,t[3]=e[3],t}function m(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]}function y(t,e){var i=t[0],r=t[1],o=t[2],s=t[3],a=e[0],l=e[1],c=e[2],u=e[3];
vendor: 49,043 bytes, line 2
2return Math.abs(i-a)<=n.Ib*Math.max(1,Math.abs(i),Math.abs(a))&&Math.abs(r-l)<=n.Ib*Math.max(1,Math.abs(r),Math.abs(l))&&Math.abs(o-c)<=n.Ib*Math.max(1,Math.abs(o),Math.abs(c))&&Math.abs(s-u)<=n.Ib*Math.max(1,Math.abs(s),Math.abs(u))}!function(){var t=function(){var t=new n.WT(4);return n.WT!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}()},37659:(t,e,i)=>{var n;!function(r,o,s,a){"use strict";var l,c=["","webkit","Moz","MS","ms","o"],u=o.createElement("div"),h="function",d=Math.round,p=Math.abs,A=Date.now;function f(t,e,i){return setTimeout(x(t,i),e)}function g(t,e,i){return!!Array.isArray(t)&&(m(t,i[e],i),!0)}function m(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(t.length!==a)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function y(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=r.console&&(r.console.warn||r.console.log);return o&&o.call(r.console,n,i),t.apply(this,arguments)}}l="function"!==typeof Object.assign?function(t){if(t===a||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(n!==a&&null!==n)for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}:Object.assign;var v=y((function(t,e,i){for(var n=Object.keys(e),r=0;r<n.length;)(!i||i&&t[n[r]]===a)&&(t[n[r]]=e[n[r]]),r++;return t}),"extend","Use `assign`."),_=y((function(t,e){return v(t,e,!0)}),"merge","Use `assign`.");function b(t,e,i){var n,r=e.prototype;(n=t.prototype=Object.create(r)).constructor=t,n._super=r,i&&l(n,i)}function x(t,e){return function(){return t.apply(e,arguments)}}function w(t,e){return typeof t==h?t.apply(e&&e[0]||a,e):t}function C(t,e){return t===a?e:t}function B(t,e,i){m(M(e),(function(e){t.addEventListener(e,i,!1)}))}function E(t,e,i){m(M(e),(function(e){t.removeEventListener(e,i,!1)}))}function S(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function T(t,e){return t.indexOf(e)>-1}function M(t){return t.trim().split(/\s+/g)}function I(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}function P(t){return Array.prototype.slice.call(t,0)}function D(t,e,i){for(var n=[],r=[],o=0;o<t.length;){var s=e?t[o][e]:t[o];I(r,s)<0&&n.push(t[o]),r[o]=s,o++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}function L(t,e){for(var i,n,r=e[0].toUpperCase()+e.slice(1),o=0;o<c.length;){if((n=(i=c[o])?i+r:e)in t)return n;o++}return a}var O=1;function F(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||r}var R="ontouchstart"in r,k=L(r,"PointerEvent")!==a,z=R&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),U="touch",N="mouse",G=25,Z=1,j=4,V=8,H=1,J=2,W=4,Q=8,q=16,K=J|W,X=Q|q,Y=K|X,$=["x","y"],tt=["clientX","clientY"];function et(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){w(t.options.enable,[t])&&i.handler(e)},this.init()}function it(t,e,i){var n=i.pointers.length,r=i.changedPointers.length,o=e&Z&&n-r===0,s=e&(j|V)&&n-r===0;i.isFirst=!!o,i.isFinal=!!s,o&&(t.session={}),i.eventType=e,function(t,e){var i=t.session,n=e.pointers,r=n.length;i.firstInput||(i.firstInput=nt(e));r>1&&!i.firstMultiple?i.firstMultiple=nt(e):1===r&&(i.firstMultiple=!1);var o=i.firstInput,s=i.firstMultiple,l=s?s.center:o.center,c=e.center=rt(n);e.timeStamp=A(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=lt(l,c),e.distance=at(l,c),function(t,e){var i=e.center,n=t.offsetDelta||{},r=t.prevDelta||{},o=t.prevInput||{};e.eventType!==Z&&o.eventType!==j||(r=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y});e.deltaX=r.x+(i.x-n.x),e.deltaY=r.y+(i.y-n.y)}(i,e),e.offsetDirection=st(e.deltaX,e.deltaY);var u=ot(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=p(u.x)>p(u.y)?u.x:u.y,e.scale=s?(h=s.pointers,d=n,at(d[0],d[1],tt)/at(h[0],h[1],tt)):1,e.rotation=s?function(t,e){return lt(e[1],e[0],tt)+lt(t[1],t[0],tt)}(s.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,r,o,s=t.lastInterval||e,l=e.timeStamp-s.timeStamp;if(e.eventType!=V&&(l>G||s.velocity===a)){var c=e.deltaX-s.deltaX,u=e.deltaY-s.deltaY,h=ot(l,c,u);n=h.x,r=h.y,i=p(h.x)>p(h.y)?h.x:h.y,o=st(c,u),t.lastInterval=e}else i=s.velocity,n=s.velocityX,r=s.velocityY,o=s.direction;e.velocity=i,e.velocityX=n,e.velocityY=r,e.direction=o}(i,e);var h,d;var f=t.element;S(e.srcEvent.target,f)&&(f=e.srcEvent.target);e.target=f}(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function nt(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:d(t.pointers[i].clientX),clientY:d(t.pointers[i].clientY)},i++;return{timeStamp:A(),pointers:e,center:rt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function rt(t){var e=t.length;if(1===e)return{x:d(t[0].clientX),y:d(t[0].clientY)};for(var i=0,n=0,r=0;r<e;)i+=t[r].clientX,n+=t[r].clientY,r++;return{x:d(i/e),y:d(n/e)}}function ot(t,e,i){return{x:e/t||0,y:i/t||0}}function st(t,e){return t===e?H:p(t)>=p(e)?t<0?J:W:e<0?Q:q}function at(t,e,i){i||(i=$);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return Math.sqrt(n*n+r*r)}function lt(t,e,i){i||(i=$);var n=e[i[0]]-t[i[0]],r=e[i[1]]-t[i[1]];return 180*Math.atan2(r,n)/Math.PI}et.prototype={handler:function(){},init:function(){this.evEl&&B(this.element,this.evEl,this.domHandler),this.evTarget&&B(this.target,this.evTarget,this.domHandler),this.evWin&&B(F(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(F(this.element),this.evWin,this.domHandler)}};var ct={mousedown:Z,mousemove:2,mouseup:j},ut="mousedown",ht="mousemove mouseup";function dt(){this.evEl=ut,this.evWin=ht,this.pressed=!1,et.apply(this,arguments)}b(dt,et,{handler:function(t){var e=ct[t.type];e&Z&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=j),this.pressed&&(e&j&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:N,srcEvent:t}))}});var pt={pointerdown:Z,pointermove:2,pointerup:j,pointercancel:V,pointerout:V},At={2:U,3:"pen",4:N,5:"kinect"},ft="pointerdown",gt="pointermove pointerup pointercancel";function mt(){this.evEl=ft,this.evWin=gt,et.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}r.MSPointerEvent&&!r.PointerEvent&&(ft="MSPointerDown",gt="MSPointerMove MSPointerUp MSPointerCancel"),b(mt,et,{handler:function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),r=pt[n],o=At[t.pointerType]||t.pointerType,s=o==U,a=I(e,t.pointerId,"pointerId");r&Z&&(0===t.button||s)?a<0&&(e.push(t),a=e.length-1):r&(j|V)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,r,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),i&&e.splice(a,1))}});var yt={touchstart:Z,touchmove:2,touchend:j,touchcancel:V};function vt(){this.evTarget="touchstart",this.evWin="touchstart touchmove touchend touchcancel",this.started=!1,et.apply(this,arguments)}function _t(t,e){var i=P(t.touches),n=P(t.changedTouches);return e&(j|V)&&(i=D(i.concat(n),"identifier",!0)),[i,n]}b(vt,et,{handler:function(t){var e=yt[t.type];if(e===Z&&(this.started=!0),this.started){var i=_t.call(this,t,e);e&(j|V)&&i[0].length-i[1].length===0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:U,srcEvent:t})}}});var bt={touchstart:Z,touchmove:2,touchend:j,touchcancel:V},xt="touchstart touchmove touchend touchcancel";function wt(){this.evTarget=xt,this.targetIds={},et.apply(this,arguments)}function Ct(t,e){var i=P(t.touches),n=this.targetIds;if(e&(2|Z)&&1===i.length)return n[i[0].identifier]=!0,[i,i];var r,o,s=P(t.changedTouches),a=[],l=this.target;if(o=i.filter((function(t){return S(t.target,l)})),e===Z)for(r=0;r<o.length;)n[o[r].identifier]=!0,r++;for(r=0;r<s.length;)n[s[r].identifier]&&a.push(s[r]),e&(j|V)&&delete n[s[r].identifier],r++;return a.length?[D(o.concat(a),"identifier",!0),a]:void 0}b(wt,et,{handler:function(t){var e=bt[t.type],i=Ct.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:U,srcEvent:t})}});var Bt=2500;function Et(){et.apply(this,arguments);var t=x(this.handler,this);this.touch=new wt(this.manager,t),this.mouse=new dt(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function St(t,e){t&Z?(this.primaryTouch=e.changedPointers[0].identifier,Tt.call(this,e)):t&(j|V)&&Tt.call(this,e)}function Tt(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY};this.lastTouches.push(i);var n=this.lastTouches;setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),Bt)}}function Mt(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var r=this.lastTouches[n],o=Math.abs(e-r.x),s=Math.abs(i-r.y);if(o<=25&&s<=25)return!0}return!1}b(Et,et,{handler:function(t,e,i){var n=i.pointerType==U,r=i.pointerType==N;if(!(r&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(n)St.call(this,e,i);else if(r&&Mt.call(this,i))return;this.callback(t,e,i)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var It=L(u.style,"touchAction"),Pt=It!==a,Dt="compute",Lt="auto",Ot="manipulation",Ft="none",Rt="pan-x",kt="pan-y",zt=function(){if(!Pt)return!1;var t={},e=r.CSS&&r.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){t[i]=!e||r.CSS.supports("touch-action",i)})),t}();function Ut(t,e){this.manager=t,this.set(e)}Ut.prototype={set:function(t){t==Dt&&(t=this.compute()),Pt&&this.manager.element.style&&zt[t]&&(this.manager.element.style[It]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return m(this.manager.recognizers,(function(e){w(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(T(t,Ft))return Ft;var e=T(t,Rt),i=T(t,kt);if(e&&i)return Ft;if(e||i)return e?Rt:kt;if(T(t,Ot))return Ot;return Lt}(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,r=T(n,Ft)&&!zt[Ft],o=T(n,kt)&&!zt[kt],s=T(n,Rt)&&!zt[Rt];if(r){var a=1===t.pointers.length,l=t.distance<2,c=t.deltaTime<250;if(a&&l&&c)return}if(!s||!o)return r||o&&i&K||s&&i&X?this.preventSrc(e):void 0}},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var Nt=1,Gt=32;function Zt(t){this.options=l({},this.defaults,t||{}),this.id=O++,this.manager=null,this.options.enable=C(this.options.enable,!0),this.state=Nt,this.simultaneous={},this.requireFail=[]}function jt(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}function Vt(t){return t==q?"down":t==Q?"up":t==J?"left":t==W?"right":""}function Ht(t,e){var i=e.manager;return i?i.get(t):t}function Jt(){Zt.apply(this,arguments)}function Wt(){Jt.apply(this,arguments),this.pX=null,this.pY=null}function Qt(){Jt.apply(this,arguments)}function qt(){Zt.apply(this,arguments),this._timer=null,this._input=null}function Kt(){Jt.apply(this,arguments)}function Xt(){Jt.apply(this,arguments)}function Yt(){Zt.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function $t(t,e){return(e=e||{}).recognizers=C(e.recognizers,$t.defaults.preset),new te(t,e)}Zt.prototype={defaults:{},set:function(t){return l(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(g(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Ht(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return g(t,"dropRecognizeWith",this)||(t=Ht(t,this),delete this.simultaneous[t.id]),this},requireFailure:function(t){if(g(t,"requireFailure",this))return this;var e=this.requireFail;return-1===I(e,t=Ht(t,this))&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(g(t,"dropRequireFailure",this))return this;t=Ht(t,this);var e=I(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+jt(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+jt(i))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=Gt},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Gt|Nt)))return!1;t++}return!0},recognize:function(t){var e=l({},t);if(!w(this.options.enable,[this,e]))return this.reset(),void(this.state=Gt);56&this.state&&(this.state=Nt),this.state=this.process(e),30&this.state&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},b(Jt,Zt,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,i=t.eventType,n=6&e,r=this.attrTest(t);return n&&(i&V||!r)?16|e:n||r?i&j?8|e:2&e?4|e:2:Gt}}),b(Wt,Jt,{defaults:{event:"pan",threshold:10,pointers:1,direction:Y},getTouchAction:function(){var t=this.options.direction,e=[];return t&K&&e.push(kt),t&X&&e.push(Rt),e},directionTest:function(t){var e=this.options,i=!0,n=t.distance,r=t.direction,o=t.deltaX,s=t.deltaY;return r&e.direction||(e.direction&K?(r=0===o?H:o<0?J:W,i=o!=this.pX,n=Math.abs(t.deltaX)):(r=0===s?H:s<0?Q:q,i=s!=this.pY,n=Math.abs(t.deltaY))),t.direction=r,i&&n>e.threshold&&r&e.direction},attrTest:function(t){return Jt.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=Vt(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),b(Qt,Jt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[Ft]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||2&this.state)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),b(qt,Zt,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Lt]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime>e.time;if(this._input=t,!n||!i||t.eventType&(j|V)&&!r)this.reset();else if(t.eventType&Z)this.reset(),this._timer=f((function(){this.state=8,this.tryEmit()}),e.time,this);else if(t.eventType&j)return 8;return Gt},reset:function(){clearTimeout(this._timer)},emit:function(t){8===this.state&&(t&&t.eventType&j?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=A(),this.manager.emit(this.options.event,this._input)))}}),b(Kt,Jt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[Ft]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||2&this.state)}}),b(Xt,Jt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:K|X,pointers:1},getTouchAction:function(){return Wt.prototype.getTouchAction.call(this)},attrTest:function(t){var e,i=this.options.direction;return i&(K|X)?e=t.overallVelocity:i&K?e=t.overallVelocityX:i&X&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&i&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&p(e)>this.options.velocity&&t.eventType&j},emit:function(t){var e=Vt(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),b(Yt,Zt,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Ot]},process:function(t){var e=this.options,i=t.pointers.length===e.pointers,n=t.distance<e.threshold,r=t.deltaTime<e.time;if(this.reset(),t.eventType&Z&&0===this.count)return this.failTimeout();if(n&&r&&i){if(t.eventType!=j)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,s=!this.pCenter||at(this.pCenter,t.center)<e.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,s&&o?this.count+=1:this.count=1,this._input=t,0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=f((function(){this.state=8,this.tryEmit()}),e.interval,this),2):8}return Gt},failTimeout:function(){return this._timer=f((function(){this.state=Gt}),this.options.interval,this),Gt},reset:function(){clearTimeout(this._timer)},emit:function(){8==this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),$t.VERSION="2.0.7",$t.defaults={domEvents:!1,touchAction:Dt,enable:!0,inputTarget:null,inputClass:null,preset:[[Kt,{enable:!1}],[Qt,{enable:!1},["rotate"]],[Xt,{direction:K}],[Wt,{direction:K},["swipe"]],[Yt],[Yt,{event:"doubletap",taps:2},["tap"]],[qt]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};function te(t,e){var i;this.options=l({},$t.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(k?mt:z?wt:R?Et:dt))(i,it),this.touchAction=new Ut(this,this.options.touchAction),ee(this,!0),m(this.options.recognizers,(function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}function ee(t,e){var i,n=t.element;n.style&&(m(t.options.cssProps,(function(r,o){i=L(n.style,o),e?(t.oldCssProps[i]=n.style[i],n.style[i]=r):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}te.prototype={set:function(t){return l(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,r=e.curRecognizer;(!r||r&&8&r.state)&&(r=e.curRecognizer=null);for(var o=0;o<n.length;)i=n[o],2===e.stopped||r&&i!=r&&!i.canRecognizeWith(r)?i.reset():i.recognize(t),!r&&14&i.state&&(r=e.curRecognizer=i),o++}},get:function(t){if(t instanceof Zt)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event==t)return e[i];return null},add:function(t){if(g(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(g(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,i=I(e,t);-1!==i&&(e.splice(i,1),this.touchAction.update())}return this},on:function(t,e){if(t!==a&&e!==a){var i=this.handlers;return m(M(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this}},off:function(t,e){if(t!==a){var i=this.handlers;return m(M(t),(function(t){e?i[t]&&i[t].splice(I(i[t],e),1):delete i[t]})),this}},emit:function(t,e){this.options.domEvents&&function(t,e){var i=o.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](e),n++}},destroy:function(){this.element&&ee(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},l($t,{INPUT_START:Z,INPUT_MOVE:2,INPUT_END:j,INPUT_CANCEL:V,STATE_POSSIBLE:Nt,STATE_BEGAN:2,STATE_CHANGED:4,STATE_ENDED:8,STATE_RECOGNIZED:8,STATE_CANCELLED:16,STATE_FAILED:Gt,DIRECTION_NONE:H,DIRECTION_LEFT:J,DIRECTION_RIGHT:W,DIRECTION_UP:Q,DIRECTION_DOWN:q,DIRECTION_HORIZONTAL:K,DIRECTION_VERTICAL:X,DIRECTION_ALL:Y,Manager:te,Input:et,TouchAction:Ut,TouchInput:wt,MouseInput:dt,PointerEventInput:mt,TouchMouseInput:Et,SingleTouchInput:vt,Recognizer:Zt,AttrRecognizer:Jt,Tap:Yt,Pan:Wt,Swipe:Xt,Pinch:Qt,Rotate:Kt,Press:qt,on:B,off:E,each:m,merge:_,extend:v,assign:l,inherit:b,bindFn:x,prefixed:L}),("undefined"!==typeof r?r:"undefined"!==typeof self?self:{}).Hammer=$t,(n=function(){return $t}.call(e,i,e,t))===a||(t.exports=n)}(window,document)},70356:(t,e)=>{e.read=function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=i?r-1:0,d=i?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,i,n,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,A=n?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+p]=255&a,p+=A,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[i+p]=255&s,p+=A,s/=256,c-=8);t[i+p-A]|=128*f}},42103:function(t,e){!function(i){"use strict";var n="Compound",r="MemberExpression",o="Literal",s=function(t,e){var i=new Error(t+" at character "+e);throw i.index=e,i.description=t,i},a=!0,l={"-":a,"!":a,"~":a,"+":a},c={"||":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},u=function(t){var e,i=0;for(var n in t)(e=n.length)>i&&t.hasOwnProperty(n)&&(i=e);return i},h=u(l),d=u(c),p={true:!0,false:!1,null:null},A=function(t){return c[t]||0},f=function(t,e,i){return{type:"||"===t||"&&"===t?"LogicalExpression":"BinaryExpression",operator:t,left:e,right:i}},g=function(t){return t>=48&&t<=57},m=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=128&&!c[String.fromCharCode(t)]},y=function(t){return 36===t||95===t||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t>=128&&!c[String.fromCharCode(t)]},v=function(t){for(var e,i,a=0,u=t.charAt,v=t.charCodeAt,_=function(e){return u.call(t,e)},b=function(e){return v.call(t,e)},x=t.length,w=function(){for(var t=b(a);32===t||9===t||10===t||13===t;)t=b(++a)},C=function(){var t,e,i=E();return w(),63!==b(a)?i:(a++,(t=C())||s("Expected expression",a),w(),58===b(a)?(a++,(e=C())||s("Expected expression",a),{type:"ConditionalExpression",test:i,consequent:t,alternate:e}):void s("Expected :",a))},B=function(){w();for(var e=t.substr(a,d),i=e.length;i>0;){if(c.hasOwnProperty(e)&&(!m(b(a))||a+e.length<t.length&&!y(b(a+e.length))))return a+=i,e;e=e.substr(0,--i)}return!1},E=function(){var t,e,i,n,r,o,l,c,u;if(o=S(),!(e=B()))return o;for(r={value:e,prec:A(e)},(l=S())||s("Expected expression after "+e,a),n=[o,r,l];(e=B())&&0!==(i=A(e));){for(r={value:e,prec:i},u=e;n.length>2&&i<=n[n.length-2].prec;)l=n.pop(),e=n.pop().value,o=n.pop(),t=f(e,o,l),n.push(t);(t=S())||s("Expected expression after "+u,a),n.push(r,t)}for(t=n[c=n.length-1];c>1;)t=f(n[c-1].value,n[c-2],t),c-=2;return t},S=function(){var e,i,n;if(w(),e=b(a),g(e)||46===e)return T();if(39===e||34===e)return M();if(91===e)return O();for(n=(i=t.substr(a,h)).length;n>0;){if(l.hasOwnProperty(i)&&(!m(b(a))||a+i.length<t.length&&!y(b(a+i.length))))return a+=n,{type:"UnaryExpression",operator:i,argument:S(),prefix:!0};i=i.substr(0,--n)}return!(!m(e)&&40!==e)&&D()},T=function(){for(var t,e,i="";g(b(a));)i+=_(a++);if(46===b(a))for(i+=_(a++);g(b(a));)i+=_(a++);if("e"===(t=_(a))||"E"===t){for(i+=_(a++),"+"!==(t=_(a))&&"-"!==t||(i+=_(a++));g(b(a));)i+=_(a++);g(b(a-1))||s("Expected exponent ("+i+_(a)+")",a)}return e=b(a),m(e)?s("Variable names cannot start with a number ("+i+_(a)+")",a):46===e&&s("Unexpected period",a),{type:o,value:parseFloat(i),raw:i}},M=function(){for(var t,e="",i=_(a++),n=!1;a<x;){if((t=_(a++))===i){n=!0;break}if("\\"===t)switch(t=_(a++)){case"n":e+="\n";break;case"r":e+="\r";break;case"t":e+="\t";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=t}else e+=t}return n||s('Unclosed quote after "'+e+'"',a),{type:o,value:e,raw:i+e+i}},I=function(){var e,i=b(a),n=a;for(m(i)?a++:s("Unexpected "+_(a),a);a<x&&(i=b(a),y(i));)a++;return e=t.slice(n,a),p.hasOwnProperty(e)?{type:o,value:p[e],raw:e}:"this"===e?{type:"ThisExpression"}:{type:"Identifier",name:e}},P=function(t){for(var e,i,r=[],o=!1,l=0;a<x;){if(w(),(e=b(a))===t){o=!0,a++,41===t&&l&&l>=r.length&&s("Unexpected token "+String.fromCharCode(t),a);break}if(44===e){if(a++,++l!==r.length)if(41===t)s("Unexpected token ,",a);else if(93===t)for(var c=r.length;c<l;c++)r.push(null)}else(i=C())&&i.type!==n||s("Expected comma",a),r.push(i)}return o||s("Expected "+String.fromCharCode(t),a),r},D=function(){var t,e;for(e=40===(t=b(a))?L():I(),w(),t=b(a);46===t||91===t||40===t;)a++,46===t?(w(),e={type:r,computed:!1,object:e,property:I()}):91===t?(e={type:r,computed:!0,object:e,property:C()},w(),93!==(t=b(a))&&s("Unclosed [",a),a++):40===t&&(e={type:"CallExpression",arguments:P(41),callee:e}),w(),t=b(a);return e},L=function(){a++;var t=C();if(w(),41===b(a))return a++,t;s("Unclosed (",a)},O=function(){return a++,{type:"ArrayExpression",elements:P(93)}},F=[];a<x;)59===(e=b(a))||44===e?a++:(i=C())?F.push(i):a<x&&s('Unexpected "'+_(a)+'"',a);return 1===F.length?F[0]:{type:n,body:F}};v.version="0.3.5",v.toString=function(){return"JavaScript Expression Parser (JSEP) v"+v.version},v.addUnaryOp=function(t){return h=Math.max(t.length,h),l[t]=a,this},v.addBinaryOp=function(t,e){return d=Math.max(t.length,d),c[t]=e,this},v.addLiteral=function(t,e){return p[t]=e,this},v.removeUnaryOp=function(t){return delete l[t],t.length===h&&(h=u(l)),this},v.removeAllUnaryOps=function(){return l={},h=0,this},v.removeBinaryOp=function(t){return delete c[t],t.length===d&&(d=u(c)),this},v.removeAllBinaryOps=function(){return c={},d=0,this},v.removeLiteral=function(t){return delete p[t],this},v.removeAllLiterals=function(){return p={},this},t.exports?e=t.exports=v:e.parse=v}()},88687:(t,e,i)=>{"use strict";new Uint8Array([0]);var n,r,o,s,a,l,c,u;!function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"}(n||(n={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(r||(r={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(o||(o={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}(s||(s={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(a||(a={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(l||(l={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(c||(c={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(u||(u={}))},62813:(t,e,i)=>{var n=i(19156);t.exports=function(t,e){return n(t,e)}},9794:function(t){t.exports=function(){"use strict";var t,e,i;function n(n,r){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",s={};t(s),i=r(s),"undefined"!==typeof window&&(i.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=r;else t=r}return n(["exports"],(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var i=n;function n(t,e,i,n){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(n-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=n,this.p2x=i,this.p2y=n}n.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},n.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},n.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},n.prototype.solveCurveX=function(t,e){var i,n,r,o,s;for(void 0===e&&(e=1e-6),r=t,s=0;s<8;s++){if(o=this.sampleCurveX(r)-t,Math.abs(o)<e)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}if((r=t)<(i=0))return i;if(r>(n=1))return n;for(;i<n;){if(o=this.sampleCurveX(r),Math.abs(o-t)<e)return r;t>o?i=r:n=r,r=.5*(n-i)+i}return r},n.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var r=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),n=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=n,this},_rotateAround:function(t,e){var i=Math.cos(t),n=Math.sin(t),r=e.y+n*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-n*(this.y-e.y),this.y=r,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t};var s="undefined"!=typeof self?self:{},a=Math.pow(2,53)-1;function l(t,e,n,r){var o=new i(t,e,n,r);return function(t){return o.solve(t)}}var c=l(.25,.1,.25,1);function u(t,e,i){return Math.min(i,Math.max(e,t))}function h(t,e,i){var n=i-e,r=((t-e)%n+n)%n+e;return r===e?i:r}function d(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var n=0,r=e;n<r.length;n+=1){var o=r[n];for(var s in o)t[s]=o[s]}return t}var p=1;function A(){return p++}function f(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function g(t){return!!t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function m(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function y(t,e){return-1!==t.indexOf(e,t.length-e.length)}function v(t,e,i){var n={};for(var r in t)n[r]=e.call(i||this,t[r],r,t);return n}function _(t,e,i){var n={};for(var r in t)e.call(i||this,t[r],r,t)&&(n[r]=t[r]);return n}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?v(t,b):t}var x={};function w(t){x[t]||("undefined"!=typeof console&&console.warn(t),x[t]=!0)}function C(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function B(t){for(var e=0,i=0,n=t.length,r=n-1,o=void 0,s=void 0;i<n;r=i++)e+=((s=t[r]).x-(o=t[i]).x)*(o.y+s.y);return e}function E(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function S(t){var e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,i,n,r){var o=n||r;return e[i]=!o||o.toLowerCase(),""})),e["max-age"]){var i=parseInt(e["max-age"],10);isNaN(i)?delete e["max-age"]:e["max-age"]=i}return e}var T=null;function M(t){if(null==T){var e=t.navigator?t.navigator.userAgent:null;T=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return T}function I(t){try{var e=s[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var P,D,L,O,F=s.performance&&s.performance.now?s.performance.now.bind(s.performance):Date.now.bind(Date),R=s.requestAnimationFrame||s.mozRequestAnimationFrame||s.webkitRequestAnimationFrame||s.msRequestAnimationFrame,k=s.cancelAnimationFrame||s.mozCancelAnimationFrame||s.webkitCancelAnimationFrame||s.msCancelAnimationFrame,z={now:F,frame:function(t){var e=R(t);return{cancel:function(){return k(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var i=s.document.createElement("canvas"),n=i.getContext("2d");if(!n)throw new Error("failed to create canvas 2d context");return i.width=t.width,i.height=t.height,n.drawImage(t,0,0,t.width,t.height),n.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return P||(P=s.document.createElement("a")),P.href=t,P.href},hardwareConcurrency:s.navigator&&s.navigator.hardwareConcurrency||4,get devicePixelRatio(){return s.devicePixelRatio},get prefersReducedMotion(){return!!s.matchMedia&&(null==D&&(D=s.matchMedia("(prefers-reduced-motion: reduce)")),D.matches)}},U={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},N={supported:!1,testSupport:function(t){!G&&O&&(Z?j(t):L=t)}},G=!1,Z=!1;function j(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,O),t.isContextLost())return;N.supported=!0}catch(t){}t.deleteTexture(e),G=!0}s.document&&((O=s.document.createElement("img")).onload=function(){L&&j(L),L=null,Z=!0},O.onerror=function(){G=!0,L=null},O.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var V="01",H=function(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()};function J(t){return 0===t.indexOf("mapbox:")}H.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",V,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},H.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},H.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},H.prototype.normalizeStyleURL=function(t,e){if(!J(t))return t;var i=K(t);return i.path="/styles/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||e)},H.prototype.normalizeGlyphsURL=function(t,e){if(!J(t))return t;var i=K(t);return i.path="/fonts/v1"+i.path,this._makeAPIURL(i,this._customAccessToken||e)},H.prototype.normalizeSourceURL=function(t,e){if(!J(t))return t;var i=K(t);return i.path="/v4/"+i.authority+".json",i.params.push("secure"),this._makeAPIURL(i,this._customAccessToken||e)},H.prototype.normalizeSpriteURL=function(t,e,i,n){var r=K(t);return J(t)?(r.path="/styles/v1"+r.path+"/sprite"+e+i,this._makeAPIURL(r,this._customAccessToken||n)):(r.path+=""+e+i,X(r))},H.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!J(t))return t;var i=K(t);i.path=i.path.replace(/(\.(png|jpg)\d*)(?=$)/,(z.devicePixelRatio>=2||512===e?"@2x":"")+(N.supported?".webp":"$1")),i.path=i.path.replace(/^.+\/v4\//,"/"),i.path="/v4"+i.path;var n=this._customAccessToken||function(t){for(var e=0,i=t;e<i.length;e+=1){var n=i[e].match(/^access_token=(.*)$/);if(n)return n[1]}return null}(i.params)||U.ACCESS_TOKEN;return U.REQUIRE_ACCESS_TOKEN&&n&&this._skuToken&&i.params.push("sku="+this._skuToken),this._makeAPIURL(i,n)},H.prototype.canonicalizeTileURL=function(t,e){var i=K(t);if(!i.path.match(/(^\/v4\/)/)||!i.path.match(/\.[\w]+$/))return t;var n="mapbox://tiles/";n+=i.path.replace("/v4/","");var r=i.params;return e&&(r=r.filter((function(t){return!t.match(/^access_token=/)}))),r.length&&(n+="?"+r.join("&")),n},H.prototype.canonicalizeTileset=function(t,e){for(var i=!!e&&J(e),n=[],r=0,o=t.tiles||[];r<o.length;r+=1){var s=o[r];Q(s)?n.push(this.canonicalizeTileURL(s,i)):n.push(s)}return n},H.prototype._makeAPIURL=function(t,e){var i="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=K(U.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol){var r=t.params.indexOf("secure");r>=0&&t.params.splice(r,1)}if("/"!==n.path&&(t.path=""+n.path+t.path),!U.REQUIRE_ACCESS_TOKEN)return X(t);if(!(e=e||U.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+i);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+i);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),X(t)};var W=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Q(t){return W.test(t)}var q=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function K(t){var e=t.match(q);if(!e)throw new Error("Unable to parse URL object");return{protocol:e[1],authority:e[2],path:e[3]||"/",params:e[4]?e[4].split("&"):[]}}function X(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function Y(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(s.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}var $=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};$.prototype.getStorageKey=function(t){var e,i=Y(U.ACCESS_TOKEN);return e=i&&i.u?s.btoa(encodeURIComponent(i.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):U.ACCESS_TOKEN||"",t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},$.prototype.fetchEventData=function(){var t=I("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{var n=s.localStorage.getItem(e);n&&(this.eventData=JSON.parse(n));var r=s.localStorage.getItem(i);r&&(this.anonId=r)}catch(t){w("Unable to read from LocalStorage")}},$.prototype.saveEventData=function(){var t=I("localStorage"),e=this.getStorageKey(),i=this.getStorageKey("uuid");if(t)try{s.localStorage.setItem(i,this.anonId),Object.keys(this.eventData).length>=1&&s.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},$.prototype.processRequests=function(t){},$.prototype.postEvent=function(t,e,i,n){var r=this;if(U.EVENTS_URL){var o=K(U.EVENTS_URL);o.params.push("access_token="+(n||U.ACCESS_TOKEN||""));var s={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.2",skuId:V,userId:this.anonId},a=e?d(s,e):s,l={url:X(o),headers:{"Content-Type":"text/plain"},body:JSON.stringify([a])};this.pendingRequest=bt(l,(function(t){r.pendingRequest=null,i(t),r.saveEventData(),r.processRequests(n)}))}},$.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var tt,et,it=function(t){function e(){t.call(this,"map.load"),this.success={},this.skuToken=""}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postMapLoadEvent=function(t,e,i,n){this.skuToken=i,(U.EVENTS_URL&&n||U.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return J(t)||Q(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},n)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){var i=this.queue.shift(),n=i.id,r=i.timestamp;n&&this.success[n]||(this.anonId||this.fetchEventData(),g(this.anonId)||(this.anonId=f()),this.postEvent(r,{skuToken:this.skuToken},(function(t){t||n&&(e.success[n]=!0)}),t))}},e}($),nt=new(function(t){function e(e){t.call(this,"appUserTurnstile"),this._customAccessToken=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.postTurnstileEvent=function(t,e){U.EVENTS_URL&&U.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return J(t)||Q(t)}))&&this.queueRequest(Date.now(),e)},e.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var i=Y(U.ACCESS_TOKEN),n=i?i.u:U.ACCESS_TOKEN,r=n!==this.eventData.tokenU;g(this.anonId)||(this.anonId=f(),r=!0);var o=this.queue.shift();if(this.eventData.lastSuccess){var s=new Date(this.eventData.lastSuccess),a=new Date(o),l=(o-this.eventData.lastSuccess)/864e5;r=r||l>=1||l<-1||s.getDate()!==a.getDate()}else r=!0;if(!r)return this.processRequests();this.postEvent(o,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=o,e.eventData.tokenU=n)}),t)}},e}($)),rt=nt.postTurnstileEvent.bind(nt),ot=new it,st=ot.postMapLoadEvent.bind(ot),at=500,lt=50;function ct(){s.caches&&!tt&&(tt=s.caches.open("mapbox-tiles"))}function ut(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ht,dt=1/0;function pt(){return null==ht&&(ht=s.OffscreenCanvas&&new s.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof s.createImageBitmap),ht}var At={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(At);var ft,gt,mt=function(t){function e(e,i,n){401===i&&Q(n)&&(e+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),t.call(this,e),this.status=i,this.url=n,this.name=this.constructor.name,this.message=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},e}(Error),yt=E()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===s.location.protocol?s.parent:s).location.href},vt=function(t,e){if(!(/^file:/.test(i=t.url)||/^file:/.test(yt())&&!/^\w+:/.test(i))){if(s.fetch&&s.Request&&s.AbortController&&s.Request.prototype.hasOwnProperty("signal"))return function(t,e){var i,n=new s.AbortController,r=new s.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:n.signal}),o=!1,a=!1,l=(i=r.url).indexOf("sku=")>0&&Q(i);"json"===t.type&&r.headers.set("Accept","application/json");var c=function(i,n,o){if(!a){if(i&&"SecurityError"!==i.message&&w(i),n&&o)return u(n);var c=Date.now();s.fetch(r).then((function(i){if(i.ok){var n=l?i.clone():null;return u(i,n,c)}return e(new mt(i.statusText,i.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},u=function(i,n,l){("arrayBuffer"===t.type?i.arrayBuffer():"json"===t.type?i.json():i.text()).then((function(t){a||(n&&l&&function(t,e,i){if(ct(),tt){var n={status:e.status,statusText:e.statusText,headers:new s.Headers};e.headers.forEach((function(t,e){return n.headers.set(e,t)}));var r=S(e.headers.get("Cache-Control")||"");r["no-store"]||(r["max-age"]&&n.headers.set("Expires",new Date(i+1e3*r["max-age"]).toUTCString()),new Date(n.headers.get("Expires")).getTime()-i<42e4||function(t,e){if(void 0===et)try{new Response(new ReadableStream),et=!0}catch(t){et=!1}et?e(t.body):t.blob().then(e)}(e,(function(e){var i=new s.Response(e,n);ct(),tt&&tt.then((function(e){return e.put(ut(t.url),i)})).catch((function(t){return w(t.message)}))})))}}(r,n,l),o=!0,e(null,t,i.headers.get("Cache-Control"),i.headers.get("Expires")))})).catch((function(t){a||e(new Error(t.message))}))};return l?function(t,e){if(ct(),!tt)return e(null);var i=ut(t.url);tt.then((function(t){t.match(i).then((function(n){var r=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0),i=S(t.headers.get("Cache-Control")||"");return e>Date.now()&&!i["no-cache"]}(n);t.delete(i),r&&t.put(i,n.clone()),e(null,n,r)})).catch(e)})).catch(e)}(r,c):c(null,null),{cancel:function(){a=!0,o||n.abort()}}}(t,e);if(E()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}var i;return function(t,e){var i=new s.XMLHttpRequest;for(var n in i.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(i.responseType="arraybuffer"),t.headers)i.setRequestHeader(n,t.headers[n]);return"json"===t.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===t.credentials,i.onerror=function(){e(new Error(i.statusText))},i.onload=function(){if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){var n=i.response;if("json"===t.type)try{n=JSON.parse(i.response)}catch(t){return e(t)}e(null,n,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else e(new mt(i.statusText,i.status,t.url))},i.send(t.body),{cancel:function(){return i.abort()}}}(t,e)},_t=function(t,e){return vt(d(t,{type:"arrayBuffer"}),e)},bt=function(t,e){return vt(d(t,{method:"POST"}),e)},xt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";ft=[],gt=0;var wt=function(t,e){if(N.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),gt>=U.MAX_PARALLEL_IMAGE_REQUESTS){var i={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return ft.push(i),i}gt++;var n=!1,r=function(){if(!n)for(n=!0,gt--;ft.length&&gt<U.MAX_PARALLEL_IMAGE_REQUESTS;){var t=ft.shift();t.cancelled||(t.cancel=wt(t.requestParameters,t.callback).cancel)}},o=_t(t,(function(t,i,n,o){r(),t?e(t):i&&(pt()?function(t,e){var i=new s.Blob([new Uint8Array(t)],{type:"image/png"});s.createImageBitmap(i).then((function(t){e(null,t)})).catch((function(t){e(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))}(i,e):function(t,e,i,n){var r=new s.Image,o=s.URL;r.onload=function(){e(null,r),o.revokeObjectURL(r.src),r.onload=null,s.requestAnimationFrame((function(){r.src=xt}))},r.onerror=function(){return e(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var a=new s.Blob([new Uint8Array(t)],{type:"image/png"});r.cacheControl=i,r.expires=n,r.src=t.byteLength?o.createObjectURL(a):xt}(i,e,n,o))}));return{cancel:function(){o.cancel(),r()}}};function Ct(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function Bt(t,e,i){if(i&&i[t]){var n=i[t].indexOf(e);-1!==n&&i[t].splice(n,1)}}var Et=function(t,e){void 0===e&&(e={}),d(this,e),this.type=t},St=function(t){function e(e,i){void 0===i&&(i={}),t.call(this,"error",d({error:e},i))}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Et),Tt=function(){};Tt.prototype.on=function(t,e){return this._listeners=this._listeners||{},Ct(t,e,this._listeners),this},Tt.prototype.off=function(t,e){return Bt(t,e,this._listeners),Bt(t,e,this._oneTimeListeners),this},Tt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},Ct(t,e,this._oneTimeListeners),this},Tt.prototype.fire=function(t,e){"string"==typeof t&&(t=new Et(t,e||{}));var i=t.type;if(this.listens(i)){t.target=this;for(var n=0,r=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];n<r.length;n+=1)r[n].call(this,t);for(var o=0,s=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];o<s.length;o+=1){var a=s[o];Bt(i,a,this._oneTimeListeners),a.call(this,t)}var l=this._eventedParent;l&&(d(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),l.fire(t))}else t instanceof St&&console.error(t.error);return this},Tt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)},T
vendor: 19,115 bytes, line 2
2t.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this};var Mt={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}
vendor: 9,823 bytes, line 2
2,"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}}
vendor: 449,819 bytes, line 2
2,It=function(t,e,i,n){this.message=(t?t+": ":"")+i,n&&(this.identifier=n),null!=e&&e.__line__&&(this.line=e.__line__)};function Pt(t){var e=t.value;return e?[new It(t.key,e,"constants have been deprecated as of v8")]:[]}function Dt(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];for(var n=0,r=e;n<r.length;n+=1){var o=r[n];for(var s in o)t[s]=o[s]}return t}function Lt(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ot(t){if(Array.isArray(t))return t.map(Ot);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e={};for(var i in t)e[i]=Ot(t[i]);return e}return Lt(t)}var Ft=function(t){function e(e,i){t.call(this,i),this.message=i,this.key=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(Error),Rt=function(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var i=0,n=e;i<n.length;i+=1){var r=n[i];this.bindings[r[0]]=r[1]}};Rt.prototype.concat=function(t){return new Rt(this,t)},Rt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},Rt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var kt={kind:"null"},zt={kind:"number"},Ut={kind:"string"},Nt={kind:"boolean"},Gt={kind:"color"},Zt={kind:"object"},jt={kind:"value"},Vt={kind:"collator"},Ht={kind:"formatted"},Jt={kind:"resolvedImage"};function Wt(t,e){return{kind:"array",itemType:t,N:e}}function Qt(t){if("array"===t.kind){var e=Qt(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}return t.kind}var qt=[kt,zt,Ut,Nt,Gt,Ht,Zt,Wt(jt),Jt];function Kt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Kt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var i=0,n=qt;i<n.length;i+=1)if(!Kt(n[i],e))return null}return"Expected "+Qt(t)+" but found "+Qt(e)+" instead."}function Xt(t,e){return e.some((function(e){return e.kind===t.kind}))}function Yt(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var $t=e((function(t,e){var i={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function n(t){return(t=Math.round(t))<0?0:t>255?255:t}function r(t){return n("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(e="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:e>1?1:e;var e}function s(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}try{e.parseCSSColor=function(t){var e,a=t.replace(/ /g,"").toLowerCase();if(a in i)return i[a].slice();if("#"===a[0])return 4===a.length?(e=parseInt(a.substr(1),16))>=0&&e<=4095?[(3840&e)>>4|(3840&e)>>8,240&e|(240&e)>>4,15&e|(15&e)<<4,1]:null:7===a.length&&(e=parseInt(a.substr(1),16))>=0&&e<=16777215?[(16711680&e)>>16,(65280&e)>>8,255&e,1]:null;var l=a.indexOf("("),c=a.indexOf(")");if(-1!==l&&c+1===a.length){var u=a.substr(0,l),h=a.substr(l+1,c-(l+1)).split(","),d=1;switch(u){case"rgba":if(4!==h.length)return null;d=o(h.pop());case"rgb":return 3!==h.length?null:[r(h[0]),r(h[1]),r(h[2]),d];case"hsla":if(4!==h.length)return null;d=o(h.pop());case"hsl":if(3!==h.length)return null;var p=(parseFloat(h[0])%360+360)%360/360,A=o(h[1]),f=o(h[2]),g=f<=.5?f*(A+1):f+A-f*A,m=2*f-g;return[n(255*s(m,g,p+1/3)),n(255*s(m,g,p)),n(255*s(m,g,p-1/3)),d];default:return null}}return null}}catch(t){}})).parseCSSColor,te=function(t,e,i,n){void 0===n&&(n=1),this.r=t,this.g=e,this.b=i,this.a=n};te.parse=function(t){if(t){if(t instanceof te)return t;if("string"==typeof t){var e=$t(t);if(e)return new te(e[0]/255*e[3],e[1]/255*e[3],e[2]/255*e[3],e[3])}}},te.prototype.toString=function(){var t=this.toArray(),e=t[1],i=t[2],n=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(i)+","+n+")"},te.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},te.black=new te(0,0,0,1),te.white=new te(1,1,1,1),te.transparent=new te(0,0,0,0),te.red=new te(1,0,0,1);var ee=function(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ee.prototype.compare=function(t,e){return this.collator.compare(t,e)},ee.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ie=function(t,e,i,n,r){this.text=t,this.image=e,this.scale=i,this.fontStack=n,this.textColor=r},ne=function(t){this.sections=t};ne.fromString=function(t){return new ne([new ie(t,null,null,null,null)])},ne.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},ne.factory=function(t){return t instanceof ne?t:ne.fromString(t)},ne.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},ne.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var n=i[e];if(n.image)t.push(["image",n.image.name]);else{t.push(n.text);var r={};n.fontStack&&(r["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(r["font-scale"]=n.scale),n.textColor&&(r["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(r)}}return t};var re=function(t){this.name=t.name,this.available=t.available};function oe(t,e,i,n){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===n||"number"==typeof n&&n>=0&&n<=1?null:"Invalid rgba value ["+[t,e,i,n].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof n?[t,e,i,n]:[t,e,i]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function se(t){if(null===t)return!0;if("string"==typeof t)return!0;if("boolean"==typeof t)return!0;if("number"==typeof t)return!0;if(t instanceof te)return!0;if(t instanceof ee)return!0;if(t instanceof ne)return!0;if(t instanceof re)return!0;if(Array.isArray(t)){for(var e=0,i=t;e<i.length;e+=1)if(!se(i[e]))return!1;return!0}if("object"==typeof t){for(var n in t)if(!se(t[n]))return!1;return!0}return!1}function ae(t){if(null===t)return kt;if("string"==typeof t)return Ut;if("boolean"==typeof t)return Nt;if("number"==typeof t)return zt;if(t instanceof te)return Gt;if(t instanceof ee)return Vt;if(t instanceof ne)return Ht;if(t instanceof re)return Jt;if(Array.isArray(t)){for(var e,i=t.length,n=0,r=t;n<r.length;n+=1){var o=ae(r[n]);if(e){if(e===o)continue;e=jt;break}e=o}return Wt(e||jt,i)}return Zt}function le(t){var e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof te||t instanceof ne||t instanceof re?t.toString():JSON.stringify(t)}re.prototype.toString=function(){return this.name},re.fromString=function(t){return t?new re({name:t,available:!1}):null},re.prototype.serialize=function(){return["image",this.name]};var ce=function(t,e){this.type=t,this.value=e};ce.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!se(t[1]))return e.error("invalid value");var i=t[1],n=ae(i),r=e.expectedType;return"array"!==n.kind||0!==n.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(n=r),new ce(n,i)},ce.prototype.evaluate=function(){return this.value},ce.prototype.eachChild=function(){},ce.prototype.outputDefined=function(){return!0},ce.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof te?["rgba"].concat(this.value.toArray()):this.value instanceof ne?this.value.serialize():this.value};var ue=function(t){this.name="ExpressionEvaluationError",this.message=t};ue.prototype.toJSON=function(){return this.message};var he={string:Ut,number:zt,boolean:Nt,object:Zt},de=function(t,e){this.type=t,this.args=e};de.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i,n=1,r=t[0];if("array"===r){var o,s;if(t.length>2){var a=t[1];if("string"!=typeof a||!(a in he)||"object"===a)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=he[a],n++}else o=jt;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],n++}i=Wt(o,s)}else i=he[r];for(var l=[];n<t.length;n++){var c=e.parse(t[n],n,jt);if(!c)return null;l.push(c)}return new de(i,l)},de.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var i=this.args[e].evaluate(t);if(!Kt(this.type,ae(i)))return i;if(e===this.args.length-1)throw new ue("Expected value to be of type "+Qt(this.type)+", but found "+Qt(ae(i))+" instead.")}return null},de.prototype.eachChild=function(t){this.args.forEach(t)},de.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},de.prototype.serialize=function(){var t=this.type,e=[t.kind];if("array"===t.kind){var i=t.itemType;if("string"===i.kind||"number"===i.kind||"boolean"===i.kind){e.push(i.kind);var n=t.N;("number"==typeof n||this.args.length>1)&&e.push(n)}}return e.concat(this.args.map((function(t){return t.serialize()})))};var pe=function(t){this.type=Ht,this.sections=t};pe.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");for(var n=[],r=!1,o=1;o<=t.length-1;++o){var s=t[o];if(r&&"object"==typeof s&&!Array.isArray(s)){r=!1;var a=null;if(s["font-scale"]&&!(a=e.parse(s["font-scale"],1,zt)))return null;var l=null;if(s["text-font"]&&!(l=e.parse(s["text-font"],1,Wt(Ut))))return null;var c=null;if(s["text-color"]&&!(c=e.parse(s["text-color"],1,Gt)))return null;var u=n[n.length-1];u.scale=a,u.font=l,u.textColor=c}else{var h=e.parse(t[o],1,jt);if(!h)return null;var d=h.type.kind;if("string"!==d&&"value"!==d&&"null"!==d&&"resolvedImage"!==d)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,n.push({content:h,scale:null,font:null,textColor:null})}}return new pe(n)},pe.prototype.evaluate=function(t){return new ne(this.sections.map((function(e){var i=e.content.evaluate(t);return ae(i)===Jt?new ie("",i,null,null,null):new ie(le(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},pe.prototype.eachChild=function(t){for(var e=0,i=this.sections;e<i.length;e+=1){var n=i[e];t(n.content),n.scale&&t(n.scale),n.font&&t(n.font),n.textColor&&t(n.textColor)}},pe.prototype.outputDefined=function(){return!1},pe.prototype.serialize=function(){for(var t=["format"],e=0,i=this.sections;e<i.length;e+=1){var n=i[e];t.push(n.content.serialize());var r={};n.scale&&(r["font-scale"]=n.scale.serialize()),n.font&&(r["text-font"]=n.font.serialize()),n.textColor&&(r["text-color"]=n.textColor.serialize()),t.push(r)}return t};var Ae=function(t){this.type=Jt,this.input=t};Ae.parse=function(t,e){if(2!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,Ut);return i?new Ae(i):e.error("No image name provided.")},Ae.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=re.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i},Ae.prototype.eachChild=function(t){t(this.input)},Ae.prototype.outputDefined=function(){return!1},Ae.prototype.serialize=function(){return["image",this.input.serialize()]};var fe={"to-boolean":Nt,"to-color":Gt,"to-number":zt,"to-string":Ut},ge=function(t,e){this.type=t,this.args=e};ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var i=t[0];if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");for(var n=fe[i],r=[],o=1;o<t.length;o++){var s=e.parse(t[o],o,jt);if(!s)return null;r.push(s)}return new ge(n,r)},ge.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,i,n=0,r=this.args;n<r.length;n+=1){if(i=null,(e=r[n].evaluate(t))instanceof te)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(i=e.length<3||e.length>4?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":oe(e[0],e[1],e[2],e[3])))return new te(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ue(i||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"===this.type.kind){for(var s=null,a=0,l=this.args;a<l.length;a+=1){if(null===(s=l[a].evaluate(t)))return 0;var c=Number(s);if(!isNaN(c))return c}throw new ue("Could not convert "+JSON.stringify(s)+" to number.")}return"formatted"===this.type.kind?ne.fromString(le(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?re.fromString(le(this.args[0].evaluate(t))):le(this.args[0].evaluate(t))},ge.prototype.eachChild=function(t){this.args.forEach(t)},ge.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ge.prototype.serialize=function(){if("formatted"===this.type.kind)return new pe([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new Ae(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var me=["Unknown","Point","LineString","Polygon"],ye=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};ye.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},ye.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?me[this.feature.type]:this.feature.type:null},ye.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},ye.prototype.canonicalID=function(){return this.canonical},ye.prototype.properties=function(){return this.feature&&this.feature.properties||{}},ye.prototype.parseColor=function(t){var e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=te.parse(t)),e};var ve=function(t,e,i,n){this.name=t,this.type=e,this._evaluate=i,this.args=n};ve.prototype.evaluate=function(t){return this._evaluate(t,this.args)},ve.prototype.eachChild=function(t){this.args.forEach(t)},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},ve.parse=function(t,e){var i,n=t[0],r=ve.definitions[n];if(!r)return e.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0);for(var o=Array.isArray(r)?r[0]:r.type,s=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=s.filter((function(e){var i=e[0];return!Array.isArray(i)||i.length===t.length-1})),l=null,c=0,u=a;c<u.length;c+=1){var h=u[c],d=h[0],p=h[1];l=new Ge(e.registry,e.path,null,e.scope);for(var A=[],f=!1,g=1;g<t.length;g++){var m=t[g],y=Array.isArray(d)?d[g-1]:d.type,v=l.parse(m,1+A.length,y);if(!v){f=!0;break}A.push(v)}if(!f)if(Array.isArray(d)&&d.length!==A.length)l.error("Expected "+d.length+" arguments, but found "+A.length+" instead.");else{for(var _=0;_<A.length;_++){var b=Array.isArray(d)?d[_]:d.type,x=A[_];l.concat(_+1).checkSubtype(b,x.type)}if(0===l.errors.length)return new ve(n,o,p,A)}}if(1===a.length)(i=e.errors).push.apply(i,l.errors);else{for(var w=(a.length?a:s).map((function(t){var e;return e=t[0],Array.isArray(e)?"("+e.map(Qt).join(", ")+")":"("+Qt(e.type)+"...)"})).join(" | "),C=[],B=1;B<t.length;B++){var E=e.parse(t[B],1+C.length);if(!E)return null;C.push(Qt(E.type))}e.error("Expected arguments of type "+w+", but found ("+C.join(", ")+") instead.")}return null},ve.register=function(t,e){for(var i in ve.definitions=e,e)t[i]=ve};var _e=function(t,e,i){this.type=Vt,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e};function be(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function xe(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function we(t,e){var i=(180+t[0])/360,n=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,r=Math.pow(2,e.z);return[Math.round(i*r*8192),Math.round(n*r*8192)]}function Ce(t,e,i){return e[1]>t[1]!=i[1]>t[1]&&t[0]<(i[0]-e[0])*(t[1]-e[1])/(i[1]-e[1])+e[0]}function Be(t,e){for(var i,n,r,o,s,a,l,c=!1,u=0,h=e.length;u<h;u++)for(var d=e[u],p=0,A=d.length;p<A-1;p++){if((o=(i=t)[0]-(n=d[p])[0])*(l=i[1]-(r=d[p+1])[1])-(a=i[0]-r[0])*(s=i[1]-n[1])==0&&o*a<=0&&s*l<=0)return!1;Ce(t,d[p],d[p+1])&&(c=!c)}return c}function Ee(t,e){for(var i=0;i<e.length;i++)if(Be(t,e[i]))return!0;return!1}function Se(t,e,i,n){var r=n[0]-i[0],o=n[1]-i[1],s=(t[0]-i[0])*o-r*(t[1]-i[1]),a=(e[0]-i[0])*o-r*(e[1]-i[1]);return s>0&&a<0||s<0&&a>0}function Te(t,e,i){for(var n=0,r=i;n<r.length;n+=1)for(var o=r[n],s=0;s<o.length-1;++s)if(0!=(h=[(u=o[s+1])[0]-(c=o[s])[0],u[1]-c[1]])[0]*(d=[(l=e)[0]-(a=t)[0],l[1]-a[1]])[1]-h[1]*d[0]&&Se(a,l,c,u)&&Se(c,u,a,l))return!0;var a,l,c,u,h,d;return!1}function Me(t,e){for(var i=0;i<t.length;++i)if(!Be(t[i],e))return!1;for(var n=0;n<t.length-1;++n)if(Te(t[n],t[n+1],e))return!1;return!0}function Ie(t,e){for(var i=0;i<e.length;i++)if(Me(t,e[i]))return!0;return!1}function Pe(t,e,i){for(var n=[],r=0;r<t.length;r++){for(var o=[],s=0;s<t[r].length;s++){var a=we(t[r][s],i);be(e,a),o.push(a)}n.push(o)}return n}function De(t,e,i){for(var n=[],r=0;r<t.length;r++){var o=Pe(t[r],e,i);n.push(o)}return n}function Le(t,e,i,n){if(t[0]<i[0]||t[0]>i[2]){var r=.5*n,o=t[0]-i[0]>r?-n:i[0]-t[0]>r?n:0;0===o&&(o=t[0]-i[2]>r?-n:i[2]-t[0]>r?n:0),t[0]+=o}be(e,t)}function Oe(t,e,i,n){for(var r=8192*Math.pow(2,n.z),o=[8192*n.x,8192*n.y],s=[],a=0,l=t;a<l.length;a+=1)for(var c=0,u=l[a];c<u.length;c+=1){var h=u[c],d=[h.x+o[0],h.y+o[1]];Le(d,e,i,r),s.push(d)}return s}function Fe(t,e,i,n){for(var r,o=8192*Math.pow(2,n.z),s=[8192*n.x,8192*n.y],a=[],l=0,c=t;l<c.length;l+=1){for(var u=[],h=0,d=c[l];h<d.length;h+=1){var p=d[h],A=[p.x+s[0],p.y+s[1]];be(e,A),u.push(A)}a.push(u)}if(e[2]-e[0]<=o/2){(r=e)[0]=r[1]=1/0,r[2]=r[3]=-1/0;for(var f=0,g=a;f<g.length;f+=1)for(var m=0,y=g[f];m<y.length;m+=1)Le(y[m],e,i,o)}return a}_e.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");var n=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,Nt);if(!n)return null;var r=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,Nt);if(!r)return null;var o=null;return i.locale&&!(o=e.parse(i.locale,1,Ut))?null:new _e(n,r,o)},_e.prototype.evaluate=function(t){return new ee(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},_e.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},_e.prototype.outputDefined=function(){return!1},_e.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Re=function(t,e){this.type=Nt,this.geojson=t,this.geometries=e};function ke(t){if(t instanceof ve){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Re)return!1;var e=!0;return t.eachChild((function(t){e&&!ke(t)&&(e=!1)})),e}function ze(t){if(t instanceof ve&&"feature-state"===t.name)return!1;var e=!0;return t.eachChild((function(t){e&&!ze(t)&&(e=!1)})),e}function Ue(t,e){if(t instanceof ve&&e.indexOf(t.name)>=0)return!1;var i=!0;return t.eachChild((function(t){i&&!Ue(t,e)&&(i=!1)})),i}Re.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(se(t[1])){var i=t[1];if("FeatureCollection"===i.type)for(var n=0;n<i.features.length;++n){var r=i.features[n].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new Re(i,i.features[n].geometry)}else if("Feature"===i.type){var o=i.geometry.type;if("Polygon"===o||"MultiPolygon"===o)return new Re(i,i.geometry)}else if("Polygon"===i.type||"MultiPolygon"===i.type)return new Re(i,i)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Re.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){var o=Pe(e.coordinates,n,r),s=Oe(t.geometry(),i,n,r);if(!xe(i,n))return!1;for(var a=0,l=s;a<l.length;a+=1)if(!Be(l[a],o))return!1}if("MultiPolygon"===e.type){var c=De(e.coordinates,n,r),u=Oe(t.geometry(),i,n,r);if(!xe(i,n))return!1;for(var h=0,d=u;h<d.length;h+=1)if(!Ee(d[h],c))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var i=[1/0,1/0,-1/0,-1/0],n=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){var o=Pe(e.coordinates,n,r),s=Fe(t.geometry(),i,n,r);if(!xe(i,n))return!1;for(var a=0,l=s;a<l.length;a+=1)if(!Me(l[a],o))return!1}if("MultiPolygon"===e.type){var c=De(e.coordinates,n,r),u=Fe(t.geometry(),i,n,r);if(!xe(i,n))return!1;for(var h=0,d=u;h<d.length;h+=1)if(!Ie(d[h],c))return!1}return!0}(t,this.geometries)}return!1},Re.prototype.eachChild=function(){},Re.prototype.outputDefined=function(){return!0},Re.prototype.serialize=function(){return["within",this.geojson]};var Ne=function(t,e){this.type=e.type,this.name=t,this.boundExpression=e};Ne.parse=function(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");var i=t[1];return e.scope.has(i)?new Ne(i,e.scope.get(i)):e.error('Unknown variable "'+i+'". Make sure "'+i+'" has been bound in an enclosing "let" expression before using it.',1)},Ne.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ne.prototype.eachChild=function(){},Ne.prototype.outputDefined=function(){return!1},Ne.prototype.serialize=function(){return["var",this.name]};var Ge=function(t,e,i,n,r){void 0===e&&(e=[]),void 0===n&&(n=new Rt),void 0===r&&(r=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=n,this.errors=r,this.expectedType=i};function Ze(t,e){for(var i,n=t.length-1,r=0,o=n,s=0;r<=o;)if((i=t[s=Math.floor((r+o)/2)])<=e){if(s===n||e<t[s+1])return s;r=s+1}else{if(!(i>e))throw new ue("Input is not a number.");o=s-1}return 0}Ge.prototype.parse=function(t,e,i,n,r){return void 0===r&&(r={}),e?this.concat(e,i,n)._parse(t,r):this._parse(t,r)},Ge.prototype._parse=function(t,e){function i(t,e,i){return"assert"===i?new de(e,[t]):"coerce"===i?new ge(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var n=t[0];if("string"!=typeof n)return this.error("Expression name must be a string, but found "+typeof n+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var r=this.registry[n];if(r){var o=r.parse(t,this);if(!o)return null;if(this.expectedType){var s=this.expectedType,a=o.type;if("string"!==s.kind&&"number"!==s.kind&&"boolean"!==s.kind&&"object"!==s.kind&&"array"!==s.kind||"value"!==a.kind)if("color"!==s.kind&&"formatted"!==s.kind&&"resolvedImage"!==s.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(s,a))return null}else o=i(o,s,e.typeAnnotation||"coerce");else o=i(o,s,e.typeAnnotation||"assert")}if(!(o instanceof ce)&&"resolvedImage"!==o.type.kind&&function t(e){if(e instanceof Ne)return t(e.boundExpression);if(e instanceof ve&&"error"===e.name)return!1;if(e instanceof _e)return!1;if(e instanceof Re)return!1;var i=e instanceof ge||e instanceof de,n=!0;return e.eachChild((function(e){n=i?n&&t(e):n&&e instanceof ce})),!!n&&ke(e)&&Ue(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(o)){var l=new ye;try{o=new ce(o.type,o.evaluate(l))}catch(t){return this.error(t.message),null}}return o}return this.error('Unknown expression "'+n+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ge.prototype.concat=function(t,e,i){var n="number"==typeof t?this.path.concat(t):this.path,r=i?this.scope.concat(i):this.scope;return new Ge(this.registry,n,e||null,r,this.errors)},Ge.prototype.error=function(t){for(var e=[],i=arguments.length-1;i-- >0;)e[i]=arguments[i+1];var n=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Ft(n,t))},Ge.prototype.checkSubtype=function(t,e){var i=Kt(t,e);return i&&this.error(i),i};var je=function(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var n=0,r=i;n<r.length;n+=1){var o=r[n],s=o[1];this.labels.push(o[0]),this.outputs.push(s)}};function Ve(t,e,i){return t*(1-i)+e*i}je.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var i=e.parse(t[1],1,zt);if(!i)return null;var n=[],r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var o=1;o<t.length;o+=2){var s=1===o?-1/0:t[o],a=t[o+1],l=o,c=o+1;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',l);if(n.length&&n[n.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',l);var u=e.parse(a,c,r);if(!u)return null;r=r||u.type,n.push([s,u])}return new je(r,i,n)},je.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);var r=e.length;return n>=e[r-1]?i[r-1].evaluate(t):i[Ze(e,n)].evaluate(t)},je.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},je.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},je.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)e>0&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var He=Object.freeze({__proto__:null,number:Ve,color:function(t,e,i){return new te(Ve(t.r,e.r,i),Ve(t.g,e.g,i),Ve(t.b,e.b,i),Ve(t.a,e.a,i))},array:function(t,e,i){return t.map((function(t,n){return Ve(t,e[n],i)}))}}),Je=6/29*3*(6/29),We=Math.PI/180,Qe=180/Math.PI;function qe(t){return t>.008856451679035631?Math.pow(t,1/3):t/Je+4/29}function Ke(t){return t>6/29?t*t*t:Je*(t-4/29)}function Xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function Ye(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function $e(t){var e=Ye(t.r),i=Ye(t.g),n=Ye(t.b),r=qe((.4124564*e+.3575761*i+.1804375*n)/.95047),o=qe((.2126729*e+.7151522*i+.072175*n)/1);return{l:116*o-16,a:500*(r-o),b:200*(o-qe((.0193339*e+.119192*i+.9503041*n)/1.08883)),alpha:t.a}}function ti(t){var e=(t.l+16)/116,i=isNaN(t.a)?e:e+t.a/500,n=isNaN(t.b)?e:e-t.b/200;return e=1*Ke(e),i=.95047*Ke(i),n=1.08883*Ke(n),new te(Xe(3.2404542*i-1.5371385*e-.4985314*n),Xe(-.969266*i+1.8760108*e+.041556*n),Xe(.0556434*i-.2040259*e+1.0572252*n),t.alpha)}function ei(t,e,i){var n=e-t;return t+i*(n>180||n<-180?n-360*Math.round(n/360):n)}var ii={forward:$e,reverse:ti,interpolate:function(t,e,i){return{l:Ve(t.l,e.l,i),a:Ve(t.a,e.a,i),b:Ve(t.b,e.b,i),alpha:Ve(t.alpha,e.alpha,i)}}},ni={forward:function(t){var e=$e(t),i=e.l,n=e.a,r=e.b,o=Math.atan2(r,n)*Qe;return{h:o<0?o+360:o,c:Math.sqrt(n*n+r*r),l:i,alpha:t.a}},reverse:function(t){var e=t.h*We,i=t.c;return ti({l:t.l,a:Math.cos(e)*i,b:Math.sin(e)*i,alpha:t.alpha})},interpolate:function(t,e,i){return{h:ei(t.h,e.h,i),c:Ve(t.c,e.c,i),l:Ve(t.l,e.l,i),alpha:Ve(t.alpha,e.alpha,i)}}},ri=Object.freeze({__proto__:null,lab:ii,hcl:ni}),oi=function(t,e,i,n,r){this.type=t,this.operator=e,this.interpolation=i,this.input=n,this.labels=[],this.outputs=[];for(var o=0,s=r;o<s.length;o+=1){var a=s[o],l=a[1];this.labels.push(a[0]),this.outputs.push(l)}};function si(t,e,i,n){var r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}oi.interpolationFactor=function(t,e,n,r){var o=0;if("exponential"===t.name)o=si(e,t.base,n,r);else if("linear"===t.name)o=si(e,1,n,r);else if("cubic-bezier"===t.name){var s=t.controlPoints;o=new i(s[0],s[1],s[2],s[3]).solve(si(e,1,n,r))}return o},oi.parse=function(t,e){var i=t[0],n=t[1],r=t[2],o=t.slice(3);if(!Array.isArray(n)||0===n.length)return e.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){var s=n[1];if("number"!=typeof s)return e.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:s}}else{if("cubic-bezier"!==n[0])return e.error("Unknown interpolation type "+String(n[0]),1,0);var a=n.slice(1);if(4!==a.length||a.some((function(t){return"number"!=typeof t||t<0||t>1})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);n={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(r=e.parse(r,2,zt)))return null;var l=[],c=null;"interpolate-hcl"===i||"interpolate-lab"===i?c=Gt:e.expectedType&&"value"!==e.expectedType.kind&&(c=e.expectedType);for(var u=0;u<o.length;u+=2){var h=o[u],d=o[u+1],p=u+3,A=u+4;if("number"!=typeof h)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',p);if(l.length&&l[l.length-1][0]>=h)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',p);var f=e.parse(d,A,c);if(!f)return null;c=c||f.type,l.push([h,f])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new oi(c,i,n,r,l):e.error("Type "+Qt(c)+" is not interpolatable.")},oi.prototype.evaluate=function(t){var e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);var n=this.input.evaluate(t);if(n<=e[0])return i[0].evaluate(t);var r=e.length;if(n>=e[r-1])return i[r-1].evaluate(t);var o=Ze(e,n),s=oi.interpolationFactor(this.interpolation,n,e[o],e[o+1]),a=i[o].evaluate(t),l=i[o+1].evaluate(t);return"interpolate"===this.operator?He[this.type.kind.toLowerCase()](a,l,s):"interpolate-hcl"===this.operator?ni.reverse(ni.interpolate(ni.forward(a),ni.forward(l),s)):ii.reverse(ii.interpolate(ii.forward(a),ii.forward(l),s))},oi.prototype.eachChild=function(t){t(this.input);for(var e=0,i=this.outputs;e<i.length;e+=1)t(i[e])},oi.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},oi.prototype.serialize=function(){var t;t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var e=[this.operator,t,this.input.serialize()],i=0;i<this.labels.length;i++)e.push(this.labels[i],this.outputs[i].serialize());return e};var ai=function(t,e){this.type=t,this.args=e};ai.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var i=null,n=e.expectedType;n&&"value"!==n.kind&&(i=n);for(var r=[],o=0,s=t.slice(1);o<s.length;o+=1){var a=e.parse(s[o],1+r.length,i,void 0,{typeAnnotation:"omit"});if(!a)return null;i=i||a.type,r.push(a)}var l=n&&r.some((function(t){return Kt(n,t.type)}));return new ai(l?jt:i,r)},ai.prototype.evaluate=function(t){for(var e,i=null,n=0,r=0,o=this.args;r<o.length&&(n++,(i=o[r].evaluate(t))&&i instanceof re&&!i.available&&(e||(e=i.name),i=null,n===this.args.length&&(i=e)),null===i);r+=1);return i},ai.prototype.eachChild=function(t){this.args.forEach(t)},ai.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ai.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var li=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};li.prototype.evaluate=function(t){return this.result.evaluate(t)},li.prototype.eachChild=function(t){for(var e=0,i=this.bindings;e<i.length;e+=1)t(i[e][1]);t(this.result)},li.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var i=[],n=1;n<t.length-1;n+=2){var r=t[n];if("string"!=typeof r)return e.error("Expected string, but found "+typeof r+" instead.",n);if(/[^a-zA-Z0-9_]/.test(r))return e.error("Variable names must contain only alphanumeric characters or '_'.",n);var o=e.parse(t[n+1],n+1);if(!o)return null;i.push([r,o])}var s=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return s?new li(i,s):null},li.prototype.outputDefined=function(){return this.result.outputDefined()},li.prototype.serialize=function(){for(var t=["let"],e=0,i=this.bindings;e<i.length;e+=1){var n=i[e];t.push(n[0],n[1].serialize())}return t.push(this.result.serialize()),t};var ci=function(t,e,i){this.type=t,this.index=e,this.input=i};ci.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,zt),n=e.parse(t[2],2,Wt(e.expectedType||jt));return i&&n?new ci(n.type.itemType,i,n):null},ci.prototype.evaluate=function(t){var e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new ue("Array index out of bounds: "+e+" < 0.");if(e>=i.length)throw new ue("Array index out of bounds: "+e+" > "+(i.length-1)+".");if(e!==Math.floor(e))throw new ue("Array index must be an integer, but found "+e+" instead.");return i[e]},ci.prototype.eachChild=function(t){t(this.index),t(this.input)},ci.prototype.outputDefined=function(){return!1},ci.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var ui=function(t,e){this.type=Nt,this.needle=t,this.haystack=e};ui.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);return i&&n?Xt(i.type,[Nt,Ut,zt,kt,jt])?new ui(i,n):e.error("Expected first argument to be of type boolean, string, number or null, but found "+Qt(i.type)+" instead"):null},ui.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!Yt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Qt(ae(e))+" instead.");if(!Yt(i,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Qt(ae(i))+" instead.");return i.indexOf(e)>=0},ui.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},ui.prototype.outputDefined=function(){return!0},ui.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var hi=function(t,e,i){this.type=zt,this.needle=t,this.haystack=e,this.fromIndex=i};hi.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,jt),n=e.parse(t[2],2,jt);if(!i||!n)return null;if(!Xt(i.type,[Nt,Ut,zt,kt,jt]))return e.error("Expected first argument to be of type boolean, string, number or null, but found "+Qt(i.type)+" instead");if(4===t.length){var r=e.parse(t[3],3,zt);return r?new hi(i,n,r):null}return new hi(i,n)},hi.prototype.evaluate=function(t){var e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!Yt(e,["boolean","string","number","null"]))throw new ue("Expected first argument to be of type boolean, string, number or null, but found "+Qt(ae(e))+" instead.");if(!Yt(i,["string","array"]))throw new ue("Expected second argument to be of type array or string, but found "+Qt(ae(i))+" instead.");if(this.fromIndex){var n=this.fromIndex.evaluate(t);return i.indexOf(e,n)}return i.indexOf(e)},hi.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},hi.prototype.outputDefined=function(){return!1},hi.prototype.serialize=function(){if(null!=this.fromIndex&&void 0!==this.fromIndex){var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var di=function(t,e,i,n,r,o){this.inputType=t,this.type=e,this.input=i,this.cases=n,this.outputs=r,this.otherwise=o};di.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var i,n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var r={},o=[],s=2;s<t.length-1;s+=2){var a=t[s],l=t[s+1];Array.isArray(a)||(a=[a]);var c=e.concat(s);if(0===a.length)return c.error("Expected at least one branch label.");for(var u=0,h=a;u<h.length;u+=1){var d=h[u];if("number"!=typeof d&&"string"!=typeof d)return c.error("Branch labels must be numbers or strings.");if("number"==typeof d&&Math.abs(d)>Number.MAX_SAFE_INTEGER)return c.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof d&&Math.floor(d)!==d)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,ae(d)))return null}else i=ae(d);if(void 0!==r[String(d)])return c.error("Branch labels must be unique.");r[String(d)]=o.length}var p=e.parse(l,s,n);if(!p)return null;n=n||p.type,o.push(p)}var A=e.parse(t[1],1,jt);if(!A)return null;var f=e.parse(t[t.length-1],t.length-1,n);return f?"value"!==A.type.kind&&e.concat(1).checkSubtype(i,A.type)?null:new di(i,n,A,r,o,f):null},di.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(ae(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},di.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},di.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},di.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],i=[],n={},r=0,o=Object.keys(this.cases).sort();r<o.length;r+=1){var s=o[r];void 0===(h=n[this.cases[s]])?(n[this.cases[s]]=i.length,i.push([this.cases[s],[s]])):i[h][1].push(s)}for(var a=function(e){return"number"===t.inputType.kind?Number(e):e},l=0,c=i;l<c.length;l+=1){var u=c[l],h=u[0],d=u[1];e.push(1===d.length?a(d[0]):d.map(a)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e};var pi=function(t,e,i){this.type=t,this.branches=e,this.otherwise=i};pi.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n=[],r=1;r<t.length-1;r+=2){var o=e.parse(t[r],r,Nt);if(!o)return null;var s=e.parse(t[r+1],r+1,i);if(!s)return null;n.push([o,s]),i=i||s.type}var a=e.parse(t[t.length-1],t.length-1,i);return a?new pi(i,n,a):null},pi.prototype.evaluate=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var n=i[e],r=n[1];if(n[0].evaluate(t))return r.evaluate(t)}return this.otherwise.evaluate(t)},pi.prototype.eachChild=function(t){for(var e=0,i=this.branches;e<i.length;e+=1){var n=i[e],r=n[1];t(n[0]),t(r)}t(this.otherwise)},pi.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},pi.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ai=function(t,e,i,n){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=n};function fi(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function gi(t,e,i,n){return 0===n.compare(e,i)}function mi(t,e,i){var n="=="!==t&&"!="!==t;return function(){function r(t,e,i){this.type=Nt,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}return r.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var i=t[0],o=e.parse(t[1],1,jt);if(!o)return null;if(!fi(i,o.type))return e.concat(1).error('"'+i+"\" comparisons are not supported for type '"+Qt(o.type)+"'.");var s=e.parse(t[2],2,jt);if(!s)return null;if(!fi(i,s.type))return e.concat(2).error('"'+i+"\" comparisons are not supported for type '"+Qt(s.type)+"'.");if(o.type.kind!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot compare types '"+Qt(o.type)+"' and '"+Qt(s.type)+"'.");n&&("value"===o.type.kind&&"value"!==s.type.kind?o=new de(s.type,[o]):"value"!==o.type.kind&&"value"===s.type.kind&&(s=new de(o.type,[s])));var a=null;if(4===t.length){if("string"!==o.type.kind&&"string"!==s.type.kind&&"value"!==o.type.kind&&"value"!==s.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(a=e.parse(t[3],3,Vt)))return null}return new r(o,s,a)},r.prototype.evaluate=function(r){var o=this.lhs.evaluate(r),s=this.rhs.evaluate(r);if(n&&this.hasUntypedArgument){var a=ae(o),l=ae(s);if(a.kind!==l.kind||"string"!==a.kind&&"number"!==a.kind)throw new ue('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+a.kind+", "+l.kind+") instead.")}if(this.collator&&!n&&this.hasUntypedArgument){var c=ae(o),u=ae(s);if("string"!==c.kind||"string"!==u.kind)return e(r,o,s)}return this.collator?i(r,o,s,this.collator.evaluate(r)):e(r,o,s)},r.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},r.prototype.outputDefined=function(){return!0},r.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},r}()}Ai.parse=function(t,e){if(t.length<=2||t.length>=5)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1,jt),n=e.parse(t[2],2,zt);if(!i||!n)return null;if(!Xt(i.type,[Wt(jt),Ut,jt]))return e.error("Expected first argument to be of type array or string, but found "+Qt(i.type)+" instead");if(4===t.length){var r=e.parse(t[3],3,zt);return r?new Ai(i.type,i,n,r):null}return new Ai(i.type,i,n)},Ai.prototype.evaluate=function(t){var e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);if(!Yt(e,["string","array"]))throw new ue("Expected first argument to be of type array or string, but found "+Qt(ae(e))+" instead.");if(this.endIndex){var n=this.endIndex.evaluate(t);return e.slice(i,n)}return e.slice(i)},Ai.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},Ai.prototype.outputDefined=function(){return!1},Ai.prototype.serialize=function(){if(null!=this.endIndex&&void 0!==this.endIndex){var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var yi=mi("==",(function(t,e,i){return e===i}),gi),vi=mi("!=",(function(t,e,i){return e!==i}),(function(t,e,i,n){return!gi(0,e,i,n)})),_i=mi("<",(function(t,e,i){return e<i}),(function(t,e,i,n){return n.compare(e,i)<0})),bi=mi(">",(function(t,e,i){return e>i}),(function(t,e,i,n){return n.compare(e,i)>0})),xi=mi("<=",(function(t,e,i){return e<=i}),(function(t,e,i,n){return n.compare(e,i)<=0})),wi=mi(">=",(function(t,e,i){return e>=i}),(function(t,e,i,n){return n.compare(e,i)>=0})),Ci=function(t,e,i,n,r){this.type=Ut,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=n,this.maxFractionDigits=r};Ci.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var i=e.parse(t[1],1,zt);if(!i)return null;var n=t[2];if("object"!=typeof n||Array.isArray(n))return e.error("NumberFormat options argument must be an object.");var r=null;if(n.locale&&!(r=e.parse(n.locale,1,Ut)))return null;var o=null;if(n.currency&&!(o=e.parse(n.currency,1,Ut)))return null;var s=null;if(n["min-fraction-digits"]&&!(s=e.parse(n["min-fraction-digits"],1,zt)))return null;var a=null;return n["max-fraction-digits"]&&!(a=e.parse(n["max-fraction-digits"],1,zt))?null:new Ci(i,r,o,s,a)},Ci.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},Ci.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},Ci.prototype.outputDefined=function(){return!1},Ci.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]};var Bi=function(t){this.type=zt,this.input=t};Bi.parse=function(t,e){if(2!==t.length)return e.error("Expected 1 argument, but found "+(t.length-1)+" instead.");var i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error("Expected argument of type string or array, but found "+Qt(i.type)+" instead."):new Bi(i):null},Bi.prototype.evaluate=function(t){var e=this.input.evaluate(t);if("string"==typeof e)return e.length;if(Array.isArray(e))return e.length;throw new ue("Expected value to be of type string or array, but found "+Qt(ae(e))+" instead.")},Bi.prototype.eachChild=function(t){t(this.input)},Bi.prototype.outputDefined=function(){return!1},Bi.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ei={"==":yi,"!=":vi,">":bi,"<":_i,">=":wi,"<=":xi,array:de,at:ci,boolean:de,case:pi,coalesce:ai,collator:_e,format:pe,image:Ae,in:ui,"index-of":hi,interpolate:oi,"interpolate-hcl":oi,"interpolate-lab":oi,length:Bi,let:li,literal:ce,match:di,number:de,"number-format":Ci,object:de,slice:Ai,step:je,string:de,"to-boolean":ge,"to-color":ge,"to-number":ge,"to-string":ge,var:Ne,within:Re};function Si(t,e){var i=e[0],n=e[1],r=e[2],o=e[3];i=i.evaluate(t),n=n.evaluate(t),r=r.evaluate(t);var s=o?o.evaluate(t):1,a=oe(i,n,r,s);if(a)throw new ue(a);return new te(i/255*s,n/255*s,r/255*s,s)}function Ti(t,e){return t in e}function Mi(t,e){var i=e[t];return void 0===i?null:i}function Ii(t){return{type:t}}function Pi(t){return{result:"success",value:t}}function Di(t){return{result:"error",value:t}}function Li(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Oi(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function Fi(t){return!!t.expression&&t.expression.interpolated}function Ri(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function ki(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function zi(t){return t}function Ui(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function Ni(t,e,i,n,r){return Ui(typeof i===r?n[i]:void 0,t.default,e.default)}function Gi(t,e,i){if("number"!==Ri(i))return Ui(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];var r=Ze(t.stops.map((function(t){return t[0]})),i);return t.stops[r][1]}function Zi(t,e,i){var n=void 0!==t.base?t.base:1;if("number"!==Ri(i))return Ui(t.default,e.default);var r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];var o=Ze(t.stops.map((function(t){return t[0]})),i),s=function(t,e,i,n){var r=n-i,o=t-i;return 0===r?0:1===e?o/r:(Math.pow(e,o)-1)/(Math.pow(e,r)-1)}(i,n,t.stops[o][0],t.stops[o+1][0]),a=t.stops[o][1],l=t.stops[o+1][1],c=He[e.type]||zi;if(t.colorSpace&&"rgb"!==t.colorSpace){var u=ri[t.colorSpace];c=function(t,e){return u.reverse(u.interpolate(u.forward(t),u.forward(e),s))}}return"function"==typeof a.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var i=a.evaluate.apply(void 0,t),n=l.evaluate.apply(void 0,t);if(void 0!==i&&void 0!==n)return c(i,n,s)}}:c(a,l,s)}function ji(t,e,i){return"color"===e.type?i=te.parse(i):"formatted"===e.type?i=ne.fromString(i.toString()):"resolvedImage"===e.type?i=re.fromString(i.toString()):Ri(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0),Ui(i,t.default,e.default)}ve.register(Ei,{error:[{kind:"error"},[Ut],function(t,e){throw new ue(e[0].evaluate(t))}],typeof:[Ut,[jt],function(t,e){return Qt(ae(e[0].evaluate(t)))}],"to-rgba":[Wt(zt,4),[Gt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Gt,[zt,zt,zt],Si],rgba:[Gt,[zt,zt,zt,zt],Si],has:{type:Nt,overloads:[[[Ut],function(t,e){return Ti(e[0].evaluate(t),t.properties())}],[[Ut,Zt],function(t,e){var i=e[1];return Ti(e[0].evaluate(t),i.evaluate(t))}]]},get:{type:jt,overloads:[[[Ut],function(t,e){return Mi(e[0].evaluate(t),t.properties())}],[[Ut,Zt],function(t,e){var i=e[1];return Mi(e[0].evaluate(t),i.evaluate(t))}]]},"feature-state":[jt,[Ut],function(t,e){return Mi(e[0].evaluate(t),t.featureState||{})}],properties:[Zt,[],function(t){return t.properties()}],"geometry-type":[Ut,[],function(t){return t.geometryType()}],id:[jt,[],function(t){return t.id()}],zoom:[zt,[],function(t){return t.globals.zoom}],"heatmap-density":[zt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[zt,[],function(t){return t.globals.lineProgress||0}],accumulated:[jt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[zt,Ii(zt),function(t,e){for(var i=0,n=0,r=e;n<r.length;n+=1)i+=r[n].evaluate(t);return i}],"*":[zt,Ii(zt),function(t,e){for(var i=1,n=0,r=e;n<r.length;n+=1)i*=r[n].evaluate(t);return i}],"-":{type:zt,overloads:[[[zt,zt],function(t,e){var i=e[1];return e[0].evaluate(t)-i.evaluate(t)}],[[zt],function(t,e){return-e[0].evaluate(t)}]]},"/":[zt,[zt,zt],function(t,e){var i=e[1];return e[0].evaluate(t)/i.evaluate(t)}],"%":[zt,[zt,zt],function(t,e){var i=e[1];return e[0].evaluate(t)%i.evaluate(t)}],ln2:[zt,[],function(){return Math.LN2}],pi:[zt,[],function(){return Math.PI}],e:[zt,[],function(){return Math.E}],"^":[zt,[zt,zt],function(t,e){var i=e[1];return Math.pow(e[0].evaluate(t),i.evaluate(t))}],sqrt:[zt,[zt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[zt,[zt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[zt,[zt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[zt,[zt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[zt,[zt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[zt,[zt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[zt,[zt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[zt,[zt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[zt,[zt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[zt,[zt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[zt,Ii(zt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[zt,Ii(zt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[zt,[zt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[zt,[zt],function(t,e){var i=e[0].evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[zt,[zt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[zt,[zt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Nt,[Ut,jt],function(t,e){var i=e[0],n=e[1];return t.properties()[i.value]===n.value}],"filter-id-==":[Nt,[jt],function(t,e){var i=e[0];return t.id()===i.value}],"filter-type-==":[Nt,[Ut],function(t,e){var i=e[0];return t.geometryType()===i.value}],"filter-<":[Nt,[Ut,jt],function(t,e){var i=e[0],n=e[1],r=t.properties()[i.value],o=n.value;return typeof r==typeof o&&r<o}],"filter-id-<":[Nt,[jt],function(t,e){var i=e[0],n=t.id(),r=i.value;return typeof n==typeof r&&n<r}],"filter->":[Nt,[Ut,jt],function(t,e){var i=e[0],n=e[1],r=t.properties()[i.value],o=n.value;return typeof r==typeof o&&r>o}],"filter-id->":[Nt,[jt],function(t,e){var i=e[0],n=t.id(),r=i.value;return typeof n==typeof r&&n>r}],"filter-<=":[Nt,[Ut,jt],function(t,e){var i=e[0],n=e[1],r=t.properties()[i.value],o=n.value;return typeof r==typeof o&&r<=o}],"filter-id-<=":[Nt,[jt],function(t,e){var i=e[0],n=t.id(),r=i.value;return typeof n==typeof r&&n<=r}],"filter->=":[Nt,[Ut,jt],function(t,e){var i=e[0],n=e[1],r=t.properties()[i.value],o=n.value;return typeof r==typeof o&&r>=o}],"filter-id->=":[Nt,[jt],function(t,e){var i=e[0],n=t.id(),r=i.value;return typeof n==typeof r&&n>=r}],"filter-has":[Nt,[jt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Nt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Nt,[Wt(Ut)],function(t,e){return e[0].value.indexOf(t.geometryType())>=0}],"filter-id-in":[Nt,[Wt(jt)],function(t,e){return e[0].value.indexOf(t.id())>=0}],"filter-in-small":[Nt,[Ut,Wt(jt)],function(t,e){var i=e[0];return e[1].value.indexOf(t.properties()[i.value])>=0}],"filter-in-large":[Nt,[Ut,Wt(jt)],function(t,e){var i=e[0],n=e[1];return function(t,e,i,n){for(;i<=n;){var r=i+n>>1;if(e[r]===t)return!0;e[r]>t?n=r-1:i=r+1}return!1}(t.properties()[i.value],n.value,0,n.value.length-1)}],all:{type:Nt,overloads:[[[Nt,Nt],function(t,e){var i=e[1];return e[0].evaluate(t)&&i.evaluate(t)}],[Ii(Nt),function(t,e){for(var i=0,n=e;i<n.length;i+=1)if(!n[i].evaluate(t))return!1;return!0}]]},any:{type:Nt,overloads:[[[Nt,Nt],function(t,e){var i=e[1];return e[0].evaluate(t)||i.evaluate(t)}],[Ii(Nt),function(t,e){for(var i=0,n=e;i<n.length;i+=1)if(n[i].evaluate(t))return!0;return!1}]]},"!":[Nt,[Nt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Nt,[Ut],function(t,e){var i=t.globals&&t.globals.isSupportedScript;return!i||i(e[0].evaluate(t))}],upcase:[Ut,[Ut],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Ut,[Ut],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Ut,Ii(jt),function(t,e){return e.map((function(e){return le(e.evaluate(t))})).join("")}],"resolved-locale":[Ut,[Vt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var Vi=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new ye,this._defaultValue=e?function(t){return"color"===t.type&&ki(t.default)?new te(0,0,0,0):"color"===t.type?te.parse(t.default)||null:void 0===t.default?null:t.default}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null};function Hi(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Ei}function Ji(t,e){var i=new Ge(Ei,[],e?function(t){var e={color:Gt,string:Ut,number:zt,enum:Ut,boolean:Nt,formatted:Ht,resolvedImage:Jt};return"array"===t.type?Wt(e[t.value]||jt,t.length):e[t.type]}(e):void 0),n=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return n?Pi(new Vi(n,e)):Di(i.errors)}Vi.prototype.evaluateWithoutErrorHandling=function(t,e,i,n,r,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},Vi.prototype.evaluate=function(t,e,i,n,r,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=n,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=o||null;try{var s=this.expression.evaluate(this._evaluator);if(null==s||"number"==typeof s&&s!=s)return this._defaultValue;if(this._enumValues&&!(s in this._enumValues))throw new ue("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(s)+" instead.");return s}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Wi=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!ze(e.expression)};Wi.prototype.evaluateWithoutErrorHandling=function(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)},Wi.prototype.evaluate=function(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)};var Qi=function(t,e,i,n){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!ze(e.expression),this.interpolationType=n};function qi(t,e){if("error"===(t=Ji(t,e)).result)return t;var i=t.value.expression,n=ke(i);if(!n&&!Li(e))return Di([new Ft("","data expressions not supported")]);var r=Ue(i,["zoom"]);if(!r&&!Oi(e))return Di([new Ft("","zoom expressions not supported")]);var o=function t(e){var i=null;if(e instanceof li)i=t(e.result);else if(e instanceof ai)for(var n=0,r=e.args;n<r.length&&!(i=t(r[n]));n+=1);else(e instanceof je||e instanceof oi)&&e.input instanceof ve&&"zoom"===e.input.name&&(i=e);return i instanceof Ft||e.eachChild((function(e){var n=t(e);n instanceof Ft?i=n:!i&&n?i=new Ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):i&&n&&i!==n&&(i=new Ft("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),i}(i);return o||r?o instanceof Ft?Di([o]):o instanceof oi&&!Fi(e)?Di([new Ft("",'"interpolate" expressions cannot be used with this property')]):Pi(o?new Qi(n?"camera":"composite",t.value,o.labels,o instanceof oi?o.interpolation:void 0):new Wi(n?"constant":"source",t.value)):Di([new Ft("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Qi.prototype.evaluateWithoutErrorHandling=function(t,e,i,n,r,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,n,r,o)},Qi.prototype.evaluate=function(t,e,i,n,r,o){return this._styleExpression.evaluate(t,e,i,n,r,o)},Qi.prototype.interpolationFactor=function(t,e,i){return this.interpolationType?oi.interpolationFactor(this.interpolationType,t,e,i):0};var Ki=function(t,e){this._parameters=t,this._specification=e,Dt(this,function t(e,i){var n,r,o,s="color"===i.type,a=e.stops&&"object"==typeof e.stops[0][0],l=a||!(a||void 0!==e.property),c=e.type||(Fi(i)?"exponential":"interval");if(s&&((e=Dt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],te.parse(t[1])]}))),e.default=te.parse(e.default?e.default:i.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!ri[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===c)n=Zi;else if("interval"===c)n=Gi;else if("categorical"===c){n=Ni,r=Object.create(null);for(var u=0,h=e.stops;u<h.length;u+=1){var d=h[u];r[d[0]]=d[1]}o=typeof e.stops[0][0]}else{if("identity"!==c)throw new Error('Unknown function type "'+c+'"');n=ji}if(a){for(var p={},A=[],f=0;f<e.stops.length;f++){var g=e.stops[f],m=g[0].zoom;void 0===p[m]&&(p[m]={zoom:m,type:e.type,property:e.property,default:e.default,stops:[]},A.push(m)),p[m].stops.push([g[0].value,g[1]])}for(var y=[],v=0,_=A;v<_.length;v+=1){var b=_[v];y.push([p[b].zoom,t(p[b],i)])}var x={name:"linear"};return{kind:"composite",interpolationType:x,interpolationFactor:oi.interpolationFactor.bind(void 0,x),zoomStops:y.map((function(t){return t[0]})),evaluate:function(t,n){var r=t.zoom;return Zi({stops:y,base:e.base},i,r).evaluate(r,n)}}}if(l){var w="exponential"===c?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:w,interpolationFactor:oi.interpolationFactor.bind(void 0,w),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return n(e,i,t.zoom,r,o)}}}return{kind:"source",evaluate:function(t,s){var a=s&&s.properties?s.properties[e.property]:void 0;return void 0===a?Ui(e.default,i.default):n(e,i,a,r,o)}}}(this._parameters,this._specification))};function Xi(t){var e=t.key,i=t.value,n=t.valueSpec||{},r=t.objectElementValidators||{},o=t.style,s=t.styleSpec,a=[],l=Ri(i);if("object"!==l)return[new It(e,i,"object expected, "+l+" found")];for(var c in i){var u=c.split(".")[0],h=n[u]||n["*"],d=void 0;if(r[u])d=r[u];else if(n[u])d=wn;else if(r["*"])d=r["*"];else{if(!n["*"]){a.push(new It(e,i[c],'unknown property "'+c+'"'));continue}d=wn}a=a.concat(d({key:(e?e+".":e)+c,value:i[c],valueSpec:h,style:o,styleSpec:s,object:i,objectKey:c},i))}for(var p in n)r[p]||n[p].required&&void 0===n[p].default&&void 0===i[p]&&a.push(new It(e,i,'missing required property "'+p+'"'));return a}function Yi(t){var e=t.value,i=t.valueSpec,n=t.style,r=t.styleSpec,o=t.key,s=t.arrayElementValidator||wn;if("array"!==Ri(e))return[new It(o,e,"array expected, "+Ri(e)+" found")];if(i.length&&e.length!==i.length)return[new It(o,e,"array length "+i.length+" expected, length "+e.length+" found")];if(i["min-length"]&&e.length<i["min-length"])return[new It(o,e,"array length at least "+i["min-length"]+" expected, length "+e.length+" found")];var a={type:i.value,values:i.values};r.$version<7&&(a.function=i.function),"object"===Ri(i.value)&&(a=i.value);for(var l=[],c=0;c<e.length;c++)l=l.concat(s({array:e,arrayIndex:c,value:e[c],valueSpec:a,style:n,styleSpec:r,key:o+"["+c+"]"}));return l}function $i(t){var e=t.key,i=t.value,n=t.valueSpec,r=Ri(i);return"number"===r&&i!=i&&(r="NaN"),"number"!==r?[new It(e,i,"number expected, "+r+" found")]:"minimum"in n&&i<n.minimum?[new It(e,i,i+" is less than the minimum value "+n.minimum)]:"maximum"in n&&i>n.maximum?[new It(e,i,i+" is greater than the maximum value "+n.maximum)]:[]}function tn(t){var e,i,n,r=t.valueSpec,o=Lt(t.value.type),s={},a="categorical"!==o&&void 0===t.value.property,l=!a,c="array"===Ri(t.value.stops)&&"array"===Ri(t.value.stops[0])&&"object"===Ri(t.value.stops[0][0]),u=Xi({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new It(t.key,t.value,'identity function may not have a "stops" property')];var e=[],i=t.value;return e=e.concat(Yi({key:t.key,value:i,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:h})),"array"===Ri(i)&&0===i.length&&e.push(new It(t.key,i,"array must have at least one stop")),e},default:function(t){return wn({key:t.key,value:t.value,valueSpec:r,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&a&&u.push(new It(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||u.push(new It(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Fi(t.valueSpec)&&u.push(new It(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!Li(t.valueSpec)?u.push(new It(t.key,t.value,"property functions not supported")):a&&!Oi(t.valueSpec)&&u.push(new It(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!c||void 0!==t.value.property||u.push(new It(t.key,t.value,'"property" property is required')),u;function h(t){var e=[],o=t.value,a=t.key;if("array"!==Ri(o))return[new It(a,o,"array expected, "+Ri(o)+" found")];if(2!==o.length)return[new It(a,o,"array length 2 expected, length "+o.length+" found")];if(c){if("object"!==Ri(o[0]))return[new It(a,o,"object expected, "+Ri(o[0])+" found")];if(void 0===o[0].zoom)return[new It(a,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new It(a,o,"object stop key must have value")];if(n&&n>Lt(o[0].zoom))return[new It(a,o[0].zoom,"stop zoom values must appear in ascending order")];Lt(o[0].zoom)!==n&&(n=Lt(o[0].zoom),i=void 0,s={}),e=e.concat(Xi({key:a+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:$i,value:d}}))}else e=e.concat(d({key:a+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Hi(Ot(o[1]))?e.concat([new It(a+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(wn({key:a+"[1]",value:o[1],valueSpec:r,style:t.style,styleSpec:t.styleSpec}))}function d(t,n){var a=Ri(t.value),l=Lt(t.value),c=null!==t.value?t.value:n;if(e){if(a!==e)return[new It(t.key,c,a+" stop domain type must match previous stop domain type "+e)]}else e=a;if("number"!==a&&"string"!==a&&"boolean"!==a)return[new It(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==a&&"categorical"!==o){var u="number expected, "+a+" found";return Li(r)&&void 0===o&&(u+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new It(t.key,c,u)]}return"categorical"!==o||"number"!==a||isFinite(l)&&Math.floor(l)===l?"categorical"!==o&&"number"===a&&void 0!==i&&l<i?[new It(t.key,c,"stop domain values must appear in ascending order")]:(i=l,"categorical"===o&&l in s?[new It(t.key,c,"stop domain values must be unique")]:(s[l]=!0,[])):[new It(t.key,c,"integer expected, found "+l)]}}function en(t){var e=("property"===t.expressionContext?qi:Ji)(Ot(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new It(""+t.key+e.key,t.value,e.message)}));var i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new It(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!ze(i))return[new It(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!ze(i))return[new It(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Ue(i,["zoom","feature-state"]))return[new It(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!ke(i))return[new It(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function nn(t){var e=t.key,i=t.value,n=t.valueSpec,r=[];return Array.isArray(n.values)?-1===n.values.indexOf(Lt(i))&&r.push(new It(e,i,"expected one of ["+n.values.join(", ")+"], "+JSON.stringify(i)+" found")):-1===Object.keys(n.values).indexOf(Lt(i))&&r.push(new It(e,i,"expected one of ["+Object.keys(n.values).join(", ")+"], "+JSON.stringify(i)+" found")),r}function rn(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,i=t.slice(1);e<i.length;e+=1){var n=i[e];if(!rn(n)&&"boolean"!=typeof n)return!1}return!0;default:return!0}}Ki.deserialize=function(t){return new Ki(t._parameters,t._specification)},Ki.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}};var on={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function sn(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};rn(t)||(t=ln(t));var e=Ji(t,on);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,i,n){return e.value.evaluate(t,i,{},n)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var i=1;i<e.length;i++)if(t(e[i]))return!0;return!1}(t)}}function an(t,e){return t<e?-1:t>e?1:0}function ln(t){if(!t)return!0;var e,i=t[0];return t.length<=1?"any"!==i:"=="===i?cn(t[1],t[2],"=="):"!="===i?dn(cn(t[1],t[2],"==")):"<"===i||">"===i||"<="===i||">="===i?cn(t[1],t[2],i):"any"===i?(e=t.slice(1),["any"].concat(e.map(ln))):"all"===i?["all"].concat(t.slice(1).map(ln)):"none"===i?["all"].concat(t.slice(1).map(ln).map(dn)):"in"===i?un(t[1],t.slice(2)):"!in"===i?dn(un(t[1],t.slice(2))):"has"===i?hn(t[1]):"!has"===i?dn(hn(t[1])):"within"!==i||t}function cn(t,e,i){switch(t){case"$type":return["filter-type-"+i,e];case"$id":return["filter-id-"+i,e];default:return["filter-"+i,t,e]}}function un(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(an)]]:["filter-in-small",t,["literal",e]]}}function hn(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function dn(t){return["!",t]}function pn(t){return rn(Ot(t.value))?en(Dt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var i=e.value,n=e.key;if("array"!==Ri(i))return[new It(n,i,"array expected, "+Ri(i)+" found")];var r,o=e.styleSpec,s=[];if(i.length<1)return[new It(n,i,"filter array must have at least 1 element")];switch(s=s.concat(nn({key:n+"[0]",value:i[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Lt(i[0])){case"<":case"<=":case">":case">=":i.length>=2&&"$type"===Lt(i[1])&&s.push(new It(n,i,'"$type" cannot be use with operator "'+i[0]+'"'));case"==":case"!=":3!==i.length&&s.push(new It(n,i,'filter array for operator "'+i[0]+'" must have 3 elements'));case"in":case"!in":i.length>=2&&"string"!==(r=Ri(i[1]))&&s.push(new It(n+"[1]",i[1],"string expected, "+r+" found"));for(var a=2;a<i.length;a++)r=Ri(i[a]),"$type"===Lt(i[1])?s=s.concat(nn({key:n+"["+a+"]",value:i[a],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==r&&"number"!==r&&"boolean"!==r&&s.push(new It(n+"["+a+"]",i[a],"string, number, or boolean expected, "+r+" found"));break;case"any":case"all":case"none":for(var l=1;l<i.length;l++)s=s.concat(t({key:n+"["+l+"]",value:i[l],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":r=Ri(i[1]),2!==i.length?s.push(new It(n,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"string"!==r&&s.push(new It(n+"[1]",i[1],"string expected, "+r+" found"));break;case"within":r=Ri(i[1]),2!==i.length?s.push(new It(n,i,'filter array for "'+i[0]+'" operator must have 2 elements')):"object"!==r&&s.push(new It(n+"[1]",i[1],"object expected, "+r+" found"))}return s}(t)}function An(t,e){var i=t.key,n=t.style,r=t.styleSpec,o=t.value,s=t.objectKey,a=r[e+"_"+t.layerType];if(!a)return[];var l=s.match(/^(.*)-transition$/);if("paint"===e&&l&&a[l[1]]&&a[l[1]].transition)return wn({key:i,value:o,valueSpec:r.transition,style:n,styleSpec:r});var c,u=t.valueSpec||a[s];if(!u)return[new It(i,o,'unknown property "'+s+'"')];if("string"===Ri(o)&&Li(u)&&!u.tokens&&(c=/^{([^}]+)}$/.exec(o)))return[new It(i,o,'"'+s+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(c[1])+" }`.")];var h=[];return"symbol"===t.layerType&&("text-field"===s&&n&&!n.glyphs&&h.push(new It(i,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===s&&ki(Ot(o))&&"identity"===Lt(o.type)&&h.push(new It(i,o,'"text-font" does not support identity functions'))),h.concat(wn({key:t.key,value:o,valueSpec:u,style:n,styleSpec:r,expressionContext:"property",propertyType:e,propertyKey:s}))}function fn(t){return An(t,"paint")}function gn(t){return An(t,"layout")}function mn(t){var e=[],i=t.value,n=t.key,r=t.style,o=t.styleSpec;i.type||i.ref||e.push(new It(n,i,'either "type" or "ref" is required'));var s,a=Lt(i.type),l=Lt(i.ref);if(i.id)for(var c=Lt(i.id),u=0;u<t.arrayIndex;u++){var h=r.layers[u];Lt(h.id)===c&&e.push(new It(n,i.id,'duplicate layer id "'+i.id+'", previously used at line '+h.id.__line__))}if("ref"in i)["type","source","source-layer","filter","layout"].forEach((function(t){t in i&&e.push(new It(n,i[t],'"'+t+'" is prohibited for ref layers'))})),r.layers.forEach((function(t){Lt(t.id)===l&&(s=t)})),s?s.ref?e.push(new It(n,i.ref,"ref cannot reference another ref layer")):a=Lt(s.type):e.push(new It(n,i.ref,'ref layer "'+l+'" not found'));else if("background"!==a)if(i.source){var d=r.sources&&r.sources[i.source],p=d&&Lt(d.type);d?"vector"===p&&"raster"===a?e.push(new It(n,i.source,'layer "'+i.id+'" requires a raster source')):"raster"===p&&"raster"!==a?e.push(new It(n,i.source,'layer "'+i.id+'" requires a vector source')):"vector"!==p||i["source-layer"]?"raster-dem"===p&&"hillshade"!==a?e.push(new It(n,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!i.paint||!i.paint["line-gradient"]||"geojson"===p&&d.lineMetrics||e.push(new It(n,i,'layer "'+i.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new It(n,i,'layer "'+i.id+'" must specify a "source-layer"')):e.push(new It(n,i.source,'source "'+i.source+'" not found'))}else e.push(new It(n,i,'missing required property "source"'));return e=e.concat(Xi({key:n,value:i,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return wn({key:n+".type",value:i.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:i,objectKey:"type"})},filter:pn,layout:function(t){return Xi({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return gn(Dt({layerType:a},t))}}})},paint:function(t){return Xi({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return fn(Dt({layerType:a},t))}}})}}}))}function yn(t){var e=t.value,i=t.key,n=Ri(e);return"string"!==n?[new It(i,e,"string expected, "+n+" found")]:[]}var vn={promoteId:function(t){var e=t.key,i=t.value;if("string"===Ri(i))return yn({key:e,value:i});var n=[];for(var r in i)n.push.apply(n,yn({key:e+"."+r,value:i[r]}));return n}};function _n(t){var e=t.value,i=t.key,n=t.styleSpec,r=t.style;if(!e.type)return[new It(i,e,'"type" is required')];var o,s=Lt(e.type);switch(s){case"vector":case"raster":case"raster-dem":return Xi({key:i,value:e,valueSpec:n["source_"+s.replace("-","_")],style:t.style,styleSpec:n,objectElementValidators:vn});case"geojson":if(o=Xi({key:i,value:e,valueSpec:n.source_geojson,style:r,styleSpec:n,objectElementValidators:vn}),e.cluster)for(var a in e.clusterProperties){var l=e.clusterProperties[a],c=l[0],u="string"==typeof c?[c,["accumulated"],["get",a]]:c;o.push.apply(o,en({key:i+"."+a+".map",value:l[1],expressionContext:"cluster-map"})),o.push.apply(o,en({key:i+"."+a+".reduce",value:u,expressionContext:"cluster-reduce"}))}return o;case"video":return Xi({key:i,value:e,valueSpec:n.source_video,style:r,styleSpec:n});case"image":return Xi({key:i,value:e,valueSpec:n.source_image,style:r,styleSpec:n});case"canvas":return[new It(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return nn({key:i+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:r,styleSpec:n})}}function bn(t){var e=t.value,i=t.styleSpec,n=i.light,r=t.style,o=[],s=Ri(e);if(void 0===e)return o;if("object"!==s)return o.concat([new It("light",e,"object expected, "+s+" found")]);for(var a in e){var l=a.match(/^(.*)-transition$/);o=o.concat(l&&n[l[1]]&&n[l[1]].transition?wn({key:a,value:e[a],valueSpec:i.transition,style:r,styleSpec:i}):n[a]?wn({key:a,value:e[a],valueSpec:n[a],style:r,styleSpec:i}):[new It(a,e[a],'unknown property "'+a+'"')])}return o}var xn={"*":function(){return[]},array:Yi,boolean:function(t){var e=t.value,i=t.key,n=Ri(e);return"boolean"!==n?[new It(i,e,"boolean expected, "+n+" found")]:[]},number:$i,color:function(t){var e=t.key,i=t.value,n=Ri(i);return"string"!==n?[new It(e,i,"color expected, "+n+" found")]:null===$t(i)?[new It(e,i,'color expected, "'+i+'" found')]:[]},constants:Pt,enum:nn,filter:pn,function:tn,layer:mn,object:Xi,source:_n,light:bn,string:yn,formatted:function(t){return 0===yn(t).length?[]:en(t)},resolvedImage:function(t){return 0===yn(t).length?[]:en(t)}};function wn(t){var e=t.value,i=t.valueSpec,n=t.styleSpec;return i.expression&&ki(Lt(e))?tn(t):i.expression&&Hi(Ot(e))?en(t):i.type&&xn[i.type]?xn[i.type](t):Xi(Dt({},t,{valueSpec:i.type?n[i.type]:i}))}function Cn(t){var e=t.value,i=t.key,n=yn(t);return n.length||(-1===e.indexOf("{fontstack}")&&n.push(new It(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&n.push(new It(i,e,'"glyphs" url must include a "{range}" token'))),n}function Bn(t,e){void 0===e&&(e=Mt);var i=[];return i=i.concat(wn({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:Cn,"*":function(){return[]}}})),t.constants&&(i=i.concat(Pt({key:"constants",value:t.constants,style:t,styleSpec:e}))),En(i)}function En(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Sn(t){return function(){for(var e=[],i=arguments.length;i--;)e[i]=arguments[i];return En(t.apply(this,e))}}Bn.source=Sn(_n),Bn.light=Sn(bn),Bn.layer=Sn(mn),Bn.filter=Sn(pn),Bn.paintProperty=Sn(fn),Bn.layoutProperty=Sn(gn);var Tn=Bn,Mn=Tn.light,In=Tn.paintProperty,Pn=Tn.layoutProperty;function Dn(t,e){var i=!1;if(e&&e.length)for(var n=0,r=e;n<r.length;n+=1)t.fire(new St(new Error(r[n].message))),i=!0;return i}var Ln=On;function On(t,e,i){var n=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var r=new Int32Array(this.arrayBuffer);t=r[0],this.d=(e=r[1])+2*(i=r[2]);for(var o=0;o<this.d*this.d;o++){var s=r[3+o],a=r[3+o+1];n.push(s===a?null:r.subarray(s,a))}var l=r[3+n.length+1];this.keys=r.subarray(r[3+n.length],l),this.bboxes=r.subarray(l),this.insert=this._insertReadonly}else{this.d=e+2*i;for(var c=0;c<this.d*this.d;c++)n.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;var u=i/e*t;this.min=-u,this.max=t+u}On.prototype.insert=function(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},On.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},On.prototype._insertCell=function(t,e,i,n,r,o){this.cells[r].push(o)},On.prototype.query=function(t,e,i,n,r){var o=this.min,s=this.max;if(t<=o&&e<=o&&s<=i&&s<=n&&!r)return Array.prototype.slice.call(this.keys);var a=[];return this._forEachCell(t,e,i,n,this._queryCell,a,{},r),a},On.prototype._queryCell=function(t,e,i,n,r,o,s,a){var l=this.cells[r];if(null!==l)for(var c=this.keys,u=this.bboxes,h=0;h<l.length;h++){var d=l[h];if(void 0===s[d]){var p=4*d;(a?a(u[p+0],u[p+1],u[p+2],u[p+3]):t<=u[p+2]&&e<=u[p+3]&&i>=u[p+0]&&n>=u[p+1])?(s[d]=!0,o.push(c[d])):s[d]=!1}}},On.prototype._forEachCell=function(t,e,i,n,r,o,s,a){for(var l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),u=this._convertToCellCoord(i),h=this._convertToCellCoord(n),d=l;d<=u;d++)for(var p=c;p<=h;p++){var A=this.d*p+d;if((!a||a(this._convertFromCellCoord(d),this._convertFromCellCoord(p),this._convertFromCellCoord(d+1),this._convertFromCellCoord(p+1)))&&r.call(this,t,e,i,n,A,o,s,a))return}},On.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},On.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},On.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,i=0,n=0;n<this.cells.length;n++)i+=this.cells[n].length;var r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;for(var o=e,s=0;s<t.length;s++){var a=t[s];r[3+s]=o,r.set(a,o),o+=a.length}return r[3+t.length]=o,r.set(this.keys,o),r[3+t.length+1]=o+=this.keys.length,r.set(this.bboxes,o),o+=this.bboxes.length,r.buffer};var Fn=s.ImageData,Rn=s.ImageBitmap,kn={};function zn(t,e,i){void 0===i&&(i={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),kn[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}for(var Un in zn("Object",Object),Ln.serialize=function(t,e){var i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}},Ln.deserialize=function(t){return new Ln(t.buffer)},zn("Grid",Ln),zn("Color",te),zn("Error",Error),zn("ResolvedImage",re),zn("StylePropertyFunction",Ki),zn("StyleExpression",Vi,{omit:["_evaluator"]}),zn("ZoomDependentExpression",Qi),zn("ZoomConstantExpression",Wi),zn("CompoundExpression",ve,{omit:["_evaluate"]}),Ei)Ei[Un]._classRegistryKey||zn("Expression_"+Un,Ei[Un]);function Nn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function Gn(t){return Rn&&t instanceof Rn}function Zn(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Nn(t)||Gn(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var i=t;return e&&e.push(i.buffer),i}if(t instanceof Fn)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var n=[],r=0,o=t;r<o.length;r+=1)n.push(Zn(o[r],e));return n}if("object"==typeof t){var s=t.constructor,a=s._classRegistryKey;if(!a)throw new Error("can't serialize object of unregistered class");var l=s.serialize?s.serialize(t,e):{};if(!s.serialize){for(var c in t)if(t.hasOwnProperty(c)&&!(kn[a].omit.indexOf(c)>=0)){var u=t[c];l[c]=kn[a].shallow.indexOf(c)>=0?u:Zn(u,e)}t instanceof Error&&(l.message=t.message)}if(l.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==a&&(l.$name=a),l}throw new Error("can't serialize object of type "+typeof t)}function jn(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Nn(t)||Gn(t)||ArrayBuffer.isView(t)||t instanceof Fn)return t;if(Array.isArray(t))return t.map(jn);if("object"==typeof t){var e=t.$name||"Object",i=kn[e].klass;if(!i)throw new Error("can't deserialize unregistered class "+e);if(i.deserialize)return i.deserialize(t);for(var n=Object.create(i.prototype),r=0,o=Object.keys(t);r<o.length;r+=1){var s=o[r];if("$name"!==s){var a=t[s];n[s]=kn[e].shallow.indexOf(s)>=0?a:jn(a)}}return n}throw new Error("can't deserialize object of type "+typeof t)}var Vn=function(){this.first=!0};Vn.prototype.update=function(t,e){var i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))};var Hn={"Latin-1 Supplement":function(t){return t>=128&&t<=255},Arabic:function(t){return t>=1536&&t<=1791},"Arabic Supplement":function(t){return t>=1872&&t<=1919},"Arabic Extended-A":function(t){return t>=2208&&t<=2303},"Hangul Jamo":function(t){return t>=4352&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return t>=5120&&t<=5759},Khmer:function(t){return t>=6016&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return t>=6320&&t<=6399},"General Punctuation":function(t){return t>=8192&&t<=8303},"Letterlike Symbols":function(t){return t>=8448&&t<=8527},"Number Forms":function(t){return t>=8528&&t<=8591},"Miscellaneous Technical":function(t){return t>=8960&&t<=9215},"Control Pictures":function(t){return t>=9216&&t<=9279},"Optical Character Recognition":function(t){return t>=9280&&t<=9311},"Enclosed Alphanumerics":function(t){return t>=9312&&t<=9471},"Geometric Shapes":function(t){return t>=9632&&t<=9727},"Miscellaneous Symbols":function(t){return t>=9728&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return t>=11008&&t<=11263},"CJK Radicals Supplement":function(t){return t>=11904&&t<=12031},"Kangxi Radicals":function(t){return t>=12032&&t<=12255},"Ideographic Description Characters":function(t){return t>=12272&&t<=12287},"CJK Symbols and Punctuation":function(t){return t>=12288&&t<=12351},Hiragana:function(t){return t>=12352&&t<=12447},Katakana:function(t){return t>=12448&&t<=12543},Bopomofo:function(t){return t>=12544&&t<=12591},"Hangul Compatibility Jamo":function(t){return t>=12592&&t<=12687},Kanbun:function(t){return t>=12688&&t<=12703},"Bopomofo Extended":function(t){return t>=12704&&t<=12735},"CJK Strokes":function(t){return t>=12736&&t<=12783},"Katakana Phonetic Extensions":function(t){return t>=12784&&t<=12799},"Enclosed CJK Letters and Months":function(t){return t>=12800&&t<=13055},"CJK Compatibility":function(t){return t>=13056&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return t>=13312&&t<=19903},"Yijing Hexagram Symbols":function(t){return t>=19904&&t<=19967},"CJK Unified Ideographs":function(t){return t>=19968&&t<=40959},"Yi Syllables":function(t){return t>=40960&&t<=42127},"Yi Radicals":function(t){return t>=42128&&t<=42191},"Hangul Jamo Extended-A":function(t){return t>=43360&&t<=43391},"Hangul Syllables":function(t){return t>=44032&&t<=55215},"Hangul Jamo Extended-B":function(t){return t>=55216&&t<=55295},"Private Use Area":function(t){return t>=57344&&t<=63743},"CJK Compatibility Ideographs":function(t){return t>=63744&&t<=64255},"Arabic Presentation Forms-A":function(t){return t>=64336&&t<=65023},"Vertical Forms":function(t){return t>=65040&&t<=65055},"CJK Compatibility Forms":function(t){return t>=65072&&t<=65103},"Small Form Variants":function(t){return t>=65104&&t<=65135},"Arabic Presentation Forms-B":function(t){return t>=65136&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return t>=65280&&t<=65519}};function Jn(t){for(var e=0,i=t;e<i.length;e+=1)if(Wn(i[e].charCodeAt(0)))return!0;return!1}function Wn(t){return!(746!==t&&747!==t&&(t<4352||!(Hn["Bopomofo Extended"](t)||Hn.Bopomofo(t)||Hn["CJK Compatibility Forms"](t)&&!(t>=65097&&t<=65103)||Hn["CJK Compatibility Ideographs"](t)||Hn["CJK Compatibility"](t)||Hn["CJK Radicals Supplement"](t)||Hn["CJK Strokes"](t)||!(!Hn["CJK Symbols and Punctuation"](t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||Hn["CJK Unified Ideographs Extension A"](t)||Hn["CJK Unified Ideographs"](t)||Hn["Enclosed CJK Letters and Months"](t)||Hn["Hangul Compatibility Jamo"](t)||Hn["Hangul Jamo Extended-A"](t)||Hn["Hangul Jamo Extended-B"](t)||Hn["Hangul Jamo"](t)||Hn["Hangul Syllables"](t)||Hn.Hiragana(t)||Hn["Ideographic Description Characters"](t)||Hn.Kanbun(t)||Hn["Kangxi Radicals"](t)||Hn["Katakana Phonetic Extensions"](t)||Hn.Katakana(t)&&12540!==t||!(!Hn["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Hn["Small Form Variants"](t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Hn["Unified Canadian Aboriginal Syllabics"](t)||Hn["Unified Canadian Aboriginal Syllabics Extended"](t)||Hn["Vertical Forms"](t)||Hn["Yijing Hexagram Symbols"](t)||Hn["Yi Syllables"](t)||Hn["Yi Radicals"](t))))}function Qn(t){return!(Wn(t)||function(t){return!!(Hn["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||Hn["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Hn["Letterlike Symbols"](t)||Hn["Number Forms"](t)||Hn["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Hn["Control Pictures"](t)&&9251!==t||Hn["Optical Character Recognition"](t)||Hn["Enclosed Alphanumerics"](t)||Hn["Geometric Shapes"](t)||Hn["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Hn["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Hn["CJK Symbols and Punctuation"](t)||Hn.Katakana(t)||Hn["Private Use Area"](t)||Hn["CJK Compatibility Forms"](t)||Hn["Small Form Variants"](t)||Hn["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}function qn(t){return t>=1424&&t<=2303||Hn["Arabic Presentation Forms-A"](t)||Hn["Arabic Presentation Forms-B"](t)}function Kn(t,e){return!(!e&&qn(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Hn.Khmer(t))}function Xn(t){for(var e=0,i=t;e<i.length;e+=1)if(qn(i[e].charCodeAt(0)))return!0;return!1}var Yn=null,$n="unavailable",tr=null,er=function(t){t&&"string"==typeof t&&t.indexOf("NetworkError")>-1&&($n="error"),Yn&&Yn(t)};function ir(){nr.fire(new Et("pluginStateChange",{pluginStatus:$n,pluginURL:tr}))}var nr=new Tt,rr=function(){return $n},or=function(){if("deferred"!==$n||!tr)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$n="loading",ir(),tr&&_t({url:tr},(function(t){t?er(t):($n="loaded",ir())}))},sr={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===$n||null!=sr.applyArabicShaping},isLoading:function(){return"loading"===$n},setState:function(t){$n=t.pluginStatus,tr=t.pluginURL},isParsed:function(){return null!=sr.applyArabicShaping&&null!=sr.processBidirectionalText&&null!=sr.processStyledBidirectionalText},getPluginURL:function(){return tr}},ar=function(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Vn,this.transition={})};ar.prototype.isSupportedScript=function(t){return function(t,e){for(var i=0,n=t;i<n.length;i+=1)if(!Kn(n[i].charCodeAt(0),e))return!1;return!0}(t,sr.isLoaded())},ar.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ar.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}};var lr=function(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(ki(t))return new Ki(t,e);if(Hi(t)){var i=qi(t,e);if("error"===i.result)throw new Error(i.value.map((function(t){return t.key+": "+t.message})).join(", "));return i.value}var n=t;return"string"==typeof t&&"color"===e.type&&(n=te.parse(t)),{kind:"constant",evaluate:function(){return n}}}(void 0===e?t.specification.default:e,t.specification)};lr.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},lr.prototype.possiblyEvaluate=function(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)};var cr=function(t){this.property=t,this.value=new lr(t,void 0)};cr.prototype.transitioned=function(t,e){return new hr(this.property,this.value,e,d({},t.transition,this.transition),t.now)},cr.prototype.untransitioned=function(){return new hr(this.property,this.value,null,{},0)};var ur=function(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)};ur.prototype.getValue=function(t){return b(this._values[t].value.value)},ur.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new cr(this._values[t].property)),this._values[t].value=new lr(this._values[t].property,null===e?void 0:b(e))},ur.prototype.getTransition=function(t){return b(this._values[t].transition)},ur.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new cr(this._values[t].property)),this._values[t].transition=b(e)||void 0},ur.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e],r=this.getValue(n);void 0!==r&&(t[n]=r);var o=this.getTransition(n);void 0!==o&&(t[n+"-transition"]=o)}return t},ur.prototype.transitioned=function(t,e){for(var i=new dr(this._properties),n=0,r=Object.keys(this._values);n<r.length;n+=1){var o=r[n];i._values[o]=this._values[o].transitioned(t,e._values[o])}return i},ur.prototype.untransitioned=function(){for(var t=new dr(this._properties),e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e];t._values[n]=this._values[n].untransitioned()}return t};var hr=function(t,e,i,n,r){this.property=t,this.value=e,this.begin=r+n.delay||0,this.end=this.begin+n.duration||0,t.specification.transition&&(n.delay||n.duration)&&(this.prior=i)};hr.prototype.possiblyEvaluate=function(t,e,i){var n=t.now||0,r=this.value.possiblyEvaluate(t,e,i),o=this.prior;if(o){if(n>this.end)return this.prior=null,r;if(this.value.isDataDriven())return this.prior=null,r;if(n<this.begin)return o.possiblyEvaluate(t,e,i);var s=(n-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,i),r,function(t){if(t<=0)return 0;if(t>=1)return 1;var e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}(s))}return r};var dr=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};dr.prototype.possiblyEvaluate=function(t,e,i){for(var n=new fr(this._properties),r=0,o=Object.keys(this._values);r<o.length;r+=1){var s=o[r];n._values[s]=this._values[s].possiblyEvaluate(t,e,i)}return n},dr.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1};var pr=function(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)};pr.prototype.getValue=function(t){return b(this._values[t].value)},pr.prototype.setValue=function(t,e){this._values[t]=new lr(this._values[t].property,null===e?void 0:b(e))},pr.prototype.serialize=function(){for(var t={},e=0,i=Object.keys(this._values);e<i.length;e+=1){var n=i[e],r=this.getValue(n);void 0!==r&&(t[n]=r)}return t},pr.prototype.possiblyEvaluate=function(t,e,i){for(var n=new fr(this._properties),r=0,o=Object.keys(this._values);r<o.length;r+=1){var s=o[r];n._values[s]=this._values[s].possiblyEvaluate(t,e,i)}return n};var Ar=function(t,e,i){this.property=t,this.value=e,this.parameters=i};Ar.prototype.isConstant=function(){return"constant"===this.value.kind},Ar.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},Ar.prototype.evaluate=function(t,e,i,n){return this.property.evaluate(this.value,this.parameters,t,e,i,n)};var fr=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};fr.prototype.get=function(t){return this._values[t]};var gr=function(t){this.specification=t};gr.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},gr.prototype.interpolate=function(t,e,i){var n=He[this.specification.type];return n?n(t,e,i):t};var mr=function(t,e){this.specification=t,this.overrides=e};mr.prototype.possiblyEvaluate=function(t,e,i,n){return new Ar(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,n)}:t.expression,e)},mr.prototype.interpolate=function(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new Ar(this,{kind:"constant",value:void 0},t.parameters);var n=He[this.specification.type];return n?new Ar(this,{kind:"constant",value:n(t.value.value,e.value.value,i)},t.parameters):t},mr.prototype.evaluate=function(t,e,i,n,r,o){return"constant"===t.kind?t.value:t.evaluate(e,i,n,r,o)};var yr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(t,e,i,n){if(void 0===t.value)return new Ar(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},i,n),o="resolvedImage"===t.property.specification.type&&"string"!=typeof r?r.name:r,s=this._calculate(o,o,o,e);return new Ar(this,{kind:"constant",value:s},e)}if("camera"===t.expression.kind){var a=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new Ar(this,{kind:"constant",value:a},e)}return new Ar(this,t.expression,e)},e.prototype.evaluate=function(t,e,i,n,r,o){if("source"===t.kind){var s=t.evaluate(e,i,n,r,o);return this._calculate(s,s,s,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,n),t.evaluate({zoom:Math.floor(e.zoom)},i,n),t.evaluate({zoom:Math.floor(e.zoom)+1},i,n),e):t.value},e.prototype._calculate=function(t,e,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},e.prototype.interpolate=function(t){return t},e}(mr),vr=function(t){this.specification=t};vr.prototype.possiblyEvaluate=function(t,e,i,n){if(void 0!==t.value){if("constant"===t.expression.kind){var r=t.expression.evaluate(e,null,{},i,n);return this._calculate(r,r,r,e)}return this._calculate(t.expression.evaluate(new ar(Math.floor(e.zoom-1),e)),t.expression.evaluate(new ar(Math.floor(e.zoom),e)),t.expression.evaluate(new ar(Math.floor(e.zoom+1),e)),e)}},vr.prototype._calculate=function(t,e,i,n){return n.zoom>n.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}},vr.prototype.interpolate=function(t){return t};var _r=function(t){this.specification=t};_r.prototype.possiblyEvaluate=function(t,e,i,n){return!!t.expression.evaluate(e,null,{},i,n)},_r.prototype.interpolate=function(){return!1};var br=function(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){var i=t[e];i.specification.overridable&&this.overridableProperties.push(e);var n=this.defaultPropertyValues[e]=new lr(i,void 0),r=this.defaultTransitionablePropertyValues[e]=new cr(i);this.defaultTransitioningPropertyValues[e]=r.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=n.possiblyEvaluate({})}};zn("DataDrivenProperty",mr),zn("DataConstantProperty",gr),zn("CrossFadedDataDrivenProperty",yr),zn("CrossFadedProperty",vr),zn("ColorRampProperty",_r);var xr=function(t){function e(e,i){if(t.call(this),this.id=e.id,this.type=e.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),i.layout&&(this._unevaluatedLayout=new pr(i.layout)),i.paint)){for(var n in this._transitionablePaint=new ur(i.paint),e.paint)this.setPaintProperty(n,e.paint[n],{validate:!1});for(var r in e.layout)this.setLayoutProperty(r,e.layout[r],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new fr(i.paint)}}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},e.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},e.prototype.setLayoutProperty=function(t,e,i){void 0===i&&(i={}),null!=e&&this._validate(Pn,"layers."+this.id+".layout."+t,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},e.prototype.getPaintProperty=function(t){return y(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)},e.prototype.setPaintProperty=function(t,e,i){if(void 0===i&&(i={}),null!=e&&this._validate(In,"layers."+this.id+".paint."+t,t,e,i))return!1;if(y(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;var n=this._transitionablePaint._values[t],r="cross-faded-data-driven"===n.property.specification["property-type"],o=n.value.isDataDriven(),s=n.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);var a=this._transitionablePaint._values[t].value;return a.isDataDriven()||o||r||this._handleOverridablePaintPropertyUpdate(t,s,a)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){},e.prototype._handleOverridablePaintPropertyUpdate=function(t,e,i){return!1},e.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},e.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},e.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},e.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},e.prototype.serialize=function(){var t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),_(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},e.prototype._validate=function(t,e,i,n,r){return void 0===r&&(r={}),(!r||!1!==r.validate)&&Dn(this,t.call(Tn,{key:e,layerType:this.type,objectKey:i,value:n,styleSpec:Mt,style:{glyphs:!0,sprite:!0}}))},e.prototype.is3D=function(){return!1},e.prototype.isTileClipped=function(){return!1},e.prototype.hasOffscreenPass=function(){return!1},e.prototype.resize=function(){},e.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof Ar&&Li(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},e}(Tt),wr={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},Cr=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Br=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Er(t,e){void 0===e&&(e=1);var i=0,n=0;return{members:t.map((function(t){var r=wr[t.type].BYTES_PER_ELEMENT,o=i=Sr(i,Math.max(e,r)),s=t.components||1;return n=Math.max(n,r),i+=r*s,{name:t.name,type:t.type,components:s,offset:o}})),size:Sr(i,Math.max(n,e)),alignment:e}}function Sr(t,e){return Math.ceil(t/e)*e}Br.serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},Br.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},Br.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Br.prototype.clear=function(){this.length=0},Br.prototype.resize=function(t){this.reserve(t),this.length=t},Br.prototype.reserve=function(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}},Br.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var Tr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var n=2*t;return this.int16[n+0]=e,this.int16[n+1]=i,t},e}(Br);Tr.prototype.bytesPerElement=4,zn("StructArrayLayout2i4",Tr);var Mr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)},e.prototype.emplace=function(t,e,i,n,r){var o=4*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=n,this.int16[o+3]=r,t},e}(Br);Mr.prototype.bytesPerElement=8,zn("StructArrayLayout4i8",Mr);var Ir=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o)},e.prototype.emplace=function(t,e,i,n,r,o,s){var a=6*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+5]=s,t},e}(Br);Ir.prototype.bytesPerElement=12,zn("StructArrayLayout2i4i12",Ir);var Pr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o)},e.prototype.emplace=function(t,e,i,n,r,o,s){var a=4*t,l=8*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.uint8[l+4]=n,this.uint8[l+5]=r,this.uint8[l+6]=o,this.uint8[l+7]=s,t},e}(Br);Pr.prototype.bytesPerElement=8,zn("StructArrayLayout2i4ub8",Pr);var Dr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var n=2*t;return this.float32[n+0]=e,this.float32[n+1]=i,t},e}(Br);Dr.prototype.bytesPerElement=8,zn("StructArrayLayout2f8",Dr);var Lr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r,o,s,a,l,c){var u=this.length;return this.resize(u+1),this.emplace(u,t,e,i,n,r,o,s,a,l,c)},e.prototype.emplace=function(t,e,i,n,r,o,s,a,l,c,u){var h=10*t;return this.uint16[h+0]=e,this.uint16[h+1]=i,this.uint16[h+2]=n,this.uint16[h+3]=r,this.uint16[h+4]=o,this.uint16[h+5]=s,this.uint16[h+6]=a,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,t},e}(Br);Lr.prototype.bytesPerElement=20,zn("StructArrayLayout10ui20",Lr);var Or=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r,o,s,a,l,c,u,h){var d=this.length;return this.resize(d+1),this.emplace(d,t,e,i,n,r,o,s,a,l,c,u,h)},e.prototype.emplace=function(t,e,i,n,r,o,s,a,l,c,u,h,d){var p=12*t;return this.int16[p+0]=e,this.int16[p+1]=i,this.int16[p+2]=n,this.int16[p+3]=r,this.uint16[p+4]=o,this.uint16[p+5]=s,this.uint16[p+6]=a,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=u,this.int16[p+10]=h,this.int16[p+11]=d,t},e}(Br);Or.prototype.bytesPerElement=24,zn("StructArrayLayout4i4ui4i24",Or);var Fr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)},e.prototype.emplace=function(t,e,i,n){var r=3*t;return this.float32[r+0]=e,this.float32[r+1]=i,this.float32[r+2]=n,t},e}(Br);Fr.prototype.bytesPerElement=12,zn("StructArrayLayout3f12",Fr);var Rr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint32[1*t+0]=e,t},e}(Br);Rr.prototype.bytesPerElement=4,zn("StructArrayLayout1ul4",Rr);var kr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r,o,s,a,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,i,n,r,o,s,a,l)},e.prototype.emplace=function(t,e,i,n,r,o,s,a,l,c){var u=10*t,h=5*t;return this.int16[u+0]=e,this.int16[u+1]=i,this.int16[u+2]=n,this.int16[u+3]=r,this.int16[u+4]=o,this.int16[u+5]=s,this.uint32[h+3]=a,this.uint16[u+8]=l,this.uint16[u+9]=c,t},e}(Br);kr.prototype.bytesPerElement=20,zn("StructArrayLayout6i1ul2ui20",kr);var zr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r,o){var s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,n,r,o)},e.prototype.emplace=function(t,e,i,n,r,o,s){var a=6*t;return this.int16[a+0]=e,this.int16[a+1]=i,this.int16[a+2]=n,this.int16[a+3]=r,this.int16[a+4]=o,this.int16[a+5]=s,t},e}(Br);zr.prototype.bytesPerElement=12,zn("StructArrayLayout2i2i2i12",zr);var Ur=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,i,n,r)},e.prototype.emplace=function(t,e,i,n,r,o){var s=4*t,a=8*t;return this.float32[s+0]=e,this.float32[s+1]=i,this.float32[s+2]=n,this.int16[a+6]=r,this.int16[a+7]=o,t},e}(Br);Ur.prototype.bytesPerElement=16,zn("StructArrayLayout2f1f2i16",Ur);var Nr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)},e.prototype.emplace=function(t,e,i,n,r){var o=12*t,s=3*t;return this.uint8[o+0]=e,this.uint8[o+1]=i,this.float32[s+1]=n,this.float32[s+2]=r,t},e}(Br);Nr.prototype.bytesPerElement=12,zn("StructArrayLayout2ub2f12",Nr);var Gr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)},e.prototype.emplace=function(t,e,i,n){var r=3*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,this.uint16[r+2]=n,t},e}(Br);Gr.prototype.bytesPerElement=6,zn("StructArrayLayout3ui6",Gr);var Zr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f,g){var m=this.length;return this.resize(m+1),this.emplace(m,t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f,g)},e.prototype.emplace=function(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f,g,m){var y=24*t,v=12*t,_=48*t;return this.int16[y+0]=e,this.int16[y+1]=i,this.uint16[y+2]=n,this.uint16[y+3]=r,this.uint32[v+2]=o,this.uint32[v+3]=s,this.uint32[v+4]=a,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=u,this.float32[v+7]=h,this.float32[v+8]=d,this.uint8[_+36]=p,this.uint8[_+37]=A,this.uint8[_+38]=f,this.uint32[v+10]=g,this.int16[y+22]=m,t},e}(Br);Zr.prototype.bytesPerElement=48,zn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Zr);var jr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f,g,m,y,v,_,b,x,w,C,B,E,S){var T=this.length;return this.resize(T+1),this.emplace(T,t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f,g,m,y,v,_,b,x,w,C,B,E,S)},e.prototype.emplace=function(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f,g,m,y,v,_,b,x,w,C,B,E,S,T){var M=34*t,I=17*t;return this.int16[M+0]=e,this.int16[M+1]=i,this.int16[M+2]=n,this.int16[M+3]=r,this.int16[M+4]=o,this.int16[M+5]=s,this.int16[M+6]=a,this.int16[M+7]=l,this.uint16[M+8]=c,this.uint16[M+9]=u,this.uint16[M+10]=h,this.uint16[M+11]=d,this.uint16[M+12]=p,this.uint16[M+13]=A,this.uint16[M+14]=f,this.uint16[M+15]=g,this.uint16[M+16]=m,this.uint16[M+17]=y,this.uint16[M+18]=v,this.uint16[M+19]=_,this.uint16[M+20]=b,this.uint16[M+21]=x,this.uint16[M+22]=w,this.uint32[I+12]=C,this.float32[I+13]=B,this.float32[I+14]=E,this.float32[I+15]=S,this.float32[I+16]=T,t},e}(Br);jr.prototype.bytesPerElement=68,zn("StructArrayLayout8i15ui1ul4f68",jr);var Vr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.float32[1*t+0]=e,t},e}(Br);Vr.prototype.bytesPerElement=4,zn("StructArrayLayout1f4",Vr);var Hr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)},e.prototype.emplace=function(t,e,i,n){var r=3*t;return this.int16[r+0]=e,this.int16[r+1]=i,this.int16[r+2]=n,t},e}(Br);Hr.prototype.bytesPerElement=6,zn("StructArrayLayout3i6",Hr);var Jr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,i)},e.prototype.emplace=function(t,e,i,n){var r=4*t;return this.uint32[2*t+0]=e,this.uint16[r+2]=i,this.uint16[r+3]=n,t},e}(Br);Jr.prototype.bytesPerElement=8,zn("StructArrayLayout1ul2ui8",Jr);var Wr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e){var i=this.length;return this.resize(i+1),this.emplace(i,t,e)},e.prototype.emplace=function(t,e,i){var n=2*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,t},e}(Br);Wr.prototype.bytesPerElement=4,zn("StructArrayLayout2ui4",Wr);var Qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},e.prototype.emplace=function(t,e){return this.uint16[1*t+0]=e,t},e}(Br);Qr.prototype.bytesPerElement=2,zn("StructArrayLayout1ui2",Qr);var qr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},e.prototype.emplaceBack=function(t,e,i,n){var r=this.length;return this.resize(r+1),this.emplace(r,t,e,i,n)},e.prototype.emplace=function(t,e,i,n,r){var o=4*t;return this.float32[o+0]=e,this.float32[o+1]=i,this.float32[o+2]=n,this.float32[o+3]=r,t},e}(Br);qr.prototype.bytesPerElement=16,zn("StructArrayLayout4f16",qr);var Kr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return i.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},i.x1.get=function(){return this._structArray.int16[this._pos2+2]},i.y1.get=function(){return this._structArray.int16[this._pos2+3]},i.x2.get=function(){return this._structArray.int16[this._pos2+4]},i.y2.get=function(){return this._structArray.int16[this._pos2+5]},i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.anchorPoint.get=function(){return new r(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,i),e}(Cr);Kr.prototype.size=20;var Xr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Kr(this,t)},e}(kr);zn("CollisionBoxArray",Xr);var Yr=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},i.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},i.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},i.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},i.segment.get=function(){return this._structArray.uint16[this._pos2+10]},i.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},i.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},i.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},i.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},i.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},i.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},i.placedOrientation.set=function(t){this._structArray.uint8[this._pos1+37]=t},i.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},i.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},i.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,i),e}(Cr);Yr.prototype.size=48;var $r=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new Yr(this,t)},e}(Zr);zn("PlacedSymbolArray",$r);var to=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return i.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},i.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},i.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},i.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},i.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},i.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},i.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},i.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},i.key.get=function(){return this._structArray.uint16[this._pos2+8]},i.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},i.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},i.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},i.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},i.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},i.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},i.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},i.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},i.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},i.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},i.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},i.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},i.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},i.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},i.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},i.crossTileID.set=function(t){this._structArray.uint32[this._pos4+12]=t},i.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},i.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},i.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},i.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(e.prototype,i),e}(Cr);to.prototype.size=68;var eo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new to(this,t)},e}(jr);zn("SymbolInstanceArray",eo);var io=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getoffsetX=function(t){return this.float32[1*t+0]},e}(Vr);zn("GlyphOffsetArray",io);var no=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getx=function(t){return this.int16[3*t+0]},e.prototype.gety=function(t){return this.int16[3*t+1]},e.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},e}(Hr);zn("SymbolLineVertexArray",no);var ro=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return i.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},i.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},i.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(e.prototype,i),e}(Cr);ro.prototype.size=8;var oo=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.get=function(t){return new ro(this,t)},e}(Jr);zn("FeatureIndexArray",oo);var so=Er([{name:"a_pos",components:2,type:"Int16"}],4).members,ao=function(t){void 0===t&&(t=[]),this.segments=t};function lo(t,e){return 256*(t=u(Math.floor(t),0,255))+u(Math.floor(e),0,255)}ao.prototype.prepareSegment=function(t,e,i,n){var r=this.segments[this.segments.length-1];return t>ao.MAX_VERTEX_ARRAY_LENGTH&&w("Max vertices per segment is "+ao.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!r||r.vertexLength+t>ao.MAX_VERTEX_ARRAY_LENGTH||r.sortKey!==n)&&(r={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==n&&(r.sortKey=n),this.segments.push(r)),r},ao.prototype.get=function(){return this.segments},ao.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var i=e[t];for(var n in i.vaos)i.vaos[n].destroy()}},ao.simpleSegment=function(t,e,i,n){return new ao([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:n,vaos:{},sortKey:0}])},ao.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,zn("SegmentVector",ao);var co=Er([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),uo=e((function(t){t.exports=function(t,e){var i,n,r,o,s,a,l,c;for(n=t.length-(i=3&t.length),r=e,s=3432918353,a=461845907,c=0;c<n;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,r=27492+(65535&(o=5*(65535&(r=(r^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<13|r>>>19))+((5*(r>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:r^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*a+(((l>>>16)*a&65535)<<16)&4294967295}return r^=t.length,r=2246822507*(65535&(r^=r>>>16))+((2246822507*(r>>>16)&65535)<<16)&4294967295,r=3266489909*(65535&(r^=r>>>13))+((3266489909*(r>>>16)&65535)<<16)&4294967295,(r^=r>>>16)>>>0}})),ho=e((function(t){t.exports=function(t,e){for(var i,n=t.length,r=e^n,o=0;n>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(i>>>16)&65535)<<16),r=1540483477*(65535&r)+((1540483477*(r>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),n-=4,++o;switch(n){case 3:r^=(255&t.charCodeAt(o+2))<<16;case 2:r^=(255&t.charCodeAt(o+1))<<8;case 1:r=1540483477*(65535&(r^=255&t.charCodeAt(o)))+((1540483477*(r>>>16)&65535)<<16)}return r=1540483477*(65535&(r^=r>>>13))+((1540483477*(r>>>16)&65535)<<16),(r^=r>>>15)>>>0}})),po=uo,Ao=ho;po.murmur3=uo,po.murmur2=Ao;var fo=function(){this.ids=[],this.positions=[],this.indexed=!1};fo.prototype.add=function(t,e,i,n){this.ids.push(mo(t)),this.positions.push(e,i,n)},fo.prototype.getPositions=function(t){for(var e=mo(t),i=0,n=this.ids.length-1;i<n;){var r=i+n>>1;this.ids[r]>=e?n=r:i=r+1}for(var o=[];this.ids[i]===e;)o.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return o},fo.serialize=function(t,e){var i=new Float64Array(t.ids),n=new Uint32Array(t.positions);return function t(e,i,n,r){for(;n<r;){for(var o=e[n+r>>1],s=n-1,a=r+1;;){do{s++}while(e[s]<o);do{a--}while(e[a]>o);if(s>=a)break;yo(e,s,a),yo(i,3*s,3*a),yo(i,3*s+1,3*a+1),yo(i,3*s+2,3*a+2)}a-n<r-a?(t(e,i,n,a),n=a+1):(t(e,i,a+1,r),r=a)}}(i,n,0,i.length-1),e&&e.push(i.buffer,n.buffer),{ids:i,positions:n}},fo.deserialize=function(t){var e=new fo;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var go=Math.pow(2,53)-1;function mo(t){var e=+t;return!isNaN(e)&&e<=go?e:po(String(t))}function yo(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}zn("FeaturePositionMap",fo);var vo=function(t,e){this.gl=t.gl,this.location=e},_o=function(t){function e(e,i){t.call(this,e,i),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},e}(vo),bo=function(t){function e(e,i){t.call(this,e,i),this.current=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},e}(vo),xo=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},e}(vo),wo=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},e}(vo),Co=function(t){function e(e,i){t.call(this,e,i),this.current=[0,0,0,0]}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},e}(vo),Bo=function(t){function e(e,i){t.call(this,e,i),this.current=te.transparent}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},e}(vo),Eo=new Float32Array(16),So=function(t){function e(e,i){t.call(this,e,i),this.current=Eo}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},e}(vo);function To(t){return[lo(255*t.r,255*t.g),lo(255*t.b,255*t.a)]}var Mo=function(t,e,i){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=i};Mo.prototype.setUniform=function(t,e,i){t.set(i.constantOr(this.value))},Mo.prototype.getBinding=function(t,e,i){return"color"===this.type?new Bo(t,e):new bo(t,e)};var Io=function(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};Io.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},Io.prototype.setUniform=function(t,e,i,n){var r="u_pattern_to"===n?this.patternTo:"u_pattern_from"===n?this.patternFrom:"u_pixel_ratio_to"===n?this.pixelRatioTo:"u_pixel_ratio_from"===n?this.pixelRatioFrom:null;r&&t.set(r)},Io.prototype.getBinding=function(t,e,i){return"u_pattern"===i.substr(0,9)?new Co(t,e):new bo(t,e)};var Po=function(t,e,i,n){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===i?2:1,offset:0}})),this.paintVertexArray=new n};Po.prototype.populatePaintArray=function(t,e,i,n,r){var o=this.paintVertexArray.length,s=this.expression.evaluate(new ar(0),e,{},n,[],r);this.paintVertexArray.resize(t),this._setPaintValue(o,t,s)},Po.prototype.updatePaintArray=function(t,e,i,n){var r=this.expression.evaluate({zoom:0},i,n);this._setPaintValue(t,e,r)},Po.prototype._setPaintValue=function(t,e,i){if("color"===this.type)for(var n=To(i),r=t;r<e;r++)this.paintVertexArray.emplace(r,n[0],n[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}},Po.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Po.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var Do=function(t,e,i,n,r,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=i,this.useIntegerZoom=n,this.zoom=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===i?4:2,offset:0}})),this.paintVertexArray=new o};Do.prototype.populatePaintArray=function(t,e,i,n,r){var o=this.expression.evaluate(new ar(this.zoom),e,{},n,[],r),s=this.expression.evaluate(new ar(this.zoom+1),e,{},n,[],r),a=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(a,t,o,s)},Do.prototype.updatePaintArray=function(t,e,i,n){var r=this.expression.evaluate({zoom:this.zoom},i,n),o=this.expression.evaluate({zoom:this.zoom+1},i,n);this._setPaintValue(t,e,r,o)},Do.prototype._setPaintValue=function(t,e,i,n){if("color"===this.type)for(var r=To(i),o=To(n),s=t;s<e;s++)this.paintVertexArray.emplace(s,r[0],r[1],o[0],o[1]);else{for(var a=t;a<e;a++)this.paintVertexArray.emplace(a,i,n);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(n))}},Do.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Do.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Do.prototype.setUniform=function(t,e){var i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,n=u(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(n)},Do.prototype.getBinding=function(t,e,i){return new bo(t,e)};var Lo=function(t,e,i,n,r,o){this.expression=t,this.type=e,this.useIntegerZoom=i,this.zoom=n,this.layerId=o,this.zoomInPaintVertexArray=new r,this.zoomOutPaintVertexArray=new r};Lo.prototype.populatePaintArray=function(t,e,i){var n=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(n,t,e.patterns&&e.patterns[this.layerId],i)},Lo.prototype.updatePaintArray=function(t,e,i,n,r){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],r)},Lo.prototype._setPaintValues=function(t,e,i,n){if(n&&i){var r=n[i.min],o=n[i.mid],s=n[i.max];if(r&&o&&s)for(var a=t;a<e;a++)this.zoomInPaintVertexArray.emplace(a,o.tl[0],o.tl[1],o.br[0],o.br[1],r.tl[0],r.tl[1],r.br[0],r.br[1],o.pixelRatio,r.pixelRatio),this.zoomOutPaintVertexArray.emplace(a,o.tl[0],o.tl[1],o.br[0],o.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],o.pixelRatio,s.pixelRatio)}},Lo.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,co.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,co.members,this.expression.isStateDependent))},Lo.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Oo=function(t,e,i){this.binders={},this._buffers=[];var n=[];for(var r in t.paint._values)if(i(r)){var o=t.paint.get(r);if(o instanceof Ar&&Li(o.property.specification)){var s=Ro(r,t.type),a=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,u=o.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===a.kind)this.binders[r]=h?new Io(a.value,s):new Mo(a.value,s,l),n.push("/u_"+r);else if("source"===a.kind||h){var d=ko(r,l,"source");this.binders[r]=h?new Lo(a,l,c,e,d,t.id):new Po(a,s,l,d),n.push("/a_"+r)}else{var p=ko(r,l,"composite");this.binders[r]=new Do(a,s,l,c,e,p),n.push("/z_"+r)}}}this.cacheKey=n.sort().join("")};Oo.prototype.getMaxValue=function(t){var e=this.binders[t];return e instanceof Po||e instanceof Do?e.maxValue:0},Oo.prototype.populatePaintArrays=function(t,e,i,n,r){for(var o in this.binders){var s=this.binders[o];(s instanceof Po||s instanceof Do||s instanceof Lo)&&s.populatePaintArray(t,e,i,n,r)}},Oo.prototype.setConstantPatternPositions=function(t,e){for(var i in this.binders){var n=this.binders[i];n instanceof Io&&n.setConstantPatternPositions(t,e)}},Oo.prototype.updatePaintArrays=function(t,e,i,n,r){var o=!1;for(var s in t)for(var a=0,l=e.getPositions(s);a<l.length;a+=1){var c=l[a],u=i.feature(c.index);for(var h in this.binders){var d=this.binders[h];if((d instanceof Po||d instanceof Do||d instanceof Lo)&&!0===d.expression.isStateDependent){var p=n.paint.get(h);d.expression=p.value,d.updatePaintArray(c.start,c.end,u,t[s],r),o=!0}}}return o},Oo.prototype.defines=function(){var t=[];for(var e in this.binders){var i=this.binders[e];(i instanceof Mo||i instanceof Io)&&t.push.apply(t,i.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return t},Oo.prototype.getBinderAttributes=function(){var t=[];for(var e in this.binders){var i=this.binders[e];if(i instanceof Po||i instanceof Do)for(var n=0;n<i.paintVertexAttributes.length;n++)t.push(i.paintVertexAttributes[n].name);else if(i instanceof Lo)for(var r=0;r<co.members.length;r++)t.push(co.members[r].name)}return t},Oo.prototype.getBinderUniforms=function(){var t=[];for(var e in this.binders){var i=this.binders[e];if(i instanceof Mo||i instanceof Io||i instanceof Do)for(var n=0,r=i.uniformNames;n<r.length;n+=1)t.push(r[n])}return t},Oo.prototype.getPaintVertexBuffers=function(){return this._buffers},Oo.prototype.getUniforms=function(t,e){var i=[];for(var n in this.binders){var r=this.binders[n];if(r instanceof Mo||r instanceof Io||r instanceof Do)for(var o=0,s=r.uniformNames;o<s.length;o+=1){var a=s[o];if(e[a]){var l=r.getBinding(t,e[a],a);i.push({name:a,property:n,binding:l})}}}return i},Oo.prototype.setUniforms=function(t,e,i,n){for(var r=0,o=e;r<o.length;r+=1){var s=o[r],a=s.name,l=s.property;this.binders[l].setUniform(s.binding,n,i.get(l),a)}},Oo.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var i=this.binders[e];if(t&&i instanceof Lo){var n=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;n&&this._buffers.push(n)}else(i instanceof Po||i instanceof Do)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}},Oo.prototype.upload=function(t){for(var e in this.binders){var i=this.binders[e];(i instanceof Po||i instanceof Do||i instanceof Lo)&&i.upload(t)}this.updatePaintBuffers()},Oo.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Po||e instanceof Do||e instanceof Lo)&&e.destroy()}};var Fo=function(t,e,i){void 0===i&&(i=function(){return!0}),this.programConfigurations={};for(var n=0,r=t;n<r.length;n+=1){var o=r[n];this.programConfigurations[o.id]=new Oo(o,e,i)}this.needsUpload=!1,this._featureMap=new fo,this._bufferOffset=0};function Ro(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(e+"-","").replace(/-/g,"_")]}function ko(t,e,i){var n={color:{source:Dr,composite:qr},number:{source:Vr,composite:Dr}},r=function(t){return{"line-pattern":{source:Lr,composite:Lr},"fill-pattern":{source:Lr,composite:Lr},"fill-extrusion-pattern":{source:Lr,composite:Lr}}[t]}(t);return r&&r[i]||n[e][i]}Fo.prototype.populatePaintArrays=function(t,e,i,n,r,o){for(var s in this.programConfigurations)this.programConfigurations[s].populatePaintArrays(t,e,n,r,o);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Fo.prototype.updatePaintArrays=function(t,e,i,n){for(var r=0,o=i;r<o.length;r+=1){var s=o[r];this.needsUpload=this.programConfigurations[s.id].updatePaintArrays(t,this._featureMap,e,s,n)||this.needsUpload}},Fo.prototype.get=function(t){return this.programConfigurations[t]},Fo.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Fo.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},zn("ConstantBinder",Mo),zn("CrossFadedConstantBinder",Io),zn("SourceExpressionBinder",Po),zn("CrossFadedCompositeBinder",Lo),zn("CompositeExpressionBinder",Do),zn("ProgramConfiguration",Oo,{omit:["_buffers"]}),zn("ProgramConfigurationSet",Fo);var zo=Math.pow(2,14)-1,Uo=-zo-1;function No(t){for(var e=8192/t.extent,i=t.loadGeometry(),n=0;n<i.length;n++)for(var r=i[n],o=0;o<r.length;o++){var s=r[o],a=Math.round(s.x*e),l=Math.round(s.y*e);s.x=u(a,Uo,zo),s.y=u(l,Uo,zo),(a<s.x||a>s.x+1||l<s.y||l>s.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return i}function Go(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?No(t):[]}}function Zo(t,e,i,n,r){t.emplaceBack(2*e+(n+1)/2,2*i+(r+1)/2)}var jo=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Tr,this.indexArray=new Gr,this.segments=new ao,this.programConfigurations=new Fo(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Vo(t,e){for(var i=0;i<t.length;i++)if($o(e,t[i]))return!0;for(var n=0;n<e.length;n++)if($o(t,e[n]))return!0;return!!Qo(t,e)}function Ho(t,e,i){return!!$o(t,e)||!!Ko(e,t,i)}function Jo(t,e){if(1===t.length)return Yo(e,t[0]);for(var i=0;i<e.length;i++)for(var n=e[i],r=0;r<n.length;r++)if($o(t,n[r]))return!0;for(var o=0;o<t.length;o++)if(Yo(e,t[o]))return!0;for(var s=0;s<e.length;s++)if(Qo(t,e[s]))return!0;return!1}function Wo(t,e,i){if(t.length>1){if(Qo(t,e))return!0;for(var n=0;n<e.length;n++)if(Ko(e[n],t,i))return!0}for(var r=0;r<t.length;r++)if(Ko(t[r],e,i))return!0;return!1}function Qo(t,e){if(0===t.length||0===e.length)return!1;for(var i=0;i<t.length-1;i++)for(var n=t[i],r=t[i+1],o=0;o<e.length-1;o++)if(qo(n,r,e[o],e[o+1]))return!0;return!1}function qo(t,e,i,n){return C(t,i,n)!==C(e,i,n)&&C(t,e,i)!==C(t,e,n)}function Ko(t,e,i){var n=i*i;if(1===e.length)return t.distSqr(e[0])<n;for(var r=1;r<e.length;r++)if(Xo(t,e[r-1],e[r])<n)return!0;return!1}function Xo(t,e,i){var n=e.distSqr(i);if(0===n)return t.distSqr(e);var r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return t.distSqr(r<0?e:r>1?i:i.sub(e)._mult(r)._add(e))}function Yo(t,e){for(var i,n,r,o=!1,s=0;s<t.length;s++)for(var a=0,l=(i=t[s]).length-1;a<i.length;l=a++)(n=i[a]).y>e.y!=(r=i[l]).y>e.y&&e.x<(r.x-n.x)*(e.y-n.y)/(r.y-n.y)+n.x&&(o=!o);return o}function $o(t,e){for(var i=!1,n=0,r=t.length-1;n<t.length;r=n++){var o=t[n],s=t[r];o.y>e.y!=s.y>e.y&&e.x<(s.x-o.x)*(e.y-o.y)/(s.y-o.y)+o.x&&(i=!i)}return i}function ts(t,e,i){var n=i[0],r=i[2];if(t.x<n.x&&e.x<n.x||t.x>r.x&&e.x>r.x||t.y<n.y&&e.y<n.y||t.y>r.y&&e.y>r.y)return!1;var o=C(t,e,i[0]);return o!==C(t,e,i[1])||o!==C(t,e,i[2])||o!==C(t,e,i[3])}function es(t,e,i){var n=e.paint.get(t).value;return"constant"===n.kind?n.value:i.programConfigurations.get(e.id).getMaxValue(t)}function is(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ns(t,e,i,n,o){if(!e[0]&&!e[1])return t;var s=r.convert(e)._mult(o);"viewport"===i&&s._rotate(-n);for(var a=[],l=0;l<t.length;l++)a.push(t[l].sub(s));return a}jo.prototype.populate=function(t,e,i){var n=this.layers[0],r=[],o=null;"circle"===n.type&&(o=n.layout.get("circle-sort-key"));for(var s=0,a=t;s<a.length;s+=1){var l=a[s],c=l.feature,u=l.id,h=l.index,d=l.sourceLayerIndex,p=this.layers[0]._featureFilter.needGeometry,A=Go(c,p);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),A,i)){var f=o?o.evaluate(A,{},i):void 0,g={id:u,properties:c.properties,type:c.type,sourceLayerIndex:d,index:h,geometry:p?A.geometry:No(c),patterns:{},sortKey:f};r.push(g)}}o&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=r;m<y.length;m+=1){var v=y[m],_=v.geometry,b=v.index,x=v.sourceLayerIndex,w=t[b].feature;this.addFeature(v,_,b,i),e.featureIndex.insert(w,_,b,x,this.index)}},jo.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},jo.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},jo.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},jo.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,so),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},jo.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},jo.prototype.addFeature=function(t,e,i,n){for(var r=0,o=e;r<o.length;r+=1)for(var s=0,a=o[r];s<a.length;s+=1){var l=a[s],c=l.x,u=l.y;if(!(c<0||c>=8192||u<0||u>=8192)){var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),d=h.vertexLength;Zo(this.layoutVertexArray,c,u,-1,-1),Zo(this.layoutVertexArray,c,u,1,-1),Zo(this.layoutVertexArray,c,u,1,1),Zo(this.layoutVertexArray,c,u,-1,1),this.indexArray.emplaceBack(d,d+1,d+2),this.indexArray.emplaceBack(d,d+3,d+2),h.vertexLength+=4,h.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},n)},zn("CircleBucket",jo,{omit:["layers"]});var rs=new br({"circle-sort-key":new mr(Mt.layout_circle["circle-sort-key"])}),os={paint:new br({"circle-radius":new mr(Mt.paint_circle["circle-radius"]),"circle-color":new mr(Mt.paint_circle["circle-color"]),"circle-blur":new mr(Mt.paint_circle["circle-blur"]),"circle-opacity":new mr(Mt.paint_circle["circle-opacity"]),"circle-translate":new gr(Mt.paint_circle["circle-translate"]),"circle-translate-anchor":new gr(Mt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new gr(Mt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new gr(Mt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new mr(Mt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new mr(Mt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new mr(Mt.paint_circle["circle-stroke-opacity"])}),layout:rs},ss="undefined"!=typeof Float32Array?Float32Array:Array;function as(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ls(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],A=e[11],f=e[12],g=e[13],m=e[14],y=e[15],v=i[0],_=i[1],b=i[2],x=i[3];return t[0]=v*n+_*a+b*h+x*f,t[1]=v*r+_*l+b*d+x*g,t[2]=v*o+_*c+b*p+x*m,t[3]=v*s+_*u+b*A+x*y,t[4]=(v=i[4])*n+(_=i[5])*a+(b=i[6])*h+(x=i[7])*f,t[5]=v*r+_*l+b*d+x*g,t[6]=v*o+_*c+b*p+x*m,t[7]=v*s+_*u+b*A+x*y,t[8]=(v=i[8])*n+(_=i[9])*a+(b=i[10])*h+(x=i[11])*f,t[9]=v*r+_*l+b*d+x*g,t[10]=v*o+_*c+b*p+x*m,t[11]=v*s+_*u+b*A+x*y,t[12]=(v=i[12])*n+(_=i[13])*a+(b=i[14])*h+(x=i[15])*f,t[13]=v*r+_*l+b*d+x*g,t[14]=v*o+_*c+b*p+x*m,t[15]=v*s+_*u+b*A+x*y,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,i=arguments.length;i--;)e+=t[i]*t[i];return Math.sqrt(e)});var cs,us=ls;function hs(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3];return t[0]=i[0]*n+i[4]*r+i[8]*o+i[12]*s,t[1]=i[1]*n+i[5]*r+i[9]*o+i[13]*s,t[2]=i[2]*n+i[6]*r+i[10]*o+i[14]*s,t[3]=i[3]*n+i[7]*r+i[11]*o+i[15]*s,t}cs=new ss(3),ss!=Float32Array&&(cs[0]=0,cs[1]=0,cs[2]=0),function(){var t=new ss(4);ss!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0)}();var ds=(function(){var t=new ss(2);ss!=Float32Array&&(t[0]=0,t[1]=0)}(),function(t){function e(e){t.call(this,e,os)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new jo(t)},e.prototype.queryRadius=function(t){var e=t;return es("circle-radius",this,e)+es("circle-stroke-width",this,e)+is(this.paint.get("circle-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,n,r,o,s,a){for(var l=ns(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,s),c=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(t,e){return t.map((function(t){return ps(t,e)}))}(l,a),d=u?c*s:c,p=0,A=n;p<A.length;p+=1)for(var f=0,g=A[p];f<g.length;f+=1){var m=g[f],y=u?m:ps(m,a),v=d,_=hs([],[m.x,m.y,0,1],a);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?v*=_[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(v*=o.cameraToCenterDistance/_[3]),Ho(h,y,v))return!0}return!1},e}(xr));function ps(t,e){var i=hs([],[t.x,t.y,0,1],e);return new r(i[0]/i[3],i[1]/i[3])}var As=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(jo);function fs(t,e,i,n){var r=e.width,o=e.height;if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==r*o*i)throw new RangeError("mismatched image size")}else n=new Uint8Array(r*o*i);return t.width=r,t.height=o,t.data=n,t}function gs(t,e,i){var n=e.width,r=e.height;if(n!==t.width||r!==t.height){var o=fs({},{width:n,height:r},i);ms(t,o,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,n),height:Math.min(t.height,r)},i),t.width=n,t.height=r,t.data=o.data}}function ms(t,e,i,n,r,o){if(0===r.width||0===r.height)return e;if(r.width>t.width||r.height>t.height||i.x>t.width-r.width||i.y>t.height-r.height)throw new RangeError("out of range source coordinates for image copy");if(r.width>e.width||r.height>e.height||n.x>e.width-r.width||n.y>e.height-r.height)throw new RangeError("out of range destination coordinates for image copy");for(var s=t.data,a=e.data,l=0;l<r.height;l++)for(var c=((i.y+l)*t.width+i.x)*o,u=((n.y+l)*e.width+n.x)*o,h=0;h<r.width*o;h++)a[u+h]=s[c+h];return e}zn("HeatmapBucket",As,{omit:["layers"]});var ys=function(t,e){fs(this,t,1,e)};ys.prototype.resize=function(t){gs(this,t,1)},ys.prototype.clone=function(){return new ys({width:this.width,height:this.height},new Uint8Array(this.data))},ys.copy=function(t,e,i,n,r){ms(t,e,i,n,r,1)};var vs=function(t,e){fs(this,t,4,e)};vs.prototype.resize=function(t){gs(this,t,4)},vs.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},vs.prototype.clone=function(){return new vs({width:this.width,height:this.height},new Uint8Array(this.data))},vs.copy=function(t,e,i,n,r){ms(t,e,i,n,r,4)},zn("AlphaImage",ys),zn("RGBAImage",vs);var _s={paint:new br({"heatmap-radius":new mr(Mt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new mr(Mt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new gr(Mt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new _r(Mt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new gr(Mt.paint_heatmap["heatmap-opacity"])})};function bs(t){var e={},i=t.resolution||256,n=t.clips?t.clips.length:1,r=t.image||new vs({width:i,height:n}),o=function(i,n,o){e[t.evaluationKey]=o;var s=t.expression.evaluate(e);r.data[i+n+0]=Math.floor(255*s.r/s.a),r.data[i+n+1]=Math.floor(255*s.g/s.a),r.data[i+n+2]=Math.floor(255*s.b/s.a),r.data[i+n+3]=Math.floor(255*s.a)};if(t.clips)for(var s=0,a=0;s<n;++s,a+=4*i)for(var l=0,c=0;l<i;l++,c+=4){var u=l/(i-1),h=t.clips[s];o(a,c,h.start*(1-u)+h.end*u)}else for(var d=0,p=0;d<i;d++,p+=4)o(0,p,d/(i-1));return r}var xs=function(t){function e(e){t.call(this,e,_s),this._updateColorRamp()}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new As(t)},e.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},e.prototype._updateColorRamp=function(){this.colorRamp=bs({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},e.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},e}(xr),ws={paint:new br({"hillshade-illumination-direction":new gr(Mt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new gr(Mt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new gr(Mt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new gr(Mt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new gr(Mt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new gr(Mt.paint_hillshade["hillshade-accent-color"])})},Cs=function(t){function e(e){t.call(this,e,ws)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},e}(xr),Bs=Er([{name:"a_pos",components:2,type:"Int16"}],4).members,Es=Ts,Ss=Ts;function Ts(t,e,i){i=i||2;var n,r,o,s,a,l,c,u=e&&e.length,h=u?e[0]*i:t.length,d=Ms(t,0,h,i,!0),p=[];if(!d||d.next===d.prev)return p;if(u&&(d=function(t,e,i,n){var r,o,s,a=[];for(r=0,o=e.length;r<o;r++)(s=Ms(t,e[r]*n,r<o-1?e[r+1]*n:t.length,n,!1))===s.next&&(s.steiner=!0),a.push(Ns(s));for(a.sort(Rs),r=0;r<a.length;r++)ks(a[r],i),i=Is(i,i.next);return i}(t,e,d,i)),t.length>80*i){n=o=t[0],r=s=t[1];for(var A=i;A<h;A+=i)(a=t[A])<n&&(n=a),(l=t[A+1])<r&&(r=l),a>o&&(o=a),l>s&&(s=l);c=0!==(c=Math.max(o-n,s-r))?1/c:0}return Ps(d,p,i,n,r,c),p}function Ms(t,e,i,n,r){var o,s;if(r===$s(t,e,i,n)>0)for(o=e;o<i;o+=n)s=Ks(o,t[o],t[o+1],s);else for(o=i-n;o>=e;o-=n)s=Ks(o,t[o],t[o+1],s);return s&&Vs(s,s.next)&&(Xs(s),s=s.next),s}function Is(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Vs(n,n.next)&&0!==js(n.prev,n,n.next))n=n.next;else{if(Xs(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function Ps(t,e,i,n,r,o,s){if(t){!s&&o&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=Us(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,o,s,a,l,c=1;do{for(i=t,t=null,o=null,s=0;i;){for(s++,n=i,a=0,e=0;e<c&&(a++,n=n.nextZ);e++);for(l=c;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;i=n}o.nextZ=null,c*=2}while(s>1)}(r)}(t,n,r,o);for(var a,l,c=t;t.prev!==t.next;)if(a=t.prev,l=t.next,o?Ls(t,n,r,o):Ds(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),Xs(t),t=l.next,c=l.next;else if((t=l)===c){s?1===s?Ps(t=Os(Is(t),e,i),e,i,n,r,o,2):2===s&&Fs(t,e,i,n,r,o):Ps(Is(t),e,i,n,r,o,1);break}}}function Ds(t){var e=t.prev,i=t,n=t.next;if(js(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Gs(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&js(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function Ls(t,e,i,n){var r=t.prev,o=t,s=t.next;if(js(r,o,s)>=0)return!1;for(var a=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,l=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,c=Us(r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,e,i,n),u=Us(a,l,e,i,n),h=t.prevZ,d=t.nextZ;h&&h.z>=c&&d&&d.z<=u;){if(h!==t.prev&&h!==t.next&&Gs(r.x,r.y,o.x,o.y,s.x,s.y,h.x,h.y)&&js(h.prev,h,h.next)>=0)return!1;if(h=h.prevZ,d!==t.prev&&d!==t.next&&Gs(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&js(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;h&&h.z>=c;){if(h!==t.prev&&h!==t.next&&Gs(r.x,r.y,o.x,o.y,s.x,s.y,h.x,h.y)&&js(h.prev,h,h.next)>=0)return!1;h=h.prevZ}for(;d&&d.z<=u;){if(d!==t.prev&&d!==t.next&&Gs(r.x,r.y,o.x,o.y,s.x,s.y,d.x,d.y)&&js(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function Os(t,e,i){var n=t;do{var r=n.prev,o=n.next.next;!Vs(r,o)&&Hs(r,n,n.next,o)&&Qs(r,o)&&Qs(o,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(o.i/i),Xs(n),Xs(n.next),n=t=o),n=n.next}while(n!==t);return Is(n)}function Fs(t,e,i,n,r,o){var s=t;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&Zs(s,a)){var l=qs(s,a);return s=Is(s,s.next),l=Is(l,l.next),Ps(s,e,i,n,r,o),void Ps(l,e,i,n,r,o)}a=a.next}s=s.next}while(s!==t)}function Rs(t,e){return t.x-e.x}function ks(t,e){if(e=function(t,e){var i,n=e,r=t.x,o=t.y,s=-1/0;do{if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){var a=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>s){if(s=a,a===r){if(o===n.y)return n;if(o===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===s)return i;var l,c=i,u=i.x,h=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=u&&r!==n.x&&Gs(o<h?r:s,o,u,h,o<h?s:r,o,n.x,n.y)&&(l=Math.abs(o-n.y)/(r-n.x),Qs(n,t)&&(l<d||l===d&&(n.x>i.x||n.x===i.x&&zs(i,n)))&&(i=n,d=l)),n=n.next}while(n!==c);return i}(t,e)){var i=qs(e,t);Is(e,e.next),Is(i,i.next)}}function zs(t,e){return js(t.prev,t,e.prev)<0&&js(e.next,t,t.next)<0}function Us(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Ns(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Gs(t,e,i,n,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(n-a)-(i-s)*(e-a)>=0&&(i-s)*(o-a)-(r-s)*(n-a)>=0}function Zs(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&Hs(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(Qs(t,e)&&Qs(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{i.y>o!=i.next.y>o&&i.next.y!==i.y&&r<(i.next.x-i.x)*(o-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(js(t.prev,t,e.prev)||js(t,e.prev,e))||Vs(t,e)&&js(t.prev,t,t.next)>0&&js(e.prev,e,e.next)>0)}function js(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Vs(t,e){return t.x===e.x&&t.y===e.y}function Hs(t,e,i,n){var r=Ws(js(t,e,i)),o=Ws(js(t,e,n)),s=Ws(js(i,n,t)),a=Ws(js(i,n,e));return r!==o&&s!==a||!(0!==r||!Js(t,i,e))||!(0!==o||!Js(t,n,e))||!(0!==s||!Js(i,t,n))||!(0!==a||!Js(i,e,n))}function Js(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Ws(t){return t>0?1:t<0?-1:0}function Qs(t,e){return js(t.prev,t,t.next)<0?js(t,e,t.next)>=0&&js(t,t.prev,e)>=0:js(t,e,t.prev)<0||js(t,t.next,e)<0}function qs(t,e){var i=new Ys(t.i,t.x,t.y),n=new Ys(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,o.next=n,n.prev=o,n}function Ks(t,e,i,n){var r=new Ys(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function Xs(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Ys(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function $s(t,e,i,n){for(var r=0,o=e,s=i-n;o<i;o+=n)r+=(t[s]-t[o])*(t[o+1]+t[s+1]),s=o;return r}function ta(t,e,i,n,r){!function t(e,i,n,r,o){for(;r>n;){if(r-n>600){var s=r-n+1,a=i-n+1,l=Math.log(s),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(s-c)/s)*(a-s/2<0?-1:1);t(e,i,Math.max(n,Math.floor(i-a*c/s+u)),Math.min(r,Math.floor(i+(s-a)*c/s+u)),o)}var h=e[i],d=n,p=r;for(ea(e,n,i),o(e[r],h)>0&&ea(e,n,r);d<p;){for(ea(e,d,p),d++,p--;o(e[d],h)<0;)d++;for(;o(e[p],h)>0;)p--}0===o(e[n],h)?ea(e,n,p):ea(e,++p,r),p<=i&&(n=p+1),i<=p&&(r=p-1)}}(t,e,i||0,n||t.length-1,r||ia)}function ea(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function ia(t,e){return t<e?-1:t>e?1:0}function na(t,e){var i=t.length;if(i<=1)return[t];for(var n,r,o=[],s=0;s<i;s++){var a=B(t[s]);0!==a&&(t[s].area=Math.abs(a),void 0===r&&(r=a<0),r===a<0?(n&&o.push(n),n=[t[s]]):n.push(t[s]))}if(n&&o.push(n),e>1)for(var l=0;l<o.length;l++)o[l].length<=e||(ta(o[l],e,1,o[l].length-1,ra),o[l]=o[l].slice(0,e));return o}function ra(t,e){return e.area-t.area}function oa(t,e,i){for(var n=i.patternDependencies,r=!1,o=0,s=e;o<s.length;o+=1){var a=s[o].paint.get(t+"-pattern");a.isConstant()||(r=!0);var l=a.constantOr(null);l&&(r=!0,n[l.to]=!0,n[l.from]=!0)}return r}function sa(t,e,i,n,r){for(var o=r.patternDependencies,s=0,a=e;s<a.length;s+=1){var l=a[s],c=l.paint.get(t+"-pattern").value;if("constant"!==c.kind){var u=c.evaluate({zoom:n-1},i,{},r.availableImages),h=c.evaluate({zoom:n},i,{},r.availableImages),d=c.evaluate({zoom:n+1},i,{},r.availableImages);h=h&&h.name?h.name:h,d=d&&d.name?d.name:d,o[u=u&&u.name?u.name:u]=!0,o[h]=!0,o[d]=!0,i.patterns[l.id]={min:u,mid:h,max:d}}}return i}Ts.deviation=function(t,e,i,n){var r=e&&e.length,o=Math.abs($s(t,0,r?e[0]*i:t.length,i));if(r)for(var s=0,a=e.length;s<a;s++)o-=Math.abs($s(t,e[s]*i,s<a-1?e[s+1]*i:t.length,i));var l=0;for(s=0;s<n.length;s+=3){var c=n[s]*i,u=n[s+1]*i,h=n[s+2]*i;l+=Math.abs((t[c]-t[h])*(t[u+1]-t[c+1])-(t[c]-t[u])*(t[h+1]-t[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},Ts.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var o=0;o<t[r].length;o++)for(var s=0;s<e;s++)i.vertices.push(t[r][o][s]);r>0&&i.holes.push(n+=t[r-1].length)}return i},Es.default=Ss;var aa=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Tr,this.indexArray=new Gr,this.indexArray2=new Wr,this.programConfigurations=new Fo(t.layers,t.zoom),this.segments=new ao,this.segments2=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};aa.prototype.populate=function(t,e,i){this.hasPattern=oa("fill",this.layers,e);for(var n=this.layers[0].layout.get("fill-sort-key"),r=[],o=0,s=t;o<s.length;o+=1){var a=s[o],l=a.feature,c=a.id,u=a.index,h=a.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,p=Go(l,d);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),p,i)){var A=n?n.evaluate(p,{},i,e.availableImages):void 0,f={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:d?p.geometry:No(l),patterns:{},sortKey:A};r.push(f)}}n&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,m=r;g<m.length;g+=1){var y=m[g],v=y.geometry,_=y.index,b=y.sourceLayerIndex;if(this.hasPattern){var x=sa("fill",this.layers,y,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(y,v,_,i,{});e.featureIndex.insert(t[_].feature,v,_,b,this.index)}},aa.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},aa.prototype.addFeatures=function(t,e,i){for(var n=0,r=this.patternFeatures;n<r.length;n+=1){var o=r[n];this.addFeature(o,o.geometry,o.index,e,i)}},aa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},aa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},aa.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Bs),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},aa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},aa.prototype.addFeature=function(t,e,i,n,r){for(var o=0,s=na(e,500);o<s.length;o+=1){for(var a=s[o],l=0,c=0,u=a;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray),d=h.vertexLength,p=[],A=[],f=0,g=a;f<g.length;f+=1){var m=g[f];if(0!==m.length){m!==a[0]&&A.push(p.length/2);var y=this.segments2.prepareSegment(m.length,this.layoutVertexArray,this.indexArray2),v=y.vertexLength;this.layoutVertexArray.emplaceBack(m[0].x,m[0].y),this.indexArray2.emplaceBack(v+m.length-1,v),p.push(m[0].x),p.push(m[0].y);for(var _=1;_<m.length;_++)this.layoutVertexArray.emplaceBack(m[_].x,m[_].y),this.indexArray2.emplaceBack(v+_-1,v+_),p.push(m[_].x),p.push(m[_].y);y.vertexLength+=m.length,y.primitiveLength+=m.length}}for(var b=Es(p,A),x=0;x<b.length;x+=3)this.indexArray.emplaceBack(d+b[x],d+b[x+1],d+b[x+2]);h.vertexLength+=l,h.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,n)},zn("FillBucket",aa,{omit:["layers","patternFeatures"]});var la=new br({"fill-sort-key":new mr(Mt.layout_fill["fill-sort-key"])}),ca={paint:new br({"fill-antialias":new gr(Mt.paint_fill["fill-antialias"]),"fill-opacity":new mr(Mt.paint_fill["fill-opacity"]),"fill-color":new mr(Mt.paint_fill["fill-color"]),"fill-outline-color":new mr(Mt.paint_fill["fill-outline-color"]),"fill-translate":new gr(Mt.paint_fill["fill-translate"]),"fill-translate-anchor":new gr(Mt.paint_fill["fill-translate-anchor"]),"fill-pattern":new yr(Mt.paint_fill["fill-pattern"])}),layout:la},ua=function(t){function e(e){t.call(this,e,ca)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,i){t.prototype.recalculate.call(this,e,i);var n=this.paint._values["fill-outline-color"];"constant"===n.value.kind&&void 0===n.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},e.prototype.createBucket=function(t){return new aa(t)},e.prototype.queryRadius=function(){return is(this.paint.get("fill-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,n,r,o,s){return Jo(ns(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,s),n)},e.prototype.isTileClipped=function(){return!0},e}(xr),ha=Er([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,da=pa;function pa(t,e,i,n,r){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=n,this._values=r,t.readFields(Aa,this,e)}function Aa(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var n=e._keys[t.readVarint()],r=e._values[t.readVarint()];e.properties[n]=r}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function fa(t){for(var e,i,n=0,r=0,o=t.length,s=o-1;r<o;s=r++)n+=((i=t[s]).x-(e=t[r]).x)*(e.y+i.y);return n}pa.types=["Unknown","Point","LineString","Polygon"],pa.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,n=1,o=0,s=0,a=0,l=[];t.pos<i;){if(o<=0){var c=t.readVarint();n=7&c,o=c>>3}if(o--,1===n||2===n)s+=t.readSVarint(),a+=t.readSVarint(),1===n&&(e&&l.push(e),e=[]),e.push(new r(s,a));else{if(7!==n)throw new Error("unknown command "+n);e&&e.push(e[0].clone())}}return e&&l.push(e),l},pa.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,n=0,r=0,o=0,s=1/0,a=-1/0,l=1/0,c=-1/0;t.pos<e;){if(n<=0){var u=t.readVarint();i=7&u,n=u>>3}if(n--,1===i||2===i)(r+=t.readSVarint())<s&&(s=r),r>a&&(a=r),(o+=t.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==i)throw new Error("unknown command "+i)}return[s,l,a,c]},pa.prototype.toGeoJSON=function(t,e,i){var n,r,o=this.extent*Math.pow(2,i),s=this.extent*t,a=this.extent*e,l=this.loadGeometry(),c=pa.types[this.type];function u(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+s)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+a)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(n=0;n<l.length;n++)h[n]=l[n][0];u(l=h);break;case 2:for(n=0;n<l.length;n++)u(l[n]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,n,r=[],o=0;o<e;o++){var s=fa(t[o]);0!==s&&(void 0===n&&(n=s<0),n===s<0?(i&&r.push(i),i=[t[o]]):i.push(t[o]))}return i&&r.push(i),r}(l),n=0;n<l.length;n++)for(r=0;r<l[n].length;r++)u(l[n][r])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var ga=ma;function ma(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(ya,this,e),this.length=this._features.length}function ya(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var n=t.readVarint()>>3;e=1===n?t.readString():2===n?t.readFloat():3===n?t.readDouble():4===n?t.readVarint64():5===n?t.readVarint():6===n?t.readSVarint():7===n?t.readBoolean():null}return e}(i))}function va(t,e,i){if(3===t){var n=new ga(i,i.readVarint()+i.pos);n.length&&(e[n.name]=n)}}ma.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new da(this._pbf,e,this.extent,this._keys,this._values)};var _a={VectorTile:function(t,e){this.layers=t.readFields(va,{},e)},VectorTileFeature:da,VectorTileLayer:ga},ba=_a.VectorTileFeature.types,xa=Math.pow(2,13);function wa(t,e,i,n,r,o,s,a){t.emplaceBack(e,i,2*Math.floor(n*xa)+s,r*xa*2,o*xa*2,Math.round(a))}var Ca=function(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new Ir,this.indexArray=new Gr,this.programConfigurations=new Fo(t.layers,t.zoom),this.segments=new ao,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};function Ba(t,e){return t.x===e.x&&(t.x<0||t.x>8192)||t.y===e.y&&(t.y<0||t.y>8192)}Ca.prototype.populate=function(t,e,i){this.features=[],this.hasPattern=oa("fill-extrusion",this.layers,e);for(var n=0,r=t;n<r.length;n+=1){var o=r[n],s=o.feature,a=o.id,l=o.index,c=o.sourceLayerIndex,u=this.layers[0]._featureFilter.needGeometry,h=Go(s,u);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),h,i)){var d={id:a,sourceLayerIndex:c,index:l,geometry:u?h.geometry:No(s),properties:s.properties,type:s.type,patterns:{}};this.hasPattern?this.features.push(sa("fill-extrusion",this.layers,d,this.zoom,e)):this.addFeature(d,d.geometry,l,i,{}),e.featureIndex.insert(s,d.geometry,l,c,this.index,!0)}}},Ca.prototype.addFeatures=function(t,e,i){for(var n=0,r=this.features;n<r.length;n+=1){var o=r[n];this.addFeature(o,o.geometry,o.index,e,i)}},Ca.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Ca.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ca.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ca.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ha),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ca.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ca.prototype.addFeature=function(t,e,i,n,r){for(var o=0,s=na(e,500);o<s.length;o+=1){for(var a=s[o],l=0,c=0,u=a;c<u.length;c+=1)l+=u[c].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),d=0,p=a;d<p.length;d+=1){var A=p[d];if(0!==A.length&&!((D=A).every((function(t){return t.x<0}))||D.every((function(t){return t.x>8192}))||D.every((function(t){return t.y<0}))||D.every((function(t){return t.y>8192}))))for(var f=0,g=0;g<A.length;g++){var m=A[g];if(g>=1){var y=A[g-1];if(!Ba(m,y)){h.vertexLength+4>ao.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var v=m.sub(y)._perp()._unit(),_=y.dist(m);f+_>32768&&(f=0),wa(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,0,f),wa(this.layoutVertexArray,m.x,m.y,v.x,v.y,0,1,f),wa(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,0,f+=_),wa(this.layoutVertexArray,y.x,y.y,v.x,v.y,0,1,f);var b=h.vertexLength;this.indexArray.emplaceBack(b,b+2,b+1),this.indexArray.emplaceBack(b+1,b+2,b+3),h.vertexLength+=4,h.primitiveLength+=2}}}}if(h.vertexLength+l>ao.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===ba[t.type]){for(var x=[],w=[],C=h.vertexLength,B=0,E=a;B<E.length;B+=1){var S=E[B];if(0!==S.length){S!==a[0]&&w.push(x.length/2);for(var T=0;T<S.length;T++){var M=S[T];wa(this.layoutVertexArray,M.x,M.y,0,0,1,1,0),x.push(M.x),x.push(M.y)}}}for(var I=Es(x,w),P=0;P<I.length;P+=3)this.indexArray.emplaceBack(C+I[P],C+I[P+2],C+I[P+1]);h.primitiveLength+=I.length/3,h.vertexLength+=l}}var D;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,n)},zn("FillExtrusionBucket",Ca,{omit:["layers","features"]});var Ea={paint:new br({"fill-extrusion-opacity":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new yr(Mt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new mr(Mt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new gr(Mt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},Sa=function(t){function e(e){t.call(this,e,Ea)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.createBucket=function(t){return new Ca(t)},e.prototype.queryRadius=function(){return is(this.paint.get("fill-extrusion-translate"))},e.prototype.is3D=function(){return!0},e.prototype.queryIntersectsFeature=function(t,e,i,n,o,s,a,l){var c=ns(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),s.angle,a),u=this.paint.get("fill-extrusion-height").evaluate(e,i),h=this.paint.get("fill-extrusion-base").evaluate(e,i),d=function(t,e,i,n){for(var o=[],s=0,a=t;s<a.length;s+=1){var l=a[s],c=[l.x,l.y,0,1];hs(c,c,e),o.push(new r(c[0]/c[3],c[1]/c[3]))}return o}(c,l),p=function(t,e,i,n){for(var o=[],s=[],a=n[8]*e,l=n[9]*e,c=n[10]*e,u=n[11]*e,h=n[8]*i,d=n[9]*i,p=n[10]*i,A=n[11]*i,f=0,g=t;f<g.length;f+=1){for(var m=[],y=[],v=0,_=g[f];v<_.length;v+=1){var b=_[v],x=b.x,w=b.y,C=n[0]*x+n[4]*w+n[12],B=n[1]*x+n[5]*w+n[13],E=n[2]*x+n[6]*w+n[14],S=n[3]*x+n[7]*w+n[15],T=E+c,M=S+u,I=C+h,P=B+d,D=E+p,L=S+A,O=new r((C+a)/M,(B+l)/M);O.z=T/M,m.push(O);var F=new r(I/L,P/L);F.z=D/L,y.push(F)}o.push(m),s.push(y)}return[o,s]}(n,h,u,l);return function(t,e,i){var n=1/0;Jo(i,e)&&(n=Ma(i,e[0]));for(var r=0;r<e.length;r++)for(var o=e[r],s=t[r],a=0;a<o.length-1;a++){var l=o[a],c=[l,o[a+1],s[a+1],s[a],l];Vo(i,c)&&(n=Math.min(n,Ma(i,c)))}return n!==1/0&&n}(p[0],p[1],d)},e}(xr);function Ta(t,e){return t.x*e.x+t.y*e.y}function Ma(t,e){if(1===t.length){for(var i,n=0,r=e[n++];!i||r.equals(i);)if(!(i=e[n++]))return 1/0;for(;n<e.length;n++){var o=e[n],s=t[0],a=i.sub(r),l=o.sub(r),c=s.sub(r),u=Ta(a,a),h=Ta(a,l),d=Ta(l,l),p=Ta(c,a),A=Ta(c,l),f=u*d-h*h,g=(d*p-h*A)/f,m=(u*A-h*p)/f,y=r.z*(1-g-m)+i.z*g+o.z*m;if(isFinite(y))return y}return 1/0}for(var v=1/0,_=0,b=e;_<b.length;_+=1)v=Math.min(v,b[_].z);return v}var Ia=Er([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,Pa=Er([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,Da=_a.VectorTileFeature.types,La=Math.cos(Math.PI/180*37.5),Oa=Math.pow(2,14)/.5,Fa=function(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new Pr,this.layoutVertexArray2=new Dr,this.indexArray=new Gr,this.programConfigurations=new Fo(t.layers,t.zoom),this.segments=new ao,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))};Fa.prototype.populate=function(t,e,i){this.hasPattern=oa("line",this.layers,e);for(var n=this.layers[0].layout.get("line-sort-key"),r=[],o=0,s=t;o<s.length;o+=1){var a=s[o],l=a.feature,c=a.id,u=a.index,h=a.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,p=Go(l,d);if(this.layers[0]._featureFilter.filter(new ar(this.zoom),p,i)){var A=n?n.evaluate(p,{},i):void 0,f={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:u,geometry:d?p.geometry:No(l),patterns:{},sortKey:A};r.push(f)}}n&&r.sort((function(t,e){return t.sortKey-e.sortKey}));for(var g=0,m=r;g<m.length;g+=1){var y=m[g],v=y.geometry,_=y.index,b=y.sourceLayerIndex;if(this.hasPattern){var x=sa("line",this.layers,y,this.zoom,e);this.patternFeatures.push(x)}else this.addFeature(y,v,_,i,{});e.featureIndex.insert(t[_].feature,v,_,b,this.index)}},Fa.prototype.update=function(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)},Fa.prototype.addFeatures=function(t,e,i){for(var n=0,r=this.patternFeatures;n<r.length;n+=1){var o=r[n];this.addFeature(o,o.geometry,o.index,e,i)}},Fa.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Fa.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Fa.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,Pa)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ia),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Fa.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Fa.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},Fa.prototype.addFeature=function(t,e,i,n,r){var o=this.layers[0].layout,s=o.get("line-join").evaluate(t,{}),a=o.get("line-cap"),l=o.get("line-miter-limit"),c=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var u=0,h=e;u<h.length;u+=1)this.addLine(h[u],t,s,a,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,r,n)},Fa.prototype.addLine=function(t,e,i,n,r,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var s=0;s<t.length-1;s++)this.totalDistance+=t[s].dist(t[s+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var a="Polygon"===Da[e.type],l=t.length;l>=2&&t[l-1].equals(t[l-2]);)l--;for(var c=0;c<l-1&&t[c].equals(t[c+1]);)c++;if(!(l<(a?3:2))){"bevel"===i&&(r=1.05);var u,h=this.overscaling<=16?122880/(512*this.overscaling):0,d=this.segments.prepareSegment(10*l,this.layoutVertexArray,this.indexArray),p=void 0,A=void 0,f=void 0,g=void 0;this.e1=this.e2=-1,a&&(g=t[c].sub(u=t[l-2])._unit()._perp());for(var m=c;m<l;m++)if(!(A=m===l-1?a?t[c+1]:void 0:t[m+1])||!t[m].equals(A)){g&&(f=g),u&&(p=u),u=t[m],g=A?A.sub(u)._unit()._perp():f;var y=(f=f||g).add(g);0===y.x&&0===y.y||y._unit();var v=f.x*g.x+f.y*g.y,_=y.x*g.x+y.y*g.y,b=0!==_?1/_:1/0,x=2*Math.sqrt(2-2*_),w=_<La&&p&&A,C=f.x*g.y-f.y*g.x>0;if(w&&m>c){var B=u.dist(p);if(B>2*h){var E=u.sub(u.sub(p)._mult(h/B)._round());this.updateDistance(p,E),this.addCurrentVertex(E,f,0,0,d),p=E}}var S=p&&A,T=S?i:a?"butt":n;if(S&&"round"===T&&(b<o?T="miter":b<=2&&(T="fakeround")),"miter"===T&&b>r&&(T="bevel"),"bevel"===T&&(b>2&&(T="flipbevel"),b<r&&(T="miter")),p&&this.updateDistance(p,u),"miter"===T)y._mult(b),this.addCurrentVertex(u,y,0,0,d);else if("flipbevel"===T){if(b>100)y=g.mult(-1);else{var M=b*f.add(g).mag()/f.sub(g).mag();y._perp()._mult(M*(C?-1:1))}this.addCurrentVertex(u,y,0,0,d),this.addCurrentVertex(u,y.mult(-1),0,0,d)}else if("bevel"===T||"fakeround"===T){var I=-Math.sqrt(b*b-1),P=C?I:0,D=C?0:I;if(p&&this.addCurrentVertex(u,f,P,D,d),"fakeround"===T)for(var L=Math.round(180*x/Math.PI/20),O=1;O<L;O++){var F=O/L;if(.5!==F){var R=F-.5;F+=F*R*(F-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*R*R+(.848013+v*(.215638*v-1.06021)))}var k=g.sub(f)._mult(F)._add(f)._unit()._mult(C?-1:1);this.addHalfVertex(u,k.x,k.y,!1,C,0,d)}A&&this.addCurrentVertex(u,g,-P,-D,d)}else if("butt"===T)this.addCurrentVertex(u,y,0,0,d);else if("square"===T){var z=p?1:-1;this.addCurrentVertex(u,y,z,z,d)}else"round"===T&&(p&&(this.addCurrentVertex(u,f,0,0,d),this.addCurrentVertex(u,f,1,1,d,!0)),A&&(this.addCurrentVertex(u,g,-1,-1,d,!0),this.addCurrentVertex(u,g,0,0,d)));if(w&&m<l-1){var U=u.dist(A);if(U>2*h){var N=u.add(A.sub(u)._mult(h/U)._round());this.updateDistance(u,N),this.addCurrentVertex(N,g,0,0,d),u=N}}}}},Fa.prototype.addCurrentVertex=function(t,e,i,n,r,o){void 0===o&&(o=!1);var s=e.y*n-e.x,a=-e.y-e.x*n;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,o,!1,i,r),this.addHalfVertex(t,s,a,o,!0,-n,r),this.distance>Oa/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,i,n,r,o))},Fa.prototype.addHalfVertex=function(t,e,i,n,r,o,s){var a=.5*(this.lineClips?this.scaledDistance*(Oa-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(n?1:0),(t.y<<1)+(r?1:0),Math.round(63*e)+128,Math.round(63*i)+128,1+(0===o?0:o<0?-1:1)|(63&a)<<2,a>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var l=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,l),s.primitiveLength++),r?this.e2=l:this.e1=l},Fa.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},Fa.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},zn("LineBucket",Fa,{omit:["layers","patternFeatures"]});var Ra=new br({"line-cap":new gr(Mt.layout_line["line-cap"]),"line-join":new mr(Mt.layout_line["line-join"]),"line-miter-limit":new gr(Mt.layout_line["line-miter-limit"]),"line-round-limit":new gr(Mt.layout_line["line-round-limit"]),"line-sort-key":new mr(Mt.layout_line["line-sort-key"])}),ka={paint:new br({"line-opacity":new mr(Mt.paint_line["line-opacity"]),"line-color":new mr(Mt.paint_line["line-color"]),"line-translate":new gr(Mt.paint_line["line-translate"]),"line-translate-anchor":new gr(Mt.paint_line["line-translate-anchor"]),"line-width":new mr(Mt.paint_line["line-width"]),"line-gap-width":new mr(Mt.paint_line["line-gap-width"]),"line-offset":new mr(Mt.paint_line["line-offset"]),"line-blur":new mr(Mt.paint_line["line-blur"]),"line-dasharray":new vr(Mt.paint_line["line-dasharray"]),"line-pattern":new yr(Mt.paint_line["line-pattern"]),"line-gradient":new _r(Mt.paint_line["line-gradient"])}),layout:Ra},za=new(function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.possiblyEvaluate=function(e,i){return i=new ar(Math.floor(i.zoom),{now:i.now,fadeDuration:i.fadeDuration,zoomHistory:i.zoomHistory,transition:i.transition}),t.prototype.possiblyEvaluate.call(this,e,i)},e.prototype.evaluate=function(e,i,n,r){return i=d({},i,{zoom:Math.floor(i.zoom)}),t.prototype.evaluate.call(this,e,i,n,r)},e}(mr))(ka.paint.properties["line-width"].specification);za.useIntegerZoom=!0;var Ua=function(t){function e(e){t.call(this,e,ka),this.gradientVersion=0}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof je,this.gradientVersion=(this.gradientVersion+1)%a)},e.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},e.prototype.recalculate=function(e,i){t.prototype.recalculate.call(this,e,i),this.paint._values["line-floorwidth"]=za.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)},e.prototype.createBucket=function(t){return new Fa(t)},e.prototype.queryRadius=function(t){var e=t,i=Na(es("line-width",this,e),es("line-gap-width",this,e)),n=es("line-offset",this,e);return i/2+Math.abs(n)+is(this.paint.get("line-translate"))},e.prototype.queryIntersectsFeature=function(t,e,i,n,o,s,a){var l=ns(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),s.angle,a),c=a/2*Na(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),u=this.paint.get("line-offset").evaluate(e,i);return u&&(n=function(t,e){for(var i=[],n=new r(0,0),o=0;o<t.length;o++){for(var s=t[o],a=[],l=0;l<s.length;l++){var c=s[l],u=s[l+1],h=0===l?n:c.sub(s[l-1])._unit()._perp(),d=l===s.length-1?n:u.sub(c)._unit()._perp(),p=h._add(d)._unit();p._mult(1/(p.x*d.x+p.y*d.y)),a.push(p._mult(e)._add(c))}i.push(a)}return i}(n,u*a)),function(t,e,i){for(var n=0;n<e.length;n++){var r=e[n];if(t.length>=3)for(var o=0;o<r.length;o++)if($o(t,r[o]))return!0;if(Wo(t,r,i))return!0}return!1}(l,n,c)},e.prototype.isTileClipped=function(){return!0},e}(xr);function Na(t,e){return e>0?e+2*t:t}var Ga=Er([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Za=Er([{name:"a_projected_pos",components:3,type:"Float32"}],4),ja=(Er([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Er([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Va=(Er([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Er([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),Ha=Er([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ja(t,e,i){return t.sections.forEach((function(t){t.text=function(t,e,i){var n=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===n?t=t.toLocaleUpperCase():"lowercase"===n&&(t=t.toLocaleLowerCase()),sr.applyArabicShaping&&(t=sr.applyArabicShaping(t)),t}(t.text,e,i)})),t}Er([{name:"triangle",components:3,type:"Uint16"}]),Er([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Er([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Er([{type:"Float32",name:"offsetX"}]),Er([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Wa={"!":"\ufe15","#":"\uff03",$:"\uff04","%":"\uff05","&":"\uff06","(":"\ufe35",")":"\ufe36","*":"\uff0a","+":"\uff0b",",":"\ufe10","-":"\ufe32",".":"\u30fb","/":"\uff0f",":":"\ufe13",";":"\ufe14","<":"\ufe3f","=":"\uff1d",">":"\ufe40","?":"\ufe16","@":"\uff20","[":"\ufe47","\\":"\uff3c","]":"\ufe48","^":"\uff3e",_:"\ufe33","`":"\uff40","{":"\ufe37","|":"\u2015","}":"\ufe38","~":"\uff5e","\xa2":"\uffe0","\xa3":"\uffe1","\xa5":"\uffe5","\xa6":"\uffe4","\xac":"\uffe2","\xaf":"\uffe3","\u2013":"\ufe32","\u2014":"\ufe31","\u2018":"\ufe43","\u2019":"\ufe44","\u201c":"\ufe41","\u201d":"\ufe42","\u2026":"\ufe19","\u2027":"\u30fb","\u20a9":"\uffe6","\u3001":"\ufe11","\u3002":"\ufe12","\u3008":"\ufe3f","\u3009":"\ufe40","\u300a":"\ufe3d","\u300b":"\ufe3e","\u300c":"\ufe41","\u300d":"\ufe42","\u300e":"\ufe43","\u300f":"\ufe44","\u3010":"\ufe3b","\u3011":"\ufe3c","\u3014":"\ufe39","\u3015":"\ufe3a","\u3016":"\ufe17","\u3017":"\ufe18","\uff01":"\ufe15","\uff08":"\ufe35","\uff09":"\ufe36","\uff0c":"\ufe10","\uff0d":"\ufe32","\uff0e":"\u30fb","\uff1a":"\ufe13","\uff1b":"\ufe14","\uff1c":"\ufe3f","\uff1e":"\ufe40","\uff1f":"\ufe16","\uff3b":"\ufe47","\uff3d":"\ufe48","\uff3f":"\ufe33","\uff5b":"\ufe37","\uff5c":"\u2015","\uff5d":"\ufe38","\uff5f":"\ufe35","\uff60":"\ufe36","\uff61":"\ufe12","\uff62":"\ufe41","\uff63":"\ufe42"},Qa=function(t,e,i,n,r){var o,s,a=8*r-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=i?r-1:0,d=i?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+t[e+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},qa=function(t,e,i,n,r,o){var s,a,l,c=8*o-r-1,u=(1<<c)-1,h=u>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,A=n?1:-1,f=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(e*l-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[i+p]=255&a,p+=A,a/=256,r-=8);for(s=s<<r|a,c+=r;c>0;t[i+p]=255&s,p+=A,s/=256,c-=8);t[i+p-A]|=128*f},Ka=Xa;function Xa(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Xa.Varint=0,Xa.Fixed64=1,Xa.Bytes=2,Xa.Fixed32=5;var Ya="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function $a(t){return t.type===Xa.Bytes?t.readVarint()+t.pos:t.pos+1}function tl(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function el(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function il(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function nl(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function rl(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function ol(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function sl(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function al(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function ll(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function cl(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function ul(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function hl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function dl(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function pl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function Al(t,e,i){1===t&&i.readMessage(fl,e)}function fl(t,e,i){if(3===t){var n=i.readMessage(gl,{}),r=n.width,o=n.height,s=n.left,a=n.top,l=n.advance;e.push({id:n.id,bitmap:new ys({width:r+6,height:o+6},n.bitmap),metrics:{width:r,height:o,left:s,top:a,advance:l}})}}function gl(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function ml(t){for(var e=0,i=0,n=0,r=t;n<r.length;n+=1){var o=r[n];e+=o.w*o.h,i=Math.max(i,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var s=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}],a=0,l=0,c=0,u=t;c<u.length;c+=1)for(var h=u[c],d=s.length-1;d>=0;d--){var p=s[d];if(!(h.w>p.w||h.h>p.h)){if(h.x=p.x,h.y=p.y,l=Math.max(l,h.y+h.h),a=Math.max(a,h.x+h.w),h.w===p.w&&h.h===p.h){var A=s.pop();d<s.length&&(s[d]=A)}else h.h===p.h?(p.x+=h.w,p.w-=h.w):h.w===p.w?(p.y+=h.h,p.h-=h.h):(s.push({x:p.x+h.w,y:p.y,w:p.w-h.w,h:h.h}),p.y+=h.h,p.h-=h.h);break}}return{w:a,h:l,fill:e/(a*l)||0}}Xa.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=hl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=pl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*hl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=hl(this.buf,this.pos)+4294967296*pl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Qa(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Qa(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(n=(112&(r=o[i.pos++]))>>4,r<128)return tl(t,n,e);if(n|=(127&(r=o[i.pos++]))<<3,r<128)return tl(t,n,e);if(n|=(127&(r=o[i.pos++]))<<10,r<128)return tl(t,n,e);if(n|=(127&(r=o[i.pos++]))<<17,r<128)return tl(t,n,e);if(n|=(127&(r=o[i.pos++]))<<24,r<128)return tl(t,n,e);if(n|=(1&(r=o[i.pos++]))<<31,r<128)return tl(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Ya?function(t,e,i){return Ya.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var n="",r=e;r<i;){var o,s,a,l=t[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>i)break;1===u?l<128&&(c=l):2===u?128==(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(s=t[r+2],128==(192&(o=t[r+1]))&&128==(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(s=t[r+2],a=t[r+3],128==(192&(o=t[r+1]))&&128==(192&s)&&128==(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),r+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Xa.Bytes)return t.push(this.readVarint(e));var i=$a(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Xa.Bytes)return t.push(this.readSVarint());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Xa.Bytes)return t.push(this.readBoolean());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Xa.Bytes)return t.push(this.readFloat());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Xa.Bytes)return t.push(this.readDouble());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Xa.Bytes)return t.push(this.readFixed32());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Xa.Bytes)return t.push(this.readSFixed32());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Xa.Bytes)return t.push(this.readFixed64());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Xa.Bytes)return t.push(this.readSFixed64());var e=$a(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Xa.Varint)for(;this.buf[this.pos++]>127;);else if(e===Xa.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Xa.Fixed32)this.pos+=4;else{if(e!==Xa.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),dl(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),dl(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),dl(this.buf,-1&t,this.pos),dl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),dl(this.buf,-1&t,this.pos),dl(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;if(t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&el(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),qa(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),qa(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&el(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,Xa.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,il,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,nl,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,sl,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,rl,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,ol,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,al,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,ll,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,cl,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,ul,e)},writeBytesField:function(t,e){this.writeTag(t,Xa.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Xa.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Xa.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Xa.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Xa.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Xa.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Xa.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Xa.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Xa.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Xa.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var yl=function(t,e){var i=e.pixelRatio,n=e.version,r=e.stretchX,o=e.stretchY,s=e.content;this.paddedRect=t,this.pixelRatio=i,this.stretchX=r,this.stretchY=o,this.content=s,this.version=n},vl={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};vl.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},vl.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},vl.tlbr.get=function(){return this.tl.concat(this.br)},vl.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yl.prototype,vl);var _l=function(t,e){var i={},n={};this.haveRenderCallbacks=[];var r=[];this.addImages(t,i,r),this.addImages(e,n,r);var o=ml(r),s=new vs({width:o.w||1,height:o.h||1});for(var a in t){var l=t[a],c=i[a].paddedRect;vs.copy(l.data,s,{x:0,y:0},{x:c.x+1,y:c.y+1},l.data)}for(var u in e){var h=e[u],d=n[u].paddedRect,p=d.x+1,A=d.y+1,f=h.data.width,g=h.data.height;vs.copy(h.data,s,{x:0,y:0},{x:p,y:A},h.data),vs.copy(h.data,s,{x:0,y:g-1},{x:p,y:A-1},{width:f,height:1}),vs.copy(h.data,s,{x:0,y:0},{x:p,y:A+g},{width:f,height:1}),vs.copy(h.data,s,{x:f-1,y:0},{x:p-1,y:A},{width:1,height:g}),vs.copy(h.data,s,{x:0,y:0},{x:p+f,y:A},{width:1,height:g})}this.image=s,this.iconPositions=i,this.patternPositions=n};_l.prototype.addImages=function(t,e,i){for(var n in t){var r=t[n],o={x:0,y:0,w:r.data.width+2,h:r.data.height+2};i.push(o),e[n]=new yl(o,r),r.hasRenderCallback&&this.haveRenderCallbacks.push(n)}},_l.prototype.patchUpdatedImages=function(t,e){for(var i in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)},_l.prototype.patchUpdatedImage=function(t,e,i){if(t&&e&&t.version!==e.version){t.version=e.version;var n=t.tl;i.update(e.data,void 0,{x:n[0],y:n[1]})}},zn("ImagePosition",yl),zn("ImageAtlas",_l);var bl={horizontal:1,vertical:2,horizontalOnly:3},xl=function(){this.scale=1,this.fontStack="",this.imageName=null};xl.forText=function(t,e){var i=new xl;return i.scale=t||1,i.fontStack=e,i},xl.forImage=function(t){var e=new xl;return e.imageName=t,e};var wl=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function Cl(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f){var g,m=wl.fromFeature(t,r);h===bl.vertical&&m.verticalizePunctuation();var y=sr.processBidirectionalText,v=sr.processStyledBidirectionalText;if(y&&1===m.sections.length){g=[];for(var _=0,b=y(m.toString(),Pl(m,c,o,e,n,p,A));_<b.length;_+=1){var x=b[_],w=new wl;w.text=x,w.sections=m.sections;for(var C=0;C<x.length;C++)w.sectionIndex.push(0);g.push(w)}}else if(v){g=[];for(var B=0,E=v(m.text,m.sectionIndex,Pl(m,c,o,e,n,p,A));B<E.length;B+=1){var S=E[B],T=new wl;T.text=S[0],T.sectionIndex=S[1],T.sections=m.sections,g.push(T)}}else g=function(t,e){for(var i=[],n=t.text,r=0,o=0,s=e;o<s.length;o+=1){var a=s[o];i.push(t.substring(r,a)),r=a}return r<n.length&&i.push(t.substring(r,n.length)),i}(m,Pl(m,c,o,e,n,p,A));var M=[],I={positionedLines:M,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:h,iconsInText:!1,verticalizable:!1};return function(t,e,i,n,r,o,s,a,l,c,u,h){for(var d=0,p=-17,A=0,f=0,g="right"===a?1:"left"===a?0:.5,m=0,y=0,v=r;y<v.length;y+=1){var _=v[y];_.trim();var b=_.getMaxScale(),x=24*(b-1),w={positionedGlyphs:[],lineOffset:0};t.positionedLines[m]=w;var C=w.positionedGlyphs,B=0;if(_.length()){for(var E=0;E<_.length();E++){var S=_.getSection(E),T=_.getSectionIndex(E),M=_.getCharCode(E),I=0,P=null,D=null,L=null,O=24,F=!(l===bl.horizontal||!u&&!Wn(M)||u&&(Bl[M]||(V=M,Hn.Arabic(V)||Hn["Arabic Supplement"](V)||Hn["Arabic Extended-A"](V)||Hn["Arabic Presentation Forms-A"](V)||Hn["Arabic Presentation Forms-B"](V))));if(S.imageName){var R=n[S.imageName];if(!R)continue;L=S.imageName,t.iconsInText=t.iconsInText||!0,D=R.paddedRect;var k=R.displaySize;S.scale=24*S.scale/h,I=x+(24-k[1]*S.scale),O=(P={width:k[0],height:k[1],left:1,top:-3,advance:F?k[1]:k[0]}).advance;var z=F?k[0]*S.scale-24*b:k[1]*S.scale-24*b;z>0&&z>B&&(B=z)}else{var U=i[S.fontStack],N=U&&U[M];if(N&&N.rect)D=N.rect,P=N.metrics;else{var G=e[S.fontStack],Z=G&&G[M];if(!Z)continue;P=Z.metrics}I=24*(b-S.scale)}F?(t.verticalizable=!0,C.push({glyph:M,imageName:L,x:d,y:p+I,vertical:F,scale:S.scale,fontStack:S.fontStack,sectionIndex:T,metrics:P,rect:D}),d+=O*S.scale+c):(C.push({glyph:M,imageName:L,x:d,y:p+I,vertical:F,scale:S.scale,fontStack:S.fontStack,sectionIndex:T,metrics:P,rect:D}),d+=P.advance*S.scale+c)}0!==C.length&&(A=Math.max(d-c,A),Ll(C,0,C.length-1,g,B)),d=0;var j=o*b+B;w.lineOffset=Math.max(B,x),p+=j,f=Math.max(j,f),++m}else p+=o,++m}var V,H=p- -17,J=Dl(s),W=J.horizontalAlign,Q=J.verticalAlign;(function(t,e,i,n,r,o,s,a,l){var c,u=(e-i)*r;c=o!==s?-a*n- -17:(-n*l+.5)*s;for(var h=0,d=t;h<d.length;h+=1)for(var p=0,A=d[h].positionedGlyphs;p<A.length;p+=1){var f=A[p];f.x+=u,f.y+=c}})(t.positionedLines,g,W,Q,A,f,o,H,r.length),t.top+=-Q*H,t.bottom=t.top+H,t.left+=-W*A,t.right=t.left+A}(I,e,i,n,g,s,a,l,h,c,d,f),!function(t){for(var e=0,i=t;e<i.length;e+=1)if(0!==i[e].positionedGlyphs.length)return!1;return!0}(M)&&I}wl.fromFeature=function(t,e){for(var i=new wl,n=0;n<t.sections.length;n++){var r=t.sections[n];r.image?i.addImageSection(r):i.addTextSection(r,e)}return i},wl.prototype.length=function(){return this.text.length},wl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},wl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},wl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},wl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",i=0;i<t.length;i++){var n=t.charCodeAt(i+1)||null,r=t.charCodeAt(i-1)||null;e+=n&&Qn(n)&&!Wa[t[i+1]]||r&&Qn(r)&&!Wa[t[i-1]]||!Wa[t[i]]?t[i]:Wa[t[i]]}return e}(this.text)},wl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&Bl[this.text.charCodeAt(e)];e++)t++;for(var i=this.text.length,n=this.text.length-1;n>=0&&n>=t&&Bl[this.text.charCodeAt(n)];n--)i--;this.text=this.text.substring(t,i),this.sectionIndex=this.sectionIndex.slice(t,i)},wl.prototype.substring=function(t,e){var i=new wl;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i},wl.prototype.toString=function(){return this.text},wl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,i){return Math.max(e,t.sections[i].scale)}),0)},wl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(xl.forText(t.scale,t.fontStack||e));for(var i=this.sections.length-1,n=0;n<t.text.length;++n)this.sectionIndex.push(i)},wl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";if(0!==e.length){var i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push(xl.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401")}else w("Can't add FormattedSection with an empty image.")},wl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var Bl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},El={};function Sl(t,e,i,n,r,o){if(e.imageName){var s=n[e.imageName];return s?s.displaySize[0]*e.scale*24/o+r:0}var a=i[e.fontStack],l=a&&a[t];return l?l.metrics.advance*e.scale+r:0}function Tl(t,e,i,n){var r=Math.pow(t-e,2);return n?t<e?r/2:2*r:r+Math.abs(i)*i}function Ml(t,e,i){var n=0;return 10===t&&(n-=1e4),i&&(n+=150),40!==t&&65288!==t||(n+=50),41!==e&&65289!==e||(n+=50),n}function Il(t,e,i,n,r,o){for(var s=null,a=Tl(e,i,r,o),l=0,c=n;l<c.length;l+=1){var u=c[l],h=Tl(e-u.x,i,r,o)+u.badness;h<=a&&(s=u,a=h)}return{index:t,x:e,priorBreak:s,badness:a}}function Pl(t,e,i,n,r,o,s){if("point"!==o)return[];if(!t)return[];for(var a,l=[],c=function(t,e,i,n,r,o){for(var s=0,a=0;a<t.length();a++){var l=t.getSection(a);s+=Sl(t.getCharCode(a),l,n,r,e,o)}return s/Math.max(1,Math.ceil(s/i))}(t,e,i,n,r,s),u=t.text.indexOf("\u200b")>=0,h=0,d=0;d<t.length();d++){var p=t.getSection(d),A=t.getCharCode(d);if(Bl[A]||(h+=Sl(A,p,n,r,e,s)),d<t.length()-1){var f=!((a=A)<11904||!(Hn["Bopomofo Extended"](a)||Hn.Bopomofo(a)||Hn["CJK Compatibility Forms"](a)||Hn["CJK Compatibility Ideographs"](a)||Hn["CJK Compatibility"](a)||Hn["CJK Radicals Supplement"](a)||Hn["CJK Strokes"](a)||Hn["CJK Symbols and Punctuation"](a)||Hn["CJK Unified Ideographs Extension A"](a)||Hn["CJK Unified Ideographs"](a)||Hn["Enclosed CJK Letters and Months"](a)||Hn["Halfwidth and Fullwidth Forms"](a)||Hn.Hiragana(a)||Hn["Ideographic Description Characters"](a)||Hn["Kangxi Radicals"](a)||Hn["Katakana Phonetic Extensions"](a)||Hn.Katakana(a)||Hn["Vertical Forms"](a)||Hn["Yi Radicals"](a)||Hn["Yi Syllables"](a)));(El[A]||f||p.imageName)&&l.push(Il(d+1,h,c,l,Ml(A,t.getCharCode(d+1),f&&u),!1))}}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(Il(t.length(),h,c,l,0,!0))}function Dl(t){var e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function Ll(t,e,i,n,r){if(n||r)for(var o=t[i],s=(t[i].x+o.metrics.advance*o.scale)*n,a=e;a<=i;a++)t[a].x-=s,t[a].y+=r}function Ol(t,e,i,n,r,o){var s,a=t.image;if(a.content){var l=a.content,c=a.pixelRatio||1;s=[l[0]/c,l[1]/c,a.displaySize[0]-l[2]/c,a.displaySize[1]-l[3]/c]}var u,h,d,p,A=e.left*o,f=e.right*o;"width"===i||"both"===i?(p=r[0]+A-n[3],h=r[0]+f+n[1]):h=(p=r[0]+(A+f-a.displaySize[0])/2)+a.displaySize[0];var g=e.top*o,m=e.bottom*o;return"height"===i||"both"===i?(u=r[1]+g-n[0],d=r[1]+m+n[2]):d=(u=r[1]+(g+m-a.displaySize[1])/2)+a.displaySize[1],{image:a,top:u,right:h,bottom:d,left:p,collisionPadding:s}}El[10]=!0,El[32]=!0,El[38]=!0,El[40]=!0,El[41]=!0,El[43]=!0,El[45]=!0,El[47]=!0,El[173]=!0,El[183]=!0,El[8203]=!0,El[8208]=!0,El[8211]=!0,El[8231]=!0;var Fl=function(t){function e(e,i,n,r){t.call(this,e,i),this.angle=n,void 0!==r&&(this.segment=r)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.clone=function(){return new e(this.x,this.y,this.angle,this.segment)},e}(r);function Rl(t,e){var i=e.expression;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new ar(t+1))};if("source"===i.kind)return{kind:"source"};for(var n=i.zoomStops,r=i.interpolationType,o=0;o<n.length&&n[o]<=t;)o++;for(var s=o=Math.max(0,o-1);s<n.length&&n[s]<t+1;)s++;s=Math.min(n.length-1,s);var a=n[o],l=n[s];return"composite"===i.kind?{kind:"composite",minZoom:a,maxZoom:l,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:l,minSize:i.evaluate(new ar(a)),maxSize:i.evaluate(new ar(l)),interpolationType:r}}function kl(t,e,i){var n=e.uSize,r=i.lowerSize;return"source"===t.kind?r/128:"composite"===t.kind?Ve(r/128,i.upperSize/128,e.uSizeT):n}function zl(t,e){var i=0,n=0;if("constant"===t.kind)n=t.layoutSize;else if("source"!==t.kind){var r=t.interpolationType,o=r?u(oi.interpolationFactor(r,e,t.minZoom,t.maxZoom),0,1):0;"camera"===t.kind?n=Ve(t.minSize,t.maxSize,o):i=o}return{uSizeT:i,uSize:n}}zn("Anchor",Fl);var Ul=Object.freeze({__proto__:null,getSizeData:Rl,evaluateSizeForFeature:kl,evaluateSizeForZoom:zl,SIZE_PACK_FACTOR:128});function Nl(t,e,i,n,r){if(void 0===e.segment)return!0;for(var o=e,s=e.segment+1,a=0;a>-i/2;){if(--s<0)return!1;a-=t[s].dist(o),o=t[s]}a+=t[s].dist(t[s+1]),s++;for(var l=[],c=0;a<i/2;){var u=t[s],h=t[s+1];if(!h)return!1;var d=t[s-1].angleTo(u)-u.angleTo(h);for(d=Math.abs((d+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:a,angleDelta:d}),c+=d;a-l[0].distance>n;)c-=l.shift().angleDelta;if(c>r)return!1;s++,a+=u.dist(h)}return!0}function Gl(t){for(var e=0,i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function Zl(t,e,i){return t?.6*e*i:0}function jl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Vl(t,e,i,n,r,o){for(var s=Zl(i,r,o),a=jl(i,n)*o,l=0,c=Gl(t)/2,u=0;u<t.length-1;u++){var h=t[u],d=t[u+1],p=h.dist(d);if(l+p>c){var A=(c-l)/p,f=Ve(h.x,d.x,A),g=Ve(h.y,d.y,A),m=new Fl(f,g,d.angleTo(h),u);return m._round(),!s||Nl(t,m,a,s,e)?m:void 0}l+=p}}function Hl(t,e,i,n,r,o,s,a,l){var c=Zl(n,o,s),u=jl(n,r),h=u*s,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-h<e/4&&(e=h+e/4),function t(e,i,n,r,o,s,a,l,c){for(var u=s/2,h=Gl(e),d=0,p=i-n,A=[],f=0;f<e.length-1;f++){for(var g=e[f],m=e[f+1],y=g.dist(m),v=m.angleTo(g);p+n<d+y;){var _=((p+=n)-d)/y,b=Ve(g.x,m.x,_),x=Ve(g.y,m.y,_);if(b>=0&&b<c&&x>=0&&x<c&&p-u>=0&&p+u<=h){var w=new Fl(b,x,v,f);w._round(),r&&!Nl(e,w,s,r,o)||A.push(w)}}d+=y}return l||A.length||a||(A=t(e,d/2,n,r,o,s,a,!0,c)),A}(t,d?e/2*a%e:(u/2+2*o)*s*a%e,e,c,i,h,d,!1,l)}function Jl(t,e,i,n,o){for(var s=[],a=0;a<t.length;a++)for(var l=t[a],c=void 0,u=0;u<l.length-1;u++){var h=l[u],d=l[u+1];h.x<e&&d.x<e||(h.x<e?h=new r(e,h.y+(e-h.x)/(d.x-h.x)*(d.y-h.y))._round():d.x<e&&(d=new r(e,h.y+(e-h.x)/(d.x-h.x)*(d.y-h.y))._round()),h.y<i&&d.y<i||(h.y<i?h=new r(h.x+(i-h.y)/(d.y-h.y)*(d.x-h.x),i)._round():d.y<i&&(d=new r(h.x+(i-h.y)/(d.y-h.y)*(d.x-h.x),i)._round()),h.x>=n&&d.x>=n||(h.x>=n?h=new r(n,h.y+(n-h.x)/(d.x-h.x)*(d.y-h.y))._round():d.x>=n&&(d=new r(n,h.y+(n-h.x)/(d.x-h.x)*(d.y-h.y))._round()),h.y>=o&&d.y>=o||(h.y>=o?h=new r(h.x+(o-h.y)/(d.y-h.y)*(d.x-h.x),o)._round():d.y>=o&&(d=new r(h.x+(o-h.y)/(d.y-h.y)*(d.x-h.x),o)._round()),c&&h.equals(c[c.length-1])||s.push(c=[h]),c.push(d)))))}return s}function Wl(t,e,i,n){var o=[],s=t.image,a=s.pixelRatio,l=s.paddedRect.w-2,c=s.paddedRect.h-2,u=t.right-t.left,h=t.bottom-t.top,d=s.stretchX||[[0,l]],p=s.stretchY||[[0,c]],A=function(t,e){return t+e[1]-e[0]},f=d.reduce(A,0),g=p.reduce(A,0),m=l-f,y=c-g,v=0,_=f,b=0,x=g,w=0,C=m,B=0,E=y;if(s.content&&n){var S=s.content;v=Ql(d,0,S[0]),b=Ql(p,0,S[1]),_=Ql(d,S[0],S[2]),x=Ql(p,S[1],S[3]),w=S[0]-v,B=S[1]-b,C=S[2]-S[0]-_,E=S[3]-S[1]-x}var T=function(n,o,l,c){var d=Kl(n.stretch-v,_,u,t.left),p=Xl(n.fixed-w,C,n.stretch,f),A=Kl(o.stretch-b,x,h,t.top),m=Xl(o.fixed-B,E,o.stretch,g),y=Kl(l.stretch-v,_,u,t.left),S=Xl(l.fixed-w,C,l.stretch,f),T=Kl(c.stretch-b,x,h,t.top),M=Xl(c.fixed-B,E,c.stretch,g),I=new r(d,A),P=new r(y,A),D=new r(y,T),L=new r(d,T),O=new r(p/a,m/a),F=new r(S/a,M/a),R=e*Math.PI/180;if(R){var k=Math.sin(R),z=Math.cos(R),U=[z,-k,k,z];I._matMult(U),P._matMult(U),L._matMult(U),D._matMult(U)}var N=n.stretch+n.fixed,G=o.stretch+o.fixed;return{tl:I,tr:P,bl:L,br:D,tex:{x:s.paddedRect.x+1+N,y:s.paddedRect.y+1+G,w:l.stretch+l.fixed-N,h:c.stretch+c.fixed-G},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:O,pixelOffsetBR:F,minFontScaleX:C/a/u,minFontScaleY:E/a/h,isSDF:i}};if(n&&(s.stretchX||s.stretchY))for(var M=ql(d,m,f),I=ql(p,y,g),P=0;P<M.length-1;P++)for(var D=M[P],L=M[P+1],O=0;O<I.length-1;O++)o.push(T(D,I[O],L,I[O+1]));else o.push(T({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return o}function Ql(t,e,i){for(var n=0,r=0,o=t;r<o.length;r+=1){var s=o[r];n+=Math.max(e,Math.min(i,s[1]))-Math.max(e,Math.min(i,s[0]))}return n}function ql(t,e,i){for(var n=[{fixed:-1,stretch:0}],r=0,o=t;r<o.length;r+=1){var s=o[r],a=s[0],l=s[1],c=n[n.length-1];n.push({fixed:a-c.stretch,stretch:c.stretch}),n.push({fixed:a-c.stretch,stretch:c.stretch+(l-a)})}return n.push({fixed:e+1,stretch:i}),n}function Kl(t,e,i,n){return t/e*i+n}function Xl(t,e,i,n){return t-e*i/n}var Yl=function(t,e,i,n,o,s,a,l,c,u){if(this.boxStartIndex=t.length,c){var h=s.top,d=s.bottom,p=s.collisionPadding;p&&(h-=p[1],d+=p[3]);var A=d-h;A>0&&(A=Math.max(10,A),this.circleDiameter=A)}else{var f=s.top*a-l,g=s.bottom*a+l,m=s.left*a-l,y=s.right*a+l,v=s.collisionPadding;if(v&&(m-=v[0]*a,f-=v[1]*a,y+=v[2]*a,g+=v[3]*a),u){var _=new r(m,f),b=new r(y,f),x=new r(m,g),w=new r(y,g),C=u*Math.PI/180;_._rotate(C),b._rotate(C),x._rotate(C),w._rotate(C),m=Math.min(_.x,b.x,x.x,w.x),y=Math.max(_.x,b.x,x.x,w.x),f=Math.min(_.y,b.y,x.y,w.y),g=Math.max(_.y,b.y,x.y,w.y)}t.emplaceBack(e.x,e.y,m,f,y,g,i,n,o)}this.boxEndIndex=t.length},$l=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=tc),this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(var i=(this.length>>1)-1;i>=0;i--)this._down(i)};function tc(t,e){return t<e?-1:t>e?1:0}function ec(t,e,i){void 0===e&&(e=1),void 0===i&&(i=!1);for(var n=1/0,o=1/0,s=-1/0,a=-1/0,l=t[0],c=0;c<l.length;c++){var u=l[c];(!c||u.x<n)&&(n=u.x),(!c||u.y<o)&&(o=u.y),(!c||u.x>s)&&(s=u.x),(!c||u.y>a)&&(a=u.y)}var h=Math.min(s-n,a-o),d=h/2,p=new $l([],ic);if(0===h)return new r(n,o);for(var A=n;A<s;A+=h)for(var f=o;f<a;f+=h)p.push(new nc(A+d,f+d,d,t));for(var g=function(t){for(var e=0,i=0,n=0,r=t[0],o=0,s=r.length,a=s-1;o<s;a=o++){var l=r[o],c=r[a],u=l.x*c.y-c.x*l.y;i+=(l.x+c.x)*u,n+=(l.y+c.y)*u,e+=3*u}return new nc(i/e,n/e,0,t)}(t),m=p.length;p.length;){var y=p.pop();(y.d>g.d||!g.d)&&(g=y,i&&console.log("found best %d after %d probes",Math.round(1e4*y.d)/1e4,m)),y.max-g.d<=e||(p.push(new nc(y.p.x-(d=y.h/2),y.p.y-d,d,t)),p.push(new nc(y.p.x+d,y.p.y-d,d,t)),p.push(new nc(y.p.x-d,y.p.y+d,d,t)),p.push(new nc(y.p.x+d,y.p.y+d,d,t)),m+=4)}return i&&(console.log("num probes: "+m),console.log("best distance: "+g.d)),g.p}function ic(t,e){return e.max-t.max}function nc(t,e,i,n){this.p=new r(t,e),this.h=i,this.d=function(t,e){for(var i=!1,n=1/0,r=0;r<e.length;r++)for(var o=e[r],s=0,a=o.length,l=a-1;s<a;l=s++){var c=o[s],u=o[l];c.y>t.y!=u.y>t.y&&t.x<(u.x-c.x)*(t.y-c.y)/(u.y-c.y)+c.x&&(i=!i),n=Math.min(n,Xo(t,c,u))}return(i?1:-1)*Math.sqrt(n)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}$l.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},$l.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,this.length>0&&(this.data[0]=e,this._down(0)),t}},$l.prototype.peek=function(){return this.data[0]},$l.prototype._up=function(t){for(var e=this.data,i=this.compare,n=e[t];t>0;){var r=t-1>>1,o=e[r];if(i(n,o)>=0)break;e[t]=o,t=r}e[t]=n},$l.prototype._down=function(t){for(var e=this.data,i=this.compare,n=this.length>>1,r=e[t];t<n;){var o=1+(t<<1),s=e[o],a=o+1;if(a<this.length&&i(e[a],s)<0&&(o=a,s=e[a]),i(s,r)>=0)break;e[t]=s,t=o}e[t]=r};var rc=Number.POSITIVE_INFINITY;function oc(t,e){return e[1]!==rc?function(t,e,i){var n=0,r=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":r=i-7;break;case"bottom-right":case"bottom-left":case"bottom":r=7-i}switch(t){case"top-right":case"bottom-right":case"right":n=-e;break;case"top-left":case"bottom-left":case"left":n=e}return[n,r]}(t,e[0],e[1]):function(t,e){var i=0,n=0;e<0&&(e=0);var r=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":n=r-7;break;case"bottom-right":case"bottom-left":n=7-r;break;case"bottom":n=7-e;break;case"top":n=e-7}switch(t){case"top-right":case"bottom-right":i=-r;break;case"top-left":case"bottom-left":i=r;break;case"left":i=e;break;case"right":i=-e}return[i,n]}(t,e[0])}function sc(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function ac(t,e,i,n,o,s,a,l,c,u,h,d,p,A,f){var g=function(t,e,i,n,o,s,a,l){for(var c=n.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,u=[],h=0,d=e.positionedLines;h<d.length;h+=1)for(var p=d[h],A=0,f=p.positionedGlyphs;A<f.length;A+=1){var g=f[A];if(g.rect){var m=g.rect||{},y=4,v=!0,_=1,b=0,x=(o||l)&&g.vertical,w=g.metrics.advance*g.scale/2;if(l&&e.verticalizable&&(b=p.lineOffset/2-(g.imageName?-(24-g.metrics.width*g.scale)/2:24*(g.scale-1))),g.imageName){var C=a[g.imageName];v=C.sdf,y=1/(_=C.pixelRatio)}var B=o?[g.x+w,g.y]:[0,0],E=o?[0,0]:[g.x+w+i[0],g.y+i[1]-b],S=[0,0];x&&(S=E,E=[0,0]);var T=(g.metrics.left-y)*g.scale-w+E[0],M=(-g.metrics.top-y)*g.scale+E[1],I=T+m.w*g.scale/_,P=M+m.h*g.scale/_,D=new r(T,M),L=new r(I,M),O=new r(T,P),F=new r(I,P);if(x){var R=new r(-w,w- -17),k=-Math.PI/2,z=12-w,U=new r(22-z,-(g.imageName?z:0)),N=new(Function.prototype.bind.apply(r,[null].concat(S)));D._rotateAround(k,R)._add(U)._add(N),L._rotateAround(k,R)._add(U)._add(N),O._rotateAround(k,R)._add(U)._add(N),F._rotateAround(k,R)._add(U)._add(N)}if(c){var G=Math.sin(c),Z=Math.cos(c),j=[Z,-G,G,Z];D._matMult(j),L._matMult(j),O._matMult(j),F._matMult(j)}var V=new r(0,0),H=new r(0,0);u.push({tl:D,tr:L,bl:O,br:F,tex:m,writingMode:e.writingMode,glyphOffset:B,sectionIndex:g.sectionIndex,isSDF:v,pixelOffsetTL:V,pixelOffsetBR:H,minFontScaleX:0,minFontScaleY:0})}}return u}(0,i,l,o,s,a,n,t.allowVerticalPlacement),m=t.textSizeData,y=null;"source"===m.kind?(y=[128*o.layout.get("text-size").evaluate(a,{})])[0]>32640&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===m.kind&&((y=[128*A.compositeTextSizes[0].evaluate(a,{},f),128*A.compositeTextSizes[1].evaluate(a,{},f)])[0]>32640||y[1]>32640)&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,g,y,l,s,a,u,e,c.lineStartIndex,c.lineLength,p,f);for(var v=0,_=h;v<_.length;v+=1)d[_[v]]=t.text.placedSymbolArray.length-1;return 4*g.length}function lc(t){for(var e in t)return t[e];return null}function cc(t,e,i,n){var r=t.compareText;if(e in r){for(var o=r[e],s=o.length-1;s>=0;s--)if(n.dist(o[s])<i)return!0}else r[e]=[];return r[e].push(n),!1}var uc=_a.VectorTileFeature.types,hc=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function dc(t,e,i,n,r,o,s,a,l,c,u,h,d){var p=a?Math.min(32640,Math.round(a[0])):0,A=a?Math.min(32640,Math.round(a[1])):0;t.emplaceBack(e,i,Math.round(32*n),Math.round(32*r),o,s,(p<<1)+(l?1:0),A,16*c,16*u,256*h,256*d)}function pc(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function Ac(t){for(var e=0,i=t.sections;e<i.length;e+=1)if(Xn(i[e].text))return!0;return!1}var fc=function(t){this.layoutVertexArray=new Or,this.indexArray=new Gr,this.programConfigurations=t,this.segments=new ao,this.dynamicLayoutVertexArray=new Fr,this.opacityVertexArray=new Rr,this.placedSymbolArray=new $r};fc.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},fc.prototype.upload=function(t,e,i,n){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ga.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Za.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,hc,!0),this.opacityVertexBuffer.itemSize=1),(i||n)&&this.programConfigurations.upload(t))},fc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},zn("SymbolBuffers",fc);var gc=function(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new ao,this.collisionVertexArray=new Nr};gc.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,ja.members,!0)},gc.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},zn("CollisionBuffers",gc);var mc=function(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=as([]),this.placementViewportMatrix=as([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Rl(this.zoom,e["text-size"]),this.iconSizeData=Rl(this.zoom,e["icon-size"]);var i=this.layers[0].layout,n=i.get("symbol-sort-key"),r=i.get("symbol-z-order");this.canOverlap=i.get("text-allow-overlap")||i.get("icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==r&&void 0!==n.constantOr(1),this.sortFeaturesByY=("viewport-y"===r||"auto"===r&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map((function(t){return bl[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID};mc.prototype.createArrays=function(){this.text=new fc(new Fo(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new fc(new Fo(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new io,this.lineVertexArray=new no,this.symbolInstances=new eo},mc.prototype.calculateGlyphDependencies=function(t,e,i,n,r){for(var o=0;o<t.length;o++)if(e[t.charCodeAt(o)]=!0,(i||n)&&r){var s=Wa[t.charAt(o)];s&&(e[s.charCodeAt(0)]=!0)}},mc.prototype.populate=function(t,e,i){var n=this.layers[0],r=n.layout,o=r.get("text-font"),s=r.get("text-field"),a=r.get("icon-image"),l=("constant"!==s.value.kind||s.value.value instanceof ne&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==o.value.kind||o.value.value.length>0),c="constant"!==a.value.kind||!!a.value.value||Object.keys(a.parameters).length>0,u=r.get("symbol-sort-key");if(this.features=[],l||c){for(var h=e.iconDependencies,d=e.glyphDependencies,p=e.availableImages,A=new ar(this.zoom),f=0,g=t;f<g.length;f+=1){var m=g[f],y=m.feature,v=m.id,_=m.index,b=m.sourceLayerIndex,x=n._featureFilter.needGeometry,w=Go(y,x);if(n._featureFilter.filter(A,w,i)){x||(w.geometry=No(y));var C=void 0;if(l){var B=n.getValueAndResolveTokens("text-field",w,i,p),E=ne.factory(B);Ac(E)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===rr()||this.hasRTLText&&sr.isParsed())&&(C=Ja(E,n,w))}var S=void 0;if(c){var T=n.getValueAndResolveTokens("icon-image",w,i,p);S=T instanceof re?T:re.fromString(T)}if(C||S){var M=this.sortFeaturesByKey?u.evaluate(w,{},i):void 0;if(this.features.push({id:v,text:C,icon:S,index:_,sourceLayerIndex:b,geometry:w.geometry,properties:y.properties,type:uc[y.type],sortKey:M}),S&&(h[S.name]=!0),C){var I=o.evaluate(w,{},i).join(","),P="map"===r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(bl.vertical)>=0;for(var D=0,L=C.sections;D<L.length;D+=1){var O=L[D];if(O.image)h[O.image.name]=!0;else{var F=Jn(C.toString()),R=O.fontStack||I,k=d[R]=d[R]||{};this.calculateGlyphDependencies(O.text,k,P,this.allowVerticalPlacement,F)}}}}}}"line"===r.get("symbol-placement")&&(this.features=function(t){var e={},i={},n=[],r=0;function o(e){n.push(t[e]),r++}function s(t,e,r){var o=i[t];return delete i[t],i[e]=o,n[o].geometry[0].pop(),n[o].geometry[0]=n[o].geometry[0].concat(r[0]),o}function a(t,i,r){var o=e[i];return delete e[i],e[t]=o,n[o].geometry[0].shift(),n[o].geometry[0]=r[0].concat(n[o].geometry[0]),o}function l(t,e,i){var n=i?e[0][e[0].length-1]:e[0][0];return t+":"+n.x+":"+n.y}for(var c=0;c<t.length;c++){var u=t[c],h=u.geometry,d=u.text?u.text.toString():null;if(d){var p=l(d,h),A=l(d,h,!0);if(p in i&&A in e&&i[p]!==e[A]){var f=a(p,A,h),g=s(p,A,n[f].geometry);delete e[p],delete i[A],i[l(d,n[g].geometry,!0)]=g,n[f].geometry=null}else p in i?s(p,A,h):A in e?a(p,A,h):(o(c),e[p]=r-1,i[A]=r-1)}else o(c)}return n.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},mc.prototype.update=function(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i))},mc.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},mc.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},mc.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},mc.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},mc.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},mc.prototype.addToLineVertexArray=function(t,e){var i=this.lineVertexArray.length;if(void 0!==t.segment){for(var n=t.dist(e[t.segment+1]),r=t.dist(e[t.segment]),o={},s=t.segment+1;s<e.length;s++)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},s<e.length-1&&(n+=e[s+1].dist(e[s]));for(var a=t.segment||0;a>=0;a--)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:r},a>0&&(r+=e[a-1].dist(e[a]));for(var l=0;l<e.length;l++){var c=o[l];this.lineVertexArray.emplaceBack(c.x,c.y,c.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}},mc.prototype.addSymbols=function(t,e,i,n,r,o,s,a,l,c,u,h){for(var d=t.indexArray,p=t.layoutVertexArray,A=t.segments.prepareSegment(4*e.length,p,d,this.canOverlap?o.sortKey:void 0),f=this.glyphOffsetArray.length,g=A.vertexLength,m=this.allowVerticalPlacement&&s===bl.vertical?Math.PI/2:0,y=o.text&&o.text.sections,v=0;v<e.length;v++){var _=e[v],b=_.tl,x=_.tr,w=_.bl,C=_.br,B=_.tex,E=_.pixelOffsetTL,S=_.pixelOffsetBR,T=_.minFontScaleX,M=_.minFontScaleY,I=_.glyphOffset,P=_.isSDF,D=_.sectionIndex,L=A.vertexLength,O=I[1];dc(p,a.x,a.y,b.x,O+b.y,B.x,B.y,i,P,E.x,E.y,T,M),dc(p,a.x,a.y,x.x,O+x.y,B.x+B.w,B.y,i,P,S.x,E.y,T,M),dc(p,a.x,a.y,w.x,O+w.y,B.x,B.y+B.h,i,P,E.x,S.y,T,M),dc(p,a.x,a.y,C.x,O+C.y,B.x+B.w,B.y+B.h,i,P,S.x,S.y,T,M),pc(t.dynamicLayoutVertexArray,a,m),d.emplaceBack(L,L+1,L+2),d.emplaceBack(L+1,L+2,L+3),A.vertexLength+=4,A.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(I[0]),v!==e.length-1&&D===e[v+1].sectionIndex||t.programConfigurations.populatePaintArrays(p.length,o,o.index,{},h,y&&y[D])}t.placedSymbolArray.emplaceBack(a.x,a.y,f,this.glyphOffsetArray.length-f,g,l,c,a.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,!1,0,u)},mc.prototype._addCollisionDebugVertex=function(t,e,i,n,r,o){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,n,r,Math.round(o.x),Math.round(o.y))},mc.prototype.addCollisionDebugVertices=function(t,e,i,n,o,s,a){var l=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),c=l.vertexLength,u=o.layoutVertexArray,h=o.collisionVertexArray,d=a.anchorX,p=a.anchorY;this._addCollisionDebugVertex(u,h,s,d,p,new r(t,e)),this._addCollisionDebugVertex(u,h,s,d,p,new r(i,e)),this._addCollisionDebugVertex(u,h,s,d,p,new r(i,n)),this._addCollisionDebugVertex(u,h,s,d,p,new r(t,n)),l.vertexLength+=4;var A=o.indexArray;A.emplaceBack(c,c+1),A.emplaceBack(c+1,c+2),A.emplaceBack(c+2,c+3),A.emplaceBack(c+3,c),l.primitiveLength+=4},mc.prototype.addDebugCollisionBoxes=function(t,e,i,n){for(var r=t;r<e;r++){var o=this.collisionBoxArray.get(r);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,n?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,i)}},mc.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new gc(zr,Va.members,Wr),this.iconCollisionBox=new gc(zr,Va.members,Wr);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},mc.prototype._deserializeCollisionBoxesForSymbol=function(t,e,i,n,r,o,s,a,l){for(var c={},u=e;u<i;u++){var h=t.get(u);c.textBox={x1:h.x1,y1:h.y1,x2:h.x2,y2:h.y2,anchorPointX:h.anchorPointX,anchorPointY:h.anchorPointY},c.textFeatureIndex=h.featureIndex;break}for(var d=n;d<r;d++){var p=t.get(d);c.verticalTextBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},c.verticalTextFeatureIndex=p.featureIndex;break}for(var A=o;A<s;A++){var f=t.get(A);c.iconBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},c.iconFeatureIndex=f.featureIndex;break}for(var g=a;g<l;g++){var m=t.get(g);c.verticalIconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},c.verticalIconFeatureIndex=m.featureIndex;break}return c},mc.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}},mc.prototype.hasTextData=function(){return this.text.segments.get().length>0},mc.prototype.hasIconData=function(){return this.icon.segments.get().length>0},mc.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},mc.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},mc.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},mc.prototype.addIndicesForPlacedSymbol=function(t,e){for(var i=t.placedSymbolArray.get(e),n=i.vertexStartIndex+4*i.numGlyphs,r=i.vertexStartIndex;r<n;r+=4)t.indexArray.emplaceBack(r,r+1,r+2),t.indexArray.emplaceBack(r+1,r+2,r+3)},mc.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),i=Math.cos(t),n=[],r=[],o=[],s=0;s<this.symbolInstances.length;++s){o.push(s);var a=this.symbolInstances.get(s);n.push(0|Math.round(e*a.anchorX+i*a.anchorY)),r.push(a.featureIndex)}return o.sort((function(t,e){return n[t]-n[e]||r[e]-r[t]})),o},mc.prototype.addToSortKeyRanges=function(t,e){var i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},mc.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var i=0,n=this.symbolInstanceIndexes;i<n.length;i+=1){var r=this.symbolInstances.get(n[i]);this.featureSortOrder.push(r.featureIndex),[r.rightJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.leftJustifiedTextSymbolIndex].forEach((function(t,i,n){t>=0&&n.indexOf(t)===i&&e.addIndicesForPlacedSymbol(e.text,t)})),r.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,r.verticalPlacedTextSymbolIndex),r.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.placedIconSymbolIndex),r.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,r.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},zn("SymbolBucket",mc,{omit:["layers","collisionBoxArray","features","compareText"]}),mc.MAX_GLYPHS=65535,mc.addDynamicAttributes=pc;var yc=new br({"symbol-placement":new gr(Mt.layout_symbol["symbol-placement"]),"symbol-spacing":new gr(Mt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new gr(Mt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new mr(Mt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new gr(Mt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new gr(Mt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new gr(Mt.layout_symbol["icon-ignore-placement"]),"icon-optional":new gr(Mt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new gr(Mt.layout_symbol["icon-rotation-alignment"]),"icon-size":new mr(Mt.layout_symbol["icon-size"]),"icon-text-fit":new gr(Mt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new gr(Mt.layout_symbol["icon-text-fit-padding"]),"icon-image":new mr(Mt.layout_symbol["icon-image"]),"icon-rotate":new mr(Mt.layout_symbol["icon-rotate"]),"icon-padding":new gr(Mt.layout_symbol["icon-padding"]),"icon-keep-upright":new gr(Mt.layout_symbol["icon-keep-upright"]),"icon-offset":new mr(Mt.layout_symbol["icon-offset"]),"icon-anchor":new mr(Mt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new gr(Mt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new gr(Mt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new gr(Mt.layout_symbol["text-rotation-alignment"]),"text-field":new mr(Mt.layout_symbol["text-field"]),"text-font":new mr(Mt.layout_symbol["text-font"]),"text-size":new mr(Mt.layout_symbol["text-size"]),"text-max-width":new mr(Mt.layout_symbol["text-max-width"]),"text-line-height":new gr(Mt.layout_symbol["text-line-height"]),"text-letter-spacing":new mr(Mt.layout_symbol["text-letter-spacing"]),"text-justify":new mr(Mt.layout_symbol["text-justify"]),"text-radial-offset":new mr(Mt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new gr(Mt.layout_symbol["text-variable-anchor"]),"text-anchor":new mr(Mt.layout_symbol["text-anchor"]),"text-max-angle":new gr(Mt.layout_symbol["text-max-angle"]),"text-writing-mode":new gr(Mt.layout_symbol["text-writing-mode"]),"text-rotate":new mr(Mt.layout_symbol["text-rotate"]),"text-padding":new gr(Mt.layout_symbol["text-padding"]),"text-keep-upright":new gr(Mt.layout_symbol["text-keep-upright"]),"text-transform":new mr(Mt.layout_symbol["text-transform"]),"text-offset":new mr(Mt.layout_symbol["text-offset"]),"text-allow-overlap":new gr(Mt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new gr(Mt.layout_symbol["text-ignore-placement"]),"text-optional":new gr(Mt.layout_symbol["text-optional"])}),vc={paint:new br({"icon-opacity":new mr(Mt.paint_symbol["icon-opacity"]),"icon-color":new mr(Mt.paint_symbol["icon-color"]),"icon-halo-color":new mr(Mt.paint_symbol["icon-halo-color"]),"icon-halo-width":new mr(Mt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new mr(Mt.paint_symbol["icon-halo-blur"]),"icon-translate":new gr(Mt.paint_symbol["icon-translate"]),"icon-translate-anchor":new gr(Mt.paint_symbol["icon-translate-anchor"]),"text-opacity":new mr(Mt.paint_symbol["text-opacity"]),"text-color":new mr(Mt.paint_symbol["text-color"],{runtimeType:Gt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new mr(Mt.paint_symbol["text-halo-color"]),"text-halo-width":new mr(Mt.paint_symbol["text-halo-width"]),"text-halo-blur":new mr(Mt.paint_symbol["text-halo-blur"]),"text-translate":new gr(Mt.paint_symbol["text-translate"]),"text-translate-anchor":new gr(Mt.paint_symbol["text-translate-anchor"])}),layout:yc},_c=function(t){this.type=t.property.overrides?t.property.overrides.runtimeType:kt,this.defaultValue=t};_c.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},_c.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},_c.prototype.outputDefined=function(){return!1},_c.prototype.serialize=function(){return null},zn("FormatSectionOverride",_c,{omit:["defaultValue"]});var bc=function(t){function e(e){t.call(this,e,vc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.recalculate=function(e,i){if(t.prototype.recalculate.call(this,e,i),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){var n=this.layout.get("text-writing-mode");if(n){for(var r=[],o=0,s=n;o<s.length;o+=1){var a=s[o];r.indexOf(a)<0&&r.push(a)}this.layout._values["text-writing-mode"]=r}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},e.prototype.getValueAndResolveTokens=function(t,e,i,n){var r=this.layout.get(t).evaluate(e,{},i,n),o=this._unevaluatedLayout._values[t];return o.isDataDriven()||Hi(o.value)||!r?r:function(t,e){return e.replace(/{([^{}]+)}/g,(function(e,i){return i in t?String(t[i]):""}))}(e.properties,r)},e.prototype.createBucket=function(t){return new mc(t)},e.prototype.queryRadius=function(){return 0},e.prototype.queryIntersectsFeature=function(){return!1},e.prototype._setPaintOverrides=function(){for(var t=0,i=vc.paint.overridableProperties;t<i.length;t+=1){var n=i[t];if(e.hasPaintOverride(this.layout,n)){var r,o=this.paint.get(n),s=new _c(o),a=new Vi(s,o.property.specification);r="constant"===o.value.kind||"source"===o.value.kind?new Wi("source",a):new Qi("composite",a,o.value.zoomStops,o.value._interpolationType),this.paint._values[n]=new Ar(o.property,r,o.parameters)}}},e.prototype._handleOverridablePaintPropertyUpdate=function(t,i,n){return!(!this.layout||i.isDataDriven()||n.isDataDriven())&&e.hasPaintOverride(this.layout,t)},e.hasPaintOverride=function(t,e){var i=t.get("text-field"),n=vc.paint.properties[e],r=!1,o=function(t){for(var e=0,i=t;e<i.length;e+=1)if(n.overrides&&n.overrides.hasOverride(i[e]))return void(r=!0)};if("constant"===i.value.kind&&i.value.value instanceof ne)o(i.value.value.sections);else if("source"===i.value.kind){var s=function(t){r||(t instanceof ce&&ae(t.value)===Ht?o(t.value.sections):t instanceof pe?o(t.sections):t.eachChild(s))},a=i.value;a._styleExpression&&s(a._styleExpression.expression)}return r},e}(xr),xc={paint:new br({"background-color":new gr(Mt.paint_background["background-color"]),"background-pattern":new vr(Mt.paint_background["background-pattern"]),"background-opacity":new gr(Mt.paint_background["background-opacity"])})},wc=function(t){function e(e){t.call(this,e,xc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(xr),Cc={paint:new br({"raster-opacity":new gr(Mt.paint_raster["raster-opacity"]),"raster-hue-rotate":new gr(Mt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new gr(Mt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new gr(Mt.paint_raster["raster-brightness-max"]),"raster-saturation":new gr(Mt.paint_raster["raster-saturation"]),"raster-contrast":new gr(Mt.paint_raster["raster-contrast"]),"raster-resampling":new gr(Mt.paint_raster["raster-resampling"]),"raster-fade-duration":new gr(Mt.paint_raster["raster-fade-duration"])})},Bc=function(t){function e(e){t.call(this,e,Cc)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(xr),Ec=function(t){function e(e){t.call(this,e,{}),this.implementation=e}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.is3D=function(){return"3d"===this.implementation.renderingMode},e.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},e.prototype.recalculate=function(){},e.prototype.updateTransitions=function(){},e.prototype.hasTransition=function(){},e.prototype.serialize=function(){},e.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},e.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},e}(xr),Sc={circle:ds,heatmap:xs,hillshade:Cs,fill:ua,"fill-extrusion":Sa,line:Ua,symbol:bc,background:wc,raster:Bc},Tc=s.HTMLImageElement,Mc=s.HTMLCanvasElement,Ic=s.HTMLVideoElement,Pc=s.ImageData,Dc=s.ImageBitmap,Lc=function(t,e,i,n){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,n)};Lc.prototype.update=function(t,e,i){var n=t.width,r=t.height,o=!(this.size&&this.size[0]===n&&this.size[1]===r||i),s=this.context,a=s.gl;if(this.useMipmap=Boolean(e&&e.useMipmap),a.bindTexture(a.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===a.RGBA&&(!e||!1!==e.premultiply)),o)this.size=[n,r],t instanceof Tc||t instanceof Mc||t instanceof Ic||t instanceof Pc||Dc&&t instanceof Dc?a.texImage2D(a.TEXTURE_2D,0,this.format,this.format,a.UNSIGNED_BYTE,t):a.texImage2D(a.TEXTURE_2D,0,this.format,n,r,0,this.format,a.UNSIGNED_BYTE,t.data);else{var l=i||{x:0,y:0},c=l.x,u=l.y;t instanceof Tc||t instanceof Mc||t instanceof Ic||t instanceof Pc||Dc&&t instanceof Dc?a.texSubImage2D(a.TEXTURE_2D,0,c,u,a.RGBA,a.UNSIGNED_BYTE,t):a.texSubImage2D(a.TEXTURE_2D,0,c,u,n,r,a.RGBA,a.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&a.generateMipmap(a.TEXTURE_2D)},Lc.prototype.bind=function(t,e,i){var n=this.context.gl;n.bindTexture(n.TEXTURE_2D,this.texture),i!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)},Lc.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},Lc.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var Oc=function(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})};Oc.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},Oc.prototype.remove=function(){delete this._channel,this._callback=function(){}};var Fc=function(t,e,i){this.target=t,this.parent=e,this.mapId=i,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},m(["receive","process"],this),this.invoker=new Oc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=E()?t:s};function Rc(t,e,i){var n=2*Math.PI*6378137/256/Math.pow(2,i);return[t*n-2*Math.PI*6378137/2,e*n-2*Math.PI*6378137/2]}Fc.prototype.send=function(t,e,i,n,r){var o=this;void 0===r&&(r=!1);var s=Math.round(1e18*Math.random()).toString(36).substring(0,10);i&&(this.callbacks[s]=i);var a=M(this.globalScope)?void 0:[];return this.target.postMessage({id:s,type:t,hasCallback:!!i,targetMapId:n,mustQueue:r,sourceMapId:this.mapId,data:Zn(e,a)},a),{cancel:function(){i&&delete o.callbacks[s],o.target.postMessage({id:s,type:"<cancel>",targetMapId:n,sourceMapId:o.mapId})}}},Fc.prototype.receive=function(t){var e=t.data,i=e.id;if(i&&(!e.targetMapId||this.mapId===e.targetMapId))if("<cancel>"===e.type){delete this.tasks[i];var n=this.cancelCallbacks[i];delete this.cancelCallbacks[i],n&&n()}else E()||e.mustQueue?(this.tasks[i]=e,this.taskQueue.push(i),this.invoker.trigger()):this.processTask(i,e)},Fc.prototype.process=function(){if(this.taskQueue.length){var t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e)}},Fc.prototype.processTask=function(t,e){var i=this;if("<response>"===e.type){var n=this.callbacks[t];delete this.callbacks[t],n&&(e.error?n(jn(e.error)):n(null,jn(e.data)))}else{var r=!1,o=M(this.globalScope)?void 0:[],s=e.hasCallback?function(e,n){r=!0,delete i.cancelCallbacks[t],i.target.postMessage({id:t,type:"<response>",sourceMapId:i.mapId,error:e?Zn(e):null,data:Zn(n,o)},o)}:function(t){r=!0},a=null,l=jn(e.data);if(this.parent[e.type])a=this.parent[e.type](e.sourceMapId,l,s);else if(this.parent.getWorkerSource){var c=e.type.split(".");a=this.parent.getWorkerSource(e.sourceMapId,c[0],l.source)[c[1]](l,s)}else s(new Error("Could not find function "+e.type));!r&&a&&a.cancel&&(this.cancelCallbacks[t]=a.cancel)}},Fc.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var kc=function(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))};kc.prototype.setNorthEast=function(t){return this._ne=t instanceof zc?new zc(t.lng,t.lat):zc.convert(t),this},kc.prototype.setSouthWest=function(t){return this._sw=t instanceof zc?new zc(t.lng,t.lat):zc.convert(t),this},kc.prototype.extend=function(t){var e,i,n=this._sw,r=this._ne;if(t instanceof zc)e=t,i=t;else{if(!(t instanceof kc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(kc.convert(t)):this.extend(zc.convert(t)):this;if(i=t._ne,!(e=t._sw)||!i)return this}return n||r?(n.lng=Math.min(e.lng,n.lng),n.lat=Math.min(e.lat,n.lat),r.lng=Math.max(i.lng,r.lng),r.lat=Math.max(i.lat,r.lat)):(this._sw=new zc(e.lng,e.lat),this._ne=new zc(i.lng,i.lat)),this},kc.prototype.getCenter=function(){return new zc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},kc.prototype.getSouthWest=function(){return this._sw},kc.prototype.getNorthEast=function(){return this._ne},kc.prototype.getNorthWest=function(){return new zc(this.getWest(),this.getNorth())},kc.prototype.getSouthEast=function(){return new zc(this.getEast(),this.getSouth())},kc.prototype.getWest=function(){return this._sw.lng},kc.prototype.getSouth=function(){return this._sw.lat},kc.prototype.getEast=function(){return this._ne.lng},kc.prototype.getNorth=function(){return this._ne.lat},kc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},kc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},kc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},kc.prototype.contains=function(t){var e=zc.convert(t),i=e.lng,n=e.lat,r=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=n&&n<=this._ne.lat&&r},kc.convert=function(t){return!t||t instanceof kc?t:new kc(t)};var zc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};zc.prototype.wrap=function(){return new zc(h(this.lng,-180,180),this.lat)},zc.prototype.toArray=function(){return[this.lng,this.lat]},zc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},zc.prototype.distanceTo=function(t){var e=Math.PI/180,i=this.lat*e,n=t.lat*e,r=Math.sin(i)*Math.sin(n)+Math.cos(i)*Math.cos(n)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(r,1))},zc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017,i=e/Math.cos(Math.PI/180*this.lat);return new kc(new zc(this.lng-i,this.lat-e),new zc(this.lng+i,this.lat+e))},zc.convert=function(t){if(t instanceof zc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new zc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new zc(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Uc=2*Math.PI*6371008.8;function Nc(t){return Uc*Math.cos(t*Math.PI/180)}function Gc(t){return(180+t)/360}function Zc(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function jc(t,e){return t/Nc(e)}function Vc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}var Hc=function(t,e,i){void 0===i&&(i=0),this.x=+t,this.y=+e,this.z=+i};Hc.fromLngLat=function(t,e){void 0===e&&(e=0);var i=zc.convert(t);return new Hc(Gc(i.lng),Zc(i.lat),jc(e,i.lat))},Hc.prototype.toLngLat=function(){return new zc(360*this.x-180,Vc(this.y))},Hc.prototype.toAltitude=function(){return this.z*Nc(Vc(this.y))},Hc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Uc*(t=Vc(this.y),1/Math.cos(t*Math.PI/180));var t};var Jc=function(t,e,i){this.z=t,this.x=e,this.y=i,this.key=qc(0,t,t,e,i)};Jc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Jc.prototype.url=function(t,e){var i,n,r,o,s,a=(n=this.y,r=this.z,o=Rc(256*(i=this.x),256*(n=Math.pow(2,r)-n-1),r),s=Rc(256*(i+1),256*(n+1),r),o[0]+","+o[1]+","+s[0]+","+s[1]),l=function(t,e,i){for(var n,r="",o=t;o>0;o--)r+=(e&(n=1<<o-1)?1:0)+(i&n?2:0);return r}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",l).replace("{bbox-epsg-3857}",a)},Jc.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new r(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Jc.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Wc=function(t,e){this.wrap=t,this.canonical=e,this.key=qc(t,e.z,e.z,e.x,e.y)},Qc=function(t,e,i,n,r){this.overscaledZ=t,this.wrap=e,this.canonical=new Jc(i,+n,+r),this.key=qc(e,t,i,n,r)};function qc(t,e,i,n,r){(t*=2)<0&&(t=-1*t-1);var o=1<<i;return(o*o*t+o*r+n).toString(36)+i.toString(36)+e.toString(36)}Qc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},Qc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new Qc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Qc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},Qc.prototype.calculateScaledKey=function(t,e){var i=this.canonical.z-t;return t>this.canonical.z?qc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):qc(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)},Qc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},Qc.prototype.children=function(t){if(this.overscaledZ>=t)return[new Qc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,i=2*this.canonical.x,n=2*this.canonical.y;return[new Qc(e,this.wrap,e,i,n),new Qc(e,this.wrap,e,i+1,n),new Qc(e,this.wrap,e,i,n+1),new Qc(e,this.wrap,e,i+1,n+1)]},Qc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},Qc.prototype.wrapped=function(){return new Qc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},Qc.prototype.unwrapTo=function(t){return new Qc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},Qc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},Qc.prototype.toUnwrapped=function(){return new Wc(this.wrap,this.canonical)},Qc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},Qc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Hc(t.x-this.wrap,t.y))},zn("CanonicalTileID",Jc),zn("OverscaledTileID",Qc,{omit:["posMatrix"]});var Kc=function(t,e,i){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&"mapbox"!==i&&"terrarium"!==i)return w('"'+i+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var n=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=i||"mapbox";for(var r=0;r<n;r++)this.data[this._idx(-1,r)]=this.data[this._idx(0,r)],this.data[this._idx(n,r)]=this.data[this._idx(n-1,r)],this.data[this._idx(r,-1)]=this.data[this._idx(r,0)],this.data[this._idx(r,n)]=this.data[this._idx(r,n-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(n,-1)]=this.data[this._idx(n-1,0)],this.data[this._idx(-1,n)]=this.data[this._idx(0,n-1)],this.data[this._idx(n,n)]=this.data[this._idx(n-1,n-1)]};Kc.prototype.get=function(t,e){var i=new Uint8Array(this.data.buffer),n=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(i[n],i[n+1],i[n+2])},Kc.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},Kc.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},Kc.prototype._unpackMapbox=function(t,e,i){return(256*t*256+256*e+i)/10-1e4},Kc.prototype._unpackTerrarium=function(t,e,i){return 256*t+e+i/256-32768},Kc.prototype.getPixels=function(){return new vs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},Kc.prototype.backfillBorder=function(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var n=e*this.dim,r=e*this.dim+this.dim,o=i*this.dim,s=i*this.dim+this.dim;switch(e){case-1:n=r-1;break;case 1:r=n+1}switch(i){case-1:o=s-1;break;case 1:s=o+1}for(var a=-e*this.dim,l=-i*this.dim,c=o;c<s;c++)for(var u=n;u<r;u++)this.data[this._idx(u,c)]=t.data[this._idx(u+a,c+l)]},zn("DEMData",Kc);var Xc=function(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}};Xc.prototype.encode=function(t){return this._stringToNumber[t]},Xc.prototype.decode=function(t){return this._numberToString[t]};var Yc=function(t,e,i,n,r){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=i,t._y=n,this.properties=t.properties,this.id=r},$c={geometry:{configurable:!0}};$c.geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},$c.geometry.set=function(t){this._geometry=t},Yc.prototype.toJSON=function(){var t={geometry:this.geometry};for(var e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t},Object.defineProperties(Yc.prototype,$c);var tu=function(){this.state={},this.stateChanges={},this.deletedStates={}};tu.prototype.updateState=function(t,e,i){var n=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},d(this.stateChanges[t][n],i),null===this.deletedStates[t])for(var r in this.deletedStates[t]={},this.state[t])r!==n&&(this.deletedStates[t][r]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][n])for(var o in this.deletedStates[t][n]={},this.state[t][n])i[o]||(this.deletedStates[t][n][o]=null);else for(var s in i)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][s]&&delete this.deletedStates[t][n][s]},tu.prototype.removeFeatureState=function(t,e,i){if(null!==this.deletedStates[t]){var n=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][n]&&(this.deletedStates[t][n]=this.deletedStates[t][n]||{},this.deletedStates[t][n][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][n])for(i in this.deletedStates[t][n]={},this.stateChanges[t][n])this.deletedStates[t][n][i]=null;else this.deletedStates[t][n]=null;else this.deletedStates[t]=null}},tu.prototype.getState=function(t,e){var i=String(e),n=d({},(this.state[t]||{})[i],(this.stateChanges[t]||{})[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var r=this.deletedStates[t][e];if(null===r)return{};for(var o in r)delete n[o]}return n},tu.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},tu.prototype.coalesceChanges=function(t,e){var i={};for(var n in this.stateChanges){this.state[n]=this.state[n]||{};var r={};for(var o in this.stateChanges[n])this.state[n][o]||(this.state[n][o]={}),d(this.state[n][o],this.stateChanges[n][o]),r[o]=this.state[n][o];i[n]=r}for(var s in this.deletedStates){this.state[s]=this.state[s]||{};var a={};if(null===this.deletedStates[s])for(var l in this.state[s])a[l]={},this.state[s][l]={};else for(var c in this.deletedStates[s]){if(null===this.deletedStates[s][c])this.state[s][c]={};else for(var u=0,h=Object.keys(this.deletedStates[s][c]);u<h.length;u+=1)delete this.state[s][c][h[u]];a[c]=this.state[s][c]}i[s]=i[s]||{},d(i[s],a)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(var p in t)t[p].setFeatureState(i,e)};var eu=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new Ln(8192,16,0),this.grid3D=new Ln(8192,16,0),this.featureIndexArray=new oo,this.promoteId=e};function iu(t,e,i,n,r){return v(t,(function(t,o){var s=e instanceof fr?e.get(o):null;return s&&s.evaluate?s.evaluate(i,n,r):s}))}function nu(t){for(var e=1/0,i=1/0,n=-1/0,r=-1/0,o=0,s=t;o<s.length;o+=1){var a=s[o];e=Math.min(e,a.x),i=Math.min(i,a.y),n=Math.max(n,a.x),r=Math.max(r,a.y)}return{minX:e,minY:i,maxX:n,maxY:r}}function ru(t,e){return e-t}eu.prototype.insert=function(t,e,i,n,r,o){var s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,n,r);for(var a=o?this.grid3D:this.grid,l=0;l<e.length;l++){for(var c=e[l],u=[1/0,1/0,-1/0,-1/0],h=0;h<c.length;h++){var d=c[h];u[0]=Math.min(u[0],d.x),u[1]=Math.min(u[1],d.y),u[2]=Math.max(u[2],d.x),u[3]=Math.max(u[3],d.y)}u[0]<8192&&u[1]<8192&&u[2]>=0&&u[3]>=0&&a.insert(s,u[0],u[1],u[2],u[3])}},eu.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new _a.VectorTile(new Ka(this.rawTileData)).layers,this.sourceLayerCoder=new Xc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},eu.prototype.query=function(t,e,i,n){var o=this;this.loadVTLayers();for(var s=t.params||{},a=8192/t.tileSize/t.scale,l=sn(s.filter),c=t.queryGeometry,u=t.queryPadding*a,h=nu(c),d=this.grid.query(h.minX-u,h.minY-u,h.maxX+u,h.maxY+u),p=nu(t.cameraQueryGeometry),A=this.grid3D.query(p.minX-u,p.minY-u,p.maxX+u,p.maxY+u,(function(e,i,n,o){return function(t,e,i,n,o){for(var s=0,a=t;s<a.length;s+=1){var l=a[s];if(e<=l.x&&i<=l.y&&n>=l.x&&o>=l.y)return!0}var c=[new r(e,i),new r(e,o),new r(n,o),new r(n,i)];if(t.length>2)for(var u=0,h=c;u<h.length;u+=1)if($o(t,h[u]))return!0;for(var d=0;d<t.length-1;d++)if(ts(t[d],t[d+1],c))return!0;return!1}(t.cameraQueryGeometry,e-u,i-u,n+u,o+u)})),f=0,g=A;f<g.length;f+=1)d.push(g[f]);d.sort(ru);for(var m,y={},v=function(r){var u=d[r];if(u!==m){m=u;var h=o.featureIndexArray.get(u),p=null;o.loadMatchingFeature(y,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,l,s.layers,s.availableImages,e,i,n,(function(e,i,n){return p||(p=No(e)),i.queryIntersectsFeature(c,e,n,p,o.z,t.transform,a,t.pixelPosMatrix)}))}},_=0;_<d.length;_++)v(_);return y},eu.prototype.loadMatchingFeature=function(t,e,i,n,r,o,s,a,l,c,u){var h=this.bucketLayerIDs[e];if(!o||function(t,e){for(var i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}(o,h)){var p=this.sourceLayerCoder.decode(i),A=this.vtLayers[p].feature(n);if(r.needGeometry){var f=Go(A,!0);if(!r.filter(new ar(this.tileID.overscaledZ),f,this.tileID.canonical))return}else if(!r.filter(new ar(this.tileID.overscaledZ),A))return;for(var g=this.getId(A,p),m=0;m<h.length;m++){var y=h[m];if(!(o&&o.indexOf(y)<0)){var v=a[y];if(v){var _={};void 0!==g&&c&&(_=c.getState(v.sourceLayer||"_geojsonTileLayer",g));var b=d({},l[y]);b.paint=iu(b.paint,v.paint,A,_,s),b.layout=iu(b.layout,v.layout,A,_,s);var x=!u||u(A,v,_);if(x){var w=new Yc(A,this.z,this.x,this.y,g);w.layer=b;var C=t[y];void 0===C&&(C=t[y]=[]),C.push({featureIndex:n,feature:w,intersectionZ:x})}}}}}},eu.prototype.lookupSymbolFeatures=function(t,e,i,n,r,o,s,a){var l={};this.loadVTLayers();for(var c=sn(r),u=0,h=t;u<h.length;u+=1)this.loadMatchingFeature(l,i,n,h[u],c,o,s,a,e);return l},eu.prototype.hasLayer=function(t){for(var e=0,i=this.bucketLayerIDs;e<i.length;e+=1)for(var n=0,r=i[e];n<r.length;n+=1)if(t===r[n])return!0;return!1},eu.prototype.getId=function(t,e){var i=t.id;return this.promoteId&&"boolean"==typeof(i=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(i=Number(i)),i},zn("FeatureIndex",eu,{omit:["rawTileData","sourceLayerCoder"]});var ou=function(t,e){this.tileID=t,this.uid=A(),this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};ou.prototype.registerFadeDuration=function(t){var e=t+this.timeAdded;e<z.now()||this.fadeEndTime&&e<this.fadeEndTime||(this.fadeEndTime=e)},ou.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},ou.prototype.loadVectorData=function(t,e,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var n in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var i={};if(!e)return i;for(var n=function(){var t=o[r],n=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==n.length){t.layers=n,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return n.filter((function(e){return e.id===t}))[0]})));for(var s=0,a=n;s<a.length;s+=1)i[a[s].id]=t}},r=0,o=t;r<o.length;r+=1)n();return i}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var r=this.buckets[n];if(r instanceof mc){if(this.hasSymbolBuckets=!0,!i)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var s=this.buckets[o];if(s instanceof mc&&s.hasRTLText){this.hasRTLText=!0,sr.isLoading()||sr.isLoaded()||"deferred"!==rr()||or();break}}for(var a in this.queryPadding=0,this.buckets){var l=this.buckets[a];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(a).queryRadius(l))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Xr},ou.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},ou.prototype.getBucket=function(t){return this.buckets[t.id]},ou.prototype.upload=function(t){for(var e in this.buckets){var i=this.buckets[e];i.uploadPending()&&i.upload(t)}var n=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Lc(t,this.imageAtlas.image,n.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Lc(t,this.glyphAtlasImage,n.ALPHA),this.glyphAtlasImage=null)},ou.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},ou.prototype.queryRenderedFeatures=function(t,e,i,n,r,o,s,a,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:n,cameraQueryGeometry:r,scale:o,tileSize:this.tileSize,pixelPosMatrix:c,transform:a,params:s,queryPadding:this.queryPadding*l},t,e,i):{}},ou.prototype.querySourceFeatures=function(t,e){var i=this.latestFeatureIndex;if(i&&i.rawTileData){var n=i.loadVTLayers(),r=e?e.sourceLayer:"",o=n._geojsonTileLayer||n[r];if(o)for(var s=sn(e&&e.filter),a=this.tileID.canonical,l=a.z,c=a.x,u=a.y,h={z:l,x:c,y:u},d=0;d<o.length;d++){var p=o.feature(d);if(s.needGeometry){var A=Go(p,!0);if(!s.filter(new ar(this.tileID.overscaledZ),A,this.tileID.canonical))continue}else if(!s.filter(new ar(this.tileID.overscaledZ),p))continue;var f=i.getId(p,r),g=new Yc(p,l,c,u,f);g.tile=h,t.push(g)}}},ou.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},ou.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},ou.prototype.setExpiryData=function(t){var e=this.expirationTime;if(t.cacheControl){var i=S(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){var n=Date.now(),r=!1;if(this.expirationTime>n)r=!1;else if(e)if(this.expirationTime<e)r=!0;else{var o=this.expirationTime-e;o?this.expirationTime=n+Math.max(o,3e4):r=!0}else r=!0;r?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},ou.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)},ou.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var i=this.latestFeatureIndex.loadVTLayers();for(var n in this.buckets)if(e.style.hasLayer(n)){var r=this.buckets[n],o=r.layers[0].sourceLayer||"_geojsonTileLayer",s=i[o],a=t[o];if(s&&a&&0!==Object.keys(a).length){r.update(a,s,this.imageAtlas&&this.imageAtlas.patternPositions||{});var l=e&&e.style&&e.style.getLayer(n);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(r)))}}}},ou.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},ou.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<z.now()},ou.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},ou.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=z.now()+t},ou.prototype.setDependencies=function(t,e){for(var i={},n=0,r=e;n<r.length;n+=1)i[r[n]]=!0;this.dependencies[t]=i},ou.prototype.hasDependency=function(t,e){for(var i=0,n=t;i<n.length;i+=1){var r=this.dependencies[n[i]];if(r)for(var o=0,s=e;o<s.length;o+=1)if(r[s[o]])return!0}return!1};var su=s.performance,au=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},su.mark(this._marks.start)};au.prototype.finish=function(){su.mark(this._marks.end);var t=su.getEntriesByName(this._marks.measure);return 0===t.length&&(su.measure(this._marks.measure,this._marks.start,this._marks.end),t=su.getEntriesByName(this._marks.measure),su.clearMarks(this._marks.start),su.clearMarks(this._marks.end),su.clearMeasures(this._marks.measure)),t},t.Actor=Fc,t.AlphaImage=ys,t.CanonicalTileID=Jc,t.CollisionBoxArray=Xr,t.Color=te,t.DEMData=Kc,t.DataConstantProperty=gr,t.DictionaryCoder=Xc,t.EXTENT=8192,t.ErrorEvent=St,t.EvaluationParameters=ar,t.Event=Et,t.Evented=Tt,t.FeatureIndex=eu,t.FillBucket=aa,t.FillExtrusionBucket=Ca,t.ImageAtlas=_l,t.ImagePosition=yl,t.LineBucket=Fa,t.LngLat=zc,t.LngLatBounds=kc,t.MercatorCoordinate=Hc,t.ONE_EM=24,t.OverscaledTileID=Qc,t.Point=r,t.Point$1=r,t.Properties=br,t.Protobuf=Ka,t.RGBAImage=vs,t.RequestManager=H,t.RequestPerformance=au,t.ResourceType=At,t.SegmentVector=ao,t.SourceFeatureState=tu,t.StructArrayLayout1ui2=Qr,t.StructArrayLayout2f1f2i16=Ur,t.StructArrayLayout2i4=Tr,t.StructArrayLayout3ui6=Gr,t.StructArrayLayout4i8=Mr,t.SymbolBucket=mc,t.Texture=Lc,t.Tile=ou,t.Transitionable=ur,t.Uniform1f=bo,t.Uniform1i=_o,t.Uniform2f=xo,t.Uniform3f=wo,t.Uniform4f=Co,t.UniformColor=Bo,t.UniformMatrix4f=So,t.UnwrappedTileID=Wc,t.ValidationError=It,t.WritingMode=bl,t.ZoomHistory=Vn,t.add=function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t},t.addDynamicAttributes=pc,t.asyncAll=function(t,e,i){if(!t.length)return i(null,[]);var n=t.length,r=new Array(t.length),o=null;t.forEach((function(t,s){e(t,(function(t,e){t&&(o=t),r[s]=e,0==--n&&i(o,r)}))}))},t.bezier=l,t.bindAll=m,t.browser=z,t.cacheEntryPossiblyAdded=function(t){++dt>lt&&(t.getActor().send("enforceCacheSizeLimit",at),dt=0)},t.clamp=u,t.clearTileCache=function(t){var e=s.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Jl,t.clone=function(t){var e=new ss(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.clone$1=b,t.clone$2=function(t){var e=new ss(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=Ha,t.config=U,t.create=function(){var t=new ss(16);return ss!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new ss(9);return ss!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new ss(4);return ss!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Ji,t.createLayout=Er,t.createStyleLayer=function(t){return"custom"===t.type?new Ec(t):new Sc[t.type](t)},t.cross=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=i[0],a=i[1],l=i[2];return t[0]=r*l-o*a,t[1]=o*s-n*l,t[2]=n*a-r*s,t},t.deepEqual=function t(e,i){if(Array.isArray(e)){if(!Array.isArray(i)||e.length!==i.length)return!1;for(var n=0;n<e.length;n++)if(!t(e[n],i[n]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==i){if("object"!=typeof i)return!1;if(Object.keys(e).length!==Object.keys(i).length)return!1;for(var r in e)if(!t(e[r],i[r]))return!1;return!0}return e===i},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=c,t.emitValidationErrors=Dn,t.endsWith=y,t.enforceCacheSizeLimit=function(t){ct(),tt&&tt.then((function(e){e.keys().then((function(i){for(var n=0;n<i.length-t;n++)e.delete(i[n])}))}))},t.evaluateSizeForFeature=kl,t.evaluateSizeForZoom=zl,t.evaluateVariableOffset=oc,t.evented=nr,t.extend=d,t.featureFilter=sn,t.filterObject=_,t.fromRotation=function(t,e){var i=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=Dl,t.getAnchorJustification=sc,t.getArrayBuffer=_t,t.getImage=wt,t.getJSON=function(t,e){return vt(d(t,{type:"json"}),e)},t.getRTLTextPluginStatus=rr,t.getReferrer=yt,t.getVideo=function(t,e){var i,n,r=s.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(var o=0;o<t.length;o++){var a=s.document.createElement("source");i=t[o],n=void 0,(n=s.document.createElement("a")).href=i,(n.protocol!==s.document.location.protocol||n.host!==s.document.location.host)&&(r.crossOrigin="Anonymous"),a.src=t[o],r.appendChild(a)}return{cancel:function(){}}},t.identity=as,t.invert=function(t,e){var i=e[0],n=e[1],r=e[2],o=e[3],s=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],d=e[10],p=e[11],A=e[12],f=e[13],g=e[14],m=e[15],y=i*a-n*s,v=i*l-r*s,_=i*c-o*s,b=n*l-r*a,x=n*c-o*a,w=r*c-o*l,C=u*f-h*A,B=u*g-d*A,E=u*m-p*A,S=h*g-d*f,T=h*m-p*f,M=d*m-p*g,I=y*M-v*T+_*S+b*E-x*B+w*C;return I?(t[0]=(a*M-l*T+c*S)*(I=1/I),t[1]=(r*T-n*M-o*S)*I,t[2]=(f*w-g*x+m*b)*I,t[3]=(d*x-h*w-p*b)*I,t[4]=(l*E-s*M-c*B)*I,t[5]=(i*M-r*E+o*B)*I,t[6]=(g*_-A*w-m*v)*I,t[7]=(u*w-d*_+p*v)*I,t[8]=(s*T-a*E+c*C)*I,t[9]=(n*E-i*T-o*C)*I,t[10]=(A*x-f*_+m*y)*I,t[11]=(h*_-u*x-p*y)*I,t[12]=(a*B-s*S-l*C)*I,t[13]=(i*S-n*B+r*C)*I,t[14]=(f*v-A*b-g*y)*I,t[15]=(u*b-h*v+d*y)*I,t):null},t.isChar=Hn,t.isMapboxURL=J,t.keysDifference=function(t,e){var i=[];for(var n in t)n in e||i.push(n);return i},t.makeRequest=vt,t.mapObject=v,t.mercatorXfromLng=Gc,t.mercatorYfromLat=Zc,t.mercatorZfromAltitude=jc,t.mul=us,t.multiply=ls,t.mvt=_a,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var i=e[0],n=e[1],r=e[2],o=i*i+n*n+r*r;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t},t.number=Ve,t.offscreenCanvasSupported=pt,t.ortho=function(t,e,i,n,r,o,s){var a=1/(e-i),l=1/(n-r),c=1/(o-s);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*a,t[13]=(r+n)*l,t[14]=(s+o)*c,t[15]=1,t},t.parseGlyphPBF=function(t){return new Ka(t).readFields(Al,[])},t.pbf=Ka,t.performSymbolLayout=function(t,e,i,n,r,o,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var a=t.layers[0].layout,l=t.layers[0]._unevaluatedLayout._values,c={};if("composite"===t.textSizeData.kind){var u=t.textSizeData,h=u.maxZoom;c.compositeTextSizes=[l["text-size"].possiblyEvaluate(new ar(u.minZoom),s),l["text-size"].possiblyEvaluate(new ar(h),s)]}if("composite"===t.iconSizeData.kind){var d=t.iconSizeData,p=d.maxZoom;c.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new ar(d.minZoom),s),l["icon-size"].possiblyEvaluate(new ar(p),s)]}c.layoutTextSize=l["text-size"].possiblyEvaluate(new ar(t.zoom+1),s),c.layoutIconSize=l["icon-size"].possiblyEvaluate(new ar(t.zoom+1),s),c.textMaxSize=l["text-size"].possiblyEvaluate(new ar(18));for(var A=24*a.get("text-line-height"),f="map"===a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement"),g=a.get("text-keep-upright"),m=a.get("text-size"),y=function(){var o=_[v],l=a.get("text-font").evaluate(o,{},s).join(","),u=m.evaluate(o,{},s),h=c.layoutTextSize.evaluate(o,{},s),d=c.layoutIconSize.evaluate(o,{},s),p={horizontal:{},vertical:void 0},y=o.text,b=[0,0];if(y){var x=y.toString(),C=24*a.get("text-letter-spacing").evaluate(o,{},s),B=function(t){for(var e=0,i=t;e<i.length;e+=1)if(n=i[e].charCodeAt(0),Hn.Arabic(n)||Hn["Arabic Supplement"](n)||Hn["Arabic Extended-A"](n)||Hn["Arabic Presentation Forms-A"](n)||Hn["Arabic Presentation Forms-B"](n))return!1;var n;return!0}(x)?C:0,E=a.get("text-anchor").evaluate(o,{},s),S=a.get("text-variable-anchor");if(!S){var T=a.get("text-radial-offset").evaluate(o,{},s);b=T?oc(E,[24*T,rc]):a.get("text-offset").evaluate(o,{},s).map((function(t){return 24*t}))}var M=f?"center":a.get("text-justify").evaluate(o,{},s),I=a.get("symbol-placement"),P="point"===I?24*a.get("text-max-width").evaluate(o,{},s):0,D=function(){t.allowVerticalPlacement&&Jn(x)&&(p.vertical=Cl(y,e,i,r,l,P,A,E,"left",B,b,bl.vertical,!0,I,h,u))};if(!f&&S){for(var L="auto"===M?S.map((function(t){return sc(t)})):[M],O=!1,F=0;F<L.length;F++){var R=L[F];if(!p.horizontal[R])if(O)p.horizontal[R]=p.horizontal[0];else{var k=Cl(y,e,i,r,l,P,A,"center",R,B,b,bl.horizontal,!1,I,h,u);k&&(p.horizontal[R]=k,O=1===k.positionedLines.length)}}D()}else{"auto"===M&&(M=sc(E));var z=Cl(y,e,i,r,l,P,A,E,M,B,b,bl.horizontal,!1,I,h,u);z&&(p.horizontal[M]=z),D(),Jn(x)&&f&&g&&(p.vertical=Cl(y,e,i,r,l,P,A,E,M,B,b,bl.vertical,!1,I,h,u))}}var U=void 0,N=!1;if(o.icon&&o.icon.name){var G=n[o.icon.name];G&&(U=function(t,e,i){var n=Dl(i),r=e[0]-t.displaySize[0]*n.horizontalAlign,o=e[1]-t.displaySize[1]*n.verticalAlign;return{image:t,top:o,bottom:o+t.displaySize[1],left:r,right:r+t.displaySize[0]}}(r[o.icon.name],a.get("icon-offset").evaluate(o,{},s),a.get("icon-anchor").evaluate(o,{},s)),N=G.sdf,void 0===t.sdfIcons?t.sdfIcons=G.sdf:t.sdfIcons!==G.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(G.pixelRatio!==t.pixelRatio||0!==a.get("icon-rotate").constantOr(1))&&(t.iconsNeedLinear=!0))}var Z=lc(p.horizontal)||p.vertical;t.iconsInText=!!Z&&Z.iconsInText,(Z||U)&&function(t,e,i,n,r,o,s,a,l,c,u){var h=o.textMaxSize.evaluate(e,{});void 0===h&&(h=s);var d,p=t.layers[0].layout,A=p.get("icon-offset").evaluate(e,{},u),f=lc(i.horizontal),g=s/24,m=t.tilePixelRatio*g,y=t.tilePixelRatio*h/24,v=t.tilePixelRatio*a,_=t.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*t.tilePixelRatio,x=p.get("icon-padding")*t.tilePixelRatio,C=p.get("text-max-angle")/180*Math.PI,B="map"===p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),E="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),S=p.get("symbol-placement"),T=_/2,M=p.get("icon-text-fit");n&&"none"!==M&&(t.allowVerticalPlacement&&i.vertical&&(d=Ol(n,i.vertical,M,p.get("icon-text-fit-padding"),A,g)),f&&(n=Ol(n,f,M,p.get("icon-text-fit-padding"),A,g)));var I=function(a,h){h.x<0||h.x>=8192||h.y<0||h.y>=8192||function(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f,g,m,y,v,_,b,x,C,B){var E,S,T,M,I,P=t.addToLineVertexArray(e,i),D=0,L=0,O=0,F=0,R=-1,k=-1,z={},U=po(""),N=0,G=0;if(void 0===a._unevaluatedLayout.getValue("text-radial-offset")?(N=(E=a.layout.get("text-offset").evaluate(_,{},C).map((function(t){return 24*t})))[0],G=E[1]):(N=24*a.layout.get("text-radial-offset").evaluate(_,{},C),G=rc),t.allowVerticalPlacement&&n.vertical){var Z=a.layout.get("text-rotate").evaluate(_,{},C)+90;M=new Yl(l,e,c,u,h,n.vertical,d,p,A,Z),s&&(I=new Yl(l,e,c,u,h,s,g,m,A,Z))}if(r){var j=a.layout.get("icon-rotate").evaluate(_,{}),V="none"!==a.layout.get("icon-text-fit"),H=Wl(r,j,x,V),J=s?Wl(s,j,x,V):void 0;T=new Yl(l,e,c,u,h,r,g,m,!1,j),D=4*H.length;var W=t.iconSizeData,Q=null;"source"===W.kind?(Q=[128*a.layout.get("icon-size").evaluate(_,{})])[0]>32640&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===W.kind&&((Q=[128*b.compositeIconSizes[0].evaluate(_,{},C),128*b.compositeIconSizes[1].evaluate(_,{},C)])[0]>32640||Q[1]>32640)&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,H,Q,v,y,_,!1,e,P.lineStartIndex,P.lineLength,-1,C),R=t.icon.placedSymbolArray.length-1,J&&(L=4*J.length,t.addSymbols(t.icon,J,Q,v,y,_,bl.vertical,e,P.lineStartIndex,P.lineLength,-1,C),k=t.icon.placedSymbolArray.length-1)}for(var q in n.horizontal){var K=n.horizontal[q];if(!S){U=po(K.text);var X=a.layout.get("text-rotate").evaluate(_,{},C);S=new Yl(l,e,c,u,h,K,d,p,A,X)}var Y=1===K.positionedLines.length;if(O+=ac(t,e,K,o,a,A,_,f,P,n.vertical?bl.horizontal:bl.horizontalOnly,Y?Object.keys(n.horizontal):[q],z,R,b,C),Y)break}n.vertical&&(F+=ac(t,e,n.vertical,o,a,A,_,f,P,bl.vertical,["vertical"],z,k,b,C));var $=S?S.boxStartIndex:t.collisionBoxArray.length,tt=S?S.boxEndIndex:t.collisionBoxArray.length,et=M?M.boxStartIndex:t.collisionBoxArray.length,it=M?M.boxEndIndex:t.collisionBoxArray.length,nt=T?T.boxStartIndex:t.collisionBoxArray.length,rt=T?T.boxEndIndex:t.collisionBoxArray.length,ot=I?I.boxStartIndex:t.collisionBoxArray.length,st=I?I.boxEndIndex:t.collisionBoxArray.length,at=-1,lt=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e};at=lt(S,at),at=lt(M,at),at=lt(T,at);var ct=(at=lt(I,at))>-1?1:0;ct&&(at*=B/24),t.glyphOffsetArray.length>=mc.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==_.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,_.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,z.right>=0?z.right:-1,z.center>=0?z.center:-1,z.left>=0?z.left:-1,z.vertical||-1,R,k,U,$,tt,et,it,nt,rt,ot,st,c,O,F,D,L,ct,0,d,N,G,at)}(t,h,a,i,n,r,d,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,m,b,B,l,v,x,E,A,e,o,c,u,s)};if("line"===S)for(var P=0,D=Jl(e.geometry,0,0,8192,8192);P<D.length;P+=1)for(var L=D[P],O=0,F=Hl(L,_,C,i.vertical||f,n,24,y,t.overscaling,8192);O<F.length;O+=1){var R=F[O];f&&cc(t,f.text,T,R)||I(L,R)}else if("line-center"===S)for(var k=0,z=e.geometry;k<z.length;k+=1){var U=z[k];if(U.length>1){var N=Vl(U,C,i.vertical||f,n,24,y);N&&I(U,N)}}else if("Polygon"===e.type)for(var G=0,Z=na(e.geometry,0);G<Z.length;G+=1){var j=Z[G],V=ec(j,16);I(j[0],new Fl(V.x,V.y,0))}else if("LineString"===e.type)for(var H=0,J=e.geometry;H<J.length;H+=1){var W=J[H];I(W,new Fl(W[0].x,W[0].y,0))}else if("Point"===e.type)for(var Q=0,q=e.geometry;Q<q.length;Q+=1)for(var K=0,X=q[Q];K<X.length;K+=1){var Y=X[K];I([Y],new Fl(Y.x,Y.y,0))}}(t,o,p,U,n,c,h,d,b,N,s)},v=0,_=t.features;v<_.length;v+=1)y();o&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,i,n,r){var o,s=1/Math.tan(e/2);return t[0]=s/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=r&&r!==1/0?(t[10]=(r+n)*(o=1/(n-r)),t[14]=2*r*n*o):(t[10]=-1,t[14]=-2*n),t},t.pick=function(t,e){for(var i={},n=0;n<e.length;n++){var r=e[n];r in t&&(i[r]=t[r])}return i},t.plugin=sr,t.polygonIntersectsPolygon=Vo,t.postMapLoadEvent=st,t.postTurnstileEvent=rt,t.potpack=ml,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=zn,t.registerForPluginStateChange=function(t){return t({pluginStatus:$n,pluginURL:tr}),nr.on("pluginStateChange",t),t},t.renderColorRamp=bs,t.rotate=function(t,e,i){var n=e[0],r=e[1],o=e[2],s=e[3],a=Math.sin(i),l=Math.cos(i);return t[0]=n*l+o*a,t[1]=r*l+s*a,t[2]=n*-a+o*l,t[3]=r*-a+s*l,t},t.rotateX=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[4],s=e[5],a=e[6],l=e[7],c=e[8],u=e[9],h=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*r+c*n,t[5]=s*r+u*n,t[6]=a*r+h*n,t[7]=l*r+d*n,t[8]=c*r-o*n,t[9]=u*r-s*n,t[10]=h*r-a*n,t[11]=d*r-l*n,t},t.rotateZ=function(t,e,i){var n=Math.sin(i),r=Math.cos(i),o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],u=e[5],h=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*r+c*n,t[1]=s*r+u*n,t[2]=a*r+h*n,t[3]=l*r+d*n,t[4]=c*r-o*n,t[5]=u*r-s*n,t[6]=h*r-a*n,t[7]=d*r-l*n,t},t.scale=function(t,e,i){var n=i[0],r=i[1],o=i[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t},t.scale$2=function(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t},t.setCacheLimits=function(t,e){at=t,lt=e},t.setRTLTextPlugin=function(t,e,i){if(void 0===i&&(i=!1),"deferred"===$n||"loading"===$n||"loaded"===$n)throw new Error("setRTLTextPlugin cannot be called multiple times.");tr=z.resolveURL(t),$n="deferred",Yn=e,ir(),i||or()},t.sphericalToCartesian=function(t){var e=t[0],i=t[1],n=t[2];return i+=90,i*=Math.PI/180,n*=Math.PI/180,{x:e*Math.cos(i)*Math.sin(n),y:e*Math.sin(i)*Math.sin(n),z:e*Math.cos(n)}},t.sqrLen=function(t){var e=t[0],i=t[1];return e*e+i*i},t.styleSpec=Mt,t.sub=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t},t.symbolSize=Ul,t.transformMat3=function(t,e,i){var n=e[0],r=e[1],o=e[2];return t[0]=n*i[0]+r*i[3]+o*i[6],t[1]=n*i[1]+r*i[4]+o*i[7],t[2]=n*i[2]+r*i[5]+o*i[8],t},t.transformMat4=hs,t.translate=function(t,e,i){var n,r,o,s,a,l,c,u,h,d,p,A,f=i[0],g=i[1],m=i[2];return e===t?(t[12]=e[0]*f+e[4]*g+e[8]*m+e[12],t[13]=e[1]*f+e[5]*g+e[9]*m+e[13],t[14]=e[2]*f+e[6]*g+e[10]*m+e[14],t[15]=e[3]*f+e[7]*g+e[11]*m+e[15]):(r=e[1],o=e[2],s=e[3],a=e[4],l=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],A=e[11],t[0]=n=e[0],t[1]=r,t[2]=o,t[3]=s,t[4]=a,t[5]=l,t[6]=c,t[7]=u,t[8]=h,t[9]=d,t[10]=p,t[11]=A,t[12]=n*f+a*g+h*m+e[12],t[13]=r*f+l*g+d*m+e[13],t[14]=o*f+c*g+p*m+e[14],t[15]=s*f+u*g+A*m+e[15]),t},t.triggerPluginCompletionEvent=er,t.uniqueId=A,t.validateCustomStyleLayer=function(t){var e=[],i=t.id;return void 0===i&&e.push({message:"layers."+i+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+i+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+i+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Mn,t.validateStyle=Tn,t.values=function(t){var e=[];for(var i in t)e.push(t[i]);return e},t.vectorTile=_a,t.version="1.13.2",t.warnOnce=w,t.webpSupported=N,t.window=s,t.wrap=h})),n(["./shared"],(function(t){function e(t){var i=typeof t;if("number"===i||"boolean"===i||"string"===i||null==t)return JSON.stringify(t);if(Array.isArray(t)){for(var n="[",r=0,o=t;r<o.length;r+=1)n+=e(o[r])+",";return n+"]"}for(var s=Object.keys(t).sort(),a="{",l=0;l<s.length;l++)a+=JSON.stringify(s[l])+":"+e(t[s[l]])+",";return a+"}"}function i(i){for(var n="",r=0,o=t.refProperties;r<o.length;r+=1)n+="/"+e(i[o[r]]);return n}var n=function(t){this.keyCache={},t&&this.replace(t)};n.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},n.prototype.update=function(e,n){for(var r=this,o=0,s=e;o<s.length;o+=1){var a=s[o];this._layerConfigs[a.id]=a;var l=this._layers[a.id]=t.createStyleLayer(a);l._featureFilter=t.featureFilter(l.filter),this.keyCache[a.id]&&delete this.keyCache[a.id]}for(var c=0,u=n;c<u.length;c+=1){var h=u[c];delete this.keyCache[h],delete this._layerConfigs[h],delete this._layers[h]}this.familiesBySource={};for(var d=0,p=function(t,e){for(var n={},r=0;r<t.length;r++){var o=e&&e[t[r].id]||i(t[r]);e&&(e[t[r].id]=o);var s=n[o];s||(s=n[o]=[]),s.push(t[r])}var a=[];for(var l in n)a.push(n[l]);return a}(t.values(this._layerConfigs),this.keyCache);d<p.length;d+=1){var A=p[d].map((function(t){return r._layers[t.id]})),f=A[0];if("none"!==f.visibility){var g=f.source||"",m=this.familiesBySource[g];m||(m=this.familiesBySource[g]={});var y=f.sourceLayer||"_geojsonTileLayer",v=m[y];v||(v=m[y]=[]),v.push(A)}}};var r=function(e){var i={},n=[];for(var r in e){var o=e[r],s=i[r]={};for(var a in o){var l=o[+a];if(l&&0!==l.bitmap.width&&0!==l.bitmap.height){var c={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2};n.push(c),s[a]={rect:c,metrics:l.metrics}}}}var u=t.potpack(n),h=new t.AlphaImage({width:u.w||1,height:u.h||1});for(var d in e){var p=e[d];for(var A in p){var f=p[+A];if(f&&0!==f.bitmap.width&&0!==f.bitmap.height){var g=i[d][A].rect;t.AlphaImage.copy(f.bitmap,h,{x:0,y:0},{x:g.x+1,y:g.y+1},f.bitmap)}}}this.image=h,this.positions=i};t.register("GlyphAtlas",r);var o=function(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId};function s(e,i,n){for(var r=new t.EvaluationParameters(i),o=0,s=e;o<s.length;o+=1)s[o].recalculate(r,n)}function a(e,i){var n=t.getArrayBuffer(e.request,(function(e,n,r,o){e?i(e):n&&i(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(n)),rawData:n,cacheControl:r,expires:o})}));return function(){n.cancel(),i()}}o.prototype.parse=function(e,i,n,o,a){var l=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var c=new t.DictionaryCoder(Object.keys(e.layers).sort()),u=new t.FeatureIndex(this.tileID,this.promoteId);u.bucketLayerIDs=[];var h,d,p,A,f={},g={featureIndex:u,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},m=i.familiesBySource[this.source];for(var y in m){var v=e.layers[y];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+y+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var _=c.encode(y),b=[],x=0;x<v.length;x++){var w=v.feature(x),C=u.getId(w,y);b.push({feature:w,id:C,index:x,sourceLayerIndex:_})}for(var B=0,E=m[y];B<E.length;B+=1){var S=E[B],T=S[0];T.minzoom&&this.zoom<Math.floor(T.minzoom)||T.maxzoom&&this.zoom>=T.maxzoom||"none"!==T.visibility&&(s(S,this.zoom,n),(f[T.id]=T.createBucket({index:u.bucketLayerIDs.length,layers:S,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_,sourceID:this.source})).populate(b,g,this.tileID.canonical),u.bucketLayerIDs.push(S.map((function(t){return t.id}))))}}}var M=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)}));Object.keys(M).length?o.send("getGlyphs",{uid:this.uid,stacks:M},(function(t,e){h||(h=t,d=e,D.call(l))})):d={};var I=Object.keys(g.iconDependencies);I.length?o.send("getImages",{icons:I,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){h||(h=t,p=e,D.call(l))})):p={};var P=Object.keys(g.patternDependencies);function D(){if(h)return a(h);if(d&&p&&A){var e=new r(d),i=new t.ImageAtlas(p,A);for(var o in f){var l=f[o];l instanceof t.SymbolBucket?(s(l.layers,this.zoom,n),t.performSymbolLayout(l,d,e.positions,p,i.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):l.hasPattern&&(l instanceof t.LineBucket||l instanceof t.FillBucket||l instanceof t.FillExtrusionBucket)&&(s(l.layers,this.zoom,n),l.addFeatures(g,this.tileID.canonical,i.patternPositions))}this.status="done",a(null,{buckets:t.values(f).filter((function(t){return!t.isEmpty()})),featureIndex:u,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:e.image,imageAtlas:i,glyphMap:this.returnDependencies?d:null,iconMap:this.returnDependencies?p:null,glyphPositions:this.returnDependencies?e.positions:null})}}P.length?o.send("getImages",{icons:P,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){h||(h=t,A=e,D.call(l))})):A={},D.call(this)};var l=function(t,e,i,n){this.actor=t,this.layerIndex=e,this.availableImages=i,this.loadVectorData=n||a,this.loading={},this.loaded={}};l.prototype.loadTile=function(e,i){var n=this,r=e.uid;this.loading||(this.loading={});var s=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),a=this.loading[r]=new o(e);a.abort=this.loadVectorData(e,(function(e,o){if(delete n.loading[r],e||!o)return a.status="done",n.loaded[r]=a,i(e);var l=o.rawData,c={};o.expires&&(c.expires=o.expires),o.cacheControl&&(c.cacheControl=o.cacheControl);var u={};if(s){var h=s.finish();h&&(u.resourceTiming=JSON.parse(JSON.stringify(h)))}a.vectorTile=o.vectorTile,a.parse(o.vectorTile,n.layerIndex,n.availableImages,n.actor,(function(e,n){if(e||!n)return i(e);i(null,t.extend({rawTileData:l.slice(0)},n,c,u))})),n.loaded=n.loaded||{},n.loaded[r]=a}))},l.prototype.reloadTile=function(t,e){var i=this,n=this.loaded,r=t.uid,o=this;if(n&&n[r]){var s=n[r];s.showCollisionBoxes=t.showCollisionBoxes;var a=function(t,n){var r=s.reloadCallback;r&&(delete s.reloadCallback,s.parse(s.vectorTile,o.layerIndex,i.availableImages,o.actor,r)),e(t,n)};"parsing"===s.status?s.reloadCallback=a:"done"===s.status&&(s.vectorTile?s.parse(s.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}},l.prototype.abortTile=function(t,e){var i=this.loading,n=t.uid;i&&i[n]&&i[n].abort&&(i[n].abort(),delete i[n]),e()},l.prototype.removeTile=function(t,e){var i=this.loaded,n=t.uid;i&&i[n]&&delete i[n],e()};var c=t.window.ImageBitmap,u=function(){this.loaded={}};function h(t,e){if(0!==t.length){d(t[0],e);for(var i=1;i<t.length;i++)d(t[i],!e)}}function d(t,e){for(var i=0,n=0,r=t.length,o=r-1;n<r;o=n++)i+=(t[n][0]-t[o][0])*(t[o][1]+t[n][1]);i>=0!=!!e&&t.reverse()}u.prototype.loadTile=function(e,i){var n=e.uid,r=e.encoding,o=e.rawImageData,s=c&&o instanceof c?this.getImageData(o):o,a=new t.DEMData(n,s,r);this.loaded=this.loaded||{},this.loaded[n]=a,i(null,a)},u.prototype.getImageData=function(e){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height);var i=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:i.width,height:i.height},i.data)},u.prototype.removeTile=function(t){var e=this.loaded,i=t.uid;e&&e[i]&&delete e[i]};var p=t.vectorTile.VectorTileFeature.prototype.toGeoJSON,A=function(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))};A.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],i=0,n=this._feature.geometry;i<n.length;i+=1){var r=n[i];e.push([new t.Point$1(r[0],r[1])])}return e}for(var o=[],s=0,a=this._feature.geometry;s<a.length;s+=1){for(var l=[],c=0,u=a[s];c<u.length;c+=1){var h=u[c];l.push(new t.Point$1(h[0],h[1]))}o.push(l)}return o},A.prototype.toGeoJSON=function(t,e,i){return p.call(this,t,e,i)};var f=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};f.prototype.feature=function(t){return new A(this._features[t])};var g=t.vectorTile.VectorTileFeature,m=y;function y(t,e){this.options=e||{},this.features=t,this.length=t.length}function v(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}y.prototype.feature=function(t){return new v(this.features[t],this.options.extent)},v.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var i=0;i<e.length;i++){for(var n=e[i],r=[],o=0;o<n.length;o++)r.push(new t.Point$1(n[o][0],n[o][1]));this.geometry.push(r)}return this.geometry},v.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,n=1/0,r=-1/0,o=0;o<t.length;o++)for(var s=t[o],a=0;a<s.length;a++){var l=s[a];e=Math.min(e,l.x),i=Math.max(i,l.x),n=Math.min(n,l.y),r=Math.max(r,l.y)}return[e,n,i,r]},v.prototype.toGeoJSON=g.prototype.toGeoJSON;var _=x,b=m;function x(e){var i=new t.pbf;return function(t,e){for(var i in t.layers)e.writeMessage(3,w,t.layers[i])}(e,i),i.finish()}function w(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var n={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)n.feature=t.feature(i),e.writeMessage(2,C,n);var r=n.keys;for(i=0;i<r.length;i++)e.writeStringField(3,r[i]);var o=n.values;for(i=0;i<o.length;i++)e.writeMessage(4,M,o[i])}function C(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,B,t),e.writeVarintField(3,i.type),e.writeMessage(4,T,i)}function B(t,e){var i=t.feature,n=t.keys,r=t.values,o=t.keycache,s=t.valuecache;for(var a in i.properties){var l=o[a];void 0===l&&(n.push(a),o[a]=l=n.length-1),e.writeVarint(l);var c=i.properties[a],u=typeof c;"string"!==u&&"boolean"!==u&&"number"!==u&&(c=JSON.stringify(c));var h=u+":"+c,d=s[h];void 0===d&&(r.push(c),s[h]=d=r.length-1),e.writeVarint(d)}}function E(t,e){return(e<<3)+(7&t)}function S(t){return t<<1^t>>31}function T(t,e){for(var i=t.loadGeometry(),n=t.type,r=0,o=0,s=i.length,a=0;a<s;a++){var l=i[a],c=1;1===n&&(c=l.length),e.writeVarint(E(1,c));for(var u=3===n?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==n&&e.writeVarint(E(2,u-1));var d=l[h].x-r,p=l[h].y-o;e.writeVarint(S(d)),e.writeVarint(S(p)),r+=d,o+=p}3===n&&e.writeVarint(E(7,1))}}function M(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function I(t,e,i,n){P(t,i,n),P(e,2*i,2*n),P(e,2*i+1,2*n+1)}function P(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function D(t,e,i,n){var r=t-i,o=e-n;return r*r+o*o}_.fromVectorTileJs=x,_.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var n in t)i[n]=new m(t[n].features,e),i[n].name=n,i[n].version=e.version,i[n].extent=e.extent;return x({layers:i})},_.GeoJSONWrapper=b;var L=function(t){return t[0]},O=function(t){return t[1]},F=function(t,e,i,n,r){void 0===e&&(e=L),void 0===i&&(i=O),void 0===n&&(n=64),void 0===r&&(r=Float64Array),this.nodeSize=n,this.points=t;for(var o=t.length<65536?Uint16Array:Uint32Array,s=this.ids=new o(t.length),a=this.coords=new r(2*t.length),l=0;l<t.length;l++)s[l]=l,a[2*l]=e(t[l]),a[2*l+1]=i(t[l]);!function t(e,i,n,r,o,s){if(!(o-r<=n)){var a=r+o>>1;!function t(e,i,n,r,o,s){for(;o>r;){if(o-r>600){var a=o-r+1,l=n-r+1,c=Math.log(a),u=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*u*(a-u)/a)*(l-a/2<0?-1:1);t(e,i,n,Math.max(r,Math.floor(n-l*u/a+h)),Math.min(o,Math.floor(n+(a-l)*u/a+h)),s)}var d=i[2*n+s],p=r,A=o;for(I(e,i,r,n),i[2*o+s]>d&&I(e,i,r,o);p<A;){for(I(e,i,p,A),p++,A--;i[2*p+s]<d;)p++;for(;i[2*A+s]>d;)A--}i[2*r+s]===d?I(e,i,r,A):I(e,i,++A,o),A<=n&&(r=A+1),n<=A&&(o=A-1)}}(e,i,a,r,o,s%2),t(e,i,n,r,a-1,s+1),t(e,i,n,a+1,o,s+1)}}(s,a,n,0,s.length-1,0)};F.prototype.range=function(t,e,i,n){return function(t,e,i,n,r,o,s){for(var a,l,c=[0,t.length-1,0],u=[];c.length;){var h=c.pop(),d=c.pop(),p=c.pop();if(d-p<=s)for(var A=p;A<=d;A++)l=e[2*A+1],(a=e[2*A])>=i&&a<=r&&l>=n&&l<=o&&u.push(t[A]);else{var f=Math.floor((p+d)/2);l=e[2*f+1],(a=e[2*f])>=i&&a<=r&&l>=n&&l<=o&&u.push(t[f]);var g=(h+1)%2;(0===h?i<=a:n<=l)&&(c.push(p),c.push(f-1),c.push(g)),(0===h?r>=a:o>=l)&&(c.push(f+1),c.push(d),c.push(g))}}return u}(this.ids,this.coords,t,e,i,n,this.nodeSize)},F.prototype.within=function(t,e,i){return function(t,e,i,n,r,o){for(var s=[0,t.length-1,0],a=[],l=r*r;s.length;){var c=s.pop(),u=s.pop(),h=s.pop();if(u-h<=o)for(var d=h;d<=u;d++)D(e[2*d],e[2*d+1],i,n)<=l&&a.push(t[d]);else{var p=Math.floor((h+u)/2),A=e[2*p],f=e[2*p+1];D(A,f,i,n)<=l&&a.push(t[p]);var g=(c+1)%2;(0===c?i-r<=A:n-r<=f)&&(s.push(h),s.push(p-1),s.push(g)),(0===c?i+r>=A:n+r>=f)&&(s.push(p+1),s.push(u),s.push(g))}}return a}(this.ids,this.coords,t,e,i,this.nodeSize)};var R={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(t){return t}},k=function(t){this.options=V(Object.create(R),t),this.trees=new Array(this.options.maxZoom+1)};function z(t,e,i,n,r){return{x:t,y:e,zoom:1/0,id:i,parentId:-1,numPoints:n,properties:r}}function U(t,e){var i=t.geometry.coordinates,n=i[1];return{x:Z(i[0]),y:j(n),zoom:1/0,index:e,parentId:-1}}function N(t){return{type:"Feature",id:t.id,properties:G(t),geometry:{type:"Point",coordinates:[(n=t.x,360*(n-.5)),(e=t.y,i=(180-360*e)*Math.PI/180,360*Math.atan(Math.exp(i))/Math.PI-90)]}};var e,i,n}function G(t){var e=t.numPoints,i=e>=1e4?Math.round(e/1e3)+"k":e>=1e3?Math.round(e/100)/10+"k":e;return V(V({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:i})}function Z(t){return t/360+.5}function j(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function V(t,e){for(var i in e)t[i]=e[i];return t}function H(t){return t.x}function J(t){return t.y}function W(t,e,i,n,r,o){var s=r-i,a=o-n;if(0!==s||0!==a){var l=((t-i)*s+(e-n)*a)/(s*s+a*a);l>1?(i=r,n=o):l>0&&(i+=s*l,n+=a*l)}return(s=t-i)*s+(a=e-n)*a}function Q(t,e,i,n){var r={id:void 0===t?null:t,type:e,geometry:i,tags:n,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(t){var e=t.geometry,i=t.type;if("Point"===i||"MultiPoint"===i||"LineString"===i)q(t,e);else if("Polygon"===i||"MultiLineString"===i)for(var n=0;n<e.length;n++)q(t,e[n]);else if("MultiPolygon"===i)for(n=0;n<e.length;n++)for(var r=0;r<e[n].length;r++)q(t,e[n][r])}(r),r}function q(t,e){for(var i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function K(t,e,i,n){if(e.geometry){var r=e.geometry.coordinates,o=e.geometry.type,s=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2),a=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=n||0),"Point"===o)X(r,a);else if("MultiPoint"===o)for(var c=0;c<r.length;c++)X(r[c],a);else if("LineString"===o)Y(r,a,s,!1);else if("MultiLineString"===o){if(i.lineMetrics){for(c=0;c<r.length;c++)Y(r[c],a=[],s,!1),t.push(Q(l,"LineString",a,e.properties));return}$(r,a,s,!1)}else if("Polygon"===o)$(r,a,s,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<e.geometry.geometries.length;c++)K(t,{id:l,geometry:e.geometry.geometries[c],properties:e.properties},i,n);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<r.length;c++){var u=[];$(r[c],u,s,!0),a.push(u)}}t.push(Q(l,o,a,e.properties))}}function X(t,e){e.push(tt(t[0])),e.push(et(t[1])),e.push(0)}function Y(t,e,i,n){for(var r,o,s=0,a=0;a<t.length;a++){var l=tt(t[a][0]),c=et(t[a][1]);e.push(l),e.push(c),e.push(0),a>0&&(s+=n?(r*c-l*o)/2:Math.sqrt(Math.pow(l-r,2)+Math.pow(c-o,2))),r=l,o=c}var u=e.length-3;e[2]=1,function t(e,i,n,r){for(var o,s=r,a=n-i>>1,l=n-i,c=e[i],u=e[i+1],h=e[n],d=e[n+1],p=i+3;p<n;p+=3){var A=W(e[p],e[p+1],c,u,h,d);if(A>s)o=p,s=A;else if(A===s){var f=Math.abs(p-a);f<l&&(o=p,l=f)}}s>r&&(o-i>3&&t(e,i,o,r),e[o+2]=s,n-o>3&&t(e,o,n,r))}(e,0,u,i),e[u+2]=1,e.size=Math.abs(s),e.start=0,e.end=e.size}function $(t,e,i,n){for(var r=0;r<t.length;r++){var o=[];Y(t[r],o,i,n),e.push(o)}}function tt(t){return t/360+.5}function et(t){var e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function it(t,e,i,n,r,o,s,a){if(n/=e,o>=(i/=e)&&s<n)return t;if(s<i||o>=n)return null;for(var l=[],c=0;c<t.length;c++){var u=t[c],h=u.geometry,d=u.type,p=0===r?u.minX:u.minY,A=0===r?u.maxX:u.maxY;if(p>=i&&A<n)l.push(u);else if(!(A<i||p>=n)){var f=[];if("Point"===d||"MultiPoint"===d)nt(h,f,i,n,r);else if("LineString"===d)rt(h,f,i,n,r,!1,a.lineMetrics);else if("MultiLineString"===d)st(h,f,i,n,r,!1);else if("Polygon"===d)st(h,f,i,n,r,!0);else if("MultiPolygon"===d)for(var g=0;g<h.length;g++){var m=[];st(h[g],m,i,n,r,!0),m.length&&f.push(m)}if(f.length){if(a.lineMetrics&&"LineString"===d){for(g=0;g<f.length;g++)l.push(Q(u.id,d,f[g],u.tags));continue}"LineString"!==d&&"MultiLineString"!==d||(1===f.length?(d="LineString",f=f[0]):d="MultiLineString"),"Point"!==d&&"MultiPoint"!==d||(d=3===f.length?"Point":"MultiPoint"),l.push(Q(u.id,d,f,u.tags))}}}return l.length?l:null}function nt(t,e,i,n,r){for(var o=0;o<t.length;o+=3){var s=t[o+r];s>=i&&s<=n&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}function rt(t,e,i,n,r,o,s){for(var a,l,c=ot(t),u=0===r?lt:ct,h=t.start,d=0;d<t.length-3;d+=3){var p=t[d],A=t[d+1],f=t[d+2],g=t[d+3],m=t[d+4],y=0===r?p:A,v=0===r?g:m,_=!1;s&&(a=Math.sqrt(Math.pow(p-g,2)+Math.pow(A-m,2))),y<i?v>i&&(l=u(c,p,A,g,m,i),s&&(c.start=h+a*l)):y>n?v<n&&(l=u(c,p,A,g,m,n),s&&(c.start=h+a*l)):at(c,p,A,f),v<i&&y>=i&&(l=u(c,p,A,g,m,i),_=!0),v>n&&y<=n&&(l=u(c,p,A,g,m,n),_=!0),!o&&_&&(s&&(c.end=h+a*l),e.push(c),c=ot(t)),s&&(h+=a)}var b=t.length-3;p=t[b],A=t[b+1],f=t[b+2],(y=0===r?p:A)>=i&&y<=n&&at(c,p,A,f),b=c.length-3,o&&b>=3&&(c[b]!==c[0]||c[b+1]!==c[1])&&at(c,c[0],c[1],c[2]),c.length&&e.push(c)}function ot(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function st(t,e,i,n,r,o){for(var s=0;s<t.length;s++)rt(t[s],e,i,n,r,o,!1)}function at(t,e,i,n){t.push(e),t.push(i),t.push(n)}function lt(t,e,i,n,r,o){var s=(o-e)/(n-e);return t.push(o),t.push(i+(r-i)*s),t.push(1),s}function ct(t,e,i,n,r,o){var s=(o-i)/(r-i);return t.push(e+(n-e)*s),t.push(o),t.push(1),s}function ut(t,e){for(var i=[],n=0;n<t.length;n++){var r,o=t[n],s=o.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)r=ht(o.geometry,e);else if("MultiLineString"===s||"Polygon"===s){r=[];for(var a=0;a<o.geometry.length;a++)r.push(ht(o.geometry[a],e))}else if("MultiPolygon"===s)for(r=[],a=0;a<o.geometry.length;a++){for(var l=[],c=0;c<o.geometry[a].length;c++)l.push(ht(o.geometry[a][c],e));r.push(l)}i.push(Q(o.id,s,r,o.tags))}return i}function ht(t,e){var i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(var n=0;n<t.length;n+=3)i.push(t[n]+e,t[n+1],t[n+2]);return i}function dt(t,e){if(t.transformed)return t;var i,n,r,o=1<<t.z,s=t.x,a=t.y;for(i=0;i<t.features.length;i++){var l=t.features[i],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(n=0;n<c.length;n+=2)l.geometry.push(pt(c[n],c[n+1],e,o,s,a));else for(n=0;n<c.length;n++){var h=[];for(r=0;r<c[n].length;r+=2)h.push(pt(c[n][r],c[n][r+1],e,o,s,a));l.geometry.push(h)}}return t.transformed=!0,t}function pt(t,e,i,n,r,o){return[Math.round(i*(t*n-r)),Math.round(i*(e*n-o))]}function At(t,e,i,n,r){for(var o=e===r.maxZoom?0:r.tolerance/((1<<e)*r.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:i,y:n,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},a=0;a<t.length;a++){s.numFeatures++,ft(s,t[a],o,r);var l=t[a].minX,c=t[a].minY,u=t[a].maxX,h=t[a].maxY;l<s.minX&&(s.minX=l),c<s.minY&&(s.minY=c),u>s.maxX&&(s.maxX=u),h>s.maxY&&(s.maxY=h)}return s}function ft(t,e,i,n){var r=e.geometry,o=e.type,s=[];if("Point"===o||"MultiPoint"===o)for(var a=0;a<r.length;a+=3)s.push(r[a]),s.push(r[a+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)gt(s,r,t,i,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(a=0;a<r.length;a++)gt(s,r[a],t,i,"Polygon"===o,0===a);else if("MultiPolygon"===o)for(var l=0;l<r.length;l++){var c=r[l];for(a=0;a<c.length;a++)gt(s,c[a],t,i,!0,0===a)}if(s.length){var u=e.tags||null;if("LineString"===o&&n.lineMetrics){for(var h in u={},e.tags)u[h]=e.tags[h];u.mapbox_clip_start=r.start/r.size,u.mapbox_clip_end=r.end/r.size}var d={geometry:s,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==e.id&&(d.id=e.id),t.features.push(d)}}function gt(t,e,i,n,r,o){var s=n*n;if(n>0&&e.size<(r?s:n))i.numPoints+=e.length/3;else{for(var a=[],l=0;l<e.length;l+=3)(0===n||e[l+2]>s)&&(i.numSimplified++,a.push(e[l]),a.push(e[l+1])),i.numPoints++;r&&function(t,e){for(var i=0,n=0,r=t.length,o=r-2;n<r;o=n,n+=2)i+=(t[n]-t[o])*(t[n+1]+t[o+1]);if(i>0===e)for(n=0,r=t.length;n<r/2;n+=2){var s=t[n],a=t[n+1];t[n]=t[r-2-n],t[n+1]=t[r-1-n],t[r-2-n]=s,t[r-1-n]=a}}(a,o),t.push(a)}}function mt(t,e){var i=(e=this.options=function(t,e){for(var i in e)t[i]=e[i];return t}(Object.create(this.options),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var n=function(t,e){var i=[];if("FeatureCollection"===t.type)for(var n=0;n<t.features.length;n++)K(i,t.features[n],e,n);else K(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(n=function(t,e){var i=e.buffer/e.extent,n=t,r=it(t,1,-1-i,i,0,-1,2,e),o=it(t,1,1-i,2+i,0,-1,2,e);return(r||o)&&(n=it(t,1,-i,1+i,0,-1,2,e)||[],r&&(n=ut(r,1).concat(n)),o&&(n=n.concat(ut(o,-1)))),n}(n,e)).length&&this.splitTile(n,0,0,0),i&&(n.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function yt(t,e,i){return 32*((1<<t)*i+e)+t}function vt(t,e){var i=t.tileID.canonical;if(!this._geoJSONIndex)return e(null,null);var n=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!n)return e(null,null);var r=new f(n.features),o=_(r);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),e(null,{vectorTile:r,rawData:o.buffer})}k.prototype.load=function(t){var e=this.options,i=e.log,n=e.minZoom,r=e.maxZoom,o=e.nodeSize;i&&console.time("total time");var s="prepare "+t.length+" points";i&&console.time(s),this.points=t;for(var a=[],l=0;l<t.length;l++)t[l].geometry&&a.push(U(t[l],l));this.trees[r+1]=new F(a,H,J,o,Float32Array),i&&console.timeEnd(s);for(var c=r;c>=n;c--){var u=+Date.now();a=this._cluster(a,c),this.trees[c]=new F(a,H,J,o,Float32Array),i&&console.log("z%d: %d clusters in %dms",c,a.length,+Date.now()-u)}return i&&console.timeEnd("total time"),this},k.prototype.getClusters=function(t,e){var i=((t[0]+180)%360+360)%360-180,n=Math.max(-90,Math.min(90,t[1])),r=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,r=180;else if(i>r){var s=this.getClusters([i,n,180,o],e),a=this.getClusters([-180,n,r,o],e);return s.concat(a)}for(var l=this.trees[this._limitZoom(e)],c=[],u=0,h=l.range(Z(i),j(o),Z(r),j(n));u<h.length;u+=1){var d=l.points[h[u]];c.push(d.numPoints?N(d):this.points[d.index])}return c},k.prototype.getChildren=function(t){var e=this._getOriginId(t),i=this._getOriginZoom(t),n="No cluster with the specified id.",r=this.trees[i];if(!r)throw new Error(n);var o=r.points[e];if(!o)throw new Error(n);for(var s=this.options.radius/(this.options.extent*Math.pow(2,i-1)),a=[],l=0,c=r.within(o.x,o.y,s);l<c.length;l+=1){var u=r.points[c[l]];u.parentId===t&&a.push(u.numPoints?N(u):this.points[u.index])}if(0===a.length)throw new Error(n);return a},k.prototype.getLeaves=function(t,e,i){var n=[];return this._appendLeaves(n,t,e=e||10,i=i||0,0),n},k.prototype.getTile=function(t,e,i){var n=this.trees[this._limitZoom(t)],r=Math.pow(2,t),o=this.options,s=o.radius/o.extent,a=(i-s)/r,l=(i+1+s)/r,c={features:[]};return this._addTileFeatures(n.range((e-s)/r,a,(e+1+s)/r,l),n.points,e,i,r,c),0===e&&this._addTileFeatures(n.range(1-s/r,a,1,l),n.points,r,i,r,c),e===r-1&&this._addTileFeatures(n.range(0,a,s/r,l),n.points,-1,i,r,c),c.features.length?c:null},k.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e},k.prototype._appendLeaves=function(t,e,i,n,r){for(var o=0,s=this.getChildren(e);o<s.length;o+=1){var a=s[o],l=a.properties;if(l&&l.cluster?r+l.point_count<=n?r+=l.point_count:r=this._appendLeaves(t,l.cluster_id,i,n,r):r<n?r++:t.push(a),t.length===i)break}return r},k.prototype._addTileFeatures=function(t,e,i,n,r,o){for(var s=0,a=t;s<a.length;s+=1){var l=e[a[s]],c=l.numPoints,u={type:1,geometry:[[Math.round(this.options.extent*(l.x*r-i)),Math.round(this.options.extent*(l.y*r-n))]],tags:c?G(l):this.points[l.index].properties},h=void 0;c?h=l.id:this.options.generateId?h=l.index:this.points[l.index].id&&(h=this.points[l.index].id),void 0!==h&&(u.id=h),o.features.push(u)}},k.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},k.prototype._cluster=function(t,e){for(var i=[],n=this.options,r=n.reduce,o=n.minPoints,s=n.radius/(n.extent*Math.pow(2,e)),a=0;a<t.length;a++){var l=t[a];if(!(l.zoom<=e)){l.zoom=e;for(var c=this.trees[e+1],u=c.within(l.x,l.y,s),h=l.numPoints||1,d=h,p=0,A=u;p<A.length;p+=1){var f=c.points[A[p]];f.zoom>e&&(d+=f.numPoints||1)}if(d>=o){for(var g=l.x*h,m=l.y*h,y=r&&h>1?this._map(l,!0):null,v=(a<<5)+(e+1)+this.points.length,_=0,b=u;_<b.length;_+=1){var x=c.points[b[_]];if(!(x.zoom<=e)){x.zoom=e;var w=x.numPoints||1;g+=x.x*w,m+=x.y*w,x.parentId=v,r&&(y||(y=this._map(l,!0)),r(y,this._map(x)))}}l.parentId=v,i.push(z(g/d,m/d,v,d,y))}else if(i.push(l),d>1)for(var C=0,B=u;C<B.length;C+=1){var E=c.points[B[C]];E.zoom<=e||(E.zoom=e,i.push(E))}}}return i},k.prototype._getOriginId=function(t){return t-this.points.length>>5},k.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},k.prototype._map=function(t,e){if(t.numPoints)return e?V({},t.properties):t.properties;var i=this.points[t.index].properties,n=this.options.map(i);return e&&n===i?V({},n):n},mt.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},mt.prototype.splitTile=function(t,e,i,n,r,o,s){for(var a=[t,e,i,n],l=this.options,c=l.debug;a.length;){n=a.pop(),i=a.pop(),e=a.pop(),t=a.pop();var u=1<<e,h=yt(e,i,n),d=this.tiles[h];if(!d&&(c>1&&console.time("creation"),d=this.tiles[h]=At(t,e,i,n,l),this.tileCoords.push({z:e,x:i,y:n}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,n,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));var p="z"+e;this.stats[p]=(this.stats[p]||0)+1,this.total++}if(d.source=t,r){if(e===l.maxZoom||e===r)continue;var A=1<<r-e;if(i!==Math.floor(o/A)||n!==Math.floor(s/A))continue}else if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue;if(d.source=null,0!==t.length){c>1&&console.time("clipping");var f,g,m,y,v,_,b=.5*l.buffer/l.extent,x=.5-b,w=.5+b,C=1+b;f=g=m=y=null,v=it(t,u,i-b,i+w,0,d.minX,d.maxX,l),_=it(t,u,i+x,i+C,0,d.minX,d.maxX,l),t=null,v&&(f=it(v,u,n-b,n+w,1,d.minY,d.maxY,l),g=it(v,u,n+x,n+C,1,d.minY,d.maxY,l),v=null),_&&(m=it(_,u,n-b,n+w,1,d.minY,d.maxY,l),y=it(_,u,n+x,n+C,1,d.minY,d.maxY,l),_=null),c>1&&console.timeEnd("clipping"),a.push(f||[],e+1,2*i,2*n),a.push(g||[],e+1,2*i,2*n+1),a.push(m||[],e+1,2*i+1,2*n),a.push(y||[],e+1,2*i+1,2*n+1)}}},mt.prototype.getTile=function(t,e,i){var n=this.options,r=n.extent,o=n.debug;if(t<0||t>24)return null;var s=1<<t,a=yt(t,e=(e%s+s)%s,i);if(this.tiles[a])return dt(this.tiles[a],r);o>1&&console.log("drilling down to z%d-%d-%d",t,e,i);for(var l,c=t,u=e,h=i;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[yt(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,t,e,i),o>1&&console.timeEnd("drilling down"),this.tiles[a]?dt(this.tiles[a],r):null):null};var _t=function(e){function i(t,i,n,r){e.call(this,t,i,n,vt),r&&(this.loadGeoJSON=r)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},i.prototype._loadData=function(){var e=this;if(this._pendingCallback&&this._pendingLoadDataParams){var i=this._pendingCallback,n=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var r=!!(n&&n.request&&n.request.collectResourceTiming)&&new t.RequestPerformance(n.request);this.loadGeoJSON(n,(function(o,s){if(o||!s)return i(o);if("object"!=typeof s)return i(new Error("Input data given to '"+n.source+"' is not a valid GeoJSON object."));!function t(e,i){var n,r=e&&e.type;if("FeatureCollection"===r)for(n=0;n<e.features.length;n++)t(e.features[n],i);else if("GeometryCollection"===r)for(n=0;n<e.geometries.length;n++)t(e.geometries[n],i);else if("Feature"===r)t(e.geometry,i);else if("Polygon"===r)h(e.coordinates,i);else if("MultiPolygon"===r)for(n=0;n<e.coordinates.length;n++)h(e.coordinates[n],i);return e}(s,!0);try{if(n.filter){var a=t.createExpression(n.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===a.result)throw new Error(a.value.map((function(t){return t.key+": "+t.message})).join(", "));var l=s.features.filter((function(t){return a.value.evaluate({zoom:0},t)}));s={type:"FeatureCollection",features:l}}e._geoJSONIndex=n.cluster?new k(function(e){var i=e.superclusterOptions,n=e.clusterProperties;if(!n||!i)return i;for(var r={},o={},s={accumulated:null,zoom:0},a={properties:null},l=Object.keys(n),c=0,u=l;c<u.length;c+=1){var h=u[c],d=n[h],p=d[0],A=t.createExpression(d[1]),f=t.createExpression("string"==typeof p?[p,["accumulated"],["get",h]]:p);r[h]=A.value,o[h]=f.value}return i.map=function(t){a.properties=t;for(var e={},i=0,n=l;i<n.length;i+=1){var o=n[i];e[o]=r[o].evaluate(s,a)}return e},i.reduce=function(t,e){a.properties=e;for(var i=0,n=l;i<n.length;i+=1){var r=n[i];s.accumulated=t[r],t[r]=o[r].evaluate(s,a)}},i}(n)).load(s.features):function(t,e){return new mt(t,e)}(s,n.geojsonVtOptions)}catch(o){return i(o)}e.loaded={};var c={};if(r){var u=r.finish();u&&(c.resourceTiming={},c.resourceTiming[n.source]=JSON.parse(JSON.stringify(u)))}i(null,c)}))}},i.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},i.prototype.reloadTile=function(t,i){var n=this.loaded;return n&&n[t.uid]?e.prototype.reloadTile.call(this,t,i):this.loadTile(t,i)},i.prototype.loadGeoJSON=function(e,i){if(e.request)t.getJSON(e.request,i);else{if("string"!=typeof e.data)return i(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return i(null,JSON.parse(e.data))}catch(t){return i(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},i.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},i.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},i.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},i.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},i}(l),bt=function(e){var i=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:_t},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(i.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');i.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}};return bt.prototype.setReferrer=function(t,e){this.referrer=e},bt.prototype.setImages=function(t,e,i){for(var n in this.availableImages[t]=e,this.workerSources[t]){var r=this.workerSources[t][n];for(var o in r)r[o].availableImages=e}i()},bt.prototype.setLayers=function(t,e,i){this.getLayerIndex(t).replace(e),i()},bt.prototype.updateLayers=function(t,e,i){this.getLayerIndex(t).update(e.layers,e.removedIds),i()},bt.prototype.loadTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).loadTile(e,i)},bt.prototype.loadDEMTile=function(t,e,i){this.getDEMWorkerSource(t,e.source).loadTile(e,i)},bt.prototype.reloadTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).reloadTile(e,i)},bt.prototype.abortTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).abortTile(e,i)},bt.prototype.removeTile=function(t,e,i){this.getWorkerSource(t,e.type,e.source).removeTile(e,i)},bt.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},bt.prototype.removeSource=function(t,e,i){if(this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]){var n=this.workerSources[t][e.type][e.source];delete this.workerSources[t][e.type][e.source],void 0!==n.removeSource?n.removeSource(e,i):i()}},bt.prototype.loadWorkerSource=function(t,e,i){try{this.self.importScripts(e.url),i()}catch(t){i(t.toString())}},bt.prototype.syncRTLPluginState=function(e,i,n){try{t.plugin.setState(i);var r=t.plugin.getPluginURL();if(t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=r){this.self.importScripts(r);var o=t.plugin.isParsed();n(o?void 0:new Error("RTL Text Plugin failed to import scripts from "+r),o)}}catch(t){n(t.toString())}},bt.prototype.getAvailableImages=function(t){var e=this.availableImages[t];return e||(e=[]),e},bt.prototype.getLayerIndex=function(t){var e=this.layerIndexes[t];return e||(e=this.layerIndexes[t]=new n),e},bt.prototype.getWorkerSource=function(t,e,i){var n=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][i]||(this.workerSources[t][e][i]=new this.workerSourceTypes[e]({send:function(e,i,r){n.actor.send(e,i,r,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][i]},bt.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new u),this.demWorkerSources[t][e]},bt.prototype.enforceCacheSizeLimit=function(e,i){t.enforceCacheSizeLimit(i)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new bt(self)),bt})),n(["./shared"],(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!i(t)}function i(t){return"undefined"==typeof window||"undefined"==typeof document?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var t,e,i=new Blob([""],{type:"text/javascript"}),n=URL.createObjectURL(i);try{e=new Worker(n),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(n),t}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(!e)return!1;var i=e.getImageData(0,0,1,1);return i&&i.width===t.width}()?(void 0===n[i=t&&t.failIfMajorPerformanceCaveat]&&(n[i]=function(t){var i=function(t){var i=document.createElement("canvas"),n=Object.create(e.webGLContextAttributes);return n.failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",n)||i.probablySupportsContext("experimental-webgl",n):i.supportsContext?i.supportsContext("webgl",n)||i.supportsContext("experimental-webgl",n):i.getContext("webgl",n)||i.getContext("experimental-webgl",n)}(t);if(!i)return!1;var n=i.createShader(i.VERTEX_SHADER);return!(!n||i.isContextLost())&&(i.shaderSource(n,"void main() {}"),i.compileShader(n),!0===i.getShaderParameter(n,i.COMPILE_STATUS))}(i)),n[i]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var i}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=i);var n={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),i={create:function(e,i,n){var r=t.window.document.createElement(e);return void 0!==i&&(r.className=i),n&&n.appendChild(r),r},createNS:function(e,i){return t.window.document.createElementNS(e,i)}},n=t.window.document&&t.window.document.documentElement.style;function r(t){if(!n)return t[0];for(var e=0;e<t.length;e++)if(t[e]in n)return t[e];return t[0]}var o,s=r(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);i.disableDrag=function(){n&&s&&(o=n[s],n[s]="none")},i.enableDrag=function(){n&&s&&(n[s]=o)};var a=r(["transform","WebkitTransform"]);i.setTransform=function(t,e){t.style[a]=e};var l=!1;try{var c=Object.defineProperty({},"passive",{get:function(){l=!0}});t.window.addEventListener("test",c,c),t.window.removeEventListener("test",c,c)}catch(t){l=!1}i.addEventListener=function(t,e,i,n){void 0===n&&(n={}),t.addEventListener(e,i,"passive"in n&&l?n:n.capture)},i.removeEventListener=function(t,e,i,n){void 0===n&&(n={}),t.removeEventListener(e,i,"passive"in n&&l?n:n.capture)};var u=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",u,!0)};function h(t){var e=t.userImage;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}i.suppressClick=function(){t.window.addEventListener("click",u,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",u,!0)}),0)},i.mousePos=function(e,i){var n=e.getBoundingClientRect();return new t.Point(i.clientX-n.left-e.clientLeft,i.clientY-n.top-e.clientTop)},i.touchPos=function(e,i){for(var n=e.getBoundingClientRect(),r=[],o=0;o<i.length;o++)r.push(new t.Point(i[o].clientX-n.left-e.clientLeft,i[o].clientY-n.top-e.clientTop));return r},i.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&t.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:e.button},i.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var d=function(e){function i(){e.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.isLoaded=function(){return this.loaded},i.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t,t)){for(var e=0,i=this.requestors;e<i.length;e+=1){var n=i[e];this._notify(n.ids,n.callback)}this.requestors=[]}},i.prototype.getImage=function(t){return this.images[t]},i.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},i.prototype._validate=function(e,i){var n=!0;return this._validateStretch(i.stretchX,i.data&&i.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),n=!1),this._validateStretch(i.stretchY,i.data&&i.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),n=!1),this._validateContent(i.content,i)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),n=!1),n},i.prototype._validateStretch=function(t,e){if(!t)return!0;for(var i=0,n=0,r=t;n<r.length;n+=1){var o=r[n];if(o[0]<i||o[1]<o[0]||e<o[1])return!1;i=o[1]}return!0},i.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},i.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},i.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},i.prototype.listImages=function(){return Object.keys(this.images)},i.prototype.getImages=function(t,e){var i=!0;if(!this.isLoaded())for(var n=0,r=t;n<r.length;n+=1)this.images[r[n]]||(i=!1);this.isLoaded()||i?this._notify(t,e):this.requestors.push({ids:t,callback:e})},i.prototype._notify=function(e,i){for(var n={},r=0,o=e;r<o.length;r+=1){var s=o[r];this.images[s]||this.fire(new t.Event("styleimagemissing",{id:s}));var a=this.images[s];a?n[s]={data:a.data.clone(),pixelRatio:a.pixelRatio,sdf:a.sdf,version:a.version,stretchX:a.stretchX,stretchY:a.stretchY,content:a.content,hasRenderCallback:Boolean(a.userImage&&a.userImage.render)}:t.warnOnce('Image "'+s+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}i(null,n)},i.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},i.prototype.getPattern=function(e){var i=this.patterns[e],n=this.getImage(e);if(!n)return null;if(i&&i.position.version===n.version)return i.position;if(i)i.position.version=n.version;else{var r={w:n.data.width+2,h:n.data.height+2,x:0,y:0},o=new t.ImagePosition(r,n);this.patterns[e]={bin:r,position:o}}return this._updatePatternAtlas(),this.patterns[e].position},i.prototype.bind=function(e){var i=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,i.RGBA),this.atlasTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)},i.prototype._updatePatternAtlas=function(){var e=[];for(var i in this.patterns)e.push(this.patterns[i].bin);var n=t.potpack(e),r=n.w,o=n.h,s=this.atlasImage;for(var a in s.resize({width:r||1,height:o||1}),this.patterns){var l=this.patterns[a].bin,c=l.x+1,u=l.y+1,h=this.images[a].data,d=h.width,p=h.height;t.RGBAImage.copy(h,s,{x:0,y:0},{x:c,y:u},{width:d,height:p}),t.RGBAImage.copy(h,s,{x:0,y:p-1},{x:c,y:u-1},{width:d,height:1}),t.RGBAImage.copy(h,s,{x:0,y:0},{x:c,y:u+p},{width:d,height:1}),t.RGBAImage.copy(h,s,{x:d-1,y:0},{x:c-1,y:u},{width:1,height:p}),t.RGBAImage.copy(h,s,{x:0,y:0},{x:c+d,y:u},{width:1,height:p})}this.dirty=!0},i.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},i.prototype.dispatchRenderCallbacks=function(t){for(var e=0,i=t;e<i.length;e+=1){var n=i[e];if(!this.callbackDispatchedThisFrame[n]){this.callbackDispatchedThisFrame[n]=!0;var r=this.images[n];h(r)&&this.updateImage(n,r)}}},i}(t.Evented),p=g,A=g,f=1e20;function g(t,e,i,n,r,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=n||.25,this.fontFamily=r||"sans-serif",this.fontWeight=o||"normal",this.radius=i||8;var s=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=s,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.d=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Int16Array(s),this.middle=Math.round(s/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function m(t,e,i,n,r,o,s){for(var a=0;a<e;a++){for(var l=0;l<i;l++)n[l]=t[l*e+a];for(y(n,r,o,s,i),l=0;l<i;l++)t[l*e+a]=r[l]}for(l=0;l<i;l++){for(a=0;a<e;a++)n[a]=t[l*e+a];for(y(n,r,o,s,e),a=0;a<e;a++)t[l*e+a]=Math.sqrt(r[a])}}function y(t,e,i,n,r){i[0]=0,n[0]=-f,n[1]=+f;for(var o=1,s=0;o<r;o++){for(var a=(t[o]+o*o-(t[i[s]]+i[s]*i[s]))/(2*o-2*i[s]);a<=n[s];)s--,a=(t[o]+o*o-(t[i[s]]+i[s]*i[s]))/(2*o-2*i[s]);i[++s]=o,n[s]=a,n[s+1]=+f}for(o=0,s=0;o<r;o++){for(;n[s+1]<o;)s++;e[o]=(o-i[s])*(o-i[s])+t[i[s]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),i=new Uint8ClampedArray(this.size*this.size),n=0;n<this.size*this.size;n++){var r=e.data[4*n+3]/255;this.gridOuter[n]=1===r?0:0===r?f:Math.pow(Math.max(0,.5-r),2),this.gridInner[n]=1===r?f:0===r?0:Math.pow(Math.max(0,r-.5),2)}for(m(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),m(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),n=0;n<this.size*this.size;n++)i[n]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[n]-this.gridInner[n])/this.radius+this.cutoff))));return i},p.default=A;var v=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};v.prototype.setURL=function(t){this.url=t},v.prototype.getGlyphs=function(e,i){var n=this,r=[];for(var o in e)for(var s=0,a=e[o];s<a.length;s+=1)r.push({stack:o,id:a[s]});t.asyncAll(r,(function(t,e){var i=t.stack,r=t.id,o=n.entries[i];o||(o=n.entries[i]={glyphs:{},requests:{},ranges:{}});var s=o.glyphs[r];if(void 0===s){if(s=n._tinySDF(o,i,r))return o.glyphs[r]=s,void e(null,{stack:i,id:r,glyph:s});var a=Math.floor(r/256);if(256*a>65535)e(new Error("glyphs > 65535 not supported"));else if(o.ranges[a])e(null,{stack:i,id:r,glyph:s});else{var l=o.requests[a];l||(l=o.requests[a]=[],v.loadGlyphRange(i,a,n.url,n.requestManager,(function(t,e){if(e){for(var i in e)n._doesCharSupportLocalGlyph(+i)||(o.glyphs[+i]=e[+i]);o.ranges[a]=!0}for(var r=0,s=l;r<s.length;r+=1)(0,s[r])(t,e);delete o.requests[a]}))),l.push((function(t,n){t?e(t):n&&e(null,{stack:i,id:r,glyph:n[r]||null})}))}}else e(null,{stack:i,id:r,glyph:s})}),(function(t,e){if(t)i(t);else if(e){for(var n={},r=0,o=e;r<o.length;r+=1){var s=o[r],a=s.stack,l=s.id,c=s.glyph;(n[a]||(n[a]={}))[l]=c&&{id:c.id,bitmap:c.bitmap.clone(),metrics:c.metrics}}i(null,n)}}))},v.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},v.prototype._tinySDF=function(e,i,n){var r=this.localIdeographFontFamily;if(r&&this._doesCharSupportLocalGlyph(n)){var o=e.tinySDF;if(!o){var s="400";/bold/i.test(i)?s="900":/medium/i.test(i)?s="500":/light/i.test(i)&&(s="200"),o=e.tinySDF=new v.TinySDF(24,3,8,.25,r,s)}return{id:n,bitmap:new t.AlphaImage({width:30,height:30},o.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},v.loadGlyphRange=function(e,i,n,r,o){var s=256*i,a=s+255,l=r.transformRequest(r.normalizeGlyphsURL(n).replace("{fontstack}",e).replace("{range}",s+"-"+a),t.ResourceType.Glyphs);t.getArrayBuffer(l,(function(e,i){if(e)o(e);else if(i){for(var n={},r=0,s=t.parseGlyphPBF(i);r<s.length;r+=1){var a=s[r];n[a.id]=a}o(null,n)}}))},v.TinySDF=p;var _=function(){this.specification=t.styleSpec.light.position};_.prototype.possiblyEvaluate=function(e,i){return t.sphericalToCartesian(e.expression.evaluate(i))},_.prototype.interpolate=function(e,i,n){return{x:t.number(e.x,i.x,n),y:t.number(e.y,i.y,n),z:t.number(e.z,i.z,n)}};var b=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new _,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),x=function(e){function i(i){e.call(this),this._transitionable=new t.Transitionable(b),this.setLight(i),this._transitioning=this._transitionable.untransitioned()}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getLight=function(){return this._transitionable.serialize()},i.prototype.setLight=function(e,i){if(void 0===i&&(i={}),!this._validate(t.validateLight,e,i))for(var n in e){var r=e[n];t.endsWith(n,"-transition")?this._transitionable.setTransition(n.slice(0,-11),r):this._transitionable.setValue(n,r)}},i.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},i.prototype.hasTransition=function(){return this._transitioning.hasTransition()},i.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},i.prototype._validate=function(e,i,n){return(!n||!1!==n.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:i,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},i}(t.Evented),w=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};w.prototype.getDash=function(t,e){var i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]},w.prototype.getDashRanges=function(t,e,i){var n=[],r=t.length%2==1?-t[t.length-1]*i:0,o=t[0]*i,s=!0;n.push({left:r,right:o,isDash:s,zeroLength:0===t[0]});for(var a=t[0],l=1;l<t.length;l++){var c=t[l];n.push({left:r=a*i,right:o=(a+=c)*i,isDash:s=!s,zeroLength:0===c})}return n},w.prototype.addRoundDash=function(t,e,i){for(var n=e/2,r=-i;r<=i;r++)for(var o=this.width*(this.nextRow+i+r),s=0,a=t[s],l=0;l<this.width;l++){l/a.right>1&&(a=t[++s]);var c=Math.abs(l-a.left),u=Math.abs(l-a.right),h=Math.min(c,u),d=void 0,p=r/i*(n+1);if(a.isDash){var A=n-Math.abs(p);d=Math.sqrt(h*h+A*A)}else d=n-Math.sqrt(h*h+p*p);this.data[o+l]=Math.max(0,Math.min(255,d+128))}},w.prototype.addRegularDash=function(t){for(var e=t.length-1;e>=0;--e){var i=t[e],n=t[e+1];i.zeroLength?t.splice(e,1):n&&n.isDash===i.isDash&&(n.left=i.left,t.splice(e,1))}var r=t[0],o=t[t.length-1];r.isDash===o.isDash&&(r.left=o.left-this.width,o.right=r.right+this.width);for(var s=this.width*this.nextRow,a=0,l=t[a],c=0;c<this.width;c++){c/l.right>1&&(l=t[++a]);var u=Math.abs(c-l.left),h=Math.abs(c-l.right),d=Math.min(u,h);this.data[s+c]=Math.max(0,Math.min(255,(l.isDash?d:-d)+128))}},w.prototype.addDash=function(e,i){var n=i?7:0,r=2*n+1;if(this.nextRow+r>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o=0,s=0;s<e.length;s++)o+=e[s];if(0!==o){var a=this.width/o,l=this.getDashRanges(e,this.width,a);i?this.addRoundDash(l,a,n):this.addRegularDash(l)}var c={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:o};return this.nextRow+=r,this.dirty=!0,c},w.prototype.bind=function(t){var e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))};var C=function e(i,n){this.workerPool=i,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var r=this.workerPool.acquire(this.id),o=0;o<r.length;o++){var s=new e.Actor(r[o],n,this.id);s.name="Worker "+o,this.actors.push(s)}};function B(e,i,n){var r=function(r,o){if(r)return n(r);if(o){var s=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);o.vector_layers&&(s.vectorLayers=o.vector_layers,s.vectorLayerIds=s.vectorLayers.map((function(t){return t.id}))),s.tiles=i.canonicalizeTileset(s,e.url),n(null,s)}};return e.url?t.getJSON(i.transformRequest(i.normalizeSourceURL(e.url),t.ResourceType.Source),r):t.browser.frame((function(){return r(null,e)}))}C.prototype.broadcast=function(e,i,n){t.asyncAll(this.actors,(function(t,n){t.send(e,i,n)}),n=n||function(){})},C.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},C.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},C.Actor=t.Actor;var E=function(e,i,n){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=i||0,this.maxzoom=n||24};E.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},E.prototype.contains=function(e){var i=Math.pow(2,e.z),n=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*i),r=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*i),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*i),s=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*i);return e.x>=n&&e.x<o&&e.y>=r&&e.y<s};var S=function(e){function i(i,n,r,o){if(e.call(this),this.id=i,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(n,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},n),this._collectResourceTiming=n.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(o)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=B(this._options,this.map._requestManager,(function(i,n){e._tileJSONRequest=null,e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new E(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},i.prototype.loaded=function(){return this._loaded},i.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.onAdd=function(t){this.map=t,this.load()},i.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},i.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},i.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.loadTile=function(e,i){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme)),r={request:this.map._requestManager.transformRequest(n,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function o(n,r){return delete e.request,e.aborted?i(null):n&&404!==n.status?i(n):(r&&r.resourceTiming&&(e.resourceTiming=r.resourceTiming),this.map._refreshExpiredTiles&&r&&e.setExpiryData(r),e.loadVectorData(r,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),i(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}r.request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=i:e.request=e.actor.send("reloadTile",r,o.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",r,o.bind(this)))},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},i.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},i.prototype.hasTransition=function(){return!1},i}(t.Evented),T=function(e){function i(i,n,r,o){e.call(this),this.id=i,this.dispatcher=r,this.setEventedParent(o),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},n),t.extend(this,t.pick(n,["url","scheme","tileSize"]))}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=B(this._options,this.map._requestManager,(function(i,n){e._tileJSONRequest=null,e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):n&&(t.extend(e,n),n.bounds&&(e.tileBounds=new E(n.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(n.tiles),t.postMapLoadEvent(n.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},i.prototype.loaded=function(){return this._loaded},i.prototype.onAdd=function(t){this.map=t,this.load()},i.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},i.prototype.serialize=function(){return t.extend({},this._options)},i.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},i.prototype.loadTile=function(e,i){var n=this,r=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(r,t.ResourceType.Tile),(function(r,o){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(r)e.state="errored",i(r);else if(o){n.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var s=n.map.painter.context,a=s.gl;e.texture=n.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(s,o,a.RGBA,{useMipmap:!0}),e.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),s.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,s.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,s.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(n.dispatcher),i(null)}}))},i.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},i.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},i.prototype.hasTransition=function(){return!1},i}(t.Evented),M=function(e){function i(i,n,r,o){e.call(this,i,n,r,o),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},n),this.encoding=n.encoding||"mapbox"}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},i.prototype.loadTile=function(e,i){var n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function r(t,n){t&&(e.state="errored",i(t)),n&&(e.dem=n,e.needsHillshadePrepare=!0,e.state="loaded",i(null))}e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),function(n,o){if(delete e.request,e.aborted)e.state="unloaded",i(null);else if(n)e.state="errored",i(n);else if(o){this.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires;var s=t.window.ImageBitmap&&o instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?o:t.browser.getImageData(o,1),a={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:s,encoding:this.encoding};e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",a,r.bind(this)))}}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},i.prototype._getNeighboringTiles=function(e){var i=e.canonical,n=Math.pow(2,i.z),r=(i.x-1+n)%n,o=0===i.x?e.wrap-1:e.wrap,s=(i.x+1+n)%n,a=i.x+1===n?e.wrap+1:e.wrap,l={};return l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y).key]={backfilled:!1},i.y>0&&(l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y-1).key]={backfilled:!1}),i.y+1<n&&(l[new t.OverscaledTileID(e.overscaledZ,o,i.z,r,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,e.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new t.OverscaledTileID(e.overscaledZ,a,i.z,s,i.y+1).key]={backfilled:!1}),l},i.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},i}(T),I=function(e){function i(i,n,r,o){e.call(this),this.id=i,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=r.getActor(),this.setEventedParent(o),this._data=n.data,this._options=t.extend({},n),this._collectResourceTiming=n.collectResourceTiming,this._resourceTiming=[],void 0!==n.maxzoom&&(this.maxzoom=n.maxzoom),n.type&&(this.type=n.type),n.attribution&&(this.attribution=n.attribution),this.promoteId=n.promoteId;var s=t.EXTENT/this.tileSize;this.workerOptions=t.extend({source:this.id,cluster:n.cluster||!1,geojsonVtOptions:{buffer:(void 0!==n.buffer?n.buffer:128)*s,tolerance:(void 0!==n.tolerance?n.tolerance:.375)*s,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:n.lineMetrics||!1,generateId:n.generateId||!1},superclusterOptions:{maxZoom:void 0!==n.clusterMaxZoom?Math.min(n.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,n.clusterMinPoints||2),extent:t.EXTENT,radius:(n.clusterRadius||50)*s,log:!1,generateId:n.generateId||!1},clusterProperties:n.clusterProperties,filter:n.filter},n.workerOptions)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(i){if(i)e.fire(new t.ErrorEvent(i));else{var n={dataType:"source",sourceDataType:"metadata"};e._collectResourceTiming&&e._resourceTiming&&e._resourceTiming.length>0&&(n.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",n))}}))},i.prototype.onAdd=function(t){this.map=t,this.load()},i.prototype.setData=function(e){var i=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){if(e)i.fire(new t.ErrorEvent(e));else{var n={dataType:"source",sourceDataType:"content"};i._collectResourceTiming&&i._resourceTiming&&i._resourceTiming.length>0&&(n.resourceTiming=i._resourceTiming,i._resourceTiming=[]),i.fire(new t.Event("data",n))}})),this},i.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},i.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},i.prototype.getClusterLeaves=function(t,e,i,n){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:i},n),this},i.prototype._updateWorkerData=function(e){var i=this;this._loaded=!1;var n=t.extend({},this.workerOptions),r=this._data;"string"==typeof r?(n.request=this.map._requestManager.transformRequest(t.browser.resolveURL(r),t.ResourceType.Source),n.request.collectResourceTiming=this._collectResourceTiming):n.data=JSON.stringify(r),this.actor.send(this.type+".loadData",n,(function(t,r){i._removed||r&&r.abandoned||(i._loaded=!0,r&&r.resourceTiming&&r.resourceTiming[i.id]&&(i._resourceTiming=r.resourceTiming[i.id].slice(0)),i.actor.send(i.type+".coalesce",{source:n.source},null),e(t))}))},i.prototype.loaded=function(){return this._loaded},i.prototype.loadTile=function(e,i){var n=this,r=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(r,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?i(null):t?i(t):(e.loadVectorData(o,n.map.painter,"reloadTile"===r),i(null))}))},i.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},i.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},i.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},i.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},i.prototype.hasTransition=function(){return!1},i}(t.Evented),P=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),D=function(e){function i(t,i,n,r){e.call(this),this.id=t,this.dispatcher=n,this.coordinates=i.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=i}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(e,i){var n=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(r,o){n._loaded=!0,r?n.fire(new t.ErrorEvent(r)):o&&(n.image=o,e&&(n.coordinates=e),i&&i(),n._finishLoading())}))},i.prototype.loaded=function(){return this._loaded},i.prototype.updateImage=function(t){var e=this;return this.image&&t.url?(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null})),this):this},i.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},i.prototype.onAdd=function(t){this.map=t,this.load()},i.prototype.setCoordinates=function(e){var i=this;this.coordinates=e;var n=e.map(t.MercatorCoordinate.fromLngLat);this.tileID=function(e){for(var i=1/0,n=1/0,r=-1/0,o=-1/0,s=0,a=e;s<a.length;s+=1){var l=a[s];i=Math.min(i,l.x),n=Math.min(n,l.y),r=Math.max(r,l.x),o=Math.max(o,l.y)}var c=Math.max(r-i,o-n),u=Math.max(0,Math.floor(-Math.log(c)/Math.LN2)),h=Math.pow(2,u);return new t.CanonicalTileID(u,Math.floor((i+r)/2*h),Math.floor((n+o)/2*h))}(n),this.minzoom=this.maxzoom=this.tileID.z;var r=n.map((function(t){return i.tileID.getTilePoint(t)._round()}));return this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(r[2].x,r[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},i.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e=this.map.painter.context,i=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(e,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[n];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}},i.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={},e(null)):(t.state="errored",e(null))},i.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return!1},i}(t.Evented),L=function(e){function i(t,i,n,r){e.call(this,t,i,n,r),this.roundZoom=!0,this.type="video",this.options=i}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){var e=this;this._loaded=!1;var i=this.options;this.urls=[];for(var n=0,r=i.urls;n<r.length;n+=1)this.urls.push(this.map._requestManager.transformRequest(r[n],t.ResourceType.Source).url);t.getVideo(this.urls,(function(i,n){e._loaded=!0,i?e.fire(new t.ErrorEvent(i)):n&&(e.video=n,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},i.prototype.pause=function(){this.video&&this.video.pause()},i.prototype.play=function(){this.video&&this.video.play()},i.prototype.seek=function(e){if(this.video){var i=this.video.seekable;e<i.start(0)||e>i.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+i.start(0)+" and "+i.end(0)+"-second mark."))):this.video.currentTime=e}},i.prototype.getVideo=function(){return this.video},i.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},i.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e=this.map.painter.context,i=e.gl;for(var n in this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(e,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var r=this.tiles[n];"loaded"!==r.state&&(r.state="loaded",r.texture=this.texture)}}},i.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this.video&&!this.video.paused},i}(D),O=function(e){function i(i,n,r,o){e.call(this,i,n,r,o),n.coordinates?Array.isArray(n.coordinates)&&4===n.coordinates.length&&!n.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "coordinates"'))),n.animate&&"boolean"!=typeof n.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'optional "animate" property must be a boolean value'))),n.canvas?"string"==typeof n.canvas||n.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+i,null,'missing required property "canvas"'))),this.options=n,this.animate=void 0===n.animate||n.animate}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},i.prototype.getCanvas=function(){return this.canvas},i.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},i.prototype.onRemove=function(){this.pause()},i.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var i=this.map.painter.context,n=i.gl;for(var r in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,P.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},i.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},i.prototype.hasTransition=function(){return this._playing},i.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var i=e[t];if(isNaN(i)||i<=0)return!0}return!1},i}(D),F={vector:S,raster:T,"raster-dem":M,geojson:I,video:L,image:D,canvas:O};function R(e,i){var n=t.identity([]);return t.translate(n,n,[1,1,0]),t.scale(n,n,[.5*e.width,.5*e.height,1]),t.multiply(n,n,e.calculatePosMatrix(i.toUnwrapped()))}function k(t,e,i,n,r,o){var s=function(t,e,i){if(t)for(var n=0,r=t;n<r.length;n+=1){var o=e[r[n]];if(o&&o.source===i&&"fill-extrusion"===o.type)return!0}else for(var s in e){var a=e[s];if(a.source===i&&"fill-extrusion"===a.type)return!0}return!1}(r&&r.layers,e,t.id),a=o.maxPitchScaleFactor(),l=t.tilesIn(n,a,s);l.sort(z);for(var c=[],u=0,h=l;u<h.length;u+=1){var d=h[u];c.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(e,i,t._state,d.queryGeometry,d.cameraQueryGeometry,d.scale,r,o,a,R(t.transform,d.tileID))})}var p=function(t){for(var e={},i={},n=0,r=t;n<r.length;n+=1){var o=r[n],s=o.queryResults,a=o.wrappedTileID,l=i[a]=i[a]||{};for(var c in s)for(var u=s[c],h=l[c]=l[c]||{},d=e[c]=e[c]||[],p=0,A=u;p<A.length;p+=1){var f=A[p];h[f.featureIndex]||(h[f.featureIndex]=!0,d.push(f))}}return e}(c);for(var A in p)p[A].forEach((function(e){var i=e.feature,n=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=n}));return p}function z(t,e){var i=t.tileID,n=e.tileID;return i.overscaledZ-n.overscaledZ||i.canonical.y-n.canonical.y||i.wrap-n.wrap||i.canonical.x-n.canonical.x}var U=function(t,e){this.max=t,this.onRemove=e,this.reset()};U.prototype.reset=function(){for(var t in this.data)for(var e=0,i=this.data[t];e<i.length;e+=1){var n=i[e];n.timeout&&clearTimeout(n.timeout),this.onRemove(n.value)}return this.data={},this.order=[],this},U.prototype.add=function(t,e,i){var n=this,r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);var o={value:e,timeout:void 0};if(void 0!==i&&(o.timeout=setTimeout((function(){n.remove(t,o)}),i)),this.data[r].push(o),this.order.push(r),this.order.length>this.max){var s=this._getAndRemoveByKey(this.order[0]);s&&this.onRemove(s)}return this},U.prototype.has=function(t){return t.wrapped().key in this.data},U.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},U.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},U.prototype.getByKey=function(t){var e=this.data[t];return e?e[0].value:null},U.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},U.prototype.remove=function(t,e){if(!this.has(t))return this;var i=t.wrapped().key,n=void 0===e?0:this.data[i].indexOf(e),r=this.data[i][n];return this.data[i].splice(n,1),r.timeout&&clearTimeout(r.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(r.value),this.order.splice(this.order.indexOf(i),1),this},U.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},U.prototype.filter=function(t){var e=[];for(var i in this.data)for(var n=0,r=this.data[i];n<r.length;n+=1){var o=r[n];t(o.value)||e.push(o)}for(var s=0,a=e;s<a.length;s+=1){var l=a[s];this.remove(l.value.tileID,l)}};var N=function(t,e,i){this.context=t;var n=t.gl;this.buffer=n.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),n.bufferData(n.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};N.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},N.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},N.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var G={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Z=function(t,e,i,n){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=n,this.context=t;var r=t.gl;this.buffer=r.createBuffer(),t.bindVertexBuffer.set(this.buffer),r.bufferData(r.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer};Z.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Z.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},Z.prototype.enableAttributes=function(t,e){for(var i=0;i<this.attributes.length;i++){var n=e.attributes[this.attributes[i].name];void 0!==n&&t.enableVertexAttribArray(n)}},Z.prototype.setVertexAttribPointers=function(t,e,i){for(var n=0;n<this.attributes.length;n++){var r=this.attributes[n],o=e.attributes[r.name];void 0!==o&&t.vertexAttribPointer(o,r.components,t[G[r.type]],!1,this.itemSize,r.offset+this.itemSize*(i||0))}},Z.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var j=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};j.prototype.get=function(){return this.current},j.prototype.set=function(t){},j.prototype.getDefault=function(){return this.default},j.prototype.setDefault=function(){this.set(this.default)};var V=function(e){function i(){e.apply(this,arguments)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},i}(j),H=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 1},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},e}(j),J=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},e}(j),W=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[!0,!0,!0,!0]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(j),Q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)},e}(j),q=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 255},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},e}(j),K=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},e.prototype.set=function(t){var e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},e}(j),X=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},e}(j),Y=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}},e}(j),$=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return[0,1]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},e}(j),tt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}},e}(j),et=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.LESS},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},e}(j),it=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}},e}(j),nt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},e}(j),rt=function(e){function i(){e.apply(this,arguments)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getDefault=function(){return t.Color.transparent},i.prototype.set=function(t){var e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},i}(j),ot=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.FUNC_ADD},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},e}(j),st=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}},e}(j),at=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.BACK},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)},e}(j),lt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.CCW},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)},e}(j),ct=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)},e}(j),ut=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return this.gl.TEXTURE0},e.prototype.set=function(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},e}(j),ht=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},e.prototype.set=function(t){var e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},e}(j),dt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}},e}(j),pt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(j),At=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}},e}(j),ft=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}},e}(j),gt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},e}(j),mt=function(t){function e(e){t.call(this,e),this.vao=e.extVertexArrayObject}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},e}(j),yt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return 4},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}},e}(j),vt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}},e}(j),_t=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return!1},e.prototype.set=function(t){if(t!==this.current||this.dirty){var e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}},e}(j),bt=function(t){function e(e,i){t.call(this,e),this.context=e,this.parent=i}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.getDefault=function(){return null},e}(j),xt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.setDirty=function(){this.dirty=!0},e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}},e}(bt),wt=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.set=function(t){if(t!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}},e}(bt),Ct=function(t,e,i,n){this.context=t,this.width=e,this.height=i;var r=this.framebuffer=t.gl.createFramebuffer();this.colorAttachment=new xt(t,r),n&&(this.depthAttachment=new wt(t,r))};Ct.prototype.destroy=function(){var t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){var i=this.depthAttachment.get();i&&t.deleteRenderbuffer(i)}t.deleteFramebuffer(this.framebuffer)};var Bt=function(t,e,i){this.func=t,this.mask=e,this.range=i};Bt.ReadOnly=!1,Bt.ReadWrite=!0,Bt.disabled=new Bt(519,Bt.ReadOnly,[0,1]);var Et=function(t,e,i,n,r,o){this.test=t,this.ref=e,this.mask=i,this.fail=n,this.depthFail=r,this.pass=o};Et.disabled=new Et({func:519,mask:0},0,0,7680,7680,7680);var St=function(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i};St.disabled=new St(St.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),St.unblended=new St(St.Replace,t.Color.transparent,[!0,!0,!0,!0]),St.alphaBlended=new St([1,771],t.Color.transparent,[!0,!0,!0,!0]);var Tt=function(t,e,i){this.enable=t,this.mode=e,this.frontFace=i};Tt.disabled=new Tt(!1,1029,2305),Tt.backCCW=new Tt(!0,1029,2305);var Mt=function(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new V(this),this.clearDepth=new H(this),this.clearStencil=new J(this),this.colorMask=new W(this),this.depthMask=new Q(this),this.stencilMask=new q(this),this.stencilFunc=new K(this),this.stencilOp=new X(this),this.stencilTest=new Y(this),this.depthRange=new $(this),this.depthTest=new tt(this),this.depthFunc=new et(this),this.blend=new it(this),this.blendFunc=new nt(this),this.blendColor=new rt(this),this.blendEquation=new ot(this),this.cullFace=new st(this),this.cullFaceSide=new at(this),this.frontFace=new lt(this),this.program=new ct(this),this.activeTexture=new ut(this),this.viewport=new ht(this),this.bindFramebuffer=new dt(this),this.bindRenderbuffer=new pt(this),this.bindTexture=new At(this),this.bindVertexBuffer=new ft(this),this.bindElementBuffer=new gt(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new mt(this),this.pixelStoreUnpack=new yt(this),this.pixelStoreUnpackPremultiplyAlpha=new vt(this),this.pixelStoreUnpackFlipY=new _t(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)};Mt.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},Mt.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},Mt.prototype.createIndexBuffer=function(t,e){return new N(this,t,e)},Mt.prototype.createVertexBuffer=function(t,e,i){return new Z(this,t,e,i)},Mt.prototype.createRenderbuffer=function(t,e,i){var n=this.gl,r=n.createRenderbuffer();return this.bindRenderbuffer.set(r),n.renderbufferStorage(n.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),r},Mt.prototype.createFramebuffer=function(t,e,i){return new Ct(this,t,e,i)},Mt.prototype.clear=function(t){var e=t.color,i=t.depth,n=this.gl,r=0;e&&(r|=n.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==i&&(r|=n.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(i),this.depthMask.set(!0)),n.clear(r)},Mt.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},Mt.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},Mt.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},Mt.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,St.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},Mt.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var It=function(e){function i(i,n,r){var o=this;e.call(this),this.id=i,this.dispatcher=r,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(o._sourceLoaded=!0),o._sourceLoaded&&!o._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(o.reload(),o.transform&&o.update(o.transform))})),this.on("error",(function(){o._sourceErrored=!0})),this._source=function(e,i,n,r){var o=new F[i.type](e,i,n,r);if(o.id!==e)throw new Error("Expected Source id to be "+e+" instead of "+o.id);return t.bindAll(["load","abort","unload","serialize","prepare"],o),o}(i,n,r,this),this._tiles={},this._cache=new U(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},i.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},i.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},i.prototype.getSource=function(){return this._source},i.prototype.pause=function(){this._paused=!0},i.prototype.resume=function(){if(this._paused){var t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform)}},i.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},i.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},i.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},i.prototype.serialize=function(){return this._source.serialize()},i.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}},i.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(Pt).map((function(t){return t.key}))},i.prototype.getRenderableIds=function(e){var i=this,n=[];for(var r in this._tiles)this._isIdRenderable(r,e)&&n.push(this._tiles[r]);return e?n.sort((function(e,n){var r=e.tileID,o=n.tileID,s=new t.Point(r.canonical.x,r.canonical.y)._rotate(i.transform.angle),a=new t.Point(o.canonical.x,o.canonical.y)._rotate(i.transform.angle);return r.overscaledZ-o.overscaledZ||a.y-s.y||a.x-s.x})).map((function(t){return t.tileID.key})):n.map((function(t){return t.tileID})).sort(Pt).map((function(t){return t.key}))},i.prototype.hasRenderableParent=function(t){var e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)},i.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},i.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},i.prototype._reloadTile=function(t,e){var i=this._tiles[t];i&&("loading"!==i.state&&(i.state=e),this._loadTile(i,this._tileLoaded.bind(this,i,t,e)))},i.prototype._tileLoaded=function(e,i,n,r){if(r)return e.state="errored",void(404!==r.status?this._source.fire(new t.ErrorEvent(r,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===n&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(i,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},i.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),i=0;i<e.length;i++){var n=e[i];if(t.neighboringTiles&&t.neighboringTiles[n]){var r=this.getTileByID(n);o(t,r),o(r,t)}}function o(t,e){t.needsHillshadePrepare=!0;var i=e.tileID.canonical.x-t.tileID.canonical.x,n=e.tileID.canonical.y-t.tileID.canonical.y,r=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===i&&0===n||Math.abs(n)>1||(Math.abs(i)>1&&(1===Math.abs(i+r)?i+=r:1===Math.abs(i-r)&&(i-=r)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,n),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},i.prototype.getTile=function(t){return this.getTileByID(t.key)},i.prototype.getTileByID=function(t){return this._tiles[t]},i.prototype._retainLoadedChildren=function(t,e,i,n){for(var r in this._tiles){var o=this._tiles[r];if(!(n[r]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>i)){for(var s=o.tileID;o&&o.tileID.overscaledZ>e+1;){var a=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[a.key])&&o.hasData()&&(s=a)}for(var l=s;l.overscaledZ>e;)if(t[(l=l.scaledTo(l.overscaledZ-1)).key]){n[s.key]=s;break}}}},i.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(var n=t.overscaledZ-1;n>=e;n--){var r=t.scaledTo(n),o=this._getLoadedTile(r);if(o)return o}},i.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},i.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1,i=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(e*i*5),r="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(r)},i.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var i={};for(var n in this._tiles){var r=this._tiles[n];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),i[r.tileID.key]=r}for(var o in this._tiles=i,this._timers)clearTimeout(this._timers[o]),delete this._timers[o];for(var s in this._tiles)this._setTileReloadTimer(s,this._tiles[s])}},i.prototype.update=function(e){var n=this;if(this.transform=e,this._sourceLoaded&&!this._paused){var r;this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(r=r.filter((function(t){return n._source.hasTile(t)})))):r=[];var o=e.coveringZoomLevel(this._source),s=Math.max(o-i.maxOverzooming,this._source.minzoom),a=Math.max(o+i.maxUnderzooming,this._source.minzoom),l=this._updateRetainedTiles(r,o);if(Dt(this._source.type)){for(var c={},u={},h=0,d=Object.keys(l);h<d.length;h+=1){var p=d[h],A=l[p],f=this._tiles[p];if(f&&!(f.fadeEndTime&&f.fadeEndTime<=t.browser.now())){var g=this.findLoadedParent(A,s);g&&(this._addTile(g.tileID),c[g.tileID.key]=g.tileID),u[p]=A}}for(var m in this._retainLoadedChildren(u,o,a,l),c)l[m]||(this._coveredTiles[m]=!0,l[m]=c[m])}for(var y in l)this._tiles[y].clearFadeHold();for(var v=0,_=t.keysDifference(this._tiles,l);v<_.length;v+=1){var b=_[v],x=this._tiles[b];x.hasSymbolBuckets&&!x.holdingForFade()?x.setHoldDuration(this.map._fadeDuration):x.hasSymbolBuckets&&!x.symbolFadeFinished()||this._removeTile(b)}this._updateLoadedParentTileCache()}},i.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},i.prototype._updateRetainedTiles=function(t,e){for(var n={},r={},o=Math.max(e-i.maxOverzooming,this._source.minzoom),s=Math.max(e+i.maxUnderzooming,this._source.minzoom),a={},l=0,c=t;l<c.length;l+=1){var u=c[l],h=this._addTile(u);n[u.key]=u,h.hasData()||e<this._source.maxzoom&&(a[u.key]=u)}this._retainLoadedChildren(a,e,s,n);for(var d=0,p=t;d<p.length;d+=1){var A=p[d],f=this._tiles[A.key];if(!f.hasData()){if(e+1>this._source.maxzoom){var g=A.children(this._source.maxzoom)[0],m=this.getTile(g);if(m&&m.hasData()){n[g.key]=g;continue}}else{var y=A.children(this._source.maxzoom);if(n[y[0].key]&&n[y[1].key]&&n[y[2].key]&&n[y[3].key])continue}for(var v=f.wasRequested(),_=A.overscaledZ-1;_>=o;--_){var b=A.scaledTo(_);if(r[b.key])break;if(r[b.key]=!0,!(f=this.getTile(b))&&v&&(f=this._addTile(b)),f&&(n[b.key]=b,v=f.wasRequested(),f.hasData()))break}}}return n},i.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],i=void 0,n=this._tiles[t].tileID;n.overscaledZ>0;){if(n.key in this._loadedParentTiles){i=this._loadedParentTiles[n.key];break}e.push(n.key);var r=n.scaledTo(n.overscaledZ-1);if(i=this._getLoadedTile(r))break;n=r}for(var o=0,s=e;o<s.length;o+=1)this._loadedParentTiles[s[o]]=i}},i.prototype._addTile=function(e){var i=this._tiles[e.key];if(i)return i;(i=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,i),i.tileID=e,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,i)));var n=Boolean(i);return n||(i=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(i,this._tileLoaded.bind(this,i,e.key,i.state))),i?(i.uses++,this._tiles[e.key]=i,n||this._source.fire(new t.Event("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i):null},i.prototype._setTileReloadTimer=function(t,e){var i=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);var n=e.getExpiryTimeout();n&&(this._timers[t]=setTimeout((function(){i._reloadTile(t,"expired"),delete i._timers[t]}),n))},i.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},i.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},i.prototype.tilesIn=function(e,i,n){var r=this,o=[],s=this.transform;if(!s)return o;for(var a=n?s.getCameraQueryGeometry(e):e,l=e.map((function(t){return s.pointCoordinate(t)})),c=a.map((function(t){return s.pointCoordinate(t)})),u=this.getIds(),h=1/0,d=1/0,p=-1/0,A=-1/0,f=0,g=c;f<g.length;f+=1){var m=g[f];h=Math.min(h,m.x),d=Math.min(d,m.y),p=Math.max(p,m.x),A=Math.max(A,m.y)}for(var y=function(e){var n=r._tiles[u[e]];if(!n.holdingForFade()){var a=n.tileID,f=Math.pow(2,s.zoom-n.tileID.overscaledZ),g=i*n.queryPadding*t.EXTENT/n.tileSize/f,m=[a.getTilePoint(new t.MercatorCoordinate(h,d)),a.getTilePoint(new t.MercatorCoordinate(p,A))];if(m[0].x-g<t.EXTENT&&m[0].y-g<t.EXTENT&&m[1].x+g>=0&&m[1].y+g>=0){var y=l.map((function(t){return a.getTilePoint(t)})),v=c.map((function(t){return a.getTilePoint(t)}));o.push({tile:n,tileID:a,queryGeometry:y,cameraQueryGeometry:v,scale:f})}}},v=0;v<u.length;v++)y(v);return o},i.prototype.getVisibleCoordinates=function(t){for(var e=this,i=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID})),n=0,r=i;n<r.length;n+=1){var o=r[n];o.posMatrix=this.transform.calculatePosMatrix(o.toUnwrapped())}return i},i.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(Dt(this._source.type))for(var e in this._tiles){var i=this._tiles[e];if(void 0!==i.fadeEndTime&&i.fadeEndTime>=t.browser.now())return!0}return!1},i.prototype.setFeatureState=function(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)},i.prototype.removeFeatureState=function(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)},i.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},i.prototype.setDependencies=function(t,e,i){var n=this._tiles[t];n&&n.setDependencies(e,i)},i.prototype.reloadTilesForDependencies=function(t,e){for(var i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter((function(i){return!i.hasDependency(t,e)}))},i}(t.Evented);function Pt(t,e){var i=Math.abs(2*t.wrap)-+(t.wrap<0),n=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||n-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function Dt(t){return"raster"===t||"image"===t||"video"===t}function Lt(){return new t.window.Worker(qr.workerUrl)}It.maxOverzooming=10,It.maxUnderzooming=3;var Ot="mapboxgl_preloaded_worker_pool",Ft=function(){this.active={}};Ft.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<Ft.workerCount;)this.workers.push(new Lt);return this.active[t]=!0,this.workers.slice()},Ft.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},Ft.prototype.isPreloaded=function(){return!!this.active[Ot]},Ft.prototype.numActive=function(){return Object.keys(this.active).length};var Rt,kt=Math.floor(t.browser.hardwareConcurrency/2);function zt(){return Rt||(Rt=new Ft),Rt}function Ut(e,i){var n={};for(var r in e)"ref"!==r&&(n[r]=e[r]);return t.refProperties.forEach((function(t){t in i&&(n[t]=i[t])})),n}function Nt(t){t=t.slice();for(var e=Object.create(null),i=0;i<t.length;i++)e[t[i].id]=t[i];for(var n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=Ut(t[n],e[t[n].ref]));return t}Ft.workerCount=Math.max(Math.min(kt,6),1);var Gt={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function Zt(t,e,i){i.push({command:Gt.addSource,args:[t,e[t]]})}function jt(t,e,i){e.push({command:Gt.removeSource,args:[t]}),i[t]=!0}function Vt(t,e,i,n){jt(t,i,n),Zt(t,e,i)}function Ht(e,i,n){var r;for(r in e[n])if(e[n].hasOwnProperty(r)&&"data"!==r&&!t.deepEqual(e[n][r],i[n][r]))return!1;for(r in i[n])if(i[n].hasOwnProperty(r)&&"data"!==r&&!t.deepEqual(e[n][r],i[n][r]))return!1;return!0}function Jt(e,i,n,r,o,s){var a;for(a in i=i||{},e=e||{})e.hasOwnProperty(a)&&(t.deepEqual(e[a],i[a])||n.push({command:s,args:[r,a,i[a],o]}));for(a in i)i.hasOwnProperty(a)&&!e.hasOwnProperty(a)&&(t.deepEqual(e[a],i[a])||n.push({command:s,args:[r,a,i[a],o]}))}function Wt(t){return t.id}function Qt(t,e){return t[e.id]=e,t}var qt=function(t,e){this.reset(t,e)};qt.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var i=1;i<this.points.length;i++)this._distances[i]=this._distances[i-1]+this.points[i].dist(this.points[i-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},qt.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var i=1,n=this._distances[i],r=e*this.paddedLength+this.padding;n<r&&i<this._distances.length;)n=this._distances[++i];var o=i-1,s=this._distances[o],a=n-s,l=a>0?(r-s)/a:0;return this.points[o].mult(1-l).add(this.points[i].mult(l))};var Kt=function(t,e,i){var n=this.boxCells=[],r=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(var o=0;o<this.xCellCount*this.yCellCount;o++)n.push([]),r.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0};function Xt(e,i,n,r,o){var s=t.create();return i?(t.scale(s,s,[1/o,1/o,1]),n||t.rotateZ(s,s,r.angle)):t.multiply(s,r.labelPlaneMatrix,e),s}function Yt(e,i,n,r,o){if(i){var s=t.clone(e);return t.scale(s,s,[o,o,1]),n||t.rotateZ(s,s,-r.angle),s}return r.glCoordMatrix}function $t(e,i){var n=[e.x,e.y,0,1];ue(n,n,i);var r=n[3];return{point:new t.Point(n[0]/r,n[1]/r),signedDistanceFromCamera:r}}function te(t,e){return.5+t/e*.5}function ee(t,e){var i=t[0]/t[3],n=t[1]/t[3];return i>=-e[0]&&i<=e[0]&&n>=-e[1]&&n<=e[1]}function ie(e,i,n,r,o,s,a,l){var c=r?e.textSizeData:e.iconSizeData,u=t.evaluateSizeForZoom(c,n.transform.zoom),h=[256/n.width*2+1,256/n.height*2+1],d=r?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;d.clear();for(var p=e.lineVertexArray,A=r?e.text.placedSymbolArray:e.icon.placedSymbolArray,f=n.transform.width/n.transform.height,g=!1,m=0;m<A.length;m++){var y=A.get(m);if(y.hidden||y.writingMode===t.WritingMode.vertical&&!g)ce(y.numGlyphs,d);else{g=!1;var v=[y.anchorX,y.anchorY,0,1];if(t.transformMat4(v,v,i),ee(v,h)){var _=te(n.transform.cameraToCenterDistance,v[3]),b=t.evaluateSizeForFeature(c,u,y),x=a?b/_:b*_,w=new t.Point(y.anchorX,y.anchorY),C=$t(w,o).point,B={},E=oe(y,x,!1,l,i,o,s,e.glyphOffsetArray,p,d,C,w,B,f);g=E.useVertical,(E.notEnoughRoom||g||E.needsFlipping&&oe(y,x,!0,l,i,o,s,e.glyphOffsetArray,p,d,C,w,B,f).notEnoughRoom)&&ce(y.numGlyphs,d)}else ce(y.numGlyphs,d)}}r?e.text.dynamicLayoutVertexBuffer.updateData(d):e.icon.dynamicLayoutVertexBuffer.updateData(d)}function ne(t,e,i,n,r,o,s,a,l,c,u){var h=a.glyphStartIndex+a.numGlyphs,d=a.lineStartIndex,p=a.lineStartIndex+a.lineLength,A=e.getoffsetX(a.glyphStartIndex),f=e.getoffsetX(h-1),g=ae(t*A,i,n,r,o,s,a.segment,d,p,l,c,u);if(!g)return null;var m=ae(t*f,i,n,r,o,s,a.segment,d,p,l,c,u);return m?{first:g,last:m}:null}function re(e,i,n,r){return e===t.WritingMode.horizontal&&Math.abs(n.y-i.y)>Math.abs(n.x-i.x)*r?{useVertical:!0}:(e===t.WritingMode.vertical?i.y<n.y:i.x>n.x)?{needsFlipping:!0}:null}function oe(e,i,n,r,o,s,a,l,c,u,h,d,p,A){var f,g=i/24,m=e.lineOffsetX*g,y=e.lineOffsetY*g;if(e.numGlyphs>1){var v=e.glyphStartIndex+e.numGlyphs,_=e.lineStartIndex,b=e.lineStartIndex+e.lineLength,x=ne(g,l,m,y,n,h,d,e,c,s,p);if(!x)return{notEnoughRoom:!0};var w=$t(x.first.point,a).point,C=$t(x.last.point,a).point;if(r&&!n){var B=re(e.writingMode,w,C,A);if(B)return B}f=[x.first];for(var E=e.glyphStartIndex+1;E<v-1;E++)f.push(ae(g*l.getoffsetX(E),m,y,n,h,d,e.segment,_,b,c,s,p));f.push(x.last)}else{if(r&&!n){var S=$t(d,o).point,T=e.lineStartIndex+e.segment+1,M=new t.Point(c.getx(T),c.gety(T)),I=$t(M,o),P=I.signedDistanceFromCamera>0?I.point:se(d,M,S,1,o),D=re(e.writingMode,S,P,A);if(D)return D}var L=ae(g*l.getoffsetX(e.glyphStartIndex),m,y,n,h,d,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,c,s,p);if(!L)return{notEnoughRoom:!0};f=[L]}for(var O=0,F=f;O<F.length;O+=1){var R=F[O];t.addDynamicAttributes(u,R.point,R.angle)}return{}}function se(t,e,i,n,r){var o=$t(t.add(t.sub(e)._unit()),r).point,s=i.sub(o);return i.add(s._mult(n/s.mag()))}function ae(e,i,n,r,o,s,a,l,c,u,h,d){var p=r?e-i:e+i,A=p>0?1:-1,f=0;r&&(A*=-1,f=Math.PI),A<0&&(f+=Math.PI);for(var g=A>0?l+a:l+a+1,m=o,y=o,v=0,_=0,b=Math.abs(p),x=[];v+_<=b;){if((g+=A)<l||g>=c)return null;if(y=m,x.push(m),void 0===(m=d[g])){var w=new t.Point(u.getx(g),u.gety(g)),C=$t(w,h);if(C.signedDistanceFromCamera>0)m=d[g]=C.point;else{var B=g-A;m=se(0===v?s:new t.Point(u.getx(B),u.gety(B)),w,y,b-v+1,h)}}v+=_,_=y.dist(m)}var E=(b-v)/_,S=m.sub(y),T=S.mult(E)._add(y);T._add(S._unit()._perp()._mult(n*A));var M=f+Math.atan2(m.y-y.y,m.x-y.x);return x.push(T),{point:T,angle:M,path:x}}Kt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Kt.prototype.insert=function(t,e,i,n,r){this._forEachCell(e,i,n,r,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(n),this.bboxes.push(r)},Kt.prototype.insertCircle=function(t,e,i,n){this._forEachCell(e-n,i-n,e+n,i+n,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(n)},Kt.prototype._insertBoxCell=function(t,e,i,n,r,o){this.boxCells[r].push(o)},Kt.prototype._insertCircleCell=function(t,e,i,n,r,o){this.circleCells[r].push(o)},Kt.prototype._query=function(t,e,i,n,r,o){if(i<0||t>this.width||n<0||e>this.height)return!r&&[];var s=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=n){if(r)return!0;for(var a=0;a<this.boxKeys.length;a++)s.push({key:this.boxKeys[a],x1:this.bboxes[4*a],y1:this.bboxes[4*a+1],x2:this.bboxes[4*a+2],y2:this.bboxes[4*a+3]});for(var l=0;l<this.circleKeys.length;l++){var c=this.circles[3*l],u=this.circles[3*l+1],h=this.circles[3*l+2];s.push({key:this.circleKeys[l],x1:c-h,y1:u-h,x2:c+h,y2:u+h})}return o?s.filter(o):s}return this._forEachCell(t,e,i,n,this._queryCell,s,{hitTest:r,seenUids:{box:{},circle:{}}},o),r?s.length>0:s},Kt.prototype._queryCircle=function(t,e,i,n,r){var o=t-i,s=t+i,a=e-i,l=e+i;if(s<0||o>this.width||l<0||a>this.height)return!n&&[];var c=[];return this._forEachCell(o,a,s,l,this._queryCellCircle,c,{hitTest:n,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},r),n?c.length>0:c},Kt.prototype.query=function(t,e,i,n,r){return this._query(t,e,i,n,!1,r)},Kt.prototype.hitTest=function(t,e,i,n,r){return this._query(t,e,i,n,!0,r)},Kt.prototype.hitTestCircle=function(t,e,i,n){return this._queryCircle(t,e,i,!0,n)},Kt.prototype._queryCell=function(t,e,i,n,r,o,s,a){var l=s.seenUids,c=this.boxCells[r];if(null!==c)for(var u=this.bboxes,h=0,d=c;h<d.length;h+=1){var p=d[h];if(!l.box[p]){l.box[p]=!0;var A=4*p;if(t<=u[A+2]&&e<=u[A+3]&&i>=u[A+0]&&n>=u[A+1]&&(!a||a(this.boxKeys[p]))){if(s.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[p],x1:u[A],y1:u[A+1],x2:u[A+2],y2:u[A+3]})}}}var f=this.circleCells[r];if(null!==f)for(var g=this.circles,m=0,y=f;m<y.length;m+=1){var v=y[m];if(!l.circle[v]){l.circle[v]=!0;var _=3*v;if(this._circleAndRectCollide(g[_],g[_+1],g[_+2],t,e,i,n)&&(!a||a(this.circleKeys[v]))){if(s.hitTest)return o.push(!0),!0;var b=g[_],x=g[_+1],w=g[_+2];o.push({key:this.circleKeys[v],x1:b-w,y1:x-w,x2:b+w,y2:x+w})}}}},Kt.prototype._queryCellCircle=function(t,e,i,n,r,o,s,a){var l=s.circle,c=s.seenUids,u=this.boxCells[r];if(null!==u)for(var h=this.bboxes,d=0,p=u;d<p.length;d+=1){var A=p[d];if(!c.box[A]){c.box[A]=!0;var f=4*A;if(this._circleAndRectCollide(l.x,l.y,l.radius,h[f+0],h[f+1],h[f+2],h[f+3])&&(!a||a(this.boxKeys[A])))return o.push(!0),!0}}var g=this.circleCells[r];if(null!==g)for(var m=this.circles,y=0,v=g;y<v.length;y+=1){var _=v[y];if(!c.circle[_]){c.circle[_]=!0;var b=3*_;if(this._circlesCollide(m[b],m[b+1],m[b+2],l.x,l.y,l.radius)&&(!a||a(this.circleKeys[_])))return o.push(!0),!0}}},Kt.prototype._forEachCell=function(t,e,i,n,r,o,s,a){for(var l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),u=this._convertToXCellCoord(i),h=this._convertToYCellCoord(n),d=l;d<=u;d++)for(var p=c;p<=h;p++)if(r.call(this,t,e,i,n,this.xCellCount*p+d,o,s,a))return},Kt.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Kt.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Kt.prototype._circlesCollide=function(t,e,i,n,r,o){var s=n-t,a=r-e,l=i+o;return l*l>s*s+a*a},Kt.prototype._circleAndRectCollide=function(t,e,i,n,r,o,s){var a=(o-n)/2,l=Math.abs(t-(n+a));if(l>a+i)return!1;var c=(s-r)/2,u=Math.abs(e-(r+c));if(u>c+i)return!1;if(l<=a||u<=c)return!0;var h=l-a,d=u-c;return h*h+d*d<=i*i};var le=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ce(t,e){for(var i=0;i<t;i++){var n=e.length;e.resize(n+4),e.float32.set(le,3*n)}}function ue(t,e,i){var n=e[0],r=e[1];return t[0]=i[0]*n+i[4]*r+i[12],t[1]=i[1]*n+i[5]*r+i[13],t[3]=i[3]*n+i[7]*r+i[15],t}var he=function(t,e,i){void 0===e&&(e=new Kt(t.width+200,t.height+200,25)),void 0===i&&(i=new Kt(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=i,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200};function de(e,i,n){return i*(t.EXTENT/(e.tileSize*Math.pow(2,n-e.tileID.overscaledZ)))}he.prototype.placeCollisionBox=function(t,e,i,n,r){var o=this.projectAndGetPerspectiveRatio(n,t.anchorPointX,t.anchorPointY),s=i*o.perspectiveRatio,a=t.x1*s+o.point.x,l=t.y1*s+o.point.y,c=t.x2*s+o.point.x,u=t.y2*s+o.point.y;return!this.isInsideGrid(a,l,c,u)||!e&&this.grid.hitTest(a,l,c,u,r)?{box:[],offscreen:!1}:{box:[a,l,c,u],offscreen:this.isOffscreen(a,l,c,u)}},he.prototype.placeCollisionCircles=function(e,i,n,r,o,s,a,l,c,u,h,d,p){var A=[],f=new t.Point(i.anchorX,i.anchorY),g=$t(f,s),m=te(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),y=(u?o/m:o*m)/t.ONE_EM,v=$t(f,a).point,_=ne(y,r,i.lineOffsetX*y,i.lineOffsetY*y,!1,v,f,i,n,a,{}),b=!1,x=!1,w=!0;if(_){for(var C=.5*d*m+p,B=new t.Point(-100,-100),E=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),S=new qt,T=_.first,M=_.last,I=[],P=T.path.length-1;P>=1;P--)I.push(T.path[P]);for(var D=1;D<M.path.length;D++)I.push(M.path[D]);var L=2.5*C;if(l){var O=I.map((function(t){return $t(t,l)}));I=O.some((function(t){return t.signedDistanceFromCamera<=0}))?[]:O.map((function(t){return t.point}))}var F=[];if(I.length>0){for(var R=I[0].clone(),k=I[0].clone(),z=1;z<I.length;z++)R.x=Math.min(R.x,I[z].x),R.y=Math.min(R.y,I[z].y),k.x=Math.max(k.x,I[z].x),k.y=Math.max(k.y,I[z].y);F=R.x>=B.x&&k.x<=E.x&&R.y>=B.y&&k.y<=E.y?[I]:k.x<B.x||R.x>E.x||k.y<B.y||R.y>E.y?[]:t.clipLine([I],B.x,B.y,E.x,E.y)}for(var U=0,N=F;U<N.length;U+=1){var G;S.reset(N[U],.25*C),G=S.length<=.5*C?1:Math.ceil(S.paddedLength/L)+1;for(var Z=0;Z<G;Z++){var j=Z/Math.max(G-1,1),V=S.lerp(j),H=V.x+100,J=V.y+100;A.push(H,J,C,0);var W=H-C,Q=J-C,q=H+C,K=J+C;if(w=w&&this.isOffscreen(W,Q,q,K),x=x||this.isInsideGrid(W,Q,q,K),!e&&this.grid.hitTestCircle(H,J,C,h)&&(b=!0,!c))return{circles:[],offscreen:!1,collisionDetected:b}}}}return{circles:!c&&b||!x?[]:A,offscreen:w,collisionDetected:b}},he.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var i=[],n=1/0,r=1/0,o=-1/0,s=-1/0,a=0,l=e;a<l.length;a+=1){var c=l[a],u=new t.Point(c.x+100,c.y+100);n=Math.min(n,u.x),r=Math.min(r,u.y),o=Math.max(o,u.x),s=Math.max(s,u.y),i.push(u)}for(var h={},d={},p=0,A=this.grid.query(n,r,o,s).concat(this.ignoredGrid.query(n,r,o,s));p<A.length;p+=1){var f=A[p],g=f.key;if(void 0===h[g.bucketInstanceId]&&(h[g.bucketInstanceId]={}),!h[g.bucketInstanceId][g.featureIndex]){var m=[new t.Point(f.x1,f.y1),new t.Point(f.x2,f.y1),new t.Point(f.x2,f.y2),new t.Point(f.x1,f.y2)];t.polygonIntersectsPolygon(i,m)&&(h[g.bucketInstanceId][g.featureIndex]=!0,void 0===d[g.bucketInstanceId]&&(d[g.bucketInstanceId]=[]),d[g.bucketInstanceId].push(g.featureIndex))}}return d},he.prototype.insertCollisionBox=function(t,e,i,n,r){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:r},t[0],t[1],t[2],t[3])},he.prototype.insertCollisionCircles=function(t,e,i,n,r){for(var o=e?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:r},a=0;a<t.length;a+=4)o.insertCircle(s,t[a],t[a+1],t[a+2])},he.prototype.projectAndGetPerspectiveRatio=function(e,i,n){var r=[i,n,0,1];return ue(r,r,e),{point:new t.Point((r[0]/r[3]+1)/2*this.transform.width+100,(-r[1]/r[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/r[3]*.5}},he.prototype.isOffscreen=function(t,e,i,n){return i<100||t>=this.screenRightBoundary||n<100||e>this.screenBottomBoundary},he.prototype.isInsideGrid=function(t,e,i,n){return i>=0&&t<this.gridRightBoundary&&n>=0&&e<this.gridBottomBoundary},he.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e};var pe=function(t,e,i,n){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):n&&i?1:0,this.placed=i};pe.prototype.isHidden=function(){return 0===this.opacity&&!this.placed};var Ae=function(t,e,i,n,r){this.text=new pe(t?t.text:null,e,i,r),this.icon=new pe(t?t.icon:null,e,n,r)};Ae.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var fe=function(t,e,i){this.text=t,this.icon=e,this.skipFade=i},ge=function(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]},me=function(t,e,i,n,r){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=n,this.tileID=r},ye=function(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}};function ve(e,i,n,r,o){var s=t.getAnchorAlignment(e),a=-(s.horizontalAlign-.5)*i,l=-(s.verticalAlign-.5)*n,c=t.evaluateVariableOffset(e,r);return new t.Point(a+c[0]*o,l+c[1]*o)}function _e(e,i,n,r,o,s){var a=e.x1,l=e.x2,c=e.y1,u=e.y2,h=e.anchorPointX,d=e.anchorPointY,p=new t.Point(i,n);return r&&p._rotate(o?s:-s),{x1:a+p.x,y1:c+p.y,x2:l+p.x,y2:u+p.y,anchorPointX:h,anchorPointY:d}}ye.prototype.get=function(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){var e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}}return this.collisionGroups[t]};var be=function(t,e,i,n){this.transform=t.clone(),this.collisionIndex=new he(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new ye(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}};function xe(t,e,i,n,r){t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0),t.emplaceBack(e?1:0,i?1:0,n||0,r||0)}be.prototype.getBucketParts=function(e,i,n,r){var o=n.getBucket(i),s=n.latestFeatureIndex;if(o&&s&&i.id===o.layerIds[0]){var a=n.collisionBoxArray,l=o.layers[0].layout,c=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),u=n.tileSize/t.EXTENT,h=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),d="map"===l.get("text-pitch-alignment"),p="map"===l.get("text-rotation-alignment"),A=de(n,1,this.transform.zoom),f=Xt(h,d,p,this.transform,A),g=null;if(d){var m=Yt(h,d,p,this.transform,A);g=t.multiply([],this.transform.labelPlaneMatrix,m)}this.retainedQueryData[o.bucketInstanceId]=new me(o.bucketInstanceId,s,o.sourceLayerIndex,o.index,n.tileID);var y={bucket:o,layout:l,posMatrix:h,textLabelPlaneMatrix:f,labelToScreenMatrix:g,scale:c,textPixelRatio:u,holdingForFade:n.holdingForFade(),collisionBoxArray:a,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(r)for(var v=0,_=o.sortKeyRanges;v<_.length;v+=1){var b=_[v];e.push({sortKey:b.sortKey,symbolInstanceStart:b.symbolInstanceStart,symbolInstanceEnd:b.symbolInstanceEnd,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:y})}},be.prototype.attemptAnchorPlacement=function(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A){var f,g=[h.textOffset0,h.textOffset1],m=ve(t,i,n,g,r),y=this.collisionIndex.placeCollisionBox(_e(e,m.x,m.y,o,s,this.transform.angle),u,a,l,c.predicate);if(!A||0!==this.collisionIndex.placeCollisionBox(_e(A,m.x,m.y,o,s,this.transform.angle),u,a,l,c.predicate).box.length)return y.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(f=this.prevPlacement.variableOffsets[h.crossTileID].anchor),this.variableOffsets[h.crossTileID]={textOffset:g,width:i,height:n,anchor:t,textBoxScale:r,prevAnchor:f},this.markUsedJustification(d,t,h,p),d.allowVerticalPlacement&&(this.markUsedOrientation(d,p,h),this.placedOrientations[h.crossTileID]=p),{shift:m,placedGlyphBoxes:y}):void 0},be.prototype.placeLayerBucketPart=function(e,i,n){var r=this,o=e.parameters,s=o.bucket,a=o.layout,l=o.posMatrix,c=o.textLabelPlaneMatrix,u=o.labelToScreenMatrix,h=o.textPixelRatio,d=o.holdingForFade,p=o.collisionBoxArray,A=o.partiallyEvaluatedTextSize,f=o.collisionGroup,g=a.get("text-optional"),m=a.get("icon-optional"),y=a.get("text-allow-overlap"),v=a.get("icon-allow-overlap"),_="map"===a.get("text-rotation-alignment"),b="map"===a.get("text-pitch-alignment"),x="none"!==a.get("icon-text-fit"),w="viewport-y"===a.get("symbol-z-order"),C=y&&(v||!s.hasIconData()||m),B=v&&(y||!s.hasTextData()||g);!s.collisionArrays&&p&&s.deserializeCollisionBoxes(p);var E=function(e,o){if(!i[e.crossTileID])if(d)r.placements[e.crossTileID]=new fe(!1,!1,!1);else{var p,w=!1,E=!1,S=!0,T=null,M={box:null,offscreen:null},I={box:null,offscreen:null},P=null,D=null,L=0,O=0,F=0;o.textFeatureIndex?L=o.textFeatureIndex:e.useRuntimeCollisionCircles&&(L=e.featureIndex),o.verticalTextFeatureIndex&&(O=o.verticalTextFeatureIndex);var R=o.textBox;if(R){var k=function(i){var n=t.WritingMode.horizontal;if(s.allowVerticalPlacement&&!i&&r.prevPlacement){var o=r.prevPlacement.placedOrientations[e.crossTileID];o&&(r.placedOrientations[e.crossTileID]=o,r.markUsedOrientation(s,n=o,e))}return n},z=function(i,n){if(s.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&o.verticalTextBox)for(var r=0,a=s.writingModes;r<a.length&&(a[r]===t.WritingMode.vertical?(M=n(),I=M):M=i(),!(M&&M.box&&M.box.length));r+=1);else M=i()};if(a.get("text-variable-anchor")){var U=a.get("text-variable-anchor");if(r.prevPlacement&&r.prevPlacement.variableOffsets[e.crossTileID]){var N=r.prevPlacement.variableOffsets[e.crossTileID];U.indexOf(N.anchor)>0&&(U=U.filter((function(t){return t!==N.anchor}))).unshift(N.anchor)}var G=function(t,i,n){for(var o=t.x2-t.x1,a=t.y2-t.y1,c=e.textBoxScale,u=x&&!v?i:null,d={box:[],offscreen:!1},p=y?2*U.length:U.length,A=0;A<p;++A){var g=r.attemptAnchorPlacement(U[A%U.length],t,o,a,c,_,b,h,l,f,A>=U.length,e,s,n,u);if(g&&(d=g.placedGlyphBoxes)&&d.box&&d.box.length){w=!0,T=g.shift;break}}return d};z((function(){return G(R,o.iconBox,t.WritingMode.horizontal)}),(function(){var i=o.verticalTextBox;return s.allowVerticalPlacement&&!(M&&M.box&&M.box.length)&&e.numVerticalGlyphVertices>0&&i?G(i,o.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),M&&(w=M.box,S=M.offscreen);var Z=k(M&&M.box);if(!w&&r.prevPlacement){var j=r.prevPlacement.variableOffsets[e.crossTileID];j&&(r.variableOffsets[e.crossTileID]=j,r.markUsedJustification(s,j.anchor,e,Z))}}else{var V=function(t,i){var n=r.collisionIndex.placeCollisionBox(t,y,h,l,f.predicate);return n&&n.box&&n.box.length&&(r.markUsedOrientation(s,i,e),r.placedOrientations[e.crossTileID]=i),n};z((function(){return V(R,t.WritingMode.horizontal)}),(function(){var i=o.verticalTextBox;return s.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&i?V(i,t.WritingMode.vertical):{box:null,offscreen:null}})),k(M&&M.box&&M.box.length)}}if(w=(p=M)&&p.box&&p.box.length>0,S=p&&p.offscreen,e.useRuntimeCollisionCircles){var H=s.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),J=t.evaluateSizeForFeature(s.textSizeData,A,H),W=a.get("text-padding");P=r.collisionIndex.placeCollisionCircles(y,H,s.lineVertexArray,s.glyphOffsetArray,J,l,c,u,n,b,f.predicate,e.collisionCircleDiameter,W),w=y||P.circles.length>0&&!P.collisionDetected,S=S&&P.offscreen}if(o.iconFeatureIndex&&(F=o.iconFeatureIndex),o.iconBox){var Q=function(t){var e=x&&T?_e(t,T.x,T.y,_,b,r.transform.angle):t;return r.collisionIndex.placeCollisionBox(e,v,h,l,f.predicate)};E=I&&I.box&&I.box.length&&o.verticalIconBox?(D=Q(o.verticalIconBox)).box.length>0:(D=Q(o.iconBox)).box.length>0,S=S&&D.offscreen}var q=g||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,K=m||0===e.numIconVertices;if(q||K?K?q||(E=E&&w):w=E&&w:E=w=E&&w,w&&p&&p.box&&r.collisionIndex.insertCollisionBox(p.box,a.get("text-ignore-placement"),s.bucketInstanceId,I&&I.box&&O?O:L,f.ID),E&&D&&r.collisionIndex.insertCollisionBox(D.box,a.get("icon-ignore-placement"),s.bucketInstanceId,F,f.ID),P&&(w&&r.collisionIndex.insertCollisionCircles(P.circles,a.get("text-ignore-placement"),s.bucketInstanceId,L,f.ID),n)){var X=s.bucketInstanceId,Y=r.collisionCircleArrays[X];void 0===Y&&(Y=r.collisionCircleArrays[X]=new ge);for(var $=0;$<P.circles.length;$+=4)Y.circles.push(P.circles[$+0]),Y.circles.push(P.circles[$+1]),Y.circles.push(P.circles[$+2]),Y.circles.push(P.collisionDetected?1:0)}r.placements[e.crossTileID]=new fe(w||C,E||B,S||s.justReloaded),i[e.crossTileID]=!0}};if(w)for(var S=s.getSortedSymbolIndexes(this.transform.angle),T=S.length-1;T>=0;--T){var M=S[T];E(s.symbolInstances.get(M),s.collisionArrays[M])}else for(var I=e.symbolInstanceStart;I<e.symbolInstanceEnd;I++)E(s.symbolInstances.get(I),s.collisionArrays[I]);if(n&&s.bucketInstanceId in this.collisionCircleArrays){var P=this.collisionCircleArrays[s.bucketInstanceId];t.invert(P.invProjMatrix,l),P.viewportMatrix=this.collisionIndex.getViewportMatrix()}s.justReloaded=!1},be.prototype.markUsedJustification=function(e,i,n,r){var o;o=r===t.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(i)];for(var s=0,a=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];s<a.length;s+=1){var l=a[s];l>=0&&(e.text.placedSymbolArray.get(l).crossTileID=o>=0&&l!==o?0:n.crossTileID)}},be.prototype.markUsedOrientation=function(e,i,n){for(var r=i===t.WritingMode.horizontal||i===t.WritingMode.horizontalOnly?i:0,o=i===t.WritingMode.vertical?i:0,s=0,a=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];s<a.length;s+=1)e.text.placedSymbolArray.get(a[s]).placedOrientation=r;n.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=o)},be.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var n=e?e.symbolFadeChange(t):1,r=e?e.opacities:{},o=e?e.variableOffsets:{},s=e?e.placedOrientations:{};for(var a in this.placements){var l=this.placements[a],c=r[a];c?(this.opacities[a]=new Ae(c,n,l.text,l.icon),i=i||l.text!==c.text.placed||l.icon!==c.icon.placed):(this.opacities[a]=new Ae(null,n,l.text,l.icon,l.skipFade),i=i||l.text||l.icon)}for(var u in r){var h=r[u];if(!this.opacities[u]){var d=new Ae(h,n,!1,!1);d.isHidden()||(this.opacities[u]=d,i=i||h.text.placed||h.icon.placed)}}for(var p in o)this.variableOffsets[p]||!this.opacities[p]||this.opacities[p].isHidden()||(this.variableOffsets[p]=o[p]);for(var A in s)this.placedOrientations[A]||!this.opacities[A]||this.opacities[A].isHidden()||(this.placedOrientations[A]=s[A]);i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},be.prototype.updateLayerOpacities=function(t,e){for(var i={},n=0,r=e;n<r.length;n+=1){var o=r[n],s=o.getBucket(t);s&&o.latestFeatureIndex&&t.id===s.layerIds[0]&&this.updateBucketOpacities(s,i,o.collisionBoxArray)}},be.prototype.updateBucketOpacities=function(e,i,n){var r=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var o=e.layers[0].layout,s=new Ae(null,0,!1,!1,!0),a=o.get("text-allow-overlap"),l=o.get("icon-allow-overlap"),c=o.get("text-variable-anchor"),u="map"===o.get("text-rotation-alignment"),h="map"===o.get("text-pitch-alignment"),d="none"!==o.get("icon-text-fit"),p=new Ae(null,0,a&&(l||!e.hasIconData()||o.get("icon-optional")),l&&(a||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);for(var A=function(t,e,i){for(var n=0;n<e/4;n++)t.opacityVertexArray.emplaceBack(i)},f=function(n){var o=e.symbolInstances.get(n),a=o.numHorizontalGlyphVertices,l=o.numVerticalGlyphVertices,f=o.crossTileID,g=r.opacities[f];i[f]?g=s:g||(r.opacities[f]=g=p),i[f]=!0;var m=o.numIconVertices>0,y=r.placedOrientations[o.crossTileID],v=y===t.WritingMode.vertical,_=y===t.WritingMode.horizontal||y===t.WritingMode.horizontalOnly;if(a>0||l>0){var b=Ie(g.text);A(e.text,a,v?Pe:b),A(e.text,l,_?Pe:b);var x=g.text.isHidden();[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){t>=0&&(e.text.placedSymbolArray.get(t).hidden=x||v?1:0)})),o.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=x||_?1:0);var w=r.variableOffsets[o.crossTileID];w&&r.markUsedJustification(e,w.anchor,o,y);var C=r.placedOrientations[o.crossTileID];C&&(r.markUsedJustification(e,"left",o,C),r.markUsedOrientation(e,C,o))}if(m){var B=Ie(g.icon),E=!(d&&o.verticalPlacedIconSymbolIndex&&v);o.placedIconSymbolIndex>=0&&(A(e.icon,o.numIconVertices,E?B:Pe),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=g.icon.isHidden()),o.verticalPlacedIconSymbolIndex>=0&&(A(e.icon,o.numVerticalIconVertices,E?Pe:B),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=g.icon.isHidden())}if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){var S=e.collisionArrays[n];if(S){var T=new t.Point(0,0);if(S.textBox||S.verticalTextBox){var M=!0;if(c){var I=r.variableOffsets[f];I?(T=ve(I.anchor,I.width,I.height,I.textOffset,I.textBoxScale),u&&T._rotate(h?r.transform.angle:-r.transform.angle)):M=!1}S.textBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!M||v,T.x,T.y),S.verticalTextBox&&xe(e.textCollisionBox.collisionVertexArray,g.text.placed,!M||_,T.x,T.y)}var P=Boolean(!_&&S.verticalIconBox);S.iconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,P,d?T.x:0,d?T.y:0),S.verticalIconBox&&xe(e.iconCollisionBox.collisionVertexArray,g.icon.placed,!P,d?T.x:0,d?T.y:0)}}},g=0;g<e.symbolInstances.length;g++)f(g);if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays){var m=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=m.invProjMatrix,e.placementViewportMatrix=m.viewportMatrix,e.collisionCircleArray=m.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}},be.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},be.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},be.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},be.prototype.stillRecent=function(t,e){var i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t},be.prototype.setStale=function(){this.stale=!0};var we=Math.pow(2,25),Ce=Math.pow(2,24),Be=Math.pow(2,17),Ee=Math.pow(2,16),Se=Math.pow(2,9),Te=Math.pow(2,8),Me=Math.pow(2,1);function Ie(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*we+e*Ce+i*Be+e*Ee+i*Se+e*Te+i*Me+e}var Pe=0,De=function(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&void 0!==t.layout.get("symbol-sort-key").constantOr(1),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};De.prototype.continuePlacement=function(t,e,i,n,r){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,n,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,r())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,r())return!0;return!1};var Le=function(t,e,i,n,r,o,s){this.placement=new be(t,r,o,s),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1};Le.prototype.isDone=function(){return this._done},Le.prototype.continuePlacement=function(e,i,n){for(var r=this,o=t.browser.now(),s=function(){var e=t.browser.now()-o;return!r._forceFullPlacement&&e>2};this._currentPlacementIndex>=0;){var a=i[e[this._currentPlacementIndex]],l=this.placement.collisionIndex.transform.zoom;if("symbol"===a.type&&(!a.minzoom||a.minzoom<=l)&&(!a.maxzoom||a.maxzoom>l)){if(this._inProgressLayer||(this._inProgressLayer=new De(a)),this._inProgressLayer.continuePlacement(n[a.source],this.placement,this._showCollisionBoxes,a,s))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},Le.prototype.commit=function(t){return this.placement.commit(t),this.placement};var Oe=512/t.EXTENT/2,Fe=function(t,e,i){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=i;for(var n=0;n<e.length;n++){var r=e.get(n),o=r.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:r.crossTileID,coord:this.getScaledCoordinates(r,t)})}};Fe.prototype.getScaledCoordinates=function(e,i){var n=Oe/Math.pow(2,i.canonical.z-this.tileID.canonical.z);return{x:Math.floor((i.canonical.x*t.EXTENT+e.anchorX)*n),y:Math.floor((i.canonical.y*t.EXTENT+e.anchorY)*n)}},Fe.prototype.findMatches=function(t,e,i){for(var n=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),r=0;r<t.length;r++){var o=t.get(r);if(!o.crossTileID){var s=this.indexedSymbolInstances[o.key];if(s)for(var a=this.getScaledCoordinates(o,e),l=0,c=s;l<c.length;l+=1){var u=c[l];if(Math.abs(u.coord.x-a.x)<=n&&Math.abs(u.coord.y-a.y)<=n&&!i[u.crossTileID]){i[u.crossTileID]=!0,o.crossTileID=u.crossTileID;break}}}}};var Re=function(){this.maxCrossTileID=0};Re.prototype.generate=function(){return++this.maxCrossTileID};var ke=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};ke.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var i in this.indexes){var n=this.indexes[i],r={};for(var o in n){var s=n[o];s.tileID=s.tileID.unwrapTo(s.tileID.wrap+e),r[s.tileID.key]=s}this.indexes[i]=r}this.lng=t},ke.prototype.addBucket=function(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var n=0;n<e.symbolInstances.length;n++)e.symbolInstances.get(n).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var r=this.usedCrossTileIDs[t.overscaledZ];for(var o in this.indexes){var s=this.indexes[o];if(Number(o)>t.overscaledZ)for(var a in s){var l=s[a];l.tileID.isChildOf(t)&&l.findMatches(e.symbolInstances,t,r)}else{var c=s[t.scaledTo(Number(o)).key];c&&c.findMatches(e.symbolInstances,t,r)}}for(var u=0;u<e.symbolInstances.length;u++){var h=e.symbolInstances.get(u);h.crossTileID||(h.crossTileID=i.generate(),r[h.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new Fe(t,e.symbolInstances,e.bucketInstanceId),!0},ke.prototype.removeBucketCrossTileIDs=function(t,e){for(var i in e.indexedSymbolInstances)for(var n=0,r=e.indexedSymbolInstances[i];n<r.length;n+=1)delete this.usedCrossTileIDs[t][r[n].crossTileID]},ke.prototype.removeStaleBuckets=function(t){var e=!1;for(var i in this.indexes){var n=this.indexes[i];for(var r in n)t[n[r].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,n[r]),delete n[r],e=!0)}return e};var ze=function(){this.layerIndexes={},this.crossTileIDs=new Re,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};ze.prototype.addLayer=function(t,e,i){var n=this.layerIndexes[t.id];void 0===n&&(n=this.layerIndexes[t.id]=new ke);var r=!1,o={};n.handleWrapJump(i);for(var s=0,a=e;s<a.length;s+=1){var l=a[s],c=l.getBucket(t);c&&t.id===c.layerIds[0]&&(c.bucketInstanceId||(c.bucketInstanceId=++this.maxBucketInstanceId),n.addBucket(l.tileID,c,this.crossTileIDs)&&(r=!0),o[c.bucketInstanceId]=!0)}return n.removeStaleBuckets(o)&&(r=!0),r},ze.prototype.pruneUnusedLayers=function(t){var e={};for(var i in t.forEach((function(t){e[t]=!0})),this.layerIndexes)e[i]||delete this.layerIndexes[i]};var Ue=function(e,i){return t.emitValidationErrors(e,i&&i.filter((function(t){return"source.canvas"!==t.identifier})))},Ne=t.pick(Gt,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Ge=t.pick(Gt,["setCenter","setZoom","setBearing","setP
2itch"]),Ze=function(){var e={},i=t.styleSpec.$version;for(var n in t.styleSpec.$root){var r,o=t.styleSpec.$root[n];o.required&&null!=(r="version"===n?i:"array"===o.type?[]:{})&&(e[n]=r)}return e}(),je=function(e){function i(n,r){var o=this;void 0===r&&(r={}),e.call(this),this.map=n,this.dispatcher=new C(zt(),this),this.imageManager=new d,this.imageManager.setEventedParent(this),this.glyphManager=new v(n._requestManager,r.localIdeographFontFamily),this.lineAtlas=new w(256,512),this.crossTileSymbolIndex=new ze,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var s=this;this._rtlTextPluginCallback=i.registerForPluginStateChange((function(e){s.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,i){if(t.triggerPluginCompletionEvent(e),i&&i.every((function(t){return t})))for(var n in s.sourceCaches)s.sourceCaches[n].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType){var e=o.sourceCaches[t.sourceId];if(e){var i=e.getSource();if(i&&i.vectorLayerIds)for(var n in o._layers){var r=o._layers[n];r.source===i.id&&o._validateLayer(r)}}}}))}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.loadURL=function(e,i){var n=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var r="boolean"==typeof i.validate?i.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,i.accessToken);var o=this.map._requestManager.transformRequest(e,t.ResourceType.Style);this._request=t.getJSON(o,(function(e,i){n._request=null,e?n.fire(new t.ErrorEvent(e)):i&&n._load(i,r)}))},i.prototype.loadJSON=function(e,i){var n=this;void 0===i&&(i={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){n._request=null,n._load(e,!1!==i.validate)}))},i.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(Ze,!1)},i.prototype._load=function(e,i){if(!i||!Ue(this,t.validateStyle(e))){for(var n in this._loaded=!0,this.stylesheet=e,e.sources)this.addSource(n,e.sources[n],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs);var r=Nt(this.stylesheet.layers);this._order=r.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var o=0,s=r;o<s.length;o+=1){var a=s[o];(a=t.createStyleLayer(a)).setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=a,this._serializedLayers[a.id]=a.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new x(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},i.prototype._loadSprite=function(e){var i=this;this._spriteRequest=function(e,i,n){var r,o,s,a=t.browser.devicePixelRatio>1?"@2x":"",l=t.getJSON(i.transformRequest(i.normalizeSpriteURL(e,a,".json"),t.ResourceType.SpriteJSON),(function(t,e){l=null,s||(s=t,r=e,u())})),c=t.getImage(i.transformRequest(i.normalizeSpriteURL(e,a,".png"),t.ResourceType.SpriteImage),(function(t,e){c=null,s||(s=t,o=e,u())}));function u(){if(s)n(s);else if(r&&o){var e=t.browser.getImageData(o),i={};for(var a in r){var l=r[a],c=l.width,u=l.height,h=l.x,d=l.y,p=l.sdf,A=l.pixelRatio,f=l.stretchX,g=l.stretchY,m=l.content,y=new t.RGBAImage({width:c,height:u});t.RGBAImage.copy(e,y,{x:h,y:d},{x:0,y:0},{width:c,height:u}),i[a]={data:y,pixelRatio:A,sdf:p,stretchX:f,stretchY:g,content:m}}n(null,i)}}return{cancel:function(){l&&(l.cancel(),l=null),c&&(c.cancel(),c=null)}}}(e,this.map._requestManager,(function(e,n){if(i._spriteRequest=null,e)i.fire(new t.ErrorEvent(e));else if(n)for(var r in n)i.imageManager.addImage(r,n[r]);i.imageManager.setLoaded(!0),i._availableImages=i.imageManager.listImages(),i.dispatcher.broadcast("setImages",i._availableImages),i.fire(new t.Event("data",{dataType:"style"}))}))},i.prototype._validateLayer=function(e){var i=this.sourceCaches[e.source];if(i){var n=e.sourceLayer;if(n){var r=i.getSource();("geojson"===r.type||r.vectorLayerIds&&-1===r.vectorLayerIds.indexOf(n))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+n+'" does not exist on source "'+r.id+'" as specified by style layer "'+e.id+'"')))}}},i.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},i.prototype._serializeLayers=function(t){for(var e=[],i=0,n=t;i<n.length;i+=1){var r=this._layers[n[i]];"custom"!==r.type&&e.push(r.serialize())}return e},i.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},i.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},i.prototype.update=function(e){if(this._loaded){var i=this._changed;if(this._changed){var n=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);for(var o in(n.length||r.length)&&this._updateWorkerLayers(n,r),this._updatedSources){var s=this._updatedSources[o];"reload"===s?this._reloadSource(o):"clear"===s&&this._clearSource(o)}for(var a in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[a].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var l={};for(var c in this.sourceCaches){var u=this.sourceCaches[c];l[c]=u.used,u.used=!1}for(var h=0,d=this._order;h<d.length;h+=1){var p=this._layers[d[h]];p.recalculate(e,this._availableImages),!p.isHidden(e.zoom)&&p.source&&(this.sourceCaches[p.source].used=!0)}for(var A in l){var f=this.sourceCaches[A];l[A]!==f.used&&f.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:A}))}this.light.recalculate(e),this.z=e.zoom,i&&this.fire(new t.Event("data",{dataType:"style"}))}},i.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},i.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},i.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},i.prototype.setState=function(e){var i=this;if(this._checkLoaded(),Ue(this,t.validateStyle(e)))return!1;
vendor: 6,108 bytes, line 2
2(e=t.clone$1(e)).layers=Nt(e.layers);var n=function(e,i){if(!e)return[{command:Gt.setStyle,args:[i]}];var n=[];try{if(!t.deepEqual(e.version,i.version))return[{command:Gt.setStyle,args:[i]}];t.deepEqual(e.center,i.center)||n.push({command:Gt.setCenter,args:[i.center]}),t.deepEqual(e.zoom,i.zoom)||n.push({command:Gt.setZoom,args:[i.zoom]}),t.deepEqual(e.bearing,i.bearing)||n.push({command:Gt.setBearing,args:[i.bearing]}),t.deepEqual(e.pitch,i.pitch)||n.push({command:Gt.setPitch,args:[i.pitch]}),t.deepEqual(e.sprite,i.sprite)||n.push({command:Gt.setSprite,args:[i.sprite]}),t.deepEqual(e.glyphs,i.glyphs)||n.push({command:Gt.setGlyphs,args:[i.glyphs]}),t.deepEqual(e.transition,i.transition)||n.push({command:Gt.setTransition,args:[i.transition]}),t.deepEqual(e.light,i.light)||n.push({command:Gt.setLight,args:[i.light]});var r={},o=[];!function(e,i,n,r){var o;for(o in i=i||{},e=e||{})e.hasOwnProperty(o)&&(i.hasOwnProperty(o)||jt(o,n,r));for(o in i)i.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],i[o])||("geojson"===e[o].type&&"geojson"===i[o].type&&Ht(e,i,o)?n.push({command:Gt.setGeoJSONSourceData,args:[o,i[o].data]}):Vt(o,i,n,r)):Zt(o,i,n))}(e.sources,i.sources,o,r);var s=[];e.layers&&e.layers.forEach((function(t){r[t.source]?n.push({command:Gt.removeLayer,args:[t.id]}):s.push(t)})),n=n.concat(o),function(e,i,n){i=i||[];var r,o,s,a,l,c,u,h=(e=e||[]).map(Wt),d=i.map(Wt),p=e.reduce(Qt,{}),A=i.reduce(Qt,{}),f=h.slice(),g=Object.create(null);for(r=0,o=0;r<h.length;r++)A.hasOwnProperty(s=h[r])?o++:(n.push({command:Gt.removeLayer,args:[s]}),f.splice(f.indexOf(s,o),1));for(r=0,o=0;r<d.length;r++)f[f.length-1-r]!==(s=d[d.length-1-r])&&(p.hasOwnProperty(s)?(n.push({command:Gt.removeLayer,args:[s]}),f.splice(f.lastIndexOf(s,f.length-o),1)):o++,n.push({command:Gt.addLayer,args:[A[s],c=f[f.length-r]]}),f.splice(f.length-r,0,s),g[s]=!0);for(r=0;r<d.length;r++)if(a=p[s=d[r]],l=A[s],!g[s]&&!t.deepEqual(a,l))if(t.deepEqual(a.source,l.source)&&t.deepEqual(a["source-layer"],l["source-layer"])&&t.deepEqual(a.type,l.type)){for(u in Jt(a.layout,l.layout,n,s,null,Gt.setLayoutProperty),Jt(a.paint,l.paint,n,s,null,Gt.setPaintProperty),t.deepEqual(a.filter,l.filter)||n.push({command:Gt.setFilter,args:[s,l.filter]}),t.deepEqual(a.minzoom,l.minzoom)&&t.deepEqual(a.maxzoom,l.maxzoom)||n.push({command:Gt.setLayerZoomRange,args:[s,l.minzoom,l.maxzoom]}),a)a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Jt(a[u],l[u],n,s,u.slice(6),Gt.setPaintProperty):t.deepEqual(a[u],l[u])||n.push({command:Gt.setLayerProperty,args:[s,u,l[u]]}));for(u in l)l.hasOwnProperty(u)&&!a.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?Jt(a[u],l[u],n,s,u.slice(6),Gt.setPaintProperty):t.deepEqual(a[u],l[u])||n.push({command:Gt.setLayerProperty,args:[s,u,l[u]]}))}else n.push({command:Gt.removeLayer,args:[s]}),c=f[f.lastIndexOf(s)+1],n.push({command:Gt.addLayer,args:[l,c]})}(s,i.layers,n)}catch(t){console.warn("Unable to compute style diff:",t),n=[{command:Gt.setStyle,args:[i]}]}return n}(this.serialize(),e).filter((function(t){return!(t.command in Ge)}));if(0===n.length)return!1;var r=n.filter((function(t){return!(t.command in Ne)}));if(r.length>0)throw new Error("Unimplemented: "+r.map((function(t){return t.command})).join(", ")+".");return n.forEach((function(t){"setTransition"!==t.command&&i[t.command].apply(i,t.args)})),this.stylesheet=e,!0},i.prototype.addImage=function(e,i){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,i),this._afterImageUpdated(e)},i.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},i.prototype.getImage=function(t){return this.imageManager.getImage(t)},i.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},i.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},i.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},i.prototype.addSource=function(e,i,n){var r=this;if(void 0===n&&(n={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!i.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(i).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(t.validateStyle.source,"sources."+e,i,null,n))){this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);var o=this.sourceCaches[e]=new It(e,i,this.dispatcher);o.style=this,o.setEventedParent(this,(function(){return{isSourceLoaded:r.loaded(),source:o.serialize(),sourceId:e}})),o.onAdd(this.map),this._changed=!0}},i.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var i in this._layers)if(this._layers[i].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+i+'" is using it.')));var n=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],n.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),n.setEventedParent(null),n.clearTiles(),n.onRemove&&n.onRemove(this.map),this._changed=!0},i.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},i.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},i.prototype.addLayer=function(e,i,n){void 0===n&&(n={}),this._checkLoaded();var r=e.id;if(this.getLayer(r))this.fire(new t.ErrorEvent(new Error('Layer with i
2d "'+r+'" already exists on this map')));else{var o;if("custom"===e.type){if(Ue(this,t.validateCustomStyleLayer(e)))return;o=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(r,e.source),e=t.clone$1(e),e=t.extend(e,{source:r})),this._validate(t.validateStyle.layer,"layers."+r,e,{arrayIndex:-1},n))return;o=t.createStyleLayer(e),this._validateLayer(o),o.setEventedParent(this,{layer:{id:r}}),this._serializedLayers[o.id]=o.serialize()}var s=i?this._order.indexOf(i):this._order.length;if(i&&-1===s)this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.')));else{if(this._order.splice(s,0,r),this._layerOrderChanged=!0,this._layers[r]=o,this._removedLayers[r]&&o.source&&"custom"!==o.type){var a=this._removedLayers[r];delete this._removedLayers[r],a.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}},i.prototype.moveLayer=function(e,i){if(this._checkLoaded(),this._changed=!0,this._layers[e]){if(e!==i){var n=this._order.indexOf(e);this._order.splice(n,1);var r=i?this._order.indexOf(i):this._order.length;
vendor: 15,882 bytes, line 2
2i&&-1===r?this.fire(new t.ErrorEvent(new Error('Layer with id "'+i+'" does not exist on this map.'))):(this._order.splice(r,0,e),this._layerOrderChanged=!0)}}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},i.prototype.removeLayer=function(e){this._checkLoaded();var i=this._layers[e];if(i){i.setEventedParent(null);var n=this._order.indexOf(e);this._order.splice(n,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map)}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},i.prototype.getLayer=function(t){return this._layers[t]},i.prototype.hasLayer=function(t){return t in this._layers},i.prototype.setLayerZoomRange=function(e,i,n){this._checkLoaded();var r=this.getLayer(e);r?r.minzoom===i&&r.maxzoom===n||(null!=i&&(r.minzoom=i),null!=n&&(r.maxzoom=n),this._updateLayer(r)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},i.prototype.setFilter=function(e,i,n){void 0===n&&(n={}),this._checkLoaded();var r=this.getLayer(e);if(r){if(!t.deepEqual(r.filter,i))return null==i?(r.filter=void 0,void this._updateLayer(r)):void(this._validate(t.validateStyle.filter,"layers."+r.id+".filter",i,null,n)||(r.filter=t.clone$1(i),this._updateLayer(r)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},i.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},i.prototype.setLayoutProperty=function(e,i,n,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(i),n)||(o.setLayoutProperty(i,n,r),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},i.prototype.getLayoutProperty=function(e,i){var n=this.getLayer(e);if(n)return n.getLayoutProperty(i);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},i.prototype.setPaintProperty=function(e,i,n,r){void 0===r&&(r={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(i),n)||(o.setPaintProperty(i,n,r)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},i.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},i.prototype.setFeatureState=function(e,i){this._checkLoaded();var n=e.source,r=e.sourceLayer,o=this.sourceCaches[n];if(void 0!==o){var s=o.getSource().type;"geojson"===s&&r?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||r?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(r,e.id,i)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},i.prototype.removeFeatureState=function(e,i){this._checkLoaded();var n=e.source,r=this.sourceCaches[n];if(void 0!==r){var o=r.getSource().type,s="vector"===o?e.sourceLayer:void 0;"vector"!==o||s?i&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):r.removeFeatureState(s,e.id,i):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},i.prototype.getFeatureState=function(e){this._checkLoaded();var i=e.source,n=e.sourceLayer,r=this.sourceCaches[i];if(void 0!==r){if("vector"!==r.getSource().type||n)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),r.getFeatureState(n,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+i+"' does not exist in the map's style.")))},i.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},i.prototype.serialize=function(){return t.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},i.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},i.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,i=function(t){return"fill-extrusion"===e._layers[t].type},n={},r=[],o=this._order.length-1;o>=0;o--){var s=this._order[o];if(i(s)){n[s]=o;for(var a=0,l=t;a<l.length;a+=1){var c=l[a][s];if(c)for(var u=0,h=c;u<h.length;u+=1)r.push(h[u])}}}r.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var d=[],p=this._order.length-1;p>=0;p--){var A=this._order[p];if(i(A))for(var f=r.length-1;f>=0;f--){var g=r[f].feature;if(n[g.layer.id]<p)break;d.push(g),r.pop()}else for(var m=0,y=t;m<y.length;m+=1){var v=y[m][A];if(v)for(var _=0,b=v;_<b.length;_+=1)d.push(b[_].feature)}}return d},i.prototype.queryRenderedFeatures=function(e,i,n){i&&i.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",i.filter,null,i);var r={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,s=i.layers;o<s.length;o+=1){var a=s[o],l=this._layers[a];if(!l)return this.fire(new t.ErrorEvent(new Error("The layer '"+a+"' does not exist in the map's style and cannot be queried for features."))),[];r[l.source]=!0}}var c=[];for(var u in i.availableImages=this._availableImages,this.sourceCaches)i.layers&&!r[u]||c.push(k(this.sourceCaches[u],this._layers,this._serializedLayers,e,i,n));return this.placement&&c.push(function(t,e,i,n,r,o,s){for(var a={},l=o.queryRenderedSymbols(n),c=[],u=0,h=Object.keys(l).map(Number);u<h.length;u+=1)c.push(s[h[u]]);c.sort(z);for(var d=function(){var i=A[p],n=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,r.filter,r.layers,r.availableImages,t);for(var o in n){var s=a[o]=a[o]||[],c=n[o];c.sort((function(t,e){var n=i.featureSortOrder;if(n){var r=n.indexOf(t.featureIndex);return n.indexOf(e.featureIndex)-r}return e.featureIndex-t.featureIndex}));for(var u=0,h=c;u<h.length;u+=1)s.push(h[u])}},p=0,A=c;p<A.length;p+=1)d();var f=function(e){a[e].forEach((function(n){var r=n.feature,o=i[t[e].source].getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=o}))};for(var g in a)f(g);return a}(this._layers,this._serializedLayers,this.sourceCaches,e,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},i.prototype.querySourceFeatures=function(e,i){i&&i.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",i.filter,null,i);var n=this.sourceCaches[e];return n?function(t,e){for(var i=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),n=[],r={},o=0;o<i.length;o++){var s=i[o],a=s.tileID.canonical.key;r[a]||(r[a]=!0,s.querySourceFeatures(n,e))}return n}(n,i):[]},i.prototype.addSourceType=function(t,e,n){return i.getSourceType(t)?n(new Error('A source type called "'+t+'" already exists.')):(i.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},n):n(null,null))},i.prototype.getLight=function(){return this.light.getLight()},i.prototype.setLight=function(e,i){void 0===i&&(i={}),this._checkLoaded();var n=this.light.getLight(),r=!1;for(var o in e)if(!t.deepEqual(e[o],n[o])){r=!0;break}if(r){var s={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,i),this.light.updateTransitions(s)}},i.prototype._validate=function(e,i,n,r,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&Ue(this,e.call(t.validateStyle,t.extend({key:i,style:this.serialize(),value:n,styleSpec:t.styleSpec},r)))},i.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var i in this.sourceCaches)this.sourceCaches[i].clearTiles(),this.sourceCaches[i].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},i.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},i.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},i.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},i.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},i.prototype._updatePlacement=function(e,i,n,r,o){void 0===o&&(o=!1);for(var s=!1,a=!1,l={},c=0,u=this._order;c<u.length;c+=1){var h=this._layers[u[c]];if("symbol"===h.type){if(!l[h.source]){var d=this.sourceCaches[h.source];l[h.source]=d.getRenderableIds(!0).map((function(t){return d.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))}var p=this.crossTileSymbolIndex.addLayer(h,l[h.source],e.center.lng);s=s||p}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===n)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new Le(e,this._order,o,i,n,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),a=!0),s&&this.pauseablePlacement.placement.setStale()),a||s)for(var A=0,f=this._order;A<f.length;A+=1){var g=this._layers[f[A]];"symbol"===g.type&&this.placement.updateLayerOpacities(g,l[g.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},i.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},i.prototype.getImages=function(t,e,i){this.imageManager.getImages(e.icons,i),this._updateTilesForChangedImages();var n=this.sourceCaches[e.source];n&&n.setDependencies(e.tileID.key,e.type,e.icons)},i.prototype.getGlyphs=function(t,e,i){this.glyphManager.getGlyphs(e.stacks,i)},i.prototype.getResource=function(e,i,n){return t.makeRequest(i,n)},i}(t.Evented);je.getSourceType=function(t){return F[t]},je.setSourceType=function(t,e){F[t]=e},je.registerForPluginStateChange=t.registerForPluginStateChange;var Ve=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),He=mi("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}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;}"),Je=mi("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),We=mi("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}"),Qe=mi("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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
2/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);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,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,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);}"),qe=mi("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);}"),Ke=mi("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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;}"),Xe=mi("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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;}"),Ye=mi("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,0.0,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;}"),$e=mi("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);}"),ti=mi("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,0,1);}"),ei=mi("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),ii=mi("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),ni=mi("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;}"),ri=mi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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);}"),oi=mi("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);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;}"),si=mi("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixe
2l_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;base=max(0.0,base);height=max(0.0,height);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\n? a_pos\n: 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;}"),ai=mi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),li=mi("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),ci=mi("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute 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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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;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;v_width2=vec2(outset,inset);}"),ui=mi("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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;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;v_width2=vec2(outset,inset);}"),hi=mi("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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute 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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat 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;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;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),di=mi("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;
2uniform 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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute 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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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;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;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);}"),pi=mi("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),Ai=mi("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);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),0.0,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;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"),fi=mi("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat 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 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),gi=mi("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;
2gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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;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,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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),0,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,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,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);}");function mi(t,e){var i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,n=e.match(/attribute ([\w]+) ([\w]+)/g),r=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=o?o.concat(r):r,a={};return{fragmentSource:t=t.replace(i,(function(t,e,i,n,r){return a[r]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nvarying "+i+" "+n+" "+r+";\n#else\nuniform "+i+" "+n+" u_"+r+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+r+"\n    "+i+" "+n+" "+r+" = u_"+r+";\n#endif\n"}
vendor: 9,171 bytes, line 2
2)),vertexSource:e=e.replace(i,(function(t,e,i,n,r){var o="float"===n?"vec2":"vec4",s=r.match(/color/)?"color":o;return a[r]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+i+" "+o+" a_"+r+";\nvarying "+i+" "+n+" "+r+";\n#else\nuniform "+i+" "+n+" u_"+r+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+r+"\n    "+r+" = a_"+r+";\n#else\n    "+i+" "+n+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n    "+r+" = unpack_mix_"+s+"(a_"+r+", u_"+r+"_t);\n#else\n    "+i+" "+n+" "+r+" = u_"+r+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+r+"\nuniform lowp float u_"+r+"_t;\nattribute "+i+" "+o+" a_"+r+";\n#else\nuniform "+i+" "+n+" u_"+r+";\n#endif\n":"vec4"===s?"\n#ifndef HAS_UNIFORM_u_"+r+"\n    "+i+" "+n+" "+r+" = a_"+r+";\n#else\n    "+i+" "+n+" "+r+" = u_"+r+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+r+"\n    "+i+" "+n+" "+r+" = unpack_mix_"+s+"(a_"+r+", u_"+r+"_t);\n#else\n    "+i+" "+n+" "+r+" = u_"+r+";\n#endif\n"})),staticAttributes:n,staticUniforms:s}}var yi=Object.freeze({__proto__:null,prelude:He,background:Je,backgroundPattern:We,circle:Qe,clippingMask:qe,heatmap:Ke,heatmapTexture:Xe,collisionBox:Ye,collisionCircle:$e,debug:ti,fill:ei,fillOutline:ii,fillOutlinePattern:ni,fillPattern:ri,fillExtrusion:oi,fillExtrusionPattern:si,hillshadePrepare:ai,hillshade:li,line:ci,lineGradient:ui,linePattern:hi,lineSDF:di,raster:pi,symbolIcon:Ai,symbolSDF:fi,symbolTextAndIcon:gi}),vi=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function _i(t){for(var e=[],i=0;i<t.length;i++)if(null!==t[i]){var n=t[i].split(" ");e.push(n.pop())}return e}vi.prototype.bind=function(t,e,i,n,r,o,s,a){this.context=t;for(var l=this.boundPaintVertexBuffers.length!==n.length,c=0;!l&&c<n.length;c++)this.boundPaintVertexBuffers[c]!==n[c]&&(l=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===i&&!l&&this.boundIndexBuffer===r&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===s&&this.boundDynamicVertexBuffer2===a?(t.bindVertexArrayOES.set(this.vao),s&&s.bind(),r&&r.dynamicDraw&&r.bind(),a&&a.bind()):this.freshBind(e,i,n,r,o,s,a)},vi.prototype.freshBind=function(t,e,i,n,r,o,s){var a,l=t.numAttributes,c=this.context,u=c.gl;if(c.extVertexArrayObject)this.vao&&this.destroy(),this.vao=c.extVertexArrayObject.createVertexArrayOES(),c.bindVertexArrayOES.set(this.vao),a=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=n,this.boundVertexOffset=r,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=s;else{a=c.currentNumAttributes||0;for(var h=l;h<a;h++)u.disableVertexAttribArray(h)}e.enableAttributes(u,t);for(var d=0,p=i;d<p.length;d+=1)p[d].enableAttributes(u,t);o&&o.enableAttributes(u,t),s&&s.enableAttributes(u,t),e.bind(),e.setVertexAttribPointers(u,t,r);for(var A=0,f=i;A<f.length;A+=1){var g=f[A];g.bind(),g.setVertexAttribPointers(u,t,r)}o&&(o.bind(),o.setVertexAttribPointers(u,t,r)),n&&n.bind(),s&&(s.bind(),s.setVertexAttribPointers(u,t,r)),c.currentNumAttributes=l},vi.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var bi=function(t,e,i,n,r,o){var s=t.gl;this.program=s.createProgram();for(var a=_i(i.staticAttributes),l=n?n.getBinderAttributes():[],c=a.concat(l),u=i.staticUniforms?_i(i.staticUniforms):[],h=n?n.getBinderUniforms():[],d=[],p=0,A=u.concat(h);p<A.length;p+=1){var f=A[p];d.indexOf(f)<0&&d.push(f)}var g=n?n.defines():[];o&&g.push("#define OVERDRAW_INSPECTOR;");var m=g.concat(He.fragmentSource,i.fragmentSource).join("\n"),y=g.concat(He.vertexSource,i.vertexSource).join("\n"),v=s.createShader(s.FRAGMENT_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(v,m),s.compileShader(v),s.attachShader(this.program,v);var _=s.createShader(s.VERTEX_SHADER);if(s.isContextLost())this.failedToCreate=!0;else{s.shaderSource(_,y),s.compileShader(_),s.attachShader(this.program,_),this.attributes={};var b={};this.numAttributes=c.length;for(var x=0;x<this.numAttributes;x++)c[x]&&(s.bindAttribLocation(this.program,x,c[x]),this.attributes[c[x]]=x);s.linkProgram(this.program),s.deleteShader(_),s.deleteShader(v);for(var w=0;w<d.length;w++){var C=d[w];if(C&&!b[C]){var B=s.getUniformLocation(this.program,C);B&&(b[C]=B)}}this.fixedUniforms=r(t,b),this.binderUniforms=n?n.getUniforms(t,b):[]}}};function xi(t,e,i){var n=1/de(i,1,e.transform.tileZoom),r=Math.pow(2,i.tileID.overscaledZ),o=i.tileSize*Math.pow(2,e.transform.tileZoom)/r,s=o*(i.tileID.canonical.x+i.tileID.wrap*r),a=o*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[n,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[s>>16,a>>16],u_pixel_coord_lower:[65535&s,65535&a]}}bi.prototype.draw=function(t,e,i,n,r,o,s,a,l,c,u,h,d,p,A,f){var g,m=t.gl;if(!this.failedToCreate){for(var y in t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(n),t.setColorMode(r),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[y].set(s[y]);p&&p.setUniforms(t,this.binderUniforms,h,{zoom:d});for(var v=(g={},g[m.LINES]=2,g[m.TRIANGLES]=3,g[m.LINE_STRIP]=1,g)[e],_=0,b=u.get();_<b.length;_+=1){var x=b[_],w=x.vaos||(x.vaos={});(w[a]||(w[a]=new vi)).bind(t,this,l,p?p.getPaintVertexBuffers():[],c,x.vertexOffset,A,f),m.drawElements(e,x.primitiveLength*v,m.UNSIGNED_SHORT,x.primitiveOffset*v*2)}}};var wi=function(e,i,n,r){var o=i.style.light,s=o.properties.get("position"),a=[s.x,s.y,s.z],l=t.create$1();"viewport"===o.properties.get("anchor")&&t.fromRotation(l,-i.transform.angle),t.transformMat3(a,a,l);var c=o.properties.get("color");return{u_matrix:e,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+n,u_opacity:r}},Ci=function(e,i,n,r,o,s,a){return t.extend(wi(e,i,n,r),xi(s,i,a),{u_height_factor:-Math.pow(2,o.overscaledZ)/a.tileSize/8})},Bi=function(t){return{u_matrix:t}},Ei=function(e,i,n,r){return t.extend(Bi(e),xi(n,i,r))},Si=function(t,e){return{u_matrix:t,u_world:e}},Ti=function(e,i,n,r,o){return t.extend(Ei(e,i,n,r),{u_world:o})},Mi=function(e,i,n,r){var o,s,a=e.transform;if("map"===r.paint.get("circle-pitch-alignment")){var l=de(n,1,a.zoom);o=!0,s=[l,l]}else o=!1,s=a.pixelsToGLUnits;return{u_camera_to_center_distance:a.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(i.posMatrix,n,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:s}},Ii=function(t,e,i){var n=de(i,1,e.zoom),r=Math.pow(2,e.zoom-i.tileID.overscaledZ),o=i.tileID.overscaleFactor();return{u_matrix:t,u_camera_to_center_distance:e.cameraToCenterDistance,u_pixels_to_tile_units:n,u_extrude_scale:[e.pixelsToGLUnits[0]/(n*r),e.pixelsToGLUnits[1]/(n*r)],u_overscale_factor:o}},Pi=function(t,e,i){return{u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_viewport_size:[i.width,i.height]}},Di=function(t,e,i){return void 0===i&&(i=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}},Li=function(t){return{u_matrix:t}},Oi=function(t,e,i,n){return{u_matrix:t,u_extrude_scale:de(e,1,i),u_intensity:n}},Fi=function(e,i,n){var r=e.transform;return{u_matrix:Ni(e,i,n),u_ratio:1/de(i,1,r.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/r.pixelsToGLUnits[0],1/r.pixelsToGLUnits[1]]}},Ri=function(e,i,n,r){return t.extend(Fi(e,i,n),{u_image:0,u_image_height:r})},ki=function(e,i,n,r){var o=e.transform,s=Ui(i,o);return{u_matrix:Ni(e,i,n),u_texsize:i.imageAtlasTexture.size,u_ratio:1/de(i,1,o.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[s,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},zi=function(e,i,n,r,o){var s=e.lineAtlas,a=Ui(i,e.transform),l="round"===n.layout.get("line-cap"),c=s.getDash(r.from,l),u=s.getDash(r.to,l),h=c.width*o.fromScale,d=u.width*o.toScale;return t.extend(Fi(e,i,n),{u_patternscale_a:[a/h,-c.height/2],u_patternscale_b:[a/d,-u.height/2],u_sdfgamma:s.width/(256*Math.min(h,d)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:c.y,u_tex_y_b:u.y,u_mix:o.t})};function Ui(t,e){return 1/de(t,1,e.tileZoom)}function Ni(t,e,i){return t.translatePosMatrix(e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}var Gi=function(t,e,i,n,r){return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:n.mix,u_opacity:n.opacity*r.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:r.paint.get("raster-brightness-min"),u_brightness_high:r.paint.get("raster-brightness-max"),u_saturation_factor:(s=r.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(o=r.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:Zi(r.paint.get("raster-hue-rotate"))};var o,s};function Zi(t){t*=Math.PI/180;var e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}
vendor: 4,449 bytes, line 2
2var ji,Vi=function(t,e,i,n,r,o,s,a,l,c){var u=r.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:u.width/u.height,u_fade_change:r.options.fadeDuration?r.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:s,u_coord_matrix:a,u_is_text:+l,u_pitch_with_map:+n,u_texsize:c,u_texture:0}},Hi=function(e,i,n,r,o,s,a,l,c,u,h){var d=o.transform;return t.extend(Vi(e,i,n,r,o,s,a,l,c,u),{u_gamma_scale:r?Math.cos(d._pitch)*d.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+h})},Ji=function(e,i,n,r,o,s,a,l,c,u){return t.extend(Hi(e,i,n,r,o,s,a,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1})},Wi=function(t,e,i){return{u_matrix:t,u_opacity:e,u_color:i}},Qi=function(e,i,n,r,o,s){return t.extend(function(t,e,i,n){var r=i.imageManager.getPattern(t.from.toString()),o=i.imageManager.getPattern(t.to.toString()),s=i.imageManager.getPixelSize(),a=s.width,l=s.height,c=Math.pow(2,n.tileID.overscaledZ),u=n.tileSize*Math.pow(2,i.transform.tileZoom)/c,h=u*(n.tileID.canonical.x+n.tileID.wrap*c),d=u*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:r.tl,u_pattern_br_a:r.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[a,l],u_mix:e.t,u_pattern_size_a:r.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/de(n,1,i.transform.tileZoom),u_pixel_coord_upper:[h>>16,d>>16],u_pixel_coord_lower:[65535&h,65535&d]}}(r,s,n,o),{u_matrix:e,u_opacity:i})},qi={fillExtrusion:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fillExtrusionPattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_lightpos:new t.Uniform3f(e,i.u_lightpos),u_lightintensity:new t.Uniform1f(e,i.u_lightintensity),u_lightcolor:new t.Uniform3f(e,i.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,i.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,i.u_height_factor),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade),u_opacity:new t.Uniform1f(e,i.u_opacity)}},fill:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},fillPattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},fillOutline:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world)}},fillOutlinePattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_texsize:new t.Uniform2f(e,i.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},circle:function(e,i){return{u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,i.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},collisionBox:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,i.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,i.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,i.u_overscale_factor)}},collisionCircle:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,i.u_inv_matrix
2),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,i.u_viewport_size)}},debug:function(e,i){return{u_color:new t.UniformColor(e,i.u_color),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_overlay:new t.Uniform1i(e,i.u_overlay),u_overlay_scale:new t.Uniform1f(e,i.u_overlay_scale)}},clippingMask:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmap:function(e,i){return{u_extrude_scale:new t.Uniform1f(e,i.u_extrude_scale),u_intensity:new t.Uniform1f(e,i.u_intensity),u_matrix:new t.UniformMatrix4f(e,i.u_matrix)}},heatmapTexture:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_world:new t.Uniform2f(e,i.u_world),u_image:new t.Uniform1i(e,i.u_image),u_color_ramp:new t.Uniform1i(e,i.u_color_ramp),u_opacity:new t.Uniform1f(e,i.u_opacity)}},hillshade:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_latrange:new t.Uniform2f(e,i.u_latrange),u_light:new t.Uniform2f(e,i.u_light),u_shadow:new t.UniformColor(e,i.u_shadow),u_highlight:new t.UniformColor(e,i.u_highlight),u_accent:new t.UniformColor(e,i.u_accent)}},hillshadePrepare:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_image:new t.Uniform1i(e,i.u_image),u_dimension:new t.Uniform2f(e,i.u_dimension),u_zoom:new t.Uniform1f(e,i.u_zoom),u_unpack:new t.Uniform4f(e,i.u_unpack)}},line:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels)}},lineGradient:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_image:new t.Uniform1i(e,i.u_image),u_image_height:new t.Uniform1f(e,i.u_image_height)}},linePattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_texsize:new t.Uniform2f(e,i.u_texsize),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_image:new t.Uniform1i(e,i.u_image),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_scale:new t.Uniform3f(e,i.u_scale),u_fade:new t.Uniform1f(e,i.u_fade)}},lineSDF:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_ratio:new t.Uniform1f(e,i.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,i.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,i.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,i.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,i.u_sdfgamma),u_image:new t.Uniform1i(e,i.u_image),u_tex_y_a:new t.Uniform1f(e,i.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,i.u_tex_y_b),u_mix:new t.Uniform1f(e,i.u_mix)}},raster:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_tl_parent:new t.Uniform2f(e,i.u_tl_parent),u_scale_parent:new t.Uniform1f(e,i.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,i.u_buffer_scale),u_fade_t:new t.Uniform1f(e,i.u_fade_t),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image0:new t.Uniform1i(e,i.u_image0),u_image1:new t.Uniform1i(e,i.u_image1),u_brightness_low:new t.Uniform1f(e,i.u_brightness_low),u_brightness_high:new t.Uniform1f(e,i.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,i.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,i.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,i.u_spin_weights)}},symbolIcon:function(e,i){return{u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix
vendor: 99,781 bytes, line 2
2),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture)}},symbolSDF:function(e,i){return{u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texture:new t.Uniform1i(e,i.u_texture),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},symbolTextAndIcon:function(e,i){return{u_is_size_zoom_constant:new t.Uniform1i(e,i.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,i.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,i.u_size_t),u_size:new t.Uniform1f(e,i.u_size),u_camera_to_center_distance:new t.Uniform1f(e,i.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,i.u_pitch),u_rotate_symbol:new t.Uniform1i(e,i.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,i.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,i.u_fade_change),u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,i.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,i.u_coord_matrix),u_is_text:new t.Uniform1i(e,i.u_is_text),u_pitch_with_map:new t.Uniform1i(e,i.u_pitch_with_map),u_texsize:new t.Uniform2f(e,i.u_texsize),u_texsize_icon:new t.Uniform2f(e,i.u_texsize_icon),u_texture:new t.Uniform1i(e,i.u_texture),u_texture_icon:new t.Uniform1i(e,i.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,i.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,i.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,i.u_is_halo)}},background:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_color:new t.UniformColor(e,i.u_color)}},backgroundPattern:function(e,i){return{u_matrix:new t.UniformMatrix4f(e,i.u_matrix),u_opacity:new t.Uniform1f(e,i.u_opacity),u_image:new t.Uniform1i(e,i.u_image),u_pattern_tl_a:new t.Uniform2f(e,i.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,i.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,i.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,i.u_pattern_br_b),u_texsize:new t.Uniform2f(e,i.u_texsize),u_mix:new t.Uniform1f(e,i.u_mix),u_pattern_size_a:new t.Uniform2f(e,i.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,i.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,i.u_scale_a),u_scale_b:new t.Uniform1f(e,i.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,i.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,i.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,i.u_tile_units_to_pixels)}}};function Ki(e,i,n,r,o,s,a){for(var l=e.context,c=l.gl,u=e.useProgram("collisionBox"),h=[],d=0,p=0,A=0;A<r.length;A++){var f=r[A],g=i.getTile(f),m=g.getBucket(n);if(m){var y=f.posMatrix;0===o[0]&&0===o[1]||(y=e.translatePosMatrix(f.posMatrix,g,o,s));var v=a?m.textCollisionBox:m.iconCollisionBox,_=m.collisionCircleArray;if(_.length>0){var b=t.create(),x=y;t.mul(b,m.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(b,b,m.placementViewportMatrix),h.push({circleArray:_,circleOffset:p,transform:x,invTransform:b}),p=d+=_.length/4}v&&u.draw(l,c.LINES,Bt.disabled,Et.disabled,e.colorModeForRenderPass(),Tt.disabled,Ii(y,e.transform,g),n.id,v.layoutVertexBuffer,v.indexBuffer,v.segments,null,e.transform.zoom,null,null,v.collisionVertexBuffer)}}if(a&&h.length){var w=e.useProgram("collisionCircle"),C=new t.StructArrayLayout2f1f2i16;C.resize(4*d),C._trim();for(var B=0,E=0,S=h;E<S.length;E+=1)for(var T=S[E],M=0;M<T.circleArray.length/4;M++){var I=4*M,P=T.circleArray[I+0],D=T.circleArray[I+1],L=T.circleArray[I+2],O=T.circleArray[I+3];C.emplace(B++,P,D,L,O,0),C.emplace(B++,P,D,L,O,1),C.emplace(B++,P,D,L,O,2),C.emplace(B++,P,D,L,O,3)}(!ji||ji.length<2*d)&&(ji=function(e){var i=2*e,n=new t.StructArrayLayout3ui6;n.resize(i),n._trim();for(var r=0;r<i;r++){var o=6*r;n.uint16[o+0]=4*r+0,n.uint16[o+1]=4*r+1,n.uint16[o+2]=4*r+2,n.uint16[o+3]=4*r+2,n.uint16[o+4]=4*r+3,n.uint16[o+5]=4*r+0}return n}(d));for(var F=l.createIndexBuffer(ji,!0),R=l.createVertexBuffer(C,t.collisionCircleLayout.members,!0),k=0,z=h;k<z.length;k+=1){var U=z[k],N=Pi(U.transform,U.invTransform,e.transform);w.draw(l,c.TRIANGLES,Bt.disabled,Et.disabled,e.colorModeForRenderPass(),Tt.disabled,N,n.id,R,F,t.SegmentVector.simpleSegment(0,2*U.circleOffset,U.circleArray.length,U.circleArray.length/2),null,e.transform.zoom,null,null,null)}R.destroy(),F.destroy()}}var Xi=t.identity(new Float32Array(16));function Yi(e,i,n,r,o,s){var a=t.getAnchorAlignment(e),l=-(a.horizontalAlign-.5)*i,c=-(a.verticalAlign-.5)*n,u=t.evaluateVariableOffset(e,r);return new t.Point((l/o+u[0])*s,(c/o+u[1])*s)}function $i(e,i,n,r,o,s,a,l,c,u,h){var d=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,A=e.icon.dynamicLayoutVertexArray,f={};p.clear();for(var g=0;g<d.length;g++){var m=d.get(g),y=m.hidden||!m.crossTileID||e.allowVerticalPlacement&&!m.placedOrientation?null:r[m.crossTileID];if(y){var v=new t.Point(m.anchorX,m.anchorY),_=$t(v,n?l:a),b=te(s.cameraToCenterDistance,_.signedDistanceFromCamera),x=o.evaluateSizeForFeature(e.textSizeData,u,m)*b/t.ONE_EM;n&&(x*=e.tilePixelRatio/c);for(var w=Yi(y.anchor,y.width,y.height,y.textOffset,y.textBoxScale,x),C=n?$t(v.add(w),a).point:_.point.add(i?w.rotate(-s.angle):w),B=e.allowVerticalPlacement&&m.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,E=0;E<m.numGlyphs;E++)t.addDynamicAttributes(p,C,B);h&&m.associatedIconIndex>=0&&(f[m.associatedIconIndex]={shiftedAnchor:C,angle:B})}else ce(m.numGlyphs,p)}if(h){A.clear();for(var S=e.icon.placedSymbolArray,T=0;T<S.length;T++){var M=S.get(T);if(M.hidden)ce(M.numGlyphs,A);else{var I=f[T];if(I)for(var P=0;P<M.numGlyphs;P++)t.addDynamicAttributes(A,I.shiftedAnchor,I.angle);else ce(M.numGlyphs,A)}}e.icon.dynamicLayoutVertexBuffer.updateData(A)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function tn(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function en(e,i,n,r,o,s,a,l,c,u,h,d){for(var p=e.context,A=p.gl,f=e.transform,g="map"===l,m="map"===c,y=g&&"point"!==n.layout.get("symbol-placement"),v=g&&!m&&!y,_=void 0!==n.layout.get("symbol-sort-key").constantOr(1),b=!1,x=e.depthModeForSublayer(0,Bt.ReadOnly),w=n.layout.get("text-variable-anchor"),C=[],B=0,E=r;B<E.length;B+=1){var S=E[B],T=i.getTile(S),M=T.getBucket(n);if(M){var I=o?M.text:M.icon;if(I&&I.segments.get().length){var P=I.programConfigurations.get(n.id),D=o||M.sdfIcons,L=o?M.textSizeData:M.iconSizeData,O=m||0!==f.pitch,F=e.useProgram(tn(D,o,M),P),R=t.evaluateSizeForZoom(L,f.zoom),k=void 0,z=[0,0],U=void 0,N=void 0,G=null,Z=void 0;if(o)U=T.glyphAtlasTexture,N=A.LINEAR,k=T.glyphAtlasTexture.size,M.iconsInText&&(z=T.imageAtlasTexture.size,G=T.imageAtlasTexture,Z=O||e.options.rotating||e.options.zooming||"composite"===L.kind||"camera"===L.kind?A.LINEAR:A.NEAREST);else{var j=1!==n.layout.get("icon-size").constantOr(0)||M.iconsNeedLinear;U=T.imageAtlasTexture,N=D||e.options.rotating||e.options.zooming||j||O?A.LINEAR:A.NEAREST,k=T.imageAtlasTexture.size}var V=de(T,1,e.transform.zoom),H=Xt(S.posMatrix,m,g,e.transform,V),J=Yt(S.posMatrix,m,g,e.transform,V),W=w&&M.hasTextData(),Q="none"!==n.layout.get("icon-text-fit")&&W&&M.hasIconData();y&&ie(M,S.posMatrix,e,o,H,J,m,u);var q=e.translatePosMatrix(S.posMatrix,T,s,a),K=y||o&&w||Q?Xi:H,X=e.translatePosMatrix(J,T,s,a,!0),Y=D&&0!==n.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1),$={program:F,buffers:I,uniformValues:D?M.iconsInText?Ji(L.kind,R,v,m,e,q,K,X,k,z):Hi(L.kind,R,v,m,e,q,K,X,o,k,!0):Vi(L.kind,R,v,m,e,q,K,X,o,k),atlasTexture:U,atlasTextureIcon:G,atlasInterpolation:N,atlasInterpolationIcon:Z,isSDF:D,hasHalo:Y};if(_&&M.canOverlap){b=!0;for(var tt=0,et=I.segments.get();tt<et.length;tt+=1){var it=et[tt];C.push({segments:new t.SegmentVector([it]),sortKey:it.sortKey,state:$})}}else C.push({segments:I.segments,sortKey:0,state:$})}}}b&&C.sort((function(t,e){return t.sortKey-e.sortKey}));for(var nt=0,rt=C;nt<rt.length;nt+=1){var ot=rt[nt],st=ot.state;if(p.activeTexture.set(A.TEXTURE0),st.atlasTexture.bind(st.atlasInterpolation,A.CLAMP_TO_EDGE),st.atlasTextureIcon&&(p.activeTexture.set(A.TEXTURE1),st.atlasTextureIcon&&st.atlasTextureIcon.bind(st.atlasInterpolationIcon,A.CLAMP_TO_EDGE)),st.isSDF){var at=st.uniformValues;st.hasHalo&&(at.u_is_halo=1,nn(st.buffers,ot.segments,n,e,st.program,x,h,d,at)),at.u_is_halo=0}nn(st.buffers,ot.segments,n,e,st.program,x,h,d,st.uniformValues)}}function nn(t,e,i,n,r,o,s,a,l){var c=n.context;r.draw(c,c.gl.TRIANGLES,o,s,a,Tt.disabled,l,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,n.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function rn(t,e,i,n,r,o,s){var a,l,c,u,h,d=t.context.gl,p=i.paint.get("fill-pattern"),A=p&&p.constantOr(1),f=i.getCrossfadeParameters();s?(l=A&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",a=d.LINES):(l=A?"fillPattern":"fill",a=d.TRIANGLES);for(var g=0,m=n;g<m.length;g+=1){var y=m[g],v=e.getTile(y);if(!A||v.patternsLoaded()){var _=v.getBucket(i);if(_){var b=_.programConfigurations.get(i.id),x=t.useProgram(l,b);A&&(t.context.activeTexture.set(d.TEXTURE0),v.imageAtlasTexture.bind(d.LINEAR,d.CLAMP_TO_EDGE),b.updatePaintBuffers(f));var w=p.constantOr(null);if(w&&v.imageAtlas){var C=v.imageAtlas,B=C.patternPositions[w.to.toString()],E=C.patternPositions[w.from.toString()];B&&E&&b.setConstantPatternPositions(B,E)}var S=t.translatePosMatrix(y.posMatrix,v,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(s){u=_.indexBuffer2,h=_.segments2;var T=[d.drawingBufferWidth,d.drawingBufferHeight];c="fillOutlinePattern"===l&&A?Ti(S,t,f,v,T):Si(S,T)}else u=_.indexBuffer,h=_.segments,c=A?Ei(S,t,f,v):Bi(S);x.draw(t.context,a,r,t.stencilModeForClipping(y),o,Tt.disabled,c,i.id,_.layoutVertexBuffer,u,h,i.paint,t.transform.zoom,b)}}}}function on(t,e,i,n,r,o,s){for(var a=t.context,l=a.gl,c=i.paint.get("fill-extrusion-pattern"),u=c.constantOr(1),h=i.getCrossfadeParameters(),d=i.paint.get("fill-extrusion-opacity"),p=0,A=n;p<A.length;p+=1){var f=A[p],g=e.getTile(f),m=g.getBucket(i);if(m){var y=m.programConfigurations.get(i.id),v=t.useProgram(u?"fillExtrusionPattern":"fillExtrusion",y);u&&(t.context.activeTexture.set(l.TEXTURE0),g.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(h));var _=c.constantOr(null);if(_&&g.imageAtlas){var b=g.imageAtlas,x=b.patternPositions[_.to.toString()],w=b.patternPositions[_.from.toString()];x&&w&&y.setConstantPatternPositions(x,w)}var C=t.translatePosMatrix(f.posMatrix,g,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),B=i.paint.get("fill-extrusion-vertical-gradient"),E=u?Ci(C,t,B,d,f,h,g):wi(C,t,B,d);v.draw(a,a.gl.TRIANGLES,r,o,s,Tt.backCCW,E,i.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,i.paint,t.transform.zoom,y)}}}function sn(e,i,n,r,o,s){var a=e.context,l=a.gl,c=i.fbo;if(c){var u=e.useProgram("hillshade");a.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get());var h=function(e,i,n){var r=n.paint.get("hillshade-shadow-color"),o=n.paint.get("hillshade-highlight-color"),s=n.paint.get("hillshade-accent-color"),a=n.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===n.paint.get("hillshade-illumination-anchor")&&(a-=e.transform.angle);var l,c,u,h=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(i.tileID.toUnwrapped(),h),u_image:0,u_latrange:(l=i.tileID,c=Math.pow(2,l.canonical.z),u=l.canonical.y,[new t.MercatorCoordinate(0,u/c).toLngLat().lat,new t.MercatorCoordinate(0,(u+1)/c).toLngLat().lat]),u_light:[n.paint.get("hillshade-exaggeration"),a],u_shadow:r,u_highlight:o,u_accent:s}}(e,i,n);u.draw(a,l.TRIANGLES,r,o,s,Tt.disabled,h,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}}function an(e,i,n,r,o,s){var a=e.context,l=a.gl,c=i.dem;if(c&&c.data){var u=c.dim,h=c.stride,d=c.getPixels();if(a.activeTexture.set(l.TEXTURE1),a.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(h),i.demTexture){var p=i.demTexture;p.update(d,{premultiply:!1}),p.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else i.demTexture=new t.Texture(a,d,l.RGBA,{premultiply:!1}),i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);a.activeTexture.set(l.TEXTURE0);var A=i.fbo;if(!A){var f=new t.Texture(a,{width:u,height:u,data:null},l.RGBA);f.bind(l.LINEAR,l.CLAMP_TO_EDGE),(A=i.fbo=a.createFramebuffer(u,u,!0)).colorAttachment.set(f.texture)}a.bindFramebuffer.set(A.framebuffer),a.viewport.set([0,0,u,u]),e.useProgram("hillshadePrepare").draw(a,l.TRIANGLES,r,o,s,Tt.disabled,function(e,i){var n=i.stride,r=t.create();return t.ortho(r,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(r,r,[0,-t.EXTENT,0]),{u_matrix:r,u_image:1,u_dimension:[n,n],u_zoom:e.overscaledZ,u_unpack:i.getUnpackVector()}}(i.tileID,c),n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1}}function ln(e,i,n,r,o){var s=r.paint.get("raster-fade-duration");if(s>0){var a=t.browser.now(),l=(a-e.timeAdded)/s,c=i?(a-i.timeAdded)/s:-1,u=n.getSource(),h=o.coveringZoomLevel({tileSize:u.tileSize,roundZoom:u.roundZoom}),d=!i||Math.abs(i.tileID.overscaledZ-h)>Math.abs(e.tileID.overscaledZ-h),p=d&&e.refreshedUponExpiration?1:t.clamp(d?l:1-c,0,1);return e.refreshedUponExpiration&&l>=1&&(e.refreshedUponExpiration=!1),i?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}var cn=new t.Color(1,0,0,1),un=new t.Color(0,1,0,1),hn=new t.Color(0,0,1,1),dn=new t.Color(1,0,1,1),pn=new t.Color(0,1,1,1);function An(t,e,i,n){gn(t,0,e+i/2,t.transform.width,i,n)}function fn(t,e,i,n){gn(t,e-i/2,0,i,t.transform.height,n)}function gn(e,i,n,r,o,s){var a=e.context,l=a.gl;l.enable(l.SCISSOR_TEST),l.scissor(i*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,r*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),a.clear({color:s}),l.disable(l.SCISSOR_TEST)}function mn(e,i,n){var r=e.context,o=r.gl,s=n.posMatrix,a=e.useProgram("debug"),l=Bt.disabled,c=Et.disabled,u=e.colorModeForRenderPass();r.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),a.draw(r,o.LINE_STRIP,l,c,u,Tt.disabled,Di(s,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var h=i.getTileByID(n.key).latestRawTileData,d=Math.floor((h&&h.byteLength||0)/1024),p=i.getTile(n).tileSize,A=512/Math.min(p,512)*(n.overscaledZ/e.transform.zoom)*.5,f=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(f+=" => "+n.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var i=t.debugOverlayCanvas,n=t.context.gl,r=t.debugOverlayCanvas.getContext("2d");r.clearRect(0,0,i.width,i.height),r.shadowColor="white",r.shadowBlur=2,r.lineWidth=1.5,r.strokeStyle="white",r.textBaseline="top",r.font="bold 36px Open Sans, sans-serif",r.fillText(e,5,5),r.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(n.LINEAR,n.CLAMP_TO_EDGE)}(e,f+" "+d+"kb"),a.draw(r,o.TRIANGLES,l,c,St.alphaBlended,Tt.disabled,Di(s,t.Color.transparent,A),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}var yn={symbol:function(e,i,n,r,o){if("translucent"===e.renderPass){var s=Et.disabled,a=e.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(e,i,n,r,o,s,a){for(var l=i.transform,c="map"===o,u="map"===s,h=0,d=e;h<d.length;h+=1){var p=d[h],A=r.getTile(p),f=A.getBucket(n);if(f&&f.text&&f.text.segments.get().length){var g=t.evaluateSizeForZoom(f.textSizeData,l.zoom),m=de(A,1,i.transform.zoom),y=Xt(p.posMatrix,u,c,i.transform,m),v="none"!==n.layout.get("icon-text-fit")&&f.hasIconData();if(g){var _=Math.pow(2,l.zoom-A.tileID.overscaledZ);$i(f,c,u,a,t.symbolSize,l,y,p.posMatrix,_,g,v)}}}}(r,e,n,i,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),o),0!==n.paint.get("icon-opacity").constantOr(1)&&en(e,i,n,r,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),s,a),0!==n.paint.get("text-opacity").constantOr(1)&&en(e,i,n,r,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),s,a),i.map.showCollisionBoxes&&(Ki(e,i,n,r,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Ki(e,i,n,r,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(e,i,n,r){if("translucent"===e.renderPass){var o=n.paint.get("circle-opacity"),s=n.paint.get("circle-stroke-width"),a=n.paint.get("circle-stroke-opacity"),l=void 0!==n.layout.get("circle-sort-key").constantOr(1);if(0!==o.constantOr(1)||0!==s.constantOr(1)&&0!==a.constantOr(1)){for(var c=e.context,u=c.gl,h=e.depthModeForSublayer(0,Bt.ReadOnly),d=Et.disabled,p=e.colorModeForRenderPass(),A=[],f=0;f<r.length;f++){var g=r[f],m=i.getTile(g),y=m.getBucket(n);if(y){var v=y.programConfigurations.get(n.id),_={programConfiguration:v,program:e.useProgram("circle",v),layoutVertexBuffer:y.layoutVertexBuffer,indexBuffer:y.indexBuffer,uniformValues:Mi(e,g,m,n)};if(l)for(var b=0,x=y.segments.get();b<x.length;b+=1){var w=x[b];A.push({segments:new t.SegmentVector([w]),sortKey:w.sortKey,state:_})}else A.push({segments:y.segments,sortKey:0,state:_})}}l&&A.sort((function(t,e){return t.sortKey-e.sortKey}));for(var C=0,B=A;C<B.length;C+=1){var E=B[C],S=E.state;S.program.draw(c,u.TRIANGLES,h,d,p,Tt.disabled,S.uniformValues,n.id,S.layoutVertexBuffer,S.indexBuffer,E.segments,n.paint,e.transform.zoom,S.programConfiguration)}}}},heatmap:function(e,i,n,r){if(0!==n.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,s=o.gl,a=Et.disabled,l=new St([s.ONE,s.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,i){var n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var r=i.heatmapFbo;if(r)n.bindTexture(n.TEXTURE_2D,r.colorAttachment.get()),t.bindFramebuffer.set(r.framebuffer);else{var o=n.createTexture();n.bindTexture(n.TEXTURE_2D,o),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),r=i.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),function(t,e,i,n){var r=t.gl;r.texImage2D(r.TEXTURE_2D,0,r.RGBA,e.width/4,e.height/4,0,r.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:r.UNSIGNED_BYTE,null),n.colorAttachment.set(i)}(t,e,o,r)}}(o,e,n),o.clear({color:t.Color.transparent});for(var c=0;c<r.length;c++){var u=r[c];if(!i.hasRenderableParent(u)){var h=i.getTile(u),d=h.getBucket(n);if(d){var p=d.programConfigurations.get(n.id);e.useProgram("heatmap",p).draw(o,s.TRIANGLES,Bt.disabled,a,l,Tt.disabled,Oi(u.posMatrix,h,e.transform.zoom,n.paint.get("heatmap-intensity")),n.id,d.layoutVertexBuffer,d.indexBuffer,d.segments,n.paint,e.transform.zoom,p)}}}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),function(e,i){var n=e.context,r=n.gl,o=i.heatmapFbo;if(o){n.activeTexture.set(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,o.colorAttachment.get()),n.activeTexture.set(r.TEXTURE1);var s=i.colorRampTexture;s||(s=i.colorRampTexture=new t.Texture(n,i.colorRamp,r.RGBA)),s.bind(r.LINEAR,r.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(n,r.TRIANGLES,Bt.disabled,Et.disabled,e.colorModeForRenderPass(),Tt.disabled,function(e,i,n,r){var o=t.create();t.ortho(o,0,e.width,e.height,0,0,1);var s=e.context.gl;return{u_matrix:o,u_world:[s.drawingBufferWidth,s.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:i.paint.get("heatmap-opacity")}}(e,i),i.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,i.paint,e.transform.zoom)}}(e,n))},line:function(e,i,n,r){if("translucent"===e.renderPass){var o=n.paint.get("line-opacity"),s=n.paint.get("line-width");if(0!==o.constantOr(1)&&0!==s.constantOr(1))for(var a=e.depthModeForSublayer(0,Bt.ReadOnly),l=e.colorModeForRenderPass(),c=n.paint.get("line-dasharray"),u=n.paint.get("line-pattern"),h=u.constantOr(1),d=n.paint.get("line-gradient"),p=n.getCrossfadeParameters(),A=h?"linePattern":c?"lineSDF":d?"lineGradient":"line",f=e.context,g=f.gl,m=!0,y=0,v=r;y<v.length;y+=1){var _=v[y],b=i.getTile(_);if(!h||b.patternsLoaded()){var x=b.getBucket(n);if(x){var w=x.programConfigurations.get(n.id),C=e.context.program.get(),B=e.useProgram(A,w),E=m||B.program!==C,S=u.constantOr(null);if(S&&b.imageAtlas){var T=b.imageAtlas,M=T.patternPositions[S.to.toString()],I=T.patternPositions[S.from.toString()];M&&I&&w.setConstantPatternPositions(M,I)}var P=h?ki(e,b,n,p):c?zi(e,b,n,c,p):d?Ri(e,b,n,x.lineClipsArray.length):Fi(e,b,n);if(h)f.activeTexture.set(g.TEXTURE0),b.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),w.updatePaintBuffers(p);else if(c&&(E||e.lineAtlas.dirty))f.activeTexture.set(g.TEXTURE0),e.lineAtlas.bind(f);else if(d){var D=x.gradients[n.id],L=D.texture;if(n.gradientVersion!==D.version){var O=256;if(n.stepInterpolant){var F=i.getSource().maxzoom,R=_.canonical.z===F?Math.ceil(1<<e.transform.maxZoom-_.canonical.z):1;O=t.clamp(t.nextPowerOfTwo(x.maxLineLength/t.EXTENT*1024*R),256,f.maxTextureSize)}D.gradient=t.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:O,image:D.gradient||void 0,clips:x.lineClipsArray}),D.texture?D.texture.update(D.gradient):D.texture=new t.Texture(f,D.gradient,g.RGBA),D.version=n.gradientVersion,L=D.texture}f.activeTexture.set(g.TEXTURE0),L.bind(n.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}B.draw(f,g.TRIANGLES,a,e.stencilModeForClipping(_),l,Tt.disabled,P,n.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,n.paint,e.transform.zoom,w,x.layoutVertexBuffer2),m=!1}}}}},fill:function(e,i,n,r){var o=n.paint.get("fill-color"),s=n.paint.get("fill-opacity");if(0!==s.constantOr(1)){var a=e.colorModeForRenderPass(),l=n.paint.get("fill-pattern"),c=e.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(t.Color.transparent).a&&1===s.constantOr(0)?"opaque":"translucent";if(e.renderPass===c){var u=e.depthModeForSublayer(1,"opaque"===e.renderPass?Bt.ReadWrite:Bt.ReadOnly);rn(e,i,n,r,u,a,!1)}if("translucent"===e.renderPass&&n.paint.get("fill-antialias")){var h=e.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,Bt.ReadOnly);rn(e,i,n,r,h,a,!0)}}},"fill-extrusion":function(t,e,i,n){var r=i.paint.get("fill-extrusion-opacity");if(0!==r&&"translucent"===t.renderPass){var o=new Bt(t.context.gl.LEQUAL,Bt.ReadWrite,t.depthRangeFor3D);if(1!==r||i.paint.get("fill-extrusion-pattern").constantOr(1))on(t,e,i,n,o,Et.disabled,St.disabled),on(t,e,i,n,o,t.stencilModeFor3D(),t.colorModeForRenderPass());else{var s=t.colorModeForRenderPass();on(t,e,i,n,o,Et.disabled,s)}}},hillshade:function(t,e,i,n){if("offscreen"===t.renderPass||"translucent"===t.renderPass){for(var r=t.context,o=t.depthModeForSublayer(0,Bt.ReadOnly),s=t.colorModeForRenderPass(),a="translucent"===t.renderPass?t.stencilConfigForOverlap(n):[{},n],l=a[0],c=0,u=a[1];c<u.length;c+=1){var h=u[c],d=e.getTile(h);d.needsHillshadePrepare&&"offscreen"===t.renderPass?an(t,d,i,o,Et.disabled,s):"translucent"===t.renderPass&&sn(t,d,i,o,l[h.overscaledZ],s)}r.viewport.set([0,0,t.width,t.height])}},raster:function(t,e,i,n){if("translucent"===t.renderPass&&0!==i.paint.get("raster-opacity")&&n.length)for(var r=t.context,o=r.gl,s=e.getSource(),a=t.useProgram("raster"),l=t.colorModeForRenderPass(),c=s instanceof D?[{},n]:t.stencilConfigForOverlap(n),u=c[0],h=c[1],d=h[h.length-1].overscaledZ,p=!t.options.moving,A=0,f=h;A<f.length;A+=1){var g=f[A],m=t.depthModeForSublayer(g.overscaledZ-d,1===i.paint.get("raster-opacity")?Bt.ReadWrite:Bt.ReadOnly,o.LESS),y=e.getTile(g),v=t.transform.calculatePosMatrix(g.toUnwrapped(),p);y.registerFadeDuration(i.paint.get("raster-fade-duration"));var _=e.findLoadedParent(g,0),b=ln(y,_,e,i,t.transform),x=void 0,w=void 0,C="nearest"===i.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;r.activeTexture.set(o.TEXTURE0),y.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),r.activeTexture.set(o.TEXTURE1),_?(_.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),x=Math.pow(2,_.tileID.overscaledZ-y.tileID.overscaledZ),w=[y.tileID.canonical.x*x%1,y.tileID.canonical.y*x%1]):y.texture.bind(C,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);var B=Gi(v,w||[0,0],x||1,b,i);s instanceof D?a.draw(r,o.TRIANGLES,m,Et.disabled,l,Tt.disabled,B,i.id,s.boundsBuffer,t.quadTriangleIndexBuffer,s.boundsSegments):a.draw(r,o.TRIANGLES,m,u[g.overscaledZ],l,Tt.disabled,B,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}},background:function(t,e,i){var n=i.paint.get("background-color"),r=i.paint.get("background-opacity");if(0!==r){var o=t.context,s=o.gl,a=t.transform,l=a.tileSize,c=i.paint.get("background-pattern");if(!t.isPatternMissing(c)){var u=!c&&1===n.a&&1===r&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass===u){var h=Et.disabled,d=t.depthModeForSublayer(0,"opaque"===u?Bt.ReadWrite:Bt.ReadOnly),p=t.colorModeForRenderPass(),A=t.useProgram(c?"backgroundPattern":"background"),f=a.coveringTiles({tileSize:l});c&&(o.activeTexture.set(s.TEXTURE0),t.imageManager.bind(t.context));for(var g=i.getCrossfadeParameters(),m=0,y=f;m<y.length;m+=1){var v=y[m],_=t.transform.calculatePosMatrix(v.toUnwrapped()),b=c?Qi(_,r,t,c,{tileID:v,tileSize:l},g):Wi(_,r,n);A.draw(o,s.TRIANGLES,d,h,p,Tt.disabled,b,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}}}},debug:function(t,e,i){for(var n=0;n<i.length;n++)mn(t,e,i[n])},custom:function(t,e,i){var n=t.context,r=i.implementation;if("offscreen"===t.renderPass){var o=r.prerender;o&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),o.call(r,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(Et.disabled);var s="3d"===r.renderingMode?new Bt(t.context.gl.LEQUAL,Bt.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Bt.ReadOnly);n.setDepthMode(s),r.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null)}}},vn=function(t,e){this.context=new Mt(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=It.maxUnderzooming+It.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ze,this.gpuTimers={}};vn.prototype.resize=function(e,i){if(this.width=e*t.browser.devicePixelRatio,this.height=i*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,r=this.style._order;n<r.length;n+=1)this.style._layers[r[n]].resize()},vn.prototype.setup=function(){var e=this.context,i=new t.StructArrayLayout2i4;i.emplaceBack(0,0),i.emplaceBack(t.EXTENT,0),i.emplaceBack(0,t.EXTENT),i.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(i,Ve.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2);var n=new t.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(t.EXTENT,0),n.emplaceBack(0,t.EXTENT),n.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(n,Ve.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5);var r=new t.StructArrayLayout4i8;r.emplaceBack(0,0,0,0),r.emplaceBack(t.EXTENT,0,t.EXTENT,0),r.emplaceBack(0,t.EXTENT,0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(r,P.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2);var o=new t.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(o,Ve.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2);var s=new t.StructArrayLayout1ui2;s.emplaceBack(0),s.emplaceBack(1),s.emplaceBack(3),s.emplaceBack(2),s.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(s);var a=new t.StructArrayLayout3ui6;a.emplaceBack(0,1,2),a.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(a),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA);var l=this.context.gl;this.stencilClearMode=new Et({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)},vn.prototype.clearStencil=function(){var e=this.context,i=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=t.create();t.ortho(n,0,this.width,this.height,0,0,1),t.scale(n,n,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,i.TRIANGLES,Bt.disabled,this.stencilClearMode,St.disabled,Tt.disabled,Li(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},vn.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var i=this.context,n=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(St.disabled),i.setDepthMode(Bt.disabled);var r=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,s=e;o<s.length;o+=1){var a=s[o],l=this._tileClippingMaskIDs[a.key]=this.nextStencilID++;r.draw(i,n.TRIANGLES,Bt.disabled,new Et({func:n.ALWAYS,mask:0},l,255,n.KEEP,n.KEEP,n.REPLACE),St.disabled,Tt.disabled,Li(a.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},vn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new Et({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},vn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new Et({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},vn.prototype.stencilConfigForOverlap=function(t){var e,i=this.context.gl,n=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),r=n[n.length-1].overscaledZ,o=n[0].overscaledZ-r+1;if(o>1){this.currentStencilSource=void 0,this.nextStencilID+o>256&&this.clearStencil();for(var s={},a=0;a<o;a++)s[a+r]=new Et({func:i.GEQUAL,mask:255},a+this.nextStencilID,255,i.KEEP,i.KEEP,i.REPLACE);return this.nextStencilID+=o,[s,n]}return[(e={},e[r]=Et.disabled,e),n]},vn.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new St([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?St.unblended:St.alphaBlended},vn.prototype.depthModeForSublayer=function(t,e,i){if(!this.opaquePassEnabledForLayer())return Bt.disabled;var n=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Bt(i||this.context.gl.LEQUAL,e,[n,n])},vn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},vn.prototype.render=function(e,i){var n=this;this.style=e,this.options=i,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var r=this.style._order,o=this.style.sourceCaches;for(var s in o){var a=o[s];a.used&&a.prepare(this.context)}var l,c,u={},h={},d={};for(var p in o){var A=o[p];u[p]=A.getVisibleCoordinates(),h[p]=u[p].slice().reverse(),d[p]=A.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var f=0;f<r.length;f++)if(this.style._layers[r[f]].is3D()){this.opaquePassCutoff=f;break}this.renderPass="offscreen";for(var g=0,m=r;g<m.length;g+=1){var y=this.style._layers[m[g]];if(y.hasOffscreenPass()&&!y.isHidden(this.transform.zoom)){var v=h[y.source];("custom"===y.type||v.length)&&this.renderLayer(this,o[y.source],y,v)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){var _=this.style._layers[r[this.currentLayer]],b=o[_.source],x=u[_.source];this._renderTileClippingMasks(_,x),this.renderLayer(this,b,_,x)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){var w=this.style._layers[r[this.currentLayer]],C=o[w.source],B=("symbol"===w.type?d:h)[w.source];this._renderTileClippingMasks(w,u[w.source]),this.renderLayer(this,C,w,B)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(n.transform.zoom)&&(t.source!==(c&&c.id)&&(c=n.style.sourceCaches[t.source]),(!l||l.getSource().maxzoom<c.getSource().maxzoom)&&(l=c))})),l&&yn.debug(this,l,l.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;An(t,t.transform.height-(e.top||0),3,cn),An(t,e.bottom||0,3,un),fn(t,e.left||0,3,hn),fn(t,t.transform.width-(e.right||0),3,dn);var i=t.transform.centerPoint;!function(t,e,i,n){gn(t,e-1,i-10,2,20,n),gn(t,e-10,i-1,20,2,n)}(t,i.x,t.transform.height-i.y,pn)}(this),this.context.setDefault()},vn.prototype.renderLayer=function(t,e,i,n){i.isHidden(this.transform.zoom)||("background"===i.type||"custom"===i.type||n.length)&&(this.id=i.id,this.gpuTimingStart(i),yn[i.type](t,e,i,n,this.style.placement.variableOffsets),this.gpuTimingEnd())},vn.prototype.gpuTimingStart=function(t){if(this.options.gpuTiming){var e=this.context.extTimerQuery,i=this.gpuTimers[t.id];i||(i=this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()}),i.calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i.query)}},vn.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var t=this.context.extTimerQuery;t.endQueryEXT(t.TIME_ELAPSED_EXT)}},vn.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},vn.prototype.queryGpuTimers=function(t){var e={};for(var i in t){var n=t[i],r=this.context.extTimerQuery,o=r.getQueryObjectEXT(n.query,r.QUERY_RESULT_EXT)/1e6;r.deleteQueryEXT(n.query),e[i]=o}return e},vn.prototype.translatePosMatrix=function(e,i,n,r,o){if(!n[0]&&!n[1])return e;var s=o?"map"===r?this.transform.angle:0:"viewport"===r?-this.transform.angle:0;if(s){var a=Math.sin(s),l=Math.cos(s);n=[n[0]*l-n[1]*a,n[0]*a+n[1]*l]}var c=[o?n[0]:de(i,n[0],this.transform.zoom),o?n[1]:de(i,n[1],this.transform.zoom),0],u=new Float32Array(16);return t.translate(u,e,c),u},vn.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},vn.prototype.getTileTexture=function(t){var e=this._tileTextures[t];return e&&e.length>0?e.pop():null},vn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i},vn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var i=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[i]||(this.cache[i]=new bi(this.context,t,yi[t],e,qi[t],this._showOverdrawInspector)),this.cache[i]},vn.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},vn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},vn.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},vn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var _n=function(t,e){this.points=t,this.planes=e};_n.fromInvProjectionMatrix=function(e,i,n){var r=Math.pow(2,n),o=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((function(i){return t.transformMat4([],i,e)})).map((function(e){return t.scale$1([],e,1/e[3]/i*r)})),s=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var i=t.sub([],o[e[0]],o[e[1]]),n=t.sub([],o[e[2]],o[e[1]]),r=t.normalize([],t.cross([],i,n)),s=-t.dot(r,o[e[1]]);return r.concat(s)}));return new _n(o,s)};var bn=function(e,i){this.min=e,this.max=i,this.center=t.scale$2([],t.add([],this.min,this.max),.5)};bn.prototype.quadrant=function(e){for(var i=[e%2==0,e<2],n=t.clone$2(this.min),r=t.clone$2(this.max),o=0;o<i.length;o++)n[o]=i[o]?this.min[o]:this.center[o],r[o]=i[o]?this.center[o]:this.max[o];return r[2]=this.max[2],new bn(n,r)},bn.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},bn.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},bn.prototype.intersects=function(e){for(var i=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,r=0;r<e.planes.length;r++){for(var o=e.planes[r],s=0,a=0;a<i.length;a++)s+=t.dot$1(o,i[a])>=0;if(0===s)return 0;s!==i.length&&(n=!1)}if(n)return 2;for(var l=0;l<3;l++){for(var c=Number.MAX_VALUE,u=-Number.MAX_VALUE,h=0;h<e.points.length;h++){var d=e.points[h][l]-this.min[l];c=Math.min(c,d),u=Math.max(u,d)}if(u<0||c>this.max[l]-this.min[l])return 0}return 1};var xn=function(t,e,i,n){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===i&&(i=0),void 0===n&&(n=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(n)||n<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=n};xn.prototype.interpolate=function(e,i,n){return null!=i.top&&null!=e.top&&(this.top=t.number(e.top,i.top,n)),null!=i.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,i.bottom,n)),null!=i.left&&null!=e.left&&(this.left=t.number(e.left,i.left,n)),null!=i.right&&null!=e.right&&(this.right=t.number(e.right,i.right,n)),this},xn.prototype.getCenter=function(e,i){var n=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+i-this.bottom)/2,0,i);return new t.Point(n,r)},xn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},xn.prototype.clone=function(){return new xn(this.top,this.bottom,this.left,this.right)},xn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var wn=function(e,i,n,r,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=i||22,this._minPitch=null==n?0:n,this._maxPitch=null==r?60:r,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xn,this._posMatrixCache={},this._alignedPosMatrixCache={}},Cn={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};wn.prototype.clone=function(){var t=new wn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},Cn.minZoom.get=function(){return this._minZoom},Cn.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},Cn.maxZoom.get=function(){return this._maxZoom},Cn.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},Cn.minPitch.get=function(){return this._minPitch},Cn.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},Cn.maxPitch.get=function(){return this._maxPitch},Cn.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},Cn.renderWorldCopies.get=function(){return this._renderWorldCopies},Cn.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},Cn.worldSize.get=function(){return this.tileSize*this.scale},Cn.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},Cn.size.get=function(){return new t.Point(this.width,this.height)},Cn.bearing.get=function(){return-this.angle/Math.PI*180},Cn.bearing.set=function(e){var i=-t.wrap(e,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},Cn.pitch.get=function(){return this._pitch/Math.PI*180},Cn.pitch.set=function(e){var i=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())},Cn.fov.get=function(){return this._fov/Math.PI*180},Cn.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},Cn.zoom.get=function(){return this._zoom},Cn.zoom.set=function(t){var e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.scale=this.zoomScale(e),this.tileZoom=Math.floor(e),this.zoomFraction=e-this.tileZoom,this._constrain(),this._calcMatrices())},Cn.center.get=function(){return this._center},Cn.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},Cn.padding.get=function(){return this._edgeInsets.toJSON()},Cn.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},Cn.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},wn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},wn.prototype.interpolatePadding=function(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()},wn.prototype.coveringZoomLevel=function(t){var e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)},wn.prototype.getVisibleUnwrappedCoordinates=function(e){var i=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new t.Point(0,0)),r=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),s=this.pointCoordinate(new t.Point(0,this.height)),a=Math.floor(Math.min(n.x,r.x,o.x,s.x)),l=Math.floor(Math.max(n.x,r.x,o.x,s.x)),c=a-1;c<=l+1;c++)0!==c&&i.push(new t.UnwrappedTileID(c,e));return i},wn.prototype.coveringTiles=function(e){var i=this.coveringZoomLevel(e),n=i;if(void 0!==e.minzoom&&i<e.minzoom)return[];void 0!==e.maxzoom&&i>e.maxzoom&&(i=e.maxzoom);var r=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,i),s=[o*r.x,o*r.y,0],a=_n.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,i),l=e.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(l=i);var c=function(t){return{aabb:new bn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}},u=[],h=[],d=i,p=e.reparseOverscaled?n:i;if(this._renderWorldCopies)for(var A=1;A<=3;A++)u.push(c(-A)),u.push(c(A));for(u.push(c(0));u.length>0;){var f=u.pop(),g=f.x,m=f.y,y=f.fullyVisible;if(!y){var v=f.aabb.intersects(a);if(0===v)continue;y=2===v}var _=f.aabb.distanceX(s),b=f.aabb.distanceY(s),x=Math.max(Math.abs(_),Math.abs(b));if(f.zoom===d||x>3+(1<<d-f.zoom)-2&&f.zoom>=l)h.push({tileID:new t.OverscaledTileID(f.zoom===d?p:f.zoom,f.wrap,f.zoom,g,m),distanceSq:t.sqrLen([s[0]-.5-g,s[1]-.5-m])});else for(var w=0;w<4;w++){var C=(g<<1)+w%2,B=(m<<1)+(w>>1);u.push({aabb:f.aabb.quadrant(w),zoom:f.zoom+1,x:C,y:B,wrap:f.wrap,fullyVisible:y})}}return h.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},wn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},Cn.unmodified.get=function(){return this._unmodified},wn.prototype.zoomScale=function(t){return Math.pow(2,t)},wn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},wn.prototype.project=function(e){var i=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(i)*this.worldSize)},wn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},Cn.point.get=function(){return this.project(this.center)},wn.prototype.setLocationAtPoint=function(e,i){var n=this.pointCoordinate(i),r=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(e),s=new t.MercatorCoordinate(o.x-(n.x-r.x),o.y-(n.y-r.y));this.center=this.coordinateLocation(s),this._renderWorldCopies&&(this.center=this.center.wrap())},wn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},wn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},wn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},wn.prototype.coordinateLocation=function(t){return t.toLngLat()},wn.prototype.pointCoordinate=function(e){var i=[e.x,e.y,0,1],n=[e.x,e.y,1,1];t.transformMat4(i,i,this.pixelMatrixInverse),t.transformMat4(n,n,this.pixelMatrixInverse);var r=i[3],o=n[3],s=i[1]/r,a=n[1]/o,l=i[2]/r,c=n[2]/o,u=l===c?0:(0-l)/(c-l);return new t.MercatorCoordinate(t.number(i[0]/r,n[0]/o,u)/this.worldSize,t.number(s,a,u)/this.worldSize)},wn.prototype.coordinatePoint=function(e){var i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix),new t.Point(i[0]/i[3],i[1]/i[3])},wn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},wn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},wn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},wn.prototype.calculatePosMatrix=function(e,i){void 0===i&&(i=!1);var n=e.key,r=i?this._alignedPosMatrixCache:this._posMatrixCache;if(r[n])return r[n];var o=e.canonical,s=this.worldSize/this.zoomScale(o.z),a=o.x+Math.pow(2,o.z)*e.wrap,l=t.identity(new Float64Array(16));return t.translate(l,l,[a*s,o.y*s,0]),t.scale(l,l,[s/t.EXTENT,s/t.EXTENT,1]),t.multiply(l,i?this.alignedProjMatrix:this.projMatrix,l),r[n]=new Float32Array(l),r[n]},wn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},wn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,i,n,r,o=-90,s=90,a=-180,l=180,c=this.size,u=this._unmodified;if(this.latRange){var h=this.latRange;o=t.mercatorYfromLat(h[1])*this.worldSize,e=(s=t.mercatorYfromLat(h[0])*this.worldSize)-o<c.y?c.y/(s-o):0}if(this.lngRange){var d=this.lngRange;a=t.mercatorXfromLng(d[0])*this.worldSize,i=(l=t.mercatorXfromLng(d[1])*this.worldSize)-a<c.x?c.x/(l-a):0}var p=this.point,A=Math.max(i||0,e||0);if(A)return this.center=this.unproject(new t.Point(i?(l+a)/2:p.x,e?(s+o)/2:p.y)),this.zoom+=this.scaleZoom(A),this._unmodified=u,void(this._constraining=!1);if(this.latRange){var f=p.y,g=c.y/2;f-g<o&&(r=o+g),f+g>s&&(r=s-g)}if(this.lngRange){var m=p.x,y=c.x/2;m-y<a&&(n=a+y),m+y>l&&(n=l-y)}void 0===n&&void 0===r||(this.center=this.unproject(new t.Point(void 0!==n?n:p.x,void 0!==r?r:p.y))),this._unmodified=u,this._constraining=!1}},wn.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var i=Math.PI/2+this._pitch,n=this._fov*(.5+e.y/this.height),r=Math.sin(n)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-i-n,.01,Math.PI-.01)),o=this.point,s=o.x,a=o.y,l=1.01*(Math.cos(Math.PI/2-this._pitch)*r+this.cameraToCenterDistance),c=this.height/50,u=new Float64Array(16);t.perspective(u,this._fov,this.width/this.height,c,l),u[8]=2*-e.x/this.width,u[9]=2*e.y/this.height,t.scale(u,u,[1,-1,1]),t.translate(u,u,[0,0,-this.cameraToCenterDistance]),t.rotateX(u,u,this._pitch),t.rotateZ(u,u,this.angle),t.translate(u,u,[-s,-a,0]),this.mercatorMatrix=t.scale([],u,[this.worldSize,this.worldSize,this.worldSize]),t.scale(u,u,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=u,this.invProjMatrix=t.invert([],this.projMatrix);var h=this.width%2/2,d=this.height%2/2,p=Math.cos(this.angle),A=Math.sin(this.angle),f=s-Math.round(s)+p*h+A*d,g=a-Math.round(a)+p*d+A*h,m=new Float64Array(u);if(t.translate(m,m,[f>.5?f-1:f,g>.5?g-1:g,0]),this.alignedProjMatrix=m,u=t.create(),t.scale(u,u,[this.width/2,-this.height/2,1]),t.translate(u,u,[1,-1,0]),this.labelPlaneMatrix=u,u=t.create(),t.scale(u,u,[1,-1,1]),t.translate(u,u,[-1,-1,0]),t.scale(u,u,[2/this.width,2/this.height,1]),this.glCoordMatrix=u,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(u=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=u,this._posMatrixCache={},this._alignedPosMatrixCache={}}},wn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=this.pointCoordinate(new t.Point(0,0)),i=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance},wn.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},wn.prototype.getCameraQueryGeometry=function(e){var i=this.getCameraPoint();if(1===e.length)return[e[0],i];for(var n=i.x,r=i.y,o=i.x,s=i.y,a=0,l=e;a<l.length;a+=1){var c=l[a];n=Math.min(n,c.x),r=Math.min(r,c.y),o=Math.max(o,c.x),s=Math.max(s,c.y)}return[new t.Point(n,r),new t.Point(o,r),new t.Point(o,s),new t.Point(n,s),new t.Point(n,r)]},Object.defineProperties(wn.prototype,Cn);var Bn=function(e){var i,n,r,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(i=this._updateHashUnthrottled.bind(this),n=!1,r=null,o=function(){r=null,n&&(i(),r=setTimeout(o,300),n=!1)},function(){return n=!0,r||o(),r})};Bn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},Bn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},Bn.prototype.getHashString=function(e){var i=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,r=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,r),s=Math.round(i.lng*o)/o,a=Math.round(i.lat*o)/o,l=this._map.getBearing(),c=this._map.getPitch(),u="";if(u+=e?"/"+s+"/"+a+"/"+n:n+"/"+a+"/"+s,(l||c)&&(u+="/"+Math.round(10*l)/10),c&&(u+="/"+Math.round(c)),this._hashName){var h=this._hashName,d=!1,p=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===h?(d=!0,e+"="+u):t})).filter((function(t){return t}));return d||p.push(h+"="+u),"#"+p.join("&")}return"#"+u},Bn.prototype._getCurrentHash=function(){var e,i=this,n=t.window.location.hash.replace("#","");return this._hashName?(n.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===i._hashName&&(e=t)})),(e&&e[1]||"").split("/")):n.split("/")},Bn.prototype._onHashChange=function(){var t=this._getCurrentHash();if(t.length>=3&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},Bn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(t){}};var En={linearity:.3,easing:t.bezier(0,0,.3,1)},Sn=t.extend({deceleration:2500,maxSpeed:1400},En),Tn=t.extend({deceleration:20,maxSpeed:1400},En),Mn=t.extend({deceleration:1e3,maxSpeed:360},En),In=t.extend({deceleration:1e3,maxSpeed:90},En),Pn=function(t){this._map=t,this.clear()};function Dn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Ln(e,i,n){var r=n.maxSpeed,o=n.linearity,s=n.deceleration,a=t.clamp(e*o/(i/1e3),-r,r),l=Math.abs(a)/(s*o);return{easing:n.easing,duration:1e3*l,amount:a*(l/2)}}Pn.prototype.clear=function(){this._inertiaBuffer=[]},Pn.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Pn.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,i=t.browser.now();e.length>0&&i-e[0].time>160;)e.shift()},Pn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var i={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},n=0,r=this._inertiaBuffer;n<r.length;n+=1){var o=r[n].settings;i.zoom+=o.zoomDelta||0,i.bearing+=o.bearingDelta||0,i.pitch+=o.pitchDelta||0,o.panDelta&&i.pan._add(o.panDelta),o.around&&(i.around=o.around),o.pinchAround&&(i.pinchAround=o.pinchAround)}var s=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,a={};if(i.pan.mag()){var l=Ln(i.pan.mag(),s,t.extend({},Sn,e||{}));a.offset=i.pan.mult(l.amount/i.pan.mag()),a.center=this._map.transform.center,Dn(a,l)}if(i.zoom){var c=Ln(i.zoom,s,Tn);a.zoom=this._map.transform.zoom+c.amount,Dn(a,c)}if(i.bearing){var u=Ln(i.bearing,s,Mn);a.bearing=this._map.transform.bearing+t.clamp(u.amount,-179,179),Dn(a,u)}if(i.pitch){var h=Ln(i.pitch,s,In);a.pitch=this._map.transform.pitch+h.amount,Dn(a,h)}if(a.zoom||a.bearing){var d=void 0===i.pinchAround?i.around:i.pinchAround;a.around=d?this._map.unproject(d):this._map.getCenter()}return this.clear(),t.extend(a,{noMoveStart:!0})}};var On=function(e){function n(n,r,o,s){void 0===s&&(s={});var a=i.mousePos(r.getCanvasContainer(),o),l=r.unproject(a);e.call(this,n,t.extend({point:a,lngLat:l,originalEvent:o},s)),this._defaultPrevented=!1,this.target=r}e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n;var r={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,r),n}(t.Event),Fn=function(e){function n(n,r,o){var s="touchend"===n?o.changedTouches:o.touches,a=i.touchPos(r.getCanvasContainer(),s),l=a.map((function(t){return r.unproject(t)})),c=a.reduce((function(t,e,i,n){return t.add(e.div(n.length))}),new t.Point(0,0)),u=r.unproject(c);e.call(this,n,{points:a,point:c,lngLats:l,lngLat:u,originalEvent:o}),this._defaultPrevented=!1}e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n;var r={defaultPrevented:{configurable:!0}};return n.prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(n.prototype,r),n}(t.Event),Rn=function(t){function e(e,i,n){t.call(this,e,{originalEvent:n}),this._defaultPrevented=!1}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;var i={defaultPrevented:{configurable:!0}};return e.prototype.preventDefault=function(){this._defaultPrevented=!0},i.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,i),e}(t.Event),kn=function(t,e){this._map=t,this._clickTolerance=e.clickTolerance};kn.prototype.reset=function(){delete this._mousedownPos},kn.prototype.wheel=function(t){return this._firePreventable(new Rn(t.type,this._map,t))},kn.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new On(t.type,this._map,t))},kn.prototype.mouseup=function(t){this._map.fire(new On(t.type,this._map,t))},kn.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new On(t.type,this._map,t))},kn.prototype.dblclick=function(t){return this._firePreventable(new On(t.type,this._map,t))},kn.prototype.mouseover=function(t){this._map.fire(new On(t.type,this._map,t))},kn.prototype.mouseout=function(t){this._map.fire(new On(t.type,this._map,t))},kn.prototype.touchstart=function(t){return this._firePreventable(new Fn(t.type,this._map,t))},kn.prototype.touchmove=function(t){this._map.fire(new Fn(t.type,this._map,t))},kn.prototype.touchend=function(t){this._map.fire(new Fn(t.type,this._map,t))},kn.prototype.touchcancel=function(t){this._map.fire(new Fn(t.type,this._map,t))},kn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},kn.prototype.isEnabled=function(){return!0},kn.prototype.isActive=function(){return!1},kn.prototype.enable=function(){},kn.prototype.disable=function(){};var zn=function(t){this._map=t};zn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},zn.prototype.mousemove=function(t){this._map.fire(new On(t.type,this._map,t))},zn.prototype.mousedown=function(){this._delayContextMenu=!0},zn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new On("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},zn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new On(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},zn.prototype.isEnabled=function(){return!0},zn.prototype.isActive=function(){return!1},zn.prototype.enable=function(){},zn.prototype.disable=function(){};var Un=function(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1};function Nn(t,e){for(var i={},n=0;n<t.length;n++)i[t[n].identifier]=e[n];return i}Un.prototype.isEnabled=function(){return!!this._enabled},Un.prototype.isActive=function(){return!!this._active},Un.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Un.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Un.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(i.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Un.prototype.mousemoveWindow=function(t,e){if(this._active){var n=e;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var r=this._startPos;this._lastPos=n,this._box||(this._box=i.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t));var o=Math.min(r.x,n.x),s=Math.max(r.x,n.x),a=Math.min(r.y,n.y),l=Math.max(r.y,n.y);i.setTransform(this._box,"translate("+o+"px,"+a+"px)"),this._box.style.width=s-o+"px",this._box.style.height=l-a+"px"}}},Un.prototype.mouseupWindow=function(e,n){var r=this;if(this._active&&0===e.button){var o=this._startPos,s=n;if(this.reset(),i.suppressClick(),o.x!==s.x||o.y!==s.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,s,r._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Un.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Un.prototype.blur=function(){this.reset()},Un.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(i.remove(this._box),this._box=null),i.enableDrag(),delete this._startPos,delete this._lastPos},Un.prototype._fireEvent=function(e,i){return this._map.fire(new t.Event(e,{originalEvent:i}))};var Gn=function(t){this.reset(),this.numTouches=t.numTouches};Gn.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Gn.prototype.touchstart=function(e,i,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),n.length===this.numTouches&&(this.centroid=function(e){for(var i=new t.Point(0,0),n=0,r=e;n<r.length;n+=1)i._add(r[n]);return i.div(e.length)}(i),this.touches=Nn(n,i)))},Gn.prototype.touchmove=function(t,e,i){if(!this.aborted&&this.centroid){var n=Nn(i,e);for(var r in this.touches){var o=n[r];(!o||o.dist(this.touches[r])>30)&&(this.aborted=!0)}}},Gn.prototype.touchend=function(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){var n=!this.aborted&&this.centroid;if(this.reset(),n)return n}};var Zn=function(t){this.singleTap=new Gn(t),this.numTaps=t.numTaps,this.reset()};Zn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Zn.prototype.touchstart=function(t,e,i){this.singleTap.touchstart(t,e,i)},Zn.prototype.touchmove=function(t,e,i){this.singleTap.touchmove(t,e,i)},Zn.prototype.touchend=function(t,e,i){var n=this.singleTap.touchend(t,e,i);if(n){var r=t.timeStamp-this.lastTime<500,o=!this.lastTap||this.lastTap.dist(n)<30;if(r&&o||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=n,this.count===this.numTaps)return this.reset(),n}};var jn=function(){this._zoomIn=new Zn({numTouches:1,numTaps:2}),this._zoomOut=new Zn({numTouches:2,numTaps:1}),this.reset()};jn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},jn.prototype.touchstart=function(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)},jn.prototype.touchmove=function(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)},jn.prototype.touchend=function(t,e,i){var n=this,r=this._zoomIn.touchend(t,e,i),o=this._zoomOut.touchend(t,e,i);return r?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(r)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return n.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},jn.prototype.touchcancel=function(){this.reset()},jn.prototype.enable=function(){this._enabled=!0},jn.prototype.disable=function(){this._enabled=!1,this.reset()},jn.prototype.isEnabled=function(){return this._enabled},jn.prototype.isActive=function(){return this._active};var Vn={0:1,2:2},Hn=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1};Hn.prototype.blur=function(){this.reset()},Hn.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Hn.prototype._correctButton=function(t,e){return!1},Hn.prototype._move=function(t,e){return{}},Hn.prototype.mousedown=function(t,e){if(!this._lastPoint){var n=i.mouseButton(t);this._correctButton(t,n)&&(this._lastPoint=e,this._eventButton=n)}},Hn.prototype.mousemoveWindow=function(t,e){var i=this._lastPoint;if(i)if(t.preventDefault(),function(t,e){var i=Vn[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton))this.reset();else if(this._moved||!(e.dist(i)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(i,e)},Hn.prototype.mouseupWindow=function(t){this._lastPoint&&i.mouseButton(t)===this._eventButton&&(this._moved&&i.suppressClick(),this.reset())},Hn.prototype.enable=function(){this._enabled=!0},Hn.prototype.disable=function(){this._enabled=!1,this.reset()},Hn.prototype.isEnabled=function(){return this._enabled},Hn.prototype.isActive=function(){return this._active};var Jn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.mousedown=function(e,i){t.prototype.mousedown.call(this,e,i),this._lastPoint&&(this._active=!0)},e.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},e.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},e}(Hn),Wn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var i=.8*(e.x-t.x);if(i)return this._active=!0,{bearingDelta:i}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Hn),Qn=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},e.prototype._move=function(t,e){var i=-.5*(e.y-t.y);if(i)return this._active=!0,{pitchDelta:i}},e.prototype.contextmenu=function(t){t.preventDefault()},e}(Hn),qn=function(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()};qn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},qn.prototype.touchstart=function(t,e,i){return this._calculateTransform(t,e,i)},qn.prototype.touchmove=function(t,e,i){if(this._active&&!(i.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,i)},qn.prototype.touchend=function(t,e,i){this._calculateTransform(t,e,i),this._active&&i.length<this._minTouches&&this.reset()},qn.prototype.touchcancel=function(){this.reset()},qn.prototype._calculateTransform=function(e,i,n){n.length>0&&(this._active=!0);var r=Nn(n,i),o=new t.Point(0,0),s=new t.Point(0,0),a=0;for(var l in r){var c=r[l],u=this._touches[l];u&&(o._add(c),s._add(c.sub(u)),a++,r[l]=c)}if(this._touches=r,!(a<this._minTouches)&&s.mag()){var h=s.div(a);if(this._sum._add(h),!(this._sum.mag()<this._clickTolerance))return{around:o.div(a),panDelta:h}}},qn.prototype.enable=function(){this._enabled=!0},qn.prototype.disable=function(){this._enabled=!1,this.reset()},qn.prototype.isEnabled=function(){return this._enabled},qn.prototype.isActive=function(){return this._active};var Kn=function(){this.reset()};function Xn(t,e,i){for(var n=0;n<t.length;n++)if(t[n].identifier===i)return e[n]}function Yn(t,e){return Math.log(t/e)/Math.LN2}Kn.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Kn.prototype._start=function(t){},Kn.prototype._move=function(t,e,i){return{}},Kn.prototype.touchstart=function(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))},Kn.prototype.touchmove=function(t,e,i){if(this._firstTwoTouches){t.preventDefault();var n=this._firstTwoTouches,r=n[1],o=Xn(i,e,n[0]),s=Xn(i,e,r);if(o&&s){var a=this._aroundCenter?null:o.add(s).div(2);return this._move([o,s],a,t)}}},Kn.prototype.touchend=function(t,e,n){if(this._firstTwoTouches){var r=this._firstTwoTouches,o=r[1],s=Xn(n,e,r[0]),a=Xn(n,e,o);s&&a||(this._active&&i.suppressClick(),this.reset())}},Kn.prototype.touchcancel=function(){this.reset()},Kn.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Kn.prototype.disable=function(){this._enabled=!1,this.reset()},Kn.prototype.isEnabled=function(){return this._enabled},Kn.prototype.isActive=function(){return this._active};var $n=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._distance,delete this._startDistance},e.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},e.prototype._move=function(t,e){var i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Yn(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Yn(this._distance,i),pinchAround:e}},e}(Kn);function tr(t,e){return 180*t.angleWith(e)/Math.PI}var er=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},e.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},e.prototype._move=function(t,e){var i=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:tr(this._vector,i),pinchAround:e}},e.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360,i=tr(t,this._startVector);return Math.abs(i)<e},e}(Kn);function ir(t){return Math.abs(t.y)>Math.abs(t.x)}var nr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e.prototype.reset=function(){t.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},e.prototype._start=function(t){this._lastPoints=t,ir(t[0].sub(t[1]))&&(this._valid=!1)},e.prototype._move=function(t,e,i){var n=t[0].sub(this._lastPoints[0]),r=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(n,r,i.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(n.y+r.y)/2*-.5}},e.prototype.gestureBeginsVertically=function(t,e,i){if(void 0!==this._valid)return this._valid;var n=t.mag()>=2,r=e.mag()>=2;if(n||r){if(!n||!r)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;var o=t.y>0==e.y>0;return ir(t)&&ir(e)&&o}},e}(Kn),rr={panStep:100,bearingStep:15,pitchStep:10},or=function(){var t=rr;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1};function sr(t){return t*(2-t)}or.prototype.blur=function(){this.reset()},or.prototype.reset=function(){this._active=!1},or.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var i=0,n=0,r=0,o=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:i=1;break;case 189:case 109:case 173:i=-1;break;case 37:t.shiftKey?n=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?n=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),s=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(n=0,r=0),{cameraAnimation:function(a){var l=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:sr,zoom:i?Math.round(l)+i*(t.shiftKey?2:1):l,bearing:a.getBearing()+n*e._bearingStep,pitch:a.getPitch()+r*e._pitchStep,offset:[-o*e._panStep,-s*e._panStep],center:a.getCenter()},{originalEvent:t})}}}},or.prototype.enable=function(){this._enabled=!0},or.prototype.disable=function(){this._enabled=!1,this.reset()},or.prototype.isEnabled=function(){return this._enabled},or.prototype.isActive=function(){return this._active},or.prototype.disableRotation=function(){this._rotationDisabled=!0},or.prototype.enableRotation=function(){this._rotationDisabled=!1};var ar=function(e,i){this._map=e,this._el=e.getCanvasContainer(),this._handler=i,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)};ar.prototype.setZoomRate=function(t){this._defaultZoomRate=t},ar.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},ar.prototype.isEnabled=function(){return!!this._enabled},ar.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},ar.prototype.isZooming=function(){return!!this._zooming},ar.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},ar.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ar.prototype.wheel=function(e){if(this.isEnabled()){var i=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=t.browser.now(),r=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,0!==i&&i%4.000244140625==0?this._type="wheel":0!==i&&Math.abs(i)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=i,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(r*i)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,i+=this._lastValue)),e.shiftKey&&i&&(i/=4),this._type&&(this._lastWheelEvent=e,this._delta-=i,this._active||this._start(e)),e.preventDefault()}},ar.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},ar.prototype._start=function(e){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var n=i.mousePos(this._el,e);this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(n)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ar.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var i=this._map.transform;if(0!==this._delta){var n="wheel"===this._type&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,r=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&0!==r&&(r=1/r);var o="number"==typeof this._targetZoom?i.zoomScale(this._targetZoom):i.scale;this._targetZoom=Math.min(i.maxZoom,Math.max(i.minZoom,i.scaleZoom(o*r))),"wheel"===this._type&&(this._startZoom=i.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var s,a="number"==typeof this._targetZoom?this._targetZoom:i.zoom,l=this._startZoom,c=this._easing,u=!1;if("wheel"===this._type&&l&&c){var h=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1),d=c(h);s=t.number(l,a,d),h<1?this._frameId||(this._frameId=!0):u=!0}else s=a,u=!0;return this._active=!0,u&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!u,zoomDelta:s-i.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ar.prototype._smoothOutEasing=function(e){var i=t.ease;if(this._prevEase){var n=this._prevEase,r=(t.browser.now()-n.start)/n.duration,o=n.easing(r+.01)-n.easing(r),s=.27/Math.sqrt(o*o+1e-4)*.01,a=Math.sqrt(.0729-s*s);i=t.bezier(s,a,.25,1)}return this._prevEase={start:t.browser.now(),duration:e,easing:i},i},ar.prototype.blur=function(){this.reset()},ar.prototype.reset=function(){this._active=!1};var lr=function(t,e){this._clickZoom=t,this._tapZoom=e};lr.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},lr.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},lr.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},lr.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var cr=function(){this.reset()};cr.prototype.reset=function(){this._active=!1},cr.prototype.blur=function(){this.reset()},cr.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(i){i.easeTo({duration:300,zoom:i.getZoom()+(t.shiftKey?-1:1),around:i.unproject(e)},{originalEvent:t})}}},cr.prototype.enable=function(){this._enabled=!0},cr.prototype.disable=function(){this._enabled=!1,this.reset()},cr.prototype.isEnabled=function(){return this._enabled},cr.prototype.isActive=function(){return this._active};var ur=function(){this._tap=new Zn({numTouches:1,numTaps:1}),this.reset()};ur.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},ur.prototype.touchstart=function(t,e,i){this._swipePoint||(this._tapTime&&t.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?i.length>0&&(this._swipePoint=e[0],this._swipeTouch=i[0].identifier):this._tap.touchstart(t,e,i))},ur.prototype.touchmove=function(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;var n=e[0],r=n.y-this._swipePoint.y;return this._swipePoint=n,t.preventDefault(),this._active=!0,{zoomDelta:r/128}}}else this._tap.touchmove(t,e,i)},ur.prototype.touchend=function(t,e,i){this._tapTime?this._swipePoint&&0===i.length&&this.reset():this._tap.touchend(t,e,i)&&(this._tapTime=t.timeStamp)},ur.prototype.touchcancel=function(){this.reset()},ur.prototype.enable=function(){this._enabled=!0},ur.prototype.disable=function(){this._enabled=!1,this.reset()},ur.prototype.isEnabled=function(){return this._enabled},ur.prototype.isActive=function(){return this._active};var hr=function(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i};hr.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},hr.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},hr.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},hr.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var dr=function(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i};dr.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},dr.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},dr.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},dr.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var pr=function(t,e,i,n){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=n,this._rotationDisabled=!1,this._enabled=!0};pr.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},pr.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},pr.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},pr.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},pr.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},pr.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Ar=function(t){return t.zoom||t.drag||t.pitch||t.rotate},fr=function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e,e}(t.Event);function gr(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}var mr=function(e,n){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Pn(e),this._bearingSnap=n.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(n),t.bindAll(["handleEvent","handleWindowEvent"],this);var r=this._el;this._listeners=[[r,"touchstart",{passive:!0}],[r,"touchmove",{passive:!1}],[r,"touchend",void 0],[r,"touchcancel",void 0],[r,"mousedown",void 0],[r,"mousemove",void 0],[r,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[r,"mouseover",void 0],[r,"mouseout",void 0],[r,"dblclick",void 0],[r,"click",void 0],[r,"keydown",{capture:!1}],[r,"keyup",void 0],[r,"wheel",{passive:!1}],[r,"contextmenu",void 0],[t.window,"blur",void 0]];for(var o=0,s=this._listeners;o<s.length;o+=1){var a=s[o],l=a[0];i.addEventListener(l,a[1],l===t.window.document?this.handleWindowEvent:this.handleEvent,a[2])}};mr.prototype.destroy=function(){for(var e=0,n=this._listeners;e<n.length;e+=1){var r=n[e],o=r[0];i.removeEventListener(o,r[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,r[2])}},mr.prototype._addDefaultHandlers=function(t){var e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new kn(e,t));var n=e.boxZoom=new Un(e,t);this._add("boxZoom",n);var r=new jn,o=new cr;e.doubleClickZoom=new lr(o,r),this._add("tapZoom",r),this._add("clickZoom",o);var s=new ur;this._add("tapDragZoom",s);var a=e.touchPitch=new nr;this._add("touchPitch",a);var l=new Wn(t),c=new Qn(t);e.dragRotate=new dr(t,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);var u=new Jn(t),h=new qn(t);e.dragPan=new hr(i,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);var d=new er,p=new $n;e.touchZoomRotate=new pr(i,p,d,s),this._add("touchRotate",d,["touchPan","touchZoom"]),this._add("touchZoom",p,["touchPan","touchRotate"]);var A=e.scrollZoom=new ar(e,this);this._add("scrollZoom",A,["mousePan"]);var f=e.keyboard=new or;this._add("keyboard",f),this._add("blockableMapEvent",new zn(e));for(var g=0,m=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];g<m.length;g+=1){var y=m[g];t.interactive&&t[y]&&e[y].enable(t[y])}},mr.prototype._add=function(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e},mr.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,i=this._handlers;e<i.length;e+=1)i[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},mr.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},mr.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},mr.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},mr.prototype.isMoving=function(){return Boolean(Ar(this._eventsInProgress))||this.isZooming()},mr.prototype._blockedByActive=function(t,e,i){for(var n in t)if(n!==i&&(!e||e.indexOf(n)<0))return!0;return!1},mr.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},mr.prototype._getMapTouches=function(t){for(var e=[],i=0,n=t;i<n.length;i+=1){var r=n[i];this._el.contains(r.target)&&e.push(r)}return e},mr.prototype.handleEvent=function(t,e){this._updatingCamera=!0;for(var n="renderFrame"===t.type?void 0:t,r={needsRenderFrame:!1},o={},s={},a=t.touches?this._getMapTouches(t.touches):void 0,l=a?i.touchPos(this._el,a):i.mousePos(this._el,t),c=0,u=this._handlers;c<u.length;c+=1){var h=u[c],d=h.handlerName,p=h.handler,A=h.allowed;if(p.isEnabled()){var f=void 0;this._blockedByActive(s,A,d)?p.reset():p[e||t.type]&&(f=p[e||t.type](t,l,a),this.mergeHandlerResult(r,o,f,d,n),f&&f.needsRenderFrame&&this._triggerRenderFrame()),(f||p.isActive())&&(s[d]=p)}}var g={};for(var m in this._previousActiveHandlers)s[m]||(g[m]=n);this._previousActiveHandlers=s,(Object.keys(g).length||gr(r))&&(this._changes.push([r,o,g]),this._triggerRenderFrame()),(Object.keys(s).length||gr(r))&&this._map._stop(!0),this._updatingCamera=!1;var y=r.cameraAnimation;y&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],y(this._map))},mr.prototype.mergeHandlerResult=function(e,i,n,r,o){if(n){t.extend(e,n);var s={handlerName:r,originalEvent:n.originalEvent||o};void 0!==n.zoomDelta&&(i.zoom=s),void 0!==n.panDelta&&(i.drag=s),void 0!==n.pitchDelta&&(i.pitch=s),void 0!==n.bearingDelta&&(i.rotate=s)}},mr.prototype._applyChanges=function(){for(var e={},i={},n={},r=0,o=this._changes;r<o.length;r+=1){var s=o[r],a=s[0],l=s[1],c=s[2];a.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(a.panDelta)),a.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+a.pitchDelta),void 0!==a.around&&(e.around=a.around),void 0!==a.pinchAround&&(e.pinchAround=a.pinchAround),a.noInertia&&(e.noInertia=a.noInertia),t.extend(i,l),t.extend(n,c)}this._updateMapTransform(e,i,n),this._changes=[]},mr.prototype._updateMapTransform=function(t,e,i){var n=this._map,r=n.transform;if(!gr(t))return this._fireEvents(e,i,!0);var o=t.panDelta,s=t.zoomDelta,a=t.bearingDelta,l=t.pitchDelta,c=t.around,u=t.pinchAround;void 0!==u&&(c=u),n._stop(!0),c=c||n.transform.centerPoint;var h=r.pointLocation(o?c.sub(o):c);a&&(r.bearing+=a),l&&(r.pitch+=l),s&&(r.zoom+=s),r.setLocationAtPoint(h,c),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)},mr.prototype._fireEvents=function(e,i,n){var r=this,o=Ar(this._eventsInProgress),s=Ar(e),a={};for(var l in e)this._eventsInProgress[l]||(a[l+"start"]=e[l].originalEvent),this._eventsInProgress[l]=e[l];for(var c in!o&&s&&this._fireEvent("movestart",s.originalEvent),a)this._fireEvent(c,a[c]);for(var u in s&&this._fireEvent("move",s.originalEvent),e)this._fireEvent(u,e[u].originalEvent);var h,d={};for(var p in this._eventsInProgress){var A=this._eventsInProgress[p],f=A.handlerName,g=A.originalEvent;this._handlersById[f].isActive()||(delete this._eventsInProgress[p],d[p+"end"]=h=i[f]||g)}for(var m in d)this._fireEvent(m,d[m]);var y=Ar(this._eventsInProgress);if(n&&(o||s)&&!y){this._updatingCamera=!0;var v=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),_=function(t){return 0!==t&&-r._bearingSnap<t&&t<r._bearingSnap};v?(_(v.bearing||this._map.getBearing())&&(v.bearing=0),this._map.easeTo(v,{originalEvent:h})):(this._map.fire(new t.Event("moveend",{originalEvent:h})),_(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},mr.prototype._fireEvent=function(e,i){this._map.fire(new t.Event(e,i?{originalEvent:i}:{}))},mr.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new fr("renderFrame",{timeStamp:e})),t._applyChanges()}))},mr.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var yr=function(e){function i(i,n){e.call(this),this._moving=!1,this._zooming=!1,this.transform=i,this._bearingSnap=n.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}return e&&(i.__proto__=e),(i.prototype=Object.create(e&&e.prototype)).constructor=i,i.prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},i.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},i.prototype.panBy=function(e,i,n){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},i),n)},i.prototype.panTo=function(e,i,n){return this.easeTo(t.extend({center:e},i),n)},i.prototype.getZoom=function(){return this.transform.zoom},i.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},i.prototype.zoomTo=function(e,i,n){return this.easeTo(t.extend({zoom:e},i),n)},i.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},i.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},i.prototype.getBearing=function(){return this.transform.bearing},i.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},i.prototype.getPadding=function(){return this.transform.padding},i.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},i.prototype.rotateTo=function(e,i,n){return this.easeTo(t.extend({bearing:e},i),n)},i.prototype.resetNorth=function(e,i){return this.rotateTo(0,t.extend({duration:1e3},e),i),this},i.prototype.resetNorthPitch=function(e,i){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),i),this},i.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},i.prototype.getPitch=function(){return this.transform.pitch},i.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},i.prototype.cameraForBounds=function(e,i){e=t.LngLatBounds.convert(e);var n=i&&i.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),n,i)},i.prototype._cameraForBoxAndBearing=function(e,i,n,r){var o={top:0,bottom:0,right:0,left:0};if("number"==typeof(r=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},r)).padding){var s=r.padding;r.padding={top:s,bottom:s,right:s,left:s}}r.padding=t.extend(o,r.padding);var a=this.transform,l=a.padding,c=a.project(t.LngLat.convert(e)),u=a.project(t.LngLat.convert(i)),h=c.rotate(-n*Math.PI/180),d=u.rotate(-n*Math.PI/180),p=new t.Point(Math.max(h.x,d.x),Math.max(h.y,d.y)),A=new t.Point(Math.min(h.x,d.x),Math.min(h.y,d.y)),f=p.sub(A),g=(a.width-(l.left+l.right+r.padding.left+r.padding.right))/f.x,m=(a.height-(l.top+l.bottom+r.padding.top+r.padding.bottom))/f.y;if(!(m<0||g<0)){var y=Math.min(a.scaleZoom(a.scale*Math.min(g,m)),r.maxZoom),v="number"==typeof r.offset.x?new t.Point(r.offset.x,r.offset.y):t.Point.convert(r.offset),_=new t.Point((r.padding.left-r.padding.right)/2,(r.padding.top-r.padding.bottom)/2).rotate(n*Math.PI/180),b=v.add(_).mult(a.scale/a.zoomScale(y));return{center:a.unproject(c.add(u).div(2).sub(b)),zoom:y,bearing:n}}t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},i.prototype.fitBounds=function(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)},i.prototype.fitScreenCoordinates=function(e,i,n,r,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(i)),n,r),r,o)},i.prototype._fitInternal=function(e,i,n){return e?(delete(i=t.extend(e,i)).padding,i.linear?this.easeTo(i,n):this.flyTo(i,n)):this},i.prototype.jumpTo=function(e,i){this.stop();var n=this.transform,r=!1,o=!1,s=!1;return"zoom"in e&&n.zoom!==+e.zoom&&(r=!0,n.zoom=+e.zoom),void 0!==e.center&&(n.center=t.LngLat.convert(e.center)),"bearing"in e&&n.bearing!==+e.bearing&&(o=!0,n.bearing=+e.bearing),"pitch"in e&&n.pitch!==+e.pitch&&(s=!0,n.pitch=+e.pitch),null==e.padding||n.isPaddingEqual(e.padding)||(n.padding=e.padding),this.fire(new t.Event("movestart",i)).fire(new t.Event("move",i)),r&&this.fire(new t.Event("zoomstart",i)).fire(new t.Event("zoom",i)).fire(new t.Event("zoomend",i)),o&&this.fire(new t.Event("rotatestart",i)).fire(new t.Event("rotate",i)).fire(new t.Event("rotateend",i)),s&&this.fire(new t.Event("pitchstart",i)).fire(new t.Event("pitch",i)).fire(new t.Event("pitchend",i)),this.fire(new t.Event("moveend",i))},i.prototype.easeTo=function(e,i){var n=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var r=this.transform,o=this.getZoom(),s=this.getBearing(),a=this.getPitch(),l=this.getPadding(),c="zoom"in e?+e.zoom:o,u="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:a,d="padding"in e?e.padding:r.padding,p=t.Point.convert(e.offset),A=r.centerPoint.add(p),f=r.pointLocation(A),g=t.LngLat.convert(e.center||f);this._normalizeCenter(g);var m,y,v=r.project(f),_=r.project(g).sub(v),b=r.zoomScale(c-o);e.around&&(m=t.LngLat.convert(e.around),y=r.locationPoint(m));var x={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||c!==o,this._rotating=this._rotating||s!==u,this._pitching=this._pitching||h!==a,this._padding=!r.isPaddingEqual(d),this._easeId=e.easeId,this._prepareEase(i,e.noMoveStart,x),this._ease((function(e){if(n._zooming&&(r.zoom=t.number(o,c,e)),n._rotating&&(r.bearing=t.number(s,u,e)),n._pitching&&(r.pitch=t.number(a,h,e)),n._padding&&(r.interpolatePadding(l,d,e),A=r.centerPoint.add(p)),m)r.setLocationAtPoint(m,y);else{var f=r.zoomScale(r.zoom-o),g=c>o?Math.min(2,b):Math.max(.5,b),x=Math.pow(g,1-e),w=r.unproject(v.add(_.mult(e*x)).mult(f));r.setLocationAtPoint(r.renderWorldCopies?w.wrap():w,A)}n._fireMoveEvents(i)}),(function(t){n._afterEase(i,t)}),e),this},i.prototype._prepareEase=function(e,i,n){void 0===n&&(n={}),this._moving=!0,i||n.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!n.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!n.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!n.pitching&&this.fire(new t.Event("pitchstart",e))},i.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},i.prototype._afterEase=function(e,i){if(!this._easeId||!i||this._easeId!==i){delete this._easeId;var n=this._zooming,r=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,n&&this.fire(new t.Event("zoomend",e)),r&&this.fire(new t.Event("rotateend",e)),o&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e))}},i.prototype.flyTo=function(e,i){var n=this;if(!e.essential&&t.browser.prefersReducedMotion){var r=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,i)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,s=this.getZoom(),a=this.getBearing(),l=this.getPitch(),c=this.getPadding(),u="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):s,h="bearing"in e?this._normalizeBearing(e.bearing,a):a,d="pitch"in e?+e.pitch:l,p="padding"in e?e.padding:o.padding,A=o.zoomScale(u-s),f=t.Point.convert(e.offset),g=o.centerPoint.add(f),m=o.pointLocation(g),y=t.LngLat.convert(e.center||m);this._normalizeCenter(y);var v=o.project(m),_=o.project(y).sub(v),b=e.curve,x=Math.max(o.width,o.height),w=x/A,C=_.mag();if("minZoom"in e){var B=t.clamp(Math.min(e.minZoom,s,u),o.minZoom,o.maxZoom),E=x/o.zoomScale(B-s);b=Math.sqrt(E/C*2)}var S=b*b;function T(t){var e=(w*w-x*x+(t?-1:1)*S*S*C*C)/(2*(t?w:x)*S*C);return Math.log(Math.sqrt(e*e+1)-e)}function M(t){return(Math.exp(t)-Math.exp(-t))/2}function I(t){return(Math.exp(t)+Math.exp(-t))/2}var P=T(0),D=function(t){return I(P)/I(P+b*t)},L=function(t){return x*((I(P)*(M(e=P+b*t)/I(e))-M(P))/S)/C;var e},O=(T(1)-P)/b;if(Math.abs(C)<1e-6||!isFinite(O)){if(Math.abs(x-w)<1e-6)return this.easeTo(e,i);var F=w<x?-1:1;O=Math.abs(Math.log(w/x))/b,L=function(){return 0},D=function(t){return Math.exp(F*b*t)}}return e.duration="duration"in e?+e.duration:1e3*O/("screenSpeed"in e?+e.screenSpeed/b:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=a!==h,this._pitching=d!==l,this._padding=!o.isPaddingEqual(p),this._prepareEase(i,!1),this._ease((function(e){var r=e*O,A=1/D(r);o.zoom=1===e?u:s+o.scaleZoom(A),n._rotating&&(o.bearing=t.number(a,h,e)),n._pitching&&(o.pitch=t.number(l,d,e)),n._padding&&(o.interpolatePadding(c,p,e),g=o.centerPoint.add(f));var m=1===e?y:o.unproject(v.add(_.mult(L(r))).mult(A));o.setLocationAtPoint(o.renderWorldCopies?m.wrap():m,g),n._fireMoveEvents(i)}),(function(){return n._afterEase(i)}),e),this},i.prototype.isEasing=function(){return!!this._easeFrameId},i.prototype.stop=function(){return this._stop()},i.prototype._stop=function(t,e){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var i=this._onEaseEnd;delete this._onEaseEnd,i.call(this,e)}if(!t){var n=this.handlers;n&&n.stop(!1)}return this},i.prototype._ease=function(e,i,n){!1===n.animate||0===n.duration?(e(1),i()):(this._easeStart=t.browser.now(),this._easeOptions=n,this._onEaseFrame=e,this._onEaseEnd=i,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},i.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},i.prototype._normalizeBearing=function(e,i){e=t.wrap(e,-180,180);var n=Math.abs(e-i);return Math.abs(e-360-i)<n&&(e-=360),Math.abs(e+360-i)<n&&(e+=360),e},i.prototype._normalizeCenter=function(t){var e=this.transform;if(e.renderWorldCopies&&!e.lngRange){var i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}},i}(t.Evented),vr=function(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};vr.prototype.getDefaultPosition=function(){return"bottom-right"},vr.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=i.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=i.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},vr.prototype.onRemove=function(){i.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},vr.prototype._setElementTitle=function(t,e){var i=this._map._getUIString("AttributionControl."+e);t.title=i,t.setAttribute("aria-label",i)},vr.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","fal
2se")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},vr.prototype._updateEditLink=function(){var e=this._editLink;e||(e=this._editLink=this._container.querySelector(".mapbox-improve-map"));var i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];if(e){var n=i.reduce((function(t,e,n){return e.value&&(t+=e.key+"="+e.value+(n<i.length-1?"&":"")),t}),"?");e.href=t.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),e.rel="noopener nofollow",this._setElementTitle(e,"MapFeedback")}},vr.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},vr.prototype._updateAttributions=function(){if(this._map.style){var t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){var e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}var i=this._map.style.sourceCaches;for(var n in i){var r=i[n];if(r.used){var o=r.getSource();o.attribution&&t.indexOf(o.attribution)<0&&t.push(o.attribution)}}t.sort((function(t,e){return t.length-e.length}));var s=(t=t.filter((function(e,i){for(var n=i+1;n<t.length;n++)if(t[n].indexOf(e)>=0)return!1;return!0}))).join(" | ");s!==this._attribHTML&&(this._attribHTML=s,t.length?(this._innerContainer.innerHTML=s,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},vr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var _r=function(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)};_r.prototype.onAdd=function(t){this._map=t,this._container=i.create("div","mapboxgl-ctrl");var e=i.create("a","mapboxgl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://www.mapbox.com/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},_r.prototype.onRemove=function(){i.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},_r.prototype.getDefaultPosition=function(){return"bottom-left"},_r.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},_r.prototype._logoRequired=function(){if(this._map.style){var t=this._map.style.sourceCaches;for(var e in t)if(t[e].getSource().mapbox_logo)return!0;return!1}},_r.prototype._updateCompact=function(){var t=this._container.children;if(t.length){var e=t[0];this._map.getCanvasContainer().offsetWidth<250?e.classList.add("mapboxgl-compact"):e.classList.remove("mapboxgl-compact")}};var br=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};br.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},br.prototype.remove=function(t){for(var e=this._currentlyRunning,i=0,n=e?this._queue.concat(e):this._queue;i<n.length;i+=1){var r=n[i];if(r.id===t)return void(r.cancelled=!0)}},br.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var i=0,n=e;i<n.length;i+=1){var r=n[i];if(!r.cancelled&&(r.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},br.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var xr={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},wr=t.window.HTMLImageElement,Cr=t.window.HTMLElement,Br=t.window.ImageBitmap,Er={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileC
vendor: 41,265 bytes, line 2
2acheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},Sr=function(n){function r(e){var i=this;if(null!=(e=t.extend({},Er,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&e.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var r=new wn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(n.call(this,r,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new br,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},xr,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Cr))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return i._update(!1)})),this.on("moveend",(function(){return i._update(!1)})),this.on("zoom",(function(){return i._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new mr(this,e),this._hash=e.hash&&new Bn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new vr({customAttribution:e.customAttribution})),this.addControl(new _r,e.logoPosition),this.on("style.load",(function(){i.transform.unmodified&&i.jumpTo(i.style.stylesheet)})),this.on("data",(function(e){i._update("style"===e.dataType),i.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){i.fire(new t.Event(e.dataType+"dataloading",e))}))}n&&(r.__proto__=n),(r.prototype=Object.create(n&&n.prototype)).constructor=r;var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return r.prototype._getMapId=function(){return this._mapId},r.prototype.addControl=function(e,i){if(void 0===i&&(i=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var n=e.onAdd(this);this._controls.push(e);var r=this._controlPositions[i];return-1!==i.indexOf("bottom")?r.insertBefore(n,r.firstChild):r.appendChild(n),this},r.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var i=this._controls.indexOf(e);return i>-1&&this._controls.splice(i,1),e.onRemove(this),this},r.prototype.hasControl=function(t){return this._controls.indexOf(t)>-1},r.prototype.resize=function(e){var i=this._containerDimensions(),n=i[0],r=i[1];if(n===this.transform.width&&r===this.transform.height)return this;this._resizeCanvas(n,r),this.transform.resize(n,r),this.painter.resize(n,r);var o=!this._moving;return o&&this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e)),this.fire(new t.Event("resize",e)),o&&this.fire(new t.Event("moveend",e)),this},r.prototype.getBounds=function(){return this.transform.getBounds()},r.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},r.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},r.prototype.setMinZoom=function(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},r.prototype.getMinZoom=function(){return this.transform.minZoom},r.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},r.prototype.getMaxZoom=function(){return this.transform.maxZoom},r.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},r.prototype.getMinPitch=function(){return this.transform.minPitch},r.prototype.setMaxPitch=function(t){if((t=null==t?60:t)>60)throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},r.prototype.getMaxPitch=function(){return this.transform.maxPitch},r.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},r.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},r.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},r.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},r.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},r.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},r.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},r.prototype._createDelegatedListener=function(t,e,i){var n,r=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:i,delegates:{mousemove:function(n){var s=r.getLayer(e)?r.queryRenderedFeatures(n.point,{layers:[e]}):[];s.length?o||(o=!0,i.call(r,new On(t,r,n.originalEvent,{features:s}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"===t||"mouseout"===t){var s=!1;return{layer:e,listener:i,delegates:{mousemove:function(n){(r.getLayer(e)?r.queryRenderedFeatures(n.point,{layers:[e]}):[]).length?s=!0:s&&(s=!1,i.call(r,new On(t,r,n.originalEvent)))},mouseout:function(e){s&&(s=!1,i.call(r,new On(t,r,e.originalEvent)))}}}}return{layer:e,listener:i,delegates:(n={},n[t]=function(t){var n=r.getLayer(e)?r.queryRenderedFeatures(t.point,{layers:[e]}):[];n.length&&(t.features=n,i.call(r,t),delete t.features)},n)}},r.prototype.on=function(t,e,i){if(void 0===i)return n.prototype.on.call(this,t,e);var r=this._createDelegatedListener(t,e,i);for(var o in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(r),r.delegates)this.on(o,r.delegates[o]);return this},r.prototype.once=function(t,e,i){if(void 0===i)return n.prototype.once.call(this,t,e);var r=this._createDelegatedListener(t,e,i);for(var o in r.delegates)this.once(o,r.delegates[o]);return this},r.prototype.off=function(t,e,i){var r=this;return void 0===i?n.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(n){for(var o=n[t],s=0;s<o.length;s++){var a=o[s];if(a.layer===e&&a.listener===i){for(var l in a.delegates)r.off(l,a.delegates[l]);return o.splice(s,1),r}}}(this._delegatedListeners),this)},r.prototype.queryRenderedFeatures=function(e,i){if(!this.style)return[];var n;if(void 0!==i||void 0===e||e instanceof t.Point||Array.isArray(e)||(i=e,e=void 0),i=i||{},(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0])n=[t.Point.convert(e)];else{var r=t.Point.convert(e[0]),o=t.Point.convert(e[1]);n=[r,new t.Point(o.x,r.y),o,new t.Point(r.x,o.y),r]}return this.style.queryRenderedFeatures(n,i,this.transform)},r.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},r.prototype.setStyle=function(e,i){return!1!==(i=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(e,i))},r.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},r.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new je(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t),this):(delete this.style,this)},r.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new je(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},r.prototype._diffStyle=function(e,i){var n=this;if("string"==typeof e){var r=this._requestManager.normalizeStyleURL(e),o=this._requestManager.transformRequest(r,t.ResourceType.Style);t.getJSON(o,(function(e,r){e?n.fire(new t.ErrorEvent(e)):r&&n._updateDiff(r,i)}))}else"object"==typeof e&&this._updateDiff(e,i)},r.prototype._updateDiff=function(e,i){try{this.style.setState(e)&&this._update(!0)}catch(n){t.warnOnce("Unable to perform style diff: "+(n.message||n.error||n)+".  Rebuilding the style from scratch."),this._updateStyle(e,i)}},r.prototype.getStyle=function(){if(this.style)return this.style.serialize()},r.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},r.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},r.prototype.isSourceLoaded=function(e){var i=this.style&&this.style.sourceCaches[e];if(void 0!==i)return i.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},r.prototype.areTilesLoaded=function(){var t=this.style&&this.style.sourceCaches;for(var e in t){var i=t[e]._tiles;for(var n in i){var r=i[n];if("loaded"!==r.state&&"errored"!==r.state)return!1}}return!0},r.prototype.addSourceType=function(t,e,i){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,i)},r.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},r.prototype.getSource=function(t){return this.style.getSource(t)},r.prototype.addImage=function(e,i,n){void 0===n&&(n={});var r=n.pixelRatio;void 0===r&&(r=1);var o=n.sdf;void 0===o&&(o=!1);var s=n.stretchX,a=n.stretchY,l=n.content;if(this._lazyInitEmptyStyle(),i instanceof wr||Br&&i instanceof Br){var c=t.browser.getImageData(i);this.style.addImage(e,{data:new t.RGBAImage({width:c.width,height:c.height},c.data),pixelRatio:r,stretchX:s,stretchY:a,content:l,sdf:o,version:0})}else{if(void 0===i.width||void 0===i.height)return this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var u=i;this.style.addImage(e,{data:new t.RGBAImage({width:i.width,height:i.height},new Uint8Array(i.data)),pixelRatio:r,stretchX:s,stretchY:a,content:l,sdf:o,version:0,userImage:u}),u.onAdd&&u.onAdd(this,e)}},r.prototype.updateImage=function(e,i){var n=this.style.getImage(e);if(!n)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var r=i instanceof wr||Br&&i instanceof Br?t.browser.getImageData(i):i,o=r.width,s=r.height,a=r.data;return void 0===o||void 0===s?this.fire(new t.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):o!==n.data.width||s!==n.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(n.data.replace(a,!(i instanceof wr||Br&&i instanceof Br)),void this.style.updateImage(e,n))},r.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},r.prototype.removeImage=function(t){this.style.removeImage(t)},r.prototype.loadImage=function(e,i){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),i)},r.prototype.listImages=function(){return this.style.listImages()},r.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},r.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},r.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},r.prototype.getLayer=function(t){return this.style.getLayer(t)},r.prototype.setLayerZoomRange=function(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)},r.prototype.setFilter=function(t,e,i){return void 0===i&&(i={}),this.style.setFilter(t,e,i),this._update(!0)},r.prototype.getFilter=function(t){return this.style.getFilter(t)},r.prototype.setPaintProperty=function(t,e,i,n){return void 0===n&&(n={}),this.style.setPaintProperty(t,e,i,n),this._update(!0)},r.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},r.prototype.setLayoutProperty=function(t,e,i,n){return void 0===n&&(n={}),this.style.setLayoutProperty(t,e,i,n),this._update(!0)},r.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},r.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},r.prototype.getLight=function(){return this.style.getLight()},r.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},r.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},r.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},r.prototype.getContainer=function(){return this._container},r.prototype.getCanvasContainer=function(){return this._canvasContainer},r.prototype.getCanvas=function(){return this._canvas},r.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},r.prototype._detectMissingCSS=function(){"rgb(250, 128, 114)"!==t.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")&&t.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},r.prototype._setupContainer=function(){var t=this._container;t.classList.add("mapboxgl-map"),(this._missingCSSCanary=i.create("div","mapboxgl-canary",t)).style.visibility="hidden",this._detectMissingCSS();var e=this._canvasContainer=i.create("div","mapboxgl-canvas-container",t);this._interactive&&e.classList.add("mapboxgl-interactive"),this._canvas=i.create("canvas","mapboxgl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var n=this._containerDimensions();this._resizeCanvas(n[0],n[1]);var r=this._controlContainer=i.create("div","mapboxgl-control-container",t),o=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){o[t]=i.create("div","mapboxgl-ctrl-"+t,r)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},r.prototype._resizeCanvas=function(e,i){var n=t.browser.devicePixelRatio||1;this._canvas.width=n*e,this._canvas.height=n*i,this._canvas.style.width=e+"px",this._canvas.style.height=i+"px"},r.prototype._setupPainter=function(){var i=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),n=this._canvas.getContext("webgl",i)||this._canvas.getContext("experimental-webgl",i);n?(this.painter=new vn(n,this.transform),t.webpSupported.testSupport(n)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},r.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},r.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},r.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},r.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},r.prototype._update=function(t){return this.style?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this},r.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},r.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},r.prototype._render=function(e){var i,n=this,r=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(i=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,i),r=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var s=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var a=this.transform.zoom,l=t.browser.now();this.style.zoomHistory.update(a,l);var c=new t.EvaluationParameters(a,{now:l,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),u=c.crossFadingFactor();1===u&&u===this._crossFadingFactor||(s=!0,this._crossFadingFactor=u),this.style.update(c)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||s)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var h=t.browser.now()-r;o.endQueryEXT(o.TIME_ELAPSED_EXT,i),setTimeout((function(){var e=o.getQueryObjectEXT(i,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(i),n.fire(new t.Event("gpu-timing-frame",{cpuTime:h,gpuTime:e}))}),50)}if(this.listens("gpu-timing-layer")){var d=this.painter.collectGpuTimers();setTimeout((function(){var e=n.painter.queryGpuTimers(d);n.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)}var p=this._sourcesDirty||this._styleDirty||this._placementDirty;return p||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||p||(this._fullyLoaded=!0),this}},r.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,i=this._controls;e<i.length;e+=1)i[e].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var n=this.painter.context.gl.getExtension("WEBGL_lose_context");n&&n.loseContext(),Tr(this._canvasContainer),Tr(this._controlContainer),Tr(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},r.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},r.prototype._onWindowOnline=function(){this._update()},r.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showPadding.get=function(){return!!this._showPadding},o.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},r.prototype._setCacheLimits=function(e,i){t.setCacheLimits(e,i)},o.version.get=function(){return t.version},Object.defineProperties(r.prototype,o),r}(yr);function Tr(t){t.parentNode&&t.parentNode.removeChild(t)}var Mr={showCompass:!0,showZoom:!0,visualizePitch:!1},Ir=function(e){var n=this;this.options=t.extend({},Mr,e),this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",(function(t){return n._map.zoomIn({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",(function(t){return n._map.zoomOut({},{originalEvent:t})})),i.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",(function(t){n.options.visualizePitch?n._map.resetNorthPitch({},{originalEvent:t}):n._map.resetNorth({},{originalEvent:t})})),this._compassIcon=i.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};Ir.prototype._updateZoomButtons=function(){var t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},Ir.prototype._rotateCompassArrow=function(){var t=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=t},Ir.prototype.onAdd=function(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Pr(this._map,this._compass,this.options.visualizePitch)),this._container},Ir.prototype.onRemove=function(){i.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},Ir.prototype._createButton=function(t,e){var n=i.create("button",t,this._container);return n.type="button",n.addEventListener("click",e),n},Ir.prototype._setButtonTitle=function(t,e){var i=this._map._getUIString("NavigationControl."+e);t.title=i,t.setAttribute("aria-label",i)};var Pr=function(e,n,r){void 0===r&&(r=!1),this._clickTolerance=10,this.element=n,this.mouseRotate=new Wn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,r&&(this.mousePitch=new Qn({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),i.addEventListener(n,"mousedown",this.mousedown),i.addEventListener(n,"touchstart",this.touchstart,{passive:!1}),i.addEventListener(n,"touchmove",this.touchmove),i.addEventListener(n,"touchend",this.touchend),i.addEventListener(n,"touchcancel",this.reset)};function Dr(e,i,n){if(e=new t.LngLat(e.lng,e.lat),i){var r=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),s=n.locationPoint(e).distSqr(i);n.locationPoint(r).distSqr(i)<s?e=r:n.locationPoint(o).distSqr(i)<s&&(e=o)}for(;Math.abs(e.lng-n.center.lng)>180;){var a=n.locationPoint(e);if(a.x>=0&&a.y>=0&&a.x<=n.width&&a.y<=n.height)break;e.lng>n.center.lng?e.lng-=360:e.lng+=360}return e}Pr.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),i.disableDrag()},Pr.prototype.move=function(t,e){var i=this.map,n=this.mouseRotate.mousemoveWindow(t,e);if(n&&n.bearingDelta&&i.setBearing(i.getBearing()+n.bearingDelta),this.mousePitch){var r=this.mousePitch.mousemoveWindow(t,e);r&&r.pitchDelta&&i.setPitch(i.getPitch()+r.pitchDelta)}},Pr.prototype.off=function(){var t=this.element;i.removeEventListener(t,"mousedown",this.mousedown),i.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),i.removeEventListener(t,"touchmove",this.touchmove),i.removeEventListener(t,"touchend",this.touchend),i.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},Pr.prototype.offTemp=function(){i.enableDrag(),i.removeEventListener(t.window,"mousemove",this.mousemove),i.removeEventListener(t.window,"mouseup",this.mouseup)},Pr.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),i.mousePos(this.element,e)),i.addEventListener(t.window,"mousemove",this.mousemove),i.addEventListener(t.window,"mouseup",this.mouseup)},Pr.prototype.mousemove=function(t){this.move(t,i.mousePos(this.element,t))},Pr.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},Pr.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=i.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},Pr.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=i.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},Pr.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},Pr.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var Lr={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Or(t,e,i){var n=t.classList;for(var r in Lr)n.remove("mapboxgl-"+i+"-anchor-"+r);n.add("mapboxgl-"+i+"-anchor-"+e)}var Fr,Rr=function(e){function n(n,r){if(e.call(this),(n instanceof t.window.HTMLElement||r)&&(n=t.extend({element:n},r)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&"auto"!==n.pitchAlignment?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=t.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=i.create("div"),this._element.setAttribute("aria-label","Map marker");var o=i.createNS("http://www.w3.org/2000/svg","svg");o.setAttributeNS(null,"display","block"),o.setAttributeNS(null,"height","41px"),o.setAttributeNS(null,"width","27px"),o.setAttributeNS(null,"viewBox","0 0 27 41");var s=i.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");var a=i.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var l=i.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");for(var c=0,u=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];c<u.length;c+=1){var h=u[c],d=i.createNS("http://www.w3.org/2000/svg","ellipse");d.setAttributeNS(null,"opacity","0.04"),d.setAttributeNS(null,"cx","10.5"),d.setAttributeNS(null,"cy","5.80029008"),d.setAttributeNS(null,"rx",h.rx),d.setAttributeNS(null,"ry",h.ry),l.appendChild(d)}var p=i.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"fill",this._color);var A=i.createNS("http://www.w3.org/2000/svg","path");A.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),p.appendChild(A);var f=i.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"fill","#000000");var g=i.createNS("http://www.w3.org/2000/svg","path");g.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),f.appendChild(g);var m=i.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(6.0, 7.0)"),m.setAttributeNS(null,"fill","#FFFFFF");var y=i.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"transform","translate(8.0, 8.0)");var v=i.createNS("http://www.w3.org/2000/svg","circle");v.setAttributeNS(null,"fill","#000000"),v.setAttributeNS(null,"opacity","0.25"),v.setAttributeNS(null,"cx","5.5"),v.setAttributeNS(null,"cy","5.5"),v.setAttributeNS(null,"r","5.4999962");var _=i.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#FFFFFF"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962"),y.appendChild(v),y.appendChild(_),a.appendChild(l),a.appendChild(p),a.appendChild(f),a.appendChild(m),a.appendChild(y),o.appendChild(a),o.setAttributeNS(null,"height",41*this._scale+"px"),o.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(o),this._offset=t.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),Or(this._element,this._anchor,"marker"),this._popup=null}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(t){return this.remove(),this._map=t,t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},n.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),i.remove(this._element),this._popup&&this._popup.remove(),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},n.prototype.getElement=function(){return this._element},n.prototype.setPopup=function(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){var e=Math.sqrt(Math.pow(13.5,2)/2);t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=t,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},n.prototype._onKeyPress=function(t){var e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},n.prototype._onMapClick=function(t){var e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},n.prototype.getPopup=function(){return this._popup},n.prototype.togglePopup=function(){var t=this._popup;return t?(t.isOpen()?t.remove():t.addTo(this._map),this):this},n.prototype._update=function(t){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Dr(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var e="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),i.setTransform(this._element,Lr[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+n+" "+e)}},n.prototype.getOffset=function(){return this._offset},n.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},n.prototype._onMove=function(e){if(!this._isDragging){var i=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=i}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},n.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},n.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},n.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},n.prototype.isDraggable=function(){return this._draggable},n.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},n.prototype.getRotation=function(){return this._rotation},n.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},n.prototype.getRotationAlignment=function(){return this._rotationAlignment},n.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},n.prototype.getPitchAlignment=function(){return this._pitchAlignment},n}(t.Evented),kr={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},zr=0,Ur=!1,Nr=function(e){function n(i){e.call(this),this.options=t.extend({},kr,i),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.onAdd=function(e){var n;return this._map=e,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),n=this._setupUI,void 0!==Fr?n(Fr):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){n(Fr="denied"!==t.state)})):n(Fr=!!t.window.navigator.geolocation),this._container},n.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),i.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,zr=0,Ur=!1},n.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())},n.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_E
2RROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},n.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},n.prototype._updateCamera=function(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude),n=e.coords.accuracy,r=this._map.getBearing(),o=t.extend({bearing:r},this.options.fitBoundsOptions);this._map.fitBounds(i.toBounds(n),o,{geolocateSource:!0})},n.prototype._updateMarker=function(e){if(e){var i=new t.LngLat(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},n.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]),i=this._map.unproject([1,t]),n=e.distanceTo(i),r=Math.ceil(2*this._accuracy/n);this._circleElement.style.width=r+"px",this._circleElement.style.height=r+"px"},n.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},n.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var i=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Ur)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},n.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},n.prototype._setupUI=function(e){var n=this;if(this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=i.create("button","mapboxgl-ctrl-geolocate",this._container),i.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",!1===e){t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r)}else{var o=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=o,this._geolocateButton.setAttribute("aria-label",o)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
2se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=i.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Rr(this._dotElement),this._circleElement=i.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Rr({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(function(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},n.prototype.trigger=function(){if(!this._setup)return t.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":zr--,Ur=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){var e;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++zr>1?(e={maximumAge:6e5,timeout:0},Ur=!0):(e=this.options.positionOptions,Ur=!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},n.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},n}(t.Evented),Gr={maxWidth:100,unit:"metric"},Zr=function(e){this.options=t.extend({},Gr,e),t.bindAll(["_onMove","setUnit"],this)};function jr(t,e,i){var n=i&&i.maxWidth||100,r=t._container.clientHeight/2,o=t.unproject([0,r]),s=t.unproject([n,r]),a=o.distanceTo(s);if(i&&"imperial"===i.unit){var l=3.2808*a;l>5280?Vr(e,n,l/5280,t._getUIString("ScaleControl.Miles")):Vr(e,n,l,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?Vr(e,n,a/1852,t._getUIString("ScaleControl.NauticalMiles")):a>=1e3?Vr(e,n,a/1e3,t._getUIString("ScaleControl.Kilometers")):Vr(e,n,a,t._getUIString("ScaleControl.Meters"))}function Vr(t,e,i,n){var r,o,s,a=(r=i,(o=Math.pow(10,(""+Math.floor(r)).length-1))*(s=(s=r/o)>=10?10:s>=5?5:s>=3?3:s>=2?2:s>=1?1:function(t){var e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(s)));t.style.width=e*(a/i)+"px",t.innerHTML=a+"&nbsp;"+n}Zr.prototype.getDefaultPosition=function(){return"bottom-left"},Zr.prototype._onMove=function(){jr(this._map,this._container,this.options)},Zr.prototype.onAdd=function(t){return this._map=t,this._container=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Zr.prototype.onRemove=function(){i.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Zr.prototype.setUnit=function(t){this.options.unit=t,jr(this._map,this._container,this.options)};var Hr=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")};Hr.prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=i.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Hr.prototype.onRemove=function(){i.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Hr.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Hr.prototype._setupUI=function(){var e=this._fullscreenButton=i.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);i.create("span","mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Hr.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Hr.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Hr.prototype._isFullscreen=function(){return this._fullscreen},Hr.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Hr.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var Jr={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"}
vendor: 114,922 bytes, line 2
2,Wr=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Qr=function(e){function n(i){e.call(this),this.options=t.extend(Object.create(Jr),i),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return e&&(n.__proto__=e),(n.prototype=Object.create(e&&e.prototype)).constructor=n,n.prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},n.prototype.isOpen=function(){return!!this._map},n.prototype.remove=function(){return this._content&&i.remove(this._content),this._container&&(i.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new t.Event("close")),this},n.prototype.getLngLat=function(){return this._lngLat},n.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},n.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},n.prototype.getElement=function(){return this._container},n.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},n.prototype.setHTML=function(e){var i,n=t.window.document.createDocumentFragment(),r=t.window.document.createElement("body");for(r.innerHTML=e;i=r.firstChild;)n.appendChild(i);return this.setDOMContent(n)},n.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},n.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},n.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=i.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},n.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},n.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},n.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},n.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},n.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=i.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},n.prototype._onMouseUp=function(t){this._update(t.point)},n.prototype._onMouseMove=function(t){this._update(t.point)},n.prototype._onDrag=function(t){this._update(t.point)},n.prototype._update=function(e){var n=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=i.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=i.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return n._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Dr(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)){var r=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),o=this.options.anchor,s=function e(i){if(i){if("number"==typeof i){var n=Math.round(Math.sqrt(.5*Math.pow(i,2)));return{center:new t.Point(0,0),top:new t.Point(0,i),"top-left":new t.Point(n,n),"top-right":new t.Point(-n,n),bottom:new t.Point(0,-i),"bottom-left":new t.Point(n,-n),"bottom-right":new t.Point(-n,-n),left:new t.Point(i,0),right:new t.Point(-i,0)}}if(i instanceof t.Point||Array.isArray(i)){var r=t.Point.convert(i);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:t.Point.convert(i.center||[0,0]),top:t.Point.convert(i.top||[0,0]),"top-left":t.Point.convert(i["top-left"]||[0,0]),"top-right":t.Point.convert(i["top-right"]||[0,0]),bottom:t.Point.convert(i.bottom||[0,0]),"bottom-left":t.Point.convert(i["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(i["bottom-right"]||[0,0]),left:t.Point.convert(i.left||[0,0]),right:t.Point.convert(i.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset);if(!o){var a,l=this._container.offsetWidth,c=this._container.offsetHeight;a=r.y+s.bottom.y<c?["top"]:r.y>this._map.transform.height-c?["bottom"]:[],r.x<l/2?a.push("left"):r.x>this._map.transform.width-l/2&&a.push("right"),o=0===a.length?"bottom":a.join("-")}var u=r.add(s[o]).round();i.setTransform(this._container,Lr[o]+" translate("+u.x+"px,"+u.y+"px)"),Or(this._container,o,"popup")}},n.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var t=this._container.querySelector(Wr);t&&t.focus()}},n.prototype._onClose=function(){this.remove()},n}(t.Evented),qr={version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:Sr,NavigationControl:Ir,GeolocateControl:Nr,AttributionControl:vr,ScaleControl:Zr,FullscreenControl:Hr,Popup:Qr,Marker:Rr,Style:je,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){zt().acquire(Ot)},clearPrewarmedResources:function(){var t=Rt;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(Ot),Rt=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return Ft.workerCount},set workerCount(t){Ft.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:""};return qr})),i}()},48331:(t,e,i)=>{"use strict";i.d(e,{Q:()=>Z});var n=i(37659);const r={mousedown:1,mousemove:2,mouseup:4};!function(t){const e=t.prototype.handler;t.prototype.handler=function(t){const i=this.store;t.button>0&&"pointerdown"===t.type&&(function(t,e){for(let i=0;i<t.length;i++)if(e(t[i]))return!0;return!1}(i,(e=>e.pointerId===t.pointerId))||i.push(t)),e.call(this,t)}}(n.PointerEventInput),n.MouseInput.prototype.handler=function(t){let e=r[t.type];1&e&&t.button>=0&&(this.pressed=!0),2&e&&0===t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))};const o=n.Manager,s=n;class a{constructor(t,e,i){this.element=t,this.callback=e,this.options={enable:!0,...i}}}const l=s?[[s.Pan,{event:"tripan",pointers:3,threshold:0,enable:!1}],[s.Rotate,{enable:!1}],[s.Pinch,{enable:!1}],[s.Swipe,{enable:!1}],[s.Pan,{threshold:0,enable:!1}],[s.Press,{enable:!1}],[s.Tap,{event:"doubletap",taps:2,enable:!1}],[s.Tap,{event:"anytap",enable:!1}],[s.Tap,{enable:!1}]]:null,c={tripan:["rotate","pinch","pan"],rotate:["pinch"],pinch:["pan"],pan:["press","doubletap","anytap","tap"],doubletap:["anytap"],anytap:["tap"]},u={doubletap:["tap"]},h={pointerdown:"pointerdown",pointermove:"pointermove",pointerup:"pointerup",touchstart:"pointerdown",touchmove:"pointermove",touchend:"pointerup",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup"},d={KEY_EVENTS:["keydown","keyup"],MOUSE_EVENTS:["mousedown","mousemove","mouseup","mouseover","mouseout","mouseleave"],WHEEL_EVENTS:["wheel","mousewheel"]},p={tap:"tap",anytap:"anytap",doubletap:"doubletap",press:"press",pinch:"pinch",pinchin:"pinch",pinchout:"pinch",pinchstart:"pinch",pinchmove:"pinch",pinchend:"pinch",pinchcancel:"pinch",rotate:"rotate",rotatestart:"rotate",rotatemove:"rotate",rotateend:"rotate",rotatecancel:"rotate",tripan:"tripan",tripanstart:"tripan",tripanmove:"tripan",tripanup:"tripan",tripandown:"tripan",tripanleft:"tripan",tripanright:"tripan",tripanend:"tripan",tripancancel:"tripan",pan:"pan",panstart:"pan",panmove:"pan",panup:"pan",pandown:"pan",panleft:"pan",panright:"pan",panend:"pan",pancancel:"pan",swipe:"swipe",swipeleft:"swipe",swiperight:"swipe",swipeup:"swipe",swipedown:"swipe"},A={click:"tap",anyclick:"anytap",dblclick:"doubletap",mousedown:"pointerdown",mousemove:"pointermove",mouseup:"pointerup",mouseover:"pointerover",mouseout:"pointerout",mouseleave:"pointerleave"},f="undefined"!==typeof navigator&&navigator.userAgent?navigator.userAgent.toLowerCase():"",g="undefined"!==typeof window?window:i.g;"undefined"!==typeof i.g?i.g:window,"undefined"!==typeof document&&document;let m=!1;try{const t={get passive(){return m=!0,!0}};g.addEventListener("test",null,t),g.removeEventListener("test",null)}catch(j){m=!1}const y=-1!==f.indexOf("firefox"),{WHEEL_EVENTS:v}=d,_="wheel",b=4.000244140625;class x extends a{constructor(t,e,i){super(t,e,i),this.handleEvent=t=>{if(!this.options.enable)return;let e=t.deltaY;g.WheelEvent&&(y&&t.deltaMode===g.WheelEvent.DOM_DELTA_PIXEL&&(e/=g.devicePixelRatio),t.deltaMode===g.WheelEvent.DOM_DELTA_LINE&&(e*=40)),0!==e&&e%b===0&&(e=Math.floor(e/b)),t.shiftKey&&e&&(e*=.25),this.callback({type:_,center:{x:t.clientX,y:t.clientY},delta:-e,srcEvent:t,pointerType:"mouse",target:t.target})},this.events=(this.options.events||[]).concat(v),this.events.forEach((e=>t.addEventListener(e,this.handleEvent,!!m&&{passive:!1})))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===_&&(this.options.enable=e)}}const{MOUSE_EVENTS:w}=d,C="pointermove",B="pointerover",E="pointerout",S="pointerenter",T="pointerleave";class M extends a{constructor(t,e,i){super(t,e,i),this.handleEvent=t=>{this.handleOverEvent(t),this.handleOutEvent(t),this.handleEnterEvent(t),this.handleLeaveEvent(t),this.handleMoveEvent(t)},this.pressed=!1;const{enable:n}=this.options;this.enableMoveEvent=n,this.enableLeaveEvent=n,this.enableEnterEvent=n,this.enableOutEvent=n,this.enableOverEvent=n,this.events=(this.options.events||[]).concat(w),this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===C&&(this.enableMoveEvent=e),t===B&&(this.enableOverEvent=e),t===E&&(this.enableOutEvent=e),t===S&&(this.enableEnterEvent=e),t===T&&(this.enableLeaveEvent=e)}handleOverEvent(t){this.enableOverEvent&&"mouseover"===t.type&&this._emit(B,t)}handleOutEvent(t){this.enableOutEvent&&"mouseout"===t.type&&this._emit(E,t)}handleEnterEvent(t){this.enableEnterEvent&&"mouseenter"===t.type&&this._emit(S,t)}handleLeaveEvent(t){this.enableLeaveEvent&&"mouseleave"===t.type&&this._emit(T,t)}handleMoveEvent(t){if(this.enableMoveEvent)switch(t.type){case"mousedown":t.button>=0&&(this.pressed=!0);break;case"mousemove":0===t.which&&(this.pressed=!1),this.pressed||this._emit(C,t);break;case"mouseup":this.pressed=!1}}_emit(t,e){this.callback({type:t,center:{x:e.clientX,y:e.clientY},srcEvent:e,pointerType:"mouse",target:e.target})}}const{KEY_EVENTS:I}=d,P="keydown",D="keyup";class L extends a{constructor(t,e,i){super(t,e,i),this.handleEvent=t=>{const e=t.target||t.srcElement;"INPUT"===e.tagName&&"text"===e.type||"TEXTAREA"===e.tagName||(this.enableDownEvent&&"keydown"===t.type&&this.callback({type:P,srcEvent:t,key:t.key,target:t.target}),this.enableUpEvent&&"keyup"===t.type&&this.callback({type:D,srcEvent:t,key:t.key,target:t.target}))},this.enableDownEvent=this.options.enable,this.enableUpEvent=this.options.enable,this.events=(this.options.events||[]).concat(I),t.tabIndex=this.options.tabIndex||0,t.style.outline="none",this.events.forEach((e=>t.addEventListener(e,this.handleEvent)))}destroy(){this.events.forEach((t=>this.element.removeEventListener(t,this.handleEvent)))}enableEventType(t,e){t===P&&(this.enableDownEvent=e),t===D&&(this.enableUpEvent=e)}}const O="contextmenu";class F extends a{constructor(t,e,i){super(t,e,i),this.handleEvent=t=>{this.options.enable&&this.callback({type:O,center:{x:t.clientX,y:t.clientY},srcEvent:t,pointerType:"mouse",target:t.target})},t.addEventListener("contextmenu",this.handleEvent)}destroy(){this.element.removeEventListener("contextmenu",this.handleEvent)}enableEventType(t,e){t===O&&(this.options.enable=e)}}const R={pointerdown:1,pointermove:2,pointerup:4,mousedown:1,mousemove:2,mouseup:4};function k(t){const e=R[t.srcEvent.type];if(!e)return null;const{buttons:i,button:n,which:r}=t.srcEvent;let o=!1,s=!1,a=!1;return 4===e||2===e&&!Number.isFinite(i)?(o=1===r,s=2===r,a=3===r):2===e?(o=Boolean(1&i),s=Boolean(4&i),a=Boolean(2&i)):1===e&&(o=0===n,s=1===n,a=2===n),{leftButton:o,middleButton:s,rightButton:a}}function z(t,e){const i=t.center;if(!i)return null;const n=e.getBoundingClientRect(),r=n.width/e.offsetWidth||1,o=n.height/e.offsetHeight||1;return{center:i,offsetCenter:{x:(i.x-n.left-e.clientLeft)/r,y:(i.y-n.top-e.clientTop)/o}}}const U={srcElement:"root",priority:0};class N{constructor(t){this.handleEvent=t=>{if(this.isEmpty())return;const e=this._normalizeEvent(t);let i=t.srcEvent.target;for(;i&&i!==e.rootElement;){if(this._emit(e,i),e.handled)return;i=i.parentNode}this._emit(e,"root")},this.eventManager=t,this.handlers=[],this.handlersByElement=new Map,this._active=!1}isEmpty(){return!this._active}add(t,e,i){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{handlers:o,handlersByElement:s}=this;let a=U;"string"===typeof i||i&&i.addEventListener?a={...U,srcElement:i}:i&&(a={...U,...i});let l=s.get(a.srcElement);l||(l=[],s.set(a.srcElement,l));const c={type:t,handler:e,srcElement:a.srcElement,priority:a.priority};n&&(c.once=!0),r&&(c.passive=!0),o.push(c),this._active=this._active||!c.passive;let u=l.length-1;for(;u>=0&&!(l[u].priority>=c.priority);)u--;l.splice(u+1,0,c)}remove(t,e){const{handlers:i,handlersByElement:n}=this;for(let r=i.length-1;r>=0;r--){const o=i[r];if(o.type===t&&o.handler===e){i.splice(r,1);const t=n.get(o.srcElement);t.splice(t.indexOf(o),1),0===t.length&&n.delete(o.srcElement)}}this._active=i.some((t=>!t.passive))}_emit(t,e){const i=this.handlersByElement.get(e);if(i){let e=!1;const n=()=>{t.handled=!0},r=()=>{t.handled=!0,e=!0},o=[];for(let s=0;s<i.length;s++){const{type:a,handler:l,once:c}=i[s];if(l({...t,type:a,stopPropagation:n,stopImmediatePropagation:r}),c&&o.push(i[s]),e)break}for(let t=0;t<o.length;t++){const{type:e,handler:i}=o[t];this.remove(e,i)}}}_normalizeEvent(t){const e=this.eventManager.getElement();return{...t,...k(t),...z(t,e),preventDefault:()=>{t.srcEvent.preventDefault()},stopImmediatePropagation:null,stopPropagation:null,handled:!1,rootElement:e}}}const G={events:null,recognizers:null,recognizerOptions:{},Manager:o,touchAction:"none",tabIndex:0};class Z{constructor(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,e=arguments.length>1?arguments[1]:void 0;this._onBasicInput=t=>{const{srcEvent:e}=t,i=h[e.type];i&&this.manager.emit(i,t)},this._onOtherEvent=t=>{this.manager.emit(t.type,t)},this.options={...G,...e},this.events=new Map,this.setElement(t);const{events:i}=this.options;i&&this.on(i)}getElement(){return this.element}setElement(t){if(this.element&&this.destroy(),this.element=t,!t)return;const{options:e}=this,i=e.Manager;this.manager=new i(t,{touchAction:e.touchAction,recognizers:e.recognizers||l}).on("hammer.input",this._onBasicInput),e.recognizers||Object.keys(c).forEach((t=>{const e=this.manager.get(t);e&&c[t].forEach((t=>{e.recognizeWith(t)}))}));for(const n in e.recognizerOptions){const t=this.manager.get(n);if(t){const i=e.recognizerOptions[n];delete i.enable,t.set(i)}}this.wheelInput=new x(t,this._onOtherEvent,{enable:!1}),this.moveInput=new M(t,this._onOtherEvent,{enable:!1}),this.keyInput=new L(t,this._onOtherEvent,{enable:!1,tabIndex:e.tabIndex}),this.contextmenuInput=new F(t,this._onOtherEvent,{enable:!1});for(const[n,r]of this.events)r.isEmpty()||(this._toggleRecognizer(r.recognizerName,!0),this.manager.on(n,r.handleEvent))}destroy(){this.element&&(this.wheelInput.destroy(),this.moveInput.destroy(),this.keyInput.destroy(),this.contextmenuInput.destroy(),this.manager.destroy(),this.wheelInput=null,this.moveInput=null,this.keyInput=null,this.contextmenuInput=null,this.manager=null,this.element=null)}on(t,e,i){this._addEventHandler(t,e,i,!1)}once(t,e,i){this._addEventHandler(t,e,i,!0)}watch(t,e,i){this._addEventHandler(t,e,i,!1,!0)}off(t,e){this._removeEventHandler(t,e)}_toggleRecognizer(t,e){const{manager:i}=this;if(!i)return;const n=i.get(t);if(n&&n.options.enable!==e){n.set({enable:e});const r=u[t];r&&!this.options.recognizers&&r.forEach((r=>{const o=i.get(r);e?(o.requireFailure(t),n.dropRequireFailure(r)):o.dropRequireFailure(t)}))}this.wheelInput.enableEventType(t,e),this.moveInput.enableEventType(t,e),this.keyInput.enableEventType(t,e),this.contextmenuInput.enableEventType(t,e)}_addEventHandler(t,e,i,n,r){if("string"!==typeof t){i=e;for(const e in t)this._addEventHandler(e,t[e],i,n,r);return}const{manager:o,events:s}=this,a=A[t]||t;let l=s.get(a);l||(l=new N(this),s.set(a,l),l.recognizerName=p[a]||a,o&&o.on(a,l.handleEvent)),l.add(t,e,i,n,r),l.isEmpty()||this._toggleRecognizer(l.recognizerName,!0)}_removeEventHandler(t,e){if("string"!==typeof t){for(const e in t)this._removeEventHandler(e,t[e]);return}const{events:i}=this,n=A[t]||t,r=i.get(n);if(r&&(r.remove(t,e),r.isEmpty())){const{recognizerName:t}=r;let e=!1;for(const n of i.values())if(n.recognizerName===t&&!n.isEmpty()){e=!0;break}e||this._toggleRecognizer(t,!1)}}}},32408:(t,e,i)=>{"use strict";t.exports=r;var n=i(70356);function r(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}r.Varint=0,r.Fixed64=1,r.Bytes=2,r.Fixed32=5;var o=4294967296,s=1/o,a="undefined"===typeof TextDecoder?null:new TextDecoder("utf8");function l(t){return t.type===r.Bytes?t.readVarint()+t.pos:t.pos+1}function c(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function u(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function h(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function d(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function p(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function A(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function f(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function g(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function m(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function y(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function v(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function _(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function b(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function x(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}r.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,o=this.pos;this.type=7&n,t(r,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=_(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=x(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=_(this.buf,this.pos)+_(this.buf,this.pos+4)*o;return this.pos+=8,t},readSFixed64:function(){var t=_(this.buf,this.pos)+x(this.buf,this.pos+4)*o;return this.pos+=8,t},readFloat:function(){var t=n.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=n.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,o=i.buf;if(r=o[i.pos++],n=(112&r)>>4,r<128)return c(t,n,e);if(r=o[i.pos++],n|=(127&r)<<3,r<128)return c(t,n,e);if(r=o[i.pos++],n|=(127&r)<<10,r<128)return c(t,n,e);if(r=o[i.pos++],n|=(127&r)<<17,r<128)return c(t,n,e);if(r=o[i.pos++],n|=(127&r)<<24,r<128)return c(t,n,e);if(r=o[i.pos++],n|=(1&r)<<31,r<128)return c(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2===1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&a?function(t,e,i){return a.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r<i;){var o,s,a,l=t[r],c=null,u=l>239?4:l>223?3:l>191?2:1;if(r+u>i)break;1===u?l<128&&(c=l):2===u?128===(192&(o=t[r+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(o=t[r+1],s=t[r+2],128===(192&o)&&128===(192&s)&&((c=(15&l)<<12|(63&o)<<6|63&s)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(o=t[r+1],s=t[r+2],a=t[r+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&((c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,n+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),n+=String.fromCharCode(c),r+=u}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==r.Bytes)return t.push(this.readVarint(e));var i=l(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==r.Bytes)return t.push(this.readSVarint());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==r.Bytes)return t.push(this.readBoolean());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==r.Bytes)return t.push(this.readFloat());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==r.Bytes)return t.push(this.readDouble());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==r.Bytes)return t.push(this.readFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==r.Bytes)return t.push(this.readSFixed32());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==r.Bytes)return t.push(this.readFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==r.Bytes)return t.push(this.readSFixed64());var e=l(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===r.Varint)for(;this.buf[this.pos++]>127;);else if(e===r.Bytes)this.pos=this.readVarint()+this.pos;else if(e===r.Fixed32)this.pos+=4;else{if(e!==r.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),b(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),b(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),b(this.buf,-1&t,this.pos),b(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),b(this.buf,-1&t,this.pos),b(this.buf,Math.floor(t*s),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!r){n>56319||o+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&u(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),n.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),n.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&u(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,r.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,h,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,d,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,f,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,p,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,A,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,g,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,m,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,y,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,v,e)},writeBytesField:function(t,e){this.writeTag(t,r.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,r.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,r.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,r.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,r.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,r.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,r.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}}},35569:(t,e,i)=>{"use strict";i.d(e,{X$:()=>ct,Pv:()=>Oi,Z3:()=>_t});var n=i(25773),r=i(30126),o=i(64649),s=i(66845),a=i(8984),l=i(65809),c=i(75818),u=function(){if("undefined"!==typeof Map)return Map;function t(t,e){var i=-1;return t.some((function(t,n){return t[0]===e&&(i=n,!0)})),i}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var i=t(this.__entries__,e),n=this.__entries__[i];return n&&n[1]},e.prototype.set=function(e,i){var n=t(this.__entries__,e);~n?this.__entries__[n][1]=i:this.__entries__.push([e,i])},e.prototype.delete=function(e){var i=this.__entries__,n=t(i,e);~n&&i.splice(n,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var i=0,n=this.__entries__;i<n.length;i++){var r=n[i];t.call(e,r[1],r[0])}},e}()}(),h="undefined"!==typeof window&&"undefined"!==typeof document&&window.document===document,d="undefined"!==typeof i.g&&i.g.Math===Math?i.g:"undefined"!==typeof self&&self.Math===Math?self:"undefined"!==typeof window&&window.Math===Math?window:Function("return this")(),p="function"===typeof requestAnimationFrame?requestAnimationFrame.bind(d):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var A=["top","right","bottom","left","width","height","size","weight"],f="undefined"!==typeof MutationObserver,g=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var i=!1,n=!1,r=0;function o(){i&&(i=!1,t()),n&&a()}function s(){p(o)}function a(){var t=Date.now();if(i){if(t-r<2)return;n=!0}else i=!0,n=!1,setTimeout(s,e);r=t}return a}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,i=e.indexOf(t);~i&&e.splice(i,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){h&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),f?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){h&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,i=void 0===e?"":e;A.some((function(t){return!!~i.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),m=function(t,e){for(var i=0,n=Object.keys(e);i<n.length;i++){var r=n[i];Object.defineProperty(t,r,{value:e[r],enumerable:!1,writable:!1,configurable:!0})}return t},y=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||d},v=B(0,0,0,0);function _(t){return parseFloat(t)||0}function b(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];return e.reduce((function(e,i){return e+_(t["border-"+i+"-width"])}),0)}function x(t){var e=t.clientWidth,i=t.clientHeight;if(!e&&!i)return v;var n=y(t).getComputedStyle(t),r=function(t){for(var e={},i=0,n=["top","right","bottom","left"];i<n.length;i++){var r=n[i],o=t["padding-"+r];e[r]=_(o)}return e}(n),o=r.left+r.right,s=r.top+r.bottom,a=_(n.width),l=_(n.height);if("border-box"===n.boxSizing&&(Math.round(a+o)!==e&&(a-=b(n,"left","right")+o),Math.round(l+s)!==i&&(l-=b(n,"top","bottom")+s)),!function(t){return t===y(t).document.documentElement}(t)){var c=Math.round(a+o)-e,u=Math.round(l+s)-i;1!==Math.abs(c)&&(a-=c),1!==Math.abs(u)&&(l-=u)}return B(r.left,r.top,a,l)}var w="undefined"!==typeof SVGGraphicsElement?function(t){return t instanceof y(t).SVGGraphicsElement}:function(t){return t instanceof y(t).SVGElement&&"function"===typeof t.getBBox};function C(t){return h?w(t)?function(t){var e=t.getBBox();return B(0,0,e.width,e.height)}(t):x(t):v}function B(t,e,i,n){return{x:t,y:e,width:i,height:n}}var E=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=B(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=C(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),S=function(t,e){var i=function(t){var e=t.x,i=t.y,n=t.width,r=t.height,o="undefined"!==typeof DOMRectReadOnly?DOMRectReadOnly:Object,s=Object.create(o.prototype);return m(s,{x:e,y:i,width:n,height:r,top:i,right:e+n,bottom:r+i,left:e}),s}(e);m(this,{target:t,contentRect:i})},T=function(){function t(t,e,i){if(this.activeObservations_=[],this.observations_=new u,"function"!==typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=i}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(t instanceof y(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new E(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!==typeof Element&&Element instanceof Object){if(!(t instanceof y(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new S(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),M="undefined"!==typeof WeakMap?new WeakMap:new u,I=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=g.getInstance(),n=new T(e,i,this);M.set(this,n)};["observe","unobserve","disconnect"].forEach((function(t){I.prototype[t]=function(){var e;return(e=M.get(this))[t].apply(e,arguments)}}));const P="undefined"!==typeof d.ResizeObserver?d.ResizeObserver:I;var D=i(22951),L=i(91976),O=("undefined"!==typeof window?window:i.g,"undefined"!==typeof i.g?i.g:window,"undefined"!==typeof document?document:{});function F(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function R(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?F(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):F(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}function k(t,e){var i;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"===typeof t)return z(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return z(t,e)}(t))||e&&t&&"number"===typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var U=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function N(t){if(!t)return null;if("string"===typeof t)return t;t.toJS&&(t=t.toJS());var e,i={},n=k(t.layers);try{for(n.s();!(e=n.n()).done;){var r=e.value;i[r.id]=r}}catch(s){n.e(s)}finally{n.f()}var o=t.layers.map((function(t){var e=i[t.ref],n=null;if("interactive"in t&&delete(n=R({},t)).interactive,e){delete(n=n||R({},t)).ref;var r,o=k(U);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&(n[a]=e[a])}}catch(s){o.e(s)}finally{o.f()}}return n||t}));return R(R({},t),{},{layers:o})}var G={container:a.object,gl:a.object,mapboxApiAccessToken:a.string,mapboxApiUrl:a.string,attributionControl:a.bool,preserveDrawingBuffer:a.bool,reuseMaps:a.bool,transformRequest:a.func,mapOptions:a.object,mapStyle:a.oneOfType([a.string,a.object]),preventStyleDiffing:a.bool,visible:a.bool,asyncRender:a.bool,onLoad:a.func,onError:a.func,width:a.number,height:a.number,viewState:a.object,longitude:a.number,latitude:a.number,zoom:a.number,bearing:a.number,pitch:a.number,altitude:a.number},Z={container:O.body,mapboxApiAccessToken:function(){var t=null;if("undefined"!==typeof window&&window.location){var e=window.location.search.match(/access_token=([^&\/]*)/);t=e&&e[1]}t||"undefined"===typeof process||(t=t||{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.MapboxAccessToken||{NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.REACT_APP_MAPBOX_ACCESS_TOKEN);return t||"no-token"}(),mapboxApiUrl:"https://api.mapbox.com",preserveDrawingBuffer:!1,attributionControl:!0,reuseMaps:!1,mapOptions:{},mapStyle:"mapbox://styles/mapbox/light-v8",preventStyleDiffing:!1,visible:!0,asyncRender:!1,onLoad:function(){},onError:function(t){t&&console.error(t.error)},width:0,height:0,longitude:0,latitude:0,zoom:0,bearing:0,pitch:0,altitude:1.5};function j(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"component";t.debug&&a.checkPropTypes(G,t,"prop",e)}var V=function(){function t(e){var i=this;if((0,D.Z)(this,t),(0,o.Z)(this,"props",Z),(0,o.Z)(this,"width",0),(0,o.Z)(this,"height",0),(0,o.Z)(this,"_fireLoadEvent",(function(){i.props.onLoad({type:"load",target:i._map})})),(0,o.Z)(this,"_handleError",(function(t){i.props.onError(t)})),!e.mapboxgl)throw new Error("Mapbox not available");this.mapboxgl=e.mapboxgl,t.initialized||(t.initialized=!0,this._checkStyleSheet(this.mapboxgl.version)),this._initialize(e)}return(0,L.Z)(t,[{key:"finalize",value:function(){return this._destroy(),this}},{key:"setProps",value:function(t){return this._update(this.props,t),this}},{key:"redraw",value:function(){var t=this._map;t.style&&(t._frame&&(t._frame.cancel(),t._frame=null),t._render())}},{key:"getMap",value:function(){return this._map}},{key:"_reuse",value:function(e){this._map=t.savedMap;var i=this._map.getContainer(),n=e.container;for(n.classList.add("mapboxgl-map");i.childNodes.length>0;)n.appendChild(i.childNodes[0]);this._map._container=n,t.savedMap=null,e.mapStyle&&this._map.setStyle(N(e.mapStyle),{diff:!1}),this._map.isStyleLoaded()?this._fireLoadEvent():this._map.once("styledata",this._fireLoadEvent)}},{key:"_create",value:function(e){if(e.reuseMaps&&t.savedMap)this._reuse(e);else{if(e.gl){var i=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(){return HTMLCanvasElement.prototype.getContext=i,e.gl}}var n={container:e.container,center:[0,0],zoom:8,pitch:0,bearing:0,maxZoom:24,style:N(e.mapStyle),interactive:!1,trackResize:!1,attributionControl:e.attributionControl,preserveDrawingBuffer:e.preserveDrawingBuffer};e.transformRequest&&(n.transformRequest=e.transformRequest),this._map=new this.mapboxgl.Map(Object.assign({},n,e.mapOptions)),this._map.once("load",this._fireLoadEvent),this._map.on("error",this._handleError)}return this}},{key:"_destroy",value:function(){this._map&&(this.props.reuseMaps&&!t.savedMap?(t.savedMap=this._map,this._map.off("load",this._fireLoadEvent),this._map.off("error",this._handleError),this._map.off("styledata",this._fireLoadEvent)):this._map.remove(),this._map=null)}},{key:"_initialize",value:function(t){var e=this;j(t=Object.assign({},Z,t),"Mapbox"),this.mapboxgl.accessToken=t.mapboxApiAccessToken||Z.mapboxApiAccessToken,this.mapboxgl.baseApiUrl=t.mapboxApiUrl,this._create(t);var i=t.container;Object.defineProperty(i,"offsetWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(i,"clientWidth",{configurable:!0,get:function(){return e.width}}),Object.defineProperty(i,"offsetHeight",{configurable:!0,get:function(){return e.height}}),Object.defineProperty(i,"clientHeight",{configurable:!0,get:function(){return e.height}});var n=this._map.getCanvas();n&&(n.style.outline="none"),this._updateMapViewport({},t),this._updateMapSize({},t),this.props=t}},{key:"_update",value:function(t,e){if(this._map){j(e=Object.assign({},this.props,e),"Mapbox");var i=this._updateMapViewport(t,e),n=this._updateMapSize(t,e);this._updateMapStyle(t,e),e.asyncRender||!i&&!n||this.redraw(),this.props=e}}},{key:"_updateMapStyle",value:function(t,e){t.mapStyle!==e.mapStyle&&this._map.setStyle(N(e.mapStyle),{diff:!e.preventStyleDiffing})}},{key:"_updateMapSize",value:function(t,e){var i=t.width!==e.width||t.height!==e.height;return i&&(this.width=e.width,this.height=e.height,this._map.resize()),i}},{key:"_updateMapViewport",value:function(t,e){var i=this._getViewState(t),n=this._getViewState(e),r=n.latitude!==i.latitude||n.longitude!==i.longitude||n.zoom!==i.zoom||n.pitch!==i.pitch||n.bearing!==i.bearing||n.altitude!==i.altitude;return r&&(this._map.jumpTo(this._viewStateToMapboxProps(n)),n.altitude!==i.altitude&&(this._map.transform.altitude=n.altitude)),r}},{key:"_getViewState",value:function(t){var e=t.viewState||t,i=e.longitude,n=e.latitude,r=e.zoom,o=e.pitch,s=void 0===o?0:o,a=e.bearing,l=void 0===a?0:a,c=e.altitude;return{longitude:i,latitude:n,zoom:r,pitch:s,bearing:l,altitude:void 0===c?1.5:c}}},{key:"_checkStyleSheet",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"0.47.0";if("undefined"!==typeof O)try{var e=O.createElement("div");if(e.className="mapboxgl-map",e.style.display="none",O.body.appendChild(e),!("static"!==window.getComputedStyle(e).position)){var i=O.createElement("link");i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href","https://api.tiles.mapbox.com/mapbox-gl-js/v".concat(t,"/mapbox-gl.css")),O.head.appendChild(i)}}catch(n){}}},{key:"_viewStateToMapboxProps",value:function(t){return{center:[t.longitude,t.latitude],zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}}}]),t}();(0,o.Z)(V,"initialized",!1),(0,o.Z)(V,"propTypes",G),(0,o.Z)(V,"defaultProps",Z),(0,o.Z)(V,"savedMap",null);var H=i(9794),J=i.n(H);function W(t){return Array.isArray(t)||ArrayBuffer.isView(t)}function Q(t,e){if(t===e)return!0;if(W(t)&&W(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;++i)if(!Q(t[i],e[i]))return!1;return!0}return Math.abs(t-e)<=1e-7}function q(t,e,i){return Math.max(e,Math.min(i,t))}function K(t,e,i){return W(t)?t.map((function(t,n){return K(t,e[n],i)})):i*e+(1-i)*t}function X(t,e){if(!t)throw new Error(e||"react-map-gl: assertion failed.")}function Y(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function $(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Y(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Y(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var tt={minZoom:0,maxZoom:24,minPitch:0,maxPitch:60},et=0,it=0,nt=1.5,rt=function(){function t(e){var i=e.width,n=e.height,r=e.latitude,o=e.longitude,s=e.zoom,a=e.bearing,l=void 0===a?it:a,c=e.pitch,u=void 0===c?et:c,h=e.altitude,d=void 0===h?nt:h,p=e.maxZoom,A=void 0===p?tt.maxZoom:p,f=e.minZoom,g=void 0===f?tt.minZoom:f,m=e.maxPitch,y=void 0===m?tt.maxPitch:m,v=e.minPitch,_=void 0===v?tt.minPitch:v,b=e.transitionDuration,x=e.transitionEasing,w=e.transitionInterpolator,C=e.transitionInterruption,B=e.startPanLngLat,E=e.startZoomLngLat,S=e.startRotatePos,T=e.startBearing,M=e.startPitch,I=e.startZoom;(0,D.Z)(this,t),X(Number.isFinite(i),"`width` must be supplied"),X(Number.isFinite(n),"`height` must be supplied"),X(Number.isFinite(o),"`longitude` must be supplied"),X(Number.isFinite(r),"`latitude` must be supplied"),X(Number.isFinite(s),"`zoom` must be supplied"),this._viewportProps=this._applyConstraints({width:i,height:n,latitude:r,longitude:o,zoom:s,bearing:l,pitch:u,altitude:d,maxZoom:A,minZoom:g,maxPitch:y,minPitch:_,transitionDuration:b,transitionEasing:x,transitionInterpolator:w,transitionInterruption:C}),this._state={startPanLngLat:B,startZoomLngLat:E,startRotatePos:S,startBearing:T,startPitch:M,startZoom:I}}return(0,L.Z)(t,[{key:"getViewportProps",value:function(){return this._viewportProps}},{key:"getState",value:function(){return this._state}},{key:"panStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startPanLngLat:this._unproject(e)})}},{key:"pan",value:function(t){var e=t.pos,i=t.startPos,n=this._state.startPanLngLat||this._unproject(i);if(!n)return this;var r=this._calculateNewLngLat({startPanLngLat:n,pos:e}),o=(0,l.Z)(r,2),s=o[0],a=o[1];return this._getUpdatedMapState({longitude:s,latitude:a})}},{key:"panEnd",value:function(){return this._getUpdatedMapState({startPanLngLat:null})}},{key:"rotateStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startRotatePos:e,startBearing:this._viewportProps.bearing,startPitch:this._viewportProps.pitch})}},{key:"rotate",value:function(t){var e,i=t.pos,n=t.deltaAngleX,r=void 0===n?0:n,o=t.deltaAngleY,s=void 0===o?0:o,a=this._state,l=a.startRotatePos,c=a.startBearing,u=a.startPitch;return Number.isFinite(c)&&Number.isFinite(u)?(e=i?this._calculateNewPitchAndBearing($($({},this._getRotationParams(i,l)),{},{startBearing:c,startPitch:u})):{bearing:c+r,pitch:u+s},this._getUpdatedMapState(e)):this}},{key:"rotateEnd",value:function(){return this._getUpdatedMapState({startBearing:null,startPitch:null})}},{key:"zoomStart",value:function(t){var e=t.pos;return this._getUpdatedMapState({startZoomLngLat:this._unproject(e),startZoom:this._viewportProps.zoom})}},{key:"zoom",value:function(t){var e=t.pos,i=t.startPos,n=t.scale;X(n>0,"`scale` must be a positive number");var r=this._state,o=r.startZoom,s=r.startZoomLngLat;Number.isFinite(o)||(o=this._viewportProps.zoom,s=this._unproject(i)||this._unproject(e)),X(s,"`startZoomLngLat` prop is required for zoom behavior to calculate where to position the map.");var a=this._calculateNewZoom({scale:n,startZoom:o||0}),u=new c.DW(Object.assign({},this._viewportProps,{zoom:a})).getMapCenterByLngLatPosition({lngLat:s,pos:e}),h=(0,l.Z)(u,2),d=h[0],p=h[1];return this._getUpdatedMapState({zoom:a,longitude:d,latitude:p})}},{key:"zoomEnd",value:function(){return this._getUpdatedMapState({startZoomLngLat:null,startZoom:null})}},{key:"_getUpdatedMapState",value:function(e){return new t(Object.assign({},this._viewportProps,this._state,e))}},{key:"_applyConstraints",value:function(t){var e=t.maxZoom,i=t.minZoom,n=t.zoom;t.zoom=q(n,i,e);var r=t.maxPitch,o=t.minPitch,s=t.pitch;return t.pitch=q(s,o,r),Object.assign(t,(0,c.QA)(t)),t}},{key:"_unproject",value:function(t){var e=new c.DW(this._viewportProps);return t&&e.unproject(t)}},{key:"_calculateNewLngLat",value:function(t){var e=t.startPanLngLat,i=t.pos;return new c.DW(this._viewportProps).getMapCenterByLngLatPosition({lngLat:e,pos:i})}},{key:"_calculateNewZoom",value:function(t){var e=t.scale,i=t.startZoom,n=this._viewportProps,r=n.maxZoom,o=n.minZoom;return q(i+Math.log2(e),o,r)}},{key:"_calculateNewPitchAndBearing",value:function(t){var e=t.deltaScaleX,i=t.deltaScaleY,n=t.startBearing,r=t.startPitch;i=q(i,-1,1);var o=this._viewportProps,s=o.minPitch,a=o.maxPitch,l=r;return i>0?l=r+i*(a-r):i<0&&(l=r-i*(s-r)),{pitch:l,bearing:n+180*e}}},{key:"_getRotationParams",value:function(t,e){var i=t[0]-e[0],n=t[1]-e[1],r=t[1],o=e[1],s=this._viewportProps,a=s.width,l=s.height,c=i/a,u=0;return n>0?Math.abs(l-o)>5&&(u=n/(o-l)*1.2):n<0&&o>5&&(u=1-r/o),{deltaScaleX:c,deltaScaleY:u=Math.min(1,Math.max(-1,u))}}}]),t}();function ot(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function st(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ot(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var at=(0,s.createContext)({viewport:null,map:null,container:null,onViewportChange:null,onViewStateChange:null,eventManager:null}),lt=at.Provider;at.Provider=function(t){var e=t.value,i=t.children,n=(0,s.useState)(null),r=(0,l.Z)(n,2),o=r[0],a=r[1],c=(0,s.useContext)(at);return e=st(st({setMap:a},c),{},{map:c&&c.map||o},e),s.createElement(lt,{value:e},i)};const ct=at;const ut="undefined"!==typeof window?s.useLayoutEffect:s.useEffect;function ht(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function dt(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ht(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ht(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var pt="A valid API access token is required to use Mapbox data";function At(t){var e=t.props,i=t.width,n=t.height;return new c.DW(dt(dt(dt({},e),e.viewState),{},{width:i,height:n}))}var ft={position:"absolute",width:"100%",height:"100%",overflow:"hidden"},gt=Object.assign({},V.propTypes,{width:a.oneOfType([a.number,a.string]),height:a.oneOfType([a.number,a.string]),onResize:a.func,disableTokenWarning:a.bool,visible:a.bool,className:a.string,style:a.object,visibilityConstraints:a.object}),mt=Object.assign({},V.defaultProps,{disableTokenWarning:!1,visible:!0,onResize:function(){},className:"",style:null,visibilityConstraints:tt});function yt(){return s.createElement("div",{key:"warning",id:"no-token-warning",style:{position:"absolute",left:0,top:0}},s.createElement("h3",{key:"header"},pt),s.createElement("div",{key:"text"},"For information on setting up your basemap, read"),s.createElement("a",{key:"link",href:"https://visgl.github.io/react-map-gl/docs/get-started/mapbox-tokens"},"Note on Map Tokens"))}var vt=(0,s.forwardRef)((function(t,e){var i=(0,s.useState)(!0),n=(0,l.Z)(i,2),r=n[0],o=n[1],a=(0,s.useState)({width:0,height:0}),c=(0,l.Z)(a,2),u=c[0],h=c[1],d=(0,s.useRef)(null),p=(0,s.useRef)(null),A=(0,s.useRef)(null),f=(0,s.useRef)(null),g=(0,s.useContext)(ct);ut((function(){if(vt.supported()){var e=new V(dt(dt(dt({},t),u),{},{mapboxgl:J(),container:p.current,onError:function(e){401===(e.error&&e.error.status||e.status)&&r&&(console.error(pt),o(!1)),t.onError(e)}}));d.current=e,g&&g.setMap&&g.setMap(e.getMap());var i=new P((function(e){if(e[0].contentRect){var i=e[0].contentRect,n=i.width,r=i.height;h({width:n,height:r}),t.onResize({width:n,height:r})}}));return i.observe(A.current),function(){e.finalize(),d.current=null,i.disconnect()}}}),[]),ut((function(){d.current&&d.current.setProps(dt(dt({},t),u))}));var m=d.current&&d.current.getMap();(0,s.useImperativeHandle)(e,(function(){return function(t){return{getMap:function(){return t.current&&t.current.getMap()},queryRenderedFeatures:function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.current&&t.current.getMap();return n&&n.queryRenderedFeatures(e,i)}}}(d)}),[]);var y=(0,s.useCallback)((function(t){var e=t.target;e===f.current&&e.scrollTo(0,0)}),[]),v=m&&s.createElement(lt,{value:dt(dt({},g),{},{viewport:g.viewport||At(dt({map:m,props:t},u)),map:m,container:g.container||A.current})},s.createElement("div",{key:"map-overlays",className:"overlays",ref:f,style:ft,onScroll:y},t.children)),_=t.className,b=t.width,x=t.height,w=t.style,C=t.visibilityConstraints,B=Object.assign({position:"relative"},w,{width:b,height:x}),E=t.visible&&function(t){var e,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:tt;for(var n in i){var r=n.slice(0,3),o=(e=n.slice(3))[0].toLowerCase()+e.slice(1);if("min"===r&&t[o]<i[n])return!1;if("max"===r&&t[o]>i[n])return!1}return!0}(t.viewState||t,C),S=Object.assign({},ft,{visibility:E?"inherit":"hidden"});return s.createElement("div",{key:"map-container",ref:A,style:B},s.createElement("div",{key:"map-mapbox",ref:p,style:S,className:_}),v,!r&&!t.disableTokenWarning&&s.createElement(yt,null))}));vt.supported=function(){return J()&&J().supported()},vt.propTypes=gt,vt.defaultProps=mt;const _t=vt;function bt(t,e){var i;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"===typeof t)return xt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return xt(t,e)}(t))||e&&t&&"number"===typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var wt=function(){function t(){(0,D.Z)(this,t),(0,o.Z)(this,"propNames",[])}return(0,L.Z)(t,[{key:"arePropsEqual",value:function(t,e){var i,n=bt(this.propNames||[]);try{for(n.s();!(i=n.n()).done;){var r=i.value;if(!Q(t[r],e[r]))return!1}}catch(o){n.e(o)}finally{n.f()}return!0}},{key:"initializeProps",value:function(t,e){return{start:t,end:e}}},{key:"interpolateProps",value:function(t,e,i){X(!1,"interpolateProps is not implemented")}},{key:"getDuration",value:function(t,e){return e.transitionDuration}}]),t}(),Ct=i(47169),Bt=i(67591),Et=i(33940);function St(t,e){if(e&&("object"===(0,Et.Z)(e)||"function"===typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,Ct.Z)(t)}function Tt(t){return Tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Tt(t)}var Mt={longitude:1,bearing:1};function It(t){return Number.isFinite(t)||Array.isArray(t)}function Pt(t,e,i){return function(t){return t in Mt}(t)&&Math.abs(i-e)>180&&(i=i<0?i+360:i-360),i}function Dt(t,e){var i;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"===typeof t)return Lt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Lt(t,e)}(t))||e&&t&&"number"===typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function Lt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Ot(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Tt(t);if(e){var r=Tt(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return St(this,i)}}var Ft=["longitude","latitude","zoom","bearing","pitch"],Rt=["latitude","longitude","zoom","width","height"],kt=["bearing","pitch"],zt={speed:1.2,curve:1.414};!function(t){(0,Bt.Z)(i,t);var e=Ot(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,D.Z)(this,i),t=e.call(this),(0,o.Z)((0,Ct.Z)(t),"propNames",Ft),t.props=Object.assign({},zt,n),t}(0,L.Z)(i,[{key:"initializeProps",value:function(t,e){var i,n={},r={},o=Dt(Rt);try{for(o.s();!(i=o.n()).done;){var s=i.value,a=t[s],l=e[s];X(It(a)&&It(l),"".concat(s," must be supplied for transition")),n[s]=a,r[s]=Pt(s,a,l)}}catch(A){o.e(A)}finally{o.f()}var c,u=Dt(kt);try{for(u.s();!(c=u.n()).done;){var h=c.value,d=t[h]||0,p=e[h]||0;n[h]=d,r[h]=Pt(h,d,p)}}catch(A){u.e(A)}finally{u.f()}return{start:n,end:r}}},{key:"interpolateProps",value:function(t,e,i){var n,r=(0,c.if)(t,e,i,this.props),o=Dt(kt);try{for(o.s();!(n=o.n()).done;){var s=n.value;r[s]=K(t[s],e[s],i)}}catch(a){o.e(a)}finally{o.f()}return r}},{key:"getDuration",value:function(t,e){var i=e.transitionDuration;return"auto"===i&&(i=(0,c.up)(t,e,this.props)),i}}])}(wt);function Ut(t,e){var i;if("undefined"===typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(i=function(t,e){if(!t)return;if("string"===typeof t)return Nt(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);"Object"===i&&t.constructor&&(i=t.constructor.name);if("Map"===i||"Set"===i)return Array.from(t);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Nt(t,e)}(t))||e&&t&&"number"===typeof t.length){i&&(t=i);var n=0,r=function(){};return{s:r,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){i=t[Symbol.iterator]()},n:function(){var t=i.next();return s=t.done,t},e:function(t){a=!0,o=t},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function Nt(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function Gt(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Tt(t);if(e){var r=Tt(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return St(this,i)}}var Zt=["longitude","latitude","zoom","bearing","pitch"],jt=function(t){(0,Bt.Z)(i,t);var e=Gt(i);function i(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,D.Z)(this,i),t=e.call(this),Array.isArray(n)&&(n={transitionProps:n}),t.propNames=n.transitionProps||Zt,n.around&&(t.around=n.around),t}return(0,L.Z)(i,[{key:"initializeProps",value:function(t,e){var i={},n={};if(this.around){i.around=this.around;var r=new c.DW(t).unproject(this.around);Object.assign(n,e,{around:new c.DW(e).project(r),aroundLngLat:r})}var o,s=Ut(this.propNames);try{for(s.s();!(o=s.n()).done;){var a=o.value,l=t[a],u=e[a];X(It(l)&&It(u),"".concat(a," must be supplied for transition")),i[a]=l,n[a]=Pt(a,l,u)}}catch(h){s.e(h)}finally{s.f()}return{start:i,end:n}}},{key:"interpolateProps",value:function(t,e,i){var n,r={},o=Ut(this.propNames);try{for(o.s();!(n=o.n()).done;){var s=n.value;r[s]=K(t[s],e[s],i)}}catch(p){o.e(p)}finally{o.f()}if(e.around){var a=new c.DW(Object.assign({},e,r)).getMapCenterByLngLatPosition({lngLat:e.aroundLngLat,pos:K(t.around,e.around,i)}),u=(0,l.Z)(a,2),h=u[0],d=u[1];r.longitude=h,r.latitude=d}return r}}]),i}(wt),Vt=function(){};var Ht=1,Jt=2,Wt=3,Qt=4,qt={transitionDuration:0,transitionEasing:function(t){return t},transitionInterpolator:new jt,transitionInterruption:Ht,onTransitionStart:Vt,onTransitionInterrupt:Vt,onTransitionEnd:Vt},Kt=function(){function t(){var e=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,D.Z)(this,t),(0,o.Z)(this,"_animationFrame",null),(0,o.Z)(this,"_onTransitionFrame",(function(){e._animationFrame=requestAnimationFrame(e._onTransitionFrame),e._updateViewport()})),this.props=null,this.onViewportChange=i.onViewportChange||Vt,this.onStateChange=i.onStateChange||Vt,this.time=i.getTime||Date.now}return(0,L.Z)(t,[{key:"getViewportInTransition",value:function(){return this._animationFrame?this.state.propsInTransition:null}},{key:"processViewportChange",value:function(t){var e=this.props;if(this.props=t,!e||this._shouldIgnoreViewportChange(e,t))return!1;if(this._isTransitionEnabled(t)){var i=Object.assign({},e),n=Object.assign({},t);if(this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this.state.interruption===Jt?Object.assign(i,this.state.endProps):Object.assign(i,this.state.propsInTransition),this.state.interruption===Qt)){var r=this.time(),o=(r-this.state.startTime)/this.state.duration;n.transitionDuration=this.state.duration-(r-this.state.startTime),n.transitionEasing=function(t,e){var i=t(e);return function(n){return 1/(1-i)*(t(n*(1-e)+e)-i)}}(this.state.easing,o),n.transitionInterpolator=i.transitionInterpolator}return n.onTransitionStart(),this._triggerTransition(i,n),!0}return this._isTransitionInProgress()&&(e.onTransitionInterrupt(),this._endTransition()),!1}},{key:"_isTransitionInProgress",value:function(){return Boolean(this._animationFrame)}},{key:"_isTransitionEnabled",value:function(t){var e=t.transitionDuration,i=t.transitionInterpolator;return(e>0||"auto"===e)&&Boolean(i)}},{key:"_isUpdateDueToCurrentTransition",value:function(t){return!!this.state.propsInTransition&&this.state.interpolator.arePropsEqual(t,this.state.propsInTransition)}},{key:"_shouldIgnoreViewportChange",value:function(t,e){return!t||(this._isTransitionInProgress()?this.state.interruption===Wt||this._isUpdateDueToCurrentTransition(e):!this._isTransitionEnabled(e)||e.transitionInterpolator.arePropsEqual(t,e))}},{key:"_triggerTransition",value:function(t,e){X(this._isTransitionEnabled(e)),this._animationFrame&&cancelAnimationFrame(this._animationFrame);var i=e.transitionInterpolator,n=i.getDuration?i.getDuration(t,e):e.transitionDuration;if(0!==n){var r=e.transitionInterpolator.initializeProps(t,e),o={inTransition:!0,isZooming:t.zoom!==e.zoom,isPanning:t.longitude!==e.longitude||t.latitude!==e.latitude,isRotating:t.bearing!==e.bearing||t.pitch!==e.pitch};this.state={duration:n,easing:e.transitionEasing,interpolator:e.transitionInterpolator,interruption:e.transitionInterruption,startTime:this.time(),startProps:r.start,endProps:r.end,animation:null,propsInTransition:{}},this._onTransitionFrame(),this.onStateChange(o)}}},{key:"_endTransition",value:function(){this._animationFrame&&(cancelAnimationFrame(this._animationFrame),this._animationFrame=null),this.onStateChange({inTransition:!1,isZooming:!1,isPanning:!1,isRotating:!1})}},{key:"_updateViewport",value:function(){var t=this.time(),e=this.state,i=e.startTime,n=e.duration,r=e.easing,o=e.interpolator,s=e.startProps,a=e.endProps,l=!1,c=(t-i)/n;c>=1&&(c=1,l=!0),c=r(c);var u=o.interpolateProps(s,a,c),h=new rt(Object.assign({},this.props,u));this.state.propsInTransition=h.getViewportProps(),this.onViewportChange(this.state.propsInTransition,this.props),l&&(this._endTransition(),this.props.onTransitionEnd())}}]),t}();(0,o.Z)(Kt,"defaultProps",qt);var Xt=i(48331);function Yt(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function $t(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Yt(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Yt(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var te={transitionDuration:0},ee={transitionDuration:300,transitionEasing:function(t){return t},transitionInterpolator:new jt,transitionInterruption:Ht},ie=300,ne=function(t){return 1-(1-t)*(1-t)},re=["wheel"],oe=["panstart","panmove","panend"],se=["pinchstart","pinchmove","pinchend"],ae=["tripanstart","tripanmove","tripanend"],le=["doubletap"],ce=["keydown"],ue=function(){function t(){var e=this;(0,D.Z)(this,t),(0,o.Z)(this,"events",[]),(0,o.Z)(this,"scrollZoom",!0),(0,o.Z)(this,"dragPan",!0),(0,o.Z)(this,"dragRotate",!0),(0,o.Z)(this,"doubleClickZoom",!0),(0,o.Z)(this,"touchZoom",!0),(0,o.Z)(this,"touchRotate",!1),(0,o.Z)(this,"keyboard",!0),(0,o.Z)(this,"_interactionState",{isDragging:!1}),(0,o.Z)(this,"_events",{}),(0,o.Z)(this,"_setInteractionState",(function(t){Object.assign(e._interactionState,t),e.onStateChange&&e.onStateChange(e._interactionState)})),(0,o.Z)(this,"_onTransition",(function(t,i){e.onViewportChange(t,e._interactionState,i)})),this.handleEvent=this.handleEvent.bind(this),this._transitionManager=new Kt({onViewportChange:this._onTransition,onStateChange:this._setInteractionState})}return(0,L.Z)(t,[{key:"handleEvent",value:function(t){this.mapState=this.getMapState();var e=this._eventStartBlocked;switch(t.type){case"panstart":return!e&&this._onPanStart(t);case"panmove":return this._onPan(t);case"panend":return this._onPanEnd(t);case"pinchstart":return!e&&this._onPinchStart(t);case"pinchmove":return this._onPinch(t);case"pinchend":return this._onPinchEnd(t);case"tripanstart":return!e&&this._onTriplePanStart(t);case"tripanmove":return this._onTriplePan(t);case"tripanend":return this._onTriplePanEnd(t);case"doubletap":return this._onDoubleTap(t);case"wheel":return this._onWheel(t);case"keydown":return this._onKeyDown(t);default:return!1}}},{key:"getCenter",value:function(t){var e=t.offsetCenter;return[e.x,e.y]}},{key:"isFunctionKeyPressed",value:function(t){var e=t.srcEvent;return Boolean(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}},{key:"blockEvents",value:function(t){var e=this,i=setTimeout((function(){e._eventStartBlocked===i&&(e._eventStartBlocked=null)}),t);this._eventStartBlocked=i}},{key:"updateViewport",value:function(t,e,i){var n=this.mapState instanceof rt?this.mapState.getViewportProps():this.mapState,r=$t($t({},t.getViewportProps()),e),o=Object.keys(r).some((function(t){return n[t]!==r[t]}));this._state=t.getState(),this._setInteractionState(i),o&&this.onViewportChange(r,this._interactionState,n)}},{key:"getMapState",value:function(t){return new rt($t($t($t({},this.mapStateProps),this._state),t))}},{key:"isDragging",value:function(){return this._interactionState.isDragging}},{key:"setOptions",value:function(t){var e=t.onViewportChange,i=t.onStateChange,n=t.eventManager,r=void 0===n?this.eventManager:n,o=t.isInteractive,s=void 0===o||o,a=t.scrollZoom,l=void 0===a?this.scrollZoom:a,c=t.dragPan,u=void 0===c?this.dragPan:c,h=t.dragRotate,d=void 0===h?this.dragRotate:h,p=t.doubleClickZoom,A=void 0===p?this.doubleClickZoom:p,f=t.touchZoom,g=void 0===f?this.touchZoom:f,m=t.touchRotate,y=void 0===m?this.touchRotate:m,v=t.keyboard,_=void 0===v?this.keyboard:v;this.onViewportChange=e,this.onStateChange=i;var b=this.mapStateProps||{},x=b.height!==t.height||b.width!==t.width;this.mapStateProps=t,x&&(this.mapState=b,this.updateViewport(new rt(t))),this._transitionManager.processViewportChange(t),this.eventManager!==r&&(this.eventManager=r,this._events={},this.toggleEvents(this.events,!0)),this.toggleEvents(re,s&&Boolean(l)),this.toggleEvents(oe,s&&Boolean(u||d)),this.toggleEvents(se,s&&Boolean(g||y)),this.toggleEvents(ae,s&&Boolean(y)),this.toggleEvents(le,s&&Boolean(A)),this.toggleEvents(ce,s&&Boolean(_)),this.scrollZoom=l,this.dragPan=u,this.dragRotate=d,this.doubleClickZoom=A,this.touchZoom=g,this.touchRotate=y,this.keyboard=_}},{key:"toggleEvents",value:function(t,e){var i=this;this.eventManager&&t.forEach((function(t){i._events[t]!==e&&(i._events[t]=e,e?i.eventManager.on(t,i.handleEvent):i.eventManager.off(t,i.handleEvent))}))}},{key:"_onPanStart",value:function(t){var e=this.getCenter(t);this._panRotate=this.isFunctionKeyPressed(t)||t.rightButton;var i=this._panRotate?this.mapState.rotateStart({pos:e}):this.mapState.panStart({pos:e});return this.updateViewport(i,te,{isDragging:!0}),!0}},{key:"_onPan",value:function(t){return!!this.isDragging()&&(this._panRotate?this._onPanRotate(t):this._onPanMove(t))}},{key:"_onPanEnd",value:function(t){return!!this.isDragging()&&(this._panRotate?this._onPanRotateEnd(t):this._onPanMoveEnd(t))}},{key:"_onPanMove",value:function(t){if(!this.dragPan)return!1;var e=this.getCenter(t),i=this.mapState.pan({pos:e});return this.updateViewport(i,te,{isPanning:!0}),!0}},{key:"_onPanMoveEnd",value:function(t){if(this.dragPan){var e=this.dragPan.inertia,i=void 0===e?ie:e;if(i&&t.velocity){var n=this.getCenter(t),r=[n[0]+t.velocityX*i/2,n[1]+t.velocityY*i/2],o=this.mapState.pan({pos:r}).panEnd();return this.updateViewport(o,$t($t({},ee),{},{transitionDuration:i,transitionEasing:ne}),{isDragging:!1,isPanning:!0}),!0}}var s=this.mapState.panEnd();return this.updateViewport(s,null,{isDragging:!1,isPanning:!1}),!0}},{key:"_onPanRotate",value:function(t){if(!this.dragRotate)return!1;var e=this.getCenter(t),i=this.mapState.rotate({pos:e});return this.updateViewport(i,te,{isRotating:!0}),!0}},{key:"_onPanRotateEnd",value:function(t){if(this.dragRotate){var e=this.dragRotate.inertia,i=void 0===e?ie:e;if(i&&t.velocity){var n=this.getCenter(t),r=[n[0]+t.velocityX*i/2,n[1]+t.velocityY*i/2],o=this.mapState.rotate({pos:r}).rotateEnd();return this.updateViewport(o,$t($t({},ee),{},{transitionDuration:i,transitionEasing:ne}),{isDragging:!1,isRotating:!0}),!0}}var s=this.mapState.panEnd();return this.updateViewport(s,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onWheel",value:function(t){if(!this.scrollZoom)return!1;var e=this.scrollZoom,i=e.speed,n=void 0===i?.01:i,r=e.smooth,o=void 0!==r&&r;t.preventDefault();var s=this.getCenter(t),a=t.delta,l=2/(1+Math.exp(-Math.abs(a*n)));a<0&&0!==l&&(l=1/l);var c=this.mapState.zoom({pos:s,scale:l});return c.getViewportProps().zoom!==this.mapStateProps.zoom&&(this.updateViewport(c,$t($t({},ee),{},{transitionInterpolator:new jt({around:s}),transitionDuration:o?250:1}),{isPanning:!0,isZooming:!0}),!0)}},{key:"_onPinchStart",value:function(t){var e=this.getCenter(t),i=this.mapState.zoomStart({pos:e}).rotateStart({pos:e});return this._startPinchRotation=t.rotation,this._lastPinchEvent=t,this.updateViewport(i,te,{isDragging:!0}),!0}},{key:"_onPinch",value:function(t){if(!this.isDragging())return!1;if(!this.touchZoom&&!this.touchRotate)return!1;var e=this.mapState;if(this.touchZoom){var i=t.scale,n=this.getCenter(t);e=e.zoom({pos:n,scale:i})}if(this.touchRotate){var r=t.rotation;e=e.rotate({deltaAngleX:this._startPinchRotation-r})}return this.updateViewport(e,te,{isDragging:!0,isPanning:Boolean(this.touchZoom),isZooming:Boolean(this.touchZoom),isRotating:Boolean(this.touchRotate)}),this._lastPinchEvent=t,!0}},{key:"_onPinchEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchZoom){var e=this.touchZoom.inertia,i=void 0===e?ie:e,n=this._lastPinchEvent;if(i&&n&&t.scale!==n.scale){var r=this.getCenter(t),o=this.mapState.rotateEnd(),s=Math.log2(t.scale),a=(s-Math.log2(n.scale))/(t.deltaTime-n.deltaTime),l=Math.pow(2,s+a*i/2);return o=o.zoom({pos:r,scale:l}).zoomEnd(),this.updateViewport(o,$t($t({},ee),{},{transitionInterpolator:new jt({around:r}),transitionDuration:i,transitionEasing:ne}),{isDragging:!1,isPanning:Boolean(this.touchZoom),isZooming:Boolean(this.touchZoom),isRotating:!1}),this.blockEvents(i),!0}}var c=this.mapState.zoomEnd().rotateEnd();return this._state.startPinchRotation=0,this.updateViewport(c,null,{isDragging:!1,isPanning:!1,isZooming:!1,isRotating:!1}),this._startPinchRotation=null,this._lastPinchEvent=null,!0}},{key:"_onTriplePanStart",value:function(t){var e=this.getCenter(t),i=this.mapState.rotateStart({pos:e});return this.updateViewport(i,te,{isDragging:!0}),!0}},{key:"_onTriplePan",value:function(t){if(!this.isDragging())return!1;if(!this.touchRotate)return!1;var e=this.getCenter(t);e[0]-=t.deltaX;var i=this.mapState.rotate({pos:e});return this.updateViewport(i,te,{isRotating:!0}),!0}},{key:"_onTriplePanEnd",value:function(t){if(!this.isDragging())return!1;if(this.touchRotate){var e=this.touchRotate.inertia,i=void 0===e?ie:e;if(i&&t.velocityY){var n=this.getCenter(t),r=[n[0],n[1]+=t.velocityY*i/2],o=this.mapState.rotate({pos:r});return this.updateViewport(o,$t($t({},ee),{},{transitionDuration:i,transitionEasing:ne}),{isDragging:!1,isRotating:!0}),this.blockEvents(i),!1}}var s=this.mapState.rotateEnd();return this.updateViewport(s,null,{isDragging:!1,isRotating:!1}),!0}},{key:"_onDoubleTap",value:function(t){if(!this.doubleClickZoom)return!1;var e=this.getCenter(t),i=this.isFunctionKeyPressed(t),n=this.mapState.zoom({pos:e,scale:i?.5:2});return this.updateViewport(n,Object.assign({},ee,{transitionInterpolator:new jt({around:e})}),{isZooming:!0}),!0}},{key:"_onKeyDown",value:function(t){if(!this.keyboard)return!1;var e,i=this.isFunctionKeyPressed(t),n=this.keyboard,r=n.zoomSpeed,o=void 0===r?2:r,s=n.moveSpeed,a=void 0===s?100:s,l=n.rotateSpeedX,c=void 0===l?15:l,u=n.rotateSpeedY,h=void 0===u?10:u,d=this.mapStateProps;switch(t.srcEvent.keyCode){case 189:e=i?this.getMapState({zoom:d.zoom-Math.log2(o)-1}):this.getMapState({zoom:d.zoom-Math.log2(o)});break;case 187:e=i?this.getMapState({zoom:d.zoom+Math.log2(o)+1}):this.getMapState({zoom:d.zoom+Math.log2(o)});break;case 37:e=i?this.getMapState({bearing:d.bearing-c}):this.mapState.pan({pos:[a,0],startPos:[0,0]});break;case 39:e=i?this.getMapState({bearing:d.bearing+c}):this.mapState.pan({pos:[-a,0],startPos:[0,0]});break;case 38:e=i?this.getMapState({pitch:d.pitch+h}):this.mapState.pan({pos:[0,a],startPos:[0,0]});break;case 40:e=i?this.getMapState({pitch:d.pitch-h}):this.mapState.pan({pos:[0,-a],startPos:[0,0]});break;default:return!1}return this.updateViewport(e,ee)}}]),t}();function he(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function de(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?he(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):he(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var pe=Object.assign({},_t.propTypes,{maxZoom:a.number,minZoom:a.number,maxPitch:a.number,minPitch:a.number,onViewStateChange:a.func,onViewportChange:a.func,onInteractionStateChange:a.func,transitionDuration:a.oneOfType([a.number,a.string]),transitionInterpolator:a.object,transitionInterruption:a.number,transitionEasing:a.func,onTransitionStart:a.func,onTransitionInterrupt:a.func,onTransitionEnd:a.func,scrollZoom:a.oneOfType([a.bool,a.object]),dragPan:a.oneOfType([a.bool,a.object]),dragRotate:a.oneOfType([a.bool,a.object]),doubleClickZoom:a.bool,touchZoom:a.oneOfType([a.bool,a.object]),touchRotate:a.oneOfType([a.bool,a.object]),keyboard:a.oneOfType([a.bool,a.object]),onHover:a.func,onClick:a.func,onDblClick:a.func,onContextMenu:a.func,onMouseDown:a.func,onMouseMove:a.func,onMouseUp:a.func,onTouchStart:a.func,onTouchMove:a.func,onTouchEnd:a.func,onMouseEnter:a.func,onMouseLeave:a.func,onMouseOut:a.func,onWheel:a.func,touchAction:a.string,eventRecognizerOptions:a.object,clickRadius:a.number,interactiveLayerIds:a.array,getCursor:a.func,controller:a.instanceOf(ue)}),Ae=Object.assign({},_t.defaultProps,tt,Kt.defaultProps,{onViewStateChange:null,onViewportChange:null,onClick:null,onNativeClick:null,onHover:null,onContextMenu:function(t){return t.preventDefault()},scrollZoom:!0,dragPan:!0,dragRotate:!0,doubleClickZoom:!0,touchZoom:!0,touchRotate:!1,keyboard:!0,touchAction:"none",eventRecognizerOptions:{},clickRadius:0,getCursor:function(t){var e=t.isDragging,i=t.isHovering;return e?"grabbing":i?"pointer":"grab"}});function fe(t){if(t.lngLat||!t.offsetCenter)return t;var e=t.offsetCenter,i=e.x,n=e.y;if(!Number.isFinite(i)||!Number.isFinite(n))return t;var r=[i,n];return t.point=r,t.lngLat=this.viewport.unproject(r),t}function ge(t){var e=this.map;if(!e||!t)return null;var i={},n=this.props.clickRadius;this.props.interactiveLayerIds&&(i.layers=this.props.interactiveLayerIds);try{return e.queryRenderedFeatures(n?[[t[0]-n,t[1]+n],[t[0]+n,t[1]-n]]:t,i)}catch(r){return null}}function me(t,e){var i=this.props[t];i&&i(fe.call(this,e))}function ye(t){me.call(this,"touch"===t.pointerType?"onTouchStart":"onMouseDown",t)}function ve(t){me.call(this,"touch"===t.pointerType?"onTouchEnd":"onMouseUp",t)}function _e(t){if(me.call(this,"touch"===t.pointerType?"onTouchMove":"onMouseMove",t),!this.state.isDragging){var e,i=this.props,n=i.onHover,r=i.interactiveLayerIds;t=fe.call(this,t),(r||n)&&(e=ge.call(this,t.point));var o=Boolean(r&&e&&e.length>0),s=o&&!this.state.isHovering,a=!o&&this.state.isHovering;(n||s)&&(t.features=e,n&&n(t)),s&&me.call(this,"onMouseEnter",t),a&&me.call(this,"onMouseLeave",t),(s||a)&&this.setState({isHovering:o})}}function be(t){var e=this.props,i=e.onClick,n=e.onNativeClick,r=e.onDblClick,o=e.doubleClickZoom,s=[],a=r||o;switch(t.type){case"anyclick":s.push(n),a||s.push(i);break;case"click":a&&s.push(i)}(s=s.filter(Boolean)).length&&((t=fe.call(this,t)).features=ge.call(this,t.point),s.forEach((function(e){return e(t)})))}var xe=(0,s.forwardRef)((function(t,e){var i=(0,s.useContext)(ct),o=(0,s.useMemo)((function(){return t.controller||new ue}),[]),a=(0,s.useMemo)((function(){return new Xt.Q(null,{touchAction:t.touchAction,recognizerOptions:t.eventRecognizerOptions})}),[]),l=(0,s.useRef)(null),c=(0,s.useRef)(null),u=(0,s.useRef)({width:0,height:0,state:{isHovering:!1,isDragging:!1}}).current;u.props=t,u.map=c.current&&c.current.getMap(),u.setState=function(e){u.state=de(de({},u.state),e),l.current.style.cursor=t.getCursor(u.state)};var h,d,p=!0,A=function(t,e,i){if(p)h=[t,e,i];else{var n=u.props,r=n.onViewStateChange,o=n.onViewportChange;r&&r({viewState:t,interactionState:e,oldViewState:i}),o&&o(t,e,i)}};(0,s.useImperativeHandle)(e,(function(){return function(t){return{getMap:t.current&&t.current.getMap,queryRenderedFeatures:t.current&&t.current.queryRenderedFeatures}}(c)}),[]);var f=(0,s.useMemo)((function(){return de(de({},i),{},{eventManager:a,container:i.container||l.current})}),[i,l.current]);f.onViewportChange=A,f.viewport=i.viewport||At(u),u.viewport=f.viewport;var g=function(t){var e=t.isDragging,i=void 0!==e&&e;if(i!==u.state.isDragging&&u.setState({isDragging:i}),p)d=t;else{var n=u.props.onInteractionStateChange;n&&n(t)}},m=function(){u.width&&u.height&&o.setOptions(de(de(de({},u.props),u.props.viewState),{},{isInteractive:Boolean(u.props.onViewStateChange||u.props.onViewportChange),onViewportChange:A,onStateChange:g,eventManager:a,width:u.width,height:u.height}))};(0,s.useEffect)((function(){return a.setElement(l.current),a.on({pointerdown:ye.bind(u),pointermove:_e.bind(u),pointerup:ve.bind(u),pointerleave:me.bind(u,"onMouseOut"),click:be.bind(u),anyclick:be.bind(u),dblclick:me.bind(u,"onDblClick"),wheel:me.bind(u,"onWheel"),contextmenu:me.bind(u,"onContextMenu")}),function(){a.destroy()}}),[]),ut((function(){h&&A.apply(void 0,(0,r.Z)(h)),d&&g(d)})),m();var y=t.width,v=t.height,_=t.style,b=t.getCursor,x=(0,s.useMemo)((function(){return de(de({position:"relative"},_),{},{width:y,height:v,cursor:b(u.state)})}),[_,y,v,b,u.state]);return h&&u._child||(u._child=s.createElement(lt,{value:f},s.createElement("div",{key:"event-canvas",ref:l,style:x},s.createElement(_t,(0,n.Z)({},t,{width:"100%",height:"100%",style:null,onResize:function(t){var e=t.width,i=t.height;u.width=e,u.height=i,m(),u.props.onResize({width:e,height:i})},ref:c}))))),p=!1,u._child}));xe.supported=_t.supported,xe.propTypes=pe,xe.defaultProps=Ae;function we(t,e){if(t===e)return!0;if(!t||!e)return!1;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(var i=0;i<t.length;i++)if(!we(t[i],e[i]))return!1;return!0}if(Array.isArray(e))return!1;if("object"===(0,Et.Z)(t)&&"object"===(0,Et.Z)(e)){var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var o=0,s=n;o<s.length;o++){var a=s[o];if(!e.hasOwnProperty(a))return!1;if(!we(t[a],e[a]))return!1}return!0}return!1}function Ce(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Be={type:a.string.isRequired,id:a.string},Ee=0;function Se(t,e,i){if(t&&t.style&&t.style._loaded){var n=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ce(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ce(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({},i);return delete n.id,delete n.children,t.addSource(e,n),t.getSource(e)}return null}function Te(t){var e=(0,s.useContext)(ct),i=(0,s.useRef)({id:t.id,type:t.type}),n=(0,s.useState)(0),r=(0,l.Z)(n,2)[1],o=(0,s.useMemo)((function(){return t.id||"jsx-source-".concat(Ee++)}),[]),a=e.map;(0,s.useEffect)((function(){if(a){var t=function(){return r((function(t){return t+1}))};return a.on("styledata",t),function(){a.off("styledata",t),requestAnimationFrame((function(){a.style&&a.style._loaded&&a.getSource(o)&&a.removeSource(o)}))}}}),[a,o]);var c=a&&a.style&&a.getSource(o);return c?function(t,e,i){X(e.id===i.id,"source id changed"),X(e.type===i.type,"source type changed");var n="",r=0;for(var o in e)"children"===o||"id"===o||we(i[o],e[o])||(n=o,r++);if(r){var s=e.type;if("geojson"===s)t.setData(e.data);else if("image"===s)t.updateImage({url:e.url,coordinates:e.coordinates});else if("canvas"!==s&&"video"!==s||1!==r||"coordinates"!==n)if("vector"===s&&t.setUrl)switch(n){case"url":t.setUrl(e.url);break;case"tiles":t.setTiles(e.tiles)}else console.warn("Unable to update <Source> prop: ".concat(n));else t.setCoordinates(e.coordinates)}}(c,t,i.current):c=Se(a,o,t),i.current=t,c&&s.Children.map(t.children,(function(t){return t&&(0,s.cloneElement)(t,{source:o})}))||null}Te.propTypes=Be;var Me=i(53782);function Ie(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function Pe(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ie(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ie(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var De={type:a.oneOf(["fill","line","symbol","circle","fill-extrusion","raster","background","heatmap","hillshade"]).isRequired,id:a.string,source:a.string,beforeId:a.string};function Le(t,e,i,n){X(i.id===n.id,"layer id changed"),X(i.type===n.type,"layer type changed");try{!function(t,e,i,n){var r=i.layout,o=void 0===r?{}:r,s=i.paint,a=void 0===s?{}:s,l=i.filter,c=i.minzoom,u=i.maxzoom,h=i.beforeId,d=(0,Me.Z)(i,["layout","paint","filter","minzoom","maxzoom","beforeId"]);if(h!==n.beforeId&&t.moveLayer(e,h),o!==n.layout){var p=n.layout||{};for(var A in o)we(o[A],p[A])||t.setLayoutProperty(e,A,o[A]);for(var f in p)o.hasOwnProperty(f)||t.setLayoutProperty(e,f,void 0)}if(a!==n.paint){var g=n.paint||{};for(var m in a)we(a[m],g[m])||t.setPaintProperty(e,m,a[m]);for(var y in g)a.hasOwnProperty(y)||t.setPaintProperty(e,y,void 0)}for(var v in we(l,n.filter)||t.setFilter(e,l),c===n.minzoom&&u===n.maxzoom||t.setLayerZoomRange(e,c,u),d)we(d[v],n[v])||t.setLayerProperty(e,v,d[v])}(t,e,i,n)}catch(r){console.warn(r)}}var Oe=0;function Fe(t){var e=(0,s.useContext)(ct),i=(0,s.useRef)({id:t.id,type:t.type}),n=(0,s.useState)(0),r=(0,l.Z)(n,2)[1],o=(0,s.useMemo)((function(){return t.id||"jsx-layer-".concat(Oe++)}),[]),a=e.map;return(0,s.useEffect)((function(){if(a){var t=function(){return r((function(t){return t+1}))};return a.on("styledata",t),function(){a.off("styledata",t),a.style&&a.style._loaded&&a.removeLayer(o)}}}),[a]),a&&a.style&&a.getLayer(o)?Le(a,o,t,i.current):function(t,e,i){if(t.style&&t.style._loaded){var n=Pe(Pe({},i),{},{id:e});delete n.beforeId,t.addLayer(n,i.beforeId)}}(a,o,t),i.current=t,null}Fe.propTypes=De;var Re={captureScroll:!1,captureDrag:!0,captureClick:!0,captureDoubleClick:!0,capturePointerMove:!1},ke={captureScroll:a.bool,captureDrag:a.bool,captureClick:a.bool,captureDoubleClick:a.bool,capturePointerMove:a.bool};function ze(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=(0,s.useContext)(ct),i=(0,s.useRef)(null),n=(0,s.useRef)({props:t,state:{},context:e,containerRef:i}).current;return n.props=t,n.context=e,(0,s.useEffect)((function(){return function(t){var e=t.containerRef.current,i=t.context.eventManager;if(e&&i){var n={wheel:function(e){var i=t.props;i.captureScroll&&e.stopPropagation(),i.onScroll&&i.onScroll(e,t)},panstart:function(e){var i=t.props;i.captureDrag&&e.stopPropagation(),i.onDragStart&&i.onDragStart(e,t)},anyclick:function(e){var i=t.props;i.captureClick&&e.stopPropagation(),i.onNativeClick&&i.onNativeClick(e,t)},click:function(e){var i=t.props;i.captureClick&&e.stopPropagation(),i.onClick&&i.onClick(e,t)},dblclick:function(e){var i=t.props;i.captureDoubleClick&&e.stopPropagation(),i.onDoubleClick&&i.onDoubleClick(e,t)},pointermove:function(e){var i=t.props;i.capturePointerMove&&e.stopPropagation(),i.onPointerMove&&i.onPointerMove(e,t)}};return i.watch(n,e),function(){i.off(n)}}}(n)}),[e.eventManager]),n}function Ue(t){var e=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Tt(t);if(e){var r=Tt(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return St(this,i)}}function Ne(t){var e=t.instance,i=ze(t),n=i.context,r=i.containerRef;return e._context=n,e._containerRef=r,e._render()}var Ge=function(t){(0,Bt.Z)(i,t);var e=Ue(i);function i(){var t;(0,D.Z)(this,i);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t=e.call.apply(e,[this].concat(r)),(0,o.Z)((0,Ct.Z)(t),"_context",{}),(0,o.Z)((0,Ct.Z)(t),"_containerRef",(0,s.createRef)()),(0,o.Z)((0,Ct.Z)(t),"_onScroll",(function(t){})),(0,o.Z)((0,Ct.Z)(t),"_onDragStart",(function(t){})),(0,o.Z)((0,Ct.Z)(t),"_onDblClick",(function(t){})),(0,o.Z)((0,Ct.Z)(t),"_onClick",(function(t){})),(0,o.Z)((0,Ct.Z)(t),"_onPointerMove",(function(t){})),t}return(0,L.Z)(i,[{key:"_render",value:function(){throw new Error("_render() not implemented")}},{key:"render",value:function(){return s.createElement(Ne,(0,n.Z)({instance:this},this.props,{onScroll:this._onScroll,onDragStart:this._onDragStart,onDblClick:this._onDblClick,onClick:this._onClick,onPointerMove:this._onPointerMove}))}}]),i}(s.PureComponent);function Ze(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function je(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ze(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ze(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}(0,o.Z)(Ge,"propTypes",ke),(0,o.Z)(Ge,"defaultProps",Re);var Ve=Object.assign({},ke,{draggable:a.bool,onDrag:a.func,onDragEnd:a.func,onDragStart:a.func,offsetLeft:a.number,offsetTop:a.number}),He=Object.assign({},Re,{draggable:!1,offsetLeft:0,offsetTop:0});function Je(t){var e=t.offsetCenter;return[e.x,e.y]}function We(t,e,i,n){var r=t[0]+e[0]-i.offsetLeft,o=t[1]+e[1]-i.offsetTop;return n.viewport.unproject([r,o])}function Qe(t,e){var i=e.props,n=e.callbacks,r=e.state,o=e.context,s=e.containerRef;if(i.draggable){t.stopPropagation();var a=Je(t),l=function(t,e){var i=t.center,n=i.x,r=i.y;if(e){var o=e.getBoundingClientRect();return[o.left-n,o.top-r]}return null}(t,s.current);if(r.setDragPos(a),r.setDragOffset(l),n.onDragStart&&l){var c=Object.assign({},t);c.lngLat=We(a,l,i,o),n.onDragStart(c)}}}function qe(t){var e=t.context.eventManager;if(e&&t.state.dragPos){var i={panmove:function(e){return function(t,e){var i=e.props,n=e.callbacks,r=e.state,o=e.context;t.stopPropagation();var s=Je(t);r.setDragPos(s);var a=r.dragOffset;if(n.onDrag&&a){var l=Object.assign({},t);l.lngLat=We(s,a,i,o),n.onDrag(l)}}(e,t)},panend:function(e){return function(t,e){var i=e.props,n=e.callbacks,r=e.state,o=e.context;t.stopPropagation();var s=r.dragPos,a=r.dragOffset;if(r.setDragPos(null),r.setDragOffset(null),n.onDragEnd&&s&&a){var l=Object.assign({},t);l.lngLat=We(s,a,i,o),n.onDragEnd(l)}}(e,t)},pancancel:function(e){return function(t,e){var i=e.state;t.stopPropagation(),i.setDragPos(null),i.setDragOffset(null)}(e,t)}};return e.watch(i),function(){e.off(i)}}}var Ke="undefined"!==typeof window&&window.devicePixelRatio||1,Xe=function(t){return Math.round(t*Ke)/Ke},Ye=function(t,e){if(null===t)return e;var i="x"===(arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x")?t.offsetWidth:t.offsetHeight;return Xe(e/100*i)/i*100};function $e(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var ti=Object.assign({},Ve,{className:a.string,longitude:a.number.isRequired,latitude:a.number.isRequired,style:a.object}),ei=Object.assign({},He,{className:""});function ii(t){var e=function(t){var e=(0,s.useState)(null),i=(0,l.Z)(e,2),n=i[0],r=i[1],o=(0,s.useState)(null),a=(0,l.Z)(o,2),c=a[0],u=a[1],h=ze(je(je({},t),{},{onDragStart:Qe}));return h.callbacks=t,h.state.dragPos=n,h.state.setDragPos=r,h.state.dragOffset=c,h.state.setDragOffset=u,(0,s.useEffect)((function(){return qe(h)}),[h.context.eventManager,Boolean(n)]),h}(t),i=e.state,n=e.containerRef,r=t.children,a=t.className,c=t.draggable,u=t.style,h=i.dragPos,d=function(t){var e=t.props,i=t.state,n=t.context,r=e.longitude,o=e.latitude,s=e.offsetLeft,a=e.offsetTop,c=i.dragPos,u=i.dragOffset;if(c&&u)return[c[0]+u[0],c[1]+u[1]];var h=n.viewport.project([r,o]),d=(0,l.Z)(h,2),p=d[0],A=d[1];return[p+=s,A+=a]}(e),p=(0,l.Z)(d,2),A=p[0],f=p[1],g="translate(".concat(Xe(A),"px, ").concat(Xe(f),"px)"),m=c?h?"grabbing":"grab":"auto",y=(0,s.useMemo)((function(){var t=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?$e(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):$e(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({position:"absolute",left:0,top:0,transform:g,cursor:m},u);return s.createElement("div",{className:"mapboxgl-marker ".concat(a),ref:e.containerRef,style:t},r)}),[r,a]),v=n.current;return v&&(v.style.transform=g,v.style.cursor=m),y}ii.defaultProps=ei,ii.propTypes=ti;s.memo(ii);var ni={top:{x:.5,y:0},"top-left":{x:0,y:0},"top-right":{x:1,y:0},bottom:{x:.5,y:1},"bottom-left":{x:0,y:1},"bottom-right":{x:1,y:1},left:{x:0,y:.5},right:{x:1,y:.5}},ri=Object.keys(ni);var oi=Object.assign({},ke,{className:a.string,longitude:a.number.isRequired,latitude:a.number.isRequired,altitude:a.number,offsetLeft:a.number,offsetTop:a.number,tipSize:a.number,closeButton:a.bool,closeOnClick:a.bool,anchor:a.oneOf(Object.keys(ni)),dynamicPosition:a.bool,sortByDepth:a.bool,onClose:a.func}),si=Object.assign({},Re,{className:"",altitude:0,offsetLeft:0,offsetTop:0,tipSize:10,anchor:"bottom",dynamicPosition:!0,sortByDepth:!1,closeButton:!0,closeOnClick:!0,onClose:function(){}});function ai(t,e,i,n){var r=(0,l.Z)(n,2),o=r[0],s=r[1],a=t.anchor,c=t.dynamicPosition,u=t.tipSize;return i&&c?function(t){var e=t.x,i=t.y,n=t.width,r=t.height,o=t.selfWidth,s=t.selfHeight,a=t.anchor,l=t.padding,c=void 0===l?0:l,u=ni[a],h=u.x,d=u.y,p=i-d*s,A=p+s,f=Math.max(0,c-p)+Math.max(0,A-r+c);if(f>0){var g=d,m=f;for(d=0;d<=1;d+=.5)A=(p=i-d*s)+s,(f=Math.max(0,c-p)+Math.max(0,A-r+c))<m&&(m=f,g=d);d=g}var y=.5;.5===d&&(h=Math.floor(h),y=1);var v=e-h*o,_=v+o,b=Math.max(0,c-v)+Math.max(0,_-n+c);if(b>0){var x=h,w=b;for(h=0;h<=1;h+=y)_=(v=e-h*o)+o,(b=Math.max(0,c-v)+Math.max(0,_-n+c))<w&&(w=b,x=h);h=x}return ri.find((function(t){var e=ni[t];return e.x===h&&e.y===d}))||a}({x:o,y:s,anchor:a,padding:u,width:e.width,height:e.height,selfWidth:i.clientWidth,selfHeight:i.clientHeight}):a}function li(t){var e=(0,s.useRef)(null),i=ze(t),n=i.context,r=i.containerRef,o=(0,s.useState)(!1),a=(0,l.Z)(o,2)[1];(0,s.useEffect)((function(){a(!0)}),[e.current]),(0,s.useEffect)((function(){if(n.eventManager&&t.closeOnClick){var e=function(){return i.props.onClose()};return n.eventManager.on("anyclick",e),function(){n.eventManager.off("anyclick",e)}}}),[n.eventManager,t.closeOnClick]);var c=n.viewport,u=t.className,h=t.longitude,d=t.latitude,p=t.altitude,A=t.tipSize,f=t.closeButton,g=t.children,m=c.project([h,d,p]),y=ai(t,c,e.current,m),v=function(t,e,i,n,r){var o=(0,l.Z)(n,3),s=o[0],a=o[1],c=o[2],u=t.offsetLeft,h=t.offsetTop,d=t.sortByDepth,p=ni[r],A=s+u,f=a+h,g=Ye(i,100*-p.x),m=Ye(i,100*-p.y,"y"),y={position:"absolute",transform:"\n      translate(".concat(g,"%, ").concat(m,"%)\n      translate(").concat(Xe(A),"px, ").concat(Xe(f),"px)\n    "),display:void 0,zIndex:void 0};return d?(c>1||c<-1||s<0||s>e.width||a<0||a>e.height?y.display="none":y.zIndex=Math.floor((1-c)/2*1e5),y):y}(t,c,r.current,m,y),_=(0,s.useCallback)((function(t){i.props.onClose();var e=i.context.eventManager;e&&e.once("click",(function(t){return t.stopPropagation()}),t.target)}),[]);return s.createElement("div",{className:"mapboxgl-popup mapboxgl-popup-anchor-".concat(y," ").concat(u),style:v,ref:r},s.createElement("div",{key:"tip",className:"mapboxgl-popup-tip",style:{borderWidth:A}}),s.createElement("div",{key:"content",ref:e,className:"mapboxgl-popup-content"},f&&s.createElement("button",{key:"close-button",className:"mapboxgl-popup-close-button",type:"button",onClick:_},"\xd7"),g))}li.propTypes=oi,li.defaultProps=si;s.memo(li);function ci(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var ui=Object.assign({},ke,{toggleLabel:a.string,className:a.string,style:a.object,compact:a.bool,customAttribution:a.oneOfType([a.string,a.arrayOf(a.string)])}),hi=Object.assign({},Re,{className:"",toggleLabel:"Toggle Attribution"});function di(t){var e=ze(t),i=e.context,n=e.containerRef,r=(0,s.useRef)(null),a=(0,s.useState)(!1),c=(0,l.Z)(a,2),u=c[0],h=c[1];(0,s.useEffect)((function(){var e;return i.map&&(e=function(t,e,i,n){var r=new(J().AttributionControl)(t);return r._map=e,r._container=i,r._innerContainer=n,r._updateAttributions(),r._updateEditLink(),e.on("styledata",r._updateData),e.on("sourcedata",r._updateData),r}({customAttribution:t.customAttribution},i.map,n.current,r.current)),function(){return e&&function(t){t._map.off("styledata",t._updateData),t._map.off("sourcedata",t._updateData)}(e)}}),[i.map]);var d=void 0===t.compact?i.viewport.width<=640:t.compact;(0,s.useEffect)((function(){!d&&u&&h(!1)}),[d]);var p=(0,s.useCallback)((function(){return h((function(t){return!t}))}),[]),A=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?ci(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):ci(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:A,className:t.className},s.createElement("div",{ref:n,"aria-pressed":u,className:"mapboxgl-ctrl mapboxgl-ctrl-attrib ".concat(d?"mapboxgl-compact":""," ").concat(u?"mapboxgl-compact-show":"")},s.createElement("button",{type:"button",className:"mapboxgl-ctrl-attrib-button",title:t.toggleLabel,onClick:p}),s.createElement("div",{ref:r,className:"mapboxgl-ctrl-attrib-inner",role:"list"})))}di.propTypes=ui,di.defaultProps=hi;s.memo(di);function pi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Ai=Object.assign({},ke,{className:a.string,style:a.object,container:a.object,label:a.string}),fi=Object.assign({},Re,{className:"",container:null,label:"Toggle fullscreen"});function gi(t){var e=ze(t),i=e.context,n=e.containerRef,r=(0,s.useState)(!1),a=(0,l.Z)(r,2),c=a[0],u=a[1],h=(0,s.useState)(!1),d=(0,l.Z)(h,2),p=d[0],A=d[1],f=(0,s.useState)(null),g=(0,l.Z)(f,2),m=g[0],y=g[1];(0,s.useEffect)((function(){var t=new(J().FullscreenControl);y(t),A(t._checkFullscreenSupport());var e=function(){var e=!t._fullscreen;t._fullscreen=e,u(e)};return O.addEventListener(t._fullscreenchange,e),function(){O.removeEventListener(t._fullscreenchange,e)}}),[]);var v=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?pi(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):pi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);if(!p)return null;var _=t.className,b=t.label,x=c?"shrink":"fullscreen";return s.createElement("div",{style:v,className:_},s.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:n},s.createElement("button",{key:x,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(x),type:"button",title:b,onClick:function(){m&&(m._container=t.container||i.container,m._onClickFullscreen())}},s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}gi.propTypes=Ai,gi.defaultProps=fi;s.memo(gi);var mi;function yi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var vi=function(){},_i=Object.assign({},ke,{className:a.string,style:a.object,label:a.string,disabledLabel:a.string,auto:a.bool,positionOptions:a.object,fitBoundsOptions:a.object,trackUserLocation:a.bool,showUserLocation:a.bool,showAccuracyCircle:a.bool,showUserHeading:a.bool,onViewStateChange:a.func,onViewportChange:a.func,onGeolocate:a.func}),bi=Object.assign({},Re,{className:"",label:"Find My Location",disabledLabel:"Location Not Available",auto:!1,positionOptions:{enableHighAccuracy:!1,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showUserLocation:!0,showUserHeading:!1,showAccuracyCircle:!0,onGeolocate:function(){}});function xi(t,e){var i=e.context,n=e.props,r=function(t){var e=new(J().LngLat)(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,n=e.toBounds(i);return[[n._ne.lng,n._ne.lat],[n._sw.lng,n._sw.lat]]}(t),o=i.viewport.fitBounds(r,n.fitBoundsOptions),s=o.longitude,a=o.latitude,l=o.zoom,c=Object.assign({},i.viewport,{longitude:s,latitude:a,zoom:l}),u=new rt(c),h=Object.assign({},u.getViewportProps(),ee),d=n.onViewportChange||i.onViewportChange||vi;(n.onViewStateChange||i.onViewStateChange||vi)({viewState:h}),d(h)}function wi(t){var e=ze(t),i=e.context,n=e.containerRef,r=(0,s.useRef)(null),a=(0,s.useState)(null),c=(0,l.Z)(a,2),u=c[0],h=c[1],d=(0,s.useState)(!1),p=(0,l.Z)(d,2),A=p[0],f=p[1];(0,s.useEffect)((function(){var n;return i.map&&(void 0!==mi?Promise.resolve(mi):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((function(t){return mi="denied"!==t.state})):(mi=Boolean(window.navigator.geolocation),Promise.resolve(mi))).then((function(o){f(o),r.current&&(n=function(t,e,i){var n=new(J().GeolocateControl)(e);n._container=O.createElement("div"),n._map={on:function(){},_getUIString:function(){return""}},n._setupUI(!0),n._map=t.map,n._geolocateButton=i;var r=t.eventManager;return n.options.trackUserLocation&&r&&r.on("panstart",(function(){"ACTIVE_LOCK"===n._watchState&&(n._watchState="BACKGROUND",i.classList.add("mapboxgl-ctrl-geolocate-background"),i.classList.remove("mapboxgl-ctrl-geolocate-active"))})),n.on("geolocate",e.onGeolocate),n}(i,t,r.current),n._updateCamera=function(t){return xi(t,e)},h(n))})),function(){n&&n._clearWatch()}}),[i.map]);var g=(0,s.useCallback)((function(){u&&(u.options=e.props,u.trigger())}),[u]);(0,s.useEffect)((function(){t.auto&&g()}),[u,t.auto]),(0,s.useEffect)((function(){u&&u._onZoom()}),[i.viewport.zoom]);var m=t.className,y=t.label,v=t.disabledLabel,_=t.trackUserLocation,b=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?yi(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):yi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:b,className:m},s.createElement("div",{key:"geolocate-control",className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:n},s.createElement("button",{key:"geolocate",className:"mapboxgl-ctrl-icon mapboxgl-ctrl-geolocate",ref:r,disabled:!A,"aria-pressed":!_,type:"button",title:A?y:v,"aria-label":A?y:v,onClick:g},s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))))}wi.propTypes=_i,wi.defaultProps=bi;s.memo(wi);function Ci(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Bi=function(){},Ei=Object.assign({},ke,{className:a.string,style:a.object,onViewStateChange:a.func,onViewportChange:a.func,showCompass:a.bool,showZoom:a.bool,zoomInLabel:a.string,zoomOutLabel:a.string,compassLabel:a.string}),Si=Object.assign({},Re,{className:"",showCompass:!0,showZoom:!0,zoomInLabel:"Zoom In",zoomOutLabel:"Zoom Out",compassLabel:"Reset North"}),Ti=1,Mi=2;function Ii(t){return function(t,e){for(var i=(t||"").split(".").map(Number),n=(e||"").split(".").map(Number),r=0;r<3;r++){var o=i[r]||0,s=n[r]||0;if(o<s)return-1;if(o>s)return 1}return 0}(t,"1.6.0")>=0?Mi:Ti}function Pi(t,e,i){var n=t.viewport,r=new rt(Object.assign({},n,i)),o=Object.assign({},r.getViewportProps(),ee),s=e.onViewportChange||t.onViewportChange||Bi;(e.onViewStateChange||t.onViewStateChange||Bi)({viewState:o}),s(o)}function Di(t,e,i,n){return s.createElement("button",{key:t,className:"mapboxgl-ctrl-icon mapboxgl-ctrl-".concat(t),type:"button",title:e,onClick:i},n||s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true"}))}function Li(t){var e=ze(t),i=e.context,n=e.containerRef,r=t.className,a=t.showCompass,l=t.showZoom,c=t.zoomInLabel,u=t.zoomOutLabel,h=t.compassLabel,d=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Ci(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ci(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:d,className:r},s.createElement("div",{className:"mapboxgl-ctrl mapboxgl-ctrl-group",ref:n},l&&Di("zoom-in",c,(function(){Pi(i,t,{zoom:i.viewport.zoom+1})})),l&&Di("zoom-out",u,(function(){Pi(i,t,{zoom:i.viewport.zoom-1})})),a&&Di("compass",h,(function(){Pi(i,t,{bearing:0,pitch:0})}),function(t){var e=(0,s.useMemo)((function(){return t.map?Ii(t.map.version):Mi}),[t.map]),i=t.viewport.bearing,n={transform:"rotate(".concat(-i,"deg)")};return e===Mi?s.createElement("span",{className:"mapboxgl-ctrl-icon","aria-hidden":"true",style:n}):s.createElement("span",{className:"mapboxgl-ctrl-compass-arrow",style:n})}(i))))}Li.propTypes=Ei,Li.defaultProps=Si;const Oi=s.memo(Li);function Fi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Ri=Object.assign({},ke,{className:a.string,style:a.object,maxWidth:a.number,unit:a.oneOf(["imperial","metric","nautical"])}),ki=Object.assign({},Re,{className:"",maxWidth:100,unit:"metric"});function zi(t){var e=ze(t),i=e.context,n=e.containerRef,r=(0,s.useState)(null),a=(0,l.Z)(r,2),c=a[0],u=a[1];(0,s.useEffect)((function(){if(i.map){var t=new(J().ScaleControl);t._map=i.map,t._container=n.current,u(t)}}),[i.map]),c&&(c.options=t,c._onMove&&c._onMove());var h=(0,s.useMemo)((function(){return function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Fi(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Fi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({position:"absolute"},t.style)}),[t.style]);return s.createElement("div",{style:h,className:t.className},s.createElement("div",{ref:n,className:"mapboxgl-ctrl mapboxgl-ctrl-scale"}))}zi.propTypes=Ri,zi.defaultProps=ki;s.memo(zi);var Ui="undefined"!==typeof window&&window.devicePixelRatio||1,Ni=Object.assign({},ke,{redraw:a.func.isRequired});function Gi(t){var e=ze(t),i=e.context,n=e.containerRef,r=(0,s.useState)(null),o=(0,l.Z)(r,2),a=o[0],c=o[1];(0,s.useEffect)((function(){c(n.current.getContext("2d"))}),[]);var u=i.viewport,h=i.isDragging;return a&&(a.save(),a.scale(Ui,Ui),t.redraw({width:u.width,height:u.height,ctx:a,isDragging:h,project:u.project,unproject:u.unproject}),a.restore()),s.createElement("canvas",{ref:n,width:u.width*Ui,height:u.height*Ui,style:{width:"".concat(u.width,"px"),height:"".concat(u.height,"px"),position:"absolute",left:0,top:0}})}Gi.propTypes=Ni,Gi.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};function Zi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var ji=Object.assign({},ke,{redraw:a.func.isRequired,style:a.object});function Vi(t){var e=ze(t),i=e.context,n=e.containerRef,r=i.viewport,a=i.isDragging,l=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Zi(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Zi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({position:"absolute",left:0,top:0,width:r.width,height:r.height},t.style);return s.createElement("div",{ref:n,style:l},t.redraw({width:r.width,height:r.height,isDragging:a,project:r.project,unproject:r.unproject}))}Vi.propTypes=ji,Vi.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};function Hi(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}var Ji=Object.assign({},ke,{redraw:a.func.isRequired,style:a.object});function Wi(t){var e=ze(t),i=e.context,n=e.containerRef,r=i.viewport,a=i.isDragging,l=function(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?Hi(Object(i),!0).forEach((function(e){(0,o.Z)(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Hi(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}({position:"absolute",left:0,top:0},t.style);return s.createElement("svg",{width:r.width,height:r.height,ref:n,style:l},t.redraw({width:r.width,height:r.height,isDragging:a,project:r.project,unproject:r.unproject}))}Wi.propTypes=Ji,Wi.defaultProps={captureScroll:!1,captureDrag:!1,captureClick:!1,captureDoubleClick:!1,capturePointerMove:!1};J()&&J().setRTLTextPlugin},79259:()=>{},22951:(t,e,i)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}i.d(e,{Z:()=>n})},91976:(t,e,i)=>{"use strict";i.d(e,{Z:()=>o});var n=i(55217);function r(t,e){for(var i=0;i<e.length;i++){var r=e[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,(0,n.Z)(r.key),r)}}function o(t,e,i){return e&&r(t.prototype,e),i&&r(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}},67591:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(6983);function r(t,e){if("function"!==typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&(0,n.Z)(t,e)}},65809:(t,e,i)=>{"use strict";i.d(e,{Z:()=>r});var n=i(64013);function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,r,o,s,a=[],l=!0,c=!1;try{if(o=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&null!=i.return&&(s=i.return(),Object(s)!==s))return}finally{if(c)throw r}}return a}}(t,e)||(0,n.Z)(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.