Files
tar1090/html/libs/ol-custom016.js

5 lines
529 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ol={})}(this,(function(t){"use strict";function e(){return function(){throw new Error("Unimplemented abstract method.")}()}var r=0;function n(t){return t.ol_uid||(t.ol_uid=String(++r))}var i,o=(i=function(t,e){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},i(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),a=function(t){function e(e){var r=this,n="Assertion failed. See https://openlayers.org/en/"+("v"+"6.10.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(r=t.call(this,n)||this).code=e,r.name="AssertionError",r.message=n,r}return o(e,t),e}(Error),s=function(){function t(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}return t.prototype.preventDefault=function(){this.defaultPrevented=!0},t.prototype.stopPropagation=function(){this.propagationStopped=!0},t}(),l="propertychange",u=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function h(t,e){return t>e?1:t<e?-1:0}function c(t,e){return t.indexOf(e)>=0}function p(t,e,r){var n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;var i=void 0;if(r>0){for(i=1;i<n;++i)if(t[i]<e)return i-1}else if(r<0){for(i=1;i<n;++i)if(t[i]<=e)return i}else for(i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof r?r(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return n-1}function f(t,e,r){for(;e<r;){var n=t[e];t[e]=t[r],t[r]=n,++e,--r}}function d(t,e){for(var r=Array.isArray(e)?e:[e],n=r.length,i=0;i<n;i++)t[t.length]=r[i]}function g(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function _(){return!0}function y(){return!1}function v(){}var m="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var r=Object(t),n=1,i=arguments.length;n<i;++n){var o=arguments[n];if(null!=o)for(var a in o)o.hasOwnProperty(a)&&(r[a]=o[a])}return r};function x(t){for(var e in t)delete t[e]}var w="function"==typeof Object.values?Object.values:function(t){var e=[];for(var r in t)e.push(t[r]);return e};function S(t){var e;for(e in t)return!1;return!e}var C=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),E=function(t){function e(e){var r=t.call(this)||this;return r.eventTarget_=e,r.pendingRemovals_=null,r.dispatching_=null,r.listeners_=null,r}return C(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var r=this.listeners_||(this.listeners_={}),n=r[t]||(r[t]=[]);-1===n.indexOf(e)&&n.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new s(t):t,r=e.type;e.target||(e.target=this.eventTarget_||this);var n,i=this.listeners_&&this.listeners_[r];if(i){var o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});r in o||(o[r]=0,a[r]=0),++o[r];for(var l=0,u=i.length;l<u;++l)if(!1===(n="handleEvent"in i[l]?i[l].handleEvent(e):i[l].call(this,e))||e.propagationStopped){n=!1;break}if(--o[r],0===o[r]){var h=a[r];for(delete a[r];h--;)this.removeEventListener(r,v);delete o[r]}return n}},e.prototype.disposeInternal=function(){this.listeners_&&x(this.listeners_)},e.prototype.getListeners=function(t){return this.listeners_&&this.listeners_[t]||void 0},e.prototype.hasListener=function(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)},e.prototype.removeEventListener=function(t,e){var r=this.listeners_&&this.listeners_[t];if(r){var n=r.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(r[n]=v,++this.pendingRemovals_[t]):(r.splice(n,1),0===r.length&&delete this.listeners_[t]))}},e}(u),T="change",b="error",R="contextmenu",P="click",O="dblclick",F="dragenter",I="dragover",L="drop",M="keydown",A="keypress",D="load",k="resize",j="touchmove",G="wheel";function N(t,e,r,n,i){if(n&&n!==t&&(r=r.bind(n)),i){var o=r;r=function(){t.removeEventListener(e,r),o.apply(this,arguments)}}var a={target:t,type:e,listener:r};return t.addEventListener(e,r),a}function B(t,e,r,n){return N(t,e,r,n,!0)}function z(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),x(t))}var U=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),V=function(t){function e(){var e=t.call(this)||this;return e.on=e.onInternal,e.once=e.onceInternal,e.un=e.unInternal,e.revision_=0,e}return U(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(T)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=N(this,t[i],e);return n}return N(this,t,e)},e.prototype.onceInternal=function(t,e){var r;if(Array.isArray(t)){var n=t.length;r=new Array(n);for(var i=0;i<n;++i)r[i]=B(this,t[i],e)}else r=B(this,t,e);return e.ol_key=r,r},e.prototype.unInternal=function(t,e){var r=e.ol_key;if(r)X(r);else if(Array.isArray(t))for(var n=0,i=t.length;n<i;++n)this.removeEventListener(t[n],e);else this.removeEventListener(t,e)},e}(E);function X(t){if(Array.isArray(t))for(var e=0,r=t.length;e<r;++e)z(t[e]);else z(t)}V.prototype.on,V.prototype.once,V.prototype.un;var W=V,Y=Object.freeze({__proto__:null,unByKey:X,default:W}),K=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Z=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.key=r,i.oldValue=n,i}return K(e,t),e}(s),H=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,n(r),r.values_=null,void 0!==e&&r.setProperties(e),r}return K(e,t),e.prototype.get=function(t){var e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return this.values_&&Object.keys(this.values_)||[]},e.prototype.getProperties=function(){return this.values_&&m({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var r;r="change:"+t,this.dispatchEvent(new Z(r,t,e)),r=l,this.dispatchEvent(new Z(r,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:"+t,e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:"+t,e)},e.prototype.set=function(t,e,r){var n=this.values_||(this.values_={});if(r)n[t]=e;else{var i=n[t];n[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var r in t)this.set(r,t[r],e)},e.prototype.applyProperties=function(t){t.values_&&m(this.values_||(this.values_={}),t.values_)},e.prototype.unset=function(t,e){if(this.values_&&t in this.values_){var r=this.values_[t];delete this.values_[t],S(this.values_)&&(this.values_=null),e||this.notify(t,r)}},e}(W),q=H,J="add",Q="remove",$=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tt="length",et=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.element=r,i.index=n,i}return $(e,t),e}(s),rt=function(t){function e(e,r){var n=t.call(this)||this;n.on,n.once,n.un;var i=r||{};if(n.unique_=!!i.unique,n.array_=e||[],n.unique_)for(var o=0,a=n.array_.length;o<a;++o)n.assertUnique_(n.array_[o],o);return n.updateLength_(),n}return $(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,r=t.length;e<r;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)t(e[r],r,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get(tt)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new et(J,e,t))},e.prototype.pop=function(){return this.removeAt(this.getLength()-1)},e.prototype.push=function(t){this.unique_&&this.assertUnique_(t);var e=this.getLength();return this.insertAt(e,t),this.getLength()},e.prototype.remove=function(t){for(var e=this.array_,r=0,n=e.length;r<n;++r)if(e[r]===t)return this.removeAt(r)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new et(Q,e,t)),e},e.prototype.setAt=function(t,e){var r=this.getLength();if(t<r){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new et(Q,n,t)),this.dispatchEvent(new et(J,e,t))}else{for(var i=r;i<t;++i)this.insertAt(i,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(tt,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var r=0,n=this.array_.length;r<n;++r)if(this.array_[r]===t&&r!==e)throw new a(58)},e}(q);function nt(t,e){if(!t)throw new a(e)}var it=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ot=function(t){function e(e){var r=t.call(this)||this;if(r.on,r.once,r.un,r.id_=void 0,r.geometryName_="geometry",r.style_=null,r.styleFunction_=void 0,r.geometryChangeKey_=null,r.addChangeListener(r.geometryName_,r.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var n=e;r.setGeometry(n)}else{var i=e;r.setProperties(i)}return r}return it(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var r=this.getGeometry();r&&t.setGeometry(r.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(z(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=N(t,T,this.handleGeometryChange_,this)),this.changed()},e.prototype.setGeometry=function(t){this.set(this.geometryName_,t)},e.prototype.setStyle=function(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;var e;Array.isArray(t)?e=t:(nt("function"==typeof t.getZIndex,41),e=[t]);return function(){return e}}(t):void 0,this.changed()},e.prototype.setId=function(t){this.id_=t,this.changed()},e.prototype.setGeometryName=function(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()},e}(q);var at=ot,st="XY",lt="XYZ",ut="XYM",ht="XYZM",ct="Point",pt="LineString",ft="LinearRing",dt="Polygon",gt="MultiPoint",_t="MultiLineString",yt="MultiPolygon",vt="GeometryCollection",mt="Circle",xt={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},wt={};wt[xt.RADIANS]=6370997/(2*Math.PI),wt[xt.DEGREES]=2*Math.PI*6370997/360,wt[xt.FEET]=.3048,wt[xt.METERS]=1,wt[xt.USFEET]=1200/3937;var St=xt,Ct="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Et=-1!==Ct.indexOf("firefox");-1!==Ct.indexOf("safari")&&Ct.indexOf("chrom");var Tt,bt=-1!==Ct.indexOf("webkit")&&-1==Ct.indexOf("edge"),Rt=-1!==Ct.indexOf("macintosh"),Pt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Ot="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Ft="undefined"!=typeof Image&&Image.prototype.decode,It=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}(),Lt=new Array(6);function Mt(t){return Dt(t,1,0,0,1,0,0)}function At(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=r*l+i*u,t[1]=n*l+o*u,t[2]=r*h+i*c,t[3]=n*h+o*c,t[4]=r*p+i*f+a,t[5]=n*p+o*f+s,t}function Dt(t,e,r,n,i,o,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t[4]=o,t[5]=a,t}function kt(t,e){var r=e[0],n=e[1];return e[0]=t[0]*r+t[2]*n+t[4],e[1]=t[1]*r+t[3]*n+t[5],e}function jt(t,e,r){return At(t,Dt(Lt,e,0,0,r,0,0))}function Gt(t,e,r,n,i,o,a,s){var l=Math.sin(o),u=Math.cos(o);return t[0]=n*u,t[1]=i*l,t[2]=-n*l,t[3]=i*u,t[4]=a*n*u-s*n*l+e,t[5]=a*i*l+s*i*u+r,t}function Nt(t,e){var r,n=(r=e)[0]*r[3]-r[1]*r[2];nt(0!==n,32);var i=e[0],o=e[1],a=e[2],s=e[3],l=e[4],u=e[5];return t[0]=s/n,t[1]=-o/n,t[2]=-a/n,t[3]=i/n,t[4]=(a*u-s*l)/n,t[5]=-(i*u-o*l)/n,t}function Bt(t){var e="matrix("+t.join(", ")+")";if(Ot)return e;var r=Tt||(Tt=document.createElement("div"));return r.style.transform=e,r.style.transform}var zt="bottom-left",Ut="bottom-right",Vt="top-left",Xt="top-right",Wt=0,Yt=1,Kt=2,Zt=4,Ht=8,qt=16;function Jt(t){for(var e=oe(),r=0,n=t.length;r<n;++r)pe(e,t[r]);return e}function Qt(t,e,r){return r?(r[0]=t[0]-e,r[1]=t[1]-e,r[2]=t[2]+e,r[3]=t[3]+e,r):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function $t(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function te(t,e,r){var n,i;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(i=r<t[1]?t[1]-r:t[3]<r?r-t[3]:0)*i}function ee(t,e){return ne(t,e[0],e[1])}function re(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function ne(t,e,r){return t[0]<=e&&e<=t[2]&&t[1]<=r&&r<=t[3]}function ie(t,e){var r=t[0],n=t[1],i=t[2],o=t[3],a=e[0],s=e[1],l=Wt;return a<r?l|=qt:a>i&&(l|=Zt),s<n?l|=Ht:s>o&&(l|=Kt),l===Wt&&(l=Yt),l}function oe(){return[1/0,1/0,-1/0,-1/0]}function ae(t,e,r,n,i){return i?(i[0]=t,i[1]=e,i[2]=r,i[3]=n,i):[t,e,r,n]}function se(t){return ae(1/0,1/0,-1/0,-1/0,t)}function le(t,e){var r=t[0],n=t[1];return ae(r,n,r,n,e)}function ue(t,e,r,n,i){return fe(se(i),t,e,r,n)}function he(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ce(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function pe(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function fe(t,e,r,n,i){for(;r<n;r+=i)de(t,e[r],e[r+1]);return t}function de(t,e,r){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],r),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],r)}function ge(t,e){var r;return(r=e(ye(t)))||(r=e(ve(t)))||(r=e(Te(t)))?r:(r=e(Ee(t)))||!1}function _e(t){var e=0;return Pe(t)||(e=be(t)*Se(t)),e}function ye(t){return[t[0],t[1]]}function ve(t){return[t[2],t[1]]}function me(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function xe(t,e){var r;return e===zt?r=ye(t):e===Ut?r=ve(t):e===Vt?r=Ee(t):e===Xt?r=Te(t):nt(!1,13),r}function we(t,e,r,n,i){var o=e*n[0]/2,a=e*n[1]/2,s=Math.cos(r),l=Math.sin(r),u=o*s,h=o*l,c=a*s,p=a*l,f=t[0],d=t[1],g=f-u+p,_=f-u-p,y=f+u-p,v=f+u+p,m=d-h-c,x=d-h+c,w=d+h+c,S=d+h-c;return ae(Math.min(g,_,y,v),Math.min(m,x,w,S),Math.max(g,_,y,v),Math.max(m,x,w,S),i)}function Se(t){return t[3]-t[1]}function Ce(t,e,r){var n=r||[1/0,1/0,-1/0,-1/0];return Re(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):se(n),n}function Ee(t){return[t[0],t[3]]}function Te(t){return[t[2],t[3]]}function be(t){return t[2]-t[0]}function Re(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Pe(t){return t[2]<t[0]||t[3]<t[1]}function Oe(t,e,r,n){var i=[];if(n>1)for(var o=t[2]-t[0],a=t[3]-t[1],s=0;s<n;++s)i.push(t[0]+o*s/n,t[1],t[2],t[1]+a*s/n,t[2]-o*s/n,t[3],t[0],t[3]-a*s/n);else i=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(i,i,2);for(var l=[],u=[],h=(s=0,i.length);s<h;s+=2)l.push(i[s]),u.push(i[s+1]);return function(t,e,r){return ae(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),r)}(l,u,r)}var Fe=function(){function t(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}return t.prototype.canWrapX=function(){return this.canWrapX_},t.prototype.getCode=function(){return this.code_},t.prototype.getExtent=function(){return this.extent_},t.prototype.getUnits=function(){return this.units_},t.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||wt[this.units_]},t.prototype.getWorldExtent=function(){return this.worldExtent_},t.prototype.getAxisOrientation=function(){return this.axisOrientation_},t.prototype.isGlobal=function(){return this.global_},t.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},t.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},t.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},t.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},t.prototype.setWorldExtent=function(t){this.worldExtent_=t},t.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},t.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_},t}();function Ie(t,e,r){return Math.min(Math.max(t,e),r)}var Le="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Me="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ae(t,e,r,n,i,o){var a=i-r,s=o-n;if(0!==a||0!==s){var l=((t-r)*a+(e-n)*s)/(a*a+s*s);l>1?(r=i,n=o):l>0&&(r+=a*l,n+=s*l)}return De(t,e,r,n)}function De(t,e,r,n){var i=r-t,o=n-e;return i*i+o*o}function ke(t){return 180*t/Math.PI}function je(t){return t*Math.PI/180}function Ge(t,e){var r=t%e;return r*e<0?r+e:r}function Ne(t,e,r){return t+r*(e-t)}function Be(t,e){var r=Math.pow(10,e);return Math.round(t*r)/r}function ze(t,e){return Math.round(Be(t,e))}function Ue(t,e){return Math.floor(Be(t,e))}function Ve(t,e){return Math.ceil(Be(t,e))}var Xe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),We=6378137,Ye=Math.PI*We,Ke=[-Ye,-Ye,Ye,Ye],Ze=[-180,-85,180,85],He=We*Math.log(Math.tan(Math.PI/2)),qe=function(t){function e(e){return t.call(this,{code:e,units:St.METERS,extent:Ke,global:!0,worldExtent:Ze,getPointResolution:function(t,e){return t/Le(e[1]/We)}})||this}return Xe(e,t),e}(Fe),Je=[new qe("EPSG:3857"),new qe("EPSG:102100"),new qe("EPSG:102113"),new qe("EPSG:900913"),new qe("http://www.opengis.net/def/crs/EPSG/0/3857"),new qe("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Qe(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a<n;a+=i){o[a]=Ye*t[a]/180;var s=We*Math.log(Math.tan(Math.PI*(+t[a+1]+90)/360));s>He?s=He:s<-He&&(s=-He),o[a+1]=s}return o}function $e(t,e,r){var n=t.length,i=r>1?r:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(n));for(var a=0;a<n;a+=i)o[a]=180*t[a]/Ye,o[a+1]=360*Math.atan(Math.exp(t[a+1]/We))/Math.PI-90;return o}var tr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),er=[-180,-90,180,90],rr=6378137*Math.PI/180,nr=function(t){function e(e,r){return t.call(this,{code:e,units:St.DEGREES,extent:er,axisOrientation:r,global:!0,metersPerUnit:rr,worldExtent:er})||this}return tr(e,t),e}(Fe),ir=[new nr("CRS:84"),new nr("EPSG:4326","neu"),new nr("urn:ogc:def:crs:OGC:1.3:CRS84"),new nr("urn:ogc:def:crs:OGC:2:84"),new nr("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new nr("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new nr("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],or={};var ar={};function sr(t,e,r){var n=t.getCode(),i=e.getCode();n in ar||(ar[n]={}),ar[n][i]=r}var lr=6371008.8;function ur(t,e,r){var n=r||lr,i=je(t[1]),o=je(e[1]),a=(o-i)/2,s=je(e[0]-t[0])/2,l=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(o);return 2*n*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function hr(t,e){for(var r=0,n=0,i=t.length;n<i-1;++n)r+=ur(t[n],t[n+1],e);return r}function cr(t,e){for(var r=0,n=t.length,i=t[n-1][0],o=t[n-1][1],a=0;a<n;a++){var s=t[a][0],l=t[a][1];r+=je(s-i)*(2+Math.sin(je(o))+Math.sin(je(l))),i=s,o=l}return r*e*e/2}var pr=Object.freeze({__proto__:null,DEFAULT_RADIUS:lr,getDistance:ur,getLength:function t(e,r){var n=r||{},i=n.radius||lr,o=n.projection||"EPSG:3857",a=e.getType();a!==vt&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case ct:case gt:break;case pt:case ft:f=hr(s=e.getCoordinates(),i);break;case _t:case dt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)f+=hr(s[u],i);break;case yt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(c=0,p=(l=s[u]).length;c<p;++c)f+=hr(l[c],i);break;case vt:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},getArea:function t(e,r){var n=r||{},i=n.radius||lr,o=n.projection||"EPSG:3857",a=e.getType();a!==vt&&(e=e.clone().transform(o,"EPSG:4326"));var s,l,u,h,c,p,f=0;switch(a){case ct:case gt:case pt:case _t:case ft:break;case dt:for(s=e.getCoordinates(),f=Math.abs(cr(s[0],i)),u=1,h=s.length;u<h;++u)f-=Math.abs(cr(s[u],i));break;case yt:for(u=0,h=(s=e.getCoordinates()).length;u<h;++u)for(l=s[u],f+=Math.abs(cr(l[0],i)),c=1,p=l.length;c<p;++c)f-=Math.abs(cr(l[c],i));break;case vt:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],r);break;default:throw new Error("Unsupported geometry type: "+a)}return f},offset:function(t,e,r,n){var i=n||lr,o=je(t[1]),a=je(t[0]),s=e/i,l=Math.asin(Math.sin(o)*Math.cos(s)+Math.cos(o)*Math.sin(s)*Math.cos(r));return[ke(a+Math.atan2(Math.sin(r)*Math.sin(s)*Math.cos(o),Math.cos(s)-Math.sin(o)*Math.sin(l))),ke(l)]}});function fr(t,e){for(var r=(""+t).split("."),n=(""+e).split("."),i=0;i<Math.max(r.length,n.length);i++){var o=parseInt(r[i]||"0",10),a=parseInt(n[i]||"0",10);if(o>a)return 1;if(a>o)return-1}return 0}function dr(t,e){var r,n,i=t[0],o=t[1],a=e[0],s=e[1],l=a[0],u=a[1],h=s[0],c=s[1],p=h-l,f=c-u,d=0===p&&0===f?0:(p*(i-l)+f*(o-u))/(p*p+f*f||0);return d<=0?(r=l,n=u):d>=1?(r=h,n=c):(r=l+d*p,n=u+d*f),[r,n]}function gr(t,e){for(var r=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){r=!1;break}return r}function _r(t,e){var r=Math.cos(e),n=Math.sin(e),i=t[0]*r-t[1]*n,o=t[1]*r+t[0]*n;return t[0]=i,t[1]=o,t}function yr(t,e){var r=t[0]-e[0],n=t[1]-e[1];return r*r+n*n}function vr(t,e){return Math.sqrt(yr(t,e))}function mr(t,e){return yr(t,dr(t,e))}function xr(t,e){if(e.canWrapX()){var r=be(e.getExtent()),n=function(t,e,r){var n=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])){var o=r||be(n);i=Math.floor((t[0]-n[0])/o)}return i}(t,e,r);n&&(t[0]-=n*r)}return t}function wr(t,e,r){var n;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];n=e}else n=t.slice();return n}function Sr(t,e,r){if(void 0!==e&&t!==e){for(var n=0,i=t.length;n<i;++n)e[n]=t[n];t=e}return t}function Cr(t){!function(t,e){or[t]=e}(t.getCode(),t),sr(t,t,wr)}function Er(t){return"string"==typeof t?or[e=t]||or[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Tr(t,e,r,n){var i,o=(t=Er(t)).getPointResolutionFunc();if(o){if(i=o(e,r),n&&n!==t.getUnits())(s=t.getMetersPerUnit())&&(i=i*s/wt[n])}else{var a=t.getUnits();if(a==St.DEGREES&&!n||n==St.DEGREES)i=e;else{var s,l=Or(t,Er("EPSG:4326"));if(l===Sr&&a!==St.DEGREES)i=e*t.getMetersPerUnit();else{var u=[r[0]-e/2,r[1],r[0]+e/2,r[1],r[0],r[1]-e/2,r[0],r[1]+e/2];i=(ur((u=l(u,u,2)).slice(0,2),u.slice(2,4))+ur(u.slice(4,6),u.slice(6,8)))/2}void 0!==(s=n?wt[n]:t.getMetersPerUnit())&&(i/=s)}}return i}function br(t){!function(t){t.forEach(Cr)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&sr(e,t,wr)}))}))}function Rr(t,e){return t?"string"==typeof t?Er(t):t:Er(e)}function Pr(t,e){if(t===e)return!0;var r=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Or(t,e)===wr)&&r}function Or(t,e){var r=function(t,e){var r;return t in ar&&e in ar[t]&&(r=ar[t][e]),r}(t.getCode(),e.getCode());return r||(r=Sr),r}function Fr(t,e){return Or(Er(t),Er(e))}function Ir(t,e,r){return Fr(e,r)(t,void 0,t.length)}var Lr,Mr,Ar;function Dr(t,e){return t}function kr(t,e){return t}function jr(t,e){return t}function Gr(t,e){return t}function Nr(t,e,r,n,i,o){for(var a=o||[],s=0,l=e;l<r;l+=n){var u=t[l],h=t[l+1];a[s++]=i[0]*u+i[2]*h+i[4],a[s++]=i[1]*u+i[3]*h+i[5]}return o&&a.length!=s&&(a.length=s),a}function Br(t,e,r,n,i,o,a){for(var s=a||[],l=Math.cos(i),u=Math.sin(i),h=o[0],c=o[1],p=0,f=e;f<r;f+=n){var d=t[f]-h,g=t[f+1]-c;s[p++]=h+d*l-g*u,s[p++]=c+d*u+g*l;for(var _=f+2;_<f+n;++_)s[p++]=t[_]}return a&&s.length!=p&&(s.length=p),s}function zr(t,e,r,n,i,o,a){for(var s=a||[],l=0,u=e;u<r;u+=n){s[l++]=t[u]+i,s[l++]=t[u+1]+o;for(var h=u+2;h<u+n;++h)s[l++]=t[h]}return a&&s.length!=l&&(s.length=l),s}br(Je),br(ir),Lr=Je,Mr=Qe,Ar=$e,ir.forEach((function(t){Lr.forEach((function(e){sr(t,e,Mr),sr(e,t,Ar)}))}));var Ur=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vr=[1,0,0,1,0,0],Xr=function(t){function r(){var e,r,n,i,o,a=t.call(this)||this;return a.extent_=[1/0,1/0,-1/0,-1/0],a.extentRevision_=-1,a.simplifiedGeometryMaxMinSquaredTolerance=0,a.simplifiedGeometryRevision=0,a.simplifyTransformedInternal=(e=function(t,e,r){if(!r)return this.getSimplifiedGeometry(e);var n=this.clone();return n.applyTransform(r),n.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&g(t,n)||(o=!0,i=this,n=t,r=e.apply(this,arguments)),r}),a}return Ur(r,t),r.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},r.prototype.clone=function(){return e()},r.prototype.closestPointXY=function(t,r,n,i){return e()},r.prototype.containsXY=function(t,e){var r=this.getClosestPoint([t,e]);return r[0]===t&&r[1]===e},r.prototype.getClosestPoint=function(t,e){var r=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],r,1/0),r},r.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},r.prototype.computeExtent=function(t){return e()},r.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&se(e),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)},r.prototype.rotate=function(t,r){e()},r.prototype.scale=function(t,r,n){e()},r.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},r.prototype.getSimplifiedGeometry=function(t){return e()},r.prototype.getType=function(){return e()},r.prototype.applyTransform=function(t){e()},r.prototype.intersectsExtent=function(t){return e()},r.prototype.translate=function(t,r){e()},r.prototype.transform=function(t,e){var r=Er(t),n=r.getUnits()==St.TILE_PIXELS?function(t,n,i){var o=r.getExtent(),a=r.getWorldExtent(),s=Se(a)/Se(o);return Gt(Vr,a[0],a[3],s,-s,0,0,0),Nr(t,0,t.length,i,Vr,n),Fr(r,e)(t,n,i)}:Fr(r,e);return this.applyTransform(n),this},r}(q),Wr=Xr,Yr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kr=function(t){function r(){var e=t.call(this)||this;return e.layout=st,e.stride=2,e.flatCoordinates=null,e}return Yr(r,t),r.prototype.computeExtent=function(t){return ue(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},r.prototype.getCoordinates=function(){return e()},r.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},r.prototype.getFlatCoordinates=function(){return this.flatCoordinates},r.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},r.prototype.getLayout=function(){return this.layout},r.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},r.prototype.getSimplifiedGeometryInternal=function(t){return this},r.prototype.getStride=function(){return this.stride},r.prototype.setFlatCoordinates=function(t,e){this.stride=Zr(t),this.layout=t,this.flatCoordinates=e},r.prototype.setCoordinates=function(t,r){e()},r.prototype.setLayout=function(t,e,r){var n;if(t)n=Zr(t);else{for(var i=0;i<r;++i){if(0===e.length)return this.layout=st,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=st:3==t?e=lt:4==t&&(e=ht);return e}(n=e.length)}this.layout=t,this.stride=n},r.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},r.prototype.rotate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();Br(r,0,r.length,n,t,e,r),this.changed()}},r.prototype.scale=function(t,e,r){var n=e;void 0===n&&(n=t);var i=r;i||(i=me(this.getExtent()));var o=this.getFlatCoordinates();if(o){var a=this.getStride();!function(t,e,r,n,i,o,a,s){for(var l=s||[],u=a[0],h=a[1],c=0,p=e;p<r;p+=n){var f=t[p]-u,d=t[p+1]-h;l[c++]=u+i*f,l[c++]=h+o*d;for(var g=p+2;g<p+n;++g)l[c++]=t[g]}s&&l.length!=c&&(l.length=c)}(o,0,o.length,a,t,n,i,o),this.changed()}},r.prototype.translate=function(t,e){var r=this.getFlatCoordinates();if(r){var n=this.getStride();zr(r,0,r.length,n,t,e,r),this.changed()}},r}(Wr);function Zr(t){var e;return t==st?e=2:t==lt||t==ut?e=3:t==ht&&(e=4),e}var Hr=Kr;function qr(t,e,r,n,i,o,a){var s,l=t[e],u=t[e+1],h=t[r]-l,c=t[r+1]-u;if(0===h&&0===c)s=e;else{var p=((i-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)s=r;else{if(p>0){for(var f=0;f<n;++f)a[f]=Ne(t[e+f],t[r+f],p);return void(a.length=n)}s=e}}for(f=0;f<n;++f)a[f]=t[s+f];a.length=n}function Jr(t,e,r,n,i){var o=t[e],a=t[e+1];for(e+=n;e<r;e+=n){var s=t[e],l=t[e+1],u=De(o,a,s,l);u>i&&(i=u),o=s,a=l}return i}function Qr(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=Jr(t,e,s,n,i),e=s}return i}function $r(t,e,r,n,i,o,a,s,l,u,h){if(e==r)return u;var c,p;if(0===i){if((p=De(a,s,t[e],t[e+1]))<u){for(c=0;c<n;++c)l[c]=t[e+c];return l.length=n,p}return u}for(var f=h||[NaN,NaN],d=e+n;d<r;)if(qr(t,d-n,d,n,a,s,f),(p=De(a,s,f[0],f[1]))<u){for(u=p,c=0;c<n;++c)l[c]=f[c];l.length=n,d+=n}else d+=n*Math.max((Math.sqrt(p)-Math.sqrt(u))/i|0,1);if(o&&(qr(t,r-n,e,n,a,s,f),(p=De(a,s,f[0],f[1]))<u)){for(u=p,c=0;c<n;++c)l[c]=f[c];l.length=n}return u}function tn(t,e,r,n,i,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];u=$r(t,e,d,n,i,o,a,s,l,u,c),e=d}return u}function en(t,e,r,n){for(var i=0,o=r.length;i<o;++i)t[e++]=r[i];return e}function rn(t,e,r,n){for(var i=0,o=r.length;i<o;++i)for(var a=r[i],s=0;s<n;++s)t[e++]=a[s];return e}function nn(t,e,r,n,i){for(var o=i||[],a=0,s=0,l=r.length;s<l;++s){var u=rn(t,e,r[s],n);o[a++]=u,e=u}return o.length=a,o}function on(t,e,r,n,i,o,a){var s=(r-e)/n;if(s<3){for(;e<r;e+=n)o[a++]=t[e],o[a++]=t[e+1];return a}var l=new Array(s);l[0]=1,l[s-1]=1;for(var u=[e,r-n],h=0;u.length>0;){for(var c=u.pop(),p=u.pop(),f=0,d=t[p],g=t[p+1],_=t[c],y=t[c+1],v=p+n;v<c;v+=n){var m=Ae(t[v],t[v+1],d,g,_,y);m>f&&(h=v,f=m)}f>i&&(l[(h-e)/n]=1,p+n<h&&u.push(p,h),h+n<c&&u.push(h,c))}for(v=0;v<s;++v)l[v]&&(o[a++]=t[e+v*n],o[a++]=t[e+v*n+1]);return a}function an(t,e){return e*Math.round(t/e)}function sn(t,e,r,n,i,o,a){if(e==r)return a;var s,l,u=an(t[e],i),h=an(t[e+1],i);e+=n,o[a++]=u,o[a++]=h;do{if(s=an(t[e],i),l=an(t[e+1],i),(e+=n)==r)return o[a++]=s,o[a++]=l,a}while(s==u&&l==h);for(;e<r;){var c=an(t[e],i),p=an(t[e+1],i);if(e+=n,c!=s||p!=l){var f=s-u,d=l-h,g=c-u,_=p-h;f*_==d*g&&(f<0&&g<f||f==g||f>0&&g>f)&&(d<0&&_<d||d==_||d>0&&_>d)?(s=c,l=p):(o[a++]=s,o[a++]=l,u=s,h=l,s=c,l=p)}}return o[a++]=s,o[a++]=l,a}function ln(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l];a=sn(t,e,h,n,i,o,a),s.push(a),e=h}return a}function un(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=e;s<r;s+=n)o[a++]=t.slice(s,s+n);return o.length=a,o}function hn(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,l=r.length;s<l;++s){var u=r[s];o[a++]=un(t,e,u,n,o[a]),e=u}return o.length=a,o}function cn(t,e,r,n,i){for(var o=void 0!==i?i:[],a=0,s=0,l=r.length;s<l;++s){var u=r[s];o[a++]=hn(t,e,u,n,o[a]),e=u[u.length-1]}return o.length=a,o}function pn(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],l=t[e+1];i+=a*s-o*l,o=s,a=l}return i/2}function fn(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=pn(t,e,s,n),e=s}return i}var dn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gn=function(t){function e(e,r){var n=t.call(this)||this;return n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return dn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,r,n){return n<te(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),$r(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.getArea=function(){return pn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return un(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=on(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,st)},e.prototype.getType=function(){return ft},e.prototype.intersectsExtent=function(t){return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=rn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr),_n=gn,yn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vn=function(t){function e(e,r){var n=t.call(this)||this;return n.setCoordinates(e,r),n}return yn(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=De(t,e,i[0],i[1]);if(o<n){for(var a=this.stride,s=0;s<a;++s)r[s]=i[s];return r.length=a,o}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return le(this.flatCoordinates,t)},e.prototype.getType=function(){return ct},e.prototype.intersectsExtent=function(t){return ne(t,this.flatCoordinates[0],this.flatCoordinates[1])},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=en(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr),mn=vn;function xn(t,e,r,n,i){return!ge(i,(function(i){return!wn(t,e,r,n,i[0],i[1])}))}function wn(t,e,r,n,i,o){for(var a=0,s=t[r-n],l=t[r-n+1];e<r;e+=n){var u=t[e],h=t[e+1];l<=o?h>o&&(u-s)*(o-l)-(i-s)*(h-l)>0&&a++:h<=o&&(u-s)*(o-l)-(i-s)*(h-l)<0&&a--,s=u,l=h}return 0!==a}function Sn(t,e,r,n,i,o){if(0===r.length)return!1;if(!wn(t,e,r[0],n,i,o))return!1;for(var a=1,s=r.length;a<s;++a)if(wn(t,r[a-1],r[a],n,i,o))return!1;return!0}function Cn(t,e,r,n,i,o,a){for(var s,l,u,c,p,f,d,g=i[o+1],_=[],y=0,v=r.length;y<v;++y){var m=r[y];for(c=t[m-n],f=t[m-n+1],s=e;s<m;s+=n)p=t[s],d=t[s+1],(g<=f&&d<=g||f<=g&&g<=d)&&(u=(g-f)/(d-f)*(p-c)+c,_.push(u)),c=p,f=d}var x=NaN,w=-1/0;for(_.sort(h),c=_[0],s=1,l=_.length;s<l;++s){p=_[s];var S=Math.abs(p-c);S>w&&Sn(t,e,r,n,u=(c+p)/2,g)&&(x=u,w=S),c=p}return isNaN(x)&&(x=i[o]),a?(a.push(x,g,w),a):[x,g,w]}function En(t,e,r,n,i){for(var o=[],a=0,s=r.length;a<s;++a){var l=r[a];o=Cn(t,e,l,n,i,2*a,o),e=l[l.length-1]}return o}function Tn(t,e,r,n,i){var o;for(e+=n;e<r;e+=n)if(o=i(t.slice(e-n,e),t.slice(e,e+n)))return o;return!1}function bn(t,e,r,n,i){var o=fe([1/0,1/0,-1/0,-1/0],t,e,r,n);return!!Re(i,o)&&(!!re(i,o)||(o[0]>=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||Tn(t,e,r,n,(function(t,e){return function(t,e,r){var n=!1,i=ie(t,e),o=ie(t,r);if(i===Yt||o===Yt)n=!0;else{var a=t[0],s=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=r[0],f=r[1],d=(f-c)/(p-h),g=void 0,_=void 0;o&Kt&&!(i&Kt)&&(n=(g=p-(f-u)/d)>=a&&g<=l),n||!(o&Zt)||i&Zt||(n=(_=f-(p-l)*d)>=s&&_<=u),n||!(o&Ht)||i&Ht||(n=(g=p-(f-s)/d)>=a&&g<=l),n||!(o&qt)||i&qt||(n=(_=f-(p-a)*d)>=s&&_<=u)}return n}(i,t,e)})))))}function Rn(t,e,r,n,i){if(!function(t,e,r,n,i){return!!(bn(t,e,r,n,i)||wn(t,e,r,n,i[0],i[1])||wn(t,e,r,n,i[0],i[3])||wn(t,e,r,n,i[2],i[1])||wn(t,e,r,n,i[2],i[3]))}(t,e,r[0],n,i))return!1;if(1===r.length)return!0;for(var o=1,a=r.length;o<a;++o)if(xn(t,r[o-1],r[o],n,i)&&!bn(t,r[o-1],r[o],n,i))return!1;return!0}function Pn(t,e,r,n){for(;e<r-n;){for(var i=0;i<n;++i){var o=t[e+i];t[e+i]=t[r-n+i],t[r-n+i]=o}e+=n,r-=n}}function On(t,e,r,n){for(var i=0,o=t[r-n],a=t[r-n+1];e<r;e+=n){var s=t[e],l=t[e+1];i+=(s-o)*(l+a),o=s,a=l}return 0===i?void 0:i>0}function Fn(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var l=r[a],u=On(t,e,l,n);if(0===a){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function In(t,e,r,n,i){for(var o=void 0!==i&&i,a=0,s=r.length;a<s;++a){var l=r[a],u=On(t,e,l,n);(0===a?o&&u||!o&&!u:o&&!u||!o&&u)&&Pn(t,e,l,n),e=l}return e}function Ln(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o)e=In(t,e,r[o],n,i);return e}var Mn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),An=function(t){function e(e,r,n){var i=t.call(this)||this;return i.ends_=[],i.flatInteriorPointRevision_=-1,i.flatInteriorPoint_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,void 0!==r&&n?(i.setFlatCoordinates(r,e),i.ends_=n):i.setCoordinates(e,r),i}return Mn(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<te(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),tn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return Sn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return fn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?In(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,hn(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=me(this.getExtent());this.flatInteriorPoint_=Cn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new mn(this.getFlatInteriorPoint(),ut)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new _n(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.ends_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o],l=new _n(e.slice(i,s),t);n.push(l),i=s}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;Fn(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=In(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=ln(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,n),new e(r,st,n)},e.prototype.getType=function(){return dt},e.prototype.intersectsExtent=function(t){return Rn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=nn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(Hr);function Dn(t){var e=t[0],r=t[1],n=t[2],i=t[3],o=[e,r,e,i,n,i,n,r,e,r];return new An(o,st,[o.length])}function kn(t,e,r){for(var n=e||32,i=t.getStride(),o=t.getLayout(),a=t.getCenter(),s=i*(n+1),l=new Array(s),u=0;u<s;u+=i){l[u]=0,l[u+1]=0;for(var h=2;h<i;h++)l[u+h]=a[h]}var c=[l.length],p=new An(l,o,c);return function(t,e,r,n){for(var i=t.getFlatCoordinates(),o=t.getStride(),a=i.length/o-1,s=n||0,l=0;l<=a;++l){var u=l*o,h=s+2*Ge(l,a)*Math.PI/a;i[u]=e[0]+r*Math.cos(h),i[u+1]=e[1]+r*Math.sin(h)}t.changed()}(p,a,t.getRadius(),r),p}var jn="prerender",Gn="postrender",Nn="precompose",Bn="postcompose",zn="rendercomplete",Un=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||void 0})},t.prototype.getColor=function(){return this.color_},t.prototype.setColor=function(t){this.color_=t},t}();function Vn(t,e,r,n,i,o,a){var s,l,u=(r-e)/n;if(1===u)s=e;else if(2===u)s=e,l=i;else if(0!==u){for(var c=t[e],p=t[e+1],f=0,d=[0],g=e+n;g<r;g+=n){var _=t[g],y=t[g+1];f+=Math.sqrt((_-c)*(_-c)+(y-p)*(y-p)),d.push(f),c=_,p=y}var v=i*f,m=function(t,e,r){for(var n,i,o=r||h,a=0,s=t.length,l=!1;a<s;)(i=+o(t[n=a+(s-a>>1)],e))<0?a=n+1:(s=n,l=!i);return l?a:~a}(d,v);m<0?(l=(v-d[-m-2])/(d[-m-1]-d[-m-2]),s=e+(-m-2)*n):s=e+m*n}var x=a>1?a:2,w=o||new Array(x);for(g=0;g<x;++g)w[g]=void 0===s?NaN:void 0===l?t[s+g]:Ne(t[s+g],t[s+n+g],l);return w}function Xn(t,e,r,n,i,o){if(r==e)return null;var a;if(i<t[e+n-1])return o?((a=t.slice(e,e+n))[n-1]=i,a):null;if(t[r-1]<i)return o?((a=t.slice(r-n,r))[n-1]=i,a):null;if(i==t[e+n-1])return t.slice(e,e+n);for(var s=e/n,l=r/n;s<l;){var u=s+l>>1;i<t[(u+1)*n-1]?l=u:s=u+1}var h=t[s*n-1];if(i==h)return t.slice((s-1)*n,(s-1)*n+n);var c=(i-h)/(t[(s+1)*n-1]-h);a=[];for(var p=0;p<n-1;++p)a.push(Ne(t[(s-1)*n+p],t[s*n+p],c));return a.push(i),a}function Wn(t,e,r,n){for(var i=t[e],o=t[e+1],a=0,s=e+n;s<r;s+=n){var l=t[s],u=t[s+1];a+=Math.sqrt((l-i)*(l-i)+(u-o)*(u-o)),i=l,o=u}return a}var Yn=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kn=function(t){function e(e,r){var n=t.call(this)||this;return n.flatMidpoint_=null,n.flatMidpointRevision_=-1,n.maxDelta_=-1,n.maxDeltaRevision_=-1,void 0===r||Array.isArray(e[0])?n.setCoordinates(e,r):n.setFlatCoordinates(r,e),n}return Yn(e,t),e.prototype.appendCoordinate=function(t){this.flatCoordinates?d(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<te(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Jr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),$r(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.forEachSegment=function(t){return Tn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.getCoordinateAtM=function(t,e){if(this.layout!=ut&&this.layout!=ht)return null;var r=void 0!==e&&e;return Xn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r)},e.prototype.getCoordinates=function(){return un(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Vn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return Wn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getFlatMidpoint=function(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[];return r.length=on(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,st)},e.prototype.getType=function(){return pt},e.prototype.intersectsExtent=function(t){return bn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=rn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr),Zn=Kn,Hn=function(){function t(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}return t.prototype.clone=function(){var e=this.getColor();return new t({color:Array.isArray(e)?e.slice():e||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()})},t.prototype.getColor=function(){return this.color_},t.prototype.getLineCap=function(){return this.lineCap_},t.prototype.getLineDash=function(){return this.lineDash_},t.prototype.getLineDashOffset=function(){return this.lineDashOffset_},t.prototype.getLineJoin=function(){return this.lineJoin_},t.prototype.getMiterLimit=function(){return this.miterLimit_},t.prototype.getWidth=function(){return this.width_},t.prototype.setColor=function(t){this.color_=t},t.prototype.setLineCap=function(t){this.lineCap_=t},t.prototype.setLineDash=function(t){this.lineDash_=t},t.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t},t.prototype.setLineJoin=function(t){this.lineJoin_=t},t.prototype.setMiterLimit=function(t){this.miterLimit_=t},t.prototype.setWidth=function(t){this.width_=t},t}(),qn=0,Jn=1,Qn=2,$n=3,ti=4;function ei(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]+2*e,r[1]=t[1]+2*e,r}function ri(t){return t[0]>0&&t[1]>0}function ni(t,e,r){return void 0===r&&(r=[0,0]),r[0]=t[0]*e+.5|0,r[1]=t[1]*e+.5|0,r}function ii(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var oi=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=ii(t.scale),this.displacement_=t.displacement}return t.prototype.clone=function(){var e=this.getScale();return new t({opacity:this.getOpacity(),scale:Array.isArray(e)?e.slice():e,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()})},t.prototype.getOpacity=function(){return this.opacity_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getDisplacement=function(){return this.displacement_},t.prototype.getAnchor=function(){return e()},t.prototype.getImage=function(t){return e()},t.prototype.getHitDetectionImage=function(){return e()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return e()},t.prototype.getImageSize=function(){return e()},t.prototype.getOrigin=function(){return e()},t.prototype.getSize=function(){return e()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=ii(t)},t.prototype.listenImageChange=function(t){e()},t.prototype.load=function(){e()},t.prototype.unlistenImageChange=function(t){e()},t}(),ai=oi,si=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,li=/^([a-z]*)$|^hsla?\(.*\)$/i;function ui(t){return"string"==typeof t?t:di(t)}function hi(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var r=getComputedStyle(e).color;return document.body.removeChild(e),r}return""}var ci=function(){var t={},e=0;return function(r){var n;if(t.hasOwnProperty(r))n=t[r];else{if(e>=1024){var i=0;for(var o in t)0==(3&i++)&&(delete t[o],--e)}n=function(t){var e,r,n,i,o;li.exec(t)&&(t=hi(t));if(si.exec(t)){var a=t.length-1,s=void 0;s=a<=4?1:2;var l=4===a||8===a;e=parseInt(t.substr(1+0*s,s),16),r=parseInt(t.substr(1+1*s,s),16),n=parseInt(t.substr(1+2*s,s),16),i=l?parseInt(t.substr(1+3*s,s),16):255,1==s&&(e=(e<<4)+e,r=(r<<4)+r,n=(n<<4)+n,l&&(i=(i<<4)+i)),o=[e,r,n,i/255]}else 0==t.indexOf("rgba(")?fi(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),fi(o)):nt(!1,14);return o}(r),t[r]=n,++e}return n}}();function pi(t){return Array.isArray(t)?t:ci(t)}function fi(t){return t[0]=Ie(t[0]+.5|0,0,255),t[1]=Ie(t[1]+.5|0,0,255),t[2]=Ie(t[2]+.5|0,0,255),t[3]=Ie(t[3],0,1),t}function di(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var r=t[1];r!=(0|r)&&(r=r+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+r+","+n+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function gi(t){return Array.isArray(t)?di(t):t}function _i(t,e,r,n){var i;return i=r&&r.length?r.shift():Ot?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(i.width=t),e&&(i.height=e),i.getContext("2d",n)}function yi(t,e){var r=e.parentNode;r&&r.replaceChild(t,e)}function vi(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var mi="ol-hidden",xi="ol-unselectable",wi="ol-control",Si="ol-collapsed",Ci=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"),Ei=["style","variant","weight","size","lineHeight","family"],Ti=function(t){var e=t.match(Ci);if(!e)return null;for(var r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},n=0,i=Ei.length;n<i;++n){var o=e[n+1];void 0!==o&&(r[Ei[n]]=o)}return r.families=r.family.split(/,\s?/),r};function bi(t){return 1===t?"":String(Math.round(100*t)/100)}var Ri="10px sans-serif",Pi="#000",Oi="round",Fi=[],Ii="round",Li="#000",Mi="center",Ai="middle",Di=[0,0,0,0],ki=new q;(new E).setSize=function(){console.warn("labelCache is deprecated.")};var ji,Gi,Ni=null,Bi={},zi=function(){var t,e,r="32px ",n=["monospace","serif"],i=n.length,o="wmytzilWMYTZIL@#/&?$%10";function a(t,a,s){for(var l=!0,u=0;u<i;++u){var h=n[u];if(e=Xi(t+" "+a+" "+r+h,o),s!=h){var c=Xi(t+" "+a+" "+r+s+","+h,o);l=l&&c!=e}}return!!l}function s(){for(var e=!0,r=ki.getKeys(),n=0,i=r.length;n<i;++n){var o=r[n];ki.get(o)<100&&(a.apply(this,o.split("\n"))?(x(Bi),Ni=null,ji=void 0,ki.set(o,100)):(ki.set(o,ki.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var r=Ti(e);if(r)for(var n=r.families,i=0,o=n.length;i<o;++i){var l=n[i],u=r.style+"\n"+r.weight+"\n"+l;void 0===ki.get(u)&&(ki.set(u,100,!0),a(r.style,r.weight,l)||(ki.set(u,0,!0),void 0===t&&(t=setInterval(s,32))))}}}(),Ui=function(t){var e=Bi[t];if(null==e){if(Ot){var r=Ti(t),n=Vi(t,"Žg");e=(isNaN(Number(r.lineHeight))?1.2:Number(r.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else Gi||((Gi=document.createElement("div")).innerHTML="M",Gi.style.minHeight="0",Gi.style.maxHeight="none",Gi.style.height="auto",Gi.style.padding="0",Gi.style.border="none",Gi.style.position="absolute",Gi.style.display="block",Gi.style.left="-99999px"),Gi.style.font=t,document.body.appendChild(Gi),e=Gi.offsetHeight,document.body.removeChild(Gi);Bi[t]=e}return e};function Vi(t,e){return Ni||(Ni=_i(1,1)),t!=ji&&(Ni.font=t,ji=Ni.font),Ni.measureText(e)}function Xi(t,e){return Vi(t,e).width}function Wi(t,e,r){if(e in r)return r[e];var n=Xi(t,e);return r[e]=n,n}function Yi(t,e,r,n,i,o,a,s,l,u,h){t.save(),1!==r&&(t.globalAlpha*=r),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var r=t.contextInstructions,n=0,i=r.length;n<i;n+=2)Array.isArray(r[n+1])?e[r[n]].apply(e,r[n+1]):e[r[n]]=r[n+1]}(n,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(n,i,o,a,s,0,0,a,s)):t.drawImage(n,i,o,a,s,l,u,a*h[0],s*h[1]),t.restore()}var Ki=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zi=function(t){function e(e){var r=this,n=void 0!==e.rotateWithView&&e.rotateWithView;return(r=t.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0]})||this).canvas_=void 0,r.hitDetectionCanvas_=null,r.fill_=void 0!==e.fill?e.fill:null,r.origin_=[0,0],r.points_=e.points,r.radius_=void 0!==e.radius?e.radius:e.radius1,r.radius2_=e.radius2,r.angle_=void 0!==e.angle?e.angle:0,r.stroke_=void 0!==e.stroke?e.stroke:null,r.size_=null,r.renderOptions_=null,r.render(),r}return Ki(e,t),e.prototype.clone=function(){var t=this.getScale(),r=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()});return r.setOpacity(this.getOpacity()),r},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var r=this.renderOptions_,n=_i(r.size*t,r.size*t);this.draw_(r,n,t),e=n.canvas,this.canvas_[t]=e}return e},e.prototype.getPixelRatio=function(t){return t},e.prototype.getImageSize=function(){return this.size_},e.prototype.getImageState=function(){return Qn},e.prototype.getOrigin=function(){return this.origin_},e.prototype.getPoints=function(){return this.points_},e.prototype.getRadius=function(){return this.radius_},e.prototype.getRadius2=function(){return this.radius2_},e.prototype.getSize=function(){return this.size_},e.prototype.getStroke=function(){return this.stroke_},e.prototype.listenImageChange=function(t){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t){},e.prototype.calculateLineJoinSize_=function(t,e,r){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var n=this.radius_,i=void 0===this.radius2_?n:this.radius2_;if(n<i){var o=n;n=i,i=o}var a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,l=i*Math.sin(s),u=n-Math.sqrt(i*i-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=r)return c*e;var p=e/2/c,f=e/2*(u/h),d=Math.sqrt((n+p)*(n+p)+f*f)-n;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=n*Math.sin(s),_=i-Math.sqrt(n*n-g*g),y=Math.sqrt(g*g+_*_)/g;if(y<=r){var v=y*e/2-i-n;return 2*Math.max(d,v)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=Ii,r=0,n=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Li),t=gi(t),void 0===(o=this.stroke_.getWidth())&&(o=1),n=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Ii),void 0===(r=this.stroke_.getMiterLimit())&&(r=10));var a=this.calculateLineJoinSize_(e,o,r),s=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*s+a),lineDash:n,lineDashOffset:i,lineJoin:e,miterLimit:r}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,r){if(e.scale(r,r),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var n=this.fill_.getColor();null===n&&(n=Pi),e.fillStyle=gi(n),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,e.setLineDash&&t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e.prototype.createHitDetectionCanvas_=function(t){if(this.fill_){var e=this.fill_.getColor(),r=0;if("string"==typeof e&&(e=pi(e)),null===e?r=1:Array.isArray(e)&&(r=4===e.length?e[3]:1),0===r){var n=_i(t.size,t.size);this.hitDetectionCanvas_=n.canvas,this.drawHitDetectionCanvas_(t,n)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,r=this.radius_;if(e===1/0)t.arc(0,0,r,0,2*Math.PI);else{var n=void 0===this.radius2_?r:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,a=0;a<e;a++){var s=i+a*o,l=a%2==0?r:n;t.lineTo(l*Math.cos(s),l*Math.sin(s))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Pi,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())},e}(ai),Hi=Zi,qi=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ji=function(t){function e(e){var r=e||{};return t.call(this,{points:1/0,fill:r.fill,radius:r.radius,stroke:r.stroke,scale:void 0!==r.scale?r.scale:1,rotation:void 0!==r.rotation?r.rotation:0,rotateWithView:void 0!==r.rotateWithView&&r.rotateWithView,displacement:void 0!==r.displacement?r.displacement:[0,0]})||this}return qi(e,t),e.prototype.clone=function(){var t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice()});return r.setOpacity(this.getOpacity()),r},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Hi),Qi=Ji,$i=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=no,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}return t.prototype.clone=function(){var e=this.getGeometry();return e&&"object"==typeof e&&(e=e.clone()),new t({geometry:e,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},t.prototype.getRenderer=function(){return this.renderer_},t.prototype.setRenderer=function(t){this.renderer_=t},t.prototype.setHitDetectionRenderer=function(t){this.hitDetectionRenderer_=t},t.prototype.getHitDetectionRenderer=function(){return this.hitDetectionRenderer_},t.prototype.getGeometry=function(){return this.geometry_},t.prototype.getGeometryFunction=function(){return this.geometryFunction_},t.prototype.getFill=function(){return this.fill_},t.prototype.setFill=function(t){this.fill_=t},t.prototype.getImage=function(){return this.image_},t.prototype.setImage=function(t){this.image_=t},t.prototype.getStroke=function(){return this.stroke_},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.getText=function(){return this.text_},t.prototype.setText=function(t){this.text_=t},t.prototype.getZIndex=function(){return this.zIndex_},t.prototype.setGeometry=function(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=no,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var to=null;function eo(t,e){if(!to){var r=new Un({color:"rgba(255,255,255,0.4)"}),n=new Hn({color:"#3399CC",width:1.25});to=[new $i({image:new Qi({fill:r,stroke:n,radius:5}),fill:r,stroke:n})]}return to}function ro(){var t={},e=[255,255,255,1],r=[0,153,255,1];return t[dt]=[new $i({fill:new Un({color:[255,255,255,.5]})})],t[yt]=t[dt],t[pt]=[new $i({stroke:new Hn({color:e,width:5})}),new $i({stroke:new Hn({color:r,width:3})})],t[_t]=t[pt],t[mt]=t[dt].concat(t[pt]),t[ct]=[new $i({image:new Qi({radius:6,fill:new Un({color:r}),stroke:new Hn({color:e,width:1.5})}),zIndex:1/0})],t[gt]=t[ct],t[vt]=t[dt].concat(t[pt],t[ct]),t}function no(t){return t.getGeometry()}var io=$i,oo="point",ao="line",so=function(){function t(t){var e=t||{};this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.scale_=e.scale,this.scaleArray_=ii(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new Un({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:oo,this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding}return t.prototype.clone=function(){var e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),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()})},t.prototype.getOverflow=function(){return this.overflow_},t.prototype.getFont=function(){return this.font_},t.prototype.getMaxAngle=function(){return this.maxAngle_},t.prototype.getPlacement=function(){return this.placement_},t.prototype.getOffsetX=function(){return this.offsetX_},t.prototype.getOffsetY=function(){return this.offsetY_},t.prototype.getFill=function(){return this.fill_},t.prototype.getRotateWithView=function(){return this.rotateWithView_},t.prototype.getRotation=function(){return this.rotation_},t.prototype.getScale=function(){return this.scale_},t.prototype.getScaleArray=function(){return this.scaleArray_},t.prototype.getStroke=function(){return this.stroke_},t.prototype.getText=function(){return this.text_},t.prototype.getTextAlign=function(){return this.textAlign_},t.prototype.getTextBaseline=function(){return this.textBaseline_},t.prototype.getBackgroundFill=function(){return this.backgroundFill_},t.prototype.getBackgroundStroke=function(){return this.backgroundStroke_},t.prototype.getPadding=function(){return this.padding_},t.prototype.setOverflow=function(t){this.overflow_=t},t.prototype.setFont=function(t){this.font_=t},t.prototype.setMaxAngle=function(t){this.maxAngle_=t},t.prototype.setOffsetX=function(t){this.offsetX_=t},t.prototype.setOffsetY=function(t){this.offsetY_=t},t.prototype.setPlacement=function(t){this.placement_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setFill=function(t){this.fill_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=ii(void 0!==t?t:1)},t.prototype.setStroke=function(t){this.stroke_=t},t.prototype.setText=function(t){this.text_=t},t.prototype.setTextAlign=function(t){this.textAlign_=t},t.prototype.setTextBaseline=function(t){this.textBaseline_=t},t.prototype.setBackgroundFill=function(t){this.backgroundFill_=t},t.prototype.setBackgroundStroke=function(t){this.backgroundStroke_=t},t.prototype.setPadding=function(t){this.padding_=t},t}(),lo=so,uo="opacity",ho="visible",co="extent",po="zIndex",fo="maxResolution",go="minResolution",_o="maxZoom",yo="minZoom",vo="source",mo="map",xo=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wo=function(t){function r(e){var r=t.call(this)||this;r.on,r.once,r.un,r.background_=e.background;var n=m({},e);return"object"==typeof e.properties&&(delete n.properties,m(n,e.properties)),n[uo]=void 0!==e.opacity?e.opacity:1,nt("number"==typeof n[uo],64),n[ho]=void 0===e.visible||e.visible,n[po]=e.zIndex,n[fo]=void 0!==e.maxResolution?e.maxResolution:1/0,n[go]=void 0!==e.minResolution?e.minResolution:0,n[yo]=void 0!==e.minZoom?e.minZoom:-1/0,n[_o]=void 0!==e.maxZoom?e.maxZoom:1/0,r.className_=void 0!==n.className?e.className:"ol-layer",delete n.className,r.setProperties(n),r.state_=null,r}return xo(r,t),r.prototype.getBackground=function(){return this.background_},r.prototype.getClassName=function(){return this.className_},r.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},r=this.getZIndex();return e.opacity=Ie(Math.round(100*this.getOpacity())/100,0,1),e.sourceState=this.getSourceState(),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==r||e.managed?r:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e},r.prototype.getLayersArray=function(t){return e()},r.prototype.getLayerStatesArray=function(t){return e()},r.prototype.getExtent=function(){return this.get(co)},r.prototype.getMaxResolution=function(){return this.get(fo)},r.prototype.getMinResolution=function(){return this.get(go)},r.prototype.getMinZoom=function(){return this.get(yo)},r.prototype.getMaxZoom=function(){return this.get(_o)},r.prototype.getOpacity=function(){return this.get(uo)},r.prototype.getSourceState=function(){return e()},r.prototype.getVisible=function(){return this.get(ho)},r.prototype.getZIndex=function(){return this.get(po)},r.prototype.setBackground=function(t){this.background_=t,this.changed()},r.prototype.setExtent=function(t){this.set(co,t)},r.prototype.setMaxResolution=function(t){this.set(fo,t)},r.prototype.setMinResolution=function(t){this.set(go,t)},r.prototype.setMaxZoom=function(t){this.set(_o,t)},r.prototype.setMinZoom=function(t){this.set(yo,t)},r.prototype.setOpacity=function(t){nt("number"==typeof t,64),this.set(uo,t)},r.prototype.setVisible=function(t){this.set(ho,t)},r.prototype.setZIndex=function(t){this.set(po,t)},r.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},r}(q),So="undefined",Co="loading",Eo="ready",To="error",bo=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ro=function(t){function e(e){var r=this,n=m({},e);delete n.source,(r=t.call(this,n)||this).on,r.once,r.un,r.mapPrecomposeKey_=null,r.mapRenderKey_=null,r.sourceChangeKey_=null,r.renderer_=null,e.render&&(r.render=e.render),e.map&&r.setMap(e.map),r.addChangeListener(vo,r.handleSourcePropertyChange_);var i=e.source?e.source:null;return r.setSource(i),r}return bo(e,t),e.prototype.getLayersArray=function(t){var e=t||[];return e.push(this),e},e.prototype.getLayerStatesArray=function(t){var e=t||[];return e.push(this.getLayerState()),e},e.prototype.getSource=function(){return this.get(vo)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():So},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(z(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=N(t,T,this.handleSourceChange_,this)),this.changed()},e.prototype.getFeatures=function(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((function(t){return t([])}))},e.prototype.render=function(t,e){var r=this.getRenderer();if(r.prepareFrame(t))return r.renderFrame(t,e)},e.prototype.setMapInternal=function(t){this.set(mo,t)},e.prototype.getMapInternal=function(){return this.get(mo)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(z(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(z(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=N(t,Nn,(function(t){var e=t.frameState.layerStatesArray,r=this.getLayerState(!1);nt(!e.some((function(t){return t.layer===r.layer})),67),e.push(r)}),this),this.mapRenderKey_=N(this,T,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(vo,t)},e.prototype.getRenderer=function(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_},e.prototype.hasRenderer=function(){return!!this.renderer_},e.prototype.createRenderer=function(){return null},e.prototype.disposeInternal=function(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),t.prototype.disposeInternal.call(this)},e}(wo);function Po(t,e){if(!t.visible)return!1;var r=e.resolution;if(r<t.minResolution||r>=t.maxResolution)return!1;var n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}var Oo=Ro;function Fo(t,e,r,n,i){Io(t,e,r||0,n||t.length-1,i||Mo)}function Io(t,e,r,n,i){for(;n>r;){if(n-r>600){var o=n-r+1,a=e-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),u=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);Io(t,e,Math.max(r,Math.floor(e-a*l/o+u)),Math.min(n,Math.floor(e+(o-a)*l/o+u)),i)}var h=t[e],c=r,p=n;for(Lo(t,r,e),i(t[n],h)>0&&Lo(t,r,n);c<p;){for(Lo(t,c,p),c++,p--;i(t[c],h)<0;)c++;for(;i(t[p],h)>0;)p--}0===i(t[r],h)?Lo(t,r,p):Lo(t,++p,n),p<=e&&(r=p+1),e<=p&&(n=p-1)}}function Lo(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function Mo(t,e){return t<e?-1:t>e?1:0}class Ao{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const r=[];if(!Wo(t,e))return r;const n=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],s=e.leaf?n(a):a;Wo(t,s)&&(e.leaf?r.push(a):Xo(t,s)?this._all(a,r):i.push(a))}e=i.pop()}return r}collides(t){let e=this.data;if(!Wo(t,e))return!1;const r=[];for(;e;){for(let n=0;n<e.children.length;n++){const i=e.children[n],o=e.leaf?this.toBBox(i):i;if(Wo(t,o)){if(e.leaf||Xo(t,o))return!0;r.push(i)}}e=r.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Yo([]),this}remove(t,e){if(!t)return this;let r=this.data;const n=this.toBBox(t),i=[],o=[];let a,s,l;for(;r||i.length;){if(r||(r=i.pop(),s=i[i.length-1],a=o.pop(),l=!0),r.leaf){const n=Do(t,r.children,e);if(-1!==n)return r.children.splice(n,1),i.push(r),this._condense(i),this}l||r.leaf||!Xo(r,n)?s?(a++,r=s.children[a],l=!1):r=null:(i.push(r),o.push(a),a=0,s=r,r=r.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const r=[];for(;t;)t.leaf?e.push(...t.children):r.push(...t.children),t=r.pop();return e}_build(t,e,r,n){const i=r-e+1;let o,a=this._maxEntries;if(i<=a)return o=Yo(t.slice(e,r+1)),ko(o,this.toBBox),o;n||(n=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,n-1))),o=Yo([]),o.leaf=!1,o.height=n;const s=Math.ceil(i/a),l=s*Math.ceil(Math.sqrt(a));Ko(t,e,r,l,this.compareMinX);for(let i=e;i<=r;i+=l){const e=Math.min(i+l-1,r);Ko(t,i,e,s,this.compareMinY);for(let r=i;r<=e;r+=s){const i=Math.min(r+s-1,e);o.children.push(this._build(t,r,i,n-1))}}return ko(o,this.toBBox),o}_chooseSubtree(t,e,r,n){for(;n.push(e),!e.leaf&&n.length-1!==r;){let r,n=1/0,a=1/0;for(let s=0;s<e.children.length;s++){const l=e.children[s],u=zo(l),h=(i=t,o=l,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-u);h<a?(a=h,n=u<n?u:n,r=l):h===a&&u<n&&(n=u,r=l)}e=r||e.children[0]}var i,o;return e}_insert(t,e,r){const n=r?t:this.toBBox(t),i=[],o=this._chooseSubtree(n,this.data,e,i);for(o.children.push(t),Go(o,n);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(n,i,e)}_split(t,e){const r=t[e],n=r.children.length,i=this._minEntries;this._chooseSplitAxis(r,i,n);const o=this._chooseSplitIndex(r,i,n),a=Yo(r.children.splice(o,r.children.length-o));a.height=r.height,a.leaf=r.leaf,ko(r,this.toBBox),ko(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(r,a)}_splitRoot(t,e){this.data=Yo([t,e]),this.data.height=t.height+1,this.data.leaf=!1,ko(this.data,this.toBBox)}_chooseSplitIndex(t,e,r){let n,i=1/0,o=1/0;for(let a=e;a<=r-e;a++){const e=jo(t,0,a,this.toBBox),s=jo(t,a,r,this.toBBox),l=Vo(e,s),u=zo(e)+zo(s);l<i?(i=l,n=a,o=u<o?u:o):l===i&&u<o&&(o=u,n=a)}return n||r-e}_chooseSplitAxis(t,e,r){const n=t.leaf?this.compareMinX:No,i=t.leaf?this.compareMinY:Bo;this._allDistMargin(t,e,r,n)<this._allDistMargin(t,e,r,i)&&t.children.sort(n)}_allDistMargin(t,e,r,n){t.children.sort(n);const i=this.toBBox,o=jo(t,0,e,i),a=jo(t,r-e,r,i);let s=Uo(o)+Uo(a);for(let n=e;n<r-e;n++){const e=t.children[n];Go(o,t.leaf?i(e):e),s+=Uo(o)}for(let n=r-e-1;n>=e;n--){const e=t.children[n];Go(a,t.leaf?i(e):e),s+=Uo(a)}return s}_adjustParentBBoxes(t,e,r){for(let n=r;n>=0;n--)Go(e[n],t)}_condense(t){for(let e,r=t.length-1;r>=0;r--)0===t[r].children.length?r>0?(e=t[r-1].children,e.splice(e.indexOf(t[r]),1)):this.clear():ko(t[r],this.toBBox)}}function Do(t,e,r){if(!r)return e.indexOf(t);for(let n=0;n<e.length;n++)if(r(t,e[n]))return n;return-1}function ko(t,e){jo(t,0,t.children.length,e,t)}function jo(t,e,r,n,i){i||(i=Yo(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<r;o++){const e=t.children[o];Go(i,t.leaf?n(e):e)}return i}function Go(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function No(t,e){return t.minX-e.minX}function Bo(t,e){return t.minY-e.minY}function zo(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Uo(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Vo(t,e){const r=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-r)*Math.max(0,o-n)}function Xo(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Wo(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Yo(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Ko(t,e,r,n,i){const o=[e,r];for(;o.length;){if((r=o.pop())-(e=o.pop())<=n)continue;const a=e+Math.ceil((r-e)/n/2)*n;Fo(t,a,e,r,i),o.push(e,a,a,r)}}var Zo=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ho="renderOrder",qo=function(t){function e(e){var r=this,n=e||{},i=m({},n);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(r=t.call(this,i)||this).declutter_=void 0!==n.declutter&&n.declutter,r.renderBuffer_=void 0!==n.renderBuffer?n.renderBuffer:100,r.style_=null,r.styleFunction_=void 0,r.setStyle(n.style),r.updateWhileAnimating_=void 0!==n.updateWhileAnimating&&n.updateWhileAnimating,r.updateWhileInteracting_=void 0!==n.updateWhileInteracting&&n.updateWhileInteracting,r}return Zo(e,t),e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Ho)},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.getUpdateWhileAnimating=function(){return this.updateWhileAnimating_},e.prototype.getUpdateWhileInteracting=function(){return this.updateWhileInteracting_},e.prototype.renderDeclutter=function(t){t.declutterTree||(t.declutterTree=new Ao(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(Ho,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:eo,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var r;Array.isArray(t)?r=t:(nt("function"==typeof t.getZIndex,41),r=[t]),e=function(){return r}}return e}(this.style_),this.changed()},e}(Oo),Jo={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},Qo=[Jo.FILL],$o=[Jo.STROKE],ta=[Jo.BEGIN_PATH],ea=[Jo.CLOSE_PATH],ra=Jo,na=function(){function t(){}return t.prototype.drawCustom=function(t,e,r,n){},t.prototype.drawGeometry=function(t){},t.prototype.setStyle=function(t){},t.prototype.drawCircle=function(t,e){},t.prototype.drawFeature=function(t,e){},t.prototype.drawGeometryCollection=function(t,e){},t.prototype.drawLineString=function(t,e){},t.prototype.drawMultiLineString=function(t,e){},t.prototype.drawMultiPoint=function(t,e){},t.prototype.drawMultiPolygon=function(t,e){},t.prototype.drawPoint=function(t,e){},t.prototype.drawPolygon=function(t,e){},t.prototype.drawText=function(t,e){},t.prototype.setFillStrokeStyle=function(t,e){},t.prototype.setImageStyle=function(t,e){},t.prototype.setTextStyle=function(t,e){},t}(),ia=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),oa=function(t){function e(e,r,n,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=r,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=n,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return ia(e,t),e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatPointCoordinates=function(t,e){for(var r=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,i=this.coordinates,o=i.length,a=0,s=t.length;a<s;a+=e)n[0]=t[a],n[1]=t[a+1],ee(r,n)&&(i[o++]=n[0],i[o++]=n[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,r,n,i,o){var a=this.coordinates,s=a.length,l=this.getBufferedMaxExtent();o&&(e+=n);var u,h,c,p=t[e],f=t[e+1],d=this.tmpCoordinate_,g=!0;for(u=e+n;u<r;u+=n)d[0]=t[u],d[1]=t[u+1],(c=ie(l,d))!==h?(g&&(a[s++]=p,a[s++]=f,g=!1),a[s++]=d[0],a[s++]=d[1]):c===Yt?(a[s++]=d[0],a[s++]=d[1],g=!1):g=!0,p=d[0],f=d[1],h=c;return(i&&g||u===e+n)&&(a[s++]=p,a[s++]=f),s},e.prototype.drawCustomCoordinates_=function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o],l=this.appendFlatLineCoordinates(t,e,s,n,!1,!1);i.push(l),e=s}return e},e.prototype.drawCustom=function(t,e,r,n){this.beginGeometry(t,e);var i,o,a,s,l,u=t.getType(),h=t.getStride(),c=this.coordinates.length;switch(u){case yt:i=t.getOrientedFlatCoordinates(),s=[];var p=t.getEndss();l=0;for(var f=0,d=p.length;f<d;++f){var g=[];l=this.drawCustomCoordinates_(i,l,p[f],h,g),s.push(g)}this.instructions.push([ra.CUSTOM,c,s,t,r,cn]),this.hitDetectionInstructions.push([ra.CUSTOM,c,s,t,n||r,cn]);break;case dt:case _t:a=[],i=u==dt?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(i,0,t.getEnds(),h,a),this.instructions.push([ra.CUSTOM,c,a,t,r,hn]),this.hitDetectionInstructions.push([ra.CUSTOM,c,a,t,n||r,hn]);break;case pt:case mt:i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,h,!1,!1),this.instructions.push([ra.CUSTOM,c,o,t,r,un]),this.hitDetectionInstructions.push([ra.CUSTOM,c,o,t,n||r,un]);break;case gt:i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,h))>c&&(this.instructions.push([ra.CUSTOM,c,o,t,r,un]),this.hitDetectionInstructions.push([ra.CUSTOM,c,o,t,n||r,un]));break;case ct:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([ra.CUSTOM,c,o,t,r]),this.hitDetectionInstructions.push([ra.CUSTOM,c,o,t,n||r])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[ra.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[ra.BEGIN_GEOMETRY,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var r,n,i=e.length,o=-1;for(t=0;t<i;++t)(n=(r=e[t])[0])==ra.END_GEOMETRY?o=t:n==ra.BEGIN_GEOMETRY&&(r[2]=t,f(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var r=this.state;if(t){var n=t.getColor();r.fillStyle=gi(n||Pi)}else r.fillStyle=void 0;if(e){var i=e.getColor();r.strokeStyle=gi(i||Li);var o=e.getLineCap();r.lineCap=void 0!==o?o:Oi;var a=e.getLineDash();r.lineDash=a?a.slice():Fi;var s=e.getLineDashOffset();r.lineDashOffset=s||0;var l=e.getLineJoin();r.lineJoin=void 0!==l?l:Ii;var u=e.getWidth();r.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();r.miterLimit=void 0!==h?h:10,r.lineWidth>this.maxLineWidth&&(this.maxLineWidth=r.lineWidth,this.bufferedMaxExtent_=null)}else r.strokeStyle=void 0,r.lineCap=void 0,r.lineDash=null,r.lineDashOffset=void 0,r.lineJoin=void 0,r.lineWidth=void 0,r.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,r=[ra.SET_FILL_STYLE,e];return"string"!=typeof e&&r.push(!0),r},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[ra.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]},e.prototype.updateFillStyle=function(t,e){var r=t.fillStyle;"string"==typeof r&&t.currentFillStyle==r||(void 0!==r&&this.instructions.push(e.call(this,t)),t.currentFillStyle=r)},e.prototype.updateStrokeStyle=function(t,e){var r=t.strokeStyle,n=t.lineCap,i=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,s=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=r||t.currentLineCap!=n||i!=t.currentLineDash&&!g(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=s||t.currentMiterLimit!=l)&&(void 0!==r&&e.call(this,t),t.currentStrokeStyle=r,t.currentLineCap=n,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=s,t.currentMiterLimit=l)},e.prototype.endGeometry=function(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var e=[ra.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=$t(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Qt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(na),aa=oa,sa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),la=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.hitDetectionImage_=null,o.image_=null,o.imagePixelRatio_=void 0,o.anchorX_=void 0,o.anchorY_=void 0,o.height_=void 0,o.opacity_=void 0,o.originX_=void 0,o.originY_=void 0,o.rotateWithView_=void 0,o.rotation_=void 0,o.scale_=void 0,o.width_=void 0,o.declutterImageWithText_=void 0,o}return sa(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([ra.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([ra.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var r=t.getFlatCoordinates(),n=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(r,n);this.instructions.push([ra.DRAW_IMAGE,i,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterImageWithText_]),this.hitDetectionInstructions.push([ra.DRAW_IMAGE,i,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.finish=function(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,t.prototype.finish.call(this)},e.prototype.setImageStyle=function(t,e){var r=t.getAnchor(),n=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),a=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=i,this.image_=o,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=a[0]*this.imagePixelRatio_,this.originY_=a[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterImageWithText_=e},e}(aa),ua=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ha=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return ua(e,t),e.prototype.drawFlatCoordinates_=function(t,e,r,n){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,r,n,!1,!1),a=[ra.MOVE_TO_LINE_TO,i,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),r},e.prototype.drawLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ra.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,Fi,0],ta);var o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push($o),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var r=this.state,n=r.strokeStyle,i=r.lineWidth;if(void 0!==n&&void 0!==i){this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([ra.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset],ta);for(var o=t.getEnds(),a=t.getFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(a,l,o[u],s);this.hitDetectionInstructions.push($o),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push($o),this.reverseHitDetectionInstructions(),this.state=null,t.prototype.finish.call(this)},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push($o),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(ta)},e}(aa),ca=ha,pa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fa=function(t){function e(e,r,n,i){return t.call(this,e,r,n,i)||this}return pa(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,r,n){var i=this.state,o=void 0!==i.fillStyle,a=void 0!==i.strokeStyle,s=r.length;this.instructions.push(ta),this.hitDetectionInstructions.push(ta);for(var l=0;l<s;++l){var u=r[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,n,!0,!a),p=[ra.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),a&&(this.instructions.push(ea),this.hitDetectionInstructions.push(ea)),e=u}return o&&(this.instructions.push(Qo),this.hitDetectionInstructions.push(Qo)),a&&(this.instructions.push($o),this.hitDetectionInstructions.push($o)),e},e.prototype.drawCircle=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([ra.SET_FILL_STYLE,Pi]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([ra.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getFlatCoordinates(),a=t.getStride(),s=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);var l=[ra.CIRCLE,s];this.instructions.push(ta,l),this.hitDetectionInstructions.push(ta,l),void 0!==r.fillStyle&&(this.instructions.push(Qo),this.hitDetectionInstructions.push(Qo)),void 0!==r.strokeStyle&&(this.instructions.push($o),this.hitDetectionInstructions.push($o)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([ra.SET_FILL_STYLE,Pi]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([ra.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);var o=t.getEnds(),a=t.getOrientedFlatCoordinates(),s=t.getStride();this.drawFlatCoordinatess_(a,0,o,s),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var r=this.state,n=r.fillStyle,i=r.strokeStyle;if(void 0!==n||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==r.fillStyle&&this.hitDetectionInstructions.push([ra.SET_FILL_STYLE,Pi]),void 0!==r.strokeStyle&&this.hitDetectionInstructions.push([ra.SET_STROKE_STYLE,r.strokeStyle,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,r.lineDash,r.lineDashOffset]);for(var o=t.getEndss(),a=t.getOrientedFlatCoordinates(),s=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(a,l,o[u],s);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var r=this.coordinates,n=0,i=r.length;n<i;++n)r[n]=an(r[n],e);return t.prototype.finish.call(this)},e.prototype.setFillStrokeStyles_=function(){var t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)},e}(aa),da=fa;function ga(t,e,r,n,i){var o,a,s,l,u,h,c,p,f,d=r,g=r,_=0,y=0,v=r;for(o=r;o<n;o+=i){var m=e[o],x=e[o+1];void 0!==l&&(p=m-l,f=x-u,s=Math.sqrt(p*p+f*f),void 0!==h&&(y+=a,Math.acos((h*p+c*f)/(a*s))>t&&(y>_&&(_=y,d=v,g=o),y=0,v=o-i)),a=s,h=p,c=f),l=m,u=x}return(y+=s)>_?[v,o]:[d,g]}var _a=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ya={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},va=function(t){function e(e,r,n,i){var o=t.call(this,e,r,n,i)||this;return o.labels_=null,o.text_="",o.textOffsetX_=0,o.textOffsetY_=0,o.textRotateWithView_=void 0,o.textRotation_=0,o.textFillState_=null,o.fillStates={},o.textStrokeState_=null,o.strokeStates={},o.textState_={},o.textStates={},o.textKey_="",o.fillKey_="",o.strokeKey_="",o.declutterImageWithText_=void 0,o}return _a(e,t),e.prototype.finish=function(){var e=t.prototype.finish.call(this);return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e},e.prototype.drawText=function(t,e){var r=this.textFillState_,n=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(r||n)){var o=this.coordinates,a=o.length,s=t.getType(),l=null,u=t.getStride();if(i.placement!==ao||s!=pt&&s!=_t&&s!=dt&&s!=yt){var h=i.overflow?null:[];switch(s){case ct:case gt:l=t.getFlatCoordinates();break;case pt:l=t.getFlatMidpoint();break;case mt:l=t.getCenter();break;case _t:l=t.getFlatMidpoints(),u=2;break;case dt:l=t.getFlatInteriorPoint(),i.overflow||h.push(l[2]/this.resolution),u=3;break;case yt:var c=t.getFlatInteriorPoints();l=[];for(S=0,C=c.length;S<C;S+=3)i.overflow||h.push(c[S+2]/this.resolution),l.push(c[S],c[S+1]);if(0===l.length)return;u=2}if((F=this.appendFlatPointCoordinates(l,u))===a)return;if(h&&(F-a)/2!=l.length/u){var p=a/2;h=h.filter((function(t,e){var r=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return r||--p,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(t,e);var f=i.padding;if(f!=Di&&(i.scale[0]<0||i.scale[1]<0)){var d=i.padding[0],g=i.padding[1],_=i.padding[2],y=i.padding[3];i.scale[0]<0&&(g=-g,y=-y),i.scale[1]<0&&(d=-d,_=-_),f=[d,g,_,y]}var v=this.pixelRatio;this.instructions.push([ra.DRAW_IMAGE,a,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,f==Di?Di:f.map((function(t){return t*v})),!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var m=1/v;this.hitDetectionInstructions.push([ra.DRAW_IMAGE,a,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterImageWithText_,f,!!i.backgroundFill,!!i.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!Re(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),s==pt)x=[l.length];else if(s==_t)x=t.getEnds();else if(s==dt)x=t.getEnds().slice(0,1);else if(s==yt){var w=t.getEndss();x=[];for(var S=0,C=w.length;S<C;++S)x.push(w[S][0])}this.beginGeometry(t,e);for(var E=i.textAlign,T=0,b=void 0,R=0,P=x.length;R<P;++R){if(null==E){var O=ga(i.maxAngle,l,T,x[R],u);T=O[0],b=O[1]}else b=x[R];for(var S=T;S<b;S+=u)o.push(l[S],l[S+1]);var F=o.length;T=x[R],this.drawChars_(a,F),a=F}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,r=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var i=this.textKey_;i in this.textStates||(this.textStates[i]={font:e.font,textAlign:e.textAlign||Mi,textBaseline:e.textBaseline||Ai,scale:e.scale});var o=this.fillKey_;r&&(o in this.fillStates||(this.fillStates[o]={fillStyle:r.fillStyle}))},e.prototype.drawChars_=function(t,e){var r=this.textStrokeState_,n=this.textState_,i=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();var s=this.pixelRatio,l=ya[n.textBaseline],u=this.textOffsetY_*s,h=this.text_,c=r?r.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([ra.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,s,u,i,c*s,h,o,1]),this.hitDetectionInstructions.push([ra.DRAW_CHARS,t,e,l,n.overflow,a,n.maxAngle,1,u,i,c,h,o,1/s])},e.prototype.setTextStyle=function(t,e){var r,i,o;if(t){var a=t.getFill();a?((i=this.textFillState_)||(i={},this.textFillState_=i),i.fillStyle=gi(a.getColor()||Pi)):(i=null,this.textFillState_=i);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var l=s.getLineDash(),u=s.getLineDashOffset(),h=s.getWidth(),c=s.getMiterLimit();o.lineCap=s.getLineCap()||Oi,o.lineDash=l?l.slice():Fi,o.lineDashOffset=void 0===u?0:u,o.lineJoin=s.getLineJoin()||Ii,o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=gi(s.getColor()||Li)}else o=null,this.textStrokeState_=o;r=this.textState_;var p=t.getFont()||Ri;zi(p);var f=t.getScaleArray();r.overflow=t.getOverflow(),r.font=p,r.maxAngle=t.getMaxAngle(),r.placement=t.getPlacement(),r.textAlign=t.getTextAlign(),r.textBaseline=t.getTextBaseline()||Ai,r.backgroundFill=t.getBackgroundFill(),r.backgroundStroke=t.getBackgroundStroke(),r.padding=t.getPadding()||Di,r.scale=void 0===f?[1,1]:f;var d=t.getOffsetX(),g=t.getOffsetY(),_=t.getRotateWithView(),y=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===d?0:d,this.textOffsetY_=void 0===g?0:g,this.textRotateWithView_=void 0!==_&&_,this.textRotation_=void 0===y?0:y,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:n(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.textBaseline||"?"),this.fillKey_=i?"string"==typeof i.fillStyle?i.fillStyle:"|"+n(i.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(aa),ma={Circle:da,Default:aa,Image:la,LineString:ca,Polygon:da,Text:va},xa=function(){function t(t,e,r,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=r,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var r=this.buildersByZIndex_[e];for(var n in r){var i=r[n].finish();t[e][n]=i}}return t},t.prototype.getBuilder=function(t,e){var r=void 0!==t?t.toString():"0",n=this.buildersByZIndex_[r];void 0===n&&(n={},this.buildersByZIndex_[r]=n);var i=n[e];void 0===i&&(i=new(0,ma[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=i);return i},t}(),wa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Sa=function(t){function r(e){var r=t.call(this)||this;return r.boundHandleImageChange_=r.handleImageChange_.bind(r),r.layer_=e,r.declutterExecutorGroup=null,r}return wa(r,t),r.prototype.getFeatures=function(t){return e()},r.prototype.prepareFrame=function(t){return e()},r.prototype.renderFrame=function(t,r){return e()},r.prototype.loadedTileCallback=function(t,e,r){t[e]||(t[e]={}),t[e][r.tileCoord.toString()]=r},r.prototype.createLoadedTileFinder=function(t,e,r){return function(n,i){var o=this.loadedTileCallback.bind(this,r,n);return t.forEachLoadedTile(e,n,i,o)}.bind(this)},r.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){},r.prototype.getDataAtPixel=function(t,e,r){return null},r.prototype.getLayer=function(){return this.layer_},r.prototype.handleFontsChanged=function(){},r.prototype.handleImageChange_=function(t){t.target.getState()===Qn&&this.renderIfReadyAndVisible()},r.prototype.loadImage=function(t){var e=t.getState();return e!=Qn&&e!=$n&&t.addEventListener(T,this.boundHandleImageChange_),e==qn&&(t.load(),e=t.getState()),e==Qn},r.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Eo&&t.changed()},r}(W),Ca=Sa,Ea=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ta=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.inversePixelTransform=r,o.frameState=n,o.context=i,o}return Ea(e,t),e}(s),ba=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ra=function(t){function e(e){var r=t.call(this,e)||this;return r.container=null,r.renderedResolution,r.tempTransform=[1,0,0,1,0,0],r.pixelTransform=[1,0,0,1,0,0],r.inversePixelTransform=[1,0,0,1,0,0],r.context=null,r.containerReused=!1,r.pixelContext_=null,r}return ba(e,t),e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,r,n){var i,o,a=this.getLayer().getClassName();!t||t.className!==a||""!==t.style.opacity||1!==r||n&&!g(pi(t.style.backgroundColor),pi(n))||(l=t.firstElementChild)instanceof HTMLCanvasElement&&(o=l.getContext("2d"));if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(i=document.createElement("div")).className=a;var s=i.style;s.position="absolute",s.width="100%",s.height="100%",n&&(s.backgroundColor=n);var l=(o=_i()).canvas;i.appendChild(l),(s=l.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=i,this.context=o}},e.prototype.clipUnrotated=function(t,e,r){var n=Ee(r),i=Te(r),o=ve(r),a=ye(r);kt(e.coordinateToPixelTransform,n),kt(e.coordinateToPixelTransform,i),kt(e.coordinateToPixelTransform,o),kt(e.coordinateToPixelTransform,a);var s=this.inversePixelTransform;kt(s,n),kt(s,i),kt(s,o),kt(s,a),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){var i=new Ta(t,this.inversePixelTransform,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(jn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Gn,t,e)},e.prototype.getRenderTransform=function(t,e,r,n,i,o,a){var s=i/2,l=o/2,u=n/e,h=-u,c=-t[0]+a,p=-t[1];return Gt(this.tempTransform,s,l,u,h,-r,c,p)},e.prototype.getDataAtPixel=function(t,e,r){var n=kt(this.inversePixelTransform,t.slice()),i=this.context,o=this.getLayer().getExtent();if(o&&!ee(o,kt(e.pixelToCoordinateTransform,t.slice())))return null;var a,s=Math.round(n[0]),l=Math.round(n[1]),u=this.pixelContext_;if(!u){var h=document.createElement("canvas");h.width=1,h.height=1,u=h.getContext("2d"),this.pixelContext_=u}u.clearRect(0,0,1,1);try{u.drawImage(i.canvas,s,l,1,1,0,0,1,1),a=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):a}return 0===a[3]?null:a},e}(Ca),Pa=Ra,Oa="Circle",Fa="Default",Ia="Image",La="LineString",Ma="Polygon",Aa="Text";function Da(t,e,r,n,i,o,a,s,l,u,h,c){var p=t[e],f=t[e+1],d=0,g=0,_=0,y=0;function v(){d=p,g=f,p=t[e+=n],f=t[e+1],y+=_,_=Math.sqrt((p-d)*(p-d)+(f-g)*(f-g))}do{v()}while(e<r-n&&y+_<o);for(var m=0===_?0:(o-y)/_,x=Ne(d,p,m),w=Ne(g,f,m),S=e-n,C=y,E=o+s*l(u,i,h);e<r-n&&y+_<E;)v();var T,b=Ne(d,p,m=0===_?0:(E-y)/_),R=Ne(g,f,m);if(c){var P=[x,w,b,R];Br(P,0,4,2,c,P,P),T=P[0]>P[2]}else T=x>b;var O,F=Math.PI,I=[],L=S+n===e;if(_=0,y=C,p=t[e=S],f=t[e+1],L){v(),O=Math.atan2(f-g,p-d),T&&(O+=O>0?-F:F);var M=(b+x)/2,A=(R+w)/2;return I[0]=[M,A,(E-o)/2,O,i],I}for(var D=0,k=i.length;D<k;){v();var j=Math.atan2(f-g,p-d);if(T&&(j+=j>0?-F:F),void 0!==O){var G=j-O;if(G+=G>F?-2*F:G<-F?2*F:0,Math.abs(G)>a)return null}O=j;for(var N=D,B=0;D<k;++D){var z=s*l(u,i[T?k-D-1:D],h);if(e+n<r&&y+_<o+B+z/2)break;B+=z}if(D!==N){var U=T?i.substring(k-N,k-D):i.substring(N,D);M=Ne(d,p,m=0===_?0:(o+B/2-y)/_),A=Ne(g,f,m);I.push([M,A,B/2,j,U]),o+=B}}return I}var ka=[1/0,1/0,-1/0,-1/0],ja=[],Ga=[],Na=[],Ba=[];function za(t){return t[3].declutterBox}var Ua=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function Va(t,e){return"start"!==e&&"end"!==e||Ua.test(t)||(e="start"===e?"left":"right"),ya[e]}var Xa=function(){function t(t,e,r,n){this.overlaps=r,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,r,n){var i=t+e+r+n;if(this.labels_[i])return this.labels_[i];var o=n?this.strokeStates[n]:null,a=r?this.fillStates[r]:null,s=this.textStates[e],l=this.pixelRatio,u=[s.scale[0]*l,s.scale[1]*l],h=Va(t,s.textAlign||Mi),c=n&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),f=p.length,d=[],g=function(t,e,r){for(var n=e.length,i=0,o=0;o<n;++o){var a=Xi(t,e[o]);i=Math.max(i,a),r.push(a)}return i}(s.font,p,d),_=Ui(s.font),y=g+c,v=[],m=(y+2)*u[0],x=(_*f+c)*u[1],w={width:m<0?Math.floor(m):Math.ceil(m),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:v};(1==u[0]&&1==u[1]||v.push("scale",u),v.push("font",s.font),n)&&(v.push("strokeStyle",o.strokeStyle),v.push("lineWidth",c),v.push("lineCap",o.lineCap),v.push("lineJoin",o.lineJoin),v.push("miterLimit",o.miterLimit),(Ot?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(v.push("setLineDash",[o.lineDash]),v.push("lineDashOffset",o.lineDashOffset)));r&&v.push("fillStyle",a.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");var S,C=.5-h,E=h*y+C*c;if(n)for(S=0;S<f;++S)v.push("strokeText",[p[S],E+C*d[S],.5*(c+_)+S*_]);if(r)for(S=0;S<f;++S)v.push("fillText",[p[S],E+C*d[S],.5*(c+_)+S*_]);return this.labels_[i]=w,w},t.prototype.replayTextBackground_=function(t,e,r,n,i,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,r),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,r,n,i,o,a,s,l,u,h,c,p,f,d,g){var _,y=r-(a*=c[0]),v=n-(s*=c[1]),m=i+l>t?t-l:i,x=o+u>e?e-u:o,w=f[3]+m*c[0]+f[1],S=f[0]+x*c[1]+f[2],C=y-f[3],E=v-f[0];return(d||0!==h)&&(ja[0]=C,Ba[0]=C,ja[1]=E,Ga[1]=E,Ga[0]=C+w,Na[0]=Ga[0],Na[1]=E+S,Ba[1]=Na[1]),0!==h?(kt(_=Gt([1,0,0,1,0,0],r,n,1,1,h,-r,-n),ja),kt(_,Ga),kt(_,Na),kt(_,Ba),ae(Math.min(ja[0],Ga[0],Na[0],Ba[0]),Math.min(ja[1],Ga[1],Na[1],Ba[1]),Math.max(ja[0],Ga[0],Na[0],Ba[0]),Math.max(ja[1],Ga[1],Na[1],Ba[1]),ka)):ae(Math.min(C,C+w),Math.min(E,E+S),Math.max(C,C+w),Math.max(E,E+S),ka),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:u,declutterBox:{minX:ka[0],minY:ka[1],maxX:ka[2],maxY:ka[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,r,n,i,o,a){var s=!(!o&&!a),l=n.declutterBox,u=t.canvas,h=a?a[2]*n.scale[0]/2:0;return l.minX-h<=u.width/e&&l.maxX+h>=0&&l.minY-h<=u.height/e&&l.maxY+h>=0&&(s&&this.replayTextBackground_(t,ja,Ga,Na,Ba,o,a),Yi(t,n.canvasTransform,i,r,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=kt(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;t.save(),t.translate(e[0]%r,e[1]%r),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()},t.prototype.setStrokeStyle_=function(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.setLineDash&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},t.prototype.drawLabelWithPointPlacement_=function(t,e,r,n){var i=this.textStates[e],o=this.createLabel(t,e,n,r),a=this.strokeStates[r],s=this.pixelRatio,l=Va(t,i.textAlign||Mi),u=ya[i.textBaseline||Ai],h=a&&a.lineWidth?a.lineWidth:0;return{label:o,anchorX:l*(o.width/s-2*i.scale[0])+2*(.5-l)*h,anchorY:u*o.height/s+2*(.5-u)*h}},t.prototype.execute_=function(t,e,r,n,i,o,a,s){var l,u,h;this.pixelCoordinates_&&g(r,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Nr(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),u=this.renderedTransform_,h=r,u[0]=h[0],u[1]=h[1],u[2]=h[2],u[3]=h[3],u[4]=h[4],u[5]=h[5]);for(var c,p,f,d,_,y,v,m,x,w,S,C,E,T,b,R,P=0,O=n.length,F=0,I=0,L=0,M=null,A=null,D=this.coordinateCache_,k=this.viewRotation_,j=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},N=this.instructions!=n||this.overlaps?0:200;P<O;){var B=n[P];switch(B[0]){case ra.BEGIN_GEOMETRY:E=B[1],R=B[3],E.getGeometry()?void 0===a||Re(a,R.getExtent())?++P:P=B[2]+1:P=B[2];break;case ra.BEGIN_PATH:I>N&&(this.fill_(t),I=0),L>N&&(t.stroke(),L=0),I||L||(t.beginPath(),d=NaN,_=NaN),++P;break;case ra.CIRCLE:var z=l[F=B[1]],U=l[F+1],V=l[F+2]-z,X=l[F+3]-U,W=Math.sqrt(V*V+X*X);t.moveTo(z+W,U),t.arc(z,U,W,0,2*Math.PI,!0),++P;break;case ra.CLOSE_PATH:t.closePath(),++P;break;case ra.CUSTOM:F=B[1],c=B[2];var Y=B[3],K=B[4],Z=6==B.length?B[5]:void 0;G.geometry=Y,G.feature=E,P in D||(D[P]=[]);var H=D[P];Z?Z(l,F,c,2,H):(H[0]=l[F],H[1]=l[F+1],H.length=2),K(H,G),++P;break;case ra.DRAW_IMAGE:F=B[1],c=B[2],m=B[3],p=B[4],f=B[5];var q=B[6],J=B[7],Q=B[8],$=B[9],tt=B[10],et=B[11],rt=B[12],nt=B[13],it=B[14];if(!m&&B.length>=19){x=B[18],w=B[19],S=B[20],C=B[21];var ot=this.drawLabelWithPointPlacement_(x,w,S,C);m=ot.label,B[3]=m;var at=B[22];p=(ot.anchorX-at)*this.pixelRatio,B[4]=p;var st=B[23];f=(ot.anchorY-st)*this.pixelRatio,B[5]=f,q=m.height,B[6]=q,nt=m.width,B[13]=nt}var lt=void 0;B.length>24&&(lt=B[24]);var ut=void 0,ht=void 0,ct=void 0;B.length>16?(ut=B[15],ht=B[16],ct=B[17]):(ut=Di,ht=!1,ct=!1),tt&&j?et+=k:tt||j||(et-=k);for(var pt=0;F<c;F+=2)if(!(lt&&lt[pt++]<nt/this.pixelRatio)){var ft=[t,e,m,Bt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[F],l[F+1],nt,q,p,f,Q,$,et,rt,i,ut,ht||ct,E),J,ht?M:null,ct?A:null],dt=void 0,gt=void 0;if(s&&it){var _t=c-F;if(!it[_t]){it[_t]=ft;continue}if(dt=it[_t],delete it[_t],gt=za(dt),s.collides(gt))continue}s&&s.collides(Bt.declutterBox)||(dt&&(s&&s.insert(gt),this.replayImageOrLabel_.apply(this,dt)),s&&s.insert(Bt.declutterBox),this.replayImageOrLabel_.apply(this,ft))}++P;break;case ra.DRAW_CHARS:var yt=B[1],vt=B[2],mt=B[3],xt=B[4];C=B[5];var wt=B[6],St=B[7],Ct=B[8];S=B[9];var Et=B[10];x=B[11],w=B[12];var Tt=[B[13],B[13]],bt=this.textStates[w],Rt=bt.font,Pt=[bt.scale[0]*St,bt.scale[1]*St],Ot=void 0;Rt in this.widths_?Ot=this.widths_[Rt]:(Ot={},this.widths_[Rt]=Ot);var Ft=Wn(l,yt,vt,2),It=Math.abs(Pt[0])*Wi(Rt,x,Ot);if(xt||It<=Ft){var Lt=this.textStates[w].textAlign,Mt=Da(l,yt,vt,2,x,(Ft-It)*ya[Lt],wt,Math.abs(Pt[0]),Wi,Rt,Ot,j?0:this.viewRotation_);t:if(Mt){var At=[],Dt=void 0,kt=void 0,jt=void 0,Gt=void 0,Nt=void 0;if(S)for(Dt=0,kt=Mt.length;Dt<kt;++Dt){jt=(Nt=Mt[Dt])[4],Gt=this.createLabel(jt,w,"",S),p=Nt[2]+(Pt[0]<0?-Et:Et),f=mt*Gt.height+2*(.5-mt)*Et*Pt[1]/Pt[0]-Ct;var Bt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,Nt[0],Nt[1],Gt.width,Gt.height,p,f,0,0,Nt[3],Tt,!1,Di,!1,E);if(s&&s.collides(Bt.declutterBox))break t;At.push([t,e,Gt,Bt,1,null,null])}if(C)for(Dt=0,kt=Mt.length;Dt<kt;++Dt){jt=(Nt=Mt[Dt])[4],Gt=this.createLabel(jt,w,C,""),p=Nt[2],f=mt*Gt.height-Ct;Bt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,Nt[0],Nt[1],Gt.width,Gt.height,p,f,0,0,Nt[3],Tt,!1,Di,!1,E);if(s&&s.collides(Bt.declutterBox))break t;At.push([t,e,Gt,Bt,1,null,null])}s&&s.load(At.map(za));for(var zt=0,Ut=At.length;zt<Ut;++zt)this.replayImageOrLabel_.apply(this,At[zt])}}++P;break;case ra.END_GEOMETRY:if(void 0!==o){var Vt=o(E=B[1],R);if(Vt)return Vt}++P;break;case ra.FILL:N?I++:this.fill_(t),++P;break;case ra.MOVE_TO_LINE_TO:for(F=B[1],c=B[2],T=l[F],v=(b=l[F+1])+.5|0,(y=T+.5|0)===d&&v===_||(t.moveTo(T,b),d=y,_=v),F+=2;F<c;F+=2)y=(T=l[F])+.5|0,v=(b=l[F+1])+.5|0,F!=c-2&&y===d&&v===_||(t.lineTo(T,b),d=y,_=v);++P;break;case ra.SET_FILL_STYLE:M=B,this.alignFill_=B[2],I&&(this.fill_(t),I=0,L&&(t.stroke(),L=0)),t.fillStyle=B[1],++P;break;case ra.SET_STROKE_STYLE:A=B,L&&(t.stroke(),L=0),this.setStrokeStyle_(t,B),++P;break;case ra.STROKE:N?L++:t.stroke(),++P;break;default:++P}}I&&this.fill_(t),L&&t.stroke()},t.prototype.execute=function(t,e,r,n,i,o){this.viewRotation_=n,this.execute_(t,e,r,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,r,n,i){return this.viewRotation_=r,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,i)},t}(),Wa=Xa,Ya=[Ma,Oa,La,Ia,Aa,Fa],Ka=function(){function t(t,e,r,n,i,o){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=r,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(i)}return t.prototype.clip=function(t,e){var r=this.getClipCoords(e);t.beginPath(),t.moveTo(r[0],r[1]),t.lineTo(r[2],r[3]),t.lineTo(r[4],r[5]),t.lineTo(r[6],r[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var r=this.executorsByZIndex_[e];void 0===r&&(r={},this.executorsByZIndex_[e]=r);var n=t[e];for(var i in n){var o=n[i];r[i]=new Wa(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var r=this.executorsByZIndex_[e],n=0,i=t.length;n<i;++n)if(t[n]in r)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o){var a=2*(n=Math.round(n))+1,s=Gt(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-r,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=_i(a,a));var u,c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):l||c.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(pe(u=[1/0,1/0,-1/0,-1/0],t),Qt(u,e*(this.renderBuffer_+n),u));var p,f=function(t){if(void 0!==Za[t])return Za[t];for(var e=2*t+1,r=t*t,n=new Array(r+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var a=i*i+o*o;if(a>r)break;var s=n[a];s||(s=[],n[a]=s),s.push(4*((t+i)*e+(t+o))+3),i>0&&s.push(4*((t-i)*e+(t+o))+3),o>0&&(s.push(4*((t+i)*e+(t-o))+3),i>0&&s.push(4*((t-i)*e+(t-o))+3))}for(var l=[],u=(i=0,n.length);i<u;++i)n[i]&&l.push.apply(l,n[i]);return Za[t]=l,l}(n);function d(t,e){for(var r=c.getImageData(0,0,a,a).data,s=0,l=f.length;s<l;s++)if(r[f[s]]>0){if(!o||p!==Ia&&p!==Aa||-1!==o.indexOf(t)){var u=(f[s]-3)/4,h=n-u%a,d=n-(u/a|0),g=i(t,e,h*h+d*d);if(g)return g}c.clearRect(0,0,a,a);break}}var g,_,y,v,m,x=Object.keys(this.executorsByZIndex_).map(Number);for(x.sort(h),g=x.length-1;g>=0;--g){var w=x[g].toString();for(y=this.executorsByZIndex_[w],_=Ya.length-1;_>=0;--_)if(void 0!==(v=y[p=Ya[_]])&&(m=v.executeHitDetection(c,s,r,d,u)))return m}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var r=e[0],n=e[1],i=e[2],o=e[3],a=[r,n,r,o,i,o,i,n];return Nr(a,0,8,2,t,a),a},t.prototype.isEmpty=function(){return S(this.executorsByZIndex_)},t.prototype.execute=function(t,e,r,n,i,o,a){var s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(h),this.maxExtent_&&(t.save(),this.clip(t,r));var l,u,c,p,f,d,g=o||Ya;for(a&&s.reverse(),l=0,u=s.length;l<u;++l){var _=s[l].toString();for(f=this.executorsByZIndex_[_],c=0,p=g.length;c<p;++c){void 0!==(d=f[g[c]])&&d.execute(t,e,r,n,i,a)}}this.maxExtent_&&t.restore()},t}(),Za={};var Ha=Ka,qa=0,Ja=1,Qa=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$a=function(t){function e(e,r,n,i,o,a,s){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=r,l.extent_=n,l.transform_=i,l.viewRotation_=o,l.squaredTolerance_=a,l.userTransform_=s,l.contextFillState_=null,l.contextStrokeState_=null,l.contextTextState_=null,l.fillState_=null,l.strokeState_=null,l.image_=null,l.imageAnchorX_=0,l.imageAnchorY_=0,l.imageHeight_=0,l.imageOpacity_=0,l.imageOriginX_=0,l.imageOriginY_=0,l.imageRotateWithView_=!1,l.imageRotation_=0,l.imageScale_=[0,0],l.imageWidth_=0,l.text_="",l.textOffsetX_=0,l.textOffsetY_=0,l.textRotateWithView_=!1,l.textRotation_=0,l.textScale_=[0,0],l.textFillState_=null,l.textStrokeState_=null,l.textState_=null,l.pixelCoordinates_=[],l.tmpLocalTransform_=[1,0,0,1,0,0],l}return Qa(e,t),e.prototype.drawImages_=function(t,e,r,n){if(this.image_){var i=Nr(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,s=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=s*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=i.length;u<h;u+=2){var c=i[u]-this.imageAnchorX_,p=i[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;Gt(a,f,d,1,1,l,-f,-d),o.setTransform.apply(o,a),o.translate(f,d),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.setTransform(1,0,0,1,0,0)}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(o.globalAlpha=s)}},e.prototype.drawText_=function(t,e,r,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=Nr(t,e,r,n,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.textRotation_;for(this.textRotateWithView_&&(a+=this.viewRotation_);e<r;e+=n){var s=i[e]+this.textOffsetX_,l=i[e+1]+this.textOffsetY_;if(0!==a||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Gt(this.tmpLocalTransform_,s,l,1,1,a,-s,-l);o.setTransform.apply(o,u),o.translate(s,l),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&o.strokeText(this.text_,s,l),this.textFillState_&&o.fillText(this.text_,s,l)}}},e.prototype.moveToLineTo_=function(t,e,r,n,i){var o=this.context_,a=Nr(t,e,r,n,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);var s=a.length;i&&(s-=2);for(var l=2;l<s;l+=2)o.lineTo(a[l],a[l+1]);return i&&o.closePath(),r},e.prototype.drawRings_=function(t,e,r,n){for(var i=0,o=r.length;i<o;++i)e=this.moveToLineTo_(t,e,r[i],n,!0);return e},e.prototype.drawCircle=function(t){if(Re(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=function(t,e,r){var n=t.getFlatCoordinates();if(n){var i=t.getStride();return Nr(n,0,n.length,i,e,r)}return null}(t,this.transform_,this.pixelCoordinates_),r=e[2]-e[0],n=e[3]-e[1],i=Math.sqrt(r*r+n*n),o=this.context_;o.beginPath(),o.arc(e[0],e[1],i,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}},e.prototype.setStyle=function(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())},e.prototype.setTransform=function(t){this.transform_=t},e.prototype.drawGeometry=function(t){switch(t.getType()){case ct:this.drawPoint(t);break;case pt:this.drawLineString(t);break;case dt:this.drawPolygon(t);break;case gt:this.drawMultiPoint(t);break;case _t:this.drawMultiLineString(t);break;case yt:this.drawMultiPolygon(t);break;case vt:this.drawGeometryCollection(t);break;case mt:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var r=e.getGeometryFunction()(t);r&&Re(this.extent_,r.getExtent())&&(this.setStyle(e),this.drawGeometry(r))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),r=0,n=e.length;r<n;++r)this.drawGeometry(e[r])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),r=t.getStride();this.image_&&this.drawImages_(e,0,e.length,r),""!==this.text_&&this.drawText_(e,0,e.length,r)},e.prototype.drawLineString=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Re(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(r,0,r.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Re(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var r=this.context_,n=t.getFlatCoordinates(),i=0,o=t.getEnds(),a=t.getStride();r.beginPath();for(var s=0,l=o.length;s<l;++s)i=this.moveToLineTo_(n,i,o[s],a,!1);r.stroke()}if(""!==this.text_){var u=t.getFlatMidpoints();this.drawText_(u,0,u.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Re(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var r=t.getFlatInteriorPoint();this.drawText_(r,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Re(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);var e=this.context_,r=t.getOrientedFlatCoordinates(),n=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var a=0,s=i.length;a<s;++a){var l=i[a];n=this.drawRings_(r,n,l,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var u=t.getFlatInteriorPoints();this.drawText_(u,0,u.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,r=this.contextFillState_;r?r.fillStyle!=t.fillStyle&&(r.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=t.lineCap&&(r.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(g(r.lineDash,t.lineDash)||e.setLineDash(r.lineDash=t.lineDash),r.lineDashOffset!=t.lineDashOffset&&(r.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),r.lineJoin!=t.lineJoin&&(r.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),r.lineWidth!=t.lineWidth&&(r.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),r.miterLimit!=t.miterLimit&&(r.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),r.strokeStyle!=t.strokeStyle&&(r.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})},e.prototype.setContextTextState_=function(t){var e=this.context_,r=this.contextTextState_,n=t.textAlign?t.textAlign:Mi;r?(r.font!=t.font&&(r.font=t.font,e.font=t.font),r.textAlign!=n&&(r.textAlign=n,e.textAlign=n),r.textBaseline!=t.textBaseline&&(r.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var r=this;if(t){var n=t.getColor();this.fillState_={fillStyle:gi(n||Pi)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),a=e.getLineDash(),s=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=a||Fi;this.strokeState_={lineCap:void 0!==o?o:Oi,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*r.pixelRatio_})),lineDashOffset:(s||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Ii,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:gi(i||Li)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var r=t.getAnchor(),n=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*this.pixelRatio_,this.imageAnchorY_=r[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScaleArray(),this.imageWidth_=e[0]*this.pixelRatio_}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var r=e.getColor();this.textFillState_={fillStyle:gi(r||Pi)}}else this.textFillState_=null;var n=t.getStroke();if(n){var i=n.getColor(),o=n.getLineCap(),a=n.getLineDash(),s=n.getLineDashOffset(),l=n.getLineJoin(),u=n.getWidth(),h=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:Oi,lineDash:a||Fi,lineDashOffset:s||0,lineJoin:void 0!==l?l:Ii,lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:gi(i||Li)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),f=t.getOffsetY(),d=t.getRotateWithView(),g=t.getRotation(),_=t.getScaleArray(),y=t.getText(),v=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:Ri,textAlign:void 0!==v?v:Mi,textBaseline:void 0!==m?m:Ai},this.text_=void 0!==y?y:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==f?this.pixelRatio_*f:0,this.textRotateWithView_=void 0!==d&&d,this.textRotation_=void 0!==g?g:0,this.textScale_=[this.pixelRatio_*_[0],this.pixelRatio_*_[1]]}else this.text_=""},e}(na),ts=$a,es="fraction",rs="pixels",ns="bottom-left",is="bottom-right",os="top-left",as="top-right";function ss(t,e,r){return e+":"+t+":"+(r?ui(r):"null")}var ls=new(function(){function t(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}return t.prototype.clear=function(){this.cache_={},this.cacheSize_=0},t.prototype.canExpireCache=function(){return this.cacheSize_>this.maxCacheSize_},t.prototype.expire=function(){if(this.canExpireCache()){var t=0;for(var e in this.cache_){var r=this.cache_[e];0!=(3&t++)||r.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,r){var n=ss(t,e,r);return n in this.cache_?this.cache_[n]:null},t.prototype.set=function(t,e,r,n){var i=ss(t,e,r);this.cache_[i]=n,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),us=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hs=function(t){function r(e,r,n,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=n,o.resolution=r,o.state=i,o}return us(r,t),r.prototype.changed=function(){this.dispatchEvent(T)},r.prototype.getExtent=function(){return this.extent},r.prototype.getImage=function(){return e()},r.prototype.getPixelRatio=function(){return this.pixelRatio_},r.prototype.getResolution=function(){return this.resolution},r.prototype.getState=function(){return this.state},r.prototype.load=function(){e()},r}(E),cs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ps(t,e,r){var n=t,i=!0,o=!1,a=!1,s=[B(n,D,(function(){a=!0,o||e()}))];return n.src&&Ft?(o=!0,n.decode().then((function(){i&&e()})).catch((function(t){i&&(a?e():r())}))):s.push(B(n,b,r)),function(){i=!1,s.forEach(z)}}var fs=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,n,qn)||this;return s.src_=i,s.image_=new Image,null!==o&&(s.image_.crossOrigin=o),s.unlisten_=null,s.state=qn,s.imageLoadFunction_=a,s}return cs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=$n,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Se(this.extent)/this.image_.height),this.state=Qn,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=qn&&this.state!=$n||(this.state=Jn,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=ps(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Se(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(hs),ds=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gs=null,_s=function(t){function e(e,r,n,i,o,a){var s=t.call(this)||this;return s.hitDetectionImage_=null,s.image_=e||new Image,null!==i&&(s.image_.crossOrigin=i),s.canvas_={},s.color_=a,s.unlisten_=null,s.imageState_=o,s.size_=n,s.src_=r,s.tainted_,s}return ds(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Qn){gs||(gs=_i(1,1)),gs.drawImage(this.image_,0,0);try{gs.getImageData(0,0,1,1),this.tainted_=!1}catch(t){gs=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(T)},e.prototype.handleImageError_=function(){this.imageState_=$n,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Qn,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_()},e.prototype.getImage=function(t){return this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_},e.prototype.getPixelRatio=function(t){return this.replaceColor_(t),this.canvas_[t]?t:1},e.prototype.getImageState=function(){return this.imageState_},e.prototype.getHitDetectionImage=function(){if(!this.hitDetectionImage_)if(this.isTainted_()){var t=this.size_[0],e=this.size_[1],r=_i(t,e);r.fillRect(0,0,t,e),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},e.prototype.getSize=function(){return this.size_},e.prototype.getSrc=function(){return this.src_},e.prototype.load=function(){if(this.imageState_==qn){this.imageState_=Jn;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=ps(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Qn){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var r=e.getContext("2d");if(r.scale(t,t),r.drawImage(this.image_,0,0),r.globalCompositeOperation="multiply","multiply"===r.globalCompositeOperation||this.isTainted_())r.fillStyle=ui(this.color_),r.fillRect(0,0,e.width/t,e.height/t),r.globalCompositeOperation="destination-in",r.drawImage(this.image_,0,0);else{for(var n=r.getImageData(0,0,e.width,e.height),i=n.data,o=this.color_[0]/255,a=this.color_[1]/255,s=this.color_[2]/255,l=this.color_[3],u=0,h=i.length;u<h;u+=4)i[u]*=o,i[u+1]*=a,i[u+2]*=s,i[u+3]*=l;r.putImageData(n,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(E);var ys=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vs=function(t){function e(e){var r=this,i=e||{},o=void 0!==i.opacity?i.opacity:1,a=void 0!==i.rotation?i.rotation:0,s=void 0!==i.scale?i.scale:1,l=void 0!==i.rotateWithView&&i.rotateWithView;(r=t.call(this,{opacity:o,rotation:a,scale:s,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:l})||this).anchor_=void 0!==i.anchor?i.anchor:[.5,.5],r.normalizedAnchor_=null,r.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:os,r.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:es,r.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:es,r.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var u=void 0!==i.img?i.img:null,h=void 0!==i.imgSize?i.imgSize:null,c=i.src;nt(!(void 0!==c&&u),4),nt(!u||u&&h,5),void 0!==c&&0!==c.length||!u||(c=u.src||n(u)),nt(void 0!==c&&c.length>0,6);var p=void 0!==i.src?qn:Qn;return r.color_=void 0!==i.color?pi(i.color):null,r.iconImage_=function(t,e,r,n,i,o){var a=ls.get(e,n,o);return a||(a=new _s(t,e,r,n,i,o),ls.set(e,n,o,a)),a}(u,c,h,r.crossOrigin_,p,r.color_),r.offset_=void 0!==i.offset?i.offset:[0,0],r.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:os,r.origin_=null,r.size_=void 0!==i.size?i.size:null,r}return ys(e,t),e.prototype.clone=function(){var t=this.getScale();return new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,crossOrigin:this.crossOrigin_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,src:this.getSrc(),offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,size:null!==this.size_?this.size_.slice():void 0,opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==es||this.anchorYUnits_==es){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==es&&(t[0]*=e[0]),this.anchorYUnits_==es&&(t[1]*=e[1])}if(this.anchorOrigin_!=os){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=as&&this.anchorOrigin_!=is||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=ns&&this.anchorOrigin_!=is||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var r=this.getDisplacement();return[t[0]-r[0],t[1]+r[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=os){var e=this.getSize(),r=this.iconImage_.getSize();if(!e||!r)return null;t=t.slice(),this.offsetOrigin_!=as&&this.offsetOrigin_!=is||(t[0]=r[0]-e[0]-t[0]),this.offsetOrigin_!=ns&&this.offsetOrigin_!=is||(t[1]=r[1]-e[1]-t[1])}return this.origin_=t,this.origin_},e.prototype.getSrc=function(){return this.iconImage_.getSrc()},e.prototype.getSize=function(){return this.size_?this.size_:this.iconImage_.getSize()},e.prototype.listenImageChange=function(t){this.iconImage_.addEventListener(T,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(T,t)},e}(ai),ms=vs,xs=.5;function ws(t,e,r,n,i,o,a){var s=_i(t[0]*xs,t[1]*xs);s.imageSmoothingEnabled=!1;for(var l=s.canvas,u=new ts(s,xs,i,null,a),c=r.length,p=Math.floor(16777215/c),f={},d=1;d<=c;++d){var g=r[d-1],_=g.getStyleFunction()||n;if(n){var y=_(g,o);if(y){Array.isArray(y)||(y=[y]);for(var v="#"+("000000"+(d*p).toString(16)).slice(-6),m=0,x=y.length;m<x;++m){var w=y[m],S=w.getGeometryFunction()(g);if(S&&Re(i,S.getExtent())){var C=w.clone(),E=C.getFill();E&&E.setColor(v);var T=C.getStroke();T&&(T.setColor(v),T.setLineDash(null)),C.setText(void 0);var b=w.getImage();if(b&&0!==b.getOpacity()){var R=b.getImageSize();if(!R)continue;var P=_i(R[0],R[1],void 0,{alpha:!1}),O=P.canvas;P.fillStyle=v,P.fillRect(0,0,O.width,O.height),C.setImage(new ms({img:O,imgSize:R,anchor:b.getAnchor(),anchorXUnits:rs,anchorYUnits:rs,offset:b.getOrigin(),opacity:1,size:b.getSize(),scale:b.getScale(),rotation:b.getRotation(),rotateWithView:b.getRotateWithView()}))}var F=C.getZIndex()||0;(M=f[F])||(M={},f[F]=M,M[dt]=[],M[mt]=[],M[pt]=[],M[ct]=[]),M[S.getType().replace("Multi","")].push(S,C)}}}}}for(var I=Object.keys(f).map(Number).sort(h),L=(d=0,I.length);d<L;++d){var M=f[I[d]];for(var A in M){var D=M[A];for(m=0,x=D.length;m<x;m+=2){u.setStyle(D[m+1]);for(var k=0,j=e.length;k<j;++k)u.setTransform(e[k]),u.drawGeometry(D[m])}}}return s.getImageData(0,0,l.width,l.height)}function Ss(t,e,r){var n=[];if(r){var i=Math.floor(Math.round(t[0])*xs),o=Math.floor(Math.round(t[1])*xs),a=4*(Ie(i,0,r.width-1)+Ie(o,0,r.height-1)*r.width),s=r.data[a],l=r.data[a+1],u=r.data[a+2]+256*(l+256*s),h=Math.floor(16777215/e.length);u&&u%h==0&&n.push(e[u/h-1])}return n}var Cs={Point:function(t,e,r,n,i){var o,a=r.getImage(),s=r.getText();i&&(t=i,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Qn)return;var l=t.getBuilder(r.getZIndex(),Ia);l.setImageStyle(a,o),l.drawPoint(e,n)}if(s&&s.getText()){var u=t.getBuilder(r.getZIndex(),Aa);u.setTextStyle(s,o),u.drawText(e,n)}},LineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),La);a.setFillStrokeStyle(null,o),a.drawLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),Aa);l.setTextStyle(s),l.drawText(e,n)}},Polygon:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(o||a){var s=t.getBuilder(r.getZIndex(),Ma);s.setFillStrokeStyle(o,a),s.drawPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Aa);u.setTextStyle(l),u.drawText(e,n)}},MultiPoint:function(t,e,r,n,i){var o,a=r.getImage(),s=r.getText();i&&(t=i,o=a&&s&&s.getText()?{}:void 0);if(a){if(a.getImageState()!=Qn)return;var l=t.getBuilder(r.getZIndex(),Ia);l.setImageStyle(a,o),l.drawMultiPoint(e,n)}if(s&&s.getText()){var u=(i||t).getBuilder(r.getZIndex(),Aa);u.setTextStyle(s,o),u.drawText(e,n)}},MultiLineString:function(t,e,r,n,i){var o=r.getStroke();if(o){var a=t.getBuilder(r.getZIndex(),La);a.setFillStrokeStyle(null,o),a.drawMultiLineString(e,n)}var s=r.getText();if(s&&s.getText()){var l=(i||t).getBuilder(r.getZIndex(),Aa);l.setTextStyle(s),l.drawText(e,n)}},MultiPolygon:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(a||o){var s=t.getBuilder(r.getZIndex(),Ma);s.setFillStrokeStyle(o,a),s.drawMultiPolygon(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Aa);u.setTextStyle(l),u.drawText(e,n)}},GeometryCollection:function(t,e,r,n,i){var o,a,s=e.getGeometriesArray();for(o=0,a=s.length;o<a;++o){(0,Cs[s[o].getType()])(t,s[o],r,n,i)}},Circle:function(t,e,r,n,i){var o=r.getFill(),a=r.getStroke();if(o||a){var s=t.getBuilder(r.getZIndex(),Oa);s.setFillStrokeStyle(o,a),s.drawCircle(e,n)}var l=r.getText();if(l&&l.getText()){var u=(i||t).getBuilder(r.getZIndex(),Aa);u.setTextStyle(l),u.drawText(e,n)}}};function Es(t,e){return parseInt(n(t),10)-parseInt(n(e),10)}function Ts(t,e){var r=bs(t,e);return r*r}function bs(t,e){return.5*t/e}function Rs(t,e,r,n,i,o,a){var s=!1,l=r.getImage();if(l){var u=l.getImageState();u==Qn||u==$n?l.unlistenImageChange(i):(u==qn&&l.load(),u=l.getImageState(),l.listenImageChange(i),s=!0)}return function(t,e,r,n,i,o){var a=r.getGeometryFunction()(e);if(!a)return;var s=a.simplifyTransformed(n,i);if(r.getRenderer())Ps(t,s,r,e);else{(0,Cs[s.getType()])(t,s,r,e,o)}}(t,e,r,n,o,a),s}function Ps(t,e,r,n){if(e.getType()!=vt)t.getBuilder(r.getZIndex(),Fa).drawCustom(e,n,r.getRenderer(),r.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,a=i.length;o<a;++o)Ps(t,i[o],r,n)}var Os=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fs=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.animatingOrInteracting_,r.dirty_=!1,r.hitDetectionImageData_=null,r.renderedFeatures_=null,r.renderedRevision_=-1,r.renderedResolution_=NaN,r.renderedExtent_=[1/0,1/0,-1/0,-1/0],r.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],r.renderedRotation_,r.renderedCenter_=null,r.renderedProjection_=null,r.renderedRenderOrder_=null,r.replayGroup_=null,r.replayGroupChanged=!0,r.declutterExecutorGroup=null,r.clipping=!0,r}return Os(e,t),e.prototype.renderWorlds=function(t,e,r){var n=e.extent,i=e.viewState,o=i.center,a=i.resolution,s=i.projection,l=i.rotation,u=s.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,f=!(p[qa]||p[Ja]),d=this.context,g=Math.round(e.size[0]*c),_=Math.round(e.size[1]*c),y=h.getWrapX()&&s.canWrapX(),v=y?be(u):null,m=y?Math.ceil((n[2]-u[2])/v)+1:1,x=y?Math.floor((n[0]-u[0])/v):0;do{var w=this.getRenderTransform(o,a,l,c,g,_,x*v);t.execute(d,1,w,l,f,void 0,r)}while(++x<m)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var r=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];!function(t,e,r){Dt(t,e,0,0,r,0,0)}(this.pixelTransform,1/r,1/r),Nt(this.inversePixelTransform,this.pixelTransform);var i=Bt(this.pixelTransform);this.useContainer(e,i,n.opacity);var o=this.context,a=o.canvas,s=this.replayGroup_,l=this.declutterExecutorGroup;if((!s||s.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*r),h=Math.round(t.size[1]*r);a.width!=u||a.height!=h?(a.width=u,a.height=h,a.style.transform!==i&&(a.style.transform=i)):this.containerReused||o.clearRect(0,0,u,h),this.preRender(o,t);var c=t.viewState;c.projection;var p=!1,f=!0;if(n.extent&&this.clipping){var d=Gr(n.extent);(p=(f=Re(d,t.extent))&&!re(d,t.extent))&&this.clipUnrotated(o,t,d)}f&&this.renderWorlds(s,t),p&&o.restore(),this.postRender(o,t);var g=bi(n.opacity),_=this.container;return g!==_.style.opacity&&(_.style.opacity=g),this.renderedRotation_!==c.rotation&&(this.renderedRotation_=c.rotation,this.hitDetectionImageData_=null),this.container},e.prototype.getFeatures=function(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){var r=[this.context.canvas.width,this.context.canvas.height];kt(this.pixelTransform,r);var n=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,s=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=r[0]*xs,c=r[1]*xs;u.push(this.getRenderTransform(n,i,o,xs,h,c,0).slice());var p=l.getSource(),f=a.getExtent();if(p.getWrapX()&&a.canWrapX()&&!re(f,s)){for(var d=s[0],g=be(f),_=0,y=void 0;d<f[0];)y=g*--_,u.push(this.getRenderTransform(n,i,o,xs,h,c,y).slice()),d+=g;for(_=0,d=s[2];d>f[2];)y=g*++_,u.push(this.getRenderTransform(n,i,o,xs,h,c,y).slice()),d-=g}this.hitDetectionImageData_=ws(r,u,this.renderedFeatures_,l.getStyleFunction(),s,i,o)}e(Ss(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,o){var a=this;if(this.replayGroup_){var s,l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),c={},p=function(t,e,r){var a=n(t),s=c[a];if(s){if(!0!==s&&r<s.distanceSq){if(0===r)return c[a]=!0,o.splice(o.lastIndexOf(s),1),i(t,h,e);s.geometry=e,s.distanceSq=r}}else{if(0===r)return c[a]=!0,i(t,h,e);o.push(c[a]={feature:t,layer:h,geometry:e,distanceSq:r,callback:i})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some((function(n){return s=n.forEachFeatureAtCoordinate(t,l,u,r,p,n===a.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),r=e.getSource();if(!r)return!1;var n=t.viewHints[qa],i=t.viewHints[Ja],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&n||!a&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var s=t.extent,l=t.viewState,u=l.projection,h=l.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=Es);var _=l.center.slice(),y=Qt(s,f*h),v=y.slice(),m=[y.slice()],x=u.getExtent();if(r.getWrapX()&&u.canWrapX()&&!re(x,t.extent)){var w=be(x),S=Math.max(be(y)/2,w);y[0]=x[0]-S,y[2]=x[2]+S,xr(_,u);var C=function(t,e){var r=e.getExtent(),n=me(t);if(e.canWrapX()&&(n[0]<r[0]||n[0]>=r[2])){var i=be(r),o=Math.floor((n[0]-r[0])/i)*i;t[0]-=o,t[2]-=o}return t}(m[0],u);C[0]<x[0]&&C[2]<x[2]?m.push([C[0]+w,C[1],C[2]+w,C[3]]):C[0]>x[0]&&C[2]>x[2]&&m.push([C[0]-w,C[1],C[2]-w,C[3]])}if(!this.dirty_&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&re(this.wrappedRenderedExtent_,y))return g(this.renderedExtent_,v)||(this.hitDetectionImageData_=null,this.renderedExtent_=v),this.renderedCenter_=_,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var E,T=new xa(bs(h,c),y,h,c);this.getLayer().getDeclutter()&&(E=new xa(bs(h,c),y,h,c));for(var b=0,R=m.length;b<R;++b)r.loadFeatures(m[b],h,u);var P=Ts(h,c),O=function(t){var r,n=t.getStyleFunction()||e.getStyleFunction();if(n&&(r=n(t,h)),r){var i=this.renderFeature(t,P,r,T,undefined,E);this.dirty_=this.dirty_||i}}.bind(this),F=jr(y),I=r.getFeaturesInExtent(F);d&&I.sort(d);for(b=0,R=I.length;b<R;++b)O(I[b]);this.renderedFeatures_=I;var L=T.finish(),M=new Ha(y,h,c,r.getOverlaps(),L,e.getRenderBuffer());return E&&(this.declutterExecutorGroup=new Ha(y,h,c,r.getOverlaps(),E.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=v,this.wrappedRenderedExtent_=y,this.renderedCenter_=_,this.renderedProjection_=u,this.replayGroup_=M,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,r,n,i,o){if(!r)return!1;var a=!1;if(Array.isArray(r))for(var s=0,l=r.length;s<l;++s)a=Rs(n,t,r[s],e,this.boundHandleStyleImageChange_,i,o)||a;else a=Rs(n,t,r,e,this.boundHandleStyleImageChange_,i,o);return a},e}(Pa),Is=Fs,Ls=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ms=function(t){function e(e){return t.call(this,e)||this}return Ls(e,t),e.prototype.createRenderer=function(){return new Is(this)},e}(qo),As=function(){function t(t){this.rbush_=new Ao(t),this.items_={}}return t.prototype.insert=function(t,e){var r={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(r),this.items_[n(e)]=r},t.prototype.load=function(t,e){for(var r=new Array(e.length),i=0,o=e.length;i<o;i++){var a=t[i],s=e[i],l={minX:a[0],minY:a[1],maxX:a[2],maxY:a[3],value:s};r[i]=l,this.items_[n(s)]=l}this.rbush_.load(r)},t.prototype.remove=function(t){var e=n(t),r=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(r)},t.prototype.update=function(t,e){var r=this.items_[n(e)];he([r.minX,r.minY,r.maxX,r.maxY],t)||(this.remove(e),this.insert(t,e))},t.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},t.prototype.getInExtent=function(t){var e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))},t.prototype.forEach=function(t){return this.forEach_(this.getAll(),t)},t.prototype.forEachInExtent=function(t,e){return this.forEach_(this.getInExtent(t),e)},t.prototype.forEach_=function(t,e){for(var r,n=0,i=t.length;n<i;n++)if(r=e(t[n]))return r;return r},t.prototype.isEmpty=function(){return S(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return ae(e.minX,e.minY,e.maxX,e.maxY,t)},t.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]},t}(),Ds=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function ks(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var js=function(t){function r(e){var r=t.call(this)||this;r.projection=Er(e.projection),r.attributions_=ks(e.attributions),r.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,r.loading=!1,r.state_=void 0!==e.state?e.state:Eo,r.wrapX_=void 0!==e.wrapX&&e.wrapX,r.interpolate_=!!e.interpolate,r.viewResolver=null,r.viewRejector=null;var n=r;return r.viewPromise_=new Promise((function(t,e){n.viewResolver=t,n.viewRejector=e})),r}return Ds(r,t),r.prototype.getAttributions=function(){return this.attributions_},r.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},r.prototype.getProjection=function(){return this.projection},r.prototype.getResolutions=function(){return e()},r.prototype.getView=function(){return this.viewPromise_},r.prototype.getState=function(){return this.state_},r.prototype.getWrapX=function(){return this.wrapX_},r.prototype.getInterpolate=function(){return this.interpolate_},r.prototype.refresh=function(){this.changed()},r.prototype.setAttributions=function(t){this.attributions_=ks(t),this.changed()},r.prototype.setState=function(t){this.state_=t,this.changed()},r}(q),Gs="addfeature",Ns="changefeature",Bs="clear",zs="removefeature",Us="featuresloadstart",Vs="featuresloadend",Xs="featuresloaderror";function Ws(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Ys="arraybuffer",Ks="json",Zs="text",Hs="xml";function qs(t,e,r,n,i,o,a){var s=new XMLHttpRequest;s.open("GET","function"==typeof t?t(r,n,i):t,!0),e.getType()==Ys&&(s.responseType="arraybuffer"),s.withCredentials=false,s.onload=function(t){if(!s.status||s.status>=200&&s.status<300){var n=e.getType(),l=void 0;n==Ks||n==Zs?l=s.responseText:n==Hs?(l=s.responseXML)||(l=(new DOMParser).parseFromString(s.responseText,"application/xml")):n==Ys&&(l=s.response),l?o(e.readFeatures(l,{extent:r,featureProjection:i}),e.readProjection(l)):a()}else a()},s.onerror=a,s.send()}function Js(t,e){return function(r,n,i,o,a){var s=this;qs(t,e,r,n,i,(function(t,e){s.addFeatures(t),void 0!==o&&o(t)}),a||v)}}var Qs=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$s=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.feature=r,i.features=n,i}return Qs(e,t),e}(s),tl=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{attributions:n.attributions,projection:void 0,state:Eo,wrapX:void 0===n.wrapX||n.wrapX})||this).on,r.once,r.un,r.loader_=v,r.format_=n.format,r.overlaps_=void 0===n.overlaps||n.overlaps,r.url_=n.url,void 0!==n.loader?r.loader_=n.loader:void 0!==r.url_&&(nt(r.format_,7),r.loader_=Js(r.url_,r.format_)),r.strategy_=void 0!==n.strategy?n.strategy:Ws;var i,o,a=void 0===n.useSpatialIndex||n.useSpatialIndex;return r.featuresRtree_=a?new As:null,r.loadedExtentsRtree_=new As,r.loadingExtentsCount_=0,r.nullGeometryFeatures_={},r.idIndex_={},r.uidIndex_={},r.featureChangeKeys_={},r.featuresCollection_=null,Array.isArray(n.features)?o=n.features:n.features&&(o=(i=n.features).getArray()),a||void 0!==i||(i=new rt(o)),void 0!==o&&r.addFeaturesInternal(o),void 0!==i&&r.bindFeaturesCollection_(i),r}return Qs(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=n(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var r=t.getGeometry();if(r){var i=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new $s(Gs,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[N(e,T,this.handleFeatureChange_,this),N(e,l,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var r=!0,n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?r=!1:this.idIndex_[n.toString()]=e),r&&(nt(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),r},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],r=[],i=[],o=0,a=t.length;o<a;o++){var s=n(u=t[o]);this.addToIndex_(s,u)&&r.push(u)}o=0;for(var l=r.length;o<l;o++){var u;s=n(u=r[o]);this.setupChangeEvents_(s,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),i.push(u)}else this.nullGeometryFeatures_[s]=u}this.featuresRtree_&&this.featuresRtree_.load(e,i);o=0;for(var p=r.length;o<p;o++)this.dispatchEvent(new $s(Gs,r[o]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(Gs,(function(r){e||(e=!0,t.push(r.feature),e=!1)})),this.addEventListener(zs,(function(r){e||(e=!0,t.remove(r.feature),e=!1)})),t.addEventListener(J,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Q,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(z)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var r=function(t){this.removeFeatureInternal(t)}.bind(this);for(var n in this.featuresRtree_.forEach(r),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var i=new $s(Bs);this.dispatchEvent(i),this.changed()},e.prototype.forEachFeature=function(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)},e.prototype.forEachFeatureAtCoordinateDirect=function(t,e){var r=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(r,(function(r){return r.getGeometry().intersectsCoordinate(t)?e(r):void 0}))},e.prototype.forEachFeatureInExtent=function(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)},e.prototype.forEachFeatureIntersectingExtent=function(t,e){return this.forEachFeatureInExtent(t,(function(r){if(r.getGeometry().intersectsExtent(t)){var n=e(r);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),S(this.nullGeometryFeatures_)||d(t,w(this.nullGeometryFeatures_))),t},e.prototype.getFeaturesAtCoordinate=function(t){var e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e},e.prototype.getFeaturesInExtent=function(t){return this.featuresRtree_?this.featuresRtree_.getInExtent(t):this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var r=t[0],n=t[1],i=null,o=[NaN,NaN],a=1/0,s=[-1/0,-1/0,1/0,1/0],l=e||_;return this.featuresRtree_.forEachInExtent(s,(function(t){if(l(t)){var e=t.getGeometry(),u=a;if((a=e.closestPointXY(r,n,o,a))<u){i=t;var h=Math.sqrt(a);s[0]=r-h,s[1]=n-h,s[2]=r+h,s[3]=n+h}}})),i},e.prototype.getExtent=function(t){return this.featuresRtree_.getExtent(t)},e.prototype.getFeatureById=function(t){var e=this.idIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getFeatureByUid=function(t){var e=this.uidIndex_[t];return void 0!==e?e:null},e.prototype.getFormat=function(){return this.format_},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.getUrl=function(){return this.url_},e.prototype.handleFeatureChange_=function(t){var e=t.target,r=n(e),i=e.getGeometry();if(i){var o=i.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[r]=e);var a=e.getId();if(void 0!==a){var s=a.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[r]=e;this.changed(),this.dispatchEvent(new $s(Ns,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:n(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&S(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,r){for(var n=this.loadedExtentsRtree_,i=this.strategy_(t,e,r),o=function(t,o){var s=i[t];n.forEachInExtent(s,(function(t){return re(t.extent,s)}))||(++a.loadingExtentsCount_,a.dispatchEvent(new $s(Us)),a.loader_.call(a,s,e,r,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new $s(Vs,void 0,t))}.bind(a),function(){--this.loadingExtentsCount_,this.dispatchEvent(new $s(Xs))}.bind(a)),n.insert(s,{extent:s.slice()}))},a=this,s=0,l=i.length;s<l;++s)o(s);this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0},e.prototype.refresh=function(){this.clear(!0),this.loadedExtentsRtree_.clear(),t.prototype.refresh.call(this)},e.prototype.removeLoadedExtent=function(t){var e,r=this.loadedExtentsRtree_;r.forEachInExtent(t,(function(r){if(he(r.extent,t))return e=r,!0})),e&&r.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=n(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t)&&this.changed()}},e.prototype.removeFeatureInternal=function(t){var e=n(t),r=this.featureChangeKeys_[e];if(r){r.forEach(z),delete this.featureChangeKeys_[e];var i=t.getId();return void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new $s(zs,t)),t}},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var r in this.idIndex_)if(this.idIndex_[r]===t){delete this.idIndex_[r],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){nt(this.format_,7),this.url_=t,this.setLoader(Js(t,this.format_))},e}(js),el=0,rl=1,nl=2,il=3,ol=4;function al(t){return Math.pow(t,3)}function sl(t){return 1-al(1-t)}function ll(t){return 3*t*t-2*t*t*t}function ul(t){return t}var hl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cl=function(t){function r(e,r,n){var i=t.call(this)||this,o=n||{};return i.tileCoord=e,i.state=r,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i.interpolate=!!o.interpolate,i}return hl(r,t),r.prototype.changed=function(){this.dispatchEvent(T)},r.prototype.release=function(){},r.prototype.getKey=function(){return this.key+"/"+this.tileCoord},r.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==nl)return this.transition_=0,t;t=t.interimTile}while(t);return this},r.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==nl){t.interimTile=null;break}t.getState()==rl?e=t:t.getState()==el?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},r.prototype.getTileCoord=function(){return this.tileCoord},r.prototype.getState=function(){return this.state},r.prototype.setState=function(t){if(this.state!==il&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},r.prototype.load=function(){e()},r.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var r=this.transitionStarts_[t];if(r){if(-1===r)return 1}else r=e,this.transitionStarts_[t]=r;var n=e-r+1e3/60;return n>=this.transition_?1:al(n/this.transition_)},r.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},r.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},r}(E),pl=cl,fl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var dl=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.crossOrigin_=i,s.src_=n,s.key=n,s.image_=new Image,null!==i&&(s.image_.crossOrigin=i),s.unlisten_=null,s.tileLoadFunction_=o,s}return fl(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=nl,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=il,this.unlistenImage_(),this.image_=((t=_i(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=nl:this.state=ol,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==il&&(this.state=el,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==el&&(this.state=rl,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=ps(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(pl),gl=function(){function t(t,e,r){this.decay_=t,this.minVelocity_=e,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}return t.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},t.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},t.prototype.end=function(){if(this.points_.length<6)return!1;var t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;for(var r=e-3;r>0&&this.points_[r+2]>t;)r-=3;var n=this.points_[e+2]-this.points_[r+2];if(n<1e3/60)return!1;var i=this.points_[e]-this.points_[r],o=this.points_[e+1]-this.points_[r+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/n,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),_l=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yl=function(t){function r(e){var r=t.call(this)||this;return r.map_=e,r}return _l(r,t),r.prototype.dispatchRenderEvent=function(t,r){e()},r.prototype.calculateMatrices2D=function(t){var e=t.viewState,r=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Gt(r,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Nt(n,r)},r.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i,o,a,s){var l,u=e.viewState;function h(t,e,r,n){return i.call(o,e,t?r:null,n)}var c=u.projection,p=xr(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&n){var d=be(c.getExtent());f.push([-d,0],[d,0])}for(var g=e.layerStatesArray,_=g.length,y=[],v=[],m=0;m<f.length;m++)for(var x=_-1;x>=0;--x){var w=g[x],S=w.layer;if(S.hasRenderer()&&Po(w,u)&&a.call(s,S)){var C=S.getRenderer(),E=S.getSource();if(C&&E){var T=E.getWrapX()?p:t,b=h.bind(null,w.managed);v[0]=T[0]+f[m][0],v[1]=T[1]+f[m][1],l=C.forEachFeatureAtCoordinate(v,e,r,b,y)}if(l)return l}}if(0!==y.length){var R=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*R})),y.sort((function(t,e){return t.distanceSq-e.distanceSq})),y.some((function(t){return l=t.callback(t.feature,t.layer,t.geometry)})),l}},r.prototype.forEachLayerAtPixel=function(t,r,n,i,o){return e()},r.prototype.hasFeatureAtCoordinate=function(t,e,r,n,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,r,n,_,this,i,o)},r.prototype.getMap=function(){return this.map_},r.prototype.renderFrame=function(t){e()},r.prototype.scheduleExpireIconCache=function(t){ls.canExpireCache()&&t.postRenderFunctions.push(vl)},r}(u);function vl(t,e){ls.expire()}var ml=yl,xl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wl=function(t){function e(e){var r=t.call(this,e)||this;r.fontChangeListenerKey_=N(ki,l,e.redrawText.bind(e)),r.element_=document.createElement("div");var n=r.element_.style;n.position="absolute",n.width="100%",n.height="100%",n.zIndex="0",r.element_.className="ol-unselectable ol-layers";var i=e.getViewport();return i.insertBefore(r.element_,i.firstChild||null),r.children_=[],r.renderedVisible_=!0,r}return xl(e,t),e.prototype.dispatchRenderEvent=function(t,e){var r=this.getMap();if(r.hasListener(t)){var n=new Ta(t,void 0,e);r.dispatchEvent(n)}},e.prototype.disposeInternal=function(){z(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),t.prototype.disposeInternal.call(this)},e.prototype.renderFrame=function(t){if(t){this.calculateMatrices2D(t),this.dispatchRenderEvent(Nn,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),r=t.viewState;this.children_.length=0;for(var n=[],i=null,o=0,a=e.length;o<a;++o){var s=e[o];if(t.layerIndex=o,Po(s,r)&&(s.sourceState==Eo||s.sourceState==So)){var l=s.layer,u=l.render(t,i);u&&(u!==i&&(this.children_.push(u),i=u),"getDeclutter"in l&&n.push(l))}}for(o=n.length-1;o>=0;--o)n[o].renderDeclutter(t);!function(t,e){for(var r=t.childNodes,n=0;;++n){var i=r[n],o=e[n];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--n):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(Bn,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,r,n,i){for(var o=e.viewState,a=e.layerStatesArray,s=a.length-1;s>=0;--s){var l=a[s],u=l.layer;if(u.hasRenderer()&&Po(l,o)&&i(u)){var h=u.getRenderer().getDataAtPixel(t,e,r);if(h){var c=n(u,h);if(c)return c}}}},e}(ml),Sl=wl,Cl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),El=function(t){function e(e,r){var n=t.call(this,e)||this;return n.layer=r,n}return Cl(e,t),e}(s),Tl="layers",bl=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.layers;var o=n.layers;return(r=t.call(this,i)||this).on,r.once,r.un,r.layersListenerKeys_=[],r.listenerKeys_={},r.addChangeListener(Tl,r.handleLayersChanged_),o?Array.isArray(o)?o=new rt(o.slice(),{unique:!0}):nt("function"==typeof o.getArray,43):o=new rt(void 0,{unique:!0}),r.setLayers(o),r}return Cl(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(z),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(N(t,J,this.handleLayersAdd_,this),N(t,Q,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(z);x(this.listenerKeys_);for(var r=t.getArray(),n=0,i=r.length;n<i;n++){var o=r[n];this.registerLayerListeners_(o),this.dispatchEvent(new El("addlayer",o))}this.changed()},e.prototype.registerLayerListeners_=function(t){var r=[N(t,l,this.handleLayerChange_,this),N(t,T,this.handleLayerChange_,this)];t instanceof e&&r.push(N(t,"addlayer",this.handleLayerGroupAdd_,this),N(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[n(t)]=r},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new El("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new El("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new El("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,r=n(e);this.listenerKeys_[r].forEach(z),delete this.listenerKeys_[r],this.dispatchEvent(new El("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(Tl)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var r=e.getArray(),n=0,i=r.length;n<i;++n)this.dispatchEvent(new El("removelayer",r[n]));this.set(Tl,t)},e.prototype.getLayersArray=function(t){var e=void 0!==t?t:[];return this.getLayers().forEach((function(t){t.getLayersArray(e)})),e},e.prototype.getLayerStatesArray=function(t){var e=void 0!==t?t:[],r=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var n=this.getLayerState(),i=n.zIndex;t||void 0!==n.zIndex||(i=0);for(var o=r,a=e.length;o<a;o++){var s=e[o];s.opacity*=n.opacity,s.visible=s.visible&&n.visible,s.maxResolution=Math.min(s.maxResolution,n.maxResolution),s.minResolution=Math.max(s.minResolution,n.minResolution),s.minZoom=Math.max(s.minZoom,n.minZoom),s.maxZoom=Math.min(s.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==s.extent?s.extent=Ce(s.extent,n.extent):s.extent=n.extent),void 0===s.zIndex&&(s.zIndex=i)}return e},e.prototype.getSourceState=function(){return Eo},e}(wo),Rl=Object.freeze({__proto__:null,GroupEvent:El,default:bl}),Pl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ol=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.map=r,i.frameState=void 0!==n?n:null,i}return Pl(e,t),e}(s),Fl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Il=function(t){function e(e,r,n,i,o){var a=t.call(this,e,r,o)||this;return a.originalEvent=n,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==i&&i,a}return Fl(e,t),Object.defineProperty(e.prototype,"pixel",{get:function(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_},set:function(t){this.pixel_=t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coordinate",{get:function(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_},set:function(t){this.coordinate_=t},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()},e}(Ol),Ll={SINGLECLICK:"singleclick",CLICK:P,DBLCLICK:O,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ml="pointermove",Al="pointerdown",Dl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kl=function(t){function e(e,r){var n=t.call(this,e)||this;n.map_=e,n.clickTimeoutId_,n.emulateClicks_=!1,n.dragging_=!1,n.dragListenerKeys_=[],n.moveTolerance_=void 0===r?1:r,n.down_=null;var i=n.map_.getViewport();return n.activePointers_=0,n.trackedTouches_={},n.element_=i,n.pointerdownListenerKey_=N(i,Al,n.handlePointerDown_,n),n.originalPointerMoveEvent_,n.relayedListenerKey_=N(i,Ml,n.relayEvent_,n),n.boundHandleTouchMove_=n.handleTouchMove_.bind(n),n.element_.addEventListener(j,n.boundHandleTouchMove_,!!It&&{passive:!1}),n}return Dl(e,t),e.prototype.emulateClick_=function(t){var e=new Il(Ll.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Il(Ll.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Il(Ll.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Ll.POINTERUP||e.type==Ll.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Ll.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Il(Ll.POINTERUP,this.map_,t);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(z),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.emulateClicks_=0===this.activePointers_,this.updateActivePointers_(t);var e=new Il(Ll.POINTERDOWN,this.map_,t);for(var r in this.dispatchEvent(e),this.down_={},t){var n=t[r];this.down_[r]="function"==typeof n?v:n}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(N(i,Ll.POINTERMOVE,this.handlePointerMove_,this),N(i,Ll.POINTERUP,this.handlePointerUp_,this),N(this.element_,Ll.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),Ll.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Il(Ll.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}},e.prototype.relayEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Il(t.type,this.map_,t,e))},e.prototype.handleTouchMove_=function(t){var e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()},e.prototype.isMoving_=function(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_},e.prototype.disposeInternal=function(){this.relayedListenerKey_&&(z(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(j,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(z(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(z),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(E),jl="postrender",Gl="movestart",Nl="moveend",Bl="layergroup",zl="size",Ul="target",Vl="view",Xl=1/0,Wl=function(){function t(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}return t.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,x(this.queuedElements_)},t.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,r=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(r);return delete this.queuedElements_[n],r},t.prototype.enqueue=function(t){nt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Xl&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},t.prototype.getCount=function(){return this.elements_.length},t.prototype.getLeftChildIndex_=function(t){return 2*t+1},t.prototype.getRightChildIndex_=function(t){return 2*t+2},t.prototype.getParentIndex_=function(t){return t-1>>1},t.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},t.prototype.isEmpty=function(){return 0===this.elements_.length},t.prototype.isKeyQueued=function(t){return t in this.queuedElements_},t.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},t.prototype.siftUp_=function(t){for(var e=this.elements_,r=this.priorities_,n=e.length,i=e[t],o=r[t],a=t;t<n>>1;){var s=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<n&&r[l]<r[s]?l:s;e[t]=e[u],r[t]=r[u],t=u}e[t]=i,r[t]=o,this.siftDown_(a,t)},t.prototype.siftDown_=function(t,e){for(var r=this.elements_,n=this.priorities_,i=r[e],o=n[e];e>t;){var a=this.getParentIndex_(e);if(!(n[a]>o))break;r[e]=r[a],n[e]=n[a],e=a}r[e]=i,n[e]=o},t.prototype.reprioritize=function(){var t,e,r,n=this.priorityFunction_,i=this.elements_,o=this.priorities_,a=0,s=i.length;for(e=0;e<s;++e)(r=n(t=i[e]))==Xl?delete this.queuedElements_[this.keyFunction_(t)]:(o[a]=r,i[a++]=t);i.length=a,o.length=a,this.heapify_()},t}(),Yl=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kl=function(t){function e(e,r){var n=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return n.boundHandleTileChange_=n.handleTileChange.bind(n),n.tileChangeCallback_=r,n.tilesLoading_=0,n.tilesLoadingKeys_={},n}return Yl(e,t),e.prototype.enqueue=function(e){var r=t.prototype.enqueue.call(this,e);r&&e[0].addEventListener(T,this.boundHandleTileChange_);return r},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,r=e.getState();if(r===nl||r===il||r===ol){e.removeEventListener(T,this.boundHandleTileChange_);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var r,n,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)n=(r=this.dequeue()[0]).getKey(),r.getState()!==el||n in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[n]=!0,++this.tilesLoading_,++i,r.load())},e}(Wl);var Zl={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},Hl=256;function ql(t,e,r){return function(n,i,o,a,s){if(n){var l=e?0:o[0]*i,u=e?0:o[1]*i,h=s?s[0]:0,c=s?s[1]:0,p=t[0]+l/2+h,f=t[2]-l/2+h,d=t[1]+u/2+c,g=t[3]-u/2+c;p>f&&(f=p=(f+p)/2),d>g&&(g=d=(g+d)/2);var _=Ie(n[0],p,f),y=Ie(n[1],d,g),v=30*i;return a&&r&&(_+=-v*Math.log(1+Math.max(0,p-n[0])/v)+v*Math.log(1+Math.max(0,n[0]-f)/v),y+=-v*Math.log(1+Math.max(0,d-n[1])/v)+v*Math.log(1+Math.max(0,n[1]-g)/v)),[_,y]}}}function Jl(t){return t}function Ql(t,e,r,n){var i=be(e)/r[0],o=Se(e)/r[1];return n?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function $l(t,e,r){var n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,r&&(n=Math.max(n,r),n/=Math.log(1+50*Math.max(0,r/t-1))/50+1),Ie(n,r/2,2*e)}function tu(t,e,r,n,i){return function(o,a,s,l){if(void 0!==o){var u=n?Ql(t,n,s,i):t;return(void 0===r||r)&&l?$l(o,u,e):Ie(o,e,u)}}}function eu(t){return void 0!==t?0:void 0}function ru(t){return void 0!==t?t:void 0}var nu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iu=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=m({},e);return r.hints_=[0,0],r.animations_=[],r.updateAnimationKey_,r.projection_=Rr(n.projection,"EPSG:3857"),r.viewportSize_=[100,100],r.targetCenter_=null,r.targetResolution_,r.targetRotation_,r.nextCenter_=null,r.nextResolution_,r.nextRotation_,r.cancelAnchor_=void 0,n.center&&(n.center=kr(n.center,r.projection_)),n.extent&&(n.extent=Gr(n.extent,r.projection_)),r.applyOptions_(n),r}return nu(e,t),e.prototype.applyOptions_=function(t){var e=m({},t);for(var r in Zl)delete e[r];this.setProperties(e,!0);var n=function(t){var e,r,n,i=28,o=2,a=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:i,l=void 0!==t.zoomFactor?t.zoomFactor:o,u=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,f=Rr(t.projection,"EPSG:3857"),d=f.getExtent(),g=t.constrainOnlyCenter,_=t.extent;u||_||!f.isGlobal()||(g=!1,_=d);if(void 0!==t.resolutions){var y=t.resolutions;r=y[a],n=void 0!==y[s]?y[s]:y[y.length-1],e=t.constrainResolution?function(t,e,r,n){return function(i,o,a,s){if(void 0!==i){var l=t[0],u=t[t.length-1],h=r?Ql(l,r,a,n):l;if(s)return void 0===e||e?$l(i,h,u):Ie(i,u,h);var c=Math.min(h,i),f=Math.floor(p(t,c,o));return t[f]>h&&f<t.length-1?t[f+1]:t[f]}}}(y,h,!g&&_,c):tu(r,n,h,!g&&_,c)}else{var v=(d?Math.max(be(d),Se(d)):360*wt[St.DEGREES]/f.getMetersPerUnit())/Hl/Math.pow(o,0),m=v/Math.pow(o,i-0);void 0!==(r=t.maxResolution)?a=0:r=v/Math.pow(l,a),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?r/Math.pow(l,s):v/Math.pow(l,s):m),s=a+Math.floor(Math.log(r/n)/Math.log(l)),n=r/Math.pow(l,s-a),e=t.constrainResolution?function(t,e,r,n,i,o){return function(a,s,l,u){if(void 0!==a){var h=i?Ql(e,i,l,o):e,c=void 0!==r?r:0;if(u)return void 0===n||n?$l(a,h,c):Ie(a,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),f=-s*(.5-1e-9)+.5,d=Math.min(h,a),g=Math.floor(Math.log(e/d)/Math.log(t)+f),_=Math.max(p,g);return Ie(e/Math.pow(t,_),c,h)}}}(l,r,n,h,!g&&_,c):tu(r,n,h,!g&&_,c)}return{constraint:e,maxResolution:r,minResolution:n,minZoom:a,zoomFactor:l}}(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;var i=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return ql(t.extent,t.constrainOnlyCenter,e)}var r=Rr(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&r.isGlobal()){var n=r.getExtent().slice();return n[0]=-1/0,n[2]=1/0,ql(n,!1,!1)}return Jl}(t),o=n.constraint,a=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(o=i||je(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=o?0:t:void 0}):!1===e?ru:"number"==typeof e?(r=e,n=2*Math.PI/r,function(t,e){return e?t:void 0!==t?t=Math.floor(t/n+.5)*n:void 0}):ru}return eu;var r,n;var i,o}(t);this.constraints_={center:i,resolution:o,rotation:a},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var r=this.getCenter();if(r){var n=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(n[3]-e[3]+e[1]-n[1]),a=i/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([r[0]+o,r[1]-a])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),m({},e,t)},e.prototype.animate=function(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);for(var e=new Array(arguments.length),r=0;r<e.length;++r){var n=arguments[r];n.center&&((n=m({},n)).center=kr(n.center,this.getProjection())),n.anchor&&((n=m({},n)).anchor=kr(n.anchor,this.getProjection())),e[r]=n}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,r=arguments.length;r>1&&"function"==typeof arguments[r-1]&&(e=arguments[r-1],--r);for(var n=0;n<r&&!this.isDef();++n){var i=arguments[n];i.center&&this.setCenterInternal(i.center),void 0!==i.zoom?this.setZoom(i.zoom):i.resolution&&this.setResolution(i.resolution),void 0!==i.rotation&&this.setRotation(i.rotation)}if(n!==r){for(var o=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,l=this.targetRotation_,u=[];n<r;++n){var h=arguments[n],c={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||ll,callback:e};if(h.center&&(c.sourceCenter=a,c.targetCenter=h.center.slice(),a=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=s,c.targetResolution=this.getResolutionForZoom(h.zoom),s=c.targetResolution):h.resolution&&(c.sourceResolution=s,c.targetResolution=h.resolution,s=c.targetResolution),void 0!==h.rotation){c.sourceRotation=l;var p=Ge(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+p,l=c.targetRotation}au(c)?c.complete=!0:o+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(qa,1),this.updateAnimations_()}else e&&ou(e,!0)},e.prototype.getAnimating=function(){return this.hints_[qa]>0},e.prototype.getInteracting=function(){return this.hints_[Ja]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(qa,-this.hints_[qa]);for(var e=0,r=this.animations_.length;e<r;++e){var n=this.animations_[e];if(n[0].callback&&ou(n[0].callback,!1),!t)for(var i=0,o=n.length;i<o;++i){var a=n[i];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN},e.prototype.updateAnimations_=function(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),this.getAnimating()){for(var t=Date.now(),e=!1,r=this.animations_.length-1;r>=0;--r){for(var n=this.animations_[r],i=!0,o=0,a=n.length;o<a;++o){var s=n[o];if(!s.complete){var l=t-s.start,u=s.duration>0?l/s.duration:1;u>=1?(s.complete=!0,u=1):i=!1;var h=s.easing(u);if(s.sourceCenter){var c=s.sourceCenter[0],p=s.sourceCenter[1],f=s.targetCenter[0],d=s.targetCenter[1];this.nextCenter_=s.targetCenter;var g=c+h*(f-c),_=p+h*(d-p);this.targetCenter_=[g,_]}if(s.sourceResolution&&s.targetResolution){var y=1===h?s.targetResolution:s.sourceResolution+h*(s.targetResolution-s.sourceResolution);if(s.anchor){var v=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(y,0,v,!0);this.targetCenter_=this.calculateCenterZoom(m,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){var x=1===h?Ge(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+h*(s.targetRotation-s.sourceRotation);if(s.anchor){var w=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(w,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!s.complete)break}}if(i){this.animations_[r]=null,this.setHint(qa,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var S=n[0].callback;S&&ou(S,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}},e.prototype.calculateCenterRotate=function(t,e){var r,n,i,o=this.getCenterInternal();return void 0!==o&&(_r(r=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),i=e,(n=r)[0]+=+i[0],n[1]+=+i[1]),r},e.prototype.calculateCenterZoom=function(t,e){var r,n=this.getCenterInternal(),i=this.getResolution();void 0!==n&&void 0!==i&&(r=[e[0]-t*(e[0]-n[0])/i,e[1]-t*(e[1]-n[1])/i]);return r},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var r=e[0],n=e[1];return[Math.abs(r*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(r*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e},e.prototype.setViewportSize=function(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)},e.prototype.getCenter=function(){var t=this.getCenterInternal();return t?Dr(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Zl.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return jr(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),r=this.getCenterInternal();nt(r,1);var n=this.getResolution();nt(void 0!==n,2);var i=this.getRotation();return nt(void 0!==i,3),we(r,n,i,e)},e.prototype.getMaxResolution=function(){return this.maxResolution_},e.prototype.getMinResolution=function(){return this.minResolution_},e.prototype.getMaxZoom=function(){return this.getZoomForResolution(this.minResolution_)},e.prototype.setMaxZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))},e.prototype.getMinZoom=function(){return this.getZoomForResolution(this.maxResolution_)},e.prototype.setMinZoom=function(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))},e.prototype.setConstrainResolution=function(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))},e.prototype.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Zl.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Gr(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var r=e||this.getViewportSizeMinusPadding_(),n=be(t)/r[0],i=Se(t)/r[1];return Math.max(n,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/Math.log(e);return function(t){return r/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(Zl.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),r=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(r/n)/e;return function(t){return Math.log(r/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),r=this.padding_;return r&&(e=[e[0]-r[1]-r[3],e[1]-r[0]-r[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),r=this.getRotation(),n=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();n=su(n,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,r)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:r,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,r,n=this.minZoom_||0;if(this.resolutions_){var i=p(this.resolutions_,t,1);n=i,e=this.resolutions_[i],r=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,r=this.zoomFactor_;return n+Math.log(e/t)/Math.log(r)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=Ie(Math.floor(t),0,this.resolutions_.length-2),r=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(r,Ie(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var r;if(nt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))nt(!Pe(t),25),r=Dn(n=Gr(t,this.getProjection()));else if(t.getType()===mt){var n;(r=Dn(n=Gr(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),me(n))}else{r=t}this.fitInternal(r,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),r=Math.cos(e),n=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),a=1/0,s=1/0,l=-1/0,u=-1/0,h=0,c=i.length;h<c;h+=o){var p=i[h]*r-i[h+1]*n,f=i[h]*n+i[h+1]*r;a=Math.min(a,p),s=Math.min(s,f),l=Math.max(l,p),u=Math.max(u,f)}return[a,s,l,u]},e.prototype.fitInternal=function(t,e){var r=e||{},n=r.size;n||(n=this.getViewportSizeMinusPadding_());var i,o=void 0!==r.padding?r.padding:[0,0,0,0],a=void 0!==r.nearest&&r.nearest;i=void 0!==r.minResolution?r.minResolution:void 0!==r.maxZoom?this.getResolutionForZoom(r.maxZoom):0;var s=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(s,[n[0]-o[1]-o[3],n[1]-o[0]-o[2]]);l=isNaN(l)?i:Math.max(l,i),l=this.getConstrainedResolution(l,a?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=me(s);p[0]+=(o[1]-o[3])/2*l,p[1]+=(o[0]-o[2])/2*l;var f=p[0]*c-p[1]*h,d=p[1]*c+p[0]*h,g=this.getConstrainedCenter([f,d],l),_=r.callback?r.callback:v;void 0!==r.duration?this.animateInternal({resolution:l,center:g,duration:r.duration,easing:r.easing},_):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),ou(_,!0))},e.prototype.centerOn=function(t,e,r){this.centerOnInternal(kr(t,this.getProjection()),e,r)},e.prototype.centerOnInternal=function(t,e,r){this.setCenterInternal(su(t,e,r,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,r,n){var i,o=this.padding_;if(o&&t){var a=this.getViewportSizeMinusPadding_(-r),s=su(t,n,[a[0]/2+o[3],a[1]/2+o[0]],e,r);i=[t[0]-s[0],t[1]-s[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Dr(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustCenterInternal=function(t){var e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])},e.prototype.adjustResolution=function(t,e){var r=e&&kr(e,this.getProjection());this.adjustResolutionInternal(t,r)},e.prototype.adjustResolutionInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,n,r);e&&(this.targetCenter_=this.calculateCenterZoom(i,e)),this.targetResolution_*=t,this.applyTargetState_()},e.prototype.adjustZoom=function(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)},e.prototype.adjustRotation=function(t,e){e&&(e=kr(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var r=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,r);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(kr(t,this.getProjection()))},e.prototype.setCenterInternal=function(t){this.targetCenter_=t,this.applyTargetState_()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.targetResolution_=t,this.applyTargetState_()},e.prototype.setRotation=function(t){this.targetRotation_=t,this.applyTargetState_()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e.prototype.applyTargetState_=function(t,e){var r=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,r),i=this.getViewportSize_(n),o=this.constraints_.resolution(this.targetResolution_,0,i,r),a=this.constraints_.center(this.targetCenter_,o,i,r,this.calculateCenterShift(this.targetCenter_,o,n,i));this.get(Zl.ROTATION)!==n&&this.set(Zl.ROTATION,n),this.get(Zl.RESOLUTION)!==o&&(this.set(Zl.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),a&&this.get(Zl.CENTER)&&gr(this.get(Zl.CENTER),a)||this.set(Zl.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,r){var n=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(o),s=this.constraints_.resolution(this.targetResolution_,i,a),l=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,o,a));if(0===n&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=r||(0===n?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===o&&this.getCenterInternal()&&gr(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:s,duration:n,easing:sl,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Ja,1)},e.prototype.endInteraction=function(t,e,r){var n=r&&kr(r,this.getProjection());this.endInteractionInternal(t,e,n)},e.prototype.endInteractionInternal=function(t,e,r){this.setHint(Ja,-1),this.resolveConstraints(t,e,r)},e.prototype.getConstrainedCenter=function(t,e){var r=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),r)},e.prototype.getConstrainedZoom=function(t,e){var r=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(r,e))},e.prototype.getConstrainedResolution=function(t,e){var r=e||0,n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,r,n)},e}(q);function ou(t,e){setTimeout((function(){t(e)}),0)}function au(t){return!(t.sourceCenter&&t.targetCenter&&!gr(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function su(t,e,r,n,i){var o=Math.cos(-i),a=Math.sin(-i),s=t[0]*o-t[1]*a,l=t[1]*o+t[0]*a;return[(s+=(e[0]/2-r[0])*n)*o-(l+=(r[1]-e[1]/2)*n)*(a=-a),l*o+s*a]}var lu=iu,uu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function hu(t){t instanceof Oo?t.setMapInternal(null):t instanceof bl&&t.getLayers().forEach(hu)}function cu(t,e){if(t instanceof Oo)t.setMapInternal(e);else if(t instanceof bl)for(var r=t.getLayers().getArray(),n=0,i=r.length;n<i;++n)cu(r[n],e)}var pu=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var r,n,i,o={},a=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new bl({layers:t.layers});o[Bl]=a,o[Ul]=t.target,o[Vl]=t.view instanceof lu?t.view:new lu,void 0!==t.controls&&(Array.isArray(t.controls)?r=new rt(t.controls.slice()):(nt("function"==typeof t.controls.getArray,47),r=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new rt(t.interactions.slice()):(nt("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new rt(t.overlays.slice()):(nt("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new rt;return{controls:r,interactions:n,keyboardEventTarget:e,overlays:i,values:o}}(e);r.renderComplete_,r.boundHandleBrowserEvent_=r.handleBrowserEvent.bind(r),r.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,r.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Pt,r.postRenderTimeoutHandle_,r.animationDelayKey_,r.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(r),r.coordinateToPixelTransform_=[1,0,0,1,0,0],r.pixelToCoordinateTransform_=[1,0,0,1,0,0],r.frameIndex_=0,r.frameState_=null,r.previousExtent_=null,r.viewPropertyListenerKey_=null,r.viewChangeListenerKey_=null,r.layerGroupPropertyListenerKeys_=null,r.viewport_=document.createElement("div"),r.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),r.viewport_.style.position="relative",r.viewport_.style.overflow="hidden",r.viewport_.style.width="100%",r.viewport_.style.height="100%",r.overlayContainer_=document.createElement("div"),r.overlayContainer_.style.position="absolute",r.overlayContainer_.style.zIndex="0",r.overlayContainer_.style.width="100%",r.overlayContainer_.style.height="100%",r.overlayContainer_.style.pointerEvents="none",r.overlayContainer_.className="ol-overlaycontainer",r.viewport_.appendChild(r.overlayContainer_),r.overlayContainerStopEvent_=document.createElement("div"),r.overlayContainerStopEvent_.style.position="absolute",r.overlayContainerStopEvent_.style.zIndex="0",r.overlayContainerStopEvent_.style.width="100%",r.overlayContainerStopEvent_.style.height="100%",r.overlayContainerStopEvent_.style.pointerEvents="none",r.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",r.viewport_.appendChild(r.overlayContainerStopEvent_),r.mapBrowserEventHandler_=null,r.moveTolerance_=e.moveTolerance,r.keyboardEventTarget_=n.keyboardEventTarget,r.targetChangeHandlerKeys_=null,r.controls=n.controls||new rt,r.interactions=n.interactions||new rt,r.overlays_=n.overlays,r.overlayIdIndex_={},r.renderer_=null,r.postRenderFunctions_=[],r.tileQueue_=new Kl(r.getTilePriority.bind(r),r.handleTileChange_.bind(r)),r.addChangeListener(Bl,r.handleLayerGroupChanged_),r.addChangeListener(Vl,r.handleViewChanged_),r.addChangeListener(zl,r.handleSizeChanged_),r.addChangeListener(Ul,r.handleTargetChanged_),r.setProperties(n.values);var i=r;return!e.view||e.view instanceof lu||e.view.then((function(t){i.setView(new lu(t))})),r.controls.addEventListener(J,function(t){t.element.setMap(this)}.bind(r)),r.controls.addEventListener(Q,function(t){t.element.setMap(null)}.bind(r)),r.interactions.addEventListener(J,function(t){t.element.setMap(this)}.bind(r)),r.interactions.addEventListener(Q,function(t){t.element.setMap(null)}.bind(r)),r.overlays_.addEventListener(J,function(t){this.addOverlayInternal_(t.element)}.bind(r)),r.overlays_.addEventListener(Q,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(r)),r.controls.forEach(function(t){t.setMap(this)}.bind(r)),r.interactions.forEach(function(t){t.setMap(this)}.bind(r)),r.overlays_.forEach(r.addOverlayInternal_.bind(r)),r}return uu(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){cu(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,r){if(this.frameState_){var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance:0,o=void 0!==r.layerFilter?r.layerFilter:_,a=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,i,a,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var r=[];return this.forEachFeatureAtPixel(t,(function(t){r.push(t)}),e),r},e.prototype.getAllLayers=function(){var t=[];return function e(r){r.forEach((function(r){r instanceof bl?e(r.getLayers()):t.push(r)}))}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,r){if(this.frameState_){var n=r||{},i=void 0!==n.hitTolerance?n.hitTolerance:0,o=n.layerFilter||_;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var r=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:_,i=void 0!==e.hitTolerance?e.hitTolerance:0,o=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,i,o,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventCoordinateInternal=function(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),r="changedTouches"in t?t.changedTouches[0]:t;return[r.clientX-e.left,r.clientY-e.top]},e.prototype.getTarget=function(){return this.get(Ul)},e.prototype.getTargetElement=function(){var t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null},e.prototype.getCoordinateFromPixel=function(t){return Dr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?kt(e.pixelToCoordinateTransform,t.slice()):null},e.prototype.getControls=function(){return this.controls},e.prototype.getOverlays=function(){return this.overlays_},e.prototype.getOverlayById=function(t){var e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null},e.prototype.getInteractions=function(){return this.interactions},e.prototype.getLayerGroup=function(){return this.get(Bl)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof rt)e.setLayers(t);else{var r=e.getLayers();r.clear(),r.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer.getSource();if(n&&n.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=kr(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?kt(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(zl)},e.prototype.getView=function(){return this.get(Vl)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getOwnerDocument=function(){var t=this.getTargetElement();return t?t.ownerDocument:document},e.prototype.getTilePriority=function(t,e,r,n){return function(t,e,r,n,i){if(!t||!(r in t.wantedTiles))return Xl;if(!t.wantedTiles[r][e.getKey()])return Xl;var o=t.viewState.center,a=n[0]-o[0],s=n[1]-o[1];return 65536*Math.log(i)+Math.sqrt(a*a+s*s)/i}(this.frameState_,t,e,r,n)},e.prototype.handleBrowserEvent=function(t,e){var r=e||t.type,n=new Il(r,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,r=e.type;if(r===Al||r===G||r===M){var n=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():n,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===n?n.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var a=this.getInteractions().getArray().slice(),s=a.length-1;s>=0;s--){var l=a[s];if(l.getMap()===this&&l.getActive()&&this.getTargetElement())if(!l.handleEvent(t)||t.propagationStopped)break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var r=this.maxTilesLoading_,n=r;if(t){var i=t.viewHints;if(i[qa]||i[Ja]){var o=Date.now()-t.time>8;r=o?0:8,n=o?0:2}}e.getTilesLoading()<r&&(e.reprioritize(),e.loadMoreTiles(r,n))}t&&this.hasListener(zn)&&!t.animate&&this.renderComplete_&&this.renderer_.dispatchRenderEvent(zn,t);for(var a=this.postRenderFunctions_,s=0,l=a.length;s<l;++s)a[s](this,t);a.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)z(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(R,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(G,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,vi(this.viewport_)}var r=this.getTargetElement();if(r){for(var n in r.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new kl(this,this.moveTolerance_),Ll)this.mapBrowserEventHandler_.addEventListener(Ll[n],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(R,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(G,this.boundHandleBrowserEvent_,!!It&&{passive:!1});var i=this.getOwnerDocument().defaultView,o=this.keyboardEventTarget_?this.keyboardEventTarget_:r;this.targetChangeHandlerKeys_=[N(o,M,this.handleBrowserEvent,this),N(o,A,this.handleBrowserEvent,this),N(i,k,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(z(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(z(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=N(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=N(t,T,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(z),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new El("addlayer",t)),this.layerGroupPropertyListenerKeys_=[N(t,l,this.render,this),N(t,T,this.render,this),N(t,"addlayer",this.handleLayerAdd_,this),N(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,r=t.length;e<r;++e){var n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){hu(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,r=this.getSize(),i=this.getView(),o=this.frameState_,a=null;if(void 0!==r&&ri(r)&&i&&i.isDef()){var s=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=i.getState();if(a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:we(l.center,l.resolution,l.rotation,r),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:r,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:l,viewHints:s,wantedTiles:{},mapId:n(this),renderTargets:{}},l.nextCenter&&l.nextResolution){var u=isNaN(l.nextRotation)?l.rotation:l.nextRotation;a.nextExtent=we(l.nextCenter,l.nextResolution,u,r)}}if(this.frameState_=a,this.renderer_.renderFrame(a),a){if(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),o)(!this.previousExtent_||!Pe(this.previousExtent_)&&!he(a.extent,this.previousExtent_))&&(this.dispatchEvent(new Ol(Gl,this,o)),this.previousExtent_=se(this.previousExtent_));this.previousExtent_&&!a.viewHints[qa]&&!a.viewHints[Ja]&&!he(a.extent,this.previousExtent_)&&(this.dispatchEvent(new Ol(Nl,this,a)),$t(a.extent,this.previousExtent_))}this.dispatchEvent(new Ol(jl,this,a)),this.renderComplete_=!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoading(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new El("removelayer",e)),this.set(Bl,t)},e.prototype.setSize=function(t){this.set(zl,t)},e.prototype.setTarget=function(t){this.set(Ul,t)},e.prototype.setView=function(t){if(!t||t instanceof lu)this.set(Vl,t);else{this.set(Vl,new lu);var e=this;t.then((function(t){e.setView(new lu(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var r=getComputedStyle(t),n=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),i=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);isNaN(n)||isNaN(i)||!ri(e=[n,i])&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0.")}this.setSize(e),this.updateViewportSize_()},e.prototype.updateViewportSize_=function(){var t=this.getView();if(t){var e=void 0,r=getComputedStyle(this.viewport_);r.width&&r.height&&(e=[parseInt(r.width,10),parseInt(r.height,10)]),t.setViewportSize(e)}},e}(q);var fu=pu,du=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gu=function(t){function e(e){var r=t.call(this)||this,n=e.element;return!n||e.target||n.style.pointerEvents||(n.style.pointerEvents="auto"),r.element=n||null,r.target_=null,r.map_=null,r.listenerKeys=[],e.render&&(r.render=e.render),e.target&&r.setTarget(e.target),r}return du(e,t),e.prototype.disposeInternal=function(){vi(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&vi(this.element);for(var e=0,r=this.listenerKeys.length;e<r;++e)z(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==v&&this.listenerKeys.push(N(t,jl,this.render,this)),t.render())},e.prototype.render=function(t){},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(q),_u=Object.freeze({__proto__:null,default:gu}),yu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vu=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).ulElement_=document.createElement("ul"),r.collapsed_=void 0===n.collapsed||n.collapsed,r.userCollapsed_=r.collapsed_,r.overrideCollapsible_=void 0!==n.collapsible,r.collapsible_=void 0===n.collapsible||n.collapsible,r.collapsible_||(r.collapsed_=!1);var i=void 0!==n.className?n.className:"ol-attribution",o=void 0!==n.tipLabel?n.tipLabel:"Attributions",a=void 0!==n.expandClassName?n.expandClassName:i+"-expand",s=void 0!==n.collapseLabel?n.collapseLabel:"",l=void 0!==n.collapseClassName?n.collapseClassName:i+"-collpase";"string"==typeof s?(r.collapseLabel_=document.createElement("span"),r.collapseLabel_.textContent=s,r.collapseLabel_.className=l):r.collapseLabel_=s;var u=void 0!==n.label?n.label:"i";"string"==typeof u?(r.label_=document.createElement("span"),r.label_.textContent=u,r.label_.className=a):r.label_=u;var h=r.collapsible_&&!r.collapsed_?r.collapseLabel_:r.label_;r.toggleButton_=document.createElement("button"),r.toggleButton_.setAttribute("type","button"),r.toggleButton_.setAttribute("aria-expanded",String(!r.collapsed_)),r.toggleButton_.title=o,r.toggleButton_.appendChild(h),r.toggleButton_.addEventListener(P,r.handleClick_.bind(r),!1);var c=i+" "+"ol-unselectable "+wi+(r.collapsed_&&r.collapsible_?" ol-collapsed":"")+(r.collapsible_?"":" ol-uncollapsible"),p=r.element;return p.className=c,p.appendChild(r.toggleButton_),p.appendChild(r.ulElement_),r.renderedAttributions_=[],r.renderedVisible_=!0,r}return yu(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},r=[],n=!0,i=t.layerStatesArray,o=0,a=i.length;o<a;++o){var s=i[o];if(Po(s,t.viewState)){var l=s.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(n=n&&!1!==l.getAttributionsCollapsible(),Array.isArray(h))for(var c=0,p=h.length;c<p;++c)h[c]in e||(r.push(h[c]),e[h[c]]=!0);else h in e||(r.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(n),r},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),r=e.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!g(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var n=0,i=e.length;n<i;++n){var o=document.createElement("li");o.innerHTML=e[n],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_},e.prototype.handleToggle_=function(){this.element.classList.toggle(Si),this.collapsed_?yi(this.collapseLabel_,this.label_):yi(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.render=function(t){this.updateElement_(t.frameState)},e}(gu),mu=vu,xu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wu=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this;var i=void 0!==n.className?n.className:"ol-rotate",o=void 0!==n.label?n.label:"⇧",a=void 0!==n.compassClassName?n.compassClassName:"ol-compass";r.label_=null,"string"==typeof o?(r.label_=document.createElement("span"),r.label_.className=a,r.label_.textContent=o):(r.label_=o,r.label_.classList.add(a));var s=n.tipLabel?n.tipLabel:"Reset rotation",l=document.createElement("button");l.className=i+"-reset",l.setAttribute("type","button"),l.title=s,l.appendChild(r.label_),l.addEventListener(P,r.handleClick_.bind(r),!1);var u=i+" "+"ol-unselectable "+wi,h=r.element;return h.className=u,h.appendChild(l),r.callResetNorth_=n.resetNorth?n.resetNorth:void 0,r.duration_=void 0!==n.duration?n.duration:250,r.autoHide_=void 0===n.autoHide||n.autoHide,r.rotation_=void 0,r.autoHide_&&r.element.classList.add(mi),r}return xu(e,t),e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();if(t){var e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:sl}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var r=e.viewState.rotation;if(r!=this.rotation_){var n="rotate("+r+"rad)";if(this.autoHide_){var i=this.element.classList.contains(mi);i||0!==r?i&&0!==r&&this.element.classList.remove(mi):this.element.classList.add(mi)}this.label_.style.transform=n}this.rotation_=r}},e}(gu),Su=wu,Cu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Eu=function(t){function e(e){var r=this,n=e||{};r=t.call(this,{element:document.createElement("div"),target:n.target})||this;var i=void 0!==n.className?n.className:"ol-zoom",o=void 0!==n.delta?n.delta:1,a=void 0!==n.zoomInClassName?n.zoomInClassName:i+"-in",s=void 0!==n.zoomOutClassName?n.zoomOutClassName:i+"-out",l=void 0!==n.zoomInLabel?n.zoomInLabel:"+",u=void 0!==n.zoomOutLabel?n.zoomOutLabel:"",h=void 0!==n.zoomInTipLabel?n.zoomInTipLabel:"Zoom in",c=void 0!==n.zoomOutTipLabel?n.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=a,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(P,r.handleClick_.bind(r,o),!1);var f=document.createElement("button");f.className=s,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(P,r.handleClick_.bind(r,-o),!1);var d=i+" "+"ol-unselectable "+wi,g=r.element;return g.className=d,g.appendChild(p),g.appendChild(f),r.duration_=void 0!==n.duration?n.duration:250,r}return Cu(e,t),e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var r=e.getZoom();if(void 0!==r){var n=e.getConstrainedZoom(r+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:sl})):e.setZoom(n)}}},e}(gu),Tu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bu="units",Ru="degrees",Pu="imperial",Ou="nautical",Fu="metric",Iu="us",Lu=[1,2,5],Mu=25.4/.28,Au=function(t){function e(e){var r=this,n=e||{},i=void 0!==n.className?n.className:n.bar?"ol-scale-bar":"ol-scale-line";return(r=t.call(this,{element:document.createElement("div"),render:n.render,target:n.target})||this).on,r.once,r.un,r.innerElement_=document.createElement("div"),r.innerElement_.className=i+"-inner",r.element.className=i+" "+xi,r.element.appendChild(r.innerElement_),r.viewState_=null,r.minWidth_=void 0!==n.minWidth?n.minWidth:64,r.renderedVisible_=!1,r.renderedWidth_=void 0,r.renderedHTML_="",r.addChangeListener(bu,r.handleUnitsChanged_),r.setUnits(n.units||Fu),r.scaleBar_=n.bar||!1,r.scaleBarSteps_=n.steps||4,r.scaleBarText_=n.text||!1,r.dpi_=n.dpi||void 0,r}return Tu(e,t),e.prototype.getUnits=function(){return this.get(bu)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(bu,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,r=t.projection,n=this.getUnits(),i=n==Ru?St.DEGREES:St.METERS,o=Tr(r,t.resolution,e,i),a=this.minWidth_*(this.dpi_||Mu)/Mu,s=a*o,l="";if(n==Ru){var u=wt[St.DEGREES];(s*=u)<u/60?(l="″",o*=3600):s<u?(l="",o*=60):l="°"}else n==Pu?s<.9144?(l="in",o/=.0254):s<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):n==Ou?(o/=1852,l="nm"):n==Fu?s<.001?(l="μm",o*=1e6):s<1?(l="mm",o*=1e3):s<1e3?l="m":(l="km",o/=1e3):n==Iu?s<.9144?(l="in",o*=39.37):s<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):nt(!1,33);for(var h,c,p,f,d=3*Math.floor(Math.log(a*o)/Math.log(10));;){p=Math.floor(d/3);var g=Math.pow(10,p);if(h=Lu[(d%3+3)%3]*g,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=a)break;++d}f=this.scaleBar_?this.createScaleBar(c,h,l):h.toFixed(p<0?-p:0)+" "+l,this.renderedHTML_!=f&&(this.innerElement_.innerHTML=f,this.renderedHTML_=f),this.renderedWidth_!=c&&(this.innerElement_.style.width=c+"px",this.renderedWidth_=c),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}else this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1)},e.prototype.createScaleBar=function(t,e,r){for(var n="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,a="#ffffff",s=0;s<this.scaleBarSteps_;s++)0===s&&i.push(this.createMarker("absolute",s)),i.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+a+';"></div>'+this.createMarker("relative",s)+(s%2==0||2===this.scaleBarSteps_?this.createStepText(s,t,!1,e,r):"")+"</div>"),s===this.scaleBarSteps_-1&&i.push(this.createStepText(s+1,t,!0,e,r)),a="#ffffff"===a?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+n+"</div>":"")+i.join("")+"</div>"},e.prototype.createMarker=function(t,e){return'<div class="ol-scale-step-marker" style="position: '+t+";top: "+("absolute"===t?3:-10)+'px;"></div>'},e.prototype.createStepText=function(t,e,r,n,i){var o=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+i);return'<div class="ol-scale-step-text" style="margin-left: '+(0===t?-3:e/this.scaleBarSteps_*-1)+"px;text-align: "+(0===t?"left":"center")+"; min-width: "+(0===t?0:e/this.scaleBarSteps_*2)+"px;left: "+(r?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=Tr(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||Mu,r=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*r*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(gu),Du=Au;var ku="active",ju=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Gu(t,e,r,n){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),a=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:a,anchor:r,duration:void 0!==n?n:250,easing:sl})}}var Nu=function(t){function e(e){var r=t.call(this)||this;return r.on,r.once,r.un,e&&e.handleEvent&&(r.handleEvent=e.handleEvent),r.map_=null,r.setActive(!0),r}return ju(e,t),e.prototype.getActive=function(){return this.get(ku)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(ku,t)},e.prototype.setMap=function(t){this.map_=t},e}(q),Bu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),zu=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:250,r}return Bu(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Ll.DBLCLICK){var r=t.originalEvent,n=t.map,i=t.coordinate,o=r.shiftKey?-this.delta_:this.delta_;Gu(n.getView(),o,i,this.duration_),r.preventDefault(),e=!0}return!e},e}(Nu),Uu=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Vu(t){for(var e=t.length,r=0,n=0,i=0;i<e;i++)r+=t[i].clientX,n+=t[i].clientY;return[r/e,n/e]}var Xu=function(t){function e(e){var r=this,n=e||{};return r=t.call(this,n)||this,n.handleDownEvent&&(r.handleDownEvent=n.handleDownEvent),n.handleDragEvent&&(r.handleDragEvent=n.handleDragEvent),n.handleMoveEvent&&(r.handleMoveEvent=n.handleMoveEvent),n.handleUpEvent&&(r.handleUpEvent=n.handleUpEvent),n.stopDown&&(r.stopDown=n.stopDown),r.handlingDownUpSequence=!1,r.trackedPointers_={},r.targetPointers=[],r}return Uu(e,t),e.prototype.getPointerCount=function(){return this.targetPointers.length},e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.originalEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Ll.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Ll.POINTERUP){var r=this.handleUpEvent(t);this.handlingDownUpSequence=r&&this.targetPointers.length>0}}else if(t.type==Ll.POINTERDOWN){var n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Ll.POINTERMOVE&&this.handleMoveEvent(t);return!e},e.prototype.handleMoveEvent=function(t){},e.prototype.handleUpEvent=function(t){return!1},e.prototype.stopDown=function(t){return t},e.prototype.updateTrackedPointers_=function(t){if(function(t){var e=t.type;return e===Ll.POINTERDOWN||e===Ll.POINTERDRAG||e===Ll.POINTERUP}(t)){var e=t.originalEvent,r=e.pointerId.toString();t.type==Ll.POINTERUP?delete this.trackedPointers_[r]:(t.type==Ll.POINTERDOWN||r in this.trackedPointers_)&&(this.trackedPointers_[r]=e),this.targetPointers=w(this.trackedPointers_)}},e}(Nu);function Wu(t){var e=arguments;return function(t){for(var r=!0,n=0,i=e.length;n<i&&(r=r&&e[n](t));++n);return r}}var Yu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Ku=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),r=t.map.getOwnerDocument().activeElement;return e.contains(r)}(t)},Zu=_,Hu=function(t){var e=t.originalEvent;return 0==e.button&&!(bt&&Rt&&e.ctrlKey)},qu=y,Ju=function(t){return t.type==Ll.SINGLECLICK},Qu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},$u=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},th=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},eh=function(t){var e=t.originalEvent;return nt(void 0!==e,56),"mouse"==e.pointerType},rh=function(t){var e=t.originalEvent;return nt(void 0!==e,56),e.isPrimary&&0===e.button},nh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ih=function(t){function e(e){var r=t.call(this,{stopDown:y})||this,n=e||{};r.kinetic_=n.kinetic,r.lastCentroid=null,r.lastPointersCount_,r.panning_=!1;var i=n.condition?n.condition:Wu(Qu,rh);return r.condition_=n.onFocusOnly?Wu(Ku,i):i,r.noKinetic_=!1,r}return nh(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,r=Vu(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){var n=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],i=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(n,i.getResolution()),_r(n,i.getRotation()),i.adjustCenterInternal(n)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,r=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=r.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),s=e.getCoordinateFromPixelInternal([a[0]-n*Math.cos(i),a[1]-n*Math.sin(i)]);r.animateInternal({center:r.getConstrainedCenter(s),duration:500,easing:sl})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>0&&this.condition_(t)){var e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Xu),oh=ih,ah=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),sh=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,{stopDown:y})||this).condition_=n.condition?n.condition:Yu,r.lastAngle_=void 0,r.duration_=void 0!==n.duration?n.duration:250,r}return ah(e,t),e.prototype.handleDragEvent=function(t){if(eh(t)){var e=t.map,r=e.getView();if(r.getConstraints().rotation!==eu){var n=e.getSize(),i=t.pixel,o=Math.atan2(n[1]/2-i[1],i[0]-n[0]/2);if(void 0!==this.lastAngle_){var a=o-this.lastAngle_;r.adjustRotationInternal(-a)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!eh(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!eh(t)&&(!(!Hu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Xu),lh=sh,uh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),hh=function(t){function e(e){var r=t.call(this)||this;return r.geometry_=null,r.element_=document.createElement("div"),r.element_.style.position="absolute",r.element_.style.pointerEvents="auto",r.element_.className="ol-box "+e,r.map_=null,r.startPixel_=null,r.endPixel_=null,r}return uh(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,r="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+r,n.top=Math.min(t[1],e[1])+r,n.width=Math.abs(e[0]-t[0])+r,n.height=Math.abs(e[1]-t[1])+r},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)},e.prototype.setPixels=function(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()},e.prototype.createOrUpdateGeometry=function(){var t=this.startPixel_,e=this.endPixel_,r=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new An([r])},e.prototype.getGeometry=function(){return this.geometry_},e}(u),ch=hh,ph=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),fh="boxstart",dh="boxdrag",gh="boxend",_h="boxcancel",yh=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.coordinate=r,i.mapBrowserEvent=n,i}return ph(e,t),e}(s),vh=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n=e||{};return r.box_=new ch(n.className||"ol-dragbox"),r.minArea_=void 0!==n.minArea?n.minArea:64,n.onBoxEnd&&(r.onBoxEnd=n.onBoxEnd),r.startPixel_=null,r.condition_=n.condition?n.condition:Hu,r.boxEndCondition_=n.boxEndCondition?n.boxEndCondition:r.defaultBoxEndCondition,r}return ph(e,t),e.prototype.defaultBoxEndCondition=function(t,e,r){var n=r[0]-e[0],i=r[1]-e[1];return n*n+i*i>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new yh(dh,t.coordinate,t))},e.prototype.handleUpEvent=function(t){this.box_.setMap(null);var e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new yh(e?gh:_h,t.coordinate,t)),!1},e.prototype.handleDownEvent=function(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new yh(fh,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Xu),mh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xh=function(t){function e(e){var r=this,n=e||{},i=n.condition?n.condition:$u;return(r=t.call(this,{condition:i,className:n.className||"ol-dragzoom",minArea:n.minArea})||this).duration_=void 0!==n.duration?n.duration:200,r.out_=void 0!==n.out&&n.out,r}return mh(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),r=this.getGeometry();if(this.out_){var n=e.rotatedExtentForGeometry(r),i=e.getResolutionForExtentInternal(n),o=e.getResolution()/i;(r=r.clone()).scale(o*o)}e.fitInternal(r,{duration:this.duration_,easing:sl})},e}(vh),wh=37,Sh=38,Ch=39,Eh=40,Th=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),bh=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.defaultCondition_=function(t){return Qu(t)&&th(t)},r.condition_=void 0!==n.condition?n.condition:r.defaultCondition_,r.duration_=void 0!==n.duration?n.duration:100,r.pixelDelta_=void 0!==n.pixelDelta?n.pixelDelta:128,r}return Th(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==M){var r=t.originalEvent,n=r.keyCode;if(this.condition_(t)&&(n==Eh||n==wh||n==Ch||n==Sh)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,a=0,s=0;n==Eh?s=-o:n==wh?a=-o:n==Ch?a=o:s=o;var l=[a,s];_r(l,i.getRotation()),function(t,e,r){var n=t.getCenterInternal();if(n){var i=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==r?r:250,easing:ul,center:t.getConstrainedCenter(i)})}}(i,l,this.duration_),r.preventDefault(),e=!0}}return!e},e}(Nu),Rh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ph=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.condition_=n.condition?n.condition:th,r.delta_=n.delta?n.delta:1,r.duration_=void 0!==n.duration?n.duration:100,r}return Rh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==M||t.type==A){var r=t.originalEvent,n=r.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){var i=t.map,o=n=="+".charCodeAt(0)?this.delta_:-this.delta_;Gu(i.getView(),o,void 0,this.duration_),r.preventDefault(),e=!0}}return!e},e}(Nu),Oh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fh="trackpad",Ih="wheel",Lh=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,n)||this).totalDelta_=0,r.lastDelta_=0,r.maxDelta_=void 0!==n.maxDelta?n.maxDelta:1,r.duration_=void 0!==n.duration?n.duration:250,r.timeout_=void 0!==n.timeout?n.timeout:80,r.useAnchor_=void 0===n.useAnchor||n.useAnchor,r.constrainResolution_=void 0!==n.constrainResolution&&n.constrainResolution;var i=n.condition?n.condition:Zu;return r.condition_=n.onFocusOnly?Wu(Ku,i):i,r.lastAnchor_=null,r.startTime_=void 0,r.timeoutId_,r.mode_=void 0,r.trackpadEventGap_=400,r.trackpadTimeoutId_,r.deltaPerZoom_=300,r}return Oh(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;if(t.type!==G)return!0;var e,r=t.map,n=t.originalEvent;if(n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==G&&(e=n.deltaY,Et&&n.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Pt),n.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var i=Date.now();void 0===this.startTime_&&(this.startTime_=i),(!this.mode_||i-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Fh:Ih);var o=r.getView();if(this.mode_===Fh&&!o.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),o.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=i,!1;this.totalDelta_+=e;var a=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,r),a),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var r=-Ie(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),Gu(e,r,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0},e.prototype.setMouseAnchor=function(t){this.useAnchor_=t,t||(this.lastAnchor_=null)},e}(Nu),Mh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ah=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=y),(r=t.call(this,i)||this).anchor_=null,r.lastAngle_=void 0,r.rotating_=!1,r.rotationDelta_=0,r.threshold_=void 0!==n.threshold?n.threshold:.3,r.duration_=void 0!==n.duration?n.duration:250,r}return Mh(e,t),e.prototype.handleDragEvent=function(t){var e=0,r=this.targetPointers[0],n=this.targetPointers[1],i=Math.atan2(n.clientY-r.clientY,n.clientX-r.clientX);if(void 0!==this.lastAngle_){var o=i-this.lastAngle_;this.rotationDelta_+=o,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=o}this.lastAngle_=i;var a=t.map,s=a.getView();if(s.getConstraints().rotation!==eu){var l=a.getViewport().getBoundingClientRect(),u=Vu(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=a.getCoordinateFromPixelInternal(u),this.rotating_&&(a.render(),s.adjustRotationInternal(e,this.anchor_))}},e.prototype.handleUpEvent=function(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Xu),Dh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kh=function(t){function e(e){var r=this,n=e||{},i=n;return i.stopDown||(i.stopDown=y),(r=t.call(this,i)||this).anchor_=null,r.duration_=void 0!==n.duration?n.duration:400,r.lastDistance_=void 0,r.lastScaleDelta_=1,r}return Dh(e,t),e.prototype.handleDragEvent=function(t){var e=1,r=this.targetPointers[0],n=this.targetPointers[1],i=r.clientX-n.clientX,o=r.clientY-n.clientY,a=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/a),this.lastDistance_=a;var s=t.map,l=s.getView();1!=e&&(this.lastScaleDelta_=e);var u=s.getViewport().getBoundingClientRect(),h=Vu(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=s.getCoordinateFromPixelInternal(h),s.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),!1}return!0},e.prototype.handleDownEvent=function(t){if(this.targetPointers.length>=2){var e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1},e}(Xu),jh=kh,Gh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nh="addfeatures",Bh=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.features=n,o.file=r,o.projection=i,o}return Gh(e,t),e}(s),zh=function(t){function e(e){var r=this,n=e||{};(r=t.call(this,{handleEvent:_})||this).on,r.once,r.un,r.readAsBuffer_=!1,r.formats_=[];for(var i=n.formatConstructors?n.formatConstructors:[],o=0,a=i.length;o<a;++o){var s=i[o];"function"==typeof s&&(s=new s),r.formats_.push(s),r.readAsBuffer_=r.readAsBuffer_||s.getType()===Ys}return r.projection_=n.projection?Er(n.projection):null,r.dropListenKeys_=null,r.source_=n.source||null,r.target=n.target?n.target:null,r}return Gh(e,t),e.prototype.handleResult_=function(t,e){var r,n=e.target.result,i=this.getMap(),o=this.projection_;o||(o=i.getView().getProjection());for(var a=this.formats_,s=0,l=a.length;s<l;++s){var u=a[s],h=n;this.readAsBuffer_&&u.getType()!==Ys&&(void 0===r&&(r=(new TextDecoder).decode(n)),h=r);var c=this.tryReadFeatures_(u,h,{featureProjection:o});if(c&&c.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(c)),this.dispatchEvent(new Bh(Nh,t,c,o));break}}},e.prototype.registerListeners_=function(){var t=this.getMap();if(t){var e=this.target?this.target:t.getViewport();this.dropListenKeys_=[N(e,L,this.handleDrop,this),N(e,F,this.handleStop,this),N(e,I,this.handleStop,this),N(e,L,this.handleStop,this)]}},e.prototype.setActive=function(e){!this.getActive()&&e&&this.registerListeners_(),this.getActive()&&!e&&this.unregisterListeners_(),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.unregisterListeners_(),t.prototype.setMap.call(this,e),this.getActive()&&this.registerListeners_()},e.prototype.tryReadFeatures_=function(t,e,r){try{return t.readFeatures(e,r)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(z),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,r=0,n=e.length;r<n;++r){var i=e.item(r),o=new FileReader;o.addEventListener(D,this.handleResult_.bind(this,i)),this.readAsBuffer_?o.readAsArrayBuffer(i):o.readAsText(i)}},e.prototype.handleStop=function(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"},e}(Nu),Uh=zh,Vh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xh=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).condition_=n.condition?n.condition:$u,r.lastAngle_=void 0,r.lastMagnitude_=void 0,r.lastScaleDelta_=0,r.duration_=void 0!==n.duration?n.duration:400,r}return Vh(e,t),e.prototype.handleDragEvent=function(t){if(eh(t)){var e=t.map,r=e.getSize(),n=t.pixel,i=n[0]-r[0]/2,o=r[1]/2-n[1],a=Math.atan2(o,i),s=Math.sqrt(i*i+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-a;l.adjustRotationInternal(u)}this.lastAngle_=a,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/s),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/s),this.lastMagnitude_=s}},e.prototype.handleUpEvent=function(t){if(!eh(t))return!0;var e=t.map.getView(),r=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,r),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!eh(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(Xu),Wh=Xh,Yh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kh=function(t){function e(e,r,n){var i=t.call(this)||this;if(void 0!==n&&void 0===r)i.setFlatCoordinates(n,e);else{var o=r||0;i.setCenterAndRadius(e,o,n)}return i}return Yh(e,t),e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){var i=this.flatCoordinates,o=t-i[0],a=e-i[1],s=o*o+a*a;if(s<n){if(0===s)for(var l=0;l<this.stride;++l)r[l]=i[l];else{var u=this.getRadius()/Math.sqrt(s);r[0]=i[0]+u*o,r[1]=i[1]+u*a;for(l=2;l<this.stride;++l)r[l]=i[l]}return r.length=this.stride,s}return n},e.prototype.containsXY=function(t,e){var r=this.flatCoordinates,n=t-r[0],i=e-r[1];return n*n+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,r=e[this.stride]-e[0];return ae(e[0]-r,e[1]-r,e[0]+r,e[1]+r,t)},e.prototype.getRadius=function(){return Math.sqrt(this.getRadiusSquared_())},e.prototype.getRadiusSquared_=function(){var t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e},e.prototype.getType=function(){return mt},e.prototype.intersectsExtent=function(t){if(Re(t,this.getExtent())){var e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||ge(t,this.intersectsCoordinate.bind(this)))}return!1},e.prototype.setCenter=function(t){var e=this.stride,r=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+r;for(var i=1;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n),this.changed()},e.prototype.setCenterAndRadius=function(t,e,r){this.setLayout(r,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var n=this.flatCoordinates,i=en(n,0,t,this.stride);n[i++]=n[0]+e;for(var o=1,a=this.stride;o<a;++o)n[i++]=n[o];n.length=i,this.changed()},e.prototype.getCoordinates=function(){return null},e.prototype.setCoordinates=function(t,e){},e.prototype.setRadius=function(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()},e.prototype.rotate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(Br(r,0,r.length,n,t,e,r)),this.changed()},e.prototype.translate=function(t,e){var r=this.getCenter(),n=this.getStride();this.setCenter(zr(r,0,r.length,n,t,e,r)),this.changed()},e}(Hr);Kh.prototype.transform;var Zh=Kh,Hh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),qh=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,r);else if(void 0!==r&&n)i.setFlatCoordinates(r,e),i.ends_=n;else{for(var o=i.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout()),d(s,c.getFlatCoordinates()),l.push(s.length)}i.setFlatCoordinates(o,s),i.ends_=l}return i}return Hh(e,t),e.prototype.appendLineString=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){return n<te(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Qr(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),tn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,r,n))},e.prototype.getCoordinateAtM=function(t,e,r){if(this.layout!=ut&&this.layout!=ht||0===this.flatCoordinates.length)return null;var n=void 0!==e&&e,i=void 0!==r&&r;return function(t,e,r,n,i,o,a){if(a)return Xn(t,e,r[r.length-1],n,i,o);var s;if(i<t[n-1])return o?((s=t.slice(0,n))[n-1]=i,s):null;if(t[t.length-1]<i)return o?((s=t.slice(t.length-n))[n-1]=i,s):null;for(var l=0,u=r.length;l<u;++l){var h=r[l];if(e!=h){if(i<t[e+n-1])return null;if(i<=t[h-1])return Xn(t,e,h,n,i,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,n,i)},e.prototype.getCoordinates=function(){return hn(this.flatCoordinates,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getLineString=function(t){return t<0||this.ends_.length<=t?null:new Zn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLineStrings=function(){for(var t=this.flatCoordinates,e=this.ends_,r=this.layout,n=[],i=0,o=0,a=e.length;o<a;++o){var s=e[o],l=new Zn(t.slice(i,s),r);n.push(l),i=s}return n},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,r=0,n=this.ends_,i=this.stride,o=0,a=n.length;o<a;++o){var s=n[o];d(t,Vn(e,r,s,i,.5)),r=s}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l];a=on(t,e,h,n,i,o,a),s.push(a),e=h}return a}(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,n),new e(r,st,n)},e.prototype.getType=function(){return _t},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){if(bn(t,e,r[o],n,i))return!0;e=r[o]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var r=nn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()},e}(Hr),Jh=qh,Qh=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),$h=function(t){function e(e,r){var n=t.call(this)||this;return r&&!Array.isArray(e[0])?n.setFlatCoordinates(r,e):n.setCoordinates(e,r),n}return Qh(e,t),e.prototype.appendPoint=function(t){this.flatCoordinates?d(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()},e.prototype.clone=function(){var t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<te(this.getExtent(),t,e))return n;for(var i=this.flatCoordinates,o=this.stride,a=0,s=i.length;a<s;a+=o){var l=De(t,e,i[a],i[a+1]);if(l<n){n=l;for(var u=0;u<o;++u)r[u]=i[a+u];r.length=o}}return n},e.prototype.getCoordinates=function(){return un(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getPoint=function(t){var e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new mn(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,r=this.stride,n=[],i=0,o=t.length;i<o;i+=r){var a=new mn(t.slice(i,i+r),e);n.push(a)}return n},e.prototype.getType=function(){return gt},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,r=this.stride,n=0,i=e.length;n<i;n+=r){if(ne(t,e[n],e[n+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=rn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Hr),tc=$h;function ec(t,e,r,n){for(var i=[],o=[1/0,1/0,-1/0,-1/0],a=0,s=r.length;a<s;++a){var l=r[a];o=ue(t,e,l[0],n),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return i}var rc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),nc=function(t){function e(e,r,n){var i=t.call(this)||this;if(i.endss_=[],i.flatInteriorPointsRevision_=-1,i.flatInteriorPoints_=null,i.maxDelta_=-1,i.maxDeltaRevision_=-1,i.orientedRevision_=-1,i.orientedFlatCoordinates_=null,!n&&!Array.isArray(e[0])){for(var o=i.getLayout(),a=e,s=[],l=[],u=0,h=a.length;u<h;++u){var c=a[u];0===u&&(o=c.getLayout());for(var p=s.length,f=c.getEnds(),g=0,_=f.length;g<_;++g)f[g]+=p;d(s,c.getFlatCoordinates()),l.push(f)}r=o,e=s,n=l}return void 0!==r&&n?(i.setFlatCoordinates(r,e),i.endss_=n):i.setCoordinates(e,r),i}return rc(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var r=this.flatCoordinates.length;d(this.flatCoordinates,t.getFlatCoordinates());for(var n=0,i=(e=t.getEnds().slice()).length;n<i;++n)e[n]+=r}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()},e.prototype.clone=function(){for(var t=this.endss_.length,r=new Array(t),n=0;n<t;++n)r[n]=this.endss_[n].slice();var i=new e(this.flatCoordinates.slice(),this.layout,r);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,r,n){return n<te(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];i=Qr(t,e,s,n,i),e=s[s.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,r,n,i,o,a,s,l,u,h){for(var c=h||[NaN,NaN],p=0,f=r.length;p<f;++p){var d=r[p];u=tn(t,e,d,n,i,o,a,s,l,u,c),e=d[d.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,r,n))},e.prototype.containsXY=function(t,e){return function(t,e,r,n,i,o){if(0===r.length)return!1;for(var a=0,s=r.length;a<s;++a){var l=r[a];if(Sn(t,e,l,n,i,o))return!0;e=l[l.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,r,n){for(var i=0,o=0,a=r.length;o<a;++o){var s=r[o];i+=fn(t,e,s,n),e=s[s.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ln(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,cn(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=ec(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=En(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new tc(this.getFlatInteriorPoints().slice(),ut)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(!Fn(t,e,s,n,i))return!1;s.length&&(e=s[s.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ln(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var r=[],n=[];return r.length=function(t,e,r,n,i,o,a,s){for(var l=0,u=r.length;l<u;++l){var h=r[l],c=[];a=ln(t,e,h,n,i,o,a,c),s.push(c),e=h[h.length-1]}return a}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,n),new e(r,st,n)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var r=this.endss_[t-1];e=r[r.length-1]}var n=this.endss_[t].slice(),i=n[n.length-1];if(0!==e)for(var o=0,a=n.length;o<a;++o)n[o]-=e;return new An(this.flatCoordinates.slice(e,i),this.layout,n)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,r=this.endss_,n=[],i=0,o=0,a=r.length;o<a;++o){var s=r[o].slice(),l=s[s.length-1];if(0!==i)for(var u=0,h=s.length;u<h;++u)s[u]-=i;var c=new An(e.slice(i,l),t,s);n.push(c),i=l}return n},e.prototype.getType=function(){return yt},e.prototype.intersectsExtent=function(t){return function(t,e,r,n,i){for(var o=0,a=r.length;o<a;++o){var s=r[o];if(Rn(t,e,s,n,i))return!0;e=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);var r=function(t,e,r,n,i){for(var o=i||[],a=0,s=0,l=r.length;s<l;++s){var u=nn(t,e,r[s],n,o[a]);o[a++]=u,e=u[u.length-1]}return o.length=a,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{var n=r[r.length-1];this.flatCoordinates.length=0===n.length?0:n[n.length-1]}this.changed()},e}(Hr),ic=nc,oc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ac="Point",sc="LineString",lc="Polygon",uc="Circle",hc="drawstart",cc="drawend",pc="drawabort",fc=function(t){function e(e,r){var n=t.call(this,e)||this;return n.feature=r,n}return oc(e,t),e}(s),dc=function(t){function e(e){var r=this,n=e;n.stopDown||(n.stopDown=y),(r=t.call(this,n)||this).on,r.once,r.un,r.shouldHandle_=!1,r.downPx_=null,r.downTimeout_,r.lastDragTime_,r.pointerType_,r.freehand_=!1,r.source_=e.source?e.source:null,r.features_=e.features?e.features:null,r.snapTolerance_=e.snapTolerance?e.snapTolerance:12,r.type_=e.type,r.mode_=function(t){switch(t){case ct:case gt:return ac;case pt:case _t:return sc;case dt:case yt:return lc;case mt:return uc;default:throw new Error("Invalid type: "+t)}}(r.type_),r.stopClick_=!!e.stopClick,r.minPoints_=e.minPoints?e.minPoints:r.mode_===lc?3:2,r.maxPoints_=r.mode_===uc?2:e.maxPoints?e.maxPoints:1/0,r.finishCondition_=e.finishCondition?e.finishCondition:_;var i,o=e.geometryFunction;if(!o){var a,s=r.mode_;if(s===uc)o=function(t,e,r){var n=e||new Zh([NaN,NaN]),i=kr(t[0]),o=yr(i,kr(t[t.length-1]));return n.setCenterAndRadius(i,Math.sqrt(o)),n};else s===ac?a=mn:s===sc?a=Zn:s===lc&&(a=An),o=function(t,e,r){return e?s===lc?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new a(t),e}}return r.geometryFunction_=o,r.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,r.finishCoordinate_=null,r.sketchFeature_=null,r.sketchPoint_=null,r.sketchCoords_=null,r.sketchLine_=null,r.sketchLineCoords_=null,r.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,r.overlay_=new Ms({source:new tl({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=ro(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),r.geometryName_=e.geometryName,r.condition_=e.condition?e.condition:Qu,r.freehandCondition_,e.freehand?r.freehandCondition_=Zu:r.freehandCondition_=e.freehandCondition?e.freehandCondition:$u,r.addChangeListener(ku,r.updateState_),r}return oc(e,t),e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),this.updateState_()},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleEvent=function(e){e.originalEvent.type===R&&e.originalEvent.preventDefault(),this.freehand_=this.mode_!==ac&&this.freehandCondition_(e);var r=e.type===Ll.POINTERMOVE,n=!0;!this.freehand_&&this.lastDragTime_&&e.type===Ll.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,r=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Ll.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),n=!1):this.freehand_&&e.type===Ll.POINTERDOWN?n=!1:r&&this.getPointerCount()<2?(n=e.type===Ll.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===Ll.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Ll.DBLCLICK&&(n=!1),t.prototype.handleEvent.call(this,e)&&n},e.prototype.handleDownEvent=function(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new Il(Ll.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)},e.prototype.handleUpEvent=function(t){var e=!0;if(0===this.getPointerCount())if(this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t),this.shouldHandle_){var r=!this.finishCoordinate_;r&&this.startDrawing_(t.coordinate),!r&&this.freehand_?this.finishDrawing():this.freehand_||r&&this.mode_!==ac||(this.atFinish_(t.pixel)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing();return!e&&this.stopClick_&&t.preventDefault(),e},e.prototype.handlePointerMove_=function(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){var e=this.downPx_,r=t.pixel,n=e[0]-r[0],i=e[1]-r[1],o=n*n+i*i;if(this.shouldHandle_=this.freehand_?o>this.squaredClickTolerance_:o<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?this.modifyDrawing_(t.coordinate):this.createOrUpdateSketchPoint_(t.coordinate.slice())},e.prototype.atFinish_=function(t){var e=!1;if(this.sketchFeature_){var r=!1,n=[this.finishCoordinate_],i=this.mode_;if(i===ac)e=!0;else if(i===uc)e=2===this.sketchCoords_.length;else if(i===sc)r=this.sketchCoords_.length>this.minPoints_;else if(i===lc){var o=this.sketchCoords_;r=o[0].length>this.minPoints_,n=[o[0][0],o[0][o[0].length-2]]}if(r)for(var a=this.getMap(),s=0,l=n.length;s<l;s++){var u=n[s],h=a.getPixelFromCoordinate(u),c=t[0]-h[0],p=t[1]-h[1],f=this.freehand_?1:this.snapTolerance_;if(e=Math.sqrt(c*c+p*p)<=f){this.finishCoordinate_=u;break}}}return e},e.prototype.createOrUpdateSketchPoint_=function(t){this.sketchPoint_?this.sketchPoint_.getGeometry().setCoordinates(t):(this.sketchPoint_=new at(new mn(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new at);var e=t.getLinearRing(0),r=this.sketchLine_.getGeometry();r?(r.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),r.changed()):(r=new Zn(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(r))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===ac?this.sketchCoords_=t.slice():this.mode_===lc?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new at(new Zn(this.sketchLineCoords_)));var r=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new at,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(r),this.updateSketchFeatures_(),this.dispatchEvent(new fc(hc,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,r,n=this.getMap(),i=this.sketchFeature_.getGeometry(),o=n.getView().getProjection();(this.mode_===ac?r=this.sketchCoords_:this.mode_===lc?(r=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(n.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):r=(e=this.sketchCoords_)[e.length-1],r[0]=t[0],r[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(i.getType()===dt&&this.mode_!==lc)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,r,n=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===sc||o===uc?(this.finishCoordinate_=t.slice(),(r=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),this.geometryFunction_(r,n,i)):o===lc&&((r=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?r.pop():e=!0),r.push(t.slice()),e&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,n,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),r=this.getMap().getView().getProjection(),n=this.mode_;if(n===sc||n===uc){if((t=this.sketchCoords_).splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();var i=this.finishCoordinate_.slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}this.geometryFunction_(t,e,r),e.getType()===dt&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(n===lc){(t=this.sketchCoords_[0]).splice(-2,1);var o=this.sketchLine_.getGeometry();if(t.length>=2){i=t[t.length-2].slice();t[t.length-1]=i,this.createOrUpdateSketchPoint_(i)}o.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,r)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,r=t.getGeometry(),n=this.getMap().getView().getProjection();this.mode_===sc?(e.pop(),this.geometryFunction_(e,r,n)):this.mode_===lc&&(e[0].pop(),this.geometryFunction_(e,r,n),e=r.getCoordinates()),this.type_===gt?t.setGeometry(new tc([e])):this.type_===_t?t.setGeometry(new Jh([e])):this.type_===yt&&t.setGeometry(new ic([e])),this.dispatchEvent(new fc(cc,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}},e.prototype.abortDrawing_=function(){this.finishCoordinate_=null;var t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),t},e.prototype.abortDrawing=function(){var t=this.abortDrawing_();t&&this.dispatchEvent(new fc(pc,t))},e.prototype.appendCoordinates=function(t){var e,r=this.mode_,n=!this.sketchFeature_;if(n&&this.startDrawing_(t[0]),r===sc||r===uc)e=this.sketchCoords_;else{if(r!==lc)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}n&&e.shift(),e.pop();for(var i=0;i<t.length;i++)this.addToDrawing_(t[i]);var o=t[t.length-1];this.addToDrawing_(o),this.modifyDrawing_(o)},e.prototype.extend=function(t){var e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();var r=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=r.slice(),this.sketchCoords_.push(r.slice()),this.sketchPoint_=new at(new mn(r)),this.updateSketchFeatures_(),this.dispatchEvent(new fc(hc,this.sketchFeature_))},e.prototype.updateSketchFeatures_=function(){var t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);var e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)},e.prototype.updateState_=function(){var t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)},e}(Xu);var gc=dc,_c=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yc="extentchanged",vc=function(t){function e(e){var r=t.call(this,yc)||this;return r.extent=e,r}return _c(e,t),e}(s);function mc(){var t=ro();return function(e,r){return t[dt]}}function xc(){var t=ro();return function(e,r){return t[ct]}}function wc(t){return function(e){return Jt([t,e])}}function Sc(t,e){return t[0]==e[0]?function(r){return Jt([t,[r[0],e[1]]])}:t[1]==e[1]?function(r){return Jt([t,[e[0],r[1]]])}:null}var Cc=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this,n)||this).on,r.once,r.un,r.condition_=n.condition?n.condition:Zu,r.extent_=null,r.pointerHandler_=null,r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.snappedToVertex_=!1,r.extentFeature_=null,r.vertexFeature_=null,e||(e={}),r.extentOverlay_=new Ms({source:new tl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:mc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),r.vertexOverlay_=new Ms({source:new tl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:xc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&r.setExtent(e.extent),r}return _c(e,t),e.prototype.snapToVertex_=function(t,e){var r=e.getCoordinateFromPixelInternal(t),n=this.getExtentInternal();if(n){var i=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(n);i.sort((function(t,e){return mr(r,t)-mr(r,e)}));var o=i[0],a=dr(r,o),s=e.getPixelFromCoordinateInternal(a);if(vr(t,s)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),h=yr(s,l),c=yr(s,u),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(a=h>c?o[1]:o[0]),a}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,r=t.map,n=this.snapToVertex_(e,r);n||(n=r.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(n)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(Dn(t)):e.setGeometry(void 0):(e=new at(t?Dn(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e},e.prototype.createOrUpdatePointerFeature_=function(t){var e=this.vertexFeature_;e?e.getGeometry().setCoordinates(t):(e=new at(new mn(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Ll.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,r=t.map,n=this.getExtentInternal(),i=this.snapToVertex_(e,r),o=function(t){var e=null,r=null;return t[0]==n[0]?e=n[2]:t[0]==n[2]&&(e=n[0]),t[1]==n[1]?r=n[3]:t[1]==n[3]&&(r=n[1]),null!==e&&null!==r?[e,r]:null};if(i&&n){var a=i[0]==n[0]||i[0]==n[2]?i[0]:null,s=i[1]==n[1]||i[1]==n[3]?i[1]:null;null!==a&&null!==s?this.pointerHandler_=wc(o(i)):null!==a?this.pointerHandler_=Sc(o([a,n[1]]),o([a,n[3]])):null!==s&&(this.pointerHandler_=Sc(o([n[0],s]),o([n[2],s])))}else i=r.getCoordinateFromPixelInternal(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=wc(i);return!0},e.prototype.handleDragEvent=function(t){if(this.pointerHandler_){var e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}},e.prototype.handleUpEvent=function(t){this.pointerHandler_=null;var e=this.getExtentInternal();return e&&0!==_e(e)||this.setExtent(null),!1},e.prototype.setMap=function(e){this.extentOverlay_.setMap(e),this.vertexOverlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getExtent=function(){return jr(this.getExtentInternal(),this.getMap().getView().getProjection())},e.prototype.getExtentInternal=function(){return this.extent_},e.prototype.setExtent=function(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new vc(this.extent_))},e}(Xu),Ec=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Tc=[0,0,0,0],bc=[],Rc="modifystart",Pc="modifyend",Oc=function(t){function e(e,r,n){var i=t.call(this,e)||this;return i.features=r,i.mapBrowserEvent=n,i}return Ec(e,t),e}(s),Fc=function(t){function e(e){var r,n=t.call(this,e)||this;if(n.on,n.once,n.un,n.boundHandleFeatureChange_=n.handleFeatureChange_.bind(n),n.condition_=e.condition?e.condition:rh,n.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&Ju(t)},n.deleteCondition_=e.deleteCondition?e.deleteCondition:n.defaultDeleteCondition_,n.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Zu,n.vertexFeature_=null,n.vertexSegments_=null,n.lastPixel_=[0,0],n.ignoreNextSingleClick_=!1,n.featuresBeingModified_=null,n.rBush_=new As,n.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,n.snappedToVertex_=!1,n.changingFeature_=!1,n.dragSegments_=[],n.overlay_=new Ms({source:new tl({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Ac(),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.SEGMENT_WRITERS_={Point:n.writePointGeometry_.bind(n),LineString:n.writeLineStringGeometry_.bind(n),LinearRing:n.writeLineStringGeometry_.bind(n),Polygon:n.writePolygonGeometry_.bind(n),MultiPoint:n.writeMultiPointGeometry_.bind(n),MultiLineString:n.writeMultiLineStringGeometry_.bind(n),MultiPolygon:n.writeMultiPolygonGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n)},n.source_=null,n.hitDetection_=null,e.features?r=e.features:e.source&&(n.source_=e.source,r=new rt(n.source_.getFeatures()),n.source_.addEventListener(Gs,n.handleSourceAdd_.bind(n)),n.source_.addEventListener(zs,n.handleSourceRemove_.bind(n))),!r)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(n.hitDetection_=e.hitDetection),n.features_=r,n.features_.forEach(n.addFeature_.bind(n)),n.features_.addEventListener(J,n.handleFeatureAdd_.bind(n)),n.features_.addEventListener(Q,n.handleFeatureRemove_.bind(n)),n.lastPointerEvent_=null,n.delta_=[0,0],n.snapToPointer_=void 0===e.snapToPointer?!n.hitDetection_:e.snapToPointer,n}return Ec(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var r=this.SEGMENT_WRITERS_[e.getType()];r&&r(t,e)}var n=this.getMap();n&&n.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,n),t.addEventListener(T,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new rt;for(var r=this.featuresBeingModified_.getArray(),n=0,i=e.length;n<i;++n)for(var o=e[n],a=0,s=o.length;a<s;++a){var l=o[a].feature;l&&-1===r.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Oc(Rc,this.featuresBeingModified_,t))}},e.prototype.removeFeature_=function(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(T,this.boundHandleFeatureChange_)},e.prototype.removeFeatureSegmentData_=function(t){var e=this.rBush_,r=[];e.forEach((function(e){t===e.feature&&r.push(e)}));for(var n=r.length-1;n>=0;--n){for(var i=r[n],o=this.dragSegments_.length-1;o>=0;--o)this.dragSegments_[o][0]===i&&this.dragSegments_.splice(o,1);e.remove(i)}},e.prototype.setActive=function(e){this.vertexFeature_&&!e&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.prototype.setActive.call(this,e)},e.prototype.setMap=function(e){this.overlay_.setMap(e),t.prototype.setMap.call(this,e)},e.prototype.getOverlay=function(){return this.overlay_},e.prototype.handleSourceAdd_=function(t){t.feature&&this.features_.push(t.feature)},e.prototype.handleSourceRemove_=function(t){t.feature&&this.features_.remove(t.feature)},e.prototype.handleFeatureAdd_=function(t){this.addFeature_(t.element)},e.prototype.handleFeatureChange_=function(t){if(!this.changingFeature_){var e=t.target;this.removeFeature_(e),this.addFeature_(e)}},e.prototype.handleFeatureRemove_=function(t){var e=t.element;this.removeFeature_(e)},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,geometry:e,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],a={feature:t,geometry:e,depth:[n],index:n,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,geometry:e,index:n,segment:o};this.rBush_.insert(Jt(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[n],index:a,segment:l};this.rBush_.insert(Jt(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,geometry:e,depth:[n],index:a,segment:l};this.rBush_.insert(Jt(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[a,n],index:u,segment:c};this.rBush_.insert(Jt(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var r=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[r,r]},i={feature:t,geometry:e,index:1,segment:[r,r]},o=[n,i];n.featureSegments=o,i.featureSegments=o,this.rBush_.insert(le(r),n);var a=e;this.rBush_.insert(a.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=r[n];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,r){var n=this.vertexFeature_;n?n.getGeometry().setCoordinates(t):(n=new at(new mn(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n));return n.set("features",e),n.set("geometries",r),n},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Ll.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(r=!(e.type!=Ll.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Ll.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!r);var r},e.prototype.handleDragEvent=function(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);for(var e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],r=[],n=[],i=0,o=this.dragSegments_.length;i<o;++i){var a=this.dragSegments_[i],s=a[0],l=s.feature;-1===r.indexOf(l)&&r.push(l);var u=s.geometry;-1===n.indexOf(u)&&n.push(u);for(var h=s.depth,c=void 0,p=s.segment,f=a[1];e.length<u.getStride();)e.push(p[f][e.length]);switch(u.getType()){case ct:c=e,p[0]=e,p[1]=e;break;case gt:(c=u.getCoordinates())[s.index]=e,p[0]=e,p[1]=e;break;case pt:(c=u.getCoordinates())[s.index+f]=e,p[f]=e;break;case _t:case dt:(c=u.getCoordinates())[h[0]][s.index+f]=e,p[f]=e;break;case yt:(c=u.getCoordinates())[h[1]][h[0]][s.index+f]=e,p[f]=e;break;case mt:if(p[0]=e,p[1]=e,0===s.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var d=vr(kr(u.getCenter()),kr(e));u.setRadius(d),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,r,n)},e.prototype.handleDownEvent=function(t){if(!this.condition_(t))return!1;var e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;var r=this.vertexFeature_;if(r){var i=t.map.getView().getProjection(),o=[],a=r.getGeometry().getCoordinates(),s=Jt([a]),l=this.rBush_.getInExtent(s),u={};l.sort(Ic);for(var h=0,c=l.length;h<c;++h){var p=l[h],f=p.segment,d=n(p.geometry),g=p.depth;if(g&&(d+="-"+g.join("-")),u[d]||(u[d]=new Array(2)),p.geometry.getType()!==mt||1!==p.index)if(!gr(f[0],a)||u[d][0])if(!gr(f[1],a)||u[d][1])n(f)in this.vertexSegments_&&!u[d][0]&&!u[d][1]&&this.insertVertexCondition_(t)&&o.push(p);else{if((p.geometry.getType()===pt||p.geometry.getType()===_t)&&u[d][0]&&0===u[d][0].index)continue;this.dragSegments_.push([p,1]),u[d][1]=p}else this.dragSegments_.push([p,0]),u[d][0]=p;else gr(Mc(e,p,i),a)&&!u[d][0]&&(this.dragSegments_.push([p,0]),u[d][0]=p)}o.length&&this.willModifyFeatures_(t,[o]);for(var _=o.length-1;_>=0;--_)this.insertVertex_(o[_],a)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var r=this.dragSegments_[e][0],n=r.geometry;if(n.getType()===mt){var i=n.getCenter(),o=r.featureSegments[0],a=r.featureSegments[1];o.segment[0]=i,o.segment[1]=i,a.segment[0]=i,a.segment[1]=i,this.rBush_.update(le(i),o);var s=n;this.rBush_.update(s.getExtent(),a)}else this.rBush_.update(Jt(r.segment),r)}return this.featuresBeingModified_&&(this.dispatchEvent(new Oc(Pc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1},e.prototype.handlePointerMove_=function(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)},e.prototype.handlePointerAtPixel_=function(t,e,r){var i,o,a=this,s=r||e.getCoordinateFromPixel(t),l=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===a.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,r){if((r=r||t.getGeometry()).getType()===ct&&c(a.features_.getArray(),t)){o=r;var n=r.getFlatCoordinates().slice(0,2);i=[{feature:t,geometry:r,segment:[n,n]}]}return!0}),{layerFilter:u})}if(!i){var h=jr(Qt(Gr(le(s,Tc)),e.getView().getResolution()*this.pixelTolerance_,Tc));i=this.rBush_.getInExtent(h)}if(i&&i.length>0){var p=i.sort((function(t,e){return Lc(s,t,l)-Lc(s,e,l)}))[0],f=p.segment,d=Mc(s,p,l),g=e.getPixelFromCoordinate(d),_=vr(t,g);if(o||_<=this.pixelTolerance_){var y={};if(y[n(f)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-s[0],this.delta_[1]=d[1]-s[1]),p.geometry.getType()===mt&&1===p.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);else{var v=e.getPixelFromCoordinate(f[0]),m=e.getPixelFromCoordinate(f[1]),x=yr(g,v),w=yr(g,m);_=Math.sqrt(Math.min(x,w)),this.snappedToVertex_=_<=this.pixelTolerance_,this.snappedToVertex_&&(d=x>w?f[1]:f[0]),this.createOrUpdateVertexFeature_(d,[p.feature],[p.geometry]);var S={};S[n(p.geometry)]=!0;for(var C=1,E=i.length;C<E;++C){var T=i[C].segment;if(!(gr(f[0],T[0])&&gr(f[1],T[1])||gr(f[0],T[1])&&gr(f[1],T[0])))break;var b=n(i[C].geometry);b in S||(S[b]=!0,y[n(T)]=!0)}}return void(this.vertexSegments_=y)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)},e.prototype.insertVertex_=function(t,e){for(var r,n=t.segment,i=t.feature,o=t.geometry,a=t.depth,s=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case _t:case dt:(r=o.getCoordinates())[a[0]].splice(s+1,0,e);break;case yt:(r=o.getCoordinates())[a[1]][a[0]].splice(s+1,0,e);break;case pt:(r=o.getCoordinates()).splice(s+1,0,e);break;default:return}this.setGeometryCoordinates_(o,r);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,s,a,1);var u={segment:[n[0],e],feature:i,geometry:o,depth:a,index:s};l.insert(Jt(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,n[1]],feature:i,geometry:o,depth:a,index:s+1};l.insert(Jt(h.segment),h),this.dragSegments_.push([h,0]),this.ignoreNextSingleClick_=!0},e.prototype.removePoint=function(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Ll.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Oc(Pc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,r,i,o,a,s,l,u,h,c,p=this.dragSegments_,f={},d=!1;for(o=p.length-1;o>=0;--o)c=n((h=(r=p[o])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===r[1]?(f[c].right=h,f[c].index=h.index):1==r[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(u=f[c].right,s=f[c].left,(l=(a=f[c].index)-1)<0&&(l=0),t=e=(i=(h=void 0!==s?s:u).geometry).getCoordinates(),d=!1,i.getType()){case _t:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(a,1),d=!0);break;case pt:e.length>2&&(e.splice(a,1),d=!0);break;case yt:t=t[h.depth[1]];case dt:(t=t[h.depth[0]]).length>4&&(a==t.length-1&&(a=0),t.splice(a,1),d=!0,0===a&&(t.pop(),t.push(t[0]),l=t.length-1))}if(d){this.setGeometryCoordinates_(i,e);var g=[];if(void 0!==s&&(this.rBush_.remove(s),g.push(s.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==s&&void 0!==u){var _={depth:h.depth,feature:h.feature,geometry:h.geometry,index:l,segment:g};this.rBush_.insert(Jt(_.segment),_)}this.updateSegmentIndices_(i,a,h.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),p.length=0}}return d},e.prototype.setGeometryCoordinates_=function(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1},e.prototype.updateSegmentIndices_=function(t,e,r,n){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===r||void 0===i.depth||g(i.depth,r))&&i.index>e&&(i.index+=n)}))},e}(Xu);function Ic(t,e){return t.index-e.index}function Lc(t,e,r){var n=e.geometry;if(n.getType()===mt){var i=n;if(1===e.index){null;var o=yr(i.getCenter(),kr(t)),a=Math.sqrt(o)-i.getRadius();return a*a}}var s=kr(t);return bc[0]=kr(e.segment[0]),bc[1]=kr(e.segment[1]),mr(s,bc)}function Mc(t,e,r){var n=e.geometry;if(n.getType()===mt&&1===e.index){var i=n;return Dr(i.getClosestPoint(kr(t)))}var o=kr(t);return bc[0]=kr(e.segment[0]),bc[1]=kr(e.segment[1]),Dr(dr(o,bc))}function Ac(){var t=ro();return function(e,r){return t[ct]}}var Dc=Fc,kc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),jc="select",Gc=function(t){function e(e,r,n,i){var o=t.call(this,e)||this;return o.selected=r,o.deselected=n,o.mapBrowserEvent=i,o}return kc(e,t),e}(s),Nc={},Bc=function(t){function e(e){var r=t.call(this)||this;r.on,r.once,r.un;var n,i,o=e||{};if(r.boundAddFeature_=r.addFeature_.bind(r),r.boundRemoveFeature_=r.removeFeature_.bind(r),r.condition_=o.condition?o.condition:Ju,r.addCondition_=o.addCondition?o.addCondition:qu,r.removeCondition_=o.removeCondition?o.removeCondition:qu,r.toggleCondition_=o.toggleCondition?o.toggleCondition:$u,r.multi_=!!o.multi&&o.multi,r.filter_=o.filter?o.filter:_,r.hitTolerance_=o.hitTolerance?o.hitTolerance:0,r.style_=void 0!==o.style?o.style:(d((n=ro())[dt],n[pt]),d(n[vt],n[pt]),function(t){return t.getGeometry()?n[t.getGeometry().getType()]:null}),r.features_=o.features||new rt,o.layers)if("function"==typeof o.layers)i=o.layers;else{var a=o.layers;i=function(t){return c(a,t)}}else i=_;return r.layerFilter_=i,r.featureLayerAssociation_={},r}return kc(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[n(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[n(t)]},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),t.prototype.setMap.call(this,e),e?(this.features_.addEventListener(J,this.boundAddFeature_),this.features_.addEventListener(Q,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(J,this.boundAddFeature_),this.features_.removeEventListener(Q,this.boundRemoveFeature_))},e.prototype.addFeature_=function(t){var e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){var r=this.getMap().getAllLayers().find((function(t){if(t instanceof Ms&&t.getSource()&&t.getSource().hasFeature(e))return t}));r&&this.addFeatureLayerAssociation_(e,r)}},e.prototype.removeFeature_=function(t){var e=t.element;this.style_&&this.restorePreviousStyle_(e)},e.prototype.getStyle=function(){return this.style_},e.prototype.applySelectedStyle_=function(t){var e=n(t);e in Nc||(Nc[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var r=this.getMap().getInteractions().getArray(),i=r.length-1;i>=0;--i){var o=r[i];if(o!==this&&o instanceof e&&o.getStyle()&&-1!==o.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(o.getStyle())}var a=n(t);t.setStyle(Nc[a]),delete Nc[a]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[n(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),r=this.removeCondition_(t),n=this.toggleCondition_(t),i=!e&&!r&&!n,o=t.map,a=this.getFeatures(),s=[],l=[];if(i){x(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return this.addFeatureLayerAssociation_(t,e),l.push(t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=a.getLength()-1;u>=0;--u){var h=a.item(u),p=l.indexOf(h);p>-1?l.splice(p,1):(a.remove(h),s.push(h))}0!==l.length&&a.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!n||c(a.getArray(),t)?(r||n)&&c(a.getArray(),t)&&(s.push(t),this.removeFeatureLayerAssociation_(t)):(this.addFeatureLayerAssociation_(t,i),l.push(t)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var f=s.length-1;f>=0;--f)a.remove(s[f]);a.extend(l)}return(l.length>0||s.length>0)&&this.dispatchEvent(new Gc(jc,l,s,t)),!0},e}(Nu);var zc=Bc,Uc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Vc(t){return t.feature?t.feature:t.element?t.element:void 0}var Xc=[],Wc=function(t){function e(e){var r=this,n=e||{},i=n;return i.handleDownEvent||(i.handleDownEvent=_),i.stopDown||(i.stopDown=y),(r=t.call(this,i)||this).source_=n.source?n.source:null,r.vertex_=void 0===n.vertex||n.vertex,r.edge_=void 0===n.edge||n.edge,r.features_=n.features?n.features:null,r.featuresListenerKeys_=[],r.featureChangeListenerKeys_={},r.indexedFeaturesExtents_={},r.pendingFeatures_={},r.pixelTolerance_=void 0!==n.pixelTolerance?n.pixelTolerance:10,r.rBush_=new As,r.SEGMENT_WRITERS_={Point:r.writePointGeometry_.bind(r),LineString:r.writeLineStringGeometry_.bind(r),LinearRing:r.writeLineStringGeometry_.bind(r),Polygon:r.writePolygonGeometry_.bind(r),MultiPoint:r.writeMultiPointGeometry_.bind(r),MultiLineString:r.writeMultiLineStringGeometry_.bind(r),MultiPolygon:r.writeMultiPolygonGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r),Circle:r.writeCircleGeometry_.bind(r)},r}return Uc(e,t),e.prototype.addFeature=function(t,e){var r=void 0===e||e,i=n(t),o=t.getGeometry();if(o){var a=this.SEGMENT_WRITERS_[o.getType()];a&&(this.indexedFeaturesExtents_[i]=o.getExtent([1/0,1/0,-1/0,-1/0]),a(t,o))}r&&(this.featureChangeListenerKeys_[i]=N(t,T,this.handleFeatureChange_,this))},e.prototype.forEachFeatureAdd_=function(t){this.addFeature(t)},e.prototype.forEachFeatureRemove_=function(t){this.removeFeature(t)},e.prototype.getFeatures_=function(){var t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t},e.prototype.handleEvent=function(e){var r=this.snapTo(e.pixel,e.coordinate,e.map);return r.snapped&&(e.coordinate=r.vertex.slice(0,2),e.pixel=r.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Vc(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Vc(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var r=n(e);r in this.pendingFeatures_||(this.pendingFeatures_[r]=e)}else this.updateFeature_(e)},e.prototype.handleUpEvent=function(t){var e=w(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1},e.prototype.removeFeature=function(t,e){var r=void 0===e||e,i=n(t),o=this.indexedFeaturesExtents_[i];if(o){var a=this.rBush_,s=[];a.forEachInExtent(o,(function(e){t===e.feature&&s.push(e)}));for(var l=s.length-1;l>=0;--l)a.remove(s[l])}r&&(z(this.featureChangeListenerKeys_[i]),delete this.featureChangeListenerKeys_[i])},e.prototype.setMap=function(e){var r=this.getMap(),n=this.featuresListenerKeys_,i=this.getFeatures_();r&&(n.forEach(z),n.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?n.push(N(this.features_,J,this.handleFeatureAdd_,this),N(this.features_,Q,this.handleFeatureRemove_,this)):this.source_&&n.push(N(this.source_,Gs,this.handleFeatureAdd_,this),N(this.source_,zs,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,r){var n=Jt([r.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),r.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(n);this.vertex_&&!this.edge_&&(i=i.filter((function(t){return t.feature.getGeometry().getType()!==mt})));var o=!1,a=null,s=null;if(0===i.length)return{snapped:o,vertex:a,vertexPixel:s};r.getView().getProjection();for(var l,u=kr(e),h=1/0,c=0;c<i.length;++c){var p=i[c];Xc[0]=kr(p.segment[0]),Xc[1]=kr(p.segment[1]);var f=mr(u,Xc);f<h&&(l=p,h=f)}var d=l.segment;if(this.vertex_&&!this.edge_){var g=r.getPixelFromCoordinate(d[0]),_=r.getPixelFromCoordinate(d[1]),y=yr(t,g),v=yr(t,_);Math.sqrt(Math.min(y,v))<=this.pixelTolerance_&&(o=!0,a=y>v?d[1]:d[0],s=r.getPixelFromCoordinate(a))}else if(this.edge_){var m=l.feature.getGeometry().getType()===mt;if(m){var x=l.feature.getGeometry();null,a=Dr(function(t,e){var r=e.getRadius(),n=e.getCenter(),i=n[0],o=n[1],a=t[0]-i,s=t[1]-o;0===a&&0===s&&(a=1);var l=Math.sqrt(a*a+s*s);return[i+r*a/l,o+r*s/l]}(u,x))}else Xc[0]=kr(d[0]),Xc[1]=kr(d[1]),a=Dr(dr(u,Xc));if(vr(t,s=r.getPixelFromCoordinate(a))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!m)){g=r.getPixelFromCoordinate(d[0]),_=r.getPixelFromCoordinate(d[1]),y=yr(s,g),v=yr(s,_);Math.sqrt(Math.min(y,v))<=this.pixelTolerance_&&(a=y>v?d[1]:d[0],s=r.getPixelFromCoordinate(a))}}return o&&(s=[Math.round(s[0]),Math.round(s[1])]),{snapped:o,vertex:a,vertexPixel:s}},e.prototype.updateFeature_=function(t){this.removeFeature(t,!1),this.addFeature(t,!1)},e.prototype.writeCircleGeometry_=function(t,e){this.getMap().getView().getProjection();for(var r=kn(e).getCoordinates()[0],n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,segment:o};this.rBush_.insert(Jt(o),a)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var r=e.getGeometriesArray(),n=0;n<r.length;++n){var i=this.SEGMENT_WRITERS_[r[n].getType()];i&&i(t,r[n])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length-1;n<i;++n){var o=r.slice(n,n+2),a={feature:t,segment:o};this.rBush_.insert(Jt(o),a)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Jt(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n){var o=r[n],a={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),a)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length;a<s;++a)for(var l=o[a],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,segment:c};this.rBush_.insert(Jt(c),p)}},e.prototype.writePointGeometry_=function(t,e){var r=e.getCoordinates(),n={feature:t,segment:[r,r]};this.rBush_.insert(e.getExtent(),n)},e.prototype.writePolygonGeometry_=function(t,e){for(var r=e.getCoordinates(),n=0,i=r.length;n<i;++n)for(var o=r[n],a=0,s=o.length-1;a<s;++a){var l=o.slice(a,a+2),u={feature:t,segment:l};this.rBush_.insert(Jt(l),u)}},e}(Xu),Yc=Wc,Kc=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zc="translatestart",Hc="translating",qc="translateend",Jc=function(t){function e(e,r,n,i,o){var a=t.call(this,e)||this;return a.features=r,a.coordinate=n,a.startCoordinate=i,a.mapBrowserEvent=o,a}return Kc(e,t),e}(s),Qc=function(t){function e(e){var r,n=this,i=e||{};if((n=t.call(this,i)||this).on,n.once,n.un,n.lastCoordinate_=null,n.startCoordinate_=null,n.features_=void 0!==i.features?i.features:null,i.layers&&!n.features_)if("function"==typeof i.layers)r=i.layers;else{var o=i.layers;r=function(t){return c(o,t)}}else r=_;return n.layerFilter_=r,n.filter_=i.filter&&!n.features_?i.filter:_,n.hitTolerance_=i.hitTolerance?i.hitTolerance:0,n.condition_=i.condition?i.condition:Zu,n.lastFeature_=null,n.addChangeListener(ku,n.handleActiveChanged_),n}return Kc(e,t),e.prototype.handleDownEvent=function(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);var e=this.features_||new rt([this.lastFeature_]);return this.dispatchEvent(new Jc(Zc,e,t.coordinate,this.startCoordinate_,t)),!0}return!1},e.prototype.handleUpEvent=function(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);var e=this.features_||new rt([this.lastFeature_]);return this.dispatchEvent(new Jc(qc,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,r=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],i=this.features_||new rt([this.lastFeature_]);i.forEach((function(t){var e=t.getGeometry();e.translate(r,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new Jc(Hc,i,e,this.startCoordinate_,t))}},e.prototype.handleMoveEvent=function(t){var e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")},e.prototype.featuresAtPixel_=function(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||c(this.features_.getArray(),t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.setHitTolerance=function(t){this.hitTolerance_=t},e.prototype.setMap=function(e){var r=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(r)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),r=this.getActive();e&&r||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(Xu),$c=Qc;function tp(t){var e=t||{},r=new rt,n=new gl(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&r.push(new lh),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&r.push(new zu({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&r.push(new oh({onFocusOnly:e.onFocusOnly,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&r.push(new Ah),(void 0===e.pinchZoom||e.pinchZoom)&&r.push(new jh({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(r.push(new bh),r.push(new Ph({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&r.push(new Lh({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&r.push(new xh({duration:e.zoomDuration})),r}var ep=Object.freeze({__proto__:null,defaults:tp,DoubleClickZoom:zu,DragAndDrop:Uh,DragBox:vh,DragPan:oh,DragRotate:lh,DragRotateAndZoom:Wh,DragZoom:xh,Draw:gc,Extent:Cc,Interaction:Nu,KeyboardPan:bh,KeyboardZoom:Ph,Modify:Dc,MouseWheelZoom:Lh,PinchRotate:Ah,PinchZoom:jh,Pointer:Xu,Select:zc,Snap:Yc,Translate:$c}),rp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),np=function(t){function e(e){return(e=m({},e)).controls||(e.controls=function(t){var e=t||{},r=new rt;return(void 0===e.zoom||e.zoom)&&r.push(new Eu(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&r.push(new Su(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&r.push(new mu(e.attributionOptions)),r}()),e.interactions||(e.interactions=tp({onFocusOnly:!0})),t.call(this,e)||this}return rp(e,t),e.prototype.createRenderer=function(){return new Sl(this)},e}(fu),ip=function(){function t(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t.prototype.canExpireCache=function(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark},t.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},t.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},t.prototype.forEach=function(t){for(var e=this.oldest_;e;)t(e.value_,e.key_,this),e=e.newer},t.prototype.get=function(t,e){var r=this.entries_[t];return nt(void 0!==r,15),r===this.newest_||(r===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(r.newer.older=r.older,r.older.newer=r.newer),r.newer=null,r.older=this.newest_,this.newest_.newer=r,this.newest_=r),r.value_},t.prototype.remove=function(t){var e=this.entries_[t];return nt(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_},t.prototype.getCount=function(){return this.count_},t.prototype.getKeys=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),r=0;for(t=this.newest_;t;t=t.older)e[r++]=t.value_;return e},t.prototype.peekLast=function(){return this.oldest_.value_},t.prototype.peekLastKey=function(){return this.oldest_.key_},t.prototype.peekFirstKey=function(){return this.newest_.key_},t.prototype.pop=function(){var t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_},t.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},t.prototype.set=function(t,e){nt(!(t in this.entries_),16);var r={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=r:this.oldest_=r,this.newest_=r,this.entries_[t]=r,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function op(t,e,r,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=r,n):[t,e,r]}function ap(t,e,r){return t+"/"+e+"/"+r}function sp(t){return ap(t[0],t[1],t[2])}function lp(t){return t.split("/").map(Number)}function up(t){return(t[1]<<t[0])+t[2]}var hp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return hp(e,t),e.prototype.expireCache=function(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=lp(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(sp(e.tileCoord)),e.release())}.bind(this))}},e}(ip),pp=cp,fp=function(){function t(t,e,r,n){this.minX=t,this.maxX=e,this.minY=r,this.maxY=n}return t.prototype.contains=function(t){return this.containsXY(t[1],t[2])},t.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},t.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},t.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},t.prototype.extend=function(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)},t.prototype.getHeight=function(){return this.maxY-this.minY+1},t.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},t.prototype.getWidth=function(){return this.maxX-this.minX+1},t.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY},t}();function dp(t,e,r,n,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=r,i.maxY=n,i):new fp(t,e,r,n)}var gp=fp,_p=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),yp=[],vp=function(t){function e(e,r,n,i){var o=t.call(this,e,r,{transition:0})||this;return o.context_={},o.executorGroups={},o.declutterExecutorGroups={},o.loadingSourceTiles=0,o.hitDetectionImageData={},o.replayState_={},o.sourceTiles=[],o.errorTileKeys={},o.wantedResolution,o.getSourceTiles=i.bind(void 0,o),o.wrappedTileCoord=n,o}return _p(e,t),e.prototype.getContext=function(t){var e=n(t);return e in this.context_||(this.context_[e]=_i(1,1,yp)),this.context_[e]},e.prototype.hasContext=function(t){return n(t)in this.context_},e.prototype.getImage=function(t){return this.hasContext(t)?this.getContext(t).canvas:null},e.prototype.getReplayState=function(t){var e=n(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]},e.prototype.load=function(){this.getSourceTiles()},e.prototype.release=function(){for(var e in this.context_)yp.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(pl),mp=vp,xp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),wp=function(t){function e(e,r,n,i,o,a){var s=t.call(this,e,r,a)||this;return s.extent=null,s.format_=i,s.features_=null,s.loader_,s.projection=null,s.resolution,s.tileLoadFunction_=o,s.url_=n,s.key=n,s}return xp(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==el&&(this.setState(rl),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))},e.prototype.onLoad=function(t,e){this.setFeatures(t)},e.prototype.onError=function(){this.setState(il)},e.prototype.setFeatures=function(t){this.features_=t,this.setState(nl)},e.prototype.setLoader=function(t){this.loader_=t},e}(pl),Sp=wp;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Cp(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})})),e}var Ep={exports:{}},Tp=Cp(_u),bp=Cp(Y),Rp=Cp(Rl);!function(t,e){t.exports=function(t,e,r){t="default"in t?t.default:t,r="default"in r?r.default:r;var n=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},i=function(){function t(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),e}}(),o=function t(e,r,n){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,r);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,r,n)}if("value"in i)return i.value;var a=i.get;return void 0!==a?a.call(n):void 0},a=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},s=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},l="layer-switcher-",u=function(t){function u(t){n(this,u);var e=Object.assign({},t),r=e.tipLabel?e.tipLabel:"Legend",i=e.collapseTipLabel?e.collapseTipLabel:"Collapse legend",o=document.createElement("div"),a=s(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,{element:o,target:e.target}));a.activationMode=e.activationMode||"mouseover",a.startActive=!0===e.startActive;var h=void 0!==e.label?e.label:"",c=void 0!==e.collapseLabel?e.collapseLabel:"»";a.groupSelectStyle=u.getGroupSelectStyle(e.groupSelectStyle),a.reverse=!1!==e.reverse,a.mapListeners=[],a.hiddenClassName="ol-unselectable ol-control layer-switcher",u.isTouchDevice_()&&(a.hiddenClassName+=" touch"),a.shownClassName="shown",o.className=a.hiddenClassName;var p=document.createElement("button");return p.setAttribute("title",r),p.setAttribute("aria-label",r),o.appendChild(p),a.panel=document.createElement("div"),a.panel.className="panel",o.appendChild(a.panel),u.enableTouchScroll_(a.panel),p.textContent=h,o.classList.add(l+"group-select-style-"+a.groupSelectStyle),o.classList.add(l+"activation-mode-"+a.activationMode),"click"===a.activationMode?(o.classList.add("activationModeClick"),a.startActive&&(p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),p.onclick=function(t){var e=t||window.event;a.element.classList.contains(a.shownClassName)?(a.hidePanel(),p.textContent=h,p.setAttribute("title",r),p.setAttribute("aria-label",r)):(a.showPanel(),p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),e.preventDefault()}):(p.onmouseover=function(){a.showPanel()},p.onclick=function(t){var e=t||window.event;a.showPanel(),e.preventDefault()},a.panel.onmouseout=function(t){a.panel.contains(t.relatedTarget)||a.hidePanel()}),a}return a(u,t),i(u,[{key:"setMap",value:function(t){for(var r=this,n=0;n<this.mapListeners.length;n++)e.unByKey(this.mapListeners[n]);this.mapListeners.length=0,o(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"setMap",this).call(this,t),t&&(this.startActive?this.showPanel():this.renderPanel(),"click"!==this.activationMode&&this.mapListeners.push(t.on("pointerdown",(function(){r.hidePanel()}))))}},{key:"showPanel",value:function(){this.element.classList.contains(this.shownClassName)||(this.element.classList.add(this.shownClassName),this.renderPanel())}},{key:"hidePanel",value:function(){this.element.classList.contains(this.shownClassName)&&this.element.classList.remove(this.shownClassName)}},{key:"renderPanel",value:function(){this.dispatchEvent("render"),u.renderPanel(this.getMap(),this.panel,{groupSelectStyle:this.groupSelectStyle,reverse:this.reverse}),this.dispatchEvent("rendercomplete")}}],[{key:"renderPanel",value:function(t,e,r){var n=new Event("render");for(e.dispatchEvent(n),(r=r||{}).groupSelectStyle=u.getGroupSelectStyle(r.groupSelectStyle),u.ensureTopVisibleBaseLayerShown(t,r.groupSelectStyle);e.firstChild;)e.removeChild(e.firstChild);u.forEachRecursive(t,(function(t,e,r){t.set("indeterminate",!1)})),"children"===r.groupSelectStyle||"none"===r.groupSelectStyle?u.setGroupVisibility(t):"group"===r.groupSelectStyle&&u.setChildVisibility(t);var i=document.createElement("ul");e.appendChild(i),u.renderLayers_(t,t,i,r,(function(n){u.renderPanel(t,e,r)}));var o=new Event("rendercomplete");e.dispatchEvent(o)}},{key:"isBaseGroup",value:function(t){if(t instanceof r){var e=t.getLayers().getArray();return e.length&&"base"===e[0].get("type")}return!1}},{key:"setGroupVisibility",value:function(t){u.getGroupsAndLayers(t,(function(t){return t instanceof r&&!t.get("combine")&&!u.isBaseGroup(t)})).reverse().forEach((function(t){var e=t.getLayersArray().map((function(t){return t.getVisible()}));e.every((function(t){return!0===t}))?(t.setVisible(!0),t.set("indeterminate",!1)):e.every((function(t){return!1===t}))?(t.setVisible(!1),t.set("indeterminate",!1)):(t.setVisible(!0),t.set("indeterminate",!0))}))}},{key:"setChildVisibility",value:function(t){u.getGroupsAndLayers(t,(function(t){return t instanceof r&&!t.get("combine")&&!u.isBaseGroup(t)})).forEach((function(t){var e=t,r=e.getVisible(),n=e.get("indeterminate");e.getLayers().getArray().forEach((function(t){t.set("indeterminate",!1),r&&!n||!t.getVisible()||t.set("indeterminate",!0)}))}))}},{key:"ensureTopVisibleBaseLayerShown",value:function(t,e){var r=void 0;u.forEachRecursive(t,(function(t,e,n){"base"===t.get("type")&&t.getVisible()&&(r=t)})),r&&u.setVisible_(t,r,!0,e)}},{key:"getGroupsAndLayers",value:function(t,e){var r=[];return e=e||function(t,e,r){return!0},u.forEachRecursive(t,(function(t,n,i){t.get("title")&&e(t,n,i)&&r.push(t)})),r}},{key:"setVisible_",value:function(t,e,n,i){e.setVisible(n),n&&"base"===e.get("type")&&u.forEachRecursive(t,(function(t,r,n){t!=e&&"base"===t.get("type")&&t.setVisible(!1)})),e instanceof r&&!e.get("combine")&&"children"===i&&e.getLayers().forEach((function(r){u.setVisible_(t,r,e.getVisible(),i)}))}},{key:"renderLayer_",value:function(t,e,n,i,o){var a=document.createElement("li"),s=e.get("title"),h=u.uuid(),c=document.createElement("label");if(e instanceof r&&!e.get("combine")){var p=u.isBaseGroup(e);if(a.classList.add("group"),p&&a.classList.add(l+"base-group"),e.get("fold")){a.classList.add(l+"fold"),a.classList.add(l+e.get("fold"));var f=document.createElement("button");f.onclick=function(t){var r=t||window.event;u.toggleFold_(e,a),r.preventDefault()},a.appendChild(f)}if(!p&&"none"!=i.groupSelectStyle){var d=document.createElement("input");d.type="checkbox",d.id=h,d.checked=e.getVisible(),d.indeterminate=e.get("indeterminate"),d.onchange=function(r){var n=r.target;u.setVisible_(t,e,n.checked,i.groupSelectStyle),o(e)},a.appendChild(d),c.htmlFor=h}c.innerHTML=s,a.appendChild(c);var g=document.createElement("ul");a.appendChild(g),u.renderLayers_(t,e,g,i,o)}else{a.className="layer";var _=document.createElement("input");"base"===e.get("type")?(_.type="radio",_.name="base"):_.type="checkbox",_.id=h,_.checked=e.get("visible"),_.indeterminate=e.get("indeterminate"),_.onchange=function(r){var n=r.target;u.setVisible_(t,e,n.checked,i.groupSelectStyle),o(e)},a.appendChild(_),c.htmlFor=h,c.innerHTML=s;var y=t.getView().getResolution();(y>e.getMaxResolution()||y<e.getMinResolution())&&(c.className+=" disabled"),a.appendChild(c)}return a}},{key:"renderLayers_",value:function(t,e,r,n,i){var o=e.getLayers().getArray().slice();n.reverse&&(o=o.reverse());for(var a,s=0;s<o.length;s++)(a=o[s]).get("title")&&r.appendChild(u.renderLayer_(t,a,s,n,i))}},{key:"forEachRecursive",value:function(t,e){t.getLayers().forEach((function(t,n,i){e(t,n,i),t instanceof r&&u.forEachRecursive(t,e)}))}},{key:"uuid",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}},{key:"enableTouchScroll_",value:function(t){if(u.isTouchDevice_()){var e=0;t.addEventListener("touchstart",(function(t){e=this.scrollTop+t.touches[0].pageY}),!1),t.addEventListener("touchmove",(function(t){this.scrollTop=e-t.touches[0].pageY}),!1)}}},{key:"isTouchDevice_",value:function(){try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}}},{key:"toggleFold_",value:function(t,e){e.classList.remove(l+t.get("fold")),t.set("fold","open"===t.get("fold")?"close":"open"),e.classList.add(l+t.get("fold"))}},{key:"getGroupSelectStyle",value:function(t){return["none","children","group"].indexOf(t)>=0?t:"children"}}]),u}(t);return window.ol&&window.ol.control&&(window.ol.control.LayerSwitcher=u),u}(Tp,bp,Rp)}(Ep);var Pp=Ep.exports,Op=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var r;if(e){var n=e.dataProjection?Er(e.dataProjection):this.readProjection(t);e.extent&&n&&n.getUnits()===St.TILE_PIXELS&&(n=Er(n)).setWorldExtent(e.extent),r={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(r)},t.prototype.adaptOptions=function(t){return m({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)},t.prototype.getType=function(){return e()},t.prototype.readFeature=function(t,r){return e()},t.prototype.readFeatures=function(t,r){return e()},t.prototype.readGeometry=function(t,r){return e()},t.prototype.readProjection=function(t){return e()},t.prototype.writeFeature=function(t,r){return e()},t.prototype.writeFeatures=function(t,r){return e()},t.prototype.writeGeometry=function(t,r){return e()},t}(),Fp=Op;function Ip(t,e,r){var n,i=r?Er(r.featureProjection):null,o=r?Er(r.dataProjection):null;if(n=i&&o&&!Pr(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&r&&void 0!==r.decimals){var a=Math.pow(10,r.decimals);n===t&&(n=t.clone()),n.applyTransform((function(t){for(var e=0,r=t.length;e<r;++e)t[e]=Math.round(t[e]*a)/a;return t}))}return n}var Lp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mp=function(t){function r(){return t.call(this)||this}return Lp(r,t),r.prototype.getType=function(){return Ks},r.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Ap(t),this.getReadOptions(t,e))},r.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Ap(t),this.getReadOptions(t,e))},r.prototype.readFeatureFromObject=function(t,r){return e()},r.prototype.readFeaturesFromObject=function(t,r){return e()},r.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Ap(t),this.getReadOptions(t,e))},r.prototype.readGeometryFromObject=function(t,r){return e()},r.prototype.readProjection=function(t){return this.readProjectionFromObject(Ap(t))},r.prototype.readProjectionFromObject=function(t){return e()},r.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},r.prototype.writeFeatureObject=function(t,r){return e()},r.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},r.prototype.writeFeaturesObject=function(t,r){return e()},r.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},r.prototype.writeGeometryObject=function(t,r){return e()},r}(Fp);function Ap(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var Dp=Mp,kp=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function jp(t){for(var e=[],r=0,n=t.length;r<n;++r)e.push(t[r].clone());return e}var Gp=function(t){function e(e){var r=t.call(this)||this;return r.geometries_=e||null,r.changeEventsKeys_=[],r.listenGeometriesChange_(),r}return kp(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(z),this.changeEventsKeys_.length=0},e.prototype.listenGeometriesChange_=function(){if(this.geometries_)for(var t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(N(this.geometries_[t],T,this.changed,this))},e.prototype.clone=function(){var t=new e(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t},e.prototype.closestPointXY=function(t,e,r,n){if(n<te(this.getExtent(),t,e))return n;for(var i=this.geometries_,o=0,a=i.length;o<a;++o)n=i[o].closestPointXY(t,e,r,n);return n},e.prototype.containsXY=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)if(r[n].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){se(t);for(var e=this.geometries_,r=0,n=e.length;r<n;++r)ce(t,e[r].getExtent());return t},e.prototype.getGeometries=function(){return jp(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].getType()===this.getType()?t=t.concat(e[r].getGeometriesArrayRecursive()):t.push(e[r]);return t},e.prototype.getSimplifiedGeometry=function(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;for(var r=[],n=this.geometries_,i=!1,o=0,a=n.length;o<a;++o){var s=n[o],l=s.getSimplifiedGeometry(t);r.push(l),l!==s&&(i=!0)}if(i){var u=new e(null);return u.setGeometriesArray(r),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return vt},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)if(e[r].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,r){var n=r;n||(n=me(this.getExtent()));for(var i=this.geometries_,o=0,a=i.length;o<a;++o)i[o].scale(t,e,n);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(jp(t))},e.prototype.setGeometriesArray=function(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()},e.prototype.applyTransform=function(t){for(var e=this.geometries_,r=0,n=e.length;r<n;++r)e[r].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var r=this.geometries_,n=0,i=r.length;n<i;++n)r[n].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Wr),Np=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function Bp(t,e){if(!t)return null;var r;switch(t.type){case ct:r=function(t){return new mn(t.coordinates)}(t);break;case pt:r=function(t){return new Zn(t.coordinates)}(t);break;case dt:r=function(t){return new An(t.coordinates)}(t);break;case gt:r=function(t){return new tc(t.coordinates)}(t);break;case _t:r=function(t){return new Jh(t.coordinates)}(t);break;case yt:r=function(t){return new ic(t.coordinates)}(t);break;case vt:r=function(t,e){var r=t.geometries.map((function(t){return Bp(t,e)}));return new Gp(r)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Ip(r,!1,e)}function zp(t,e){var r,n=(t=Ip(t,!0,e)).getType();switch(n){case ct:r=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case pt:r=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case dt:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(r)}}(t,e);break;case gt:r=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case _t:r=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case yt:r=function(t,e){var r;e&&(r=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(r)}}(t,e);break;case vt:r=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var r=m({},e);return delete r.featureProjection,zp(t,r)}))}}(t,e);break;case mt:r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return r}var Up=function(t){function e(e){var r=this,n=e||{};return(r=t.call(this)||this).dataProjection=Er(n.dataProjection?n.dataProjection:"EPSG:4326"),n.featureProjection&&(r.defaultFeatureProjection=Er(n.featureProjection)),r.geometryName_=n.geometryName,r.extractGeometryName_=n.extractGeometryName,r.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],r}return Np(e,t),e.prototype.readFeatureFromObject=function(t,e){var r=null,n=Bp((r="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new at;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in r!==void 0&&i.setGeometryName(r.geometry_name),i.setGeometry(n),"id"in r&&i.setId(r.id),r.properties&&i.setProperties(r.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var r=null;if("FeatureCollection"===t.type){r=[];for(var n=t.features,i=0,o=n.length;i<o;++i)r.push(this.readFeatureFromObject(n[i],e))}else r=[this.readFeatureFromObject(t,e)];return r},e.prototype.readGeometryFromObject=function(t,e){return Bp(t,e)},e.prototype.readProjectionFromObject=function(t){var e,r=t.crs;return r?"name"==r.type?e=Er(r.properties.name):"EPSG"===r.type?e=Er("EPSG:"+r.properties.code):nt(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var r={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(r.id=n),!t.hasProperties())return r;var i=t.getProperties(),o=t.getGeometry();return o&&(r.geometry=zp(o,e),delete i[t.getGeometryName()]),S(i)||(r.properties=i),r},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var r=[],n=0,i=t.length;n<i;++n)r.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:r}},e.prototype.writeGeometryObject=function(t,e){return zp(t,this.adaptOptions(e))},e}(Dp),Vp="http://www.w3.org/2001/XMLSchema-instance";function Xp(t,e){return hf().createElementNS(t,e)}function Wp(t,e){return Yp(t,e,[]).join("")}function Yp(t,e,r){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?r.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(t.nodeValue);else{var n=void 0;for(n=t.firstChild;n;n=n.nextSibling)Yp(n,e,r)}return r}function Kp(t){return"documentElement"in t}function Zp(t){return(new DOMParser).parseFromString(t,"application/xml")}function Hp(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&d(n[n.length-1],i)}}function qp(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&n[n.length-1].push(i)}}function Jp(t,e){return function(r,n){var i=t.call(void 0!==e?e:this,r,n);void 0!==i&&(n[n.length-1]=i)}}function Qp(t,e,r){return function(n,i){var o=t.call(void 0!==r?r:this,n,i);void 0!==o&&(i[i.length-1][void 0!==e?e:n.localName]=o)}}function $p(t,e){return function(r,n,i){t.call(void 0!==e?e:this,r,n,i),i[i.length-1].node.appendChild(r)}}function tf(t,e){var r=t;return function(t,n,i){var o=n[n.length-1].node,a=r;return void 0===a&&(a=i),Xp(void 0!==e?e:o.namespaceURI,a)}}var ef=tf();function rf(t,e){for(var r=e.length,n=new Array(r),i=0;i<r;++i)n[i]=t[e[i]];return n}function nf(t,e,r){var n,i,o=void 0!==r?r:{};for(n=0,i=t.length;n<i;++n)o[t[n]]=e;return o}function of(t,e,r,n){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var a=o[i.localName];void 0!==a&&a.call(n,i,r)}}}function af(t,e,r,n,i){return n.push(t),of(e,r,n,i),n.pop()}function sf(t,e,r,n,i,o,a){return i.push(t),function(t,e,r,n,i,o){for(var a,s,l=(void 0!==i?i:r).length,u=0;u<l;++u)void 0!==(a=r[u])&&void 0!==(s=e.call(void 0!==o?o:this,a,n,void 0!==i?i[u]:void 0))&&t[s.namespaceURI][s.localName].call(o,s,a,n)}(e,r,n,i,o,a),i.pop()}var lf=void 0;var uf=void 0;function hf(){return void 0===uf&&"undefined"!=typeof document&&(uf=document.implementation.createDocument("","",null)),uf}var cf=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pf=function(t){function r(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===lf&&"undefined"!=typeof XMLSerializer&&(lf=new XMLSerializer),lf),e}return cf(r,t),r.prototype.getType=function(){return Hs},r.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var r=Zp(t);return this.readFeatureFromDocument(r,e)}return Kp(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},r.prototype.readFeatureFromDocument=function(t,e){var r=this.readFeaturesFromDocument(t,e);return r.length>0?r[0]:null},r.prototype.readFeatureFromNode=function(t,e){return null},r.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var r=Zp(t);return this.readFeaturesFromDocument(r,e)}return Kp(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},r.prototype.readFeaturesFromDocument=function(t,e){for(var r=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&d(r,this.readFeaturesFromNode(n,e));return r},r.prototype.readFeaturesFromNode=function(t,r){return e()},r.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var r=Zp(t);return this.readGeometryFromDocument(r,e)}return Kp(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},r.prototype.readGeometryFromDocument=function(t,e){return null},r.prototype.readGeometryFromNode=function(t,e){return null},r.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Zp(t);return this.readProjectionFromDocument(e)}return Kp(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},r.prototype.readProjectionFromDocument=function(t){return this.dataProjection},r.prototype.readProjectionFromNode=function(t){return this.dataProjection},r.prototype.writeFeature=function(t,e){var r=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeFeatureNode=function(t,e){return null},r.prototype.writeFeatures=function(t,e){var r=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeFeaturesNode=function(t,e){return null},r.prototype.writeGeometry=function(t,e){var r=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(r)},r.prototype.writeGeometryNode=function(t,e){return null},r}(Fp),ff=pf;function df(t){var e,r=Wp(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(r))?void 0!==e[1]||!1:void 0}function gf(t){var e,r=Wp(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(r))?parseFloat(e[1]):void 0}function _f(t){return Wp(t,!1).trim()}function yf(t,e){mf(t,e?"1":"0")}function vf(t,e){var r=e.toPrecision();t.appendChild(hf().createTextNode(r))}function mf(t,e){t.appendChild(hf().createTextNode(e))}var xf,wf,Sf,Cf,Ef,Tf,bf,Rf,Pf,Of=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ff=["http://www.google.com/kml/ext/2.2"],If=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],Lf={fraction:es,pixels:rs,insetPixels:rs},Mf=nf(If,{ExtendedData:Rd,Region:Pd,MultiGeometry:Qp(vd,"geometry"),LineString:Qp(gd,"geometry"),LinearRing:Qp(_d,"geometry"),Point:Qp(md,"geometry"),Polygon:Qp(wd,"geometry"),Style:Qp(Cd),StyleMap:function(t,e){var r=ed.call(this,t,e);if(!r)return;var n=e[e.length-1];Array.isArray(r)?n.Style=r:"string"==typeof r?n.styleUrl=r:nt(!1,38)},address:Qp(_f),description:Qp(_f),name:Qp(_f),open:Qp(df),phoneNumber:Qp(_f),styleUrl:Qp(Qf),visibility:Qp(df)},nf(Ff,{MultiTrack:Qp((function(t,e){var r=af([],ld,t,e);if(!r)return;return new Jh(r)}),"geometry"),Track:Qp(hd,"geometry")})),Af=nf(If,{ExtendedData:Rd,Region:Pd,Link:function(t,e){of(Df,t,e)},address:Qp(_f),description:Qp(_f),name:Qp(_f),open:Qp(df),phoneNumber:Qp(_f),visibility:Qp(df)}),Df=nf(If,{href:Qp(Jf)}),kf=nf(If,{LatLonAltBox:function(t,e){var r=af({},Id,t,e);if(!r)return;var n=e[e.length-1],i=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];n.extent=i,n.altitudeMode=r.altitudeMode,n.minAltitude=parseFloat(r.minAltitude),n.maxAltitude=parseFloat(r.maxAltitude)},Lod:function(t,e){var r=af({},Ld,t,e);if(!r)return;var n=e[e.length-1];n.minLodPixels=parseFloat(r.minLodPixels),n.maxLodPixels=parseFloat(r.maxLodPixels),n.minFadeExtent=parseFloat(r.minFadeExtent),n.maxFadeExtent=parseFloat(r.maxFadeExtent)}}),jf=nf(If,["Document","Placemark"]),Gf=nf(If,{Document:$p((function(t,e,r){sf({node:t},jd,Gd,e,r,void 0,this)})),Placemark:$p(lg)}),Nf=null,Bf=null,zf=null,Uf=null,Vf=null,Xf=null;function Wf(t){return 32/Math.min(t[0],t[1])}function Yf(t){return t}var Kf=function(t){function e(e){var r=t.call(this)||this,n=e||{};return Xf||(Nf=new Un({color:xf=[255,255,255,1]}),Tf="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Bf=new ms({anchor:wf=[20,2],anchorOrigin:ns,anchorXUnits:Sf=rs,anchorYUnits:Cf=rs,crossOrigin:"anonymous",rotation:0,scale:Wf(Ef=[64,64]),size:Ef,src:Tf}),bf="NO_IMAGE",zf=new Hn({color:xf,width:1}),Rf=new Hn({color:[51,51,51,1],width:2}),Uf=new lo({font:"bold 16px Helvetica",fill:Nf,stroke:Rf,scale:.8}),Vf=new io({fill:Nf,image:Bf,text:Uf,stroke:zf,zIndex:0}),Xf=[Vf]),r.dataProjection=Er("EPSG:4326"),r.defaultStyle_=n.defaultStyle?n.defaultStyle:Xf,r.extractStyles_=void 0===n.extractStyles||n.extractStyles,r.writeStyles_=void 0===n.writeStyles||n.writeStyles,r.sharedStyles_={},r.showPointNames_=void 0===n.showPointNames||n.showPointNames,r.crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r.iconUrlFunction_=n.iconUrlFunction?n.iconUrlFunction:Yf,r.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],r}return Of(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var r=af([],nf(If,{Document:Hp(this.readDocumentOrFolder_,this),Folder:Hp(this.readDocumentOrFolder_,this),Placemark:qp(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return r||void 0},e.prototype.readPlacemark_=function(t,e){var r=af({geometry:null},Mf,t,e,this);if(r){var n=new at,i=t.getAttribute("id");null!==i&&n.setId(i);var o=e[0],a=r.geometry;if(a&&Ip(a,!1,o),n.setGeometry(a),delete r.geometry,this.extractStyles_){var s=function(t,e,r,n,i){return function(o,a){var s=i,l="",u=[];if(s){var h=o.getGeometry();if(h){var c=h.getType();c===vt?(u=h.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ct||e===gt})),s=u.length>0):s=c===ct||c===gt}}s&&(l=o.get("name"),(s=s&&!!l)&&l.search(/&[^&]+;/)>-1&&(Pf||(Pf=document.createElement("textarea")),Pf.innerHTML=l,l=Pf.value));var p=r;if(t?p=t:e&&(p=Zf(e,r,n)),s){var f=function(t,e){var r=[0,0],n="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var a=i.getScaleArray(),s=i.getAnchor();r[0]=a[0]*(o[0]-s[0]),r[1]=a[1]*(o[1]/2-s[1]),n="left"}}var l=t.getText();l?((l=l.clone()).setFont(l.getFont()||Uf.getFont()),l.setScale(l.getScale()||Uf.getScale()),l.setFill(l.getFill()||Uf.getFill()),l.setStroke(l.getStroke()||Rf)):l=Uf.clone();return l.setText(e),l.setOffsetX(r[0]),l.setOffsetY(r[1]),l.setTextAlign(n),new io({image:i,text:l})}(p[0],l);return u.length>0?(f.setGeometry(new Gp(u)),[f,new io({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):f}return p}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(s)}return delete r.Style,n.setProperties(r,!0),n}},e.prototype.readSharedStyle_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=Cd.call(this,t,e);if(n){var i=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readSharedStyleMap_=function(t,e){var r=t.getAttribute("id");if(null!==r){var n=ed.call(this,t,e);if(n){var i,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+r,o).href;else i="#"+r;this.sharedStyles_[i]=n}}},e.prototype.readFeatureFromNode=function(t,e){if(!c(If,t.namespaceURI))return null;var r=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return r||null},e.prototype.readFeaturesFromNode=function(t,e){if(!c(If,t.namespaceURI))return[];var r,n=t.localName;if("Document"==n||"Folder"==n)return(r=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==n){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){r=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var a=this.readFeaturesFromNode(o,e);a&&d(r,a)}return r}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Zp(t);return this.readNameFromDocument(e)}return Kp(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}},e.prototype.readNameFromDocument=function(t){for(var e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){var r=this.readNameFromNode(e);if(r)return r}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(c(If,e.namespaceURI)&&"name"==e.localName)return _f(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var r=e.localName;if(c(If,e.namespaceURI)&&("Document"==r||"Folder"==r||"Placemark"==r||"kml"==r)){var n=this.readNameFromNode(e);if(n)return n}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var r=Zp(t);d(e,this.readNetworkLinksFromDocument(r))}else Kp(t)?d(e,this.readNetworkLinksFromDocument(t)):d(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&d(e,this.readNetworkLinksFromNode(r));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(c(If,r.namespaceURI)&&"NetworkLink"==r.localName){var n=af({},Af,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!c(If,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||d(e,this.readNetworkLinksFromNode(r))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var r=Zp(t);d(e,this.readRegionFromDocument(r))}else Kp(t)?d(e,this.readRegionFromDocument(t)):d(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&d(e,this.readRegionFromNode(r));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],r=t.firstElementChild;r;r=r.nextElementSibling)if(c(If,r.namespaceURI)&&"Region"==r.localName){var n=af({},kf,r,[]);e.push(n)}for(r=t.firstElementChild;r;r=r.nextElementSibling){var i=r.localName;!c(If,r.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||d(e,this.readRegionFromNode(r))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var r=Xp(If[4],"kml"),n="http://www.w3.org/2000/xmlns/";r.setAttributeNS(n,"xmlns:gx",Ff[0]),r.setAttributeNS(n,"xmlns:xsi",Vp),r.setAttributeNS(Vp,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:r},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var a=jf[r.namespaceURI],s=rf(o,a);return sf(i,Gf,ef,s,[e],a,this),r},e}(ff);function Zf(t,e,r){return Array.isArray(t)?t:"string"==typeof t?Zf(r[t],e,r):e}function Hf(t){var e=Wp(t,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(r){var n=r[1];return[parseInt(n.substr(6,2),16),parseInt(n.substr(4,2),16),parseInt(n.substr(2,2),16),parseInt(n.substr(0,2),16)/255]}}function qf(t){var e=Wp(t,!1),r=[];e=e.replace(/\s*,\s*/g,",");for(var n,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;n=i.exec(e);){var o=parseFloat(n[1]),a=parseFloat(n[2]),s=n[3]?parseFloat(n[3]):0;r.push(o,a,s),e=e.substr(n[0].length)}if(""===e)return r}function Jf(t){var e=Wp(t,!1).trim(),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function Qf(t){var e=Wp(t,!1).trim().replace(/^(?!.*#)/,"#"),r=t.baseURI;return r&&"about:blank"!=r||(r=window.location.href),r?new URL(e,r).href:e}function $f(t){return gf(t)}var td=nf(If,{Pair:function(t,e){var r=af({},Od,t,e,this);if(!r)return;var n=r.key;if(n&&"normal"==n){var i=r.styleUrl;i&&(e[e.length-1]=i);var o=r.Style;o&&(e[e.length-1]=o)}}});function ed(t,e){return af(void 0,td,t,e,this)}var rd=nf(If,{Icon:Qp((function(t,e){var r=af({},cd,t,e);return r||null})),color:Qp(Hf),heading:Qp(gf),hotSpot:Qp((function(t){var e,r=t.getAttribute("xunits"),n=t.getAttribute("yunits");return e="insetPixels"!==r?"insetPixels"!==n?ns:os:"insetPixels"!==n?is:as,{x:parseFloat(t.getAttribute("x")),xunits:Lf[r],y:parseFloat(t.getAttribute("y")),yunits:Lf[n],origin:e}})),scale:Qp($f)});var nd=nf(If,{color:Qp(Hf),scale:Qp($f)});var id=nf(If,{color:Qp(Hf),width:Qp(gf)});var od=nf(If,{color:Qp(Hf),fill:Qp(df),outline:Qp(df)});var ad=nf(If,{coordinates:Jp(qf)});function sd(t,e){return af(null,ad,t,e)}var ld=nf(Ff,{Track:qp(hd)});var ud=nf(If,{when:function(t,e){var r=e[e.length-1].whens,n=Wp(t,!1),i=Date.parse(n);r.push(isNaN(i)?0:i)}},nf(Ff,{coord:function(t,e){var r=e[e.length-1].coordinates,n=Wp(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(i){var o=parseFloat(i[1]),a=parseFloat(i[2]),s=parseFloat(i[3]);r.push([o,a,s])}else r.push([])}}));function hd(t,e){var r=af({coordinates:[],whens:[]},ud,t,e);if(r){for(var n=[],i=r.coordinates,o=r.whens,a=0,s=Math.min(i.length,o.length);a<s;++a)3==i[a].length&&n.push(i[a][0],i[a][1],i[a][2],o[a]);return new Zn(n,ht)}}var cd=nf(If,{href:Qp(Jf)},nf(Ff,{x:Qp(gf),y:Qp(gf),w:Qp(gf),h:Qp(gf)}));var pd=nf(If,{coordinates:Jp(qf)});function fd(t,e){return af(null,pd,t,e)}var dd=nf(If,{extrude:Qp(df),tessellate:Qp(df),altitudeMode:Qp(_f)});function gd(t,e){var r=af({},dd,t,e),n=fd(t,e);if(n){var i=new Zn(n,lt);return i.setProperties(r,!0),i}}function _d(t,e){var r=af({},dd,t,e),n=fd(t,e);if(n){var i=new An(n,lt,[n.length]);return i.setProperties(r,!0),i}}var yd=nf(If,{LineString:qp(gd),LinearRing:qp(_d),MultiGeometry:qp(vd),Point:qp(md),Polygon:qp(wd)});function vd(t,e){var r,n=af([],yd,t,e);if(!n)return null;if(0===n.length)return new Gp(n);for(var i=!0,o=n[0].getType(),a=1,s=n.length;a<s;++a)if(n[a].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if(o==ct){var h=n[0];l=h.getLayout(),u=h.getFlatCoordinates();for(a=1,s=n.length;a<s;++a)d(u,n[a].getFlatCoordinates());Ed(r=new tc(u,l),n)}else o==pt?Ed(r=new Jh(n),n):o==dt?Ed(r=new ic(n),n):o==vt?r=new Gp(n):nt(!1,37)}else r=new Gp(n);return r}function md(t,e){var r=af({},dd,t,e),n=fd(t,e);if(n){var i=new mn(n,lt);return i.setProperties(r,!0),i}}var xd=nf(If,{innerBoundaryIs:function(t,e){var r=af([],Md,t,e);if(r.length>0){var n=e[e.length-1];n.push.apply(n,r)}},outerBoundaryIs:function(t,e){var r=af(void 0,Ad,t,e);if(r){e[e.length-1][0]=r}}});function wd(t,e){var r=af({},dd,t,e),n=af([null],xd,t,e);if(n&&n[0]){for(var i=n[0],o=[i.length],a=1,s=n.length;a<s;++a)d(i,n[a]),o.push(i.length);var l=new An(i,lt,o);return l.setProperties(r,!0),l}}var Sd=nf(If,{IconStyle:function(t,e){var r=af({},rd,t,e);if(r){var n,i,o,a,s=e[e.length-1],l="Icon"in r?r.Icon:{},u=!("Icon"in r)||Object.keys(l).length>0,h=l.href;h?n=h:u&&(n=Tf);var c,p=ns,f=r.hotSpot;f?(i=[f.x,f.y],o=f.xunits,a=f.yunits,p=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(n)&&(/pushpin/.test(n)?(i=wf,o=Sf,a=Cf):/arrow-reverse/.test(n)?(i=[54,42],o=Sf,a=Cf):/paddle/.test(n)&&(i=[32,1],o=Sf,a=Cf));var d,g=l.x,_=l.y;void 0!==g&&void 0!==_&&(c=[g,_]);var y,v=l.w,m=l.h;void 0!==v&&void 0!==m&&(d=[v,m]);var x=r.heading;void 0!==x&&(y=je(x));var w=r.scale,S=r.color;if(u){n==Tf&&(d=Ef);var C=new ms({anchor:i,anchorOrigin:p,anchorXUnits:o,anchorYUnits:a,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:ns,rotation:y,scale:w,size:d,src:this.iconUrlFunction_(n),color:S}),E=C.getScaleArray()[0],T=C.getSize();if(null===T){var b=C.getImageState();if(b===qn||b===Jn){var R=function(){var t=C.getImageState();if(t!==qn&&t!==Jn){var e=C.getSize();if(e&&2==e.length){var r=Wf(e);C.setScale(E*r)}C.unlistenImageChange(R)}};C.listenImageChange(R),b===qn&&C.load()}}else if(2==T.length){var P=Wf(T);C.setScale(E*P)}s.imageStyle=C}else s.imageStyle=bf}},LabelStyle:function(t,e){var r=af({},nd,t,e);if(r){var n=e[e.length-1],i=new lo({fill:new Un({color:"color"in r?r.color:xf}),scale:r.scale});n.textStyle=i}},LineStyle:function(t,e){var r=af({},id,t,e);if(r){var n=e[e.length-1],i=new Hn({color:"color"in r?r.color:xf,width:"width"in r?r.width:1});n.strokeStyle=i}},PolyStyle:function(t,e){var r=af({},od,t,e);if(r){var n=e[e.length-1],i=new Un({color:"color"in r?r.color:xf});n.fillStyle=i;var o=r.fill;void 0!==o&&(n.fill=o);var a=r.outline;void 0!==a&&(n.outline=a)}}});function Cd(t,e){var r=af({},Sd,t,e,this);if(!r)return null;var n,i="fillStyle"in r?r.fillStyle:Nf,o=r.fill;void 0===o||o||(i=null),"imageStyle"in r?r.imageStyle!=bf&&(n=r.imageStyle):n=Bf;var a="textStyle"in r?r.textStyle:Uf,s="strokeStyle"in r?r.strokeStyle:zf,l=r.outline;return void 0===l||l?[new io({fill:i,image:n,stroke:s,text:a,zIndex:void 0})]:[new io({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===vt?new Gp(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==dt&&e!==yt}))):r!==dt&&r!==yt?e:void 0},fill:i,image:n,stroke:s,text:a,zIndex:void 0}),new io({geometry:function(t){var e=t.getGeometry(),r=e.getType();return r===vt?new Gp(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===dt||e===yt}))):r===dt||r===yt?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function Ed(t,e){var r,n,i,o=e.length,a=new Array(e.length),s=new Array(e.length),l=new Array(e.length);r=!1,n=!1,i=!1;for(var u=0;u<o;++u){var h=e[u];a[u]=h.get("extrude"),s[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),r=r||void 0!==a[u],n=n||void 0!==s[u],i=i||l[u]}r&&t.set("extrude",a),n&&t.set("tessellate",s),i&&t.set("altitudeMode",l)}var Td=nf(If,{displayName:Qp(_f),value:Qp(_f)});var bd=nf(If,{Data:function(t,e){var r=t.getAttribute("name");of(Td,t,e);var n=e[e.length-1];r&&n.displayName?n[r]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==r?n[r]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){of(Fd,t,e)}});function Rd(t,e){of(bd,t,e)}function Pd(t,e){of(kf,t,e)}var Od=nf(If,{Style:Qp(Cd),key:Qp(_f),styleUrl:Qp(Qf)});var Fd=nf(If,{SimpleData:function(t,e){var r=t.getAttribute("name");if(null!==r){var n=_f(t);e[e.length-1][r]=n}}});var Id=nf(If,{altitudeMode:Qp(_f),minAltitude:Qp(gf),maxAltitude:Qp(gf),north:Qp(gf),south:Qp(gf),east:Qp(gf),west:Qp(gf)});var Ld=nf(If,{minLodPixels:Qp(gf),maxLodPixels:Qp(gf),minFadeExtent:Qp(gf),maxFadeExtent:Qp(gf)});var Md=nf(If,{LinearRing:qp(sd)});var Ad=nf(If,{LinearRing:Jp(sd)});function Dd(t,e){for(var r=pi(e),n=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]],i=0;i<4;++i){var o=Math.floor(n[i]).toString(16);n[i]=1==o.length?"0"+o:o}mf(t,n.join(""))}var kd=nf(If,{Data:$p((function(t,e,r){t.setAttribute("name",e.name);var n={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&sf(n,kd,ef,[i.displayName],r,["displayName"]),null!==i&&i.value&&sf(n,kd,ef,[i.value],r,["value"])):sf(n,kd,ef,[i],r,["value"])})),value:$p((function(t,e){mf(t,e)})),displayName:$p((function(t,e){!function(t,e){t.appendChild(hf().createCDATASection(e))}(t,e)}))});var jd=nf(If,{Placemark:$p(lg)}),Gd=function(t,e,r){return Xp(e[e.length-1].node.namespaceURI,"Placemark")};var Nd=tf("Data");var Bd=nf(If,["href"],nf(Ff,["x","y","w","h"])),zd=nf(If,{href:$p(mf)},nf(Ff,{x:$p(vf),y:$p(vf),w:$p(vf),h:$p(vf)})),Ud=function(t,e,r){return Xp(Ff[0],"gx:"+r)};var Vd=nf(If,["scale","heading","Icon","color","hotSpot"]),Xd=nf(If,{Icon:$p((function(t,e,r){var n={node:t},i=r[r.length-1].node,o=Bd[i.namespaceURI],a=rf(e,o);sf(n,zd,ef,a,r,o),a=rf(e,o=Bd[Ff[0]]),sf(n,zd,Ud,a,r,o)})),color:$p(Dd),heading:$p(vf),hotSpot:$p((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:$p(vg)});var Wd=nf(If,["color","scale"]),Yd=nf(If,{color:$p(Dd),scale:$p(vg)});var Kd=nf(If,["color","width"]),Zd=nf(If,{color:$p(Dd),width:$p(vf)});var Hd={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},qd=function(t,e,r){if(t)return Xp(e[e.length-1].node.namespaceURI,Hd[t.getType()])},Jd=tf("Point"),Qd=tf("LineString"),$d=tf("LinearRing"),tg=tf("Polygon"),eg=nf(If,{LineString:$p(cg),Point:$p(cg),Polygon:$p(_g),GeometryCollection:$p(rg)});function rg(t,e,r){var n,i={node:t},o=e.getType(),a=[];o===vt?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===gt?a=a.concat(t.getPoints()):e===_t?a=a.concat(t.getLineStrings()):e===yt?a=a.concat(t.getPolygons()):e===ct||e===pt||e===dt?a.push(t):nt(!1,39)})),n=qd):o===gt?(a=e.getPoints(),n=Jd):o===_t?(a=e.getLineStrings(),n=Qd):o===yt?(a=e.getPolygons(),n=tg):nt(!1,39),sf(i,eg,n,a,r)}var ng=nf(If,{LinearRing:$p(cg)});function ig(t,e,r){sf({node:t},ng,$d,[e],r)}var og=nf(If,{ExtendedData:$p((function(t,e,r){for(var n={node:t},i=e.names,o=e.values,a=i.length,s=0;s<a;s++)sf(n,kd,Nd,[{name:i[s],value:o[s]}],r)})),MultiGeometry:$p(rg),LineString:$p(cg),LinearRing:$p(cg),Point:$p(cg),Polygon:$p(_g),Style:$p((function(t,e,r){var n={node:t},i={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(i.LabelStyle=o);var a=e.pointStyles[0].getImage();a&&"function"==typeof a.getSrc&&(i.IconStyle=a)}if(e.lineStyles.length){(s=e.lineStyles[0].getStroke())&&(i.LineStyle=s)}if(e.polyStyles.length){var s;(s=e.polyStyles[0].getStroke())&&!i.LineStyle&&(i.LineStyle=s),i.PolyStyle=e.polyStyles[0]}var l=r[r.length-1].node,u=mg[l.namespaceURI],h=rf(i,u);sf(n,xg,ef,h,r,u)})),address:$p(mf),description:$p(mf),name:$p(mf),open:$p(yf),phoneNumber:$p(mf),styleUrl:$p(mf),visibility:$p(yf)}),ag=nf(If,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),sg=tf("ExtendedData");function lg(t,e,r){var n={node:t};e.getId()&&t.setAttribute("id",e.getId());var i=e.getProperties(),o={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};o[e.getGeometryName()]=1;var a=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),s=e.getStyleFunction();if(s){var l=s(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===vt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ct||e===gt})).length:n===ct||n===gt}}))),this.writeStyles_){var c=u,p=u;e.getGeometry()&&(c=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===vt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===_t})).length:n===pt||n===_t}})),p=u.filter((function(t){var r=t.getGeometryFunction()(e);if(r){var n=r.getType();return n===vt?r.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===dt||e===yt})).length:n===dt||n===yt}}))),i.Style={pointStyles:h,lineStyles:c,polyStyles:p}}if(h.length&&void 0===i.name){var f=h[0].getText();f&&(i.name=f.getText())}}}var d=r[r.length-1].node,g=ag[d.namespaceURI],_=rf(i,g);if(sf(n,og,ef,_,r,g),a.length>0){var y=rf(i,a);sf(n,og,sg,[{names:a,values:y}],r)}var v=r[0],m=e.getGeometry();m&&(m=Ip(m,!0,v)),sf(n,og,qd,[m],r)}var ug=nf(If,["extrude","tessellate","altitudeMode","coordinates"]),hg=nf(If,{extrude:$p(yf),tessellate:$p(yf),altitudeMode:$p(mf),coordinates:$p((function(t,e,r){var n,i=r[r.length-1],o=i.layout,a=i.stride;o==st||o==ut?n=2:o==lt||o==ht?n=3:nt(!1,34);var s=e.length,l="";if(s>0){l+=e[0];for(var u=1;u<n;++u)l+=","+e[u];for(var h=a;h<s;h+=a){l+=" "+e[h];for(u=1;u<n;++u)l+=","+e[h+u]}}mf(t,l)}))});function cg(t,e,r){var n=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=n;var a=r[r.length-1].node,s=ug[a.namespaceURI],l=rf(o,s);sf(i,hg,ef,l,r,s)}var pg=nf(If,["color","fill","outline"]),fg=nf(If,{outerBoundaryIs:$p(ig),innerBoundaryIs:$p(ig)}),dg=tf("innerBoundaryIs"),gg=tf("outerBoundaryIs");function _g(t,e,r){var n=e.getLinearRings(),i=n.shift(),o={node:t};sf(o,fg,dg,n,r),sf(o,fg,gg,[i],r)}var yg=nf(If,{color:$p(Dd),fill:$p(yf),outline:$p(yf)});function vg(t,e){vf(t,Math.round(1e6*e)/1e6)}var mg=nf(If,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),xg=nf(If,{IconStyle:$p((function(t,e,r){var n={node:t},i={},o=e.getSrc(),a=e.getSize(),s=e.getImageSize(),l={href:o};if(a){l.w=a[0],l.h=a[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&s&&0!==h[0]&&h[1]!==a[1]&&(l.x=h[0],l.y=s[1]-(h[1]+a[1])),u&&(u[0]!==a[0]/2||u[1]!==a[1]/2)){var c={x:u[0],xunits:rs,y:a[1]-u[1],yunits:rs};i.hotSpot=c}}i.Icon=l;var p=e.getScaleArray()[0],f=a;null===f&&(f=Ef),2==f.length&&(p/=Wf(f)),1!==p&&(i.scale=p);var d=e.getRotation();0!==d&&(i.heading=d);var g=e.getColor();g&&(i.color=g);var _=r[r.length-1].node,y=Vd[_.namespaceURI],v=rf(i,y);sf(n,Xd,ef,v,r,y)})),LabelStyle:$p((function(t,e,r){var n={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var a=e.getScale();a&&1!==a&&(i.scale=a);var s=r[r.length-1].node,l=Wd[s.namespaceURI],u=rf(i,l);sf(n,Yd,ef,u,r,l)})),LineStyle:$p((function(t,e,r){var n={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=r[r.length-1].node,a=Kd[o.namespaceURI],s=rf(i,a);sf(n,Zd,ef,s,r,a)})),PolyStyle:$p((function(t,e,r){var n={node:t},i=e.getFill(),o=e.getStroke(),a={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},s=r[r.length-1].node,l=pg[s.namespaceURI],u=rf(a,l);sf(n,yg,ef,u,r,l)}))});var wg=Kf,Sg={
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
read:function(t,e,r,n,i){var o,a,s=8*i-n-1,l=(1<<s)-1,u=l>>1,h=-7,c=r?i-1:0,p=r?-1:1,f=t[e+c];for(c+=p,o=f&(1<<-h)-1,f>>=-h,h+=s;h>0;o=256*o+t[e+c],c+=p,h-=8);for(a=o&(1<<-h)-1,o>>=-h,h+=n;h>0;a=256*a+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),o-=u}return(f?-1:1)*a*Math.pow(2,o-n)},write:function(t,e,r,n,i,o){var a,s,l,u=8*o-i-1,h=(1<<u)-1,c=h>>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(a++,l/=2),a+c>=h?(s=0,a=h):a+c>=1?(s=(e*l-1)*Math.pow(2,i),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+f]=255&s,f+=d,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;t[r+f]=255&a,f+=d,a/=256,u-=8);t[r+f-d]|=128*g}},Cg=Tg,Eg=Sg;function Tg(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Tg.Varint=0,Tg.Fixed64=1,Tg.Bytes=2,Tg.Fixed32=5;var bg=4294967296,Rg=1/bg,Pg="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Og(t){return t.type===Tg.Bytes?t.readVarint()+t.pos:t.pos+1}function Fg(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Ig(t,e,r){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(n);for(var i=r.pos-1;i>=t;i--)r.buf[i+n]=r.buf[i]}function Lg(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Mg(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Ag(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Dg(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function kg(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function jg(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Gg(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Ng(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function Bg(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function zg(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Ug(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function Vg(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}Tg.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var n=this.readVarint(),i=n>>3,o=this.pos;this.type=7&n,t(i,e,this),this.pos===o&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=zg(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Vg(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=zg(this.buf,this.pos)+zg(this.buf,this.pos+4)*bg;return this.pos+=8,t},readSFixed64:function(){var t=zg(this.buf,this.pos)+Vg(this.buf,this.pos+4)*bg;return this.pos+=8,t},readFloat:function(){var t=Eg.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Eg.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r,n=this.buf;return e=127&(r=n[this.pos++]),r<128?e:(e|=(127&(r=n[this.pos++]))<<7,r<128?e:(e|=(127&(r=n[this.pos++]))<<14,r<128?e:(e|=(127&(r=n[this.pos++]))<<21,r<128?e:function(t,e,r){var n,i,o=r.buf;if(i=o[r.pos++],n=(112&i)>>4,i<128)return Fg(t,n,e);if(i=o[r.pos++],n|=(127&i)<<3,i<128)return Fg(t,n,e);if(i=o[r.pos++],n|=(127&i)<<10,i<128)return Fg(t,n,e);if(i=o[r.pos++],n|=(127&i)<<17,i<128)return Fg(t,n,e);if(i=o[r.pos++],n|=(127&i)<<24,i<128)return Fg(t,n,e);if(i=o[r.pos++],n|=(1&i)<<31,i<128)return Fg(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(r=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Pg?function(t,e,r){return Pg.decode(t.subarray(e,r))}(this.buf,e,t):function(t,e,r){var n="",i=e;for(;i<r;){var o,a,s,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>r)break;1===h?l<128&&(u=l):2===h?128==(192&(o=t[i+1]))&&(u=(31&l)<<6|63&o)<=127&&(u=null):3===h?(o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&((u=(15&l)<<12|(63&o)<<6|63&a)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&((u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,n+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),n+=String.fromCharCode(u),i+=h}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Tg.Bytes)return t.push(this.readVarint(e));var r=Og(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Tg.Bytes)return t.push(this.readSVarint());var e=Og(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Tg.Bytes)return t.push(this.readBoolean());var e=Og(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Tg.Bytes)return t.push(this.readFloat());var e=Og(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Tg.Bytes)return t.push(this.readDouble());var e=Og(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Tg.Bytes)return t.push(this.readFixed32());var e=Og(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Tg.Bytes)return t.push(this.readSFixed32());var e=Og(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Tg.Bytes)return t.push(this.readFixed64());var e=Og(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Tg.Bytes)return t.push(this.readSFixed64());var e=Og(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===Tg.Varint)for(;this.buf[this.pos++]>127;);else if(e===Tg.Bytes)this.pos=this.readVarint()+this.pos;else if(e===Tg.Fixed32)this.pos+=4;else{if(e!==Tg.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var r=new Uint8Array(e);r.set(this.buf),this.buf=r,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Ug(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Ug(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Ug(this.buf,-1&t,this.pos),Ug(this.buf,Math.floor(t*Rg),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Ug(this.buf,-1&t,this.pos),Ug(this.buf,Math.floor(t*Rg),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var r,n;t>=0?(r=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(r=~(-t%4294967296))?r=r+1|0:(r=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,r){r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos++]=127&t|128,t>>>=7,r.buf[r.pos]=127&t}(r,0,e),function(t,e){var r=(7&t)<<4;if(e.buf[e.pos++]|=r|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var n,i,o=0;o<e.length;o++){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){n>56319||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):i=n;continue}if(n<56320){t[r++]=239,t[r++]=191,t[r++]=189,i=n;continue}n=i-55296<<10|n-56320|65536,i=null}else i&&(t[r++]=239,t[r++]=191,t[r++]=189,i=null);n<128?t[r++]=n:(n<2048?t[r++]=n>>6|192:(n<65536?t[r++]=n>>12|224:(t[r++]=n>>18|240,t[r++]=n>>12&63|128),t[r++]=n>>6&63|128),t[r++]=63&n|128)}return r}(this.buf,t,this.pos);var r=this.pos-e;r>=128&&Ig(e,r,this),this.pos=e-1,this.writeVarint(r),this.pos+=r},writeFloat:function(t){this.realloc(4),Eg.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Eg.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this);var n=this.pos-r;n>=128&&Ig(r,n,this),this.pos=r-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,r){this.writeTag(t,Tg.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Lg,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Mg,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,kg,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Ag,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Dg,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,jg,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Gg,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Ng,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Bg,e)},writeBytesField:function(t,e){this.writeTag(t,Tg.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Tg.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Tg.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Tg.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Tg.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Tg.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Tg.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Tg.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Tg.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Tg.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Xg=[1,0,0,1,0,0],Wg=function(){function t(t,e,r,n,i){this.styleFunction,this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r,this.properties_=n}return t.prototype.get=function(t){return this.properties_[t]},t.prototype.getExtent=function(){return this.extent_||(this.extent_=this.type_===ct?le(this.flatCoordinates_):ue(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_},t.prototype.getFlatInteriorPoint=function(){if(!this.flatInteriorPoints_){var t=me(this.getExtent());this.flatInteriorPoints_=Cn(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=ec(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=En(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Vn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_},t.prototype.getFlatMidpoints=function(){if(!this.flatMidpoints_){this.flatMidpoints_=[];for(var t=this.flatCoordinates_,e=0,r=this.ends_,n=0,i=r.length;n<i;++n){var o=r[n],a=Vn(t,e,o,2,.5);d(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_},t.prototype.getId=function(){return this.id_},t.prototype.getOrientedFlatCoordinates=function(){return this.flatCoordinates_},t.prototype.getGeometry=function(){return this},t.prototype.getSimplifiedGeometry=function(t){return this},t.prototype.simplifyTransformed=function(t,e){return this},t.prototype.getProperties=function(){return this.properties_},t.prototype.getStride=function(){return 2},t.prototype.getStyleFunction=function(){return this.styleFunction},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=Er(t)).getExtent(),r=t.getWorldExtent();if(e&&r){var n=Se(r)/Se(e);Gt(Xg,r[0],r[3],n,-n,0,0,0),Nr(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Xg,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();Wg.prototype.getEndss=Wg.prototype.getEnds,Wg.prototype.getFlatCoordinates=Wg.prototype.getOrientedFlatCoordinates;var Yg=Wg,Kg=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zg=function(t){function e(e){var r=t.call(this)||this,n=e||{};return r.dataProjection=new Fe({code:"",units:St.TILE_PIXELS}),r.featureClass_=n.featureClass?n.featureClass:Yg,r.geometryName_=n.geometryName,r.layerName_=n.layerName?n.layerName:"layer",r.layers_=n.layers?n.layers:null,r.idProperty_=n.idProperty,r.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],r}return Kg(e,t),e.prototype.readRawGeometry_=function(t,e,r,n){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,a=0,s=0,l=0,u=0,h=0;t.pos<i;){if(!a){var c=t.readVarint();o=7&c,a=c>>3}a--,1===o||2===o?(s+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(n.push(u),h=u),r.push(s,l),u+=2):7===o?u>h&&(r.push(r[h],r[h+1]),u+=2):nt(!1,59)}u>h&&(n.push(u),h=u)},e.prototype.createFeature_=function(t,e,r){var n,i=e.type;if(0===i)return null;var o,a=e.properties;this.idProperty_?(o=a[this.idProperty_],delete a[this.idProperty_]):o=e.id,a[this.layerName_]=e.layer.name;var s=[],l=[];this.readRawGeometry_(t,e,s,l);var u=function(t,e){var r;1===t?r=1===e?ct:gt:2===t?r=1===e?pt:_t:3===t&&(r=dt);return r}(i,l.length);if(this.featureClass_===Yg)(n=new this.featureClass_(u,s,l,a,o)).transform(r.dataProjection);else{var h=void 0;if(u==dt){for(var c=[],p=0,f=0,d=0,g=l.length;d<g;++d){var _=l[d];if(On(s,p,_,2)){if(0===c.length)continue;c[c.length-1].push(l[f])}else c.push(l.slice(f,d+1));f=d+1,p=_}h=c.length>1?new ic(s,st,c):new An(s,st,l)}else h=u===ct?new mn(s,st):u===pt?new Zn(s,st):u===dt?new An(s,st,l):u===gt?new tc(s,st):u===_t?new Jh(s,st,l):null;n=new(0,this.featureClass_),this.geometryName_&&n.setGeometryName(this.geometryName_);var y=Ip(h,!1,r);n.setGeometry(y),n.setId(o),n.setProperties(a,!0)}return n},e.prototype.getType=function(){return Ys},e.prototype.readFeatures=function(t,e){var r=this.layers_,n=this.adaptOptions(e),i=Er(n.dataProjection);i.setWorldExtent(n.extent),n.dataProjection=i;var o=new Cg(t),a=o.readFields(Hg,{}),s=[];for(var l in a)if(!r||-1!=r.indexOf(l)){var u=a[l],h=u?[0,0,u.extent,u.extent]:null;i.setExtent(h);for(var c=0,p=u.length;c<p;++c){var f=Qg(o,u,c);s.push(this.createFeature_(o,f,n))}}return s},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Fp);function Hg(t,e,r){if(3===t){var n={keys:[],values:[],features:[]},i=r.readVarint()+r.pos;r.readFields(qg,n,i),n.length=n.features.length,n.length&&(e[n.name]=n)}}function qg(t,e,r){if(15===t)e.version=r.readVarint();else if(1===t)e.name=r.readString();else if(5===t)e.extent=r.readVarint();else if(2===t)e.features.push(r.pos);else if(3===t)e.keys.push(r.readString());else if(4===t){for(var n=null,i=r.readVarint()+r.pos;r.pos<i;)n=1===(t=r.readVarint()>>3)?r.readString():2===t?r.readFloat():3===t?r.readDouble():4===t?r.readVarint64():5===t?r.readVarint():6===t?r.readSVarint():7===t?r.readBoolean():null;e.values.push(n)}}function Jg(t,e,r){if(1==t)e.id=r.readVarint();else if(2==t)for(var n=r.readVarint()+r.pos;r.pos<n;){var i=e.layer.keys[r.readVarint()],o=e.layer.values[r.readVarint()];e.properties[i]=o}else 3==t?e.type=r.readVarint():4==t&&(e.geometry=r.pos)}function Qg(t,e,r){t.pos=e.features[r];var n=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(Jg,i,n),i}var $g=Zg,t_=34962,e_=34963,r_=35044,n_=35048,i_=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function o_(t,e){for(var r=m({preserveDrawingBuffer:!0},e),n=i_.length,i=0;i<n;++i)try{var o=t.getContext(i_[i],r);if(o)return o}catch(t){}return null}var a_=r_,s_=function(){function t(t,e){this.array=null,this.type=t,nt(t===t_||t===e_,62),this.usage=void 0!==e?e:a_}return t.prototype.ofSize=function(t){this.array=new(l_(this.type))(t)},t.prototype.fromArray=function(t){var e=l_(this.type);this.array=e.from?e.from(t):new e(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(l_(this.type))(t)},t.prototype.getType=function(){return this.type},t.prototype.getArray=function(){return this.array},t.prototype.getUsage=function(){return this.usage},t.prototype.getSize=function(){return this.array?this.array.length:0},t}();function l_(t){switch(t){case t_:return Float32Array;case e_:return Uint32Array;default:return Float32Array}}var u_=s_,h_="webglcontextlost",c_="webglcontextrestored",p_=function(){function t(t){this.gl_=t.webGlContext;var e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();var r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(r);var n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n uniform float u_opacity;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,r),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(r){this.uniforms_.push({value:t.uniforms[r],location:e.getUniformLocation(this.renderTargetProgram_,r)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),r=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,r[0],r[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==r[0]||this.renderTargetTextureSize_[1]!==r[1]){this.renderTargetTextureSize_=r;var n=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,n,r[0],r[1],0,i,o,null),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}},t.prototype.apply=function(t,e,r,i){var o=this.getGL(),a=t.size;if(o.bindFramebuffer(o.FRAMEBUFFER,e?e.getFrameBuffer():null),o.activeTexture(o.TEXTURE0),o.bindTexture(o.TEXTURE_2D,this.renderTargetTexture_),!e){var s=n(o.canvas);if(!t.renderTargets[s]){var l=o.getContextAttributes();l&&l.preserveDrawingBuffer&&(o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT)),t.renderTargets[s]=!0}}o.enable(o.BLEND),o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA),o.viewport(0,0,o.drawingBufferWidth,o.drawingBufferHeight),o.bindBuffer(o.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),o.useProgram(this.renderTargetProgram_),o.enableVertexAttribArray(this.renderTargetAttribLocation_),o.vertexAttribPointer(this.renderTargetAttribLocation_,2,o.FLOAT,!1,0,0),o.uniform2f(this.renderTargetUniformLocation_,a[0],a[1]),o.uniform1i(this.renderTargetTextureLocation_,0);var u=t.layerStatesArray[t.layerIndex].opacity;o.uniform1f(this.renderTargetOpacityLocation_,u),this.applyUniforms(t),r&&r(o,t),o.drawArrays(o.TRIANGLES,0,6),i&&i(o,t)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=1;this.uniforms_.forEach((function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof ImageData)i.texture||(i.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+n]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),e instanceof ImageData?r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,e.width,e.height,0,r.UNSIGNED_BYTE,new Uint8Array(e.data)):r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e),r.uniform1i(i.location,n++);else if(Array.isArray(e))switch(e.length){case 2:return void r.uniform2f(i.location,e[0],e[1]);case 3:return void r.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void r.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(i.location,e)}))},t}(),f_=p_;function d_(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}var g_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),__="u_projectionMatrix",y_="u_offsetScaleMatrix",v_="u_offsetRotateMatrix",m_="u_time",x_="u_zoom",w_="u_resolution",S_={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},C_={};function E_(t){return"shared/"+t}var T_=0;var b_=function(t){function e(e){var r,n=t.call(this)||this,i=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvasCacheKey_=i.canvasCacheKey?E_(i.canvasCacheKey):(r="unique/"+T_,T_+=1,r),n.canvas_=function(t){var e=C_[t];if(!e){var r=document.createElement("canvas");r.style.position="absolute",r.style.left="0",e={users:0,canvas:r},C_[t]=e}return e.users+=1,e.canvas}(n.canvasCacheKey_),n.gl_=o_(n.canvas_),n.bufferCache_={},n.extensionCache_={},n.currentProgram_=null,n.canvas_.addEventListener(h_,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(c_,n.boundHandleWebGLContextRestored_),n.offsetRotateMatrix_=[1,0,0,1,0,0],n.offsetScaleMatrix_=[1,0,0,1,0,0],n.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.uniformLocations_={},n.attribLocations_={},n.uniforms_=[],i.uniforms&&n.setUniforms(i.uniforms);var o=n.getGL();return n.postProcessPasses_=i.postProcesses?i.postProcesses.map((function(t){return new f_({webGlContext:o,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new f_({webGlContext:o})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return g_(e,t),e.prototype.setUniforms=function(t){for(var e in this.uniforms_=[],t)this.uniforms_.push({name:e,value:t[e]});this.uniformLocations_={}},e.prototype.canvasCacheKeyMatches=function(t){return this.canvasCacheKey_===E_(t)},e.prototype.getExtension=function(t){if(t in this.extensionCache_)return this.extensionCache_[t];var e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e},e.prototype.bindBuffer=function(t){var e=this.getGL(),r=n(t),i=this.bufferCache_[r];i||(i={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[r]=i);e.bindBuffer(t.getType(),i.webGlBuffer)},e.prototype.flushBufferData=function(t){var e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())},e.prototype.deleteBuffer=function(t){var e=this.getGL(),r=n(t),i=this.bufferCache_[r];i&&!e.isContextLost()&&e.deleteBuffer(i.webGlBuffer),delete this.bufferCache_[r]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(h_,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(c_,this.boundHandleWebGLContextRestored_),function(t){var e=C_[t];if(e&&(e.users-=1,!(e.users>0))){var r=o_(e.canvas).getExtension("WEBGL_lose_context");r&&r.loseContext(),delete C_[t]}}(this.canvasCacheKey_),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,e){var r=this.getGL(),n=this.getCanvas(),i=t.size,o=t.pixelRatio;n.width=i[0]*o,n.height=i[1]*o,n.style.width=i[0]+"px",n.style.height=i[1]+"px",r.useProgram(this.currentProgram_);for(var a=this.postProcessPasses_.length-1;a>=0;a--)this.postProcessPasses_[a].init(t);r.bindTexture(r.TEXTURE_2D,null),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,e?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,r){var n=this.getGL(),i=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,i[0],i[1]),n.bindTexture(n.TEXTURE_2D,e.getTexture()),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,r?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var r=this.getGL();this.getExtension("OES_element_index_uint");var n=r.UNSIGNED_INT,i=e-t,o=4*t;r.drawElements(r.TRIANGLES,i,n,o)},e.prototype.finalizeDraw=function(t,e,r){for(var n=0,i=this.postProcessPasses_.length;n<i;n++)n===i-1?this.postProcessPasses_[n].apply(t,null,e,r):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,r=t.viewState.rotation,n=Mt(this.offsetScaleMatrix_);jt(n,2/e[0],2/e[1]);var i=Mt(this.offsetRotateMatrix_);0!==r&&function(t,e){var r=Math.cos(e),n=Math.sin(e);At(t,Dt(Lt,r,n,-n,r,0,0))}(i,-r),this.setUniformMatrixValue(y_,d_(this.tmpMat4_,n)),this.setUniformMatrixValue(v_,d_(this.tmpMat4_,i)),this.setUniformFloatValue(m_,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(x_,t.viewState.zoom),this.setUniformFloatValue(w_,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,r=this.getGL(),n=0;this.uniforms_.forEach(function(i){if((e="function"==typeof i.value?i.value(t):i.value)instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageData)i.texture||(i.prevValue=void 0,i.texture=r.createTexture()),r.activeTexture(r["TEXTURE"+n]),r.bindTexture(r.TEXTURE_2D,i.texture),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,r.LINEAR),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(!(e instanceof HTMLImageElement)||e.complete)&&i.prevValue!==e&&(i.prevValue=e,r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)),r.uniform1i(this.getUniformLocation(i.name),n++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,d_(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void r.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void r.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void r.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&r.uniform1f(this.getUniformLocation(i.name),e)}.bind(this))},e.prototype.useProgram=function(t){return t!=this.currentProgram_&&(this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},!0)},e.prototype.compileShader=function(t,e){var r=this.getGL(),n=r.createShader(e);return r.shaderSource(n,t),r.compileShader(n),n},e.prototype.getProgram=function(t,e){var r=this.getGL(),n=this.compileShader(t,r.FRAGMENT_SHADER),i=this.compileShader(e,r.VERTEX_SHADER),o=r.createProgram();if(r.attachShader(o,n),r.attachShader(o,i),r.linkProgram(o),!r.getShaderParameter(n,r.COMPILE_STATUS)){var a="Fragment shader compliation failed: "+r.getShaderInfoLog(n);throw new Error(a)}if(r.deleteShader(n),!r.getShaderParameter(i,r.COMPILE_STATUS)){a="Vertex shader compilation failed: "+r.getShaderInfoLog(i);throw new Error(a)}if(r.deleteShader(i),!r.getProgramParameter(o,r.LINK_STATUS)){a="GL program linking failed: "+r.getShaderInfoLog(i);throw new Error(a)}return o},e.prototype.getUniformLocation=function(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]},e.prototype.getAttributeLocation=function(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]},e.prototype.makeProjectionTransform=function(t,e){var r=t.size,n=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return Mt(e),Gt(e,0,0,2/(i*r[0]),2/(i*r[1]),-n,-o[0],-o[1]),e},e.prototype.setUniformFloatValue=function(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)},e.prototype.setUniformMatrixValue=function(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)},e.prototype.enableAttributeArray_=function(t,e,r,n,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,r,!1,n,i))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,r=0;r<t.length;r++){var n=t[r];e+=n.size*R_(n.type)}return e}(t),r=0,n=0;n<t.length;n++){var i=t[n];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,r),r+=i.size*R_(i.type)}},e.prototype.handleWebGLContextLost=function(){x(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,r){var n=this.getGL(),i=r||n.createTexture(),o=n.RGBA,a=n.RGBA,s=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,0,o,a,s,e):n.texImage2D(n.TEXTURE_2D,0,o,t[0],t[1],0,a,s,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i},e}(u);function R_(t){switch(t){case S_.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case S_.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case S_.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case S_.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var P_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),O_="GENERATE_BUFFERS",F_=function(t){function e(e,r){var n=t.call(this,e)||this,i=r||{};return n.inversePixelTransform_=[1,0,0,1,0,0],n.postProcesses_=i.postProcesses,n.uniforms_=i.uniforms,n.helper,e.addChangeListener(mo,n.removeHelper_.bind(n)),n.dispatchPreComposeEvent=n.dispatchPreComposeEvent.bind(n),n.dispatchPostComposeEvent=n.dispatchPostComposeEvent.bind(n),n}return P_(e,t),e.prototype.dispatchPreComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(Nn)){var n=new Ta(Nn,void 0,e,t);r.dispatchEvent(n)}},e.prototype.dispatchPostComposeEvent=function(t,e){var r=this.getLayer();if(r.hasListener(Bn)){var n=new Ta(Bn,void 0,e,t);r.dispatchEvent(n)}},e.prototype.reset=function(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)},e.prototype.removeHelper_=function(){this.helper&&(this.helper.dispose(),delete this.helper)},e.prototype.prepareFrame=function(t){if(this.getLayer().getSource()){for(var r=!0,n=-1,i=void 0,o=0,a=t.layerStatesArray.length;o<a;o++){var s=t.layerStatesArray[o].layer,l=s.getRenderer();if(l instanceof e){var u=s.getClassName();if((r||u!==i)&&(n+=1,r=!1),i=u,l===this)break}else r=!0}var h="map/"+t.mapId+"/group/"+n;this.helper&&this.helper.canvasCacheKeyMatches(h)||(this.helper&&this.helper.dispose(),this.helper=new b_({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:h}),i&&(this.helper.getCanvas().className=i),this.afterHelperCreated())}return this.prepareFrameInternal(t)},e.prototype.afterHelperCreated=function(){},e.prototype.prepareFrameInternal=function(t){return!0},e.prototype.disposeInternal=function(){this.removeHelper_(),t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e,r){var n=this.getLayer();if(n.hasListener(t)){Gt(this.inversePixelTransform_,0,0,r.pixelRatio,-r.pixelRatio,0,0,-r.size[1]);var i=new Ta(t,this.inversePixelTransform_,r,e);n.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(jn,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Gn,t,e)},e}(Ca);var I_=F_,L_=new Uint8Array(4),M_=function(){function t(t,e){this.helper_=t;var r=t.getGL();this.texture_=r.createTexture(),this.framebuffer_=r.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}return t.prototype.setSize=function(t){g(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())},t.prototype.getSize=function(){return this.size_},t.prototype.clearCachedData=function(){this.dataCacheDirty_=!0},t.prototype.readAll=function(){if(this.dataCacheDirty_){var t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_},t.prototype.readPixel=function(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return L_[0]=0,L_[1]=0,L_[2]=0,L_[3]=0,L_;this.readAll();var r=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return L_[0]=this.data_[4*r],L_[1]=this.data_[4*r+1],L_[2]=this.data_[4*r+2],L_[3]=this.data_[4*r+3],L_},t.prototype.getTexture=function(){return this.texture_},t.prototype.getFramebuffer=function(){return this.framebuffer_},t.prototype.updateSize_=function(){var t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)},t}();var A_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),D_=function(t){function e(e,r){var i=this,o=r.uniforms||{},a=[1,0,0,1,0,0];o[__]=a,(i=t.call(this,e,{uniforms:o,postProcesses:r.postProcesses})||this).sourceRevision_=-1,i.verticesBuffer_=new u_(t_,n_),i.hitVerticesBuffer_=new u_(t_,n_),i.indicesBuffer_=new u_(e_,n_),i.vertexShader_=r.vertexShader,i.fragmentShader_=r.fragmentShader,i.program_,i.hitDetectionEnabled_=!(!r.hitFragmentShader||!r.hitVertexShader),i.hitVertexShader_=r.hitVertexShader,i.hitFragmentShader_=r.hitFragmentShader,i.hitProgram_;var s,l,u=r.attributes?r.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:S_.FLOAT}})):[];i.attributes=[{name:"a_position",size:2,type:S_.FLOAT},{name:"a_index",size:1,type:S_.FLOAT}].concat(u),i.hitDetectionAttributes=[{name:"a_position",size:2,type:S_.FLOAT},{name:"a_index",size:1,type:S_.FLOAT},{name:"a_hitColor",size:4,type:S_.FLOAT},{name:"a_featureUid",size:1,type:S_.FLOAT}].concat(u),i.customAttributes=r.attributes?r.attributes:[],i.previousExtent_=[1/0,1/0,-1/0,-1/0],i.currentTransform_=a,i.renderTransform_=[1,0,0,1,0,0],i.invertRenderTransform_=[1,0,0,1,0,0],i.renderInstructions_=new Float32Array(0),i.hitRenderInstructions_=new Float32Array(0),i.hitRenderTarget_,i.worker_=(s=new Blob(['var e="function"==typeof Object.assign?Object.assign:function(e,n){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,o=arguments.length;r<o;++r){var i=arguments[r];if(null!=i)for(var f in i)i.hasOwnProperty(f)&&(t[f]=i[f])}return t},n="GENERATE_BUFFERS",t=[],r={vertexPosition:0,indexPosition:0};function o(e,n,t,r,o){e[n+0]=t,e[n+1]=r,e[n+2]=o}function i(e,n,i,f,s,u){var a=3+s,l=e[n+0],v=e[n+1],c=t;c.length=s;for(var g=0;g<c.length;g++)c[g]=e[n+2+g];var b=u?u.vertexPosition:0,h=u?u.indexPosition:0,d=b/a;return o(i,b,l,v,0),c.length&&i.set(c,b+3),o(i,b+=a,l,v,1),c.length&&i.set(c,b+3),o(i,b+=a,l,v,2),c.length&&i.set(c,b+3),o(i,b+=a,l,v,3),c.length&&i.set(c,b+3),b+=a,f[h++]=d,f[h++]=d+1,f[h++]=d+3,f[h++]=d+1,f[h++]=d+2,f[h++]=d+3,r.vertexPosition=b,r.indexPosition=h,r}var f=self;f.onmessage=function(t){var r=t.data;if(r.type===n){for(var o=r.customAttributesCount,s=2+o,u=new Float32Array(r.renderInstructions),a=u.length/s,l=4*a*(o+3),v=new Uint32Array(6*a),c=new Float32Array(l),g=null,b=0;b<u.length;b+=s)g=i(u,b,c,v,o,g);var h=e({vertexBuffer:c.buffer,indexBuffer:v.buffer,renderInstructions:u.buffer},r);f.postMessage(h,[c.buffer,v.buffer,u.buffer])}};'],{type:"application/javascript"}),l=URL.createObjectURL(s),new Worker(l)),i.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===O_){var r=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=r,Nt(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):this.renderInstructions_=new Float32Array(t.data.renderInstructions),this.getLayer().changed()}}.bind(i)),i.featureCache_={},i.featureCount_=0;var h=i.getLayer().getSource();return i.sourceListenKeys_=[N(h,Gs,i.handleSourceFeatureAdded_,i),N(h,Ns,i.handleSourceFeatureChanged_,i),N(h,zs,i.handleSourceFeatureDelete_,i),N(h,Bs,i.handleSourceFeatureClear_,i)],h.forEachFeature(function(t){this.featureCache_[n(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(i)),i}return A_(e,t),e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new M_(this.helper))},e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[n(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[n(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[n(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){var e=this.helper.getGL();this.preRender(e,t);var r=this.indicesBuffer_.getSize();this.helper.drawElements(0,r),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);var n=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer(),r=e.getSource(),n=t.viewState,i=!t.viewHints[qa]&&!t.viewHints[Ja],o=!he(this.previousExtent_,t.extent),a=this.sourceRevision_<r.getRevision();if(a&&(this.sourceRevision_=r.getRevision()),i&&(o||a)){var s=n.projection,l=n.resolution,u=e instanceof qo?e.getRenderBuffer():0,h=Qt(t.extent,u*l);r.loadFeatures(h,l,s),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),At(this.currentTransform_,this.invertRenderTransform_),this.helper.useProgram(this.program_),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0},e.prototype.rebuildBuffers_=function(t){var e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);var r,n,i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){var o=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===o||(this.hitRenderInstructions_=new Float32Array(o))}var a,s,l,u,h,c=[],p=[],f=0,d=0;for(var g in this.featureCache_)if((n=(r=this.featureCache_[g]).geometry)&&n.getType()===ct){c[0]=n.getFlatCoordinates()[0],c[1]=n.getFlatCoordinates()[1],kt(e,c),s=d+6,l=void 0,u=void 0,h=void 0,u=256,h=255,(l=p||[])[0]=Math.floor(s/u/u/u)/h,l[1]=Math.floor(s/u/u)%u/h,l[2]=Math.floor(s/u)%u/h,l[3]=s%u/h,a=l,this.renderInstructions_[f++]=c[0],this.renderInstructions_[f++]=c[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[d++]=c[0],this.hitRenderInstructions_[d++]=c[1],this.hitRenderInstructions_[d++]=a[0],this.hitRenderInstructions_[d++]=a[1],this.hitRenderInstructions_[d++]=a[2],this.hitRenderInstructions_[d++]=a[3],this.hitRenderInstructions_[d++]=Number(g));for(var _=void 0,y=0;y<this.customAttributes.length;y++)_=this.customAttributes[y].callback(r.feature,r.properties),this.renderInstructions_[f++]=_,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[d++]=_)}var v={type:O_,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(v.projectionTransform=e,this.worker_.postMessage(v,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){var m={type:O_,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};m.projectionTransform=e,m.hitDetection=!0,this.worker_.postMessage(m,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,n,i){if(nt(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=kt(e.coordinateToPixelTransform,t.slice()),a=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),s=function(t){var e=0,r=256,n=255;return e+=Math.round(t[0]*r*r*r*n),e+=Math.round(t[1]*r*r*n),e+=Math.round(t[2]*r*n),e+Math.round(t[3]*n)}([a[0]/255,a[1]/255,a[2]/255,a[3]/255]),l=this.hitRenderInstructions_[s],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?n(h,this.getLayer(),null):void 0}},e.prototype.renderHitDetection=function(t){if(this.hitVerticesBuffer_.getSize()){this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}},e.prototype.disposeInternal=function(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){z(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(I_),k_=D_,j_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),G_="blur",N_="gradient",B_="radius",z_=["#00f","#0ff","#0f0","#ff0","#f00"];var U_=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(r=t.call(this,i)||this).gradient_=null,r.addChangeListener(N_,r.handleGradientChanged_),r.setGradient(n.gradient?n.gradient:z_),r.setBlur(void 0!==n.blur?n.blur:15),r.setRadius(void 0!==n.radius?n.radius:8);var o=n.weight?n.weight:"weight";return r.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,r.setRenderOrder(null),r}return j_(e,t),e.prototype.getBlur=function(){return this.get(G_)},e.prototype.getGradient=function(){return this.get(N_)},e.prototype.getRadius=function(){return this.get(B_)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,r=256,n=_i(e,r),i=n.createLinearGradient(0,0,e,r),o=1/(t.length-1),a=0,s=t.length;a<s;++a)i.addColorStop(a*o,t[a]);return n.fillStyle=i,n.fillRect(0,0,e,r),n.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(G_,t)},e.prototype.setGradient=function(t){this.set(N_,t)},e.prototype.setRadius=function(t){this.set(B_,t)},e.prototype.createRenderer=function(){return new k_(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){var e=this.weightFunction_(t);return void 0!==e?Ie(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(B_)+this.get(G_))}.bind(this),u_blurSlope:function(){return this.get(B_)/Math.max(1,this.get(G_))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})},e.prototype.renderDeclutter=function(){},e}(qo),V_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),X_=function(t){function e(e){var r=e||{};return t.call(this,r)||this}return V_(e,t),e}(Oo),W_={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},Y_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),K_=function(t){function e(e){var r=t.call(this,e)||this;return r.image_=null,r}return Y_(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],r=t.pixelRatio,n=t.viewState,i=n.resolution,o=this.getLayer().getSource(),a=t.viewHints,s=t.extent;if(void 0!==e.extent&&(s=Ce(s,Gr(e.extent,n.projection))),!a[qa]&&!a[Ja]&&!Pe(s))if(o){var l=n.projection,u=o.getImage(s,i,r,l);u&&this.loadImage(u)&&(this.image_=u)}else this.image_=null;return!!this.image_},e.prototype.renderFrame=function(t,e){var r=this.image_,n=r.getExtent(),i=r.getResolution(),o=r.getPixelRatio(),a=t.layerStatesArray[t.layerIndex],s=t.pixelRatio,l=t.viewState,u=l.center,h=l.resolution,c=t.size,p=s*i/(h*o),f=Math.round(c[0]*s),d=Math.round(c[1]*s),g=l.rotation;if(g){var _=Math.round(Math.sqrt(f*f+d*d));f=_,d=_}Gt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,g,-f/2,-d/2),Nt(this.inversePixelTransform,this.pixelTransform);var y=Bt(this.pixelTransform);this.useContainer(e,y,a.opacity);var v=this.context,x=v.canvas;x.width!=f||x.height!=d?(x.width=f,x.height=d):this.containerReused||v.clearRect(0,0,f,d);var w=!1,S=!0;if(a.extent){var C=Gr(a.extent,l.projection);(w=(S=Re(C,t.extent))&&!re(C,t.extent))&&this.clipUnrotated(v,t,C)}var E=r.getImage(),T=Gt(this.tempTransform,f/2,d/2,p,p,0,o*(n[0]-u[0])/i,o*(u[1]-n[3])/i);this.renderedResolution=i*s/o;var b=E.width*T[0],R=E.height*T[3];if(this.getLayer().getSource().getInterpolate()||m(v,W_),this.preRender(v,t),S&&b>=.5&&R>=.5){var P=T[4],O=T[5],F=a.opacity,I=void 0;1!==F&&(I=v.globalAlpha,v.globalAlpha=F),v.drawImage(E,0,0,+E.width,+E.height,Math.round(P),Math.round(O),Math.round(b),Math.round(R)),1!==F&&(v.globalAlpha=I)}return this.postRender(v,t),w&&v.restore(),y!==x.style.transform&&(x.style.transform=y),this.container},e}(Pa),Z_=K_,H_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),q_=function(t){function e(e){return t.call(this,e)||this}return H_(e,t),e.prototype.createRenderer=function(){return new Z_(this)},e}(X_),J_=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Q_=function(t){function e(e){var r=t.call(this,e)||this;return r.extentChanged=!0,r.renderedExtent_=null,r.renderedPixelRatio,r.renderedProjection=null,r.renderedRevision,r.renderedTiles=[],r.newTiles_=!1,r.tmpExtent=[1/0,1/0,-1/0,-1/0],r.tmpTileRange_=new gp(0,0,0,0),r}return J_(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==nl||r==ol||r==il&&!n},e.prototype.getTile=function(t,e,r,n){var i=n.pixelRatio,o=n.viewState.projection,a=this.getLayer(),s=a.getSource().getTile(t,e,r,i,o);return s.getState()==il&&(a.getUseInterimTilesOnError()?a.getPreload()>0&&(this.newTiles_=!0):s.setState(nl)),this.isDrawableTile(s)||(s=s.getInterimTile()),s},e.prototype.loadedTileCallback=function(e,r,n){return!!this.isDrawableTile(n)&&t.prototype.loadedTileCallback.call(this,e,r,n)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var r=t.layerStatesArray[t.layerIndex],i=t.viewState,o=i.projection,a=i.resolution,s=i.center,l=i.rotation,u=t.pixelRatio,c=this.getLayer(),p=c.getSource(),f=p.getRevision(),d=p.getTileGridForProjection(o),g=d.getZForResolution(a,p.zDirection),_=d.getResolution(g),y=t.extent,v=r.extent&&Gr(r.extent);v&&(y=Ce(y,Gr(r.extent)));var x=p.getTilePixelRatio(u),w=Math.round(t.size[0]*x),S=Math.round(t.size[1]*x);if(l){var C=Math.round(Math.sqrt(w*w+S*S));w=C,S=C}var E=_*w/2/x,T=_*S/2/x,b=[s[0]-E,s[1]-T,s[0]+E,s[1]+T],R=d.getTileRangeForExtentAndZ(y,g),P={};P[g]={};var O=this.createLoadedTileFinder(p,o,P),F=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;for(var L=R.minX;L<=R.maxX;++L)for(var M=R.minY;M<=R.maxY;++M){var A=this.getTile(g,L,M,t);if(this.isDrawableTile(A)){var D=n(this);if(A.getState()==nl){P[g][A.tileCoord.toString()]=A;var k=A.inTransition(D);this.newTiles_||!k&&-1!==this.renderedTiles.indexOf(A)||(this.newTiles_=!0)}if(1===A.getAlpha(D,t.time))continue}var j=d.getTileCoordChildTileRange(A.tileCoord,I,F),G=!1;j&&(G=O(g+1,j)),G||d.forEachTileCoordParentTileRange(A.tileCoord,O,I,F)}var N=_/a;Gt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,l,-w/2,-S/2);var B=Bt(this.pixelTransform);this.useContainer(e,B,r.opacity,this.getBackground(t));var z=this.context,U=z.canvas;Nt(this.inversePixelTransform,this.pixelTransform),Gt(this.tempTransform,w/2,S/2,N,N,0,-w/2,-S/2),U.width!=w||U.height!=S?(U.width=w,U.height=S):this.containerReused||z.clearRect(0,0,w,S),v&&this.clipUnrotated(z,t,v),p.getInterpolate()||m(z,W_),this.preRender(z,t),this.renderedTiles.length=0;var V,X,W,Y=Object.keys(P).map(Number);Y.sort(h),1!==r.opacity||this.containerReused&&!p.getOpaque(t.viewState.projection)?(V=[],X=[]):Y=Y.reverse();for(var K=Y.length-1;K>=0;--K){var Z=Y[K],H=p.getTilePixelSize(Z,u,o),q=d.getResolution(Z)/_,J=H[0]*q*N,Q=H[1]*q*N,$=d.getTileCoordForCoordAndZ(Ee(b),Z),tt=d.getTileCoordExtent($),et=kt(this.tempTransform,[x*(tt[0]-b[0])/_,x*(b[3]-tt[3])/_]),rt=x*p.getGutterForProjection(o),nt=P[Z];for(var it in nt){var ot=(A=nt[it]).tileCoord,at=$[1]-ot[1],st=Math.round(et[0]-(at-1)*J),lt=$[2]-ot[2],ut=Math.round(et[1]-(lt-1)*Q),ht=st-(L=Math.round(et[0]-at*J)),ct=ut-(M=Math.round(et[1]-lt*Q)),pt=g===Z;if(!(k=pt&&1!==A.getAlpha(n(this),t.time)))if(V){z.save(),W=[L,M,L+ht,M,L+ht,M+ct,L,M+ct];for(var ft=0,dt=V.length;ft<dt;++ft)if(g!==Z&&Z<X[ft]){var gt=V[ft];z.beginPath(),z.moveTo(W[0],W[1]),z.lineTo(W[2],W[3]),z.lineTo(W[4],W[5]),z.lineTo(W[6],W[7]),z.moveTo(gt[6],gt[7]),z.lineTo(gt[4],gt[5]),z.lineTo(gt[2],gt[3]),z.lineTo(gt[0],gt[1]),z.clip()}V.push(W),X.push(Z)}else z.clearRect(L,M,ht,ct);this.drawTileImage(A,t,L,M,ht,ct,rt,pt),V&&!k?(z.restore(),this.renderedTiles.unshift(A)):this.renderedTiles.push(A),this.updateUsedTiles(t.usedTiles,p,A)}}this.renderedRevision=f,this.renderedResolution=_,this.extentChanged=!this.renderedExtent_||!he(this.renderedExtent_,b),this.renderedExtent_=b,this.renderedPixelRatio=u,this.renderedProjection=o,this.manageTilePyramid(t,p,d,u,o,y,g,c.getPreload()),this.scheduleExpireCache(t,p),this.postRender(z,t),r.extent&&z.restore(),B!==U.style.transform&&(U.style.transform=B);var _t=bi(r.opacity),yt=this.container;return _t!==yt.style.opacity&&(yt.style.opacity=_t),this.container},e.prototype.drawTileImage=function(t,e,r,i,o,a,s,l){var u=this.getTileImage(t);if(u){var h=n(this),c=l?t.getAlpha(h,e.time):1,p=c!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(u,s,s,u.width-2*s,u.height-2*s,r,i,o,a),p&&this.context.restore(),1!==c?e.animate=!0:l&&t.endTransition(h)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getTileImage=function(t){return t.getImage()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var r=function(t,e,r){var i=n(t);i in r.usedTiles&&t.expireCache(r.viewState.projection,r.usedTiles[i])}.bind(null,e);t.postRenderFunctions.push(r)}},e.prototype.updateUsedTiles=function(t,e,r){var i=n(e);i in t||(t[i]={}),t[i][r.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,r,i,o,a,s,l,u){var h=n(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,f,d,g,_,y=t.wantedTiles[h],v=t.tileQueue,m=0;for(_=r.getMinZoom();_<=s;++_)for(p=r.getTileRangeForExtentAndZ(a,_,p),f=r.getResolution(_),d=p.minX;d<=p.maxX;++d)for(g=p.minY;g<=p.maxY;++g)s-_<=l?(++m,(c=e.getTile(_,d,g,i,o)).getState()==el&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,h,r.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(_,d,g,o);e.updateCacheSize(m,o)},e}(Pa);Q_.prototype.getLayer;var $_=Q_,ty="image",ey="hybrid",ry="vector",ny=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iy={image:[Ma,Oa,La,Ia,Aa],hybrid:[Ma,La],vector:[]},oy={hybrid:[Ia,Aa,Fa],vector:[Ma,Oa,La,Ia,Aa,Fa]},ay=function(t){function e(e){var r=t.call(this,e)||this;return r.boundHandleStyleImageChange_=r.handleStyleImageChange_.bind(r),r.dirty_=!1,r.renderedLayerRevision_,r.renderedPixelToCoordinateTransform_=null,r.renderedRotation_,r.tmpTransform_=[1,0,0,1,0,0],r}return ny(e,t),e.prototype.prepareTile=function(t,e,r){var n,i=t.getState();return i!==nl&&i!==il||(this.updateExecutorGroup_(t,e,r),this.tileImageNeedsRender_(t)&&(n=!0)),n},e.prototype.getTile=function(e,r,n,i){var o=i.pixelRatio,a=i.viewState,s=a.resolution,l=a.projection,u=this.getLayer(),h=u.getSource().getTile(e,r,n,o,l),c=i.viewHints,p=!(c[qa]||c[Ja]);return!p&&h.wantedResolution||(h.wantedResolution=s),this.prepareTile(h,o,l)&&(p||Date.now()-i.time<8)&&u.getRenderMode()!==ry&&this.renderTileImage_(h,i),t.prototype.getTile.call(this,e,r,n,i)},e.prototype.isDrawableTile=function(e){var r=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(r.getRenderMode()===ry?n(r)in e.executorGroups:e.hasContext(r))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var r=this.getLayer().getRevision();return this.renderedLayerRevision_!=r&&(this.renderedTiles.length=0),this.renderedLayerRevision_=r,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,r){var i=this.getLayer(),o=i.getRevision(),a=i.getRenderOrder()||null,s=t.wantedResolution,l=t.getReplayState(i);if(l.dirty||l.renderedResolution!==s||l.renderedRevision!=o||l.renderedRenderOrder!=a){var u=i.getSource(),h=i.getDeclutter(),c=u.getTileGrid(),p=u.getTileGridForProjection(r).getTileCoordExtent(t.wrappedTileCoord),f=u.getSourceTiles(e,r,t),d=n(i);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],h&&(t.declutterExecutorGroups[d]=[]);for(var g=function(r,n){var o=f[r];if(o.getState()!=nl)return"continue";var g=o.tileCoord,y=c.getTileCoordExtent(g),v=Ce(p,y),m=Qt(v,i.getRenderBuffer()*s,_.tmpExtent),x=he(y,v)?null:m;l.dirty=!1;var w=new xa(0,m,s,e),S=h?new xa(0,v,s,e):void 0,C=Ts(s,e),E=function(t){var e,r=t.getStyleFunction()||i.getStyleFunction();if(r&&(e=r(t,s)),e){var n=this.renderFeature(t,C,e,w,S);this.dirty_=this.dirty_||n,l.dirty=l.dirty||n}},T=o.getFeatures();a&&a!==l.renderedRenderOrder&&T.sort(a);for(var b=0,R=T.length;b<R;++b){var P=T[b];x&&!Re(x,P.getGeometry().getExtent())||E.call(_,P)}var O=w.finish(),F=i.getRenderMode()!==ry&&h&&1===f.length?null:v,I=new Ha(F,s,e,u.getOverlaps(),O,i.getRenderBuffer());if(t.executorGroups[d].push(I),S){var L=new Ha(null,s,e,u.getOverlaps(),S.finish(),i.getRenderBuffer());t.declutterExecutorGroups[d].push(L)}},_=this,y=0,v=f.length;y<v;++y)g(y);l.renderedRevision=o,l.renderedRenderOrder=a,l.renderedResolution=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,r,i,o){var a=e.viewState.resolution,s=e.viewState.rotation;r=null==r?0:r;var l=this.getLayer(),u=l.getSource().getTileGridForProjection(e.viewState.projection),h=Jt([t]);Qt(h,a*r,h);for(var c,p={},f=function(t,e,r){var a=t.getId();void 0===a&&(a=n(t));var s=p[a];if(s){if(!0!==s&&r<s.distanceSq){if(0===r)return p[a]=!0,o.splice(o.lastIndexOf(s),1),i(t,l,e);s.geometry=e,s.distanceSq=r}}else{if(0===r)return p[a]=!0,i(t,l,e);o.push(p[a]={feature:t,layer:l,geometry:e,distanceSq:r,callback:i})}},d=this.renderedTiles,g=function(i,o){var p=d[i];if(!Re(u.getTileCoordExtent(p.wrappedTileCoord),h))return"continue";var g=n(l),_=[p.executorGroups[g]],y=p.declutterExecutorGroups[g];y&&_.push(y),_.some((function(n){for(var i=n===y?e.declutterTree.all().map((function(t){return t.value})):null,o=0,l=n.length;o<l;++o){var u=n[o];if(c=u.forEachFeatureAtCoordinate(t,a,s,r,f,i))return!0}}))},_=0,y=d.length;!c&&_<y;++_)g(_);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,r){for(var i,o=this.getLayer(),a=n(o),s=o.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=s.getTileGridForProjection(l),p=kt(this.renderedPixelToCoordinateTransform_,t.slice()),f=c.getTileCoordForCoordAndResolution(p,h),d=0,g=this.renderedTiles.length;d<g;++d)if(f.toString()===this.renderedTiles[d].tileCoord.toString()){if((i=this.renderedTiles[d]).getState()===nl){var _=c.getTileCoordExtent(i.tileCoord);s.getWrapX()&&l.canWrapX()&&!re(u,_)&&xr(p,l);break}i=void 0}if(!i||i.loadingSourceTiles>0)e([]);else{var y=Ee(c.getTileCoordExtent(i.wrappedTileCoord)),v=[(p[0]-y[0])/h,(y[1]-p[1])/h],m=i.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]),x=i.hitDetectionImageData[a];if(!x&&!this.animatingOrInteracting_){var w=ii(c.getTileSize(c.getZForResolution(h))),S=this.renderedRotation_;x=ws(w,[this.getRenderTransform(c.getTileCoordCenter(i.wrappedTileCoord),h,0,xs,w[0]*xs,w[1]*xs,0)],m,o.getStyleFunction(),c.getTileCoordExtent(i.wrappedTileCoord),i.getReplayState(o).renderedResolution,S),i.hitDetectionImageData[a]=x}e(Ss(v,m,x))}}.bind(this))},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.renderDeclutter=function(t){var e=this.context,r=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var i=t.viewHints,o=!(i[qa]||i[Ja]),a=this.renderedTiles,s=0,l=a.length;s<l;++s){var u=a[s],h=u.declutterExecutorGroups[n(this.getLayer())];if(h)for(var c=h.length-1;c>=0;--c)h[c].execute(this.context,1,this.getTileRenderTransform(u,t),t.viewState.rotation,o,void 0,t.declutterTree)}e.globalAlpha=r},e.prototype.getTileRenderTransform=function(t,e){var r=e.pixelRatio,n=e.viewState,i=n.center,o=n.resolution,a=n.rotation,s=e.size,l=Math.round(s[0]*r),u=Math.round(s[1]*r),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),c=t.tileCoord,p=h.getTileCoordExtent(t.wrappedTileCoord),f=h.getTileCoordExtent(c,this.tmpExtent)[0]-p[0];return At(jt(this.inversePixelTransform.slice(),1/r,1/r),this.getRenderTransform(i,o,a,r,l,u,f))},e.prototype.renderFrame=function(e,r){var i=e.viewHints,o=!(i[qa]||i[Ja]);t.prototype.renderFrame.call(this,e,r),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var a=this.getLayer(),s=a.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=a.getOpacity();for(var h=oy[s],c=e.viewState.rotation,p=this.renderedTiles,f=[],d=[],g=p.length-1;g>=0;--g)for(var _=p[g],y=this.getTileRenderTransform(_,e),v=_.executorGroups[n(a)],m=!1,x=0,w=v.length;x<w;++x){var S=v[x];if(S.hasExecutors(h)){var C=_.tileCoord[0],E=void 0;if(!m&&(E=S.getClipCoords(y))){l.save();for(var T=0,b=f.length;T<b;++T){var R=f[T];C<d[T]&&(l.beginPath(),l.moveTo(E[0],E[1]),l.lineTo(E[2],E[3]),l.lineTo(E[4],E[5]),l.lineTo(E[6],E[7]),l.moveTo(R[6],R[7]),l.lineTo(R[4],R[5]),l.lineTo(R[2],R[3]),l.lineTo(R[0],R[1]),l.clip())}}S.execute(l,1,y,c,o,h),!m&&E&&(l.restore(),f.push(E),d.push(C),m=!0)}}return l.globalAlpha=u,this.container},e.prototype.renderFeature=function(t,e,r,n,i){if(!r)return!1;var o=!1;if(Array.isArray(r))for(var a=0,s=r.length;a<s;++a)o=Rs(n,t,r[a],e,this.boundHandleStyleImageChange_,void 0,i)||o;else o=Rs(n,t,r,e,this.boundHandleStyleImageChange_,void 0,i);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===ry)return!1;var r=t.getReplayState(e),n=e.getRevision(),i=t.wantedResolution;return r.renderedTileResolution!==i||r.renderedTileRevision!==n},e.prototype.renderTileImage_=function(t,e){var r=this.getLayer(),i=t.getReplayState(r),o=r.getRevision(),a=t.executorGroups[n(r)];i.renderedTileRevision=o;var s=t.wrappedTileCoord,l=s[0],u=r.getSource(),h=e.pixelRatio,c=e.viewState.projection,p=u.getTileGridForProjection(c),f=p.getResolution(t.tileCoord[0]),d=e.pixelRatio/t.wantedResolution*f,g=p.getResolution(l),_=t.getContext(r);h=Math.round(Math.max(h,d/h));var y=u.getTilePixelSize(l,h,c);_.canvas.width=y[0],_.canvas.height=y[1];var v=h/d;if(1!==v){var m=Mt(this.tmpTransform_);jt(m,v,v),_.setTransform.apply(_,m)}var x=p.getTileCoordExtent(s,this.tmpExtent),w=d/g,S=Mt(this.tmpTransform_);jt(S,w,-w),function(t,e,r){At(t,Dt(Lt,1,0,0,1,e,r))}(S,-x[0],-x[3]);for(var C=0,E=a.length;C<E;++C){a[C].execute(_,v,S,0,!0,iy[r.getRenderMode()])}i.renderedTileResolution=t.wantedResolution},e}($_),sy=ay,ly="preload",uy="useInterimTilesOnError",hy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),cy=function(t){function e(e){var r=this,n=e||{},i=m({},n);delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,n.renderMode===ty&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),n.renderMode=void 0);var o=n.renderMode||ey;return nt(o==ey||o==ry,28),r.renderMode_=o,r.setPreload(n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r.getBackground,r.setBackground,r}return hy(e,t),e.prototype.createRenderer=function(){return new sy(this)},e.prototype.getFeatures=function(e){return t.prototype.getFeatures.call(this,e)},e.prototype.getRenderMode=function(){return this.renderMode_},e.prototype.getPreload=function(){return this.get(ly)},e.prototype.getUseInterimTilesOnError=function(){return this.get(uy)},e.prototype.setPreload=function(t){this.set(ly,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(uy,t)},e}(qo),py="tileloadstart",fy="tileloadend",dy="tileloaderror",gy=[0,0,0],_y=function(){function t(t){var e,r,n,i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,nt((e=this.resolutions_,r=!0,n=function(t,e){return e-t}||h,e.every((function(t,i){if(0===i)return!0;var o=n(e[i-1],t);return!(o>0||r&&0===o)}))),17),!t.origins)for(var o=0,a=this.resolutions_.length-1;o<a;++o)if(i){if(this.resolutions_[o]/this.resolutions_[o+1]!==i){i=void 0;break}}else i=this.resolutions_[o]/this.resolutions_[o+1];this.zoomFactor_=i,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,nt(this.origins_.length==this.resolutions_.length,20));var s=t.extent;void 0===s||this.origin_||this.origins_||(this.origin_=Ee(s)),nt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,nt(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Hl,nt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==s?s:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){var r=new gp(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(s){var n=this.getTileRangeForExtentAndZ(s,e);r.minX=Math.max(n.minX,r.minX),r.maxX=Math.min(n.maxX,r.maxX),r.minY=Math.max(n.minY,r.minY),r.maxY=Math.min(n.maxY,r.maxY)}return r}),this):s&&this.calculateTileRanges_(s)}return t.prototype.forEachTileCoord=function(t,e,r){for(var n=this.getTileRangeForExtentAndZ(t,e),i=n.minX,o=n.maxX;i<=o;++i)for(var a=n.minY,s=n.maxY;a<=s;++a)r([e,i,a])},t.prototype.forEachTileCoordParentTileRange=function(t,e,r,n){var i,o,a=null,s=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);s>=this.minZoom;){if(e(s,2===this.zoomFactor_?dp(i=Math.floor(i/2),i,o=Math.floor(o/2),o,r):this.getTileRangeForExtentAndZ(a,s,r)))return!0;--s}return!1},t.prototype.getExtent=function(){return this.extent_},t.prototype.getMaxZoom=function(){return this.maxZoom},t.prototype.getMinZoom=function(){return this.minZoom},t.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},t.prototype.getResolution=function(t){return this.resolutions_[t]},t.prototype.getResolutions=function(){return this.resolutions_},t.prototype.getTileCoordChildTileRange=function(t,e,r){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],i=2*t[2];return dp(n,n+1,i,i+1,e)}var o=this.getTileCoordExtent(t,r||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,r){if(e>this.maxZoom||e<this.minZoom)return null;var n=t[0],i=t[1],o=t[2];if(e===n)return dp(i,o,i,o,r);if(this.zoomFactor_){var a=Math.pow(this.zoomFactor_,e-n),s=Math.floor(i*a),l=Math.floor(o*a);return e<n?dp(s,s,l,l,r):dp(s,Math.floor(a*(i+1))-1,l,Math.floor(a*(o+1))-1,r)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,r)},t.prototype.getTileRangeExtent=function(t,e,r){var n=this.getOrigin(t),i=this.getResolution(t),o=ii(this.getTileSize(t),this.tmpSize_),a=n[0]+e.minX*o[0]*i,s=n[0]+(e.maxX+1)*o[0]*i;return ae(a,n[1]+e.minY*o[1]*i,s,n[1]+(e.maxY+1)*o[1]*i,r)},t.prototype.getTileRangeForExtentAndZ=function(t,e,r){var n=gy;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);var i=n[1],o=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),dp(i,n[1],o,n[2],r)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),r=this.getResolution(t[0]),n=ii(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*r,e[1]-(t[2]+.5)*n[1]*r]},t.prototype.getTileCoordExtent=function(t,e){var r=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=ii(this.getTileSize(t[0]),this.tmpSize_),o=r[0]+t[1]*i[0]*n,a=r[1]-(t[2]+1)*i[1]*n;return ae(o,a,o+i[0]*n,a+i[1]*n,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,r){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,r,n,i){var o=this.getZForResolution(r),a=r/this.getResolution(o),s=this.getOrigin(o),l=ii(this.getTileSize(o),this.tmpSize_),u=a*(t-s[0])/r/l[0],h=a*(s[1]-e)/r/l[1];return n?(u=Ve(u,5)-1,h=Ve(h,5)-1):(u=Ue(u,5),h=Ue(h,5)),op(o,u,h,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,r,n,i){var o=this.getOrigin(r),a=this.getResolution(r),s=ii(this.getTileSize(r),this.tmpSize_),l=(t-o[0])/a/s[0],u=(o[1]-e)/a/s[1];return n?(l=Ve(l,5)-1,u=Ve(u,5)-1):(l=Ue(l,5),u=Ue(u,5)),op(r,l,u,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,r){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,r)},t.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},t.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},t.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null},t.prototype.getZForResolution=function(t,e){return Ie(p(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,r=new Array(e),n=this.minZoom;n<e;++n)r[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=r},t}(),yy=_y;function vy(t){var e=t.getDefaultTileGrid();return e||(e=wy(t),t.setDefaultTileGrid(e)),e}function my(t){var e=t||{},r=e.extent||Er("EPSG:3857").getExtent(),n={extent:r,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:xy(r,e.maxZoom,e.tileSize,e.maxResolution)};return new yy(n)}function xy(t,e,r,n){for(var i=void 0!==e?e:42,o=Se(t),a=be(t),s=ii(void 0!==r?r:Hl),l=n>0?n:Math.max(a/s[0],o/s[1]),u=i+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function wy(t,e,r,n){return function(t,e,r,n){var i=void 0!==n?n:Vt,o=xy(t,e,r);return new yy({extent:t,origin:xe(t,i),resolutions:o,tileSize:r})}(Sy(t),e,r,n)}function Sy(t){var e=(t=Er(t)).getExtent();if(!e){var r=180*wt[St.DEGREES]/t.getMetersPerUnit();e=ae(-r,-r,r,r)}return e}var Cy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ey=function(t){function r(e){var r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||this;r.on,r.once,r.un,r.opaque_=void 0!==e.opaque&&e.opaque,r.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,r.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var n=e.tileGrid;return n&&ii(n.getTileSize(n.getMinZoom()),[256,256]),r.tileCache=new pp(e.cacheSize||0),r.tmpSize=[0,0],r.key_=e.key||"",r.tileOptions={transition:e.transition,interpolate:e.interpolate},r.zDirection=e.zDirection?e.zDirection:0,r}return Cy(r,t),r.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},r.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);r&&r.expireCache(e)},r.prototype.forEachLoadedTile=function(t,e,r,n){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,a,s,l=!0,u=r.minX;u<=r.maxX;++u)for(var h=r.minY;h<=r.maxY;++h)a=ap(e,u,h),s=!1,i.containsKey(a)&&(s=(o=i.get(a)).getState()===nl)&&(s=!1!==n(o)),s||(l=!1);return l},r.prototype.getGutterForProjection=function(t){return 0},r.prototype.getKey=function(){return this.key_},r.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},r.prototype.getOpaque=function(t){return this.opaque_},r.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},r.prototype.getTile=function(t,r,n,i,o){return e()},r.prototype.getTileGrid=function(){return this.tileGrid},r.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:vy(t)},r.prototype.getTileCacheForProjection=function(t){return nt(Pr(this.getProjection(),t),68),this.tileCache},r.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},r.prototype.getTilePixelSize=function(t,e,r){var n=this.getTileGridForProjection(r),i=this.getTilePixelRatio(e),o=ii(n.getTileSize(t),this.tmpSize);return 1==i?o:ni(o,i,this.tmpSize)},r.prototype.getTileCoordForTileUrlFunction=function(t,e){var r=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(r);return this.getWrapX()&&r.isGlobal()&&(t=function(t,e,r){var n=e[0],i=t.getTileCoordCenter(e),o=Sy(r);if(ee(o,i))return e;var a=be(o),s=Math.ceil((o[0]-i[0])/a);return i[0]+=a*s,t.getTileCoordForCoordAndZ(i,n)}(n,t,r)),function(t,e){var r=t[0],n=t[1],i=t[2];if(e.getMinZoom()>r||r>e.getMaxZoom())return!1;var o=e.getFullTileRange(r);return!o||o.containsXY(n,i)}(t,n)?t:null},r.prototype.clear=function(){this.tileCache.clear()},r.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},r.prototype.updateCacheSize=function(t,e){var r=this.getTileCacheForProjection(e);t>r.highWaterMark&&(r.highWaterMark=t)},r.prototype.useTile=function(t,e,r,n){},r}(js),Ty=function(t){function e(e,r){var n=t.call(this,e)||this;return n.tile=r,n}return Cy(e,t),e}(s),by=Ey;function Ry(t,e){var r=/\{z\}/g,n=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(a,s,l){return a?t.replace(r,a[0].toString()).replace(n,a[1].toString()).replace(i,a[2].toString()).replace(o,(function(){var t=a[0],r=e.getFullTileRange(t);return nt(r,55),(r.getHeight()-a[2]-1).toString()})):void 0}}function Py(t){return 1===t.length?t[0]:function(e,r,n){if(e){var i=Ge(up(e),t.length);return t[i](e,r,n)}}}var Oy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fy=function(t){function e(r){var n=t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,opaque:r.opaque,projection:r.projection,state:r.state,tileGrid:r.tileGrid,tilePixelRatio:r.tilePixelRatio,wrapX:r.wrapX,transition:r.transition,interpolate:r.interpolate,key:r.key,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this;return n.generateTileUrlFunction_=n.tileUrlFunction===e.prototype.tileUrlFunction,n.tileLoadFunction=r.tileLoadFunction,r.tileUrlFunction&&(n.tileUrlFunction=r.tileUrlFunction),n.urls=null,r.urls?n.setUrls(r.urls):r.url&&n.setUrl(r.url),n.tileLoadingKeys_={},n}return Oy(e,t),e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,r=t.target,i=n(r),o=r.getState();o==rl?(this.tileLoadingKeys_[i]=!0,e=py):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],e=o==il?dy:o==nl?fy:void 0),null!=e&&this.dispatchEvent(new Ty(e,r))},e.prototype.setTileLoadFunction=function(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()},e.prototype.setTileUrlFunction=function(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()},e.prototype.setUrl=function(t){var e=function(t){var e=[],r=/\{([a-z])-([a-z])\}/.exec(t);if(r){var n=r[1].charCodeAt(0),i=r[2].charCodeAt(0),o=void 0;for(o=n;o<=i;++o)e.push(t.replace(r[0],String.fromCharCode(o)));return e}if(r=/\{(\d+)-(\d+)\}/.exec(t)){for(var a=parseInt(r[2],10),s=parseInt(r[1],10);s<=a;s++)e.push(t.replace(r[0],s.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){for(var r=t.length,n=new Array(r),i=0;i<r;++i)n[i]=Ry(t[i],e);return Py(n)}(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,r){},e.prototype.useTile=function(t,e,r){var n=ap(t,e,r);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(by),Iy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ly=function(t){function e(e){var r=this,n=e.projection||"EPSG:3857",i=e.extent||Sy(n),o=e.tileGrid||my({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(r=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:n,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Ay,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:void 0===e.zDirection?1:e.zDirection})||this).format_=e.format?e.format:null,r.sourceTileCache=new pp(r.tileCache.highWaterMark),r.overlaps_=null==e.overlaps||e.overlaps,r.tileClass=e.tileClass?e.tileClass:Sp,r.tileGrids_={},r}return Iy(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],r=this.tileCache;if(0===r.getCount())return e;var n=lp(r.peekFirstKey())[0],i=this.tileGrid;return r.forEach((function(r){if(r.tileCoord[0]===n&&r.getState()===nl)for(var o=r.getSourceTiles(),a=0,s=o.length;a<s;++a){var l=o[a],u=l.tileCoord;if(Re(t,i.getTileCoordExtent(u))){var h=l.getFeatures();if(h)for(var c=0,p=h.length;c<p;++c){var f=h[c],d=f.getGeometry();Re(t,d.getExtent())&&e.push(f)}}}})),e},e.prototype.getOverlaps=function(){return this.overlaps_},e.prototype.clear=function(){this.tileCache.clear(),this.sourceTileCache.clear()},e.prototype.expireCache=function(e,r){var n=this.getTileCacheForProjection(e),i=Object.keys(r).reduce((function(t,e){var r,i,o=ap((i=(r=e).substring(r.lastIndexOf("/")+1,r.length).split(",").map(Number))[0],i[1],i[2]);if(n.containsKey(o))for(var a=n.get(o).sourceTiles,s=0,l=a.length;s<l;++s)t[a[s].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,r),this.sourceTileCache.expireCache(i)},e.prototype.getSourceTiles=function(t,e,r){var n=this;if(r.getState()===el){r.setState(rl);var i=r.wrappedTileCoord,o=this.getTileGridForProjection(e),a=o.getTileCoordExtent(i),s=i[0],l=o.getResolution(s);Qt(a,-l,a);var u=this.tileGrid,h=u.getExtent();h&&Ce(a,h,a);var c=u.getZForResolution(l,1);u.forEachTileCoord(a,c,(function(i){var o=n.tileUrlFunction(i,t,e),a=n.sourceTileCache.containsKey(o)?n.sourceTileCache.get(o):new n.tileClass(i,o?el:ol,o,n.format_,n.tileLoadFunction);r.sourceTiles.push(a);var s=a.getState();if(s<nl){var l=function(t){n.handleTileChange(t);var e=a.getState();if(e===nl||e===il){var i=a.getKey();i in r.errorTileKeys?a.getState()===nl&&delete r.errorTileKeys[i]:r.loadingSourceTiles--,e===il?r.errorTileKeys[i]=!0:a.removeEventListener(T,l),0===r.loadingSourceTiles&&r.setState(S(r.errorTileKeys)?nl:il)}};a.addEventListener(T,l),r.loadingSourceTiles++}s===el&&(a.extent=u.getTileCoordExtent(i),a.projection=e,a.resolution=u.getResolution(i[0]),n.sourceTileCache.set(o,a),a.load())})),r.loadingSourceTiles||r.setState(r.sourceTiles.some((function(t){return t.getState()===il}))?il:nl)}return r.sourceTiles},e.prototype.getTile=function(t,e,r,n,i){var o,a=ap(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)&&(o=this.tileCache.get(a)).key===s)return o;var l=[t,e,r],u=this.getTileCoordForTileUrlFunction(l,i),h=this.getTileGrid().getExtent(),c=this.getTileGridForProjection(i);if(u&&h){var p=c.getTileCoordExtent(u);Qt(p,-c.getResolution(t),p),Re(h,p)||(u=null)}var f=!0;if(null!==u){var d=this.tileGrid,g=c.getResolution(t),_=d.getZForResolution(g,1),y=c.getTileCoordExtent(u);Qt(y,-g,y),d.forEachTileCoord(y,_,function(t){f=f&&!this.tileUrlFunction(t,n,i)}.bind(this))}var v=new mp(l,f?ol:el,u,this.getSourceTiles.bind(this,n,i));return v.key=s,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(a,v)):this.tileCache.set(a,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),r=this.tileGrids_[e];if(!r){var n=this.tileGrid;r=wy(t,void 0,n?n.getTileSize(n.getMinZoom()):void 0),this.tileGrids_[e]=r}return r},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,r){var n=ii(this.getTileGridForProjection(r).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]},e.prototype.updateCacheSize=function(e,r){t.prototype.updateCacheSize.call(this,2*e,r),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(r).highWaterMark},e}(Fy),My=Ly;function Ay(t,e){t.setLoader((function(r,n,i){qs(e,t.getFormat(),r,n,i,t.onLoad.bind(t),t.onError.bind(t))}))}var Dy,ky=function(){function t(t,e,r,n,i,o){this.sourceProj_=t,this.targetProj_=e;var a={},s=Fr(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return a[e]||(a[e]=s(t)),a[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&be(n)==be(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?be(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?be(this.targetProj_.getExtent()):null;var l=Ee(r),u=Te(r),h=ve(r),c=ye(r),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(h),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(Me(_e(r)/(o*o*256*256)))):0);if(this.addQuad_(l,u,h,c,p,f,d,g,_),this.wrapsXInSource_){var y=1/0;this.triangles_.forEach((function(t,e,r){y=Math.min(y,t.source[0][0],t.source[1][0],t.source[2][0])})),this.triangles_.forEach(function(t){if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-y>this.sourceWorldWidth_/2){var e=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];e[0][0]-y>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-y>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-y>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var r=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-r<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}a={}}return t.prototype.addTriangle_=function(t,e,r,n,i,o){this.triangles_.push({source:[n,i,o],target:[t,e,r]})},t.prototype.addQuad_=function(t,e,r,n,i,o,a,s,l){var u=Jt([i,o,a,s]),h=this.sourceWorldWidth_?be(u)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&h>.5&&h<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=be(Jt([t,e,r,n]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&h&&(f=h>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(u[0])&&isFinite(u[1])&&isFinite(u[2])&&isFinite(u[3]))||Re(u,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(i[0])&&isFinite(i[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])&&isFinite(s[0])&&isFinite(s[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(i[0])&&isFinite(i[1])?0:8)+(isFinite(o[0])&&isFinite(o[1])?0:4)+(isFinite(a[0])&&isFinite(a[1])?0:2)+(isFinite(s[0])&&isFinite(s[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var g=[(t[0]+r[0])/2,(t[1]+r[1])/2],_=this.transformInv_(g),y=void 0;if(p)y=(Ge(i[0],c)+Ge(a[0],c))/2-Ge(_[0],c);else y=(i[0]+a[0])/2-_[0];var v=(i[1]+a[1])/2-_[1];f=y*y+v*v>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-r[0])<=Math.abs(t[1]-r[1])){var m=[(e[0]+r[0])/2,(e[1]+r[1])/2],x=this.transformInv_(m),w=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(w);this.addQuad_(t,e,m,w,i,o,x,S,l-1),this.addQuad_(w,m,r,n,S,x,a,s,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(r[0]+n[0])/2,(r[1]+n[1])/2],b=this.transformInv_(T);this.addQuad_(t,C,T,n,i,E,b,s,l-1),this.addQuad_(C,e,r,T,E,o,a,b,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,r,n,i,a,s),0==(14&d)&&this.addTriangle_(t,r,e,i,a,o),d&&(0==(13&d)&&this.addTriangle_(e,n,t,o,s,i),0==(7&d)&&this.addTriangle_(e,n,r,o,s,a))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,r,n){var i=e.source;pe(t,i[0]),pe(t,i[1]),pe(t,i[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}();function jy(t,e,r,n,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,r),t.lineTo(n,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(r,i)),t.restore()}function Gy(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Ny(t,e,r,n){var i=Ir(r,e,t),o=Tr(e,n,r),a=e.getMetersPerUnit();void 0!==a&&(o*=a);var s=t.getMetersPerUnit();void 0!==s&&(o/=s);var l=t.getExtent();if(!l||ee(l,i)){var u=Tr(t,o,i)/o;isFinite(u)&&u>0&&(o/=u)}return o}function By(t,e,r,n,i,o,a,s,l,u,h,c){var p=_i(Math.round(r*t),Math.round(r*e));if(c||m(p,W_),0===l.length)return p.canvas;function f(t){return Math.round(t*r)/r}p.scale(r,r),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,r){ce(d,t.extent)}));var g=be(d),_=Se(d),y=_i(Math.round(r*g/n),Math.round(r*_/n));c||m(y,W_);var v=r/n;l.forEach((function(t,e,r){var n=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=be(t.extent),a=Se(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,n*v,i*v,o*v,a*v)}));var x=Ee(a);return s.getTriangles().forEach((function(t,e,i){var a=t.source,s=t.target,l=a[0][0],u=a[0][1],h=a[1][0],g=a[1][1],_=a[2][0],v=a[2][1],m=f((s[0][0]-x[0])/o),w=f(-(s[0][1]-x[1])/o),S=f((s[1][0]-x[0])/o),C=f(-(s[1][1]-x[1])/o),E=f((s[2][0]-x[0])/o),T=f(-(s[2][1]-x[1])/o),b=l,R=u;l=0,u=0;var P=function(t){for(var e=t.length,r=0;r<e;r++){for(var n=r,i=Math.abs(t[r][r]),o=r+1;o<e;o++){var a=Math.abs(t[o][r]);a>i&&(i=a,n=o)}if(0===i)return null;var s=t[n];t[n]=t[r],t[r]=s;for(var l=r+1;l<e;l++)for(var u=-t[l][r]/t[r][r],h=r;h<e+1;h++)r==h?t[l][h]=0:t[l][h]+=u*t[r][h]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var f=p-1;f>=0;f--)t[f][e]-=t[f][p]*c[p]}return c}([[h-=b,g-=R,0,0,S-m],[_-=b,v-=R,0,0,E-m],[0,0,h,g,C-w],[0,0,_,v,T-w]]);if(P){if(p.save(),p.beginPath(),function(){if(void 0===Dy){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",jy(t,4,5,4,0),jy(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Dy=Gy(e,0)||Gy(e,4)||Gy(e,8)}return Dy}()||!c){p.moveTo(S,C);for(var O=m-S,F=w-C,I=0;I<4;I++)p.lineTo(S+f((I+1)*O/4),C+f(I*F/3)),3!=I&&p.lineTo(S+f((I+1)*O/4),C+f((I+1)*F/3));p.lineTo(E,T)}else p.moveTo(S,C),p.lineTo(m,w),p.lineTo(E,T);p.clip(),p.transform(P[0],P[2],P[1],P[3],m,w),p.translate(d[0]-b,d[3]-R),p.scale(n/r,-n/r),p.drawImage(y.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,s.getTriangles().forEach((function(t,e,r){var n=t.target,i=(n[0][0]-x[0])/o,a=-(n[0][1]-x[1])/o,s=(n[1][0]-x[0])/o,l=-(n[1][1]-x[1])/o,u=(n[2][0]-x[0])/o,h=-(n[2][1]-x[1])/o;p.beginPath(),p.moveTo(s,l),p.lineTo(i,a),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var zy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Uy=function(t){function e(e,r,n,i,o,a,s,l,u,h,c,p){var f=t.call(this,o,el,{interpolate:!!p})||this;f.renderEdges_=void 0!==c&&c,f.pixelRatio_=s,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=r,f.targetTileGrid_=i,f.wrappedTileCoord_=a||o,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=i.getTileCoordExtent(f.wrappedTileCoord_),g=f.targetTileGrid_.getExtent(),_=f.sourceTileGrid_.getExtent(),y=g?Ce(d,g):d;if(0===_e(y))return f.state=ol,f;var v=e.getExtent();v&&(_=_?Ce(_,v):v);var m=i.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,r,n){var i=me(r),o=Ny(t,e,i,n);return(!isFinite(o)||o<=0)&&ge(r,(function(r){return o=Ny(t,e,r,n),isFinite(o)&&o>0})),o}(e,n,y,m);if(!isFinite(x)||x<=0)return f.state=ol,f;var w=void 0!==h?h:.5;if(f.triangulation_=new ky(e,n,y,_,x*w,m),0===f.triangulation_.getTriangles().length)return f.state=ol,f;f.sourceZ_=r.getZForResolution(x);var S=f.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(S[1]=Ie(S[1],_[1],_[3]),S[3]=Ie(S[3],_[1],_[3])):S=Ce(S,_)),_e(S)){for(var C=r.getTileRangeForExtentAndZ(S,f.sourceZ_),E=C.minX;E<=C.maxX;E++)for(var T=C.minY;T<=C.maxY;T++){var b=u(f.sourceZ_,E,T,s);b&&f.sourceTiles_.push(b)}0===f.sourceTiles_.length&&(f.state=ol)}else f.state=ol;return f}return zy(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,r,n){e&&e.getState()==nl&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=il;else{var e=this.wrappedTileCoord_[0],r=this.targetTileGrid_.getTileSize(e),n="number"==typeof r?r:r[0],i="number"==typeof r?r:r[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=By(n,i,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,s,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=nl}this.changed()},e.prototype.load=function(){if(this.state==el){this.state=rl,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,r,n){var i=e.getState();if(i==el||i==rl){t++;var o=N(e,T,(function(r){var n=e.getState();n!=nl&&n!=il&&n!=ol||(z(o),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(o)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,r){t.getState()==el&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(z),this.sourcesListenerKeys_=null},e}(pl),Vy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Xy=function(t){function e(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(r=t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Wy,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:n,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,r.tileClass=void 0!==e.tileClass?e.tileClass:dl,r.tileCacheForProjection={},r.tileGridForProjection={},r.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,r.renderReprojectionEdges_=!1,r}return Vy(e,t),e.prototype.canExpireCache=function(){if(this.tileCache.canExpireCache())return!0;for(var t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1},e.prototype.expireCache=function(t,e){var r=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==r?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[n];i.expireCache(i==r?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Pr(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Pr(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Pr(e,t)){var r=n(t);return r in this.tileGridForProjection||(this.tileGridForProjection[r]=vy(t)),this.tileGridForProjection[r]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Pr(e,t))return this.tileCache;var r=n(t);return r in this.tileCacheForProjection||(this.tileCacheForProjection[r]=new pp(this.tileCache.highWaterMark)),this.tileCacheForProjection[r]},e.prototype.createTile_=function(t,e,r,n,i,o){var a=[t,e,r],s=this.getTileCoordForTileUrlFunction(a,i),l=s?this.tileUrlFunction(s,n,i):void 0,u=new this.tileClass(a,void 0!==l?el:ol,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=o,u.addEventListener(T,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,r,n,i){var o=this.getProjection();if(o&&i&&!Pr(o,i)){var a=this.getTileCacheForProjection(i),s=[t,e,r],l=void 0,u=sp(s);a.containsKey(u)&&(l=a.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(o),p=this.getTileGridForProjection(i),f=this.getTileCoordForTileUrlFunction(s,i),d=new Uy(o,c,i,p,s,f,this.getTilePixelRatio(n),this.getGutter(),function(t,e,r,n){return this.getTileInternal(t,e,r,n,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=h,l?(d.interimTile=l,d.refreshInterimChain(),a.replace(u,d)):a.set(u,d),d}return this.getTileInternal(t,e,r,n,o||i)},e.prototype.getTileInternal=function(t,e,r,n,i){var o=null,a=ap(t,e,r),s=this.getKey();if(this.tileCache.containsKey(a)){if((o=this.tileCache.get(a)).key!=s){var l=o;o=this.createTile_(t,e,r,n,i,s),l.getState()==el?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(a,o)}}else o=this.createTile_(t,e,r,n,i,s),this.tileCache.set(a,o);return o},e.prototype.setRenderReprojectionEdges=function(t){if(this.renderReprojectionEdges_!=t){for(var e in this.renderReprojectionEdges_=t,this.tileCacheForProjection)this.tileCacheForProjection[e].clear();this.changed()}},e.prototype.setTileGridForProjection=function(t,e){var r=Er(t);if(r){var i=n(r);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}},e}(Fy);function Wy(t,e){t.getImage().src=e}var Yy=Xy,Ky=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();!function(t){function e(e){var r=this,n="Unexpected response status: "+e.status;return(r=t.call(this,n)||this).name="ResponseError",r.response=e,r}Ky(e,t)}(Error),function(t){function e(e){var r=t.call(this,"Failed to issue request")||this;return r.name="ClientError",r.client=e,r}Ky(e,t)}(Error);var Zy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Hy=function(t){function e(e){var r=this,n=e||{},i=m({},n);return delete i.preload,delete i.useInterimTilesOnError,(r=t.call(this,i)||this).on,r.once,r.un,r.setPreload(void 0!==n.preload?n.preload:0),r.setUseInterimTilesOnError(void 0===n.useInterimTilesOnError||n.useInterimTilesOnError),r}return Zy(e,t),e.prototype.getPreload=function(){return this.get(ly)},e.prototype.setPreload=function(t){this.set(ly,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(uy)},e.prototype.setUseInterimTilesOnError=function(t){this.set(uy,t)},e}(Oo),qy=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Jy=function(t){function e(e){return t.call(this,e)||this}return qy(e,t),e.prototype.createRenderer=function(){return new $_(this)},e}(Hy),Qy=function(){function t(t,e){this.name=t,this.data=e,this.texture_=null}return t.prototype.getTexture=function(t){if(!this.texture_){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_},t}(),$y=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function tv(t,e,r){var n=r?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function ev(t,e,r,n,i,o){var a=t.getGL();tv(a,e,o);var s,l,u=r.byteLength/n[1],h=1;switch(u%8==0?h=8:u%4==0?h=4:u%2==0&&(h=2),i){case 1:s=a.LUMINANCE;break;case 2:s=a.LUMINANCE_ALPHA;break;case 3:s=a.RGB;break;case 4:s=a.RGBA;break;default:throw new Error("Unsupported number of bands: "+i)}r instanceof Float32Array?(l=a.FLOAT,t.getExtension("OES_texture_float"),t.getExtension("OES_texture_float_linear")):l=a.UNSIGNED_BYTE;var c=a.getParameter(a.UNPACK_ALIGNMENT);a.pixelStorei(a.UNPACK_ALIGNMENT,h),a.texImage2D(a.TEXTURE_2D,0,s,n[0],n[1],0,s,l,r),a.pixelStorei(a.UNPACK_ALIGNMENT,c)}var rv=function(t){function e(e,r,n){var i=t.call(this)||this;i.tile,i.textures=[],i.handleTileChange_=i.handleTileChange_.bind(i),i.size=ii(r.getTileSize(e.tileCoord[0])),i.bandCount=NaN,i.helper_=n;var o=new u_(t_,r_);return o.fromArray([0,1,1,1,1,0,0,0]),n.flushBufferData(o),i.coords=o,i.setTile(e),i}return $y(e,t),e.prototype.setTile=function(t){t!==this.tile&&(this.tile&&this.tile.removeEventListener(T,this.handleTileChange_),this.tile=t,this.textures.length=0,this.loaded=t.getState()===nl,this.loaded?this.uploadTile_():t.addEventListener(T,this.handleTileChange_))},e.prototype.uploadTile_=function(){var t=this.helper_,e=t.getGL(),r=this.tile;if(r instanceof dl||r instanceof Uy){var n=e.createTexture();return this.textures.push(n),this.bandCount=4,void function(t,e,r,n){tv(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,r)}(e,n,r.getImage(),r.interpolate)}var i=r.getData(),o=i instanceof Float32Array,a=this.size[0]*this.size[1],s=o?Float32Array:Uint8Array,l=s.BYTES_PER_ELEMENT,u=i.byteLength/this.size[1];this.bandCount=Math.floor(u/l/this.size[0]);var h=Math.ceil(this.bandCount/4);if(1===h){n=e.createTexture();return this.textures.push(n),void ev(t,n,i,this.size,this.bandCount,r.interpolate)}for(var c=new Array(h),p=0;p<h;++p){n=e.createTexture();this.textures.push(n);var f=p<h-1?4:this.bandCount%4;c[p]=new s(a*f)}for(var d=0,g=0,_=this.size[0]*this.bandCount,y=0;y<this.size[1];++y){for(var v=0;v<_;++v){var m=i[g+v],x=Math.floor(d/this.bandCount),w=v%this.bandCount;(S=c[p=Math.floor(w/4)])[x*(f=S.length/a)+w%4]=m,++d}g+=u/l}for(p=0;p<h;++p){var S;n=this.textures[p],f=(S=c[p]).length/a;ev(t,n,S,this.size,f,r.interpolate)}},e.prototype.handleTileChange_=function(){this.tile.getState()===nl&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(T))},e.prototype.disposeInternal=function(){var t=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(var e=0;e<this.textures.length;++e)t.deleteTexture(this.textures[e]);this.tile.removeEventListener(T,this.handleTileChange_)},e}(E),nv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),iv="u_tileTextures",ov="u_tileTransform",av="u_transitionAlpha",sv="u_depth",lv="u_texturePixelWidth",uv="u_texturePixelHeight",hv="u_resolution",cv="u_zoom",pv=[{name:"a_textureCoord",size:2,type:S_.FLOAT}],fv={};function dv(t){return 2*(1-1/(t+1))-1}function gv(t,e,r){r in t||(t[r]=[]),t[r].push(e)}function _v(t,e){var r=t.layerStatesArray[t.layerIndex];r.extent&&(e=Ce(e,Gr(r.extent,t.viewState.projection)));var n=r.layer.getSource();if(!n.getWrapX()){var i=n.tileGrid.getExtent();i&&(e=Ce(e,i))}return e}var yv=function(t){function e(e,r){var n=t.call(this,e,{uniforms:r.uniforms})||this;n.tileTransform_=[1,0,0,1,0,0],n.tempMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],n.tempTileRange_=new gp(0,0,0,0),n.tempTileCoord_=op(0,0,0),n.tempSize_=[0,0],n.program_,n.vertexShader_=r.vertexShader,n.fragmentShader_=r.fragmentShader,n.indices_=new u_(e_,r_),n.indices_.fromArray([0,1,3,1,2,3]);var i=void 0!==r.cacheSize?r.cacheSize:512;return n.tileTextureCache_=new ip(i),n.paletteTextures_=r.paletteTextures||[],n}return nv(e,t),e.prototype.reset=function(e){t.prototype.reset.call(this,{uniforms:e.uniforms}),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.paletteTextures_=e.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))},e.prototype.afterHelperCreated=function(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)},e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),r=t.getState(),n=e.getUseInterimTilesOnError();return r==nl||r==ol||r==il&&!n},e.prototype.prepareFrameInternal=function(t){var e=this.getLayer().getSource();return!!e&&(!Pe(_v(t,t.extent))&&e.getState()===Eo)},e.prototype.enqueueTiles=function(t,e,r,i){var o=t.viewState,a=this.getLayer().getSource(),s=a.getTileGridForProjection(o.projection),l=this.tileTextureCache_,u=s.getTileRangeForExtentAndZ(e,r,this.tempTileRange_),h=n(a);h in t.wantedTiles||(t.wantedTiles[h]={});for(var c=t.wantedTiles[h],p=s.getResolution(r),f=u.minX;f<=u.maxX;++f)for(var d=u.minY;d<=u.maxY;++d){var g=op(r,f,d,this.tempTileCoord_),_=sp(g),y=void 0,v=void 0;if(l.containsKey(_)&&(v=(y=l.get(_)).tile),!y||y.tile.key!==a.getKey())if(v=a.getTile(r,f,d,t.pixelRatio,o.projection),y)if(this.isDrawableTile_(v))y.setTile(v);else{var m=v.getInterimTile();y.setTile(m)}else y=new rv(v,s,this.helper),l.set(_,y);gv(i,y,r);var x=v.getKey();c[x]=!0,v.getState()===el&&(t.tileQueue.isKeyQueued(x)||t.tileQueue.enqueue([v,h,s.getTileCoordCenter(g),p]))}},e.prototype.renderFrame=function(t){var e=this.helper.getGL();this.preRender(e,t);var r=t.viewState,i=this.getLayer().getSource(),o=i.getTileGridForProjection(r.projection),a=_v(t,t.extent),s=o.getZForResolution(r.resolution,i.zDirection),l={};if(t.nextExtent){var u=o.getZForResolution(r.nextResolution,i.zDirection),c=_v(t,t.nextExtent);this.enqueueTiles(t,c,u,l)}this.enqueueTiles(t,a,s,l);for(var p={},f=n(this),d=t.time,g=!1,_=l[s],y=0,v=_.length;y<v;++y){var m=(k=(H=_[y]).tile).tileCoord;if(H.loaded){if(1===(j=k.getAlpha(f,d))){k.endTransition(f);continue}g=!0,p[G=sp(m)]=j}if(!this.findAltTiles_(o,m,s+1,l))for(var x=o.getMinZoom(),w=s-1;w>=x;--w){if(this.findAltTiles_(o,m,w,l))break}}this.helper.useProgram(this.program_),this.helper.prepareDraw(t,!g);for(var S=Object.keys(l).map(Number).sort(h),C=r.center[0],E=r.center[1],T=0,b=S.length;T<b;++T){var R=S[T],P=o.getResolution(R),O=ii(o.getTileSize(R),this.tempSize_),F=o.getOrigin(R),I=(C-F[0])/(O[0]*P),L=(F[1]-E)/(O[1]*P),M=r.resolution/P,A=dv(R),D=l[R];for(y=0,v=D.length;y<v;++y){if((H=D[y]).loaded){var k,j,G=sp(m=(k=H.tile).tileCoord),N=m[1],B=m[2];Gt(this.tileTransform_,0,0,2/(t.size[0]*M/O[0]),-2/(t.size[1]*M/O[1]),r.rotation,-(I-N),-(L-B)),this.helper.setUniformMatrixValue(ov,d_(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(H.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(pv);for(var z=0;z<H.textures.length;){var U="TEXTURE"+z,V=iv+"["+z+"]";e.activeTexture(e[U]),e.bindTexture(e.TEXTURE_2D,H.textures[z]),e.uniform1i(this.helper.getUniformLocation(V),z),++z}for(var X=0;X<this.paletteTextures_.length;++X){var W=this.paletteTextures_[X];e.activeTexture(e["TEXTURE"+z]);var Y=W.getTexture(e);e.bindTexture(e.TEXTURE_2D,Y),e.uniform1i(this.helper.getUniformLocation(W.name),z),++z}(j=G in p?p[G]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(av,j),this.helper.setUniformFloatValue(sv,A),this.helper.setUniformFloatValue(lv,O[0]),this.helper.setUniformFloatValue(uv,O[1]),this.helper.setUniformFloatValue(hv,r.resolution),this.helper.setUniformFloatValue(cv,r.zoom),this.helper.drawElements(0,this.indices_.getSize())}}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);for(var K=this.helper.getCanvas(),Z=this.tileTextureCache_;Z.canExpireCache();){var H;(H=Z.pop()).dispose()}return t.postRenderFunctions.push((function(t,e){i.expireCache(e.viewState.projection,fv)})),this.postRender(e,t),K},e.prototype.findAltTiles_=function(t,e,r,n){var i=t.getTileRangeForTileCoordAndZ(e,r,this.tempTileRange_);if(!i)return!1;for(var o=!0,a=this.tileTextureCache_,s=i.minX;s<=i.maxX;++s)for(var l=i.minY;l<=i.maxY;++l){var u=ap(r,s,l),h=!1;if(a.containsKey(u)){var c=a.get(u);c.loaded&&(gv(n,c,r),h=!0)}h||(o=!1)}return o},e.prototype.disposeInternal=function(){var e=this.helper,r=e.getGL();e.deleteBuffer(this.indices_),delete this.indices_,r.deleteProgram(this.program_),delete this.program_;var n=this.tileTextureCache_;n.forEach((function(t){t.dispose()})),n.clear(),delete this.tileTextureCache_,t.prototype.disposeInternal.call(this)},e}(I_);yv.prototype.getLayer;var vv=1,mv=2,xv=4,wv=8,Sv=16,Cv=31,Ev=0,Tv={};function bv(t){if("number"==typeof t)return vv;if("boolean"==typeof t)return wv;if("string"==typeof t)return e=t,li.test(e)&&(e=hi(e)),si.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?xv|mv:mv;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: "+JSON.stringify(t));var r=t;if(r.every((function(t){return"number"==typeof t})))return 3===r.length||4===r.length?xv|Sv:Sv;if("string"!=typeof r[0])throw new Error("Expected an expression operator but received: "+JSON.stringify(r));var n=Tv[r[0]];if(void 0===n)throw new Error("Unrecognized expression operator: "+JSON.stringify(r));return n.getReturnType(r.slice(1))}function Rv(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Pv(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return"vec"+t.length+"("+t.map(Rv).join(", ")+")"}function Ov(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Fv(t,e,r){if(Array.isArray(e)&&"string"==typeof e[0]){var n=Tv[e[0]];if(void 0===n)throw new Error("Unrecognized expression operator: "+JSON.stringify(e));return n.toGlsl(t,e.slice(1),r)}var i,o=bv(e);if((o&vv)>0)return Rv(e);if((o&wv)>0)return e.toString();if((o&mv)>0&&(void 0===r||r==mv))return function(t,e){return Rv(Ov(t,e))}(t,e.toString());if((o&xv)>0&&(void 0===r||r==xv))return(i=pi(e).slice()).length<4&&i.push(1),Pv(i.map((function(t,e){return e<3?t/255:t})));if((o&Sv)>0)return Pv(e);throw new Error("Unexpected expression "+e+" (expected type "+r+")")}function Iv(t){if(!(bv(t)&vv))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function Lv(t){for(var e=0;e<t.length;e++)Iv(t[e])}function Mv(t){if(!(bv(t)&mv))throw new Error("A string value was expected, got "+JSON.stringify(t)+" instead")}function Av(t){if(!(bv(t)&wv))throw new Error("A boolean value was expected, got "+JSON.stringify(t)+" instead")}function Dv(t,e){if(t.length!==e)throw new Error("Exactly "+e+" arguments were expected, got "+t.length+" instead")}function kv(t,e){if(t.length<e)throw new Error("At least "+e+" arguments were expected, got "+t.length+" instead")}function jv(t,e){if(t.length>e)throw new Error("At most "+e+" arguments were expected, got "+t.length+" instead")}function Gv(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function Nv(t,e){if(Me(e)%1!=0)throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t))}function Bv(t){return"u_var_"+t}Tv.get={getReturnType:function(t){return Cv},toGlsl:function(t,e){Dv(e,1),Mv(e[0]);var r=e[0].toString();return-1===t.attributes.indexOf(r)&&t.attributes.push(r),(t.inFragmentShader?"v_":"a_")+r}},Tv.var={getReturnType:function(t){return Cv},toGlsl:function(t,e){Dv(e,1),Mv(e[0]);var r=e[0].toString();return-1===t.variables.indexOf(r)&&t.variables.push(r),Bv(r)}};Tv.palette={getReturnType:function(t){return xv},toGlsl:function(t,e){Dv(e,2),Iv(e[0]);var r=Fv(t,e[0]),n=e[1];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");for(var i=n.length,o=new Uint8Array(4*i),a=0;a<i;a++){var s=n[a],l=void 0;if("string"==typeof s)l=ci(s);else{if(!Array.isArray(s))throw new Error("The second argument of palette must be an array of strings or colors");var u=s.length;if(4===u)l=s;else{if(3!==u)throw new Error("Expected palette color to have 3 or 4 values, got "+u);l=[s[0],s[1],s[2],1]}}var h=4*a;o[h]=l[0],o[h+1]=l[1],o[h+2]=l[2],o[h+3]=255*l[3]}t.paletteTextures||(t.paletteTextures=[]);var c="u_paletteTextures["+t.paletteTextures.length+"]",p=new Qy(c,o);return t.paletteTextures.push(p),"texture2D("+c+", vec2(("+r+" + 0.5) / "+i+".0, 0.5))"}};var zv="getBandValue";function Uv(t){return{getReturnType:function(t){return wv},toGlsl:function(e,r){Dv(r,2);for(var n=Cv,i=0;i<r.length;i++)n&=bv(r[i]);if(n===Ev)throw new Error("All arguments should be of compatible type, got "+JSON.stringify(r)+" instead");return n&=~xv,"("+Fv(e,r[0],n)+" "+t+" "+Fv(e,r[1],n)+")"}}}function Vv(t){return{getReturnType:function(t){return wv},toGlsl:function(e,r){kv(r,2);for(var n=0;n<r.length;n++)Av(r[n]);return"("+r.map((function(t){return Fv(e,t)})).join(" "+t+" ")+")"}}}Tv.band={getReturnType:function(t){return vv},toGlsl:function(t,e){kv(e,1),jv(e,3);var r=e[0];if(!(zv in t.functions)){for(var n="",i=t.bandCount||1,o=0;o<i;o++){var a=Math.floor(o/4),s=o%4;s===i-1&&1===s&&(s=3),n+="\n if (band == "+(o+1)+".0) {\n return texture2D("+(iv+"["+a+"]")+", v_textureCoord + vec2(dx, dy))["+s+"];\n }\n "}t.functions.getBandValue="\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / "+lv+";\n float dy = yOffset / "+uv+";\n "+n+"\n }\n "}return"getBandValue("+Fv(t,r)+", "+Fv(t,e[1]||0)+", "+Fv(t,e[2]||0)+")"}},Tv.time={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,0),"u_time"}},Tv.zoom={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,0),"u_zoom"}},Tv.resolution={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,0),"u_resolution"}},Tv["*"]={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"("+Fv(t,e[0])+" * "+Fv(t,e[1])+")"}},Tv["/"]={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"("+Fv(t,e[0])+" / "+Fv(t,e[1])+")"}},Tv["+"]={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"("+Fv(t,e[0])+" + "+Fv(t,e[1])+")"}},Tv["-"]={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"("+Fv(t,e[0])+" - "+Fv(t,e[1])+")"}},Tv.clamp={getReturnType:function(t){return vv},toGlsl:function(t,e){Dv(e,3),Lv(e);var r=Fv(t,e[1]),n=Fv(t,e[2]);return"clamp("+Fv(t,e[0])+", "+r+", "+n+")"}},Tv["%"]={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"mod("+Fv(t,e[0])+", "+Fv(t,e[1])+")"}},Tv["^"]={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"pow("+Fv(t,e[0])+", "+Fv(t,e[1])+")"}},Tv.abs={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,1),Lv(e),"abs("+Fv(t,e[0])+")"}},Tv.sin={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,1),Lv(e),"sin("+Fv(t,e[0])+")"}},Tv.cos={getReturnType:function(t){return vv},toGlsl:function(t,e){return Dv(e,1),Lv(e),"cos("+Fv(t,e[0])+")"}},Tv.atan={getReturnType:function(t){return vv},toGlsl:function(t,e){return kv(e,1),jv(e,2),Lv(e),2===e.length?"atan("+Fv(t,e[0])+", "+Fv(t,e[1])+")":"atan("+Fv(t,e[0])+")"}},Tv[">"]={getReturnType:function(t){return wv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"("+Fv(t,e[0])+" > "+Fv(t,e[1])+")"}},Tv[">="]={getReturnType:function(t){return wv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"("+Fv(t,e[0])+" >= "+Fv(t,e[1])+")"}},Tv["<"]={getReturnType:function(t){return wv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"("+Fv(t,e[0])+" < "+Fv(t,e[1])+")"}},Tv["<="]={getReturnType:function(t){return wv},toGlsl:function(t,e){return Dv(e,2),Lv(e),"("+Fv(t,e[0])+" <= "+Fv(t,e[1])+")"}},Tv["=="]=Uv("=="),Tv["!="]=Uv("!="),Tv["!"]={getReturnType:function(t){return wv},toGlsl:function(t,e){return Dv(e,1),Av(e[0]),"(!"+Fv(t,e[0])+")"}},Tv.all=Vv("&&"),Tv.any=Vv("||"),Tv.between={getReturnType:function(t){return wv},toGlsl:function(t,e){Dv(e,3),Lv(e);var r=Fv(t,e[1]),n=Fv(t,e[2]),i=Fv(t,e[0]);return"("+i+" >= "+r+" && "+i+" <= "+n+")"}},Tv.array={getReturnType:function(t){return Sv},toGlsl:function(t,e){kv(e,2),jv(e,4),Lv(e);var r=e.map((function(e){return Fv(t,e,vv)}));return"vec"+e.length+"("+r.join(", ")+")"}},Tv.color={getReturnType:function(t){return xv},toGlsl:function(t,e){kv(e,3),jv(e,4),Lv(e);var r=e;3===e.length&&r.push(1);var n=e.map((function(e,r){return Fv(t,e,vv)+(r<3?" / 255.0":"")}));return"vec"+e.length+"("+n.join(", ")+")"}},Tv.interpolate={getReturnType:function(t){for(var e=xv|vv,r=3;r<t.length;r+=2)e&=bv(t[r]);return e},toGlsl:function(t,e,r){Gv(e),kv(e,6);var n,i=e[0];switch(i[0]){case"linear":n=1;break;case"exponential":n=i[1];break;default:n=null}if(!n)throw new Error('Invalid interpolation type for "interpolate" operator, received: '+JSON.stringify(i));var o=void 0!==r?r:Cv,a=Tv.interpolate.getReturnType(e)&o;Nv(e,a);for(var s=Fv(t,e[1]),l=Rv(n),u="",h=2;h<e.length-2;h+=2){var c=Fv(t,e[h]),p=u||Fv(t,e[h+1],a),f=Fv(t,e[h+2]);u="mix("+p+", "+Fv(t,e[h+3],a)+", pow(clamp(("+s+" - "+c+") / ("+f+" - "+c+"), 0.0, 1.0), "+l+"))"}return u}},Tv.match={getReturnType:function(t){for(var e=Cv,r=2;r<t.length;r+=2)e&=bv(t[r]);return e&=bv(t[t.length-1])},toGlsl:function(t,e,r){Gv(e),kv(e,4);var n=void 0!==r?r:Cv,i=Tv.match.getReturnType(e)&n;Nv(e,i);for(var o=Fv(t,e[0]),a=Fv(t,e[e.length-1],i),s=null,l=e.length-3;l>=1;l-=2){s="("+o+" == "+Fv(t,e[l])+" ? "+Fv(t,e[l+1],i)+" : "+(s||a)+")"}return s}},Tv.case={getReturnType:function(t){for(var e=Cv,r=1;r<t.length;r+=2)e&=bv(t[r]);return e&=bv(t[t.length-1])},toGlsl:function(t,e,r){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got "+t+" instead")}(e),kv(e,3);var n=void 0!==r?r:Cv,i=Tv.case.getReturnType(e)&n;Nv(e,i);for(var o=0;o<e.length-1;o+=2)Av(e[o]);var a=Fv(t,e[e.length-1],i),s=null;for(o=e.length-3;o>=0;o-=2){s="("+Fv(t,e[o])+" ? "+Fv(t,e[o+1],i)+" : "+(s||a)+")"}return s}};var Xv=function(){function t(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}return t.prototype.addUniform=function(t){return this.uniforms.push(t),this},t.prototype.addAttribute=function(t){return this.attributes.push(t),this},t.prototype.addVarying=function(t,e,r){return this.varyings.push({name:t,type:e,expression:r}),this},t.prototype.setSizeExpression=function(t){return this.sizeExpression=t,this},t.prototype.setRotationExpression=function(t){return this.rotationExpression=t,this},t.prototype.setSymbolOffsetExpression=function(t){return this.offsetExpression=t,this},t.prototype.setColorExpression=function(t){return this.colorExpression=t,this},t.prototype.setTextureCoordinateExpression=function(t){return this.texCoordExpression=t,this},t.prototype.setFragmentDiscardExpression=function(t){return this.discardExpression=t,this},t.prototype.setSymbolRotateWithView=function(t){return this.rotateWithView=t,this},t.prototype.getSizeExpression=function(){return this.sizeExpression},t.prototype.getOffsetExpression=function(){return this.offsetExpression},t.prototype.getColorExpression=function(){return this.colorExpression},t.prototype.getTextureCoordinateExpression=function(){return this.texCoordExpression},t.prototype.getFragmentDiscardExpression=function(){return this.discardExpression},t.prototype.getSymbolVertexShader=function(t){var e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix",r=this.attributes,n=this.varyings;return t&&(r=r.concat("vec4 a_hitColor"),n=n.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nattribute vec2 a_position;\nattribute float a_index;\n"+r.map((function(t){return"attribute "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n mat4 offsetMatrix = "+e+";\n vec2 halfSize = "+this.sizeExpression+" * 0.5;\n vec2 offset = "+this.offsetExpression+";\n float angle = "+this.rotationExpression+";\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = "+this.texCoordExpression+";\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n"+n.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")+"\n}"},t.prototype.getSymbolFragmentShader=function(t){var e=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"",r=this.varyings;return t&&(r=r.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),"precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n"+this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")+"\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n"+r.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")+"\nvoid main(void) {\n if ("+this.discardExpression+") { discard; }\n gl_FragColor = "+this.colorExpression+";\n gl_FragColor.rgb *= gl_FragColor.a;\n"+e+"\n}"},t}();var Wv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Yv=function(t){function e(e){var r=this,n=m({},e);return(r=t.call(this,n)||this).parseResult_=function(t){var e=t.symbol,r=void 0!==e.size?e.size:1,n=e.color||"white",i=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],a=void 0!==e.opacity?e.opacity:1,s=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},u=Fv(l,r,Sv|vv),h=Fv(l,o,Sv),c=Fv(l,i,Sv),p=Fv(l,s,vv),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},d=Fv(f,n,xv),g=Fv(f,a,vv),_="1.0",y="vec2("+Fv(f,r,Sv|vv)+").x";switch(e.symbolType){case"square":case"image":break;case"circle":_="(1.0-smoothstep(1.-4./"+y+",1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))";break;case"triangle":var v="(v_quadCoord*2.-1.)",m="(atan("+v+".x,"+v+".y))";_="(1.0-smoothstep(.5-3./"+y+",.5,cos(floor(.5+"+m+"/2.094395102)*2.094395102-"+m+")*length("+v+")))";break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}var x=(new Xv).setSizeExpression("vec2("+u+")").setRotationExpression(p).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4("+d+".rgb, "+d+".a * "+g+" * "+_+")");if(t.filter){var w=Fv(f,t.filter,wv);x.setFragmentDiscardExpression("!"+w)}var S={};if(f.variables.forEach((function(e){var r=Bv(e);x.addUniform("float "+r),S[r]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: "+e);var r=t.variables[e];return"string"==typeof r&&(r=Ov(l,r)),void 0!==r?r:-9999999}})),"image"===e.symbolType&&e.src){var C=new Image;C.src=e.src,x.addUniform("sampler2D u_texture").setColorExpression(x.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),S.u_texture=C}return f.attributes.forEach((function(t){-1===l.attributes.indexOf(t)&&l.attributes.push(t),x.addVarying("v_"+t,"float","a_"+t)})),l.attributes.forEach((function(t){x.addAttribute("float a_"+t)})),{builder:x,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,r){var n=r[t];return"string"==typeof n&&(n=Ov(l,n)),void 0!==n?n:-9999999}}})),uniforms:S}}(e.style),r.hitDetectionDisabled_=!!e.disableHitDetection,r}return Wv(e,t),e.prototype.createRenderer=function(){return new k_(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})},e}(Oo),Kv=Yv,Zv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();var Hv=function(t){function e(e){var r=this,i=void 0!==e.hidpi&&e.hidpi,o=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(o=e.interpolate),(r=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",interpolate:o,opaque:!0,projection:Er("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:Co,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:i?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).hidpi_=i,r.culture_=void 0!==e.culture?e.culture:"en-us",r.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,r.apiKey_=e.key,r.imagerySet_=e.imagerySet,function(t,e,r,i){var o=document.createElement("script"),a="olc_"+n(e);function s(){delete window[a],o.parentNode.removeChild(o)}o.async=!0,o.src=t+(-1==t.indexOf("?")?"?":"&")+(i||"callback")+"="+a;var l=setTimeout((function(){s(),r&&r()}),1e4);window[a]=function(t){clearTimeout(l),s(),e(t)},document.getElementsByTagName("head")[0].appendChild(o)}("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+r.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+r.apiKey_+"&c="+r.culture_,r.handleImageryMetadataResponse.bind(r),void 0,"jsonp"),r}return Zv(e,t),e.prototype.getApiKey=function(){return this.apiKey_},e.prototype.getImagerySet=function(){return this.imagerySet_},e.prototype.handleImageryMetadataResponse=function(t){if(200==t.statusCode&&"OK"==t.statusDescription&&"ValidCredentials"==t.authenticationResultCode&&1==t.resourceSets.length&&1==t.resourceSets[0].resources.length){var e=t.resourceSets[0].resources[0],r=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,n=Sy(this.getProjection()),i=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/i:[e.imageWidth/i,e.imageHeight/i],a=my({extent:n,minZoom:e.zoomMin,maxZoom:r,tileSize:o});this.tileGrid=a;var s=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=Py(e.imageUrlSubdomains.map((function(t){var r=[0,0,0],n=e.imageUrl.replace("{subdomain}",t).replace("{culture}",s);return function(t,e,i){if(t){op(t[0],t[1],t[2],r);var o=n;return l&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,r,n=t[0],i=new Array(n),o=1<<n-1;for(e=0;e<n;++e)r=48,t[1]&o&&(r+=1),t[2]&o&&(r+=2),i[e]=String.fromCharCode(r),o>>=1;return i.join("")}(r))}}}))),e.imageryProviders){var u=Or(Er("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var r=[],n=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(n.resolution,this.zDirection),a=i.getTileCoordForCoordAndZ(n.center,o)[0];return e.imageryProviders.map((function(e){for(var n=!1,i=e.coverageAreas,o=0,s=i.length;o<s;++o){var l=i[o];if(a>=l.zoomMin&&a<=l.zoomMax){var h=l.bbox;if(Re(Oe([h[1],h[0],h[3],h[2]],u),t.extent)){n=!0;break}}}n&&r.push(e.attribution)})),r.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),r}.bind(this))}this.setState(Eo)}else this.setState(To)},e}(Yy),qv=Hv,Jv=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qv=function(t){function e(e){var r=e||{},n=void 0===r.imageSmoothing||r.imageSmoothing;void 0!==r.interpolate&&(n=r.interpolate);var i=void 0!==r.projection?r.projection:"EPSG:3857",o=void 0!==r.tileGrid?r.tileGrid:my({extent:Sy(i),maxResolution:r.maxResolution,maxZoom:r.maxZoom,minZoom:r.minZoom,tileSize:r.tileSize});return t.call(this,{attributions:r.attributions,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,interpolate:n,opaque:r.opaque,projection:i,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileGrid:o,tileLoadFunction:r.tileLoadFunction,tilePixelRatio:r.tilePixelRatio,tileUrlFunction:r.tileUrlFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,attributionsCollapsible:r.attributionsCollapsible,zDirection:r.zDirection})||this}return Jv(e,t),e}(Yy),$v=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),tm=function(t){function e(e,r,n,i,o,a,s){var l=this,u=e.getExtent(),h=r.getExtent(),c=h?Ce(n,h):n,p=Ny(e,r,me(c),i),f=new ky(e,r,c,u,.5*p,i),d=a(f.calculateSourceExtent(),p,o),g=d?qn:ti,_=d?d.getPixelRatio():1;return(l=t.call(this,n,i,_,g)||this).targetProj_=r,l.maxSourceExtent_=u,l.triangulation_=f,l.targetResolution_=i,l.targetExtent_=n,l.sourceImage_=d,l.sourcePixelRatio_=_,l.interpolate_=s,l.canvas_=null,l.sourceListenerKey_=null,l}return $v(e,t),e.prototype.disposeInternal=function(){this.state==Jn&&this.unlistenSource_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.getProjection=function(){return this.targetProj_},e.prototype.reproject_=function(){var t=this.sourceImage_.getState();if(t==Qn){var e=be(this.targetExtent_)/this.targetResolution_,r=Se(this.targetExtent_)/this.targetResolution_;this.canvas_=By(e,r,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==qn){this.state=Jn,this.changed();var t=this.sourceImage_.getState();t==Qn||t==$n?this.reproject_():(this.sourceListenerKey_=N(this.sourceImage_,T,(function(t){var e=this.sourceImage_.getState();e!=Qn&&e!=$n||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){z(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(hs),em=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),rm="imageloadstart",nm="imageloadend",im="imageloaderror",om=function(t){function e(e,r){var n=t.call(this,e)||this;return n.image=r,n}return em(e,t),e}(s);function am(t,e){t.getImage().src=e}var sm=function(t){function r(e){var r=this,n=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(n=e.interpolate),(r=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state,interpolate:n})||this).on,r.once,r.un,r.resolutions_=void 0!==e.resolutions?e.resolutions:null,r.reprojectedImage_=null,r.reprojectedRevision_=0,r}return em(r,t),r.prototype.getResolutions=function(){return this.resolutions_},r.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=p(this.resolutions_,t,0);t=this.resolutions_[e]}return t},r.prototype.getImage=function(t,e,r,n){var i=this.getProjection();if(i&&n&&!Pr(i,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Pr(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&he(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new tm(i,n,t,e,r,function(t,e,r){return this.getImageInternal(t,e,r,i)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(n=i),this.getImageInternal(t,e,r,n)},r.prototype.getImageInternal=function(t,r,n,i){return e()},r.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case Jn:this.loading=!0,this.dispatchEvent(new om(rm,e));break;case Qn:this.loading=!1,this.dispatchEvent(new om(nm,e));break;case $n:this.loading=!1,this.dispatchEvent(new om(im,e))}},r}(js);function lm(t,e){var r=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&r.push(t+"="+encodeURIComponent(e[t]))}));var n=r.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+n}var um="1.3.0",hm="carmentaserver",cm="geoserver",pm="mapserver",fm="qgis",dm=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),gm=[101,101],_m=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;return void 0!==n.interpolate&&(i=n.interpolate),(r=t.call(this,{attributions:n.attributions,interpolate:i,projection:n.projection,resolutions:n.resolutions})||this).crossOrigin_=void 0!==n.crossOrigin?n.crossOrigin:null,r.url_=n.url,r.imageLoadFunction_=void 0!==n.imageLoadFunction?n.imageLoadFunction:am,r.params_=n.params||{},r.v13_=!0,r.updateV13_(),r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.image_=null,r.imageSize_=[0,0],r.renderedRevision_=0,r.ratio_=void 0!==n.ratio?n.ratio:1.5,r}return dm(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){if(void 0!==this.url_){var i=Er(r),o=this.getProjection();o&&o!==i&&(e=Ny(o,i,t,e),t=Ir(t,i,o));var a=we(t,e,0,gm),s={SERVICE:"WMS",VERSION:um,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(s,this.params_,n);var l=Ue((t[0]-a[0])/e,4),u=Ue((a[3]-t[1])/e,4);return s[this.v13_?"I":"X"]=l,s[this.v13_?"J":"Y"]=u,this.getRequestUrl_(a,gm,1,o||i,s)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var r={SERVICE:"WMS",VERSION:um,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i/28e-5}return m(r,e),lm(this.url_,r)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,r,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==r||this.hidpi_&&void 0!==this.serverType_||(r=1);var i=e/r,o=me(t),a=we(o,i,0,[Ve(be(t)/i,4),Ve(Se(t)/i,4)]),s=we(o,i,0,[Ve(this.ratio_*be(t)/i,4),Ve(this.ratio_*Se(t)/i,4)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==r&&re(l.getExtent(),a))return l;var u={SERVICE:"WMS",VERSION:um,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};m(u,this.params_),this.imageSize_[0]=ze(be(s)/i,4),this.imageSize_[1]=ze(Se(s)/i,4);var h=this.getRequestUrl_(s,this.imageSize_,r,n,u);return this.image_=new fs(s,e,r,h,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(T,this.handleImageChange.bind(this)),this.image_},e.prototype.getImageLoadFunction=function(){return this.imageLoadFunction_},e.prototype.getRequestUrl_=function(t,e,r,n,i){if(nt(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=r)switch(this.serverType_){case cm:var o=90*r+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case pm:i.MAP_RESOLUTION=90*r;break;case hm:case fm:i.DPI=90*r;break;default:nt(!1,8)}i.WIDTH=e[0],i.HEIGHT=e[1];var a,s=n.getAxisOrientation();return a=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=a.join(","),lm(this.url_,i)},e.prototype.getUrl=function(){return this.url_},e.prototype.setImageLoadFunction=function(t){this.image_=null,this.imageLoadFunction_=t,this.changed()},e.prototype.setUrl=function(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())},e.prototype.updateParams=function(t){m(this.params_,t),this.updateV13_(),this.image_=null,this.changed()},e.prototype.updateV13_=function(){var t=this.params_.VERSION||um;this.v13_=fr(t,"1.3")>=0},e}(sm),ym=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),vm=function(t){function e(e){var r,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate),r=void 0!==n.attributions?n.attributions:['&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var o=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",a=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:r,attributionsCollapsible:!1,cacheSize:n.cacheSize,crossOrigin:o,interpolate:i,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,opaque:void 0===n.opaque||n.opaque,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,transition:n.transition,url:a,wrapX:n.wrapX,zDirection:n.zDirection})||this}return ym(e,t),e}(Qv),mm=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),xm=function(t){function e(e){var r=this,n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var o=n.params||{},a=!("TRANSPARENT"in o)||o.TRANSPARENT;return(r=t.call(this,{attributions:n.attributions,attributionsCollapsible:n.attributionsCollapsible,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,interpolate:i,opaque:!a,projection:n.projection,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileClass:n.tileClass,tileGrid:n.tileGrid,tileLoadFunction:n.tileLoadFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,zDirection:n.zDirection})||this).gutter_=void 0!==n.gutter?n.gutter:0,r.params_=o,r.v13_=!0,r.serverType_=n.serverType,r.hidpi_=void 0===n.hidpi||n.hidpi,r.tmpExtent_=[1/0,1/0,-1/0,-1/0],r.updateV13_(),r.setKey(r.getKeyForParams_()),r}return mm(e,t),e.prototype.getFeatureInfoUrl=function(t,e,r,n){var i=Er(r),o=this.getProjection(),a=this.getTileGrid();a||(a=this.getTileGridForProjection(i));var s=a.getZForResolution(e,this.zDirection),l=a.getTileCoordForCoordAndZ(t,s);if(!(a.getResolutions().length<=l[0])){var u=a.getResolution(l[0]),h=a.getTileCoordExtent(l,this.tmpExtent_),c=ii(a.getTileSize(l[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=ei(c,p,this.tmpSize),h=Qt(h,u*p,h)),o&&o!==i&&(u=Ny(o,i,t,u),h=function(t,e,r,n){return Oe(t,Fr(e,r),void 0,n)}(h,i,o),t=Ir(t,i,o));var f={SERVICE:"WMS",VERSION:um,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(f,this.params_,n);var d=Math.floor((t[0]-h[0])/u),g=Math.floor((h[3]-t[1])/u);return f[this.v13_?"I":"X"]=d,f[this.v13_?"J":"Y"]=g,this.getRequestUrl_(l,c,h,1,o||i,f)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.urls[0]){var r={SERVICE:"WMS",VERSION:um,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var n=this.params_.LAYERS;if(!(!Array.isArray(n)||1===n.length))return;r.LAYER=n}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;r.SCALE=t*i/28e-5}return m(r,e),lm(this.urls[0],r)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,r,n,i,o){var a=this.urls;if(a){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=n)switch(this.serverType_){case cm:var s=90*n+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+s:o.FORMAT_OPTIONS="dpi:"+s;break;case pm:o.MAP_RESOLUTION=90*n;break;case hm:case fm:o.DPI=90*n;break;default:nt(!1,52)}var l,u=i.getAxisOrientation(),h=r;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=r[0],h[0]=r[1],h[1]=c,c=r[2],h[2]=r[3],h[3]=c}if(o.BBOX=h.join(","),1==a.length)l=a[0];else l=a[Ge(up(t),a.length)];return lm(l,o)}},e.prototype.getTilePixelRatio=function(t){return this.hidpi_&&void 0!==this.serverType_?t:1},e.prototype.getKeyForParams_=function(){var t=0,e=[];for(var r in this.params_)e[t++]=r+"-"+this.params_[r];return e.join("/")},e.prototype.updateParams=function(t){m(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())},e.prototype.updateV13_=function(){var t=this.params_.VERSION||um;this.v13_=fr(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,r){var n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(r)),!(n.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=n.getResolution(t[0]),o=n.getTileCoordExtent(t,this.tmpExtent_),a=ii(n.getTileSize(t[0]),this.tmpSize),s=this.gutter_;0!==s&&(a=ei(a,s,this.tmpSize),o=Qt(o,i*s,o)),1!=e&&(a=ni(a,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:um,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return m(l,this.params_),this.getRequestUrl_(t,a,o,e,r,l)}},e}(Yy),wm=xm;W.unByKey=X;let Sm={Control:gu,Zoom:Eu,Attribution:mu,ScaleLine:Du,LayerSwitcher:Pp},Cm={GeoJSON:Up,KML:wg,MVT:$g},Em={Group:bl,Tile:Jy,Vector:Ms,VectorTile:cy,WebGLPoints:Kv,Heatmap:U_,Image:q_},Tm={toLonLat:function(t,e){var r=Ir(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=r[0];return(n<-180||n>180)&&(r[0]=Ge(n+180,360)-180),r},fromLonLat:function(t,e){return Ir(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}},bm={LineString:Zn,Point:mn,MultiPoint:tc},Rm={Icon:ms,Style:io,Text:lo,Stroke:Hn,Fill:Un,Circle:Qi},Pm={OSM:vm,XYZ:Qv,TileWMS:wm,BingMaps:qv,Vector:tl,VectorTile:My,ImageWMS:_m};t.Collection=rt,t.Feature=at,t.Map=np,t.Observable=W,t.View=lu,t.control=Sm,t.format=Cm,t.geom=bm,t.interaction=ep,t.layer=Em,t.proj=Tm,t.source=Pm,t.sphere=pr,t.style=Rm,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ol-custom.js.map