const M6=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const e of document.querySelectorAll('link[rel="modulepreload"]'))Z(e);new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const i of r.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&Z(i)}).observe(document,{childList:!0,subtree:!0});function T(e){const r={};return e.integrity&&(r.integrity=e.integrity),e.referrerpolicy&&(r.referrerPolicy=e.referrerpolicy),e.crossorigin==="use-credentials"?r.credentials="include":e.crossorigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function Z(e){if(e.ep)return;e.ep=!0;const r=T(e);fetch(e.href,r)}};M6();function L(){return function(){throw new Error("Unimplemented abstract method.")}()}var F6=0;function U(n){return n.ol_uid||(n.ol_uid=String(++F6))}var D6="6.15.1",N6=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),G6=function(n){N6(t,n);function t(T){var Z=this,e="v"+D6.split("-")[0],r="Assertion failed. See https://openlayers.org/en/"+e+"/doc/errors/#"+T+" for details.";return Z=n.call(this,r)||this,Z.code=T,Z.name="AssertionError",Z.message=r,Z}return t}(Error);const $7=G6;var b6=function(){function n(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return n.prototype.preventDefault=function(){this.defaultPrevented=!0},n.prototype.stopPropagation=function(){this.propagationStopped=!0},n}();const V2=b6,K0={PROPERTYCHANGE:"propertychange"};var j6=function(){function n(){this.disposed=!1}return n.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},n.prototype.disposeInternal=function(){},n}();const m5=j6;function k6(n,t,T){for(var Z,e,r=T||w0,i=0,o=n.length,a=!1;i>1),e=+r(n[Z],t),e<0?i=Z+1:(o=Z,a=!e);return a?i:~i}function w0(n,t){return n>t?1:n0){for(e=1;e0?e-1:e:n[e-1]-t0||T&&i===0)})}function B0(){return!0}function v4(){return!1}function O0(){}function W6(n){var t=!1,T,Z,e;return function(){var r=Array.prototype.slice.call(arguments);return(!t||this!==e||!S0(r,Z))&&(t=!0,e=this,Z=r,T=n.apply(this,arguments)),T}}var e2=typeof Object.assign=="function"?Object.assign:function(n,t){if(n==null)throw new TypeError("Cannot convert undefined or null to object");for(var T=Object(n),Z=1,e=arguments.length;Z0:!1},t.prototype.removeEventListener=function(T,Z){var e=this.listeners_&&this.listeners_[T];if(e){var r=e.indexOf(Z);r!==-1&&(this.pendingRemovals_&&T in this.pendingRemovals_?(e[r]=O0,++this.pendingRemovals_[T]):(e.splice(r,1),e.length===0&&delete this.listeners_[T]))}},t}(m5);const H0=U6,G={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function B(n,t,T,Z,e){if(Z&&Z!==n&&(T=T.bind(Z)),e){var r=T;T=function(){n.removeEventListener(t,T),r.apply(this,arguments)}}var i={target:n,type:t,listener:T};return n.addEventListener(t,T),i}function r4(n,t,T,Z){return B(n,t,T,Z,!0)}function H(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),I1(n))}var z6=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),g4=function(n){z6(t,n);function t(){var T=n.call(this)||this;return T.on=T.onInternal,T.once=T.onceInternal,T.un=T.unInternal,T.revision_=0,T}return t.prototype.changed=function(){++this.revision_,this.dispatchEvent(G.CHANGE)},t.prototype.getRevision=function(){return this.revision_},t.prototype.onInternal=function(T,Z){if(Array.isArray(T)){for(var e=T.length,r=new Array(e),i=0;i0;)this.pop()},t.prototype.extend=function(T){for(var Z=0,e=T.length;Z=0||s0.match(/cpu (os|iphone os) 15_4 like mac os x/));var Z9=s0.indexOf("webkit")!==-1&&s0.indexOf("edge")==-1,t9=s0.indexOf("macintosh")!==-1,Z3=typeof devicePixelRatio<"u"?devicePixelRatio:1,_4=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,e9=typeof Image<"u"&&Image.prototype.decode,t3=function(){var n=!1;try{var t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}();new Array(6);function F2(){return[1,0,0,1,0,0]}function n9(n,t,T,Z,e,r,i){return n[0]=t,n[1]=T,n[2]=Z,n[3]=e,n[4]=r,n[5]=i,n}function r9(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function t2(n,t){var T=t[0],Z=t[1];return t[0]=n[0]*T+n[2]*Z+n[4],t[1]=n[1]*T+n[3]*Z+n[5],t}function i9(n,t,T){return n9(n,t,0,0,T,0,0)}function K2(n,t,T,Z,e,r,i,o){var a=Math.sin(r),s=Math.cos(r);return n[0]=Z*s,n[1]=e*a,n[2]=-Z*a,n[3]=e*s,n[4]=i*Z*s-o*Z*a+t,n[5]=i*e*a+o*e*s+T,n}function C5(n,t){var T=o9(t);X(T!==0,32);var Z=t[0],e=t[1],r=t[2],i=t[3],o=t[4],a=t[5];return n[0]=i/T,n[1]=-e/T,n[2]=-r/T,n[3]=Z/T,n[4]=(r*a-i*o)/T,n[5]=-(Z*a-e*o)/T,n}function o9(n){return n[0]*n[3]-n[1]*n[2]}var r7;function e3(n){var t="matrix("+n.join(", ")+")";if(_4)return t;var T=r7||(r7=document.createElement("div"));return T.style.transform=t,T.style.transform}const r2={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function i7(n){for(var t=C2(),T=0,Z=n.length;Te&&(a=a|r2.RIGHT),or&&(a=a|r2.ABOVE),a===r2.UNKNOWN&&(a=r2.INTERSECTING),a}function C2(){return[1/0,1/0,-1/0,-1/0]}function D2(n,t,T,Z,e){return e?(e[0]=n,e[1]=t,e[2]=T,e[3]=Z,e):[n,t,T,Z]}function L1(n){return D2(1/0,1/0,-1/0,-1/0,n)}function s9(n,t){var T=n[0],Z=n[1];return D2(T,Z,T,Z,t)}function r3(n,t,T,Z,e){var r=L1(e);return o3(r,n,t,T,Z)}function _1(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function i3(n,t){return t[0]n[2]&&(n[2]=t[2]),t[1]n[3]&&(n[3]=t[3]),n}function p1(n,t){t[0]n[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function o3(n,t,T,Z,e){for(;Tt[0]?Z[0]=n[0]:Z[0]=t[0],n[1]>t[1]?Z[1]=n[1]:Z[1]=t[1],n[2]=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function O5(n){return n[2]=i&&p<=a),!Z&&!!(r&r2.RIGHT)&&!(e&r2.RIGHT)&&(d=c-(u-a)*f,Z=d>=o&&d<=s),!Z&&!!(r&r2.BELOW)&&!(e&r2.BELOW)&&(p=u-(c-o)/f,Z=p>=i&&p<=a),!Z&&!!(r&r2.LEFT)&&!(e&r2.LEFT)&&(d=c-(u-i)*f,Z=d>=o&&d<=s)}return Z}function f9(n,t,T,Z){var e=[];if(Z>1)for(var r=n[2]-n[0],i=n[3]-n[1],o=0;o=T[2])){var e=q(T),r=Math.floor((Z[0]-T[0])/e),i=r*e;n[0]-=i,n[2]-=i}return n}function p9(n,t){if(t.canWrapX()){var T=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[T[0],n[1],T[2],n[3]]];s3(n,t);var Z=q(T);if(q(n)>Z)return[[T[0],n[1],T[2],n[3]]];if(n[0]T[2])return[[n[0],n[1],T[2],n[3]],[T[0],n[1],n[2]-Z,n[3]]]}return[n]}var d9=function(){function n(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return n.prototype.canWrapX=function(){return this.canWrapX_},n.prototype.getCode=function(){return this.code_},n.prototype.getExtent=function(){return this.extent_},n.prototype.getUnits=function(){return this.units_},n.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||E2[this.units_]},n.prototype.getWorldExtent=function(){return this.worldExtent_},n.prototype.getAxisOrientation=function(){return this.axisOrientation_},n.prototype.isGlobal=function(){return this.global_},n.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)},n.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},n.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},n.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)},n.prototype.setWorldExtent=function(t){this.worldExtent_=t},n.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},n.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},n}();const l3=d9;function n2(n,t,T){return Math.min(Math.max(n,t),T)}var v9=function(){var n;return"cosh"in Math?n=Math.cosh:n=function(t){var T=Math.exp(t);return(T+1/T)/2},n}(),g9=function(){var n;return"log2"in Math?n=Math.log2:n=function(t){return Math.log(t)*Math.LOG2E},n}();function _9(n,t,T,Z,e,r){var i=e-T,o=r-Z;if(i!==0||o!==0){var a=((n-T)*i+(t-Z)*o)/(i*i+o*o);a>1?(T=e,Z=r):a>0&&(T+=i*a,Z+=o*a)}return E0(n,t,T,Z)}function E0(n,t,T,Z){var e=T-n,r=Z-t;return e*e+r*r}function y9(n){for(var t=n.length,T=0;Te&&(e=i,Z=r)}if(e===0)return null;var o=n[Z];n[Z]=n[T],n[T]=o;for(var a=T+1;a=0;u--){h[u]=n[u][t]/n[u][u];for(var c=u-1;c>=0;c--)n[c][t]-=n[c][u]*h[u]}return h}function e4(n){return n*Math.PI/180}function U0(n,t){var T=n%t;return T*t<0?T+t:T}function W2(n,t,T){return n+T*(t-n)}function u3(n,t){var T=Math.pow(10,t);return Math.round(n*T)/T}function z1(n,t){return Math.floor(u3(n,t))}function K1(n,t){return Math.ceil(u3(n,t))}var m9=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),A1=6378137,W0=Math.PI*A1,E9=[-W0,-W0,W0,W0],C9=[-180,-85,180,85],V1=A1*Math.log(Math.tan(Math.PI/2)),D0=function(n){m9(t,n);function t(T){return n.call(this,{code:T,units:U2.METERS,extent:E9,global:!0,worldExtent:C9,getPointResolution:function(Z,e){return Z/v9(e[1]/A1)}})||this}return t}(l3),o7=[new D0("EPSG:3857"),new D0("EPSG:102100"),new D0("EPSG:102113"),new D0("EPSG:900913"),new D0("http://www.opengis.net/def/crs/EPSG/0/3857"),new D0("http://www.opengis.net/gml/srs/epsg.xml#3857")];function x9(n,t,T){var Z=n.length,e=T>1?T:2,r=t;r===void 0&&(e>2?r=n.slice():r=new Array(Z));for(var i=0;iV1?o=V1:o<-V1&&(o=-V1),r[i+1]=o}return r}function w9(n,t,T){var Z=n.length,e=T>1?T:2,r=t;r===void 0&&(e>2?r=n.slice():r=new Array(Z));for(var i=0;i=0;--Z)if(n[Z]!=t[Z]){T=!1;break}return T}function R5(n,t){var T=Math.cos(t),Z=Math.sin(t),e=n[0]*T-n[1]*Z,r=n[1]*T+n[0]*Z;return n[0]=e,n[1]=r,n}function M9(n,t){return n[0]*=t,n[1]*=t,n}function h3(n,t){if(t.canWrapX()){var T=q(t.getExtent()),Z=F9(n,t,T);Z&&(n[0]-=Z*T)}return n}function F9(n,t,T){var Z=t.getExtent(),e=0;if(t.canWrapX()&&(n[0]Z[2])){var r=T||q(Z);e=Math.floor((n[0]-Z[0])/r)}return e}var D9=63710088e-1;function l7(n,t,T){var Z=T||D9,e=e4(n[1]),r=e4(t[1]),i=(r-e)/2,o=e4(t[0]-n[0])/2,a=Math.sin(i)*Math.sin(i)+Math.sin(o)*Math.sin(o)*Math.cos(e)*Math.cos(r);return 2*Z*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}var r5=!0;function N9(n){var t=n===void 0?!0:n;r5=!t}function S5(n,t,T){var Z;if(t!==void 0){for(var e=0,r=n.length;e=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(r5=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n)}function o5(n,t){return w2?f3(n,t,w2):n}function g0(n,t){return w2?f3(n,w2,t):n}function Y9(n,t){if(!w2)return n;var T=Z2(t).getUnits(),Z=w2.getUnits();return T&&Z?n*E2[T]/E2[Z]:n}function W9(){h7(o7),h7(s7),j9(s7,o7,x9,w9)}W9();function C0(n,t,T,Z,e,r){for(var i=r||[],o=0,a=t;a1)h=T;else if(u>0){for(var c=0;ce&&(e=s),r=o,i=a}return e}function A5(n,t,T,Z,e){for(var r=0,i=T.length;r0;){for(var h=s.pop(),u=s.pop(),c=0,f=n[u],p=n[u+1],d=n[h],_=n[h+1],v=u+Z;vc&&(l=v,c=m)}c>e&&(a[(l-t)/Z]=1,u+Z0&&p>c)&&(f<0&&d0&&d>f)){s=h,l=u;continue}r[i++]=s,r[i++]=l,o=s,a=l,s=h,l=u}}return r[i++]=s,r[i++]=l,i}function g3(n,t,T,Z,e,r,i,o){for(var a=0,s=T.length;ar&&(s-o)*(r-a)-(e-o)*(l-a)>0&&i++:l<=r&&(s-o)*(r-a)-(e-o)*(l-a)<0&&i--,o=s,a=l}return i!==0}function G5(n,t,T,Z,e,r){if(T.length===0||!_0(n,t,T[0],Z,e,r))return!1;for(var i=1,o=T.length;iy&&(s=(l+h)/2,G5(n,t,T,Z,s,f)&&(g=s,y=m)),l=h}return isNaN(g)&&(g=e[r]),i?(i.push(g,f,y),i):[g,f,y]}function h8(n,t,T,Z,e){for(var r=[],i=0,o=T.length;i=e[0]&&r[2]<=e[2]||r[1]>=e[1]&&r[3]<=e[3]?!0:E3(n,t,T,Z,function(i,o){return c9(e,i,o)}):!1}function c8(n,t,T,Z,e){for(var r=0,i=T.length;r0}function O3(n,t,T,Z,e){for(var r=e!==void 0?e:!1,i=0,o=T.length;i1?i:2,y=r||new Array(g),f=0;f>1;e0&&n[1]>0}function C8(n,t,T){return T===void 0&&(T=[0,0]),T[0]=n[0]*t+.5|0,T[1]=n[1]*t+.5|0,T}function S2(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}var x8=function(){function n(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=S2(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}return n.prototype.clone=function(){var t=this.getScale();return new n({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},n.prototype.getOpacity=function(){return this.opacity_},n.prototype.getRotateWithView=function(){return this.rotateWithView_},n.prototype.getRotation=function(){return this.rotation_},n.prototype.getScale=function(){return this.scale_},n.prototype.getScaleArray=function(){return this.scaleArray_},n.prototype.getDisplacement=function(){return this.displacement_},n.prototype.getDeclutterMode=function(){return this.declutterMode_},n.prototype.getAnchor=function(){return L()},n.prototype.getImage=function(t){return L()},n.prototype.getHitDetectionImage=function(){return L()},n.prototype.getPixelRatio=function(t){return 1},n.prototype.getImageState=function(){return L()},n.prototype.getImageSize=function(){return L()},n.prototype.getOrigin=function(){return L()},n.prototype.getSize=function(){return L()},n.prototype.setDisplacement=function(t){this.displacement_=t},n.prototype.setOpacity=function(t){this.opacity_=t},n.prototype.setRotateWithView=function(t){this.rotateWithView_=t},n.prototype.setRotation=function(t){this.rotation_=t},n.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=S2(t)},n.prototype.listenImageChange=function(t){L()},n.prototype.load=function(){L()},n.prototype.unlistenImageChange=function(t){L()},n}();const L3=x8;var w8=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,O8=/^([a-z]*)$|^hsla?\(.*\)$/i;function A3(n){return typeof n=="string"?n:M3(n)}function R8(n){var t=document.createElement("div");if(t.style.color=n,t.style.color!==""){document.body.appendChild(t);var T=getComputedStyle(t).color;return document.body.removeChild(t),T}else return""}var S8=function(){var n=1024,t={},T=0;return function(Z){var e;if(t.hasOwnProperty(Z))e=t[Z];else{if(T>=n){var r=0;for(var i in t)(r++&3)===0&&(delete t[i],--T)}e=I8(Z),t[Z]=e,++T}return e}}();function s4(n){return Array.isArray(n)?n:S8(n)}function I8(n){var t,T,Z,e,r;if(O8.exec(n)&&(n=R8(n)),w8.exec(n)){var i=n.length-1,o=void 0;i<=4?o=1:o=2;var a=i===4||i===8;t=parseInt(n.substr(1+0*o,o),16),T=parseInt(n.substr(1+1*o,o),16),Z=parseInt(n.substr(1+2*o,o),16),a?e=parseInt(n.substr(1+3*o,o),16):e=255,o==1&&(t=(t<<4)+t,T=(T<<4)+T,Z=(Z<<4)+Z,a&&(e=(e<<4)+e)),r=[t,T,Z,e/255]}else n.indexOf("rgba(")==0?(r=n.slice(5,-1).split(",").map(Number),y7(r)):n.indexOf("rgb(")==0?(r=n.slice(4,-1).split(",").map(Number),r.push(1),y7(r)):X(!1,14);return r}function y7(n){return n[0]=n2(n[0]+.5|0,0,255),n[1]=n2(n[1]+.5|0,0,255),n[2]=n2(n[2]+.5|0,0,255),n[3]=n2(n[3],0,1),n}function M3(n){var t=n[0];t!=(t|0)&&(t=t+.5|0);var T=n[1];T!=(T|0)&&(T=T+.5|0);var Z=n[2];Z!=(Z|0)&&(Z=Z+.5|0);var e=n[3]===void 0?1:Math.round(n[3]*100)/100;return"rgba("+t+","+T+","+Z+","+e+")"}function M2(n){return Array.isArray(n)?M3(n):n}function g2(n,t,T,Z){var e;return T&&T.length?e=T.shift():_4?e=new OffscreenCanvas(n||300,t||300):e=document.createElement("canvas"),n&&(e.width=n),t&&(e.height=t),e.getContext("2d",Z)}function F3(n){var t=n.canvas;t.width=1,t.height=1,n.clearRect(0,0,1,1)}function P8(n){var t=n.offsetWidth,T=getComputedStyle(n);return t+=parseInt(T.marginLeft,10)+parseInt(T.marginRight,10),t}function L8(n){var t=n.offsetHeight,T=getComputedStyle(n);return t+=parseInt(T.marginTop,10)+parseInt(T.marginBottom,10),t}function m7(n,t){var T=t.parentNode;T&&T.replaceChild(n,t)}function l4(n){return n&&n.parentNode?n.parentNode.removeChild(n):null}function D3(n){for(;n.lastChild;)n.removeChild(n.lastChild)}function A8(n,t){for(var T=n.childNodes,Z=0;;++Z){var e=T[Z],r=t[Z];if(!e&&!r)break;if(e!==r){if(!e){n.appendChild(r);continue}if(!r){n.removeChild(e),--Z;continue}n.insertBefore(r,e)}}}var $1="ol-hidden",M8="ol-selectable",O4="ol-unselectable",b5="ol-control",E7="ol-collapsed",F8=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),C7=["style","variant","weight","size","lineHeight","family"],N3=function(n){var t=n.match(F8);if(!t)return null;for(var T={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},Z=0,e=C7.length;Z=n.maxResolution)return!1;var Z=t.zoom;return Z>n.minZoom&&Z<=n.maxZoom}const R4=J8;function Q8(n,t,T,Z,e){Y3(n,t,T||0,Z||n.length-1,e||TT)}function Y3(n,t,T,Z,e){for(;Z>T;){if(Z-T>600){var r=Z-T+1,i=t-T+1,o=Math.log(r),a=.5*Math.exp(2*o/3),s=.5*Math.sqrt(o*a*(r-a)/r)*(i-r/2<0?-1:1),l=Math.max(T,Math.floor(t-i*a/r+s)),h=Math.min(Z,Math.floor(t+(r-i)*a/r+s));Y3(n,t,l,h,e)}var u=n[t],c=T,f=Z;for(u1(n,T,t),e(n[Z],u)>0&&u1(n,T,Z);c0;)f--}e(n[T],u)===0?u1(n,T,f):(f++,u1(n,f,Z)),f<=t&&(T=f+1),t<=f&&(Z=f-1)}}function u1(n,t,T){var Z=n[t];n[t]=n[T],n[T]=Z}function TT(n,t){return nt?1:0}class W3{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let T=this.data;const Z=[];if(!q1(t,T))return Z;const e=this.toBBox,r=[];for(;T;){for(let i=0;i=0&&r[T].children.length>this._maxEntries;)this._split(r,T),T--;this._adjustParentBBoxes(e,r,T)}_split(t,T){const Z=t[T],e=Z.children.length,r=this._minEntries;this._chooseSplitAxis(Z,r,e);const i=this._chooseSplitIndex(Z,r,e),o=k0(Z.children.splice(i,Z.children.length-i));o.height=Z.height,o.leaf=Z.leaf,N0(Z,this.toBBox),N0(o,this.toBBox),T?t[T-1].children.push(o):this._splitRoot(Z,o)}_splitRoot(t,T){this.data=k0([t,T]),this.data.height=t.height+1,this.data.leaf=!1,N0(this.data,this.toBBox)}_chooseSplitIndex(t,T,Z){let e,r=1/0,i=1/0;for(let o=T;o<=Z-T;o++){const a=c1(t,0,o,this.toBBox),s=c1(t,o,Z,this.toBBox),l=rT(a,s),h=X4(a)+X4(s);l=T;s--){const l=t.children[s];f1(o,t.leaf?r(l):l),a+=H1(o)}return a}_adjustParentBBoxes(t,T,Z){for(let e=Z;e>=0;e--)f1(T[e],t)}_condense(t){for(let T=t.length-1,Z;T>=0;T--)t[T].children.length===0?T>0?(Z=t[T-1].children,Z.splice(Z.indexOf(t[T]),1)):this.clear():N0(t[T],this.toBBox)}}function ZT(n,t,T){if(!T)return t.indexOf(n);for(let Z=0;Z=n.minX&&t.maxY>=n.minY}function k0(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function O7(n,t,T,Z,e){const r=[t,T];for(;r.length;){if(T=r.pop(),t=r.pop(),T-t<=Z)continue;const i=t+Math.ceil((T-t)/Z/2)*Z;Q8(n,i,t,T,e),r.push(t,i,i,T)}}var iT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),R7={RENDER_ORDER:"renderOrder"},oT=function(n){iT(t,n);function t(T){var Z=this,e=T||{},r=e2({},e);return delete r.style,delete r.renderBuffer,delete r.updateWhileAnimating,delete r.updateWhileInteracting,Z=n.call(this,r)||this,Z.declutter_=e.declutter!==void 0?e.declutter:!1,Z.renderBuffer_=e.renderBuffer!==void 0?e.renderBuffer:100,Z.style_=null,Z.styleFunction_=void 0,Z.setStyle(e.style),Z.updateWhileAnimating_=e.updateWhileAnimating!==void 0?e.updateWhileAnimating:!1,Z.updateWhileInteracting_=e.updateWhileInteracting!==void 0?e.updateWhileInteracting:!1,Z}return t.prototype.getDeclutter=function(){return this.declutter_},t.prototype.getFeatures=function(T){return n.prototype.getFeatures.call(this,T)},t.prototype.getRenderBuffer=function(){return this.renderBuffer_},t.prototype.getRenderOrder=function(){return this.get(R7.RENDER_ORDER)},t.prototype.getStyle=function(){return this.style_},t.prototype.getStyleFunction=function(){return this.styleFunction_},t.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},t.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},t.prototype.renderDeclutter=function(T){T.declutterTree||(T.declutterTree=new W3(9)),this.getRenderer().renderDeclutter(T)},t.prototype.setRenderOrder=function(T){this.set(R7.RENDER_ORDER,T)},t.prototype.setStyle=function(T){this.style_=T!==void 0?T:K8,this.styleFunction_=T===null?void 0:z8(this.style_),this.changed()},t}(R4);const aT=oT;var M1={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},J1=[M1.FILL],o0=[M1.STROKE],m0=[M1.BEGIN_PATH],S7=[M1.CLOSE_PATH];const F=M1;var sT=function(){function n(){}return n.prototype.drawCustom=function(t,T,Z,e){},n.prototype.drawGeometry=function(t){},n.prototype.setStyle=function(t){},n.prototype.drawCircle=function(t,T){},n.prototype.drawFeature=function(t,T){},n.prototype.drawGeometryCollection=function(t,T){},n.prototype.drawLineString=function(t,T){},n.prototype.drawMultiLineString=function(t,T){},n.prototype.drawMultiPoint=function(t,T){},n.prototype.drawMultiPolygon=function(t,T){},n.prototype.drawPoint=function(t,T){},n.prototype.drawPolygon=function(t,T){},n.prototype.drawText=function(t,T){},n.prototype.setFillStrokeStyle=function(t,T){},n.prototype.setImageStyle=function(t,T){},n.prototype.setTextStyle=function(t,T){},n}();const B3=sT;var lT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),uT=function(n){lT(t,n);function t(T,Z,e,r){var i=n.call(this)||this;return i.tolerance=T,i.maxExtent=Z,i.pixelRatio=r,i.maxLineWidth=0,i.resolution=e,i.beginGeometryInstruction1_=null,i.beginGeometryInstruction2_=null,i.bufferedMaxExtent_=null,i.instructions=[],i.coordinates=[],i.tmpCoordinate_=[],i.hitDetectionInstructions=[],i.state={},i}return t.prototype.applyPixelRatio=function(T){var Z=this.pixelRatio;return Z==1?T:T.map(function(e){return e*Z})},t.prototype.appendFlatPointCoordinates=function(T,Z){for(var e=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=T.length;aa&&(this.instructions.push([F.CUSTOM,a,l,T,e,i0]),this.hitDetectionInstructions.push([F.CUSTOM,a,l,T,r||e,i0]));break;case"Point":s=T.getFlatCoordinates(),this.coordinates.push(s[0],s[1]),l=this.coordinates.length,this.instructions.push([F.CUSTOM,a,l,T,e]),this.hitDetectionInstructions.push([F.CUSTOM,a,l,T,r||e]);break}this.endGeometry(Z)},t.prototype.beginGeometry=function(T,Z){this.beginGeometryInstruction1_=[F.BEGIN_GEOMETRY,Z,0,T],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[F.BEGIN_GEOMETRY,Z,0,T],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},t.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},t.prototype.reverseHitDetectionInstructions=function(){var T=this.hitDetectionInstructions;T.reverse();var Z,e=T.length,r,i,o=-1;for(Z=0;Zthis.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0},t.prototype.createFill=function(T){var Z=T.fillStyle,e=[F.SET_FILL_STYLE,Z];return typeof Z!="string"&&e.push(!0),e},t.prototype.applyStroke=function(T){this.instructions.push(this.createStroke(T))},t.prototype.createStroke=function(T){return[F.SET_STROKE_STYLE,T.strokeStyle,T.lineWidth*this.pixelRatio,T.lineCap,T.lineJoin,T.miterLimit,this.applyPixelRatio(T.lineDash),T.lineDashOffset*this.pixelRatio]},t.prototype.updateFillStyle=function(T,Z){var e=T.fillStyle;(typeof e!="string"||T.currentFillStyle!=e)&&(e!==void 0&&this.instructions.push(Z.call(this,T)),T.currentFillStyle=e)},t.prototype.updateStrokeStyle=function(T,Z){var e=T.strokeStyle,r=T.lineCap,i=T.lineDash,o=T.lineDashOffset,a=T.lineJoin,s=T.lineWidth,l=T.miterLimit;(T.currentStrokeStyle!=e||T.currentLineCap!=r||i!=T.currentLineDash&&!S0(T.currentLineDash,i)||T.currentLineDashOffset!=o||T.currentLineJoin!=a||T.currentLineWidth!=s||T.currentMiterLimit!=l)&&(e!==void 0&&Z.call(this,T),T.currentStrokeStyle=e,T.currentLineCap=r,T.currentLineDash=i,T.currentLineDashOffset=o,T.currentLineJoin=a,T.currentLineWidth=s,T.currentMiterLimit=l)},t.prototype.endGeometry=function(T){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var Z=[F.END_GEOMETRY,T];this.instructions.push(Z),this.hitDetectionInstructions.push(Z)},t.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=n3(this.maxExtent),this.maxLineWidth>0)){var T=this.resolution*(this.maxLineWidth+1)/2;x5(this.bufferedMaxExtent_,T,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},t}(B3);const F1=uT;var hT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),cT=function(n){hT(t,n);function t(T,Z,e,r){var i=n.call(this,T,Z,e,r)||this;return i.hitDetectionImage_=null,i.image_=null,i.imagePixelRatio_=void 0,i.anchorX_=void 0,i.anchorY_=void 0,i.height_=void 0,i.opacity_=void 0,i.originX_=void 0,i.originY_=void 0,i.rotateWithView_=void 0,i.rotation_=void 0,i.scale_=void 0,i.width_=void 0,i.declutterMode_=void 0,i.declutterImageWithText_=void 0,i}return t.prototype.drawPoint=function(T,Z){if(!!this.image_){this.beginGeometry(T,Z);var e=T.getFlatCoordinates(),r=T.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(e,r);this.instructions.push([F.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([F.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(Z)}},t.prototype.drawMultiPoint=function(T,Z){if(!!this.image_){this.beginGeometry(T,Z);var e=T.getFlatCoordinates(),r=T.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(e,r);this.instructions.push([F.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([F.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(Z)}},t.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,n.prototype.finish.call(this)},t.prototype.setImageStyle=function(T,Z){var e=T.getAnchor(),r=T.getSize(),i=T.getOrigin();this.imagePixelRatio_=T.getPixelRatio(this.pixelRatio),this.anchorX_=e[0],this.anchorY_=e[1],this.hitDetectionImage_=T.getHitDetectionImage(),this.image_=T.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=T.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=T.getRotateWithView(),this.rotation_=T.getRotation(),this.scale_=T.getScaleArray(),this.width_=r[0],this.declutterMode_=T.getDeclutterMode(),this.declutterImageWithText_=Z},t}(F1);const fT=cT;var pT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),dT=function(n){pT(t,n);function t(T,Z,e,r){return n.call(this,T,Z,e,r)||this}return t.prototype.drawFlatCoordinates_=function(T,Z,e,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(T,Z,e,r,!1,!1),a=[F.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),e},t.prototype.drawLineString=function(T,Z){var e=this.state,r=e.strokeStyle,i=e.lineWidth;if(!(r===void 0||i===void 0)){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(T,Z),this.hitDetectionInstructions.push([F.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,C1,x1],m0);var o=T.getFlatCoordinates(),a=T.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(o0),this.endGeometry(Z)}},t.prototype.drawMultiLineString=function(T,Z){var e=this.state,r=e.strokeStyle,i=e.lineWidth;if(!(r===void 0||i===void 0)){this.updateStrokeStyle(e,this.applyStroke),this.beginGeometry(T,Z),this.hitDetectionInstructions.push([F.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash,e.lineDashOffset],m0);for(var o=T.getEnds(),a=T.getFlatCoordinates(),s=T.getStride(),l=0,h=0,u=o.length;hn&&(a>o&&(o=a,r=s,i=h),a=0,s=h-e)),u=c,d=v,_=g),f=y,p=m}return a+=c,a>o?[s,h]:[r,i]}var mT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),v1={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ET=function(n){mT(t,n);function t(T,Z,e,r){var i=n.call(this,T,Z,e,r)||this;return i.labels_=null,i.text_="",i.textOffsetX_=0,i.textOffsetY_=0,i.textRotateWithView_=void 0,i.textRotation_=0,i.textFillState_=null,i.fillStates={},i.textStrokeState_=null,i.strokeStates={},i.textState_={},i.textStates={},i.textKey_="",i.fillKey_="",i.strokeKey_="",i.declutterImageWithText_=void 0,i}return t.prototype.finish=function(){var T=n.prototype.finish.call(this);return T.textStates=this.textStates,T.fillStates=this.fillStates,T.strokeStates=this.strokeStates,T},t.prototype.drawText=function(T,Z){var e=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(!(this.text_===""||!i||!e&&!r)){var o=this.coordinates,a=o.length,s=T.getType(),l=null,h=T.getStride();if(i.placement===V8.LINE&&(s=="LineString"||s=="MultiLineString"||s=="Polygon"||s=="MultiPolygon")){if(!d2(this.getBufferedMaxExtent(),T.getExtent()))return;var u=void 0;if(l=T.getFlatCoordinates(),s=="LineString")u=[l.length];else if(s=="MultiLineString")u=T.getEnds();else if(s=="Polygon")u=T.getEnds().slice(0,1);else if(s=="MultiPolygon"){var c=T.getEndss();u=[];for(var f=0,p=c.length;fN[2]}else A=y>O;var R=Math.PI,b=[],j=x+Z===t;t=x,d=0,_=E,u=n[t],c=n[t+1];var M;if(j){v(),M=Math.atan2(c-p,u-f),A&&(M+=M>0?-R:R);var I=(O+y)/2,P=(S+m)/2;return b[0]=[I,P,(w-r)/2,M,e],b}e=e.replace(/\n/g," ");for(var Y=0,W=e.length;Y0?-R:R),M!==void 0){var C=K-M;if(C+=C>R?-2*R:C<-R?2*R:0,Math.abs(C)>i)return null}M=K;for(var Q=Y,V=0;Y0&&n.push(` `,""),n.push(t,""),n}var GT=function(){function n(t,T,Z,e){this.overlaps=Z,this.pixelRatio=T,this.resolution=t,this.alignFill_,this.instructions=e.instructions,this.coordinates=e.coordinates,this.coordinateCache_={},this.renderedTransform_=F2(),this.hitDetectionInstructions=e.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=e.fillStates||{},this.strokeStates=e.strokeStates||{},this.textStates=e.textStates||{},this.widths_={},this.labels_={}}return n.prototype.createLabel=function(t,T,Z,e){var r=t+T+Z+e;if(this.labels_[r])return this.labels_[r];var i=e?this.strokeStates[e]:null,o=Z?this.fillStates[Z]:null,a=this.textStates[T],s=this.pixelRatio,l=[a.scale[0]*s,a.scale[1]*s],h=Array.isArray(t),u=a.justify?v1[a.justify]:M7(Array.isArray(t)?t[0]:t,a.textAlign||R1),c=e&&i.lineWidth?i.lineWidth:0,f=h?t:t.split(` `).reduce(NT,[]),p=b8(a,f),d=p.width,_=p.height,v=p.widths,g=p.heights,y=p.lineWidths,m=d+c,x=[],E=(m+2)*l[0],w=(_+c)*l[1],O={width:E<0?Math.floor(E):Math.ceil(E),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:x};if((l[0]!=1||l[1]!=1)&&x.push("scale",l),e){x.push("strokeStyle",i.strokeStyle),x.push("lineWidth",c),x.push("lineCap",i.lineCap),x.push("lineJoin",i.lineJoin),x.push("miterLimit",i.miterLimit);var S=_4?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;S.prototype.setLineDash&&(x.push("setLineDash",[i.lineDash]),x.push("lineDashOffset",i.lineDashOffset))}Z&&x.push("fillStyle",o.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var A=.5-u,N=u*m+A*c,R=[],b=[],j=0,M=0,I=0,P=0,Y,W=0,K=f.length;Wt?t-s:r,y=i+l>T?T-l:i,m=f[3]+g*u[0]+f[1],x=f[0]+y*u[1]+f[2],E=_-f[3],w=v-f[0];(p||h!==0)&&(J2[0]=E,Q2[0]=E,J2[1]=w,G2[1]=w,G2[0]=E+m,b2[0]=G2[0],b2[1]=w+x,Q2[1]=b2[1]);var O;return h!==0?(O=K2(F2(),Z,e,1,1,h,-Z,-e),t2(O,J2),t2(O,G2),t2(O,b2),t2(O,Q2),D2(Math.min(J2[0],G2[0],b2[0],Q2[0]),Math.min(J2[1],G2[1],b2[1],Q2[1]),Math.max(J2[0],G2[0],b2[0],Q2[0]),Math.max(J2[1],G2[1],b2[1],Q2[1]),G0)):D2(Math.min(E,E+m),Math.min(w,w+x),Math.max(E,E+m),Math.max(w,w+x),G0),c&&(_=Math.round(_),v=Math.round(v)),{drawImageX:_,drawImageY:v,drawImageW:g,drawImageH:y,originX:s,originY:l,declutterBox:{minX:G0[0],minY:G0[1],maxX:G0[2],maxY:G0[3],value:d},canvasTransform:O,scale:u}},n.prototype.replayImageOrLabel_=function(t,T,Z,e,r,i,o){var a=!!(i||o),s=e.declutterBox,l=t.canvas,h=o?o[2]*e.scale[0]/2:0,u=s.minX-h<=l.width/T&&s.maxX+h>=0&&s.minY-h<=l.height/T&&s.maxY+h>=0;return u&&(a&&this.replayTextBackground_(t,J2,G2,b2,Q2,i,o),j8(t,e.canvasTransform,r,Z,e.originX,e.originY,e.drawImageW,e.drawImageH,e.drawImageX,e.drawImageY,e.scale)),!0},n.prototype.fill_=function(t){if(this.alignFill_){var T=t2(this.renderedTransform_,[0,0]),Z=512*this.pixelRatio;t.save(),t.translate(T[0]%Z,T[1]%Z),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},n.prototype.setStrokeStyle_=function(t,T){t.strokeStyle=T[1],t.lineWidth=T[2],t.lineCap=T[3],t.lineJoin=T[4],t.miterLimit=T[5],t.setLineDash&&(t.lineDashOffset=T[7],t.setLineDash(T[6]))},n.prototype.drawLabelWithPointPlacement_=function(t,T,Z,e){var r=this.textStates[T],i=this.createLabel(t,T,e,Z),o=this.strokeStates[Z],a=this.pixelRatio,s=M7(Array.isArray(t)?t[0]:t,r.textAlign||R1),l=v1[r.textBaseline||h4],h=o&&o.lineWidth?o.lineWidth:0,u=i.width/a-2*r.scale[0],c=s*u+2*(.5-s)*h,f=l*i.height/a+2*(.5-l)*h;return{label:i,anchorX:c,anchorY:f}},n.prototype.execute_=function(t,T,Z,e,r,i,o,a){var s;this.pixelCoordinates_&&S0(Z,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=C0(this.coordinates,0,this.coordinates.length,2,Z,this.pixelCoordinates_),r9(this.renderedTransform_,Z));for(var l=0,h=e.length,u=0,c,f,p,d,_,v,g,y,m,x,E,w,O=0,S=0,A=null,N=null,R=this.coordinateCache_,b=this.viewRotation_,j=Math.round(Math.atan2(-Z[1],Z[0])*1e12)/1e12,M={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:b},I=this.instructions!=e||this.overlaps?0:200,P,Y,W,K;lI&&(this.fill_(t),O=0),S>I&&(t.stroke(),S=0),!O&&!S&&(t.beginPath(),d=NaN,_=NaN),++l;break;case F.CIRCLE:u=C[1];var V=s[u],k=s[u+1],i2=s[u+2],c2=s[u+3],o2=i2-V,A0=c2-k,v2=Math.sqrt(o2*o2+A0*A0);t.moveTo(V+v2,k),t.arc(V,k,v2,0,2*Math.PI,!0),++l;break;case F.CLOSE_PATH:t.closePath(),++l;break;case F.CUSTOM:u=C[1],c=C[2];var Q0=C[3],P2=C[4],T1=C.length==6?C[5]:void 0;M.geometry=Q0,M.feature=P,l in R||(R[l]=[]);var l0=R[l];T1?T1(s,u,c,2,l0):(l0[0]=s[u],l0[1]=s[u+1],l0.length=2),P2(l0,M),++l;break;case F.DRAW_IMAGE:u=C[1],c=C[2],y=C[3],f=C[4],p=C[5];var M0=C[6],G1=C[7],b1=C[8],Z1=C[9],t1=C[10],$2=C[11],M4=C[12],u0=C[13],j1=C[14],H2=C[15];if(!y&&C.length>=20){m=C[19],x=C[20],E=C[21],w=C[22];var F0=this.drawLabelWithPointPlacement_(m,x,E,w);y=F0.label,C[3]=y;var F4=C[23];f=(F0.anchorX-F4)*this.pixelRatio,C[4]=f;var k1=C[24];p=(F0.anchorY-k1)*this.pixelRatio,C[5]=p,M0=y.height,C[6]=M0,u0=y.width,C[13]=u0}var e1=void 0;C.length>25&&(e1=C[25]);var N2=void 0,L2=void 0,h0=void 0;C.length>17?(N2=C[16],L2=C[17],h0=C[18]):(N2=y0,L2=!1,h0=!1),t1&&j?$2+=b:!t1&&!j&&($2-=b);for(var n1=0;u0){if(!i||c!=="Image"&&c!=="Text"||i.indexOf(x)!==-1){var A=(u[O]-3)/4,N=e-A%o,R=e-(A/o|0),b=r(x,E,N*N+R*R);if(b)return b}l.clearRect(0,0,o,o);break}}var p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(w0);var d,_,v,g,y;for(d=p.length-1;d>=0;--d){var m=p[d].toString();for(v=this.executorsByZIndex_[m],_=W4.length-1;_>=0;--_)if(c=W4[_],g=v[c],g!==void 0&&(y=g.executeHitDetection(l,a,Z,f,h),y))return y}},n.prototype.getClipCoords=function(t){var T=this.maxExtent_;if(!T)return null;var Z=T[0],e=T[1],r=T[2],i=T[3],o=[Z,e,Z,i,r,i,r,e];return C0(o,0,8,2,t,o),o},n.prototype.isEmpty=function(){return V0(this.executorsByZIndex_)},n.prototype.execute=function(t,T,Z,e,r,i,o){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(w0),this.maxExtent_&&(t.save(),this.clip(t,Z));var s=i||W4,l,h,u,c,f,p;for(o&&a.reverse(),l=0,h=a.length;lT)break;var o=Z[i];o||(o=[],Z[i]=o),o.push(((n+e)*t+(n+r))*4+3),e>0&&o.push(((n-e)*t+(n+r))*4+3),r>0&&(o.push(((n+e)*t+(n-r))*4+3),e>0&&o.push(((n-e)*t+(n-r))*4+3))}for(var a=[],e=0,s=Z.length;ethis.maxCacheSize_},n.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var T in this.cache_){var Z=this.cache_[T];(t++&3)===0&&!Z.hasListener()&&(delete this.cache_[T],--this.cacheSize_)}}},n.prototype.get=function(t,T,Z){var e=D7(t,T,Z);return e in this.cache_?this.cache_[e]:null},n.prototype.set=function(t,T,Z,e){var r=D7(t,T,Z);this.cache_[r]=e,++this.cacheSize_},n.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},n}();function D7(n,t,T){var Z=T?A3(T):"null";return t+":"+n+":"+Z}var p4=new BT,UT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),zT=function(n){UT(t,n);function t(T,Z,e,r){var i=n.call(this)||this;return i.extent=T,i.pixelRatio_=e,i.resolution=Z,i.state=r,i}return t.prototype.changed=function(){this.dispatchEvent(G.CHANGE)},t.prototype.getExtent=function(){return this.extent},t.prototype.getImage=function(){return L()},t.prototype.getPixelRatio=function(){return this.pixelRatio_},t.prototype.getResolution=function(){return this.resolution},t.prototype.getState=function(){return this.state},t.prototype.load=function(){L()},t}(H0);const KT=zT;var VT=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}();(function(n){VT(t,n);function t(T,Z,e,r,i,o){var a=n.call(this,T,Z,e,$.IDLE)||this;return a.src_=r,a.image_=new Image,i!==null&&(a.image_.crossOrigin=i),a.unlisten_=null,a.state=$.IDLE,a.imageLoadFunction_=o,a}return t.prototype.getImage=function(){return this.image_},t.prototype.handleImageError_=function(){this.state=$.ERROR,this.unlistenImage_(),this.changed()},t.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=x2(this.extent)/this.image_.height),this.state=$.LOADED,this.unlistenImage_(),this.changed()},t.prototype.load=function(){(this.state==$.IDLE||this.state==$.ERROR)&&(this.state=$.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=j5(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},t.prototype.setImage=function(T){this.image_=T,this.resolution=x2(this.extent)/this.image_.height},t.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},t})(KT);function j5(n,t,T){var Z=n,e=!0,r=!1,i=!1,o=[r4(Z,G.LOAD,function(){i=!0,r||t()})];return Z.src&&e9?(r=!0,Z.decode().then(function(){e&&t()}).catch(function(a){e&&(i?t():T())})):o.push(r4(Z,G.ERROR,T)),function(){e=!1,o.forEach(H)}}var $T=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),h1=null,HT=function(n){$T(t,n);function t(T,Z,e,r,i,o){var a=n.call(this)||this;return a.hitDetectionImage_=null,a.image_=T||new Image,r!==null&&(a.image_.crossOrigin=r),a.canvas_={},a.color_=o,a.unlisten_=null,a.imageState_=i,a.size_=e,a.src_=Z,a.tainted_,a}return t.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===$.LOADED){h1||(h1=g2(1,1)),h1.drawImage(this.image_,0,0);try{h1.getImageData(0,0,1,1),this.tainted_=!1}catch{h1=null,this.tainted_=!0}}return this.tainted_===!0},t.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(G.CHANGE)},t.prototype.handleImageError_=function(){this.imageState_=$.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.handleImageLoad_=function(){this.imageState_=$.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},t.prototype.getImage=function(T){return this.replaceColor_(T),this.canvas_[T]?this.canvas_[T]:this.image_},t.prototype.getPixelRatio=function(T){return this.replaceColor_(T),this.canvas_[T]?T:1},t.prototype.getImageState=function(){return this.imageState_},t.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var T=this.size_[0],Z=this.size_[1],e=g2(T,Z);e.fillRect(0,0,T,Z),this.hitDetectionImage_=e.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},t.prototype.getSize=function(){return this.size_},t.prototype.getSrc=function(){return this.src_},t.prototype.load=function(){if(this.imageState_==$.IDLE){this.imageState_=$.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=j5(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},t.prototype.replaceColor_=function(T){if(!(!this.color_||this.canvas_[T]||this.imageState_!==$.LOADED)){var Z=document.createElement("canvas");this.canvas_[T]=Z,Z.width=Math.ceil(this.image_.width*T),Z.height=Math.ceil(this.image_.height*T);var e=Z.getContext("2d");if(e.scale(T,T),e.drawImage(this.image_,0,0),e.globalCompositeOperation="multiply",e.globalCompositeOperation==="multiply"||this.isTainted_())e.fillStyle=A3(this.color_),e.fillRect(0,0,Z.width/T,Z.height/T),e.globalCompositeOperation="destination-in",e.drawImage(this.image_,0,0);else{for(var r=e.getImageData(0,0,Z.width,Z.height),i=r.data,o=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],h=0,u=i.length;h0,6);var h=e.src!==void 0?$.IDLE:$.LOADED;return Z.color_=e.color!==void 0?s4(e.color):null,Z.iconImage_=qT(s,l,Z.imgSize_!==void 0?Z.imgSize_:null,Z.crossOrigin_,h,Z.color_),Z.offset_=e.offset!==void 0?e.offset:[0,0],Z.offsetOrigin_=e.offsetOrigin!==void 0?e.offsetOrigin:y2.TOP_LEFT,Z.origin_=null,Z.size_=e.size!==void 0?e.size:null,Z}return t.prototype.clone=function(){var T=this.getScale();return new t({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(T)?T.slice():T,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},t.prototype.getAnchor=function(){var T=this.normalizedAnchor_;if(!T){T=this.anchor_;var Z=this.getSize();if(this.anchorXUnits_==e0.FRACTION||this.anchorYUnits_==e0.FRACTION){if(!Z)return null;T=this.anchor_.slice(),this.anchorXUnits_==e0.FRACTION&&(T[0]*=Z[0]),this.anchorYUnits_==e0.FRACTION&&(T[1]*=Z[1])}if(this.anchorOrigin_!=y2.TOP_LEFT){if(!Z)return null;T===this.anchor_&&(T=this.anchor_.slice()),(this.anchorOrigin_==y2.TOP_RIGHT||this.anchorOrigin_==y2.BOTTOM_RIGHT)&&(T[0]=-T[0]+Z[0]),(this.anchorOrigin_==y2.BOTTOM_LEFT||this.anchorOrigin_==y2.BOTTOM_RIGHT)&&(T[1]=-T[1]+Z[1])}this.normalizedAnchor_=T}var e=this.getDisplacement();return[T[0]-e[0],T[1]+e[1]]},t.prototype.setAnchor=function(T){this.anchor_=T,this.normalizedAnchor_=null},t.prototype.getColor=function(){return this.color_},t.prototype.getImage=function(T){return this.iconImage_.getImage(T)},t.prototype.getPixelRatio=function(T){return this.iconImage_.getPixelRatio(T)},t.prototype.getImageSize=function(){return this.iconImage_.getSize()},t.prototype.getImageState=function(){return this.iconImage_.getImageState()},t.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},t.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var T=this.offset_;if(this.offsetOrigin_!=y2.TOP_LEFT){var Z=this.getSize(),e=this.iconImage_.getSize();if(!Z||!e)return null;T=T.slice(),(this.offsetOrigin_==y2.TOP_RIGHT||this.offsetOrigin_==y2.BOTTOM_RIGHT)&&(T[0]=e[0]-Z[0]-T[0]),(this.offsetOrigin_==y2.BOTTOM_LEFT||this.offsetOrigin_==y2.BOTTOM_RIGHT)&&(T[1]=e[1]-Z[1]-T[1])}return this.origin_=T,this.origin_},t.prototype.getSrc=function(){return this.iconImage_.getSrc()},t.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},t.prototype.listenImageChange=function(T){this.iconImage_.addEventListener(G.CHANGE,T)},t.prototype.load=function(){this.iconImage_.load()},t.prototype.unlistenImageChange=function(T){this.iconImage_.removeEventListener(G.CHANGE,T)},t}(L3);const f5=QT;var A2=.5;function TZ(n,t,T,Z,e,r,i){var o=n[0]*A2,a=n[1]*A2,s=g2(o,a);s.imageSmoothingEnabled=!1;for(var l=s.canvas,h=new WT(s,A2,e,null,i),u=T.length,c=Math.floor((256*256*256-1)/u),f={},p=1;p<=u;++p){var d=T[p-1],_=d.getStyleFunction()||Z;if(!!Z){var v=_(d,r);if(!!v){Array.isArray(v)||(v=[v]);for(var g=p*c,y="#"+("000000"+g.toString(16)).slice(-6),m=0,x=v.length;mp[2];)++v,g=_*v,h.push(this.getRenderTransform(r,i,o,A2,u,c,g).slice()),d-=_}this.hitDetectionImageData_=TZ(e,h,this.renderedFeatures_,l.getStyleFunction(),s,i,o)}Z(ZZ(T,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},t.prototype.forEachFeatureAtCoordinate=function(T,Z,e,r,i){var o=this;if(!!this.replayGroup_){var a=Z.viewState.resolution,s=Z.viewState.rotation,l=this.getLayer(),h={},u=function(p,d,_){var v=U(p),g=h[v];if(g){if(g!==!0&&_m[0]&&w[2]>m[2]&&y.push([w[0]-x,w[1],w[2]-x,w[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==d&&v0(this.wrappedRenderedExtent_,v))return S0(this.renderedExtent_,g)||(this.hitDetectionImageData_=null,this.renderedExtent_=g),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var O=new P7(p5(u,c),v,u,c),S;this.getLayer().getDeclutter()&&(S=new P7(p5(u,c),v,u,c));var A=p3(),N;if(A){for(var R=0,b=y.length;R=200&&o.status<300){var s=t.getType(),l=void 0;s=="json"||s=="text"?l=o.responseText:s=="xml"?(l=o.responseXML,l||(l=new DOMParser().parseFromString(o.responseText,"application/xml"))):s=="arraybuffer"&&(l=o.response),l?r(t.readFeatures(l,{extent:T,featureProjection:e}),t.readProjection(l)):i()}else i()},o.onerror=i,o.send()}function j7(n,t){return function(T,Z,e,r,i){var o=this;xZ(n,t,T,Z,e,function(a,s){o.addFeatures(a),r!==void 0&&r(a)},i||O0)}}var H3=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),T0=function(n){H3(t,n);function t(T,Z,e){var r=n.call(this,T)||this;return r.feature=Z,r.features=e,r}return t}(V2),wZ=function(n){H3(t,n);function t(T){var Z=this,e=T||{};Z=n.call(this,{attributions:e.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:e.wrapX!==void 0?e.wrapX:!0})||this,Z.on,Z.once,Z.un,Z.loader_=O0,Z.format_=e.format,Z.overlaps_=e.overlaps===void 0?!0:e.overlaps,Z.url_=e.url,e.loader!==void 0?Z.loader_=e.loader:Z.url_!==void 0&&(X(Z.format_,7),Z.loader_=j7(Z.url_,Z.format_)),Z.strategy_=e.strategy!==void 0?e.strategy:EZ;var r=e.useSpatialIndex!==void 0?e.useSpatialIndex:!0;Z.featuresRtree_=r?new G7:null,Z.loadedExtentsRtree_=new G7,Z.loadingExtentsCount_=0,Z.nullGeometryFeatures_={},Z.idIndex_={},Z.uidIndex_={},Z.featureChangeKeys_={},Z.featuresCollection_=null;var i,o;return Array.isArray(e.features)?o=e.features:e.features&&(i=e.features,o=i.getArray()),!r&&i===void 0&&(i=new m2(o)),o!==void 0&&Z.addFeaturesInternal(o),i!==void 0&&Z.bindFeaturesCollection_(i),Z}return t.prototype.addFeature=function(T){this.addFeatureInternal(T),this.changed()},t.prototype.addFeatureInternal=function(T){var Z=U(T);if(!this.addToIndex_(Z,T)){this.featuresCollection_&&this.featuresCollection_.remove(T);return}this.setupChangeEvents_(Z,T);var e=T.getGeometry();if(e){var r=e.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(r,T)}else this.nullGeometryFeatures_[Z]=T;this.dispatchEvent(new T0(O2.ADDFEATURE,T))},t.prototype.setupChangeEvents_=function(T,Z){this.featureChangeKeys_[T]=[B(Z,G.CHANGE,this.handleFeatureChange_,this),B(Z,K0.PROPERTYCHANGE,this.handleFeatureChange_,this)]},t.prototype.addToIndex_=function(T,Z){var e=!0,r=Z.getId();return r!==void 0&&(r.toString()in this.idIndex_?e=!1:this.idIndex_[r.toString()]=Z),e&&(X(!(T in this.uidIndex_),30),this.uidIndex_[T]=Z),e},t.prototype.addFeatures=function(T){this.addFeaturesInternal(T),this.changed()},t.prototype.addFeaturesInternal=function(T){for(var Z=[],e=[],r=[],i=0,o=T.length;i0},t.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),n.prototype.refresh.call(this)},t.prototype.removeLoadedExtent=function(T){var Z=this.loadedExtentsRtree_,e;Z.forEachInExtent(T,function(r){if(_1(r.extent,T))return e=r,!0}),e&&Z.remove(e)},t.prototype.removeFeature=function(T){if(!!T){var Z=U(T);Z in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[Z]:this.featuresRtree_&&this.featuresRtree_.remove(T);var e=this.removeFeatureInternal(T);e&&this.changed()}},t.prototype.removeFeatureInternal=function(T){var Z=U(T),e=this.featureChangeKeys_[Z];if(!!e){e.forEach(H),delete this.featureChangeKeys_[Z];var r=T.getId();return r!==void 0&&delete this.idIndex_[r.toString()],delete this.uidIndex_[Z],this.dispatchEvent(new T0(O2.REMOVEFEATURE,T)),T}},t.prototype.removeFromIdIndex_=function(T){var Z=!1;for(var e in this.idIndex_)if(this.idIndex_[e]===T){delete this.idIndex_[e],Z=!0;break}return Z},t.prototype.setLoader=function(T){this.loader_=T},t.prototype.setUrl=function(T){X(this.format_,7),this.url_=T,this.setLoader(j7(T,this.format_))},t}($3);const I4=wZ,D={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function q3(n){return Math.pow(n,3)}function J0(n){return 1-q3(1-n)}function OZ(n){return 3*n*n-2*n*n*n}function RZ(n){return n}var SZ=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),IZ=function(n){SZ(t,n);function t(T,Z,e){var r=n.call(this)||this,i=e||{};return r.tileCoord=T,r.state=Z,r.interimTile=null,r.key="",r.transition_=i.transition===void 0?250:i.transition,r.transitionStarts_={},r.interpolate=!!i.interpolate,r}return t.prototype.changed=function(){this.dispatchEvent(G.CHANGE)},t.prototype.release=function(){},t.prototype.getKey=function(){return this.key+"/"+this.tileCoord},t.prototype.getInterimTile=function(){if(!this.interimTile)return this;var T=this.interimTile;do{if(T.getState()==D.LOADED)return this.transition_=0,T;T=T.interimTile}while(T);return this},t.prototype.refreshInterimChain=function(){if(!!this.interimTile){var T=this.interimTile,Z=this;do{if(T.getState()==D.LOADED){T.interimTile=null;break}else T.getState()==D.LOADING?Z=T:T.getState()==D.IDLE?Z.interimTile=T.interimTile:Z=T;T=Z.interimTile}while(T)}},t.prototype.getTileCoord=function(){return this.tileCoord},t.prototype.getState=function(){return this.state},t.prototype.setState=function(T){if(this.state!==D.ERROR&&this.state>T)throw new Error("Tile load sequence violation");this.state=T,this.changed()},t.prototype.load=function(){L()},t.prototype.getAlpha=function(T,Z){if(!this.transition_)return 1;var e=this.transitionStarts_[T];if(!e)e=Z,this.transitionStarts_[T]=e;else if(e===-1)return 1;var r=Z-e+1e3/60;return r>=this.transition_?1:q3(r/this.transition_)},t.prototype.inTransition=function(T){return this.transition_?this.transitionStarts_[T]!==-1:!1},t.prototype.endTransition=function(T){this.transition_&&(this.transitionStarts_[T]=-1)},t}(H0);const J3=IZ;var PZ=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),LZ=function(n){PZ(t,n);function t(T,Z,e,r,i,o){var a=n.call(this,T,Z,o)||this;return a.crossOrigin_=r,a.src_=e,a.key=e,a.image_=new Image,r!==null&&(a.image_.crossOrigin=r),a.unlisten_=null,a.tileLoadFunction_=i,a}return t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(T){this.image_=T,this.state=D.LOADED,this.unlistenImage_(),this.changed()},t.prototype.handleImageError_=function(){this.state=D.ERROR,this.unlistenImage_(),this.image_=AZ(),this.changed()},t.prototype.handleImageLoad_=function(){var T=this.image_;T.naturalWidth&&T.naturalHeight?this.state=D.LOADED:this.state=D.EMPTY,this.unlistenImage_(),this.changed()},t.prototype.load=function(){this.state==D.ERROR&&(this.state=D.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==D.IDLE&&(this.state=D.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=j5(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},t.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},t}(J3);function AZ(){var n=g2(1,1);return n.fillStyle="rgba(0,0,0,0)",n.fillRect(0,0,1,1),n.canvas}const Q3=LZ;var MZ=function(){function n(t,T,Z){this.decay_=t,this.minVelocity_=T,this.delay_=Z,this.points_=[],this.angle_=0,this.initialVelocity_=0}return n.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},n.prototype.update=function(t,T){this.points_.push(t,T,Date.now())},n.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,T=this.points_.length-3;if(this.points_[T+2]0&&this.points_[Z+2]>t;)Z-=3;var e=this.points_[T+2]-this.points_[Z+2];if(e<1e3/60)return!1;var r=this.points_[T]-this.points_[Z],i=this.points_[T+1]-this.points_[Z+1];return this.angle_=Math.atan2(i,r),this.initialVelocity_=Math.sqrt(r*r+i*i)/e,this.initialVelocity_>this.minVelocity_},n.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},n.prototype.getAngle=function(){return this.angle_},n}();const FZ=MZ;var DZ=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),NZ=function(n){DZ(t,n);function t(T){var Z=n.call(this)||this;return Z.map_=T,Z}return t.prototype.dispatchRenderEvent=function(T,Z){L()},t.prototype.calculateMatrices2D=function(T){var Z=T.viewState,e=T.coordinateToPixelTransform,r=T.pixelToCoordinateTransform;K2(e,T.size[0]/2,T.size[1]/2,1/Z.resolution,-1/Z.resolution,-Z.rotation,-Z.center[0],-Z.center[1]),C5(r,e)},t.prototype.forEachFeatureAtCoordinate=function(T,Z,e,r,i,o,a,s){var l,h=Z.viewState;function u(j,M,I,P){return i.call(o,M,j?I:null,P)}var c=h.projection,f=h3(T.slice(),c),p=[[0,0]];if(c.canWrapX()&&r){var d=c.getExtent(),_=q(d);p.push([-_,0],[_,0])}for(var v=Z.layerStatesArray,g=v.length,y=[],m=[],x=0;x=0;--E){var w=v[E],O=w.layer;if(O.hasRenderer()&&f4(w,h)&&a.call(s,O)){var S=O.getRenderer(),A=O.getSource();if(S&&A){var N=A.getWrapX()?f:T,R=u.bind(null,w.managed);m[0]=N[0]+p[x][0],m[1]=N[1]+p[x][1],l=S.forEachFeatureAtCoordinate(m,Z,e,R,y)}if(l)return l}}if(y.length!==0){var b=1/y.length;return y.forEach(function(j,M){return j.distanceSq+=M*b}),y.sort(function(j,M){return j.distanceSq-M.distanceSq}),y.some(function(j){return l=j.callback(j.feature,j.layer,j.geometry)}),l}},t.prototype.forEachLayerAtPixel=function(T,Z,e,r,i){return L()},t.prototype.hasFeatureAtCoordinate=function(T,Z,e,r,i,o){var a=this.forEachFeatureAtCoordinate(T,Z,e,r,B0,this,i,o);return a!==void 0},t.prototype.getMap=function(){return this.map_},t.prototype.renderFrame=function(T){L()},t.prototype.scheduleExpireIconCache=function(T){p4.canExpireCache()&&T.postRenderFunctions.push(GZ)},t}(m5);function GZ(n,t){p4.expire()}const bZ=NZ;var jZ=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),kZ=function(n){jZ(t,n);function t(T){var Z=n.call(this,T)||this;Z.fontChangeListenerKey_=B(X2,K0.PROPERTYCHANGE,T.redrawText.bind(T)),Z.element_=document.createElement("div");var e=Z.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",Z.element_.className=O4+" ol-layers";var r=T.getViewport();return r.insertBefore(Z.element_,r.firstChild||null),Z.children_=[],Z.renderedVisible_=!0,Z}return t.prototype.dispatchRenderEvent=function(T,Z){var e=this.getMap();if(e.hasListener(T)){var r=new U3(T,void 0,Z);e.dispatchEvent(r)}},t.prototype.disposeInternal=function(){H(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),n.prototype.disposeInternal.call(this)},t.prototype.renderFrame=function(T){if(!T){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(T),this.dispatchRenderEvent(a0.PRECOMPOSE,T);var Z=T.layerStatesArray.sort(function(c,f){return c.zIndex-f.zIndex}),e=T.viewState;this.children_.length=0;for(var r=[],i=null,o=0,a=Z.length;o=0;--o)r[o].renderDeclutter(T);A8(this.element_,this.children_),this.dispatchRenderEvent(a0.POSTCOMPOSE,T),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(T)},t.prototype.forEachLayerAtPixel=function(T,Z,e,r,i){for(var o=Z.viewState,a=Z.layerStatesArray,s=a.length,l=s-1;l>=0;--l){var h=a[l],u=h.layer;if(u.hasRenderer()&&f4(h,o)&&i(u)){var c=u.getRenderer(),f=c.getDataAtPixel(T,Z,e);if(f){var p=r(u,f);if(p)return p}}}},t}(bZ);const XZ=kZ;var T6=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),n0=function(n){T6(t,n);function t(T,Z){var e=n.call(this,T)||this;return e.layer=Z,e}return t}(V2),U4={LAYERS:"layers"},YZ=function(n){T6(t,n);function t(T){var Z=this,e=T||{},r=e2({},e);delete r.layers;var i=e.layers;return Z=n.call(this,r)||this,Z.on,Z.once,Z.un,Z.layersListenerKeys_=[],Z.listenerKeys_={},Z.addChangeListener(U4.LAYERS,Z.handleLayersChanged_),i?Array.isArray(i)?i=new m2(i.slice(),{unique:!0}):X(typeof i.getArray=="function",43):i=new m2(void 0,{unique:!0}),Z.setLayers(i),Z}return t.prototype.handleLayerChange_=function(){this.changed()},t.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(H),this.layersListenerKeys_.length=0;var T=this.getLayers();this.layersListenerKeys_.push(B(T,p2.ADD,this.handleLayersAdd_,this),B(T,p2.REMOVE,this.handleLayersRemove_,this));for(var Z in this.listenerKeys_)this.listenerKeys_[Z].forEach(H);I1(this.listenerKeys_);for(var e=T.getArray(),r=0,i=e.length;rthis.moveTolerance_||Math.abs(T.clientY-this.down_.clientY)>this.moveTolerance_},t.prototype.disposeInternal=function(){this.relayedListenerKey_&&(H(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(G.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(H(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(H),this.dragListenerKeys_.length=0,this.element_=null,n.prototype.disposeInternal.call(this)},t}(H0);const $Z=VZ,Y2={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},l2={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"};var d4=1/0,HZ=function(){function n(t,T){this.priorityFunction_=t,this.keyFunction_=T,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return n.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,I1(this.queuedElements_)},n.prototype.dequeue=function(){var t=this.elements_,T=this.priorities_,Z=t[0];t.length==1?(t.length=0,T.length=0):(t[0]=t.pop(),T[0]=T.pop(),this.siftUp_(0));var e=this.keyFunction_(Z);return delete this.queuedElements_[e],Z},n.prototype.enqueue=function(t){X(!(this.keyFunction_(t)in this.queuedElements_),31);var T=this.priorityFunction_(t);return T!=d4?(this.elements_.push(t),this.priorities_.push(T),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},n.prototype.getCount=function(){return this.elements_.length},n.prototype.getLeftChildIndex_=function(t){return t*2+1},n.prototype.getRightChildIndex_=function(t){return t*2+2},n.prototype.getParentIndex_=function(t){return t-1>>1},n.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},n.prototype.isEmpty=function(){return this.elements_.length===0},n.prototype.isKeyQueued=function(t){return t in this.queuedElements_},n.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},n.prototype.siftUp_=function(t){for(var T=this.elements_,Z=this.priorities_,e=T.length,r=T[t],i=Z[t],o=t;t>1;){var a=this.getLeftChildIndex_(t),s=this.getRightChildIndex_(t),l=st;){var o=this.getParentIndex_(T);if(e[o]>i)Z[T]=Z[o],e[T]=e[o],T=o;else break}Z[T]=r,e[T]=i},n.prototype.reprioritize=function(){var t=this.priorityFunction_,T=this.elements_,Z=this.priorities_,e=0,r=T.length,i,o,a;for(o=0;o0;)i=this.dequeue()[0],o=i.getKey(),r=i.getState(),r===D.IDLE&&!(o in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++e,i.load())},t}(qZ);const Tt=QZ;function Zt(n,t,T,Z,e){if(!n||!(T in n.wantedTiles)||!n.wantedTiles[T][t.getKey()])return d4;var r=n.viewState.center,i=Z[0]-r[0],o=Z[1]-r[1];return 65536*Math.log(e)+Math.sqrt(i*i+o*o)/e}const R2={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};var tt=42,k5=256;function k7(n,t,T){return function(Z,e,r,i,o){if(!!Z){if(!e&&!t)return Z;var a=t?0:r[0]*e,s=t?0:r[1]*e,l=o?o[0]:0,h=o?o[1]:0,u=n[0]+a/2+l,c=n[2]-a/2+l,f=n[1]+s/2+h,p=n[3]-s/2+h;u>c&&(u=(c+u)/2,c=u),f>p&&(f=(p+f)/2,p=f);var d=n2(Z[0],u,c),_=n2(Z[1],f,p);if(i&&T&&e){var v=30*e;d+=-v*Math.log(1+Math.max(0,u-Z[0])/v)+v*Math.log(1+Math.max(0,Z[0]-c)/v),_+=-v*Math.log(1+Math.max(0,f-Z[1])/v)+v*Math.log(1+Math.max(0,Z[1]-p)/v)}return[d,_]}}}function et(n){return n}function X5(n,t,T,Z){var e=q(t)/T[0],r=x2(t)/T[1];return Z?Math.min(n,Math.max(e,r)):Math.min(n,Math.min(e,r))}function Y5(n,t,T){var Z=Math.min(n,t),e=50;return Z*=Math.log(1+e*Math.max(0,n/t-1))/e+1,T&&(Z=Math.max(Z,T),Z/=Math.log(1+e*Math.max(0,T/n-1))/e+1),n2(Z,T/2,t*2)}function nt(n,t,T,Z){return function(e,r,i,o){if(e!==void 0){var a=n[0],s=n[n.length-1],l=T?X5(a,T,i,Z):a;if(o){var h=t!==void 0?t:!0;return h?Y5(e,l,s):n2(e,s,l)}var u=Math.min(l,e),c=Math.floor(E5(n,u,r));return n[c]>l&&c1&&typeof arguments[Z-1]=="function"&&(e=arguments[Z-1],--Z);for(var r=0;r0},t.prototype.getInteracting=function(){return this.hints_[u2.INTERACTING]>0},t.prototype.cancelAnimations=function(){this.setHint(u2.ANIMATING,-this.hints_[u2.ANIMATING]);for(var T,Z=0,e=this.animations_.length;Z=0;--e){for(var r=this.animations_[e],i=!0,o=0,a=r.length;o0?l/s.duration:1;h>=1?(s.complete=!0,h=1):i=!1;var u=s.easing(h);if(s.sourceCenter){var c=s.sourceCenter[0],f=s.sourceCenter[1],p=s.targetCenter[0],d=s.targetCenter[1];this.nextCenter_=s.targetCenter;var _=c+u*(p-c),v=f+u*(d-f);this.targetCenter_=[_,v]}if(s.sourceResolution&&s.targetResolution){var g=u===1?s.targetResolution:s.sourceResolution+u*(s.targetResolution-s.sourceResolution);if(s.anchor){var y=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(g,0,y,!0);this.targetCenter_=this.calculateCenterZoom(m,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=g,this.applyTargetState_(!0)}if(s.sourceRotation!==void 0&&s.targetRotation!==void 0){var x=u===1?U0(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+u*(s.targetRotation-s.sourceRotation);if(s.anchor){var E=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(E,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),Z=!0,!s.complete)break}}if(i){this.animations_[e]=null,this.setHint(u2.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var w=r[0].callback;w&&Q1(w,!0)}}this.animations_=this.animations_.filter(Boolean),Z&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},t.prototype.calculateCenterRotate=function(T,Z){var e,r=this.getCenterInternal();return r!==void 0&&(e=[r[0]-Z[0],r[1]-Z[1]],R5(e,T-this.getRotation()),A9(e,Z)),e},t.prototype.calculateCenterZoom=function(T,Z){var e,r=this.getCenterInternal(),i=this.getResolution();if(r!==void 0&&i!==void 0){var o=Z[0]-T*(Z[0]-r[0])/i,a=Z[1]-T*(Z[1]-r[1])/i;e=[o,a]}return e},t.prototype.getViewportSize_=function(T){var Z=this.viewportSize_;if(T){var e=Z[0],r=Z[1];return[Math.abs(e*Math.cos(T))+Math.abs(r*Math.sin(T)),Math.abs(e*Math.sin(T))+Math.abs(r*Math.cos(T))]}else return Z},t.prototype.setViewportSize=function(T){this.viewportSize_=Array.isArray(T)?T.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},t.prototype.getCenter=function(){var T=this.getCenterInternal();return T&&i5(T,this.getProjection())},t.prototype.getCenterInternal=function(){return this.get(R2.CENTER)},t.prototype.getConstraints=function(){return this.constraints_},t.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},t.prototype.getHints=function(T){return T!==void 0?(T[0]=this.hints_[0],T[1]=this.hints_[1],T):this.hints_.slice()},t.prototype.calculateExtent=function(T){var Z=this.calculateExtentInternal(T);return o5(Z,this.getProjection())},t.prototype.calculateExtentInternal=function(T){var Z=T||this.getViewportSizeMinusPadding_(),e=this.getCenterInternal();X(e,1);var r=this.getResolution();X(r!==void 0,2);var i=this.getRotation();return X(i!==void 0,3),t5(e,r,i,Z)},t.prototype.getMaxResolution=function(){return this.maxResolution_},t.prototype.getMinResolution=function(){return this.minResolution_},t.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},t.prototype.setMaxZoom=function(T){this.applyOptions_(this.getUpdatedOptions_({maxZoom:T}))},t.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},t.prototype.setMinZoom=function(T){this.applyOptions_(this.getUpdatedOptions_({minZoom:T}))},t.prototype.setConstrainResolution=function(T){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:T}))},t.prototype.getProjection=function(){return this.projection_},t.prototype.getResolution=function(){return this.get(R2.RESOLUTION)},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getResolutionForExtent=function(T,Z){return this.getResolutionForExtentInternal(g0(T,this.getProjection()),Z)},t.prototype.getResolutionForExtentInternal=function(T,Z){var e=Z||this.getViewportSizeMinusPadding_(),r=q(T)/e[0],i=x2(T)/e[1];return Math.max(r,i)},t.prototype.getResolutionForValueFunction=function(T){var Z=T||2,e=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(e/r)/Math.log(Z);return function(o){var a=e/Math.pow(Z,o*i);return a}},t.prototype.getRotation=function(){return this.get(R2.ROTATION)},t.prototype.getValueForResolutionFunction=function(T){var Z=Math.log(T||2),e=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(e/r)/Z;return function(o){var a=Math.log(e/o)/Z/i;return a}},t.prototype.getViewportSizeMinusPadding_=function(T){var Z=this.getViewportSize_(T),e=this.padding_;return e&&(Z=[Z[0]-e[1]-e[3],Z[1]-e[0]-e[2]]),Z},t.prototype.getState=function(){var T=this.getProjection(),Z=this.getResolution(),e=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=K4(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],Z,e)}return{center:r.slice(0),projection:T!==void 0?T:null,resolution:Z,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:e,zoom:this.getZoom()}},t.prototype.getZoom=function(){var T,Z=this.getResolution();return Z!==void 0&&(T=this.getZoomForResolution(Z)),T},t.prototype.getZoomForResolution=function(T){var Z=this.minZoom_||0,e,r;if(this.resolutions_){var i=E5(this.resolutions_,T,1);Z=i,e=this.resolutions_[i],i==this.resolutions_.length-1?r=2:r=e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return Z+Math.log(e/T)/Math.log(r)},t.prototype.getResolutionForZoom=function(T){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var Z=n2(Math.floor(T),0,this.resolutions_.length-2),e=this.resolutions_[Z]/this.resolutions_[Z+1];return this.resolutions_[Z]/Math.pow(e,n2(T-Z,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,T-this.minZoom_)},t.prototype.fit=function(T,Z){var e;if(X(Array.isArray(T)||typeof T.getSimplifiedGeometry=="function",24),Array.isArray(T)){X(!O5(T),25);var r=g0(T,this.getProjection());e=g7(r)}else if(T.getType()==="Circle"){var r=g0(T.getExtent(),this.getProjection());e=g7(r),e.rotate(this.getRotation(),R0(r))}else{var i=p3();i?e=T.clone().transform(i,this.getProjection()):e=T}this.fitInternal(e,Z)},t.prototype.rotatedExtentForGeometry=function(T){for(var Z=this.getRotation(),e=Math.cos(Z),r=Math.sin(-Z),i=T.getFlatCoordinates(),o=T.getStride(),a=1/0,s=1/0,l=-1/0,h=-1/0,u=0,c=i.length;u=0;s--){var l=a[s];if(!(l.getMap()!==this||!l.getActive()||!this.getTargetElement())){var h=l.handleEvent(T);if(!h||T.propagationStopped)break}}}},t.prototype.handlePostRender=function(){var T=this.frameState_,Z=this.tileQueue_;if(!Z.isEmpty()){var e=this.maxTilesLoading_,r=e;if(T){var i=T.viewHints;if(i[u2.ANIMATING]||i[u2.INTERACTING]){var o=Date.now()-T.time>8;e=o?0:8,r=o?0:2}}Z.getTilesLoading()0;if(this.renderedVisible_!=e&&(this.element.style.display=e?"":"none",this.renderedVisible_=e),!S0(Z,this.renderedAttributions_)){D3(this.ulElement_);for(var r=0,i=Z.length;r0&&e%(2*Math.PI)!==0?Z.animate({rotation:0,duration:this.duration_,easing:J0}):Z.setRotation(0))}},t.prototype.render=function(T){var Z=T.frameState;if(!!Z){var e=Z.viewState.rotation;if(e!=this.rotation_){var r="rotate("+e+"rad)";if(this.autoHide_){var i=this.element.classList.contains($1);!i&&e===0?this.element.classList.add($1):i&&e!==0&&this.element.classList.remove($1)}this.label_.style.transform=r}this.rotation_=e}},t}(B5);const wt=xt;var Ot=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Rt=function(n){Ot(t,n);function t(T){var Z=this,e=T||{};Z=n.call(this,{element:document.createElement("div"),target:e.target})||this;var r=e.className!==void 0?e.className:"ol-zoom",i=e.delta!==void 0?e.delta:1,o=e.zoomInClassName!==void 0?e.zoomInClassName:r+"-in",a=e.zoomOutClassName!==void 0?e.zoomOutClassName:r+"-out",s=e.zoomInLabel!==void 0?e.zoomInLabel:"+",l=e.zoomOutLabel!==void 0?e.zoomOutLabel:"\u2013",h=e.zoomInTipLabel!==void 0?e.zoomInTipLabel:"Zoom in",u=e.zoomOutTipLabel!==void 0?e.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=o,c.setAttribute("type","button"),c.title=h,c.appendChild(typeof s=="string"?document.createTextNode(s):s),c.addEventListener(G.CLICK,Z.handleClick_.bind(Z,i),!1);var f=document.createElement("button");f.className=a,f.setAttribute("type","button"),f.title=u,f.appendChild(typeof l=="string"?document.createTextNode(l):l),f.addEventListener(G.CLICK,Z.handleClick_.bind(Z,-i),!1);var p=r+" "+O4+" "+b5,d=Z.element;return d.className=p,d.appendChild(c),d.appendChild(f),Z.duration_=e.duration!==void 0?e.duration:250,Z}return t.prototype.handleClick_=function(T,Z){Z.preventDefault(),this.zoomByDelta_(T)},t.prototype.zoomByDelta_=function(T){var Z=this.getMap(),e=Z.getView();if(!!e){var r=e.getZoom();if(r!==void 0){var i=e.getConstrainedZoom(r+T);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:J0})):e.setZoom(i)}}},t}(B5);const St=Rt;var It=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),s2={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},Pt=function(n){It(t,n);function t(T){var Z=n.call(this)||this;Z.on,Z.once,Z.un,Z.options=T,Z.id=T.id,Z.insertFirst=T.insertFirst!==void 0?T.insertFirst:!0,Z.stopEvent=T.stopEvent!==void 0?T.stopEvent:!0,Z.element=document.createElement("div"),Z.element.className=T.className!==void 0?T.className:"ol-overlay-container "+M8,Z.element.style.position="absolute",Z.element.style.pointerEvents="auto";var e=T.autoPan;return e&&typeof e!="object"&&(e={animation:T.autoPanAnimation,margin:T.autoPanMargin}),Z.autoPan=e||!1,Z.rendered={transform_:"",visible:!0},Z.mapPostrenderListenerKey=null,Z.addChangeListener(s2.ELEMENT,Z.handleElementChanged),Z.addChangeListener(s2.MAP,Z.handleMapChanged),Z.addChangeListener(s2.OFFSET,Z.handleOffsetChanged),Z.addChangeListener(s2.POSITION,Z.handlePositionChanged),Z.addChangeListener(s2.POSITIONING,Z.handlePositioningChanged),T.element!==void 0&&Z.setElement(T.element),Z.setOffset(T.offset!==void 0?T.offset:[0,0]),Z.setPositioning(T.positioning||"top-left"),T.position!==void 0&&Z.setPosition(T.position),Z}return t.prototype.getElement=function(){return this.get(s2.ELEMENT)},t.prototype.getId=function(){return this.id},t.prototype.getMap=function(){return this.get(s2.MAP)||null},t.prototype.getOffset=function(){return this.get(s2.OFFSET)},t.prototype.getPosition=function(){return this.get(s2.POSITION)},t.prototype.getPositioning=function(){return this.get(s2.POSITIONING)},t.prototype.handleElementChanged=function(){D3(this.element);var T=this.getElement();T&&this.element.appendChild(T)},t.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(l4(this.element),H(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var T=this.getMap();if(T){this.mapPostrenderListenerKey=B(T,Y2.POSTRENDER,this.render,this),this.updatePixelPosition();var Z=this.stopEvent?T.getOverlayContainerStopEvent():T.getOverlayContainer();this.insertFirst?Z.insertBefore(this.element,Z.childNodes[0]||null):Z.appendChild(this.element),this.performAutoPan()}},t.prototype.render=function(){this.updatePixelPosition()},t.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},t.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},t.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},t.prototype.setElement=function(T){this.set(s2.ELEMENT,T)},t.prototype.setMap=function(T){this.set(s2.MAP,T)},t.prototype.setOffset=function(T){this.set(s2.OFFSET,T)},t.prototype.setPosition=function(T){this.set(s2.POSITION,T)},t.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},t.prototype.panIntoView=function(T){var Z=this.getMap();if(!(!Z||!Z.getTargetElement()||!this.get(s2.POSITION))){var e=this.getRect(Z.getTargetElement(),Z.getSize()),r=this.getElement(),i=this.getRect(r,[P8(r),L8(r)]),o=T||{},a=o.margin===void 0?20:o.margin;if(!v0(e,i)){var s=i[0]-e[0],l=e[2]-i[2],h=i[1]-e[1],u=e[3]-i[3],c=[0,0];if(s<0?c[0]=s-a:l<0&&(c[0]=Math.abs(l)+a),h<0?c[1]=h-a:u<0&&(c[1]=Math.abs(u)+a),c[0]!==0||c[1]!==0){var f=Z.getView().getCenterInternal(),p=Z.getPixelFromCoordinateInternal(f);if(!p)return;var d=[p[0]+c[0],p[1]+c[1]],_=o.animation||{};Z.getView().animateInternal({center:Z.getCoordinateFromPixelInternal(d),duration:_.duration,easing:_.easing})}}}},t.prototype.getRect=function(T,Z){var e=T.getBoundingClientRect(),r=e.left+window.pageXOffset,i=e.top+window.pageYOffset;return[r,i,r+Z[0],i+Z[1]]},t.prototype.setPositioning=function(T){this.set(s2.POSITIONING,T)},t.prototype.setVisible=function(T){this.rendered.visible!==T&&(this.element.style.display=T?"":"none",this.rendered.visible=T)},t.prototype.updatePixelPosition=function(){var T=this.getMap(),Z=this.getPosition();if(!T||!T.isRendered()||!Z){this.setVisible(!1);return}var e=T.getPixelFromCoordinate(Z),r=T.getSize();this.updateRenderedPosition(e,r)},t.prototype.updateRenderedPosition=function(T,Z){var e=this.element.style,r=this.getOffset(),i=this.getPositioning();this.setVisible(!0);var o=Math.round(T[0]+r[0])+"px",a=Math.round(T[1]+r[1])+"px",s="0%",l="0%";i=="bottom-right"||i=="center-right"||i=="top-right"?s="-100%":(i=="bottom-center"||i=="center-center"||i=="top-center")&&(s="-50%"),i=="bottom-left"||i=="bottom-center"||i=="bottom-right"?l="-100%":(i=="center-left"||i=="center-center"||i=="center-right")&&(l="-50%");var h="translate(".concat(s,", ").concat(l,") translate(").concat(o,", ").concat(a,")");this.rendered.transform_!=h&&(this.rendered.transform_=h,e.transform=h,e.msTransform=h)},t.prototype.getOptions=function(){return this.options},t}(I2);const Lt=Pt;function At(n){var t=n||{},T=new m2,Z=t.zoom!==void 0?t.zoom:!0;Z&&T.push(new St(t.zoomOptions));var e=t.rotate!==void 0?t.rotate:!0;e&&T.push(new wt(t.rotateOptions));var r=t.attribution!==void 0?t.attribution:!0;return r&&T.push(new Et(t.attributionOptions)),T}const W7={ACTIVE:"active"};var Mt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Ft=function(n){Mt(t,n);function t(T){var Z=n.call(this)||this;return Z.on,Z.once,Z.un,T&&T.handleEvent&&(Z.handleEvent=T.handleEvent),Z.map_=null,Z.setActive(!0),Z}return t.prototype.getActive=function(){return this.get(W7.ACTIVE)},t.prototype.getMap=function(){return this.map_},t.prototype.handleEvent=function(T){return!0},t.prototype.setActive=function(T){this.set(W7.ACTIVE,T)},t.prototype.setMap=function(T){this.map_=T},t}(I2);function Dt(n,t,T){var Z=n.getCenterInternal();if(Z){var e=[Z[0]+t[0],Z[1]+t[1]];n.animateInternal({duration:T!==void 0?T:250,easing:RZ,center:n.getConstrainedCenter(e)})}}function U5(n,t,T,Z){var e=n.getZoom();if(e!==void 0){var r=n.getConstrainedZoom(e+t),i=n.getResolutionForZoom(r);n.getAnimating()&&n.cancelAnimations(),n.animate({resolution:i,anchor:T,duration:Z!==void 0?Z:250,easing:J0})}}const D1=Ft;var Nt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Gt=function(n){Nt(t,n);function t(T){var Z=n.call(this)||this,e=T||{};return Z.delta_=e.delta?e.delta:1,Z.duration_=e.duration!==void 0?e.duration:250,Z}return t.prototype.handleEvent=function(T){var Z=!1;if(T.type==J.DBLCLICK){var e=T.originalEvent,r=T.map,i=T.coordinate,o=e.shiftKey?-this.delta_:this.delta_,a=r.getView();U5(a,o,i,this.duration_),e.preventDefault(),Z=!0}return!Z},t}(D1);const bt=Gt;var jt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),kt=function(n){jt(t,n);function t(T){var Z=this,e=T||{};return Z=n.call(this,e)||this,e.handleDownEvent&&(Z.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(Z.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(Z.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(Z.handleUpEvent=e.handleUpEvent),e.stopDown&&(Z.stopDown=e.stopDown),Z.handlingDownUpSequence=!1,Z.targetPointers=[],Z}return t.prototype.getPointerCount=function(){return this.targetPointers.length},t.prototype.handleDownEvent=function(T){return!1},t.prototype.handleDragEvent=function(T){},t.prototype.handleEvent=function(T){if(!T.originalEvent)return!0;var Z=!1;if(this.updateTrackedPointers_(T),this.handlingDownUpSequence){if(T.type==J.POINTERDRAG)this.handleDragEvent(T),T.originalEvent.preventDefault();else if(T.type==J.POINTERUP){var e=this.handleUpEvent(T);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(T.type==J.POINTERDOWN){var r=this.handleDownEvent(T);this.handlingDownUpSequence=r,Z=this.stopDown(r)}else T.type==J.POINTERMOVE&&this.handleMoveEvent(T);return!Z},t.prototype.handleMoveEvent=function(T){},t.prototype.handleUpEvent=function(T){return!1},t.prototype.stopDown=function(T){return T},t.prototype.updateTrackedPointers_=function(T){T.activePointers&&(this.targetPointers=T.activePointers)},t}(D1);function z5(n){for(var t=n.length,T=0,Z=0,e=0;e0&&this.condition_(T)){var Z=T.map,e=Z.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},t}(N1);const Vt=Kt;var $t=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Ht=function(n){$t(t,n);function t(T){var Z=this,e=T||{};return Z=n.call(this,{stopDown:v4})||this,Z.condition_=e.condition?e.condition:Xt,Z.lastAngle_=void 0,Z.duration_=e.duration!==void 0?e.duration:250,Z}return t.prototype.handleDragEvent=function(T){if(!!V4(T)){var Z=T.map,e=Z.getView();if(e.getConstraints().rotation!==W5){var r=Z.getSize(),i=T.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(this.lastAngle_!==void 0){var a=o-this.lastAngle_;e.adjustRotationInternal(-a)}this.lastAngle_=o}}},t.prototype.handleUpEvent=function(T){if(!V4(T))return!0;var Z=T.map,e=Z.getView();return e.endInteraction(this.duration_),!1},t.prototype.handleDownEvent=function(T){if(!V4(T))return!1;if(n6(T)&&this.condition_(T)){var Z=T.map;return Z.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},t}(N1);const qt=Ht;var Jt=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Qt=function(n){Jt(t,n);function t(T){var Z=n.call(this)||this;return Z.geometry_=null,Z.element_=document.createElement("div"),Z.element_.style.position="absolute",Z.element_.style.pointerEvents="auto",Z.element_.className="ol-box "+T,Z.map_=null,Z.startPixel_=null,Z.endPixel_=null,Z}return t.prototype.disposeInternal=function(){this.setMap(null)},t.prototype.render_=function(){var T=this.startPixel_,Z=this.endPixel_,e="px",r=this.element_.style;r.left=Math.min(T[0],Z[0])+e,r.top=Math.min(T[1],Z[1])+e,r.width=Math.abs(Z[0]-T[0])+e,r.height=Math.abs(Z[1]-T[1])+e},t.prototype.setMap=function(T){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var Z=this.element_.style;Z.left="inherit",Z.top="inherit",Z.width="inherit",Z.height="inherit"}this.map_=T,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},t.prototype.setPixels=function(T,Z){this.startPixel_=T,this.endPixel_=Z,this.createOrUpdateGeometry(),this.render_()},t.prototype.createOrUpdateGeometry=function(){var T=this.startPixel_,Z=this.endPixel_,e=[T,[T[0],Z[1]],Z,[Z[0],T[1]]],r=e.map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new a4([r])},t.prototype.getGeometry=function(){return this.geometry_},t}(m5);const Te=Qt;var o6=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),T4={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},$4=function(n){o6(t,n);function t(T,Z,e){var r=n.call(this,T)||this;return r.coordinate=Z,r.mapBrowserEvent=e,r}return t}(V2),Ze=function(n){o6(t,n);function t(T){var Z=n.call(this)||this;Z.on,Z.once,Z.un;var e=T||{};return Z.box_=new Te(e.className||"ol-dragbox"),Z.minArea_=e.minArea!==void 0?e.minArea:64,e.onBoxEnd&&(Z.onBoxEnd=e.onBoxEnd),Z.startPixel_=null,Z.condition_=e.condition?e.condition:n6,Z.boxEndCondition_=e.boxEndCondition?e.boxEndCondition:Z.defaultBoxEndCondition,Z}return t.prototype.defaultBoxEndCondition=function(T,Z,e){var r=e[0]-Z[0],i=e[1]-Z[1];return r*r+i*i>=this.minArea_},t.prototype.getGeometry=function(){return this.box_.getGeometry()},t.prototype.handleDragEvent=function(T){this.box_.setPixels(this.startPixel_,T.pixel),this.dispatchEvent(new $4(T4.BOXDRAG,T.coordinate,T))},t.prototype.handleUpEvent=function(T){this.box_.setMap(null);var Z=this.boxEndCondition_(T,this.startPixel_,T.pixel);return Z&&this.onBoxEnd(T),this.dispatchEvent(new $4(Z?T4.BOXEND:T4.BOXCANCEL,T.coordinate,T)),!1},t.prototype.handleDownEvent=function(T){return this.condition_(T)?(this.startPixel_=T.pixel,this.box_.setMap(T.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new $4(T4.BOXSTART,T.coordinate,T)),!0):!1},t.prototype.onBoxEnd=function(T){},t}(N1);const te=Ze;var ee=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),ne=function(n){ee(t,n);function t(T){var Z=this,e=T||{},r=e.condition?e.condition:Bt;return Z=n.call(this,{condition:r,className:e.className||"ol-dragzoom",minArea:e.minArea})||this,Z.duration_=e.duration!==void 0?e.duration:200,Z.out_=e.out!==void 0?e.out:!1,Z}return t.prototype.onBoxEnd=function(T){var Z=this.getMap(),e=Z.getView(),r=this.getGeometry();if(this.out_){var i=e.rotatedExtentForGeometry(r),o=e.getResolutionForExtentInternal(i),a=e.getResolution()/o;r=r.clone(),r.scale(a*a)}e.fitInternal(r,{duration:this.duration_,easing:J0})},t}(te);const re=ne,f0={LEFT:37,UP:38,RIGHT:39,DOWN:40};var ie=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),oe=function(n){ie(t,n);function t(T){var Z=n.call(this)||this,e=T||{};return Z.defaultCondition_=function(r){return r6(r)&&i6(r)},Z.condition_=e.condition!==void 0?e.condition:Z.defaultCondition_,Z.duration_=e.duration!==void 0?e.duration:100,Z.pixelDelta_=e.pixelDelta!==void 0?e.pixelDelta:128,Z}return t.prototype.handleEvent=function(T){var Z=!1;if(T.type==G.KEYDOWN){var e=T.originalEvent,r=e.keyCode;if(this.condition_(T)&&(r==f0.DOWN||r==f0.LEFT||r==f0.RIGHT||r==f0.UP)){var i=T.map,o=i.getView(),a=o.getResolution()*this.pixelDelta_,s=0,l=0;r==f0.DOWN?l=-a:r==f0.LEFT?s=-a:r==f0.RIGHT?s=a:l=a;var h=[s,l];R5(h,o.getRotation()),Dt(o,h,this.duration_),e.preventDefault(),Z=!0}}return!Z},t}(D1);const ae=oe;var se=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),le=function(n){se(t,n);function t(T){var Z=n.call(this)||this,e=T||{};return Z.condition_=e.condition?e.condition:i6,Z.delta_=e.delta?e.delta:1,Z.duration_=e.duration!==void 0?e.duration:100,Z}return t.prototype.handleEvent=function(T){var Z=!1;if(T.type==G.KEYDOWN||T.type==G.KEYPRESS){var e=T.originalEvent,r=e.charCode;if(this.condition_(T)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=T.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_,a=i.getView();U5(a,o,void 0,this.duration_),e.preventDefault(),Z=!0}}return!Z},t}(D1);const ue=le;var he=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),H4={TRACKPAD:"trackpad",WHEEL:"wheel"},ce=function(n){he(t,n);function t(T){var Z=this,e=T||{};Z=n.call(this,e)||this,Z.totalDelta_=0,Z.lastDelta_=0,Z.maxDelta_=e.maxDelta!==void 0?e.maxDelta:1,Z.duration_=e.duration!==void 0?e.duration:250,Z.timeout_=e.timeout!==void 0?e.timeout:80,Z.useAnchor_=e.useAnchor!==void 0?e.useAnchor:!0,Z.constrainResolution_=e.constrainResolution!==void 0?e.constrainResolution:!1;var r=e.condition?e.condition:Wt;return Z.condition_=e.onFocusOnly?v5(e6,r):r,Z.lastAnchor_=null,Z.startTime_=void 0,Z.timeoutId_,Z.mode_=void 0,Z.trackpadEventGap_=400,Z.trackpadTimeoutId_,Z.deltaPerZoom_=300,Z}return t.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var T=this.getMap();if(!!T){var Z=T.getView();Z.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}},t.prototype.handleEvent=function(T){if(!this.condition_(T))return!0;var Z=T.type;if(Z!==G.WHEEL)return!0;var e=T.map,r=T.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=T.coordinate);var i;if(T.type==G.WHEEL&&(i=r.deltaY,Q6&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=Z3),r.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)),i===0)return!1;this.lastDelta_=i;var o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?H4.TRACKPAD:H4.WHEEL);var a=e.getView();if(this.mode_===H4.TRACKPAD&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-i/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=i;var s=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,e),s),!1},t.prototype.handleWheelZoom_=function(T){var Z=T.getView();Z.getAnimating()&&Z.cancelAnimations();var e=-n2(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(Z.getConstrainResolution()||this.constrainResolution_)&&(e=e?e>0?1:-1:0),U5(Z,e,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},t.prototype.setMouseAnchor=function(T){this.useAnchor_=T,T||(this.lastAnchor_=null)},t}(D1);const fe=ce;var pe=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),de=function(n){pe(t,n);function t(T){var Z=this,e=T||{},r=e;return r.stopDown||(r.stopDown=v4),Z=n.call(this,r)||this,Z.anchor_=null,Z.lastAngle_=void 0,Z.rotating_=!1,Z.rotationDelta_=0,Z.threshold_=e.threshold!==void 0?e.threshold:.3,Z.duration_=e.duration!==void 0?e.duration:250,Z}return t.prototype.handleDragEvent=function(T){var Z=0,e=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-e.clientY,r.clientX-e.clientX);if(this.lastAngle_!==void 0){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),Z=o}this.lastAngle_=i;var a=T.map,s=a.getView();if(s.getConstraints().rotation!==W5){var l=a.getViewport().getBoundingClientRect(),h=z5(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(h),this.rotating_&&(a.render(),s.adjustRotationInternal(Z,this.anchor_))}},t.prototype.handleUpEvent=function(T){if(this.targetPointers.length<2){var Z=T.map,e=Z.getView();return e.endInteraction(this.duration_),!1}else return!0},t.prototype.handleDownEvent=function(T){if(this.targetPointers.length>=2){var Z=T.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||Z.getView().beginInteraction(),!0}else return!1},t}(N1);const ve=de;var ge=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),_e=function(n){ge(t,n);function t(T){var Z=this,e=T||{},r=e;return r.stopDown||(r.stopDown=v4),Z=n.call(this,r)||this,Z.anchor_=null,Z.duration_=e.duration!==void 0?e.duration:400,Z.lastDistance_=void 0,Z.lastScaleDelta_=1,Z}return t.prototype.handleDragEvent=function(T){var Z=1,e=this.targetPointers[0],r=this.targetPointers[1],i=e.clientX-r.clientX,o=e.clientY-r.clientY,a=Math.sqrt(i*i+o*o);this.lastDistance_!==void 0&&(Z=this.lastDistance_/a),this.lastDistance_=a;var s=T.map,l=s.getView();Z!=1&&(this.lastScaleDelta_=Z);var h=s.getViewport().getBoundingClientRect(),u=z5(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=s.getCoordinateFromPixelInternal(u),s.render(),l.adjustResolutionInternal(Z,this.anchor_)},t.prototype.handleUpEvent=function(T){if(this.targetPointers.length<2){var Z=T.map,e=Z.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}else return!0},t.prototype.handleDownEvent=function(T){if(this.targetPointers.length>=2){var Z=T.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||Z.getView().beginInteraction(),!0}else return!1},t}(N1);const ye=_e;var me=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Ee=function(n){me(t,n);function t(T,Z,e){var r=n.call(this)||this;if(r.ends_=[],r.maxDelta_=-1,r.maxDeltaRevision_=-1,Array.isArray(T[0]))r.setCoordinates(T,Z);else if(Z!==void 0&&e)r.setFlatCoordinates(Z,T),r.ends_=e;else{for(var i=r.getLayout(),o=T,a=[],s=[],l=0,h=o.length;l0&&this.getCount()>this.highWaterMark},n.prototype.expireCache=function(t){for(;this.canExpireCache();)this.pop()},n.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},n.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},n.prototype.forEach=function(t){for(var T=this.oldest_;T;)t(T.value_,T.key_,this),T=T.newer},n.prototype.get=function(t,T){var Z=this.entries_[t];return X(Z!==void 0,15),Z===this.newest_||(Z===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(Z.newer.older=Z.older,Z.older.newer=Z.newer),Z.newer=null,Z.older=this.newest_,this.newest_.newer=Z,this.newest_=Z),Z.value_},n.prototype.remove=function(t){var T=this.entries_[t];return X(T!==void 0,15),T===this.newest_?(this.newest_=T.older,this.newest_&&(this.newest_.newer=null)):T===this.oldest_?(this.oldest_=T.newer,this.oldest_&&(this.oldest_.older=null)):(T.newer.older=T.older,T.older.newer=T.newer),delete this.entries_[t],--this.count_,T.value_},n.prototype.getCount=function(){return this.count_},n.prototype.getKeys=function(){var t=new Array(this.count_),T=0,Z;for(Z=this.newest_;Z;Z=Z.older)t[T++]=Z.key_;return t},n.prototype.getValues=function(){var t=new Array(this.count_),T=0,Z;for(Z=this.newest_;Z;Z=Z.older)t[T++]=Z.value_;return t},n.prototype.peekLast=function(){return this.oldest_.value_},n.prototype.peekLastKey=function(){return this.oldest_.key_},n.prototype.peekFirstKey=function(){return this.newest_.key_},n.prototype.peek=function(t){if(!!this.containsKey(t))return this.entries_[t].value_},n.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},n.prototype.replace=function(t,T){this.get(t),this.entries_[t].value_=T},n.prototype.set=function(t,T){X(!(t in this.entries_),16);var Z={key_:t,newer:null,older:this.newest_,value_:T};this.newest_?this.newest_.newer=Z:this.oldest_=Z,this.newest_=Z,this.entries_[t]=Z,++this.count_},n.prototype.setSize=function(t){this.highWaterMark=t},n}();const De=Fe;function B7(n,t,T,Z){return Z!==void 0?(Z[0]=n,Z[1]=t,Z[2]=T,Z):[n,t,T]}function L4(n,t,T){return n+"/"+t+"/"+T}function s6(n){return L4(n[0],n[1],n[2])}function Ne(n){return n.split("/").map(Number)}function Ge(n){return(n[1]<T||T>t.getMaxZoom())return!1;var r=t.getFullTileRange(T);return r?r.containsXY(Z,e):!0}var je=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),ke=function(n){je(t,n);function t(){return n!==null&&n.apply(this,arguments)||this}return t.prototype.expireCache=function(T){for(;this.canExpireCache();){var Z=this.peekLast();if(Z.getKey()in T)break;this.pop().release()}},t.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var T=this.peekFirstKey(),Z=Ne(T),e=Z[0];this.forEach(function(r){r.tileCoord[0]!==e&&(this.remove(s6(r.tileCoord)),r.release())}.bind(this))}},t}(De);const l6=ke;var u6=function(){function n(t,T,Z,e){this.minX=t,this.maxX=T,this.minY=Z,this.maxY=e}return n.prototype.contains=function(t){return this.containsXY(t[1],t[2])},n.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},n.prototype.containsXY=function(t,T){return this.minX<=t&&t<=this.maxX&&this.minY<=T&&T<=this.maxY},n.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},n.prototype.extend=function(t){t.minXthis.maxX&&(this.maxX=t.maxX),t.minYthis.maxY&&(this.maxY=t.maxY)},n.prototype.getHeight=function(){return this.maxY-this.minY+1},n.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},n.prototype.getWidth=function(){return this.maxX-this.minX+1},n.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},n}();function b0(n,t,T,Z,e){return e!==void 0?(e.minX=n,e.maxX=t,e.minY=T,e.maxY=Z,e):new u6(n,t,T,Z)}const h6=u6;var Xe=globalThis&&globalThis.__extends||function(){var n=function(t,T){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(Z,e){Z.__proto__=e}||function(Z,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Z[r]=e[r])},n(t,T)};return function(t,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");n(t,T);function Z(){this.constructor=t}t.prototype=T===null?Object.create(T):(Z.prototype=T.prototype,new Z)}}(),Ye=function(n){Xe(t,n);function t(T){var Z=n.call(this)||this;return Z.geometries_=T||null,Z.changeEventsKeys_=[],Z.listenGeometriesChange_(),Z}return t.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(H),this.changeEventsKeys_.length=0},t.prototype.listenGeometriesChange_=function(){if(!!this.geometries_)for(var T=0,Z=this.geometries_.length;Tthis.sourceWorldWidth_/2){var y=[[g.source[0][0],g.source[0][1]],[g.source[1][0],g.source[1][1]],[g.source[2][0],g.source[2][1]]];y[0][0]-v>this.sourceWorldWidth_/2&&(y[0][0]-=this.sourceWorldWidth_),y[1][0]-v>this.sourceWorldWidth_/2&&(y[1][0]-=this.sourceWorldWidth_),y[2][0]-v>this.sourceWorldWidth_/2&&(y[2][0]-=this.sourceWorldWidth_);var m=Math.min(y[0][0],y[1][0],y[2][0]),x=Math.max(y[0][0],y[1][0],y[2][0]);x-m.5&&h<1,f=!1;if(s>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var p=i7([t,T,Z,e]),d=q(p)/this.targetWorldWidth_;f=d>z7||f}!c&&this.sourceProj_.isGlobal()&&h&&(f=h>z7||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!d2(l,this.maxSourceExtent_))){var _=0;if(!f&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(i[0])||!isFinite(i[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1]))){if(s>0)f=!0;else if(_=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(i[0])||!isFinite(i[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+(!isFinite(a[0])||!isFinite(a[1])?1:0),_!=1&&_!=2&&_!=4&&_!=8)return}if(s>0){if(!f){var v=[(t[0]+Z[0])/2,(t[1]+Z[1])/2],g=this.transformInv_(v),y=void 0;if(c){var m=(U0(r[0],u)+U0(o[0],u))/2;y=m-U0(g[0],u)}else y=(r[0]+o[0])/2-g[0];var x=(r[1]+o[1])/2-g[1],E=y*y+x*x;f=E>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-Z[0])<=Math.abs(t[1]-Z[1])){var w=[(T[0]+Z[0])/2,(T[1]+Z[1])/2],O=this.transformInv_(w),S=[(e[0]+t[0])/2,(e[1]+t[1])/2],A=this.transformInv_(S);this.addQuad_(t,T,w,S,r,i,O,A,s-1),this.addQuad_(S,w,Z,e,A,O,o,a,s-1)}else{var N=[(t[0]+T[0])/2,(t[1]+T[1])/2],R=this.transformInv_(N),b=[(Z[0]+e[0])/2,(Z[1]+e[1])/2],j=this.transformInv_(b);this.addQuad_(t,N,b,e,r,R,j,a,s-1),this.addQuad_(N,T,Z,b,R,i,o,j,s-1)}return}}if(c){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(_&11)==0&&this.addTriangle_(t,Z,e,r,o,a),(_&14)==0&&this.addTriangle_(t,Z,T,r,o,i),_&&((_&13)==0&&this.addTriangle_(T,e,t,i,a,r),(_&7)==0&&this.addTriangle_(T,e,Z,i,a,o))}},n.prototype.calculateSourceExtent=function(){var t=C2();return this.triangles_.forEach(function(T,Z,e){var r=T.source;p1(t,r[0]),p1(t,r[1]),p1(t,r[2])}),t},n.prototype.getTriangles=function(){return this.triangles_},n}();const pn=fn;var q4,f6=[];function K7(n,t,T,Z,e){n.beginPath(),n.moveTo(0,0),n.lineTo(t,T),n.lineTo(Z,e),n.closePath(),n.save(),n.clip(),n.fillRect(0,0,Math.max(t,Z)+1,Math.max(T,e)),n.restore()}function J4(n,t){return Math.abs(n[t*4]-210)>2||Math.abs(n[t*4+3]-.75*255)>2}function dn(){if(q4===void 0){var n=document.createElement("canvas").getContext("2d");n.globalCompositeOperation="lighter",n.fillStyle="rgba(210, 0, 0, 0.75)",K7(n,4,5,4,0),K7(n,4,5,0,5);var t=n.getImageData(0,0,3,3).data;q4=J4(t,0)||J4(t,4)||J4(t,8)}return q4}function V7(n,t,T,Z){var e=P5(T,t,n),r=u7(t,Z,T),i=t.getMetersPerUnit();i!==void 0&&(r*=i);var o=n.getMetersPerUnit();o!==void 0&&(r/=o);var a=n.getExtent();if(!a||P1(a,e)){var s=u7(n,r,e)/r;isFinite(s)&&s>0&&(r/=s)}return r}function vn(n,t,T,Z){var e=R0(T),r=V7(n,t,e,Z);return(!isFinite(r)||r<=0)&&a3(T,function(i){return r=V7(n,t,i,Z),isFinite(r)&&r>0}),r}function gn(n,t,T,Z,e,r,i,o,a,s,l,h){var u=g2(Math.round(T*n),Math.round(T*t),f6);if(h||e2(u,y5),a.length===0)return u.canvas;u.scale(T,T);function c(y){return Math.round(y*T)/T}u.globalCompositeOperation="lighter";var f=C2();a.forEach(function(y,m,x){i3(f,y.extent)});var p=q(f),d=x2(f),_=g2(Math.round(T*p/Z),Math.round(T*d/Z));h||e2(_,y5);var v=T/Z;a.forEach(function(y,m,x){var E=y.extent[0]-f[0],w=-(y.extent[3]-f[3]),O=q(y.extent),S=x2(y.extent);y.image.width>0&&y.image.height>0&&_.drawImage(y.image,s,s,y.image.width-2*s,y.image.height-2*s,E*v,w*v,O*v,S*v)});var g=P0(i);return o.getTriangles().forEach(function(y,m,x){var E=y.source,w=y.target,O=E[0][0],S=E[0][1],A=E[1][0],N=E[1][1],R=E[2][0],b=E[2][1],j=c((w[0][0]-g[0])/r),M=c(-(w[0][1]-g[1])/r),I=c((w[1][0]-g[0])/r),P=c(-(w[1][1]-g[1])/r),Y=c((w[2][0]-g[0])/r),W=c(-(w[2][1]-g[1])/r),K=O,C=S;O=0,S=0,A-=K,N-=C,R-=K,b-=C;var Q=[[A,N,0,0,I-j],[R,b,0,0,Y-j],[0,0,A,N,P-M],[0,0,R,b,W-M]],V=y9(Q);if(!!V){if(u.save(),u.beginPath(),dn()||!h){u.moveTo(I,P);for(var k=4,i2=j-I,c2=M-P,o2=0;o20&&(this.newTiles_=!0):l.setState(D.LOADED)),this.isDrawableTile(l)||(l=l.getInterimTile()),l},t.prototype.getData=function(T){var Z=this.frameState;if(!Z)return null;var e=this.getLayer(),r=t2(Z.pixelToCoordinateTransform,T.slice()),i=e.getExtent();if(i&&!P1(i,r))return null;for(var o=Z.pixelRatio,a=Z.viewState.projection,s=Z.viewState,l=e.getRenderSource(),h=l.getTileGridForProjection(s.projection),u=l.getTilePixelRatio(Z.pixelRatio),c=h.getZForResolution(s.resolution);c>=h.getMinZoom();--c){var f=h.getTileCoordForCoordAndZ(r,c),p=l.getTile(c,f[1],f[2],o,a);if(!(p instanceof Q3||p instanceof p6))return null;if(p.getState()===D.LOADED){var d=h.getOrigin(c),_=S2(h.getTileSize(c)),v=h.getResolution(c),g=Math.floor(u*((r[0]-d[0])/v-f[1]*_[0])),y=Math.floor(u*((d[1]-r[1])/v-f[2]*_[1])),m=Math.round(u*l.getGutterForProjection(s.projection));return this.getImageData(p.getImage(),g+m,y+m)}}return null},t.prototype.loadedTileCallback=function(T,Z,e){return this.isDrawableTile(e)?n.prototype.loadedTileCallback.call(this,T,Z,e):!1},t.prototype.prepareFrame=function(T){return!!this.getLayer().getSource()},t.prototype.renderFrame=function(T,Z){var e=T.layerStatesArray[T.layerIndex],r=T.viewState,i=r.projection,o=r.resolution,a=r.center,s=r.rotation,l=T.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),f=u.getTileGridForProjection(i),p=f.getZForResolution(o,u.zDirection),d=f.getResolution(p),_=T.extent,v=T.viewState.resolution,g=u.getTilePixelRatio(l),y=Math.round(q(_)/v*l),m=Math.round(x2(_)/v*l),x=e.extent&&g0(e.extent,i);x&&(_=d1(_,g0(e.extent,i)));var E=d*y/2/g,w=d*m/2/g,O=[a[0]-E,a[1]-w,a[0]+E,a[1]+w],S=f.getTileRangeForExtentAndZ(_,p),A={};A[p]={};var N=this.createLoadedTileFinder(u,i,A),R=this.tmpExtent,b=this.tmpTileRange_;this.newTiles_=!1;for(var j=s?e5(r.center,v,s,T.size):void 0,M=S.minX;M<=S.maxX;++M)for(var I=S.minY;I<=S.maxY;++I)if(!(s&&!f.tileCoordIntersectsViewport([p,M,I],j))){var P=this.getTile(p,M,I,T);if(this.isDrawableTile(P)){var Y=U(this);if(P.getState()==D.LOADED){A[p][P.tileCoord.toString()]=P;var W=P.inTransition(Y);W&&e.opacity!==1&&(P.endTransition(Y),W=!1),!this.newTiles_&&(W||this.renderedTiles.indexOf(P)===-1)&&(this.newTiles_=!0)}if(P.getAlpha(Y,T.time)===1)continue}var K=f.getTileCoordChildTileRange(P.tileCoord,b,R),C=!1;K&&(C=N(p+1,K)),C||f.forEachTileCoordParentTileRange(P.tileCoord,N,b,R)}var Q=d/o*l/g;K2(this.pixelTransform,T.size[0]/2,T.size[1]/2,1/l,1/l,s,-y/2,-m/2);var V=e3(this.pixelTransform);this.useContainer(Z,V,this.getBackground(T));var k=this.context,i2=k.canvas;C5(this.inversePixelTransform,this.pixelTransform),K2(this.tempTransform,y/2,m/2,Q,Q,0,-y/2,-m/2),i2.width!=y||i2.height!=m?(i2.width=y,i2.height=m):this.containerReused||k.clearRect(0,0,y,m),x&&this.clipUnrotated(k,T,x),u.getInterpolate()||e2(k,y5),this.preRender(k,T),this.renderedTiles.length=0;var c2=Object.keys(A).map(Number);c2.sort(w0);var o2,A0,v2;e.opacity===1&&(!this.containerReused||u.getOpaque(T.viewState.projection))?c2=c2.reverse():(o2=[],A0=[]);for(var Q0=c2.length-1;Q0>=0;--Q0){var P2=c2[Q0],T1=u.getTilePixelSize(P2,l,i),l0=f.getResolution(P2),M0=l0/d,G1=T1[0]*M0*Q,b1=T1[1]*M0*Q,Z1=f.getTileCoordForCoordAndZ(P0(O),P2),t1=f.getTileCoordExtent(Z1),$2=t2(this.tempTransform,[g*(t1[0]-O[0])/d,g*(O[3]-t1[3])/d]),M4=g*u.getGutterForProjection(i),u0=A[P2];for(var j1 in u0){var P=u0[j1],H2=P.tileCoord,F0=Z1[1]-H2[1],F4=Math.round($2[0]-(F0-1)*G1),k1=Z1[2]-H2[2],e1=Math.round($2[1]-(k1-1)*b1),M=Math.round($2[0]-F0*G1),I=Math.round($2[1]-k1*b1),N2=F4-M,L2=e1-I,h0=p===P2,W=h0&&P.getAlpha(U(this),T.time)!==1,n1=!1;if(!W)if(o2){v2=[M,I,M+N2,I,M+N2,I+L2,M,I+L2];for(var h2=0,X1=o2.length;h2=this.minZoom;){if(this.zoomFactor_===2?(i=Math.floor(i/2),o=Math.floor(o/2),r=b0(i,i,o,o,Z)):r=this.getTileRangeForExtentAndZ(a,s,Z),T(s,r))return!0;--s}return!1},n.prototype.getExtent=function(){return this.extent_},n.prototype.getMaxZoom=function(){return this.maxZoom},n.prototype.getMinZoom=function(){return this.minZoom},n.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},n.prototype.getResolution=function(t){return this.resolutions_[t]},n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getTileCoordChildTileRange=function(t,T,Z){if(t[0]this.maxZoom||T0?Z:Math.max(i/o[0],r/o[1]),s=e+1,l=new Array(s),h=0;he.highWaterMark&&(e.highWaterMark=T)},t.prototype.useTile=function(T,Z,e,r){},t}($3),Ln=function(n){_6(t,n);function t(T,Z){var e=n.call(this,T)||this;return e.tile=Z,e}return t}(V2);const An=Pn;function Mn(n,t){var T=/\{z\}/g,Z=/\{x\}/g,e=/\{y\}/g,r=/\{-y\}/g;return function(i,o,a){if(i)return n.replace(T,i[0].toString()).replace(Z,i[1].toString()).replace(e,i[2].toString()).replace(r,function(){var s=i[0],l=t.getFullTileRange(s);X(l,55);var h=l.getHeight()-i[2]-1;return h.toString()})}}function Fn(n,t){for(var T=n.length,Z=new Array(T),e=0;e