var Yl=Object.defineProperty,Ul=Object.defineProperties;var Wl=Object.getOwnPropertyDescriptors;var Vo=Object.getOwnPropertySymbols;var Bl=Object.prototype.hasOwnProperty,Zl=Object.prototype.propertyIsEnumerable;var Ho=(i,r,t)=>r in i?Yl(i,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[r]=t,$o=(i,r)=>{for(var t in r||(r={}))Bl.call(r,t)&&Ho(i,t,r[t]);if(Vo)for(var t of Vo(r))Zl.call(r,t)&&Ho(i,t,r[t]);return i},qo=(i,r)=>Ul(i,Wl(r));const zl=function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))e(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&e(a)}).observe(document,{childList:!0,subtree:!0});function t(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerpolicy&&(o.referrerPolicy=n.referrerpolicy),n.crossorigin==="use-credentials"?o.credentials="include":n.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function e(n){if(n.ep)return;n.ep=!0;const o=t(n);fetch(n.href,o)}};zl();function F(){return function(){throw new Error("Unimplemented abstract method.")}()}var Kl=0;function H(i){return i.ol_uid||(i.ol_uid=String(++Kl))}var Vl="6.14.1",Hl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),$l=function(i){Hl(r,i);function r(t){var e=this,n="v"+Vl.split("-")[0],o="Assertion failed. See https://openlayers.org/en/"+n+"/doc/errors/#"+t+" for details.";return e=i.call(this,o)||this,e.code=t,e.name="AssertionError",e.message=o,e}return r}(Error),Ja=$l,ql=function(){function i(r){this.propagationStopped,this.defaultPrevented,this.type=r,this.target=null}return i.prototype.preventDefault=function(){this.defaultPrevented=!0},i.prototype.stopPropagation=function(){this.propagationStopped=!0},i}();function Jl(i){i.stopPropagation()}var Ht=ql,Er={PROPERTYCHANGE:"propertychange"},Ql=function(){function i(){this.disposed=!1}return i.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},i.prototype.disposeInternal=function(){},i}(),eo=Ql;function tu(i,r,t){for(var e,n,o=t||Ke,a=0,s=i.length,l=!1;a>1),n=+o(i[e],r),n<0?a=e+1:(s=e,l=!n);return l?a:~a}function Ke(i,r){return i>r?1:i=0}function ro(i,r,t){var e=i.length;if(i[0]<=r)return 0;if(r<=i[e-1])return e-1;var n=void 0;if(t>0){for(n=1;n0?n-1:n:i[n-1]-r0||t&&a===0)})}function _r(){return!0}function ei(){return!1}function Ve(){}function nu(i){var r=!1,t,e,n;return function(){var o=Array.prototype.slice.call(arguments);return(!r||this!==n||!qe(o,e))&&(r=!0,n=this,e=o,t=i.apply(this,arguments)),t}}var ut=typeof Object.assign=="function"?Object.assign:function(i,r){if(i==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(i),e=1,n=arguments.length;e0:!1},r.prototype.removeEventListener=function(t,e){var n=this.listeners_&&this.listeners_[t];if(n){var o=n.indexOf(e);o!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[o]=Ve,++this.pendingRemovals_[t]):(n.splice(o,1),n.length===0&&delete this.listeners_[t]))}},r}(eo),xr=ou,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 W(i,r,t,e,n){if(e&&e!==i&&(t=t.bind(e)),n){var o=t;t=function(){i.removeEventListener(r,t),o.apply(this,arguments)}}var a={target:i,type:r,listener:t};return i.addEventListener(r,t),a}function kn(i,r,t,e){return W(i,r,t,e,!0)}function J(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),tn(i))}var au=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ri=function(i){au(r,i);function r(){var t=i.call(this)||this;return t.on=t.onInternal,t.once=t.onceInternal,t.un=t.unInternal,t.revision_=0,t}return r.prototype.changed=function(){++this.revision_,this.dispatchEvent(G.CHANGE)},r.prototype.getRevision=function(){return this.revision_},r.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,o=new Array(n),a=0;a0;)this.pop()},r.prototype.extend=function(t){for(var e=0,n=t.length;e=0||Se.match(/cpu (os|iphone os) 15_4 like mac os x/));var vu=Se.indexOf("webkit")!==-1&&Se.indexOf("edge")==-1,ns=Se.indexOf("macintosh")!==-1,is=typeof devicePixelRatio!="undefined"?devicePixelRatio:1,ni=typeof WorkerGlobalScope!="undefined"&&typeof OffscreenCanvas!="undefined"&&self instanceof WorkerGlobalScope,gu=typeof Image!="undefined"&&Image.prototype.decode,os=function(){var i=!1;try{var r=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,r),window.removeEventListener("_",null,r)}catch{}return i}();new Array(6);function Kt(){return[1,0,0,1,0,0]}function _u(i,r,t,e,n,o,a){return i[0]=r,i[1]=t,i[2]=e,i[3]=n,i[4]=o,i[5]=a,i}function yu(i,r){return i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i}function st(i,r){var t=r[0],e=r[1];return r[0]=i[0]*t+i[2]*e+i[4],r[1]=i[1]*t+i[3]*e+i[5],r}function mu(i,r,t){return _u(i,r,0,0,t,0,0)}function se(i,r,t,e,n,o,a,s){var l=Math.sin(o),u=Math.cos(o);return i[0]=e*u,i[1]=n*l,i[2]=-e*l,i[3]=n*u,i[4]=a*e*u-s*e*l+r,i[5]=a*n*l+s*n*u+t,i}function no(i,r){var t=Eu(r);B(t!==0,32);var e=r[0],n=r[1],o=r[2],a=r[3],s=r[4],l=r[5];return i[0]=a/t,i[1]=-n/t,i[2]=-o/t,i[3]=e/t,i[4]=(o*l-a*s)/t,i[5]=-(e*l-n*s)/t,i}function Eu(i){return i[0]*i[3]-i[1]*i[2]}var ea;function as(i){var r="matrix("+i.join(", ")+")";if(ni)return r;var t=ea||(ea=document.createElement("div"));return t.style.transform=r,t.style.transform}var Xr={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},vt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ra(i){for(var r=Pt(),t=0,e=i.length;tn&&(l=l|vt.RIGHT),so&&(l=l|vt.ABOVE),l===vt.UNKNOWN&&(l=vt.INTERSECTING),l}function Pt(){return[1/0,1/0,-1/0,-1/0]}function le(i,r,t,e,n){return n?(n[0]=i,n[1]=r,n[2]=t,n[3]=e,n):[i,r,t,e]}function rn(i){return le(1/0,1/0,-1/0,-1/0,i)}function ls(i,r){var t=i[0],e=i[1];return le(t,e,t,e,r)}function us(i,r,t,e,n){var o=rn(n);return hs(o,i,r,t,e)}function zr(i,r){return i[0]==r[0]&&i[2]==r[2]&&i[1]==r[1]&&i[3]==r[3]}function oo(i,r){return r[0]i[2]&&(i[2]=r[2]),r[1]i[3]&&(i[3]=r[3]),i}function Br(i,r){r[0]i[2]&&(i[2]=r[0]),r[1]i[3]&&(i[3]=r[1])}function hs(i,r,t,e,n){for(;tr[0]?e[0]=i[0]:e[0]=r[0],i[1]>r[1]?e[1]=i[1]:e[1]=r[1],i[2]=r[0]&&i[1]<=r[3]&&i[3]>=r[1]}function ao(i){return i[2]=a&&v<=l),!e&&!!(o&vt.RIGHT)&&!(n&vt.RIGHT)&&(g=p-(c-l)*d,e=g>=s&&g<=u),!e&&!!(o&vt.BELOW)&&!(n&vt.BELOW)&&(v=c-(p-s)/d,e=v>=a&&v<=l),!e&&!!(o&vt.LEFT)&&!(n&vt.LEFT)&&(g=p-(c-a)*d,e=g>=s&&g<=u)}return e}function wu(i,r){var t=r.getExtent(),e=Re(i);if(r.canWrapX()&&(e[0]=t[2])){var n=it(t),o=Math.floor((e[0]-t[0])/n),a=o*n;i[0]-=a,i[2]-=a}return i}var Su=function(){function i(r){this.code_=r.code,this.units_=r.units,this.extent_=r.extent!==void 0?r.extent:null,this.worldExtent_=r.worldExtent!==void 0?r.worldExtent:null,this.axisOrientation_=r.axisOrientation!==void 0?r.axisOrientation:"enu",this.global_=r.global!==void 0?r.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=r.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=r.metersPerUnit}return i.prototype.canWrapX=function(){return this.canWrapX_},i.prototype.getCode=function(){return this.code_},i.prototype.getExtent=function(){return this.extent_},i.prototype.getUnits=function(){return this.units_},i.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||Vt[this.units_]},i.prototype.getWorldExtent=function(){return this.worldExtent_},i.prototype.getAxisOrientation=function(){return this.axisOrientation_},i.prototype.isGlobal=function(){return this.global_},i.prototype.setGlobal=function(r){this.global_=r,this.canWrapX_=!!(r&&this.extent_)},i.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},i.prototype.setDefaultTileGrid=function(r){this.defaultTileGrid_=r},i.prototype.setExtent=function(r){this.extent_=r,this.canWrapX_=!!(this.global_&&r)},i.prototype.setWorldExtent=function(r){this.worldExtent_=r},i.prototype.setGetPointResolution=function(r){this.getPointResolutionFunc_=r},i.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},i}(),fs=Su;function ot(i,r,t){return Math.min(Math.max(i,r),t)}var Ru=function(){var i;return"cosh"in Math?i=Math.cosh:i=function(r){var t=Math.exp(r);return(t+1/t)/2},i}(),Pu=function(){var i;return"log2"in Math?i=Math.log2:i=function(r){return Math.log(r)*Math.LOG2E},i}();function Lu(i,r,t,e,n,o){var a=n-t,s=o-e;if(a!==0||s!==0){var l=((i-t)*a+(r-e)*s)/(a*a+s*s);l>1?(t=n,e=o):l>0&&(t+=a*l,e+=s*l)}return Be(i,r,t,e)}function Be(i,r,t,e){var n=t-i,o=e-r;return n*n+o*o}function Iu(i){for(var r=i.length,t=0;tn&&(n=a,e=o)}if(n===0)return null;var s=i[e];i[e]=i[t],i[t]=s;for(var l=t+1;l=0;c--){f[c]=i[c][r]/i[c][c];for(var p=c-1;p>=0;p--)i[p][r]-=i[p][c]*f[c]}return f}function na(i){return i*180/Math.PI}function Ze(i){return i*Math.PI/180}function yr(i,r){var t=i%r;return t*r<0?t+r:t}function ie(i,r,t){return i+t*(r-i)}function ps(i,r){var t=Math.pow(10,r);return Math.round(i*t)/t}function Cn(i,r){return Math.floor(ps(i,r))}function xn(i,r){return Math.ceil(ps(i,r))}var Au=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),nn=6378137,gr=Math.PI*nn,Mu=[-gr,-gr,gr,gr],Fu=[-180,-85,180,85],On=nn*Math.log(Math.tan(Math.PI/2)),sr=function(i){Au(r,i);function r(t){return i.call(this,{code:t,units:oe.METERS,extent:Mu,global:!0,worldExtent:Fu,getPointResolution:function(e,n){return e/Ru(n[1]/nn)}})||this}return r}(fs),ia=[new sr("EPSG:3857"),new sr("EPSG:102100"),new sr("EPSG:102113"),new sr("EPSG:900913"),new sr("http://www.opengis.net/def/crs/EPSG/0/3857"),new sr("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Nu(i,r,t){var e=i.length,n=t>1?t:2,o=r;o===void 0&&(n>2?o=i.slice():o=new Array(e));for(var a=0;aOn?s=On:s<-On&&(s=-On),o[a+1]=s}return o}function Du(i,r,t){var e=i.length,n=t>1?t:2,o=r;o===void 0&&(n>2?o=i.slice():o=new Array(e));for(var a=0;ar?e:new Array(1+r-n).join("0")+e}function ds(i,r){return i[0]+=+r[0],i[1]+=+r[1],i}function jn(i,r){for(var t=!0,e=i.length-1;e>=0;--e)if(i[e]!=r[e]){t=!1;break}return t}function so(i,r){var t=Math.cos(r),e=Math.sin(r),n=i[0]*t-i[1]*e,o=i[1]*t+i[0]*e;return i[0]=n,i[1]=o,i}function vs(i,r){return i[0]*=r,i[1]*=r,i}function gs(i,r){if(r.canWrapX()){var t=it(r.getExtent()),e=Uu(i,r,t);e&&(i[0]-=e*t)}return i}function Uu(i,r,t){var e=r.getExtent(),n=0;if(r.canWrapX()&&(i[0]e[2])){var o=t||it(e);n=Math.floor((i[0]-e[0])/o)}return n}var _s=63710088e-1;function sa(i,r,t){var e=t||_s,n=Ze(i[1]),o=Ze(r[1]),a=(o-n)/2,s=Ze(r[0]-i[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(n)*Math.cos(o);return 2*e*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function Wu(i,r,t,e){var n=e||_s,o=Ze(i[1]),a=Ze(i[0]),s=r/n,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(t)),u=a+Math.atan2(Math.sin(t)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l));return[na(u),na(l)]}var Wi=!0;function ys(i){var r=i===void 0?!0:i;Wi=!r}function lo(i,r,t){var e;if(r!==void 0){for(var n=0,o=i.length;n=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(Wi=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function Es(i,r){return i}function Xe(i,r){return i}function $u(){ua(ia),ua(aa),zu(aa,ia,Nu,Du)}$u();function ze(i,r,t,e,n,o){for(var a=o||[],s=0,l=r;l1)f=t;else if(c>0){for(var p=0;pn&&(n=u),o=s,a=l}return n}function fo(i,r,t,e,n){for(var o=0,a=t.length;o0;){for(var f=u.pop(),c=u.pop(),p=0,d=i[c],v=i[c+1],g=i[f],m=i[f+1],_=c+e;_p&&(h=_,p=T)}p>n&&(l[(h-r)/e]=1,c+e0&&v>p)&&(d<0&&g0&&g>d)){u=f,h=c;continue}o[a++]=u,o[a++]=h,s=u,l=h,u=f,h=c}}return o[a++]=u,o[a++]=h,a}function xs(i,r,t,e,n,o,a,s){for(var l=0,u=t.length;lo&&(u-s)*(o-l)-(n-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(n-s)*(h-l)<0&&a--,s=u,l=h}return a!==0}function yo(i,r,t,e,n,o){if(t.length===0||!Ye(i,r,t[0],e,n,o))return!1;for(var a=1,s=t.length;aE&&(u=(h+f)/2,yo(i,r,t,e,u,d)&&(y=u,E=T)),h=f}return isNaN(y)&&(y=n[o]),a?(a.push(y,d,E),a):[y,d,E]}function mh(i,r,t,e,n){for(var o=[],a=0,s=t.length;a=n[0]&&o[2]<=n[2]||o[1]>=n[1]&&o[3]<=n[3]?!0:Rs(i,r,t,e,function(a,s){return Ou(n,a,s)}):!1}function Eh(i,r,t,e,n){for(var o=0,a=t.length;o0}function Is(i,r,t,e,n){for(var o=n!==void 0?n:!1,a=0,s=t.length;a1?a:2,E=o||new Array(y),d=0;d>1;n0&&i[1]>0}function Dh(i,r,t){return t===void 0&&(t=[0,0]),t[0]=i[0]*r+.5|0,t[1]=i[1]*r+.5|0,t}function Ft(i,r){return Array.isArray(i)?i:(r===void 0?r=[i,i]:(r[0]=i,r[1]=i),r)}var Gh=function(){function i(r){this.opacity_=r.opacity,this.rotateWithView_=r.rotateWithView,this.rotation_=r.rotation,this.scale_=r.scale,this.scaleArray_=Ft(r.scale),this.displacement_=r.displacement}return i.prototype.clone=function(){var r=this.getScale();return new i({opacity:this.getOpacity(),scale:Array.isArray(r)?r.slice():r,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},i.prototype.getOpacity=function(){return this.opacity_},i.prototype.getRotateWithView=function(){return this.rotateWithView_},i.prototype.getRotation=function(){return this.rotation_},i.prototype.getScale=function(){return this.scale_},i.prototype.getScaleArray=function(){return this.scaleArray_},i.prototype.getDisplacement=function(){return this.displacement_},i.prototype.getAnchor=function(){return F()},i.prototype.getImage=function(r){return F()},i.prototype.getHitDetectionImage=function(){return F()},i.prototype.getPixelRatio=function(r){return 1},i.prototype.getImageState=function(){return F()},i.prototype.getImageSize=function(){return F()},i.prototype.getOrigin=function(){return F()},i.prototype.getSize=function(){return F()},i.prototype.setDisplacement=function(r){this.displacement_=r},i.prototype.setOpacity=function(r){this.opacity_=r},i.prototype.setRotateWithView=function(r){this.rotateWithView_=r},i.prototype.setRotation=function(r){this.rotation_=r},i.prototype.setScale=function(r){this.scale_=r,this.scaleArray_=Ft(r)},i.prototype.listenImageChange=function(r){F()},i.prototype.load=function(){F()},i.prototype.unlistenImageChange=function(r){F()},i}(),Ns=Gh,kh=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,bh=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ds(i){return typeof i=="string"?i:Gs(i)}function jh(i){var r=document.createElement("div");if(r.style.color=i,r.style.color!==""){document.body.appendChild(r);var t=getComputedStyle(r).color;return document.body.removeChild(r),t}else return""}var Xh=function(){var i=1024,r={},t=0;return function(e){var n;if(r.hasOwnProperty(e))n=r[e];else{if(t>=i){var o=0;for(var a in r)(o++&3)===0&&(delete r[a],--t)}n=Yh(e),r[e]=n,++t}return n}}();function Wn(i){return Array.isArray(i)?i:Xh(i)}function Yh(i){var r,t,e,n,o;if(bh.exec(i)&&(i=jh(i)),kh.exec(i)){var a=i.length-1,s=void 0;a<=4?s=1:s=2;var l=a===4||a===8;r=parseInt(i.substr(1+0*s,s),16),t=parseInt(i.substr(1+1*s,s),16),e=parseInt(i.substr(1+2*s,s),16),l?n=parseInt(i.substr(1+3*s,s),16):n=255,s==1&&(r=(r<<4)+r,t=(t<<4)+t,e=(e<<4)+e,l&&(n=(n<<4)+n)),o=[r,t,e,n/255]}else i.indexOf("rgba(")==0?(o=i.slice(5,-1).split(",").map(Number),_a(o)):i.indexOf("rgb(")==0?(o=i.slice(4,-1).split(",").map(Number),o.push(1),_a(o)):B(!1,14);return o}function _a(i){return i[0]=ot(i[0]+.5|0,0,255),i[1]=ot(i[1]+.5|0,0,255),i[2]=ot(i[2]+.5|0,0,255),i[3]=ot(i[3],0,1),i}function Gs(i){var r=i[0];r!=(r|0)&&(r=r+.5|0);var t=i[1];t!=(t|0)&&(t=t+.5|0);var e=i[2];e!=(e|0)&&(e=e+.5|0);var n=i[3]===void 0?1:Math.round(i[3]*100)/100;return"rgba("+r+","+t+","+e+","+n+")"}function zt(i){return Array.isArray(i)?Gs(i):i}function kt(i,r,t,e){var n;return t&&t.length?n=t.shift():ni?n=new OffscreenCanvas(i||300,r||300):n=document.createElement("canvas"),i&&(n.width=i),r&&(n.height=r),n.getContext("2d",e)}function Uh(i){var r=i.offsetWidth,t=getComputedStyle(i);return r+=parseInt(t.marginLeft,10)+parseInt(t.marginRight,10),r}function Wh(i){var r=i.offsetHeight,t=getComputedStyle(i);return r+=parseInt(t.marginTop,10)+parseInt(t.marginBottom,10),r}function Bn(i,r){var t=r.parentNode;t&&t.replaceChild(i,r)}function Zn(i){return i&&i.parentNode?i.parentNode.removeChild(i):null}function ks(i){for(;i.lastChild;)i.removeChild(i.lastChild)}function Bh(i,r){for(var t=i.childNodes,e=0;;++e){var n=t[e],o=r[e];if(!n&&!o)break;if(n!==o){if(!n){i.appendChild(o);continue}if(!o){i.removeChild(n),--e;continue}i.insertBefore(o,n)}}}var wn="ol-hidden",Zh="ol-selectable",He="ol-unselectable",ya="ol-unsupported",on="ol-control",ma="ol-collapsed",zh=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"),Ea=["style","variant","weight","size","lineHeight","family"],bs=function(i){var r=i.match(zh);if(!r)return null;for(var t={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},e=0,n=Ea.length;e=i.maxResolution)return!1;var e=r.zoom;return e>i.minZoom&&e<=i.maxZoom}var ci=fc;function pc(i,r,t,e,n){Zs(i,r,t||0,e||i.length-1,n||dc)}function Zs(i,r,t,e,n){for(;e>t;){if(e-t>600){var o=e-t+1,a=r-t+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1),h=Math.max(t,Math.floor(r-a*l/o+u)),f=Math.min(e,Math.floor(r+(o-a)*l/o+u));Zs(i,r,h,f,n)}var c=i[r],p=t,d=e;for(kr(i,t,r),n(i[e],c)>0&&kr(i,t,e);p0;)d--}n(i[t],c)===0?kr(i,t,d):(d++,kr(i,d,e)),d<=r&&(t=d+1),r<=d&&(e=d-1)}}function kr(i,r,t){var e=i[r];i[r]=i[t],i[t]=e}function dc(i,r){return ir?1:0}class zs{constructor(r=9){this._maxEntries=Math.max(4,r),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(r){let t=this.data;const e=[];if(!Rn(r,t))return e;const n=this.toBBox,o=[];for(;t;){for(let a=0;a=0&&o[t].children.length>this._maxEntries;)this._split(o,t),t--;this._adjustParentBBoxes(n,o,t)}_split(r,t){const e=r[t],n=e.children.length,o=this._minEntries;this._chooseSplitAxis(e,o,n);const a=this._chooseSplitIndex(e,o,n),s=pr(e.children.splice(a,e.children.length-a));s.height=e.height,s.leaf=e.leaf,lr(e,this.toBBox),lr(s,this.toBBox),t?r[t-1].children.push(s):this._splitRoot(e,s)}_splitRoot(r,t){this.data=pr([r,t]),this.data.height=r.height+1,this.data.leaf=!1,lr(this.data,this.toBBox)}_chooseSplitIndex(r,t,e){let n,o=1/0,a=1/0;for(let s=t;s<=e-t;s++){const l=Yr(r,0,s,this.toBBox),u=Yr(r,s,e,this.toBBox),h=mc(l,u),f=Ci(l)+Ci(u);h=t;u--){const h=r.children[u];Ur(s,r.leaf?o(h):h),l+=Sn(s)}return l}_adjustParentBBoxes(r,t,e){for(let n=e;n>=0;n--)Ur(t[n],r)}_condense(r){for(let t=r.length-1,e;t>=0;t--)r[t].children.length===0?t>0?(e=r[t-1].children,e.splice(e.indexOf(r[t]),1)):this.clear():lr(r[t],this.toBBox)}}function vc(i,r,t){if(!t)return r.indexOf(i);for(let e=0;e=i.minX&&r.maxY>=i.minY}function pr(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xa(i,r,t,e,n){const o=[r,t];for(;o.length;){if(t=o.pop(),r=o.pop(),t-r<=e)continue;const a=r+Math.ceil((t-r)/e/2)*e;pc(i,a,r,t,n),o.push(r,a,a,t)}}var Ec=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Oa={RENDER_ORDER:"renderOrder"},Tc=function(i){Ec(r,i);function r(t){var e=this,n=t||{},o=ut({},n);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,e=i.call(this,o)||this,e.declutter_=n.declutter!==void 0?n.declutter:!1,e.renderBuffer_=n.renderBuffer!==void 0?n.renderBuffer:100,e.style_=null,e.styleFunction_=void 0,e.setStyle(n.style),e.updateWhileAnimating_=n.updateWhileAnimating!==void 0?n.updateWhileAnimating:!1,e.updateWhileInteracting_=n.updateWhileInteracting!==void 0?n.updateWhileInteracting:!1,e}return r.prototype.getDeclutter=function(){return this.declutter_},r.prototype.getFeatures=function(t){return i.prototype.getFeatures.call(this,t)},r.prototype.getRenderBuffer=function(){return this.renderBuffer_},r.prototype.getRenderOrder=function(){return this.get(Oa.RENDER_ORDER)},r.prototype.getStyle=function(){return this.style_},r.prototype.getStyleFunction=function(){return this.styleFunction_},r.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},r.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},r.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new zs(9)),this.getRenderer().renderDeclutter(t)},r.prototype.setRenderOrder=function(t){this.set(Oa.RENDER_ORDER,t)},r.prototype.setStyle=function(t){this.style_=t!==void 0?t:oc,this.styleFunction_=t===null?void 0:ic(this.style_),this.changed()},r}(ci),Cc=Tc,an={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},Pn=[an.FILL],xe=[an.STROKE],We=[an.BEGIN_PATH],wa=[an.CLOSE_PATH],N=an,xc=function(){function i(){}return i.prototype.drawCustom=function(r,t,e,n){},i.prototype.drawGeometry=function(r){},i.prototype.setStyle=function(r){},i.prototype.drawCircle=function(r,t){},i.prototype.drawFeature=function(r,t){},i.prototype.drawGeometryCollection=function(r,t){},i.prototype.drawLineString=function(r,t){},i.prototype.drawMultiLineString=function(r,t){},i.prototype.drawMultiPoint=function(r,t){},i.prototype.drawMultiPolygon=function(r,t){},i.prototype.drawPoint=function(r,t){},i.prototype.drawPolygon=function(r,t){},i.prototype.drawText=function(r,t){},i.prototype.setFillStrokeStyle=function(r,t){},i.prototype.setImageStyle=function(r,t){},i.prototype.setTextStyle=function(r,t){},i}(),Ks=xc,Oc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),wc=function(i){Oc(r,i);function r(t,e,n,o){var a=i.call(this)||this;return a.tolerance=t,a.maxExtent=e,a.pixelRatio=o,a.maxLineWidth=0,a.resolution=n,a.beginGeometryInstruction1_=null,a.beginGeometryInstruction2_=null,a.bufferedMaxExtent_=null,a.instructions=[],a.coordinates=[],a.tmpCoordinate_=[],a.hitDetectionInstructions=[],a.state={},a}return r.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})},r.prototype.appendFlatPointCoordinates=function(t,e){for(var n=this.getBufferedMaxExtent(),o=this.tmpCoordinate_,a=this.coordinates,s=a.length,l=0,u=t.length;ll&&(this.instructions.push([N.CUSTOM,l,h,t,n,Ce]),this.hitDetectionInstructions.push([N.CUSTOM,l,h,t,o||n,Ce]));break;case P.POINT:u=t.getFlatCoordinates(),this.coordinates.push(u[0],u[1]),h=this.coordinates.length,this.instructions.push([N.CUSTOM,l,h,t,n]),this.hitDetectionInstructions.push([N.CUSTOM,l,h,t,o||n]);break}this.endGeometry(e)},r.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[N.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[N.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},r.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},r.prototype.reverseHitDetectionInstructions=function(){var t=this.hitDetectionInstructions;t.reverse();var e,n=t.length,o,a,s=-1;for(e=0;ethis.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},r.prototype.createFill=function(t){var e=t.fillStyle,n=[N.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(!0),n},r.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},r.prototype.createStroke=function(t){return[N.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},r.prototype.updateFillStyle=function(t,e){var n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},r.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,o=t.lineCap,a=t.lineDash,s=t.lineDashOffset,l=t.lineJoin,u=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=o||a!=t.currentLineDash&&!qe(t.currentLineDash,a)||t.currentLineDashOffset!=s||t.currentLineJoin!=l||t.currentLineWidth!=u||t.currentMiterLimit!=h)&&(n!==void 0&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=o,t.currentLineDash=a,t.currentLineDashOffset=s,t.currentLineJoin=l,t.currentLineWidth=u,t.currentMiterLimit=h)},r.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[N.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},r.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ss(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;ii(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},r}(Ks),sn=wc,Sc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Rc=function(i){Sc(r,i);function r(t,e,n,o){var a=i.call(this,t,e,n,o)||this;return a.hitDetectionImage_=null,a.image_=null,a.imagePixelRatio_=void 0,a.anchorX_=void 0,a.anchorY_=void 0,a.height_=void 0,a.opacity_=void 0,a.originX_=void 0,a.originY_=void 0,a.rotateWithView_=void 0,a.rotation_=void 0,a.scale_=void 0,a.width_=void 0,a.declutterImageWithText_=void 0,a}return r.prototype.drawPoint=function(t,e){if(!!this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(n,o);this.instructions.push([N.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,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.declutterImageWithText_]),this.hitDetectionInstructions.push([N.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},r.prototype.drawMultiPoint=function(t,e){if(!!this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(n,o);this.instructions.push([N.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,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.declutterImageWithText_]),this.hitDetectionInstructions.push([N.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},r.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,i.prototype.finish.call(this)},r.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),o=t.getSize(),a=t.getHitDetectionImage(),s=t.getImage(this.pixelRatio),l=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=a,this.image_=s,this.height_=o[1],this.opacity_=t.getOpacity(),this.originX_=l[0]*this.imagePixelRatio_,this.originY_=l[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=o[0],this.declutterImageWithText_=e},r}(sn),Pc=Rc,Lc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ic=function(i){Lc(r,i);function r(t,e,n,o){return i.call(this,t,e,n,o)||this}return r.prototype.drawFlatCoordinates_=function(t,e,n,o){var a=this.coordinates.length,s=this.appendFlatLineCoordinates(t,e,n,o,!1,!1),l=[N.MOVE_TO_LINE_TO,a,s];return this.instructions.push(l),this.hitDetectionInstructions.push(l),n},r.prototype.drawLineString=function(t,e){var n=this.state,o=n.strokeStyle,a=n.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Vr,Hr],We);var s=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(s,0,s.length,l),this.hitDetectionInstructions.push(xe),this.endGeometry(e)}},r.prototype.drawMultiLineString=function(t,e){var n=this.state,o=n.strokeStyle,a=n.lineWidth;if(!(o===void 0||a===void 0)){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([N.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],We);for(var s=t.getEnds(),l=t.getFlatCoordinates(),u=t.getStride(),h=0,f=0,c=s.length;fi&&(l>s&&(s=l,o=u,a=f),l=0,u=f-n)),c=p,g=_,m=y),d=E,v=T}return l+=p,l>s?[u,f]:[o,a]}var Dc=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),$n={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Gc=function(i){Dc(r,i);function r(t,e,n,o){var a=i.call(this,t,e,n,o)||this;return a.labels_=null,a.text_="",a.textOffsetX_=0,a.textOffsetY_=0,a.textRotateWithView_=void 0,a.textRotation_=0,a.textFillState_=null,a.fillStates={},a.textStrokeState_=null,a.strokeStates={},a.textState_={},a.textStates={},a.textKey_="",a.fillKey_="",a.strokeKey_="",a.declutterImageWithText_=void 0,a}return r.prototype.finish=function(){var t=i.prototype.finish.call(this);return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t},r.prototype.drawText=function(t,e){var n=this.textFillState_,o=this.textStrokeState_,a=this.textState_;if(!(this.text_===""||!a||!n&&!o)){var s=this.coordinates,l=s.length,u=t.getType(),h=null,f=t.getStride();if(a.placement===Ws.LINE&&(u==P.LINE_STRING||u==P.MULTI_LINE_STRING||u==P.POLYGON||u==P.MULTI_POLYGON)){if(!Rt(this.getBufferedMaxExtent(),t.getExtent()))return;var c=void 0;if(h=t.getFlatCoordinates(),u==P.LINE_STRING)c=[h.length];else if(u==P.MULTI_LINE_STRING)c=t.getEnds();else if(u==P.POLYGON)c=t.getEnds().slice(0,1);else if(u==P.MULTI_POLYGON){var p=t.getEndss();c=[];for(var d=0,v=p.length;dI[2]}else b=E>R;var j=Math.PI,U=[],A=x+e===r;r=x,g=0,m=w,c=i[r],p=i[r+1];var k;if(A){_(),k=Math.atan2(p-v,c-d),b&&(k+=k>0?-j:j);var L=(R+E)/2,z=(M+T)/2;return U[0]=[L,z,(O-o)/2,k,n],U}for(var Z=0,V=n.length;Z0?-j:j),k!==void 0){var C=Q-k;if(C+=C>j?-2*j:C<-j?2*j:0,Math.abs(C)>a)return null}k=Q;for(var lt=Z,X=0;Z0&&i.push(` `,""),i.push(r,""),i}var qc=function(){function i(r,t,e,n){this.overlaps=e,this.pixelRatio=t,this.resolution=r,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=Kt(),this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return i.prototype.createLabel=function(r,t,e,n){var o=r+t+e+n;if(this.labels_[o])return this.labels_[o];var a=n?this.strokeStates[n]:null,s=e?this.fillStates[e]:null,l=this.textStates[t],u=this.pixelRatio,h=[l.scale[0]*u,l.scale[1]*u],f=Array.isArray(r),c=La(f?r[0]:r,l.textAlign||Jr),p=n&&a.lineWidth?a.lineWidth:0,d=f?r:r.split(` `).reduce($c,[]),v=$h(l,d),g=v.width,m=v.height,_=v.widths,y=v.heights,E=v.lineWidths,T=g+p,x=[],w=(T+2)*h[0],O=(m+p)*h[1],R={width:w<0?Math.floor(w):Math.ceil(w),height:O<0?Math.floor(O):Math.ceil(O),contextInstructions:x};if((h[0]!=1||h[1]!=1)&&x.push("scale",h),n){x.push("strokeStyle",a.strokeStyle),x.push("lineWidth",p),x.push("lineCap",a.lineCap),x.push("lineJoin",a.lineJoin),x.push("miterLimit",a.miterLimit);var M=ni?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D;M.prototype.setLineDash&&(x.push("setLineDash",[a.lineDash]),x.push("lineDashOffset",a.lineDashOffset))}e&&x.push("fillStyle",s.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");for(var b=.5-c,I=c*T+b*p,j=[],U=[],A=0,k=0,L=0,z=0,Z,V=0,Q=d.length;Vr?r-u:o,E=a+h>t?t-h:a,T=d[3]+y*c[0]+d[1],x=d[0]+E*c[1]+d[2],w=m-d[3],O=_-d[0];(v||f!==0)&&(fe[0]=w,pe[0]=w,fe[1]=O,qt[1]=O,qt[0]=w+T,Jt[0]=qt[0],Jt[1]=O+x,pe[1]=Jt[1]);var R;return f!==0?(R=se(Kt(),e,n,1,1,f,-e,-n),st(R,fe),st(R,qt),st(R,Jt),st(R,pe),le(Math.min(fe[0],qt[0],Jt[0],pe[0]),Math.min(fe[1],qt[1],Jt[1],pe[1]),Math.max(fe[0],qt[0],Jt[0],pe[0]),Math.max(fe[1],qt[1],Jt[1],pe[1]),ur)):le(Math.min(w,w+T),Math.min(O,O+x),Math.max(w,w+T),Math.max(O,O+x),ur),p&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:y,drawImageH:E,originX:u,originY:h,declutterBox:{minX:ur[0],minY:ur[1],maxX:ur[2],maxY:ur[3],value:g},canvasTransform:R,scale:c}},i.prototype.replayImageOrLabel_=function(r,t,e,n,o,a,s){var l=!!(a||s),u=n.declutterBox,h=r.canvas,f=s?s[2]*n.scale[0]/2:0,c=u.minX-f<=h.width/t&&u.maxX+f>=0&&u.minY-f<=h.height/t&&u.maxY+f>=0;return c&&(l&&this.replayTextBackground_(r,fe,qt,Jt,pe,a,s),qh(r,n.canvasTransform,o,e,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},i.prototype.fill_=function(r){if(this.alignFill_){var t=st(this.renderedTransform_,[0,0]),e=512*this.pixelRatio;r.save(),r.translate(t[0]%e,t[1]%e),r.rotate(this.viewRotation_)}r.fill(),this.alignFill_&&r.restore()},i.prototype.setStrokeStyle_=function(r,t){r.strokeStyle=t[1],r.lineWidth=t[2],r.lineCap=t[3],r.lineJoin=t[4],r.miterLimit=t[5],r.setLineDash&&(r.lineDashOffset=t[7],r.setLineDash(t[6]))},i.prototype.drawLabelWithPointPlacement_=function(r,t,e,n){var o=this.textStates[t],a=this.createLabel(r,t,n,e),s=this.strokeStates[e],l=this.pixelRatio,u=La(Array.isArray(r)?r[0]:r,o.textAlign||Jr),h=$n[o.textBaseline||Kn],f=s&&s.lineWidth?s.lineWidth:0,c=a.width/l-2*o.scale[0],p=u*c+2*(.5-u)*f,d=h*a.height/l+2*(.5-h)*f;return{label:a,anchorX:p,anchorY:d}},i.prototype.execute_=function(r,t,e,n,o,a,s,l){var u;this.pixelCoordinates_&&qe(e,this.renderedTransform_)?u=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),u=ze(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),yu(this.renderedTransform_,e));for(var h=0,f=n.length,c=0,p,d,v,g,m,_,y,E,T,x,w,O,R=0,M=0,b=null,I=null,j=this.coordinateCache_,U=this.viewRotation_,A=Math.round(Math.atan2(-e[1],e[0])*1e12)/1e12,k={context:r,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:U},L=this.instructions!=n||this.overlaps?0:200,z,Z,V,Q;hL&&(this.fill_(r),R=0),M>L&&(r.stroke(),M=0),!R&&!M&&(r.beginPath(),g=NaN,m=NaN),++h;break;case N.CIRCLE:c=C[1];var X=u[c],ct=u[c+1],Lt=u[c+2],It=u[c+3],xt=Lt-X,At=It-ct,rr=Math.sqrt(xt*xt+At*At);r.moveTo(X+rr,ct),r.arc(X,ct,rr,0,2*Math.PI,!0),++h;break;case N.CLOSE_PATH:r.closePath(),++h;break;case N.CUSTOM:c=C[1],p=C[2];var Wt=C[3],fn=C[4],pn=C.length==6?C[5]:void 0;k.geometry=Wt,k.feature=z,h in j||(j[h]=[]);var ue=j[h];pn?pn(u,c,p,2,ue):(ue[0]=u[c],ue[1]=u[c+1],ue.length=2),fn(ue,k),++h;break;case N.DRAW_IMAGE:c=C[1],p=C[2],E=C[3],d=C[4],v=C[5];var nr=C[6],dn=C[7],Rr=C[8],vn=C[9],Ie=C[10],Pr=C[11],gn=C[12],ir=C[13],he=C[14];if(!E&&C.length>=19){T=C[18],x=C[19],w=C[20],O=C[21];var or=this.drawLabelWithPointPlacement_(T,x,w,O);E=or.label,C[3]=E;var gi=C[22];d=(or.anchorX-gi)*this.pixelRatio,C[4]=d;var _n=C[23];v=(or.anchorY-_n)*this.pixelRatio,C[5]=v,nr=E.height,C[6]=nr,ir=E.width,C[13]=ir}var Lr=void 0;C.length>24&&(Lr=C[24]);var $t=void 0,Bt=void 0,Ae=void 0;C.length>16?($t=C[15],Bt=C[16],Ae=C[17]):($t=Ue,Bt=!1,Ae=!1),Ie&&A?Pr+=U:!Ie&&!A&&(Pr-=U);for(var Ir=0;c0){if(!a||p!==nt.IMAGE&&p!==nt.TEXT||a.indexOf(x)!==-1){var b=(c[R]-3)/4,I=n-b%s,j=n-(b/s|0),U=o(x,w,I*I+j*j);if(U)return U}h.clearRect(0,0,s,s);break}}var v=Object.keys(this.executorsByZIndex_).map(Number);v.sort(Ke);var g,m,_,y,E;for(g=v.length-1;g>=0;--g){var T=v[g].toString();for(_=this.executorsByZIndex_[T],m=Oi.length-1;m>=0;--m)if(p=Oi[m],y=_[p],y!==void 0&&(E=y.executeHitDetection(h,l,e,d,f),E))return E}},i.prototype.getClipCoords=function(r){var t=this.maxExtent_;if(!t)return null;var e=t[0],n=t[1],o=t[2],a=t[3],s=[e,n,e,a,o,a,o,n];return ze(s,0,8,2,r,s),s},i.prototype.isEmpty=function(){return Tr(this.executorsByZIndex_)},i.prototype.execute=function(r,t,e,n,o,a,s){var l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(Ke),this.maxExtent_&&(r.save(),this.clip(r,e));var u=a||Oi,h,f,c,p,d,v;for(s&&l.reverse(),h=0,f=l.length;ht)break;var s=e[a];s||(s=[],e[a]=s),s.push(((i+n)*r+(i+o))*4+3),n>0&&s.push(((i-n)*r+(i+o))*4+3),o>0&&(s.push(((i+n)*r+(i-o))*4+3),n>0&&s.push(((i-n)*r+(i-o))*4+3))}for(var l=[],n=0,u=e.length;nthis.maxCacheSize_},i.prototype.expire=function(){if(this.canExpireCache()){var r=0;for(var t in this.cache_){var e=this.cache_[t];(r++&3)===0&&!e.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}},i.prototype.get=function(r,t,e){var n=Aa(r,t,e);return n in this.cache_?this.cache_[n]:null},i.prototype.set=function(r,t,e,n){var o=Aa(r,t,e);this.cache_[o]=n,++this.cacheSize_},i.prototype.setSize=function(r){this.maxCacheSize_=r,this.expire()},i}();function Aa(i,r,t){var e=t?Ds(t):"null";return r+":"+i+":"+e}var qn=new of,af=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),sf=function(i){af(r,i);function r(t,e,n,o){var a=i.call(this)||this;return a.extent=t,a.pixelRatio_=n,a.resolution=e,a.state=o,a}return r.prototype.changed=function(){this.dispatchEvent(G.CHANGE)},r.prototype.getExtent=function(){return this.extent},r.prototype.getImage=function(){return F()},r.prototype.getPixelRatio=function(){return this.pixelRatio_},r.prototype.getResolution=function(){return this.resolution},r.prototype.getState=function(){return this.state},r.prototype.load=function(){F()},r}(xr),lf=sf,uf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}();(function(i){uf(r,i);function r(t,e,n,o,a,s){var l=i.call(this,t,e,n,tt.IDLE)||this;return l.src_=o,l.image_=new Image,a!==null&&(l.image_.crossOrigin=a),l.unlisten_=null,l.state=tt.IDLE,l.imageLoadFunction_=s,l}return r.prototype.getImage=function(){return this.image_},r.prototype.handleImageError_=function(){this.state=tt.ERROR,this.unlistenImage_(),this.changed()},r.prototype.handleImageLoad_=function(){this.resolution===void 0&&(this.resolution=Ut(this.extent)/this.image_.height),this.state=tt.LOADED,this.unlistenImage_(),this.changed()},r.prototype.load=function(){(this.state==tt.IDLE||this.state==tt.ERROR)&&(this.state=tt.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},r.prototype.setImage=function(t){this.image_=t,this.resolution=Ut(this.extent)/this.image_.height},r.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},r})(lf);function Eo(i,r,t){var e=i,n=!0,o=!1,a=!1,s=[kn(e,G.LOAD,function(){a=!0,o||r()})];return e.src&&gu?(o=!0,e.decode().then(function(){n&&r()}).catch(function(l){n&&(a?r():t())})):s.push(kn(e,G.ERROR,t)),function(){n=!1,s.forEach(J)}}var hf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),br=null,cf=function(i){hf(r,i);function r(t,e,n,o,a,s){var l=i.call(this)||this;return l.hitDetectionImage_=null,l.image_=t||new Image,o!==null&&(l.image_.crossOrigin=o),l.canvas_={},l.color_=s,l.unlisten_=null,l.imageState_=a,l.size_=n,l.src_=e,l.tainted_,l}return r.prototype.isTainted_=function(){if(this.tainted_===void 0&&this.imageState_===tt.LOADED){br||(br=kt(1,1)),br.drawImage(this.image_,0,0);try{br.getImageData(0,0,1,1),this.tainted_=!1}catch{br=null,this.tainted_=!0}}return this.tainted_===!0},r.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(G.CHANGE)},r.prototype.handleImageError_=function(){this.imageState_=tt.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},r.prototype.handleImageLoad_=function(){this.imageState_=tt.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_()},r.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},r.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},r.prototype.getImageState=function(){return this.imageState_},r.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],n=kt(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},r.prototype.getSize=function(){return this.size_},r.prototype.getSrc=function(){return this.src_},r.prototype.load=function(){if(this.imageState_==tt.IDLE){this.imageState_=tt.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},r.prototype.replaceColor_=function(t){if(!(!this.color_||this.canvas_[t]||this.imageState_!==tt.LOADED)){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply",n.globalCompositeOperation==="multiply"||this.isTainted_())n.fillStyle=Ds(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var o=n.getImageData(0,0,e.width,e.height),a=o.data,s=this.color_[0]/255,l=this.color_[1]/255,u=this.color_[2]/255,h=this.color_[3],f=0,c=a.length;f0,6);var f=n.src!==void 0?tt.IDLE:tt.LOADED;return e.color_=n.color!==void 0?Wn(n.color):null,e.iconImage_=ff(u,h,e.imgSize_!==void 0?e.imgSize_:null,e.crossOrigin_,f,e.color_),e.offset_=n.offset!==void 0?n.offset:[0,0],e.offsetOrigin_=n.offsetOrigin!==void 0?n.offsetOrigin:Dt.TOP_LEFT,e.origin_=null,e.size_=n.size!==void 0?n.size:null,e}return r.prototype.clone=function(){var t=this.getScale();return new r({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()})},r.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==ye.FRACTION||this.anchorYUnits_==ye.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==ye.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==ye.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Dt.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_==Dt.TOP_RIGHT||this.anchorOrigin_==Dt.BOTTOM_RIGHT)&&(t[0]=-t[0]+e[0]),(this.anchorOrigin_==Dt.BOTTOM_LEFT||this.anchorOrigin_==Dt.BOTTOM_RIGHT)&&(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},r.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},r.prototype.getColor=function(){return this.color_},r.prototype.getImage=function(t){return this.iconImage_.getImage(t)},r.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},r.prototype.getImageSize=function(){return this.iconImage_.getSize()},r.prototype.getImageState=function(){return this.iconImage_.getImageState()},r.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},r.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Dt.TOP_LEFT){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_==Dt.TOP_RIGHT||this.offsetOrigin_==Dt.BOTTOM_RIGHT)&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_==Dt.BOTTOM_LEFT||this.offsetOrigin_==Dt.BOTTOM_RIGHT)&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_},r.prototype.getSrc=function(){return this.iconImage_.getSrc()},r.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},r.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(G.CHANGE,t)},r.prototype.load=function(){this.iconImage_.load()},r.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(G.CHANGE,t)},r}(Ns),Gn=df,Zt=.5;function vf(i,r,t,e,n,o,a){var s=i[0]*Zt,l=i[1]*Zt,u=kt(s,l);u.imageSmoothingEnabled=!1;for(var h=u.canvas,f=new nf(u,Zt,n,null,a),c=t.length,p=Math.floor((256*256*256-1)/c),d={},v=1;v<=c;++v){var g=t[v-1],m=g.getStyleFunction()||e;if(!!e){var _=m(g,o);if(!!_){Array.isArray(_)||(_=[_]);for(var y=v*p,E="#"+("000000"+y.toString(16)).slice(-6),T=0,x=_.length;Tv[2];)++_,y=m*_,f.push(this.getRenderTransform(o,a,s,Zt,c,p,y).slice()),g-=m}this.hitDetectionImageData_=vf(n,f,this.renderedFeatures_,h.getStyleFunction(),u,a,s)}e(gf(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},r.prototype.forEachFeatureAtCoordinate=function(t,e,n,o,a){var s=this;if(!!this.replayGroup_){var l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),f={},c=function(v,g,m){var _=H(v),y=f[_];if(y){if(y!==!0&&mT[0]&&O[2]>T[2]&&E.push([O[0]-x,O[1],O[2]-x,O[3]])}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==d&&this.renderedRenderOrder_==g&&je(this.wrappedRenderedExtent_,_))return qe(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var R=new Ra($i(c,p),_,c,p),M;this.getLayer().getDeclutter()&&(M=new Ra($i(c,p),_,c,p));for(var b,I,j,I=0,j=E.length;I=200&&s.status<300){var u=r.getType(),h=void 0;u==be.JSON||u==be.TEXT?h=s.responseText:u==be.XML?(h=s.responseXML,h||(h=new DOMParser().parseFromString(s.responseText,"application/xml"))):u==be.ARRAY_BUFFER&&(h=s.response),h?o(r.readFeatures(h,{extent:t,featureProjection:n}),r.readProjection(h)):a()}else a()},s.onerror=a,s.send()}function Da(i,r){return function(t,e,n,o,a){var s=this;jf(i,r,t,e,n,function(l,u){s.addFeatures(l),o!==void 0&&o(l)},a||Ve)}}var Qs=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),de=function(i){Qs(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.feature=e,o.features=n,o}return r}(Ht),Xf=function(i){Qs(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{attributions:n.attributions,interpolate:!0,projection:void 0,state:$e.READY,wrapX:n.wrapX!==void 0?n.wrapX:!0})||this,e.on,e.once,e.un,e.loader_=Ve,e.format_=n.format,e.overlaps_=n.overlaps===void 0?!0:n.overlaps,e.url_=n.url,n.loader!==void 0?e.loader_=n.loader:e.url_!==void 0&&(B(e.format_,7),e.loader_=Da(e.url_,e.format_)),e.strategy_=n.strategy!==void 0?n.strategy:kf;var o=n.useSpatialIndex!==void 0?n.useSpatialIndex:!0;e.featuresRtree_=o?new Fa:null,e.loadedExtentsRtree_=new Fa,e.loadingExtentsCount_=0,e.nullGeometryFeatures_={},e.idIndex_={},e.uidIndex_={},e.featureChangeKeys_={},e.featuresCollection_=null;var a,s;return Array.isArray(n.features)?s=n.features:n.features&&(a=n.features,s=a.getArray()),!o&&a===void 0&&(a=new Gt(s)),s!==void 0&&e.addFeaturesInternal(s),a!==void 0&&e.bindFeaturesCollection_(a),e}return r.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},r.prototype.addFeatureInternal=function(t){var e=H(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var o=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(o,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new de(jt.ADDFEATURE,t))},r.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[W(e,G.CHANGE,this.handleFeatureChange_,this),W(e,Er.PROPERTYCHANGE,this.handleFeatureChange_,this)]},r.prototype.addToIndex_=function(t,e){var n=!0,o=e.getId();return o!==void 0&&(o.toString()in this.idIndex_?n=!1:this.idIndex_[o.toString()]=e),n&&(B(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},r.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},r.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],o=[],a=0,s=t.length;a0},r.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),i.prototype.refresh.call(this)},r.prototype.removeLoadedExtent=function(t){var e=this.loadedExtentsRtree_,n;e.forEachInExtent(t,function(o){if(zr(o.extent,t))return n=o,!0}),n&&e.remove(n)},r.prototype.removeFeature=function(t){if(!!t){var e=H(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);var n=this.removeFeatureInternal(t);n&&this.changed()}},r.prototype.removeFeatureInternal=function(t){var e=H(t),n=this.featureChangeKeys_[e];if(!!n){n.forEach(J),delete this.featureChangeKeys_[e];var o=t.getId();return o!==void 0&&delete this.idIndex_[o.toString()],delete this.uidIndex_[e],this.dispatchEvent(new de(jt.REMOVEFEATURE,t)),t}},r.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},r.prototype.setLoader=function(t){this.loader_=t},r.prototype.setUrl=function(t){B(this.format_,7),this.url_=t,this.setLoader(Da(t,this.format_))},r}(Js),dr=Xf;function Ln(i,r){return st(i.inversePixelTransform,r.slice(0))}var D={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function tl(i){return Math.pow(i,3)}function er(i){return 1-tl(1-i)}function Yf(i){return 3*i*i-2*i*i*i}function Uf(i){return i}var Wf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Bf=function(i){Wf(r,i);function r(t,e,n){var o=i.call(this)||this,a=n||{};return o.tileCoord=t,o.state=e,o.interimTile=null,o.key="",o.transition_=a.transition===void 0?250:a.transition,o.transitionStarts_={},o.interpolate=!!a.interpolate,o}return r.prototype.changed=function(){this.dispatchEvent(G.CHANGE)},r.prototype.release=function(){},r.prototype.getKey=function(){return this.key+"/"+this.tileCoord},r.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},r.prototype.refreshInterimChain=function(){if(!!this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==D.LOADED){t.interimTile=null;break}else t.getState()==D.LOADING?e=t:t.getState()==D.IDLE?e.interimTile=t.interimTile:e=t;t=e.interimTile}while(t)}},r.prototype.getTileCoord=function(){return this.tileCoord},r.prototype.getState=function(){return this.state},r.prototype.setState=function(t){if(this.state!==D.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},r.prototype.load=function(){F()},r.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;var o=e-n+1e3/60;return o>=this.transition_?1:tl(o/this.transition_)},r.prototype.inTransition=function(t){return this.transition_?this.transitionStarts_[t]!==-1:!1},r.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},r}(xr),el=Bf,Zf=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),zf=function(i){Zf(r,i);function r(t,e,n,o,a,s){var l=i.call(this,t,e,s)||this;return l.crossOrigin_=o,l.src_=n,l.key=n,l.image_=new Image,o!==null&&(l.image_.crossOrigin=o),l.unlisten_=null,l.tileLoadFunction_=a,l}return r.prototype.getImage=function(){return this.image_},r.prototype.setImage=function(t){this.image_=t,this.state=D.LOADED,this.unlistenImage_(),this.changed()},r.prototype.handleImageError_=function(){this.state=D.ERROR,this.unlistenImage_(),this.image_=Kf(),this.changed()},r.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=D.LOADED:this.state=D.EMPTY,this.unlistenImage_(),this.changed()},r.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_=Eo(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},r.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},r}(el);function Kf(){var i=kt(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}var rl=zf,Vf=function(){function i(r,t,e){this.decay_=r,this.minVelocity_=t,this.delay_=e,this.points_=[],this.angle_=0,this.initialVelocity_=0}return i.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},i.prototype.update=function(r,t){this.points_.push(r,t,Date.now())},i.prototype.end=function(){if(this.points_.length<6)return!1;var r=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]0&&this.points_[e+2]>r;)e-=3;var n=this.points_[t+2]-this.points_[e+2];if(n<1e3/60)return!1;var o=this.points_[t]-this.points_[e],a=this.points_[t+1]-this.points_[e+1];return this.angle_=Math.atan2(a,o),this.initialVelocity_=Math.sqrt(o*o+a*a)/n,this.initialVelocity_>this.minVelocity_},i.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},i.prototype.getAngle=function(){return this.angle_},i}(),Hf=Vf,$f=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),qf=function(i){$f(r,i);function r(t){var e=i.call(this)||this;return e.map_=t,e}return r.prototype.dispatchRenderEvent=function(t,e){F()},r.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,o=t.pixelToCoordinateTransform;se(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),no(o,n)},r.prototype.forEachFeatureAtCoordinate=function(t,e,n,o,a,s,l,u){var h,f=e.viewState;function c(A,k,L,z){return a.call(s,k,A?L:null,z)}var p=f.projection,d=gs(t.slice(),p),v=[[0,0]];if(p.canWrapX()&&o){var g=p.getExtent(),m=it(g);v.push([-m,0],[m,0])}for(var _=e.layerStatesArray,y=_.length,E=[],T=[],x=0;x=0;--w){var O=_[w],R=O.layer;if(R.hasRenderer()&&Hn(O,f)&&l.call(u,R)){var M=R.getRenderer(),b=R.getSource();if(M&&b){var I=b.getWrapX()?d:t,j=c.bind(null,O.managed);T[0]=I[0]+v[x][0],T[1]=I[1]+v[x][1],h=M.forEachFeatureAtCoordinate(T,e,n,j,E)}if(h)return h}}if(E.length!==0){var U=1/E.length;return E.forEach(function(A,k){return A.distanceSq+=k*U}),E.sort(function(A,k){return A.distanceSq-k.distanceSq}),E.some(function(A){return h=A.callback(A.feature,A.layer,A.geometry)}),h}},r.prototype.forEachLayerAtPixel=function(t,e,n,o,a){return F()},r.prototype.hasFeatureAtCoordinate=function(t,e,n,o,a,s){var l=this.forEachFeatureAtCoordinate(t,e,n,o,_r,this,a,s);return l!==void 0},r.prototype.getMap=function(){return this.map_},r.prototype.renderFrame=function(t){F()},r.prototype.scheduleExpireIconCache=function(t){qn.canExpireCache()&&t.postRenderFunctions.push(Jf)},r}(eo);function Jf(i,r){qn.expire()}var Qf=qf,tp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ep=function(i){tp(r,i);function r(t){var e=i.call(this,t)||this;e.fontChangeListenerKey_=W(ee,Er.PROPERTYCHANGE,t.redrawText.bind(t)),e.element_=document.createElement("div");var n=e.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",e.element_.className=He+" ol-layers";var o=t.getViewport();return o.insertBefore(e.element_,o.firstChild||null),e.children_=[],e.renderedVisible_=!0,e}return r.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var o=new Vs(t,void 0,e);n.dispatchEvent(o)}},r.prototype.disposeInternal=function(){J(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),i.prototype.disposeInternal.call(this)},r.prototype.renderFrame=function(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(we.PRECOMPOSE,t);var e=t.layerStatesArray.sort(function(p,d){return p.zIndex-d.zIndex}),n=t.viewState;this.children_.length=0;for(var o=[],a=null,s=0,l=e.length;s=0;--s)o[s].renderDeclutter(t);Bh(this.element_,this.children_),this.dispatchRenderEvent(we.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)},r.prototype.forEachLayerAtPixel=function(t,e,n,o,a){for(var s=e.viewState,l=e.layerStatesArray,u=l.length,h=u-1;h>=0;--h){var f=l[h],c=f.layer;if(c.hasRenderer()&&Hn(f,s)&&a(c)){var p=c.getRenderer(),d=p.getDataAtPixel(t,e,n);if(d){var v=o(c,d);if(v)return v}}}},r}(Qf),rp=ep,nl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),me=function(i){nl(r,i);function r(t,e){var n=i.call(this,t)||this;return n.layer=e,n}return r}(Ht),Si={LAYERS:"layers"},np=function(i){nl(r,i);function r(t){var e=this,n=t||{},o=ut({},n);delete o.layers;var a=n.layers;return e=i.call(this,o)||this,e.on,e.once,e.un,e.layersListenerKeys_=[],e.listenerKeys_={},e.addChangeListener(Si.LAYERS,e.handleLayersChanged_),a?Array.isArray(a)?a=new Gt(a.slice(),{unique:!0}):B(typeof a.getArray=="function",43):a=new Gt(void 0,{unique:!0}),e.setLayers(a),e}return r.prototype.handleLayerChange_=function(){this.changed()},r.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(J),this.layersListenerKeys_.length=0;var t=this.getLayers();this.layersListenerKeys_.push(W(t,St.ADD,this.handleLayersAdd_,this),W(t,St.REMOVE,this.handleLayersRemove_,this));for(var e in this.listenerKeys_)this.listenerKeys_[e].forEach(J);tn(this.listenerKeys_);for(var n=t.getArray(),o=0,a=n.length;othis.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},r.prototype.disposeInternal=function(){this.relayedListenerKey_&&(J(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(G.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(J(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(J),this.dragListenerKeys_.length=0,this.element_=null,i.prototype.disposeInternal.call(this)},r}(xr),hp=up,re={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},dt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},Jn=1/0,cp=function(){function i(r,t){this.priorityFunction_=r,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return i.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,tn(this.queuedElements_)},i.prototype.dequeue=function(){var r=this.elements_,t=this.priorities_,e=r[0];r.length==1?(r.length=0,t.length=0):(r[0]=r.pop(),t[0]=t.pop(),this.siftUp_(0));var n=this.keyFunction_(e);return delete this.queuedElements_[n],e},i.prototype.enqueue=function(r){B(!(this.keyFunction_(r)in this.queuedElements_),31);var t=this.priorityFunction_(r);return t!=Jn?(this.elements_.push(r),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(r)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1},i.prototype.getCount=function(){return this.elements_.length},i.prototype.getLeftChildIndex_=function(r){return r*2+1},i.prototype.getRightChildIndex_=function(r){return r*2+2},i.prototype.getParentIndex_=function(r){return r-1>>1},i.prototype.heapify_=function(){var r;for(r=(this.elements_.length>>1)-1;r>=0;r--)this.siftUp_(r)},i.prototype.isEmpty=function(){return this.elements_.length===0},i.prototype.isKeyQueued=function(r){return r in this.queuedElements_},i.prototype.isQueued=function(r){return this.isKeyQueued(this.keyFunction_(r))},i.prototype.siftUp_=function(r){for(var t=this.elements_,e=this.priorities_,n=t.length,o=t[r],a=e[r],s=r;r>1;){var l=this.getLeftChildIndex_(r),u=this.getRightChildIndex_(r),h=ur;){var s=this.getParentIndex_(t);if(n[s]>a)e[t]=e[s],n[t]=n[s],t=s;else break}e[t]=o,n[t]=a},i.prototype.reprioritize=function(){var r=this.priorityFunction_,t=this.elements_,e=this.priorities_,n=0,o=t.length,a,s,l;for(s=0;s0;)a=this.dequeue()[0],s=a.getKey(),o=a.getState(),o===D.IDLE&&!(s in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[s]=!0,++this.tilesLoading_,++n,a.load())},r}(fp),vp=dp;function gp(i,r,t,e,n){if(!i||!(t in i.wantedTiles)||!i.wantedTiles[t][r.getKey()])return Jn;var o=i.viewState.center,a=e[0]-o[0],s=e[1]-o[1];return 65536*Math.log(n)+Math.sqrt(a*a+s*s)/n}var Xt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},_p=42,To=256;function Ga(i,r,t){return function(e,n,o,a,s){if(!!e){if(!n&&!r)return e;var l=r?0:o[0]*n,u=r?0:o[1]*n,h=s?s[0]:0,f=s?s[1]:0,c=i[0]+l/2+h,p=i[2]-l/2+h,d=i[1]+u/2+f,v=i[3]-u/2+f;c>p&&(c=(p+c)/2,p=c),d>v&&(d=(v+d)/2,v=d);var g=ot(e[0],c,p),m=ot(e[1],d,v);if(a&&t&&n){var _=30*n;g+=-_*Math.log(1+Math.max(0,c-e[0])/_)+_*Math.log(1+Math.max(0,e[0]-p)/_),m+=-_*Math.log(1+Math.max(0,d-e[1])/_)+_*Math.log(1+Math.max(0,e[1]-v)/_)}return[g,m]}}}function yp(i){return i}function Co(i,r,t,e){var n=it(r)/t[0],o=Ut(r)/t[1];return e?Math.min(i,Math.max(n,o)):Math.min(i,Math.min(n,o))}function xo(i,r,t){var e=Math.min(i,r),n=50;return e*=Math.log(1+n*Math.max(0,i/r-1))/n+1,t&&(e=Math.max(e,t),e/=Math.log(1+n*Math.max(0,t/i-1))/n+1),ot(e,t/2,r*2)}function mp(i,r,t,e){return function(n,o,a,s){if(n!==void 0){var l=i[0],u=i[i.length-1],h=t?Co(l,t,a,e):l;if(s){var f=r!==void 0?r:!0;return f?xo(n,h,u):ot(n,u,h)}var c=Math.min(h,n),p=Math.floor(ro(i,c,o));return i[p]>h&&p1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);for(var o=0;o0},r.prototype.getInteracting=function(){return this.hints_[Ct.INTERACTING]>0},r.prototype.cancelAnimations=function(){this.setHint(Ct.ANIMATING,-this.hints_[Ct.ANIMATING]);for(var t,e=0,n=this.animations_.length;e=0;--n){for(var o=this.animations_[n],a=!0,s=0,l=o.length;s0?h/u.duration:1;f>=1?(u.complete=!0,f=1):a=!1;var c=u.easing(f);if(u.sourceCenter){var p=u.sourceCenter[0],d=u.sourceCenter[1],v=u.targetCenter[0],g=u.targetCenter[1];this.nextCenter_=u.targetCenter;var m=p+c*(v-p),_=d+c*(g-d);this.targetCenter_=[m,_]}if(u.sourceResolution&&u.targetResolution){var y=c===1?u.targetResolution:u.sourceResolution+c*(u.targetResolution-u.sourceResolution);if(u.anchor){var E=this.getViewportSize_(this.getRotation()),T=this.constraints_.resolution(y,0,E,!0);this.targetCenter_=this.calculateCenterZoom(T,u.anchor)}this.nextResolution_=u.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(u.sourceRotation!==void 0&&u.targetRotation!==void 0){var x=c===1?yr(u.targetRotation+Math.PI,2*Math.PI)-Math.PI:u.sourceRotation+c*(u.targetRotation-u.sourceRotation);if(u.anchor){var w=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(w,u.anchor)}this.nextRotation_=u.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!u.complete)break}}if(a){this.animations_[n]=null,this.setHint(Ct.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var O=o[0].callback;O&&In(O,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},r.prototype.calculateCenterRotate=function(t,e){var n,o=this.getCenterInternal();return o!==void 0&&(n=[o[0]-e[0],o[1]-e[1]],so(n,t-this.getRotation()),ds(n,e)),n},r.prototype.calculateCenterZoom=function(t,e){var n,o=this.getCenterInternal(),a=this.getResolution();if(o!==void 0&&a!==void 0){var s=e[0]-t*(e[0]-o[0])/a,l=e[1]-t*(e[1]-o[1])/a;n=[s,l]}return n},r.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],o=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(o*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(o*Math.cos(t))]}else return e},r.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},r.prototype.getCenter=function(){var t=this.getCenterInternal();return t&&Bi(t,this.getProjection())},r.prototype.getCenterInternal=function(){return this.get(Xt.CENTER)},r.prototype.getConstraints=function(){return this.constraints_},r.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},r.prototype.getHints=function(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},r.prototype.calculateExtent=function(t){var e=this.calculateExtentInternal(t);return Es(e,this.getProjection())},r.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();B(n,1);var o=this.getResolution();B(o!==void 0,2);var a=this.getRotation();return B(a!==void 0,3),Yi(n,o,a,e)},r.prototype.getMaxResolution=function(){return this.maxResolution_},r.prototype.getMinResolution=function(){return this.minResolution_},r.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},r.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},r.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},r.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},r.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},r.prototype.getProjection=function(){return this.projection_},r.prototype.getResolution=function(){return this.get(Xt.RESOLUTION)},r.prototype.getResolutions=function(){return this.resolutions_},r.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Xe(t,this.getProjection()),e)},r.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),o=it(t)/n[0],a=Ut(t)/n[1];return Math.max(o,a)},r.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(n/o)/Math.log(e);return function(s){var l=n/Math.pow(e,s*a);return l}},r.prototype.getRotation=function(){return this.get(Xt.ROTATION)},r.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),o=this.minResolution_,a=Math.log(n/o)/e;return function(s){var l=Math.log(n/s)/e/a;return l}},r.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},r.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),o=this.getCenterInternal(),a=this.padding_;if(a){var s=this.getViewportSizeMinusPadding_();o=Pi(o,this.getViewportSize_(),[s[0]/2+a[3],s[1]/2+a[0]],e,n)}return{center:o.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}},r.prototype.getZoom=function(){var t,e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t},r.prototype.getZoomForResolution=function(t){var e=this.minZoom_||0,n,o;if(this.resolutions_){var a=ro(this.resolutions_,t,1);e=a,n=this.resolutions_[a],a==this.resolutions_.length-1?o=2:o=n/this.resolutions_[a+1]}else n=this.maxResolution_,o=this.zoomFactor_;return e+Math.log(n/t)/Math.log(o)},r.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=ot(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,ot(t-e,0,1))}else return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},r.prototype.fit=function(t,e){var n;if(B(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function",24),Array.isArray(t)){B(!ao(t),25);var o=Xe(t,this.getProjection());n=va(o)}else if(t.getType()===P.CIRCLE){var o=Xe(t.getExtent(),this.getProjection());n=va(o),n.rotate(this.getRotation(),Re(o))}else{var a=Hu();a?n=t.clone().transform(a,this.getProjection()):n=t}this.fitInternal(n,e)},r.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),o=Math.sin(-e),a=t.getFlatCoordinates(),s=t.getStride(),l=1/0,u=1/0,h=-1/0,f=-1/0,c=0,p=a.length;c=0;u--){var h=l[u];if(!(h.getMap()!==this||!h.getActive()||!this.getTargetElement())){var f=h.handleEvent(t);if(!f||t.propagationStopped)break}}}},r.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var n=this.maxTilesLoading_,o=n;if(t){var a=t.viewHints;if(a[Ct.ANIMATING]||a[Ct.INTERACTING]){var s=Date.now()-t.time>8;n=s?0:8,o=s?0:2}}e.getTilesLoading()0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!qe(e,this.renderedAttributions_)){ks(this.ulElement_);for(var o=0,a=e.length;o0&&n%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:er}):e.setRotation(0))}},r.prototype.render=function(t){var e=t.frameState;if(!!e){var n=e.viewState.rotation;if(n!=this.rotation_){var o="rotate("+n+"rad)";if(this.autoHide_){var a=this.element.classList.contains(wn);!a&&n===0?this.element.classList.add(wn):a&&n!==0&&this.element.classList.remove(wn)}this.label_.style.transform=o}this.rotation_=n}},r}(ln),Xp=jp,Yp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Up=function(i){Yp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),target:n.target})||this;var o=n.className!==void 0?n.className:"ol-zoom",a=n.delta!==void 0?n.delta:1,s=n.zoomInClassName!==void 0?n.zoomInClassName:o+"-in",l=n.zoomOutClassName!==void 0?n.zoomOutClassName:o+"-out",u=n.zoomInLabel!==void 0?n.zoomInLabel:"+",h=n.zoomOutLabel!==void 0?n.zoomOutLabel:"\u2013",f=n.zoomInTipLabel!==void 0?n.zoomInTipLabel:"Zoom in",c=n.zoomOutTipLabel!==void 0?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=f,p.appendChild(typeof u=="string"?document.createTextNode(u):u),p.addEventListener(G.CLICK,e.handleClick_.bind(e,a),!1);var d=document.createElement("button");d.className=l,d.setAttribute("type","button"),d.title=c,d.appendChild(typeof h=="string"?document.createTextNode(h):h),d.addEventListener(G.CLICK,e.handleClick_.bind(e,-a),!1);var v=o+" "+He+" "+on,g=e.element;return g.className=v,g.appendChild(p),g.appendChild(d),e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},r.prototype.zoomByDelta_=function(t){var e=this.getMap(),n=e.getView();if(!!n){var o=n.getZoom();if(o!==void 0){var a=n.getConstrainedZoom(o+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:a,duration:this.duration_,easing:er})):n.setZoom(a)}}},r}(ln),Wp=Up,Bp=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ja=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],Xa={ENTERFULLSCREEN:"enterfullscreen",LEAVEFULLSCREEN:"leavefullscreen"},Zp=function(i){Bp(r,i);function r(t){var e=this,n=t||{};e=i.call(this,{element:document.createElement("div"),target:n.target})||this,e.on,e.once,e.un,e.keys_=n.keys!==void 0?n.keys:!1,e.source_=n.source,e.isInFullscreen_=!1,e.boundHandleMapTargetChange_=e.handleMapTargetChange_.bind(e),e.cssClassName_=n.className!==void 0?n.className:"ol-full-screen",e.documentListeners_=[],e.activeClassName_=n.activeClassName!==void 0?n.activeClassName.split(" "):[e.cssClassName_+"-true"],e.inactiveClassName_=n.inactiveClassName!==void 0?n.inactiveClassName.split(" "):[e.cssClassName_+"-false"];var o=n.label!==void 0?n.label:"\u2922";e.labelNode_=typeof o=="string"?document.createTextNode(o):o;var a=n.labelActive!==void 0?n.labelActive:"\xD7";e.labelActiveNode_=typeof a=="string"?document.createTextNode(a):a;var s=n.tipLabel?n.tipLabel:"Toggle full-screen";return e.button_=document.createElement("button"),e.button_.title=s,e.button_.setAttribute("type","button"),e.button_.appendChild(e.labelNode_),e.button_.addEventListener(G.CLICK,e.handleClick_.bind(e),!1),e.setClassName_(e.button_,e.isInFullscreen_),e.element.className="".concat(e.cssClassName_," ").concat(He," ").concat(on),e.element.appendChild(e.button_),e}return r.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},r.prototype.handleFullScreen_=function(){var t=this.getMap();if(!!t){var e=t.getOwnerDocument();if(!!Ya(e))if(Ua(e))Kp(e);else{var n=void 0;this.source_?n=typeof this.source_=="string"?e.getElementById(this.source_):this.source_:n=t.getTargetElement(),this.keys_?zp(n):al(n)}}},r.prototype.handleFullScreenChange_=function(){var t=this.getMap();if(!!t){var e=this.isInFullscreen_;this.isInFullscreen_=Ua(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Bn(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(Xa.ENTERFULLSCREEN)):(Bn(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(Xa.LEAVEFULLSCREEN)),t.updateSize())}},r.prototype.setClassName_=function(t,e){var n,o,a,s;e?((n=t.classList).remove.apply(n,this.inactiveClassName_),(o=t.classList).add.apply(o,this.activeClassName_)):((a=t.classList).remove.apply(a,this.activeClassName_),(s=t.classList).add.apply(s,this.inactiveClassName_))},r.prototype.setMap=function(t){var e=this.getMap();e&&e.removeChangeListener(dt.TARGET,this.boundHandleMapTargetChange_),i.prototype.setMap.call(this,t),this.handleMapTargetChange_(),t&&t.addChangeListener(dt.TARGET,this.boundHandleMapTargetChange_)},r.prototype.handleMapTargetChange_=function(){for(var t=this.documentListeners_,e=0,n=t.length;en?(this.direction_=jr.HORIZONTAL,this.widthLimit_=e-l):(this.direction_=jr.VERTICAL,this.heightLimit_=n-u),this.sliderInitialized_=!0},r.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),n=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),o=this.getResolutionForPosition_(n),a=e.getConstrainedZoom(e.getZoomForResolution(o));e.animateInternal({zoom:a,duration:this.duration_,easing:er})},r.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.target===this.element.firstElementChild){var e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,this.dragListenerKeys_.length===0){var n=this.handleDraggerDrag_,o=this.handleDraggerEnd_,a=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(W(a,Ee.POINTERMOVE,n,this),W(a,Ee.POINTERUP,o,this))}}},r.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=t.clientX-this.startX_,n=t.clientY-this.startY_,o=this.getRelativePosition_(e,n);this.currentResolution_=this.getResolutionForPosition_(o),this.getMap().getView().setResolution(this.currentResolution_)}},r.prototype.handleDraggerEnd_=function(t){if(this.dragging_){var e=this.getMap().getView();e.endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(J),this.dragListenerKeys_.length=0}},r.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),n=this.element.firstElementChild;this.direction_==jr.HORIZONTAL?n.style.left=this.widthLimit_*e+"px":n.style.top=this.heightLimit_*e+"px"},r.prototype.getRelativePosition_=function(t,e){var n;return this.direction_===jr.HORIZONTAL?n=t/this.widthLimit_:n=e/this.heightLimit_,ot(n,0,1)},r.prototype.getResolutionForPosition_=function(t){var e=this.getMap().getView().getResolutionForValueFunction();return e(1-t)},r.prototype.getPositionForResolution_=function(t){var e=this.getMap().getView().getValueForResolutionFunction();return ot(1-e(t),0,1)},r.prototype.render=function(t){if(!!t.frameState&&!(!this.sliderInitialized_&&!this.initSlider_())){var e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},r}(ln),td=Qp;function sl(i){var r=i||{},t=new Gt,e=r.zoom!==void 0?r.zoom:!0;e&&t.push(new Wp(r.zoomOptions));var n=r.rotate!==void 0?r.rotate:!0;n&&t.push(new Xp(r.rotateOptions));var o=r.attribution!==void 0?r.attribution:!0;return o&&t.push(new kp(r.attributionOptions)),t}var Wa={ACTIVE:"active"},ed=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),rd=function(i){ed(r,i);function r(t){var e=i.call(this)||this;return e.on,e.once,e.un,t&&t.handleEvent&&(e.handleEvent=t.handleEvent),e.map_=null,e.setActive(!0),e}return r.prototype.getActive=function(){return this.get(Wa.ACTIVE)},r.prototype.getMap=function(){return this.map_},r.prototype.handleEvent=function(t){return!0},r.prototype.setActive=function(t){this.set(Wa.ACTIVE,t)},r.prototype.setMap=function(t){this.map_=t},r}(bt);function nd(i,r,t){var e=i.getCenterInternal();if(e){var n=[e[0]+r[0],e[1]+r[1]];i.animateInternal({duration:t!==void 0?t:250,easing:Uf,center:i.getConstrainedCenter(n)})}}function wo(i,r,t,e){var n=i.getZoom();if(n!==void 0){var o=i.getConstrainedZoom(n+r),a=i.getResolutionForZoom(o);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:a,anchor:t,duration:e!==void 0?e:250,easing:er})}}var un=rd,id=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),od=function(i){id(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.delta_=n.delta?n.delta:1,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==et.DBLCLICK){var n=t.originalEvent,o=t.map,a=t.coordinate,s=n.shiftKey?-this.delta_:this.delta_,l=o.getView();wo(l,s,a,this.duration_),n.preventDefault(),e=!0}return!e},r}(un),ad=od,sd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ld=function(i){sd(r,i);function r(t){var e=this,n=t||{};return e=i.call(this,n)||this,n.handleDownEvent&&(e.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(e.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(e.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(e.handleUpEvent=n.handleUpEvent),n.stopDown&&(e.stopDown=n.stopDown),e.handlingDownUpSequence=!1,e.trackedPointers_={},e.targetPointers=[],e}return r.prototype.getPointerCount=function(){return this.targetPointers.length},r.prototype.handleDownEvent=function(t){return!1},r.prototype.handleDragEvent=function(t){},r.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==et.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==et.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==et.POINTERDOWN){var o=this.handleDownEvent(t);this.handlingDownUpSequence=o,e=this.stopDown(o)}else t.type==et.POINTERMOVE&&this.handleMoveEvent(t);return!e},r.prototype.handleMoveEvent=function(t){},r.prototype.handleUpEvent=function(t){return!1},r.prototype.stopDown=function(t){return t},r.prototype.updateTrackedPointers_=function(t){if(ud(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==et.POINTERUP?delete this.trackedPointers_[n]:t.type==et.POINTERDOWN?this.trackedPointers_[n]=e:n in this.trackedPointers_&&(this.trackedPointers_[n]=e),this.targetPointers=Qa(this.trackedPointers_)}},r}(un);function So(i){for(var r=i.length,t=0,e=0,n=0;n0&&this.condition_(t)){var e=t.map,n=e.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}else return!1},r}(hn),fl=gd,_d=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),yd=function(i){_d(r,i);function r(t){var e=this,n=t||{};return e=i.call(this,{stopDown:ei})||this,e.condition_=n.condition?n.condition:hd,e.lastAngle_=void 0,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleDragEvent=function(t){if(!!Li(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==Oo){var o=e.getSize(),a=t.pixel,s=Math.atan2(o[1]/2-a[1],a[0]-o[0]/2);if(this.lastAngle_!==void 0){var l=s-this.lastAngle_;n.adjustRotationInternal(-l)}this.lastAngle_=s}}},r.prototype.handleUpEvent=function(t){if(!Li(t))return!0;var e=t.map,n=e.getView();return n.endInteraction(this.duration_),!1},r.prototype.handleDownEvent=function(t){if(!Li(t))return!1;if(ul(t)&&this.condition_(t)){var e=t.map;return e.getView().beginInteraction(),this.lastAngle_=void 0,!0}else return!1},r}(hn),md=yd,Ed=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Td=function(i){Ed(r,i);function r(t){var e=i.call(this)||this;return e.geometry_=null,e.element_=document.createElement("div"),e.element_.style.position="absolute",e.element_.style.pointerEvents="auto",e.element_.className="ol-box "+t,e.map_=null,e.startPixel_=null,e.endPixel_=null,e}return r.prototype.disposeInternal=function(){this.setMap(null)},r.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",o=this.element_.style;o.left=Math.min(t[0],e[0])+n,o.top=Math.min(t[1],e[1])+n,o.width=Math.abs(e[0]-t[0])+n,o.height=Math.abs(e[1]-t[1])+n},r.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},r.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},r.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]],o=n.map(this.map_.getCoordinateFromPixelInternal,this.map_);o[4]=o[0].slice(),this.geometry_?this.geometry_.setCoordinates([o]):this.geometry_=new Yn([o])},r.prototype.getGeometry=function(){return this.geometry_},r}(eo),Cd=Td,pl=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),An={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"},Ii=function(i){pl(r,i);function r(t,e,n){var o=i.call(this,t)||this;return o.coordinate=e,o.mapBrowserEvent=n,o}return r}(Ht),xd=function(i){pl(r,i);function r(t){var e=i.call(this)||this;e.on,e.once,e.un;var n=t||{};return e.box_=new Cd(n.className||"ol-dragbox"),e.minArea_=n.minArea!==void 0?n.minArea:64,n.onBoxEnd&&(e.onBoxEnd=n.onBoxEnd),e.startPixel_=null,e.condition_=n.condition?n.condition:ul,e.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:e.defaultBoxEndCondition,e}return r.prototype.defaultBoxEndCondition=function(t,e,n){var o=n[0]-e[0],a=n[1]-e[1];return o*o+a*a>=this.minArea_},r.prototype.getGeometry=function(){return this.box_.getGeometry()},r.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Ii(An.BOXDRAG,t.coordinate,t))},r.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Ii(e?An.BOXEND:An.BOXCANCEL,t.coordinate,t)),!1},r.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 Ii(An.BOXSTART,t.coordinate,t)),!0):!1},r.prototype.onBoxEnd=function(t){},r}(hn),Od=xd,wd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Sd=function(i){wd(r,i);function r(t){var e=this,n=t||{},o=n.condition?n.condition:pd;return e=i.call(this,{condition:o,className:n.className||"ol-dragzoom",minArea:n.minArea})||this,e.duration_=n.duration!==void 0?n.duration:200,e.out_=n.out!==void 0?n.out:!1,e}return r.prototype.onBoxEnd=function(t){var e=this.getMap(),n=e.getView(),o=this.getGeometry();if(this.out_){var a=n.rotatedExtentForGeometry(o),s=n.getResolutionForExtentInternal(a),l=n.getResolution()/s;o=o.clone(),o.scale(l*l)}n.fitInternal(o,{duration:this.duration_,easing:er})},r}(Od),Rd=Sd,Ne={LEFT:37,UP:38,RIGHT:39,DOWN:40},Pd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ld=function(i){Pd(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.defaultCondition_=function(o){return hl(o)&&cl(o)},e.condition_=n.condition!==void 0?n.condition:e.defaultCondition_,e.duration_=n.duration!==void 0?n.duration:100,e.pixelDelta_=n.pixelDelta!==void 0?n.pixelDelta:128,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==G.KEYDOWN){var n=t.originalEvent,o=n.keyCode;if(this.condition_(t)&&(o==Ne.DOWN||o==Ne.LEFT||o==Ne.RIGHT||o==Ne.UP)){var a=t.map,s=a.getView(),l=s.getResolution()*this.pixelDelta_,u=0,h=0;o==Ne.DOWN?h=-l:o==Ne.LEFT?u=-l:o==Ne.RIGHT?u=l:h=l;var f=[u,h];so(f,s.getRotation()),nd(s,f,this.duration_),n.preventDefault(),e=!0}}return!e},r}(un),Id=Ld,Ad=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Md=function(i){Ad(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.condition_=n.condition?n.condition:cl,e.delta_=n.delta?n.delta:1,e.duration_=n.duration!==void 0?n.duration:100,e}return r.prototype.handleEvent=function(t){var e=!1;if(t.type==G.KEYDOWN||t.type==G.KEYPRESS){var n=t.originalEvent,o=n.charCode;if(this.condition_(t)&&(o=="+".charCodeAt(0)||o=="-".charCodeAt(0))){var a=t.map,s=o=="+".charCodeAt(0)?this.delta_:-this.delta_,l=a.getView();wo(l,s,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},r}(un),Fd=Md,Nd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Ai={TRACKPAD:"trackpad",WHEEL:"wheel"},Dd=function(i){Nd(r,i);function r(t){var e=this,n=t||{};e=i.call(this,n)||this,e.totalDelta_=0,e.lastDelta_=0,e.maxDelta_=n.maxDelta!==void 0?n.maxDelta:1,e.duration_=n.duration!==void 0?n.duration:250,e.timeout_=n.timeout!==void 0?n.timeout:80,e.useAnchor_=n.useAnchor!==void 0?n.useAnchor:!0,e.constrainResolution_=n.constrainResolution!==void 0?n.constrainResolution:!1;var o=n.condition?n.condition:fd;return e.condition_=n.onFocusOnly?qi(ll,o):o,e.lastAnchor_=null,e.startTime_=void 0,e.timeoutId_,e.mode_=void 0,e.trackpadEventGap_=400,e.trackpadTimeoutId_,e.deltaPerZoom_=300,e}return r.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap().getView();t.endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},r.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==G.WHEEL)return!0;var n=t.map,o=t.originalEvent;o.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate);var a;if(t.type==G.WHEEL&&(a=o.deltaY,pu&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(a/=is),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(a*=40)),a===0)return!1;this.lastDelta_=a;var s=Date.now();this.startTime_===void 0&&(this.startTime_=s),(!this.mode_||s-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(a)<4?Ai.TRACKPAD:Ai.WHEEL);var l=n.getView();if(this.mode_===Ai.TRACKPAD&&!(l.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(l.getAnimating()&&l.cancelAnimations(),l.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),l.adjustZoom(-a/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=s,!1;this.totalDelta_+=a;var u=Math.max(this.timeout_-(s-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),u),!1},r.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-ot(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),wo(e,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},r.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},r}(un),dl=Dd,Gd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),kd=function(i){Gd(r,i);function r(t){var e=this,n=t||{},o=n;return o.stopDown||(o.stopDown=ei),e=i.call(this,o)||this,e.anchor_=null,e.lastAngle_=void 0,e.rotating_=!1,e.rotationDelta_=0,e.threshold_=n.threshold!==void 0?n.threshold:.3,e.duration_=n.duration!==void 0?n.duration:250,e}return r.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],o=this.targetPointers[1],a=Math.atan2(o.clientY-n.clientY,o.clientX-n.clientX);if(this.lastAngle_!==void 0){var s=a-this.lastAngle_;this.rotationDelta_+=s,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=s}this.lastAngle_=a;var l=t.map,u=l.getView();if(u.getConstraints().rotation!==Oo){var h=l.getViewport().getBoundingClientRect(),f=So(this.targetPointers);f[0]-=h.left,f[1]-=h.top,this.anchor_=l.getCoordinateFromPixelInternal(f),this.rotating_&&(l.render(),u.adjustRotationInternal(e,this.anchor_))}},r.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map,n=e.getView();return n.endInteraction(this.duration_),!1}else return!0},r.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}else return!1},r}(hn),bd=kd,jd=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Xd=function(i){jd(r,i);function r(t){var e=this,n=t||{},o=n;return o.stopDown||(o.stopDown=ei),e=i.call(this,o)||this,e.anchor_=null,e.duration_=n.duration!==void 0?n.duration:400,e.lastDistance_=void 0,e.lastScaleDelta_=1,e}return r.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],o=this.targetPointers[1],a=n.clientX-o.clientX,s=n.clientY-o.clientY,l=Math.sqrt(a*a+s*s);this.lastDistance_!==void 0&&(e=this.lastDistance_/l),this.lastDistance_=l;var u=t.map,h=u.getView();e!=1&&(this.lastScaleDelta_=e);var f=u.getViewport().getBoundingClientRect(),c=So(this.targetPointers);c[0]-=f.left,c[1]-=f.top,this.anchor_=u.getCoordinateFromPixelInternal(c),u.render(),h.adjustResolutionInternal(e,this.anchor_)},r.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map,n=e.getView(),o=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,o),!1}else return!0},r.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}else return!1},r}(hn),Yd=Xd,Ud=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Wd=function(i){Ud(r,i);function r(t,e,n){var o=i.call(this)||this;if(o.ends_=[],o.maxDelta_=-1,o.maxDeltaRevision_=-1,Array.isArray(t[0]))o.setCoordinates(t,e);else if(e!==void 0&&n)o.setFlatCoordinates(e,t),o.ends_=n;else{for(var a=o.getLayout(),s=t,l=[],u=[],h=0,f=s.length;h0&&this.getCount()>this.highWaterMark},i.prototype.expireCache=function(r){for(;this.canExpireCache();)this.pop()},i.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},i.prototype.containsKey=function(r){return this.entries_.hasOwnProperty(r)},i.prototype.forEach=function(r){for(var t=this.oldest_;t;)r(t.value_,t.key_,this),t=t.newer},i.prototype.get=function(r,t){var e=this.entries_[r];return B(e!==void 0,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},i.prototype.remove=function(r){var t=this.entries_[r];return B(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_[r],--this.count_,t.value_},i.prototype.getCount=function(){return this.count_},i.prototype.getKeys=function(){var r=new Array(this.count_),t=0,e;for(e=this.newest_;e;e=e.older)r[t++]=e.key_;return r},i.prototype.getValues=function(){var r=new Array(this.count_),t=0,e;for(e=this.newest_;e;e=e.older)r[t++]=e.value_;return r},i.prototype.peekLast=function(){return this.oldest_.value_},i.prototype.peekLastKey=function(){return this.oldest_.key_},i.prototype.peekFirstKey=function(){return this.newest_.key_},i.prototype.pop=function(){var r=this.oldest_;return delete this.entries_[r.key_],r.newer&&(r.newer.older=null),this.oldest_=r.newer,this.oldest_||(this.newest_=null),--this.count_,r.value_},i.prototype.replace=function(r,t){this.get(r),this.entries_[r].value_=t},i.prototype.set=function(r,t){B(!(r in this.entries_),16);var e={key_:r,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=e:this.oldest_=e,this.newest_=e,this.entries_[r]=e,++this.count_},i.prototype.setSize=function(r){this.highWaterMark=r},i}(),tv=Qd;function Za(i,r,t,e){return e!==void 0?(e[0]=i,e[1]=r,e[2]=t,e):[i,r,t]}function pi(i,r,t){return i+"/"+r+"/"+t}function yl(i){return pi(i[0],i[1],i[2])}function ev(i){return i.split("/").map(Number)}function rv(i){return(i[1]<t||t>r.getMaxZoom())return!1;var o=r.getFullTileRange(t);return o?o.containsXY(e,n):!0}var iv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ov=function(i){iv(r,i);function r(){return i!==null&&i.apply(this,arguments)||this}return r.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast();if(e.getKey()in t)break;this.pop().release()}},r.prototype.pruneExceptNewestZ=function(){if(this.getCount()!==0){var t=this.peekFirstKey(),e=ev(t),n=e[0];this.forEach(function(o){o.tileCoord[0]!==n&&(this.remove(yl(o.tileCoord)),o.release())}.bind(this))}},r}(tv),ml=ov,El=function(){function i(r,t,e,n){this.minX=r,this.maxX=t,this.minY=e,this.maxY=n}return i.prototype.contains=function(r){return this.containsXY(r[1],r[2])},i.prototype.containsTileRange=function(r){return this.minX<=r.minX&&r.maxX<=this.maxX&&this.minY<=r.minY&&r.maxY<=this.maxY},i.prototype.containsXY=function(r,t){return this.minX<=r&&r<=this.maxX&&this.minY<=t&&t<=this.maxY},i.prototype.equals=function(r){return this.minX==r.minX&&this.minY==r.minY&&this.maxX==r.maxX&&this.maxY==r.maxY},i.prototype.extend=function(r){r.minXthis.maxX&&(this.maxX=r.maxX),r.minYthis.maxY&&(this.maxY=r.maxY)},i.prototype.getHeight=function(){return this.maxY-this.minY+1},i.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},i.prototype.getWidth=function(){return this.maxX-this.minX+1},i.prototype.intersects=function(r){return this.minX<=r.maxX&&this.maxX>=r.minX&&this.minY<=r.maxY&&this.maxY>=r.minY},i}();function cr(i,r,t,e,n){return n!==void 0?(n.minX=i,n.maxX=r,n.minY=t,n.maxY=e,n):new El(i,r,t,e)}var Tl=El,Cl=function(){function i(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return i.prototype.getReadOptions=function(r,t){var e;if(t){var n=t.dataProjection?at(t.dataProjection):this.readProjection(r);t.extent&&n&&n.getUnits()===oe.TILE_PIXELS&&(n=at(n),n.setWorldExtent(t.extent)),e={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(e)},i.prototype.adaptOptions=function(r){return ut({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},r)},i.prototype.getType=function(){return F()},i.prototype.readFeature=function(r,t){return F()},i.prototype.readFeatures=function(r,t){return F()},i.prototype.readGeometry=function(r,t){return F()},i.prototype.readProjection=function(r){return F()},i.prototype.writeFeature=function(r,t){return F()},i.prototype.writeFeatures=function(r,t){return F()},i.prototype.writeGeometry=function(r,t){return F()},i}();function Le(i,r,t){var e=t?at(t.featureProjection):null,n=t?at(t.dataProjection):null,o;if(e&&n&&!ke(e,n)?o=(r?i.clone():i).transform(r?e:n,r?n:e):o=i,r&&t&&t.decimals!==void 0){var a=Math.pow(10,t.decimals),s=function(l){for(var u=0,h=l.length;u0?n[0]:null},r.prototype.readFeatureFromNode=function(t,e){return null},r.prototype.readFeatures=function(t,e){if(t)if(typeof t=="string"){var n=Nn(t);return this.readFeaturesFromDocument(n,e)}else return Fn(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e);else return[]},r.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],o=t.firstChild;o;o=o.nextSibling)o.nodeType==Node.ELEMENT_NODE&&Yt(n,this.readFeaturesFromNode(o,e));return n},r.prototype.readFeaturesFromNode=function(t,e){return F()},r.prototype.readGeometry=function(t,e){if(t)if(typeof t=="string"){var n=Nn(t);return this.readGeometryFromDocument(n,e)}else return Fn(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e);else return null},r.prototype.readGeometryFromDocument=function(t,e){return null},r.prototype.readGeometryFromNode=function(t,e){return null},r.prototype.readProjection=function(t){if(t)if(typeof t=="string"){var e=Nn(t);return this.readProjectionFromDocument(e)}else return Fn(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t);else return null},r.prototype.readProjectionFromDocument=function(t){return this.dataProjection},r.prototype.readProjectionFromNode=function(t){return this.dataProjection},r.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeFeatureNode=function(t,e){return null},r.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeFeaturesNode=function(t,e){return null},r.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},r.prototype.writeGeometryNode=function(t,e){return null},r}(Cl),Av=Iv;function Ao(i){var r=di(i,!1),t=Date.parse(r);return isNaN(t)?void 0:t/1e3}function ne(i){var r=di(i,!1);return Mv(r)}function Mv(i){var r=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(i);if(r)return parseFloat(r[1])}function Qn(i){var r=di(i,!1);return Fv(r)}function Fv(i){var r=/^\s*(\d+)\s*$/.exec(i);if(r)return parseInt(r[1],10)}function ft(i){return di(i,!1).trim()}function Nv(i,r){var t=new Date(r*1e3),e=t.getUTCFullYear()+"-"+Gr(t.getUTCMonth()+1,2)+"-"+Gr(t.getUTCDate(),2)+"T"+Gr(t.getUTCHours(),2)+":"+Gr(t.getUTCMinutes(),2)+":"+Gr(t.getUTCSeconds(),2)+"Z";i.appendChild(cn().createTextNode(e))}function De(i,r){var t=r.toPrecision();i.appendChild(cn().createTextNode(t))}function ti(i,r){var t=r.toString();i.appendChild(cn().createTextNode(t))}function pt(i,r){i.appendChild(cn().createTextNode(r))}var Dv=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),ht=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],Gv="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",kv={rte:Sl,trk:Rl,wpt:Pl},bv=gt(ht,{rte:Mi(Sl),trk:Mi(Rl),wpt:Mi(Pl)}),jv=gt(ht,{text:K(ft,"linkText"),type:K(ft,"linkType")}),Xv=gt(ht,{rte:Y(hg),trk:Y(cg),wpt:Y(pg)}),Yv=function(i){Dv(r,i);function r(t){var e=i.call(this)||this,n=t||{};return e.dataProjection=at("EPSG:4326"),e.readExtensions_=n.readExtensions,e}return r.prototype.handleReadExtensions_=function(t){t||(t=[]);for(var e=0,n=t.length;ethis.sourceWorldWidth_/2){var E=[[y.source[0][0],y.source[0][1]],[y.source[1][0],y.source[1][1]],[y.source[2][0],y.source[2][1]]];E[0][0]-_>this.sourceWorldWidth_/2&&(E[0][0]-=this.sourceWorldWidth_),E[1][0]-_>this.sourceWorldWidth_/2&&(E[1][0]-=this.sourceWorldWidth_),E[2][0]-_>this.sourceWorldWidth_/2&&(E[2][0]-=this.sourceWorldWidth_);var T=Math.min(E[0][0],E[1][0],E[2][0]),x=Math.max(E[0][0],E[1][0],E[2][0]);x-T.5&&f<1,d=!1;if(u>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){var v=ra([r,t,e,n]),g=it(v)/this.targetWorldWidth_;d=g>Ha||d}!p&&this.sourceProj_.isGlobal()&&f&&(d=f>Ha||d)}if(!(!d&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!Rt(h,this.maxSourceExtent_))){var m=0;if(!d&&(!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(l[0])||!isFinite(l[1]))){if(u>0)d=!0;else if(m=(!isFinite(o[0])||!isFinite(o[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(s[0])||!isFinite(s[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),m!=1&&m!=2&&m!=4&&m!=8)return}if(u>0){if(!d){var _=[(r[0]+e[0])/2,(r[1]+e[1])/2],y=this.transformInv_(_),E=void 0;if(p){var T=(yr(o[0],c)+yr(s[0],c))/2;E=T-yr(y[0],c)}else E=(o[0]+s[0])/2-y[0];var x=(o[1]+s[1])/2-y[1],w=E*E+x*x;d=w>this.errorThresholdSquared_}if(d){if(Math.abs(r[0]-e[0])<=Math.abs(r[1]-e[1])){var O=[(t[0]+e[0])/2,(t[1]+e[1])/2],R=this.transformInv_(O),M=[(n[0]+r[0])/2,(n[1]+r[1])/2],b=this.transformInv_(M);this.addQuad_(r,t,O,M,o,a,R,b,u-1),this.addQuad_(M,O,e,n,b,R,s,l,u-1)}else{var I=[(r[0]+t[0])/2,(r[1]+t[1])/2],j=this.transformInv_(I),U=[(e[0]+n[0])/2,(e[1]+n[1])/2],A=this.transformInv_(U);this.addQuad_(r,I,U,n,o,j,A,l,u-1),this.addQuad_(I,t,e,U,j,a,s,A,u-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(m&11)==0&&this.addTriangle_(r,e,n,o,s,l),(m&14)==0&&this.addTriangle_(r,e,t,o,s,a),m&&((m&13)==0&&this.addTriangle_(t,n,r,a,l,o),(m&7)==0&&this.addTriangle_(t,n,e,a,l,s))}},i.prototype.calculateSourceExtent=function(){var r=Pt();return this.triangles_.forEach(function(t,e,n){var o=t.source;Br(r,o[0]),Br(r,o[1]),Br(r,o[2])}),r},i.prototype.getTriangles=function(){return this.triangles_},i}(),yg=_g,to={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},mg={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},Di;function $a(i,r,t,e,n){i.beginPath(),i.moveTo(0,0),i.lineTo(r,t),i.lineTo(e,n),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(r,e)+1,Math.max(t,n)),i.restore()}function Gi(i,r){return Math.abs(i[r*4]-210)>2||Math.abs(i[r*4+3]-.75*255)>2}function Eg(){if(Di===void 0){var i=document.createElement("canvas").getContext("2d");i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",$a(i,4,5,4,0),$a(i,4,5,0,5);var r=i.getImageData(0,0,3,3).data;Di=Gi(r,0)||Gi(r,4)||Gi(r,8)}return Di}function qa(i,r,t,e){var n=ms(t,r,i),o=la(r,e,t),a=r.getMetersPerUnit();a!==void 0&&(o*=a);var s=i.getMetersPerUnit();s!==void 0&&(o/=s);var l=i.getExtent();if(!l||en(l,n)){var u=la(i,o,n)/o;isFinite(u)&&u>0&&(o/=u)}return o}function Tg(i,r,t,e){var n=Re(t),o=qa(i,r,n,e);return(!isFinite(o)||o<=0)&&cs(t,function(a){return o=qa(i,r,a,e),isFinite(o)&&o>0}),o}function Cg(i,r,t,e,n,o,a,s,l,u,h,f){var c=kt(Math.round(t*i),Math.round(t*r));if(f||ut(c,to),l.length===0)return c.canvas;c.scale(t,t);function p(E){return Math.round(E*t)/t}c.globalCompositeOperation="lighter";var d=Pt();l.forEach(function(E,T,x){oo(d,E.extent)});var v=it(d),g=Ut(d),m=kt(Math.round(t*v/e),Math.round(t*g/e));f||ut(m,to);var _=t/e;l.forEach(function(E,T,x){var w=E.extent[0]-d[0],O=-(E.extent[3]-d[3]),R=it(E.extent),M=Ut(E.extent);E.image.width>0&&E.image.height>0&&m.drawImage(E.image,u,u,E.image.width-2*u,E.image.height-2*u,w*_,O*_,R*_,M*_)});var y=Qe(a);return s.getTriangles().forEach(function(E,T,x){var w=E.source,O=E.target,R=w[0][0],M=w[0][1],b=w[1][0],I=w[1][1],j=w[2][0],U=w[2][1],A=p((O[0][0]-y[0])/o),k=p(-(O[0][1]-y[1])/o),L=p((O[1][0]-y[0])/o),z=p(-(O[1][1]-y[1])/o),Z=p((O[2][0]-y[0])/o),V=p(-(O[2][1]-y[1])/o),Q=R,C=M;R=0,M=0,b-=Q,I-=C,j-=Q,U-=C;var lt=[[b,I,0,0,L-A],[j,U,0,0,Z-A],[0,0,b,I,z-k],[0,0,j,U,V-k]],X=Iu(lt);if(!!X){if(c.save(),c.beginPath(),Eg()||!f){c.moveTo(L,z);for(var ct=4,Lt=A-L,It=k-z,xt=0;xt=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),s=Math.floor(s/2),o=cr(a,a,s,s,e)):o=this.getTileRangeForExtentAndZ(l,u,e),t(u,o))return!0;--u}return!1},i.prototype.getExtent=function(){return this.extent_},i.prototype.getMaxZoom=function(){return this.maxZoom},i.prototype.getMinZoom=function(){return this.minZoom},i.prototype.getOrigin=function(r){return this.origin_?this.origin_:this.origins_[r]},i.prototype.getResolution=function(r){return this.resolutions_[r]},i.prototype.getResolutions=function(){return this.resolutions_},i.prototype.getTileCoordChildTileRange=function(r,t,e){if(r[0]this.maxZoom||t0?e:Math.max(a/s[0],o/s[1]),u=n+1,h=new Array(u),f=0;fn.highWaterMark&&(n.highWaterMark=t)},r.prototype.useTile=function(t,e,n,o){},r}(Js),Mg=function(i){Fl(r,i);function r(t,e){var n=i.call(this,t)||this;return n.tile=e,n}return r}(Ht),Fg=Ag;function Ng(i,r){var t=/\{z\}/g,e=/\{x\}/g,n=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){if(a)return i.replace(t,a[0].toString()).replace(e,a[1].toString()).replace(n,a[2].toString()).replace(o,function(){var u=a[0],h=r.getFullTileRange(u);B(h,55);var f=h.getHeight()-a[2]-1;return f.toString()})}}function Dg(i,r){for(var t=i.length,e=new Array(t),n=0;n=0;--o){var a=this.geometryFunction(t[o]);a?ds(n,a.getCoordinates()):t.splice(o,1)}vs(n,1/t.length);var s=Re(e),l=this.interpolationRatio,u=new Pe([n[0]*(1-l)+s[0]*l,n[1]*(1-l)+s[1]*l]);return this.createCustomCluster_?this.createCustomCluster_(u,t):new Oe({geometry:u,features:t})},r}(dr),Hg=Vg,$g=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),Nl='© OpenStreetMap contributors.',qg=function(i){$g(r,i);function r(t){var e=t||{},n=e.imageSmoothing!==void 0?e.imageSmoothing:!0;e.interpolate!==void 0&&(n=e.interpolate);var o;e.attributions!==void 0?o=e.attributions:o=[Nl];var a=e.crossOrigin!==void 0?e.crossOrigin:"anonymous",s=e.url!==void 0?e.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return i.call(this,{attributions:o,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:a,interpolate:n,maxZoom:e.maxZoom!==void 0?e.maxZoom:19,opaque:e.opaque!==void 0?e.opaque:!0,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:s,wrapX:e.wrapX,zDirection:e.zDirection})||this}return r}(jo),Jg=qg,Dn={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"},Qg=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),t_=function(i){Qg(r,i);function r(t){var e=this,n=t||{},o=ut({},n);return delete o.preload,delete o.useInterimTilesOnError,e=i.call(this,o)||this,e.on,e.once,e.un,e.setPreload(n.preload!==void 0?n.preload:0),e.setUseInterimTilesOnError(n.useInterimTilesOnError!==void 0?n.useInterimTilesOnError:!0),e}return r.prototype.getPreload=function(){return this.get(Dn.PRELOAD)},r.prototype.setPreload=function(t){this.set(Dn.PRELOAD,t)},r.prototype.getUseInterimTilesOnError=function(){return this.get(Dn.USE_INTERIM_TILES_ON_ERROR)},r.prototype.setUseInterimTilesOnError=function(t){this.set(Dn.USE_INTERIM_TILES_ON_ERROR,t)},r.prototype.getData=function(t){return i.prototype.getData.call(this,t)},r}(ci),e_=t_,r_=globalThis&&globalThis.__extends||function(){var i=function(r,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])},i(r,t)};return function(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");i(r,t);function e(){this.constructor=r}r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}}(),n_=function(i){r_(r,i);function r(t){var e=i.call(this,t)||this;return e.extentChanged=!0,e.renderedExtent_=null,e.renderedPixelRatio,e.renderedProjection=null,e.renderedRevision,e.renderedTiles=[],e.newTiles_=!1,e.tmpExtent=Pt(),e.tmpTileRange_=new Tl(0,0,0,0),e}return r.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),o=e.getUseInterimTilesOnError();return n==D.LOADED||n==D.EMPTY||n==D.ERROR&&!o},r.prototype.getTile=function(t,e,n,o){var a=o.pixelRatio,s=o.viewState.projection,l=this.getLayer(),u=l.getSource(),h=u.getTile(t,e,n,a,s);return h.getState()==D.ERROR&&(l.getUseInterimTilesOnError()?l.getPreload()>0&&(this.newTiles_=!0):h.setState(D.LOADED)),this.isDrawableTile(h)||(h=h.getInterimTile()),h},r.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),o=st(e.pixelToCoordinateTransform,t.slice()),a=n.getExtent();if(a&&!en(a,o))return null;for(var s=e.pixelRatio,l=e.viewState.projection,u=e.viewState,h=n.getRenderSource(),f=h.getTileGridForProjection(u.projection),c=h.getTilePixelRatio(e.pixelRatio),p=f.getZForResolution(u.resolution);p>=f.getMinZoom();--p){var d=f.getTileCoordForCoordAndZ(o,p),v=h.getTile(p,d[1],d[2],s,l);if(!(v instanceof rl||v instanceof Ll))return null;if(v.getState()===D.LOADED){var g=f.getOrigin(p),m=Ft(f.getTileSize(p)),_=f.getResolution(p),y=Math.floor(c*((o[0]-g[0])/_-d[1]*m[0])),E=Math.floor(c*((g[1]-o[1])/_-d[2]*m[1]));return this.getImageData(v.getImage(),y,E)}}return null},r.prototype.loadedTileCallback=function(t,e,n){return this.isDrawableTile(n)?i.prototype.loadedTileCallback.call(this,t,e,n):!1},r.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},r.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],o=t.viewState,a=o.projection,s=o.resolution,l=o.center,u=o.rotation,h=t.pixelRatio,f=this.getLayer(),c=f.getSource(),p=c.getRevision(),d=c.getTileGridForProjection(a),v=d.getZForResolution(s,c.zDirection),g=d.getResolution(v),m=t.extent,_=n.extent&&Xe(n.extent);_&&(m=Zr(m,Xe(n.extent)));var y=c.getTilePixelRatio(h),E=Math.round(t.size[0]*y),T=Math.round(t.size[1]*y);if(u){var x=Math.round(Math.sqrt(E*E+T*T));E=x,T=x}var w=g*E/2/y,O=g*T/2/y,R=[l[0]-w,l[1]-O,l[0]+w,l[1]+O],M=d.getTileRangeForExtentAndZ(m,v),b={};b[v]={};var I=this.createLoadedTileFinder(c,a,b),j=this.tmpExtent,U=this.tmpTileRange_;this.newTiles_=!1;for(var A=M.minX;A<=M.maxX;++A)for(var k=M.minY;k<=M.maxY;++k){var L=this.getTile(v,A,k,t);if(this.isDrawableTile(L)){var z=H(this);if(L.getState()==D.LOADED){b[v][L.tileCoord.toString()]=L;var Z=L.inTransition(z);!this.newTiles_&&(Z||this.renderedTiles.indexOf(L)===-1)&&(this.newTiles_=!0)}if(L.getAlpha(z,t.time)===1)continue}var V=d.getTileCoordChildTileRange(L.tileCoord,U,j),Q=!1;V&&(Q=I(v+1,V)),Q||d.forEachTileCoordParentTileRange(L.tileCoord,I,U,j)}var C=g/s;se(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,u,-E/2,-T/2);var lt=as(this.pixelTransform);this.useContainer(e,lt,n.opacity,this.getBackground(t));var X=this.context,ct=X.canvas;no(this.inversePixelTransform,this.pixelTransform),se(this.tempTransform,E/2,T/2,C,C,0,-E/2,-T/2),ct.width!=E||ct.height!=T?(ct.width=E,ct.height=T):this.containerReused||X.clearRect(0,0,E,T),_&&this.clipUnrotated(X,t,_),c.getInterpolate()||ut(X,to),this.preRender(X,t),this.renderedTiles.length=0;var Lt=Object.keys(b).map(Number);Lt.sort(Ke);var It,xt,At;n.opacity===1&&(!this.containerReused||c.getOpaque(t.viewState.projection))?Lt=Lt.reverse():(It=[],xt=[]);for(var rr=Lt.length-1;rr>=0;--rr){var Wt=Lt[rr],fn=c.getTilePixelSize(Wt,h,a),pn=d.getResolution(Wt),ue=pn/g,nr=fn[0]*ue*C,dn=fn[1]*ue*C,Rr=d.getTileCoordForCoordAndZ(Qe(R),Wt),vn=d.getTileCoordExtent(Rr),Ie=st(this.tempTransform,[y*(vn[0]-R[0])/g,y*(R[3]-vn[3])/g]),Pr=y*c.getGutterForProjection(a),gn=b[Wt];for(var ir in gn){var L=gn[ir],he=L.tileCoord,or=Rr[1]-he[1],gi=Math.round(Ie[0]-(or-1)*nr),_n=Rr[2]-he[2],Lr=Math.round(Ie[1]-(_n-1)*dn),A=Math.round(Ie[0]-or*nr),k=Math.round(Ie[1]-_n*dn),$t=gi-A,Bt=Lr-k,Ae=v===Wt,Z=Ae&&L.getAlpha(H(this),t.time)!==1,Ir=!1;if(!Z)if(It){At=[A,k,A+$t,k,A+$t,k+Bt,A,k+Bt];for(var Ot=0,yn=It.length;OtStamen Design, under CC BY 3.0.',Nl],u_={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},h_={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}},c_=function(i){s_(r,i);function r(t){var e=t.imageSmoothing!==void 0?t.imageSmoothing:!0;t.interpolate!==void 0&&(e=t.interpolate);var n=t.layer.indexOf("-"),o=n==-1?t.layer:t.layer.slice(0,n),a=h_[o],s=u_[t.layer],l=t.url!==void 0?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+s.extension;return i.call(this,{attributions:l_,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:e,maxZoom:t.maxZoom!=null?t.maxZoom:a.maxZoom,minZoom:t.minZoom!=null?t.minZoom:a.minZoom,opaque:s.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:l,wrapX:t.wrapX,zDirection:t.zDirection})||this}return r}(jo),f_=c_;if(typeof Dl!="object")var Dl={};const S={mapWrapClass:"a2g-map-wrap",mapClass:"a2g-map",convexHullFill:null,convexHullStroke:null,textFill:null,textStroke:null,innerCircle:null,outerCircle:null,initMapConfig:function(i){this.layers.maptiler.a===null&&i.api&&i.api.maptiler&&i.api.maptiler.key&&(this.layers.maptiler.a=i.api.maptiler.key),this.layers.thunderforest.a===null&&i.api&&i.api.thunderforest&&i.api.thunderforest.key&&(this.layers.thunderforest.a=i.api.thunderforest.key),this.convexHullFill===null&&(i.style&&typeof i.style.convexHullFill=="object"?this.convexHullFill=new Tt(i.style.convexHullFill):this.convexHullFill=new Tt({color:"rgba(255, 153, 0, 0.4)"})),this.convexHullStroke===null&&(i.style&&typeof i.style.convexHullStroke=="object"?this.convexHullStroke=new Et(i.style.convexHullStroke):this.convexHullStroke=new Et({color:"rgba(255, 153, 0, 0.4)"})),this.textFill===null&&(i.style&&typeof i.style.textFill=="object"?this.textFill=new Tt(i.style.textFill):this.textFill=new Tt({color:"rgba(0, 0, 0, 0.9)"})),this.textStroke===null&&(i.style&&typeof i.style.textStroke=="object"?this.textStroke=new Et(i.style.textStroke):this.textStroke=new Et({color:"rgba(255, 153, 0, 0.4)"})),this.innerCircle===null&&(i.style&&typeof i.style.innerCircle=="object"?this.innerCircle=new ge({radius:i.style.innerCircle.radius,fill:new Tt(i.style.innerCircle.fill)}):this.innerCircle=new ge({radius:14,fill:new Tt({color:"rgba(255, 165, 0, 0.7)"})})),this.outerCircle===null&&(i.style&&typeof i.style.outerCircle=="object"?this.outerCircle=new ge({radius:i.style.outerCircle.radius,fill:new Tt(i.style.outerCircle.fill)}):this.outerCircle=new ge({radius:14,fill:new Tt({color:"rgba(255, 165, 0, 0.7)"})})),i.style&&i.style.gpx?this.gpx.initConfig(i.style.gpx):this.gpx.initConfig({})},styles:[],mapWraps:[],maps:[],mapConfigs:[],mapObjects:[],gpx:{mapSources:[],mapLayers:[],style:{Point:null,LineString:null,MultiLineString:null},initConfig:function(i){this.style.Point===null&&(typeof i.Point=="object"?this.style.Point=new yt({image:new ge({fill:new Tt(i.Point.image.fill),radius:i.Point.image.radius,stroke:new Et(i.Point.image.stroke)})}):this.style.Point=new yt({image:new ge({fill:new Tt({color:"rgba(255,255,0,0.4)"}),radius:5,stroke:new Et({color:"#ff0",width:1})})})),this.style.LineString===null&&(typeof i.LineString=="object"?this.style.LineString=new yt({stroke:new Et(i.LineString.stroke)}):this.style.LineString=new yt({stroke:new Et({color:"#f00",width:3})})),this.style.MultiLineString===null&&(typeof i.MultiLineString=="object"?this.style.MultiLineString=new yt({stroke:new Et(i.MultiLineString.stroke)}):this.style.MultiLineString=new yt({stroke:new Et({color:"#f00",width:3})}))},init:function(i){var r=this;typeof S.mapConfigs[i].gpxSource!="undefined"&&(r.mapSources[i]=new dr({url:S.mapConfigs[i].gpxSource,format:new dg}),r.mapLayers[i]=new hr({source:r.mapSources[i],style:function(t){return r.style[t.getGeometry().getType()]}}),S.layers.mapLayers[i].push(r.mapLayers[i]))}},geolocate:{locateMeDoms:[],checkboxClass:"a2g-map-geolocate-me",geolocations:[],positionFeature:new Oe,accuracyFeature:new Oe,mapSources:[],mapLayers:[],setPositionFeatureStyle:function(){this.positionFeature.setStyle(new yt({image:new ge({radius:6,fill:new Tt({color:"#3399CC"}),stroke:new Et({color:"#fff",width:2})})}))},setMapGeolocations:function(i){var r=this;r.geolocations[i]=new Lh({trackingOptions:{enableHighAccuracy:!0},projection:S.views[i].getProjection()}),r.geolocations[i].on("change:position",function(){const t=r.geolocations[i].getPosition();r.positionFeature.setGeometry(t?new Pe(t):null)}),r.geolocations[i].on("change:accuracyGeometry",function(){r.accuracyFeature.setGeometry(r.geolocations[i].getAccuracyGeometry())})},setGeolocateMeAction:function(i){var r=this;r.locateMeDoms[i]=S.mapWraps[i].getElementsByClassName(r.checkboxClass),r.locateMeDoms[i].length>0&&(r.setMapGeolocations(i),r.mapSources[i]=new dr({features:[r.accuracyFeature,r.positionFeature]}),r.mapLayers[i]=new hr({map:S.mapObjects[i],source:r.mapSources[i]}));for(var t=0;t altogether',attributionOpenStreetMap:'© OpenStreetMap',thunderforest:{a:null,baseUrl:"https://tile.thunderforest.com/",baseUrlSufix:"/{z}/{x}/{y}.png?apikey=",getUrl:function(i){return this.baseUrl+i+this.baseUrlSufix+this.a}},maptiler:{a:null,baseUrl:"https://api.maptiler.com/maps/",baseUrlSufix:"/{z}/{x}/{y}.png?key=",jpgUrlSufix:"/{z}/{x}/{y}.jpg?key=",getUrl:function(i){return i==="hybrid"||i==="openstreetmap"?this.baseUrl+i+this.jpgUrlSufix+this.a:this.baseUrl+i+this.baseUrlSufix+this.a}},countryLayerStyle:new yt({fill:new Tt({color:"#aaa"}),stroke:new Et({color:"#333"})}),setCountryLayer:function(i,r,t){var e=this;e.mapCountryOverlay[i]=r,e.mapLayerSources[i][r]=new dr({url:typeof t.countryGeoSource=="undefined"?e.coutriesGeojsonSource:t.countryGeoSource,format:new Ka}),e.mapLayers[i][r]=new hr({source:e.mapLayerSources[i][r],style:function(n){return e.countryLayerStyle.getFill().setColor("#aaa"),e.countryLayerStyle}})},setMapXyzLayer:function(i,r,t){this.mapLayerSources[i][r]=new jo(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},setMapOsmLayer:function(i,r,t){this.mapLayerSources[i][r]=new Jg(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},setMapStamenLayer:function(i,r,t){this.mapLayerSources[i][r]=new f_(t),this.mapLayers[i][r]=new bi({source:this.mapLayerSources[i][r]})},appendToMapLayerSwitcher:function(i,r,t){for(var e=0;e2&&this.mapLayers[i][a].setSource(null);else n>2&&this.mapLayers[i][a].setSource(null);this.appendToMapLayerSwitcher(i,t[a],a)}if(this.setLayerSwitcherAction(i),e){this.mapLayers[i][S.layers.mapLayers[i].length-1].setSource(S.layers.mapLayerSources[i][S.layers.mapLayerSources[i].length-1]);for(var a=0;a{typeof r.layers.mapCountryOverlay[i]!="undefined"&&(document.addEventListener("pointermove",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("click",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("focus",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}),document.addEventListener("scroll",function(){typeof r.executedInitActions[i]=="undefined"&&(r.views[i].fit(r.layers.mapLayerSources[i][r.layers.mapCountryOverlay[i]].getFeatures()[0].getGeometry(),{duration:500,padding:[170,50,30,150]}),r.executedInitActions[i]=!0)}))})},executedInitActions:[],featureOverlaySource:[],featureOverlayStyle:[],setFeatureOverlayStyle:function(i,r){typeof this.featureOverlayStyle[i]=="undefined"&&(r.style&&typeof r.style.featureOverlay=="object"?typeof r.style.featureOverlay.fill=="object"&&typeof r.style.featureOverlay.stroke=="object"?this.featureOverlayStyle[i]=new yt({fill:new Tt(r.style.featureOverlay.fill),stroke:new Et(r.style.featureOverlay.stroke)}):typeof r.style.featureOverlay.fill=="object"?this.featureOverlayStyle[i]=new yt({fill:new Tt(r.style.featureOverlay.fill)}):typeof r.style.featureOverlay.stroke=="object"&&(this.featureOverlayStyle[i]=new yt({stroke:new Et(r.style.featureOverlay.stroke)})):this.featureOverlayStyle[i]=new yt({stroke:new Et({color:"rgba(255,255,255, 0.6)",width:4})}))},featureOverlay:[],featureHighlight:[],setMapClickAction:function(i){S.layers.mapCountryOverlay[i]!==null&&S.mapObjects[i].on("pointermove",function(r){typeof S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]]!="undefined"&&S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]].getFeatures(r.pixel).then(function(t){const e=t.length?t[0]:void 0;e!==S.featureHighlight[i]&&(S.featureHighlight[i]&&S.featureOverlay[i].getSource().removeFeature(S.featureHighlight[i]),e&&S.featureOverlay[i].getSource().addFeature(e),S.featureHighlight[i]=e)})}),S.mapObjects[i].on("click",function(r){var t=!0;typeof S.marker.layers.mapClusters[i]!="undefined"&&S.marker.layers.mapClusters[i].getFeatures(r.pixel).then(function(e){if(e.length>0){t=!1;const n=e[0].get("features");if(n.length>1){const o=Pt();n.forEach(l=>oo(o,l.getGeometry().getExtent()));const a=S.mapObjects[i].getView(),s=S.mapObjects[i].getView().getResolution();a.getZoom()===a.getMaxZoom()?(clickFeature=e[0],clickResolution=s,S.marker.layers.mapClusterCircles[i].setStyle(S.marker.layers.clusterCircleStyle)):a.fit(o,{duration:500,padding:[170,50,30,150]})}else typeof n[0].values_.popup!="undefined"&&(S.popup.content[i].innerHTML=n[0].values_.popup,S.popup.overlay[i].setPosition(n[0].getGeometry().getCoordinates()))}}),S.layers.mapCountryOverlay[i]!==null&&typeof S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]]!="undefined"&&S.layers.mapLayers[i][S.layers.mapCountryOverlay[i]].getFeatures(r.pixel).then(function(e){if(t){const u=e.length?e[0]:void 0;if(u!==void 0&&u.get("popup")!==void 0){S.popup.content[i].innerHTML=u.get("popup");for(var n=0,o=0,a=0,s=0;s1?[new yt({image:S.outerCircle}),new yt({image:S.innerCircle,text:new lc({text:r.toString(),fill:S.textFill,stroke:S.textStroke})})]:S.marker.icons.clusterMemberStyle(i.get("features")[0])},clusterCircleStyle:function(i,r){if(i!==S.clickFeature||r!==S.clickResolution)return;const t=i.get("features");return i.getGeometry().getCoordinates(),S.marker.layers.generatePointsCircle(t.length,i.getGeometry().getCoordinates(),r).reduce((e,n,o)=>{const a=new Pe(n);return e.push(S.marker.icons.clusterMemberStyle(new Oe(qo($o({},t[o].getProperties()),{geometry:a})))),e},[])},setMapMarkerLayer:function(i){typeof this.mapVectorSources[i]=="undefined"&&(S.mapConfigs[i].markerSource?this.mapVectorSources[i]=new dr({format:new Ka,url:S.mapConfigs[i].markerSource}):this.mapVectorSources[i]=null),typeof this.mapClusterSources[i]=="undefined"&&this.mapVectorSources[i]!==null&&(this.mapClusterSources[i]=new Hg({distance:this.clusterDistance,source:this.mapVectorSources[i]})),typeof this.mapClusters[i]=="undefined"&&typeof this.mapClusterSources[i]=="object"&&(this.mapClusters[i]=new hr({source:this.mapClusterSources[i],style:this.clusterStyle})),typeof this.mapClusterCircles[i]=="undefined"&&typeof this.mapClusterSources[i]=="object"&&(this.mapClusterCircles[i]=new hr({source:this.mapClusterSources[i],style:this.clusterCircleStyle})),this.mapVectorSources[i]!==null&&(S.layers.mapLayers[i].push(this.mapClusters[i]),S.layers.mapLayers[i].push(this.mapClusterCircles[i]))}}},clickFeature:null,clickResolution:null,fillMapConfigs:function(i){this.maps[i].dataset.mapConfig&&(this.mapConfigs[i]=JSON.parse(this.maps[i].dataset.mapConfig)),typeof this.mapConfigs[i]=="undefined"&&(this.mapConfigs[i]={}),this.maps[i].dataset.markers&&(this.mapConfigs[i].markers=this.maps[i].dataset.markers),this.maps[i].dataset.markerSource&&(this.mapConfigs[i].markerSource=this.maps[i].dataset.markerSource),this.maps[i].dataset.mapLayers&&(this.mapConfigs[i].mapLayers=JSON.parse(this.maps[i].dataset.mapLayers)),this.maps[i].dataset.gpxSource&&(this.mapConfigs[i].gpxSource=this.maps[i].dataset.gpxSource),this.maps[i].dataset.defaultMarkerIcon&&(this.mapConfigs[i].defaultMarkerIcon=this.maps[i].dataset.defaultMarkerIcon),this.maps[i].dataset.centerLon&&(this.mapConfigs[i].centerLon=this.maps[i].dataset.centerLon),this.maps[i].dataset.centerLat&&(this.mapConfigs[i].centerLat=this.maps[i].dataset.centerLat),this.maps[i].dataset.zoom&&(this.mapConfigs[i].zoom=this.maps[i].dataset.zoom),this.maps[i].dataset.maxZoom&&(this.mapConfigs[i].maxZoom=this.maps[i].dataset.maxZoom),this.maps[i].dataset.zoomSlider&&(this.mapConfigs[i].zoomSlider=this.maps[i].dataset.zoomSlider),this.maps[i].dataset.fullScreen&&(this.mapConfigs[i].fullScreen=this.maps[i].dataset.fullScreen)},init:function(i){this.initMapConfig(i);var r=document.getElementsByClassName(this.mapWrapClass);for(let t=0;t