Appearance
diff --git a/pr-preview/pr-2/404.html b/pr-preview/pr-2/404.html deleted file mode 100644 index 3974d97..0000000 --- a/pr-preview/pr-2/404.html +++ /dev/null @@ -1,21 +0,0 @@ - - -
- - -404
But if you don't change your direction, and if you keep looking, you may end up where you are heading.
0&&x>p)){h=u,c=g;continue}r[o++]=h,r[o++]=c,a=h,l=c,h=u,c=g}return r[o++]=h,r[o++]=c,o}function rd(i,t,e,n,s,r,o,a){for(let l=0,h=e.length;l 0,n=this.readUint32(e),s=Math.floor((n&268435455)/1e3),r=!!(n&2147483648)||s===1||s===3,o=!!(n&1073741824)||s===2||s===3,a=!!(n&536870912),l=(n&268435455)%1e3,h=["XY",r?"Z":"",o?"M":""].join(""),c=a?this.readUint32(e):null;if(t!==void 0&&t!==l)throw new Error("Unexpected WKB geometry type "+l);if(this.initialized_){if(this.isLittleEndian_!==e)throw new Error("Inconsistent endian");if(this.layout_!==h)throw new Error("Inconsistent geometry layout");if(c&&this.srid_!==c)throw new Error("Inconsistent coordinate system (SRID)")}else this.isLittleEndian_=e,this.hasZ_=r,this.hasM_=o,this.layout_=h,this.srid_=c,this.initialized_=!0;return l}readWkbPayload(t){switch(t){case Xt.POINT:return this.readPoint();case Xt.LINE_STRING:return this.readLineString();case Xt.POLYGON:case Xt.TRIANGLE:return this.readPolygon();case Xt.MULTI_POINT:return this.readMultiPoint();case Xt.MULTI_LINE_STRING:return this.readMultiLineString();case Xt.MULTI_POLYGON:case Xt.POLYHEDRAL_SURFACE:case Xt.TIN:return this.readMultiPolygon();case Xt.GEOMETRY_COLLECTION:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}}readWkbBlock(t){return this.readWkbPayload(this.readWkbHeader(t))}readWkbCollection(t,e){const n=this.readUint32(),s=[];for(let r=0;r 0;)p--}s(i[e],g)===0?yo(i,e,p):(p++,yo(i,p,n)),p<=t&&(e=p+1),t<=p&&(n=p-1)}}function yo(i,t,e){var n=i[t];i[t]=i[e],i[e]=n}function xR(i,t){return i !Xl.includes(i));class D_{constructor(t,e,n,s,r,o,a){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=pe(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let s=this.executorsByZIndex_[n];s===void 0&&(s={},this.executorsByZIndex_[n]=s);const r=t[n];for(const o in r){const a=r[o];s[o]=new EC(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let s=0,r=t.length;s p[2];)++v,w=x*v,c.push(this.getRenderTransform(s,r,o,_i,u,g,w).slice()),_-=x}this.hitDetectionImageData_=j_(n,c,this.renderedFeatures_,h.getStyleFunction(),l,r,o,Zl(r,this.renderedPixelRatio_),null)}e(z_(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,s,r){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(p,_,x){const v=st(p),w=h[v];if(w){if(w!==!0&&x Math.PI/2;c=c!==p}const f=UC(t);for(let p=l;p<=h;++p){let _=this.meridians_.length+this.parallels_.length,x,v,w,E;if(this.meridiansLabels_)for(v=0,w=this.meridiansLabels_.length;v >4;if(c+=d&15,c>x){a&&pi(0);break}if(d||pi(2),W<256)e[u++]=W;else if(W==256){k=c,g=null;break}else{var K=W-254;if(W>264){var C=W-257,G=gy[C];K=ki(i,c,(1< =p)return Promise.reject(new RangeError(`Invalid sample index '${e[v]}'.`));let _;if(n){const v=this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,w=Math.max.apply(null,this.fileDirectory.BitsPerSample);_=Ru(v,w,f*e.length),l&&_.fill(l)}else{_=[];for(let v=0;v this.abortedBlockIds.has(g)||!this.blockCache.has(g));if(l.forEach(g=>this.blockIdsToFetch.add(g)),l.length>0&&e&&!e.aborted){this.fetchBlocks(null);for(const g of l){const f=this.blockRequests.get(g);if(!f)throw new Error(`Block ${g} is not in the block requests`);a.push(f)}await Promise.allSettled(a)}if(e&&e.aborted)throw new Zr("Request was aborted");const h=r.map(g=>this.blockCache.get(g)||this.evictedBlocks.get(g)),c=h.filter(g=>!g);if(c.length)throw new xL(c,"Request failed");const u=new Map(_L(r,h));return this.readSliceData(t,u)}fetchBlocks(t){if(this.blockIdsToFetch.size>0){const e=this.groupBlocks(this.blockIdsToFetch),n=this.source.fetch(e,t);for(let s=0;sMath.max(s,kl(i,r)),0);return e[t]=n,n}function Qb(i,t){const e=[],n=[],s=[];let r=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){const u=t[h];if(u===`
-`||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l;continue}const g=t[h+1]||i.font,f=kl(g,u);e.push(f),o+=f;const p=Kb(g);n.push(p),l=Math.max(l,p)}return{width:r,height:a,widths:e,heights:n,lineWidths:s}}function Jb(i,t,e,n,s,r,o,a,l,h,c){i.save(),e!==1&&(i.globalAlpha===void 0?i.globalAlpha=u=>u.globalAlpha*=e:i.globalAlpha*=e),t&&i.transform.apply(i,t),n.contextInstructions?(i.translate(l,h),i.scale(c[0],c[1]),tE(n,i)):c[0]<0||c[1]<0?(i.translate(l,h),i.scale(c[0],c[1]),i.drawImage(n,s,r,o,a,0,0,o,a)):i.drawImage(n,s,r,o,a,l,h,o*c[0],a*c[1]),i.restore()}function tE(i,t){const e=i.contextInstructions;for(let n=0,s=e.length;nthis.imageState_=et.LOADED),this.render()}clone(){const t=this.getScale(),e=new Ch({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const n=this.renderOptions_,s=Jt(n.size*t,n.size*t);this.draw_(n,s,t),e=s.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius_,r=this.radius2_===void 0?s:this.radius2_;if(s0;i[e+f]=o&255,f+=p,o/=256,h-=8);i[e+f-p]|=_*128};var WS=jt,el=Id;function jt(i){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(i)?i:new Uint8Array(i||0),this.pos=0,this.type=0,this.length=this.buf.length}jt.Varint=0;jt.Fixed64=1;jt.Bytes=2;jt.Fixed32=5;var fu=65536*65536,qf=1/fu,qS=12,n_=typeof TextDecoder>"u"?null:new TextDecoder("utf8");jt.prototype={destroy:function(){this.buf=null},readFields:function(i,t,e){for(e=e||this.length;this.pos=t;l--){const h=i.children[l];Mo(o,i.leaf?s(h):h),a+=al(o)}return a}_adjustParentBBoxes(i,t,e){for(let n=e;n>=0;n--)Mo(t[n],i)}_condense(i){for(let t=i.length-1,e;t>=0;t--)i[t].children.length===0?t>0?(e=i[t-1].children,e.splice(e.indexOf(i[t]),1)):this.clear():sr(i[t],this.toBBox)}};function vR(i,t,e){if(!e)return t.indexOf(i);for(let n=0;nn.featureId;case z.GeometryType:return n=>n.geometryType;case z.Concat:{const n=i.args.map(s=>Xi(s));return s=>"".concat(...n.map(r=>r(s).toString()))}case z.Resolution:return n=>n.resolution;case z.Any:case z.All:case z.Between:case z.In:case z.Not:return WR(i);case z.Equal:case z.NotEqual:case z.LessThan:case z.LessThanOrEqualTo:case z.GreaterThan:case z.GreaterThanOrEqualTo:return BR(i);case z.Multiply:case z.Divide:case z.Add:case z.Subtract:case z.Clamp:case z.Mod:case z.Pow:case z.Abs:case z.Floor:case z.Ceil:case z.Round:case z.Sin:case z.Cos:case z.Atan:case z.Sqrt:return qR(i);case z.Case:return XR(i);case z.Match:return ZR(i);case z.Interpolate:return $R(i);case z.ToString:return VR(i);default:throw new Error(`Unsupported operator ${e}`)}}function zR(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;rn(r)<=s(r);case z.GreaterThan:return r=>n(r)>s(r);case z.GreaterThanOrEqualTo:return r=>n(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${e}`)}}function WR(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;rb[2]}else j=S>N;const B=Math.PI,d=[],m=R+n===t;t=R,x=0,v=C,g=i[t],f=i[t+1];let y;if(m){w(),y=Math.atan2(f-_,g-p),j&&(y+=y>0?-B:B);const b=(N+S)/2,M=(U+T)/2;return d[0]=[b,M,(P-r)/2,y,s],d}s=s.replace(/\n/g," ");for(let b=0,M=s.length;bS[0]&&b[2]>S[2]&&E.push([b[0]-m,b[1],b[2]-m,b[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==_&&Ze(this.wrappedRenderedExtent_,v))return $s(this.renderedExtent_,w)||(this.hitDetectionImageData_=null,this.renderedExtent_=w),this.renderedCenter_=x,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const T=new N_(B_(u,g),v,u,g);let R;for(let m=0,y=E.length;m0&&this.changed()}removeFeature(t){t&&this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=st(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);const n=this.featureChangeKeys_[e];if(!n)return;n.forEach(ve),delete this.featureChangeKeys_[e];const s=t.getId();return s!==void 0&&delete this.idIndex_[s.toString()],delete this.uidIndex_[e],this.hasListener(ke.REMOVEFEATURE)&&this.dispatchEvent(new Qn(ke.REMOVEFEATURE,t)),t}removeFromIdIndex_(t){let e=!1;for(const n in this.idIndex_){const s=this.idIndex_[n];if(t instanceof Ge&&Array.isArray(s)&&s.includes(t))s.splice(s.indexOf(t),1);else if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}}return e}setLoader(t){this.loader_=t}setUrl(t){At(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(Np(t,this.format_))}}function UC(i){if(!(i.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");const t=i.inversePixelTransform[0],e=i.inversePixelTransform[1],n=Math.sqrt(t*t+e*e),s=i.frameState,r=Qr(i.inversePixelTransform.slice(),s.coordinateToPixelTransform),o=Zl(s.viewState.resolution,n);let a;return new G_(i.context,n,s.extent,r,s.viewState.rotation,o,a)}function Z_(i,t,e){const n=[];let s=i(0),r=i(1),o=t(s),a=t(r);const l=[r,s],h=[a,o],c=[1,0],u={};let g=1e5,f,p,_,x,v,w;for(;--g>0&&c.length>0;)_=c.pop(),s=l.pop(),o=h.pop(),w=_.toString(),w in u||(n.push(o[0],o[1]),u[w]=!0),x=c.pop(),r=l.pop(),a=h.pop(),v=(_+x)/2,f=i(v),p=t(f),t0(p[0],p[1],o[0],o[1],a[0],a[1]){this.uniforms_.push({value:t.uniforms[o],location:e.getUniformLocation(this.renderTargetProgram_,o)})})}getGL(){return this.gl_}init(t){const e=this.getGL(),n=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),e.viewport(0,0,n[0],n[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;const s=0,r=e.RGBA,o=0,a=e.RGBA,l=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,s,r,n[0],n[1],o,a,l,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,n[0],n[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}apply(t,e,n,s){const r=this.getGL(),o=t.size;if(r.bindFramebuffer(r.FRAMEBUFFER,e?e.getFrameBuffer():null),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,this.renderTargetTexture_),!e){const l=st(r.canvas);if(!t.renderTargets[l]){const h=r.getContextAttributes();h&&h.preserveDrawingBuffer&&(r.clearColor(0,0,0,0),r.clearDepth(1),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT)),t.renderTargets[l]=!0}}r.disable(r.DEPTH_TEST),r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.viewport(0,0,r.drawingBufferWidth,r.drawingBufferHeight),r.bindBuffer(r.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),r.useProgram(this.renderTargetProgram_),r.enableVertexAttribArray(this.renderTargetAttribLocation_),r.vertexAttribPointer(this.renderTargetAttribLocation_,2,r.FLOAT,!1,0,0),r.uniform2f(this.renderTargetUniformLocation_,o[0],o[1]),r.uniform1i(this.renderTargetTextureLocation_,0);const a=t.layerStatesArray[t.layerIndex].opacity;r.uniform1f(this.renderTargetOpacityLocation_,a),this.applyUniforms(t),n&&n(r,t),r.drawArrays(r.TRIANGLES,0,6),s&&s(r,t)}getFrameBuffer(){return this.frameBuffer_}getDepthBuffer(){return this.depthBuffer_}applyUniforms(t){const e=this.getGL();let n,s=1;this.uniforms_.forEach(function(r){if(n=typeof r.value=="function"?r.value(t):r.value,n instanceof HTMLCanvasElement||n instanceof ImageData)r.texture||(r.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${s}`]),e.bindTexture(e.TEXTURE_2D,r.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),n instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,n.width,n.height,0,e.UNSIGNED_BYTE,new Uint8Array(n.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n),e.uniform1i(r.location,s++);else if(Array.isArray(n))switch(n.length){case 2:e.uniform2f(r.location,n[0],n[1]);return;case 3:e.uniform3f(r.location,n[0],n[1],n[2]);return;case 4:e.uniform4f(r.location,n[0],n[1],n[2],n[3]);return;default:return}else typeof n=="number"&&e.uniform1f(r.location,n)})}}function V_(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Y_(i,t){return i[0]=t[0],i[1]=t[1],i[4]=t[2],i[5]=t[3],i[12]=t[4],i[13]=t[5],i}const En={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},tn={UNSIGNED_BYTE:YC,UNSIGNED_SHORT:HC,UNSIGNED_INT:KC,FLOAT:$_},Yl={};function Gp(i){return"shared/"+i}let jp=0;function iI(){const i="unique/"+jp;return jp+=1,i}function nI(i){let t=Yl[i];if(!t){const e=document.createElement("canvas");e.width=1,e.height=1,e.style.position="absolute",e.style.left="0",t={users:0,context:QC(e)},Yl[i]=t}return t.users+=1,t.context}function sI(i){const t=Yl[i];if(!t||(t.users-=1,t.users>0))return;const e=t.context,n=e.getExtension("WEBGL_lose_context");n&&n.loseContext();const s=e.canvas;s.width=1,s.height=1,delete Yl[i]}class rI extends Uu{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?Gp(t.canvasCacheKey):iI(),this.gl_=nI(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(cl.LOST,this.boundHandleWebGLContextLost_),e.addEventListener(cl.RESTORED,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=pe(),this.offsetScaleMatrix_=pe(),this.tmpMat4_=V_(),this.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map(n=>new Dp({webGlContext:this.gl_,scaleRatio:n.scaleRatio,vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,uniforms:n.uniforms})):[new Dp({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===Gp(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.gl_,n=st(t);let s=this.bufferCache_[n];if(!s){const r=e.createBuffer();s={buffer:t,webGlBuffer:r},this.bufferCache_[n]=s}e.bindBuffer(t.getType(),s.webGlBuffer)}flushBufferData(t){const e=this.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.gl_,n=st(t),s=this.bufferCache_[n];s&&!e.isContextLost()&&e.deleteBuffer(s.webGlBuffer),delete this.bufferCache_[n]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(cl.LOST,this.boundHandleWebGLContextLost_),t.removeEventListener(cl.RESTORED,this.boundHandleWebGLContextRestored_),sI(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,n){const s=this.gl_,r=this.getCanvas(),o=t.size,a=t.pixelRatio;(r.width!==o[0]*a||r.height!==o[1]*a)&&(r.width=o[0]*a,r.height=o[1]*a,r.style.width=o[0]+"px",r.style.height=o[1]+"px");for(let l=this.postProcessPasses_.length-1;l>=0;l--)this.postProcessPasses_[l].init(t);s.bindTexture(s.TEXTURE_2D,null),s.clearColor(0,0,0,0),s.depthRange(0,1),s.clearDepth(1),s.clear(s.COLOR_BUFFER_BIT|s.DEPTH_BUFFER_BIT),s.enable(s.BLEND),s.blendFunc(s.ONE,e?s.ZERO:s.ONE_MINUS_SRC_ALPHA),n?(s.enable(s.DEPTH_TEST),s.depthFunc(s.LEQUAL)):s.disable(s.DEPTH_TEST)}bindTexture(t,e,n){const s=this.gl_;s.activeTexture(s.TEXTURE0+e),s.bindTexture(s.TEXTURE_2D,t),s.uniform1i(this.getUniformLocation(n),e)}prepareDrawToRenderTarget(t,e,n,s){const r=this.gl_,o=e.getSize();r.bindFramebuffer(r.FRAMEBUFFER,e.getFramebuffer()),r.bindRenderbuffer(r.RENDERBUFFER,e.getDepthbuffer()),r.viewport(0,0,o[0],o[1]),r.bindTexture(r.TEXTURE_2D,e.getTexture()),r.clearColor(0,0,0,0),r.depthRange(0,1),r.clearDepth(1),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,n?r.ZERO:r.ONE_MINUS_SRC_ALPHA),s?(r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL)):r.disable(r.DEPTH_TEST)}drawElements(t,e){const n=this.gl_;this.getExtension("OES_element_index_uint");const s=n.UNSIGNED_INT,r=4,o=e-t,a=t*r;n.drawElements(n.TRIANGLES,o,s,a)}finalizeDraw(t,e,n){for(let s=0,r=this.postProcessPasses_.length;sh&&(h=u),g>c&&(c=g);f=Math.max(h-a,c-l),f=f!==0?32767/f:0}return la(r,o,e,a,l,f,0),o}function Q_(i,t,e,n,s){var r,o;if(s===bu(i,t,e,n)>0)for(r=t;r0||f>0&&r;)0!==o&&(0===f||!r||n.z<=r.z)?(x=n,n=n.nextZ,o--):(x=r,r=r.nextZ,f--),i?i.nextZ=x:e=x,x.prevZ=i,i=x;n=r}i.nextZ=null,s*=2}while(u>1)}(x)}(e,r,x,i);for(var o,f,p=e;e.prev!==e.next;)if(o=e.prev,f=e.next,i?v(e,r,x,i):l(e))t.push(o.i/n|0),t.push(e.i/n|0),t.push(f.i/n|0),B(e),e=f.next,p=f.next;else if((e=f)===p){u?1===u?a(e=h(s(e),t,n),t,n,r,x,i,2):2===u&&c(e,t,n,r,x,i):a(s(e),t,n,r,x,i,1);break}}}function l(e){var t=e.prev,n=e,r=e.next;if(w(t,n,r)>=0)return!1;for(var x=t.x,i=n.x,u=r.x,o=t.y,f=n.y,s=r.y,a=xi?x>u?x:u:i>u?i:u,h=o>f?o>s?o:s:f>s?f:s,c=r.next;c!==t;){if(c.x>=a&&c.x<=v&&c.y>=l&&c.y<=h&&M(x,o,i,f,u,s,c.x,c.y)&&w(c.prev,c,c.next)>=0)return!1;c=c.next}return!0}function v(e,t,n,r){var x=e.prev,i=e,u=e.next;if(w(x,i,u)>=0)return!1;for(var o=x.x,f=i.x,s=u.x,a=x.y,l=i.y,v=u.y,h=o{const e=t.args[0].value;return e in i.properties||(i.properties[e]={name:e,type:t.type}),(i.inFragmentShader?"v_prop_":"a_prop_")+e},[z.GeometryType]:(i,t,e)=>{const n="geometryType";return n in i.properties||(i.properties[n]={name:n,type:xe,evaluator:s=>qd(s.getGeometry())}),(i.inFragmentShader?"v_prop_":"a_prop_")+n},[z.Var]:(i,t)=>{const e=t.args[0].value;return e in i.variables||(i.variables[e]={name:e,type:t.type}),sg(e)},[z.Resolution]:()=>"u_resolution",[z.Zoom]:()=>"u_zoom",[z.Time]:()=>"u_time",[z.Any]:Dt(i=>`(${i.join(" || ")})`),[z.All]:Dt(i=>`(${i.join(" && ")})`),[z.Not]:Dt(([i])=>`(!${i})`),[z.Equal]:Dt(([i,t])=>`(${i} == ${t})`),[z.NotEqual]:Dt(([i,t])=>`(${i} != ${t})`),[z.GreaterThan]:Dt(([i,t])=>`(${i} > ${t})`),[z.GreaterThanOrEqualTo]:Dt(([i,t])=>`(${i} >= ${t})`),[z.LessThan]:Dt(([i,t])=>`(${i} < ${t})`),[z.LessThanOrEqualTo]:Dt(([i,t])=>`(${i} <= ${t})`),[z.Multiply]:Dt(i=>`(${i.join(" * ")})`),[z.Divide]:Dt(([i,t])=>`(${i} / ${t})`),[z.Add]:Dt(i=>`(${i.join(" + ")})`),[z.Subtract]:Dt(([i,t])=>`(${i} - ${t})`),[z.Clamp]:Dt(([i,t,e])=>`clamp(${i}, ${t}, ${e})`),[z.Mod]:Dt(([i,t])=>`mod(${i}, ${t})`),[z.Pow]:Dt(([i,t])=>`pow(${i}, ${t})`),[z.Abs]:Dt(([i])=>`abs(${i})`),[z.Floor]:Dt(([i])=>`floor(${i})`),[z.Ceil]:Dt(([i])=>`ceil(${i})`),[z.Round]:Dt(([i])=>`floor(${i} + 0.5)`),[z.Sin]:Dt(([i])=>`sin(${i})`),[z.Cos]:Dt(([i])=>`cos(${i})`),[z.Atan]:Dt(([i,t])=>t!==void 0?`atan(${i}, ${t})`:`atan(${i})`),[z.Sqrt]:Dt(([i])=>`sqrt(${i})`),[z.Match]:Dt(i=>{const t=i[0],e=i[i.length-1];let n=null;for(let s=i.length-3;s>=1;s-=2){const r=i[s],o=i[s+1];n=`(${t} == ${r} ? ${o} : ${n||e})`}return n}),[z.Between]:Dt(([i,t,e])=>`(${i} >= ${t} && ${i} <= ${e})`),[z.Interpolate]:Dt(([i,t,...e])=>{let n="";for(let s=0;s0){e([]);return}const p=c.getTileCoordExtent(f.wrappedTileCoord),_=zn(p),x=[(u[0]-_[0])/h,(_[1]-u[1])/h],v=f.getSourceTiles().reduce(function(E,S){return E.concat(S.getFeatures())},[]);let w=f.hitDetectionImageData[r];if(!w){const E=se(c.getTileSize(c.getZForResolution(h,o.zDirection))),S=this.renderedRotation_,T=[this.getRenderTransform(c.getTileCoordCenter(f.wrappedTileCoord),h,0,_i,E[0]*_i,E[1]*_i,0)];w=j_(E,T,v,s.getStyleFunction(),c.getTileCoordExtent(f.wrappedTileCoord),f.getReplayState(s).renderedResolution,S),f.hitDetectionImageData[r]=w}e(z_(x,v,w))})}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.renderedLayerRevision_!==void 0&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderDeclutter(t,e){const n=this.context,s=n.globalAlpha;n.globalAlpha=e.opacity;const r=t.viewHints,o=!(r[ee.ANIMATING]||r[ee.INTERACTING]),a=this.renderedTiles;for(let l=0,h=a.length;l{const l=Vh(a,n,s);for(let h=0;h>8-s-R&u;else if(R+s<=16)c[S]=a.getUint16(T)>>16-s-R&u;else if(R+s<=24){const C=a.getUint16(T)<<8|a.getUint8(T+2);c[S]=C>>24-s-R&u}else c[S]=a.getUint32(T)>>32-s-R&u}}}}return c.buffer}class Vy{constructor(t,e,n,s,r,o){this.fileDirectory=t,this.geoKeys=e,this.dataView=n,this.littleEndian=s,this.tiles=r?{}:null,this.isTiled=!t.StripOffsets;const a=t.PlanarConfiguration;if(this.planarConfiguration=typeof a>"u"?1:a,this.planarConfiguration!==1&&this.planarConfiguration!==2)throw new Error("Invalid planar configuration.");this.source=o}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return typeof this.fileDirectory.SamplesPerPixel<"u"?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:typeof this.fileDirectory.RowsPerStrip<"u"?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(t){return this.isTiled||(t+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-t*this.getTileHeight()}getBytesPerPixel(){let t=0;for(let e=0;e