1import{r as e,t}from"./rolldown-runtime-BHe-jwch.js";var n=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},r={PROPERTYCHANGE:`propertychange`},i=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function a(e,t,n){let r,i;n||=o;let a=0,s=e.length,c=!1;for(;a<s;)r=a+(s-a>>1),i=+n(e[r],t),i<0?a=r+1:(s=r,c=!i);return c?a:~a}function o(e,t){return e>t?1:e<t?-1:0}function s(e,t,n){let r=e.length;if(e[0]<=t)return 0;if(t<=e[r-1])return r-1;let i;if(n>0){for(i=1;i<r;++i)if(e[i]<t)return i-1}else if(n<0){for(i=1;i<r;++i)if(e[i]<=t)return i}else for(i=1;i<r;++i)if(e[i]==t)return i;else if(e[i]<t)return typeof n==`function`?n(t,e[i-1],e[i])>0?i-1:i:e[i-1]-t<t-e[i]?i-1:i;return r-1}function c(e,t,n){for(;t<n;){let r=e[t];e[t]=e[n],e[n]=r,++t,--n}}function l(e,t){let n=Array.isArray(t)?t:[t],r=n.length;for(let t=0;t<r;t++)e[e.length]=n[t]}function u(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function d(e,t,n){let r=t||o;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function f(){return!0}function p(){return!1}function m(){}function h(e){let t=!1,n,r,i;return function(){let a=Array.prototype.slice.call(arguments);return(!t||this!==i||!u(a,r))&&(t=!0,i=this,r=a,n=e.apply(this,arguments)),n}}function g(e){for(let t in e)delete e[t]}function _(e){let t;for(t in e)return!1;return!t}var v=class extends i{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,r=t?e:e.type,i=this.listeners_&&this.listeners_[r];if(!i)return;let a=t?new n(e):e;a.target||=this.eventTarget_||this;let o=this.dispatching_||={},s=this.pendingRemovals_||={};r in o||(o[r]=0,s[r]=0),++o[r];let c;for(let e=0,t=i.length;e<t;++e)if(c=`handleEvent`in i[e]?i[e].handleEvent(a):i[e].call(this,a),c===!1||a.propagationStopped){c=!1;break}if(--o[r]===0){let e=s[r];for(delete s[r];e--;)this.removeEventListener(r,m);delete o[r]}return c}disposeInternal(){this.listeners_&&g(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){let n=this.listeners_&&this.listeners_[e];if(n){let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=m,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}}},y={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`};function b(e,t,n,r,i){if(r&&r!==e&&(n=n.bind(r)),i){let r=n;n=function(){e.removeEventListener(t,n),r.apply(this,arguments)}}let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function x(e,t,n,r){return b(e,t,n,r,!0)}function S(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),g(e))}var C=class extends v{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(y.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=b(this,e[i],t);return r}return b(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=x(this,e[i],t)}else n=x(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)w(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};C.prototype.on,C.prototype.once,C.prototype.un;function w(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)S(e[t]);else S(e)}function T(){throw Error(`Unimplemented abstract method.`)}var E=0;function D(e){return e.ol_uid||=String(++E)}var O=class extends n{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},k=class extends C{constructor(e){super(),this.on,this.once,this.un,D(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}hasProperties(){return!!this.values_}notify(e,t){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new O(n,e,t)),n=r.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new O(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||={};if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}
1applyProperties(e){e.values_&&Object.assign(this.values_||={},e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],_(this.values_)&&(this.values_=null),t||this.notify(e,n)}}},ee={1:`The view center is not defined`,2:`The view resolution is not defined`,3:`The view rotation is not defined`,4:"`image` and `src` cannot be provided at the same time",5:"`imgSize` must be set when `image` is provided",7:"`format` must be set when `url` is set",8:"Unknown `serverType` configured",9:"`url` must be configured or set using `#setUrl()`",10:"The default `geometryFunction` can only handle `Point` geometries",11:"`options.featureTypes` must be an Array",12:"`options.geometryName` must also be provided when `options.bbox` is set",13:`Invalid corner`,14:`Invalid color`,15:`Tried to get a value for a key that does not exist in the cache`,16:`Tried to set a value for a key that is used already`,17:"`resolutions` must be sorted in descending order",18:"Either `origin` or `origins` must be configured, never both",19:"Number of `tileSizes` and `resolutions` must be equal",20:"Number of `origins` and `resolutions` must be equal",22:"Either `tileSize` or `tileSizes` must be configured, never both",24:"Invalid extent or geometry provided as `geometry`",25:"Cannot fit empty extent provided as `geometry`",26:`Features must have an id set`,27:`Features must have an id set`,28:'`renderMode` must be `"hybrid"` or `"vector"`',30:"The passed `feature` was already added to the source",31:"Tried to enqueue an `element` that was already added to the queue",32:`Transformation matrix cannot be inverted`,33:`Invalid units`,34:`Invalid geometry layout`,36:`Unknown SRS type`,37:`Unknown geometry type found`,38:"`styleMapValue` has an unknown type",39:`Unknown geometry type`,40:"Expected `feature` to have a geometry",41:"Expected an `ol/style/Style` or an array of `ol/style/Style.js`",42:`Question unknown, the answer is 42`,43:"Expected `layers` to be an array or a `Collection`",47:"Expected `controls` to be an array or an `ol/Collection`",48:"Expected `interactions` to be an array or an `ol/Collection`",49:"Expected `overlays` to be an array or an `ol/Collection`",50:"`options.featureTypes` should be an Array",51:"Either `url` or `tileJSON` options must be provided",52:"Unknown `serverType` configured",53:"Unknown `tierSizeCalculation` configured",55:`The {-y} placeholder requires a tile grid with extent`,56:`mapBrowserEvent must originate from a pointer event`,57:`At least 2 conditions are required`,59:`Invalid command found in the PBF`,60:"Missing or invalid `size`",61:`Cannot determine IIIF Image API version from provided image information JSON`,62:"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`",64:`Layer opacity must be a number`,66:"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`",67:"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both",68:`A VectorTile source can only be rendered if it has a projection compatible with the view projection`,69:"`width` or `height` cannot be provided together with `scale`"},A=class extends Error{constructor(e){let t=ee[e];super(t),this.code=e,this.name=`AssertionError`,this.message=t}},j={ADD:`add`,REMOVE:`remove`},te={LENGTH:`length`},M=class extends n{constructor(e,t,n){super(e),this.element=t,this.index=n}},N=class extends k{constructor(e,t){if(super(),this.on,this.once,this.un,t||={},this.unique_=!!t.unique,this.array_=e||[],this.unique_)for(let e=0,t=this.array_.length;e<t;++e)this.assertUnique_(this.array_[e],e);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,n=e.length;t<n;++t)this.push(e[t]);return this}forEach(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)e(t[n],n,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(te.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new M(j.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)if(t[n]===e)return this.removeAt(n)}removeAt(e){if(e<0||e>=this.getLength())return;let t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new M(j.REMOVE,t,e)),t}setAt(e,t){if(e>=this.getLength()){this.insertAt(e,t);return}if(e<0)throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t,e);let n=this.array_[e];this.array_[e]=t,this.dispatchEvent(new M(j.REMOVE,n,e)),this.dispatchEvent(new M(j.ADD,t,e))}updateLength_(){this.set(te.LENGTH,this.array_.length)}assertUnique_(e,t){for(let n=0,r=this.array_.length;n<r;++n)if(this.array_[n]===e&&n!==t)throw new A(58)}},P=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``,ne=P.includes(`firefox`);P.includes(`safari`)&&!P.includes(`chrom`)&&(P.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(P));var re=P.includes(`webkit`)&&!P.includes(`edge`),ie=P.includes(`macintosh`),ae=typeof devicePixelRatio<`u`?devicePixelRatio:1,oe=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,se=typeof Image<`u`&&Image.prototype.decode,ce=(function(){let e=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})();function F(e,t){if(!e)throw new A(t)}function le(){return[1,0,0,1,0,0]}function ue(e,t,n,r,i,a,o){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=a,e[5]=o,e}function de(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function I(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function fe(e,t,n){return ue(e,t,0,0,n,0,0)}function pe(e,t,n,r,i,a,o,s){let c=Math.sin(a),l=Math.cos(a);return e[0]=r*l,e[1]=i*c,e[2]=-r*c,e[3]=i*l,e[4]=o*r*l-s*r*c+t,e[5]=o
1*i*c+s*i*l+n,e}function me(e,t){let n=he(t);F(n!==0,32);let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-a/n,e[3]=r/n,e[4]=(a*c-o*s)/n,e[5]=-(r*c-i*s)/n,e}function he(e){return e[0]*e[3]-e[1]*e[2]}var ge;function _e(e){let t=`matrix(`+e.join(`, `)+`)`;if(oe)return t;let n=ge||=document.createElement(`div`);return n.style.transform=t,n.style.transform}var L={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ve(e){let t=De();for(let n=0,r=e.length;n<r;++n)Pe(t,e[n]);return t}function ye(e,t,n){return Oe(Math.min.apply(null,e),Math.min.apply(null,t),Math.max.apply(null,e),Math.max.apply(null,t),n)}function be(e,t,n){return n?(n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function xe(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function Se(e,t,n){let r,i;return r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,i=n<e[1]?e[1]-n:e[3]<n?n-e[3]:0,r*r+i*i}function Ce(e,t){return Te(e,t[0],t[1])}function we(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function Te(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function Ee(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=L.UNKNOWN;return o<n?c|=L.LEFT:o>i&&(c|=L.RIGHT),s<r?c|=L.BELOW:s>a&&(c|=L.ABOVE),c===L.UNKNOWN&&(c=L.INTERSECTING),c}function De(){return[1/0,1/0,-1/0,-1/0]}function Oe(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function ke(e){return Oe(1/0,1/0,-1/0,-1/0,e)}function Ae(e,t){let n=e[0],r=e[1];return Oe(n,r,n,r,t)}function je(e,t,n,r,i){return Fe(ke(i),e,t,n,r)}function Me(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function Ne(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function Pe(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function Fe(e,t,n,r,i){for(;n<r;n+=i)Ie(e,t[n],t[n+1]);return e}function Ie(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function Le(e,t){let n;return n=t(ze(e)),n||(n=t(Be(e)),n)||(n=t(Je(e)),n)||(n=t(qe(e)),n)?n:!1}function Re(e){let t=0;return Xe(e)||(t=R(e)*Ge(e)),t}function ze(e){return[e[0],e[1]]}function Be(e){return[e[2],e[1]]}function Ve(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function He(e,t){let n;return t===`bottom-left`?n=ze(e):t===`bottom-right`?n=Be(e):t===`top-left`?n=qe(e):t===`top-right`?n=Je(e):F(!1,13),n}function Ue(e,t,n,r,i){let[a,o,s,c,l,u,d,f]=We(e,t,n,r);return Oe(Math.min(a,s,l,d),Math.min(o,c,u,f),Math.max(a,s,l,d),Math.max(o,c,u,f),i)}function We(e,t,n,r){let i=t*r[0]/2,a=t*r[1]/2,o=Math.cos(n),s=Math.sin(n),c=i*o,l=i*s,u=a*o,d=a*s,f=e[0],p=e[1];return[f-c+d,p-l-u,f-c-d,p-l+u,f+c-d,p+l+u,f+c+d,p+l-u,f-c+d,p-l-u]}function Ge(e){return e[3]-e[1]}function Ke(e,t,n){let r=n||De();return Ye(e,t)?(e[0]>t[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]<t[2]?r[2]=e[2]:r[2]=t[2],e[3]<t[3]?r[3]=e[3]:r[3]=t[3]):ke(r),r}function qe(e){return[e[0],e[3]]}function Je(e){return[e[2],e[3]]}function R(e){return e[2]-e[0]}function Ye(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Xe(e){return e[2]<e[0]||e[3]<e[1]}function Ze(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}function Qe(e,t,n){let r=!1,i=Ee(e,t),a=Ee(e,n);if(i===L.INTERSECTING||a===L.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&L.ABOVE&&!(i&L.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&L.RIGHT&&!(i&L.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&L.BELOW&&!(i&L.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&L.LEFT&&!(i&L.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function $e(e,t,n,r){let i=[];if(r>1){let t=e[2]-e[0],n=e[3]-e[1];for(let a=0;a<r;++a)i.push(e[0]+t*a/r,e[1],e[2],e[1]+n*a/r,e[2]-t*a/r,e[3],e[0],e[3]-n*a/r)}else i=[e[0],e[1],e[2],e[1],e[2],e[3],e[0],e[3]];t(i,i,2);let a=[],o=[];for(let e=0,t=i.length;e<t;e+=2)a.push(i[e]),o.push(i[e+1]);return ye(a,o,n)}function et(e,t){let n=t.getExtent(),r=Ve(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=R(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function tt(e,t){if(t.canWrapX()){let n=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[n[0],e[1],n[2],e[3]]];et(e,t);let r=R(n);if(R(e)>r)return[[n[0],e[1],n[2],e[3]]];if(e[0]<n[0])return[[e[0]+r,e[1],n[2],e[3]],[n[0],e[1],e[2],e[3]]];if(e[2]>n[2])return[[e[0],e[1],n[2],e[3]],[n[0],e[1],e[2]-r,e[3]]]}return[e]}function z(e,t,n){return Math.min(Math.max(e,t),n)}function nt(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return rt(e,t,n,r)}function rt(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}function it(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function at(e){return e*180/Math.PI}function ot(e){return e*Math.PI/180}function st(e,t){let n=e%t;return n*t<0?n+t:n}function ct(e,t,n){return e+n*(t-e)}function lt(e,t){let n=10**t;return Math.round(e*n)/n}function ut(e,t){return Math.floor(lt(e,t))}function dt(e,t){return Math.ceil(lt(e,t))}
1var ft=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,pt=/^([a-z]*)$|^hsla?\(.*\)$/i;function mt(e){return typeof e==`string`?e:bt(e)}function ht(e){let t=document.createElement(`div`);if(t.style.color=e,t.style.color!==``){document.body.appendChild(t);let e=getComputedStyle(t).color;return document.body.removeChild(t),e}return``}var gt=(function(){let e={},t=0;return(function(n){let r;if(e.hasOwnProperty(n))r=e[n];else{if(t>=1024){let n=0;for(let r in e)n++&3||(delete e[r],--t)}r=vt(n),e[n]=r,++t}return r})})();function _t(e){return Array.isArray(e)?e:gt(e)}function vt(e){let t,n,r,i,a;if(pt.exec(e)&&(e=ht(e)),ft.exec(e)){let o=e.length-1,s;s=o<=4?1:2;let c=o===4||o===8;t=parseInt(e.substr(1+0*s,s),16),n=parseInt(e.substr(1+1*s,s),16),r=parseInt(e.substr(1+2*s,s),16),i=c?parseInt(e.substr(1+3*s,s),16):255,s==1&&(t=(t<<4)+t,n=(n<<4)+n,r=(r<<4)+r,c&&(i=(i<<4)+i)),a=[t,n,r,i/255]}else e.startsWith(`rgba(`)?(a=e.slice(5,-1).split(`,`).map(Number),yt(a)):e.startsWith(`rgb(`)?(a=e.slice(4,-1).split(`,`).map(Number),a.push(1),yt(a)):F(!1,14);return a}function yt(e){return e[0]=z(e[0]+.5|0,0,255),e[1]=z(e[1]+.5|0,0,255),e[2]=z(e[2]+.5|0,0,255),e[3]=z(e[3],0,1),e}function bt(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let n=e[1];n!=(n|0)&&(n=n+.5|0);let r=e[2];r!=(r|0)&&(r=r+.5|0);let i=e[3]===void 0?1:Math.round(e[3]*100)/100;return`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`}var xt=class{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(let t in this.cache_){let n=this.cache_[t];!(e++&3)&&!n.hasListener()&&(delete this.cache_[t],--this.cacheSize_)}}}get(e,t,n){let r=St(e,t,n);return r in this.cache_?this.cache_[r]:null}set(e,t,n,r){let i=St(e,t,n);this.cache_[i]=r,++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function St(e,t,n){let r=n?mt(n):`null`;return t+`:`+e+`:`+r}var Ct=new xt,B={OPACITY:`opacity`,VISIBLE:`visible`,EXTENT:`extent`,Z_INDEX:`zIndex`,MAX_RESOLUTION:`maxResolution`,MIN_RESOLUTION:`minResolution`,MAX_ZOOM:`maxZoom`,MIN_ZOOM:`minZoom`,SOURCE:`source`,MAP:`map`},wt=class extends k{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;let t=Object.assign({},e);typeof e.properties==`object`&&(delete t.properties,Object.assign(t,e.properties)),t[B.OPACITY]=e.opacity===void 0?1:e.opacity,F(typeof t[B.OPACITY]==`number`,64),t[B.VISIBLE]=e.visible===void 0?!0:e.visible,t[B.Z_INDEX]=e.zIndex,t[B.MAX_RESOLUTION]=e.maxResolution===void 0?1/0:e.maxResolution,t[B.MIN_RESOLUTION]=e.minResolution===void 0?0:e.minResolution,t[B.MIN_ZOOM]=e.minZoom===void 0?-1/0:e.minZoom,t[B.MAX_ZOOM]=e.maxZoom===void 0?1/0:e.maxZoom,this.className_=t.className===void 0?`ol-layer`:t.className,delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){let t=this.state_||{layer:this,managed:e===void 0?!0:e},n=this.getZIndex();return t.opacity=z(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=n===void 0&&!t.managed?1/0:n,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return T()}getLayerStatesArray(e){return T()}getExtent(){return this.get(B.EXTENT)}getMaxResolution(){return this.get(B.MAX_RESOLUTION)}getMinResolution(){return this.get(B.MIN_RESOLUTION)}getMinZoom(){return this.get(B.MIN_ZOOM)}getMaxZoom(){return this.get(B.MAX_ZOOM)}getOpacity(){return this.get(B.OPACITY)}getSourceState(){return T()}getVisible(){return this.get(B.VISIBLE)}getZIndex(){return this.get(B.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(B.EXTENT,e)}setMaxResolution(e){this.set(B.MAX_RESOLUTION,e)}setMinResolution(e){this.set(B.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(B.MAX_ZOOM,e)}setMinZoom(e){this.set(B.MIN_ZOOM,e)}setOpacity(e){F(typeof e==`number`,64),this.set(B.OPACITY,e)}setVisible(e){this.set(B.VISIBLE,e)}setZIndex(e){this.set(B.Z_INDEX,e)}disposeInternal(){this.state_&&=(this.state_.layer=null,null),super.disposeInternal()}},Tt={PRERENDER:`prerender`,POSTRENDER:`postrender`,PRECOMPOSE:`precompose`,POSTCOMPOSE:`postcompose`,RENDERCOMPLETE:`rendercomplete`}
1,V={ANIMATING:0,INTERACTING:1},Et={CENTER:`center`,RESOLUTION:`resolution`,ROTATION:`rotation`},Dt={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},Ot=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global===void 0?!1:e.global,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Dt[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}},kt=6378137,At=Math.PI*kt,jt=[-At,-At,At,At],Mt=[-180,-85,180,85],Nt=kt*Math.log(Math.tan(Math.PI/2)),Pt=class extends Ot{constructor(e){super({code:e,units:`m`,extent:jt,global:!0,worldExtent:Mt,getPointResolution:function(e,t){return e/Math.cosh(t[1]/kt)}})}},Ft=[new Pt(`EPSG:3857`),new Pt(`EPSG:102100`),new Pt(`EPSG:102113`),new Pt(`EPSG:900913`),new Pt(`http://www.opengis.net/def/crs/EPSG/0/3857`),new Pt(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function It(e,t,n){let r=e.length;n=n>1?n:2,t===void 0&&(t=n>2?e.slice():Array(r));for(let i=0;i<r;i+=n){t[i]=At*e[i]/180;let n=kt*Math.log(Math.tan(Math.PI*(+e[i+1]+90)/360));n>Nt?n=Nt:n<-Nt&&(n=-Nt),t[i+1]=n}return t}function Lt(e,t,n){let r=e.length;n=n>1?n:2,t===void 0&&(t=n>2?e.slice():Array(r));for(let i=0;i<r;i+=n)t[i]=180*e[i]/At,t[i+1]=360*Math.atan(Math.exp(e[i+1]/kt))/Math.PI-90;return t}var Rt=6378137,zt=[-180,-90,180,90],Bt=Math.PI*Rt/180,Vt=class extends Ot{constructor(e,t){super({code:e,units:`degrees`,extent:zt,axisOrientation:t,global:!0,metersPerUnit:Bt,worldExtent:zt})}},Ht=[new Vt(`CRS:84`),new Vt(`EPSG:4326`,`neu`),new Vt(`urn:ogc:def:crs:OGC:1.3:CRS84`),new Vt(`urn:ogc:def:crs:OGC:2:84`),new Vt(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new Vt(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new Vt(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)],Ut={};function Wt(e){return Ut[e]||Ut[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function Gt(e,t){Ut[e]=t}var Kt={};function qt(e,t,n){let r=e.getCode(),i=t.getCode();r in Kt||(Kt[r]={}),Kt[r][i]=n}function Jt(e,t){let n;return e in Kt&&t in Kt[e]&&(n=Kt[e][t]),n}function Yt(e,t,n){let r=n===void 0?``+e:e.toFixed(n),i=r.indexOf(`.`);return i=i===-1?r.length:i,i>t?r:Array(1+t-i).join(`0`)+r}function Xt(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function Zt(e,t){let n=!0;for(let r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Qt(e,t){let n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,a=e[1]*n+e[0]*r;return e[0]=i,e[1]=a,e}function $t(e,t){return e[0]*=t,e[1]*=t,e}function en(e,t){if(t.canWrapX()){let n=R(t.getExtent()),r=tn(e,t,n);r&&(e[0]-=r*n)}return e}function tn(e,t,n){let r=t.getExtent(),i=0;return t.canWrapX()&&(e[0]<r[0]||e[0]>r[2])&&(n||=R(r),i=Math.floor((e[0]-r[0])/n)),i}function nn(e,t,n){n||=6371008.8;let r=ot(e[1]),i=ot(t[1]),a=(i-r)/2,o=ot(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}function rn(e,t,n,r){r||=6371008.8;let i=ot(e[1]),a=ot(e[0]),o=t/r,s=Math.asin(Math.sin(i)*Math.cos(o)+Math.cos(i)*Math.sin(o)*Math.cos(n));return[at(a+Math.atan2(Math.sin(n)*Math.sin(o)*Math.cos(i),Math.cos(o)-Math.sin(i)*Math.sin(s))),at(s)]}var an={info:1,warn:2,error:3,none:4},on=an.info;function sn(...e){on>an.warn||console.warn(...e)}var cn=!0;function ln(e){cn=!(e===void 0||e)}function un(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function dn(e,t){if(t!==void 0&&e!==t){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];e=t}return e}function fn(e){Gt(e.getCode(),e),qt(e,e,un)}function pn(e){e.forEach(fn)}function H(e){return typeof e==`string`?Wt(e):e||null}function mn(e,t,n,r){e=H(e);let i,a=e.getPointResolutionFunc();if(a){if(i=a(t,n),r&&r!==e.getUnits()){let t=e.getMetersPerUnit();t&&(i=i*t/Dt[r])}}else{let a=e.getUnits();if(a==`degrees`&&!r||r==`degrees`)i=t;else{let o=xn(e,H(`EPSG:4326`));if(o===dn&&a!==`degrees`)i=t*e.getMetersPerUnit();else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];e=o(e,e,2),i=(nn(e.slice(0,2),e.slice(2,4))+nn(e.slice(4,6),e.slice(6,8)))/2}let s=r?Dt[r]:e.getMetersPerUnit();s!==void 0&&(i/=s)}}return i}function hn(e){pn(e),e.forEach(function(t){e.forEach(function(e){t!==e&&qt(t,e,un)})})}function gn(e,t,n,r){e.forEach(function(e){t.forEach(function(t){qt(e,t,n),qt(t,e,r)})})}function _n(e,t){return e?typeof e==`string`?H(e):e:H(t)}function vn(e,t){return ln(),Cn(e,`EPSG:4326`,t===void 0?`EPSG:3857`:t)}function yn(e,t){let n=Cn(e,t===void 0?`EPSG:3857`:t,`EPSG:4326`),r=n[0];return(r<-180||r>180)&&(n[0]=st(r+180,360)-180),n}function bn(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||xn(e,t)===un)&&n}function xn(e,t){let n=Jt(e.getCode(),t.getCode());return n||=dn,n}function Sn(e,t){return xn(H(e),H(t))}function Cn(e,t,n){return Sn(t,n)(e,void 0,e.length)}function wn(e,t,n,r){return $e(e,Sn(t,n),void 0,r)}var Tn=null;function En(){return Tn}function Dn(e,t){return Tn?Cn(e,t,Tn):e}function On(e,t){return Tn?Cn(e,Tn,t):(cn&&!Zt(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(cn=!1,sn(`Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.`)),e)}function kn(e,t){return Tn?wn(e,t,Tn):e}function An(e,t){return Tn?wn(e,Tn,t):e}function jn(e,t){if(!Tn)return e;let n=H(t).getUnits(),r=Tn.getUnits();return n&&r?e*Dt[n]/Dt[r]:e}function Mn(e,t){if(!Tn)return e;let n=H(t).getUnits(),r=Tn.getUnits();return n&&r?e*Dt[r]/Dt[n]:e}function Nn(){hn(Ft),hn(Ht),gn(Ht,Ft,It,Lt)}Nn();
1function Pn(e,t,n){return(function(r,i,a,o,s){if(!r)return;if(!i&&!t)return r;let c=t?0:a[0]*i,l=t?0:a[1]*i,u=s?s[0]:0,d=s?s[1]:0,f=e[0]+c/2+u,p=e[2]-c/2+u,m=e[1]+l/2+d,h=e[3]-l/2+d;f>p&&(f=(p+f)/2,p=f),m>h&&(m=(h+m)/2,h=m);let g=z(r[0],f,p),_=z(r[1],m,h);if(o&&n&&i){let e=30*i;g+=-e*Math.log(1+Math.max(0,f-r[0])/e)+e*Math.log(1+Math.max(0,r[0]-p)/e),_+=-e*Math.log(1+Math.max(0,m-r[1])/e)+e*Math.log(1+Math.max(0,r[1]-h)/e)}return[g,_]})}function Fn(e){return e}function In(e,t,n,r){let i=R(t)/n[0],a=Ge(t)/n[1];return r?Math.min(e,Math.max(i,a)):Math.min(e,Math.min(i,a))}function Ln(e,t,n){let r=Math.min(e,t);return r*=Math.log(1+50*Math.max(0,e/t-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/e-1))/50+1),z(r,n/2,t*2)}function Rn(e,t,n,r){return t=t===void 0?!0:t,(function(i,a,o,c){if(i!==void 0){let l=e[0],u=e[e.length-1],d=n?In(l,n,o,r):l;if(c)return t?Ln(i,d,u):z(i,u,d);let f=Math.floor(s(e,Math.min(d,i),a));return e[f]>d&&f<e.length-1?e[f+1]:e[f]}})}function zn(e,t,n,r,i,a){return r=r===void 0?!0:r,n=n===void 0?0:n,(function(o,s,c,l){if(o!==void 0){let u=i?In(t,i,c,a):t;if(l)return r?Ln(o,u,n):z(o,n,u);let d=1e-9,f=Math.ceil(Math.log(t/u)/Math.log(e)-d),p=-s*(.5-d)+.5,m=Math.floor(Math.log(t/Math.min(u,o))/Math.log(e)+p);return z(t/e**+Math.max(f,m),n,u)}})}function Bn(e,t,n,r,i){return n=n===void 0?!0:n,(function(a,o,s,c){if(a!==void 0){let o=r?In(e,r,s,i):e;return!n||!c?z(a,t,o):Ln(a,o,t)}})}function Vn(e){if(e!==void 0)return 0}function Hn(e){if(e!==void 0)return e}function Un(e){let t=2*Math.PI/e;return(function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e})}function Wn(e){return e||=ot(5),(function(t,n){if(n)return t;if(t!==void 0)return Math.abs(t)<=e?0:t})}function Gn(e){return e**3}function Kn(e){return 1-Gn(1-e)}function qn(e){return 3*e*e-2*e*e*e}function Jn(e){return e}function Yn(e,t,n,r,i,a){a||=[];let o=0;for(let s=t;s<n;s+=r){let t=e[s],n=e[s+1];a[o++]=i[0]*t+i[2]*n+i[4],a[o++]=i[1]*t+i[3]*n+i[5]}return a&&a.length!=o&&(a.length=o),a}function Xn(e,t,n,r,i,a,o){o||=[];let s=Math.cos(i),c=Math.sin(i),l=a[0],u=a[1],d=0;for(let i=t;i<n;i+=r){let t=e[i]-l,n=e[i+1]-u;o[d++]=l+t*s-n*c,o[d++]=u+t*c+n*s;for(let t=i+2;t<i+r;++t)o[d++]=e[t]}return o&&o.length!=d&&(o.length=d),o}function Zn(e,t,n,r,i,a,o,s){s||=[];let c=o[0],l=o[1],u=0;for(let o=t;o<n;o+=r){let t=e[o]-c,n=e[o+1]-l;s[u++]=c+i*t,s[u++]=l+a*n;for(let t=o+2;t<o+r;++t)s[u++]=e[t]}return s&&s.length!=u&&(s.length=u),s}function Qn(e,t,n,r,i,a,o){o||=[];let s=0;for(let c=t;c<n;c+=r){o[s++]=e[c]+i,o[s++]=e[c+1]+a;for(let t=c+2;t<c+r;++t)o[s++]=e[t]}return o&&o.length!=s&&(o.length=s),o}var $n=le(),er=class extends k{constructor(){super(),this.extent_=De(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=h(function(e,t,n){if(!n)return this.getSimplifiedGeometry(t);let r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return T()}closestPointXY(e,t,n,r){return T()}containsXY(e,t){let n=this.getClosestPoint([e,t]);return n[0]===e&&n[1]===t}getClosestPoint(e,t){return t||=[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return T()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&ke(e),this.extentRevision_=this.getRevision()}return Ze(this.extent_,e)}rotate(e,t){T()}scale(e,t,n){T()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return T()}getType(){return T()}applyTransform(e){T()}intersectsExtent(e){return T()}translate(e,t){T()}transform(e,t){let n=H(e),r=n.getUnits()==`tile-pixels`?function(e,r,i){let a=n.getExtent(),o=n.getWorldExtent(),s=Ge(o)/Ge(a);return pe($n,o[0],o[3],s,-s,0,0,0),Yn(e,0,e.length,i,$n,r),Sn(n,t)(e,r,i)}:Sn(n,t);return this.applyTransform(r),this}},tr=class extends er{constructor(){super(),this.layout=`XY`,this.stride=2,this.flatCoordinates=null}computeExtent(e){return je(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return T()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=rr(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){T()}setLayout(e,t,n){let r;if(e)r=rr(e);else{for(let e=0;e<n;++e){if(t.length===0){this.layout=`XY`,this.stride=2;return}t=t[0]}r=t.length,e=nr(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Xn(n,0,n.length,r,e,t,n),this.changed()}}scale(e,t,n){t===void 0&&(t=e),n||=Ve(this.getExtent());let r=this.getFlatCoordinates();if(r){let i=this.getStride();Zn(r,0,r.length,i,e,t,n,r),this.changed()}}translate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Qn(n,0,n.length,r,e,t,n),this.changed()}}};function nr(e){let t;return e==2?t=`XY`:e==3?t=`XYZ`:e==4&&(t=`XYZM`),t}function rr(e){let t;return e==`XY`?t=2:e==`XYZ`||e==`XYM`?t=3:e==`XYZM`&&(t=4),t}function ir(e,t,n){let r=e.getFlatCoordinates();if(!r)return null;let i=e.getStride();return Yn(r,0,r.length,i,t,n)}function ar(e,t,n,r,i,a,o){let s=e[t],c=e[t+1],l=e[n]-s,u=e[n+1]-c,d;if(l===0&&u===0)d=t;else{let f=((i-s)*l+(a-c)*u)/(l*l+u*u);if(f>1)d=n;else if(f>0){for(let i=0;i<r;++i)o[i]=ct(e[t+i],e[n+i],f);o.length=r;return}else d=t}for(let t=0;t<r;++t)o[t]=e[d+t];o.length=r}function or(e,t,n,r,i){let a=e[t],o=e[t+1];for(t+=r;t<n;t+=r){let n=e[t],r=e[t+1],s=rt(a,o,n,r);s>i&&(i=s),a=n,o=r}return i}function sr(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=or(e,t,o,r,i),t=o}return i}function cr(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=sr(e,t,o,r,i),t=o[o.length-1]}return i}function lr(e,t,n,r,i,a,o,s,c,l,u){if(t==n)return l;let d,f;if(i===0){if(f=rt(o,s,e[t],e[t+1]),f<l){for(d=0;d<r;++d)c[d]=e[t+d];return c.length=r,f}return l}u||=[NaN,NaN];let p=t+r;for(;p<n;)if(ar(e,p-r,p,r,o,s,u),f=rt(o,s,u[0],u[1]),f<l){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r,p+=r}else p+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(a&&(ar(e,n-r,t,r,o,s,u),f=rt(o,s,u[0],u[1]),f<l)){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r}return l}function ur(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=lr(e,t,f,r,i,a,o,s,c,l,u),t=f}return l}function dr(e,t,n,r,i,a,o,s,c,l,u){u||=[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=ur(e,t,f,r,i,a,o,s,c,l,u),t=f[f.length-1]}return l}function fr(e,t,n,r){for(let r=0,i=n.length;r<i;++r)e[t++]=n[r];return t}function pr(e,t,n,r){for(let i=0,a=n.length;i<a;++i){let a=n[i];for(let n=0;n<r;++n)e[t++]=a[n]}return t}function mr(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=pr(e,t,n[o],r);i[a++]=s,t=s}return i.length=a,i}function hr(e,t,n,r,i){i||=[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=mr(e,t,n[o],r,i[a]);s.length===0&&(s[0]=t),i[a++]=s,t=s[s.length-1]}return i.length=a,i}function gr(e,t,n,r,i,a,o){let s=(n-t)/r;if(s<3){for(;t<n;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}let c=Array(s);c[0]=1,c[s-1]=1;let l=[t,n-r],u=0;for(;l.length>0;){let n=l.pop(),a=l.pop(),o=0,s=e[a],d=e[a+1],f=e[n],p=e[n+1];for(let t=a+r;t<n;t+=r){let n=e[t],r=e[t+1],i=nt(n,r,s,d,f,p);i>o&&(u=t,o=i)}o>i&&(c[(u-t)/r]=1,a+r<u&&l.push(a,u),u+r<n&&l.push(u,n))}for(let n=0;n<s;++n)c[n]&&(a[o++]=e[t+n*r],a[o++]=e[t+n*r+1]);return o}function _r(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=gr(e,t,l,r,i,a,o),s.push(o),t=l}return o}function vr(e,t){return t*Math.round(e/t)}function yr(e,t,n,r,i,a,o){if(t==n)return o;let s=vr(e[t],i),c=vr(e[t+1],i);t+=r,a[o++]=s,a[o++]=c;let l,u;do if(l=vr(e[t],i),u=vr(e[t+1],i),t+=r,t==n)return a[o++]=l,a[o++]=u,o;while(l==s&&u==c);for(;t<n;){let n=vr(e[t],i),d=vr(e[t+1],i);if(t+=r,n==l&&d==u)continue;let f=l-s,p=u-c,m=n-s,h=d-c;if(f*h==p*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(p<0&&h<p||p==h||p>0&&h>p)){l=n,u=d;continue}a[o++]=l,a[o++]=u,s=l,c=u,l=n,u=d}return a[o++]=l,a[o++]=u,o}function br(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=yr(e,t,l,r,i,a,o),s.push(o),t=l}return o}function xr(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c],u=[];o=br(e,t,l,r,i,a,o,u),s.push(u),t=l[l.length-1]}return o}function Sr(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=t;o<n;o+=r)i[a++]=e.slice(o,o+r);return i.length=a,i}function Cr(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=Sr(e,t,s,r,i[a]),t=s}return i.length=a,i}function wr(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=s.length===1&&s[0]===t?[]:Cr(e,t,s,r,i[a]),t=s[s.length-1]}return i.length=a,i}function Tr(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];i+=o*n-a*r,a=n,o=r}return i/2}function Er(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=Tr(e,t,o,r),t=o}return i}function Dr(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=Er(e,t,o,r),t=o[o.length-1]}return i}var Or=class e extends tr{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new e(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,n,r){return r<Se(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(or(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),lr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,n,r))}getArea(){return Tr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Sr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let n=[];return n.length=gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LinearRing`}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=pr(this.flatCoordinates,0,e,this.stride),this.changed()}},kr=class e extends tr{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=rt(e,t,i[0],i[1]);if(a<r){let e=this.stride;for(let t=0;t<e;++t)n[t]=i[t];return n.length=e,a}return r}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(e){return Ae(this.flatCoordinates,e)}getType(){return`Point`}intersectsExtent(e){return Te(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||=[],this.flatCoordinates.length=fr(this.flatCoordinates,0,e,this.stride),this.changed()}};function Ar(e,t,n,r,i){return!Le(i,function(i){return!jr(e,t,n,r,i[0],i[1])})}function jr(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function Mr(e,t,n,r,i,a){if(n.length===0||!jr(e,t,n[0],r,i,a))return!1;for(let t=1,o=n.length;t<o;++t)if(jr(e,n[t-1],n[t],r,i,a))return!1;return!0}function Nr(e,t,n,r,i,a){if(n.length===0)return!1;for(let o=0,s=n.length;o<s;++o){let s=n[o];if(Mr(e,t,s,r,i,a))return!0;t=s[s.length-1]}return!1}function Pr(e,t,n,r,i,a,s){let c,l,u,d,f,p,m,h=i[a+1],g=[];for(let i=0,a=n.length;i<a;++i){let a=n[i];for(d=e[a-r],p=e[a-r+1],c=t;c<a;c+=r)f=e[c],m=e[c+1],(h<=p&&m<=h||p<=h&&h<=m)&&(u=(h-p)/(m-p)*(f-d)+d,g.push(u)),d=f,p=m}let _=NaN,v=-1/0;for(g.sort(o),d=g[0],c=1,l=g.length;c<l;++c){f=g[c];let i=Math.abs(f-d);i>v&&(u=(d+f)/2,Mr(e,t,n,r,u,h)&&(_=u,v=i)),d=f}
1return isNaN(_)&&(_=i[a]),s?(s.push(_,h,v),s):[_,h,v]}function Fr(e,t,n,r,i){let a=[];for(let o=0,s=n.length;o<s;++o){let s=n[o];a=Pr(e,t,s,r,i,2*o,a),t=s[s.length-1]}return a}function Ir(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function Lr(e,t,n,r,i){let a=Fe(De(),e,t,n,r);return Ye(i,a)?we(i,a)||a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]?!0:Ir(e,t,n,r,function(e,t){return Qe(i,e,t)}):!1}function Rr(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){if(Lr(e,t,n[a],r,i))return!0;t=n[a]}return!1}function zr(e,t,n,r,i){return!!(Lr(e,t,n,r,i)||jr(e,t,n,r,i[0],i[1])||jr(e,t,n,r,i[0],i[3])||jr(e,t,n,r,i[2],i[1])||jr(e,t,n,r,i[2],i[3]))}function Br(e,t,n,r,i){if(!zr(e,t,n[0],r,i))return!1;if(n.length===1)return!0;for(let t=1,a=n.length;t<a;++t)if(Ar(e,n[t-1],n[t],r,i)&&!Lr(e,n[t-1],n[t],r,i))return!1;return!0}function Vr(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(Br(e,t,o,r,i))return!0;t=o[o.length-1]}return!1}function Hr(e,t,n,r){for(;t<n-r;){for(let i=0;i<r;++i){let a=e[t+i];e[t+i]=e[n-r+i],e[n-r+i]=a}t+=r,n-=r}}function Ur(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];i+=(n-a)*(r+o),a=n,o=r}return i===0?void 0:i>0}function Wr(e,t,n,r,i){i=i===void 0?!1:i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=Ur(e,t,o,r);if(a===0){if(i&&s||!i&&!s)return!1}else if(i&&!s||!i&&s)return!1;t=o}return!0}function Gr(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];if(!Wr(e,t,o,r,i))return!1;o.length&&(t=o[o.length-1])}return!0}function Kr(e,t,n,r,i){i=i===void 0?!1:i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=Ur(e,t,o,r);(a===0?i&&s||!i&&!s:i&&!s||!i&&s)&&Hr(e,t,o,r),t=o}return t}function qr(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=Kr(e,t,n[a],r,i);return t}var Jr=class e extends tr{constructor(e,t,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&n?(this.setFlatCoordinates(t,e),this.ends_=n):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?l(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Se(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ur(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return Mr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Er(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),Kr(t,0,this.ends_,this.stride,e)),Cr(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let e=Ve(this.getExtent());this.flatInteriorPoint_=Pr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new kr(this.getFlatInteriorPoint(),`XYM`)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new Or(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){let e=this.layout,t=this.flatCoordinates,n=this.ends_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=new Or(t.slice(i,o),e);r.push(s),i=o}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;Wr(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=Kr(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=br(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getType(){return`Polygon`}intersectsExtent(e){return Br(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=mr(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}};function Yr(e,t,n,r){n||=32;let i=[];for(let a=0;a<n;++a)l(i,rn(e,t,2*Math.PI*a/n,r));return i.push(i[0],i[1]),new Jr(i,`XY`,[i.length])}function Xr(e){let t=e[0],n=e[1],r=e[2],i=e[3],a=[t,n,t,i,r,i,r,n,t,n];return new Jr(a,`XY`,[a.length])}var Zr=0,Qr=class extends k{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=_n(e.projection,`EPSG:3857`),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&ln(),e.center&&=On(e.center,this.projection_),e.extent&&=An(e.extent,this.projection_),this.applyOptions_(e)}
1applyOptions_(e){let t=Object.assign({},e);for(let e in Et)delete t[e];this.setProperties(t,!0);let n=ti(e);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=n.minZoom;let r=ei(e),i=n.constraint,a=ni(e);this.constraints_={center:r,resolution:i,rotation:a},this.setRotation(e.rotation===void 0?0:e.rotation),this.setCenterInternal(e.center===void 0?null:e.center),e.resolution===void 0?e.zoom!==void 0&&this.setZoom(e.zoom):this.setResolution(e.resolution)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;let n=this.getCenterInternal();if(n){let r=e||[0,0,0,0];t||=[0,0,0,0];let i=this.getResolution(),a=i/2*(r[3]-t[3]+t[1]-r[1]),o=i/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([n[0]+a,n[1]-o])}}getUpdatedOptions_(e){let t=this.getProperties();return t.resolution===void 0?t.zoom=this.getZoom():t.resolution=this.getResolution(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let t=Array(arguments.length);for(let e=0;e<t.length;++e){let n=arguments[e];n.center&&(n=Object.assign({},n),n.center=On(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=On(n.anchor,this.getProjection())),t[e]=n}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,n;t>1&&typeof arguments[t-1]==`function`&&(n=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){let e=arguments[r];e.center&&this.setCenterInternal(e.center),e.zoom===void 0?e.resolution&&this.setResolution(e.resolution):this.setZoom(e.zoom),e.rotation!==void 0&&this.setRotation(e.rotation)}if(r===t){n&&$r(n,!0);return}let i=Date.now(),a=this.targetCenter_.slice(),o=this.targetResolution_,s=this.targetRotation_,c=[];for(;r<t;++r){let e=arguments[r],t={start:i,complete:!1,anchor:e.anchor,duration:e.duration===void 0?1e3:e.duration,easing:e.easing||qn,callback:n};if(e.center&&(t.sourceCenter=a,t.targetCenter=e.center.slice(),a=t.targetCenter),e.zoom===void 0?e.resolution&&(t.sourceResolution=o,t.targetResolution=e.resolution,o=t.targetResolution):(t.sourceResolution=o,t.targetResolution=this.getResolutionForZoom(e.zoom),o=t.targetResolution),e.rotation!==void 0){t.sourceRotation=s;let n=st(e.rotation-s+Math.PI,2*Math.PI)-Math.PI;t.targetRotation=s+n,s=t.targetRotation}ri(t)?t.complete=!0:i+=t.duration,c.push(t)}this.animations_.push(c),this.setHint(V.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[V.ANIMATING]>0}getInteracting(){return this.hints_[V.INTERACTING]>0}cancelAnimations(){this.setHint(V.ANIMATING,-this.hints_[V.ANIMATING]);let e;for(let t=0,n=this.animations_.length;t<n;++t){let n=this.animations_[t];if(n[0].callback&&$r(n[0].callback,!1),!e)for(let t=0,r=n.length;t<r;++t){let r=n[t];if(!r.complete){e=r.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;let e=Date.now(),t=!1;for(let n=this.animations_.length-1;n>=0;--n){let r=this.animations_[n],i=!0;for(let n=0,a=r.length;n<a;++n){let a=r[n];if(a.complete)continue;let o=e-a.start,s=a.duration>0?o/a.duration:1;s>=1?(a.complete=!0,s=1):i=!1;let c=a.easing(s);if(a.sourceCenter){let e=a.sourceCenter[0],t=a.sourceCenter[1],n=a.targetCenter[0],r=a.targetCenter[1];this.nextCenter_=a.targetCenter;let i=e+c*(n-e),o=t+c*(r-t);this.targetCenter_=[i,o]}if(a.sourceResolution&&a.targetResolution){let e=c===1?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){let t=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(e,0,t,!0);this.targetCenter_=this.calculateCenterZoom(n,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=e,this.applyTargetState_(!0)}if(a.sourceRotation!==void 0&&a.targetRotation!==void 0){let e=c===1?st(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){let t=this.constraints_.rotation(e,!0);this.targetCenter_=this.calculateCenterRotate(t,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=e}if(this.applyTargetState_(!0),t=!0,!a.complete)break}if(i){this.animations_[n]=null,this.setHint(V.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let e=r[0].callback;e&&$r(e,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let n,r=this.getCenterInternal();return r!==void 0&&(n=[r[0]-t[0],r[1]-t[1]],Qt(n,e-this.getRotation()),Xt(n,t)),n}calculateCenterZoom(e,t){let n,r=this.getCenterInternal(),i=this.getResolution();return r!==void 0&&i!==void 0&&(n=[t[0]-e*(t[0]-r[0])/i,t[1]-e*(t[1]-r[1])/i]),n}getViewportSize_(e){let t=this.viewportSize_;if(e){let n=t[0],r=t[1];return[Math.abs(n*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(n*Math.sin(e))+Math.abs(r*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){let e=this.getCenterInternal();return e&&Dn(e,this.getProjection())}getCenterInternal(){return this.get(Et.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get(`constrainResolution`)}getHints(e){return e===void 0?this.hints_.slice():(e[0]=this.hints_[0],e[1]=this.hints_[1],e)}calculateExtent(e){return kn(this.calculateExtentInternal(e),this.getProjection())}calculateExtentInternal(e){e||=this.getViewportSizeMinusPadding_();let t=this.getCenterInternal();F(t,1);let n=this.getResolution();F(n!==void 0,2);let r=this.getRotation();return F(r!==void 0,3),Ue(t,n,r,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(Et.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(An(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t||=this.getViewportSizeMinusPadding_();let n=R(e)/t[0],r=Ge(e)/t[1];return Math.max(n,r)}getResolutionForValueFunction(e){e||=2;let t=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(t/n)/Math.log(e);return(function(n){return t/e**+(n*r)})}getRotation(){return this.get(Et.ROTATION)}getValueForResolutionFunction(e){let t=Math.log(e||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/t;return(function(e){return Math.log(n/e)/t/i})}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e),n=this.padding_;return n&&(t=[t[0]-n[1]-n[3],t[1]-n[0]-n[2]]),t}getState(){let e=this.getProjection(),t=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){let e=this.getViewportSizeMinusPadding_();r=ii(r,this.getViewportSize_(),[e[0]/2+i[3],e[1]/2+i[0]],t,n)}return{center:r.slice(0),projection:e===void 0?null:e,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e,t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,n,r;if(this.resolutions_){let i=s(this.resolutions_,e,1);t=i,n=this.resolutions_[i],r=i==this.resolutions_.length-1?2:n/this.resolutions_[i+1]}else n=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(n/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;let t=z(Math.floor(e),0,this.resolutions_.length-2),n=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/n**+z(e-t,0,1)}return this.maxResolution_/this.zoomFactor_**+(e-this.minZoom_)}
1fit(e,t){let n;if(F(Array.isArray(e)||typeof e.getSimplifiedGeometry==`function`,24),Array.isArray(e))F(!Xe(e),25),n=Xr(An(e,this.getProjection()));else if(e.getType()===`Circle`){let t=An(e.getExtent(),this.getProjection());n=Xr(t),n.rotate(this.getRotation(),Ve(t))}else{let t=En();n=t?e.clone().transform(t,this.getProjection()):e}this.fitInternal(n,t)}rotatedExtentForGeometry(e){let t=this.getRotation(),n=Math.cos(t),r=Math.sin(-t),i=e.getFlatCoordinates(),a=e.getStride(),o=1/0,s=1/0,c=-1/0,l=-1/0;for(let e=0,t=i.length;e<t;e+=a){let t=i[e]*n-i[e+1]*r,a=i[e]*r+i[e+1]*n;o=Math.min(o,t),s=Math.min(s,a),c=Math.max(c,t),l=Math.max(l,a)}return[o,s,c,l]}fitInternal(e,t){t||={};let n=t.size;n||=this.getViewportSizeMinusPadding_();let r=t.padding===void 0?[0,0,0,0]:t.padding,i=t.nearest===void 0?!1:t.nearest,a;a=t.minResolution===void 0?t.maxZoom===void 0?0:this.getResolutionForZoom(t.maxZoom):t.minResolution;let o=this.rotatedExtentForGeometry(e),s=this.getResolutionForExtentInternal(o,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);s=isNaN(s)?a:Math.max(s,a),s=this.getConstrainedResolution(s,+!i);let c=this.getRotation(),l=Math.sin(c),u=Math.cos(c),d=Ve(o);d[0]+=(r[1]-r[3])/2*s,d[1]+=(r[0]-r[2])/2*s;let f=d[0]*u-d[1]*l,p=d[1]*u+d[0]*l,h=this.getConstrainedCenter([f,p],s),g=t.callback?t.callback:m;t.duration===void 0?(this.targetResolution_=s,this.targetCenter_=h,this.applyTargetState_(!1,!0),$r(g,!0)):this.animateInternal({resolution:s,center:h,duration:t.duration,easing:t.easing},g)}centerOn(e,t,n){this.centerOnInternal(On(e,this.getProjection()),t,n)}centerOnInternal(e,t,n){this.setCenterInternal(ii(e,t,n,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,n,r){let i,a=this.padding_;if(a&&e){let o=this.getViewportSizeMinusPadding_(-n),s=ii(e,r,[o[0]/2+a[3],o[1]/2+a[0]],t,n);i=[e[0]-s[0],e[1]-s[1]]}return i}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){let t=Dn(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){let t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t&&=On(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*e,0,r,n);t&&(this.targetCenter_=this.calculateCenterZoom(i,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(this.zoomFactor_**+-e,t)}adjustRotation(e,t){t&&=On(t,this.getProjection()),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,n);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&On(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){let n=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,0,i,n),o=this.constraints_.center(this.targetCenter_,a,i,n,this.calculateCenterShift(this.targetCenter_,a,r,i));this.get(Et.ROTATION)!==r&&this.set(Et.ROTATION,r),this.get(Et.RESOLUTION)!==a&&(this.set(Et.RESOLUTION,a),this.set(`zoom`,this.getZoom(),!0)),(!o||!this.get(Et.CENTER)||!Zt(this.get(Et.CENTER),o))&&this.set(Et.CENTER,o),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,n){e=e===void 0?200:e;let r=t||0,i=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(i),o=this.constraints_.resolution(this.targetResolution_,r,a),s=this.constraints_.center(this.targetCenter_,o,a,!1,this.calculateCenterShift(this.targetCenter_,o,i,a));if(e===0&&!this.cancelAnchor_){this.targetResolution_=o,this.targetRotation_=i,this.targetCenter_=s,this.applyTargetState_();return}n||=e===0?this.cancelAnchor_:void 0,this.cancelAnchor_=void 0,(this.getResolution()!==o||this.getRotation()!==i||!this.getCenterInternal()||!Zt(this.getCenterInternal(),s))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:i,center:s,resolution:o,duration:e,easing:Kn,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(V.INTERACTING,1)}endInteraction(e,t,n){n&&=On(n,this.getProjection()),this.endInteractionInternal(e,t,n)}endInteractionInternal(e,t,n){this.getInteracting()&&(this.setHint(V.INTERACTING,-1),this.resolveConstraints(e,t,n
1))}getConstrainedCenter(e,t){let n=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),n)}getConstrainedZoom(e,t){let n=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(n,t))}getConstrainedResolution(e,t){t||=0;let n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,n)}};function $r(e,t){setTimeout(function(){e(t)},0)}function ei(e){if(e.extent!==void 0){let t=e.smoothExtentConstraint===void 0?!0:e.smoothExtentConstraint;return Pn(e.extent,e.constrainOnlyCenter,t)}let t=_n(e.projection,`EPSG:3857`);if(e.multiWorld!==!0&&t.isGlobal()){let e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Pn(e,!1,!1)}return Fn}function ti(e){let t,n,r,i=e.minZoom===void 0?Zr:e.minZoom,a=e.maxZoom===void 0?28:e.maxZoom,o=e.zoomFactor===void 0?2:e.zoomFactor,s=e.multiWorld===void 0?!1:e.multiWorld,c=e.smoothResolutionConstraint===void 0?!0:e.smoothResolutionConstraint,l=e.showFullExtent===void 0?!1:e.showFullExtent,u=_n(e.projection,`EPSG:3857`),d=u.getExtent(),f=e.constrainOnlyCenter,p=e.extent;if(!s&&!p&&u.isGlobal()&&(f=!1,p=d),e.resolutions!==void 0){let o=e.resolutions;n=o[i],r=o[a]===void 0?o[o.length-1]:o[a],t=e.constrainResolution?Rn(o,c,!f&&p,l):Bn(n,r,c,!f&&p,l)}else{let s=(d?Math.max(R(d),Ge(d)):360*Dt.degrees/u.getMetersPerUnit())/256/2**Zr,m=s/2**(28-Zr);n=e.maxResolution,n===void 0?n=s/o**+i:i=0,r=e.minResolution,r===void 0&&(r=e.maxZoom===void 0?m:e.maxResolution===void 0?s/o**+a:n/o**+a),a=i+Math.floor(Math.log(n/r)/Math.log(o)),r=n/o**+(a-i),t=e.constrainResolution?zn(o,n,r,c,!f&&p,l):Bn(n,r,c,!f&&p,l)}return{constraint:t,maxResolution:n,minResolution:r,minZoom:i,zoomFactor:o}}function ni(e){if(e.enableRotation===void 0||e.enableRotation){let t=e.constrainRotation;return t===void 0||t===!0?Wn():t===!1?Hn:typeof t==`number`?Un(t):Hn}return Vn}function ri(e){return!(e.sourceCenter&&e.targetCenter&&!Zt(e.sourceCenter,e.targetCenter)||e.sourceResolution!==e.targetResolution||e.sourceRotation!==e.targetRotation)}function ii(e,t,n,r,i){let a=Math.cos(-i),o=Math.sin(-i),s=e[0]*a-e[1]*o,c=e[1]*a+e[0]*o;return s+=(t[0]/2-n[0])*r,c+=(n[1]-t[1]/2)*r,o=-o,[s*a-c*o,c*a+s*o]}var ai=class extends wt{constructor(e){let t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(B.SOURCE,this.handleSourcePropertyChange_);let n=e.source?e.source:null;this.setSource(n)}getLayersArray(e){return e||=[],e.push(this),e}getLayerStatesArray(e){return e||=[],e.push(this.getLayerState()),e}getSource(){return this.get(B.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){let e=this.getSource();return e?e.getState():`undefined`}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.get
1Source().getState()!==`ready`)&&(this.sourceReady_=!0,this.dispatchEvent(`sourceready`))}handleSourcePropertyChange_(){this.sourceChangeKey_&&=(S(this.sourceChangeKey_),null),this.sourceReady_=!1;let e=this.getSource();e&&(this.sourceChangeKey_=b(e,y.CHANGE,this.handleSourceChange_,this),e.getState()===`ready`&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent(`sourceready`)},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let t;t=e instanceof Qr?{viewState:e.getState(),extent:e.calculateExtent()}:e;let n=this.getExtent();return this.getVisible()&&oi(this.getLayerState(),t.viewState)&&(!n||Ye(n,t.extent))}getAttributions(e){if(!this.isVisible(e))return[];let t,n=this.getSource();if(n&&(t=n.getAttributions()),!t)return[];let r=e instanceof Qr?e.getViewStateAndExtent():e,i=t(r);return Array.isArray(i)||(i=[i]),i}render(e,t){let n=this.getRenderer();if(n.prepareFrame(e))return this.rendered=!0,n.renderFrame(e,t)}unrender(){this.rendered=!1}setMapInternal(e){e||this.unrender(),this.set(B.MAP,e)}getMapInternal(){return this.get(B.MAP)}setMap(e){this.mapPrecomposeKey_&&=(S(this.mapPrecomposeKey_),null),e||this.changed(),this.mapRenderKey_&&=(S(this.mapRenderKey_),null),e&&(this.mapPrecomposeKey_=b(e,Tt.PRECOMPOSE,function(e){let t=e.frameState.layerStatesArray,n=this.getLayerState(!1);F(!t.some(function(e){return e.layer===n.layer}),67),t.push(n)},this),this.mapRenderKey_=b(this,y.CHANGE,e.render,e),this.changed())}setSource(e){this.set(B.SOURCE,e)}getRenderer(){return this.renderer_||=this.createRenderer(),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}};function oi(e,t){if(!e.visible)return!1;let n=t.resolution;if(n<e.minResolution||n>=e.maxResolution)return!1;let r=t.zoom;return r>e.minZoom&&r<=e.maxZoom}var si=class extends i{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){T()}calculateMatrices2D(e){let t=e.viewState,n=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;pe(n,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),me(r,n)}forEachFeatureAtCoordinate(e,t,n,r,i,a,o,s){let c,l=t.viewState;function u(e,t,n,r){return i.call(a,t,e?n:null,r)}let d=l.projection,f=en(e.slice(),d),p=[[0,0]];if(d.canWrapX()&&r){let e=R(d.getExtent());p.push([-e,0],[e,0])}let m=t.layerStatesArray,h=m.length,g=[],_=[];for(let r=0;r<p.length;r++)for(let i=h-1;i>=0;--i){let a=m[i],d=a.layer;if(d.hasRenderer()&&oi(a,l)&&o.call(s,d)){let i=d.getRenderer(),o=d.getSource();if(i&&o){let s=o.getWrapX()?f:e,l=u.bind(null,a.managed);_[0]=s[0]+p[r][0],_[1]=s[1]+p[r][1],c=i.forEachFeatureAtCoordinate(_,t,n,l,g)}if(c)return c}}if(g.length===0)return;let v=1/g.length;return g.forEach((e,t)=>e.distanceSq+=t*v),g.sort((e,t)=>e.distanceSq-t.distanceSq),g.some(e=>c=e.callback(e.feature,e.layer,e.geometry)),c}hasFeatureAtCoordinate(e,t,n,r,i,a){return this.forEachFeatureAtCoordinate(e,t,n,r,f,this,i,a)!==void 0}getMap(){return this.map_}renderFrame(e){T()}scheduleExpireIconCache(e){Ct.canExpireCache()&&e.postRenderFunctions.push(ci)}};function ci(e,t){Ct.expire()}var li=class extends n{constructor(e,t,n,r){super(e),this.inversePixelTransform=t,this.frameState=n,this.context=r}},ui=`ol-hidden`,di=`ol-unselectable`,fi=`ol-control`,pi=`ol-collapsed`,mi=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`),hi=[`style`,`variant`,`weight`,`size`,`lineHeight`,`family`],gi=function(e){let t=e.match(mi);if(!t)return null;let n={lineHeight:`normal`,size:`1.2em`,style:`normal`,weight:`normal`,variant:`normal`};for(let e=0,r=hi.length;e<r;++e){let r=t[e+1];r!==void 0&&(n[hi[e]]=r)}return n.families=n.family.split(/,\s?/),n};function _i(e,t,n,r){let i;return i=n&&n.length?n.shift():oe?new OffscreenCanvas(e||300,t||300):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`2d`,r)}function vi(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function yi(e,t){let n=t.parentNode;n&&n.replaceChild(e,t)}function bi(e){return e&&e.parentNode?e.parentNode.removeChild(e):null}function xi(e){for(;e.lastChild;)e.removeChild(e.lastChild)}function Si(e,t){let n=e.childNodes;for(let r=0;;++r){let i=n[r],a=t[r];if(!i&&!a)break;if(i!==a){if(!i){e.appendChild(a);continue}if(!a){e.removeChild(i),--r;continue}e.insertBefore(a,i)}}}var Ci=`10px sans-serif`,wi=`#000`,Ti=`round`,Ei=[],Di=`round`,Oi=`#000`,ki=`center`,Ai=`middle`,ji=[0,0,0,0],Mi=new k,Ni=null,Pi,Fi={},Ii=(function(){let e=[`monospace`,`serif`],t=e.length,n=`wmytzilWMYTZIL@#/&?$%10ï`,r,i;function a(r,a,o){let s=!0;for(let c=0;c<t;++c){let t=e[c];if(i=zi(r+` `+a+` 32px `+t,n),o!=t){let e=zi(r+` `+a+` 32px `+o+`,`+t,n);s&&=e!=i}}return!!s}function o(){let e=!0,t=Mi.getKeys();for(let n=0,r=t.length;n<r;++n){let r=t[n];Mi.get(r)<100&&(a.apply(this,r.split(` 2`))?(g(Fi),Ni=null,Pi=void 0,Mi.set(r,100)):(Mi.set(r,Mi.get(r)+1,!0),e=!1))}e&&(clearInterval(r),r=void 0)}return function(e){let t=gi(e);if(!t)return;let n=t.families;for(let e=0,i=n.length;e<i;++e){let i=n[e],s=t.style+` 3`+t.weight+` 4`+i;Mi.get(s)===void 0&&(Mi.set(s,100,!0),a(t.style,t.weight,i)||(Mi.set(s,0,!0),r===void 0&&(r=setInterval(o,32))))}}})(),Li=(function(){let e;return function(t){let n=Fi[t];if(n==null){if(oe){let e=gi(t),r=Ri(t,`Žg`);n=(isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else e||(e=document.createElement(`div`),e.innerHTML=`M`,e.style.minHeight=`0`,e.style.maxHeight=`none`,e.style.height=`auto`,e.style.padding=`0`,e.style.border=`none`,e.style.position=`absolute`,e.style.display=`block`,e.style.left=`-99999px`),e.style.font=t,document.body.appendChild(e),n=e.offsetHeight,document.body.removeChild(e);Fi[t]=n}return n}})();function Ri(e,t){return Ni||=_i(1,1),e!=Pi&&(Ni.font=e,Pi=Ni.font),Ni.measureText(t)}
4function zi(e,t){return Ri(e,t).width}function Bi(e,t,n){if(t in n)return n[t];let r=t.split(` 5`).reduce((t,n)=>Math.max(t,zi(e,n)),0);return n[t]=r,r}function Vi(e,t){let n=[],r=[],i=[],a=0,o=0,s=0,c=0;for(let l=0,u=t.length;l<=u;l+=2){let d=t[l];if(d===` 6`||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c;continue}let f=t[l+1]||e.font,p=zi(f,d);n.push(p),o+=p;let m=Li(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function Hi(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha*=n),t&&e.setTransform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),Ui(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function Ui(e,t){let n=e.contextInstructions;for(let e=0,r=n.length;e<r;e+=2)Array.isArray(n[e+1])?t[n[e]].apply(t,n[e+1]):t[n[e]]=n[e+1]}var Wi=class extends si{constructor(e){super(e),this.fontChangeListenerKey_=b(Mi,r.PROPERTYCHANGE,e.redrawText.bind(e)),this.element_=document.createElement(`div`);let t=this.element_.style;t.position=`absolute`,t.width=`100%`,t.height=`100%`,t.zIndex=`0`,this.element_.className=di+` ol-layers`;let n=e.getViewport();n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){let n=this.getMap();if(n.hasListener(e)){let r=new li(e,void 0,t);n.dispatchEvent(r)}}disposeInternal(){S(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&=(this.element_.style.display=`none`,!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Tt.PRECOMPOSE,e);let t=e.layerStatesArray.sort(function(e,t){return e.zIndex-t.zIndex}),n=e.viewState;this.children_.length=0;let r=[],i=null;for(let a=0,o=t.length;a<o;++a){let o=t[a];e.layerIndex=a;let s=o.layer,c=s.getSourceState();if(!oi(o,n)||c!=`ready`&&c!=`undefined`){s.unrender();continue}let l=s.render(e,i);l&&(l!==i&&(this.children_.push(l),i=l),`getDeclutter`in s&&r.push(s))}for(let t=r.length-1;t>=0;--t)r[t].renderDeclutter(e);Si(this.element_,this.children_),this.dispatchRenderEvent(Tt.POSTCOMPOSE,e),this.renderedVisible_||=(this.element_.style.display=``,!0),this.scheduleExpireIconCache(e)}},Gi=class extends n{constructor(e,t){super(e),this.layer=t}},Ki={LAYERS:`layers`},qi=class e extends wt{constructor(e){e||={};let t=Object.assign({},e);delete t.layers;let n=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Ki.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new N(n.slice(),{unique:!0}):F(typeof n.getArray==`function`,43):n=new N(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(S),this.layersListenerKeys_.length=0;let e=this.getLayers();this.layersListenerKeys_.push(b(e,j.ADD,this.handleLayersAdd_,this),b(e,j.REMOVE,this.handleLayersRemove_,this));for(let e in this.listenerKeys_)this.listenerKeys_[e].forEach(S);g(this.listenerKeys_);let t=e.getArray();for(let e=0,n=t.length;e<n;e++){let n=t[e];this.registerLayerListeners_(n),this.dispatchEvent(new Gi(`addlayer`,n))}this.changed()}registerLayerListeners_(t){let n=[b(t,r.PROPERTYCHANGE,this.handleLayerChange_,this),b(t,y.CHANGE,this.handleLayerChange_,this)];t instanceof e&&n.push(b(t,`addlayer`,this.handleLayerGroupAdd_,this),b(t,`removelayer`,this.handleLayerGroupRemove_,this)),this.listenerKeys_[D(t)]=n}handleLayerGroupAdd_(e){this.dispatchEvent(new Gi(`addlayer`,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new Gi(`removelayer`,e.layer))}handleLayersAdd_(e){let t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new Gi(`addlayer`,t)),this.changed()}handleLayersRemove_(e){let t=e.element,n=D(t);this.listenerKeys_[n].forEach(S),delete this.listenerKeys_[n],this.dispatchEvent(new Gi(`removelayer`,t)),this.changed()}getLayers(){return this.get(Ki.LAYERS)}setLayers(e){let t=this.getLayers();if(t){let e=t.getArray();for(let t=0,n=e.length;t<n;++t)this.dispatchEvent(new Gi(`removelayer`,e[t]))}this.set(Ki.LAYERS,e)}
6getLayersArray(e){return e=e===void 0?[]:e,this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){let t=e===void 0?[]:e,n=t.length;this.getLayers().forEach(function(e){e.getLayerStatesArray(t)});let r=this.getLayerState(),i=r.zIndex;!e&&r.zIndex===void 0&&(i=0);for(let e=n,a=t.length;e<a;e++){let n=t[e];n.opacity*=r.opacity,n.visible=n.visible&&r.visible,n.maxResolution=Math.min(n.maxResolution,r.maxResolution),n.minResolution=Math.max(n.minResolution,r.minResolution),n.minZoom=Math.max(n.minZoom,r.minZoom),n.maxZoom=Math.min(n.maxZoom,r.maxZoom),r.extent!==void 0&&(n.extent===void 0?n.extent=r.extent:n.extent=Ke(n.extent,r.extent)),n.zIndex===void 0&&(n.zIndex=i)}return t}getSourceState(){return`ready`}},Ji=class extends n{constructor(e,t,n){super(e),this.map=t,this.frameState=n===void 0?null:n}},Yi=class extends Ji{constructor(e,t,n,r,i,a){super(e,t,i),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=r===void 0?!1:r,this.activePointers=a}get pixel(){return this.pixel_||=this.map.getEventPixel(this.originalEvent),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||=this.map.getCoordinateFromPixel(this.pixel),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),`preventDefault`in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),`stopPropagation`in this.originalEvent&&this.originalEvent.stopPropagation()}},U={SINGLECLICK:`singleclick`,CLICK:y.CLICK,DBLCLICK:y.DBLCLICK,POINTERDRAG:`pointerdrag`,POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},Xi={POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},Zi=class extends v{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;let n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=b(n,Xi.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=b(n,Xi.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(y.TOUCHMOVE,this.boundHandleTouchMove_,ce?{passive:!1}:!1)}emulateClick_(e){let t=new Yi(U.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_===void 0?this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;let t=new Yi(U.SINGLECLICK,this.map_,e);this.dispatchEvent(t)},250):(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new Yi(U.DBLCLICK,this.map_,e),this.dispatchEvent(t))}updateActivePointers_(e){let t=e,n=t.pointerId;if(t.type==U.POINTERUP||t.type==U.POINTERCANCEL){delete this.trackedTouches_[n];for(let e in this.trackedTouches_)if(this.trackedTouches_[e].target!==t.target){delete this.trackedTouches_[e];break}}else (t.type==U.POINTERDOWN||t.type==U.POINTERMOVE)&&(this.trackedTouches_[n]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);let t=new Yi(U.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(S),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);let t=new Yi(U.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(t),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){let e=this.map_.getOwnerDocument();this.dragListenerKeys_.push(b(e,U.POINTERMOVE,this.handlePointerMove_,this),b(e,U.POINTERUP,this.handlePointerUp_,this),b(this.element_,U.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==e&&this.dragListenerKeys_.push(b(this.element_.getRootNode(),U.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;let t=new Yi(U.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;let t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new Yi(U.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){let t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!=`boolean`||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&=(S(this.relayedListenerKey_),null),this.element_.removeEventListener(y.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&=(S(this.pointerdownListenerKey_),null),this.dragListenerKeys_.forEach(S),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},Qi={POSTRENDER:`postrender`,MOVESTART:`movestart`,MOVEEND:`moveend`,LOADSTART:`loadstart`,LOADEND:`loadend`},$i={LAYERGROUP:`layergroup`,SIZE:`size`,TARGET:`target`,VIEW:`view`},ea=1/0,ta=class{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,g(this.queuedElements_)}dequeue(){let e=this.elements_,t=this.priorities_,n=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));let r=this.keyFunction_(n);return delete this.queuedElements_[r],n}enqueue(e){F(!(this.keyFunction_(e)in this.queuedElements_),31);let t=this.priorityFunction_(e);
6return t==1/0?!1:(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){let t=this.elements_,n=this.priorities_,r=t.length,i=t[e],a=n[e],o=e;for(;e<r>>1;){let i=this.getLeftChildIndex_(e),a=this.getRightChildIndex_(e),o=a<r&&n[a]<n[i]?a:i;t[e]=t[o],n[e]=n[o],e=o}t[e]=i,n[e]=a,this.siftDown_(o,e)}siftDown_(e,t){let n=this.elements_,r=this.priorities_,i=n[t],a=r[t];for(;t>e;){let e=this.getParentIndex_(t);if(r[e]>a)n[t]=n[e],r[t]=r[e],t=e;else break}n[t]=i,r[t]=a}reprioritize(){let e=this.priorityFunction_,t=this.elements_,n=this.priorities_,r=0,i=t.length,a,o,s;for(o=0;o<i;++o)a=t[o],s=e(a),s==1/0?delete this.queuedElements_[this.keyFunction_(a)]:(n[r]=s,t[r++]=a);t.length=r,n.length=r,this.heapify_()}},W={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},na=class extends ta{constructor(e,t){super(function(t){return e.apply(null,t)},function(e){return e[0].getKey()}),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){let t=super.enqueue(e);return t&&e[0].addEventListener(y.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){let t=e.target,n=t.getState();if(n===W.LOADED||n===W.ERROR||n===W.EMPTY){n!==W.ERROR&&t.removeEventListener(y.CHANGE,this.boundHandleTileChange_);let e=t.getKey();e in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[e],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let n=0,r,i,a;for(;this.tilesLoading_<e&&n<t&&this.getCount()>0;)i=this.dequeue()[0],a=i.getKey(),r=i.getState(),r===W.IDLE&&!(a in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[a]=!0,++this.tilesLoading_,++n,i.load())}};function ra(e,t,n,r,i){if(!e||!(n in e.wantedTiles)||!e.wantedTiles[n][t.getKey()])return ea;let a=e.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}var ia=class extends k{constructor(e){super();let t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents=`auto`),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){bi(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&bi(this.element);for(let e=0,t=this.listenerKeys.length;e<t;++e)S(this.listenerKeys[e]);this.listenerKeys.length=0,this.map_=e,e&&((this.target_?this.target_:e.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==m&&this.listenerKeys.push(b(e,Qi.POSTRENDER,this.render,this)),e.render())}render(e){}setTarget(e){this.target_=typeof e==`string`?document.getElementById(e):e}},aa=class extends ia{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target}),this.ulElement_=document.createElement(`ul`),this.collapsed_=e.collapsed===void 0?!0:e.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible===void 0?!0:e.collapsible,this.collapsible_||(this.collapsed_=!1);let t=e.className===void 0?`ol-attribution`:e.className,n=e.tipLabel===void 0?`Attributions`:e.tipLabel,r=e.expandClassName===void 0?t+`-expand`:e.expandClassName,i=e.collapseLabel===void 0?`âº`:e.collapseLabel,a=e.collapseClassName===void 0?t+`-collapse`:e.collapseClassName;typeof i==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=i,this.collapseLabel_.className=a):this.collapseLabel_=i;let o=e.label===void 0?`i`:e.label;typeof o==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=o,this.label_.className=r):this.label_=o;let s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement(`button`),this.toggleButton_.setAttribute(`type`,`button`),this.toggleButton_.setAttribute(`aria-expanded`,String(!this.collapsed_)),this.toggleButton_.title=n,this.toggleButton_.appendChild(s),this.toggleButton_.addEventListener(y.CLICK,this.handleClick_.bind(this),!1);let c=t+` `+di+` `+fi+(this.collapsed_&&this.collapsible_?` `+pi:``)+(this.collapsible_?``:` ol-uncollapsible`),l=this.element;l.className=c,l.appendChild(this.toggleButton_),l.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){let t=Array.from(new Set(this.getMap().getAllLayers().flatMap(t=>t.getAttributions(e)))),n=!this.getMap().getAllLayers().some(e=>e.getSource()&&e.getSource().getAttributionsCollapsible()===!1);return this.overrideCollapsible_||this.setCollapsible(n),t}updateElement_(e){if(!e){this.renderedVisible_&&=(this.element.style.display=`none`,!1);return}let t=this.collectSourceAttributions_(e),n=t.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?``:`none`,this.renderedVisible_=n),!u(t,this.renderedAttributions_)){xi(this.ulElement_);for(let e=0,n=t.length;e<n;++e){let n=document.createElement(`li`);n.innerHTML=t[e],this.ulElement_.appendChild(n)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(pi),this.collapsed_?yi(this.collapseLabel_,this.label_):yi(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute(`aria-expanded`,String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle(`ol-uncollapsible`),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}},oa=class extends ia{constructor(e){e||={},super({element:document.createElement(`div`),render:e.render,target:e.target});let t=e.className===void 0?`ol-rotate`:e.className,n=e.label===void 0?`â§`:e.label,r=e.compassClassName===void 0?`ol-compass`:e.compassClassName;this.label_=null,typeof n==`string`?(this.label_=document.createElement(`span`),this.label_.className=r,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(r));let i=e.tipLabel?e.tipLabel:`Reset rotation`,a=document.createElement(`button`);a.className=t+`-reset`,a.setAttribute(`type`,`button`),a.title=i,a.appendChild(this.label_),a.addEventListener(y.CLICK,this.handleClick_.bind(this),!1);let o=t+` `+di+` `+fi,s=this.element;s.className=o,s.appendChild(a),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration===void 0?250:e.duration,this.autoHide_=e.autoHide===void 0?!0:e.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(ui)}handleClick_(e){e.preventDefault(),this.callResetNorth_===void 0?this.resetNorth_():this.callResetNorth_()}resetNorth_(){let e=this.getMap().getView();if(!e)return;let t=e.getRotation();t!==void 0&&(this.duration_>0&&t%(2*Math.PI)!=0?e.animate({rotation:0,duration:this.duration_,easing:Kn}):e.setRotation(0))}render(e){let t=e.frameState;if(!t)return;let n=t.viewState.rotation;if(n!=this.rotation_){let e=`rotate(`+n+`rad)`;if(this.autoHide_){let e=this.element.classList.contains(ui);!e&&n===0?this.element.classList.add(ui):e&&n!==0&&this.element.classList.remove(ui)}this.label_.style.transform=e}this.rotation_=n}},sa=class extends ia{constructor(e){e||={},super({element:document.createElement(`div`),target:e.target});let t=e.className===void 0?`ol-zoom`:e.className,n=e.delta===void 0?1:e.delta,r=e.zoomInClassName===void 0?t+`-in`
6:e.zoomInClassName,i=e.zoomOutClassName===void 0?t+`-out`:e.zoomOutClassName,a=e.zoomInLabel===void 0?`+`:e.zoomInLabel,o=e.zoomOutLabel===void 0?`â`:e.zoomOutLabel,s=e.zoomInTipLabel===void 0?`Zoom in`:e.zoomInTipLabel,c=e.zoomOutTipLabel===void 0?`Zoom out`:e.zoomOutTipLabel,l=document.createElement(`button`);l.className=r,l.setAttribute(`type`,`button`),l.title=s,l.appendChild(typeof a==`string`?document.createTextNode(a):a),l.addEventListener(y.CLICK,this.handleClick_.bind(this,n),!1);let u=document.createElement(`button`);u.className=i,u.setAttribute(`type`,`button`),u.title=c,u.appendChild(typeof o==`string`?document.createTextNode(o):o),u.addEventListener(y.CLICK,this.handleClick_.bind(this,-n),!1);let d=t+` `+di+` `+fi,f=this.element;f.className=d,f.appendChild(l),f.appendChild(u),this.duration_=e.duration===void 0?250:e.duration}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){let t=this.getMap().getView();if(!t)return;let n=t.getZoom();if(n!==void 0){let r=t.getConstrainedZoom(n+e);this.duration_>0?(t.getAnimating()&&t.cancelAnimations(),t.animate({zoom:r,duration:this.duration_,easing:Kn})):t.setZoom(r)}}};function ca(e){e||={};let t=new N;return(e.zoom===void 0||e.zoom)&&t.push(new sa(e.zoomOptions)),(e.rotate===void 0||e.rotate)&&t.push(new oa(e.rotateOptions)),(e.attribution===void 0||e.attribution)&&t.push(new aa(e.attributionOptions)),t}var la={ACTIVE:`active`},ua=class extends k{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(la.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(la.ACTIVE,e)}setMap(e){this.map_=e}};function da(e,t,n){let r=e.getCenterInternal();if(r){let i=[r[0]+t[0],r[1]+t[1]];e.animateInternal({duration:n===void 0?250:n,easing:Jn,center:e.getConstrainedCenter(i)})}}function fa(e,t,n,r){let i=e.getZoom();if(i===void 0)return;let a=e.getConstrainedZoom(i+t),o=e.getResolutionForZoom(a);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:o,anchor:n,duration:r===void 0?250:r,easing:Kn})}var pa=class extends ua{constructor(e){super(),e||={},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?250:e.duration}handleEvent(e){let t=!1;if(e.type==U.DBLCLICK){let n=e.originalEvent,r=e.map,i=e.coordinate,a=n.shiftKey?-this.delta_:this.delta_;fa(r.getView(),a,i,this.duration_),n.preventDefault(),t=!0}return!t}},ma=class extends ua{constructor(e){e||={},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==U.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==U.POINTERUP){let t=this.handleUpEvent(e);this.handlingDownUpSequence=t&&this.targetPointers.length>0}}else if(e.type==U.POINTERDOWN){let n=this.handleDownEvent(e);this.handlingDownUpSequence=n,t=this.stopDown(n)}else e.type==U.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}};function ha(e){let t=e.length,n=0,r=0;for(let i=0;i<t;i++)n+=e[i].clientX,r+=e[i].clientY;return{clientX:n/t,clientY:r/t}}function ga(e){let t=arguments;return function(e){let n=!0;for(let r=0,i=t.length;r<i&&(n&&=t[r](e),n);++r);return n}}var _a=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},va=function(e){let t=e.map.getTargetElement(),n=e.map.getOwnerDocument().activeElement;return t.contains(n)},ya=function(e){return e.map.getTargetElement().hasAttribute(`tabindex`)?va(e):!0},ba=f,xa=function(e){let t=e.originalEvent;return t.button==0&&!(re&&ie&&t.ctrlKey)},Sa=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Ca=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},wa=function(e){let t=e.originalEvent,n=t.target.tagName;return n!==`INPUT`&&n!==`SELECT`&&n!==`TEXTAREA`&&!t.target.isContentEditable},Ta=function(e){let t=e.originalEvent;return F(t!==void 0,56),t.pointerType==`mouse`},Ea=function(e){let t=e.originalEvent;return F(t!==void 0,56),t.isPrimary&&t.button===0},Da=class extends ma{constructor(e){super({stopDown:p}),e||={},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;let t=e.condition?e.condition:ga(Sa,Ea);this.condition_=e.onFocusOnly?ga(ya,t):t,this.noKinetic_=!1}handleDragEvent(e){let t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());let n=this.targetPointers,r=t.getEventPixel(ha(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){let t=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],n=e.map.getView();$t(t,n.getResolution()),Qt(t,n.getRotation()),n.adjustCenterInternal(t)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=n.length,e.originalEvent.preventDefault()}handleUpEvent(e){let t=e.map,n=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){let e=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),i=n.getCenterInternal(),a=t.getPixelFromCo
6ordinateInternal(i),o=t.getCoordinateFromPixelInternal([a[0]-e*Math.cos(r),a[1]-e*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(o),duration:500,easing:Kn})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){let t=e.map.getView();return this.lastCentroid=null,t.getAnimating()&&t.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},Oa=class extends ma{constructor(e){e||={},super({stopDown:p}),this.condition_=e.condition?e.condition:_a,this.lastAngle_=void 0,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){if(!Ta(e))return;let t=e.map,n=t.getView();if(n.getConstraints().rotation===Vn)return;let r=t.getSize(),i=e.pixel,a=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(this.lastAngle_!==void 0){let e=a-this.lastAngle_;n.adjustRotationInternal(-e)}this.lastAngle_=a}handleUpEvent(e){return Ta(e)?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){return Ta(e)&&xa(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}},ka=class extends i{constructor(e){super(),this.geometry_=null,this.element_=document.createElement(`div`),this.element_.style.position=`absolute`,this.element_.style.pointerEvents=`auto`,this.element_.className=`ol-box `+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){let e=this.startPixel_,t=this.endPixel_,n=this.element_.style;n.left=Math.min(e[0],t[0])+`px`,n.top=Math.min(e[1],t[1])+`px`,n.width=Math.abs(t[0]-e[0])+`px`,n.height=Math.abs(t[1]-e[1])+`px`}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left=`inherit`,e.top=`inherit`,e.width=`inherit`,e.height=`inherit`}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){let e=this.startPixel_,t=this.endPixel_,n=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Jr([n])}getGeometry(){return this.geometry_}},Aa={BOXSTART:`boxstart`,BOXDRAG:`boxdrag`,BOXEND:`boxend`,BOXCANCEL:`boxcancel`},ja=class extends n{constructor(e,t,n){super(e),this.coordinate=t,this.mapBrowserEvent=n}},Ma=class extends ma{constructor(e){super(),this.on,this.once,this.un,e||={},this.box_=new ka(e.className||`ol-dragbox`),this.minArea_=e.minArea===void 0?64:e.minArea,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition?e.condition:xa,this.boxEndCondition_=e.boxEndCondition?e.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,n){let r=n[0]-t[0],i=n[1]-t[1];return r*r+i*i>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new ja(Aa.BOXDRAG,e.coordinate,e))}handleUpEvent(e){this.box_.setMap(null);let t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new ja(t?Aa.BOXEND:Aa.BOXCANCEL,e.coordinate,e)),!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new ja(Aa.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}},Na=class extends Ma{constructor(e){e||={};let t=e.condition?e.condition:Ca;super({condition:t,className:e.className||`ol-dragzoom`,minArea:e.minArea}),this.duration_=e.duration===void 0?200:e.duration,this.out_=e.out===void 0?!1:e.out}onBoxEnd(e){let t=this.getMap().getView(),n=this.getGeometry();if(this.out_){let e=t.rotatedExtentForGeometry(n),r=t.getResolutionForExtentInternal(e),i=t.getResolution()/r;n=n.clone(),n.scale(i*i)}t.fitInternal(n,{duration:this.duration_,easing:Kn})}},Pa={LEFT:37,UP:38,RIGHT:39,DOWN:40},Fa=class extends ua{constructor(e){super(),e||={},this.defaultCondition_=function(e){return Sa(e)&&wa(e)},this.condition_=e.condition===void 0?this.defaultCondition_:e.condition,this.duration_=e.duration===void 0?100:e.duration,this.pixelDelta_=e.pixelDelta===void 0?128:e.pixelDelta}handleEvent(e){let t=!1;if(e.type==y.KEYDOWN){let n=e.originalEvent,r=n.keyCode;if(this.condition_(e)&&(r==Pa.DOWN||r==Pa.LEFT||r==Pa.RIGHT||r==Pa.UP)){let i=e.map.getView(),a=i.getResolution()*this.pixelDelta_,o=0,s=0;r==Pa.DOWN?s=-a:r==Pa.LEFT?o=-a:r==Pa.RIGHT?o=a:s=a;let c=[o,s];Qt(c,i.getRotation()),da(i,c,this.duration_),n.preventDefault(),t=!0}}return!t}},Ia=class extends ua{constructor(e){super(),e||={},this.condition_=e.condition?e.condition:wa,this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?100:e.duration}handleEvent(e){let t=!1;if(e.type==y.KEYDOWN||e.type==y.KEYPRESS){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r===`+`||r===`-`)){let i=e.map,a=r===`+`?this.delta_:-this.delta_;fa(i.getView(),a,void 0,this.duration_),n.preventDefault(),t=!0}}return!t}},La=class{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let n=t-3;for(;n>0&&this.points_[n+2]>e;)n-=3;let r=this.points_[t+2]-this.points_[n+2];if(r<1e3/60)return!1;let i=this.points_[t]-this.points_[n],a=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(a,i),this.initialVelocity_=Math.sqrt(i*i+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},Ra=class extends ua{constructor(e){e||={},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta===void 0?1:e.maxDelta,this.duration_=e.duration===void 0?250:e.duration,this.timeout_=e.timeout===void 0?80:e.timeout,this.useAnchor_=e.useAnchor===void 0?!0:e.useAnchor,this.constrainResolution_=e.constrainResolution===void 0?!1:e.constrainResolution;let t=e.condition?e.condition:ba;this.condition_=e.onFocusOnly?ga(ya,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;let e=this.getMap();e&&e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(e){if(!this.condition_(e)||e.type!==y.WHEEL)return!0;let t=e.map,n=e.originalEvent;
6n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.coordinate);let r;if(e.type==y.WHEEL&&(r=n.deltaY,ne&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(r/=ae),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(r*=40)),r===0)return!1;this.lastDelta_=r;let i=Date.now();this.startTime_===void 0&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?`trackpad`:`wheel`);let a=t.getView();if(this.mode_===`trackpad`&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=r;let o=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,t),o),!1}handleWheelZoom_(e){let t=e.getView();t.getAnimating()&&t.cancelAnimations();let n=-z(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),fa(t,n,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}},za=class extends ma{constructor(e){e||={};let t=e;t.stopDown||=p,super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold===void 0?.3:e.threshold,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){let t=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(this.lastAngle_!==void 0){let e=i-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=e}this.lastAngle_=i;let a=e.map,o=a.getView();o.getConstraints().rotation!==Vn&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(ha(this.targetPointers))),this.rotating_&&(a.render(),o.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}},Ba=class extends ma{constructor(e){e||={};let t=e;t.stopDown||=p,super(t),this.anchor_=null,this.duration_=e.duration===void 0?400:e.duration,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,a=n.clientY-r.clientY,o=Math.sqrt(i*i+a*a);this.lastDistance_!==void 0&&(t=this.lastDistance_/o),this.lastDistance_=o;let s=e.map,c=s.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel(ha(this.targetPointers))),s.render(),c.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}};function Va(e){e||={};let t=new N,n=new La(-.005,.05,100);return(e.altShiftDragRotate===void 0||e.altShiftDragRotate)&&t.push(new Oa),(e.doubleClickZoom===void 0||e.doubleClickZoom)&&t.push(new pa({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan===void 0||e.dragPan)&&t.push(new Da({onFocusOnly:e.onFocusOnly,kinetic:n})),(e.pinchRotate===void 0||e.pinchRotate)&&t.push(new za),(e.pinchZoom===void 0||e.pinchZoom)&&t.push(new Ba({duration:e.zoomDuration})),(e.keyboard===void 0||e.keyboard)&&(t.push(new Fa),t.push(new Ia({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom===void 0||e.mouseWheelZoom)&&t.push(new Ra({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom===void 0||e.shiftDragZoom)&&t.push(new Na({duration:e.zoomDuration})),t}function Ha(e){return e[0]>0&&e[1]>0}function Ua(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function Wa(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}
6function Ga(e){if(e instanceof ai){e.setMapInternal(null);return}e instanceof qi&&e.getLayers().forEach(Ga)}function Ka(e,t){if(e instanceof ai){e.setMapInternal(t);return}if(e instanceof qi){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e)Ka(n[e],t)}}var qa=class extends k{constructor(e){super(),e||={},this.on,this.once,this.un;let t=Ja(e);this.renderComplete_,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading===void 0?16:e.maxTilesLoading,this.pixelRatio_=e.pixelRatio===void 0?ae:e.pixelRatio,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=le(),this.pixelToCoordinateTransform_=le(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement(`div`),this.viewport_.className=`ol-viewport`+(`ontouchstart`in window?` ol-touch`:``),this.viewport_.style.position=`relative`,this.viewport_.style.overflow=`hidden`,this.viewport_.style.width=`100%`,this.viewport_.style.height=`100%`,this.overlayContainer_=document.createElement(`div`),this.overlayContainer_.style.position=`absolute`,this.overlayContainer_.style.zIndex=`0`,this.overlayContainer_.style.width=`100%`,this.overlayContainer_.style.height=`100%`,this.overlayContainer_.style.pointerEvents=`none`,this.overlayContainer_.className=`ol-overlaycontainer`,this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement(`div`),this.overlayContainerStopEvent_.style.position=`absolute`,this.overlayContainerStopEvent_.style.zIndex=`0`,this.overlayContainerStopEvent_.style.width=`100%`,this.overlayContainerStopEvent_.style.height=`100%`,this.overlayContainerStopEvent_.style.pointerEvents=`none`,this.overlayContainerStopEvent_.className=`ol-overlaycontainer-stopevent`,this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=t.controls||ca(),this.interactions=t.interactions||Va({onFocusOnly:!0}),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new na(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener($i.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener($i.VIEW,this.handleViewChanged_),this.addChangeListener($i.SIZE,this.handleSizeChanged_),this.addChangeListener($i.TARGET,this.handleTargetChanged_),this.setProperties(t.values);let n=this;e.view&&!(e.view instanceof Qr)&&e.view.then(function(e){n.setVie
6w(new Qr(e))}),this.controls.addEventListener(j.ADD,e=>{e.element.setMap(this)}),this.controls.addEventListener(j.REMOVE,e=>{e.element.setMap(null)}),this.interactions.addEventListener(j.ADD,e=>{e.element.setMap(this)}),this.interactions.addEventListener(j.REMOVE,e=>{e.element.setMap(null)}),this.overlays_.addEventListener(j.ADD,e=>{this.addOverlayInternal_(e.element)}),this.overlays_.addEventListener(j.REMOVE,e=>{let t=e.element.getId();t!==void 0&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)}),this.controls.forEach(e=>{e.setMap(this)}),this.interactions.forEach(e=>{e.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){Ka(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){let t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,n){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(e);n=n===void 0?{}:n;let i=n.hitTolerance===void 0?0:n.hitTolerance,a=n.layerFilter===void 0?f:n.layerFilter,o=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,o,t,null,a,null)}getFeaturesAtPixel(e,t){let n=[];return this.forEachFeatureAtPixel(e,function(e){n.push(e)},t),n}getAllLayers(){let e=[];function t(n){n.forEach(function(n){n instanceof qi?t(n.getLayers()):e.push(n)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;let n=this.getCoordinateFromPixelInternal(e);t=t===void 0?{}:t;let r=t.layerFilter===void 0?f:t.layerFilter,i=t.hitTolerance===void 0?0:t.hitTolerance,a=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,a,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){let t=this.viewport_.getBoundingClientRect(),n=this.getSize(),r=t.width/n[0],i=t.height/n[1],a=`changedTouches`in e?e.changedTouches[0]:e;return[(a.clientX-t.left)/r,(a.clientY-t.top)/i]}getTarget(){return this.get($i.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return Dn(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){let t=this.frameState_;return t?I(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){let t=this.overlayIdIndex_[e.toString()];return t===void 0?null:t}getInteractions(){return this.interactions}getLayerGroup(){return this.get($i.LAYERGROUP)}setLayers(e){let t=this.getLayerGroup();if(e instanceof N){t.setLayers(e);return}let n=t.getLayers();n.clear(),n.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t<n;++t){let n=e[t];if(!n.visible)continue;let r=n.layer.getRenderer();if(r&&!r.ready)return!0;let i=n.layer.getSource();if(i&&i.loading)return!0}return!1}getPixelFromCoordinate(e){let t=On(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){let t=this.frameState_;return t?I(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get($i.SIZE)}getView(){return this.get($i.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){let e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,n,r){return ra(this.frameState_,e,t,n,r)}handleBrowserEvent(e,t){t||=e.type;let n=new Yi(t,this,e);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(e){if(!this.frameState_)return;let t=e.originalEvent,n=t.type;if(n===Xi.POINTERDOWN||n===y.WHEEL||n===y.KEYDOWN){let e=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():e,r=t.target;if(this.overlayContainerStopEvent_.contains(r)||!(n===e?e.documentElement:n).contains(r))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){let t=this.getInteractions().getArray().slice();for(let n=t.length-1;n>=0;n--){let r=t[n];if(!(r.getMap()!==this||!r.getActive()||!this.getTargetElement())&&(!r.handleEvent(e)||e.propagationStopped))break}}}handlePostRender(){let e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let n=this.maxTilesLoading_,r=n;if(e){let t=e.viewHints;if(t[V.ANIMATING]||t[V.INTERACTING]){let t=Date.now()-e.time>8;n=t?0:8,r=t?0:2}}t.getTilesLoading()<n&&(t.reprioritize(),t.loadMoreTiles(n,r))}e&&this.renderer_&&!e.animate&&(this.renderComplete_===!0?(this.hasListener(Tt.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Tt.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new Ji(Qi.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new Ji(Qi.LOADSTART,this,e))));let n=this.postRenderFunctions_;for(let t=0,r=n.length;t<r;++t)n[t](this,e);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let e=0,t=this.targetChangeHandlerKeys_.length;e<t;++e)S(this.targetChangeHandlerKeys_[e]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(y.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(y.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,bi(this.viewport_)}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);let e=this.targetElement_.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.unobserve(e.host)}let e=this.getTarget(),t=typeof e==`string`?document.getElementById(e):e;if(this.targetElement_=t,!t)this.renderer_&&=(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),null),this.animationDelayKey_&&=(cancelAnimationFrame(this.animationDelayKey_),void 0);else{t.appendChild(this.viewport_),this.renderer_||=new Wi(this),this.mapBrowserEventHandler_=new Zi(this,this.moveTolerance_);for(let e in U)this.mapBrowserEventHandler_.addEventListener(U[e],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(y.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(y.WHEEL,this.boundHandleBrowserEvent_,ce?{passive:!1}:!1);let e=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.targetChangeHandlerKeys_=[b(e,y.KEYDOWN,this.handleBrowserEvent,this),b(e,y.KEYPRESS,this.handleBrowserEvent,this)];let n=t.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.observe(n.host),this.resizeObserver_.observe(t)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&=(S(this.viewPropertyListenerKey_),null),this.viewChangeListenerKey_&&=(S(this.viewChangeListenerKey_),null);let e=this.getView();e&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=b(e,r.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=b(e,y.CHANGE,this.handleViewPropertyChanged_,this),e.resolve
6Constraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&=(this.layerGroupPropertyListenerKeys_.forEach(S),null);let e=this.getLayerGroup();e&&(this.handleLayerAdd_(new Gi(`addlayer`,e)),this.layerGroupPropertyListenerKeys_=[b(e,r.PROPERTYCHANGE,this.render,this),b(e,y.CHANGE,this.render,this),b(e,`addlayer`,this.handleLayerAdd_,this),b(e,`removelayer`,this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){let e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t<n;++t){let n=e[t].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){Ga(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){let t=this.getSize(),n=this.getView(),r=this.frameState_,i=null;if(t!==void 0&&Ha(t)&&n&&n.isDef()){let r=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(i={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:Ue(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:r,wantedTiles:{},mapId:D(this),renderTargets:{}},a.nextCenter&&a.nextResolution){let e=isNaN(a.nextRotation)?a.rotation:a.nextRotation;i.nextExtent=Ue(a.nextCenter,a.nextResolution,e,t)}}this.frameState_=i,this.renderer_.renderFrame(i),i&&(i.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,i.postRenderFunctions),r&&(!this.previousExtent_||!Xe(this.previousExtent_)&&!Me(i.extent,this.previousExtent_))&&(this.dispatchEvent(new Ji(Qi.MOVESTART,this,r)),this.previousExtent_=ke(this.previousExtent_)),this.previousExtent_&&!i.viewHints[V.ANIMATING]&&!i.viewHints[V.INTERACTING]&&!Me(i.extent,this.previousExtent_)&&(this.dispatchEvent(new Ji(Qi.MOVEEND,this,i)),xe(i.extent,this.previousExtent_))),this.dispatchEvent(new Ji(Qi.POSTRENDER,this,i)),this.renderComplete_=this.hasListener(Qi.LOADSTART)||this.hasListener(Qi.LOADEND)||this.hasListener(Tt.RENDERCOMPLETE)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0)}setLayerGroup(e){let t=this.getLayerGroup();t&&this.handleLayerRemove_(new Gi(`removelayer`,t)),this.set($i.LAYERGROUP,e)}setSize(e){this.set($i.SIZE,e)}setTarget(e){this.set($i.TARGET,e)}setView(e){if(!e||e instanceof Qr){this.set($i.VIEW,e);return}this.set($i.VIEW,new Qr);let t=this;e.then(function(e){t.setView(new Qr(e))})}updateSize(){let e=this.getTargetElement(),t;if(e){let n=getComputedStyle(e),r=e.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),i=e.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);!isNaN(r)&&!isNaN(i)&&(t=[r,i],!Ha(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&sn(`No map visible because the map container's width or height are 0.`))}let n=this.getSize();t&&(!n||!u(t,n))&&(this.setSize(t),this.updateViewportSize_())}updateViewportSize_(){let e=this.getView();if(e){let t,n=getComputedStyle(this.viewport_);n.width&&n.height&&(t=[parseInt(n.width,10),parseInt(n.height,10)]),e.setViewportSize(t)}}};function Ja(e){let t=null;e.keyboardEventTarget!==void 0&&(t=typeof e.keyboardEventTarget==`string`?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);let n={},r=e.layers&&typeof e.layers.getLayers==`function`?e.layers:new qi({layers:e.layers});n[$i.LAYERGROUP]=r,n[$i.TARGET]=e.target,n[$i.VIEW]=e.view instanceof Qr?e.view:new Qr;let i;e.controls!==void 0&&(Array.isArray(e.controls)?i=new N(e.controls.slice()):(F(typeof e.controls.getArray==`function`,47),i=e.controls));let a;e.interactions!==void 0&&(Array.isArray(e.interactions)?a=new N(e.interactions.slice()):(F(typeof e.interactions.getArray==`function`,48),a=e.interactions));let o;return e.overlays===void 0?o=new N:Array.isArray(e.overlays)?o=new N(e.overlays.slice()):(F(typeof e.overlays.getArray==`function`,49),o=e.overlays),{controls:i,interactions:a,keyboardEventTarget:t,overlays:o,values:n}}var Ya=class e extends k{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_=`geometry`,this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if(typeof e.getSimplifiedGeometry==`function`){let t=e;this.setGeometry(t)}else{let t=e;this.setProperties(t)}}clone(){let t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());let n=this.getGeometry();n&&t.setGeometry(n.clone());let r=this.getStyle();return r&&t.setStyle(r),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&=(S(this.geometryChangeKey_),null);let e=this.getGeometry();e&&(this.geometryChangeKey_=b(e,y.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?Xa(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}};function Xa(e){if(typeof e==`function`)return e;let t;return Array.isArray(e)?t=e:(F(typeof e.getZIndex==`function`,41),t=[e]),function(){return t}}var G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4},Za=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=Wa(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return T()}getImage(e){return T()}getHitDetectionImage(){return T()}getPixelRatio(e){return 1}getImageState(){return T()}getImageSize(){return T()}getOrigin(){return T()}getSize(){return T()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Wa(e)}listenImageChange(e){T()}load(){T()}unlistenImageChange(e){T()}};function Qa(e){return Array.isArray(e)?bt(e):e}var $a=class e extends Za{constructor(e){let t=e.rotateWithView===void 0?!1:e.rotateWithView;super({opacity:1,rotateWithView:t,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius_=e.radiu
6s===void 0?e.radius1:e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_=null,this.renderOptions_=null,this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_;if(!e)return null;let t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(e){let t=this.canvas_[e];if(!t){let n=this.renderOptions_,r=_i(n.size*e,n.size*e);this.draw_(n,r,e),t=r.canvas,this.canvas_[e]=t}return t}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return G.LOADED}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius_,i=this.radius2_===void 0?r:this.radius2_;if(r<i){let e=r;r=i,i=e}let a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,s=i*Math.sin(o),c=Math.sqrt(i*i-s*s),l=r-c,u=Math.sqrt(s*s+l*l),d=u/s;if(e===`miter`&&d<=n)return d*t;let f=t/2/d,p=t/2*(l/u),m=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e===`bevel`)return m*2;let h=r*Math.sin(o),g=Math.sqrt(r*r-h*h),_=i-g,v=Math.sqrt(h*h+_*_)/h;if(v<=n){let e=v*t/2-i-r;return 2*Math.max(m,e)}return m*2}createRenderOptions(){let e=Di,t=0,n=null,r=0,i,a=0;this.stroke_&&(i=this.stroke_.getColor(),i===null&&(i=Oi),i=Qa(i),a=this.stroke_.getWidth(),a===void 0&&(a=1),n=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),e=this.stroke_.getLineJoin(),e===void 0&&(e=Di),t=this.stroke_.getMiterLimit(),t===void 0&&(t=10));let o=this.calculateLineJoinSize_(e,a,t),s=Math.max(this.radius_,this.radius2_||0),c=Math.ceil(2*s+o);return{strokeStyle:i,strokeWidth:a,size:c,lineDash:n,lineDashOffset:r,lineJoin:e,miterLimit:t}}render(){this.renderOptions_=this.createRenderOptions();let e=this.renderOptions_.size;this.canvas_={},this.size_=[e,e]}draw_(e,t,n){if(t.scale(n,n),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let e=this.fill_.getColor();e===null&&(e=wi),t.fillStyle=Qa(e),t.fill()}this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){if(this.fill_){let t=this.fill_.getColor(),n=0;if(typeof t==`string`&&(t=_t(t)),t===null?n=1:Array.isArray(t)&&(n=t.length===4?t[3]:1),n===0){let t=_i(e.size,e.size);this.hitDetectionCanvas_=t.canvas,this.drawHitDetectionCanvas_(e,t)}}this.hitDetectionCanvas_||=this.getImage(1)}createPath_(e){let t=this.points_,n=this.radius_;if(t===1/0)e.arc(0,0,n,0,2*Math.PI);else{let r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(t*=2);let i=this.angle_-Math.PI/2,a=2*Math.PI/t;for(let o=0;o<t;o++){let t=i+o*a,s=o%2==0?n:r;e.lineTo(s*Math.cos(t),s*Math.sin(t))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=wi,t.fill(),this.stroke_&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}},eo=class e extends $a{constructor(e){e||={radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale===void 0?1:e.scale,rotation:e.rotation===void 0?0:e.rotation,rotateWithView:e.rotateWithView===void 0?!1:e.rotateWithView,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode})}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.get
6Stroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}setRadius(e){this.radius_=e,this.render()}},to=class e{constructor(e){e||={},this.color_=e.color===void 0?null:e.color}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(e){this.color_=e}};function no(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[x(r,y.LOAD,function(){o=!0,a||t()})];return r.src&&se?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())})):s.push(x(r,y.ERROR,n)),function(){i=!1,s.forEach(S)}}var ro=null,io=class extends v{constructor(e,t,n,r,i,a){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=r,this.canvas_={},this.color_=a,this.unlisten_=null,this.imageState_=i,this.size_=n,this.src_=t,this.tainted_}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===G.LOADED){ro||=_i(1,1,void 0,{willReadFrequently:!0}),ro.drawImage(this.image_,0,0);try{ro.getImageData(0,0,1,1),this.tainted_=!1}catch{ro=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(y.CHANGE)}handleImageError_(){this.imageState_=G.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=G.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_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){let e=this.size_[0],t=this.size_[1],n=_i(e,t);n.fillRect(0,0,e,t),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===G.IDLE){this.image_||this.initializeImage_(),this.imageState_=G.LOADING;try{this.image_.src=this.src_}catch{this.handleImageError_()}this.unlisten_=no(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==G.LOADED)return;let t=this.image_,n=document.createElement(`canvas`);n.width=Math.ceil(t.width*e),n.height=Math.ceil(t.height*e);let r=n.getContext(`2d`);r.scale(e,e),r.drawImage(t,0,0),r.globalCompositeOperation=`multiply`,r.fillStyle=mt(this.color_),r.fillRect(0,0,n.width/e,n.height/e),r.globalCompositeOperation=`destination-in`,r.drawImage(t,0,0),this.canvas_[e]=n}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}};function ao(e,t,n,r,i,a){let o=Ct.get(t,r,a);return o||(o=new io(e,t,n,r,i,a),Ct.set(t,r,a,o)),o}var oo=class e extends Za{constructor(e){e||={};let t=e.opacity===void 0?1:e.opacity,n=e.rotation===void 0?0:e.rotation,r=e.scale===void 0?1:e.scale,i=e.rotateWithView===void 0?!1:e.rotateWithView;super({opacity:t,rotation:n,scale:r,displacement:e.displacement===void 0?[0,0]:e.displacement,rotateWithView:i,declutterMode:e.declutterMode}),this.anchor_=e.anchor===void 0?[.5,.5]:e.anchor,this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin===void 0?`top-left`:e.anchorOrigin,this.anchorXUnits_=e.anchorXUnits===void 0?`fraction`:e.anchorXUnits,this.anchorYUnits_=e.anchorYUnits===void 0?`fraction`:e.anchorYUnits,this.crossOrigin_=e.crossOrigin===void 0?null:e.crossOrigin;let a=e.img===void 0?null:e.img;this.imgSize_=e.imgSize;let o=e.src;F(!(o!==void 0&&a),4),F(!a||a&&this.imgSize_,5),(o===void 0||o.length===0)&&a&&(o=a.src||D(a)),F(o!==void 0&&o.length>0,6),F(!((e.width!==void 0||e.height!==void 0)&&e.scale!==void 0),69);let s=e.src===void 0?G.LOADED:G.IDLE;if(this.color_=e.color===void 0?null:_t(e.color),this.iconImage_=ao(a,o,this.imgSize_===void 0?null:this.imgSize_,this.crossOrigin_,s,this.color_),this.offset_=e.offset===void 0?[0,0]:e.offset,this.offsetOrigin_=e.offsetOrigin===void 0?`top-left`:e.offsetOrigin,this.origin_=null,this.size_=e.size===void 0?null:e.size,this.width_=e.width,this.height_=e.height,this.width_!==void 0||this.height_!==void 0){let e=this.getImage(1);e.width>0?this.updateScaleFromWidthAndHeight(this.width_,this.height_):e.addEventListener(`load`,()=>{this.updateScaleFromWidthAndHeight(this.width_,this.height_)})}}clone(){let t=this.getScale();return t=Array.isArray(t)?t.slice():t,(this.width_!==void 0||this.height_!==void 0)&&(t=void 0),new e({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:t,size:this.size_===null?void 0:this.size_.slice(),src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode(),width:this.width_,height:this.height_})}updateScaleFromWidthAndHeight(e,t){let n=this.getImage(1);e!==void 0&&t!==void 0?super.setScale([e/n.width,t/n.height]):e===void 0?t===void 0?super.setScale([1,1]):super.setScale([t/n.height,t/n.height]):super.setScale([e/n.width,e/n.width])}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;let t=this.getSize();if(this.anchorXUnits_==`fraction`||this.anchorYUnits_==`fraction`){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==`fraction`&&(e[0]*=t[0]),this.anchorYUnits_==`fraction`&&(e[1]*=t[1])}if(this.anchorOrigin_!=`top-left`){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==`top-right`||this.anchorOrigin_==`bottom-right`)&&(e[0]=-e[0]+t[0]),(this.anchorOrigin_==`bottom-left`||this.anchorOrigin_==`bottom-right`)&&(e[1]=-e[1]+t[1])}this.normalizedAnchor_=e}let t=this.getDisplacement(),n=this.getScaleArray();return[e[0]-t[0]/n[0],e[1]+t[1]/n[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!=`top-left`){let t=this.getSize(),n=this.iconImage_.getSize();if(!t||!n)return null;e=e.slice(),(this.offsetOrigin_==`top-right`||this.offsetOrigin_==`bottom-right`)&&(e[0]=n[0]-t[0]-e[0]),(this.offsetOrigin_==`bottom-left`||this.offsetOrigin_==`bottom-right`)&&(e[1]=n[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){return this.width_}getHeight(){return this.height_}setWidth(e){this.width_=e,this.updateScaleFromWidthAndHeight(e,this.height_)}setHeight(e){this.height_=e,this.updateScaleFromWidthAndHeight(this.width_,e)}setScale(e){super.setScale(e);let t=this.getImage(1);if(t){let n=Array.isArray(e)?e[0]:e;n!==void 0&&(this.width_=n*t.width);let r=Array.isArray(e)?e[1]:e;r!==void 0&&(this.height_=r*t.height)}}listenImageChange(e){this.iconImage_.addEventListener(y.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(y.CHANGE,e)}},so=class e{constructor(e){e||={},this.color_=e.color===void 0?null:e.color,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash===void 0?null:e.lineDash,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}},co=class e{constructor(e){e||={},this.geometry_=null,this.geometryFunction_=po,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill===void 0?null:e.fill,this.image_=e.image===void 0?null:e.image,this.renderer_=e.renderer===void 0?null:e.renderer,this.hitDetectionRenderer_=e.hitDetectionRenderer===void 0?null:e.hitDetectionRenderer,this.stroke_=e.stroke===void 0?null:e.stroke,this.text_=e.text===void 0?null:e.text,this.zIndex_=e.zIndex}clone(){let t=this.getGeometry();return t&&typeof t==`object`&&(t=t.clone()),new e({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.get
6Stroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e==`function`?this.geometryFunction_=e:typeof e==`string`?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=po,this.geometry_=e}setZIndex(e){this.zIndex_=e}};function lo(e){let t;if(typeof e==`function`)t=e;else{let n;Array.isArray(e)?n=e:(F(typeof e.getZIndex==`function`,41),n=[e]),t=function(){return n}}return t}var uo=null;function fo(e,t){if(!uo){let e=new to({color:`rgba(255,255,255,0.4)`}),t=new so({color:`#3399CC`,width:1.25});uo=[new co({image:new eo({fill:e,stroke:t,radius:5}),fill:e,stroke:t})]}return uo}function po(e){return e.getGeometry()}var mo=`#333`,ho=class e{constructor(e){e||={},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=Wa(e.scale===void 0?1:e.scale),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill===void 0?new to({color:mo}):e.fill,this.maxAngle_=e.maxAngle===void 0?Math.PI/4:e.maxAngle,this.placement_=e.placement===void 0?`point`:e.placement,this.overflow_=!!e.overflow,this.stroke_=e.stroke===void 0?null:e.stroke,this.offsetX_=e.offsetX===void 0?0:e.offsetX,this.offsetY_=e.offsetY===void 0?0:e.offsetY,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding}clone(){let t=this.getScale();return new e({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Wa(e===void 0?1:e)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}
6setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}},go=class{constructor(e){this.highWaterMark=e===void 0?2048:e,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){let n=this.entries_[e];return F(n!==void 0,15),n===this.newest_?n.value_:(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n,n.value_)}remove(e){let t=this.entries_[e];return F(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_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.key_;return e}getValues(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){if(this.containsKey(e))return this.entries_[e].value_}pop(){let e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){F(!(e in this.entries_),16);let n={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[e]=n,++this.count_}setSize(e){this.highWaterMark=e}},_o=class extends v{constructor(e,t,n){super(),n||={},this.tileCoord=e,this.state=t,this.interimTile=null,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(y.CHANGE)}release(){this.state===W.ERROR&&this.setState(W.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let e=this.interimTile;do{if(e.getState()==W.LOADED)return this.transition_=0,e;e=e.interimTile}while(e);return this}refreshInterimChain(){if(!this.interimTile)return;let e=this.interimTile,t=this;do{if(e.getState()==W.LOADED){e.interimTile=null;break}else e.getState()==W.LOADING?t=e:e.getState()==W.IDLE?t.interimTile=e.interimTile:t=e;e=t.interimTile}while(e)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==W.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}load(){T()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:Gn(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}},vo=class extends _o{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r,this.src_=n,this.key=n,this.image_=new Image,r!==null&&(this.image_.crossOrigin=r),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=W.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=W.ERROR,this.unlistenImage_(),this.image_=yo(),this.changed()}handleImageLoad_(){let e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=W.LOADED:this.state=W.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==W.ERROR&&(this.state=W.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==W.IDLE&&(this.state=W.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=no(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}};
6function yo(){let e=_i(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var bo=.5,xo=10,So=.25,Co=class{constructor(e,t,n,r,i,a){this.sourceProj_=e,this.targetProj_=t;let o={},s=Sn(this.targetProj_,this.sourceProj_);this.transformInv_=function(e){let t=e[0]+`/`+e[1];return o[t]||(o[t]=s(e)),o[t]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&R(r)==R(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?R(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?R(this.targetProj_.getExtent()):null;let c=qe(n),l=Je(n),u=Be(n),d=ze(n),f=this.transformInv_(c),p=this.transformInv_(l),m=this.transformInv_(u),h=this.transformInv_(d),g=xo+(a?Math.max(0,Math.ceil(Math.log2(Re(n)/(a*a*256*256)))):0);if(this.addQuad_(c,l,u,d,f,p,m,h,g),this.wrapsXInSource_){let e=1/0;this.triangles_.forEach(function(t,n,r){e=Math.min(e,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(t=>{if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-e>this.sourceWorldWidth_/2){let n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-e>this.sourceWorldWidth_/2&&(n[0][0]-=this.sourceWorldWidth_),n[1][0]-e>this.sourceWorldWidth_/2&&(n[1][0]-=this.sourceWorldWidth_),n[2][0]-e>this.sourceWorldWidth_/2&&(n[2][0]-=this.sourceWorldWidth_);let r=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-r<this.sourceWorldWidth_/2&&(t.source=n)}})}o={}}addTriangle_(e,t,n,r,i,a){this.triangles_.push({source:[r,i,a],target:[e,t,n]})}addQuad_(e,t,n,r,i,a,o,s,c){let l=ve([i,a,o,s]),u=this.sourceWorldWidth_?R(l)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&u>.5&&u<1,p=!1;if(c>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=R(ve([e,t,n,r]))/this.targetWorldWidth_>So||p),!f&&this.sourceProj_.isGlobal()&&u&&(p=u>So||p)),!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!Ye(l,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(i[0])||!isFinite(i[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1]))){if(c>0)p=!0;else if(m=(!isFinite(i[0])||!isFinite(i[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+ +(!isFinite(s[0])||!isFinite(s[1])),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){let t=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=this.transformInv_(t),a;a=f?(st(i[0],d)+st(o[0],d))/2-st(r[0],d):(i[0]+o[0])/2-r[0];let s=(i[1]+o[1])/2-r[1];p=a*a+s*s>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){let l=[(t[0]+n[0])/2,(t[1]+n[1])/2],u=this.transformInv_(l),d=[(r[0]+e[0])/2,(r[1]+e[1])/2],f=this.transformInv_(d);this.addQuad_(e,t,l,d,i,a,u,f,c-1),this.addQuad_(d,l,n,r,f,u,o,s,c-1)}else{let l=[(e[0]+t[0])/2,(e[1]+t[1])/2],u=this.transformInv_(l),d=[(n[0]+r[0])/2,(n[1]+r[1])/2],f=this.transformInv_(d);this.addQuad_(e,l,d,r,i,u,f,s,c-1),this.addQuad_(l,t,n,d,u,a,o,f,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,n,r,i,o,s),m&14||this.addTriangle_(e,n,t,i,o,a),m&&(m&13||this.addTriangle_(t,r,e,a,s,i),m&7||this.addTriangle_(t,r,n,a,s,o))}calculateSourceExtent(){let e=De();return this.triangles_.forEach(function(t,n,r){let i=t.source;Pe(e,i[0]),Pe(e,i[1]),Pe(e,i[2])}),e}getTriangles(){return this.triangles_}},wo,To=[];function Eo(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore()}function Do(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function Oo(){if(wo===void 0){let e=_i(6,6,To);e.globalCompositeOperation=`lighter`,e.fillStyle=`rgba(210, 0, 0, 0.75)`,Eo(e,4,5,4,0),Eo(e,4,5,0,5);let t=e.getImageData(0,0,3,3).data;wo=Do(t,0)||Do(t,4)||Do(t,8),vi(e),To.push(e.canvas)}return wo}function ko(e,t,n,r){let i=Cn(n,t,e),a=mn(t,r,n),o=t.getMetersPerUnit();o!==void 0&&(a*=o);let s=e.getMetersPerUnit();s!==void 0&&(a/=s);let c=e.getExtent();if(!c||Ce(c,i)){let t=mn(e,a,i)/a;isFinite(t)&&t>0&&(a/=t)}return a}function Ao(e,t,n,r){let i=ko(e,t,Ve(n),r);return(!isFinite(i)||i<=0)&&Le(n,function(n){return i=ko(e,t,n,r),isFinite(i)&&i>0}),i}function jo(e,t,n,r,i,a,o,s,c,l,u,d){let f=_i(Math.round(n*e),Math.round(n*t),To);if(d||(f.imageSmoothingEnabled=!1),c.length===0)return f.canvas;f.scale(n,n);function p(e){return Math.round(e*n)/n}f.globalCompositeOperation=`lighter`;let m=De();
6c.forEach(function(e,t,n){Ne(m,e.extent)});let h=R(m),g=Ge(m),_=_i(Math.round(n*h/r),Math.round(n*g/r),To);d||(_.imageSmoothingEnabled=!1);let v=n/r;c.forEach(function(e,t,n){let r=e.extent[0]-m[0],i=-(e.extent[3]-m[3]),a=R(e.extent),o=Ge(e.extent);e.image.width>0&&e.image.height>0&&_.drawImage(e.image,l,l,e.image.width-2*l,e.image.height-2*l,r*v,i*v,a*v,o*v)});let y=qe(o);return s.getTriangles().forEach(function(e,t,i){let o=e.source,s=e.target,c=o[0][0],l=o[0][1],u=o[1][0],h=o[1][1],g=o[2][0],v=o[2][1],b=p((s[0][0]-y[0])/a),x=p(-(s[0][1]-y[1])/a),S=p((s[1][0]-y[0])/a),C=p(-(s[1][1]-y[1])/a),w=p((s[2][0]-y[0])/a),T=p(-(s[2][1]-y[1])/a),E=c,D=l;c=0,l=0,u-=E,h-=D,g-=E,v-=D;let O=it([[u,h,0,0,S-b],[g,v,0,0,w-b],[0,0,u,h,C-x],[0,0,g,v,T-x]]);if(O){if(f.save(),f.beginPath(),Oo()||!d){f.moveTo(S,C);let e=b-S,t=x-C;for(let n=0;n<4;n++)f.lineTo(S+p((n+1)*e/4),C+p(n*t/3)),n!=3&&f.lineTo(S+p((n+1)*e/4),C+p((n+1)*t/3));f.lineTo(w,T)}else f.moveTo(S,C),f.lineTo(b,x),f.lineTo(w,T);f.clip(),f.transform(O[0],O[2],O[1],O[3],b,x),f.translate(m[0]-E,m[3]-D),f.scale(r/n,-r/n),f.drawImage(_.canvas,0,0),f.restore()}}),vi(_),To.push(_.canvas),u&&(f.save(),f.globalCompositeOperation=`source-over`,f.strokeStyle=`black`,f.lineWidth=1,s.getTriangles().forEac
6h(function(e,t,n){let r=e.target,i=(r[0][0]-y[0])/a,o=-(r[0][1]-y[1])/a,s=(r[1][0]-y[0])/a,c=-(r[1][1]-y[1])/a,l=(r[2][0]-y[0])/a,u=-(r[2][1]-y[1])/a;f.beginPath(),f.moveTo(s,c),f.lineTo(i,o),f.lineTo(l,u),f.closePath(),f.stroke()}),f.restore()),f.canvas}var Mo=class extends _o{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(i,W.IDLE,{interpolate:!!d}),this.renderEdges_=u===void 0?!1:u,this.pixelRatio_=o,this.gutter_=s,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=a||i,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;let f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),m=this.sourceTileGrid_.getExtent(),h=p?Ke(f,p):f;if(Re(h)===0){this.state=W.EMPTY;return}let g=e.getExtent();g&&(m=m?Ke(m,g):g);let _=r.getResolution(this.wrappedTileCoord_[0]),v=Ao(e,n,h,_);if(!isFinite(v)||v<=0){this.state=W.EMPTY;return}let y=l===void 0?bo:l;if(this.triangulation_=new Co(e,n,h,m,v*y,_),this.triangulation_.getTriangles().length===0){this.state=W.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let b=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(b[1]=z(b[1],m[1],m[3]),b[3]=z(b[3],m[1],m[3])):b=Ke(b,m)),!Re(b))this.state=W.EMPTY;else{let e=t.getTileRangeForExtentAndZ(b,this.sourceZ_);for(let t=e.minX;t<=e.maxX;t++)for(let n=e.minY;n<=e.maxY;n++){let e=c(this.sourceZ_,t,n,o);e&&this.sourceTiles_.push(e)}this.sourceTiles_.length===0&&(this.state=W.EMPTY)}}getImage(){return this.canvas_}reproject_(){let e=[];
6if(this.sourceTiles_.forEach(t=>{t&&t.getState()==W.LOADED&&e.push({extent:this.sourceTileGrid_.getTileCoordExtent(t.tileCoord),image:t.getImage()})}),this.sourceTiles_.length=0,e.length===0)this.state=W.ERROR;else{let t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),r=typeof n==`number`?n:n[0],i=typeof n==`number`?n:n[1],a=this.targetTileGrid_.getResolution(t),o=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=jo(r,i,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,s,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=W.LOADED}this.changed()}load(){if(this.state==W.IDLE){this.state=W.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(t=>{let n=t.getState();if(n==W.IDLE||n==W.LOADING){e++;let n=b(t,y.CHANGE,function(r){let i=t.getState();(i==W.LOADED||i==W.ERROR||i==W.EMPTY)&&(S(n),e--,e===0&&(this.unlistenSources_(),this.reproject_()))},this);this.sourcesListenerKeys_.push(n)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function(e,t,n){e.getState()==W.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(S),this.sourcesListenerKeys_=null}release(){this.canvas_&&=(vi(this.canvas_.getContext(`2d`)),To.push(this.canvas_),null),super.release()}};function No(e,t,n,r){return r===void 0?[e,t,n]:(r[0]=e,r[1]=t,r[2]=n,r)}function Po(e,t,n){return e+`/`+t+`/`+n}function Fo(e){return Po(e[0],e[1],e[2])}function Io(e){return e.split(`/`).map(Number)}function Lo(e){return(e[1]<<e[0])+e[2]}function Ro(e,t){let n=e[0],r=e[1],i=e[2];if(t.getMinZoom()>n||n>t.getMaxZoom())return!1;let a=t.getFullTileRange(n);return a?a.containsXY(r,i):!0}var zo=class extends go{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(e){for(;this.canExpireCache()&&!(this.peekLast().getKey()in e);)this.pop().release()}pruneExceptNewestZ(){if(this.getCount()===0)return;let e=Io(this.peekFirstKey())[0];this.forEach(t=>{t.tileCoord[0]!==e&&(this.remove(Fo(t.tileCoord)),t.release())})}},Bo={TILELOADSTART:`tileloadstart`,TILELOADEND:`tileloadend`,TILELOADERROR:`tileloaderror`},Vo=class extends k{constructor(e){super(),this.projection=H(e.projection),this.attributions_=Ho(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible===void 0?!0:e.attributionsCollapsible,this.loading=!1,this.state_=e.state===void 0?`ready`:e.state,this.wrapX_=e.wrapX===void 0?!1:e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let t=this;this.viewPromise_=new Promise(function(e,n){t.viewResolver=e,t.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=Ho(e),this.changed()}setState(e){this.state_=e,this.changed()}};function Ho(e){return e?Array.isArray(e)?function(t){return e}:typeof e==`function`?e:function(t){return[e]}:null}var Uo=class{constructor(e,t,n,r){this.minX=e,this.maxX=t,this.minY=n,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}
6getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}};function Wo(e,t,n,r,i){return i===void 0?new Uo(e,t,n,r):(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i)}var Go=[0,0,0],Ko=5,qo=class{constructor(e){this.minZoom=e.minZoom===void 0?0:e.minZoom,this.resolutions_=e.resolutions,F(d(this.resolutions_,function(e,t){return t-e},!0),17);let t;if(!e.origins){for(let e=0,n=this.resolutions_.length-1;e<n;++e)if(!t)t=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin===void 0?null:e.origin,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,F(this.origins_.length==this.resolutions_.length,20));let n=e.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=qe(n)),F(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,F(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=e.tileSize===void 0?this.tileSizes_?null:256:e.tileSize,F(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=n===void 0?null:n,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes===void 0?n&&this.calculateTileRanges_(n):this.fullTileRanges_=e.sizes.map(function(e,t){let r=new Uo(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(n){let e=this.getTileRangeForExtentAndZ(n,t);r.minX=Math.max(e.minX,r.minX),r.maxX=Math.min(e.maxX,r.maxX),r.minY=Math.max(e.minY,r.minY),r.maxY=Math.min(e.maxY,r.maxY)}return r},this)}forEachTileCoord(e,t,n){let r=this.getTileRangeForExtentAndZ(e,t);for(let e=r.minX,i=r.maxX;e<=i;++e)for(let i=r.minY,a=r.maxY;i<=a;++i)n([t,e,i])}forEachTileCoordParentTileRange(e,t,n,r){let i,a,o,s=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):s=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(this.zoomFactor_===2?(a=Math.floor(a/2),o=Math.floor(o/2),i=Wo(a,a,o,o,n)):i=this.getTileRangeForExtentAndZ(s,c,n),t(c,i))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,n){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){let n=e[1]*2,r=e[2]*2;return Wo(n,n+1,r,r+1,t)}let r=this.getTileCoordExtent(e,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,n){if(t>this.maxZoom||t<this.minZoom)return null;let r=e[0],i=e[1],a=e[2];if(t===r)return Wo(i,a,i,a,n);if(this.zoomFactor_){let e=this.zoomFactor_**+(t-r),o=Math.floor(i*e),s=Math.floor(a*e);return t<r?Wo(o,o,s,s,n):Wo(o,Math.floor(e*(i+1))-1,s,Math.floor(e*(a+1))-1,n)}let o=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t,n)}getTileRangeExtent(e,t,n){let r=this.getOrigin(e),i=this.getResolution(e),a=Wa(this.getTileSize(e),this.tmpSize_),o=r[0]+t.minX*a[0]*i,s=r[0]+(t.maxX+1)*a[0]*i;return Oe(o,r[1]+t.minY*a[1]*i,s,r[1]+(t.maxY+1)*a[1]*i,n)}getTileRangeForExtentAndZ(e,t,n){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,Go);let r=Go[1],i=Go[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,Go);let a=Go[1],o=Go[2];return Wo(r,a,i,o,n)}getTileCoordCenter(e){let t=this.getOrigin(e[0]),n=this.getResolution(e[0]),r=Wa(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*n,t[1]-(e[2]+.5)*r[1]*n]}getTileCoordExtent(e,t){let n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=Wa(this.getTileSize(e[0]),this.tmpSize_),a=n[0]+e[1]*i[0]*r,o=n[1]-(e[2]+1)*i[1]*r;return Oe(a,o,a+i[0]*r,o+i[1]*r,t)}getTileCoordForCoordAndResolution(e,t,n){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,n)}getTileCoordForXYAndResolution_(e,t,n,r,i){let a=this.getZForResolution(n),o=n/this.getResolution(a),s=this.getOrigin(a),c=Wa(this.getTileSize(a),this.tmpSize_),l=o*(e-s[0])/n/c[0],u=o*(s[1]-t)/n/c[1];return r?(l=dt(l,Ko)-1,u=dt(u,Ko)-1):(l=ut(l,Ko),u=ut(u,Ko)),No(a,l,u,i)}getTileCoordForXYAndZ_(e,t,n,r,i){let a=this.getOrigin(n),o=this.getResolution(n),s=Wa(this.getTileSize(n),this.tmpSize_),c=(e-a[0])/o/s[0],l=(a[1]-t)/o/s[1];
6return r?(c=dt(c,Ko)-1,l=dt(l,Ko)-1):(c=ut(c,Ko),l=ut(l,Ko)),No(n,c,l,i)}getTileCoordForCoordAndZ(e,t,n){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,n)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){return z(s(this.resolutions_,e,t||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return zr(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){let t=this.resolutions_.length,n=Array(t);for(let r=this.minZoom;r<t;++r)n[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=n}};function Jo(e){let t=e.getDefaultTileGrid();return t||(t=$o(e),e.setDefaultTileGrid(t)),t}function Yo(e,t,n){let r=t[0],i=e.getTileCoordCenter(t),a=es(n);if(!Ce(a,i)){let t=R(a),n=Math.ceil((a[0]-i[0])/t);return i[0]+=t*n,e.getTileCoordForCoordAndZ(i,r)}return t}function Xo(e,t,n,r){r=r===void 0?`top-left`:r;let i=Qo(e,t,n);return new qo({extent:e,origin:He(e,r),resolutions:i,tileSize:n})}function Zo(e){let t=e||{},n=t.extent||H(`EPSG:3857`).getExtent();return new qo({extent:n,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:Qo(n,t.maxZoom,t.tileSize,t.maxResolution)})}function Qo(e,t,n,r){t=t===void 0?42:t,n=Wa(n===void 0?256:n);let i=Ge(e),a=R(e);r=r>0?r:Math.max(a/n[0],i/n[1]);let o=t+1,s=Array(o);for(let e=0;e<o;++e)s[e]=r/2**e;return s}function $o(e,t,n,r){return Xo(es(e),t,n,r)}function es(e){e=H(e);let t=e.getExtent();if(!t){let n=180*Dt.degrees/e.getMetersPerUnit();t=Oe(-n,-n,n,n)}return t}var ts=class extends Vo{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.opaque_=e.opaque===void 0?!1:e.opaque,this.tilePixelRatio_=e.tilePixelRatio===void 0?1:e.tilePixelRatio,this.tileGrid=e.tileGrid===void 0?null:e.tileGrid,this.tileGrid&&Wa(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tileCache=new zo(e.cacheSize||0),this.tmpSize=[0,0],this.key_=e.key||``,this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(e,t){let n=this.getTileCacheForProjection(e);n&&n.expireCache(t)}forEachLoadedTile(e,t,n,r){let i=this.getTileCacheForProjection(e);if(!i)return!1;let a=!0,o,s,c;for(let e=n.minX;e<=n.maxX;++e)for(let l=n.minY;l<=n.maxY;++l)s=Po(t,e,l),c=!1,i.containsKey(s)&&(o=i.get(s),c=o.getState()===W.LOADED,c&&=r(o)!==!1),c||(a=!1);return a}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getOpaque(e){return this.opaque_}getResolutions(e){let t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,n,r,i){return T()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:Jo(e)}getTileCacheForProjection(e){let t=this.getProjection();return F(t===null||bn(t,e),68),this.tileCache}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,n){let r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(t),a=Wa(r.getTileSize(e),this.tmpSize);return i==1?a:Ua(a,i,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){t=t===void 0?this.getProjection():t;let n=this.getTileGridForProjection(t);return this.getWrapX()&&t.isGlobal()&&(e=Yo(n,e,t)),Ro(e,n)?e:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(e,t){let n=this.getTileCacheForProjection(t);e>n.highWaterMark&&(n.highWaterMark=e)}useTile(e,t,n,r){}},ns=class extends n{constructor(e,t){super(e),this.tile=t}};function rs(e,t){let n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,a=/\{-y\}/g;return(function(o,s,c){if(o)return e.replace(n,o[0].toString()).replace(r,o[1].toString()).replace(i,o[2].toString()).replace(a,function(){let e=o[0],n=t.getFullTileRange(e);return F(n,55),(n.getHeight()-o[2]-1).toString()})})}function is(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=rs(e[i],t);return as(r)}function as(e){return e.length===1?e[0]:(function(t,n,r){if(t)return e[st(Lo(t),e.length)](t,n,r)})}function os(e){let t=[],n=/\{([a-z])-([a-z])\}/.exec(e);
6if(n){let r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),a;for(a=r;a<=i;++a)t.push(e.replace(n[0],String.fromCharCode(a)));return t}if(n=/\{(\d+)-(\d+)\}/.exec(e),n){let r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)t.push(e.replace(n[0],i.toString()));return t}return t.push(e),t}var ss=class e extends ts{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===e.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){let t=e.target,n=D(t),r=t.getState(),i;r==W.LOADING?(this.tileLoadingKeys_[n]=!0,i=Bo.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==W.ERROR?Bo.TILELOADERROR:r==W.LOADED?Bo.TILELOADEND:void 0),i!=null&&this.dispatchEvent(new ns(i,t))}setTileLoadFunction(e){this.tileCache.clear(),this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,this.tileCache.pruneExceptNewestZ(),t===void 0?this.changed():this.setKey(t)}setUrl(e){let t=os(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;let t=e.join(` 7`);this.generateTileUrlFunction_?this.setTileUrlFunction(is(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}useTile(e,t,n){let r=Po(e,t,n);this.tileCache.containsKey(r)&&this.tileCache.get(r)}},cs=class extends ss{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:ls,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0?!0:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.tileClass=e.tileClass===void 0?vo:e.tileClass,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(let e in this.tileCacheForProjection)if(this.tileCacheForProjection[e].canExpireCache())return!0;return!1}expireCache(e,t){let n=this.getTileCacheForProjection(e);this.tileCache.expireCache(this.tileCache==n?t:{});for(let e in this.tileCacheForProjection){let r=this.tileCacheForProjection[e];r.expireCache(r==n?t:{})}}getGutterForProjection(e){return this.getProjection()&&e&&!bn(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getOpaque(e){return this.getProjection()&&e&&!bn(this.getProjection(),e)?!1:super.getOpaque(e)}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||bn(t,e)))return this.tileGrid;let n=D(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Jo(e)),this.tileGridForProjection[n]}getTileCacheForProjection(e){let t=this.getProjection();if(!t||bn(t,e))return this.tileCache;let n=D(e);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new zo(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?W.EMPTY:W.IDLE,c===void 0?``:c,this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(y.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i){let a=this.getProjection();if(!a||!i||bn(a,i))return this.getTileInternal(e,t,n,r,a||i);let o=this.getTileCacheForProjection(i),s=[e,t,n],c,l=Fo(s);o.containsKey(l)&&(c=o.get(l));let u=this.getKey();if(c&&c.key==u)return c;let d=new Mo(a,this.getTileGridForProjection(a),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i),this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=u,c?(d.interimTile=c,d.refreshInterimChain(),o.replace(l,d)):o.set(l,d),d}getTileInternal(e,t,n,r,i){let a=null,o=Po(e,t,n),s=this.getKey();if(!this.tileCache.containsKey(o))a=this.createTile_(e,t,n,r,i,s),this.tileCache.set(o,a);else if(a=this.tileCache.get(o),a.key!=s){let c=a;a=this.createTile_(e,t,n,r,i,s),c.getState()==W.IDLE?a.interimTile=c.interimTile:a.interimTile=c,a.refreshInterimChain(),this.tileCache.replace(o,a)}return a}setRenderReprojectionEdges(e){if(this.renderReprojectionEdges_!=e){this.renderReprojectionEdges_=e;for(let e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}}setTileGridForProjection(e,t){let n=H(e);if(n){let e=D(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}clear(){super.clear();for(let e in this.tileCacheForProjection)this.tileCacheForProjection[e].clear()}};function ls(e,t){e.getImage().src=t}var us=class extends cs{constructor(e){e||={};let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid===void 0?Zo({extent:es(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize}):e.tileGrid;super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,opaque:e.opaque,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter}getGutter(){return this.gutter_}},ds=e(t(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n||=self).RBush=r()})(e,function(){function e(e,r,i,a,o){(function e(n,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,c=r-i+1,l=Math.log(s),u=.5*Math.exp(2*l/3),d=.5*Math.sqrt(l*u*(s-u)/s)*(c-s/2<0?-1:1);e(n,r,Math.max(i,Math.floor(r-c*u/s+d)),Math.min(a,Math.floor(r+(s-c)*u/s+d)),o)}var f=n[r],p=i,m=a;for(t(n,i,r),o(n[a],f)>0&&t(n,i,a);p<m;){for(t(n,p,m),p++,m--;o(n[p],f)<0;)p++;for(;o(n[m],f)>0;)m--}o(n[i],f)===0?t(n,i,m):t(n,++m,a),m<=r&&(i=m+1),r<=m&&(a=m-1)}})(e,r,i||0,a||e.length-1,o||n)}function t(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function n(e,t){return e<t?-1:+(e>t)}var r=function(e){e===void 0&&(e=9),this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function i(e,t,n){if(!n)return t.indexOf(e);for(var r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function a(e,t){o(e,0,e.children.length,t,e)}function o(e,t,n,r,i){i||=m(null),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=t;a<n;a++){var o=e.children[a];s(i,e.leaf?r(o):o)}return i}function s(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function c(e,t){return e.minX-t.minX}function l(e,t){return e.minY-t.minY}function u(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function d(e){return e.maxX-e.minX+(e.maxY-e.minY)}function f(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function p(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function m(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function h(t,n,r,i,a){for(var o=[n,r];o.length;)if(!((r=o.pop())-(n=o.pop())<=i)){var s=n+Math.ceil((r-n)/i/2)*i;e(t,s,n,r,a),o.push(n,s,s,r)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(e){var t=this.data,n=[];if(!p(e,t))return n;for(var r=this.toBBox,i=[];t;){for(var a=0;a<t.children.length;a++){var o=t.children[a],s=t.leaf?r(o):o;p(e,s)&&(t.leaf?n.push(o):f(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n},r.prototype.collides=function(e){var t=this.data;if(!p(e,t))return!1;for(var n=[];t;){for(var r=0;r<t.children.length;r++){var i=t.children[r],a=t.leaf?this.toBBox(i):i;if(p(e,a)){if(t.leaf||f(e,a))return!0;n.push(i)}}t=n.pop()}return!1},r.prototype.load=function(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(var t=0;t<e.length;t++)this.insert(e[t]);return this}var n=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},r.prototype.insert=function(e){return e&&this._insert(e,this.data.height-1),this},r.prototype.clear=function(){return this.data=m([]),this},r.prototype.remove=function(e,t){if(!e)return this;for(var n,r,a,o=this.data,s=this.toBBox(e),c=[],l=[];o||c.length;){if(o||(o=c.pop(),r=c[c.length-1],n=l.pop(),a=!0),o.leaf){var u=i(e,o.children,t);
7if(u!==-1)return o.children.splice(u,1),c.push(o),this._condense(c),this}a||o.leaf||!f(o,s)?r?(n++,o=r.children[n],a=!1):o=null:(c.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},r.prototype.toBBox=function(e){return e},r.prototype.compareMinX=function(e,t){return e.minX-t.minX},r.prototype.compareMinY=function(e,t){return e.minY-t.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(e){return this.data=e,this},r.prototype._all=function(e,t){for(var n=[];e;)e.leaf?t.push.apply(t,e.children):n.push.apply(n,e.children),e=n.pop();return t},r.prototype._build=function(e,t,n,r){var i,o=n-t+1,s=this._maxEntries;if(o<=s)return a(i=m(e.slice(t,n+1)),this.toBBox),i;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/s**(r-1))),(i=m([])).leaf=!1,i.height=r;var c=Math.ceil(o/s),l=c*Math.ceil(Math.sqrt(s));h(e,t,n,l,this.compareMinX);for(var u=t;u<=n;u+=l){var d=Math.min(u+l-1,n);h(e,u,d,c,this.compareMinY);for(var f=u;f<=d;f+=c){var p=Math.min(f+c-1,d);i.children.push(this._build(e,f,p,r-1))}}return a(i,this.toBBox),i},r.prototype._chooseSubtree=function(e,t,n,r){for(;r.push(t),!t.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;s<t.children.length;s++){var c=t.children[s],l=u(c),d=(f=e,p=c,(Math.max(p.maxX,f.maxX)-Math.min(p.minX,f.minX))*(Math.max(p.maxY,f.maxY)-Math.min(p.minY,f.minY))-l);d<a?(a=d,i=l<i?l:i,o=c):d===a&&l<i&&(i=l,o=c)}t=o||t.children[0]}var f,p;return t},r.prototype._insert=function(e,t,n){var r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),s(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)},r.prototype._split=function(e,t){var n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,a(n,this.toBBox),a(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(n,s)},r.prototype._splitRoot=function(e,t){this.data=m([e,t]),this.data.height=e.height+1,this.data.leaf=!1,a(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(e,t,n){for(var r,i,a,s,c,l,d,f=1/0,p=1/0,m=t;m<=n-t;m++){var h=o(e,0,m,this.toBBox),g=o(e,m,n,this.toBBox),_=(i=h,a=g,s=void 0,c=void 0,l=void 0,d=void 0,s=Math.max(i.minX,a.minX),c=Math.max(i.minY,a.minY),l=Math.min(i.maxX,a.maxX),d=Math.min(i.maxY,a.maxY),Math.max(0,l-s)*Math.max(0,d-c)),v=u(h)+u(g);_<f?(f=_,r=m,p=v<p?v:p):_===f&&v<p&&(p=v,r=m)}return r||n-t},r.prototype._chooseSplitAxis=function(e,t,n){var r=e.leaf?this.compareMinX:c,i=e.leaf?this.compareMinY:l;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)},r.prototype._allDistMargin=function(e,t,n,r){e.children.sort(r);for(var i=this.toBBox,a=o(e,0,t,i),c=o(e,n-t,n,i),l=d(a)+d(c),u=t;u<n-t;u++){var f=e.children[u];s(a,e.leaf?i(f):f),l+=d(a)}for(var p=n-t-1;p>=t;p--){var m=e.children[p];s(c,e.leaf?i(m):m),l+=d(c)}return l},r.prototype._adjustParentBBoxes=function(e,t,n){for(var r=n;r>=0;r--)s(t[r],e)},r.prototype._condense=function(e){for(var t=e.length-1,n=void 0;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children).splice(n.indexOf(e[t]),1):this.clear():a(e[t],this.toBBox)},r})}))(),1),fs=class{constructor(e){this.rbush_=new ds.default(e),this.items_={}}insert(e,t){let n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(n),this.items_[D(t)]=n}load(e,t){let n=Array(t.length);for(let r=0,i=t.length;r<i;r++){let i=e[r],a=t[r],o={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],value:a};n[r]=o,this.items_[D(a)]=o}this.rbush_.load(n)}remove(e){let t=D(e),n=this.items_[t];return delete this.items_[t],this.rbush_.remove(n)!==null}update(e,t){let n=this.items_[D(t)];Me([n.minX,n.minY,n.maxX,n.maxY],e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(e){let t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(e){return e.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let n;for(let r=0,i=e.length;r<i;r++)if(n=t(e[r]),n)return n;return n}isEmpty(){return _(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){let t=this.rbush_.toJSON();return Oe(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(let t in e.items_)this.items_[t]=e.items_[t]}},ps={ADDFEATURE:`addfeature`,CHANGEFEATURE:`changefeature`,CLEAR:`clear`,REMOVEFEATURE:`removefeature`,FEATURESLOADSTART:`featuresloadstart`,FEATURESLOADEND:`featuresloadend`,FEATURESLOADERROR:`featuresloaderror`};function ms(e,t){return[[-1/0,-1/0,1/0,1/0]]}function hs(e){return(function(t,n,r){let i=e.getZForResolution(Mn(n,r)),a=e.getTileRangeForExtentAndZ(An(t,r),i),o=[],s=[i,0,0];for(s[1]=a.minX;s[1]<=a.maxX;++s[1])for(s[2]=a.minY;s[2]<=a.maxY;++s[2])o.push(kn(e.getTileCoordExtent(s),r));return o}
7)}var gs=!1;function _s(e,t,n,r,i,a,o){let s=new XMLHttpRequest;s.open(`GET`,typeof e==`function`?e(n,r,i):e,!0),t.getType()==`arraybuffer`&&(s.responseType=`arraybuffer`),s.withCredentials=gs,s.onload=function(e){if(!s.status||s.status>=200&&s.status<300){let e=t.getType(),r;e==`json`||e==`text`?r=s.responseText:e==`xml`?(r=s.responseXML,r||=new DOMParser().parseFromString(s.responseText,`application/xml`)):e==`arraybuffer`&&(r=s.response),r?a(t.readFeatures(r,{extent:n,featureProjection:i}),t.readProjection(r)):o()}else o()},s.onerror=o,s.send()}function vs(e,t){return function(n,r,i,a,o){let s=this;_s(e,t,n,r,i,function(e,t){s.addFeatures(e),a!==void 0&&a(e)},o||m)}}var ys=class extends n{constructor(e,t,n){super(e),this.feature=t,this.features=n}},bs=class extends Vo{constructor(e){e||={},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:`ready`,wrapX:e.wrapX===void 0?!0:e.wrapX}),this.on,this.once,this.un,this.loader_=m,this.format_=e.format,this.overlaps_=e.overlaps===void 0?!0:e.overlaps,this.url_=e.url,e.loader===void 0?this.url_!==void 0&&(F(this.format_,7),this.loader_=vs(this.url_,this.format_)):this.loader_=e.loader,this.strategy_=e.strategy===void 0?ms:e.strategy;let t=e.useSpatialIndex===void 0?!0:e.useSpatialIndex;this.featuresRtree_=t?new fs:null,this.loadedExtentsRtree_=new fs,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,r;Array.isArray(e.features)?r=e.features:e.features&&(n=e.features,r=n.getArray()),!t&&n===void 0&&(n=new N(r)),r!==void 0&&this.addFeaturesInternal(r),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){let t=D(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);let n=e.getGeometry();if(n){let t=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(t,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new ys(ps.ADDFEATURE,e))}setupChangeEvents_(e,t){this.featureChangeKeys_[e]=[b(t,y.CHANGE,this.handleFeatureChange_,this),b(t,r.PROPERTYCHANGE,this.handleFeatureChange_,this)]}addToIndex_(e,t){let n=!0,r=t.getId();return r!==void 0&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=t),n&&(F(!(e in this.uidIndex_),30),this.uidIndex_[e]=t),n}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){let t=[],n=[],r=[];for(let t=0,r=e.length;t<r;t++){let r=e[t],i=D(r);this.addToIndex_(i,r)&&n.push(r)}for(let e=0,i=n.length;e<i;e++){let i=n[e],a=D(i);this.setupChangeEvents_(a,i);let o=i.getGeometry();if(o){let e=o.getExtent();t.push(e),r.push(i)}else this.nullGeometryFeatures_[a]=i}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(ps.ADDFEATURE))for(let e=0,t=n.length;e<t;e++)this.dispatchEvent(new ys(ps.ADDFEATURE,n[e]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(ps.ADDFEATURE,function(n){t||=(t=!0,e.push(n.feature),!1)}),this.addEventListener(ps.REMOVEFEATURE,function(n){t||=(t=!0,e.remove(n.feature),!1)}),e.addEventListener(j.ADD,e=>{t||=(t=!0,this.addFeature(e.element),!1)}),e.addEventListener(j.REMOVE,e=>{t||=(t=!0,this.removeFeature(e.element),!1)}),this.featuresCollection_=e}clear(e){if(e){for(let e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(S);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(e=>{this.removeFeatureInternal(e)});for(let e in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[e])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let t=new ys(ps.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){let n=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(n,function(n){if(n.getGeometry().intersectsCoordinate(e))return t(n)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(n){if(n.getGeometry().intersectsExtent(e)){let e=t(n);if(e)return e}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),_(this.nullGeometryFeatures_)||l(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){let t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);let n=tt(e,t);return[].concat(...n.map(e=>this.featuresRtree_.getInExtent(e)))}else if(this.featuresCollection_)return this.featuresCollection_.getArray().slice(0);return[]}getClosestFeatureToCoordinate(e,t){let n=e[0],r=e[1],i=null,a=[NaN,NaN],o=1/0,s=[-1/0,-1/0,1/0,1/0];return t||=f,this.featuresRtree_.forEachInExtent(s,function(e){if(t(e)){let t=e.getGeometry(),c=o;if(o=t.closestPointXY(n,r,a,o),o<c){i=e;let t=Math.sqrt(o);s[0]=n-t,s[1]=r-t,s[2]=n+t,s[3]=r+t}}}),i}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){let t=this.idIndex_[e.toString()];return t===void 0?null:t}getFeatureByUid(e){let t=this.uidIndex_[e];return t===void 0?null:t}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){let t=e.target,n=D(t),r=t.getGeometry();if(!r)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[n]=t);else{let e=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(e,t)):this.featuresRtree_&&this.featuresRtree_.update(e,t)}let i=t.getId();if(i!==void 0){let e=i.toString();this.idIndex_[e]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[e]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[n]=t;this.changed(),this.dispatchEvent(new ys(ps.CHANGEFEATURE,t))}hasFeature(e){let t=e.getId();return t===void 0?D(e)in this.uidIndex_:t in this.idIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&_(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}
7loadFeatures(e,t,n){let r=this.loadedExtentsRtree_,i=this.strategy_(e,t,n);for(let e=0,a=i.length;e<a;++e){let a=i[e];r.forEachInExtent(a,function(e){return we(e.extent,a)})||(++this.loadingExtentsCount_,this.dispatchEvent(new ys(ps.FEATURESLOADSTART)),this.loader_.call(this,a,t,n,e=>{--this.loadingExtentsCount_,this.dispatchEvent(new ys(ps.FEATURESLOADEND,void 0,e))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new ys(ps.FEATURESLOADERROR))}),r.insert(a,{extent:a.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){let t=this.loadedExtentsRtree_,n;t.forEachInExtent(e,function(t){if(Me(t.extent,e))return n=t,!0}),n&&t.remove(n)}removeFeature(e){if(!e)return;let t=D(e);t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){let t=D(e),n=this.featureChangeKeys_[t];if(!n)return;n.forEach(S),delete this.featureChangeKeys_[t];let r=e.getId();return r!==void 0&&delete this.idIndex_[r.toString()],delete this.uidIndex_[t],this.dispatchEvent(new ys(ps.REMOVEFEATURE,e)),e}removeFromIdIndex_(e){let t=!1;for(let n in this.idIndex_)if(this.idIndex_[n]===e){delete this.idIndex_[n],t=!0;break}return t}setLoader(e){this.loader_=e}setUrl(e){F(this.format_,7),this.url_=e,this.setLoader(vs(e,this.format_))}},xs=`© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.`,Ss=class extends us{constructor(e){e||={};let t;t=e.attributions===void 0?[xs]:e.attributions;let n=e.crossOrigin===void 0?`anonymous`:e.crossOrigin,r=e.url===void 0?`https://tile.openstreetmap.org/{z}/{x}/{y}.png`:e.url;super({attributions:t,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:n,interpolate:e.interpolate,maxZoom:e.maxZoom===void 0?19:e.maxZoom,opaque:e.opaque===void 0?!0:e.opaque,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:r,wrapX:e.wrapX,zDirection:e.zDirection})}},Cs=class extends C{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.declutterExecutorGroup=null}getFeatures(e){return T()}getData(e){return null}prepareFrame(e){return T()}renderFrame(e,t){return T()}loadedTileCallback(e,t,n){e[t]||(e[t]={}),e[t][n.tileCoord.toString()]=n}createLoadedTileFinder(e,t,n){return((r,i)=>{let a=this.loadedTileCallback.bind(this,n,r);return e.forEachLoadedTile(t,r,i,a)})}forEachFeatureAtCoordinate(e,t,n,r,i){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){e.target.getState()===G.LOADED&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=G.LOADED&&t!=G.ERROR&&e.addEventListener(y.CHANGE,this.boundHandleImageChange_),t==G.IDLE&&(e.load(),t=e.getState()),t==G.LOADED}renderIfReadyAndVisible(){let e=this.getLayer();e&&e.getVisible()&&e.getSourceState()===`ready`&&e.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}},ws=[],Ts=null;function Es(){Ts=_i(1,1,void 0,{willReadFrequently:!0})}var Ds=class extends Cs{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=le(),this.pixelTransform=le(),this.inversePixelTransform=le(),this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(e,t,n){Ts||Es(),Ts.clearRect(0,0,1,1);let r;try{Ts.drawImage(e,t,n,1,1,0,0,1,1),r=Ts.getImageData(0,0,1,1).data}catch{return Ts=null,null}return r}getBackground(e){let t=this.getLayer().getBackground();return typeof t==`function`&&(t=t(e.viewState.resolution)),t||void 0}useContainer(e,t,n){let r=this.getLayer().getClassName(),i,a;if(e&&e.className===r&&(!n||e&&e.style.backgroundColor&&u(_t(e.style.backgroundColor),_t(n)))){let t=e.firstElementChild;t instanceof HTMLCanvasElement&&(a=t.getContext(`2d`))}if(a&&a.canvas.style.transform===t?(this.container=e,this.context=a,this.containerReused=!0):this.containerReused&&=(this.container=null,this.context=null,!1),!this.container){i=document.createElement(`div`),i.className=r;let e=i.style;e.position=`absolute`,e.width=`100%`,e.height=`100%`,a=_i();let t=a.canvas;i.appendChild(t),e=t.style,e.position=`absolute`,e.left=`0`,e.transformOrigin=`top left`,this.container=i,this.context=a}
7!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(e,t,n){let r=qe(n),i=Je(n),a=Be(n),o=ze(n);I(t.coordinateToPixelTransform,r),I(t.coordinateToPixelTransform,i),I(t.coordinateToPixelTransform,a),I(t.coordinateToPixelTransform,o);let s=this.inversePixelTransform;I(s,r),I(s,i),I(s,a),I(s,o),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])),e.lineTo(Math.round(i[0]),Math.round(i[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.clip()}dispatchRenderEvent_(e,t,n){let r=this.getLayer();if(r.hasListener(e)){let i=new li(e,this.inversePixelTransform,n,t);r.dispatchEvent(i)}}preRender(e,t){this.frameState=t,this.dispatchRenderEvent_(Tt.PRERENDER,e,t)}postRender(e,t){this.dispatchRenderEvent_(Tt.POSTRENDER,e,t)}getRenderTransform(e,t,n,r,i,a,o){let s=i/2,c=a/2,l=r/t,u=-l,d=-e[0]+o,f=-e[1];return pe(this.tempTransform,s,c,l,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}},Os={PRELOAD:`preload`,USE_INTERIM_TILES_ON_ERROR:`useInterimTilesOnError`},ks=class extends ai{constructor(e){e||={};let t=Object.assign({},e);delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.setPreload(e.preload===void 0?0:e.preload),this.setUseInterimTilesOnError(e.useInterimTilesOnError===void 0?!0:e.useInterimTilesOnError)}getPreload(){return this.get(Os.PRELOAD)}setPreload(e){this.set(Os.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Os.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Os.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}},As=class extends Ds{constructor(e){super(e),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=De(),this.tmpTileRange_=new Uo(0,0,0,0)}isDrawableTile(e){let t=this.getLayer(),n=e.getState(),r=t.getUseInterimTilesOnError();return n==W.LOADED||n==W.EMPTY||n==W.ERROR&&!r}getTile(e,t,n,r){let i=r.pixelRatio,a=r.viewState.projection,o=this.getLayer(),s=o.getSource().getTile(e,t,n,i,a);return s.getState()==W.ERROR&&o.getUseInterimTilesOnError()&&o.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(s)||(s=s.getInterimTile()),s}getData(e){let t=this.frameState;if(!t)return null;let n=this.getLayer(),r=I(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!Ce(i,r))return null;let a=t.pixelRatio,o=t.viewState.projection,s=t.viewState,c=n.getRenderSource(),l=c.getTileGridForProjection(s.projection),u=c.getTilePixelRatio(t.pixelRatio);for(let e=l.getZForResolution(s.resolution);e>=l.getMinZoom();--e){let t=l.getTileCoordForCoordAndZ(r,e),n=c.getTile(e,t[1],t[2],a,o);if(!(n instanceof vo||n instanceof Mo)||n instanceof Mo&&n.getState()===W.EMPTY)return null;if(n.getState()!==W.LOADED)continue;let i=l.getOrigin(e),d=Wa(l.getTileSize(e)),f=l.getResolution(e),p=Math.floor(u*((r[0]-i[0])/f-t[1]*d[0])),m=Math.floor(u*((i[1]-r[1])/f-t[2]*d[1])),h=Math.round(u*c.getGutterForProjection(s.projection));return this.getImageData(n.getImage(),p+h,m+h)}return null}loadedTileCallback(e,t,n){return this.isDrawableTile(n)?super.loadedTileCallback(e,t,n):!1}prepareFrame(e){return!!this.getLayer().getSource()}renderFrame(e,t){let n=e.layerStatesArray[e.layerIndex],r=e.viewState,i=r.projection,a=r.resolution,s=r.center,c=r.rotation,l=e.pixelRatio,u=this.getLayer(),d=u.getSource(),f=d.getRevision(),p=d.getTileGridForProjection(i),m=p.getZForResolution(a,d.zDirection),h=p.getResolution(m),g=e.extent,_=e.viewState.resolution,v=d.getTilePixelRatio(l),y=Math.round(R(g)/_*l),b=Math.round(Ge(g)/_*l),x=n.extent&&An(n.extent,i);x&&(g=Ke(g,An(n.extent,i)));let S=h*y/2/v,C=h*b/2/v,w=[s[0]-S,s[1]-C,s[0]+S,s[1]+C],T=p.getTileRangeForExtentAndZ(g,m),E={};E[m]={};let O=this.createLoadedTileFinder(d,i,E),k=this.tmpExtent,ee=this.tmpTileRange_;this.newTiles_=!1;let A=c?We(r.center,_,c,e.size):void 0;for(let t=T.minX;t<=T.maxX;++t)for(let r=T.minY;r<=T.maxY;++r){if(c&&!p.tileCoordIntersectsViewport([m,t,r],A))continue;let i=this.getTile(m,t,r,e);if(this.isDrawableTile(i)){let t=D(this);if(i.getState()==W.LOADED){E[m][i.tileCoord.toString()]=i;let e=i.inTransition(t);e&&n.opacity!==1&&(i.endTransition(t),e=!1),!this.newTiles_&&(e||!this.renderedTiles.includes(i))&&(this.newTiles_=!0)}if(i.getAlpha(t,e.time)===1)continue}let a=p.getTileCoordChildTileRange(i.tileCoord,ee,k),o=!1;a&&(o=O(m+1,a)),o||p.forEachTileCoordParentTileRange(i.tileCoord,O,ee,k)}let j=h/a*l/v;pe(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/l,1/l,c,-y/2,-b/2);let te=_e(this.pixelTransform);
7this.useContainer(t,te,this.getBackground(e));let M=this.context,N=M.canvas;me(this.inversePixelTransform,this.pixelTransform),pe(this.tempTransform,y/2,b/2,j,j,0,-y/2,-b/2),N.width!=y||N.height!=b?(N.width=y,N.height=b):this.containerReused||M.clearRect(0,0,y,b),x&&this.clipUnrotated(M,e,x),d.getInterpolate()||(M.imageSmoothingEnabled=!1),this.preRender(M,e),this.renderedTiles.length=0;let P=Object.keys(E).map(Number);P.sort(o);let ne,re,ie;n.opacity===1&&(!this.containerReused||d.getOpaque(e.viewState.projection))?P=P.reverse():(ne=[],re=[]);for(let t=P.length-1;t>=0;--t){let n=P[t],r=d.getTilePixelSize(n,l,i),a=p.getResolution(n)/h,o=r[0]*a*j,s=r[1]*a*j,c=p.getTileCoordForCoordAndZ(qe(w),n),u=p.getTileCoordExtent(c),f=I(this.tempTransform,[v*(u[0]-w[0])/h,v*(w[3]-u[3])/h]),g=v*d.getGutterForProjection(i),_=E[n];for(let t in _){let r=_[t],i=r.tileCoord,a=c[1]-i[1],l=Math.round(f[0]-(a-1)*o),u=c[2]-i[2],p=Math.round(f[1]-(u-1)*s),h=Math.round(f[0]-a*o),v=Math.round(f[1]-u*s),y=l-h,b=p-v,x=m===n,S=x&&r.getAlpha(D(this),e.time)!==1,C=!1;if(!S)if(ne){ie=[h,v,h+y,v,h+y,v+b,h,v+b];for(let e=0,t=ne.length;e<t;++e)if(m!==n&&n<re[e]){let t=ne[e];Ye([h,v,h+y,v+b],[t[0],t[3],t[4],t[7]])&&(C||=(M.save(),!0),M.beginPath(),M.moveTo(ie[0],ie[1]),M.lineTo(ie[2],ie[3]),M.lineTo(ie[4],ie[5]),M.lineTo(ie[6],ie[7]),M.moveTo(t[6],t[7]),M.lineTo(t[4],t[5]),M.lineTo(t[2],t[3]),M.lineTo(t[0],t[1]),M.clip())}ne.push(ie),re.push(n)}else M.clearRect(h,v,y,b);this.drawTileImage(r,e,h,v,y,b,g,x),ne&&!S?(C&&M.restore(),this.renderedTiles.unshift(r)):this.renderedTiles.push(r),this.updateUsedTiles(e.usedTiles,d,r)}}return this.renderedRevision=f,this.renderedResolution=h,this.extentChanged=!this.renderedExtent_||!Me(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=i,this.manageTilePyramid(e,d,p,l,i,g,m,u.getPreload()),this.scheduleExpireCache(e,d),this.postRender(M,e),n.extent&&M.restore(),M.imageSmoothingEnabled=!0,te!==N.style.transform&&(N.style.transform=te),this.container}drawTileImage(e,t,n,r,i,a,o,s){let c=this.getTileImage(e);if(!c)return;let l=D(this),u=t.layerStatesArray[t.layerIndex],d=u.opacity*(s?e.getAlpha(l,t.time):1),f=d!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=d),this.context.drawImage(c,o,o,c.width-2*o,c.height-2*o,n,r,i,a),f&&this.context.restore(),d===u.opacity?s&&e.endTransition(l):t.animate=!0}getImage(){let e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}scheduleExpireCache(e,t){if(t.canExpireCache()){let n=function(e,t,n){let r=D(e);r in n.usedTiles&&e.expireCache(n.viewState.projection,n.usedTiles[r])}.bind(null,t);e.postRenderFunctions.push(n)}}updateUsedTiles(e,t,n){let r=D(t);r in e||(e[r]={}),e[r][n.getKey()]=!0}manageTilePyramid(e,t,n,r,i,a,o,s,c){let l=D(t);l in e.wantedTiles||(e.wantedTiles[l]={});let u=e.wantedTiles[l],d=e.tileQueue,f=n.getMinZoom(),p=e.viewState.rotation,m=p?We(e.viewState.center,e.viewState.resolution,p,e.size):void 0,h=0,g,_,v,y,b,x;for(x=f;x<=o;++x)for(_=n.getTileRangeForExtentAndZ(a,x,_),v=n.getResolution(x),y=_.minX;y<=_.maxX;++y)for(b=_.minY;b<=_.maxY;++b)p&&!n.tileCoordIntersectsViewport([x,y,b],m)||(o-x<=s?(++h,g=t.getTile(x,y,b,r,i),g.getState()==W.IDLE&&(u[g.getKey()]=!0,d.isKeyQueued(g.getKey())||d.enqueue([g,l,n.getTileCoordCenter(g.tileCoord),v])),c!==void 0&&c(g)):t.useTile(x,y,b,i));t.updateCacheSize(h,i)}},js=class extends ks{constructor(e){super(e)}createRenderer(){return new As(this)}};function Ms(e,t,n,r,i,o,s){let c,l,u=(n-t)/r;if(u===1)c=t;else if(u===2)c=t,l=i;else if(u!==0){let o=e[t],s=e[t+1],u=0,d=[0];for(let i=t+r;i<n;i+=r){let t=e[i],n=e[i+1];u+=Math.sqrt((t-o)*(t-o)+(n-s)*(n-s)),d.push(u),o=t,s=n}let f=i*u,p=a(d,f);p<0?(l=(f-d[-p-2])/(d[-p-1]-d[-p-2]),c=t+(-p-2)*r):c=t+p*r}s=s>1?s:2,o||=Array(s);for(let t=0;t<s;++t)o[t]=c===void 0?NaN:l===void 0?e[c+t]:ct(e[c+t],e[c+r+t],l);return o}function Ns(e,t,n,r,i,a){if(n==t)return null;let o;if(i<e[t+r-1])return a?(o=e.slice(t,t+r),o[r-1]=i,o):null;if(e[n-1]<i)return a?(o=e.slice(n-r,n),o[r-1]=i,o):null;if(i==e[t+r-1])return e.slice(t,t+r);let s=t/r,c=n/r;
7for(;s<c;){let t=s+c>>1;i<e[(t+1)*r-1]?c=t:s=t+1}let l=e[s*r-1];if(i==l)return e.slice((s-1)*r,(s-1)*r+r);let u=e[(s+1)*r-1],d=(i-l)/(u-l);o=[];for(let t=0;t<r-1;++t)o.push(ct(e[(s-1)*r+t],e[s*r+t],d));return o.push(i),o}function Ps(e,t,n,r,i,a,o){if(o)return Ns(e,t,n[n.length-1],r,i,a);let s;if(i<e[r-1])return a?(s=e.slice(0,r),s[r-1]=i,s):null;if(e[e.length-1]<i)return a?(s=e.slice(e.length-r),s[r-1]=i,s):null;for(let a=0,o=n.length;a<o;++a){let o=n[a];if(t!=o){if(i<e[t+r-1])return null;if(i<=e[o-1])return Ns(e,t,o,r,i,!1);t=o}}return null}function Fs(e,t,n,r){let i=e[t],a=e[t+1],o=0;for(let s=t+r;s<n;s+=r){let t=e[s],n=e[s+1];o+=Math.sqrt((t-i)*(t-i)+(n-a)*(n-a)),i=t,a=n}return o}var Is=class e extends tr{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendCoordinate(e){this.flatCoordinates?l(this.flatCoordinates,e):this.flatCoordinates=e.slice(),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Se(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(or(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),lr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,n,r))}forEachSegment(e){return Ir(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return this.layout!=`XYM`&&this.layout!=`XYZM`?null:(t=t===void 0?!1:t,Ns(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return Sr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return Ms(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return Fs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){let n=[];return n.length=gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LineString`}intersectsExtent(e){return Lr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=pr(this.flatCoordinates,0,e,this.stride),this.changed()}};function Ls(e){return new co({fill:Rs(e,``),stroke:zs(e,``),text:Bs(e),image:Vs(e)})}function Rs(e,t){let n=e[t+`fill-color`];if(n)return new to({color:n})}function zs(e,t){let n=e[t+`stroke-width`],r=e[t+`stroke-color`];if(!(!n&&!r))return new so({width:n,color:r,lineCap:e[t+`stroke-line-cap`],lineJoin:e[t+`stroke-line-join`],lineDash:e[t+`stroke-line-dash`],lineDashOffset:e[t+`stroke-line-dash-offset`],miterLimit:e[t+`stroke-miter-limit`]})}function Bs(e){let t=e[`text-value`];if(t)return new ho({text:t,font:e[`text-font`],maxAngle:e[`text-max-angle`],offsetX:e[`text-offset-x`],offsetY:e[`text-offset-y`],overflow:e[`text-overflow`],placement:e[`text-placement`],repeat:e[`text-repeat`],scale:e[`text-scale`],rotateWithView:e[`text-rotate-with-view`],rotation:e[`text-rotation`],textAlign:e[`text-align`],justify:e[`text-justify`],textBaseline:e[`text-baseline`],padding:e[`text-padding`],fill:Rs(e,`text-`),backgroundFill:Rs(e,`text-background-`),stroke:zs(e,`text-`),backgroundStroke:zs(e,`text-background-`)})}function Vs(e){let t=e[`icon-src`],n=e[`icon-img`];if(t||n)return new oo({src:t,img:n,imgSize:e[`icon-img-size`],anchor:e[`icon-anchor`],anchorOrigin:e[`icon-anchor-origin`],anchorXUnits:e[`icon-anchor-x-units`],anchorYUnits:e[`icon-anchor-y-units`],color:e[`icon-color`],crossOrigin:e[`icon-cross-origin`],offset:e[`icon-offset`],displacement:e[`icon-displacement`],opacity:e[`icon-opacity`],scale:e[`icon-scale`],rotation:e[`icon-rotation`],rotateWithView:e[`icon-rotate-with-view`],size:e[`icon-size`],declutterMode:e[`icon-declutter-mode`]});let r=e[`shape-points`];if(r){let t=`shape-`;return new $a({points:r,fill:Rs(e,t),stroke:zs(e,t),radius:e[`shape-radius`],radius1:e[`shape-radius1`],radius2:e[`shape-radius2`],angle:e[`shape-angle`],displacement:e[`shape-displacement`],rotation:e[`shape-rotation`],rotateWithView:e[`shape-rotate-with-view`],scale:e[`shape-scale`],declutterMode:e[`shape-declutter-mode`]})}let i=e[`circle-radius`];if(i){let t=`circle-`;
7return new eo({radius:i,fill:Rs(e,t),stroke:zs(e,t),displacement:e[`circle-displacement`],scale:e[`circle-scale`],rotation:e[`circle-rotation`],rotateWithView:e[`circle-rotate-with-view`],declutterMode:e[`circle-declutter-mode`]})}}var Hs={RENDER_ORDER:`renderOrder`},Us=class extends ai{constructor(e){e||={};let t=Object.assign({},e);delete t.style,delete t.renderBuffer,delete t.updateWhileAnimating,delete t.updateWhileInteracting,super(t),this.declutter_=e.declutter===void 0?!1:e.declutter,this.renderBuffer_=e.renderBuffer===void 0?100:e.renderBuffer,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating===void 0?!1:e.updateWhileAnimating,this.updateWhileInteracting_=e.updateWhileInteracting===void 0?!1:e.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Hs.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e){e.declutterTree||=new ds.default(9),this.getRenderer().renderDeclutter(e)}setRenderOrder(e){this.set(Hs.RENDER_ORDER,e)}setStyle(e){let t;if(e===void 0)t=fo;else if(e===null)t=null;else if(typeof e==`function`)t=e;else if(e instanceof co)t=e;else if(Array.isArray(e)){let n=e.length,r=Array(n);for(let t=0;t<n;++t){let n=e[t];n instanceof co?r[t]=n:r[t]=Ls(n)}t=r}else t=Ls(e);this.style_=t,this.styleFunction_=e===null?void 0:lo(this.style_),this.changed()}},K={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},Ws=[K.FILL],Gs=[K.STROKE],Ks=[K.BEGIN_PATH],qs=[K.CLOSE_PATH],Js=class{drawCustom(e,t,n,r){}drawGeometry(e){}setStyle(e){}drawCircle(e,t){}drawFeature(e,t){}drawGeometryCollection(e,t){}drawLineString(e,t){}drawMultiLineString(e,t){}drawMultiPoint(e,t){}drawMultiPolygon(e,t){}drawPoint(e,t){}drawPolygon(e,t){}drawText(e,t){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}},Ys=class extends Js{constructor(e,t,n,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){let t=this.pixelRatio;return t==1?e:e.map(function(e){return e*t})}appendFlatPointCoordinates(e,t){let n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,a=i.length;for(let o=0,s=e.length;o<s;o+=t)r[0]=e[o],r[1]=e[o+1],Ce(n,r)&&(i[a++]=r[0],i[a++]=r[1]);return a}appendFlatLineCoordinates(e,t,n,r,i,a){let o=this.coordinates,s=o.length,c=this.getBufferedMaxExtent();a&&(t+=r);let l=e[t],u=e[t+1],d=this.tmpCoordinate_,f=!0,p,m,h;for(p=t+r;p<n;p+=r)d[0]=e[p],d[1]=e[p+1],h=Ee(c,d),h===m?h===L.INTERSECTING?(o[s++]=d[0],o[s++]=d[1],f=!1):f=!0:(f&&=(o[s++]=l,o[s++]=u,!1),o[s++]=d[0],o[s++]=d[1]),l=d[0],u=d[1],m=h;return(i&&f||p===t+r)&&(o[s++]=l,o[s++]=u),s}drawCustomCoordinates_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a],s=this.appendFlatLineCoordinates(e,t,o,r,!1,!1);i.push(s),t=o}return t}drawCustom(e,t,n,r){this.beginGeometry(e,t);let i=e.getType(),a=e.getStride(),o=this.coordinates.length,s,c,l,u,d;switch(i){case`MultiPolygon`:s=e.getOrientedFlatCoordinates(),u=[];let t=e.getEndss();d=0;for(let e=0,n=t.length;e<n;++e){let n=[];d=this.drawCustomCoordinates_(s,d,t[e],a,n),u.push(n)}this.instructions.push([K.CUSTOM,o,u,e,n,wr]),this.hitDetectionInstructions.push([K.CUSTOM,o,u,e,r||n,wr]);break;case`Polygon`:case`MultiLineString`:l=[],s=i==`Polygon`?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),d=this.drawCustomCoordinates_(s,0,e.getEnds(),a,l),this.instructions.push([K.CUSTOM,o,l,e,n,Cr]),this.hitDetectionInstructions.push([K.CUSTOM,o,l,e,r||n,Cr]);break;case`LineString`:case`Circle`:s=e.getFlatCoordinates(),c=this.appendFlatLineCoordinates(s,0,s.length,a,!1,!1),this.instructions.push([K.CUSTOM,o,c,e,n,Sr]),this.hitDetectionInstructions.push([K.CUSTOM,o,c,e,r||n,Sr]);break;case`MultiPoint`:s=e.getFlatCoordinates(),c=this.appendFlatPointCoordinates(s,a),c>o&&(this.instructions.push([K.CUSTOM,o,c,e,n,Sr]),this.hitDetectionInstructions.push([K.CUSTOM,o,c,e,r||n,Sr]));break;case`Point`:s=e.getFlatCoordinates(),this.coordinates.push(s[0],s[1]),c=this.coordinates.length,this.instructions.push([K.CUSTOM,o,c,e,n]),this.hitDetectionInstructions.push([K.CUSTOM,o,c,e,r||n]);break;default:}this.endGeometry(t)}
7beginGeometry(e,t){this.beginGeometryInstruction1_=[K.BEGIN_GEOMETRY,t,0,e],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[K.BEGIN_GEOMETRY,t,0,e],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let e=this.hitDetectionInstructions;e.reverse();let t,n=e.length,r,i,a=-1;for(t=0;t<n;++t)r=e[t],i=r[0],i==K.END_GEOMETRY?a=t:i==K.BEGIN_GEOMETRY&&(r[2]=t,c(this.hitDetectionInstructions,a,t),a=-1)}setFillStrokeStyle(e,t){let n=this.state;if(e?n.fillStyle=Qa(e.getColor()||wi):n.fillStyle=void 0,t){n.strokeStyle=Qa(t.getColor()||Oi);let e=t.getLineCap();n.lineCap=e===void 0?Ti:e;let r=t.getLineDash();n.lineDash=r?r.slice():Ei,n.lineDashOffset=t.getLineDashOffset()||0;let i=t.getLineJoin();n.lineJoin=i===void 0?Di:i;let a=t.getWidth();n.lineWidth=a===void 0?1:a;let o=t.getMiterLimit();n.miterLimit=o===void 0?10:o,n.lineWidth>this.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}createFill(e){let t=e.fillStyle,n=[K.SET_FILL_STYLE,t];return typeof t!=`string`&&n.push(!0),n}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[K.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,this.applyPixelRatio(e.lineDash),e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){let n=e.fillStyle;(typeof n!=`string`||e.currentFillStyle!=n)&&(n!==void 0&&this.instructions.push(t.call(this,e)),e.currentFillStyle=n)}updateStrokeStyle(e,t){let n=e.strokeStyle,r=e.lineCap,i=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,c=e.miterLimit;(e.currentStrokeStyle!=n||e.currentLineCap!=r||i!=e.currentLineDash&&!u(e.currentLineDash,i)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=c)&&(n!==void 0&&t.call(this,e),e.currentStrokeStyle=n,e.currentLineCap=r,e.currentLineDash=i,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=c)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let t=[K.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=xe(this.maxExtent),this.maxLineWidth>0)){let e=this.resolution*(this.maxLineWidth+1)/2;be(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},Xs=class extends Ys{constructor(e,t,n,r){super(e,t,n,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t){if(!this.image_)return;this.beginGeometry(e,t);let n=e.getFlatCoordinates(),r=e.getStride(),i=this.coordinates.length,a=this.appendFlatPointCoordinates(n,r);this.instructions.push([K.DRAW_IMAGE,i,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([K.DRAW_IMAGE,i,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t){if(!this.image_)return;this.beginGeometry(e,t);let n=e.getFlatCoordinates(),r=e.getStride(),i=this.coordinates.length,a=this.appendFlatPointCoordinates(n,r);this.instructions.push([K.DRAW_IMAGE,i,a,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.
7ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([K.DRAW_IMAGE,i,a,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}finish(){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,super.finish()}setImageStyle(e,t){let n=e.getAnchor(),r=e.getSize(),i=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}},Zs=class extends Ys{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinates_(e,t,n,r){let i=this.coordinates.length,a=this.appendFlatLineCoordinates(e,t,n,r,!1,!1),o=[K.MOVE_TO_LINE_TO,i,a];return this.instructions.push(o),this.hitDetectionInstructions.push(o),n}drawLineString(e,t){let n=this.state,r=n.strokeStyle,i=n.lineWidth;if(r===void 0||i===void 0)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Ei,0],Ks);let a=e.getFlatCoordinates(),o=e.getStride();this.drawFlatCoordinates_(a,0,a.length,o),this.hitDetectionInstructions.push(Gs),this.endGeometry(t)}drawMultiLineString(e,t){let n=this.state,r=n.strokeStyle,i=n.lineWidth;if(r===void 0||i===void 0)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(e,t),this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],Ks);let a=e.getEnds(),o=e.getFlatCoordinates(),s=e.getStride(),c=0;for(let e=0,t=a.length;e<t;++e)c=this.drawFlatCoordinates_(o,c,a[e],s);this.hitDetectionInstructions.push(Gs),this.endGeometry(t)}finish(){let e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Gs),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Gs),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(Ks)}},Qs=class extends Ys{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinatess_(e,t,n,r){let i=this.state,a=i.fillStyle!==void 0,o=i.strokeStyle!==void 0,s=n.length;this.instructions.push(Ks),this.hitDetectionInstructions.push(Ks);for(let i=0;i<s;++i){let a=n[i],s=this.coordinates.length,c=this.appendFlatLineCoordinates(e,t,a,r,!0,!o),l=[K.MOVE_TO_LINE_TO,s,c];this.instructions.push(l),this.hitDetectionInstructions.push(l),o&&(this.instructions.push(qs),this.hitDetectionInstructions.push(qs)),t=a}return a&&(this.instructions.push(Ws),this.hitDetectionInstructions.push(Ws)),o&&(this.instructions.push(Gs),this.hitDetectionInstructions.push(Gs)),t}drawCircle(e,t){let n=this.state,r=n.fillStyle,i=n.strokeStyle;if(r===void 0&&i===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_FILL_STYLE,wi]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);let a=e.getFlatCoordinates(),o=e.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,o,!1,!1);let c=[K.CIRCLE,s];this.instructions.push(Ks,c),this.hitDetectionInstructions.push(Ks,c),n.fillStyle!==void 0&&(this.instructions.push(Ws),this.hitDetectionInstructions.push(Ws)),n.strokeStyle!==void 0&&(this.instructions.push(Gs),this.hitDetectionInstructions.push(Gs)),this.endGeometry(t)}drawPolygon(e,t){let n=this.state,r=n.fillStyle,i=n.strokeStyle;if(r===void 0&&i===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_FILL_STYLE,wi]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);let a=e.getEnds(),o=e.getOrientedFlatCoordinates(),s=e.getStride();this.drawFlatCoordinatess_(o,0,a,s),this.endGeometry(t)}drawMultiPolygon(e,t){let n=this.state,r=n.fillStyle,i=n.strokeStyle;if(r===void 0&&i===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t),n.fillStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_FILL_STYLE,wi]),n.strokeStyle!==void 0&&this.hitDetectionInstructions.push([K.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);let a=e.getEndss(),o=e.getOrientedFlatCoordinates(),s=e.getStride(),c=0;for(let e=0,t=a.length;e<t;++e)c=this.drawFlatCoordinatess_(o,c,a[e],s);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;let e=this.tolerance;if(e!==0){let t=this.coordinates;for(let n=0,r=t.length;n<r;++n)t[n]=vr(t[n],e)}return super.finish()}setFillStrokeStyles_(){let e=this.state;e.fillStyle!==void 0&&this.updateFillStyle(e,this.createFill),e.strokeStyle!==void 0&&this.updateStrokeStyle(e,this.applyStroke)}};function $s(e,t,n,r,i){let a=[],o=n,s=0,c=t.slice(n,2);for(;s<e&&o+i<r;){let[n,r]=c.slice(-2),l=t[o+i],u=t[o+i+1],d=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r));if(s+=d,s>=e){let t=(e-s+d)/d,f=ct(n,l,t),p=ct(r,u,t);c.push(f,p),a.push(c),c=[f,p],s==e&&(o+=i),s=0}else if(s<e)c.push(t[o+i],t[o+i+1]),o+=i;else{let e=d-s,t=ct(n,l,e/d),f=ct(r,u,e/d);c.push(t,f),a.push(c),c=[t,f],s=0,o+=i}}return s>0&&a.push(c),a}function ec(e,t,n,r,i){let a=n,o=n,s=0,c=0,l=n,u,d,f,p,m,h,g,_,v,y;for(d=n;d<r;d+=i){let n=t[d],r=t[d+1];m!==void 0&&(v=n-m,y=r-h,p=Math.sqrt(v*v+y*y),g!==void 0&&(c+=f,u=Math.acos((g*v+_*y)/(f*p)),u>e&&(c>s&&(s=c,a=l,o=d),c=0,l=d-i)),f=p,g=v,_=y),m=n,h=r}return c+=p,c>s?[l,d]:[a,o]}var tc={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},nc={Circle:Qs,Default:Ys,Image:Xs,LineString:Zs,Polygon:Qs,Text:class extends Ys{constructor(e,t,n,r){super(e,t,n,r),this.labels_=null,this.text_=``,this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_=``,this.fillKey_=``,this.strokeKey_=``,this.declutterImageWithText_=void 0}finish(){let e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t){let n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(this.text_===``||!i||!n&&!r)return;let a=this.coordinates,o=a.length,s=e.getType(),c=null,l=e.getStride();if(i.placement===`line`&&(s==`LineString`||s==`MultiLineString`||s==`Polygon`||s==`MultiPolygon`)){if(!Ye(this.getBufferedMaxExtent(),e.getExtent()))return;let n;if(c=e.getFlatCoordinates(),s==`LineString`)n=[c.length];else if(s==`MultiLineString`)n=e.getEnds();else if(s==`Polygon`)n=e.getEnds().slice(0,1);else if(s==`MultiPolygon`){let t=e.getEndss();n=[];for(let e=0,r=t.length;e<r;++e)n.push(t[e][0])}this.beginGeometry(e,t);let r=i.repeat,u=r?void 0:i.textAlign,d=0;for(let e=0,t=n.length;e<t;++e){let t;t=r?$s(r*this.resolution,c,d,n[e],l):[c.slice(d,n[e])];for(let r=0,s=t.length;r<s;++r){let s=t[r],c=0,f=s.length;if(u==null){let e=ec(i.maxAngle,s,0,s.length,2);c=e[0],f=e[1]}for(let e=c;e<f;e+=l)a.push(s[e],s[e+1]);let p=a.length;d=n[e],this.drawChars_(o,p),o=p}}this.endGeometry(t)}else{let n=i.overflow?null:[];switch(s){case`Point`:case`MultiPoint`:c=e.getFlatCoordinates();break;case`LineString`:c=e.getFlatMidpoint();break;case`Circle`:c=e.getCenter();break;case`MultiLineString`:c=e.getFlatMidpoints(),l=2;break;
7case`Polygon`:c=e.getFlatInteriorPoint(),i.overflow||n.push(c[2]/this.resolution),l=3;break;case`MultiPolygon`:let t=e.getFlatInteriorPoints();c=[];for(let e=0,r=t.length;e<r;e+=3)i.overflow||n.push(t[e+2]/this.resolution),c.push(t[e],t[e+1]);if(c.length===0)return;l=2;break;default:}let r=this.appendFlatPointCoordinates(c,l);if(r===o)return;if(n&&(r-o)/2!==c.length/l){let e=o/2;n=n.filter((t,n)=>{let r=a[(e+n)*2]===c[n*l]&&a[(e+n)*2+1]===c[n*l+1];return r||--e,r})}this.saveTextStates_(),(i.backgroundFill||i.backgroundStroke)&&(this.setFillStrokeStyle(i.backgroundFill,i.backgroundStroke),i.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),i.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(e,t);let u=i.padding;if(u!=ji&&(i.scale[0]<0||i.scale[1]<0)){let e=i.padding[0],t=i.padding[1],n=i.padding[2],r=i.padding[3];i.scale[0]<0&&(t=-t,r=-r),i.scale[1]<0&&(e=-e,n=-n),u=[e,t,n,r]}let d=this.pixelRatio;this.instructions.push([K.DRAW_IMAGE,o,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,u==ji?ji:u.map(function(e){return e*d}),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]);let f=1/d;this.hitDetectionInstructions.push([K.DRAW_IMAGE,o,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[f,f],NaN,void 0,this.declutterImageWithText_,u,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]),this.endGeometry(t)}}saveTextStates_(){let e=this.textStrokeState_,t=this.textState_,n=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));let i=this.textKey_;i in this.textStates||(this.textStates[i]={font:t.font,textAlign:t.textAlign||`center`,justify:t.justify,textBaseline:t.textBaseline||`middle`,scale:t.scale});let a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(e,t){let n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();let s=this.pixelRatio,c=tc[r.textBaseline],l=this.textOffsetY_*s,u=this.text_,d=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([K.DRAW_CHARS,e,t,c,r.overflow,o,r.maxAngle,s,l,i,d*s,u,a,1]),this.hitDetectionInstructions.push([K.DRAW_CHARS,e,t,c,r.overflow,o,r.maxAngle,1,l,i,d,u,a,1/s])}setTextStyle(e,t){let n,r,i;if(!e)this.text_=``;else{let t=e.getFill();t?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=Qa(t.getColor()||`#000`)):(r=null,this.textFillState_=r);let a=e.getStroke();if(!a)i=null,this.textStrokeState_=i;else{i=this.textStrokeState_,i||(i={},this.textStrokeState_=i);let e=a.getLineDash(),t=a.getLineDashOffset(),n=a.getWidth(),r=a.getMiterLimit();i.lineCap=a.getLineCap()||`round`,i.lineDash=e?e.slice():Ei,i.lineDashOffset=t===void 0?0:t,i.lineJoin=a.getLineJoin()||`round`,i.lineWidth=n===void 0?1:n,i.miterLimit=r===void 0?10:r,i.strokeStyle=Qa(a.getColor()||`#000`)}n=this.textState_;let o=e.getFont()||`10px sans-serif`;Ii(o);let s=e.getScaleArray();n.overflow=e.getOverflow(),n.font=o,n.maxAngle=e.getMaxAngle(),n.placement=e.getPlacement(),n.textAlign=e.getTextAlign(),n.repeat=e.getRepeat(),n.justify=e.getJustify(),n.textBaseline=e.getTextBaseline()||`middle`,n.backgroundFill=e.getBackgroundFill(),n.backgroundStroke=e.getBackgroundStroke(),n.padding=e.getPadding()||ji,n.scale=s===void 0?[1,1]:s;let c=e.getOffsetX(),l=e.getOffsetY(),u=e.getRotateWithView(),d=e.getRotation();this.text_=e.getText()||``,this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=l===void 0?0:l,this.textRotateWithView_=u===void 0?!1:u,this.textRotation_=d===void 0?0:d,this.strokeKey_=i?(typeof i.strokeStyle==`string`?i.strokeStyle:D(i.strokeStyle))+i.lineCap+i.lineDashOffset+`|`+i.lineWidth+i.lineJoin+i.miterLimit+`[`+i.lineDash.join()+`]`:``,this.textKey_=n.font+n.scale+(n.textAlign||`?`)+(n.repeat||`?`)+(n.justify||`?`)+(n.textBaseline||`?`),this.fillKey_=r?typeof r.fillStyle==`string`?r.fillStyle:`|`+D(r.fillStyle):``}this.declutterImageWithText_=t}}},rc=class{constructor(e,t,n,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_
7={}}finish(){let e={};for(let t in this.buildersByZIndex_){e[t]=e[t]||{};let n=this.buildersByZIndex_[t];for(let r in n){let i=n[r].finish();e[t][r]=i}}return e}getBuilder(e,t){let n=e===void 0?`0`:e.toString(),r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let i=r[t];if(i===void 0){let e=nc[t];i=new e(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=i}return i}};function ic(e,t,n,r,i,a,o,s,c,l,u,d){let f=e[t],p=e[t+1],m=0,h=0,g=0,_=0;function v(){m=f,h=p,t+=r,f=e[t],p=e[t+1],_+=g,g=Math.sqrt((f-m)*(f-m)+(p-h)*(p-h))}do v();while(t<n-r&&_+g<a);let y=g===0?0:(a-_)/g,b=ct(m,f,y),x=ct(h,p,y),S=t-r,C=_,w=a+s*c(l,i,u);for(;t<n-r&&_+g<w;)v();y=g===0?0:(w-_)/g;let T=ct(m,f,y),E=ct(h,p,y),D;if(d){let e=[b,x,T,E];Xn(e,0,4,2,d,e,e),D=e[0]>e[2]}else D=b>T;let O=Math.PI,k=[],ee=S+r===t;t=S,g=0,_=C,f=e[t],p=e[t+1];let A;if(ee)return v(),A=Math.atan2(p-h,f-m),D&&(A+=A>0?-O:O),k[0]=[(T+b)/2,(E+x)/2,(w-a)/2,A,i],k;i=i.replace(/\n/g,` `);for(let e=0,d=i.length;e<d;){v();let b=Math.atan2(p-h,f-m);if(D&&(b+=b>0?-O:O),A!==void 0){let e=b-A;if(e+=e>O?-2*O:e<-O?2*O:0,Math.abs(e)>o)return null}A=b;let x=e,S=0;for(;e<d;++e){let o=D?d-e-1:e,f=s*c(l,i[o],u);if(t+r<n&&_+g<a+S+f/2)break;S+=f}if(e===x)continue;let C=D?i.substring(d-x,d-e):i.substring(x,e);y=g===0?0:(a+S/2-_)/g;let w=ct(m,f,y),T=ct(h,p,y);k.push([w,T,S/2,b,C]),a+=S}return k}var ac=De(),oc=[],sc=[],cc=[],lc=[];function uc(e){return e[3].declutterBox}var dc=RegExp(`[Ö-ࣿï¬-ï·¿ï¹°-ﻼà -à¿¿î -î¿¿]`);function fc(e,t){return(t===`start`||t===`end`)&&!dc.test(e)&&(t=t===`start`?`left`:`right`),tc[t]}function pc(e,t,n){return n>0&&e.push(` 8`,``),e.push(t,``),e}var mc=class{constructor(e,t,n,r){this.overlaps=n,this.pixelRatio=t,this.resolution=e,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=le(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}createLabel(e,t,n,r){let i=e+t+n+r;if(this.labels_[i])return this.labels_[i];let a=r?this.strokeStates[r]:null,o=n?this.fillStates[n]:null,s=this.textStates[t],c=this.pixelRatio,l=[s.scale[0]*c,s.scale[1]*c],u=Array.isArray(e),d=s.justify?tc[s.justify]:fc(Array.isArray(e)?e[0]:e,s.textAlign||`center`),f=r&&a.lineWidth?a.lineWidth:0,p=u?e:e.split(` 9`).reduce(pc,[]),{width:m,height:h,widths:g,heights:_,lineWidths:v}=Vi(s,p),y=m+f,b=[],x=(y+2)*l[0],S=(h+f)*l[1],C={width:x<0?Math.floor(x):Math.ceil(x),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:b};(l[0]!=1||l[1]!=1)&&b.push(`scale`,l),r&&(b.push(`strokeStyle`,a.strokeStyle),b.push(`lineWidth`,f),b.push(`lineCap`,a.lineCap),b.push(`lineJoin`,a.lineJoin),b.push(`miterLimit`,a.miterLimit),b.push(`setLineDash`,[a.lineDash]),b.push(`lineDashOffset`,a.lineDashOffset)),n&&b.push(`fillStyle`,o.fillStyle),b.push(`textBaseline`,`middle`),b.push(`textAlign`,`center`);let w=.5-d,T=d*y+w*f,E=[],D=[],O=0,k=0,ee=0,A=0,j;for(let e=0,t=p.length;e<t;e+=2){let t=p[e];if(t===` 10`){k+=O,O=0,T=d*y+w*f,++A;continue}let i=p[e+1]||s.font;i!==j&&(r&&E.push(`font`,i),n&&D.push(`font`,i),j=i),O=Math.max(O,_[ee]);let a=[t,T+w*g[ee]+d*(g[ee]-v[A]),.5*(f+O)+k];T+=g[ee],r&&E.push(`strokeText`,a),n&&D.push(`fillText`,a),++ee}return Array.prototype.push.apply(b,E),Array.prototype.push.apply(b,D),this.labels_[i]=C,C}replayTextBackground_(e,t,n,r,i,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,t),a&&(this.alignFill_=a[2],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())}calculateImageOrLabelDimensions_(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){o*=d[0],s*=d[1];let g=n-o,_=r-s,v=i+c>e?e-c:i,y=a+l>t?t-l:a,b=p[3]+v*d[0]+p[1],x=p[0]+y*d[1]+p[2],S=g-p[3],C=_-p[0];(m||u!==0)&&(oc[0]=S,lc[0]=S,oc[1]=C,sc[1]=C,sc[0]=S+b,cc[0]=sc[0],cc[1]=C+x,lc[1]=cc[1]);let w;return u===0?Oe(Math.min(S,S+b),Math.min(C,C+x),Math.max(S,S+b),Math.max(C,C+x),ac):(w=pe(le(),n,r,1,1,u,-n,-r),I(w,oc),I(w,sc),I(w,cc),I(w,lc),Oe(Math.min(oc[0],sc[0],cc[0],lc[0]),Math.min(oc[1],sc[1],cc[1],lc[
101]),Math.max(oc[0],sc[0],cc[0],lc[0]),Math.max(oc[1],sc[1],cc[1],lc[1]),ac)),f&&(g=Math.round(g),_=Math.round(_)),{drawImageX:g,drawImageY:_,drawImageW:v,drawImageH:y,originX:c,originY:l,declutterBox:{minX:ac[0],minY:ac[1],maxX:ac[2],maxY:ac[3],value:h},canvasTransform:w,scale:d}}replayImageOrLabel_(e,t,n,r,i,a,o){let s=!!(a||o),c=r.declutterBox,l=e.canvas,u=o?o[2]*r.scale[0]/2:0;return c.minX-u<=l.width/t&&c.maxX+u>=0&&c.minY-u<=l.height/t&&c.maxY+u>=0&&(s&&this.replayTextBackground_(e,oc,sc,cc,lc,a,o),Hi(e,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){if(this.alignFill_){let t=I(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;e.save(),e.translate(t[0]%n,t[1]%n),e.rotate(this.viewRotation_)}e.fill(),this.alignFill_&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6])}drawLabelWithPointPlacement_(e,t,n,r){let i=this.textStates[t],a=this.createLabel(e,t,r,n),o=this.strokeStates[n],s=this.pixelRatio,c=fc(Array.isArray(e)?e[0]:e,i.textAlign||`center`),l=tc[i.textBaseline||`middle`],u=o&&o.lineWidth?o.lineWidth:0;return{label:a,anchorX:c*(a.width/s-2*i.scale[0])+2*(.5-c)*u,anchorY:l*a.height/s+2*(.5-l)*u}}execute_(e,t,n,r,i,a,o,s){let c;this.pixelCoordinates_&&u(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||=[],c=Yn(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),de(this.renderedTransform_,n));let l=0,d=r.length,f=0,p,m,h,g,_,v,y,b,x,S,C,w,T=0,E=0,D=null,O=null,k=this.coordinateCache_,ee=this.viewRotation_,A=Math.round(Math.atan2(-n[1],n[0])*0xe8d4a51000)/0xe8d4a51000,j={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:ee},te=this.instructions!=r||this.overlaps?0:200,M,N,P,ne;for(;l<d;){let n=r[l];switch(n[0]){case K.BEGIN_GEOMETRY:M=n[1],ne=n[3],M.getGeometry()?o!==void 0&&!Ye(o,ne.getExtent())?l=n[2]+1:++l:l=n[2];break;case K.BEGIN_PATH:T>te&&(this.fill_(e),T=0),E>te&&(e.stroke(),E=0),!T&&!E&&(e.beginPath(),g=NaN,_=NaN),++l;break;case K.CIRCLE:f=n[1];let r=c[f],u=c[f+1],d=c[f+2],re=c[f+3],ie=d-r,ae=re-u,oe=Math.sqrt(ie*ie+ae*ae);e.moveTo(r+oe,u),e.arc(r,u,oe,0,2*Math.PI,!0),++l;break;case K.CLOSE_PATH:e.closePath(),++l;break;case K.CUSTOM:f=n[1],p=n[2];let se=n[3],ce=n[4],F=n.length==6?n[5]:void 0;j.geometry=se,j.feature=M,l in k||(k[l]=[]);let le=k[l];F?F(c,f,p,2,le):(le[0]=c[f],le[1]=c[f+1],le.length=2),ce(le,j),++l;break;case K.DRAW_IMAGE:f=n[1],p=n[2],b=n[3],m=n[4],h=n[5];let ue=n[6],de=n[7],I=n[8],fe=n[9],pe=n[10],me=n[11],he=n[12],ge=n[13],_e=n[14],L=n[15];if(!b&&n.length>=20){x=n[19],S=n[20],C=n[21],w=n[22];let e=this.drawLabelWithPointPlacement_(x,S,C,w);b=e.label,n[3]=b;let t=n[23];m=(e.anchorX-t)*this.pixelRatio,n[4]=m;let r=n[24];h=(e.anchorY-r)*this.pixelRatio,n[5]=h,ue=b.height,n[6]=ue,ge=b.width,n[13]=ge}let ve;n.length>25&&(ve=n[25]);let ye,be,xe;n.length>17?(ye=n[16],be=n[17],xe=n[18]):(ye=ji,be=!1,xe=!1),pe&&A?me+=ee:!pe&&!A&&(me-=ee);let Se=0;for(;f<p;f+=2){if(ve&&ve[Se++]<ge/this.pixelRatio)continue;let n=this.calculateImageOrLabelDimensions_(b.width,b.height,c[f],c[f+1],ge,ue,m,h,I,fe,me,he,i,ye,be||xe,M),r=[e,t,b,n,de,be?D:null,xe?O:null];if(s){if(_e===`none`)continue;if(_e===`obstacle`){s.insert(n.declutterBox);continue}else{let e,t;if(L){let n=p-f;if(!L[n]){L[n]=r;continue}if(e=L[n],delete L[n],t=uc(e),s.collides(t))continue}if(s.collides(n.declutterBox))continue;e&&(s.insert(t),this.replayImageOrLabel_.apply(this,e)),s.insert(n.declutterBox)}}this.replayImageOrLabel_.apply(this,r)}++l;break;case K.DRAW_CHARS:let Ce=n[1],we=n[2],Te=n[3],Ee=n[4];w=n[5];let De=n[6],Oe=n[7],ke=n[8];C=n[9];let Ae=n[10];x=n[11],S=n[12];let je=[n[13],n[13]],Me=this.textStates[S],Ne=Me.font,Pe=[Me.scale[0]*Oe,Me.scale[1]*Oe],Fe;Ne in this.widths_?Fe=this.widths_[Ne]:(Fe={},this.widths_[Ne]=Fe);let Ie=Fs(c,Ce,we,2),Le=Math.abs(Pe[0])*Bi(Ne,x,Fe);if(Ee||Le<=Ie){let n=this.textStates[S].textAlign,r=(Ie-Le)*tc[n],i=ic(c,Ce,we,2,x,r,De,Math.abs(Pe[0]),Bi,Ne,Fe,A?0:this.viewRotation_);drawChars:if(i){let n=[],r,a,o,c,l;if(C)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,S,``,C),m=l[2]+(Pe[0]<0?-Ae:Ae),h=Te*c.height+(.5-Te)*2*Ae*Pe[1]/Pe[0]-ke;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,m,h,0,0,l[3],je,!1,ji,!1,M);if(s&&s.collides(a.declutterBox))break drawChars;n.push([e,t,c,a,1,null,null])}if(w)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,S,w,``),m=l[2],h=Te*c.height-ke;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,m,h,0,0,l[3],je,!1,ji,!1,M);if(s&&s.collides(a.declutterBox))break drawChars;n.push([e,t,c,a,1,null,null])}s&&s.load(n.map(uc));for(let e=0,t=n.length;e<t;++e)this.replayImageOrLabel_.apply(this,n[e])}}++l;break;case K.END_GEOMETRY:if(a!==void 0){M=n[1];let e=a(M,ne);if(e)return e}++l;break;case K.FILL:te?T++:this.fill_(e),++l;break;case K.MOVE_TO_LINE_TO:for(f=n[1],p=n[2],N=c[f],P=c[f+1],v=N+.5|0,y=P+.5|0,(v!==g||y!==_)&&(e.moveTo(N,P),g=v,_=y),f+=2;f<p;f+=2)N=c[f],P=c[f+1],v=N+.5|0,y=P+.5|0,(f==p-2||v!==g||y!==_)&&(e.lineTo(N,P),g=v,_=y);++l;break;case K.SET_FILL_STYLE:D=n,this.alignFill_=n[2],T&&(this.fill_(e),T=0,E&&=(e.stroke(),0)),e.fillStyle=n[1],++l;break;case K.SET_STROKE_STYLE:O=n,E&&=(e.stroke(),0),this.setStrokeStyle_(e,n),++l;break;case K.STROKE:te?E++:e.stroke(),++l;break;default:++l;break}}T&&this.fill_(e),E&&e.stroke()}execute(e,t,n,r,i,a){this.viewRotation_=r,this.execute_(e,t,n,this.instructions,i,void 0,void 0,a)}executeHitDetection(e,t,n,r,i){return this.viewRotation_=n,this.execute_(e,1,t,this.hitDetectionInstructions,!0,r,i)}},hc=[`Polygon`,`Circle`,`LineString`,`Image`,`Text`,`Default`],gc=class{constructor(e,t,n,r,i,a){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_
10={},this.hitDetectionContext_=null,this.hitDetectionTransform_=le(),this.createExecutors_(i)}clip(e,t){let n=this.getClipCoords(t);e.beginPath(),e.moveTo(n[0],n[1]),e.lineTo(n[2],n[3]),e.lineTo(n[4],n[5]),e.lineTo(n[6],n[7]),e.clip()}createExecutors_(e){for(let t in e){let n=this.executorsByZIndex_[t];n===void 0&&(n={},this.executorsByZIndex_[t]=n);let r=e[t];for(let e in r){let t=r[e];n[e]=new mc(this.resolution_,this.pixelRatio_,this.overlaps_,t)}}}hasExecutors(e){for(let t in this.executorsByZIndex_){let n=this.executorsByZIndex_[t];for(let t=0,r=e.length;t<r;++t)if(e[t]in n)return!0}return!1}forEachFeatureAtCoordinate(e,t,n,r,i,a){r=Math.round(r);let s=r*2+1,c=pe(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-n,-e[0],-e[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=_i(s,s,void 0,{willReadFrequently:!0}));let u=this.hitDetectionContext_;u.canvas.width!==s||u.canvas.height!==s?(u.canvas.width=s,u.canvas.height=s):l||u.clearRect(0,0,s,s);let d;this.renderBuffer_!==void 0&&(d=De(),Pe(d,e),be(d,t*(this.renderBuffer_+r),d));let f=vc(r),p;function m(e,t){let n=u.getImageData(0,0,s,s).data;for(let o=0,c=f.length;o<c;o++)if(n[f[o]]>0){if(!a||p!==`Image`&&p!==`Text`||a.includes(e)){let n=(f[o]-3)/4,a=r-n%s,c=r-(n/s|0),l=i(e,t,a*a+c*c);if(l)return l}u.clearRect(0,0,s,s);break}}let h=Object.keys(this.executorsByZIndex_).map(Number);h.sort(o);let g,_,v,y,b;for(g=h.length-1;g>=0;--g){let e=h[g].toString();for(v=this.executorsByZIndex_[e],_=hc.length-1;_>=0;--_)if(p=hc[_],y=v[p],y!==void 0&&(b=y.executeHitDetection(u,c,n,m,d),b))return b}}getClipCoords(e){let t=this.maxExtent_;if(!t)return null;let n=t[0],r=t[1],i=t[2],a=t[3],o=[n,r,n,a,i,a,i,r];return Yn(o,0,8,2,e,o),o}isEmpty(){return _(this.executorsByZIndex_)}execute(e,t,n,r,i,a,s){let c=Object.keys(this.executorsByZIndex_).map(Number);c.sort(o),this.maxExtent_&&(e.save(),this.clip(e,n)),a||=hc;let l,u,d,f,p,m;for(s&&c.reverse(),l=0,u=c.length;l<u;++l){let o=c[l].toString();for(p=this.executorsByZIndex_[o],d=0,f=a.length;d<f;++d){let o=a[d];m=p[o],m!==void 0&&m.execute(e,t,n,r,i,s)}}this.maxExtent_&&e.restore()}},_c={};function vc(e){if(_c[e]!==void 0)return _c[e];let t=e*2+1,n=e*e,r=Array(n+1);for(let i=0;i<=e;++i)for(let a=0;a<=e;++a){let o=i*i+a*a;if(o>n)break;let s=r[o];s||(s=[],r[o]=s),s.push(((e+i)*t+(e+a))*4+3),i>0&&s.push(((e-i)*t+(e+a))*4+3),a>0&&(s.push(((e+i)*t+(e-a))*4+3),i>0&&s.push(((e-i)*t+(e-a))*4+3))}let i=[];for(let e=0,t=r.length;e<t;++e)r[e]&&i.push(...r[e]);return _c[e]=i,i}var yc=class extends Js{constructor(e,t,n,r,i,a,o){super(),this.context_=e,this.pixelRatio_=t,this.extent_=n,this.transform_=r,this.transformRotation_=r?lt(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=i,this.squaredTolerance_=a,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_=``,this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=le()}drawImages_(e,t,n,r){if(!this.image_)return;let i=Yn(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.tmpLocalTransform_,s=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=s*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let e=0,t=i.length;e<t;e+=2){let t=i[e]-this.imageAnchorX_,n=i[e+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){let e=t+this.imageAnchorX_,r=n+this.imageAnchorY_;pe(o,e,r,1,1,c,-e,-r),a.setTransform.apply(a,o),a.translate(e,r),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.setTransform(1,0,0,1,0,0)}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,t,n,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=s)}drawText_(e,t,n,r){if(!this.textState_||this.text_===``)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);let i=Yn(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.textRotation_;for(this.transformRotation_===0&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);t<n;t+=r){let e=i[t]+this.textOffsetX_,n=i[t+1]+this.textOffsetY_;o!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.translate(e-this.textOffsetX_,n-this.textOffsetY_),a.rotate(o),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0
10),this.textFillState_&&a.fillText(this.text_,0,0),a.setTransform(1,0,0,1,0,0)):(this.textStrokeState_&&a.strokeText(this.text_,e,n),this.textFillState_&&a.fillText(this.text_,e,n))}}moveToLineTo_(e,t,n,r,i){let a=this.context_,o=Yn(e,t,n,r,this.transform_,this.pixelCoordinates_);a.moveTo(o[0],o[1]);let s=o.length;i&&(s-=2);for(let e=2;e<s;e+=2)a.lineTo(o[e],o[e+1]);return i&&a.closePath(),n}drawRings_(e,t,n,r){for(let i=0,a=n.length;i<a;++i)t=this.moveToLineTo_(e,t,n[i],r,!0);return t}drawCircle(e){if(Ye(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=ir(e,this.transform_,this.pixelCoordinates_),n=t[2]-t[0],r=t[3]-t[1],i=Math.sqrt(n*n+r*r),a=this.context_;a.beginPath(),a.arc(t[0],t[1],i,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==``&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case`Point`:this.drawPoint(e);break;case`LineString`:this.drawLineString(e);break;case`Polygon`:this.drawPolygon(e);break;case`MultiPoint`:this.drawMultiPoint(e);break;case`MultiLineString`:this.drawMultiLineString(e);break;case`MultiPolygon`:this.drawMultiPolygon(e);break;case`GeometryCollection`:this.drawGeometryCollection(e);break;case`Circle`:this.drawCircle(e);break;default:}}drawFeature(e,t){let n=t.getGeometryFunction()(e);!n||!Ye(this.extent_,n.getExtent())||(this.setStyle(t),this.drawGeometry(n))}drawGeometryCollection(e){let t=e.getGeometriesArray();for(let e=0,n=t.length;e<n;++e)this.drawGeometry(t[e])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Ye(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(n,0,n.length,e.getStride(),!1),t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getExtent();if(Ye(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates(),r=0,i=e.getEnds(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e)r=this.moveToLineTo_(n,r,i[e],a,!1);t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoints();this.drawText_(t,0,t.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Ye(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Ye(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getOrientedFlatCoordinates(),r=0,i=e.getEndss(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e){let t=i[e];r=this.drawRings_(n,r,t,a)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){let t=this.context_,n=this.contextFillState_;n?n.fillStyle!=e.fillStyle&&(n.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){let t=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=e.lineCap&&(n.lineCap=e.lineCap,t.lineCap=e.lineCap),u(n.lineDash,e.lineDash)||t.setLineDash(n.lineDash=e.lineDash),n.lineDashOffset!=e.lineDashOffset&&(n.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),n.lineJoin!=e.lineJoin&&(n.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),n.lineWidth!=e.lineWidth&&(n.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),n.miterLimit!=e.miter
10Limit&&(n.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),n.strokeStyle!=e.strokeStyle&&(n.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){let t=this.context_,n=this.contextTextState_,r=e.textAlign?e.textAlign:ki;n?(n.font!=e.font&&(n.font=e.font,t.font=e.font),n.textAlign!=r&&(n.textAlign=r,t.textAlign=r),n.textBaseline!=e.textBaseline&&(n.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(!e)this.fillState_=null;else{let t=e.getColor();this.fillState_={fillStyle:Qa(t||wi)}}if(!t)this.strokeState_=null;else{let e=t.getColor(),n=t.getLineCap(),r=t.getLineDash(),i=t.getLineDashOffset(),a=t.getLineJoin(),o=t.getWidth(),s=t.getMiterLimit(),c=r||Ei;this.strokeState_={lineCap:n===void 0?Ti:n,lineDash:this.pixelRatio_===1?c:c.map(e=>e*this.pixelRatio_),lineDashOffset:(i||0)*this.pixelRatio_,lineJoin:a===void 0?Di:a,lineWidth:(o===void 0?1:o)*this.pixelRatio_,miter
10Limit:s===void 0?10:s,strokeStyle:Qa(e||Oi)}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}let n=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),i=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*n,this.imageAnchorY_=r[1]*n,this.imageHeight_=t[1]*n,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=i[0],this.imageOriginY_=i[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();let a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=t[0]*n}setTextStyle(e){if(!e)this.text_=``;else{let t=e.getFill();if(!t)this.textFillState_=null;else{let e=t.getColor();this.textFillState_={fillStyle:Qa(e||wi)}}let n=e.getStroke();if(!n)this.textStrokeState_=null;else{let e=n.getColor(),t=n.getLineCap(),r=n.getLineDash(),i=n.getLineDashOffset(),a=n.getLineJoin(),o=n.getWidth(),s=n.getMiterLimit();this.textStrokeState_={lineCap:t===void 0?Ti:t,lineDash:r||Ei,lineDashOffset:i||0,lineJoin:a===void 0?Di:a,lineWidth:o===void 0?1:o,miterLimit:s===void 0?10:s,strokeStyle:Qa(e||Oi)}}let r=e.getFont(),i=e.getOffsetX(),a=e.getOffsetY(),o=e.getRotateWithView(),s=e.getRotation(),c=e.getScaleArray(),l=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r===void 0?Ci:r,textAlign:u===void 0?ki:u,textBaseline:d===void 0?Ai:d},this.text_=l===void 0?``:Array.isArray(l)?l.reduce((e,t,n)=>e+=n%2?` `:t,``):l,this.textOffsetX_=i===void 0?0:this.pixelRatio_*i,this.textOffsetY_=a===void 0?0:this.pixelRatio_*a,this.textRotateWithView_=o===void 0?!1:o,this.textRotation_=s===void 0?0:s,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}},bc=.5;function xc(e,t,n,r,i,a,s){let c=_i(e[0]*bc,e[1]*bc);c.imageSmoothingEnabled=!1;let l=c.canvas,u=new yc(c,bc,i,null,s),d=n.length,f=Math.floor((256*256*256-1)/d),p={};for(let e=1;e<=d;++e){let t=n[e-1],o=t.getStyleFunction()||r;if(!r)continue;let s=o(t,a);if(!s)continue;Array.isArray(s)||(s=[s]);let c=(e*f).toString(16).padStart(7,`#00000`);for(let e=0,n=s.length;e<n;++e){let n=s[e],r=n.getGeometryFunction()(t);if(!r||!Ye(i,r.getExtent()))continue;let a=n.clone(),o=a.getFill();o&&o.setColor(c);let l=a.getStroke();l&&(l.setColor(c),l.setLineDash(null)),a.setText(void 0);let u=n.getImage();if(u&&u.getOpacity()!==0){let e=u.getImageSize();if(!e)continue;let t=_i(e[0],e[1],void 0,{alpha:!1}),n=t.canvas;t.fillStyle=c,t.fillRect(0,0,n.width,n.height),a.setImage(new oo({img:n,imgSize:e,anchor:u.getAnchor(),anchorXUnits:`pixels`,anchorYUnits:`pixels`,offset:u.getOrigin(),opacity:1,size:u.getSize(),scale:u.getScale(),rotation:u.getRotation(),rotateWithView:u.getRotateWithView()}))}let d=a.getZIndex()||0,f=p[d];f||(f={},p[d]=f,f.Polygon=[],f.Circle=[],f.LineString=[],f.Point=[]);let m=r.getType();if(m===`GeometryCollection`){let e=r.getGeometriesArrayRecursive();for(let t=0,n=e.length;t<n;++t){let n=e[t];f[n.getType().replace(`Multi`,``)].push(n,a)}}else f[m.replace(`Multi`,``)].push(r,a)}}let m=Object.keys(p).map(Number).sort(o);for(let e=0,n=m.length;e<n;++e){let n=p[m[e]];for(let e in n){let r=n[e];for(let e=0,n=r.length;e<n;e+=2){u.setStyle(r[e+1]);for(let n=0,i=t.length;n<i;++n)u.setTransform(t[n]),u.drawGeometry(r[e])}}}return c.getImageData(0,0,l.width,l.height)}function Sc(e,t,n){let r=[];if(n){let i=Math.floor(Math.round(e[0])*bc),a=Math.floor(Math.round(e[1])*bc),o=(z(i,0,n.width-1)+z(a,0,n.height-1)*n.width)*4,s=n.data[o],c=n.data[o+1],l=n.data[o+2]+256*(c+256*s),u=Math.floor((256*256*256-1)/t.length);l&&l%u===0&&r.push(t[l/u-1])}return r}var Cc=.5,wc={Point:Ic,LineString:Nc,Polygon:Rc,MultiPoint:Lc,MultiLineString:Pc,MultiPolygon:Fc,GeometryCollection:Mc,Circle:Oc};function Tc(e,t){return parseInt(D(e),10)-parseInt(D(t),10)}function Ec(e,t){let n=Dc(e,t);return n*n}function Dc(e,t){return Cc*e/t}function Oc(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let i=e.getBuilder(n.getZIndex(),`Circle`);i.setFillStrokeStyle(a,o),i.drawCircle(t,r)}let s=n.getText();if(s&&s.getText()){let a=(i||e).getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r)}}function kc(e,t,n,r,i,a,o){let s=!1,c=n.getImage();if(c){let e=c.getImageState();e==G.LOADED||e==G.ERROR?c.unlistenImageChange(i):(e==G.IDLE&&c.load(),c.listenImageChange(i),s=!0)}return Ac(e,t,n,r,a,o),s}function Ac(e,t,n,r,i,a){let o=n.getGeometryFunction()(t);if(!o)return;let s=o.simplifyTransformed(r,i);if(n.getRenderer())jc(e,s,n,t);else{let r=wc[s.getType()];r(e,s,n,t,a)}}function jc(e,t,n,r){if(t.getType()==`GeometryCollection`){let i=t.getGeometries();for(let t=0,a=i.length;t<a;++t)jc(e,i[t],n,r);return}e.getBuilder(n.getZIndex(),`Default`).drawCustom(t,r,n.getRenderer(),n.getHitDetectionRenderer())}function Mc(e,t,n,r,i){let a=t.getGeometriesArray(),o,s;for(o=0,s=a.length;o<s;++o){let t=wc[a[o].getType()];t(e,a[o],n,r,i)}}
10function Nc(e,t,n,r,i){let a=n.getStroke();if(a){let i=e.getBuilder(n.getZIndex(),`LineString`);i.setFillStrokeStyle(null,a),i.drawLineString(t,r)}let o=n.getText();if(o&&o.getText()){let a=(i||e).getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r)}}function Pc(e,t,n,r,i){let a=n.getStroke();if(a){let i=e.getBuilder(n.getZIndex(),`LineString`);i.setFillStrokeStyle(null,a),i.drawMultiLineString(t,r)}let o=n.getText();if(o&&o.getText()){let a=(i||e).getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r)}}function Fc(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(o||a){let i=e.getBuilder(n.getZIndex(),`Polygon`);i.setFillStrokeStyle(a,o),i.drawMultiPolygon(t,r)}let s=n.getText();if(s&&s.getText()){let a=(i||e).getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r)}}function Ic(e,t,n,r,i){let a=n.getImage(),o=n.getText(),s;if(a){if(a.getImageState()!=G.LOADED)return;let c=e;if(i){let l=a.getDeclutterMode();if(l!==`none`)if(c=i,l===`obstacle`){let i=e.getBuilder(n.getZIndex(),`Image`);i.setImageStyle(a,s),i.drawPoint(t,r)}else o&&o.getText()&&(s={})}let l=c.getBuilder(n.getZIndex(),`Image`);l.setImageStyle(a,s),l.drawPoint(t,r)}if(o&&o.getText()){let a=e;i&&(a=i);let c=a.getBuilder(n.getZIndex(),`Text`);c.setTextStyle(o,s),c.drawText(t,r)}}function Lc(e,t,n,r,i){let a=n.getImage(),o=n.getText(),s;if(a){if(a.getImageState()!=G.LOADED)return;let c=e;if(i){let l=a.getDeclutterMode();if(l!==`none`)if(c=i,l===`obstacle`){let i=e.getBuilder(n.getZIndex(),`Image`);i.setImageStyle(a,s),i.drawMultiPoint(t,r)}else o&&o.getText()&&(s={})}let l=c.getBuilder(n.getZIndex(),`Image`);l.setImageStyle(a,s),l.drawMultiPoint(t,r)}if(o&&o.getText()){let a=e;i&&(a=i);let c=a.getBuilder(n.getZIndex(),`Text`);c.setTextStyle(o,s),c.drawText(t,r)}}function Rc(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let i=e.getBuilder(n.getZIndex(),`Polygon`);i.setFillStrokeStyle(a,o),i.drawPolygon(t,r)}let s=n.getText();if(s&&s.getText()){let a=(i||e).getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r)}}var zc=class extends Ds{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=De(),this.wrappedRenderedExtent_=De(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(e,t,n){let r=t.extent,i=t.viewState,a=i.center,o=i.resolution,s=i.projection,c=i.rotation,l=s.getExtent(),u=this.getLayer().getSource(),d=t.pixelRatio,f=t.viewHints,p=!(f[V.ANIMATING]||f[V.INTERACTING]),m=this.compositionContext_,h=Math.round(t.size[0]*d),g=Math.round(t.size[1]*d),_=u.getWrapX()&&s.canWrapX(),v=_?R(l):null,y=_?Math.ceil((r[2]-l[2])/v)+1:1,b=_?Math.floor((r[0]-l[0])/v):0;do{let t=this.getRenderTransform(a,o,c,d,h,g,b*v);e.execute(m,1,t,c,p,void 0,n)}while(++b<y)}setupCompositionContext_(){if(this.opacity_!==1){let e=_i(this.context.canvas.width,this.context.canvas.height,ws);this.compositionContext_=e}else this.compositionContext_=this.context}releaseCompositionContext_(){if(this.opacity_!==1){let e=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=e,vi(this.compositionContext_),ws.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(e){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,e,e.declutterTree),this.releaseCompositionContext_())}renderFrame(e,t){let n=e.pixelRatio,r=e.layerStatesArray[e.layerIndex];fe(this.pixelTransform,1/n,1/n),me(this.inversePixelTransform,this.pixelTransform);let i=_e(this.pixelTransform);this.useContainer(t,i,this.getBackground(e));let a=this.context,o=a.canvas,s=this.replayGroup_,c=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!c||c.isEmpty()))return null;let l=Math.round(e.size[0]*n),u=Math.round(e.size[1]*n);o.width!=l||o.height!=u?(o.width=l,o.height=u,o.style.transform!==i&&(o.style.transform=i)):this.containerReused||a.clearRect(0,0,l,u),this.preRender(a,e);let d=e.viewState,f=d.projection;this.opacity_=r.opacity,this.setupCompositionContext_();let p=!1,m=!0;if(r.extent&&this.clipping){let t=An(r.extent,f);m=Ye(t,e.extent),p=m&&!we(t,e.extent),p&&this.clipUnrotated(this.compositionContext_,e,t)}return m&&this.renderWorlds(s,e),p&&this.compositionContext_.restore(
10),this.releaseCompositionContext_(),this.postRender(a,e),this.renderedRotation_!==d.rotation&&(this.renderedRotation_=d.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(e){return new Promise(t=>{if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){let e=[this.context.canvas.width,this.context.canvas.height];I(this.pixelTransform,e);let t=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,i=this.renderedProjection_,a=this.wrappedRenderedExtent_,o=this.getLayer(),s=[],c=e[0]*bc,l=e[1]*bc;s.push(this.getRenderTransform(t,n,r,bc,c,l,0).slice());let u=o.getSource(),d=i.getExtent();if(u.getWrapX()&&i.canWrapX()&&!we(d,a)){let e=a[0],i=R(d),o=0,u;for(;e<d[0];)--o,u=i*o,s.push(this.getRenderTransform(t,n,r,bc,c,l,u).slice()),e+=i;for(o=0,e=a[2];e>d[2];)++o,u=i*o,s.push(this.getRenderTransform(t,n,r,bc,c,l,u).slice()),e-=i}this.hitDetectionImageData_=xc(e,s,this.renderedFeatures_,o.getStyleFunction(),a,n,r)}t(Sc(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,n,r,i){if(!this.replayGroup_)return;let a=t.viewState.resolution,o=t.viewState.rotation,s=this.getLayer(),c={},l=function(e,t,n){let a=D(e),o=c[a];if(!o){if(n===0)return c[a]=!0,r(e,s,t);i.push(c[a]={feature:e,layer:s,geometry:t,distanceSq:n,callback:r})}else if(o!==!0&&n<o.distanceSq){if(n===0)return c[a]=!0,i.splice(i.lastIndexOf(o),1),r(e,s,t);o.geometry=t,o.distanceSq=n}},u,d=[this.replayGroup_];return this.declutterExecutorGroup&&d.push(this.declutterExecutorGroup),d.some(r=>u=r.forEachFeatureAtCoordinate(e,a,o,n,l,r===this.declutterExecutorGroup&&t.declutterTree?t.declutterTree.all().map(e=>e.value):null)),u}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){let t=this.getLayer(),n=t.getSource();if(!n)return!1;let r=e.viewHints[V.ANIMATING],i=e.viewHints[V.INTERACTING],a=t.getUpdateWhileAnimating(),o=t.getUpdateWhileInteracting();if(this.ready&&!a&&r||!o&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let s=e.extent,c=e.viewState,l=c.projection,d=c.resolution,f=e.pixelRatio,p=t.getRevision(),m=t.getRenderBuffer(),h=t.getRenderOrder();h===void 0&&(h=Tc);let g=c.center.slice(),_=be(s,m*d),v=_.slice(),y=[_.slice()],b=l.getExtent();if(n.getWrapX()&&l.canWrapX()&&!we(b,e.extent)){let e=R(b),t=Math.max(R(_)/2,e);_[0]=b[0]-t,_[2]=b[2]+t,en(g,l);let n=et(y[0],l);n[0]<b[0]&&n[2]<b[2]?y.push([n[0]+e,n[1],n[2]+e,n[3]]):n[0]>b[0]&&n[2]>b[2]&&y.push([n[0]-e,n[1],n[2]-e,n[3]])}if(this.ready&&this.renderedResolution_==d&&this.renderedRevision_==p&&this.renderedRenderOrder_==h&&we(this.wrappedRenderedExtent_,_))return u(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let x=new rc(Dc(d,f),_,d,f),S;this.getLayer().getDeclutter()&&(S=new rc(Dc(d,f),_,d,f));let C=En(),w;if(C){for(let e=0,t=y.length;e<t;++e){let t=y[e],r=kn(t,l);n.loadFeatures(r,jn(d,l),C)}w=xn(C,l)}else for(let e=0,t=y.length;e<t;++e)n.loadFeatures(y[e],d,l);let T=Ec(d,f),E=!0,D=e=>{let n,r=e.getStyleFunction()||t.getStyleFunction();if(r&&(n=r(e,d)),n){let t=this.renderFeature(e,T,n,x,w,S);E&&=!t}},O=kn(_,l),k=n.getFeaturesInExtent(O);h&&k.sort(h);for(let e=0,t=k.length;e<t;++e)D(k[e]);this.renderedFeatures_=k,this.ready=E;let ee=x.finish(),A=new gc(_,d,f,n.getOverlaps(),ee,t.getRenderBuffer());return S&&(this.declutterExecutorGroup=new gc(_,d,f,n.getOverlaps(),S.finish(),t.getRenderBuffer())),this.renderedResolution_=d,this.renderedRevision_=p,this.renderedRenderOrder_=h,this.renderedExtent_=v,this.wrappedRenderedExtent_=_,this.renderedCenter_=g,this.renderedProjection_=l,this.replayGroup_=A,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,n,r,i,a){if(!n)return!1;let o=!1;if(Array.isArray(n))for(let s=0,c=n.length;s<c;++s)o=kc(r,e,n[s],t,this.boundHandleStyleImageChange_,i,a)||o;else o=kc(r,e,n,t,this.boundHandleStyleImageChange_,i,a);return o}},Bc=class extends Us{constructor(e){super(e)}createRenderer(){return new zc(this)}},Vc=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let n=t.dataProjection?H(t.dataProjection):this.readProjection(e);t.extent&&n&&n.getUnits()===`tile-pixels`&&(n=H(n),n.setWorldExtent(t.extent)),t={dataProjection:n,featureProjection:t.featureProjection}}return this.adaptOptions(t)}
10adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},e)}getType(){return T()}readFeature(e,t){return T()}readFeatures(e,t){return T()}readGeometry(e,t){return T()}readProjection(e){return T()}writeFeature(e,t){return T()}writeFeatures(e,t){return T()}writeGeometry(e,t){return T()}};function Hc(e,t,n){let r=n?H(n.featureProjection):null,i=n?H(n.dataProjection):null,a;if(a=r&&i&&!bn(r,i)?(t?e.clone():e).transform(t?r:i,t?i:r):e,t&&n&&n.decimals!==void 0){let t=10**n.decimals;a===e&&(a=e.clone()),a.applyTransform(function(e){for(let n=0,r=e.length;n<r;++n)e[n]=Math.round(e[n]*t)/t;return e})}return a}var Uc=class e extends tr{constructor(e,t,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(t!==void 0&&n)this.setFlatCoordinates(t,e),this.ends_=n;else{let t=this.getLayout(),n=e,r=[],i=[];for(let e=0,a=n.length;e<a;++e){let a=n[e];e===0&&(t=a.getLayout()),l(r,a.getFlatCoordinates()),i.push(r.length)}this.setFlatCoordinates(t,r),this.ends_=i}}appendLineString(e){this.flatCoordinates?l(this.flatCoordinates,e.getFlatCoordinates().slice()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Se(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(sr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),ur(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,n,r))}getCoordinateAtM(e,t,n){return this.layout!=`XYM`&&this.layout!=`XYZM`||this.flatCoordinates.length===0?null:(t=t===void 0?!1:t,n=n===void 0?!1:n,Ps(this.flatCoordinates,0,this.ends_,this.stride,e,t,n))}getCoordinates(){return Cr(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new Is(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){let e=this.flatCoordinates,t=this.ends_,n=this.layout,r=[],i=0;for(let a=0,o=t.length;a<o;++a){let o=t[a],s=new Is(e.slice(i,o),n);r.push(s),i=o}return r}getFlatMidpoints(){let e=[],t=this.flatCoordinates,n=0,r=this.ends_,i=this.stride;for(let a=0,o=r.length;a<o;++a){let o=r[a];l(e,Ms(t,n,o,i,.5)),n=o}return e}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=_r(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,`XY`,r)}getType(){return`MultiLineString`}intersectsExtent(e){return Rr(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||=[];let n=mr(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}},Wc=class e extends tr{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){this.flatCoordinates?l(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<Se(this.getExtent(),e,t))return r;let i=this.flatCoordinates,a=this.stride;for(let o=0,s=i.length;o<s;o+=a){let s=rt(e,t,i[o],i[o+1]);if(s<r){r=s;for(let e=0;e<a;++e)n[e]=i[o+e];n.length=a}}return r}getCoordinates(){return Sr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){let t=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return e<0||t<=e?null:new kr(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){let e=this.flatCoordinates,t=this.layout,n=this.stride,r=[];for(let i=0,a=e.length;i<a;i+=n){let a=new kr(e.slice(i,i+n),t);r.push(a)}return r}getType(){return`MultiPoint`}intersectsExtent(e){let t=this.flatCoordinates,n=this.stride;for(let r=0,i=t.length;r<i;r+=n){let n=t[r],i=t[r+1];if(Te(e,n,i))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||=[],this.flatCoordinates.length=pr(this.flatCoordinates,0,e,this.stride),this.changed()}};function Gc(e,t,n,r){let i=[],a=De();for(let o=0,s=n.length;o<s;++o){let s=n[o];a=je(e,t,s[0],r),i.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=s[s.length-1]}return i}var Kc=class e extends tr{constructor(e,t,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){let r=this.getLayout(),i=e,a=[],o=[];for(let e=0,t=i.length;e<t;++e){let t=i[e];e===0&&(r=t.getLayout());let n=a.length,s=t.getEnds();for(let e=0,t=s.length;e<t;++e)s[e]+=n;l(a,t.getFlatCoordinates()),o.push(s)}t=r,e=a,n=o}t!==void 0&&n?(this.setFlatCoordinates(t,e),this.endss_=n):this.setCoordinates(e,t)}appendPolygon(e){let t;if(!this.flatCoordinates)this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();else{let n=this.flatCoordinates.length;l(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let e=0,r=t.length;e<r;++e)t[e]+=n}this.endss_.push(t),this.changed()}clone(){let t=this.endss_.length,n=Array(t);for(let e=0;e<t;++e)n[e]=this.endss_[e].slice();let r=new e(this.flatCoordinates.slice(),this.layout,n);return r.applyProperties(this),r}closestPointXY(e,t,n,r){return r<Se(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(cr(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),dr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return Nr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return Dr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),qr(t,0,this.endss_,this.stride,e)),wr(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){let e=Gc(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=Fr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Wc(this.getFlatInteriorPoints().slice(),`XYM`)}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;Gr(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=qr(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=xr(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(e===0)t=0;else{let n=this.endss_[e-1];t=n[n.length-1]}let n=this.endss_[e].slice(),r=n[n.length-1];if(t!==0)for(let e=0,r=n.length;e<r;++e)n[e]-=t;return new Jr(this.flatCoordinates.slice(t,r),this.layout,n)}getPolygons(){let e=this.layout,t=this.flatCoordinates,n=this.endss_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a].slice(),s=o[o.length-1];if(i!==0)for(let e=0,t=o.length;e<t;++e)o[e]-=i;let c=new Jr(t.slice(i,s),e,o);r.push(c),i=s}return r}getType(){return`MultiPolygon`}intersectsExtent(e){return Vr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||=[];let n=hr(this.flatCoordinates,0,e,this.stride,this.endss_);if(n.length===0)this.flatCoordinates.length=0;else{let e=n[n.length-1];this.flatCoordinates.length=e.length===0?0:e[e.length-1]}this.changed()}},qc=class e extends er{constructor(e){super(),this.geometries_=e||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(S),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let e=0,t=this.geometries_.length;e<t;
10++e)this.changeEventsKeys_.push(b(this.geometries_[e],y.CHANGE,this.changed,this))}clone(){let t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t}closestPointXY(e,t,n,r){if(r<Se(this.getExtent(),e,t))return r;let i=this.geometries_;for(let a=0,o=i.length;a<o;++a)r=i[a].closestPointXY(e,t,n,r);return r}containsXY(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)if(n[r].containsXY(e,t))return!0;return!1}computeExtent(e){ke(e);let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)Ne(e,t[n].getExtent());return e}getGeometries(){return Jc(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].getType()===this.getType()?e=e.concat(t[n].getGeometriesArrayRecursive()):e.push(t[n]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let n=[],r=this.geometries_,i=!1;for(let e=0,a=r.length;e<a;++e){let a=r[e],o=a.getSimplifiedGeometry(t);n.push(o),o!==a&&(i=!0)}if(i){let t=new e(null);return t.setGeometriesArray(n),t}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return`GeometryCollection`}intersectsExtent(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)if(t[n].intersectsExtent(e))return!0;return!1}isEmpty(){return this.geometries_.length===0}rotate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].rotate(e,t);this.changed()}scale(e,t,n){n||=Ve(this.getExtent());let r=this.geometries_;for(let i=0,a=r.length;i<a;++i)r[i].scale(e,t,n);this.changed()}setGeometries(e){this.setGeometriesArray(Jc(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let n=0,r=t.length;n<r;++n)t[n].applyTransform(e);this.changed()}translate(e,t){let n=this.geometries_;for(let r=0,i=n.length;r<i;++r)n[r].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function Jc(e){let t=[];for(let n=0,r=e.length;n<r;++n)t.push(e[n].clone());return t}var Yc=class extends Vc{constructor(){super()}getType(){return`json`}readFeature(e,t){return this.readFeatureFromObject(Xc(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(Xc(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return T()}readFeaturesFromObject(e,t){return T()}readGeometry(e,t){return this.readGeometryFromObject(Xc(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return T()}readProjection(e){return this.readProjectionFromObject(Xc(e))}readProjectionFromObject(e){return T()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return T()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return T()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return T()}};function Xc(e){return typeof e==`string`?JSON.parse(e)||null:e===null?null:e}var Zc=class extends Yc{constructor(e){e||={},super(),this.dataProjection=H(e.dataProjection?e.dataProjection:`EPSG:4326`),e.featureProjection&&(this.defaultFeatureProjection=H(e.featureProjection)),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=[`application/geo+json`,`application/vnd.geo+json`]}readFeatureFromObject(e,t){let n=null;n=e.type===`Feature`?e:{type:`Feature`,geometry:e,properties:null};let r=Qc(n.geometry,t),i=new Ya;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&`geometry_name`in n!==void 0&&i.setGeometryName(n.geometry_name),i.setGeometry(r),`id`in n&&i.setId(n.id),n.properties&&i.setProperties(n.properties,!0),i}readFeaturesFromObject(e,t){let n=e,r=null;if(n.type===`FeatureCollection`){let n=e;r=[];let i=n.features;for(let e=0,n=i.length;e<n;++e)r.push(this.readFeatureFromObject(i[e],t))}else r=[this.readFeatureFromObject(e,t)];return r}readGeometryFromObject(e,t){return Qc(e,t)}readProjectionFromObject(e){let t=e.crs,n;return t?t.type==`name`?n=H(t.properties.name):t.type===`EPSG`?n=H(`EPSG:`+t.properties.code):F(!1,36):n=this.dataProjection,n}writeFeatureObject(e,t){t=this.adaptOptions(t);let n={type:`Feature`,geometry:null,properties:null},r=e.getId();if(r!==void 0&&(n.id=r),!e.hasProperties())return n;let i=e.getProperties(),a=e.getGeometry();return a&&(n.geometry=ol(a,t),delete i[e.getGeometryName()]),_(i)||(n.properties=i),n}writeFeaturesObject(e,t){t=this.adaptOptions(t);let n=[];for(let r=0,i=e.length;r<i;++r)n.push(this.writeFeatureObject(e[r],t));return{type:`FeatureCollection`,features:n}}writeGeometryObject(e,t){return ol(e,this.adaptOptions(t))}};function Qc(e,t){if(!e)return null;let n;switch(e.type){case`Point`:n=el(e);break;case`LineString`:n=tl(e);break;
10case`Polygon`:n=al(e);break;case`MultiPoint`:n=rl(e);break;case`MultiLineString`:n=nl(e);break;case`MultiPolygon`:n=il(e);break;case`GeometryCollection`:n=$c(e);break;default:throw Error(`Unsupported GeoJSON type: `+e.type)}return Hc(n,!1,t)}function $c(e,t){return new qc(e.geometries.map(function(e){return Qc(e,t)}))}function el(e){return new kr(e.coordinates)}function tl(e){return new Is(e.coordinates)}function nl(e){return new Uc(e.coordinates)}function rl(e){return new Wc(e.coordinates)}function il(e){return new Kc(e.coordinates)}function al(e){return new Jr(e.coordinates)}function ol(e,t){e=Hc(e,!0,t);let n=e.getType(),r;switch(n){case`Point`:r=fl(e,t);break;case`LineString`:r=cl(e,t);break;case`Polygon`:r=pl(e,t);break;case`MultiPoint`:r=ul(e,t);break;case`MultiLineString`:r=ll(e,t);break;case`MultiPolygon`:r=dl(e,t);break;case`GeometryCollection`:r=sl(e,t);break;case`Circle`:r={type:`GeometryCollection`,geometries:[]};break;default:throw Error(`Unsupported geometry type: `+n)}return r}function sl(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:`GeometryCollection`,geometries:e.getGeometriesArray().map(function(e){return ol(e,t)})}}function cl(e,t){return{type:`LineString`,coordinates:e.getCoordinates()}}function ll(e,t){return{type:`MultiLineString`,coordinates:e.getCoordinates()}}function ul(e,t){return{type:`MultiPoint`,coordinates:e.getCoordinates()}}function dl(e,t){let n;return t&&(n=t.rightHanded),{type:`MultiPolygon`,coordinates:e.getCoordinates(n)}}function fl(e,t){return{type:`Point`,coordinates:e.getCoordinates()}}function pl(e,t){let n;return t&&(n=t.rightHanded),{type:`Polygon`,coordinates:e.getCoordinates(n)}}var ml=`units`,hl=[1,2,5],gl=25.4/.28,_l=class extends ia{constructor(e){e||={};let t=document.createElement(`div`);t.style.pointerEvents=`none`,super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;let n=e.className===void 0?e.bar?`ol-scale-bar`:`ol-scale-line`:e.className;this.innerElement_=document.createElement(`div`),this.innerElement_.className=n+`-inner`,this.element.className=n+` `+di,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=e.minWidth===void 0?64:e.minWidth,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_=``,this.addChangeListener(ml,this.handleUnitsChanged_),this.setUnits(e.units||`metric`),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(ml)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(ml,e)}setDpi(e){this.dpi_=e}updateElement_(){let e=this.viewState_;if(!e){this.renderedVisible_&&=(this.element.style.display=`none`,!1);return}let t=e.center,n=e.projection,r=this.getUnits(),i=r==`degrees`?`degrees`:`m`,a=mn(n,e.resolution,t,i),o=this.minWidth_*(this.dpi_||gl)/gl,s=this.maxWidth_===void 0?void 0:this.maxWidth_*(this.dpi_||gl)/gl,c=o*a,l=``;if(r==`degrees`){let e=Dt.degrees;c*=e,c<e/60?(l=`â³`,a*=3600):c<e?(l=`â²`,a*=60):l=`°`}else r==`imperial`?c<.9144?(l=`in`,a/=.0254):c<1609.344?(l=`ft`,a/=.3048):(l=`mi`,a/=1609.344):r==`nautical`?(a/=1852,l=`NM`):r==`metric`?c<.001?(l=`μm`,a*=1e6):c<1?(l=`mm`,a*=1e3):c<1e3?l=`m`:(l=`km`,a/=1e3):r==`us`?c<.9144?(l=`in`,a*=39.37):c<1609.344?(l=`ft`,a/=.30480061):(l=`mi`,a/=1609.3472):F(!1,33);let u=3*Math.floor(Math.log(o*a)/Math.log(10)),d,f,p,m,h,g;for(;;){p=Math.floor(u/3);let e=10**p;if(d=hl[(u%3+3)%3]*e,f=Math.round(d/a),isNaN(f)){this.element.style.display=`none`,this.renderedVisible_=!1;return}if(s!==void 0&&f>=s){d=m,f=h,p=g;break}else if(f>=o)break;m=d,h=f,g=p,++u}let _=this.scaleBar_?this.createScaleBar(f,d,l):d.toFixed(p<0?-p:0)+` `+l;this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=f&&(this.innerElement_.style.width=f+`px`,this.renderedWidth_=f),this.renderedVisible_||=(this.element.style.display=``,!0)}createScaleBar(e,t,n){let r=this.getScaleForResolution(),i=r<1?Math.round(1/r).toLocaleString()+` : 1`:`1 : `+Math.round(r).toLocaleString(),a=this.scaleBarSteps_,o=e/a,s=[this.createMarker(`absolute`)];for(let r=0;r<a;++r){let i=r%2==0?`ol-scale-singlebar-odd`:`ol-scale-singlebar-even`;s.push(`<div><div class="ol-scale-singlebar ${i}" style="width: ${o}px;"></div>`+this.createMarker(`relative`)+(r%2==0||a===2?this.createStepText(r,e,!1,t,n):``)+`</div>`)}return s.push(this.createStepText(a,e,!0,t,n)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+i+`</div>`:``)+s.join(``)}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${e===`absolute`?3:-10}px;"></div>`}createStepText(e,t,n,r,i){let a=(e===0?0:Math.round(r/this.scaleBarSteps_*e*100)/100)+(e===0?``:` `+i),o=e===0?-3:t/this.scaleBarSteps_*-1,s=e===0?0:t/this.scaleBarSteps_*2;return`<div class="ol-scale-step-text" style="margin-left: ${o}px;text-align: ${e===0?`left`:`center`};min-width: ${s}px;left: ${n?t+`px`:`unset`};">`+a+`</div>`}getScaleForResolution(){let e=mn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,`m`),t=this.dpi_||gl;return 1e3/25.4*e*t}render(e){let t=e.frameState;t?this.viewState_=t.viewState:this.viewState_=null,this.updateElement_()}},vl=`http://www.w3.org/2001/XMLSchema-instance`;function yl(e,t){return Il().createElementNS(e,t)}function bl(e,t){return xl(e,t,[]).join(``)}function xl(e,t,n){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)t?n.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,``)):n.push(e.nodeValue);else{let r;for(r=e.firstChild;r;r=r.nextSibling)xl(r,t,n)}return n}function Sl(e){return`documentElement`in e}function Cl(e){return new DOMParser().parseFromString(e,`application/xml`)}function wl(e,t){return(function(n,r){let i=e.call(t===void 0?this:t,n,r);i!==void 0&&r[r.length-1].push(i)})}function q(e,t,n){return(function(r,i){let a=e.call(n===void 0?this:n,r,i);if(a!==void 0){let e=i[i.length-1],n=t===void 0?r.localName:t;e[n]=a}})}function J(e,t){return function(n,r,i){e.call(t===void 0?this:t,n,r,i),i[i.length-1].node.appendChild(n)}}function Tl(e,t){let n,r;return function(t,i,a){if(n===void 0){n={};let i={};i[t.localName]=e,n[t.namespaceURI]=i,r=El(t.localName)}jl(n,r,i,a)}}function El(e,t){return(function(n,r,i){let a=r[r.length-1].node,o=e;return o===void 0&&(o=i),yl(t===void 0?a.namespaceURI:t,o)})}var Dl=El();function Ol(e,t){let n=t.length,r=Array(n);for(let i=0;i<n;++i)r[i]=e[t[i]];return r}function Y(e,t,n){n=n===void 0?{}:n;let r,i;for(r=0,i=e.length;r<i;++r)n[e[r]]=t;return n}function kl(e,t,n,r){let i;for(i=t.firstElementChild;i;i=i.nextElementSibling){let t=e[i.namespaceURI];if(t!==void 0){let e=t[i.localName];e!==void 0&&e.call(r,i,n)}}}function Al(e,t,n,r,i){return r.push(e),kl(t,n,r,i),r.pop()}function jl(e,t,n,r,i,a){let o=(i===void 0?n:i).length,s,c;for(let l=0;l<o;++l)s=n[l],s!==void 0&&(c=t.call(a===void 0?this:a,s,r,i===void 0?void 0:i[l]),c!==void 0&&e[c.namespaceURI][c.localName].call(a,c,s,r))}function Ml(e,t,n,r,i,a,o){return i.push(e),jl(t,n,r,i,a,o),i.pop()}var Nl=void 0;function Pl(){return Nl===void 0&&typeof XMLSerializer<`u`&&(Nl=new XMLSerializer),Nl}var Fl=void 0;function Il(){return Fl===void 0&&typeof document<`u`&&(Fl=document.implementation.createDocument(``,``,null)),Fl}var Ll=class extends Vc{constructor(){super(),this.xmlSerializer_=Pl()}getType(){return`xml`}readFeature(e,t){if(!e)return null;if(typeof e==`string`){let n=Cl(e);return this.readFeatureFromDocument(n,t)}else if(Sl(e))return this.readFeatureFromDocument(e,t);return this.readFeatureFromNode(e,t)}readFeatureFromDocument(e,t){let n=this.readFeaturesFromDocument(e,t);return n.length>0?n[0]:null}readFeatureFromNode(e,t){return null}readFeatures(e,t){if(!e)return[];if(typeof e==`string`){let n=Cl(e);return this.readFeaturesFromDocument(n,t)}else if(Sl(e))return this.readFeaturesFromDocument(e,t);
10return this.readFeaturesFromNode(e,t)}readFeaturesFromDocument(e,t){let n=[];for(let r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&l(n,this.readFeaturesFromNode(r,t));return n}readFeaturesFromNode(e,t){return T()}readGeometry(e,t){if(!e)return null;if(typeof e==`string`){let n=Cl(e);return this.readGeometryFromDocument(n,t)}else if(Sl(e))return this.readGeometryFromDocument(e,t);return this.readGeometryFromNode(e,t)}readGeometryFromDocument(e,t){return null}readGeometryFromNode(e,t){return null}readProjection(e){if(!e)return null;if(typeof e==`string`){let t=Cl(e);return this.readProjectionFromDocument(t)}else if(Sl(e))return this.readProjectionFromDocument(e);return this.readProjectionFromNode(e)}readProjectionFromDocument(e){return this.dataProjection}readProjectionFromNode(e){return this.dataProjection}writeFeature(e,t){let n=this.writeFeatureNode(e,t);return this.xmlSerializer_.serializeToString(n)}writeFeatureNode(e,t){return null}writeFeatures(e,t){let n=this.writeFeaturesNode(e,t);return this.xmlSerializer_.serializeToString(n)}writeFeaturesNode(e,t){return null}writeGeometry(e,t){let n=this.writeGeometryNode(e,t);return this.xmlSerializer_.serializeToString(n)}writeGeometryNode(e,t){return null}};function Rl(e){let t=bl(e,!1),n=Date.parse(t);return isNaN(n)?void 0:n/1e3}function zl(e){return Bl(bl(e,!1))}function Bl(e){let t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(e);if(t)return parseFloat(t[1])}function Vl(e){return Hl(bl(e,!1))}function Hl(e){let t=/^\s*(\d+)\s*$/.exec(e);if(t)return parseInt(t[1],10)}function X(e){return bl(e,!1).trim()}function Ul(e,t){let n=new Date(t*1e3),r=n.getUTCFullYear()+`-`+Yt(n.getUTCMonth()+1,2)+`-`+Yt(n.getUTCDate(),2)+`T`+Yt(n.getUTCHours(),2)+`:`+Yt(n.getUTCMinutes(),2)+`:`+Yt(n.getUTCSeconds(),2)+`Z`;e.appendChild(Il().createTextNode(r))}function Wl(e,t){let n=t.toPrecision();e.appendChild(Il().createTextNode(n))}function Gl(e,t){let n=t.toString();e.appendChild(Il().createTextNode(n))}function Z(e,t){e.appendChild(Il().createTextNode(t))}var Q=[null,`http://www.topografix.com/GPX/1/0`,`http://www.topografix.com/GPX/1/1`],Kl=`http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd`,ql={rte:wu,trk:Tu,wpt:Eu},Jl=Y(Q,{rte:wl(wu),trk:wl(Tu),wpt:wl(Eu)}),Yl=Y(Q,{text:q(X,`linkText`),type:q(X,`linkType`)}),Xl=Y(Q,{rte:J(ku),trk:J(Au),wpt:J(Mu)}),Zl=class extends Ll{constructor(e){super(),e||={},this.dataProjection=H(`EPSG:4326`),this.readExtensions_=e.readExtensions}handleReadExtensions_(e){e||=[];for(let t=0,n=e.length;t<n;++t){let n=e[t];if(this.readExtensions_){let e=n.get(`extensionsNode_`)||null;this.readExtensions_(n,e)}n.set(`extensionsNode_`,void 0)}}readFeatureFromNode(e,t){if(!Q.includes(e.namespaceURI))return null;let n=ql[e.localName];if(!n)return null;let r=n(e,[this.getReadOptions(e,t)]);return r?(this.handleReadExtensions_([r]),r):null}readFeaturesFromNode(e,t){if(!Q.includes(e.namespaceURI))return[];if(e.localName==`gpx`){let n=Al([],Jl,e,[this.getReadOptions(e,t)]);return n?(this.handleReadExtensions_(n),n):[]}return[]}writeFeaturesNode(e,t){t=this.adaptOptions(t);let n=yl(`http://www.topografix.com/GPX/1/1`,`gpx`);return n.setAttributeNS(`http://www.w3.org/2000/xmlns/`,`xmlns:xsi`,vl),n.setAttributeNS(vl,`xsi:schemaLocation`,Kl),n.setAttribute(`version`,`1.1`),n.setAttribute(`creator`,`OpenLayers`),Ml({node:n},Xl,gu,e,[t]),n}},Ql=Y(Q,{name:q(X),cmt:q(X),desc:q(X),src:q(X),link:yu,number:q(Vl),extensions:bu,type:q(X),rtept:xu}),$l=Y(Q,{ele:q(zl),time:q(Rl)}),eu=Y(Q,{name:q(X),cmt:q(X),desc:q(X),src:q(X),link:yu,number:q(Vl),type:q(X),extensions:bu,trkseg:Cu}),tu=Y(Q,{trkpt:Su}),nu=Y(Q,{ele:q(zl),time:q(Rl)}),ru=Y(Q,{ele:q(zl),time:q(Rl),magvar:q(zl),geoidheight:q(zl),name:q(X),cmt:q(X),desc:q(X),src:q(X),link:yu,sym:q(X),type:q(X),fix:q(X),sat:q(Vl),hdop:q(zl),vdop:q(zl),pdop:q(zl),ageofdgpsdata:q(zl),dgpsid:q(Vl),extensions:bu}),iu=[`text`,`type`],au=Y(Q,{text:J(Z),type:J(Z)}),ou=Y(Q,[`name`,`cmt`,`desc`,`src`,`link`,`number`,`type`,`rtept`]),su=Y(Q,{name:J(Z),cmt:J(Z),desc:J(Z),src:J(Z),link:J(Du),number:J(Gl),type:J(Z),rtept:Tl(J(Ou))}),cu=Y(Q,[`ele`,`time`]),lu=Y(Q,[`name`,`cmt`,`desc`,`src`,`link`,`number`,`type`,`trkseg`]),uu=Y(Q,{name:J(Z),cmt:J(Z),desc:J(Z),src:J(Z),link:J(Du),number:J(Gl),type:J(Z),trkseg:Tl(J(ju))}),du=El(`trkpt`),fu=Y(Q,{trkpt:J(Ou)}),pu=Y(Q,[`ele`,`time`,`magvar`,`geoidheight`,`name`,`cmt`,`desc`,`src`,`link`,`sym`,`type`,`fix`,`sat`,`hdop`,`vdop`,`pdop`,`ageofdgpsdata`,`dgpsid`]),mu=Y(Q,{ele:J(Wl),time:J(Ul),magvar:J(Wl),geoidheight:J(Wl),name:J(Z),cmt:J(Z),desc:J(Z),src:J(Z),link:J(Du),sym:J(Z),type:J(Z),fix:J(Z),sat:J(Gl),hdop:J(Wl),vdop:J(Wl),pdop:J(Wl),ageofdgpsdata:J(Wl),dgpsid:J(Gl)}),hu={Point:`wpt`,LineString:`rte`,MultiLineString:`trk`};function gu(e,t,n){let r=e.getGeometry();if(r){let e=hu[r.getType()];if(e){let n=t[t.length-1].node;return yl(n.namespaceURI,e)}}}function _u(e,t,n,r){return e.push(parseFloat(n.getAttribute(`lon`)),parseFloat(n.getAttribute(`lat`))),`ele`in r?(e.push(r.ele),delete r.ele,t.hasZ=!0):e.push(0),`time`in r?(e.push(r.time),delete r.time,t.hasM=!0):e.push(0),e}function vu(e,t,n){let r=`XY`,i=2;if(e.hasZ&&e.hasM?(r=`XYZM`,i=4):e.hasZ?(r=`XYZ`,i=3):e.hasM&&(r=`XYM`,i=3),i!==4){for(let n=0,r=t.length/4;n<r;n++)t[n*i]=t[n*4],t[n*i+1]=t[n*4+1],e.hasZ&&(t[n*i+2]=t[n*4+2]),e.hasM&&(t[n*i+2]=t[n*4+3]);if(t.length=t.length/4*i,n)for(let e=0,t=n.length;e<t;e++)n[e]=n[e]/4*i}return r}function yu(e,t){let n=t[t.length-1],r=e.getAttribute(`href`);r!==null&&(n.link=r),kl(Yl,e,t)}function bu(e,t){let n=t[t.length-1];n.extensionsNode_=e}function xu(e,t){let n=Al({},$l,e,t);if(n){let r=t[t.length-1],i=r.flatCoordinates,a=r.layoutOptions;_u(i,a,e,n)}}function Su(e,t){let n=Al({},nu,e,t);if(n){let r=t[t.length-1],i=r.flatCoordinates,a=r.layoutOptions;_u(i,a,e,n)}}function Cu(e,t){let n=t[t.length-1];kl(tu,e,t);let r=n.flatCoordinates;n.ends.push(r.length)}function wu(e,t){let n=t[0],r=Al({flatCoordinates:[],layoutOptions:{}},Ql,e,t);if(!r)return;let i=r.flatCoordinates;delete r.flatCoordinates;let a=r.layoutOptions;delete r.layoutOptions;let o=new Is(i,vu(a,i));Hc(o,!1,n);let s=new Ya(o);return s.setProperties(r,!0),s}function Tu(e,t){let n=t[0],r=Al({flatCoordinates:[],ends:[],layoutOptions:{}},eu,e,t);if(!r)return;let i=r.flatCoordinates;delete r.flatCoordinates;let a=r.ends;delete r.ends;let o=r.layoutOptions;delete r.layoutOptions;let s=new Uc(i,vu(o,i,a),a);Hc(s,!1,n);let c=new Ya(s);return c.setProperties(r,!0),c}function Eu(e,t){let n=t[0],r=Al({},ru,e,t);if(!r)return;let i={},a=_u([],i,e,r),o=new kr(a,vu(i,a));Hc(o,!1,n);let s=new Ya(o);return s.setProperties(r,!0),s}function Du(e,t,n){e.setAttribute(`href`,t);let r=n[n.length-1].properties,i=[r.linkText,r.linkType];Ml({node:e},au,Dl,i,n,iu)}function Ou(e,t,n){let r=n[n.length-1],i=r.node.namespaceURI,a=r.properties;switch(e.setAttributeNS(null,`lat`,String(t[1])),e.setAttributeNS(null,`lon`,String(t[0])
10),r.geometryLayout){case`XYZM`:t[3]!==0&&(a.time=t[3]);case`XYZ`:t[2]!==0&&(a.ele=t[2]);break;case`XYM`:t[2]!==0&&(a.time=t[2]);break;default:}let o=e.nodeName==`rtept`?cu[i]:pu[i],s=Ol(a,o);Ml({node:e,properties:a},mu,Dl,s,n,o)}function ku(e,t,n){let r=n[0],i=t.getProperties(),a={node:e};a.properties=i;let o=t.getGeometry();if(o.getType()==`LineString`){let e=Hc(o,!0,r);a.geometryLayout=e.getLayout(),i.rtept=e.getCoordinates()}let s=ou[n[n.length-1].node.namespaceURI];Ml(a,su,Dl,Ol(i,s),n,s)}function Au(e,t,n){let r=n[0],i=t.getProperties(),a={node:e};a.properties=i;let o=t.getGeometry();o.getType()==`MultiLineString`&&(i.trkseg=Hc(o,!0,r).getLineStrings());let s=lu[n[n.length-1].node.namespaceURI];Ml(a,uu,Dl,Ol(i,s),n,s)}function ju(e,t,n){let r={node:e};r.geometryLayout=t.getLayout(),r.properties={},Ml(r,fu,du,t.getCoordinates(),n)}function Mu(e,t,n){let r=n[0],i=n[n.length-1];i.properties=t.getProperties();let a=t.getGeometry();if(a.getType()==`Point`){let t=Hc(a,!0,r);i.geometryLayout=t.getLayout(),Ou(e,t.getCoordinates(),n)}}var Nu={ADD_FEATURES:`addfeatures`},Pu=class extends n{constructor(e,t,n,r){super(e),this.features=n,this.file=t,this.projection=r}},Fu=class extends ua{constructor(e){e||={},super({handleEvent:f}),this.on,this.once,this.un,this.readAsBuffer_=!1,this.formats_=[];let t=e.formatConstructors?e.formatConstructors:[];for(let e=0,n=t.length;e<n;++e){let n=t[e];typeof n==`function`&&(n=new n),this.formats_.push(n),this.readAsBuffer_=this.readAsBuffer_||n.getType()===`arraybuffer`}this.projection_=e.projection?H(e.projection):null,this.dropListenKeys_=null,this.source_=e.source||null,this.target=e.target?e.target:null}handleResult_(e,t){let n=t.target.result,r=this.getMap(),i=this.projection_;i||(i=En(),i||=r.getView().getProjection());let a,o=this.formats_;for(let t=0,r=o.length;t<r;++t){let r=o[t],s=n;this.readAsBuffer_&&r.getType()!==`arraybuffer`&&(a===void 0&&(a=new TextDecoder().decode(n)),s=a);let c=this.tryReadFeatures_(r,s,{featureProjection:i});if(c&&c.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(c)),this.dispatchEvent(new Pu(Nu.ADD_FEATURES,e,c,i));break}}}registerListeners_(){let e=this.getMap();if(e){let t=this.target?this.target:e.getViewport();this.dropListenKeys_=[b(t,y.DROP,this.handleDrop,this),b(t,y.DRAGENTER,this.handleStop,this),b(t,y.DRAGOVER,this.handleStop,this),b(t,y.DROP,this.handleStop,this)]}}setActive(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),super.setActive(e)}setMap(e){this.unregisterListeners_(),super.setMap(e),this.getActive()&&this.registerListeners_()}tryReadFeatures_(e,t,n){try{return e.readFeatures(t,n)}catch{return null}}unregisterListeners_(){this.dropListenKeys_&&=(this.dropListenKeys_.forEach(S),null)}handleDrop(e){let t=e.dataTransfer.files;for(let e=0,n=t.length;e<n;++e){let n=t.item(e),r=new FileReader;r.addEventListener(y.LOAD,this.handleResult_.bind(this,n)),this.readAsBuffer_?r.readAsArrayBuffer(n):r.readAsText(n)}}handleStop(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect=`copy`}},$={ACCURACY:`accuracy`,ACCURACY_GEOMETRY:`accuracyGeometry`,ALTITUDE:`altitude`,ALTITUDE_ACCURACY:`altitudeAccuracy`,HEADING:`heading`,POSITION:`position`,PROJECTION:`projection`,SPEED:`speed`,TRACKING:`tracking`,TRACKING_OPTIONS:`trackingOptions`},Iu={ERROR:`error`},Lu=class extends n{constructor(e){super(Iu.ERROR),this.code=e.code,this.message=e.message}},Ru=class extends k{constructor(e){super(),this.on,this.once,this.un,e||={},this.position_=null,this.transform_=dn,this.watchId_=void 0,this.addChangeListener($.PROJECTION,this.handleProjectionChanged_),this.addChangeListener($.TRACKING,this.handleTrackingChanged_),e.projection!==void 0&&this.setProjection(e.projection),e.trackingOptions!==void 0&&this.setTrackingOptions(e.trackingOptions),this.setTracking(e.tracking===void 0?!1:e.tracking)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){let e=this.getProjection();e&&(this.transform_=xn(H(`EPSG:4326`),e),this.position_&&this.set($.POSITION,this.transform_(this.position_)))}handleTrackingChanged_(){if(`geolocation`in navigator){let e=this.getTracking();e&&this.watchId_===void 0?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&this.watchId_!==void 0&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(e){let t=e.coords;this.set($.ACCURACY,t.accuracy),this.set($.ALTITUDE,t.altitude===null?void 0:t.altitude),this.set($.ALTITUDE_ACCURACY,t.altitudeAccuracy===null?void 0:t.altitudeAccuracy),this.set($.HEADING,t.heading===null?void 0:ot(t.heading)),this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];let n=this.transform_(this.position_);this.set($.POSITION,n.slice()),this.set($.SPEED,t.speed===null?void 0:t.speed);let r=Yr(this.position_,t.accuracy);r.applyTransform(this.transform_),this.set($.ACCURACY_GEOMETRY,r),this.changed()}positionError_(e){this.dispatchEvent(new Lu(e))}getAccuracy(){return this.get($.ACCURACY)}getAccuracyGeometry(){return this.get($.ACCURACY_GEOMETRY)||null}getAltitude(){return this.get($.ALTITUDE)}getAltitudeAccuracy(){return this.get($.ALTITUDE_ACCURACY)}getHeading(){return this.get($.HEADING)}getPosition(){return this.get($.POSITION)}getProjection(){return this.get($.PROJECTION)}getSpeed(){return this.get($.SPEED)}getTracking(){return this.get($.TRACKING)}getTrackingOptions(){return this.get($.TRACKING_OPTIONS)}setProjection(e){this.set($.PROJECTION,H(e))}setTracking(e){this.set($.TRACKING,e)}setTrackingOptions(e){this.set($.TRACKING_OPTIONS,e)}};export{vn as C,Ce as E,kr as S,yn as T,eo as _,Zc as a,ca as b,Ss as c,us as d,Zo as f,to as g,so as h,_l as i,bs as l,co as m,Fu as n,Bc as o,ho as p,Zl as r,js as s,Ru as t,hs as u,Ya as v,H as w,Qr as x,qa as y};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.