Files
tar1090/html/libs/ol-custom013.js
Matthias Wirth c11d57a6fb ol stuff
2021-10-29 21:22:01 +02:00

5 lines
521 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 n=0;function r(t){return t.ol_uid||(t.ol_uid=String(++n))}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 n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},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 n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),s=function(t){function e(e){var n=this,r="Assertion failed. See https://openlayers.org/en/"+("v"+"6.9.0".split("-")[0])+"/doc/errors/#"+e+" for details.";return(n=t.call(this,r)||this).code=e,n.name="AssertionError",n.message=r,n}return o(e,t),e}(Error),a=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,n){var r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;var i=void 0;if(n>0){for(i=1;i<r;++i)if(t[i]<e)return i-1}else if(n<0){for(i=1;i<r;++i)if(t[i]<=e)return i}else for(i=1;i<r;++i){if(t[i]==e)return i;if(t[i]<e)return"function"==typeof n?n(e,t[i-1],t[i])>0?i-1:i:t[i-1]-e<e-t[i]?i-1:i}return r-1}function f(t,e,n){for(;e<n;){var r=t[e];t[e]=t[n],t[n]=r,++e,--n}}function d(t,e){for(var n=Array.isArray(e)?e:[e],r=n.length,i=0;i<r;i++)t[t.length]=n[i]}function g(t,e){var n=t.length;if(n!==e.length)return!1;for(var r=0;r<n;r++)if(t[r]!==e[r])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 n=Object(t),r=1,i=arguments.length;r<i;++r){var o=arguments[r];if(null!=o)for(var s in o)o.hasOwnProperty(s)&&(n[s]=o[s])}return n};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 n in t)e.push(t[n]);return e};function S(t){var e;for(e in t)return!1;return!e}var C=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(t){function e(e){var n=t.call(this)||this;return n.eventTarget_=e,n.pendingRemovals_=null,n.dispatching_=null,n.listeners_=null,n}return C(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),r=n[t]||(n[t]=[]);-1===r.indexOf(e)&&r.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new a(t):t,n=e.type;e.target||(e.target=this.eventTarget_||this);var r,i=this.listeners_&&this.listeners_[n];if(i){var o=this.dispatching_||(this.dispatching_={}),s=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,s[n]=0),++o[n];for(var l=0,u=i.length;l<u;++l)if(!1===(r="handleEvent"in i[l]?i[l].handleEvent(e):i[l].call(this,e))||e.propagationStopped){r=!1;break}if(--o[n],0===o[n]){var h=s[n];for(delete s[n];h--;)this.removeEventListener(n,v);delete o[n]}return r}},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 n=this.listeners_&&this.listeners_[t];if(n){var r=n.indexOf(e);-1!==r&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[r]=v,++this.pendingRemovals_[t]):(n.splice(r,1),0===n.length&&delete this.listeners_[t]))}},e}(u),T="change",b="error",R="contextmenu",P="click",O="dblclick",F="dragenter",I="dragover",M="drop",L="keydown",A="keypress",D="load",k="resize",j="touchmove",G="wheel";function N(t,e,n,r,i){if(r&&r!==t&&(n=n.bind(r)),i){var o=n;n=function(){t.removeEventListener(e,n),o.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function z(t,e,n,r){return N(t,e,n,r,!0)}function B(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),x(t))}var U=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),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 n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=N(this,t[i],e);return r}return N(this,t,e)},e.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var r=t.length;n=new Array(r);for(var i=0;i<r;++i)n[i]=z(this,t[i],e)}else n=z(this,t,e);return e.ol_key=n,n},e.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)X(n);else if(Array.isArray(t))for(var r=0,i=t.length;r<i;++r)this.removeEventListener(t[r],e);else this.removeEventListener(t,e)},e}(E);function X(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)B(t[e]);else B(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,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Z=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.key=n,i.oldValue=r,i}return K(e,t),e}(a),H=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,r(n),n.values_=null,void 0!==e&&n.setProperties(e),n}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 n;n="change:"+t,this.dispatchEvent(new Z(n,t,e)),n=l,this.dispatchEvent(new Z(n,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,n){var r=this.values_||(this.values_={});if(n)r[t]=e;else{var i=r[t];r[t]=e,i!==e&&this.notify(t,i)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],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 n=this.values_[t];delete this.values_[t],S(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(W),q=H,J="add",Q="remove",$=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),tt="length",et=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.element=n,i.index=r,i}return $(e,t),e}(a),nt=function(t){function e(e,n){var r=t.call(this)||this;r.on,r.once,r.un;var i=n||{};if(r.unique_=!!i.unique,r.array_=e||[],r.unique_)for(var o=0,s=r.array_.length;o<s;++o)r.assertUnique_(r.array_[o],o);return r.updateLength_(),r}return $(e,t),e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,n=t.length;e<n;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,n=0,r=e.length;n<r;++n)t(e[n],n,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_,n=0,r=e.length;n<r;++n)if(e[n]===t)return this.removeAt(n)},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 n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var r=this.array_[t];this.array_[t]=e,this.dispatchEvent(new et(Q,r,t)),this.dispatchEvent(new et(J,e,t))}else{for(var i=n;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 n=0,r=this.array_.length;n<r;++n)if(this.array_[n]===t&&n!==e)throw new s(58)},e}(q);function rt(t,e){if(!t)throw new s(e)}var it=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ot=function(t){function e(e){var n=t.call(this)||this;if(n.on,n.once,n.un,n.id_=void 0,n.geometryName_="geometry",n.style_=null,n.styleFunction_=void 0,n.geometryChangeKey_=null,n.addChangeListener(n.geometryName_,n.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){var r=e;n.setGeometry(r)}else{var i=e;n.setProperties(i)}return n}return it(e,t),e.prototype.clone=function(){var t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());var n=this.getGeometry();n&&t.setGeometry(n.clone());var r=this.getStyle();return r&&t.setStyle(r),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_&&(B(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:(rt("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 st=ot,at="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}(),Mt=new Array(6);function Lt(t){return Dt(t,1,0,0,1,0,0)}function At(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],s=t[4],a=t[5],l=e[0],u=e[1],h=e[2],c=e[3],p=e[4],f=e[5];return t[0]=n*l+i*u,t[1]=r*l+o*u,t[2]=n*h+i*c,t[3]=r*h+o*c,t[4]=n*p+i*f+s,t[5]=r*p+o*f+a,t}function Dt(t,e,n,r,i,o,s){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=s,t}function kt(t,e){var n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function jt(t,e,n){return At(t,Dt(Mt,e,0,0,n,0,0))}function Gt(t,e,n,r,i,o,s,a){var l=Math.sin(o),u=Math.cos(o);return t[0]=r*u,t[1]=i*l,t[2]=-r*l,t[3]=i*u,t[4]=s*r*u-a*r*l+e,t[5]=s*i*l+a*i*u+n,t}function Nt(t,e){var n,r=(n=e)[0]*n[3]-n[1]*n[2];rt(0!==r,32);var i=e[0],o=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/r,t[1]=-o/r,t[2]=-s/r,t[3]=i/r,t[4]=(s*u-a*l)/r,t[5]=-(i*u-o*l)/r,t}function zt(t){var e="matrix("+t.join(", ")+")";if(Ot)return e;var n=Tt||(Tt=document.createElement("div"));return n.style.transform=e,n.style.transform}var Bt="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(),n=0,r=t.length;n<r;++n)pe(e,t[n]);return e}function Qt(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[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,n){var r,i;return(r=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*r+(i=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*i}function ee(t,e){return re(t,e[0],e[1])}function ne(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function re(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function ie(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],s=e[0],a=e[1],l=Wt;return s<n?l|=qt:s>i&&(l|=Zt),a<r?l|=Ht:a>o&&(l|=Kt),l===Wt&&(l=Yt),l}function oe(){return[1/0,1/0,-1/0,-1/0]}function se(t,e,n,r,i){return i?(i[0]=t,i[1]=e,i[2]=n,i[3]=r,i):[t,e,n,r]}function ae(t){return se(1/0,1/0,-1/0,-1/0,t)}function le(t,e){var n=t[0],r=t[1];return se(n,r,n,r,e)}function ue(t,e,n,r,i){return fe(ae(i),t,e,n,r)}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,n,r,i){for(;n<r;n+=i)de(t,e[n],e[n+1]);return t}function de(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function ge(t,e){var n;return(n=e(ye(t)))||(n=e(ve(t)))||(n=e(Te(t)))?n:(n=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 n;return e===Bt?n=ye(t):e===Ut?n=ve(t):e===Vt?n=Ee(t):e===Xt?n=Te(t):rt(!1,13),n}function we(t,e,n,r,i){var o=e*r[0]/2,s=e*r[1]/2,a=Math.cos(n),l=Math.sin(n),u=o*a,h=o*l,c=s*a,p=s*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 se(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,n){var r=n||[1/0,1/0,-1/0,-1/0];return Re(t,e)?(t[0]>e[0]?r[0]=t[0]:r[0]=e[0],t[1]>e[1]?r[1]=t[1]:r[1]=e[1],t[2]<e[2]?r[2]=t[2]:r[2]=e[2],t[3]<e[3]?r[3]=t[3]:r[3]=e[3]):ae(r),r}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,n,r){var i=[];if(r>1)for(var o=t[2]-t[0],s=t[3]-t[1],a=0;a<r;++a)i.push(t[0]+o*a/r,t[1],t[2],t[1]+s*a/r,t[2]-o*a/r,t[3],t[0],t[3]-s*a/r);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=(a=0,i.length);a<h;a+=2)l.push(i[a]),u.push(i[a+1]);return function(t,e,n){return se(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),n)}(l,u,n)}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,n){return Math.min(Math.max(t,e),n)}var Me="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Le="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Ae(t,e,n,r,i,o){var s=i-n,a=o-r;if(0!==s||0!==a){var l=((t-n)*s+(e-r)*a)/(s*s+a*a);l>1?(n=i,r=o):l>0&&(n+=s*l,r+=a*l)}return De(t,e,n,r)}function De(t,e,n,r){var i=n-t,o=r-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 n=t%e;return n*e<0?n+e:n}function Ne(t,e,n){return t+n*(e-t)}var ze=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Be=6378137,Ue=Math.PI*Be,Ve=[-Ue,-Ue,Ue,Ue],Xe=[-180,-85,180,85],We=Be*Math.log(Math.tan(Math.PI/2)),Ye=function(t){function e(e){return t.call(this,{code:e,units:St.METERS,extent:Ve,global:!0,worldExtent:Xe,getPointResolution:function(t,e){return t/Me(e[1]/Be)}})||this}return ze(e,t),e}(Fe),Ke=[new Ye("EPSG:3857"),new Ye("EPSG:102100"),new Ye("EPSG:102113"),new Ye("EPSG:900913"),new Ye("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ye("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ze(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;s<r;s+=i){o[s]=Ue*t[s]/180;var a=Be*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>We?a=We:a<-We&&(a=-We),o[s+1]=a}return o}function He(t,e,n){var r=t.length,i=n>1?n:2,o=e;void 0===o&&(o=i>2?t.slice():new Array(r));for(var s=0;s<r;s+=i)o[s]=180*t[s]/Ue,o[s+1]=360*Math.atan(Math.exp(t[s+1]/Be))/Math.PI-90;return o}var qe=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Je=[-180,-90,180,90],Qe=6378137*Math.PI/180,$e=function(t){function e(e,n){return t.call(this,{code:e,units:St.DEGREES,extent:Je,axisOrientation:n,global:!0,metersPerUnit:Qe,worldExtent:Je})||this}return qe(e,t),e}(Fe),tn=[new $e("CRS:84"),new $e("EPSG:4326","neu"),new $e("urn:ogc:def:crs:OGC:1.3:CRS84"),new $e("urn:ogc:def:crs:OGC:2:84"),new $e("http://www.opengis.net/def/crs/OGC/1.3/CRS84","neu"),new $e("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new $e("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],en={};var nn={};function rn(t,e,n){var r=t.getCode(),i=e.getCode();r in nn||(nn[r]={}),nn[r][i]=n}var on=6371008.8;function sn(t,e,n){var r=n||on,i=je(t[1]),o=je(e[1]),s=(o-i)/2,a=je(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(i)*Math.cos(o);return 2*r*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}function an(t,e){for(var n=0,r=0,i=t.length;r<i-1;++r)n+=sn(t[r],t[r+1],e);return n}function ln(t,e){for(var n=0,r=t.length,i=t[r-1][0],o=t[r-1][1],s=0;s<r;s++){var a=t[s][0],l=t[s][1];n+=je(a-i)*(2+Math.sin(je(o))+Math.sin(je(l))),i=a,o=l}return n*e*e/2}var un=Object.freeze({__proto__:null,DEFAULT_RADIUS:on,getDistance:sn,getLength:function t(e,n){var r=n||{},i=r.radius||on,o=r.projection||"EPSG:3857",s=e.getType();s!==vt&&(e=e.clone().transform(o,"EPSG:4326"));var a,l,u,h,c,p,f=0;switch(s){case ct:case gt:break;case pt:case ft:f=an(a=e.getCoordinates(),i);break;case _t:case dt:for(u=0,h=(a=e.getCoordinates()).length;u<h;++u)f+=an(a[u],i);break;case yt:for(u=0,h=(a=e.getCoordinates()).length;u<h;++u)for(c=0,p=(l=a[u]).length;c<p;++c)f+=an(l[c],i);break;case vt:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],n);break;default:throw new Error("Unsupported geometry type: "+s)}return f},getArea:function t(e,n){var r=n||{},i=r.radius||on,o=r.projection||"EPSG:3857",s=e.getType();s!==vt&&(e=e.clone().transform(o,"EPSG:4326"));var a,l,u,h,c,p,f=0;switch(s){case ct:case gt:case pt:case _t:case ft:break;case dt:for(a=e.getCoordinates(),f=Math.abs(ln(a[0],i)),u=1,h=a.length;u<h;++u)f-=Math.abs(ln(a[u],i));break;case yt:for(u=0,h=(a=e.getCoordinates()).length;u<h;++u)for(l=a[u],f+=Math.abs(ln(l[0],i)),c=1,p=l.length;c<p;++c)f-=Math.abs(ln(l[c],i));break;case vt:var d=e.getGeometries();for(u=0,h=d.length;u<h;++u)f+=t(d[u],n);break;default:throw new Error("Unsupported geometry type: "+s)}return f},offset:function(t,e,n,r){var i=r||on,o=je(t[1]),s=je(t[0]),a=e/i,l=Math.asin(Math.sin(o)*Math.cos(a)+Math.cos(o)*Math.sin(a)*Math.cos(n));return[ke(s+Math.atan2(Math.sin(n)*Math.sin(a)*Math.cos(o),Math.cos(a)-Math.sin(o)*Math.sin(l))),ke(l)]}});function hn(t,e){for(var n=(""+t).split("."),r=(""+e).split("."),i=0;i<Math.max(n.length,r.length);i++){var o=parseInt(n[i]||"0",10),s=parseInt(r[i]||"0",10);if(o>s)return 1;if(s>o)return-1}return 0}function cn(t,e){var n,r,i=t[0],o=t[1],s=e[0],a=e[1],l=s[0],u=s[1],h=a[0],c=a[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?(n=l,r=u):d>=1?(n=h,r=c):(n=l+d*p,r=u+d*f),[n,r]}function pn(t,e){for(var n=!0,r=t.length-1;r>=0;--r)if(t[r]!=e[r]){n=!1;break}return n}function fn(t,e){var n=Math.cos(e),r=Math.sin(e),i=t[0]*n-t[1]*r,o=t[1]*n+t[0]*r;return t[0]=i,t[1]=o,t}function dn(t,e){var n=t[0]-e[0],r=t[1]-e[1];return n*n+r*r}function gn(t,e){return Math.sqrt(dn(t,e))}function _n(t,e){return dn(t,cn(t,e))}function yn(t,e){if(e.canWrapX()){var n=be(e.getExtent()),r=function(t,e,n){var r=e.getExtent(),i=0;if(e.canWrapX()&&(t[0]<r[0]||t[0]>r[2])){var o=n||be(r);i=Math.floor((t[0]-r[0])/o)}return i}(t,e,n);r&&(t[0]-=r*n)}return t}function vn(t,e,n){var r;if(void 0!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];r=e}else r=t.slice();return r}function mn(t,e,n){if(void 0!==e&&t!==e){for(var r=0,i=t.length;r<i;++r)e[r]=t[r];t=e}return t}function xn(t){!function(t,e){en[t]=e}(t.getCode(),t),rn(t,t,vn)}function wn(t){return"string"==typeof t?en[e=t]||en[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function Sn(t,e,n,r){var i,o=(t=wn(t)).getPointResolutionFunc();if(o){if(i=o(e,n),r&&r!==t.getUnits())(a=t.getMetersPerUnit())&&(i=i*a/wt[r])}else{var s=t.getUnits();if(s==St.DEGREES&&!r||r==St.DEGREES)i=e;else{var a,l=bn(t,wn("EPSG:4326"));if(l===mn&&s!==St.DEGREES)i=e*t.getMetersPerUnit();else{var u=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];i=(sn((u=l(u,u,2)).slice(0,2),u.slice(2,4))+sn(u.slice(4,6),u.slice(6,8)))/2}void 0!==(a=r?wt[r]:t.getMetersPerUnit())&&(i/=a)}}return i}function Cn(t){!function(t){t.forEach(xn)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&rn(e,t,vn)}))}))}function En(t,e){return t?"string"==typeof t?wn(t):t:wn(e)}function Tn(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||bn(t,e)===vn)&&n}function bn(t,e){var n=function(t,e){var n;return t in nn&&e in nn[t]&&(n=nn[t][e]),n}(t.getCode(),e.getCode());return n||(n=mn),n}function Rn(t,e){return bn(wn(t),wn(e))}function Pn(t,e,n){return Rn(e,n)(t,void 0,t.length)}var On,Fn,In;function Mn(t,e){return t}function Ln(t,e){return t}function An(t,e){return t}function Dn(t,e){return t}function kn(t,e,n,r,i,o){for(var s=o||[],a=0,l=e;l<n;l+=r){var u=t[l],h=t[l+1];s[a++]=i[0]*u+i[2]*h+i[4],s[a++]=i[1]*u+i[3]*h+i[5]}return o&&s.length!=a&&(s.length=a),s}function jn(t,e,n,r,i,o,s){for(var a=s||[],l=Math.cos(i),u=Math.sin(i),h=o[0],c=o[1],p=0,f=e;f<n;f+=r){var d=t[f]-h,g=t[f+1]-c;a[p++]=h+d*l-g*u,a[p++]=c+d*u+g*l;for(var _=f+2;_<f+r;++_)a[p++]=t[_]}return s&&a.length!=p&&(a.length=p),a}function Gn(t,e,n,r,i,o,s){for(var a=s||[],l=0,u=e;u<n;u+=r){a[l++]=t[u]+i,a[l++]=t[u+1]+o;for(var h=u+2;h<u+r;++h)a[l++]=t[h]}return s&&a.length!=l&&(a.length=l),a}Cn(Ke),Cn(tn),On=Ke,Fn=Ze,In=He,tn.forEach((function(t){On.forEach((function(e){rn(t,e,Fn),rn(e,t,In)}))}));var Nn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),zn=[1,0,0,1,0,0],Bn=function(t){function n(){var e,n,r,i,o,s=t.call(this)||this;return s.extent_=[1/0,1/0,-1/0,-1/0],s.extentRevision_=-1,s.simplifiedGeometryMaxMinSquaredTolerance=0,s.simplifiedGeometryRevision=0,s.simplifyTransformedInternal=(e=function(t,e,n){if(!n)return this.getSimplifiedGeometry(e);var r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(e)},o=!1,function(){var t=Array.prototype.slice.call(arguments);return o&&this===i&&g(t,r)||(o=!0,i=this,r=t,n=e.apply(this,arguments)),n}),s}return Nn(n,t),n.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},n.prototype.clone=function(){return e()},n.prototype.closestPointXY=function(t,n,r,i){return e()},n.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},n.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},n.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},n.prototype.computeExtent=function(t){return e()},n.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&ae(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)},n.prototype.rotate=function(t,n){e()},n.prototype.scale=function(t,n,r){e()},n.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},n.prototype.getSimplifiedGeometry=function(t){return e()},n.prototype.getType=function(){return e()},n.prototype.applyTransform=function(t){e()},n.prototype.intersectsExtent=function(t){return e()},n.prototype.translate=function(t,n){e()},n.prototype.transform=function(t,e){var n=wn(t),r=n.getUnits()==St.TILE_PIXELS?function(t,r,i){var o=n.getExtent(),s=n.getWorldExtent(),a=Se(s)/Se(o);return Gt(zn,s[0],s[3],a,-a,0,0,0),kn(t,0,t.length,i,zn,r),Rn(n,e)(t,r,i)}:Rn(n,e);return this.applyTransform(r),this},n}(q),Un=Bn,Vn=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xn=function(t){function n(){var e=t.call(this)||this;return e.layout=at,e.stride=2,e.flatCoordinates=null,e}return Vn(n,t),n.prototype.computeExtent=function(t){return ue(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)},n.prototype.getCoordinates=function(){return e()},n.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},n.prototype.getFlatCoordinates=function(){return this.flatCoordinates},n.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},n.prototype.getLayout=function(){return this.layout},n.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)},n.prototype.getSimplifiedGeometryInternal=function(t){return this},n.prototype.getStride=function(){return this.stride},n.prototype.setFlatCoordinates=function(t,e){this.stride=Wn(t),this.layout=t,this.flatCoordinates=e},n.prototype.setCoordinates=function(t,n){e()},n.prototype.setLayout=function(t,e,n){var r;if(t)r=Wn(t);else{for(var i=0;i<n;++i){if(0===e.length)return this.layout=at,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=at:3==t?e=lt:4==t&&(e=ht);return e}(r=e.length)}this.layout=t,this.stride=r},n.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},n.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var r=this.getStride();jn(n,0,n.length,r,t,e,n),this.changed()}},n.prototype.scale=function(t,e,n){var r=e;void 0===r&&(r=t);var i=n;i||(i=me(this.getExtent()));var o=this.getFlatCoordinates();if(o){var s=this.getStride();!function(t,e,n,r,i,o,s,a){for(var l=a||[],u=s[0],h=s[1],c=0,p=e;p<n;p+=r){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+r;++g)l[c++]=t[g]}a&&l.length!=c&&(l.length=c)}(o,0,o.length,s,t,r,i,o),this.changed()}},n.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var r=this.getStride();Gn(n,0,n.length,r,t,e,n),this.changed()}},n}(Un);function Wn(t){var e;return t==at?e=2:t==lt||t==ut?e=3:t==ht&&(e=4),e}var Yn=Xn;function Kn(t,e,n,r,i,o,s){var a,l=t[e],u=t[e+1],h=t[n]-l,c=t[n+1]-u;if(0===h&&0===c)a=e;else{var p=((i-l)*h+(o-u)*c)/(h*h+c*c);if(p>1)a=n;else{if(p>0){for(var f=0;f<r;++f)s[f]=Ne(t[e+f],t[n+f],p);return void(s.length=r)}a=e}}for(f=0;f<r;++f)s[f]=t[a+f];s.length=r}function Zn(t,e,n,r,i){var o=t[e],s=t[e+1];for(e+=r;e<n;e+=r){var a=t[e],l=t[e+1],u=De(o,s,a,l);u>i&&(i=u),o=a,s=l}return i}function Hn(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];i=Zn(t,e,a,r,i),e=a}return i}function qn(t,e,n,r,i,o,s,a,l,u,h){if(e==n)return u;var c,p;if(0===i){if((p=De(s,a,t[e],t[e+1]))<u){for(c=0;c<r;++c)l[c]=t[e+c];return l.length=r,p}return u}for(var f=h||[NaN,NaN],d=e+r;d<n;)if(Kn(t,d-r,d,r,s,a,f),(p=De(s,a,f[0],f[1]))<u){for(u=p,c=0;c<r;++c)l[c]=f[c];l.length=r,d+=r}else d+=r*Math.max((Math.sqrt(p)-Math.sqrt(u))/i|0,1);if(o&&(Kn(t,n-r,e,r,s,a,f),(p=De(s,a,f[0],f[1]))<u)){for(u=p,c=0;c<r;++c)l[c]=f[c];l.length=r}return u}function Jn(t,e,n,r,i,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,f=n.length;p<f;++p){var d=n[p];u=qn(t,e,d,r,i,o,s,a,l,u,c),e=d}return u}function Qn(t,e,n,r){for(var i=0,o=n.length;i<o;++i)t[e++]=n[i];return e}function $n(t,e,n,r){for(var i=0,o=n.length;i<o;++i)for(var s=n[i],a=0;a<r;++a)t[e++]=s[a];return e}function tr(t,e,n,r,i){for(var o=i||[],s=0,a=0,l=n.length;a<l;++a){var u=$n(t,e,n[a],r);o[s++]=u,e=u}return o.length=s,o}function er(t,e,n,r,i,o,s){var a=(n-e)/r;if(a<3){for(;e<n;e+=r)o[s++]=t[e],o[s++]=t[e+1];return s}var l=new Array(a);l[0]=1,l[a-1]=1;for(var u=[e,n-r],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+r;v<c;v+=r){var m=Ae(t[v],t[v+1],d,g,_,y);m>f&&(h=v,f=m)}f>i&&(l[(h-e)/r]=1,p+r<h&&u.push(p,h),h+r<c&&u.push(h,c))}for(v=0;v<a;++v)l[v]&&(o[s++]=t[e+v*r],o[s++]=t[e+v*r+1]);return s}function nr(t,e){return e*Math.round(t/e)}function rr(t,e,n,r,i,o,s){if(e==n)return s;var a,l,u=nr(t[e],i),h=nr(t[e+1],i);e+=r,o[s++]=u,o[s++]=h;do{if(a=nr(t[e],i),l=nr(t[e+1],i),(e+=r)==n)return o[s++]=a,o[s++]=l,s}while(a==u&&l==h);for(;e<n;){var c=nr(t[e],i),p=nr(t[e+1],i);if(e+=r,c!=a||p!=l){var f=a-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)?(a=c,l=p):(o[s++]=a,o[s++]=l,u=a,h=l,a=c,l=p)}}return o[s++]=a,o[s++]=l,s}function ir(t,e,n,r,i,o,s,a){for(var l=0,u=n.length;l<u;++l){var h=n[l];s=rr(t,e,h,r,i,o,s),a.push(s),e=h}return s}function or(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=e;a<n;a+=r)o[s++]=t.slice(a,a+r);return o.length=s,o}function sr(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=0,l=n.length;a<l;++a){var u=n[a];o[s++]=or(t,e,u,r,o[s]),e=u}return o.length=s,o}function ar(t,e,n,r,i){for(var o=void 0!==i?i:[],s=0,a=0,l=n.length;a<l;++a){var u=n[a];o[s++]=sr(t,e,u,r,o[s]),e=u[u.length-1]}return o.length=s,o}function lr(t,e,n,r){for(var i=0,o=t[n-r],s=t[n-r+1];e<n;e+=r){var a=t[e],l=t[e+1];i+=s*a-o*l,o=a,s=l}return i/2}function ur(t,e,n,r){for(var i=0,o=0,s=n.length;o<s;++o){var a=n[o];i+=lr(t,e,a,r),e=a}return i}var hr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cr=function(t){function e(e,n){var r=t.call(this)||this;return r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return hr(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,r){return r<te(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Zn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),qn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.getArea=function(){return lr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return or(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=er(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,at)},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=$n(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Yn),pr=cr,fr=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dr=function(t){function e(e,n){var r=t.call(this)||this;return r.setCoordinates(e,n),r}return fr(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,n,r){var i=this.flatCoordinates,o=De(t,e,i[0],i[1]);if(o<r){for(var s=this.stride,a=0;a<s;++a)n[a]=i[a];return n.length=s,o}return r},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 re(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=Qn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Yn),gr=dr;function _r(t,e,n,r,i){return!ge(i,(function(i){return!yr(t,e,n,r,i[0],i[1])}))}function yr(t,e,n,r,i,o){for(var s=0,a=t[n-r],l=t[n-r+1];e<n;e+=r){var u=t[e],h=t[e+1];l<=o?h>o&&(u-a)*(o-l)-(i-a)*(h-l)>0&&s++:h<=o&&(u-a)*(o-l)-(i-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function vr(t,e,n,r,i,o){if(0===n.length)return!1;if(!yr(t,e,n[0],r,i,o))return!1;for(var s=1,a=n.length;s<a;++s)if(yr(t,n[s-1],n[s],r,i,o))return!1;return!0}function mr(t,e,n,r,i,o,s){for(var a,l,u,c,p,f,d,g=i[o+1],_=[],y=0,v=n.length;y<v;++y){var m=n[y];for(c=t[m-r],f=t[m-r+1],a=e;a<m;a+=r)p=t[a],d=t[a+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],a=1,l=_.length;a<l;++a){p=_[a];var S=Math.abs(p-c);S>w&&vr(t,e,n,r,u=(c+p)/2,g)&&(x=u,w=S),c=p}return isNaN(x)&&(x=i[o]),s?(s.push(x,g,w),s):[x,g,w]}function xr(t,e,n,r,i){for(var o=[],s=0,a=n.length;s<a;++s){var l=n[s];o=mr(t,e,l,r,i,2*s,o),e=l[l.length-1]}return o}function wr(t,e,n,r,i){var o;for(e+=r;e<n;e+=r)if(o=i(t.slice(e-r,e),t.slice(e,e+r)))return o;return!1}function Sr(t,e,n,r,i){var o=fe([1/0,1/0,-1/0,-1/0],t,e,n,r);return!!Re(i,o)&&(!!ne(i,o)||(o[0]>=i[0]&&o[2]<=i[2]||(o[1]>=i[1]&&o[3]<=i[3]||wr(t,e,n,r,(function(t,e){return function(t,e,n){var r=!1,i=ie(t,e),o=ie(t,n);if(i===Yt||o===Yt)r=!0;else{var s=t[0],a=t[1],l=t[2],u=t[3],h=e[0],c=e[1],p=n[0],f=n[1],d=(f-c)/(p-h),g=void 0,_=void 0;o&Kt&&!(i&Kt)&&(r=(g=p-(f-u)/d)>=s&&g<=l),r||!(o&Zt)||i&Zt||(r=(_=f-(p-l)*d)>=a&&_<=u),r||!(o&Ht)||i&Ht||(r=(g=p-(f-a)/d)>=s&&g<=l),r||!(o&qt)||i&qt||(r=(_=f-(p-s)*d)>=a&&_<=u)}return r}(i,t,e)})))))}function Cr(t,e,n,r,i){if(!function(t,e,n,r,i){return!!(Sr(t,e,n,r,i)||yr(t,e,n,r,i[0],i[1])||yr(t,e,n,r,i[0],i[3])||yr(t,e,n,r,i[2],i[1])||yr(t,e,n,r,i[2],i[3]))}(t,e,n[0],r,i))return!1;if(1===n.length)return!0;for(var o=1,s=n.length;o<s;++o)if(_r(t,n[o-1],n[o],r,i)&&!Sr(t,n[o-1],n[o],r,i))return!1;return!0}function Er(t,e,n,r){for(;e<n-r;){for(var i=0;i<r;++i){var o=t[e+i];t[e+i]=t[n-r+i],t[n-r+i]=o}e+=r,n-=r}}function Tr(t,e,n,r){for(var i=0,o=t[n-r],s=t[n-r+1];e<n;e+=r){var a=t[e],l=t[e+1];i+=(a-o)*(l+s),o=a,s=l}return 0===i?void 0:i>0}function br(t,e,n,r,i){for(var o=void 0!==i&&i,s=0,a=n.length;s<a;++s){var l=n[s],u=Tr(t,e,l,r);if(0===s){if(o&&u||!o&&!u)return!1}else if(o&&!u||!o&&u)return!1;e=l}return!0}function Rr(t,e,n,r,i){for(var o=void 0!==i&&i,s=0,a=n.length;s<a;++s){var l=n[s],u=Tr(t,e,l,r);(0===s?o&&u||!o&&!u:o&&!u||!o&&u)&&Er(t,e,l,r),e=l}return e}function Pr(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o)e=Rr(t,e,n[o],r,i);return e}var Or=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fr=function(t){function e(e,n,r){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!==n&&r?(i.setFlatCoordinates(n,e),i.ends_=r):i.setCoordinates(e,n),i}return Or(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,n,r){return r<te(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Hn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Jn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return vr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return ur(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Rr(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,sr(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_=mr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new gr(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 pr(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,n=this.ends_,r=[],i=0,o=0,s=n.length;o<s;++o){var a=n[o],l=new pr(e.slice(i,a),t);r.push(l),i=a}return r},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;br(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Rr(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=ir(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,at,r)},e.prototype.getType=function(){return dt},e.prototype.intersectsExtent=function(t){return Cr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var n=tr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(Yn);function Ir(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=[e,n,e,i,r,i,r,n,e,n];return new Fr(o,at,[o.length])}function Mr(t,e,n){for(var r=e||32,i=t.getStride(),o=t.getLayout(),s=t.getCenter(),a=i*(r+1),l=new Array(a),u=0;u<a;u+=i){l[u]=0,l[u+1]=0;for(var h=2;h<i;h++)l[u+h]=s[h]}var c=[l.length],p=new Fr(l,o,c);return function(t,e,n,r){for(var i=t.getFlatCoordinates(),o=t.getStride(),s=i.length/o-1,a=r||0,l=0;l<=s;++l){var u=l*o,h=a+2*Ge(l,s)*Math.PI/s;i[u]=e[0]+n*Math.cos(h),i[u+1]=e[1]+n*Math.sin(h)}t.changed()}(p,s,t.getRadius(),n),p}var Lr="prerender",Ar="postrender",Dr="precompose",kr="postcompose",jr="rendercomplete",Gr=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 Nr(t,e,n,r,i,o,s){var a,l,u=(n-e)/r;if(1===u)a=e;else if(2===u)a=e,l=i;else if(0!==u){for(var c=t[e],p=t[e+1],f=0,d=[0],g=e+r;g<n;g+=r){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,n){for(var r,i,o=n||h,s=0,a=t.length,l=!1;s<a;)(i=+o(t[r=s+(a-s>>1)],e))<0?s=r+1:(a=r,l=!i);return l?s:~s}(d,v);m<0?(l=(v-d[-m-2])/(d[-m-1]-d[-m-2]),a=e+(-m-2)*r):a=e+m*r}var x=s>1?s:2,w=o||new Array(x);for(g=0;g<x;++g)w[g]=void 0===a?NaN:void 0===l?t[a+g]:Ne(t[a+g],t[a+r+g],l);return w}function zr(t,e,n,r,i,o){if(n==e)return null;var s;if(i<t[e+r-1])return o?((s=t.slice(e,e+r))[r-1]=i,s):null;if(t[n-1]<i)return o?((s=t.slice(n-r,n))[r-1]=i,s):null;if(i==t[e+r-1])return t.slice(e,e+r);for(var a=e/r,l=n/r;a<l;){var u=a+l>>1;i<t[(u+1)*r-1]?l=u:a=u+1}var h=t[a*r-1];if(i==h)return t.slice((a-1)*r,(a-1)*r+r);var c=(i-h)/(t[(a+1)*r-1]-h);s=[];for(var p=0;p<r-1;++p)s.push(Ne(t[(a-1)*r+p],t[a*r+p],c));return s.push(i),s}function Br(t,e,n,r){for(var i=t[e],o=t[e+1],s=0,a=e+r;a<n;a+=r){var l=t[a],u=t[a+1];s+=Math.sqrt((l-i)*(l-i)+(u-o)*(u-o)),i=l,o=u}return s}var Ur=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vr=function(t){function e(e,n){var r=t.call(this)||this;return r.flatMidpoint_=null,r.flatMidpointRevision_=-1,r.maxDelta_=-1,r.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?r.setCoordinates(e,n):r.setFlatCoordinates(n,e),r}return Ur(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,n,r){return r<te(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Zn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),qn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.forEachSegment=function(t){return wr(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 n=void 0!==e&&e;return zr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n)},e.prototype.getCoordinates=function(){return or(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinateAt=function(t,e){return Nr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)},e.prototype.getLength=function(){return Br(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 n=[];return n.length=er(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,at)},e.prototype.getType=function(){return pt},e.prototype.intersectsExtent=function(t){return Sr(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=$n(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Yn),Xr=Vr,Wr=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}(),Yr=0,Kr=1,Zr=2,Hr=3,qr=4;function Jr(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]+2*e,n[1]=t[1]+2*e,n}function Qr(t){return t[0]>0&&t[1]>0}function $r(t,e,n){return void 0===n&&(n=[0,0]),n[0]=t[0]*e+.5|0,n[1]=t[1]*e+.5|0,n}function ti(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var ei=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=ti(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.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_=ti(t)},t.prototype.listenImageChange=function(t){e()},t.prototype.load=function(){e()},t.prototype.unlistenImageChange=function(t){e()},t}(),ni=ei,ri=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,ii=/^([a-z]*)$|^hsla?\(.*\)$/i;function oi(t){return"string"==typeof t?t:hi(t)}function si(t){var e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n}return""}var ai=function(){var t={},e=0;return function(n){var r;if(t.hasOwnProperty(n))r=t[n];else{if(e>=1024){var i=0;for(var o in t)0==(3&i++)&&(delete t[o],--e)}r=function(t){var e,n,r,i,o;ii.exec(t)&&(t=si(t));if(ri.exec(t)){var s=t.length-1,a=void 0;a=s<=4?1:2;var l=4===s||8===s;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),r=parseInt(t.substr(1+2*a,a),16),i=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,n=(n<<4)+n,r=(r<<4)+r,l&&(i=(i<<4)+i)),o=[e,n,r,i/255]}else 0==t.indexOf("rgba(")?ui(o=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((o=t.slice(4,-1).split(",").map(Number)).push(1),ui(o)):rt(!1,14);return o}(n),t[n]=r,++e}return r}}();function li(t){return Array.isArray(t)?t:ai(t)}function ui(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 hi(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var r=t[2];return r!=(0|r)&&(r=r+.5|0),"rgba("+e+","+n+","+r+","+(void 0===t[3]?1:t[3])+")"}function ci(t){return Array.isArray(t)?hi(t):t}function pi(t,e,n,r){var i;return n&&n.length?i=n.shift():Ot?i=new OffscreenCanvas(t||300,e||300):(i=document.createElement("canvas")).style.all="unset",t&&(i.width=t),e&&(i.height=e),i.getContext("2d",r)}function fi(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function di(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}var gi="ol-hidden",_i="ol-unselectable",yi="ol-control",vi="ol-collapsed",mi=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),xi=["style","variant","weight","size","lineHeight","family"],wi=function(t){var e=t.match(mi);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},r=0,i=xi.length;r<i;++r){var o=e[r+1];void 0!==o&&(n[xi[r]]=o)}return n.families=n.family.split(/,\s?/),n};function Si(t){return 1===t?"":String(Math.round(100*t)/100)}var Ci="10px sans-serif",Ei="#000",Ti="round",bi=[],Ri="round",Pi="#000",Oi="center",Fi="middle",Ii=[0,0,0,0],Mi=new q;(new E).setSize=function(){console.warn("labelCache is deprecated.")};var Li,Ai,Di=null,ki={},ji=function(){var t,e,n="32px ",r=["monospace","serif"],i=r.length,o="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var l=!0,u=0;u<i;++u){var h=r[u];if(e=zi(t+" "+s+" "+n+h,o),a!=h){var c=zi(t+" "+s+" "+n+a+","+h,o);l=l&&c!=e}}return!!l}function a(){for(var e=!0,n=Mi.getKeys(),r=0,i=n.length;r<i;++r){var o=n[r];Mi.get(o)<100&&(s.apply(this,o.split("\n"))?(x(ki),Di=null,Li=void 0,Mi.set(o,100)):(Mi.set(o,Mi.get(o)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var n=wi(e);if(n)for(var r=n.families,i=0,o=r.length;i<o;++i){var l=r[i],u=n.style+"\n"+n.weight+"\n"+l;void 0===Mi.get(u)&&(Mi.set(u,100,!0),s(n.style,n.weight,l)||(Mi.set(u,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),Gi=function(t){var e=ki[t];if(null==e){if(Ot){var n=wi(t),r=Ni(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else Ai||((Ai=document.createElement("div")).innerHTML="M",Ai.style.minHeight="0",Ai.style.maxHeight="none",Ai.style.height="auto",Ai.style.padding="0",Ai.style.border="none",Ai.style.position="absolute",Ai.style.display="block",Ai.style.left="-99999px"),Ai.style.font=t,document.body.appendChild(Ai),e=Ai.offsetHeight,document.body.removeChild(Ai);ki[t]=e}return e};function Ni(t,e){return Di||(Di=pi(1,1)),t!=Li&&(Di.font=t,Li=Di.font),Di.measureText(e)}function zi(t,e){return Ni(t,e).width}function Bi(t,e,n){if(e in n)return n[e];var r=zi(t,e);return n[e]=r,r}function Ui(t,e,n,r,i,o,s,a,l,u,h){t.save(),1!==n&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),r.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var n=t.contextInstructions,r=0,i=n.length;r<i;r+=2)Array.isArray(n[r+1])?e[n[r]].apply(e,n[r+1]):e[n[r]]=n[r+1]}(r,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(r,i,o,s,a,0,0,s,a)):t.drawImage(r,i,o,s,a,l,u,s*h[0],a*h[1]),t.restore()}var Vi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xi=function(t){function e(e){var n=this,r=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:r,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,n.hitDetectionCanvas_=null,n.fill_=void 0!==e.fill?e.fill:null,n.origin_=[0,0],n.points_=e.points,n.radius_=void 0!==e.radius?e.radius:e.radius1,n.radius2_=e.radius2,n.angle_=void 0!==e.angle?e.angle:0,n.stroke_=void 0!==e.stroke?e.stroke:null,n.anchor_=null,n.size_=null,n.renderOptions_=null,n.render(),n}return Vi(e,t),e.prototype.clone=function(){var t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice()});return n.setOpacity(this.getOpacity()),n},e.prototype.getAnchor=function(){return this.anchor_},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 n=this.renderOptions_,r=pi(n.size*t,n.size*t);this.draw_(n,r,t),e=r.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 Zr},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,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;var r=this.radius_,i=void 0===this.radius2_?r:this.radius2_;if(r<i){var o=r;r=i,i=o}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,l=i*Math.sin(a),u=r-Math.sqrt(i*i-l*l),h=Math.sqrt(l*l+u*u),c=h/l;if("miter"===t&&c<=n)return c*e;var p=e/2/c,f=e/2*(u/h),d=Math.sqrt((r+p)*(r+p)+f*f)-r;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=r*Math.sin(a),_=i-Math.sqrt(r*r-g*g),y=Math.sqrt(g*g+_*_)/g;if(y<=n){var v=y*e/2-i-r;return 2*Math.max(d,v)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=Ri,n=0,r=null,i=0,o=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Pi),t=ci(t),void 0===(o=this.stroke_.getWidth())&&(o=1),r=this.stroke_.getLineDash(),i=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Ri),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=this.calculateLineJoinSize_(e,o,n),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*a+s),lineDash:r,lineDashOffset:i,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size,e=this.getDisplacement();this.canvas_={},this.anchor_=[t/2-e[0],t/2+e[1]],this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var r=this.fill_.getColor();null===r&&(r=Ei),e.fillStyle=ci(r),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(),n=0;if("string"==typeof e&&(e=li(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var r=pi(t.size,t.size);this.hitDetectionCanvas_=r.canvas,this.drawHitDetectionCanvas_(t,r)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))},e.prototype.createPath_=function(t){var e=this.points_,n=this.radius_;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{var r=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var i=this.angle_-Math.PI/2,o=2*Math.PI/e,s=0;s<e;s++){var a=i+s*o,l=s%2==0?n:r;t.lineTo(l*Math.cos(a),l*Math.sin(a))}t.closePath()}},e.prototype.drawHitDetectionCanvas_=function(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Ei,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}(ni),Wi=Xi,Yi=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ki=function(t){function e(e){var n=e||{};return t.call(this,{points:1/0,fill:n.fill,radius:n.radius,stroke:n.stroke,scale:void 0!==n.scale?n.scale:1,rotation:void 0!==n.rotation?n.rotation:0,rotateWithView:void 0!==n.rotateWithView&&n.rotateWithView,displacement:void 0!==n.displacement?n.displacement:[0,0]})||this}return Yi(e,t),e.prototype.clone=function(){var t=this.getScale(),n=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 n.setOpacity(this.getOpacity()),n},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(Wi),Zi=Ki,Hi=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=$i,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_=$i,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var qi=null;function Ji(t,e){if(!qi){var n=new Gr({color:"rgba(255,255,255,0.4)"}),r=new Wr({color:"#3399CC",width:1.25});qi=[new Hi({image:new Zi({fill:n,stroke:r,radius:5}),fill:n,stroke:r})]}return qi}function Qi(){var t={},e=[255,255,255,1],n=[0,153,255,1];return t[dt]=[new Hi({fill:new Gr({color:[255,255,255,.5]})})],t[yt]=t[dt],t[pt]=[new Hi({stroke:new Wr({color:e,width:5})}),new Hi({stroke:new Wr({color:n,width:3})})],t[_t]=t[pt],t[mt]=t[dt].concat(t[pt]),t[ct]=[new Hi({image:new Zi({radius:6,fill:new Gr({color:n}),stroke:new Wr({color:e,width:1.5})}),zIndex:1/0})],t[gt]=t[ct],t[vt]=t[dt].concat(t[pt],t[ct]),t}function $i(t){return t.getGeometry()}var to=Hi,eo="point",no="line",ro=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_=ti(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 Gr({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:eo,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_=ti(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}(),io=ro,oo="opacity",so="visible",ao="extent",lo="zIndex",uo="maxResolution",ho="minResolution",co="maxZoom",po="minZoom",fo="source",go=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_o=function(t){function n(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=m({},e);return"object"==typeof e.properties&&(delete r.properties,m(r,e.properties)),r[oo]=void 0!==e.opacity?e.opacity:1,rt("number"==typeof r[oo],64),r[so]=void 0===e.visible||e.visible,r[lo]=e.zIndex,r[uo]=void 0!==e.maxResolution?e.maxResolution:1/0,r[ho]=void 0!==e.minResolution?e.minResolution:0,r[po]=void 0!==e.minZoom?e.minZoom:-1/0,r[co]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==r.className?e.className:"ol-layer",delete r.className,n.setProperties(r),n.state_=null,n}return go(n,t),n.prototype.getClassName=function(){return this.className_},n.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=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!==n||e.managed?n: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},n.prototype.getLayersArray=function(t){return e()},n.prototype.getLayerStatesArray=function(t){return e()},n.prototype.getExtent=function(){return this.get(ao)},n.prototype.getMaxResolution=function(){return this.get(uo)},n.prototype.getMinResolution=function(){return this.get(ho)},n.prototype.getMinZoom=function(){return this.get(po)},n.prototype.getMaxZoom=function(){return this.get(co)},n.prototype.getOpacity=function(){return this.get(oo)},n.prototype.getSourceState=function(){return e()},n.prototype.getVisible=function(){return this.get(so)},n.prototype.getZIndex=function(){return this.get(lo)},n.prototype.setExtent=function(t){this.set(ao,t)},n.prototype.setMaxResolution=function(t){this.set(uo,t)},n.prototype.setMinResolution=function(t){this.set(ho,t)},n.prototype.setMaxZoom=function(t){this.set(co,t)},n.prototype.setMinZoom=function(t){this.set(po,t)},n.prototype.setOpacity=function(t){rt("number"==typeof t,64),this.set(oo,t)},n.prototype.setVisible=function(t){this.set(so,t)},n.prototype.setZIndex=function(t){this.set(lo,t)},n.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},n}(q),yo="undefined",vo="loading",mo="ready",xo="error",wo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),So=function(t){function e(e){var n=this,r=m({},e);delete r.source,(n=t.call(this,r)||this).on,n.once,n.un,n.mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addChangeListener(fo,n.handleSourcePropertyChange_);var i=e.source?e.source:null;return n.setSource(i),n}return wo(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(fo)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():yo},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(B(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 n=this.getRenderer();if(n.prepareFrame(t))return n.renderFrame(t,e)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(B(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(B(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=N(t,Dr,(function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);rt(!e.some((function(t){return t.layer===n.layer})),67),e.push(n)}),this),this.mapRenderKey_=N(this,T,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(fo,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}(_o);function Co(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var r=e.zoom;return r>t.minZoom&&r<=t.maxZoom}var Eo=So;function To(t,e,n,r,i){bo(t,e,n||0,r||t.length-1,i||Po)}function bo(t,e,n,r,i){for(;r>n;){if(r-n>600){var o=r-n+1,s=e-n+1,a=Math.log(o),l=.5*Math.exp(2*a/3),u=.5*Math.sqrt(a*l*(o-l)/o)*(s-o/2<0?-1:1);bo(t,e,Math.max(n,Math.floor(e-s*l/o+u)),Math.min(r,Math.floor(e+(o-s)*l/o+u)),i)}var h=t[e],c=n,p=r;for(Ro(t,n,e),i(t[r],h)>0&&Ro(t,n,r);c<p;){for(Ro(t,c,p),c++,p--;i(t[c],h)<0;)c++;for(;i(t[p],h)>0;)p--}0===i(t[n],h)?Ro(t,n,p):Ro(t,++p,r),p<=e&&(n=p+1),e<=p&&(r=p-1)}}function Ro(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Po(t,e){return t<e?-1:t>e?1:0}class Oo{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 n=[];if(!zo(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;o<e.children.length;o++){const s=e.children[o],a=e.leaf?r(s):s;zo(t,a)&&(e.leaf?n.push(s):No(t,a)?this._all(s,n):i.push(s))}e=i.pop()}return n}collides(t){let e=this.data;if(!zo(t,e))return!1;const n=[];for(;e;){for(let r=0;r<e.children.length;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(zo(t,o)){if(e.leaf||No(t,o))return!0;n.push(i)}}e=n.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=Bo([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let s,a,l;for(;n||i.length;){if(n||(n=i.pop(),a=i[i.length-1],s=o.pop(),l=!0),n.leaf){const r=Fo(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}l||n.leaf||!No(n,r)?a?(s++,n=a.children[s],l=!1):n=null:(i.push(n),o.push(s),s=0,a=n,n=n.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 n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,s=this._maxEntries;if(i<=s)return o=Bo(t.slice(e,n+1)),Io(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(s)),s=Math.ceil(i/Math.pow(s,r-1))),o=Bo([]),o.leaf=!1,o.height=r;const a=Math.ceil(i/s),l=a*Math.ceil(Math.sqrt(s));Uo(t,e,n,l,this.compareMinX);for(let i=e;i<=n;i+=l){const e=Math.min(i+l-1,n);Uo(t,i,e,a,this.compareMinY);for(let n=i;n<=e;n+=a){const i=Math.min(n+a-1,e);o.children.push(this._build(t,n,i,r-1))}}return Io(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,s=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],u=ko(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<s?(s=h,r=u<r?u:r,n=l):h===s&&u<r&&(r=u,n=l)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),Lo(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),s=Bo(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,Io(n,this.toBBox),Io(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)}_splitRoot(t,e){this.data=Bo([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Io(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let s=e;s<=n-e;s++){const e=Mo(t,0,s,this.toBBox),a=Mo(t,s,n,this.toBBox),l=Go(e,a),u=ko(e)+ko(a);l<i?(i=l,r=s,o=u<o?u:o):l===i&&u<o&&(o=u,r=s)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:Ao,i=t.leaf?this.compareMinY:Do;this._allDistMargin(t,e,n,r)<this._allDistMargin(t,e,n,i)&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=Mo(t,0,e,i),s=Mo(t,n-e,n,i);let a=jo(o)+jo(s);for(let r=e;r<n-e;r++){const e=t.children[r];Lo(o,t.leaf?i(e):e),a+=jo(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];Lo(s,t.leaf?i(e):e),a+=jo(s)}return a}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)Lo(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():Io(t[n],this.toBBox)}}function Fo(t,e,n){if(!n)return e.indexOf(t);for(let r=0;r<e.length;r++)if(n(t,e[r]))return r;return-1}function Io(t,e){Mo(t,0,t.children.length,e,t)}function Mo(t,e,n,r,i){i||(i=Bo(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;o<n;o++){const e=t.children[o];Lo(i,t.leaf?r(e):e)}return i}function Lo(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 Ao(t,e){return t.minX-e.minX}function Do(t,e){return t.minY-e.minY}function ko(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function jo(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Go(t,e){const n=Math.max(t.minX,e.minX),r=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-n)*Math.max(0,o-r)}function No(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function zo(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Bo(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Uo(t,e,n,r,i){const o=[e,n];for(;o.length;){if((n=o.pop())-(e=o.pop())<=r)continue;const s=e+Math.ceil((n-e)/r/2)*r;To(t,s,e,n,i),o.push(e,s,s,n)}}var Vo=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xo="renderOrder",Wo=function(t){function e(e){var n=this,r=e||{},i=m({},r);return delete i.style,delete i.renderBuffer,delete i.updateWhileAnimating,delete i.updateWhileInteracting,(n=t.call(this,i)||this).declutter_=void 0!==r.declutter&&r.declutter,n.renderBuffer_=void 0!==r.renderBuffer?r.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(r.style),n.updateWhileAnimating_=void 0!==r.updateWhileAnimating&&r.updateWhileAnimating,n.updateWhileInteracting_=void 0!==r.updateWhileInteracting&&r.updateWhileInteracting,n}return Vo(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(Xo)},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 Oo(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(Xo,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Ji,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;Array.isArray(t)?n=t:(rt("function"==typeof t.getZIndex,41),n=[t]),e=function(){return n}}return e}(this.style_),this.changed()},e}(Eo),Yo={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},Ko=[Yo.FILL],Zo=[Yo.STROKE],Ho=[Yo.BEGIN_PATH],qo=[Yo.CLOSE_PATH],Jo=Yo,Qo=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,r){},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}(),$o=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ts=function(t){function e(e,n,r,i){var o=t.call(this)||this;return o.tolerance=e,o.maxExtent=n,o.pixelRatio=i,o.maxLineWidth=0,o.resolution=r,o.beginGeometryInstruction1_=null,o.beginGeometryInstruction2_=null,o.bufferedMaxExtent_=null,o.instructions=[],o.coordinates=[],o.tmpCoordinate_=[],o.hitDetectionInstructions=[],o.state={},o}return $o(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 n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,o=i.length,s=0,a=t.length;s<a;s+=e)r[0]=t[s],r[1]=t[s+1],ee(n,r)&&(i[o++]=r[0],i[o++]=r[1]);return o},e.prototype.appendFlatLineCoordinates=function(t,e,n,r,i,o){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();o&&(e+=r);var u,h,c,p=t[e],f=t[e+1],d=this.tmpCoordinate_,g=!0;for(u=e+r;u<n;u+=r)d[0]=t[u],d[1]=t[u+1],(c=ie(l,d))!==h?(g&&(s[a++]=p,s[a++]=f,g=!1),s[a++]=d[0],s[a++]=d[1]):c===Yt?(s[a++]=d[0],s[a++]=d[1],g=!1):g=!0,p=d[0],f=d[1],h=c;return(i&&g||u===e+r)&&(s[a++]=p,s[a++]=f),a},e.prototype.drawCustomCoordinates_=function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o],l=this.appendFlatLineCoordinates(t,e,a,r,!1,!1);i.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,n,r){this.beginGeometry(t,e);var i,o,s,a,l,u=t.getType(),h=t.getStride(),c=this.coordinates.length;switch(u){case yt:i=t.getOrientedFlatCoordinates(),a=[];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),a.push(g)}this.instructions.push([Jo.CUSTOM,c,a,t,n,ar]),this.hitDetectionInstructions.push([Jo.CUSTOM,c,a,t,r||n,ar]);break;case dt:case _t:s=[],i=u==dt?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(i,0,t.getEnds(),h,s),this.instructions.push([Jo.CUSTOM,c,s,t,n,sr]),this.hitDetectionInstructions.push([Jo.CUSTOM,c,s,t,r||n,sr]);break;case pt:case mt:i=t.getFlatCoordinates(),o=this.appendFlatLineCoordinates(i,0,i.length,h,!1,!1),this.instructions.push([Jo.CUSTOM,c,o,t,n,or]),this.hitDetectionInstructions.push([Jo.CUSTOM,c,o,t,r||n,or]);break;case gt:i=t.getFlatCoordinates(),(o=this.appendFlatPointCoordinates(i,h))>c&&(this.instructions.push([Jo.CUSTOM,c,o,t,n,or]),this.hitDetectionInstructions.push([Jo.CUSTOM,c,o,t,r||n,or]));break;case ct:i=t.getFlatCoordinates(),this.coordinates.push(i[0],i[1]),o=this.coordinates.length,this.instructions.push([Jo.CUSTOM,c,o,t,n]),this.hitDetectionInstructions.push([Jo.CUSTOM,c,o,t,r||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Jo.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Jo.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 n,r,i=e.length,o=-1;for(t=0;t<i;++t)(r=(n=e[t])[0])==Jo.END_GEOMETRY?o=t:r==Jo.BEGIN_GEOMETRY&&(n[2]=t,f(this.hitDetectionInstructions,o,t),o=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var r=t.getColor();n.fillStyle=ci(r||Ei)}else n.fillStyle=void 0;if(e){var i=e.getColor();n.strokeStyle=ci(i||Pi);var o=e.getLineCap();n.lineCap=void 0!==o?o:Ti;var s=e.getLineDash();n.lineDash=s?s.slice():bi;var a=e.getLineDashOffset();n.lineDashOffset=a||0;var l=e.getLineJoin();n.lineJoin=void 0!==l?l:Ri;var u=e.getWidth();n.lineWidth=void 0!==u?u:1;var h=e.getMiterLimit();n.miterLimit=void 0!==h?h:10,n.lineWidth>this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},e.prototype.createFill=function(t){var e=t.fillStyle,n=[Jo.SET_FILL_STYLE,e];return"string"!=typeof e&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[Jo.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 n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,r=t.lineCap,i=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=r||i!=t.currentLineDash&&!g(t.currentLineDash,i)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=r,t.currentLineDash=i,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,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=[Jo.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}(Qo),es=ts,ns=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),rs=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,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 ns(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([Jo.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([Jo.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 n=t.getFlatCoordinates(),r=t.getStride(),i=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([Jo.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([Jo.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 n=t.getAnchor(),r=t.getSize(),i=t.getHitDetectionImage(),o=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=i,this.image_=o,this.height_=r[1],this.opacity_=t.getOpacity(),this.originX_=s[0]*this.imagePixelRatio_,this.originY_=s[1]*this.imagePixelRatio_,this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=r[0],this.declutterImageWithText_=e},e}(es),is=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),os=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return is(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,r){var i=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,r,!1,!1),s=[Jo.MOVE_TO_LINE_TO,i,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Jo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,bi,0],Ho);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push(Zo),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,r=n.strokeStyle,i=n.lineWidth;if(void 0!==r&&void 0!==i){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Jo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],Ho);for(var o=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinates_(s,l,o[u],a);this.hitDetectionInstructions.push(Zo),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Zo),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(Zo),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(Ho)},e}(es),ss=os,as=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ls=function(t){function e(e,n,r,i){return t.call(this,e,n,r,i)||this}return as(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,r){var i=this.state,o=void 0!==i.fillStyle,s=void 0!==i.strokeStyle,a=n.length;this.instructions.push(Ho),this.hitDetectionInstructions.push(Ho);for(var l=0;l<a;++l){var u=n[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,r,!0,!s),p=[Jo.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(qo),this.hitDetectionInstructions.push(qo)),e=u}return o&&(this.instructions.push(Ko),this.hitDetectionInstructions.push(Ko)),s&&(this.instructions.push(Zo),this.hitDetectionInstructions.push(Zo)),e},e.prototype.drawCircle=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Jo.SET_FILL_STYLE,Ei]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Jo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,s,!1,!1);var l=[Jo.CIRCLE,a];this.instructions.push(Ho,l),this.hitDetectionInstructions.push(Ho,l),void 0!==n.fillStyle&&(this.instructions.push(Ko),this.hitDetectionInstructions.push(Ko)),void 0!==n.strokeStyle&&(this.instructions.push(Zo),this.hitDetectionInstructions.push(Zo)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Jo.SET_FILL_STYLE,Ei]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Jo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var o=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,o,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,r=n.fillStyle,i=n.strokeStyle;if(void 0!==r||void 0!==i){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Jo.SET_FILL_STYLE,Ei]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Jo.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var o=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,u=0,h=o.length;u<h;++u)l=this.drawFlatCoordinatess_(s,l,o[u],a);this.endGeometry(e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var e=this.tolerance;if(0!==e)for(var n=this.coordinates,r=0,i=n.length;r<i;++r)n[r]=nr(n[r],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}(es),us=ls;function hs(t,e,n,r,i){var o,s,a,l,u,h,c,p,f,d=n,g=n,_=0,y=0,v=n;for(o=n;o<r;o+=i){var m=e[o],x=e[o+1];void 0!==l&&(p=m-l,f=x-u,a=Math.sqrt(p*p+f*f),void 0!==h&&(y+=s,Math.acos((h*p+c*f)/(s*a))>t&&(y>_&&(_=y,d=v,g=o),y=0,v=o-i)),s=a,h=p,c=f),l=m,u=x}return(y+=a)>_?[v,o]:[d,g]}var cs=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ps={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},fs=function(t){function e(e,n,r,i){var o=t.call(this,e,n,r,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 cs(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 n=this.textFillState_,r=this.textStrokeState_,i=this.textState_;if(""!==this.text_&&i&&(n||r)){var o=this.coordinates,s=o.length,a=t.getType(),l=null,u=t.getStride();if(i.placement!==no||a!=pt&&a!=_t&&a!=dt&&a!=yt){var h=i.overflow?null:[];switch(a){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))===s)return;if(h&&(F-s)/2!=l.length/u){var p=s/2;h=h.filter((function(t,e){var n=o[2*(p+e)]===l[e*u]&&o[2*(p+e)+1]===l[e*u+1];return n||--p,n}))}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!=Ii&&(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([Jo.DRAW_IMAGE,s,F,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,f==Ii?Ii: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([Jo.DRAW_IMAGE,s,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(),a==pt)x=[l.length];else if(a==_t)x=t.getEnds();else if(a==dt)x=t.getEnds().slice(0,1);else if(a==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=hs(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_(s,F),s=F}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,r=this.strokeKey_;t&&(r in this.strokeStates||(this.strokeStates[r]={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||Oi,textBaseline:e.textBaseline||Fi,scale:e.scale});var o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,o=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=ps[r.textBaseline],u=this.textOffsetY_*a,h=this.text_,c=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([Jo.DRAW_CHARS,t,e,l,r.overflow,s,r.maxAngle,a,u,i,c*a,h,o,1]),this.hitDetectionInstructions.push([Jo.DRAW_CHARS,t,e,l,r.overflow,s,r.maxAngle,1,u,i,c,h,o,1/a])},e.prototype.setTextStyle=function(t,e){var n,i,o;if(t){var s=t.getFill();s?((i=this.textFillState_)||(i={},this.textFillState_=i),i.fillStyle=ci(s.getColor()||Ei)):(i=null,this.textFillState_=i);var a=t.getStroke();if(a){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var l=a.getLineDash(),u=a.getLineDashOffset(),h=a.getWidth(),c=a.getMiterLimit();o.lineCap=a.getLineCap()||Ti,o.lineDash=l?l.slice():bi,o.lineDashOffset=void 0===u?0:u,o.lineJoin=a.getLineJoin()||Ri,o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===c?10:c,o.strokeStyle=ci(a.getColor()||Pi)}else o=null,this.textStrokeState_=o;n=this.textState_;var p=t.getFont()||Ci;ji(p);var f=t.getScaleArray();n.overflow=t.getOverflow(),n.font=p,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.textBaseline=t.getTextBaseline()||Fi,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Ii,n.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:r(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.textBaseline||"?"),this.fillKey_=i?"string"==typeof i.fillStyle?i.fillStyle:"|"+r(i.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(es),ds={Circle:us,Default:es,Image:rs,LineString:ss,Polygon:us,Text:fs},gs=function(){function t(t,e,n,r){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_={}}return t.prototype.finish=function(){var t={};for(var e in this.buildersByZIndex_){t[e]=t[e]||{};var n=this.buildersByZIndex_[e];for(var r in n){var i=n[r].finish();t[e][r]=i}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",r=this.buildersByZIndex_[n];void 0===r&&(r={},this.buildersByZIndex_[n]=r);var i=r[e];void 0===i&&(i=new(0,ds[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[e]=i);return i},t}(),_s=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ys=function(t){function n(e){var n=t.call(this)||this;return n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return _s(n,t),n.prototype.getFeatures=function(t){return e()},n.prototype.prepareFrame=function(t){return e()},n.prototype.renderFrame=function(t,n){return e()},n.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},n.prototype.createLoadedTileFinder=function(t,e,n){return function(r,i){var o=this.loadedTileCallback.bind(this,n,r);return t.forEachLoadedTile(e,r,i,o)}.bind(this)},n.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i){},n.prototype.getDataAtPixel=function(t,e,n){return null},n.prototype.getLayer=function(){return this.layer_},n.prototype.handleFontsChanged=function(){},n.prototype.handleImageChange_=function(t){t.target.getState()===Zr&&this.renderIfReadyAndVisible()},n.prototype.loadImage=function(t){var e=t.getState();return e!=Zr&&e!=Hr&&t.addEventListener(T,this.boundHandleImageChange_),e==Yr&&(t.load(),e=t.getState()),e==Zr},n.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==mo&&t.changed()},n}(W),vs=ys,ms=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xs=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.inversePixelTransform=n,o.frameState=r,o.context=i,o}return ms(e,t),e}(a),ws=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ss=function(t){function e(e){var n=t.call(this,e)||this;return n.container=null,n.renderedResolution,n.tempTransform=[1,0,0,1,0,0],n.pixelTransform=[1,0,0,1,0,0],n.inversePixelTransform=[1,0,0,1,0,0],n.context=null,n.containerReused=!1,n}return ws(e,t),e.prototype.useContainer=function(t,e,n){var r,i,o=this.getLayer().getClassName();t&&t.style.opacity===Si(n)&&t.className===o&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(i=a.getContext("2d")));if(i&&i.canvas.style.transform===e?(this.container=t,this.context=i,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(r=document.createElement("div")).className=o;var s=r.style;s.position="absolute",s.width="100%",s.height="100%";var a=(i=pi()).canvas;r.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=r,this.context=i}},e.prototype.clipUnrotated=function(t,e,n){var r=Ee(n),i=Te(n),o=ve(n),s=ye(n);kt(e.coordinateToPixelTransform,r),kt(e.coordinateToPixelTransform,i),kt(e.coordinateToPixelTransform,o),kt(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;kt(a,r),kt(a,i),kt(a,o),kt(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(r[0]),Math.round(r[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(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var r=this.getLayer();if(r.hasListener(t)){var i=new xs(t,this.inversePixelTransform,n,e);r.dispatchEvent(i)}},e.prototype.preRender=function(t,e){this.dispatchRenderEvent_(Lr,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ar,t,e)},e.prototype.getRenderTransform=function(t,e,n,r,i,o,s){var a=i/2,l=o/2,u=r/e,h=-u,c=-t[0]+s,p=-t[1];return Gt(this.tempTransform,a,l,u,h,-n,c,p)},e.prototype.getDataAtPixel=function(t,e,n){var r,i=kt(this.inversePixelTransform,t.slice()),o=this.context,s=this.getLayer().getExtent();if(s&&!ee(s,kt(e.pixelToCoordinateTransform,t.slice())))return null;try{var a=Math.round(i[0]),l=Math.round(i[1]),u=document.createElement("canvas"),h=u.getContext("2d");u.width=1,u.height=1,h.clearRect(0,0,1,1),h.drawImage(o.canvas,a,l,1,1,0,0,1,1),r=h.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?new Uint8Array:r}return 0===r[3]?null:r},e}(vs),Cs=Ss,Es="Circle",Ts="Default",bs="Image",Rs="LineString",Ps="Polygon",Os="Text";function Fs(t,e,n,r,i,o,s,a,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+=r],f=t[e+1],y+=_,_=Math.sqrt((p-d)*(p-d)+(f-g)*(f-g))}do{v()}while(e<n-r&&y+_<o);for(var m=0===_?0:(o-y)/_,x=Ne(d,p,m),w=Ne(g,f,m),S=e-r,C=y,E=o+a*l(u,i,h);e<n-r&&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];jn(P,0,4,2,c,P,P),T=P[0]>P[2]}else T=x>b;var O,F=Math.PI,I=[],M=S+r===e;if(_=0,y=C,p=t[e=S],f=t[e+1],M){v(),O=Math.atan2(f-g,p-d),T&&(O+=O>0?-F:F);var L=(b+x)/2,A=(R+w)/2;return I[0]=[L,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)>s)return null}O=j;for(var N=D,z=0;D<k;++D){var B=a*l(u,i[T?k-D-1:D],h);if(e+r<n&&y+_<o+z+B/2)break;z+=B}if(D!==N){var U=T?i.substring(k-N,k-D):i.substring(N,D);L=Ne(d,p,m=0===_?0:(o+z/2-y)/_),A=Ne(g,f,m);I.push([L,A,z/2,j,U]),o+=z}}return I}var Is=[1/0,1/0,-1/0,-1/0],Ms=[],Ls=[],As=[],Ds=[];function ks(t){return t[3].declutterBox}var js=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 Gs(t,e){return"start"!==e&&"end"!==e||js.test(t)||(e="start"===e?"left":"right"),ps[e]}var Ns=function(){function t(t,e,n,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,r){var i=t+e+n+r;if(this.labels_[i])return this.labels_[i];var o=r?this.strokeStates[r]:null,s=n?this.fillStates[n]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Gs(t,a.textAlign||Oi),c=r&&o.lineWidth?o.lineWidth:0,p=t.split("\n"),f=p.length,d=[],g=function(t,e,n){for(var r=e.length,i=0,o=0;o<r;++o){var s=zi(t,e[o]);i=Math.max(i,s),n.push(s)}return i}(a.font,p,d),_=Gi(a.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",a.font),r)&&(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)));n&&v.push("fillStyle",s.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");var S,C=.5-h,E=h*y+C*c;if(r)for(S=0;S<f;++S)v.push("strokeText",[p[S],E+C*d[S],.5*(c+_)+S*_]);if(n)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,n,r,i,o,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,i),t.lineTo.apply(t,e),o&&(this.alignFill_=o[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,r,i,o,s,a,l,u,h,c,p,f,d,g){var _,y=n-(s*=c[0]),v=r-(a*=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)&&(Ms[0]=C,Ds[0]=C,Ms[1]=E,Ls[1]=E,Ls[0]=C+w,As[0]=Ls[0],As[1]=E+S,Ds[1]=As[1]),0!==h?(kt(_=Gt([1,0,0,1,0,0],n,r,1,1,h,-n,-r),Ms),kt(_,Ls),kt(_,As),kt(_,Ds),se(Math.min(Ms[0],Ls[0],As[0],Ds[0]),Math.min(Ms[1],Ls[1],As[1],Ds[1]),Math.max(Ms[0],Ls[0],As[0],Ds[0]),Math.max(Ms[1],Ls[1],As[1],Ds[1]),Is)):se(Math.min(C,C+w),Math.min(E,E+S),Math.max(C,C+w),Math.max(E,E+S),Is),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:u,declutterBox:{minX:Is[0],minY:Is[1],maxX:Is[2],maxY:Is[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,n,r,i,o,s){var a=!(!o&&!s),l=r.declutterBox,u=t.canvas,h=s?s[2]*r.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&&(a&&this.replayTextBackground_(t,Ms,Ls,As,Ds,o,s),Ui(t,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=kt(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(e[0]%n,e[1]%n),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,n,r){var i=this.textStates[e],o=this.createLabel(t,e,r,n),s=this.strokeStates[n],a=this.pixelRatio,l=Gs(t,i.textAlign||Oi),u=ps[i.textBaseline||Fi],h=s&&s.lineWidth?s.lineWidth:0;return{label:o,anchorX:l*(o.width/a-2*i.scale[0])+2*(.5-l)*h,anchorY:u*o.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,n,r,i,o,s,a){var l,u,h;this.pixelCoordinates_&&g(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=kn(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),u=this.renderedTransform_,h=n,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=r.length,F=0,I=0,M=0,L=null,A=null,D=this.coordinateCache_,k=this.viewRotation_,j=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,G={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},N=this.instructions!=r||this.overlaps?0:200;P<O;){var z=r[P];switch(z[0]){case Jo.BEGIN_GEOMETRY:E=z[1],R=z[3],E.getGeometry()?void 0===s||Re(s,R.getExtent())?++P:P=z[2]+1:P=z[2];break;case Jo.BEGIN_PATH:I>N&&(this.fill_(t),I=0),M>N&&(t.stroke(),M=0),I||M||(t.beginPath(),d=NaN,_=NaN),++P;break;case Jo.CIRCLE:var B=l[F=z[1]],U=l[F+1],V=l[F+2]-B,X=l[F+3]-U,W=Math.sqrt(V*V+X*X);t.moveTo(B+W,U),t.arc(B,U,W,0,2*Math.PI,!0),++P;break;case Jo.CLOSE_PATH:t.closePath(),++P;break;case Jo.CUSTOM:F=z[1],c=z[2];var Y=z[3],K=z[4],Z=6==z.length?z[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 Jo.DRAW_IMAGE:F=z[1],c=z[2],m=z[3],p=z[4],f=z[5];var q=z[6],J=z[7],Q=z[8],$=z[9],tt=z[10],et=z[11],nt=z[12],rt=z[13],it=z[14];if(!m&&z.length>=19){x=z[18],w=z[19],S=z[20],C=z[21];var ot=this.drawLabelWithPointPlacement_(x,w,S,C);m=ot.label,z[3]=m;var st=z[22];p=(ot.anchorX-st)*this.pixelRatio,z[4]=p;var at=z[23];f=(ot.anchorY-at)*this.pixelRatio,z[5]=f,q=m.height,z[6]=q,rt=m.width,z[13]=rt}var lt=void 0;z.length>24&&(lt=z[24]);var ut=void 0,ht=void 0,ct=void 0;z.length>16?(ut=z[15],ht=z[16],ct=z[17]):(ut=Ii,ht=!1,ct=!1),tt&&j?et+=k:tt||j||(et-=k);for(var pt=0;F<c;F+=2)if(!(lt&&lt[pt++]<rt/this.pixelRatio)){var ft=[t,e,m,zt=this.calculateImageOrLabelDimensions_(m.width,m.height,l[F],l[F+1],rt,q,p,f,Q,$,et,nt,i,ut,ht||ct,E),J,ht?L:null,ct?A:null],dt=void 0,gt=void 0;if(a&&it){var _t=c-F;if(!it[_t]){it[_t]=ft;continue}if(dt=it[_t],delete it[_t],gt=ks(dt),a.collides(gt))continue}a&&a.collides(zt.declutterBox)||(dt&&(a&&a.insert(gt),this.replayImageOrLabel_.apply(this,dt)),a&&a.insert(zt.declutterBox),this.replayImageOrLabel_.apply(this,ft))}++P;break;case Jo.DRAW_CHARS:var yt=z[1],vt=z[2],mt=z[3],xt=z[4];C=z[5];var wt=z[6],St=z[7],Ct=z[8];S=z[9];var Et=z[10];x=z[11],w=z[12];var Tt=[z[13],z[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=Br(l,yt,vt,2),It=Math.abs(Pt[0])*Bi(Rt,x,Ot);if(xt||It<=Ft){var Mt=this.textStates[w].textAlign,Lt=Fs(l,yt,vt,2,x,(Ft-It)*ps[Mt],wt,Math.abs(Pt[0]),Bi,Rt,Ot,j?0:this.viewRotation_);t:if(Lt){var At=[],Dt=void 0,kt=void 0,jt=void 0,Gt=void 0,Nt=void 0;if(S)for(Dt=0,kt=Lt.length;Dt<kt;++Dt){jt=(Nt=Lt[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 zt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,Nt[0],Nt[1],Gt.width,Gt.height,p,f,0,0,Nt[3],Tt,!1,Ii,!1,E);if(a&&a.collides(zt.declutterBox))break t;At.push([t,e,Gt,zt,1,null,null])}if(C)for(Dt=0,kt=Lt.length;Dt<kt;++Dt){jt=(Nt=Lt[Dt])[4],Gt=this.createLabel(jt,w,C,""),p=Nt[2],f=mt*Gt.height-Ct;zt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,Nt[0],Nt[1],Gt.width,Gt.height,p,f,0,0,Nt[3],Tt,!1,Ii,!1,E);if(a&&a.collides(zt.declutterBox))break t;At.push([t,e,Gt,zt,1,null,null])}a&&a.load(At.map(ks));for(var Bt=0,Ut=At.length;Bt<Ut;++Bt)this.replayImageOrLabel_.apply(this,At[Bt])}}++P;break;case Jo.END_GEOMETRY:if(void 0!==o){var Vt=o(E=z[1],R);if(Vt)return Vt}++P;break;case Jo.FILL:N?I++:this.fill_(t),++P;break;case Jo.MOVE_TO_LINE_TO:for(F=z[1],c=z[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 Jo.SET_FILL_STYLE:L=z,this.alignFill_=z[2],I&&(this.fill_(t),I=0,M&&(t.stroke(),M=0)),t.fillStyle=z[1],++P;break;case Jo.SET_STROKE_STYLE:A=z,M&&(t.stroke(),M=0),this.setStrokeStyle_(t,z),++P;break;case Jo.STROKE:N?M++:t.stroke(),++P;break;default:++P}}I&&this.fill_(t),M&&t.stroke()},t.prototype.execute=function(t,e,n,r,i,o){this.viewRotation_=r,this.execute_(t,e,n,this.instructions,i,void 0,void 0,o)},t.prototype.executeHitDetection=function(t,e,n,r,i){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,r,i)},t}(),zs=Ns,Bs=[Ps,Es,Rs,bs,Os,Ts],Us=function(){function t(t,e,n,r,i,o){this.maxExtent_=t,this.overlaps_=r,this.pixelRatio_=n,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 n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()},t.prototype.createExecutors_=function(t){for(var e in t){var n=this.executorsByZIndex_[e];void 0===n&&(n={},this.executorsByZIndex_[e]=n);var r=t[e];for(var i in r){var o=r[i];n[i]=new zs(this.resolution_,this.pixelRatio_,this.overlaps_,o)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],r=0,i=t.length;r<i;++r)if(t[r]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i,o){var s=2*(r=Math.round(r))+1,a=Gt(this.hitDetectionTransform_,r+.5,r+.5,1/e,-1/e,-n,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=pi(s,s));var u,c=this.hitDetectionContext_;c.canvas.width!==s||c.canvas.height!==s?(c.canvas.width=s,c.canvas.height=s):l||c.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(pe(u=[1/0,1/0,-1/0,-1/0],t),Qt(u,e*(this.renderBuffer_+r),u));var p,f=function(t){if(void 0!==Vs[t])return Vs[t];for(var e=2*t+1,n=t*t,r=new Array(n+1),i=0;i<=t;++i)for(var o=0;o<=t;++o){var s=i*i+o*o;if(s>n)break;var a=r[s];a||(a=[],r[s]=a),a.push(4*((t+i)*e+(t+o))+3),i>0&&a.push(4*((t-i)*e+(t+o))+3),o>0&&(a.push(4*((t+i)*e+(t-o))+3),i>0&&a.push(4*((t-i)*e+(t-o))+3))}for(var l=[],u=(i=0,r.length);i<u;++i)r[i]&&l.push.apply(l,r[i]);return Vs[t]=l,l}(r);function d(t,e){for(var n=c.getImageData(0,0,s,s).data,a=0,l=f.length;a<l;a++)if(n[f[a]]>0){if(!o||p!==bs&&p!==Os||-1!==o.indexOf(t)){var u=(f[a]-3)/4,h=r-u%s,d=r-(u/s|0),g=i(t,e,h*h+d*d);if(g)return g}c.clearRect(0,0,s,s);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],_=Bs.length-1;_>=0;--_)if(void 0!==(v=y[p=Bs[_]])&&(m=v.executeHitDetection(c,a,n,d,u)))return m}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],r=e[1],i=e[2],o=e[3],s=[n,r,n,o,i,o,i,r];return kn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return S(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,r,i,o,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(h),this.maxExtent_&&(t.save(),this.clip(t,n));var l,u,c,p,f,d,g=o||Bs;for(s&&a.reverse(),l=0,u=a.length;l<u;++l){var _=a[l].toString();for(f=this.executorsByZIndex_[_],c=0,p=g.length;c<p;++c){void 0!==(d=f[g[c]])&&d.execute(t,e,n,r,i,s)}}this.maxExtent_&&t.restore()},t}(),Vs={};var Xs=Us,Ws=0,Ys=1,Ks=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zs=function(t){function e(e,n,r,i,o,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=n,l.extent_=r,l.transform_=i,l.viewRotation_=o,l.squaredTolerance_=s,l.userTransform_=a,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 Ks(e,t),e.prototype.drawImages_=function(t,e,n,r){if(this.image_){var i=kn(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.tmpLocalTransform_,a=o.globalAlpha;1!=this.imageOpacity_&&(o.globalAlpha=a*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(s,f,d,1,1,l,-f,-d),o.setTransform.apply(o,s),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=a)}},e.prototype.drawText_=function(t,e,n,r){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var i=kn(t,e,n,r,this.transform_,this.pixelCoordinates_),o=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<n;e+=r){var a=i[e]+this.textOffsetX_,l=i[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=Gt(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);o.setTransform.apply(o,u),o.translate(a,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_,a,l),this.textFillState_&&o.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,n,r,i){var o=this.context_,s=kn(t,e,n,r,this.transform_,this.pixelCoordinates_);o.moveTo(s[0],s[1]);var a=s.length;i&&(a-=2);for(var l=2;l<a;l+=2)o.lineTo(s[l],s[l+1]);return i&&o.closePath(),n},e.prototype.drawRings_=function(t,e,n,r){for(var i=0,o=n.length;i<o;++i)e=this.moveToLineTo_(t,e,n[i],r,!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,n){var r=t.getFlatCoordinates();if(r){var i=t.getStride();return kn(r,0,r.length,i,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],r=e[3]-e[1],i=Math.sqrt(n*n+r*r),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 n=e.getGeometryFunction()(t);n&&Re(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,r=e.length;n<r;++n)this.drawGeometry(e[n])},e.prototype.drawPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},e.prototype.drawMultiPoint=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)},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_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var r=t.getFlatMidpoint();this.drawText_(r,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 n=this.context_,r=t.getFlatCoordinates(),i=0,o=t.getEnds(),s=t.getStride();n.beginPath();for(var a=0,l=o.length;a<l;++a)i=this.moveToLineTo_(r,i,o[a],s,!1);n.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 n=t.getFlatInteriorPoint();this.drawText_(n,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_,n=t.getOrientedFlatCoordinates(),r=0,i=t.getEndss(),o=t.getStride();e.beginPath();for(var s=0,a=i.length;s<a;++s){var l=i[s];r=this.drawRings_(n,r,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_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.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_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),e.setLineDash&&(g(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset)),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.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_,n=this.contextTextState_,r=t.textAlign?t.textAlign:Oi;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=r&&(n.textAlign=r,e.textAlign=r),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=r,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:r,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var r=t.getColor();this.fillState_={fillStyle:ci(r||Ei)}}else this.fillState_=null;if(e){var i=e.getColor(),o=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=s||bi;this.strokeState_={lineCap:void 0!==o?o:Ti,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*n.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Ri,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:ci(i||Pi)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*this.pixelRatio_,this.imageAnchorY_=n[1]*this.pixelRatio_,this.imageHeight_=e[1]*this.pixelRatio_,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[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 n=e.getColor();this.textFillState_={fillStyle:ci(n||Ei)}}else this.textFillState_=null;var r=t.getStroke();if(r){var i=r.getColor(),o=r.getLineCap(),s=r.getLineDash(),a=r.getLineDashOffset(),l=r.getLineJoin(),u=r.getWidth(),h=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==o?o:Ti,lineDash:s||bi,lineDashOffset:a||0,lineJoin:void 0!==l?l:Ri,lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:ci(i||Pi)}}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:Ci,textAlign:void 0!==v?v:Oi,textBaseline:void 0!==m?m:Fi},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}(Qo),Hs=Zs,qs="fraction",Js="pixels",Qs="bottom-left",$s="bottom-right",ta="top-left",ea="top-right";function na(t,e,n){return e+":"+t+":"+(n?oi(n):"null")}var ra=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 n=this.cache_[e];0!=(3&t++)||n.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},t.prototype.get=function(t,e,n){var r=na(t,e,n);return r in this.cache_?this.cache_[r]:null},t.prototype.set=function(t,e,n,r){var i=na(t,e,n);this.cache_[i]=r,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),ia=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oa=function(t){function n(e,n,r,i){var o=t.call(this)||this;return o.extent=e,o.pixelRatio_=r,o.resolution=n,o.state=i,o}return ia(n,t),n.prototype.changed=function(){this.dispatchEvent(T)},n.prototype.getExtent=function(){return this.extent},n.prototype.getImage=function(){return e()},n.prototype.getPixelRatio=function(){return this.pixelRatio_},n.prototype.getResolution=function(){return this.resolution},n.prototype.getState=function(){return this.state},n.prototype.load=function(){e()},n}(E),sa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function aa(t,e,n){var r=t;if(r.src&&Ft){var i=r.decode(),o=!0;return i.then((function(){o&&e()})).catch((function(t){o&&("EncodingError"===t.name&&"Invalid image type."===t.message?e():n())})),function(){o=!1}}var s=[z(r,D,e),z(r,b,n)];return function(){s.forEach(B)}}var la=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,r,Yr)||this;return a.src_=i,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.state=Yr,a.imageLoadFunction_=s,a}return sa(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Hr,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Se(this.extent)/this.image_.height),this.state=Zr,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Yr&&this.state!=Hr||(this.state=Kr,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=aa(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}(oa),ua=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ha=null,ca=function(t){function e(e,n,r,i,o,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==i&&(a.image_.crossOrigin=i),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=o,a.size_=r,a.src_=n,a.tainted_,a}return ua(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Zr){ha||(ha=pi(1,1)),ha.drawImage(this.image_,0,0);try{ha.getImageData(0,0,1,1),this.tainted_=!1}catch(t){ha=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(T)},e.prototype.handleImageError_=function(){this.imageState_=Hr,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Zr,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],n=pi(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.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_==Yr){this.imageState_=Kr;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=aa(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Zr){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply","multiply"===n.globalCompositeOperation||this.isTainted_())n.fillStyle=oi(this.color_),n.fillRect(0,0,e.width/t,e.height/t),n.globalCompositeOperation="destination-in",n.drawImage(this.image_,0,0);else{for(var r=n.getImageData(0,0,e.width,e.height),i=r.data,o=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],u=0,h=i.length;u<h;u+=4)i[u]*=o,i[u+1]*=s,i[u+2]*=a,i[u+3]*=l;n.putImageData(r,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(E);var pa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fa=function(t){function e(e){var n=this,i=e||{},o=void 0!==i.opacity?i.opacity:1,s=void 0!==i.rotation?i.rotation:0,a=void 0!==i.scale?i.scale:1,l=void 0!==i.rotateWithView&&i.rotateWithView;(n=t.call(this,{opacity:o,rotation:s,scale:a,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:l})||this).anchor_=void 0!==i.anchor?i.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:ta,n.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:qs,n.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:qs,n.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;rt(!(void 0!==c&&u),4),rt(!u||u&&h,5),void 0!==c&&0!==c.length||!u||(c=u.src||r(u)),rt(void 0!==c&&c.length>0,6);var p=void 0!==i.src?Yr:Zr;return n.color_=void 0!==i.color?li(i.color):null,n.iconImage_=function(t,e,n,r,i,o){var s=ra.get(e,r,o);return s||(s=new ca(t,e,n,r,i,o),ra.set(e,r,o,s)),s}(u,c,h,n.crossOrigin_,p,n.color_),n.offset_=void 0!==i.offset?i.offset:[0,0],n.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:ta,n.origin_=null,n.size_=void 0!==i.size?i.size:null,n}return pa(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(){if(this.normalizedAnchor_)return this.normalizedAnchor_;var t=this.anchor_,e=this.getSize();if(this.anchorXUnits_==qs||this.anchorYUnits_==qs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==qs&&(t[0]*=e[0]),this.anchorYUnits_==qs&&(t[1]*=e[1])}if(this.anchorOrigin_!=ta){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=ea&&this.anchorOrigin_!=$s||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Qs&&this.anchorOrigin_!=$s||(t[1]=-t[1]+e[1])}var n=this.getDisplacement();return t[0]-=n[0],t[1]+=n[1],this.normalizedAnchor_=t,this.normalizedAnchor_},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_!=ta){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=ea&&this.offsetOrigin_!=$s||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=Qs&&this.offsetOrigin_!=$s||(t[1]=n[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}(ni),da=fa,ga=.5;function _a(t,e,n,r,i,o,s){var a=pi(t[0]*ga,t[1]*ga);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new Hs(a,ga,i,null,s),c=n.length,p=Math.floor(16777215/c),f={},d=1;d<=c;++d){var g=n[d-1],_=g.getStyleFunction()||r;if(r){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=pi(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 da({img:O,imgSize:R,anchor:b.getAnchor(),anchorXUnits:Js,anchorYUnits:Js,offset:b.getOrigin(),opacity:1,size:b.getSize(),scale:b.getScale(),rotation:b.getRotation(),rotateWithView:b.getRotateWithView()}))}var F=C.getZIndex()||0;(L=f[F])||(L={},f[F]=L,L[dt]=[],L[mt]=[],L[pt]=[],L[ct]=[]),L[S.getType().replace("Multi","")].push(S,C)}}}}}for(var I=Object.keys(f).map(Number).sort(h),M=(d=0,I.length);d<M;++d){var L=f[I[d]];for(var A in L){var D=L[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 a.getImageData(0,0,l.width,l.height)}function ya(t,e,n){var r=[];if(n){var i=Math.floor(Math.round(t[0])*ga),o=Math.floor(Math.round(t[1])*ga),s=4*(Ie(i,0,n.width-1)+Ie(o,0,n.height-1)*n.width),a=n.data[s],l=n.data[s+1],u=n.data[s+2]+256*(l+256*a),h=Math.floor(16777215/e.length);u&&u%h==0&&r.push(e[u/h-1])}return r}var va={Point:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();i&&(t=i,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Zr)return;var l=t.getBuilder(n.getZIndex(),bs);l.setImageStyle(s,o),l.drawPoint(e,r)}if(a&&a.getText()){var u=t.getBuilder(n.getZIndex(),Os);u.setTextStyle(a,o),u.drawText(e,r)}},LineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),Rs);s.setFillStrokeStyle(null,o),s.drawLineString(e,r)}var a=n.getText();if(a&&a.getText()){var l=(i||t).getBuilder(n.getZIndex(),Os);l.setTextStyle(a),l.drawText(e,r)}},Polygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),Ps);a.setFillStrokeStyle(o,s),a.drawPolygon(e,r)}var l=n.getText();if(l&&l.getText()){var u=(i||t).getBuilder(n.getZIndex(),Os);u.setTextStyle(l),u.drawText(e,r)}},MultiPoint:function(t,e,n,r,i){var o,s=n.getImage(),a=n.getText();i&&(t=i,o=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Zr)return;var l=t.getBuilder(n.getZIndex(),bs);l.setImageStyle(s,o),l.drawMultiPoint(e,r)}if(a&&a.getText()){var u=(i||t).getBuilder(n.getZIndex(),Os);u.setTextStyle(a,o),u.drawText(e,r)}},MultiLineString:function(t,e,n,r,i){var o=n.getStroke();if(o){var s=t.getBuilder(n.getZIndex(),Rs);s.setFillStrokeStyle(null,o),s.drawMultiLineString(e,r)}var a=n.getText();if(a&&a.getText()){var l=(i||t).getBuilder(n.getZIndex(),Os);l.setTextStyle(a),l.drawText(e,r)}},MultiPolygon:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(s||o){var a=t.getBuilder(n.getZIndex(),Ps);a.setFillStrokeStyle(o,s),a.drawMultiPolygon(e,r)}var l=n.getText();if(l&&l.getText()){var u=(i||t).getBuilder(n.getZIndex(),Os);u.setTextStyle(l),u.drawText(e,r)}},GeometryCollection:function(t,e,n,r,i){var o,s,a=e.getGeometriesArray();for(o=0,s=a.length;o<s;++o){(0,va[a[o].getType()])(t,a[o],n,r,i)}},Circle:function(t,e,n,r,i){var o=n.getFill(),s=n.getStroke();if(o||s){var a=t.getBuilder(n.getZIndex(),Es);a.setFillStrokeStyle(o,s),a.drawCircle(e,r)}var l=n.getText();if(l&&l.getText()){var u=(i||t).getBuilder(n.getZIndex(),Os);u.setTextStyle(l),u.drawText(e,r)}}};function ma(t,e){return parseInt(r(t),10)-parseInt(r(e),10)}function xa(t,e){var n=wa(t,e);return n*n}function wa(t,e){return.5*t/e}function Sa(t,e,n,r,i,o,s){var a=!1,l=n.getImage();if(l){var u=l.getImageState();u==Zr||u==Hr?l.unlistenImageChange(i):(u==Yr&&l.load(),u=l.getImageState(),l.listenImageChange(i),a=!0)}return function(t,e,n,r,i,o){var s=n.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(r,i);if(n.getRenderer())Ca(t,a,n,e);else{(0,va[a.getType()])(t,a,n,e,o)}}(t,e,n,r,o,s),a}function Ca(t,e,n,r){if(e.getType()!=vt)t.getBuilder(n.getZIndex(),Ts).drawCustom(e,r,n.getRenderer(),n.getHitDetectionRenderer());else for(var i=e.getGeometries(),o=0,s=i.length;o<s;++o)Ca(t,i[o],n,r)}var Ea=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ta=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,n.dirty_=!1,n.hitDetectionImageData_=null,n.renderedFeatures_=null,n.renderedRevision_=-1,n.renderedResolution_=NaN,n.renderedExtent_=[1/0,1/0,-1/0,-1/0],n.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],n.renderedRotation_,n.renderedCenter_=null,n.renderedProjection_=null,n.renderedRenderOrder_=null,n.replayGroup_=null,n.replayGroupChanged=!0,n.declutterExecutorGroup=null,n.clipping=!0,n}return Ea(e,t),e.prototype.useContainer=function(e,n,r){r<1&&(e=null),t.prototype.useContainer.call(this,e,n,r)},e.prototype.renderWorlds=function(t,e,n){var r=e.extent,i=e.viewState,o=i.center,s=i.resolution,a=i.projection,l=i.rotation,u=a.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,f=!(p[Ws]||p[Ys]),d=this.context,g=Math.round(e.size[0]*c),_=Math.round(e.size[1]*c),y=h.getWrapX()&&a.canWrapX(),v=y?be(u):null,m=y?Math.ceil((r[2]-u[2])/v)+1:1,x=y?Math.floor((r[0]-u[0])/v):0;do{var w=this.getRenderTransform(o,s,l,c,g,_,x*v);t.execute(d,1,w,l,f,void 0,n)}while(++x<m)},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree)},e.prototype.renderFrame=function(t,e){var n=t.pixelRatio,r=t.layerStatesArray[t.layerIndex];!function(t,e,n){Dt(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),Nt(this.inversePixelTransform,this.pixelTransform);var i=zt(this.pixelTransform);this.useContainer(e,i,r.opacity);var o=this.context,s=o.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return null;var u=Math.round(t.size[0]*n),h=Math.round(t.size[1]*n);s.width!=u||s.height!=h?(s.width=u,s.height=h,s.style.transform!==i&&(s.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(r.extent&&this.clipping){var d=Dn(r.extent);(p=(f=Re(d,t.extent))&&!ne(d,t.extent))&&this.clipUnrotated(o,t,d)}f&&this.renderWorlds(a,t),p&&o.restore(),this.postRender(o,t);var g=Si(r.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 n=[this.context.canvas.width,this.context.canvas.height];kt(this.pixelTransform,n);var r=this.renderedCenter_,i=this.renderedResolution_,o=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=n[0]*ga,c=n[1]*ga;u.push(this.getRenderTransform(r,i,o,ga,h,c,0).slice());var p=l.getSource(),f=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!ne(f,a)){for(var d=a[0],g=be(f),_=0,y=void 0;d<f[0];)y=g*--_,u.push(this.getRenderTransform(r,i,o,ga,h,c,y).slice()),d+=g;for(_=0,d=a[2];d>f[2];)y=g*++_,u.push(this.getRenderTransform(r,i,o,ga,h,c,y).slice()),d-=g}this.hitDetectionImageData_=_a(n,u,this.renderedFeatures_,l.getStyleFunction(),a,i,o)}e(ya(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o){var s=this;if(this.replayGroup_){var a,l=e.viewState.resolution,u=e.viewState.rotation,h=this.getLayer(),c={},p=function(t,e,n){var s=r(t),a=c[s];if(a){if(!0!==a&&n<a.distanceSq){if(0===n)return c[s]=!0,o.splice(o.lastIndexOf(a),1),i(t,h,e);a.geometry=e,a.distanceSq=n}}else{if(0===n)return c[s]=!0,i(t,h,e);o.push(c[s]={feature:t,layer:h,geometry:e,distanceSq:n,callback:i})}},f=[this.replayGroup_];return this.declutterExecutorGroup&&f.push(this.declutterExecutorGroup),f.some((function(r){return a=r.forEachFeatureAtCoordinate(t,l,u,n,p,r===s.declutterExecutorGroup?e.declutterTree.all().map((function(t){return t.value})):null)})),a}},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(),n=e.getSource();if(!n)return!1;var r=t.viewHints[Ws],i=t.viewHints[Ys],o=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!o&&r||!s&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=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=ma);var _=l.center.slice(),y=Qt(a,f*h),v=y.slice(),m=[y.slice()],x=u.getExtent();if(n.getWrapX()&&u.canWrapX()&&!ne(x,t.extent)){var w=be(x),S=Math.max(be(y)/2,w);y[0]=x[0]-S,y[2]=x[2]+S,yn(_,u);var C=function(t,e){var n=e.getExtent(),r=me(t);if(e.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){var i=be(n),o=Math.floor((r[0]-n[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&&ne(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 gs(wa(h,c),y,h,c);this.getLayer().getDeclutter()&&(E=new gs(wa(h,c),y,h,c));for(var b=0,R=m.length;b<R;++b)n.loadFeatures(m[b],h,u);var P=xa(h,c),O=function(t){var n,r=t.getStyleFunction()||e.getStyleFunction();if(r&&(n=r(t,h)),n){var i=this.renderFeature(t,P,n,T,undefined,E);this.dirty_=this.dirty_||i}}.bind(this),F=An(y),I=n.getFeaturesInExtent(F);d&&I.sort(d);for(b=0,R=I.length;b<R;++b)O(I[b]);this.renderedFeatures_=I;var M=T.finish(),L=new Xs(y,h,c,n.getOverlaps(),M,e.getRenderBuffer());return E&&(this.declutterExecutorGroup=new Xs(y,h,c,n.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_=L,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,n,r,i,o){if(!n)return!1;var s=!1;if(Array.isArray(n))for(var a=0,l=n.length;a<l;++a)s=Sa(r,t,n[a],e,this.boundHandleStyleImageChange_,i,o)||s;else s=Sa(r,t,n,e,this.boundHandleStyleImageChange_,i,o);return s},e}(Cs),ba=Ta,Ra=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pa=function(t){function e(e){return t.call(this,e)||this}return Ra(e,t),e.prototype.createRenderer=function(){return new ba(this)},e}(Wo),Oa=function(){function t(t){this.rbush_=new Oo(t),this.items_={}}return t.prototype.insert=function(t,e){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[r(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),i=0,o=e.length;i<o;i++){var s=t[i],a=e[i],l={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:a};n[i]=l,this.items_[r(a)]=l}this.rbush_.load(n)},t.prototype.remove=function(t){var e=r(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)},t.prototype.update=function(t,e){var n=this.items_[r(e)];he([n.minX,n.minY,n.maxX,n.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 n,r=0,i=t.length;r<i;r++)if(n=e(t[r]))return n;return n},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 se(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}(),Fa=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Ia(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var Ma=function(t){function n(e){var n=t.call(this)||this;n.projection=wn(e.projection),n.attributions_=Ia(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:mo,n.wrapX_=void 0!==e.wrapX&&e.wrapX,n.viewResolver=null,n.viewRejector=null;var r=n;return n.viewPromise_=new Promise((function(t,e){r.viewResolver=t,r.viewRejector=e})),n}return Fa(n,t),n.prototype.getAttributions=function(){return this.attributions_},n.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},n.prototype.getProjection=function(){return this.projection},n.prototype.getResolutions=function(){return e()},n.prototype.getView=function(){return this.viewPromise_},n.prototype.getState=function(){return this.state_},n.prototype.getWrapX=function(){return this.wrapX_},n.prototype.getContextOptions=function(){},n.prototype.refresh=function(){this.changed()},n.prototype.setAttributions=function(t){this.attributions_=Ia(t),this.changed()},n.prototype.setState=function(t){this.state_=t,this.changed()},n}(q),La="addfeature",Aa="changefeature",Da="clear",ka="removefeature",ja="featuresloadstart",Ga="featuresloadend",Na="featuresloaderror";function za(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Ba="arraybuffer",Ua="json",Va="text",Xa="xml";function Wa(t,e,n,r,i,o,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,r,i):t,!0),e.getType()==Ba&&(a.responseType="arraybuffer"),a.withCredentials=false,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var r=e.getType(),l=void 0;r==Ua||r==Va?l=a.responseText:r==Xa?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):r==Ba&&(l=a.response),l?o(e.readFeatures(l,{extent:n,featureProjection:i}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}function Ya(t,e){return function(n,r,i,o,s){var a=this;Wa(t,e,n,r,i,(function(t,e){a.addFeatures(t),void 0!==o&&o(t)}),s||v)}}var Ka=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Za=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.feature=n,i.features=r,i}return Ka(e,t),e}(a),Ha=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{attributions:r.attributions,projection:void 0,state:mo,wrapX:void 0===r.wrapX||r.wrapX})||this).on,n.once,n.un,n.loader_=v,n.format_=r.format,n.overlaps_=void 0===r.overlaps||r.overlaps,n.url_=r.url,void 0!==r.loader?n.loader_=r.loader:void 0!==n.url_&&(rt(n.format_,7),n.loader_=Ya(n.url_,n.format_)),n.strategy_=void 0!==r.strategy?r.strategy:za;var i,o,s=void 0===r.useSpatialIndex||r.useSpatialIndex;return n.featuresRtree_=s?new Oa:null,n.loadedExtentsRtree_=new Oa,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(r.features)?o=r.features:r.features&&(o=(i=r.features).getArray()),s||void 0!==i||(i=new nt(o)),void 0!==o&&n.addFeaturesInternal(o),void 0!==i&&n.bindFeaturesCollection_(i),n}return Ka(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=r(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var n=t.getGeometry();if(n){var i=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(i,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Za(La,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 n=!0,r=e.getId();return void 0!==r&&(r.toString()in this.idIndex_?n=!1:this.idIndex_[r.toString()]=e),n&&(rt(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),n},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],n=[],i=[],o=0,s=t.length;o<s;o++){var a=r(u=t[o]);this.addToIndex_(a,u)&&n.push(u)}o=0;for(var l=n.length;o<l;o++){var u;a=r(u=n[o]);this.setupChangeEvents_(a,u);var h=u.getGeometry();if(h){var c=h.getExtent();e.push(c),i.push(u)}else this.nullGeometryFeatures_[a]=u}this.featuresRtree_&&this.featuresRtree_.load(e,i);o=0;for(var p=n.length;o<p;o++)this.dispatchEvent(new Za(La,n[o]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(La,(function(n){e||(e=!0,t.push(n.feature),e=!1)})),this.addEventListener(ka,(function(n){e||(e=!0,t.remove(n.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(B)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_)for(var n in this.featuresRtree_.forEach(this.removeFeatureInternal.bind(this)),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var r=new Za(Da);this.dispatchEvent(r),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 n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,(function(n){return n.getGeometry().intersectsCoordinate(t)?e(n):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(n){if(n.getGeometry().intersectsExtent(t)){var r=e(n);if(r)return r}}))},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 n=t[0],r=t[1],i=null,o=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||_;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(n,r,o,s))<u){i=t;var h=Math.sqrt(s);a[0]=n-h,a[1]=r-h,a[2]=n+h,a[3]=r+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,n=r(e),i=e.getGeometry();if(i){var o=i.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);var s=e.getId();if(void 0!==s){var a=s.toString();this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Za(Aa,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:r(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&S(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,n){for(var r=this.loadedExtentsRtree_,i=this.strategy_(t,e,n),o=function(t,o){var a=i[t];r.forEachInExtent(a,(function(t){return ne(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new Za(ja)),s.loader_.call(s,a,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Za(Ga,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Za(Na))}.bind(s)),r.insert(a,{extent:a.slice()}))},s=this,a=0,l=i.length;a<l;++a)o(a);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,n=this.loadedExtentsRtree_;n.forEachInExtent(t,(function(n){if(he(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){var e=r(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=r(t);this.featureChangeKeys_[e].forEach(B),delete this.featureChangeKeys_[e];var n=t.getId();void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Za(ka,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var n in this.idIndex_)if(this.idIndex_[n]===t){delete this.idIndex_[n],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e.prototype.setUrl=function(t){rt(this.format_,7),this.url_=t,this.setLoader(Ya(t,this.format_))},e}(Ma),qa=Ha,Ja=0,Qa=1,$a=2,tl=3,el=4;function nl(t){return Math.pow(t,3)}function rl(t){return 1-nl(1-t)}function il(t){return 3*t*t-2*t*t*t}function ol(t){return t}var sl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),al=function(t){function n(e,n,r){var i=t.call(this)||this,o=r||{};return i.tileCoord=e,i.state=n,i.interimTile=null,i.key="",i.transition_=void 0===o.transition?250:o.transition,i.transitionStarts_={},i}return sl(n,t),n.prototype.changed=function(){this.dispatchEvent(T)},n.prototype.release=function(){},n.prototype.getKey=function(){return this.key+"/"+this.tileCoord},n.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==$a)return this.transition_=0,t;t=t.interimTile}while(t);return this},n.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==$a){t.interimTile=null;break}t.getState()==Qa?e=t:t.getState()==Ja?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},n.prototype.getTileCoord=function(){return this.tileCoord},n.prototype.getState=function(){return this.state},n.prototype.setState=function(t){if(this.state!==tl&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},n.prototype.load=function(){e()},n.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;var r=e-n+1e3/60;return r>=this.transition_?1:nl(r/this.transition_)},n.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},n.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},n}(E),ll=al,ul=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var hl=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=i,a.src_=r,a.key=r,a.image_=new Image,null!==i&&(a.image_.crossOrigin=i),a.unlisten_=null,a.tileLoadFunction_=o,a}return ul(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=$a,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=tl,this.unlistenImage_(),this.image_=((t=pi(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=$a:this.state=el,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==tl&&(this.state=Ja,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Ja&&(this.state=Qa,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=aa(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(ll),cl=function(){function t(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,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 n=e-3;n>0&&this.points_[n+2]>t;)n-=3;var r=this.points_[e+2]-this.points_[n+2];if(r<1e3/60)return!1;var i=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,i),this.initialVelocity_=Math.sqrt(i*i+o*o)/r,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),pl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fl=function(t){function n(e){var n=t.call(this)||this;return n.map_=e,n}return pl(n,t),n.prototype.dispatchRenderEvent=function(t,n){e()},n.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,r=t.pixelToCoordinateTransform;Gt(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Nt(r,n)},n.prototype.forEachFeatureAtCoordinate=function(t,e,n,r,i,o,s,a){var l,u=e.viewState;function h(t,e,n,r){return i.call(o,e,t?n:null,r)}var c=u.projection,p=yn(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&r){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()&&Co(w,u)&&s.call(a,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,n,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}},n.prototype.forEachLayerAtPixel=function(t,n,r,i,o){return e()},n.prototype.hasFeatureAtCoordinate=function(t,e,n,r,i,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,r,_,this,i,o)},n.prototype.getMap=function(){return this.map_},n.prototype.renderFrame=function(t){e()},n.prototype.scheduleExpireIconCache=function(t){ra.canExpireCache()&&t.postRenderFunctions.push(dl)},n}(u);function dl(t,e){ra.expire()}var gl=fl,_l=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),yl=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=N(Mi,l,e.redrawText.bind(e)),n.element_=document.createElement("div");var r=n.element_.style;r.position="absolute",r.width="100%",r.height="100%",r.zIndex="0",n.element_.className="ol-unselectable ol-layers";var i=e.getViewport();return i.insertBefore(n.element_,i.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return _l(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var r=new xs(t,void 0,e);n.dispatchEvent(r)}},e.prototype.disposeInternal=function(){B(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(Dr,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=t.viewState;this.children_.length=0;for(var r=[],i=null,o=0,s=e.length;o<s;++o){var a=e[o];if(t.layerIndex=o,Co(a,n)&&(a.sourceState==mo||a.sourceState==yo)){var l=a.layer,u=l.render(t,i);u&&(u!==i&&(this.children_.push(u),i=u),"getDeclutter"in l&&r.push(l))}}for(o=r.length-1;o>=0;--o)r[o].renderDeclutter(t);!function(t,e){for(var n=t.childNodes,r=0;;++r){var i=n[r],o=e[r];if(!i&&!o)break;i!==o&&(i?o?t.insertBefore(o,i):(t.removeChild(i),--r):t.appendChild(o))}}(this.element_,this.children_),this.dispatchRenderEvent(kr,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,n,r,i){for(var o=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],u=l.layer;if(u.hasRenderer()&&Co(l,o)&&i(u)){var h=u.getRenderer().getDataAtPixel(t,e,n);if(h){var c=r(u,h);if(c)return c}}}},e}(gl),vl=yl,ml=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xl="layers",wl=function(t){function e(e){var n=this,r=e||{},i=m({},r);delete i.layers;var o=r.layers;return(n=t.call(this,i)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(xl,n.handleLayersChanged_),o?Array.isArray(o)?o=new nt(o.slice(),{unique:!0}):rt("function"==typeof o.getArray,43):o=new nt(void 0,{unique:!0}),n.setLayers(o),n}return ml(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(B),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(B);x(this.listenerKeys_);for(var n=t.getArray(),i=0,o=n.length;i<o;i++){var s=n[i];this.listenerKeys_[r(s)]=[N(s,l,this.handleLayerChange_,this),N(s,T,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[r(e)]=[N(e,l,this.handleLayerChange_,this),N(e,T,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=r(t.element);this.listenerKeys_[e].forEach(B),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(xl)},e.prototype.setLayers=function(t){this.set(xl,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:[],n=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));var r=this.getLayerState(),i=r.zIndex;t||void 0!==r.zIndex||(i=0);for(var o=n,s=e.length;o<s;o++){var a=e[o];a.opacity*=r.opacity,a.visible=a.visible&&r.visible,a.maxResolution=Math.min(a.maxResolution,r.maxResolution),a.minResolution=Math.max(a.minResolution,r.minResolution),a.minZoom=Math.max(a.minZoom,r.minZoom),a.maxZoom=Math.min(a.maxZoom,r.maxZoom),void 0!==r.extent&&(void 0!==a.extent?a.extent=Ce(a.extent,r.extent):a.extent=r.extent),void 0===a.zIndex&&(a.zIndex=i)}return e},e.prototype.getSourceState=function(){return mo},e}(_o),Sl=Object.freeze({__proto__:null,default:wl}),Cl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),El=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.map=n,i.frameState=void 0!==r?r:null,i}return Cl(e,t),e}(a),Tl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),bl=function(t){function e(e,n,r,i,o){var s=t.call(this,e,n,o)||this;return s.originalEvent=r,s.pixel_=null,s.coordinate_=null,s.dragging=void 0!==i&&i,s}return Tl(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}(El),Rl={SINGLECLICK:"singleclick",CLICK:P,DBLCLICK:O,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Pl="pointermove",Ol="pointerdown",Fl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Il=function(t){function e(e,n){var r=t.call(this,e)||this;r.map_=e,r.clickTimeoutId_,r.emulateClicks_=!1,r.dragging_=!1,r.dragListenerKeys_=[],r.moveTolerance_=void 0===n?1:n,r.down_=null;var i=r.map_.getViewport();return r.activePointers_=0,r.trackedTouches_={},r.element_=i,r.pointerdownListenerKey_=N(i,Ol,r.handlePointerDown_,r),r.originalPointerMoveEvent_,r.relayedListenerKey_=N(i,Pl,r.relayEvent_,r),r.boundHandleTouchMove_=r.handleTouchMove_.bind(r),r.element_.addEventListener(j,r.boundHandleTouchMove_,!!It&&{passive:!1}),r}return Fl(e,t),e.prototype.emulateClick_=function(t){var e=new bl(Rl.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new bl(Rl.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new bl(Rl.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Rl.POINTERUP||e.type==Rl.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Rl.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new bl(Rl.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(B),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 bl(Rl.POINTERDOWN,this.map_,t);for(var n in this.dispatchEvent(e),this.down_={},t){var r=t[n];this.down_[n]="function"==typeof r?v:r}if(0===this.dragListenerKeys_.length){var i=this.map_.getOwnerDocument();this.dragListenerKeys_.push(N(i,Rl.POINTERMOVE,this.handlePointerMove_,this),N(i,Rl.POINTERUP,this.handlePointerUp_,this),N(this.element_,Rl.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==i&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),Rl.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new bl(Rl.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 bl(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_&&(B(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(j,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(B(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(B),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(E),Ml="postrender",Ll="movestart",Al="moveend",Dl="layergroup",kl="size",jl="target",Gl="view",Nl=1/0,zl=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_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var r=this.keyFunction_(n);return delete this.queuedElements_[r],n},t.prototype.enqueue=function(t){rt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=Nl&&(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_,n=this.priorities_,r=e.length,i=e[t],o=n[t],s=t;t<r>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<r&&n[l]<n[a]?l:a;e[t]=e[u],n[t]=n[u],t=u}e[t]=i,n[t]=o,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var n=this.elements_,r=this.priorities_,i=n[e],o=r[e];e>t;){var s=this.getParentIndex_(e);if(!(r[s]>o))break;n[e]=n[s],r[e]=r[s],e=s}n[e]=i,r[e]=o},t.prototype.reprioritize=function(){var t,e,n,r=this.priorityFunction_,i=this.elements_,o=this.priorities_,s=0,a=i.length;for(e=0;e<a;++e)(n=r(t=i[e]))==Nl?delete this.queuedElements_[this.keyFunction_(t)]:(o[s]=n,i[s++]=t);i.length=s,o.length=s,this.heapify_()},t}(),Bl=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ul=function(t){function e(e,n){var r=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return r.boundHandleTileChange_=r.handleTileChange.bind(r),r.tileChangeCallback_=n,r.tilesLoading_=0,r.tilesLoadingKeys_={},r}return Bl(e,t),e.prototype.enqueue=function(e){var n=t.prototype.enqueue.call(this,e);n&&e[0].addEventListener(T,this.boundHandleTileChange_);return n},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,n=e.getState();if(n===$a||n===tl||n===el){e.removeEventListener(T,this.boundHandleTileChange_);var r=e.getKey();r in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[r],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var n,r,i=0;this.tilesLoading_<t&&i<e&&this.getCount()>0;)r=(n=this.dequeue()[0]).getKey(),n.getState()!==Ja||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++i,n.load())},e}(zl);var Vl="center",Xl="resolution",Wl="rotation",Yl=256;function Kl(t,e,n){return function(r,i,o,s,a){if(r){var l=e?0:o[0]*i,u=e?0:o[1]*i,h=a?a[0]:0,c=a?a[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(r[0],p,f),y=Ie(r[1],d,g),v=30*i;return s&&n&&(_+=-v*Math.log(1+Math.max(0,p-r[0])/v)+v*Math.log(1+Math.max(0,r[0]-f)/v),y+=-v*Math.log(1+Math.max(0,d-r[1])/v)+v*Math.log(1+Math.max(0,r[1]-g)/v)),[_,y]}}}function Zl(t){return t}function Hl(t,e,n,r){var i=be(e)/n[0],o=Se(e)/n[1];return r?Math.min(t,Math.max(i,o)):Math.min(t,Math.min(i,o))}function ql(t,e,n){var r=Math.min(t,e);return r*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/t-1))/50+1),Ie(r,n/2,2*e)}function Jl(t,e,n,r,i){return function(o,s,a,l){if(void 0!==o){var u=r?Hl(t,r,a,i):t;return(void 0===n||n)&&l?ql(o,u,e):Ie(o,e,u)}}}function Ql(t){return void 0!==t?0:void 0}function $l(t){return void 0!==t?t:void 0}var tu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),eu=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=m({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=En(r.projection,"EPSG:3857"),n.viewportSize_=[100,100],n.targetCenter_=null,n.targetResolution_,n.targetRotation_,n.nextCenter_=null,n.nextResolution_,n.nextRotation_,n.cancelAnchor_=void 0,r.center&&(r.center=Ln(r.center,n.projection_)),r.extent&&(r.extent=Dn(r.extent,n.projection_)),n.applyOptions_(r),n}return tu(e,t),e.prototype.applyOptions_=function(t){var e=function(t){var e,n,r,i=28,o=2,s=void 0!==t.minZoom?t.minZoom:0,a=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=En(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;n=y[s],r=void 0!==y[a]?y[a]:y[y.length-1],e=t.constrainResolution?function(t,e,n,r){return function(i,o,s,a){if(void 0!==i){var l=t[0],u=t[t.length-1],h=n?Hl(l,n,s,r):l;if(a)return void 0===e||e?ql(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):Jl(n,r,h,!g&&_,c)}else{var v=(d?Math.max(be(d),Se(d)):360*wt[St.DEGREES]/f.getMetersPerUnit())/Yl/Math.pow(o,0),m=v/Math.pow(o,i-0);void 0!==(n=t.maxResolution)?s=0:n=v/Math.pow(l,s),void 0===(r=t.minResolution)&&(r=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(l,a):v/Math.pow(l,a):m),a=s+Math.floor(Math.log(n/r)/Math.log(l)),r=n/Math.pow(l,a-s),e=t.constrainResolution?function(t,e,n,r,i,o){return function(s,a,l,u){if(void 0!==s){var h=i?Hl(e,i,l,o):e,c=void 0!==n?n:0;if(u)return void 0===r||r?ql(s,h,c):Ie(s,c,h);var p=Math.ceil(Math.log(e/h)/Math.log(t)-1e-9),f=-a*(.5-1e-9)+.5,d=Math.min(h,s),g=Math.floor(Math.log(e/d)/Math.log(t)+f),_=Math.max(p,g);return Ie(e/Math.pow(t,_),c,h)}}}(l,n,r,h,!g&&_,c):Jl(n,r,h,!g&&_,c)}return{constraint:e,maxResolution:n,minResolution:r,minZoom:s,zoomFactor:l}}(t);this.maxResolution_=e.maxResolution,this.minResolution_=e.minResolution,this.zoomFactor_=e.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=e.minZoom;var n=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Kl(t.extent,t.constrainOnlyCenter,e)}var n=En(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&n.isGlobal()){var r=n.getExtent().slice();return r[0]=-1/0,r[2]=1/0,Kl(r,!1,!1)}return Zl}(t),r=e.constraint,i=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?$l:"number"==typeof e?(n=e,r=2*Math.PI/n,function(t,e){return e?t:void 0!==t?t=Math.floor(t/r+.5)*r:void 0}):$l}return Ql;var n,r;var i,o}(t);this.constraints_={center:n,resolution:r,rotation:i},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),this.setProperties({}),this.options_=t},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var n=this.getCenter();if(n){var r=t||[0,0,0,0];e=e||[0,0,0,0];var i=this.getResolution(),o=i/2*(r[3]-e[3]+e[1]-r[1]),s=i/2*(r[0]-e[0]+e[2]-r[2]);this.setCenterInternal([n[0]+o,n[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=m({},this.options_);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),n=0;n<e.length;++n){var r=arguments[n];r.center&&((r=m({},r)).center=Ln(r.center,this.getProjection())),r.anchor&&((r=m({},r)).anchor=Ln(r.anchor,this.getProjection())),e[n]=r}this.animateInternal.apply(this,e)},e.prototype.animateInternal=function(t){var e,n=arguments.length;n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n);for(var r=0;r<n&&!this.isDef();++r){var i=arguments[r];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(r!==n){for(var o=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_,u=[];r<n;++r){var h=arguments[r],c={start:o,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||il,callback:e};if(h.center&&(c.sourceCenter=s,c.targetCenter=h.center.slice(),s=c.targetCenter),void 0!==h.zoom?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(h.zoom),a=c.targetResolution):h.resolution&&(c.sourceResolution=a,c.targetResolution=h.resolution,a=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}ru(c)?c.complete=!0:o+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(Ws,1),this.updateAnimations_()}else e&&nu(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Ws]>0},e.prototype.getInteracting=function(){return this.hints_[Ys]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Ws,-this.hints_[Ws]);for(var e=0,n=this.animations_.length;e<n;++e){var r=this.animations_[e];if(r[0].callback&&nu(r[0].callback,!1),!t)for(var i=0,o=r.length;i<o;++i){var s=r[i];if(!s.complete){t=s.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,n=this.animations_.length-1;n>=0;--n){for(var r=this.animations_[n],i=!0,o=0,s=r.length;o<s;++o){var a=r[o];if(!a.complete){var l=t-a.start,u=a.duration>0?l/a.duration:1;u>=1?(a.complete=!0,u=1):i=!1;var h=a.easing(u);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],f=a.targetCenter[0],d=a.targetCenter[1];this.nextCenter_=a.targetCenter;var g=c+h*(f-c),_=p+h*(d-p);this.targetCenter_=[g,_]}if(a.sourceResolution&&a.targetResolution){var y=1===h?a.targetResolution:a.sourceResolution+h*(a.targetResolution-a.sourceResolution);if(a.anchor){var v=this.getViewportSize_(this.getRotation()),m=this.constraints_.resolution(y,0,v,!0);this.targetCenter_=this.calculateCenterZoom(m,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=y,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var x=1===h?Ge(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var w=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(w,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(i){this.animations_[n]=null,this.setHint(Ws,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var S=r[0].callback;S&&nu(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 n,r,i,o=this.getCenterInternal();return void 0!==o&&(fn(n=[o[0]-e[0],o[1]-e[1]],t-this.getRotation()),i=e,(r=n)[0]+=+i[0],r[1]+=+i[1]),n},e.prototype.calculateCenterZoom=function(t,e){var n,r=this.getCenterInternal(),i=this.getResolution();void 0!==r&&void 0!==i&&(n=[e[0]-t*(e[0]-r[0])/i,e[1]-t*(e[1]-r[1])/i]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],r=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(r*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(r*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?Mn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(Vl)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.options_.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 An(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();rt(n,1);var r=this.getResolution();rt(void 0!==r,2);var i=this.getRotation();return rt(void 0!==i,3),we(n,r,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(Xl)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Dn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),r=be(t)/n[0],i=Se(t)/n[1];return Math.max(r,i)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/Math.log(e);return function(t){return n/Math.pow(e,t*i)}},e.prototype.getRotation=function(){return this.get(Wl)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/e;return function(t){return Math.log(n/t)/e/i}},e.prototype.getViewportSizeMinusPadding_=function(t){var e=this.getViewportSize_(t),n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e},e.prototype.getState=function(){var t=this.getProjection(),e=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){var o=this.getViewportSizeMinusPadding_();r=iu(r,this.getViewportSize_(),[o[0]/2+i[3],o[1]/2+i[0]],e,n)}return{center:r.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,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,n,r=this.minZoom_||0;if(this.resolutions_){var i=p(this.resolutions_,t,1);r=i,e=this.resolutions_[i],n=i==this.resolutions_.length-1?2:e/this.resolutions_[i+1]}else e=this.maxResolution_,n=this.zoomFactor_;return r+Math.log(e/t)/Math.log(n)},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),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,Ie(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(rt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))rt(!Pe(t),25),n=Ir(r=Dn(t,this.getProjection()));else if(t.getType()===mt){var r;(n=Ir(r=Dn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),me(r))}else{n=t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),r=Math.sin(-e),i=t.getFlatCoordinates(),o=t.getStride(),s=1/0,a=1/0,l=-1/0,u=-1/0,h=0,c=i.length;h<c;h+=o){var p=i[h]*n-i[h+1]*r,f=i[h]*r+i[h+1]*n;s=Math.min(s,p),a=Math.min(a,f),l=Math.max(l,p),u=Math.max(u,f)}return[s,a,l,u]},e.prototype.fitInternal=function(t,e){var n=e||{},r=n.size;r||(r=this.getViewportSizeMinusPadding_());var i,o=void 0!==n.padding?n.padding:[0,0,0,0],s=void 0!==n.nearest&&n.nearest;i=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.getResolutionForZoom(n.maxZoom):0;var a=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(a,[r[0]-o[1]-o[3],r[1]-o[0]-o[2]]);l=isNaN(l)?i:Math.max(l,i),l=this.getConstrainedResolution(l,s?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=me(a);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),_=n.callback?n.callback:v;void 0!==n.duration?this.animateInternal({resolution:l,center:g,duration:n.duration,easing:n.easing},_):(this.targetResolution_=l,this.targetCenter_=g,this.applyTargetState_(!1,!0),nu(_,!0))},e.prototype.centerOn=function(t,e,n){this.centerOnInternal(Ln(t,this.getProjection()),e,n)},e.prototype.centerOnInternal=function(t,e,n){this.setCenterInternal(iu(t,e,n,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,n,r){var i,o=this.padding_;if(o&&t){var s=this.getViewportSizeMinusPadding_(-n),a=iu(t,r,[s[0]/2+o[3],s[1]/2+o[0]],e,n);i=[t[0]-a[0],t[1]-a[1]]}return i},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Mn(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 n=e&&Ln(e,this.getProjection());this.adjustResolutionInternal(t,n)},e.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*t,0,r,n);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=Ln(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(r,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(Ln(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 n=this.getAnimating()||this.getInteracting()||e,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,0,i,n),s=this.constraints_.center(this.targetCenter_,o,i,n,this.calculateCenterShift(this.targetCenter_,o,r,i));this.get(Wl)!==r&&this.set(Wl,r),this.get(Xl)!==o&&this.set(Xl,o),this.get(Vl)&&pn(this.get(Vl),s)||this.set(Vl,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,n){var r=void 0!==t?t:200,i=e||0,o=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(o),a=this.constraints_.resolution(this.targetResolution_,i,s),l=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,o,s));if(0===r&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=o,this.targetCenter_=l,void this.applyTargetState_();var u=n||(0===r?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===o&&this.getCenterInternal()&&pn(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:o,center:l,resolution:a,duration:r,easing:rl,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Ys,1)},e.prototype.endInteraction=function(t,e,n){var r=n&&Ln(n,this.getProjection());this.endInteractionInternal(t,e,r)},e.prototype.endInteractionInternal=function(t,e,n){this.setHint(Ys,-1),this.resolveConstraints(t,e,n)},e.prototype.getConstrainedCenter=function(t,e){var n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)},e.prototype.getConstrainedZoom=function(t,e){var n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))},e.prototype.getConstrainedResolution=function(t,e){var n=e||0,r=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,r)},e}(q);function nu(t,e){setTimeout((function(){t(e)}),0)}function ru(t){return!(t.sourceCenter&&t.targetCenter&&!pn(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function iu(t,e,n,r,i){var o=Math.cos(-i),s=Math.sin(-i),a=t[0]*o-t[1]*s,l=t[1]*o+t[0]*s;return[(a+=(e[0]/2-n[0])*r)*o-(l+=(n[1]-e[1]/2)*r)*(s=-s),l*o+a*s]}var ou=eu,su=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),au=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,r,i,o={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new wl({layers:t.layers});o[Dl]=s,o[jl]=t.target,o[Gl]=t.view instanceof ou?t.view:new ou,void 0!==t.controls&&(Array.isArray(t.controls)?n=new nt(t.controls.slice()):(rt("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?r=new nt(t.interactions.slice()):(rt("function"==typeof t.interactions.getArray,48),r=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?i=new nt(t.overlays.slice()):(rt("function"==typeof t.overlays.getArray,49),i=t.overlays):i=new nt;return{controls:n,interactions:r,keyboardEventTarget:e,overlays:i,values:o}}(e);n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Pt,n.postRenderTimeoutHandle_,n.animationDelayKey_,n.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}.bind(n),n.coordinateToPixelTransform_=[1,0,0,1,0,0],n.pixelToCoordinateTransform_=[1,0,0,1,0,0],n.frameIndex_=0,n.frameState_=null,n.previousExtent_=null,n.viewPropertyListenerKey_=null,n.viewChangeListenerKey_=null,n.layerGroupPropertyListenerKeys_=null,n.viewport_=document.createElement("div"),n.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),n.viewport_.style.position="relative",n.viewport_.style.overflow="hidden",n.viewport_.style.width="100%",n.viewport_.style.height="100%",n.overlayContainer_=document.createElement("div"),n.overlayContainer_.style.position="absolute",n.overlayContainer_.style.zIndex="0",n.overlayContainer_.style.width="100%",n.overlayContainer_.style.height="100%",n.overlayContainer_.style.pointerEvents="none",n.overlayContainer_.className="ol-overlaycontainer",n.viewport_.appendChild(n.overlayContainer_),n.overlayContainerStopEvent_=document.createElement("div"),n.overlayContainerStopEvent_.style.position="absolute",n.overlayContainerStopEvent_.style.zIndex="0",n.overlayContainerStopEvent_.style.width="100%",n.overlayContainerStopEvent_.style.height="100%",n.overlayContainerStopEvent_.style.pointerEvents="none",n.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",n.viewport_.appendChild(n.overlayContainerStopEvent_),n.mapBrowserEventHandler_=null,n.moveTolerance_=e.moveTolerance,n.keyboardEventTarget_=r.keyboardEventTarget,n.keyHandlerKeys_=null,n.controls=r.controls||new nt,n.interactions=r.interactions||new nt,n.overlays_=r.overlays,n.overlayIdIndex_={},n.renderer_=null,n.handleResize_,n.postRenderFunctions_=[],n.tileQueue_=new Ul(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(Dl,n.handleLayerGroupChanged_),n.addChangeListener(Gl,n.handleViewChanged_),n.addChangeListener(kl,n.handleSizeChanged_),n.addChangeListener(jl,n.handleTargetChanged_),n.setProperties(r.values);var i=n;return!e.view||e.view instanceof ou||e.view.then((function(t){i.setView(new ou(t))})),n.controls.addEventListener(J,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(Q,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(J,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(Q,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(J,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(Q,function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(n)),n.controls.forEach(function(t){t.setMap(this)}.bind(n)),n.interactions.forEach(function(t){t.setMap(this)}.bind(n)),n.overlays_.forEach(n.addOverlayInternal_.bind(n)),n}return su(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.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,n){if(this.frameState_){var r=this.getCoordinateFromPixelInternal(t),i=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,o=void 0!==n.layerFilter?n.layerFilter:_,s=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,s,e,null,o,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_){var r=n||{},i=void 0!==r.hitTolerance?r.hitTolerance:0,o=r.layerFilter||_;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,i,e,o)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var n=this.getCoordinateFromPixelInternal(t),r=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(n,this.frameState_,i,o,r,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(),n="changedTouches"in t?t.changedTouches[0]:t;return[n.clientX-e.left,n.clientY-e.top]},e.prototype.getTarget=function(){return this.get(jl)},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 Mn(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(Dl)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof nt)e.setLayers(t);else{var n=e.getLayers();n.clear(),n.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoading=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var r=t[e].layer.getSource();if(r&&r.loading)return!0}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Ln(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(kl)},e.prototype.getView=function(){return this.get(Gl)},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,n,r){return function(t,e,n,r,i){if(!t||!(n in t.wantedTiles))return Nl;if(!t.wantedTiles[n][e.getKey()])return Nl;var o=t.viewState.center,s=r[0]-o[0],a=r[1]-o[1];return 65536*Math.log(i)+Math.sqrt(s*s+a*a)/i}(this.frameState_,t,e,n,r)},e.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,r=new bl(n,this,t);this.handleMapBrowserEvent(r)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,n=e.type;if(n===Ol||n===G||n===L){var r=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():r,o=e.target;if(this.overlayContainerStopEvent_.contains(o)||!(i===r?r.documentElement:i).contains(o))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t))for(var s=this.getInteractions().getArray().slice(),a=s.length-1;a>=0;a--){var l=s[a];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 n=this.maxTilesLoading_,r=n;if(t){var i=t.viewHints;if(i[Ws]||i[Ys]){var o=Date.now()-t.time>8;n=o?0:8,r=o?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,r))}!t||!this.hasListener(jr)||t.animate||this.tileQueue_.getTilesLoading()||this.getLoading()||this.renderer_.dispatchRenderEvent(jr,t);for(var s=this.postRenderFunctions_,a=0,l=s.length;a<l;++a)s[a](this,t);s.length=0},e.prototype.handleSizeChanged_=function(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.mapBrowserEventHandler_){for(var e=0,n=this.keyHandlerKeys_.length;e<n;++e)B(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null,this.viewport_.removeEventListener(R,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(G,this.boundHandleBrowserEvent_),void 0!==this.handleResize_&&(removeEventListener(k,this.handleResize_,!1),this.handleResize_=void 0),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,di(this.viewport_)}if(t){for(var r in t.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Il(this,this.moveTolerance_),Rl)this.mapBrowserEventHandler_.addEventListener(Rl[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(R,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(G,this.boundHandleBrowserEvent_,!!It&&{passive:!1});var i=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[N(i,L,this.handleBrowserEvent,this),N(i,A,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(k,this.handleResize_,!1))}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_&&(B(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(B(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(B),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[N(t,l,this.render,this),N(t,T,this.render,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,n=t.length;e<n;++e){var r=t[e].layer;r.hasRenderer()&&r.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.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,n=this.getSize(),r=this.getView(),i=this.frameState_,o=null;if(void 0!==n&&Qr(n)&&r&&r.isDef()){var s=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();if(o={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:we(a.center,a.resolution,a.rotation,n),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:n,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:s,wantedTiles:{}},a.nextCenter&&a.nextResolution){var l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;o.nextExtent=we(a.nextCenter,a.nextResolution,l,n)}}if(this.frameState_=o,this.renderer_.renderFrame(o),o){if(o.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,o.postRenderFunctions),i)(!this.previousExtent_||!Pe(this.previousExtent_)&&!he(o.extent,this.previousExtent_))&&(this.dispatchEvent(new El(Ll,this,i)),this.previousExtent_=ae(this.previousExtent_));this.previousExtent_&&!o.viewHints[Ws]&&!o.viewHints[Ys]&&!he(o.extent,this.previousExtent_)&&(this.dispatchEvent(new El(Al,this,o)),$t(o.extent,this.previousExtent_))}this.dispatchEvent(new El(Ml,this,o)),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){this.set(Dl,t)},e.prototype.setSize=function(t){this.set(kl,t)},e.prototype.setTarget=function(t){this.set(jl,t)},e.prototype.setView=function(t){if(!t||t instanceof ou)this.set(Gl,t);else{this.set(Gl,new ou);var e=this;t.then((function(t){e.setView(new ou(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var n=getComputedStyle(t),r=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),i=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);isNaN(r)||isNaN(i)||!Qr(e=[r,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,n=getComputedStyle(this.viewport_);n.width&&n.height&&(e=[parseInt(n.width,10),parseInt(n.height,10)]),t.setViewportSize(e)}},e}(q);var lu=au,uu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),hu=function(t){function e(e){var n=t.call(this)||this,r=e.element;return!r||e.target||r.style.pointerEvents||(r.style.pointerEvents="auto"),n.element=r||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return uu(e,t),e.prototype.disposeInternal=function(){di(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&di(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)B(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,Ml,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),cu=Object.freeze({__proto__:null,default:hu}),pu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),fu=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).ulElement_=document.createElement("ul"),n.collapsed_=void 0===r.collapsed||r.collapsed,n.userCollapsed_=n.collapsed_,n.overrideCollapsible_=void 0!==r.collapsible,n.collapsible_=void 0===r.collapsible||r.collapsible,n.collapsible_||(n.collapsed_=!1);var i=void 0!==r.className?r.className:"ol-attribution",o=void 0!==r.tipLabel?r.tipLabel:"Attributions",s=void 0!==r.expandClassName?r.expandClassName:i+"-expand",a=void 0!==r.collapseLabel?r.collapseLabel:"",l=void 0!==r.collapseClassName?r.collapseClassName:i+"-collpase";"string"==typeof a?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=a,n.collapseLabel_.className=l):n.collapseLabel_=a;var u=void 0!==r.label?r.label:"i";"string"==typeof u?(n.label_=document.createElement("span"),n.label_.textContent=u,n.label_.className=s):n.label_=u;var h=n.collapsible_&&!n.collapsed_?n.collapseLabel_:n.label_;n.toggleButton_=document.createElement("button"),n.toggleButton_.setAttribute("type","button"),n.toggleButton_.setAttribute("aria-expanded",String(!n.collapsed_)),n.toggleButton_.title=o,n.toggleButton_.appendChild(h),n.toggleButton_.addEventListener(P,n.handleClick_.bind(n),!1);var c=i+" "+"ol-unselectable "+yi+(n.collapsed_&&n.collapsible_?" ol-collapsed":"")+(n.collapsible_?"":" ol-uncollapsible"),p=n.element;return p.className=c,p.appendChild(n.toggleButton_),p.appendChild(n.ulElement_),n.renderedAttributions_=[],n.renderedVisible_=!0,n}return pu(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],r=!0,i=t.layerStatesArray,o=0,s=i.length;o<s;++o){var a=i[o];if(Co(a,t.viewState)){var l=a.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(r=r&&!1!==l.getAttributionsCollapsible(),Array.isArray(h))for(var c=0,p=h.length;c<p;++c)h[c]in e||(n.push(h[c]),e[h[c]]=!0);else h in e||(n.push(h),e[h]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(r),n},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!g(e,this.renderedAttributions_)){!function(t){for(;t.lastChild;)t.removeChild(t.lastChild)}(this.ulElement_);for(var r=0,i=e.length;r<i;++r){var o=document.createElement("li");o.innerHTML=e[r],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(vi),this.collapsed_?fi(this.collapseLabel_,this.label_):fi(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}(hu),du=fu,gu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_u=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this;var i=void 0!==r.className?r.className:"ol-rotate",o=void 0!==r.label?r.label:"⇧",s=void 0!==r.compassClassName?r.compassClassName:"ol-compass";n.label_=null,"string"==typeof o?(n.label_=document.createElement("span"),n.label_.className=s,n.label_.textContent=o):(n.label_=o,n.label_.classList.add(s));var a=r.tipLabel?r.tipLabel:"Reset rotation",l=document.createElement("button");l.className=i+"-reset",l.setAttribute("type","button"),l.title=a,l.appendChild(n.label_),l.addEventListener(P,n.handleClick_.bind(n),!1);var u=i+" "+"ol-unselectable "+yi,h=n.element;return h.className=u,h.appendChild(l),n.callResetNorth_=r.resetNorth?r.resetNorth:void 0,n.duration_=void 0!==r.duration?r.duration:250,n.autoHide_=void 0===r.autoHide||r.autoHide,n.rotation_=void 0,n.autoHide_&&n.element.classList.add(gi),n}return gu(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:rl}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var r="rotate("+n+"rad)";if(this.autoHide_){var i=this.element.classList.contains(gi);i||0!==n?i&&0!==n&&this.element.classList.remove(gi):this.element.classList.add(gi)}this.label_.style.transform=r}this.rotation_=n}},e}(hu),yu=_u,vu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),mu=function(t){function e(e){var n=this,r=e||{};n=t.call(this,{element:document.createElement("div"),target:r.target})||this;var i=void 0!==r.className?r.className:"ol-zoom",o=void 0!==r.delta?r.delta:1,s=void 0!==r.zoomInClassName?r.zoomInClassName:i+"-in",a=void 0!==r.zoomOutClassName?r.zoomOutClassName:i+"-out",l=void 0!==r.zoomInLabel?r.zoomInLabel:"+",u=void 0!==r.zoomOutLabel?r.zoomOutLabel:"",h=void 0!==r.zoomInTipLabel?r.zoomInTipLabel:"Zoom in",c=void 0!==r.zoomOutTipLabel?r.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=h,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(P,n.handleClick_.bind(n,o),!1);var f=document.createElement("button");f.className=a,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof u?document.createTextNode(u):u),f.addEventListener(P,n.handleClick_.bind(n,-o),!1);var d=i+" "+"ol-unselectable "+yi,g=n.element;return g.className=d,g.appendChild(p),g.appendChild(f),n.duration_=void 0!==r.duration?r.duration:250,n}return vu(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 n=e.getZoom();if(void 0!==n){var r=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:r,duration:this.duration_,easing:rl})):e.setZoom(r)}}},e}(hu),xu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wu="units",Su="degrees",Cu="imperial",Eu="nautical",Tu="metric",bu="us",Ru=[1,2,5],Pu=25.4/.28,Ou=function(t){function e(e){var n=this,r=e||{},i=void 0!==r.className?r.className:r.bar?"ol-scale-bar":"ol-scale-line";return(n=t.call(this,{element:document.createElement("div"),render:r.render,target:r.target})||this).on,n.once,n.un,n.innerElement_=document.createElement("div"),n.innerElement_.className=i+"-inner",n.element.className=i+" "+_i,n.element.appendChild(n.innerElement_),n.viewState_=null,n.minWidth_=void 0!==r.minWidth?r.minWidth:64,n.renderedVisible_=!1,n.renderedWidth_=void 0,n.renderedHTML_="",n.addChangeListener(wu,n.handleUnitsChanged_),n.setUnits(r.units||Tu),n.scaleBar_=r.bar||!1,n.scaleBarSteps_=r.steps||4,n.scaleBarText_=r.text||!1,n.dpi_=r.dpi||void 0,n}return xu(e,t),e.prototype.getUnits=function(){return this.get(wu)},e.prototype.handleUnitsChanged_=function(){this.updateElement_()},e.prototype.setUnits=function(t){this.set(wu,t)},e.prototype.setDpi=function(t){this.dpi_=t},e.prototype.updateElement_=function(){var t=this.viewState_;if(t){var e=t.center,n=t.projection,r=this.getUnits(),i=r==Su?St.DEGREES:St.METERS,o=Sn(n,t.resolution,e,i),s=this.minWidth_*(this.dpi_||Pu)/Pu,a=s*o,l="";if(r==Su){var u=wt[St.DEGREES];(a*=u)<u/60?(l="″",o*=3600):a<u?(l="",o*=60):l="°"}else r==Cu?a<.9144?(l="in",o/=.0254):a<1609.344?(l="ft",o/=.3048):(l="mi",o/=1609.344):r==Eu?(o/=1852,l="nm"):r==Tu?a<.001?(l="μm",o*=1e6):a<1?(l="mm",o*=1e3):a<1e3?l="m":(l="km",o/=1e3):r==bu?a<.9144?(l="in",o*=39.37):a<1609.344?(l="ft",o/=.30480061):(l="mi",o/=1609.3472):rt(!1,33);for(var h,c,p,f,d=3*Math.floor(Math.log(s*o)/Math.log(10));;){p=Math.floor(d/3);var g=Math.pow(10,p);if(h=Ru[(d%3+3)%3]*g,c=Math.round(h/o),isNaN(c))return this.element.style.display="none",void(this.renderedVisible_=!1);if(c>=s)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,n){for(var r="1 : "+Math.round(this.getScaleForResolution()).toLocaleString(),i=[],o=t/this.scaleBarSteps_,s="#ffffff",a=0;a<this.scaleBarSteps_;a++)0===a&&i.push(this.createMarker("absolute",a)),i.push('<div><div class="ol-scale-singlebar" style="width: '+o+"px;background-color: "+s+';"></div>'+this.createMarker("relative",a)+(a%2==0||2===this.scaleBarSteps_?this.createStepText(a,t,!1,e,n):"")+"</div>"),a===this.scaleBarSteps_-1&&i.push(this.createStepText(a+1,t,!0,e,n)),s="#ffffff"===s?"#000000":"#ffffff";return'<div style="display: flex;">'+(this.scaleBarText_?'<div class="ol-scale-text" style="width: '+t+'px;">'+r+"</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,n,r,i){var o=(0===t?0:Math.round(r/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: "+(n?e+"px":"unset")+';">'+o+"</div>"},e.prototype.getScaleForResolution=function(){var t=Sn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center),e=this.dpi_||Pu,n=this.viewState_.projection.getMetersPerUnit();return parseFloat(t.toString())*n*(1e3/25.4)*e},e.prototype.render=function(t){var e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()},e}(hu),Fu=Ou;var Iu="active",Mu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Lu(t,e,n,r){var i=t.getZoom();if(void 0!==i){var o=t.getConstrainedZoom(i+e),s=t.getResolutionForZoom(o);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:void 0!==r?r:250,easing:rl})}}var Au=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,e&&e.handleEvent&&(n.handleEvent=e.handleEvent),n.map_=null,n.setActive(!0),n}return Mu(e,t),e.prototype.getActive=function(){return this.get(Iu)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Iu,t)},e.prototype.setMap=function(t){this.map_=t},e}(q),Du=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ku=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:250,n}return Du(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Rl.DBLCLICK){var n=t.originalEvent,r=t.map,i=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_;Lu(r.getView(),o,i,this.duration_),n.preventDefault(),e=!0}return!e},e}(Au),ju=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Gu(t){for(var e=t.length,n=0,r=0,i=0;i<e;i++)n+=t[i].clientX,r+=t[i].clientY;return[n/e,r/e]}var Nu=function(t){function e(e){var n=this,r=e||{};return n=t.call(this,r)||this,r.handleDownEvent&&(n.handleDownEvent=r.handleDownEvent),r.handleDragEvent&&(n.handleDragEvent=r.handleDragEvent),r.handleMoveEvent&&(n.handleMoveEvent=r.handleMoveEvent),r.handleUpEvent&&(n.handleUpEvent=r.handleUpEvent),r.stopDown&&(n.stopDown=r.stopDown),n.handlingDownUpSequence=!1,n.trackedPointers_={},n.targetPointers=[],n}return ju(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==Rl.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Rl.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==Rl.POINTERDOWN){var r=this.handleDownEvent(t);this.handlingDownUpSequence=r,e=this.stopDown(r)}else t.type==Rl.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===Rl.POINTERDOWN||e===Rl.POINTERDRAG||e===Rl.POINTERUP}(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==Rl.POINTERUP?delete this.trackedPointers_[n]:(t.type==Rl.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=e),this.targetPointers=w(this.trackedPointers_)}},e}(Au);function zu(t){var e=arguments;return function(t){for(var n=!0,r=0,i=e.length;r<i&&(n=n&&e[r](t));++r);return n}}var Bu=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Uu=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){return t.target.getTargetElement().contains(document.activeElement)}(t)},Vu=_,Xu=function(t){var e=t.originalEvent;return 0==e.button&&!(bt&&Rt&&e.ctrlKey)},Wu=y,Yu=function(t){return t.type==Rl.SINGLECLICK},Ku=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Zu=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Hu=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},qu=function(t){var e=t.originalEvent;return rt(void 0!==e,56),"mouse"==e.pointerType},Ju=function(t){var e=t.originalEvent;return rt(void 0!==e,56),e.isPrimary&&0===e.button},Qu=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),$u=function(t){function e(e){var n=t.call(this,{stopDown:y})||this,r=e||{};n.kinetic_=r.kinetic,n.lastCentroid=null,n.lastPointersCount_,n.panning_=!1;var i=r.condition?r.condition:zu(Ku,Ju);return n.condition_=r.onFocusOnly?zu(Uu,i):i,n.noKinetic_=!1,n}return Qu(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=Gu(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],i=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(r,i.getResolution()),fn(r,i.getRotation()),i.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()},e.prototype.handleUpEvent=function(t){var e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var r=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),o=n.getCenterInternal(),s=e.getPixelFromCoordinateInternal(o),a=e.getCoordinateFromPixelInternal([s[0]-r*Math.cos(i),s[1]-r*Math.sin(i)]);n.animateInternal({center:n.getConstrainedCenter(a),duration:500,easing:rl})}return this.panning_&&(this.panning_=!1,n.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}(Nu),th=$u,eh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),nh=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{stopDown:y})||this).condition_=r.condition?r.condition:Bu,n.lastAngle_=void 0,n.duration_=void 0!==r.duration?r.duration:250,n}return eh(e,t),e.prototype.handleDragEvent=function(t){if(qu(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==Ql){var r=e.getSize(),i=t.pixel,o=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(void 0!==this.lastAngle_){var s=o-this.lastAngle_;n.adjustRotationInternal(-s)}this.lastAngle_=o}}},e.prototype.handleUpEvent=function(t){return!qu(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!qu(t)&&(!(!Xu(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(Nu),rh=nh,ih=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),oh=function(t){function e(e){var n=t.call(this)||this;return n.geometry_=null,n.element_=document.createElement("div"),n.element_.style.position="absolute",n.element_.style.pointerEvents="auto",n.element_.className="ol-box "+e,n.map_=null,n.startPixel_=null,n.endPixel_=null,n}return ih(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",r=this.element_.style;r.left=Math.min(t[0],e[0])+n,r.top=Math.min(t[1],e[1])+n,r.width=Math.abs(e[0]-t[0])+n,r.height=Math.abs(e[1]-t[1])+n},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_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Fr([n])},e.prototype.getGeometry=function(){return this.geometry_},e}(u),sh=oh,ah=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),lh="boxstart",uh="boxdrag",hh="boxend",ch="boxcancel",ph=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.coordinate=n,i.mapBrowserEvent=r,i}return ah(e,t),e}(a),fh=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r=e||{};return n.box_=new sh(r.className||"ol-dragbox"),n.minArea_=void 0!==r.minArea?r.minArea:64,r.onBoxEnd&&(n.onBoxEnd=r.onBoxEnd),n.startPixel_=null,n.condition_=r.condition?r.condition:Xu,n.boxEndCondition_=r.boxEndCondition?r.boxEndCondition:n.defaultBoxEndCondition,n}return ah(e,t),e.prototype.defaultBoxEndCondition=function(t,e,n){var r=n[0]-e[0],i=n[1]-e[1];return r*r+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 ph(uh,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 ph(e?hh:ch,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 ph(lh,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(Nu),dh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),gh=function(t){function e(e){var n=this,r=e||{},i=r.condition?r.condition:Zu;return(n=t.call(this,{condition:i,className:r.className||"ol-dragzoom",minArea:r.minArea})||this).duration_=void 0!==r.duration?r.duration:200,n.out_=void 0!==r.out&&r.out,n}return dh(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var r=e.rotatedExtentForGeometry(n),i=e.getResolutionForExtentInternal(r),o=e.getResolution()/i;(n=n.clone()).scale(o*o)}e.fitInternal(n,{duration:this.duration_,easing:rl})},e}(fh),_h=37,yh=38,vh=39,mh=40,xh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),wh=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.defaultCondition_=function(t){return Ku(t)&&Hu(t)},n.condition_=void 0!==r.condition?r.condition:n.defaultCondition_,n.duration_=void 0!==r.duration?r.duration:100,n.pixelDelta_=void 0!==r.pixelDelta?r.pixelDelta:128,n}return xh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==L){var n=t.originalEvent,r=n.keyCode;if(this.condition_(t)&&(r==mh||r==_h||r==vh||r==yh)){var i=t.map.getView(),o=i.getResolution()*this.pixelDelta_,s=0,a=0;r==mh?a=-o:r==_h?s=-o:r==vh?s=o:a=o;var l=[s,a];fn(l,i.getRotation()),function(t,e,n){var r=t.getCenterInternal();if(r){var i=[r[0]+e[0],r[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:ol,center:t.getConstrainedCenter(i)})}}(i,l,this.duration_),n.preventDefault(),e=!0}}return!e},e}(Au),Sh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ch=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.condition_=r.condition?r.condition:Hu,n.delta_=r.delta?r.delta:1,n.duration_=void 0!==r.duration?r.duration:100,n}return Sh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==L||t.type==A){var n=t.originalEvent,r=n.charCode;if(this.condition_(t)&&(r=="+".charCodeAt(0)||r=="-".charCodeAt(0))){var i=t.map,o=r=="+".charCodeAt(0)?this.delta_:-this.delta_;Lu(i.getView(),o,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(Au),Eh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Th="trackpad",bh="wheel",Rh=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,r)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==r.maxDelta?r.maxDelta:1,n.duration_=void 0!==r.duration?r.duration:250,n.timeout_=void 0!==r.timeout?r.timeout:80,n.useAnchor_=void 0===r.useAnchor||r.useAnchor,n.constrainResolution_=void 0!==r.constrainResolution&&r.constrainResolution;var i=r.condition?r.condition:Vu;return n.condition_=r.onFocusOnly?zu(Uu,i):i,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return Eh(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,n=t.map,r=t.originalEvent;if(r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==G&&(e=r.deltaY,Et&&r.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Pt),r.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?Th:bh);var o=n.getView();if(this.mode_===Th&&!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 s=Math.max(this.timeout_-(i-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),s),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();var n=-Ie(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Lu(e,n,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}(Au),Ph=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Oh=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=y),(n=t.call(this,i)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==r.threshold?r.threshold:.3,n.duration_=void 0!==r.duration?r.duration:250,n}return Ph(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.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 s=t.map,a=s.getView();if(a.getConstraints().rotation!==Ql){var l=s.getViewport().getBoundingClientRect(),u=Gu(this.targetPointers);u[0]-=l.left,u[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(u),this.rotating_&&(s.render(),a.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}(Nu),Fh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ih=function(t){function e(e){var n=this,r=e||{},i=r;return i.stopDown||(i.stopDown=y),(n=t.call(this,i)||this).anchor_=null,n.duration_=void 0!==r.duration?r.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return Fh(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,o=n.clientY-r.clientY,s=Math.sqrt(i*i+o*o);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var u=a.getViewport().getBoundingClientRect(),h=Gu(this.targetPointers);h[0]-=u.left,h[1]-=u.top,this.anchor_=a.getCoordinateFromPixelInternal(h),a.render(),l.adjustResolutionInternal(e,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!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}(Nu),Mh=Ih,Lh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ah="addfeatures",Dh=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.features=r,o.file=n,o.projection=i,o}return Lh(e,t),e}(a),kh=function(t){function e(e){var n=this,r=e||{};(n=t.call(this,{handleEvent:_})||this).on,n.once,n.un,n.readAsBuffer_=!1,n.formats_=[];for(var i=r.formatConstructors?r.formatConstructors:[],o=0,s=i.length;o<s;++o){var a=i[o];"function"==typeof a&&(a=new a),n.formats_.push(a),n.readAsBuffer_=n.readAsBuffer_||a.getType()===Ba}return n.projection_=r.projection?wn(r.projection):null,n.dropListenKeys_=null,n.source_=r.source||null,n.target=r.target?r.target:null,n}return Lh(e,t),e.prototype.handleResult_=function(t,e){var n,r=e.target.result,i=this.getMap(),o=this.projection_;o||(o=i.getView().getProjection());for(var s=this.formats_,a=0,l=s.length;a<l;++a){var u=s[a],h=r;this.readAsBuffer_&&u.getType()!==Ba&&(void 0===n&&(n=(new TextDecoder).decode(r)),h=n);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 Dh(Ah,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,M,this.handleDrop,this),N(e,F,this.handleStop,this),N(e,I,this.handleStop,this),N(e,M,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,n){try{return t.readFeatures(e,n)}catch(t){return null}},e.prototype.unregisterListeners_=function(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(B),this.dropListenKeys_=null)},e.prototype.handleDrop=function(t){for(var e=t.dataTransfer.files,n=0,r=e.length;n<r;++n){var i=e.item(n),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}(Au),jh=kh,Gh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nh=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,r)||this).condition_=r.condition?r.condition:Zu,n.lastAngle_=void 0,n.lastMagnitude_=void 0,n.lastScaleDelta_=0,n.duration_=void 0!==r.duration?r.duration:400,n}return Gh(e,t),e.prototype.handleDragEvent=function(t){if(qu(t)){var e=t.map,n=e.getSize(),r=t.pixel,i=r[0]-n[0]/2,o=n[1]/2-r[1],s=Math.atan2(o,i),a=Math.sqrt(i*i+o*o),l=e.getView();if(void 0!==this.lastAngle_){var u=this.lastAngle_-s;l.adjustRotationInternal(u)}this.lastAngle_=s,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/a),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/a),this.lastMagnitude_=a}},e.prototype.handleUpEvent=function(t){if(!qu(t))return!0;var e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),this.lastScaleDelta_=0,!1},e.prototype.handleDownEvent=function(t){return!!qu(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))},e}(Nu),zh=Nh,Bh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Uh=function(t){function e(e,n,r){var i=t.call(this)||this;if(void 0!==r&&void 0===n)i.setFlatCoordinates(r,e);else{var o=n||0;i.setCenterAndRadius(e,o,r)}return i}return Bh(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,n,r){var i=this.flatCoordinates,o=t-i[0],s=e-i[1],a=o*o+s*s;if(a<r){if(0===a)for(var l=0;l<this.stride;++l)n[l]=i[l];else{var u=this.getRadius()/Math.sqrt(a);n[0]=i[0]+u*o,n[1]=i[1]+u*s;for(l=2;l<this.stride;++l)n[l]=i[l]}return n.length=this.stride,a}return r},e.prototype.containsXY=function(t,e){var n=this.flatCoordinates,r=t-n[0],i=e-n[1];return r*r+i*i<=this.getRadiusSquared_()},e.prototype.getCenter=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.computeExtent=function(t){var e=this.flatCoordinates,n=e[this.stride]-e[0];return se(e[0]-n,e[1]-n,e[0]+n,e[1]+n,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,n=this.flatCoordinates[e]-this.flatCoordinates[0],r=t.slice();r[e]=r[0]+n;for(var i=1;i<e;++i)r[e+i]=t[i];this.setFlatCoordinates(this.layout,r),this.changed()},e.prototype.setCenterAndRadius=function(t,e,n){this.setLayout(n,t,0),this.flatCoordinates||(this.flatCoordinates=[]);var r=this.flatCoordinates,i=Qn(r,0,t,this.stride);r[i++]=r[0]+e;for(var o=1,s=this.stride;o<s;++o)r[i++]=r[o];r.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 n=this.getCenter(),r=this.getStride();this.setCenter(jn(n,0,n.length,r,t,e,n)),this.changed()},e.prototype.translate=function(t,e){var n=this.getCenter(),r=this.getStride();this.setCenter(Gn(n,0,n.length,r,t,e,n)),this.changed()},e}(Yn);Uh.prototype.transform;var Vh=Uh,Xh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wh=function(t){function e(e,n,r){var i=t.call(this)||this;if(i.ends_=[],i.maxDelta_=-1,i.maxDeltaRevision_=-1,Array.isArray(e[0]))i.setCoordinates(e,n);else if(void 0!==n&&r)i.setFlatCoordinates(n,e),i.ends_=r;else{for(var o=i.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout()),d(a,c.getFlatCoordinates()),l.push(a.length)}i.setFlatCoordinates(o,a),i.ends_=l}return i}return Xh(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,n,r){return r<te(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Hn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Jn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,r))},e.prototype.getCoordinateAtM=function(t,e,n){if(this.layout!=ut&&this.layout!=ht||0===this.flatCoordinates.length)return null;var r=void 0!==e&&e,i=void 0!==n&&n;return function(t,e,n,r,i,o,s){if(s)return zr(t,e,n[n.length-1],r,i,o);var a;if(i<t[r-1])return o?((a=t.slice(0,r))[r-1]=i,a):null;if(t[t.length-1]<i)return o?((a=t.slice(t.length-r))[r-1]=i,a):null;for(var l=0,u=n.length;l<u;++l){var h=n[l];if(e!=h){if(i<t[e+r-1])return null;if(i<=t[h-1])return zr(t,e,h,r,i,!1);e=h}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,r,i)},e.prototype.getCoordinates=function(){return sr(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 Xr(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_,n=this.layout,r=[],i=0,o=0,s=e.length;o<s;++o){var a=e[o],l=new Xr(t.slice(i,a),n);r.push(l),i=a}return r},e.prototype.getFlatMidpoints=function(){for(var t=[],e=this.flatCoordinates,n=0,r=this.ends_,i=this.stride,o=0,s=r.length;o<s;++o){var a=r[o];d(t,Nr(e,n,a,i,.5)),n=a}return t},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=function(t,e,n,r,i,o,s,a){for(var l=0,u=n.length;l<u;++l){var h=n[l];s=er(t,e,h,r,i,o,s),a.push(s),e=h}return s}(this.flatCoordinates,0,this.ends_,this.stride,t,n,0,r),new e(n,at,r)},e.prototype.getType=function(){return _t},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){if(Sr(t,e,n[o],r,i))return!0;e=n[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 n=tr(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(Yn),Yh=Wh,Kh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Zh=function(t){function e(e,n){var r=t.call(this)||this;return n&&!Array.isArray(e[0])?r.setFlatCoordinates(n,e):r.setCoordinates(e,n),r}return Kh(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,n,r){if(r<te(this.getExtent(),t,e))return r;for(var i=this.flatCoordinates,o=this.stride,s=0,a=i.length;s<a;s+=o){var l=De(t,e,i[s],i[s+1]);if(l<r){r=l;for(var u=0;u<o;++u)n[u]=i[s+u];n.length=o}}return r},e.prototype.getCoordinates=function(){return or(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 gr(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)},e.prototype.getPoints=function(){for(var t=this.flatCoordinates,e=this.layout,n=this.stride,r=[],i=0,o=t.length;i<o;i+=n){var s=new gr(t.slice(i,i+n),e);r.push(s)}return r},e.prototype.getType=function(){return gt},e.prototype.intersectsExtent=function(t){for(var e=this.flatCoordinates,n=this.stride,r=0,i=e.length;r<i;r+=n){if(re(t,e[r],e[r+1]))return!0}return!1},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=$n(this.flatCoordinates,0,t,this.stride),this.changed()},e}(Yn),Hh=Zh;function qh(t,e,n,r){for(var i=[],o=[1/0,1/0,-1/0,-1/0],s=0,a=n.length;s<a;++s){var l=n[s];o=ue(t,e,l[0],r),i.push((o[0]+o[2])/2,(o[1]+o[3])/2),e=l[l.length-1]}return i}var Jh=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qh=function(t){function e(e,n,r){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,!r&&!Array.isArray(e[0])){for(var o=i.getLayout(),s=e,a=[],l=[],u=0,h=s.length;u<h;++u){var c=s[u];0===u&&(o=c.getLayout());for(var p=a.length,f=c.getEnds(),g=0,_=f.length;g<_;++g)f[g]+=p;d(a,c.getFlatCoordinates()),l.push(f)}n=o,e=a,r=l}return void 0!==n&&r?(i.setFlatCoordinates(n,e),i.endss_=r):i.setCoordinates(e,n),i}return Jh(e,t),e.prototype.appendPolygon=function(t){var e;if(this.flatCoordinates){var n=this.flatCoordinates.length;d(this.flatCoordinates,t.getFlatCoordinates());for(var r=0,i=(e=t.getEnds().slice()).length;r<i;++r)e[r]+=n}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,n=new Array(t),r=0;r<t;++r)n[r]=this.endss_[r].slice();var i=new e(this.flatCoordinates.slice(),this.layout,n);return i.applyProperties(this),i},e.prototype.closestPointXY=function(t,e,n,r){return r<te(this.getExtent(),t,e)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];i=Hn(t,e,a,r,i),e=a[a.length-1]}return i}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,r,i,o,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,f=n.length;p<f;++p){var d=n[p];u=Jn(t,e,d,r,i,o,s,a,l,u,c),e=d[d.length-1]}return u}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,n,r))},e.prototype.containsXY=function(t,e){return function(t,e,n,r,i,o){if(0===n.length)return!1;for(var s=0,a=n.length;s<a;++s){var l=n[s];if(vr(t,e,l,r,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,n,r){for(var i=0,o=0,s=n.length;o<s;++o){var a=n[o];i+=ur(t,e,a,r),e=a[a.length-1]}return i}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Pr(e=this.getOrientedFlatCoordinates().slice(),0,this.endss_,this.stride,t):e=this.flatCoordinates,ar(e,0,this.endss_,this.stride)},e.prototype.getEndss=function(){return this.endss_},e.prototype.getFlatInteriorPoints=function(){if(this.flatInteriorPointsRevision_!=this.getRevision()){var t=qh(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=xr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_},e.prototype.getInteriorPoints=function(){return new Hh(this.getFlatInteriorPoints().slice(),ut)},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(!br(t,e,a,r,i))return!1;a.length&&(e=a[a.length-1])}return!0}(t,0,this.endss_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Pr(this.orientedFlatCoordinates_,0,this.endss_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],r=[];return n.length=function(t,e,n,r,i,o,s,a){for(var l=0,u=n.length;l<u;++l){var h=n[l],c=[];s=ir(t,e,h,r,i,o,s,c),a.push(c),e=h[h.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),n,0,r),new e(n,at,r)},e.prototype.getPolygon=function(t){if(t<0||this.endss_.length<=t)return null;var e;if(0===t)e=0;else{var n=this.endss_[t-1];e=n[n.length-1]}var r=this.endss_[t].slice(),i=r[r.length-1];if(0!==e)for(var o=0,s=r.length;o<s;++o)r[o]-=e;return new Fr(this.flatCoordinates.slice(e,i),this.layout,r)},e.prototype.getPolygons=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.endss_,r=[],i=0,o=0,s=n.length;o<s;++o){var a=n[o].slice(),l=a[a.length-1];if(0!==i)for(var u=0,h=a.length;u<h;++u)a[u]-=i;var c=new Fr(e.slice(i,l),t,a);r.push(c),i=l}return r},e.prototype.getType=function(){return yt},e.prototype.intersectsExtent=function(t){return function(t,e,n,r,i){for(var o=0,s=n.length;o<s;++o){var a=n[o];if(Cr(t,e,a,r,i))return!0;e=a[a.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 n=function(t,e,n,r,i){for(var o=i||[],s=0,a=0,l=n.length;a<l;++a){var u=tr(t,e,n[a],r,o[s]);o[s++]=u,e=u[u.length-1]}return o.length=s,o}(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{var r=n[n.length-1];this.flatCoordinates.length=0===r.length?0:r[r.length-1]}this.changed()},e}(Yn),$h=Qh,tc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ec="Point",nc="LineString",rc="Polygon",ic="Circle",oc="drawstart",sc="drawend",ac="drawabort",lc=function(t){function e(e,n){var r=t.call(this,e)||this;return r.feature=n,r}return tc(e,t),e}(a),uc=function(t){function e(e){var n=this,r=e;r.stopDown||(r.stopDown=y),(n=t.call(this,r)||this).on,n.once,n.un,n.shouldHandle_=!1,n.downPx_=null,n.downTimeout_,n.lastDragTime_,n.pointerType_,n.freehand_=!1,n.source_=e.source?e.source:null,n.features_=e.features?e.features:null,n.snapTolerance_=e.snapTolerance?e.snapTolerance:12,n.type_=e.type,n.mode_=function(t){switch(t){case ct:case gt:return ec;case pt:case _t:return nc;case dt:case yt:return rc;case mt:return ic;default:throw new Error("Invalid type: "+t)}}(n.type_),n.stopClick_=!!e.stopClick,n.minPoints_=e.minPoints?e.minPoints:n.mode_===rc?3:2,n.maxPoints_=n.mode_===ic?2:e.maxPoints?e.maxPoints:1/0,n.finishCondition_=e.finishCondition?e.finishCondition:_;var i,o=e.geometryFunction;if(!o){var s,a=n.mode_;if(a===ic)o=function(t,e,n){var r=e||new Vh([NaN,NaN]),i=Ln(t[0]),o=dn(i,Ln(t[t.length-1]));return r.setCenterAndRadius(i,Math.sqrt(o)),r};else a===ec?s=gr:a===nc?s=Xr:a===rc&&(s=Fr),o=function(t,e,n){return e?a===rc?t[0].length?e.setCoordinates([t[0].concat([t[0][0]])]):e.setCoordinates([]):e.setCoordinates(t):e=new s(t),e}}return n.geometryFunction_=o,n.dragVertexDelay_=void 0!==e.dragVertexDelay?e.dragVertexDelay:500,n.finishCoordinate_=null,n.sketchFeature_=null,n.sketchPoint_=null,n.sketchCoords_=null,n.sketchLine_=null,n.sketchLineCoords_=null,n.squaredClickTolerance_=e.clickTolerance?e.clickTolerance*e.clickTolerance:36,n.overlay_=new Pa({source:new qa({useSpatialIndex:!1,wrapX:!!e.wrapX&&e.wrapX}),style:e.style?e.style:(i=Qi(),function(t,e){return i[t.getGeometry().getType()]}),updateWhileInteracting:!0}),n.geometryName_=e.geometryName,n.condition_=e.condition?e.condition:Ku,n.freehandCondition_,e.freehand?n.freehandCondition_=Vu:n.freehandCondition_=e.freehandCondition?e.freehandCondition:Zu,n.addChangeListener(Iu,n.updateState_),n}return tc(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_!==ec&&this.freehandCondition_(e);var n=e.type===Rl.POINTERMOVE,r=!0;!this.freehand_&&this.lastDragTime_&&e.type===Rl.POINTERDRAG&&(Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=e.pixel,this.shouldHandle_=!this.freehand_,n=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0));return this.freehand_&&e.type===Rl.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(e.coordinate),r=!1):this.freehand_&&e.type===Rl.POINTERDOWN?r=!1:n&&this.getPointerCount()<2?(r=e.type===Rl.POINTERMOVE)&&this.freehand_?(this.handlePointerMove_(e),this.shouldHandle_&&e.originalEvent.preventDefault()):("mouse"===e.originalEvent.pointerType||e.type===Rl.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(e):e.type===Rl.DBLCLICK&&(r=!1),t.prototype.handleEvent.call(this,e)&&r},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 bl(Rl.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 n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&this.mode_!==ec||(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_,n=t.pixel,r=e[0]-n[0],i=e[1]-n[1],o=r*r+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 n=!1,r=[this.finishCoordinate_],i=this.mode_;if(i===ec)e=!0;else if(i===ic)e=2===this.sketchCoords_.length;else if(i===nc)n=this.sketchCoords_.length>this.minPoints_;else if(i===rc){var o=this.sketchCoords_;n=o[0].length>this.minPoints_,r=[o[0][0],o[0][o[0].length-2]]}if(n)for(var s=this.getMap(),a=0,l=r.length;a<l;a++){var u=r[a],h=s.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 st(new gr(t)),this.updateSketchFeatures_())},e.prototype.createOrUpdateCustomSketchLine_=function(t){this.sketchLine_||(this.sketchLine_=new st);var e=t.getLinearRing(0),n=this.sketchLine_.getGeometry();n?(n.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),n.changed()):(n=new Xr(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(n))},e.prototype.startDrawing_=function(t){var e=this.getMap().getView().getProjection();this.finishCoordinate_=t,this.mode_===ec?this.sketchCoords_=t.slice():this.mode_===rc?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new st(new Xr(this.sketchLineCoords_)));var n=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new st,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new lc(oc,this.sketchFeature_))},e.prototype.modifyDrawing_=function(t){var e,n,r=this.getMap(),i=this.sketchFeature_.getGeometry(),o=r.getView().getProjection();(this.mode_===ec?n=this.sketchCoords_:this.mode_===rc?(n=(e=this.sketchCoords_[0])[e.length-1],this.atFinish_(r.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):n=(e=this.sketchCoords_)[e.length-1],n[0]=t[0],n[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,o),this.sketchPoint_)&&this.sketchPoint_.getGeometry().setCoordinates(t);if(i.getType()===dt&&this.mode_!==rc)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()},e.prototype.addToDrawing_=function(t){var e,n,r=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),o=this.mode_;o===nc||o===ic?(this.finishCoordinate_=t.slice(),(n=this.sketchCoords_).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),this.geometryFunction_(n,r,i)):o===rc&&((n=this.sketchCoords_[0]).length>=this.maxPoints_&&(this.freehand_?n.pop():e=!0),n.push(t.slice()),e&&(this.finishCoordinate_=n[0]),this.geometryFunction_(this.sketchCoords_,r,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),e&&this.finishDrawing()},e.prototype.removeLastPoint=function(){if(this.sketchFeature_){var t,e=this.sketchFeature_.getGeometry(),n=this.getMap().getView().getProjection(),r=this.mode_;if(r===nc||r===ic){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,n),e.getType()===dt&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if(r===rc){(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,n)}1===t.length&&this.abortDrawing(),this.updateSketchFeatures_()}},e.prototype.finishDrawing=function(){var t=this.abortDrawing_();if(t){var e=this.sketchCoords_,n=t.getGeometry(),r=this.getMap().getView().getProjection();this.mode_===nc?(e.pop(),this.geometryFunction_(e,n,r)):this.mode_===rc&&(e[0].pop(),this.geometryFunction_(e,n,r),e=n.getCoordinates()),this.type_===gt?t.setGeometry(new Hh([e])):this.type_===_t?t.setGeometry(new Yh([e])):this.type_===yt&&t.setGeometry(new $h([e])),this.dispatchEvent(new lc(sc,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 lc(ac,t))},e.prototype.appendCoordinates=function(t){var e,n=this.mode_,r=!this.sketchFeature_;if(r&&this.startDrawing_(t[0]),n===nc||n===ic)e=this.sketchCoords_;else{if(n!==rc)return;e=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}r&&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 n=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=n.slice(),this.sketchCoords_.push(n.slice()),this.sketchPoint_=new st(new gr(n)),this.updateSketchFeatures_(),this.dispatchEvent(new lc(oc,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}(Nu);var hc=uc,cc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pc="extentchanged",fc=function(t){function e(e){var n=t.call(this,pc)||this;return n.extent=e,n}return cc(e,t),e}(a);function dc(){var t=Qi();return function(e,n){return t[dt]}}function gc(){var t=Qi();return function(e,n){return t[ct]}}function _c(t){return function(e){return Jt([t,e])}}function yc(t,e){return t[0]==e[0]?function(n){return Jt([t,[n[0],e[1]]])}:t[1]==e[1]?function(n){return Jt([t,[e[0],n[1]]])}:null}var vc=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,r)||this).on,n.once,n.un,n.condition_=r.condition?r.condition:Vu,n.extent_=null,n.pointerHandler_=null,n.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,n.snappedToVertex_=!1,n.extentFeature_=null,n.vertexFeature_=null,e||(e={}),n.extentOverlay_=new Pa({source:new qa({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.boxStyle?e.boxStyle:dc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),n.vertexOverlay_=new Pa({source:new qa({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.pointerStyle?e.pointerStyle:gc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),e.extent&&n.setExtent(e.extent),n}return cc(e,t),e.prototype.snapToVertex_=function(t,e){var n=e.getCoordinateFromPixelInternal(t),r=this.getExtentInternal();if(r){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]]]]}(r);i.sort((function(t,e){return _n(n,t)-_n(n,e)}));var o=i[0],s=cn(n,o),a=e.getPixelFromCoordinateInternal(s);if(gn(t,a)<=this.pixelTolerance_){var l=e.getPixelFromCoordinateInternal(o[0]),u=e.getPixelFromCoordinateInternal(o[1]),h=dn(a,l),c=dn(a,u),p=Math.sqrt(Math.min(h,c));return this.snappedToVertex_=p<=this.pixelTolerance_,this.snappedToVertex_&&(s=h>c?o[1]:o[0]),s}}return null},e.prototype.handlePointerMove_=function(t){var e=t.pixel,n=t.map,r=this.snapToVertex_(e,n);r||(r=n.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(r)},e.prototype.createOrUpdateExtentFeature_=function(t){var e=this.extentFeature_;return e?t?e.setGeometry(Ir(t)):e.setGeometry(void 0):(e=new st(t?Ir(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 st(new gr(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e));return e},e.prototype.handleEvent=function(e){return!e.originalEvent||!this.condition_(e)||(e.type!=Rl.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),t.prototype.handleEvent.call(this,e),!1)},e.prototype.handleDownEvent=function(t){var e=t.pixel,n=t.map,r=this.getExtentInternal(),i=this.snapToVertex_(e,n),o=function(t){var e=null,n=null;return t[0]==r[0]?e=r[2]:t[0]==r[2]&&(e=r[0]),t[1]==r[1]?n=r[3]:t[1]==r[3]&&(n=r[1]),null!==e&&null!==n?[e,n]:null};if(i&&r){var s=i[0]==r[0]||i[0]==r[2]?i[0]:null,a=i[1]==r[1]||i[1]==r[3]?i[1]:null;null!==s&&null!==a?this.pointerHandler_=_c(o(i)):null!==s?this.pointerHandler_=yc(o([s,r[1]]),o([s,r[3]])):null!==a&&(this.pointerHandler_=yc(o([r[0],a]),o([r[2],a])))}else i=n.getCoordinateFromPixelInternal(e),this.setExtent([i[0],i[1],i[0],i[1]]),this.pointerHandler_=_c(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 An(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 fc(this.extent_))},e}(Nu),mc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),xc=[0,0,0,0],wc=[],Sc="modifystart",Cc="modifyend",Ec=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.features=n,i.mapBrowserEvent=r,i}return mc(e,t),e}(a),Tc=function(t){function e(e){var n,r=t.call(this,e)||this;if(r.on,r.once,r.un,r.boundHandleFeatureChange_=r.handleFeatureChange_.bind(r),r.condition_=e.condition?e.condition:Ju,r.defaultDeleteCondition_=function(t){return function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey}(t)&&Yu(t)},r.deleteCondition_=e.deleteCondition?e.deleteCondition:r.defaultDeleteCondition_,r.insertVertexCondition_=e.insertVertexCondition?e.insertVertexCondition:Vu,r.vertexFeature_=null,r.vertexSegments_=null,r.lastPixel_=[0,0],r.ignoreNextSingleClick_=!1,r.featuresBeingModified_=null,r.rBush_=new Oa,r.pixelTolerance_=void 0!==e.pixelTolerance?e.pixelTolerance:10,r.snappedToVertex_=!1,r.changingFeature_=!1,r.dragSegments_=[],r.overlay_=new Pa({source:new qa({useSpatialIndex:!1,wrapX:!!e.wrapX}),style:e.style?e.style:Oc(),updateWhileAnimating:!0,updateWhileInteracting:!0}),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),Circle:r.writeCircleGeometry_.bind(r),GeometryCollection:r.writeGeometryCollectionGeometry_.bind(r)},r.source_=null,r.hitDetection_=null,e.features?n=e.features:e.source&&(r.source_=e.source,n=new nt(r.source_.getFeatures()),r.source_.addEventListener(La,r.handleSourceAdd_.bind(r)),r.source_.addEventListener(ka,r.handleSourceRemove_.bind(r))),!n)throw new Error("The modify interaction requires features, a source or a layer");return e.hitDetection&&(r.hitDetection_=e.hitDetection),r.features_=n,r.features_.forEach(r.addFeature_.bind(r)),r.features_.addEventListener(J,r.handleFeatureAdd_.bind(r)),r.features_.addEventListener(Q,r.handleFeatureRemove_.bind(r)),r.lastPointerEvent_=null,r.delta_=[0,0],r.snapToPointer_=void 0===e.snapToPointer?!r.hitDetection_:e.snapToPointer,r}return mc(e,t),e.prototype.addFeature_=function(t){var e=t.getGeometry();if(e){var n=this.SEGMENT_WRITERS_[e.getType()];n&&n(t,e)}var r=this.getMap();r&&r.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,r),t.addEventListener(T,this.boundHandleFeatureChange_)},e.prototype.willModifyFeatures_=function(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new nt;for(var n=this.featuresBeingModified_.getArray(),r=0,i=e.length;r<i;++r)for(var o=e[r],s=0,a=o.length;s<a;++s){var l=o[s].feature;l&&-1===n.indexOf(l)&&this.featuresBeingModified_.push(l)}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new Ec(Sc,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_,n=[];e.forEach((function(e){t===e.feature&&n.push(e)}));for(var r=n.length-1;r>=0;--r){for(var i=n[r],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 n=e.getCoordinates(),r={feature:t,geometry:e,segment:[n,n]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r){var o=n[r],s={feature:t,geometry:e,depth:[r],index:r,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),s={feature:t,geometry:e,index:r,segment:o};this.rBush_.insert(Jt(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[r],index:s,segment:l};this.rBush_.insert(Jt(l),u)}},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,geometry:e,depth:[r],index:s,segment:l};this.rBush_.insert(Jt(l),u)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var l=o[s],u=0,h=l.length-1;u<h;++u){var c=l.slice(u,u+2),p={feature:t,geometry:e,depth:[s,r],index:u,segment:c};this.rBush_.insert(Jt(c),p)}},e.prototype.writeCircleGeometry_=function(t,e){var n=e.getCenter(),r={feature:t,geometry:e,index:0,segment:[n,n]},i={feature:t,geometry:e,index:1,segment:[n,n]},o=[r,i];r.featureSegments=o,i.featureSegments=o,this.rBush_.insert(le(n),r);var s=e;this.rBush_.insert(s.getExtent(),i)},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=n[r];(0,this.SEGMENT_WRITERS_[i.getType()])(t,i)}},e.prototype.createOrUpdateVertexFeature_=function(t,e,n){var r=this.vertexFeature_;r?r.getGeometry().setCoordinates(t):(r=new st(new gr(t)),this.vertexFeature_=r,this.overlay_.getSource().addFeature(r));return r.set("features",e),r.set("geometries",n),r},e.prototype.handleEvent=function(e){return!e.originalEvent||(this.lastPointerEvent_=e,e.map.getView().getInteracting()||e.type!=Rl.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(e),this.vertexFeature_&&this.deleteCondition_(e)&&(n=!(e.type!=Rl.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),e.type==Rl.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),t.prototype.handleEvent.call(this,e)&&!n);var n},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]],n=[],r=[],i=0,o=this.dragSegments_.length;i<o;++i){var s=this.dragSegments_[i],a=s[0],l=a.feature;-1===n.indexOf(l)&&n.push(l);var u=a.geometry;-1===r.indexOf(u)&&r.push(u);for(var h=a.depth,c=void 0,p=a.segment,f=s[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())[a.index]=e,p[0]=e,p[1]=e;break;case pt:(c=u.getCoordinates())[a.index+f]=e,p[f]=e;break;case _t:case dt:(c=u.getCoordinates())[h[0]][a.index+f]=e,p[f]=e;break;case yt:(c=u.getCoordinates())[h[1]][h[0]][a.index+f]=e,p[f]=e;break;case mt:if(p[0]=e,p[1]=e,0===a.index)this.changingFeature_=!0,u.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;t.map.getView().getProjection();var d=gn(Ln(u.getCenter()),Ln(e));u.setRadius(d),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(u,c)}this.createOrUpdateVertexFeature_(e,n,r)},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 n=this.vertexFeature_;if(n){var i=t.map.getView().getProjection(),o=[],s=n.getGeometry().getCoordinates(),a=Jt([s]),l=this.rBush_.getInExtent(a),u={};l.sort(bc);for(var h=0,c=l.length;h<c;++h){var p=l[h],f=p.segment,d=r(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(!pn(f[0],s)||u[d][0])if(!pn(f[1],s)||u[d][1])r(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 pn(Pc(e,p,i),s)&&!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[_],s)}return!!this.vertexFeature_},e.prototype.handleUpEvent=function(t){for(var e=this.dragSegments_.length-1;e>=0;--e){var n=this.dragSegments_[e][0],r=n.geometry;if(r.getType()===mt){var i=r.getCenter(),o=n.featureSegments[0],s=n.featureSegments[1];o.segment[0]=i,o.segment[1]=i,s.segment[0]=i,s.segment[1]=i,this.rBush_.update(le(i),o);var a=r;this.rBush_.update(a.getExtent(),s)}else this.rBush_.update(Jt(n.segment),n)}return this.featuresBeingModified_&&(this.dispatchEvent(new Ec(Cc,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,n){var i,o,s=this,a=n||e.getCoordinateFromPixel(t),l=e.getView().getProjection();if(this.hitDetection_){var u="object"==typeof this.hitDetection_?function(t){return t===s.hitDetection_}:void 0;e.forEachFeatureAtPixel(t,(function(t,e,n){if((n=n||t.getGeometry()).getType()===ct&&c(s.features_.getArray(),t)){o=n;var r=n.getFlatCoordinates().slice(0,2);i=[{feature:t,geometry:n,segment:[r,r]}]}return!0}),{layerFilter:u})}if(!i){var h=An(Qt(Dn(le(a,xc)),e.getView().getResolution()*this.pixelTolerance_,xc));i=this.rBush_.getInExtent(h)}if(i&&i.length>0){var p=i.sort((function(t,e){return Rc(a,t,l)-Rc(a,e,l)}))[0],f=p.segment,d=Pc(a,p,l),g=e.getPixelFromCoordinate(d),_=gn(t,g);if(o||_<=this.pixelTolerance_){var y={};if(y[r(f)]=!0,this.snapToPointer_||(this.delta_[0]=d[0]-a[0],this.delta_[1]=d[1]-a[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=dn(g,v),w=dn(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[r(p.geometry)]=!0;for(var C=1,E=i.length;C<E;++C){var T=i[C].segment;if(!(pn(f[0],T[0])&&pn(f[1],T[1])||pn(f[0],T[1])&&pn(f[1],T[0])))break;var b=r(i[C].geometry);b in S||(S[b]=!0,y[r(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 n,r=t.segment,i=t.feature,o=t.geometry,s=t.depth,a=t.index;e.length<o.getStride();)e.push(0);switch(o.getType()){case _t:case dt:(n=o.getCoordinates())[s[0]].splice(a+1,0,e);break;case yt:(n=o.getCoordinates())[s[1]][s[0]].splice(a+1,0,e);break;case pt:(n=o.getCoordinates()).splice(a+1,0,e);break;default:return}this.setGeometryCoordinates_(o,n);var l=this.rBush_;l.remove(t),this.updateSegmentIndices_(o,a,s,1);var u={segment:[r[0],e],feature:i,geometry:o,depth:s,index:a};l.insert(Jt(u.segment),u),this.dragSegments_.push([u,1]);var h={segment:[e,r[1]],feature:i,geometry:o,depth:s,index:a+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!=Rl.POINTERDRAG){var t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);var e=this.removeVertex_();return this.dispatchEvent(new Ec(Cc,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1},e.prototype.removeVertex_=function(){var t,e,n,i,o,s,a,l,u,h,c,p=this.dragSegments_,f={},d=!1;for(o=p.length-1;o>=0;--o)c=r((h=(n=p[o])[0]).feature),h.depth&&(c+="-"+h.depth.join("-")),c in f||(f[c]={}),0===n[1]?(f[c].right=h,f[c].index=h.index):1==n[1]&&(f[c].left=h,f[c].index=h.index+1);for(c in f){switch(u=f[c].right,a=f[c].left,(l=(s=f[c].index)-1)<0&&(l=0),t=e=(i=(h=void 0!==a?a:u).geometry).getCoordinates(),d=!1,i.getType()){case _t:e[h.depth[0]].length>2&&(e[h.depth[0]].splice(s,1),d=!0);break;case pt:e.length>2&&(e.splice(s,1),d=!0);break;case yt:t=t[h.depth[1]];case dt:(t=t[h.depth[0]]).length>4&&(s==t.length-1&&(s=0),t.splice(s,1),d=!0,0===s&&(t.pop(),t.push(t[0]),l=t.length-1))}if(d){this.setGeometryCoordinates_(i,e);var g=[];if(void 0!==a&&(this.rBush_.remove(a),g.push(a.segment[0])),void 0!==u&&(this.rBush_.remove(u),g.push(u.segment[1])),void 0!==a&&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,s,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,n,r){this.rBush_.forEachInExtent(t.getExtent(),(function(i){i.geometry===t&&(void 0===n||void 0===i.depth||g(i.depth,n))&&i.index>e&&(i.index+=r)}))},e}(Nu);function bc(t,e){return t.index-e.index}function Rc(t,e,n){var r=e.geometry;if(r.getType()===mt){var i=r;if(1===e.index){null;var o=dn(i.getCenter(),Ln(t)),s=Math.sqrt(o)-i.getRadius();return s*s}}var a=Ln(t);return wc[0]=Ln(e.segment[0]),wc[1]=Ln(e.segment[1]),_n(a,wc)}function Pc(t,e,n){var r=e.geometry;if(r.getType()===mt&&1===e.index){var i=r;return Mn(i.getClosestPoint(Ln(t)))}var o=Ln(t);return wc[0]=Ln(e.segment[0]),wc[1]=Ln(e.segment[1]),Mn(cn(o,wc))}function Oc(){var t=Qi();return function(e,n){return t[ct]}}var Fc=Tc,Ic=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mc="select",Lc=function(t){function e(e,n,r,i){var o=t.call(this,e)||this;return o.selected=n,o.deselected=r,o.mapBrowserEvent=i,o}return Ic(e,t),e}(a),Ac={},Dc=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var r,i,o=e||{};if(n.boundAddFeature_=n.addFeature_.bind(n),n.boundRemoveFeature_=n.removeFeature_.bind(n),n.condition_=o.condition?o.condition:Yu,n.addCondition_=o.addCondition?o.addCondition:Wu,n.removeCondition_=o.removeCondition?o.removeCondition:Wu,n.toggleCondition_=o.toggleCondition?o.toggleCondition:Zu,n.multi_=!!o.multi&&o.multi,n.filter_=o.filter?o.filter:_,n.hitTolerance_=o.hitTolerance?o.hitTolerance:0,n.style_=void 0!==o.style?o.style:(d((r=Qi())[dt],r[pt]),d(r[vt],r[pt]),function(t){return t.getGeometry()?r[t.getGeometry().getType()]:null}),n.features_=o.features||new nt,o.layers)if("function"==typeof o.layers)i=o.layers;else{var s=o.layers;i=function(t){return c(s,t)}}else i=_;return n.layerFilter_=i,n.featureLayerAssociation_={},n}return Ic(e,t),e.prototype.addFeatureLayerAssociation_=function(t,e){this.featureLayerAssociation_[r(t)]=e},e.prototype.getFeatures=function(){return this.features_},e.prototype.getHitTolerance=function(){return this.hitTolerance_},e.prototype.getLayer=function(t){return this.featureLayerAssociation_[r(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;this.style_&&this.applySelectedStyle_(e)},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=r(t);e in Ac||(Ac[e]=t.getStyle()),t.setStyle(this.style_)},e.prototype.restorePreviousStyle_=function(t){for(var n=this.getMap().getInteractions().getArray(),i=n.length-1;i>=0;--i){var o=n[i];if(o!==this&&o instanceof e&&o.getStyle()&&-1!==o.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(o.getStyle())}var s=r(t);t.setStyle(Ac[s]),delete Ac[s]},e.prototype.removeFeatureLayerAssociation_=function(t){delete this.featureLayerAssociation_[r(t)]},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=this.addCondition_(t),n=this.removeCondition_(t),r=this.toggleCondition_(t),i=!e&&!n&&!r,o=t.map,s=this.getFeatures(),a=[],l=[];if(i){x(this.featureLayerAssociation_),o.forEachFeatureAtPixel(t.pixel,function(t,e){if(this.filter_(t,e))return l.push(t),this.addFeatureLayerAssociation_(t,e),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var u=s.getLength()-1;u>=0;--u){var h=s.item(u),p=l.indexOf(h);p>-1?l.splice(p,1):(s.remove(h),a.push(h))}0!==l.length&&s.extend(l)}else{o.forEachFeatureAtPixel(t.pixel,function(t,i){if(this.filter_(t,i))return!e&&!r||c(s.getArray(),t)?(n||r)&&c(s.getArray(),t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(l.push(t),this.addFeatureLayerAssociation_(t,i)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(var f=a.length-1;f>=0;--f)s.remove(a[f]);s.extend(l)}return(l.length>0||a.length>0)&&this.dispatchEvent(new Lc(Mc,l,a,t)),!0},e}(Au);var kc=Dc,jc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Gc(t){return t.feature?t.feature:t.element?t.element:void 0}var Nc=[],zc=function(t){function e(e){var n=this,r=e||{},i=r;return i.handleDownEvent||(i.handleDownEvent=_),i.stopDown||(i.stopDown=y),(n=t.call(this,i)||this).source_=r.source?r.source:null,n.vertex_=void 0===r.vertex||r.vertex,n.edge_=void 0===r.edge||r.edge,n.features_=r.features?r.features:null,n.featuresListenerKeys_=[],n.featureChangeListenerKeys_={},n.indexedFeaturesExtents_={},n.pendingFeatures_={},n.pixelTolerance_=void 0!==r.pixelTolerance?r.pixelTolerance:10,n.rBush_=new Oa,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),GeometryCollection:n.writeGeometryCollectionGeometry_.bind(n),Circle:n.writeCircleGeometry_.bind(n)},n}return jc(e,t),e.prototype.addFeature=function(t,e){var n=void 0===e||e,i=r(t),o=t.getGeometry();if(o){var s=this.SEGMENT_WRITERS_[o.getType()];s&&(this.indexedFeaturesExtents_[i]=o.getExtent([1/0,1/0,-1/0,-1/0]),s(t,o))}n&&(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 n=this.snapTo(e.pixel,e.coordinate,e.map);return n.snapped&&(e.coordinate=n.vertex.slice(0,2),e.pixel=n.vertexPixel),t.prototype.handleEvent.call(this,e)},e.prototype.handleFeatureAdd_=function(t){var e=Gc(t);this.addFeature(e)},e.prototype.handleFeatureRemove_=function(t){var e=Gc(t);this.removeFeature(e)},e.prototype.handleFeatureChange_=function(t){var e=t.target;if(this.handlingDownUpSequence){var n=r(e);n in this.pendingFeatures_||(this.pendingFeatures_[n]=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 n=void 0===e||e,i=r(t),o=this.indexedFeaturesExtents_[i];if(o){var s=this.rBush_,a=[];s.forEachInExtent(o,(function(e){t===e.feature&&a.push(e)}));for(var l=a.length-1;l>=0;--l)s.remove(a[l])}n&&(B(this.featureChangeListenerKeys_[i]),delete this.featureChangeListenerKeys_[i])},e.prototype.setMap=function(e){var n=this.getMap(),r=this.featuresListenerKeys_,i=this.getFeatures_();n&&(r.forEach(B),r.length=0,i.forEach(this.forEachFeatureRemove_.bind(this))),t.prototype.setMap.call(this,e),e&&(this.features_?r.push(N(this.features_,J,this.handleFeatureAdd_,this),N(this.features_,Q,this.handleFeatureRemove_,this)):this.source_&&r.push(N(this.source_,La,this.handleFeatureAdd_,this),N(this.source_,ka,this.handleFeatureRemove_,this)),i.forEach(this.forEachFeatureAdd_.bind(this)))},e.prototype.snapTo=function(t,e,n){var r=Jt([n.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),n.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),i=this.rBush_.getInExtent(r);this.vertex_&&!this.edge_&&(i=i.filter((function(t){return t.feature.getGeometry().getType()!==mt})));var o=!1,s=null,a=null;if(0===i.length)return{snapped:o,vertex:s,vertexPixel:a};n.getView().getProjection();for(var l,u=Ln(e),h=1/0,c=0;c<i.length;++c){var p=i[c];Nc[0]=Ln(p.segment[0]),Nc[1]=Ln(p.segment[1]);var f=_n(u,Nc);f<h&&(l=p,h=f)}var d=l.segment;if(this.vertex_&&!this.edge_){var g=n.getPixelFromCoordinate(d[0]),_=n.getPixelFromCoordinate(d[1]),y=dn(t,g),v=dn(t,_);Math.sqrt(Math.min(y,v))<=this.pixelTolerance_&&(o=!0,s=y>v?d[1]:d[0],a=n.getPixelFromCoordinate(s))}else if(this.edge_){var m=l.feature.getGeometry().getType()===mt;if(m){var x=l.feature.getGeometry();null,s=Mn(function(t,e){var n=e.getRadius(),r=e.getCenter(),i=r[0],o=r[1],s=t[0]-i,a=t[1]-o;0===s&&0===a&&(s=1);var l=Math.sqrt(s*s+a*a);return[i+n*s/l,o+n*a/l]}(u,x))}else Nc[0]=Ln(d[0]),Nc[1]=Ln(d[1]),s=Mn(cn(u,Nc));if(gn(t,a=n.getPixelFromCoordinate(s))<=this.pixelTolerance_&&(o=!0,this.vertex_&&!m)){g=n.getPixelFromCoordinate(d[0]),_=n.getPixelFromCoordinate(d[1]),y=dn(a,g),v=dn(a,_);Math.sqrt(Math.min(y,v))<=this.pixelTolerance_&&(s=y>v?d[1]:d[0],a=n.getPixelFromCoordinate(s))}}return o&&(a=[Math.round(a[0]),Math.round(a[1])]),{snapped:o,vertex:s,vertexPixel:a}},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 n=Mr(e).getCoordinates()[0],r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),s={feature:t,segment:o};this.rBush_.insert(Jt(o),s)}},e.prototype.writeGeometryCollectionGeometry_=function(t,e){for(var n=e.getGeometriesArray(),r=0;r<n.length;++r){var i=this.SEGMENT_WRITERS_[n[r].getType()];i&&i(t,n[r])}},e.prototype.writeLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length-1;r<i;++r){var o=n.slice(r,r+2),s={feature:t,segment:o};this.rBush_.insert(Jt(o),s)}},e.prototype.writeMultiLineStringGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Jt(l),u)}},e.prototype.writeMultiPointGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r){var o=n[r],s={feature:t,segment:[o,o]};this.rBush_.insert(e.getExtent(),s)}},e.prototype.writeMultiPolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length;s<a;++s)for(var l=o[s],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 n=e.getCoordinates(),r={feature:t,segment:[n,n]};this.rBush_.insert(e.getExtent(),r)},e.prototype.writePolygonGeometry_=function(t,e){for(var n=e.getCoordinates(),r=0,i=n.length;r<i;++r)for(var o=n[r],s=0,a=o.length-1;s<a;++s){var l=o.slice(s,s+2),u={feature:t,segment:l};this.rBush_.insert(Jt(l),u)}},e}(Nu),Bc=zc,Uc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vc="translatestart",Xc="translating",Wc="translateend",Yc=function(t){function e(e,n,r,i,o){var s=t.call(this,e)||this;return s.features=n,s.coordinate=r,s.startCoordinate=i,s.mapBrowserEvent=o,s}return Uc(e,t),e}(a),Kc=function(t){function e(e){var n,r=this,i=e||{};if((r=t.call(this,i)||this).on,r.once,r.un,r.lastCoordinate_=null,r.startCoordinate_=null,r.features_=void 0!==i.features?i.features:null,i.layers&&!r.features_)if("function"==typeof i.layers)n=i.layers;else{var o=i.layers;n=function(t){return c(o,t)}}else n=_;return r.layerFilter_=n,r.filter_=i.filter&&!r.features_?i.filter:_,r.hitTolerance_=i.hitTolerance?i.hitTolerance:0,r.condition_=i.condition?i.condition:Vu,r.lastFeature_=null,r.addChangeListener(Iu,r.handleActiveChanged_),r}return Uc(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 nt([this.lastFeature_]);return this.dispatchEvent(new Yc(Vc,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 nt([this.lastFeature_]);return this.dispatchEvent(new Yc(Wc,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1},e.prototype.handleDragEvent=function(t){if(this.lastCoordinate_){var e=t.coordinate,n=e[0]-this.lastCoordinate_[0],r=e[1]-this.lastCoordinate_[1],i=this.features_||new nt([this.lastFeature_]);i.forEach((function(t){var e=t.getGeometry();e.translate(n,r),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new Yc(Xc,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 n=this.getMap();t.prototype.setMap.call(this,e),this.updateState_(n)},e.prototype.handleActiveChanged_=function(){this.updateState_(null)},e.prototype.updateState_=function(t){var e=this.getMap(),n=this.getActive();e&&n||(e=e||t)&&e.getViewport().classList.remove("ol-grab","ol-grabbing")},e}(Nu),Zc=Kc;function Hc(t){var e=t||{},n=new nt,r=new cl(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new rh),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new ku({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new th({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new Oh),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new Mh({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new wh),n.push(new Ch({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new Rh({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new gh({duration:e.zoomDuration})),n}var qc=Object.freeze({__proto__:null,defaults:Hc,DoubleClickZoom:ku,DragAndDrop:jh,DragBox:fh,DragPan:th,DragRotate:rh,DragRotateAndZoom:zh,DragZoom:gh,Draw:hc,Extent:vc,Interaction:Au,KeyboardPan:wh,KeyboardZoom:Ch,Modify:Fc,MouseWheelZoom:Rh,PinchRotate:Oh,PinchZoom:Mh,Pointer:Nu,Select:kc,Snap:Bc,Translate:Zc}),Jc=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qc=function(t){function e(e){return(e=m({},e)).controls||(e.controls=function(t){var e=t||{},n=new nt;return(void 0===e.zoom||e.zoom)&&n.push(new mu(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new yu(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new du(e.attributionOptions)),n}()),e.interactions||(e.interactions=Hc({onFocusOnly:!0})),t.call(this,e)||this}return Jc(e,t),e.prototype.createRenderer=function(){return new vl(this)},e}(lu),$c=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 n=this.entries_[t];return rt(void 0!==n,15),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_},t.prototype.remove=function(t){var e=this.entries_[t];return rt(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_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},t.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=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){rt(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},t.prototype.setSize=function(t){this.highWaterMark=t},t}();function tp(t,e,n,r){return void 0!==r?(r[0]=t,r[1]=e,r[2]=n,r):[t,e,n]}function ep(t,e,n){return t+"/"+e+"/"+n}function np(t){return ep(t[0],t[1],t[2])}function rp(t){return t.split("/").map(Number)}function ip(t){return(t[1]<<t[0])+t[2]}var op=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),sp=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return op(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=rp(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(np(e.tileCoord)),e.release())}.bind(this))}},e}($c),ap=sp,lp=function(){function t(t,e,n,r){this.minX=t,this.maxX=e,this.minY=n,this.maxY=r}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 up(t,e,n,r,i){return void 0!==i?(i.minX=t,i.maxX=e,i.minY=n,i.maxY=r,i):new lp(t,e,n,r)}var hp=lp,cp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),pp=[],fp=function(t){function e(e,n,r,i){var o=t.call(this,e,n,{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=r,o}return cp(e,t),e.prototype.getContext=function(t){var e=r(t);return e in this.context_||(this.context_[e]=pi(1,1,pp)),this.context_[e]},e.prototype.hasContext=function(t){return r(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=r(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_)pp.push(this.context_[e].canvas),delete this.context_[e];t.prototype.release.call(this)},e}(ll),dp=fp,gp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_p=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e,n,s)||this;return a.extent=null,a.format_=i,a.features_=null,a.loader_,a.projection=null,a.resolution,a.tileLoadFunction_=o,a.url_=r,a.key=r,a}return gp(e,t),e.prototype.getFormat=function(){return this.format_},e.prototype.getFeatures=function(){return this.features_},e.prototype.load=function(){this.state==Ja&&(this.setState(Qa),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(tl)},e.prototype.setFeatures=function(t){this.features_=t,this.setState($a)},e.prototype.setLoader=function(t){this.loader_=t},e}(ll),yp=_p;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function vp(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(t).forEach((function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})})),e}var mp={exports:{}},xp=vp(cu),wp=vp(Y),Sp=vp(Sl);!function(t,e){t.exports=function(t,e,n){t="default"in t?t.default:t,n="default"in n?n.default:n;var r=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 n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}(),o=function t(e,n,r){null===e&&(e=Function.prototype);var i=Object.getOwnPropertyDescriptor(e,n);if(void 0===i){var o=Object.getPrototypeOf(e);return null===o?void 0:t(o,n,r)}if("value"in i)return i.value;var s=i.get;return void 0!==s?s.call(r):void 0},s=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)},a=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){r(this,u);var e=Object.assign({},t),n=e.tipLabel?e.tipLabel:"Legend",i=e.collapseTipLabel?e.collapseTipLabel:"Collapse legend",o=document.createElement("div"),s=a(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,{element:o,target:e.target}));s.activationMode=e.activationMode||"mouseover",s.startActive=!0===e.startActive;var h=void 0!==e.label?e.label:"",c=void 0!==e.collapseLabel?e.collapseLabel:"»";s.groupSelectStyle=u.getGroupSelectStyle(e.groupSelectStyle),s.reverse=!1!==e.reverse,s.mapListeners=[],s.hiddenClassName="ol-unselectable ol-control layer-switcher",u.isTouchDevice_()&&(s.hiddenClassName+=" touch"),s.shownClassName="shown",o.className=s.hiddenClassName;var p=document.createElement("button");return p.setAttribute("title",n),p.setAttribute("aria-label",n),o.appendChild(p),s.panel=document.createElement("div"),s.panel.className="panel",o.appendChild(s.panel),u.enableTouchScroll_(s.panel),p.textContent=h,o.classList.add(l+"group-select-style-"+s.groupSelectStyle),o.classList.add(l+"activation-mode-"+s.activationMode),"click"===s.activationMode?(o.classList.add("activationModeClick"),s.startActive&&(p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),p.onclick=function(t){var e=t||window.event;s.element.classList.contains(s.shownClassName)?(s.hidePanel(),p.textContent=h,p.setAttribute("title",n),p.setAttribute("aria-label",n)):(s.showPanel(),p.textContent=c,p.setAttribute("title",i),p.setAttribute("aria-label",i)),e.preventDefault()}):(p.onmouseover=function(){s.showPanel()},p.onclick=function(t){var e=t||window.event;s.showPanel(),e.preventDefault()},s.panel.onmouseout=function(t){s.panel.contains(t.relatedTarget)||s.hidePanel()}),s}return s(u,t),i(u,[{key:"setMap",value:function(t){for(var n=this,r=0;r<this.mapListeners.length;r++)e.unByKey(this.mapListeners[r]);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(){n.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,n){var r=new Event("render");for(e.dispatchEvent(r),(n=n||{}).groupSelectStyle=u.getGroupSelectStyle(n.groupSelectStyle),u.ensureTopVisibleBaseLayerShown(t,n.groupSelectStyle);e.firstChild;)e.removeChild(e.firstChild);u.forEachRecursive(t,(function(t,e,n){t.set("indeterminate",!1)})),"children"===n.groupSelectStyle||"none"===n.groupSelectStyle?u.setGroupVisibility(t):"group"===n.groupSelectStyle&&u.setChildVisibility(t);var i=document.createElement("ul");e.appendChild(i),u.renderLayers_(t,t,i,n,(function(r){u.renderPanel(t,e,n)}));var o=new Event("rendercomplete");e.dispatchEvent(o)}},{key:"isBaseGroup",value:function(t){if(t instanceof n){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 n&&!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 n&&!t.get("combine")&&!u.isBaseGroup(t)})).forEach((function(t){var e=t,n=e.getVisible(),r=e.get("indeterminate");e.getLayers().getArray().forEach((function(t){t.set("indeterminate",!1),n&&!r||!t.getVisible()||t.set("indeterminate",!0)}))}))}},{key:"ensureTopVisibleBaseLayerShown",value:function(t,e){var n=void 0;u.forEachRecursive(t,(function(t,e,r){"base"===t.get("type")&&t.getVisible()&&(n=t)})),n&&u.setVisible_(t,n,!0,e)}},{key:"getGroupsAndLayers",value:function(t,e){var n=[];return e=e||function(t,e,n){return!0},u.forEachRecursive(t,(function(t,r,i){t.get("title")&&e(t,r,i)&&n.push(t)})),n}},{key:"setVisible_",value:function(t,e,r,i){e.setVisible(r),r&&"base"===e.get("type")&&u.forEachRecursive(t,(function(t,n,r){t!=e&&"base"===t.get("type")&&t.setVisible(!1)})),e instanceof n&&!e.get("combine")&&"children"===i&&e.getLayers().forEach((function(n){u.setVisible_(t,n,e.getVisible(),i)}))}},{key:"renderLayer_",value:function(t,e,r,i,o){var s=document.createElement("li"),a=e.get("title"),h=u.uuid(),c=document.createElement("label");if(e instanceof n&&!e.get("combine")){var p=u.isBaseGroup(e);if(s.classList.add("group"),p&&s.classList.add(l+"base-group"),e.get("fold")){s.classList.add(l+"fold"),s.classList.add(l+e.get("fold"));var f=document.createElement("button");f.onclick=function(t){var n=t||window.event;u.toggleFold_(e,s),n.preventDefault()},s.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(n){var r=n.target;u.setVisible_(t,e,r.checked,i.groupSelectStyle),o(e)},s.appendChild(d),c.htmlFor=h}c.innerHTML=a,s.appendChild(c);var g=document.createElement("ul");s.appendChild(g),u.renderLayers_(t,e,g,i,o)}else{s.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(n){var r=n.target;u.setVisible_(t,e,r.checked,i.groupSelectStyle),o(e)},s.appendChild(_),c.htmlFor=h,c.innerHTML=a;var y=t.getView().getResolution();(y>e.getMaxResolution()||y<e.getMinResolution())&&(c.className+=" disabled"),s.appendChild(c)}return s}},{key:"renderLayers_",value:function(t,e,n,r,i){var o=e.getLayers().getArray().slice();r.reverse&&(o=o.reverse());for(var s,a=0;a<o.length;a++)(s=o[a]).get("title")&&n.appendChild(u.renderLayer_(t,s,a,r,i))}},{key:"forEachRecursive",value:function(t,e){t.getLayers().forEach((function(t,r,i){e(t,r,i),t instanceof n&&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}(xp,wp,Sp)}(mp);var Cp=mp.exports,Ep=function(){function t(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}return t.prototype.getReadOptions=function(t,e){var n;if(e){var r=e.dataProjection?wn(e.dataProjection):this.readProjection(t);e.extent&&r&&r.getUnits()===St.TILE_PIXELS&&(r=wn(r)).setWorldExtent(e.extent),n={dataProjection:r,featureProjection:e.featureProjection}}return this.adaptOptions(n)},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,n){return e()},t.prototype.readFeatures=function(t,n){return e()},t.prototype.readGeometry=function(t,n){return e()},t.prototype.readProjection=function(t){return e()},t.prototype.writeFeature=function(t,n){return e()},t.prototype.writeFeatures=function(t,n){return e()},t.prototype.writeGeometry=function(t,n){return e()},t}(),Tp=Ep;function bp(t,e,n){var r,i=n?wn(n.featureProjection):null,o=n?wn(n.dataProjection):null;if(r=i&&o&&!Tn(i,o)?(e?t.clone():t).transform(e?i:o,e?o:i):t,e&&n&&void 0!==n.decimals){var s=Math.pow(10,n.decimals);r===t&&(r=t.clone()),r.applyTransform((function(t){for(var e=0,n=t.length;e<n;++e)t[e]=Math.round(t[e]*s)/s;return t}))}return r}var Rp=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pp=function(t){function n(){return t.call(this)||this}return Rp(n,t),n.prototype.getType=function(){return Ua},n.prototype.readFeature=function(t,e){return this.readFeatureFromObject(Op(t),this.getReadOptions(t,e))},n.prototype.readFeatures=function(t,e){return this.readFeaturesFromObject(Op(t),this.getReadOptions(t,e))},n.prototype.readFeatureFromObject=function(t,n){return e()},n.prototype.readFeaturesFromObject=function(t,n){return e()},n.prototype.readGeometry=function(t,e){return this.readGeometryFromObject(Op(t),this.getReadOptions(t,e))},n.prototype.readGeometryFromObject=function(t,n){return e()},n.prototype.readProjection=function(t){return this.readProjectionFromObject(Op(t))},n.prototype.readProjectionFromObject=function(t){return e()},n.prototype.writeFeature=function(t,e){return JSON.stringify(this.writeFeatureObject(t,e))},n.prototype.writeFeatureObject=function(t,n){return e()},n.prototype.writeFeatures=function(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))},n.prototype.writeFeaturesObject=function(t,n){return e()},n.prototype.writeGeometry=function(t,e){return JSON.stringify(this.writeGeometryObject(t,e))},n.prototype.writeGeometryObject=function(t,n){return e()},n}(Tp);function Op(t){if("string"==typeof t){var e=JSON.parse(t);return e||null}return null!==t?t:null}var Fp=Pp,Ip=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Mp(t){for(var e=[],n=0,r=t.length;n<r;++n)e.push(t[n].clone());return e}var Lp=function(t){function e(e){var n=t.call(this)||this;return n.geometries_=e||null,n.changeEventsKeys_=[],n.listenGeometriesChange_(),n}return Ip(e,t),e.prototype.unlistenGeometriesChange_=function(){this.changeEventsKeys_.forEach(B),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,n,r){if(r<te(this.getExtent(),t,e))return r;for(var i=this.geometries_,o=0,s=i.length;o<s;++o)r=i[o].closestPointXY(t,e,n,r);return r},e.prototype.containsXY=function(t,e){for(var n=this.geometries_,r=0,i=n.length;r<i;++r)if(n[r].containsXY(t,e))return!0;return!1},e.prototype.computeExtent=function(t){ae(t);for(var e=this.geometries_,n=0,r=e.length;n<r;++n)ce(t,e[n].getExtent());return t},e.prototype.getGeometries=function(){return Mp(this.geometries_)},e.prototype.getGeometriesArray=function(){return this.geometries_},e.prototype.getGeometriesArrayRecursive=function(){for(var t=[],e=this.geometries_,n=0,r=e.length;n<r;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);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 n=[],r=this.geometries_,i=!1,o=0,s=r.length;o<s;++o){var a=r[o],l=a.getSimplifiedGeometry(t);n.push(l),l!==a&&(i=!0)}if(i){var u=new e(null);return u.setGeometriesArray(n),u}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this},e.prototype.getType=function(){return vt},e.prototype.intersectsExtent=function(t){for(var e=this.geometries_,n=0,r=e.length;n<r;++n)if(e[n].intersectsExtent(t))return!0;return!1},e.prototype.isEmpty=function(){return 0===this.geometries_.length},e.prototype.rotate=function(t,e){for(var n=this.geometries_,r=0,i=n.length;r<i;++r)n[r].rotate(t,e);this.changed()},e.prototype.scale=function(t,e,n){var r=n;r||(r=me(this.getExtent()));for(var i=this.geometries_,o=0,s=i.length;o<s;++o)i[o].scale(t,e,r);this.changed()},e.prototype.setGeometries=function(t){this.setGeometriesArray(Mp(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_,n=0,r=e.length;n<r;++n)e[n].applyTransform(t);this.changed()},e.prototype.translate=function(t,e){for(var n=this.geometries_,r=0,i=n.length;r<i;++r)n[r].translate(t,e);this.changed()},e.prototype.disposeInternal=function(){this.unlistenGeometriesChange_(),t.prototype.disposeInternal.call(this)},e}(Un),Ap=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Dp(t,e){if(!t)return null;var n;switch(t.type){case ct:n=function(t){return new gr(t.coordinates)}(t);break;case pt:n=function(t){return new Xr(t.coordinates)}(t);break;case dt:n=function(t){return new Fr(t.coordinates)}(t);break;case gt:n=function(t){return new Hh(t.coordinates)}(t);break;case _t:n=function(t){return new Yh(t.coordinates)}(t);break;case yt:n=function(t){return new $h(t.coordinates)}(t);break;case vt:n=function(t,e){var n=t.geometries.map((function(t){return Dp(t,e)}));return new Lp(n)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return bp(n,!1,e)}function kp(t,e){var n,r=(t=bp(t,!0,e)).getType();switch(r){case ct:n=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case pt:n=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case dt:n=function(t,e){var n;e&&(n=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(n)}}(t,e);break;case gt:n=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case _t:n=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case yt:n=function(t,e){var n;e&&(n=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}(t,e);break;case vt:n=function(t,e){return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){var n=m({},e);return delete n.featureProjection,kp(t,n)}))}}(t,e);break;case mt:n={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+r)}return n}var jp=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this)||this).dataProjection=wn(r.dataProjection?r.dataProjection:"EPSG:4326"),r.featureProjection&&(n.defaultFeatureProjection=wn(r.featureProjection)),n.geometryName_=r.geometryName,n.extractGeometryName_=r.extractGeometryName,n.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"],n}return Ap(e,t),e.prototype.readFeatureFromObject=function(t,e){var n=null,r=Dp((n="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null}).geometry,e),i=new st;return this.geometryName_?i.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in n!==void 0&&i.setGeometryName(n.geometry_name),i.setGeometry(r),"id"in n&&i.setId(n.id),n.properties&&i.setProperties(n.properties,!0),i},e.prototype.readFeaturesFromObject=function(t,e){var n=null;if("FeatureCollection"===t.type){n=[];for(var r=t.features,i=0,o=r.length;i<o;++i)n.push(this.readFeatureFromObject(r[i],e))}else n=[this.readFeatureFromObject(t,e)];return n},e.prototype.readGeometryFromObject=function(t,e){return Dp(t,e)},e.prototype.readProjectionFromObject=function(t){var e,n=t.crs;return n?"name"==n.type?e=wn(n.properties.name):"EPSG"===n.type?e=wn("EPSG:"+n.properties.code):rt(!1,36):e=this.dataProjection,e},e.prototype.writeFeatureObject=function(t,e){e=this.adaptOptions(e);var n={type:"Feature",geometry:null,properties:null},r=t.getId();if(void 0!==r&&(n.id=r),!t.hasProperties())return n;var i=t.getProperties(),o=t.getGeometry();return o&&(n.geometry=kp(o,e),delete i[t.getGeometryName()]),S(i)||(n.properties=i),n},e.prototype.writeFeaturesObject=function(t,e){e=this.adaptOptions(e);for(var n=[],r=0,i=t.length;r<i;++r)n.push(this.writeFeatureObject(t[r],e));return{type:"FeatureCollection",features:n}},e.prototype.writeGeometryObject=function(t,e){return kp(t,this.adaptOptions(e))},e}(Fp),Gp="http://www.w3.org/2001/XMLSchema-instance";function Np(t,e){return of().createElementNS(t,e)}function zp(t,e){return Bp(t,e,[]).join("")}function Bp(t,e,n){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?n.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):n.push(t.nodeValue);else{var r=void 0;for(r=t.firstChild;r;r=r.nextSibling)Bp(r,e,n)}return n}function Up(t){return"documentElement"in t}function Vp(t){return(new DOMParser).parseFromString(t,"application/xml")}function Xp(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&d(r[r.length-1],i)}}function Wp(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&r[r.length-1].push(i)}}function Yp(t,e){return function(n,r){var i=t.call(void 0!==e?e:this,n,r);void 0!==i&&(r[r.length-1]=i)}}function Kp(t,e,n){return function(r,i){var o=t.call(void 0!==n?n:this,r,i);void 0!==o&&(i[i.length-1][void 0!==e?e:r.localName]=o)}}function Zp(t,e){return function(n,r,i){t.call(void 0!==e?e:this,n,r,i),i[i.length-1].node.appendChild(n)}}function Hp(t,e){var n=t;return function(t,r,i){var o=r[r.length-1].node,s=n;return void 0===s&&(s=i),Np(void 0!==e?e:o.namespaceURI,s)}}var qp=Hp();function Jp(t,e){for(var n=e.length,r=new Array(n),i=0;i<n;++i)r[i]=t[e[i]];return r}function Qp(t,e,n){var r,i,o=void 0!==n?n:{};for(r=0,i=t.length;r<i;++r)o[t[r]]=e;return o}function $p(t,e,n,r){var i;for(i=e.firstElementChild;i;i=i.nextElementSibling){var o=t[i.namespaceURI];if(void 0!==o){var s=o[i.localName];void 0!==s&&s.call(r,i,n)}}}function tf(t,e,n,r,i){return r.push(t),$p(e,n,r,i),r.pop()}function ef(t,e,n,r,i,o,s){return i.push(t),function(t,e,n,r,i,o){for(var s,a,l=(void 0!==i?i:n).length,u=0;u<l;++u)void 0!==(s=n[u])&&void 0!==(a=e.call(void 0!==o?o:this,s,r,void 0!==i?i[u]:void 0))&&t[a.namespaceURI][a.localName].call(o,a,s,r)}(e,n,r,i,o,s),i.pop()}var nf=void 0;var rf=void 0;function of(){return void 0===rf&&"undefined"!=typeof document&&(rf=document.implementation.createDocument("","",null)),rf}var sf=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),af=function(t){function n(){var e=t.call(this)||this;return e.xmlSerializer_=(void 0===nf&&"undefined"!=typeof XMLSerializer&&(nf=new XMLSerializer),nf),e}return sf(n,t),n.prototype.getType=function(){return Xa},n.prototype.readFeature=function(t,e){if(t){if("string"==typeof t){var n=Vp(t);return this.readFeatureFromDocument(n,e)}return Up(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null},n.prototype.readFeatureFromDocument=function(t,e){var n=this.readFeaturesFromDocument(t,e);return n.length>0?n[0]:null},n.prototype.readFeatureFromNode=function(t,e){return null},n.prototype.readFeatures=function(t,e){if(t){if("string"==typeof t){var n=Vp(t);return this.readFeaturesFromDocument(n,e)}return Up(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]},n.prototype.readFeaturesFromDocument=function(t,e){for(var n=[],r=t.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&d(n,this.readFeaturesFromNode(r,e));return n},n.prototype.readFeaturesFromNode=function(t,n){return e()},n.prototype.readGeometry=function(t,e){if(t){if("string"==typeof t){var n=Vp(t);return this.readGeometryFromDocument(n,e)}return Up(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null},n.prototype.readGeometryFromDocument=function(t,e){return null},n.prototype.readGeometryFromNode=function(t,e){return null},n.prototype.readProjection=function(t){if(t){if("string"==typeof t){var e=Vp(t);return this.readProjectionFromDocument(e)}return Up(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null},n.prototype.readProjectionFromDocument=function(t){return this.dataProjection},n.prototype.readProjectionFromNode=function(t){return this.dataProjection},n.prototype.writeFeature=function(t,e){var n=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(n)},n.prototype.writeFeatureNode=function(t,e){return null},n.prototype.writeFeatures=function(t,e){var n=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(n)},n.prototype.writeFeaturesNode=function(t,e){return null},n.prototype.writeGeometry=function(t,e){var n=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(n)},n.prototype.writeGeometryNode=function(t,e){return null},n}(Tp),lf=af;function uf(t){var e,n=zp(t,!1);return(e=/^\s*(true|1)|(false|0)\s*$/.exec(n))?void 0!==e[1]||!1:void 0}function hf(t){var e,n=zp(t,!1);return(e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(n))?parseFloat(e[1]):void 0}function cf(t){return zp(t,!1).trim()}function pf(t,e){df(t,e?"1":"0")}function ff(t,e){var n=e.toPrecision();t.appendChild(of().createTextNode(n))}function df(t,e){t.appendChild(of().createTextNode(e))}var gf,_f,yf,vf,mf,xf,wf,Sf,Cf,Ef=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Tf=["http://www.google.com/kml/ext/2.2"],bf=[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"],Rf={fraction:qs,pixels:Js,insetPixels:Js},Pf=Qp(bf,{ExtendedData:Sd,Region:Cd,MultiGeometry:Kp(fd,"geometry"),LineString:Kp(hd,"geometry"),LinearRing:Kp(cd,"geometry"),Point:Kp(dd,"geometry"),Polygon:Kp(_d,"geometry"),Style:Kp(vd),StyleMap:function(t,e){var n=qf.call(this,t,e);if(!n)return;var r=e[e.length-1];Array.isArray(n)?r.Style=n:"string"==typeof n?r.styleUrl=n:rt(!1,38)},address:Kp(cf),description:Kp(cf),name:Kp(cf),open:Kp(uf),phoneNumber:Kp(cf),styleUrl:Kp(Kf),visibility:Kp(uf)},Qp(Tf,{MultiTrack:Kp((function(t,e){var n=tf([],rd,t,e);if(!n)return;return new Yh(n)}),"geometry"),Track:Kp(od,"geometry")})),Of=Qp(bf,{ExtendedData:Sd,Region:Cd,Link:function(t,e){$p(Ff,t,e)},address:Kp(cf),description:Kp(cf),name:Kp(cf),open:Kp(uf),phoneNumber:Kp(cf),visibility:Kp(uf)}),Ff=Qp(bf,{href:Kp(Yf)}),If=Qp(bf,{LatLonAltBox:function(t,e){var n=tf({},bd,t,e);if(!n)return;var r=e[e.length-1],i=[parseFloat(n.west),parseFloat(n.south),parseFloat(n.east),parseFloat(n.north)];r.extent=i,r.altitudeMode=n.altitudeMode,r.minAltitude=parseFloat(n.minAltitude),r.maxAltitude=parseFloat(n.maxAltitude)},Lod:function(t,e){var n=tf({},Rd,t,e);if(!n)return;var r=e[e.length-1];r.minLodPixels=parseFloat(n.minLodPixels),r.maxLodPixels=parseFloat(n.maxLodPixels),r.minFadeExtent=parseFloat(n.minFadeExtent),r.maxFadeExtent=parseFloat(n.maxFadeExtent)}}),Mf=Qp(bf,["Document","Placemark"]),Lf=Qp(bf,{Document:Zp((function(t,e,n){ef({node:t},Md,Ld,e,n,void 0,this)})),Placemark:Zp(rg)}),Af=null,Df=null,kf=null,jf=null,Gf=null,Nf=null;function zf(t){return 32/Math.min(t[0],t[1])}function Bf(t){return t}var Uf=function(t){function e(e){var n=t.call(this)||this,r=e||{};return Nf||(Af=new Gr({color:gf=[255,255,255,1]}),xf="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Df=new da({anchor:_f=[20,2],anchorOrigin:Qs,anchorXUnits:yf=Js,anchorYUnits:vf=Js,crossOrigin:"anonymous",rotation:0,scale:zf(mf=[64,64]),size:mf,src:xf}),wf="NO_IMAGE",kf=new Wr({color:gf,width:1}),Sf=new Wr({color:[51,51,51,1],width:2}),jf=new io({font:"bold 16px Helvetica",fill:Af,stroke:Sf,scale:.8}),Gf=new to({fill:Af,image:Df,text:jf,stroke:kf,zIndex:0}),Nf=[Gf]),n.dataProjection=wn("EPSG:4326"),n.defaultStyle_=r.defaultStyle?r.defaultStyle:Nf,n.extractStyles_=void 0===r.extractStyles||r.extractStyles,n.writeStyles_=void 0===r.writeStyles||r.writeStyles,n.sharedStyles_={},n.showPointNames_=void 0===r.showPointNames||r.showPointNames,n.crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",n.iconUrlFunction_=r.iconUrlFunction?r.iconUrlFunction:Bf,n.supportedMediaTypes=["application/vnd.google-earth.kml+xml"],n}return Ef(e,t),e.prototype.readDocumentOrFolder_=function(t,e){var n=tf([],Qp(bf,{Document:Xp(this.readDocumentOrFolder_,this),Folder:Xp(this.readDocumentOrFolder_,this),Placemark:Wp(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return n||void 0},e.prototype.readPlacemark_=function(t,e){var n=tf({geometry:null},Pf,t,e,this);if(n){var r=new st,i=t.getAttribute("id");null!==i&&r.setId(i);var o=e[0],s=n.geometry;if(s&&bp(s,!1,o),r.setGeometry(s),delete n.geometry,this.extractStyles_){var a=function(t,e,n,r,i){return function(o,s){var a=i,l="",u=[];if(a){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})),a=u.length>0):a=c===ct||c===gt}}a&&(l=o.get("name"),(a=a&&!!l)&&l.search(/&[^&]+;/)>-1&&(Cf||(Cf=document.createElement("textarea")),Cf.innerHTML=l,l=Cf.value));var p=n;if(t?p=t:e&&(p=Vf(e,n,r)),a){var f=function(t,e){var n=[0,0],r="start",i=t.getImage();if(i){var o=i.getSize();if(o&&2==o.length){var s=i.getScaleArray(),a=i.getAnchor();n[0]=s[0]*(o[0]-a[0]),n[1]=s[1]*(o[1]/2-a[1]),r="left"}}var l=t.getText();l?((l=l.clone()).setFont(l.getFont()||jf.getFont()),l.setScale(l.getScale()||jf.getScale()),l.setFill(l.getFill()||jf.getFill()),l.setStroke(l.getStroke()||Sf)):l=jf.clone();return l.setText(e),l.setOffsetX(n[0]),l.setOffsetY(n[1]),l.setTextAlign(r),new to({image:i,text:l})}(p[0],l);return u.length>0?(f.setGeometry(new Lp(u)),[f,new to({geometry:p[0].getGeometry(),image:null,fill:p[0].getFill(),stroke:p[0].getStroke(),text:null})].concat(p.slice(1))):f}return p}}(n.Style,n.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);r.setStyle(a)}return delete n.Style,r.setProperties(n,!0),r}},e.prototype.readSharedStyle_=function(t,e){var n=t.getAttribute("id");if(null!==n){var r=vd.call(this,t,e);if(r){var i=void 0,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+n,o).href;else i="#"+n;this.sharedStyles_[i]=r}}},e.prototype.readSharedStyleMap_=function(t,e){var n=t.getAttribute("id");if(null!==n){var r=qf.call(this,t,e);if(r){var i,o=t.baseURI;if(o&&"about:blank"!=o||(o=window.location.href),o)i=new URL("#"+n,o).href;else i="#"+n;this.sharedStyles_[i]=r}}},e.prototype.readFeatureFromNode=function(t,e){if(!c(bf,t.namespaceURI))return null;var n=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return n||null},e.prototype.readFeaturesFromNode=function(t,e){if(!c(bf,t.namespaceURI))return[];var n,r=t.localName;if("Document"==r||"Folder"==r)return(n=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]))||[];if("Placemark"==r){var i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==r){n=[];for(var o=t.firstElementChild;o;o=o.nextElementSibling){var s=this.readFeaturesFromNode(o,e);s&&d(n,s)}return n}return[]},e.prototype.readName=function(t){if(t){if("string"==typeof t){var e=Vp(t);return this.readNameFromDocument(e)}return Up(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 n=this.readNameFromNode(e);if(n)return n}},e.prototype.readNameFromNode=function(t){for(var e=t.firstElementChild;e;e=e.nextElementSibling)if(c(bf,e.namespaceURI)&&"name"==e.localName)return cf(e);for(e=t.firstElementChild;e;e=e.nextElementSibling){var n=e.localName;if(c(bf,e.namespaceURI)&&("Document"==n||"Folder"==n||"Placemark"==n||"kml"==n)){var r=this.readNameFromNode(e);if(r)return r}}},e.prototype.readNetworkLinks=function(t){var e=[];if("string"==typeof t){var n=Vp(t);d(e,this.readNetworkLinksFromDocument(n))}else Up(t)?d(e,this.readNetworkLinksFromDocument(t)):d(e,this.readNetworkLinksFromNode(t));return e},e.prototype.readNetworkLinksFromDocument=function(t){for(var e=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&d(e,this.readNetworkLinksFromNode(n));return e},e.prototype.readNetworkLinksFromNode=function(t){for(var e=[],n=t.firstElementChild;n;n=n.nextElementSibling)if(c(bf,n.namespaceURI)&&"NetworkLink"==n.localName){var r=tf({},Of,n,[]);e.push(r)}for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;!c(bf,n.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||d(e,this.readNetworkLinksFromNode(n))}return e},e.prototype.readRegion=function(t){var e=[];if("string"==typeof t){var n=Vp(t);d(e,this.readRegionFromDocument(n))}else Up(t)?d(e,this.readRegionFromDocument(t)):d(e,this.readRegionFromNode(t));return e},e.prototype.readRegionFromDocument=function(t){for(var e=[],n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&d(e,this.readRegionFromNode(n));return e},e.prototype.readRegionFromNode=function(t){for(var e=[],n=t.firstElementChild;n;n=n.nextElementSibling)if(c(bf,n.namespaceURI)&&"Region"==n.localName){var r=tf({},If,n,[]);e.push(r)}for(n=t.firstElementChild;n;n=n.nextElementSibling){var i=n.localName;!c(bf,n.namespaceURI)||"Document"!=i&&"Folder"!=i&&"kml"!=i||d(e,this.readRegionFromNode(n))}return e},e.prototype.writeFeaturesNode=function(t,e){e=this.adaptOptions(e);var n=Np(bf[4],"kml"),r="http://www.w3.org/2000/xmlns/";n.setAttributeNS(r,"xmlns:gx",Tf[0]),n.setAttributeNS(r,"xmlns:xsi",Gp),n.setAttributeNS(Gp,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");var i={node:n},o={};t.length>1?o.Document=t:1==t.length&&(o.Placemark=t[0]);var s=Mf[n.namespaceURI],a=Jp(o,s);return ef(i,Lf,qp,a,[e],s,this),n},e}(lf);function Vf(t,e,n){return Array.isArray(t)?t:"string"==typeof t?Vf(n[t],e,n):e}function Xf(t){var e=zp(t,!1),n=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(n){var r=n[1];return[parseInt(r.substr(6,2),16),parseInt(r.substr(4,2),16),parseInt(r.substr(2,2),16),parseInt(r.substr(0,2),16)/255]}}function Wf(t){var e=zp(t,!1),n=[];e=e.replace(/\s*,\s*/g,",");for(var r,i=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;r=i.exec(e);){var o=parseFloat(r[1]),s=parseFloat(r[2]),a=r[3]?parseFloat(r[3]):0;n.push(o,s,a),e=e.substr(r[0].length)}if(""===e)return n}function Yf(t){var e=zp(t,!1).trim(),n=t.baseURI;return n&&"about:blank"!=n||(n=window.location.href),n?new URL(e,n).href:e}function Kf(t){var e=zp(t,!1).trim().replace(/^(?!.*#)/,"#"),n=t.baseURI;return n&&"about:blank"!=n||(n=window.location.href),n?new URL(e,n).href:e}function Zf(t){return hf(t)}var Hf=Qp(bf,{Pair:function(t,e){var n=tf({},Ed,t,e,this);if(!n)return;var r=n.key;if(r&&"normal"==r){var i=n.styleUrl;i&&(e[e.length-1]=i);var o=n.Style;o&&(e[e.length-1]=o)}}});function qf(t,e){return tf(void 0,Hf,t,e,this)}var Jf=Qp(bf,{Icon:Kp((function(t,e){var n=tf({},sd,t,e);return n||null})),color:Kp(Xf),heading:Kp(hf),hotSpot:Kp((function(t){var e,n=t.getAttribute("xunits"),r=t.getAttribute("yunits");return e="insetPixels"!==n?"insetPixels"!==r?Qs:ta:"insetPixels"!==r?$s:ea,{x:parseFloat(t.getAttribute("x")),xunits:Rf[n],y:parseFloat(t.getAttribute("y")),yunits:Rf[r],origin:e}})),scale:Kp(Zf)});var Qf=Qp(bf,{color:Kp(Xf),scale:Kp(Zf)});var $f=Qp(bf,{color:Kp(Xf),width:Kp(hf)});var td=Qp(bf,{color:Kp(Xf),fill:Kp(uf),outline:Kp(uf)});var ed=Qp(bf,{coordinates:Yp(Wf)});function nd(t,e){return tf(null,ed,t,e)}var rd=Qp(Tf,{Track:Wp(od)});var id=Qp(bf,{when:function(t,e){var n=e[e.length-1].whens,r=zp(t,!1),i=Date.parse(r);n.push(isNaN(i)?0:i)}},Qp(Tf,{coord:function(t,e){var n=e[e.length-1].coordinates,r=zp(t,!1),i=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(r);if(i){var o=parseFloat(i[1]),s=parseFloat(i[2]),a=parseFloat(i[3]);n.push([o,s,a])}else n.push([])}}));function od(t,e){var n=tf({coordinates:[],whens:[]},id,t,e);if(n){for(var r=[],i=n.coordinates,o=n.whens,s=0,a=Math.min(i.length,o.length);s<a;++s)3==i[s].length&&r.push(i[s][0],i[s][1],i[s][2],o[s]);return new Xr(r,ht)}}var sd=Qp(bf,{href:Kp(Yf)},Qp(Tf,{x:Kp(hf),y:Kp(hf),w:Kp(hf),h:Kp(hf)}));var ad=Qp(bf,{coordinates:Yp(Wf)});function ld(t,e){return tf(null,ad,t,e)}var ud=Qp(bf,{extrude:Kp(uf),tessellate:Kp(uf),altitudeMode:Kp(cf)});function hd(t,e){var n=tf({},ud,t,e),r=ld(t,e);if(r){var i=new Xr(r,lt);return i.setProperties(n,!0),i}}function cd(t,e){var n=tf({},ud,t,e),r=ld(t,e);if(r){var i=new Fr(r,lt,[r.length]);return i.setProperties(n,!0),i}}var pd=Qp(bf,{LineString:Wp(hd),LinearRing:Wp(cd),MultiGeometry:Wp(fd),Point:Wp(dd),Polygon:Wp(_d)});function fd(t,e){var n,r=tf([],pd,t,e);if(!r)return null;if(0===r.length)return new Lp(r);for(var i=!0,o=r[0].getType(),s=1,a=r.length;s<a;++s)if(r[s].getType()!=o){i=!1;break}if(i){var l=void 0,u=void 0;if(o==ct){var h=r[0];l=h.getLayout(),u=h.getFlatCoordinates();for(s=1,a=r.length;s<a;++s)d(u,r[s].getFlatCoordinates());md(n=new Hh(u,l),r)}else o==pt?md(n=new Yh(r),r):o==dt?md(n=new $h(r),r):o==vt?n=new Lp(r):rt(!1,37)}else n=new Lp(r);return n}function dd(t,e){var n=tf({},ud,t,e),r=ld(t,e);if(r){var i=new gr(r,lt);return i.setProperties(n,!0),i}}var gd=Qp(bf,{innerBoundaryIs:function(t,e){var n=tf([],Pd,t,e);if(n.length>0){var r=e[e.length-1];r.push.apply(r,n)}},outerBoundaryIs:function(t,e){var n=tf(void 0,Od,t,e);if(n){e[e.length-1][0]=n}}});function _d(t,e){var n=tf({},ud,t,e),r=tf([null],gd,t,e);if(r&&r[0]){for(var i=r[0],o=[i.length],s=1,a=r.length;s<a;++s)d(i,r[s]),o.push(i.length);var l=new Fr(i,lt,o);return l.setProperties(n,!0),l}}var yd=Qp(bf,{IconStyle:function(t,e){var n=tf({},Jf,t,e);if(n){var r,i,o,s,a=e[e.length-1],l="Icon"in n?n.Icon:{},u=!("Icon"in n)||Object.keys(l).length>0,h=l.href;h?r=h:u&&(r=xf);var c,p=Qs,f=n.hotSpot;f?(i=[f.x,f.y],o=f.xunits,s=f.yunits,p=f.origin):/^http:\/\/maps\.(?:google|gstatic)\.com\//.test(r)&&(/pushpin/.test(r)?(i=_f,o=yf,s=vf):/arrow-reverse/.test(r)?(i=[54,42],o=yf,s=vf):/paddle/.test(r)&&(i=[32,1],o=yf,s=vf));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=n.heading;void 0!==x&&(y=je(x));var w=n.scale,S=n.color;if(u){r==xf&&(d=mf);var C=new da({anchor:i,anchorOrigin:p,anchorXUnits:o,anchorYUnits:s,crossOrigin:this.crossOrigin_,offset:c,offsetOrigin:Qs,rotation:y,scale:w,size:d,src:this.iconUrlFunction_(r),color:S}),E=C.getScaleArray()[0],T=C.getSize();if(null===T){var b=C.getImageState();if(b===Yr||b===Kr){var R=function(){var t=C.getImageState();if(t!==Yr&&t!==Kr){var e=C.getSize();if(e&&2==e.length){var n=zf(e);C.setScale(E*n)}C.unlistenImageChange(R)}};C.listenImageChange(R),b===Yr&&C.load()}}else if(2==T.length){var P=zf(T);C.setScale(E*P)}a.imageStyle=C}else a.imageStyle=wf}},LabelStyle:function(t,e){var n=tf({},Qf,t,e);if(n){var r=e[e.length-1],i=new io({fill:new Gr({color:"color"in n?n.color:gf}),scale:n.scale});r.textStyle=i}},LineStyle:function(t,e){var n=tf({},$f,t,e);if(n){var r=e[e.length-1],i=new Wr({color:"color"in n?n.color:gf,width:"width"in n?n.width:1});r.strokeStyle=i}},PolyStyle:function(t,e){var n=tf({},td,t,e);if(n){var r=e[e.length-1],i=new Gr({color:"color"in n?n.color:gf});r.fillStyle=i;var o=n.fill;void 0!==o&&(r.fill=o);var s=n.outline;void 0!==s&&(r.outline=s)}}});function vd(t,e){var n=tf({},yd,t,e,this);if(!n)return null;var r,i="fillStyle"in n?n.fillStyle:Af,o=n.fill;void 0===o||o||(i=null),"imageStyle"in n?n.imageStyle!=wf&&(r=n.imageStyle):r=Df;var s="textStyle"in n?n.textStyle:jf,a="strokeStyle"in n?n.strokeStyle:kf,l=n.outline;return void 0===l||l?[new to({fill:i,image:r,stroke:a,text:s,zIndex:void 0})]:[new to({geometry:function(t){var e=t.getGeometry(),n=e.getType();return n===vt?new Lp(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e!==dt&&e!==yt}))):n!==dt&&n!==yt?e:void 0},fill:i,image:r,stroke:a,text:s,zIndex:void 0}),new to({geometry:function(t){var e=t.getGeometry(),n=e.getType();return n===vt?new Lp(e.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===dt||e===yt}))):n===dt||n===yt?e:void 0},fill:i,stroke:null,zIndex:void 0})]}function md(t,e){var n,r,i,o=e.length,s=new Array(e.length),a=new Array(e.length),l=new Array(e.length);n=!1,r=!1,i=!1;for(var u=0;u<o;++u){var h=e[u];s[u]=h.get("extrude"),a[u]=h.get("tessellate"),l[u]=h.get("altitudeMode"),n=n||void 0!==s[u],r=r||void 0!==a[u],i=i||l[u]}n&&t.set("extrude",s),r&&t.set("tessellate",a),i&&t.set("altitudeMode",l)}var xd=Qp(bf,{displayName:Kp(cf),value:Kp(cf)});var wd=Qp(bf,{Data:function(t,e){var n=t.getAttribute("name");$p(xd,t,e);var r=e[e.length-1];n&&r.displayName?r[n]={value:r.value,displayName:r.displayName,toString:function(){return r.value}}:null!==n?r[n]=r.value:null!==r.displayName&&(r[r.displayName]=r.value),delete r.value},SchemaData:function(t,e){$p(Td,t,e)}});function Sd(t,e){$p(wd,t,e)}function Cd(t,e){$p(If,t,e)}var Ed=Qp(bf,{Style:Kp(vd),key:Kp(cf),styleUrl:Kp(Kf)});var Td=Qp(bf,{SimpleData:function(t,e){var n=t.getAttribute("name");if(null!==n){var r=cf(t);e[e.length-1][n]=r}}});var bd=Qp(bf,{altitudeMode:Kp(cf),minAltitude:Kp(hf),maxAltitude:Kp(hf),north:Kp(hf),south:Kp(hf),east:Kp(hf),west:Kp(hf)});var Rd=Qp(bf,{minLodPixels:Kp(hf),maxLodPixels:Kp(hf),minFadeExtent:Kp(hf),maxFadeExtent:Kp(hf)});var Pd=Qp(bf,{LinearRing:Wp(nd)});var Od=Qp(bf,{LinearRing:Yp(nd)});function Fd(t,e){for(var n=li(e),r=[255*(4==n.length?n[3]:1),n[2],n[1],n[0]],i=0;i<4;++i){var o=Math.floor(r[i]).toString(16);r[i]=1==o.length?"0"+o:o}df(t,r.join(""))}var Id=Qp(bf,{Data:Zp((function(t,e,n){t.setAttribute("name",e.name);var r={node:t},i=e.value;"object"==typeof i?(null!==i&&i.displayName&&ef(r,Id,qp,[i.displayName],n,["displayName"]),null!==i&&i.value&&ef(r,Id,qp,[i.value],n,["value"])):ef(r,Id,qp,[i],n,["value"])})),value:Zp((function(t,e){df(t,e)})),displayName:Zp((function(t,e){!function(t,e){t.appendChild(of().createCDATASection(e))}(t,e)}))});var Md=Qp(bf,{Placemark:Zp(rg)}),Ld=function(t,e,n){return Np(e[e.length-1].node.namespaceURI,"Placemark")};var Ad=Hp("Data");var Dd=Qp(bf,["href"],Qp(Tf,["x","y","w","h"])),kd=Qp(bf,{href:Zp(df)},Qp(Tf,{x:Zp(ff),y:Zp(ff),w:Zp(ff),h:Zp(ff)})),jd=function(t,e,n){return Np(Tf[0],"gx:"+n)};var Gd=Qp(bf,["scale","heading","Icon","color","hotSpot"]),Nd=Qp(bf,{Icon:Zp((function(t,e,n){var r={node:t},i=n[n.length-1].node,o=Dd[i.namespaceURI],s=Jp(e,o);ef(r,kd,qp,s,n,o),s=Jp(e,o=Dd[Tf[0]]),ef(r,kd,jd,s,n,o)})),color:Zp(Fd),heading:Zp(ff),hotSpot:Zp((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:Zp(fg)});var zd=Qp(bf,["color","scale"]),Bd=Qp(bf,{color:Zp(Fd),scale:Zp(fg)});var Ud=Qp(bf,["color","width"]),Vd=Qp(bf,{color:Zp(Fd),width:Zp(ff)});var Xd={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},Wd=function(t,e,n){if(t)return Np(e[e.length-1].node.namespaceURI,Xd[t.getType()])},Yd=Hp("Point"),Kd=Hp("LineString"),Zd=Hp("LinearRing"),Hd=Hp("Polygon"),qd=Qp(bf,{LineString:Zp(sg),Point:Zp(sg),Polygon:Zp(cg),GeometryCollection:Zp(Jd)});function Jd(t,e,n){var r,i={node:t},o=e.getType(),s=[];o===vt?(e.getGeometriesArrayRecursive().forEach((function(t){var e=t.getType();e===gt?s=s.concat(t.getPoints()):e===_t?s=s.concat(t.getLineStrings()):e===yt?s=s.concat(t.getPolygons()):e===ct||e===pt||e===dt?s.push(t):rt(!1,39)})),r=Wd):o===gt?(s=e.getPoints(),r=Yd):o===_t?(s=e.getLineStrings(),r=Kd):o===yt?(s=e.getPolygons(),r=Hd):rt(!1,39),ef(i,qd,r,s,n)}var Qd=Qp(bf,{LinearRing:Zp(sg)});function $d(t,e,n){ef({node:t},Qd,Zd,[e],n)}var tg=Qp(bf,{ExtendedData:Zp((function(t,e,n){for(var r={node:t},i=e.names,o=e.values,s=i.length,a=0;a<s;a++)ef(r,Id,Ad,[{name:i[a],value:o[a]}],n)})),MultiGeometry:Zp(Jd),LineString:Zp(sg),LinearRing:Zp(sg),Point:Zp(sg),Polygon:Zp(cg),Style:Zp((function(t,e,n){var r={node:t},i={};if(e.pointStyles.length){var o=e.pointStyles[0].getText();o&&(i.LabelStyle=o);var s=e.pointStyles[0].getImage();s&&"function"==typeof s.getSrc&&(i.IconStyle=s)}if(e.lineStyles.length){(a=e.lineStyles[0].getStroke())&&(i.LineStyle=a)}if(e.polyStyles.length){var a;(a=e.polyStyles[0].getStroke())&&!i.LineStyle&&(i.LineStyle=a),i.PolyStyle=e.polyStyles[0]}var l=n[n.length-1].node,u=dg[l.namespaceURI],h=Jp(i,u);ef(r,gg,qp,h,n,u)})),address:Zp(df),description:Zp(df),name:Zp(df),open:Zp(pf),phoneNumber:Zp(df),styleUrl:Zp(df),visibility:Zp(pf)}),eg=Qp(bf,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),ng=Hp("ExtendedData");function rg(t,e,n){var r={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 s=Object.keys(i||{}).sort().filter((function(t){return!o[t]})),a=e.getStyleFunction();if(a){var l=a(e,0);if(l){var u=Array.isArray(l)?l:[l],h=u;if(e.getGeometry()&&(h=u.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var r=n.getType();return r===vt?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===ct||e===gt})).length:r===ct||r===gt}}))),this.writeStyles_){var c=u,p=u;e.getGeometry()&&(c=u.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var r=n.getType();return r===vt?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===pt||e===_t})).length:r===pt||r===_t}})),p=u.filter((function(t){var n=t.getGeometryFunction()(e);if(n){var r=n.getType();return r===vt?n.getGeometriesArrayRecursive().filter((function(t){var e=t.getType();return e===dt||e===yt})).length:r===dt||r===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=n[n.length-1].node,g=eg[d.namespaceURI],_=Jp(i,g);if(ef(r,tg,qp,_,n,g),s.length>0){var y=Jp(i,s);ef(r,tg,ng,[{names:s,values:y}],n)}var v=n[0],m=e.getGeometry();m&&(m=bp(m,!0,v)),ef(r,tg,Wd,[m],n)}var ig=Qp(bf,["extrude","tessellate","altitudeMode","coordinates"]),og=Qp(bf,{extrude:Zp(pf),tessellate:Zp(pf),altitudeMode:Zp(df),coordinates:Zp((function(t,e,n){var r,i=n[n.length-1],o=i.layout,s=i.stride;o==at||o==ut?r=2:o==lt||o==ht?r=3:rt(!1,34);var a=e.length,l="";if(a>0){l+=e[0];for(var u=1;u<r;++u)l+=","+e[u];for(var h=s;h<a;h+=s){l+=" "+e[h];for(u=1;u<r;++u)l+=","+e[h+u]}}df(t,l)}))});function sg(t,e,n){var r=e.getFlatCoordinates(),i={node:t};i.layout=e.getLayout(),i.stride=e.getStride();var o=e.getProperties();o.coordinates=r;var s=n[n.length-1].node,a=ig[s.namespaceURI],l=Jp(o,a);ef(i,og,qp,l,n,a)}var ag=Qp(bf,["color","fill","outline"]),lg=Qp(bf,{outerBoundaryIs:Zp($d),innerBoundaryIs:Zp($d)}),ug=Hp("innerBoundaryIs"),hg=Hp("outerBoundaryIs");function cg(t,e,n){var r=e.getLinearRings(),i=r.shift(),o={node:t};ef(o,lg,ug,r,n),ef(o,lg,hg,[i],n)}var pg=Qp(bf,{color:Zp(Fd),fill:Zp(pf),outline:Zp(pf)});function fg(t,e){ff(t,Math.round(1e6*e)/1e6)}var dg=Qp(bf,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),gg=Qp(bf,{IconStyle:Zp((function(t,e,n){var r={node:t},i={},o=e.getSrc(),s=e.getSize(),a=e.getImageSize(),l={href:o};if(s){l.w=s[0],l.h=s[1];var u=e.getAnchor(),h=e.getOrigin();if(h&&a&&0!==h[0]&&h[1]!==s[1]&&(l.x=h[0],l.y=a[1]-(h[1]+s[1])),u&&(u[0]!==s[0]/2||u[1]!==s[1]/2)){var c={x:u[0],xunits:Js,y:s[1]-u[1],yunits:Js};i.hotSpot=c}}i.Icon=l;var p=e.getScaleArray()[0],f=s;null===f&&(f=mf),2==f.length&&(p/=zf(f)),1!==p&&(i.scale=p);var d=e.getRotation();0!==d&&(i.heading=d);var g=e.getColor();g&&(i.color=g);var _=n[n.length-1].node,y=Gd[_.namespaceURI],v=Jp(i,y);ef(r,Nd,qp,v,n,y)})),LabelStyle:Zp((function(t,e,n){var r={node:t},i={},o=e.getFill();o&&(i.color=o.getColor());var s=e.getScale();s&&1!==s&&(i.scale=s);var a=n[n.length-1].node,l=zd[a.namespaceURI],u=Jp(i,l);ef(r,Bd,qp,u,n,l)})),LineStyle:Zp((function(t,e,n){var r={node:t},i={color:e.getColor(),width:Number(e.getWidth())||1},o=n[n.length-1].node,s=Ud[o.namespaceURI],a=Jp(i,s);ef(r,Vd,qp,a,n,s)})),PolyStyle:Zp((function(t,e,n){var r={node:t},i=e.getFill(),o=e.getStroke(),s={color:i?i.getColor():void 0,fill:!!i&&void 0,outline:!!o&&void 0},a=n[n.length-1].node,l=ag[a.namespaceURI],u=Jp(s,l);ef(r,pg,qp,u,n,l)}))});var _g=Uf,yg={
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
read:function(t,e,n,r,i){var o,s,a=8*i-r-1,l=(1<<a)-1,u=l>>1,h=-7,c=n?i-1:0,p=n?-1:1,f=t[e+c];for(c+=p,o=f&(1<<-h)-1,f>>=-h,h+=a;h>0;o=256*o+t[e+c],c+=p,h-=8);for(s=o&(1<<-h)-1,o>>=-h,h+=r;h>0;s=256*s+t[e+c],c+=p,h-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=u}return(f?-1:1)*s*Math.pow(2,o-r)},write:function(t,e,n,r,i,o){var s,a,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=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),(e+=s+c>=1?p/l:p*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=h?(a=0,s=h):s+c>=1?(a=(e*l-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+f]=255&a,f+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;t[n+f]=255&s,f+=d,s/=256,u-=8);t[n+f-d]|=128*g}},vg=xg,mg=yg;function xg(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}xg.Varint=0,xg.Fixed64=1,xg.Bytes=2,xg.Fixed32=5;var wg=4294967296,Sg=1/wg,Cg="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Eg(t){return t.type===xg.Bytes?t.readVarint()+t.pos:t.pos+1}function Tg(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function bg(t,e,n){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(r);for(var i=n.pos-1;i>=t;i--)n.buf[i+r]=n.buf[i]}function Rg(t,e){for(var n=0;n<t.length;n++)e.writeVarint(t[n])}function Pg(t,e){for(var n=0;n<t.length;n++)e.writeSVarint(t[n])}function Og(t,e){for(var n=0;n<t.length;n++)e.writeFloat(t[n])}function Fg(t,e){for(var n=0;n<t.length;n++)e.writeDouble(t[n])}function Ig(t,e){for(var n=0;n<t.length;n++)e.writeBoolean(t[n])}function Mg(t,e){for(var n=0;n<t.length;n++)e.writeFixed32(t[n])}function Lg(t,e){for(var n=0;n<t.length;n++)e.writeSFixed32(t[n])}function Ag(t,e){for(var n=0;n<t.length;n++)e.writeFixed64(t[n])}function Dg(t,e){for(var n=0;n<t.length;n++)e.writeSFixed64(t[n])}function kg(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function jg(t,e,n){t[n]=e,t[n+1]=e>>>8,t[n+2]=e>>>16,t[n+3]=e>>>24}function Gg(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}xg.prototype={destroy:function(){this.buf=null},readFields:function(t,e,n){for(n=n||this.length;this.pos<n;){var r=this.readVarint(),i=r>>3,o=this.pos;this.type=7&r,t(i,e,this),this.pos===o&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=kg(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Gg(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=kg(this.buf,this.pos)+kg(this.buf,this.pos+4)*wg;return this.pos+=8,t},readSFixed64:function(){var t=kg(this.buf,this.pos)+Gg(this.buf,this.pos+4)*wg;return this.pos+=8,t},readFloat:function(){var t=mg.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=mg.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,n,r=this.buf;return e=127&(n=r[this.pos++]),n<128?e:(e|=(127&(n=r[this.pos++]))<<7,n<128?e:(e|=(127&(n=r[this.pos++]))<<14,n<128?e:(e|=(127&(n=r[this.pos++]))<<21,n<128?e:function(t,e,n){var r,i,o=n.buf;if(i=o[n.pos++],r=(112&i)>>4,i<128)return Tg(t,r,e);if(i=o[n.pos++],r|=(127&i)<<3,i<128)return Tg(t,r,e);if(i=o[n.pos++],r|=(127&i)<<10,i<128)return Tg(t,r,e);if(i=o[n.pos++],r|=(127&i)<<17,i<128)return Tg(t,r,e);if(i=o[n.pos++],r|=(127&i)<<24,i<128)return Tg(t,r,e);if(i=o[n.pos++],r|=(1&i)<<31,i<128)return Tg(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(n=r[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&&Cg?function(t,e,n){return Cg.decode(t.subarray(e,n))}(this.buf,e,t):function(t,e,n){var r="",i=e;for(;i<n;){var o,s,a,l=t[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h>n)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],s=t[i+2],128==(192&o)&&128==(192&s)&&((u=(15&l)<<12|(63&o)<<6|63&s)<=2047||u>=55296&&u<=57343)&&(u=null)):4===h&&(o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&((u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)<=65535||u>=1114112)&&(u=null)),null===u?(u=65533,h=1):u>65535&&(u-=65536,r+=String.fromCharCode(u>>>10&1023|55296),u=56320|1023&u),r+=String.fromCharCode(u),i+=h}return r}(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!==xg.Bytes)return t.push(this.readVarint(e));var n=Eg(this);for(t=t||[];this.pos<n;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==xg.Bytes)return t.push(this.readSVarint());var e=Eg(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==xg.Bytes)return t.push(this.readBoolean());var e=Eg(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==xg.Bytes)return t.push(this.readFloat());var e=Eg(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==xg.Bytes)return t.push(this.readDouble());var e=Eg(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==xg.Bytes)return t.push(this.readFixed32());var e=Eg(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==xg.Bytes)return t.push(this.readSFixed32());var e=Eg(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==xg.Bytes)return t.push(this.readFixed64());var e=Eg(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==xg.Bytes)return t.push(this.readSFixed64());var e=Eg(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===xg.Varint)for(;this.buf[this.pos++]>127;);else if(e===xg.Bytes)this.pos=this.readVarint()+this.pos;else if(e===xg.Fixed32)this.pos+=4;else{if(e!==xg.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 n=new Uint8Array(e);n.set(this.buf),this.buf=n,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),jg(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),jg(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),jg(this.buf,-1&t,this.pos),jg(this.buf,Math.floor(t*Sg),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),jg(this.buf,-1&t,this.pos),jg(this.buf,Math.floor(t*Sg),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var n,r;t>=0?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:(n=0,r=r+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){var n=(7&t)<<4;if(e.buf[e.pos++]|=n|((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}(r,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,n){for(var r,i,o=0;o<e.length;o++){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){r>56319||o+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):i=r;continue}if(r<56320){t[n++]=239,t[n++]=191,t[n++]=189,i=r;continue}r=i-55296<<10|r-56320|65536,i=null}else i&&(t[n++]=239,t[n++]=191,t[n++]=189,i=null);r<128?t[n++]=r:(r<2048?t[n++]=r>>6|192:(r<65536?t[n++]=r>>12|224:(t[n++]=r>>18|240,t[n++]=r>>12&63|128),t[n++]=r>>6&63|128),t[n++]=63&r|128)}return n}(this.buf,t,this.pos);var n=this.pos-e;n>=128&&bg(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n},writeFloat:function(t){this.realloc(4),mg.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),mg.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 n=0;n<e;n++)this.buf[this.pos++]=t[n]},writeRawMessage:function(t,e){this.pos++;var n=this.pos;t(e,this);var r=this.pos-n;r>=128&&bg(n,r,this),this.pos=n-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,n){this.writeTag(t,xg.Bytes),this.writeRawMessage(e,n)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Rg,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Pg,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ig,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Og,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Fg,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Mg,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Lg,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Ag,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Dg,e)},writeBytesField:function(t,e){this.writeTag(t,xg.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,xg.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,xg.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,xg.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,xg.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,xg.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,xg.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,xg.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,xg.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,xg.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Ng=[1,0,0,1,0,0],zg=function(){function t(t,e,n,r,i){this.extent_,this.id_=i,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n,this.properties_=r}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_=mr(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_},t.prototype.getFlatInteriorPoints=function(){if(!this.flatInteriorPoints_){var t=qh(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=xr(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_},t.prototype.getFlatMidpoint=function(){return this.flatMidpoints_||(this.flatMidpoints_=Nr(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,n=this.ends_,r=0,i=n.length;r<i;++r){var o=n[r],s=Nr(t,e,o,2,.5);d(this.flatMidpoints_,s),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(){},t.prototype.getType=function(){return this.type_},t.prototype.transform=function(t){var e=(t=wn(t)).getExtent(),n=t.getWorldExtent();if(e&&n){var r=Se(n)/Se(e);Gt(Ng,n[0],n[3],r,-r,0,0,0),kn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Ng,this.flatCoordinates_)}},t.prototype.getEnds=function(){return this.ends_},t}();zg.prototype.getEndss=zg.prototype.getEnds,zg.prototype.getFlatCoordinates=zg.prototype.getOrientedFlatCoordinates;var Bg=zg,Ug=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Vg=function(t){function e(e){var n=t.call(this)||this,r=e||{};return n.dataProjection=new Fe({code:"",units:St.TILE_PIXELS}),n.featureClass_=r.featureClass?r.featureClass:Bg,n.geometryName_=r.geometryName,n.layerName_=r.layerName?r.layerName:"layer",n.layers_=r.layers?r.layers:null,n.idProperty_=r.idProperty,n.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"],n}return Ug(e,t),e.prototype.readRawGeometry_=function(t,e,n,r){t.pos=e.geometry;for(var i=t.readVarint()+t.pos,o=1,s=0,a=0,l=0,u=0,h=0;t.pos<i;){if(!s){var c=t.readVarint();o=7&c,s=c>>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&u>h&&(r.push(u),h=u),n.push(a,l),u+=2):7===o?u>h&&(n.push(n[h],n[h+1]),u+=2):rt(!1,59)}u>h&&(r.push(u),h=u)},e.prototype.createFeature_=function(t,e,n){var r,i=e.type;if(0===i)return null;var o,s=e.properties;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;var a=[],l=[];this.readRawGeometry_(t,e,a,l);var u=function(t,e){var n;1===t?n=1===e?ct:gt:2===t?n=1===e?pt:_t:3===t&&(n=dt);return n}(i,l.length);if(this.featureClass_===Bg)(r=new this.featureClass_(u,a,l,s,o)).transform(n.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(Tr(a,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 $h(a,at,c):new Fr(a,at,l)}else h=u===ct?new gr(a,at):u===pt?new Xr(a,at):u===dt?new Fr(a,at,l):u===gt?new Hh(a,at):u===_t?new Yh(a,at,l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);var y=bp(h,!1,n);r.setGeometry(y),r.setId(o),r.setProperties(s,!0)}return r},e.prototype.getType=function(){return Ba},e.prototype.readFeatures=function(t,e){var n=this.layers_,r=this.adaptOptions(e),i=wn(r.dataProjection);i.setWorldExtent(r.extent),r.dataProjection=i;var o=new vg(t),s=o.readFields(Xg,{}),a=[];for(var l in s)if(!n||-1!=n.indexOf(l)){var u=s[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=Kg(o,u,c);a.push(this.createFeature_(o,f,r))}}return a},e.prototype.readProjection=function(t){return this.dataProjection},e.prototype.setLayers=function(t){this.layers_=t},e}(Tp);function Xg(t,e,n){if(3===t){var r={keys:[],values:[],features:[]},i=n.readVarint()+n.pos;n.readFields(Wg,r,i),r.length=r.features.length,r.length&&(e[r.name]=r)}}function Wg(t,e,n){if(15===t)e.version=n.readVarint();else if(1===t)e.name=n.readString();else if(5===t)e.extent=n.readVarint();else if(2===t)e.features.push(n.pos);else if(3===t)e.keys.push(n.readString());else if(4===t){for(var r=null,i=n.readVarint()+n.pos;n.pos<i;)r=1===(t=n.readVarint()>>3)?n.readString():2===t?n.readFloat():3===t?n.readDouble():4===t?n.readVarint64():5===t?n.readVarint():6===t?n.readSVarint():7===t?n.readBoolean():null;e.values.push(r)}}function Yg(t,e,n){if(1==t)e.id=n.readVarint();else if(2==t)for(var r=n.readVarint()+n.pos;n.pos<r;){var i=e.layer.keys[n.readVarint()],o=e.layer.values[n.readVarint()];e.properties[i]=o}else 3==t?e.type=n.readVarint():4==t&&(e.geometry=n.pos)}function Kg(t,e,n){t.pos=e.features[n];var r=t.readVarint()+t.pos,i={layer:e,type:0,properties:{}};return t.readFields(Yg,i,r),i}var Zg=Vg,Hg=34962,qg=34963,Jg=35044,Qg=35048,$g=["experimental-webgl","webgl","webkit-3d","moz-webgl"];var t_=Jg,e_=function(){function t(t,e){this.array=null,this.type=t,rt(t===Hg||t===qg,62),this.usage=void 0!==e?e:t_}return t.prototype.ofSize=function(t){this.array=new(n_(this.type))(t)},t.prototype.fromArray=function(t){var e=n_(this.type);this.array=e.from?e.from(t):new e(t)},t.prototype.fromArrayBuffer=function(t){this.array=new(n_(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 n_(t){return t===qg?Uint32Array:Float32Array}var r_=e_,i_="webglcontextlost",o_="webglcontextrestored",s_=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 n=e.createShader(e.VERTEX_SHADER);e.shaderSource(n,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(n);var r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord);\n }\n"),e.compileShader(r),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,n),e.attachShader(this.renderTargetProgram_,r),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.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(n){this.uniforms_.push({value:t.uniforms[n],location:e.getUniformLocation(this.renderTargetProgram_,n)})}.bind(this))}return t.prototype.getGL=function(){return this.gl_},t.prototype.init=function(t){var e=this.getGL(),n=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,n[0],n[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==n[0]||this.renderTargetTextureSize_[1]!==n[1]){this.renderTargetTextureSize_=n;var r=e.RGBA,i=e.RGBA,o=e.UNSIGNED_BYTE;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,0,r,n[0],n[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){var n=this.getGL(),r=t.size;n.bindFramebuffer(n.FRAMEBUFFER,e?e.getFrameBuffer():null),n.activeTexture(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,this.renderTargetTexture_),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.viewport(0,0,n.drawingBufferWidth,n.drawingBufferHeight),n.bindBuffer(n.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),n.useProgram(this.renderTargetProgram_),n.enableVertexAttribArray(this.renderTargetAttribLocation_),n.vertexAttribPointer(this.renderTargetAttribLocation_,2,n.FLOAT,!1,0,0),n.uniform2f(this.renderTargetUniformLocation_,r[0],r[1]),n.uniform1i(this.renderTargetTextureLocation_,0),this.applyUniforms(t),n.drawArrays(n.TRIANGLES,0,6)},t.prototype.getFrameBuffer=function(){return this.frameBuffer_},t.prototype.applyUniforms=function(t){var e,n=this.getGL(),r=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=n.createTexture()),n.activeTexture(n["TEXTURE"+r]),n.bindTexture(n.TEXTURE_2D,i.texture),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),e instanceof ImageData?n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,e.width,e.height,0,n.UNSIGNED_BYTE,new Uint8Array(e.data)):n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e),n.uniform1i(i.location,r++);else if(Array.isArray(e))switch(e.length){case 2:return void n.uniform2f(i.location,e[0],e[1]);case 3:return void n.uniform3f(i.location,e[0],e[1],e[2]);case 4:return void n.uniform4f(i.location,e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&n.uniform1f(i.location,e)}))},t}(),a_=s_;function l_(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 u_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),h_="u_projectionMatrix",c_="u_offsetScaleMatrix",p_="u_offsetRotateMatrix",f_="u_time",d_="u_zoom",g_="u_resolution",__={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:5126},y_=function(t){function e(e){var n=t.call(this)||this,r=e||{};n.boundHandleWebGLContextLost_=n.handleWebGLContextLost.bind(n),n.boundHandleWebGLContextRestored_=n.handleWebGLContextRestored.bind(n),n.canvas_=document.createElement("canvas"),n.canvas_.style.position="absolute",n.canvas_.style.left="0",n.gl_=function(t,e){for(var n=$g.length,r=0;r<n;++r)try{var i=t.getContext($g[r],e);if(i)return i}catch(t){}return null}(n.canvas_);var i=n.getGL();if(n.bufferCache_={},n.extensionCache_={},n.currentProgram_=null,n.canvas_.addEventListener(i_,n.boundHandleWebGLContextLost_),n.canvas_.addEventListener(o_,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_=[],r.uniforms)for(var o in r.uniforms)n.uniforms_.push({name:o,value:r.uniforms[o]});return n.postProcessPasses_=r.postProcesses?r.postProcesses.map((function(t){return new a_({webGlContext:i,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new a_({webGlContext:i})],n.shaderCompileErrors_=null,n.startTime_=Date.now(),n}return u_(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(),n=r(t),i=this.bufferCache_[n];i||(i={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[n]=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(),n=r(t),i=this.bufferCache_[n];i&&!e.isContextLost()&&e.deleteBuffer(i.webGlBuffer),delete this.bufferCache_[n]},e.prototype.disposeInternal=function(){this.canvas_.removeEventListener(i_,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(o_,this.boundHandleWebGLContextRestored_);var t=this.gl_.getExtension("WEBGL_lose_context");t&&t.loseContext(),delete this.gl_,delete this.canvas_},e.prototype.prepareDraw=function(t,e){var n=this.getGL(),r=this.getCanvas(),i=t.size,o=t.pixelRatio;r.width=i[0]*o,r.height=i[1]*o,r.style.width=i[0]+"px",r.style.height=i[1]+"px",n.useProgram(this.currentProgram_);for(var s=this.postProcessPasses_.length-1;s>=0;s--)this.postProcessPasses_[s].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),n.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.prepareDrawToRenderTarget=function(t,e,n){var r=this.getGL(),i=e.getSize();r.bindFramebuffer(r.FRAMEBUFFER,e.getFramebuffer()),r.viewport(0,0,i[0],i[1]),r.bindTexture(r.TEXTURE_2D,e.getTexture()),r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,n?r.ZERO:r.ONE_MINUS_SRC_ALPHA),r.useProgram(this.currentProgram_),this.applyFrameState(t),this.applyUniforms(t)},e.prototype.drawElements=function(t,e){var n=this.getGL();this.getExtension("OES_element_index_uint");var r=n.UNSIGNED_INT,i=e-t,o=4*t;n.drawElements(n.TRIANGLES,i,r,o)},e.prototype.finalizeDraw=function(t){for(var e=0;e<this.postProcessPasses_.length;e++)this.postProcessPasses_[e].apply(t,this.postProcessPasses_[e+1]||null)},e.prototype.getCanvas=function(){return this.canvas_},e.prototype.getGL=function(){return this.gl_},e.prototype.applyFrameState=function(t){var e=t.size,n=t.viewState.rotation,r=Lt(this.offsetScaleMatrix_);jt(r,2/e[0],2/e[1]);var i=Lt(this.offsetRotateMatrix_);0!==n&&function(t,e){var n=Math.cos(e),r=Math.sin(e);At(t,Dt(Mt,n,r,-r,n,0,0))}(i,-n),this.setUniformMatrixValue(c_,l_(this.tmpMat4_,r)),this.setUniformMatrixValue(p_,l_(this.tmpMat4_,i)),this.setUniformFloatValue(f_,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(d_,t.viewState.zoom),this.setUniformFloatValue(g_,t.viewState.resolution)},e.prototype.applyUniforms=function(t){var e,n=this.getGL(),r=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=n.createTexture()),n.activeTexture(n["TEXTURE"+r]),n.bindTexture(n.TEXTURE_2D,i.texture),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),(!(e instanceof HTMLImageElement)||e.complete)&&i.prevValue!==e&&(i.prevValue=e,n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e)),n.uniform1i(this.getUniformLocation(i.name),r++);else if(Array.isArray(e)&&6===e.length)this.setUniformMatrixValue(i.name,l_(this.tmpMat4_,e));else if(Array.isArray(e)&&e.length<=4)switch(e.length){case 2:return void n.uniform2f(this.getUniformLocation(i.name),e[0],e[1]);case 3:return void n.uniform3f(this.getUniformLocation(i.name),e[0],e[1],e[2]);case 4:return void n.uniform4f(this.getUniformLocation(i.name),e[0],e[1],e[2],e[3]);default:return}else"number"==typeof e&&n.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 n=this.getGL(),r=n.createShader(e);return n.shaderSource(r,t),n.compileShader(r),r},e.prototype.getProgram=function(t,e){var n=this.getGL(),r=this.compileShader(t,n.FRAGMENT_SHADER),i=this.compileShader(e,n.VERTEX_SHADER),o=n.createProgram();if(n.attachShader(o,r),n.attachShader(o,i),n.linkProgram(o),!n.getShaderParameter(r,n.COMPILE_STATUS)){var s="Fragment shader compliation failed: "+n.getShaderInfoLog(r);throw new Error(s)}if(n.deleteShader(r),!n.getShaderParameter(i,n.COMPILE_STATUS)){s="Vertex shader compilation failed: "+n.getShaderInfoLog(i);throw new Error(s)}if(n.deleteShader(i),!n.getProgramParameter(o,n.LINK_STATUS)){s="GL program linking failed: "+n.getShaderInfoLog(i);throw new Error(s)}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 n=t.size,r=t.viewState.rotation,i=t.viewState.resolution,o=t.viewState.center;return Lt(e),Gt(e,0,0,2/(i*n[0]),2/(i*n[1]),-r,-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,n,r,i){var o=this.getAttributeLocation(t);o<0||(this.getGL().enableVertexAttribArray(o),this.getGL().vertexAttribPointer(o,e,n,!1,r,i))},e.prototype.enableAttributes=function(t){for(var e=function(t){for(var e=0,n=0;n<t.length;n++){var r=t[n];e+=r.size*v_(r.type)}return e}(t),n=0,r=0;r<t.length;r++){var i=t[r];this.enableAttributeArray_(i.name,i.size,i.type||5126,e,n),n+=i.size*v_(i.type)}},e.prototype.handleWebGLContextLost=function(){x(this.bufferCache_),this.currentProgram_=null},e.prototype.handleWebGLContextRestored=function(){},e.prototype.createTexture=function(t,e,n){var r=this.getGL(),i=n||r.createTexture(),o=r.RGBA,s=r.RGBA,a=r.UNSIGNED_BYTE;return r.bindTexture(r.TEXTURE_2D,i),e?r.texImage2D(r.TEXTURE_2D,0,o,s,a,e):r.texImage2D(r.TEXTURE_2D,0,o,t[0],t[1],0,s,a,null),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),i},e}(u);function v_(t){switch(t){case __.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case __.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case __.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case __.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}var m_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),x_="GENERATE_BUFFERS",w_=function(t){function e(e,n){var r=t.call(this,e)||this,i=n||{};return r.helper=new y_({postProcesses:i.postProcesses,uniforms:i.uniforms}),void 0!==i.className&&(r.helper.getCanvas().className=i.className),r}return m_(e,t),e.prototype.disposeInternal=function(){this.helper.dispose(),delete this.helper,t.prototype.disposeInternal.call(this)},e.prototype.dispatchRenderEvent_=function(t,e){var n=this.getLayer();if(n.hasListener(t)){var r=new xs(t,null,e,null);n.dispatchEvent(r)}},e.prototype.preRender=function(t){this.dispatchRenderEvent_(Lr,t)},e.prototype.postRender=function(t){this.dispatchRenderEvent_(Ar,t)},e}(vs);var S_=w_,C_=new Uint8Array(4),E_=function(){function t(t,e){this.helper_=t;var n=t.getGL();this.texture_=n.createTexture(),this.framebuffer_=n.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 C_[0]=0,C_[1]=0,C_[2]=0,C_[3]=0,C_;this.readAll();var n=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return C_[0]=this.data_[4*n],C_[1]=this.data_[4*n+1],C_[2]=this.data_[4*n+2],C_[3]=this.data_[4*n+3],C_},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}(),T_=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"}),b_=URL.createObjectURL(T_);var R_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),P_=function(t){function e(e,n){var i=this,o=n.uniforms||{},s=[1,0,0,1,0,0];o[h_]=s,(i=t.call(this,e,{className:n.className,uniforms:o,postProcesses:n.postProcesses})||this).sourceRevision_=-1,i.verticesBuffer_=new r_(Hg,Qg),i.hitVerticesBuffer_=new r_(Hg,Qg),i.indicesBuffer_=new r_(qg,Qg),i.program_=i.helper.getProgram(n.fragmentShader,n.vertexShader),i.hitDetectionEnabled_=!(!n.hitFragmentShader||!n.hitVertexShader),i.hitProgram_=i.hitDetectionEnabled_&&i.helper.getProgram(n.hitFragmentShader,n.hitVertexShader);var a=n.attributes?n.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:__.FLOAT}})):[];i.attributes=[{name:"a_position",size:2,type:__.FLOAT},{name:"a_index",size:1,type:__.FLOAT}].concat(a),i.hitDetectionAttributes=[{name:"a_position",size:2,type:__.FLOAT},{name:"a_index",size:1,type:__.FLOAT},{name:"a_hitColor",size:4,type:__.FLOAT},{name:"a_featureUid",size:1,type:__.FLOAT}].concat(a),i.customAttributes=n.attributes?n.attributes:[],i.previousExtent_=[1/0,1/0,-1/0,-1/0],i.currentTransform_=s,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.hitDetectionEnabled_&&new E_(i.helper),i.worker_=new Worker(b_),i.worker_.addEventListener("message",function(t){var e=t.data;if(e.type===x_){var n=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_=n,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 l=i.getLayer().getSource();return i.sourceListenKeys_=[N(l,La,i.handleSourceFeatureAdded_,i),N(l,Aa,i.handleSourceFeatureChanged_,i),N(l,ka,i.handleSourceFeatureDelete_,i),N(l,Da,i.handleSourceFeatureClear_,i)],l.forEachFeature(function(t){this.featureCache_[r(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(i)),i}return R_(e,t),e.prototype.handleSourceFeatureAdded_=function(t){var e=t.feature;this.featureCache_[r(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++},e.prototype.handleSourceFeatureChanged_=function(t){var e=t.feature;this.featureCache_[r(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}},e.prototype.handleSourceFeatureDelete_=function(t){var e=t.feature;delete this.featureCache_[r(e)],this.featureCount_--},e.prototype.handleSourceFeatureClear_=function(){this.featureCache_={},this.featureCount_=0},e.prototype.renderFrame=function(t){this.preRender(t);var e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e),this.helper.finalizeDraw(t);var n=this.helper.getCanvas(),r=t.layerStatesArray[t.layerIndex].opacity;return r!==parseFloat(n.style.opacity)&&(n.style.opacity=String(r)),this.hitDetectionEnabled_&&(this.renderHitDetection(t),this.hitRenderTarget_.clearCachedData()),this.postRender(t),n},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource(),r=t.viewState,i=!t.viewHints[Ws]&&!t.viewHints[Ys],o=!he(this.previousExtent_,t.extent),s=this.sourceRevision_<n.getRevision();if(s&&(this.sourceRevision_=n.getRevision()),i&&(o||s)){var a=r.projection,l=r.resolution,u=e instanceof Wo?e.getRenderBuffer():0,h=Qt(t.extent,u*l);n.loadFeatures(h,l,a),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 n,r,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 s,a,l,u,h,c=[],p=[],f=0,d=0;for(var g in this.featureCache_)if((r=(n=this.featureCache_[g]).geometry)&&r.getType()===ct){c[0]=r.getFlatCoordinates()[0],c[1]=r.getFlatCoordinates()[1],kt(e,c),a=d+6,l=void 0,u=void 0,h=void 0,u=256,h=255,(l=p||[])[0]=Math.floor(a/u/u/u)/h,l[1]=Math.floor(a/u/u)%u/h,l[2]=Math.floor(a/u)%u/h,l[3]=a%u/h,s=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++]=s[0],this.hitRenderInstructions_[d++]=s[1],this.hitRenderInstructions_[d++]=s[2],this.hitRenderInstructions_[d++]=s[3],this.hitRenderInstructions_[d++]=Number(g));for(var _=void 0,y=0;y<this.customAttributes.length;y++)_=this.customAttributes[y].callback(n.feature,n.properties),this.renderInstructions_[f++]=_,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[d++]=_)}var v={type:x_,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:x_,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,n,r,i){if(rt(this.hitDetectionEnabled_,66),this.hitRenderInstructions_){var o=kt(e.coordinateToPixelTransform,t.slice()),s=this.hitRenderTarget_.readPixel(o[0]/2,o[1]/2),a=function(t){var e=0,n=256,r=255;return e+=Math.round(t[0]*n*n*n*r),e+=Math.round(t[1]*n*n*r),e+=Math.round(t[2]*n*r),e+Math.round(t[3]*r)}([s[0]/255,s[1]/255,s[2]/255,s[3]/255]),l=this.hitRenderInstructions_[a],u=Math.floor(l).toString(),h=this.getLayer().getSource().getFeatureByUid(u);return h?r(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){B(t)})),this.sourceListenKeys_=null,t.prototype.disposeInternal.call(this)},e}(S_),O_=P_,F_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),I_="blur",M_="gradient",L_="radius",A_=["#00f","#0ff","#0f0","#ff0","#f00"];var D_=function(t){function e(e){var n=this,r=e||{},i=m({},r);delete i.gradient,delete i.radius,delete i.blur,delete i.weight,(n=t.call(this,i)||this).gradient_=null,n.addChangeListener(M_,n.handleGradientChanged_),n.setGradient(r.gradient?r.gradient:A_),n.setBlur(void 0!==r.blur?r.blur:15),n.setRadius(void 0!==r.radius?r.radius:8);var o=r.weight?r.weight:"weight";return n.weightFunction_="string"==typeof o?function(t){return t.get(o)}:o,n.setRenderOrder(null),n}return F_(e,t),e.prototype.getBlur=function(){return this.get(I_)},e.prototype.getGradient=function(){return this.get(M_)},e.prototype.getRadius=function(){return this.get(L_)},e.prototype.handleGradientChanged_=function(){this.gradient_=function(t){for(var e=1,n=256,r=pi(e,n),i=r.createLinearGradient(0,0,e,n),o=1/(t.length-1),s=0,a=t.length;s<a;++s)i.addColorStop(s*o,t[s]);return r.fillStyle=i,r.fillRect(0,0,e,n),r.canvas}(this.getGradient())},e.prototype.setBlur=function(t){this.set(I_,t)},e.prototype.setGradient=function(t){this.set(M_,t)},e.prototype.setRadius=function(t){this.set(L_,t)},e.prototype.createRenderer=function(){return new O_(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(L_)+this.get(I_))}.bind(this),u_blurSlope:function(){return this.get(L_)/Math.max(1,this.get(I_))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a;\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)}}]})},e.prototype.renderDeclutter=function(){},e}(Pa),k_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),j_=function(t){function e(e){var n=e||{};return t.call(this,n)||this}return k_(e,t),e}(Eo),G_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),N_=function(t){function e(e){var n=t.call(this,e)||this;return n.image_=null,n}return G_(e,t),e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.prepareFrame=function(t){var e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,r=t.viewState,i=r.resolution,o=this.getLayer().getSource(),s=t.viewHints,a=t.extent;if(void 0!==e.extent&&(a=Ce(a,Dn(e.extent,r.projection))),!s[Ws]&&!s[Ys]&&!Pe(a))if(o){var l=r.projection,u=o.getImage(a,i,n,l);u&&this.loadImage(u)&&(this.image_=u)}else this.image_=null;return!!this.image_},e.prototype.renderFrame=function(t,e){var n=this.image_,r=n.getExtent(),i=n.getResolution(),o=n.getPixelRatio(),s=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,l=t.viewState,u=l.center,h=l.resolution,c=t.size,p=a*i/(h*o),f=Math.round(c[0]*a),d=Math.round(c[1]*a),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/a,1/a,g,-f/2,-d/2),Nt(this.inversePixelTransform,this.pixelTransform);var y=zt(this.pixelTransform);this.useContainer(e,y,s.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(s.extent){var C=Dn(s.extent,l.projection);(w=(S=Re(C,t.extent))&&!ne(C,t.extent))&&this.clipUnrotated(v,t,C)}var E=n.getImage(),T=Gt(this.tempTransform,f/2,d/2,p,p,0,o*(r[0]-u[0])/i,o*(u[1]-r[3])/i);this.renderedResolution=i*a/o;var b=E.width*T[0],R=E.height*T[3];if(m(v,this.getLayer().getSource().getContextOptions()),this.preRender(v,t),S&&b>=.5&&R>=.5){var P=T[4],O=T[5],F=s.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}(Cs),z_=N_,B_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),U_=function(t){function e(e){return t.call(this,e)||this}return B_(e,t),e.prototype.createRenderer=function(){return new z_(this)},e}(j_),V_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),X_=function(t){function e(e){var n=t.call(this,e)||this;return n.extentChanged=!0,n.renderedExtent_=null,n.renderedPixelRatio,n.renderedProjection=null,n.renderedRevision,n.renderedTiles=[],n.newTiles_=!1,n.tmpExtent=[1/0,1/0,-1/0,-1/0],n.tmpTileRange_=new hp(0,0,0,0),n}return V_(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),r=e.getUseInterimTilesOnError();return n==$a||n==el||n==tl&&!r},e.prototype.getTile=function(t,e,n,r){var i=r.pixelRatio,o=r.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,i,o);return a.getState()==tl&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState($a)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.loadedTileCallback=function(e,n,r){return!!this.isDrawableTile(r)&&t.prototype.loadedTileCallback.call(this,e,n,r)},e.prototype.prepareFrame=function(t){return!!this.getLayer().getSource()},e.prototype.renderFrame=function(t,e){var n=t.layerStatesArray[t.layerIndex],i=t.viewState,o=i.projection,s=i.resolution,a=i.center,l=i.rotation,u=t.pixelRatio,c=this.getLayer(),p=c.getSource(),f=p.getRevision(),d=p.getTileGridForProjection(o),g=d.getZForResolution(s,p.zDirection),_=d.getResolution(g),y=t.extent,v=n.extent&&Dn(n.extent);v&&(y=Ce(y,Dn(n.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=[a[0]-E,a[1]-T,a[0]+E,a[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 M=R.minX;M<=R.maxX;++M)for(var L=R.minY;L<=R.maxY;++L){var A=this.getTile(g,M,L,t);if(this.isDrawableTile(A)){var D=r(this);if(A.getState()==$a){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=_/s;Gt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/x,1/x,l,-w/2,-S/2);var z=zt(this.pixelTransform);this.useContainer(e,z,n.opacity);var B=this.context,U=B.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||B.clearRect(0,0,w,S),v&&this.clipUnrotated(B,t,v),m(B,p.getContextOptions()),this.preRender(B,t),this.renderedTiles.length=0;var V,X,W,Y=Object.keys(P).map(Number);Y.sort(h),1!==n.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])/_]),nt=x*p.getGutterForProjection(o),rt=P[Z];for(var it in rt){var ot=(A=rt[it]).tileCoord,st=$[1]-ot[1],at=Math.round(et[0]-(st-1)*J),lt=$[2]-ot[2],ut=Math.round(et[1]-(lt-1)*Q),ht=at-(M=Math.round(et[0]-st*J)),ct=ut-(L=Math.round(et[1]-lt*Q)),pt=g===Z;if(!(k=pt&&1!==A.getAlpha(r(this),t.time)))if(V){B.save(),W=[M,L,M+ht,L,M+ht,L+ct,M,L+ct];for(var ft=0,dt=V.length;ft<dt;++ft)if(g!==Z&&Z<X[ft]){var gt=V[ft];B.beginPath(),B.moveTo(W[0],W[1]),B.lineTo(W[2],W[3]),B.lineTo(W[4],W[5]),B.lineTo(W[6],W[7]),B.moveTo(gt[6],gt[7]),B.lineTo(gt[4],gt[5]),B.lineTo(gt[2],gt[3]),B.lineTo(gt[0],gt[1]),B.clip()}V.push(W),X.push(Z)}else B.clearRect(M,L,ht,ct);this.drawTileImage(A,t,M,L,ht,ct,nt,pt),V&&!k?(B.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(B,t),n.extent&&B.restore(),z!==U.style.transform&&(U.style.transform=z);var _t=Si(n.opacity),yt=this.container;return _t!==yt.style.opacity&&(yt.style.opacity=_t),this.container},e.prototype.drawTileImage=function(t,e,n,i,o,s,a,l){var u=this.getTileImage(t);if(u){var h=r(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,a,a,u.width-2*a,u.height-2*a,n,i,o,s),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 n=function(t,e,n){var i=r(t);i in n.usedTiles&&t.expireCache(n.viewState.projection,n.usedTiles[i])}.bind(null,e);t.postRenderFunctions.push(n)}},e.prototype.updateUsedTiles=function(t,e,n){var i=r(e);i in t||(t[i]={}),t[i][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,i,o,s,a,l,u){var h=r(e);h in t.wantedTiles||(t.wantedTiles[h]={});var c,p,f,d,g,_,y=t.wantedTiles[h],v=t.tileQueue,m=0;for(_=n.getMinZoom();_<=a;++_)for(p=n.getTileRangeForExtentAndZ(s,_,p),f=n.getResolution(_),d=p.minX;d<=p.maxX;++d)for(g=p.minY;g<=p.maxY;++g)a-_<=l?(++m,(c=e.getTile(_,d,g,i,o)).getState()==Ja&&(y[c.getKey()]=!0,v.isKeyQueued(c.getKey())||v.enqueue([c,h,n.getTileCoordCenter(c.tileCoord),f])),void 0!==u&&u(c)):e.useTile(_,d,g,o);e.updateCacheSize(m,o)},e}(Cs);X_.prototype.getLayer;var W_=X_,Y_="image",K_="hybrid",Z_="vector",H_=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),q_={image:[Ps,Es,Rs,bs,Os],hybrid:[Ps,Rs],vector:[]},J_={hybrid:[bs,Os,Ts],vector:[Ps,Es,Rs,bs,Os,Ts]},Q_=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.dirty_=!1,n.renderedLayerRevision_,n.renderedPixelToCoordinateTransform_=null,n.renderedRotation_,n.tmpTransform_=[1,0,0,1,0,0],n}return H_(e,t),e.prototype.prepareTile=function(t,e,n){var r,i=t.getState();return i!==$a&&i!==tl||(this.updateExecutorGroup_(t,e,n),this.tileImageNeedsRender_(t)&&(r=!0)),r},e.prototype.getTile=function(e,n,r,i){var o=i.pixelRatio,s=i.viewState,a=s.resolution,l=s.projection,u=this.getLayer(),h=u.getSource().getTile(e,n,r,o,l),c=i.viewHints,p=!(c[Ws]||c[Ys]);return!p&&h.wantedResolution||(h.wantedResolution=a),this.prepareTile(h,o,l)&&(p||Date.now()-i.time<8)&&u.getRenderMode()!==Z_&&this.renderTileImage_(h,i),t.prototype.getTile.call(this,e,n,r,i)},e.prototype.isDrawableTile=function(e){var n=this.getLayer();return t.prototype.isDrawableTile.call(this,e)&&(n.getRenderMode()===Z_?r(n)in e.executorGroups:e.hasContext(n))},e.prototype.getTileImage=function(t){return t.getImage(this.getLayer())},e.prototype.prepareFrame=function(e){var n=this.getLayer().getRevision();return this.renderedLayerRevision_!=n&&(this.renderedTiles.length=0),this.renderedLayerRevision_=n,t.prototype.prepareFrame.call(this,e)},e.prototype.updateExecutorGroup_=function(t,e,n){var i=this.getLayer(),o=i.getRevision(),s=i.getRenderOrder()||null,a=t.wantedResolution,l=t.getReplayState(i);if(l.dirty||l.renderedResolution!==a||l.renderedRevision!=o||l.renderedRenderOrder!=s){var u=i.getSource(),h=i.getDeclutter(),c=u.getTileGrid(),p=u.getTileGridForProjection(n).getTileCoordExtent(t.wrappedTileCoord),f=u.getSourceTiles(e,n,t),d=r(i);delete t.hitDetectionImageData[d],t.executorGroups[d]=[],h&&(t.declutterExecutorGroups[d]=[]);for(var g=function(n,r){var o=f[n];if(o.getState()!=$a)return"continue";var g=o.tileCoord,y=c.getTileCoordExtent(g),v=Ce(p,y),m=Qt(v,i.getRenderBuffer()*a,_.tmpExtent),x=he(y,v)?null:m;l.dirty=!1;var w=new gs(0,m,a,e),S=h?new gs(0,v,a,e):void 0,C=xa(a,e),E=function(t){var e,n=t.getStyleFunction()||i.getStyleFunction();if(n&&(e=n(t,a)),e){var r=this.renderFeature(t,C,e,w,S);this.dirty_=this.dirty_||r,l.dirty=l.dirty||r}},T=o.getFeatures();s&&s!==l.renderedRenderOrder&&T.sort(s);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()!==Z_&&h&&1===f.length?null:v,I=new Xs(F,a,e,u.getOverlaps(),O,i.getRenderBuffer());if(t.executorGroups[d].push(I),S){var M=new Xs(null,a,e,u.getOverlaps(),S.finish(),i.getRenderBuffer());t.declutterExecutorGroups[d].push(M)}},_=this,y=0,v=f.length;y<v;++y)g(y);l.renderedRevision=o,l.renderedRenderOrder=s,l.renderedResolution=a}},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o){var s=e.viewState.resolution,a=e.viewState.rotation;n=null==n?0:n;var l=this.getLayer(),u=l.getSource().getTileGridForProjection(e.viewState.projection),h=Jt([t]);Qt(h,s*n,h);for(var c,p={},f=function(t,e,n){var s=t.getId();void 0===s&&(s=r(t));var a=p[s];if(a){if(!0!==a&&n<a.distanceSq){if(0===n)return p[s]=!0,o.splice(o.lastIndexOf(a),1),i(t,l,e);a.geometry=e,a.distanceSq=n}}else{if(0===n)return p[s]=!0,i(t,l,e);o.push(p[s]={feature:t,layer:l,geometry:e,distanceSq:n,callback:i})}},d=this.renderedTiles,g=function(i,o){var p=d[i];if(!Re(u.getTileCoordExtent(p.wrappedTileCoord),h))return"continue";var g=r(l),_=[p.executorGroups[g]],y=p.declutterExecutorGroups[g];y&&_.push(y),_.some((function(r){for(var i=r===y?e.declutterTree.all().map((function(t){return t.value})):null,o=0,l=r.length;o<l;++o){var u=r[o];if(c=u.forEachFeatureAtCoordinate(t,s,a,n,f,i))return!0}}))},_=0,y=d.length;!c&&_<y;++_)g(_);return c},e.prototype.getFeatures=function(t){return new Promise(function(e,n){for(var i,o=this.getLayer(),s=r(o),a=o.getSource(),l=this.renderedProjection,u=l.getExtent(),h=this.renderedResolution,c=a.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()===$a){var _=c.getTileCoordExtent(i.tileCoord);a.getWrapX()&&l.canWrapX()&&!ne(u,_)&&yn(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[s];if(!x&&!this.animatingOrInteracting_){var w=ti(c.getTileSize(c.getZForResolution(h))),S=this.renderedRotation_;x=_a(w,[this.getRenderTransform(c.getTileCoordCenter(i.wrappedTileCoord),h,0,ga,w[0]*ga,w[1]*ga,0)],m,o.getStyleFunction(),c.getTileCoordExtent(i.wrappedTileCoord),i.getReplayState(o).renderedResolution,S),i.hitDetectionImageData[s]=x}e(ya(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,n=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();for(var i=t.viewHints,o=!(i[Ws]||i[Ys]),s=this.renderedTiles,a=0,l=s.length;a<l;++a){var u=s[a],h=u.declutterExecutorGroups[r(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=n},e.prototype.getTileRenderTransform=function(t,e){var n=e.pixelRatio,r=e.viewState,i=r.center,o=r.resolution,s=r.rotation,a=e.size,l=Math.round(a[0]*n),u=Math.round(a[1]*n),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/n,1/n),this.getRenderTransform(i,o,s,n,l,u,f))},e.prototype.renderFrame=function(e,n){var i=e.viewHints,o=!(i[Ws]||i[Ys]);t.prototype.renderFrame.call(this,e,n),this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;var s=this.getLayer(),a=s.getRenderMode(),l=this.context,u=l.globalAlpha;l.globalAlpha=s.getOpacity();for(var h=J_[a],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[r(s)],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,n,r,i){if(!n)return!1;var o=!1;if(Array.isArray(n))for(var s=0,a=n.length;s<a;++s)o=Sa(r,t,n[s],e,this.boundHandleStyleImageChange_,void 0,i)||o;else o=Sa(r,t,n,e,this.boundHandleStyleImageChange_,void 0,i);return o},e.prototype.tileImageNeedsRender_=function(t){var e=this.getLayer();if(e.getRenderMode()===Z_)return!1;var n=t.getReplayState(e),r=e.getRevision(),i=t.wantedResolution;return n.renderedTileResolution!==i||n.renderedTileRevision!==r},e.prototype.renderTileImage_=function(t,e){var n=this.getLayer(),i=t.getReplayState(n),o=n.getRevision(),s=t.executorGroups[r(n)];i.renderedTileRevision=o;var a=t.wrappedTileCoord,l=a[0],u=n.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(n);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=Lt(this.tmpTransform_);jt(m,v,v),_.setTransform.apply(_,m)}var x=p.getTileCoordExtent(a,this.tmpExtent),w=d/g,S=Lt(this.tmpTransform_);jt(S,w,-w),function(t,e,n){At(t,Dt(Mt,1,0,0,1,e,n))}(S,-x[0],-x[3]);for(var C=0,E=s.length;C<E;++C){s[C].execute(_,v,S,0,!0,q_[n.getRenderMode()])}i.renderedTileResolution=t.wantedResolution},e}(W_),$_=Q_,ty="preload",ey="useInterimTilesOnError",ny=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),ry=function(t){function e(e){var n=this,r=e||{},i=m({},r);delete i.preload,delete i.useInterimTilesOnError,(n=t.call(this,i)||this).on,n.once,n.un,r.renderMode===Y_&&(console.warn('renderMode: "image" is deprecated. Option ignored.'),r.renderMode=void 0);var o=r.renderMode||K_;return rt(o==K_||o==Z_,28),n.renderMode_=o,n.setPreload(r.preload?r.preload:0),n.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),n}return ny(e,t),e.prototype.createRenderer=function(){return new $_(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(ty)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ey)},e.prototype.setPreload=function(t){this.set(ty,t)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ey,t)},e}(Wo),iy="tileloadstart",oy="tileloadend",sy="tileloaderror",ay=[0,0,0],ly=function(){function t(t){var e,n,r,i;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,rt((e=this.resolutions_,n=!0,r=function(t,e){return e-t}||h,e.every((function(t,i){if(0===i)return!0;var o=r(e[i-1],t);return!(o>0||n&&0===o)}))),17),!t.origins)for(var o=0,s=this.resolutions_.length-1;o<s;++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,rt(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=Ee(a)),rt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,rt(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Yl,rt(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a: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 n=new hp(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(a){var r=this.getTileRangeForExtentAndZ(a,e);n.minX=Math.max(r.minX,n.minX),n.maxX=Math.min(r.maxX,n.maxX),n.minY=Math.max(r.minY,n.minY),n.maxY=Math.min(r.maxY,n.maxY)}return n}),this):a&&this.calculateTileRanges_(a)}return t.prototype.forEachTileCoord=function(t,e,n){for(var r=this.getTileRangeForExtentAndZ(t,e),i=r.minX,o=r.maxX;i<=o;++i)for(var s=r.minY,a=r.maxY;s<=a;++s)n([e,i,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,r){var i,o,s=null,a=t[0]-1;for(2===this.zoomFactor_?(i=t[1],o=t[2]):s=this.getTileCoordExtent(t,r);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?up(i=Math.floor(i/2),i,o=Math.floor(o/2),o,n):this.getTileRangeForExtentAndZ(s,a,n)))return!0;--a}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,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var r=2*t[1],i=2*t[2];return up(r,r+1,i,i+1,e)}var o=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var r=t[0],i=t[1],o=t[2];if(e===r)return up(i,o,i,o,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-r),a=Math.floor(i*s),l=Math.floor(o*s);return e<r?up(a,a,l,l,n):up(a,Math.floor(s*(i+1))-1,l,Math.floor(s*(o+1))-1,n)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var r=this.getOrigin(t),i=this.getResolution(t),o=ti(this.getTileSize(t),this.tmpSize_),s=r[0]+e.minX*o[0]*i,a=r[0]+(e.maxX+1)*o[0]*i;return se(s,r[1]+e.minY*o[1]*i,a,r[1]+(e.maxY+1)*o[1]*i,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var r=ay;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,r);var i=r[1],o=r[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,r),up(i,r[1],o,r[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=ti(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*r[0]*n,e[1]-(t[2]+.5)*r[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),r=this.getResolution(t[0]),i=ti(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*i[0]*r,s=n[1]-(t[2]+1)*i[1]*r;return se(o,s,o+i[0]*r,s+i[1]*r,e)},t.prototype.getTileCoordForCoordAndResolution=function(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)},t.prototype.getTileCoordForXYAndResolution_=function(t,e,n,r,i){var o=this.getZForResolution(n),s=n/this.getResolution(o),a=this.getOrigin(o),l=ti(this.getTileSize(o),this.tmpSize_),u=r?.5:0,h=r?.5:0,c=Math.floor((t-a[0])/n+u),p=Math.floor((a[1]-e)/n+h),f=s*c/l[0],d=s*p/l[1];return r?(f=Math.ceil(f)-1,d=Math.ceil(d)-1):(f=Math.floor(f),d=Math.floor(d)),tp(o,f,d,i)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,r,i){var o=this.getOrigin(n),s=this.getResolution(n),a=ti(this.getTileSize(n),this.tmpSize_),l=r?.5:0,u=r?.5:0,h=Math.floor((t-o[0])/s+l),c=Math.floor((o[1]-e)/s+u),p=h/a[0],f=c/a[1];return r?(p=Math.ceil(p)-1,f=Math.ceil(f)-1):(p=Math.floor(p),f=Math.floor(f)),tp(n,p,f,i)},t.prototype.getTileCoordForCoordAndZ=function(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)},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,n=new Array(e),r=this.minZoom;r<e;++r)n[r]=this.getTileRangeForExtentAndZ(t,r);this.fullTileRanges_=n},t}(),uy=ly;function hy(t){var e=t.getDefaultTileGrid();return e||(e=fy(t),t.setDefaultTileGrid(e)),e}function cy(t){var e=t||{},n=e.extent||wn("EPSG:3857").getExtent(),r={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:py(n,e.maxZoom,e.tileSize,e.maxResolution)};return new uy(r)}function py(t,e,n,r){for(var i=void 0!==e?e:42,o=Se(t),s=be(t),a=ti(void 0!==n?n:Yl),l=r>0?r:Math.max(s/a[0],o/a[1]),u=i+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function fy(t,e,n,r){return function(t,e,n,r){var i=void 0!==r?r:Vt,o=py(t,e,n);return new uy({extent:t,origin:xe(t,i),resolutions:o,tileSize:n})}(dy(t),e,n,r)}function dy(t){var e=(t=wn(t)).getExtent();if(!e){var n=180*wt[St.DEGREES]/t.getMetersPerUnit();e=se(-n,-n,n,n)}return e}var gy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),_y=function(t){function n(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX})||this;n.on,n.once,n.un,n.opaque_=void 0!==e.opaque&&e.opaque,n.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,n.tileGrid=void 0!==e.tileGrid?e.tileGrid:null;var r=e.tileGrid;return r&&ti(r.getTileSize(r.getMinZoom()),[256,256]),n.tileCache=new ap(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition},n.zDirection=e.zDirection?e.zDirection:0,n}return gy(n,t),n.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},n.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},n.prototype.forEachLoadedTile=function(t,e,n,r){var i=this.getTileCacheForProjection(t);if(!i)return!1;for(var o,s,a,l=!0,u=n.minX;u<=n.maxX;++u)for(var h=n.minY;h<=n.maxY;++h)s=ep(e,u,h),a=!1,i.containsKey(s)&&(a=(o=i.get(s)).getState()===$a)&&(a=!1!==r(o)),a||(l=!1);return l},n.prototype.getGutterForProjection=function(t){return 0},n.prototype.getKey=function(){return this.key_},n.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},n.prototype.getOpaque=function(t){return this.opaque_},n.prototype.getResolutions=function(){return this.tileGrid.getResolutions()},n.prototype.getTile=function(t,n,r,i,o){return e()},n.prototype.getTileGrid=function(){return this.tileGrid},n.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:hy(t)},n.prototype.getTileCacheForProjection=function(t){return rt(Tn(this.getProjection(),t),68),this.tileCache},n.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},n.prototype.getTilePixelSize=function(t,e,n){var r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(e),o=ti(r.getTileSize(t),this.tmpSize);return 1==i?o:$r(o,i,this.tmpSize)},n.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),r=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var r=e[0],i=t.getTileCoordCenter(e),o=dy(n);if(ee(o,i))return e;var s=be(o),a=Math.ceil((o[0]-i[0])/s);return i[0]+=s*a,t.getTileCoordForCoordAndZ(i,r)}(r,t,n)),function(t,e){var n=t[0],r=t[1],i=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var o=e.getFullTileRange(n);return!o||o.containsXY(r,i)}(t,r)?t:null},n.prototype.clear=function(){this.tileCache.clear()},n.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},n.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},n.prototype.useTile=function(t,e,n,r){},n}(Ma),yy=function(t){function e(e,n){var r=t.call(this,e)||this;return r.tile=n,r}return gy(e,t),e}(a),vy=_y;function my(t,e){var n=/\{z\}/g,r=/\{x\}/g,i=/\{y\}/g,o=/\{-y\}/g;return function(s,a,l){return s?t.replace(n,s[0].toString()).replace(r,s[1].toString()).replace(i,s[2].toString()).replace(o,(function(){var t=s[0],n=e.getFullTileRange(t);return rt(n,55),(n.getHeight()-s[2]-1).toString()})):void 0}}function xy(t){return 1===t.length?t[0]:function(e,n,r){if(e){var i=Ge(ip(e),t.length);return t[i](e,n,r)}}}var wy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Sy=function(t){function e(n){var r=t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,opaque:n.opaque,projection:n.projection,state:n.state,tileGrid:n.tileGrid,tilePixelRatio:n.tilePixelRatio,wrapX:n.wrapX,transition:n.transition,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return r.generateTileUrlFunction_=r.tileUrlFunction===e.prototype.tileUrlFunction,r.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(r.tileUrlFunction=n.tileUrlFunction),r.urls=null,n.urls?r.setUrls(n.urls):n.url&&r.setUrl(n.url),r.tileLoadingKeys_={},r}return wy(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,n=t.target,i=r(n),o=n.getState();o==Qa?(this.tileLoadingKeys_[i]=!0,e=iy):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],e=o==tl?sy:o==$a?oy:void 0),null!=e&&this.dispatchEvent(new yy(e,n))},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=[],n=/\{([a-z])-([a-z])\}/.exec(t);if(n){var r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),o=void 0;for(o=r;o<=i;++o)e.push(t.replace(n[0],String.fromCharCode(o)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(n[2],10),a=parseInt(n[1],10);a<=s;a++)e.push(t.replace(n[0],a.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 n=t.length,r=new Array(n),i=0;i<n;++i)r[i]=my(t[i],e);return xy(r)}(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var r=ep(t,e,n);this.tileCache.containsKey(r)&&this.tileCache.get(r)},e}(vy),Cy=Sy,Ey=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ty=function(t){function e(e){var n=this,r=e.projection||"EPSG:3857",i=e.extent||dy(r),o=e.tileGrid||cy({extent:i,maxResolution:e.maxResolution,maxZoom:void 0!==e.maxZoom?e.maxZoom:22,minZoom:e.minZoom,tileSize:e.tileSize||512});return(n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,opaque:!1,projection:r,state:e.state,tileGrid:o,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Ry,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,n.sourceTileCache=new ap(n.tileCache.highWaterMark),n.overlaps_=null==e.overlaps||e.overlaps,n.tileClass=e.tileClass?e.tileClass:yp,n.tileGrids_={},n}return Ey(e,t),e.prototype.getFeaturesInExtent=function(t){var e=[],n=this.tileCache;if(0===n.getCount())return e;var r=rp(n.peekFirstKey())[0],i=this.tileGrid;return n.forEach((function(n){if(n.tileCoord[0]===r&&n.getState()===$a)for(var o=n.getSourceTiles(),s=0,a=o.length;s<a;++s){var l=o[s],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,n){var r=this.getTileCacheForProjection(e),i=Object.keys(n).reduce((function(t,e){var n,i,o=ep((i=(n=e).substring(n.lastIndexOf("/")+1,n.length).split(",").map(Number))[0],i[1],i[2]);if(r.containsKey(o))for(var s=r.get(o).sourceTiles,a=0,l=s.length;a<l;++a)t[s[a].getKey()]=!0;return t}),{});t.prototype.expireCache.call(this,e,n),this.sourceTileCache.expireCache(i)},e.prototype.getSourceTiles=function(t,e,n){var r=this;if(n.getState()===Ja){n.setState(Qa);var i=n.wrappedTileCoord,o=this.getTileGridForProjection(e),s=o.getTileCoordExtent(i),a=i[0],l=o.getResolution(a);Qt(s,-l,s);var u=this.tileGrid,h=u.getExtent();h&&Ce(s,h,s);var c=u.getZForResolution(l,1);u.forEachTileCoord(s,c,(function(i){var o=r.tileUrlFunction(i,t,e),s=r.sourceTileCache.containsKey(o)?r.sourceTileCache.get(o):new r.tileClass(i,o?Ja:el,o,r.format_,r.tileLoadFunction);n.sourceTiles.push(s);var a=s.getState();if(a<$a){var l=function(t){r.handleTileChange(t);var e=s.getState();if(e===$a||e===tl){var i=s.getKey();i in n.errorTileKeys?s.getState()===$a&&delete n.errorTileKeys[i]:n.loadingSourceTiles--,e===tl?n.errorTileKeys[i]=!0:s.removeEventListener(T,l),0===n.loadingSourceTiles&&n.setState(S(n.errorTileKeys)?$a:tl)}};s.addEventListener(T,l),n.loadingSourceTiles++}a===Ja&&(s.extent=u.getTileCoordExtent(i),s.projection=e,s.resolution=u.getResolution(i[0]),r.sourceTileCache.set(o,s),s.load())})),n.loadingSourceTiles||n.setState(n.sourceTiles.some((function(t){return t.getState()===tl}))?tl:$a)}return n.sourceTiles},e.prototype.getTile=function(t,e,n,r,i){var o,s=ep(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)&&(o=this.tileCache.get(s)).key===a)return o;var l=[t,e,n],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,r,i)}.bind(this))}var v=new dp(l,f?el:Ja,u,this.getSourceTiles.bind(this,r,i));return v.key=a,o?(v.interimTile=o,v.refreshInterimChain(),this.tileCache.replace(s,v)):this.tileCache.set(s,v),v},e.prototype.getTileGridForProjection=function(t){var e=t.getCode(),n=this.tileGrids_[e];if(!n){var r=this.tileGrid;n=fy(t,void 0,r?r.getTileSize(r.getMinZoom()):void 0),this.tileGrids_[e]=n}return n},e.prototype.getTilePixelRatio=function(t){return t},e.prototype.getTilePixelSize=function(t,e,n){var r=ti(this.getTileGridForProjection(n).getTileSize(t),this.tmpSize);return[Math.round(r[0]*e),Math.round(r[1]*e)]},e.prototype.updateCacheSize=function(e,n){t.prototype.updateCacheSize.call(this,2*e,n),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(n).highWaterMark},e}(Cy),by=Ty;function Ry(t,e){t.setLoader((function(n,r,i){Wa(e,t.getFormat(),n,r,i,t.onLoad.bind(t),t.onError.bind(t))}))}var Py,Oy=function(){function t(t,e,n,r,i,o){this.sourceProj_=t,this.targetProj_=e;var s={},a=Rn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return s[e]||(s[e]=a(t)),s[e]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&be(r)==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(n),u=Te(n),h=ve(n),c=ye(n),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(h),g=this.transformInv_(c),_=10+(o?Math.max(0,Math.ceil(Le(_e(n)/(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,n){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 n=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-n<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}s={}}return t.prototype.addTriangle_=function(t,e,n,r,i,o){this.triangles_.push({source:[r,i,o],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,r,i,o,s,a,l){var u=Jt([i,o,s,a]),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,n,r]))/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(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[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(s[0])&&isFinite(s[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1))&&2!=d&&4!=d&&8!=d)return;if(l>0){if(!f){var g=[(t[0]+n[0])/2,(t[1]+n[1])/2],_=this.transformInv_(g),y=void 0;if(p)y=(Ge(i[0],c)+Ge(s[0],c))/2-Ge(_[0],c);else y=(i[0]+s[0])/2-_[0];var v=(i[1]+s[1])/2-_[1];f=y*y+v*v>this.errorThresholdSquared_}if(f){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){var m=[(e[0]+n[0])/2,(e[1]+n[1])/2],x=this.transformInv_(m),w=[(r[0]+t[0])/2,(r[1]+t[1])/2],S=this.transformInv_(w);this.addQuad_(t,e,m,w,i,o,x,S,l-1),this.addQuad_(w,m,n,r,S,x,s,a,l-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),T=[(n[0]+r[0])/2,(n[1]+r[1])/2],b=this.transformInv_(T);this.addQuad_(t,C,T,r,i,E,b,a,l-1),this.addQuad_(C,e,n,T,E,o,s,b,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,n,r,i,s,a),0==(14&d)&&this.addTriangle_(t,n,e,i,s,o),d&&(0==(13&d)&&this.addTriangle_(e,r,t,o,a,i),0==(7&d)&&this.addTriangle_(e,r,n,o,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,n,r){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}(),Fy="1.3.0",Iy={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1};function My(t,e,n,r,i){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(r,i),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,r)+1,Math.max(n,i)),t.restore()}function Ly(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Ay(t,e,n,r){var i=Pn(n,e,t),o=Sn(e,r,n),s=e.getMetersPerUnit();void 0!==s&&(o*=s);var a=t.getMetersPerUnit();void 0!==a&&(o/=a);var l=t.getExtent();if(!l||ee(l,i)){var u=Sn(t,o,i)/o;isFinite(u)&&u>0&&(o/=u)}return o}function Dy(t,e,n,r,i,o,s,a,l,u,h,c){var p=pi(Math.round(n*t),Math.round(n*e));if(m(p,c),0===l.length)return p.canvas;function f(t){return Math.round(t*n)/n}p.scale(n,n),p.globalCompositeOperation="lighter";var d=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,n){ce(d,t.extent)}));var g=be(d),_=Se(d),y=pi(Math.round(n*g/r),Math.round(n*_/r));m(y,c);var v=n/r;l.forEach((function(t,e,n){var r=t.extent[0]-d[0],i=-(t.extent[3]-d[3]),o=be(t.extent),s=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,r*v,i*v,o*v,s*v)}));var x=Ee(s);return a.getTriangles().forEach((function(t,e,i){var s=t.source,a=t.target,l=s[0][0],u=s[0][1],h=s[1][0],g=s[1][1],_=s[2][0],v=s[2][1],m=f((a[0][0]-x[0])/o),w=f(-(a[0][1]-x[1])/o),S=f((a[1][0]-x[0])/o),C=f(-(a[1][1]-x[1])/o),E=f((a[2][0]-x[0])/o),T=f(-(a[2][1]-x[1])/o),b=l,R=u;l=0,u=0;var P=function(t){for(var e=t.length,n=0;n<e;n++){for(var r=n,i=Math.abs(t[n][n]),o=n+1;o<e;o++){var s=Math.abs(t[o][n]);s>i&&(i=s,r=o)}if(0===i)return null;var a=t[r];t[r]=t[n],t[n]=a;for(var l=n+1;l<e;l++)for(var u=-t[l][n]/t[n][n],h=n;h<e+1;h++)n==h?t[l][h]=0:t[l][h]+=u*t[n][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===Py){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",My(t,4,5,4,0),My(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;Py=Ly(e,0)||Ly(e,4)||Ly(e,8)}return Py}()||c===Iy){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(r/n,-r/n),p.drawImage(y.canvas,0,0),p.restore()}})),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,n){var r=t.target,i=(r[0][0]-x[0])/o,s=-(r[0][1]-x[1])/o,a=(r[1][0]-x[0])/o,l=-(r[1][1]-x[1])/o,u=(r[2][0]-x[0])/o,h=-(r[2][1]-x[1])/o;p.beginPath(),p.moveTo(a,l),p.lineTo(i,s),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var ky=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),jy=function(t){function e(e,n,r,i,o,s,a,l,u,h,c,p){var f=t.call(this,o,Ja)||this;f.renderEdges_=void 0!==c&&c,f.contextOptions_=p,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=n,f.targetTileGrid_=i,f.wrappedTileCoord_=s||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=el,f;var v=e.getExtent();v&&(_=_?Ce(_,v):v);var m=i.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,n,r){var i=me(n),o=Ay(t,e,i,r);return(!isFinite(o)||o<=0)&&ge(n,(function(n){return o=Ay(t,e,n,r),isFinite(o)&&o>0})),o}(e,r,y,m);if(!isFinite(x)||x<=0)return f.state=el,f;var w=void 0!==h?h:.5;if(f.triangulation_=new Oy(e,r,y,_,x*w,m),0===f.triangulation_.getTriangles().length)return f.state=el,f;f.sourceZ_=n.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=n.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,a);b&&f.sourceTiles_.push(b)}0===f.sourceTiles_.length&&(f.state=el)}else f.state=el;return f}return ky(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,r){e&&e.getState()==$a&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=tl;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),r="number"==typeof n?n:n[0],i="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Dy(r,i,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),o,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.contextOptions_),this.state=$a}this.changed()},e.prototype.load=function(){if(this.state==Ja){this.state=Qa,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,r){var i=e.getState();if(i==Ja||i==Qa){t++;var o=N(e,T,(function(n){var r=e.getState();r!=$a&&r!=tl&&r!=el||(B(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,n){t.getState()==Ja&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(B),this.sourcesListenerKeys_=null},e}(ll),Gy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ny=function(t){function e(e){var n=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:zy,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this;return n.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:hl,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.contextOptions_=!1===e.imageSmoothing?Iy:void 0,n.renderReprojectionEdges_=!1,n}return Gy(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 n=this.getTileCacheForProjection(t);for(var r in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var i=this.tileCacheForProjection[r];i.expireCache(i==n?e:{})}},e.prototype.getContextOptions=function(){return this.contextOptions_},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Tn(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){return t.prototype.getKey.call(this)+(this.contextOptions_?"\n"+JSON.stringify(this.contextOptions_):"")},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Tn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Tn(e,t)){var n=r(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=hy(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Tn(e,t))return this.tileCache;var n=r(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new ap(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,r,i,o){var s=[t,e,n],a=this.getTileCoordForTileUrlFunction(s,i),l=a?this.tileUrlFunction(a,r,i):void 0,u=new this.tileClass(s,void 0!==l?Ja:el,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,n,r,i){var o=this.getProjection();if(o&&i&&!Tn(o,i)){var s=this.getTileCacheForProjection(i),a=[t,e,n],l=void 0,u=np(a);s.containsKey(u)&&(l=s.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(a,i),d=new jy(o,c,i,p,a,f,this.getTilePixelRatio(r),this.getGutter(),function(t,e,n,r){return this.getTileInternal(t,e,n,r,o)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.contextOptions_);return d.key=h,l?(d.interimTile=l,d.refreshInterimChain(),s.replace(u,d)):s.set(u,d),d}return this.getTileInternal(t,e,n,r,o||i)},e.prototype.getTileInternal=function(t,e,n,r,i){var o=null,s=ep(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)){if((o=this.tileCache.get(s)).key!=a){var l=o;o=this.createTile_(t,e,n,r,i,a),l.getState()==Ja?o.interimTile=l.interimTile:o.interimTile=l,o.refreshInterimChain(),this.tileCache.replace(s,o)}}else o=this.createTile_(t,e,n,r,i,a),this.tileCache.set(s,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 n=wn(t);if(n){var i=r(n);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}},e}(Cy);function zy(t,e){t.getImage().src=e}var By=Ny,Uy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();!function(t){function e(e){var n=this,r="Unexpected response status: "+e.status;return(n=t.call(this,r)||this).name="ResponseError",n.response=e,n}Uy(e,t)}(Error),function(t){function e(e){var n=t.call(this,"Failed to issue request")||this;return n.name="ClientError",n.client=e,n}Uy(e,t)}(Error);var Vy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xy=function(t){function e(e){var n=this,r=e||{},i=m({},r);return delete i.preload,delete i.useInterimTilesOnError,(n=t.call(this,i)||this).on,n.once,n.un,n.setPreload(void 0!==r.preload?r.preload:0),n.setUseInterimTilesOnError(void 0===r.useInterimTilesOnError||r.useInterimTilesOnError),n}return Vy(e,t),e.prototype.getPreload=function(){return this.get(ty)},e.prototype.setPreload=function(t){this.set(ty,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ey)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ey,t)},e}(Eo),Wy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Yy=function(t){function e(e){return t.call(this,e)||this}return Wy(e,t),e.prototype.createRenderer=function(){return new W_(this)},e}(Xy),Ky=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();function Zy(t,e){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.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR)}function Hy(t,e,n,r,i){var o,s,a=t.getGL();switch(Zy(a,e),i){case 1:o=a.LUMINANCE;break;case 2:o=a.LUMINANCE_ALPHA;break;case 3:o=a.RGB;break;case 4:o=a.RGBA;break;default:throw new Error("Unsupported number of bands: "+i)}n instanceof Float32Array?(s=a.FLOAT,t.getExtension("OES_texture_float"),t.getExtension("OES_texture_float_linear")):s=a.UNSIGNED_BYTE,a.texImage2D(a.TEXTURE_2D,0,o,r[0],r[1],0,o,s,n)}var qy=function(t){function e(e,n,r){var i=t.call(this)||this;i.tile,i.textures=[],i.handleTileChange_=i.handleTileChange_.bind(i),i.size=ti(n.getTileSize(e.tileCoord[0])),i.bandCount=NaN,i.helper_=r;var o=new r_(Hg,Jg);return o.fromArray([0,1,1,1,1,0,0,0]),r.flushBufferData(o),i.coords=o,i.setTile(e),i}return Ky(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()===$a,this.loaded?this.uploadTile_():t.addEventListener(T,this.handleTileChange_))},e.prototype.uploadTile_=function(){var t=this.helper_,e=t.getGL(),n=this.tile;if(n instanceof hl){var r=e.createTexture();return this.textures.push(r),this.bandCount=4,void function(t,e,n){Zy(t,e),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,n)}(e,r,n.getImage())}var i=n.getData(),o=i instanceof Float32Array,s=this.size[0]*this.size[1];this.bandCount=i.byteLength/(o?4:1)/s;var a=Math.ceil(this.bandCount/4);if(1===a){r=e.createTexture();return this.textures.push(r),void Hy(t,r,i,this.size,this.bandCount)}for(var l=o?Float32Array:Uint8Array,u=new Array(a),h=0;h<a;++h){r=e.createTexture();this.textures.push(r);var c=h<a-1?4:this.bandCount%4;u[h]=new l(s*c)}for(var p=s*this.bandCount,f=0;f<p;++f){var d=f%this.bandCount,g=d%4,_=(c=(h=Math.floor(d/4))<a-1?4:this.bandCount%4,Math.floor(f/this.bandCount));u[h][_*c+g]=i[f]}for(h=0;h<a;++h){c=h<a-1?4:this.bandCount%4;Hy(t,r=this.textures[h],u[h],this.size,c)}},e.prototype.handleTileChange_=function(){this.tile.getState()===$a&&(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),Jy=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Qy="u_tileTexture",$y="u_tileTransform",tv="u_transitionAlpha",ev="u_depth",nv="u_texturePixelWidth",rv="u_texturePixelHeight",iv="u_resolution",ov="u_zoom",sv=[{name:"a_textureCoord",size:2,type:__.FLOAT}],av={};function lv(t){return 2*(1-1/(t+1))-1}function uv(t,e,n){n in t||(t[n]=[]),t[n].push(e)}function hv(t,e){var n=t.layerStatesArray[t.layerIndex];return n.extent&&(e=Ce(e,Dn(n.extent,t.viewState.projection))),e}var cv=function(t){function e(e,n){var r=t.call(this,e,{uniforms:n.uniforms,className:n.className})||this;r.tileTransform_=[1,0,0,1,0,0],r.tempMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],r.tempTileRange_=new hp(0,0,0,0),r.tempTileCoord_=tp(0,0,0),r.tempSize_=[0,0],r.program_=r.helper.getProgram(n.fragmentShader,n.vertexShader);var i=new r_(qg,Jg);i.fromArray([0,1,3,1,2,3]),r.helper.flushBufferData(i),r.indices_=i;var o=void 0!==n.cacheSize?n.cacheSize:512;return r.tileTextureCache_=new $c(o),r.renderedOpacity_=NaN,r}return Jy(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),r=e.getUseInterimTilesOnError();return n==$a||n==el||n==tl&&!r},e.prototype.prepareFrame=function(t){if(Pe(hv(t,t.extent)))return!1;var e=this.getLayer().getSource();return!!e&&e.getState()===mo},e.prototype.enqueueTiles=function(t,e,n,i){var o=t.viewState,s=this.getLayer().getSource(),a=s.getTileGridForProjection(o.projection),l=this.tileTextureCache_,u=a.getTileRangeForExtentAndZ(e,n),h=r(s);h in t.wantedTiles||(t.wantedTiles[h]={});for(var c=t.wantedTiles[h],p=a.getResolution(n),f=u.minX;f<=u.maxX;++f)for(var d=u.minY;d<=u.maxY;++d){var g=tp(n,f,d,this.tempTileCoord_),_=np(g),y=void 0,v=void 0;l.containsKey(_)&&(v=(y=l.get(_)).tile),y&&y.tile.key===s.getKey()||(v=s.getTile(n,f,d,t.pixelRatio,o.projection),y?y.setTile(this.isDrawableTile(v)?v:v.getInterimTile()):(y=new qy(v,a,this.helper),l.set(_,y))),uv(i,y,n);var m=v.getKey();c[m]=!0,v.getState()===Ja&&(t.tileQueue.isKeyQueued(m)||t.tileQueue.enqueue([v,h,a.getTileCoordCenter(g),p]))}},e.prototype.renderFrame=function(t){this.preRender(t);var e=t.viewState,n=t.layerStatesArray[t.layerIndex],i=hv(t,t.extent),o=this.getLayer().getSource(),s=o.getTileGridForProjection(e.projection),a=s.getZForResolution(e.resolution,o.zDirection),l={};if(t.nextExtent){var u=s.getZForResolution(e.nextResolution,o.zDirection),c=hv(t,t.nextExtent);this.enqueueTiles(t,c,u,l)}this.enqueueTiles(t,i,a,l);for(var p={},f=r(this),d=t.time,g=!1,_=l[a],y=0,v=_.length;y<v;++y){var m=(k=(K=_[y]).tile).tileCoord;if(K.loaded){if(1===(j=k.getAlpha(f,d))){k.endTransition(f);continue}g=!0,p[G=np(m)]=j}if(!this.findAltTiles_(s,m,a+1,l))for(var x=a-1;x>=s.minZoom;--x){if(this.findAltTiles_(s,m,x,l))break}}this.helper.useProgram(this.program_),this.helper.prepareDraw(t,!g);for(var w=Object.keys(l).map(Number).sort(h),S=this.helper.getGL(),C=e.center[0],E=e.center[1],T=0,b=w.length;T<b;++T){var R=w[T],P=s.getResolution(R),O=ti(s.getTileSize(R),this.tempSize_),F=s.getOrigin(R),I=(C-F[0])/(O[0]*P),M=(F[1]-E)/(O[1]*P),L=e.resolution/P,A=lv(R),D=l[R];for(y=0,v=D.length;y<v;++y){if((K=D[y]).loaded){var k,j,G=np(m=(k=K.tile).tileCoord),N=m[1],z=m[2];Gt(this.tileTransform_,0,0,2/(t.size[0]*L/O[0]),-2/(t.size[1]*L/O[1]),e.rotation,-(I-N),-(M-z)),this.helper.setUniformMatrixValue($y,l_(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(K.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(sv);for(var B=0;B<K.textures.length;++B){var U="TEXTURE"+B,V=Qy+B;S.activeTexture(S[U]),S.bindTexture(S.TEXTURE_2D,K.textures[B]),S.uniform1i(this.helper.getUniformLocation(V),B)}(j=G in p?p[G]:1)<1&&(t.animate=!0),this.helper.setUniformFloatValue(tv,j),this.helper.setUniformFloatValue(ev,A),this.helper.setUniformFloatValue(nv,O[0]),this.helper.setUniformFloatValue(rv,O[1]),this.helper.setUniformFloatValue(iv,e.resolution),this.helper.setUniformFloatValue(ov,e.zoom),this.helper.drawElements(0,this.indices_.getSize())}}}this.helper.finalizeDraw(t);var X=this.helper.getCanvas(),W=n.opacity;this.renderedOpacity_!==W&&(X.style.opacity=String(W),this.renderedOpacity_=W);for(var Y=this.tileTextureCache_;Y.canExpireCache();){var K;(K=Y.pop()).dispose()}return t.postRenderFunctions.push((function(t,e){o.expireCache(o.getProjection(),av)})),this.postRender(t),X},e.prototype.findAltTiles_=function(t,e,n,r){var i=t.getTileRangeForTileCoordAndZ(e,n,this.tempTileRange_);if(!i)return!1;for(var o=!0,s=this.tileTextureCache_,a=i.minX;a<=i.maxX;++a)for(var l=i.minY;l<=i.maxY;++l){var u=ep(n,a,l),h=!1;if(s.containsKey(u)){var c=s.get(u);c.loaded&&(uv(r,c,n),h=!0)}h||(o=!1)}return o},e.prototype.disposeInternal=function(){var e=this.helper,n=e.getGL();e.deleteBuffer(this.indices_),delete this.indices_,n.deleteProgram(this.program_),delete this.program_;var r=this.tileTextureCache_;r.forEach((function(t){t.dispose()})),r.clear(),delete this.tileTextureCache_,t.prototype.disposeInternal.call(this)},e}(S_);cv.prototype.getLayer;var pv=1,fv=2,dv=4,gv=8,_v=16,yv=31,vv=0,mv={};function xv(t){if("number"==typeof t)return pv;if("boolean"==typeof t)return gv;if("string"==typeof t)return e=t,ii.test(e)&&(e=si(e)),ri.test(e)||0===e.indexOf("rgba(")||0===e.indexOf("rgb(")?dv|fv:fv;var e;if(!Array.isArray(t))throw new Error("Unhandled value type: "+JSON.stringify(t));var n=t;if(n.every((function(t){return"number"==typeof t})))return 3===n.length||4===n.length?dv|_v:_v;if("string"!=typeof n[0])throw new Error("Expected an expression operator but received: "+JSON.stringify(n));var r=mv[n[0]];if(void 0===r)throw new Error("Unrecognized expression operator: "+JSON.stringify(n));return r.getReturnType(n.slice(1))}function wv(t){var e=t.toString();return-1===e.indexOf(".")?e+".0":e}function Sv(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(wv).join(", ")+")"}function Cv(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function Ev(t,e,n){if(Array.isArray(e)&&"string"==typeof e[0]){var r=mv[e[0]];if(void 0===r)throw new Error("Unrecognized expression operator: "+JSON.stringify(e));return r.toGlsl(t,e.slice(1),n)}var i,o=xv(e);if((o&pv)>0)return wv(e);if((o&gv)>0)return e.toString();if((o&fv)>0&&(void 0===n||n==fv))return function(t,e){return wv(Cv(t,e))}(t,e.toString());if((o&dv)>0&&(void 0===n||n==dv))return(i=li(e).slice()).length<4&&i.push(1),Sv(i.map((function(t,e){return e<3?t/255:t})));if((o&_v)>0)return Sv(e);throw new Error("Unexpected expression "+e+" (expected type "+n+")")}function Tv(t){if(!(xv(t)&pv))throw new Error("A numeric value was expected, got "+JSON.stringify(t)+" instead")}function bv(t){for(var e=0;e<t.length;e++)Tv(t[e])}function Rv(t){if(!(xv(t)&fv))throw new Error("A string value was expected, got "+JSON.stringify(t)+" instead")}function Pv(t){if(!(xv(t)&gv))throw new Error("A boolean value was expected, got "+JSON.stringify(t)+" instead")}function Ov(t,e){if(t.length!==e)throw new Error("Exactly "+e+" arguments were expected, got "+t.length+" instead")}function Fv(t,e){if(t.length<e)throw new Error("At least "+e+" arguments were expected, got "+t.length+" instead")}function Iv(t,e){if(t.length>e)throw new Error("At most "+e+" arguments were expected, got "+t.length+" instead")}function Mv(t){if(t.length%2!=0)throw new Error("An even amount of arguments was expected, got "+t+" instead")}function Lv(t,e){if(Le(e)%1!=0)throw new Error("Could not infer only one type from the following expression: "+JSON.stringify(t))}function Av(t){return"u_var_"+t}function Dv(t){return{getReturnType:function(t){return gv},toGlsl:function(e,n){Ov(n,2);for(var r=yv,i=0;i<n.length;i++)r&=xv(n[i]);if(r===vv)throw new Error("All arguments should be of compatible type, got "+JSON.stringify(n)+" instead");return r&=~dv,"("+Ev(e,n[0],r)+" "+t+" "+Ev(e,n[1],r)+")"}}}function kv(t){return{getReturnType:function(t){return gv},toGlsl:function(e,n){Fv(n,2);for(var r=0;r<n.length;r++)Pv(n[r]);return"("+n.map((function(t){return Ev(e,t)})).join(" "+t+" ")+")"}}}mv.get={getReturnType:function(t){return yv},toGlsl:function(t,e){Ov(e,1),Rv(e[0]);var n=e[0].toString();return-1===t.attributes.indexOf(n)&&t.attributes.push(n),(t.inFragmentShader?"v_":"a_")+n}},mv.var={getReturnType:function(t){return yv},toGlsl:function(t,e){Ov(e,1),Rv(e[0]);var n=e[0].toString();return-1===t.variables.indexOf(n)&&t.variables.push(n),Av(n)}},mv.band={getReturnType:function(t){return pv},toGlsl:function(t,e){Fv(e,1),Iv(e,3);var n=e[0];if("number"!=typeof n)throw new Error("Band index must be a number");var r=n-1,i=Math.floor(r/4),o=r%4;if(n===t.bandCount&&1===o&&(o=3),1===e.length)return"color"+i+"["+o+"]";var s=e[1],a=e[2]||0;return Tv(s),Tv(a),"texture2D("+(Qy+i)+", v_textureCoord + vec2("+Ev(t,s)+" / "+nv+", "+Ev(t,a)+" / "+rv+"))["+o+"]"}},mv.time={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,0),"u_time"}},mv.zoom={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,0),"u_zoom"}},mv.resolution={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,0),"u_resolution"}},mv["*"]={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,2),bv(e),"("+Ev(t,e[0])+" * "+Ev(t,e[1])+")"}},mv["/"]={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,2),bv(e),"("+Ev(t,e[0])+" / "+Ev(t,e[1])+")"}},mv["+"]={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,2),bv(e),"("+Ev(t,e[0])+" + "+Ev(t,e[1])+")"}},mv["-"]={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,2),bv(e),"("+Ev(t,e[0])+" - "+Ev(t,e[1])+")"}},mv.clamp={getReturnType:function(t){return pv},toGlsl:function(t,e){Ov(e,3),bv(e);var n=Ev(t,e[1]),r=Ev(t,e[2]);return"clamp("+Ev(t,e[0])+", "+n+", "+r+")"}},mv["%"]={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,2),bv(e),"mod("+Ev(t,e[0])+", "+Ev(t,e[1])+")"}},mv["^"]={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,2),bv(e),"pow("+Ev(t,e[0])+", "+Ev(t,e[1])+")"}},mv.abs={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,1),bv(e),"abs("+Ev(t,e[0])+")"}},mv.sin={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,1),bv(e),"sin("+Ev(t,e[0])+")"}},mv.cos={getReturnType:function(t){return pv},toGlsl:function(t,e){return Ov(e,1),bv(e),"cos("+Ev(t,e[0])+")"}},mv.atan={getReturnType:function(t){return pv},toGlsl:function(t,e){return Fv(e,1),Iv(e,2),bv(e),2===e.length?"atan("+Ev(t,e[0])+", "+Ev(t,e[1])+")":"atan("+Ev(t,e[0])+")"}},mv[">"]={getReturnType:function(t){return gv},toGlsl:function(t,e){return Ov(e,2),bv(e),"("+Ev(t,e[0])+" > "+Ev(t,e[1])+")"}},mv[">="]={getReturnType:function(t){return gv},toGlsl:function(t,e){return Ov(e,2),bv(e),"("+Ev(t,e[0])+" >= "+Ev(t,e[1])+")"}},mv["<"]={getReturnType:function(t){return gv},toGlsl:function(t,e){return Ov(e,2),bv(e),"("+Ev(t,e[0])+" < "+Ev(t,e[1])+")"}},mv["<="]={getReturnType:function(t){return gv},toGlsl:function(t,e){return Ov(e,2),bv(e),"("+Ev(t,e[0])+" <= "+Ev(t,e[1])+")"}},mv["=="]=Dv("=="),mv["!="]=Dv("!="),mv["!"]={getReturnType:function(t){return gv},toGlsl:function(t,e){return Ov(e,1),Pv(e[0]),"(!"+Ev(t,e[0])+")"}},mv.all=kv("&&"),mv.any=kv("||"),mv.between={getReturnType:function(t){return gv},toGlsl:function(t,e){Ov(e,3),bv(e);var n=Ev(t,e[1]),r=Ev(t,e[2]),i=Ev(t,e[0]);return"("+i+" >= "+n+" && "+i+" <= "+r+")"}},mv.array={getReturnType:function(t){return _v},toGlsl:function(t,e){Fv(e,2),Iv(e,4),bv(e);var n=e.map((function(e){return Ev(t,e,pv)}));return"vec"+e.length+"("+n.join(", ")+")"}},mv.color={getReturnType:function(t){return dv},toGlsl:function(t,e){Fv(e,3),Iv(e,4),bv(e);var n=e;3===e.length&&n.push(1);var r=e.map((function(e,n){return Ev(t,e,pv)+(n<3?" / 255.0":"")}));return"vec"+e.length+"("+r.join(", ")+")"}},mv.interpolate={getReturnType:function(t){for(var e=dv|pv,n=3;n<t.length;n+=2)e&=xv(t[n]);return e},toGlsl:function(t,e,n){Mv(e),Fv(e,6);var r,i=e[0];switch(i[0]){case"linear":r=1;break;case"exponential":r=i[1];break;default:r=null}if(!r)throw new Error('Invalid interpolation type for "interpolate" operator, received: '+JSON.stringify(i));var o=void 0!==n?n:yv,s=mv.interpolate.getReturnType(e)&o;Lv(e,s);for(var a=Ev(t,e[1]),l=wv(r),u="",h=2;h<e.length-2;h+=2){var c=Ev(t,e[h]),p=u||Ev(t,e[h+1],s),f=Ev(t,e[h+2]);u="mix("+p+", "+Ev(t,e[h+3],s)+", pow(clamp(("+a+" - "+c+") / ("+f+" - "+c+"), 0.0, 1.0), "+l+"))"}return u}},mv.match={getReturnType:function(t){for(var e=yv,n=2;n<t.length;n+=2)e&=xv(t[n]);return e&=xv(t[t.length-1])},toGlsl:function(t,e,n){Mv(e),Fv(e,4);var r=void 0!==n?n:yv,i=mv.match.getReturnType(e)&r;Lv(e,i);for(var o=Ev(t,e[0]),s=Ev(t,e[e.length-1],i),a=null,l=e.length-3;l>=1;l-=2){a="("+o+" == "+Ev(t,e[l])+" ? "+Ev(t,e[l+1],i)+" : "+(a||s)+")"}return a}},mv.case={getReturnType:function(t){for(var e=yv,n=1;n<t.length;n+=2)e&=xv(t[n]);return e&=xv(t[t.length-1])},toGlsl:function(t,e,n){!function(t){if(t.length%2==0)throw new Error("An odd amount of arguments was expected, got "+t+" instead")}(e),Fv(e,3);var r=void 0!==n?n:yv,i=mv.case.getReturnType(e)&r;Lv(e,i);for(var o=0;o<e.length-1;o+=2)Pv(e[o]);var s=Ev(t,e[e.length-1],i),a=null;for(o=e.length-3;o>=0;o-=2){a="("+Ev(t,e[o])+" ? "+Ev(t,e[o+1],i)+" : "+(a||s)+")"}return a}};var jv=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,n){return this.varyings.push({name:t,type:e,expression:n}),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",n=this.attributes,r=this.varyings;return t&&(n=n.concat("vec4 a_hitColor"),r=r.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"+n.map((function(t){return"attribute "+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 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"+r.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;":"",n=this.varyings;return t&&(n=n.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"+n.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 Gv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nv=function(t){function e(e){var n=this,r=m({},e);return(n=t.call(this,r)||this).parseResult_=function(t){var e=t.symbol,n=void 0!==e.size?e.size:1,r=e.color||"white",i=e.textureCoord||[0,0,1,1],o=e.offset||[0,0],s=void 0!==e.opacity?e.opacity:1,a=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{}},u=Ev(l,n,_v|pv),h=Ev(l,o,_v),c=Ev(l,i,_v),p=Ev(l,a,pv),f={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap},d=Ev(f,r,dv),g=Ev(f,s,pv),_="1.0",y="vec2("+Ev(f,n,_v|pv)+").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 jv).setSizeExpression("vec2("+u+")").setRotationExpression(p).setSymbolOffsetExpression(h).setTextureCoordinateExpression(c).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression("vec4("+d+".rgb, "+d+".a * "+g+" * "+_+")");if(t.filter){var w=Ev(f,t.filter,gv);x.setFragmentDiscardExpression("!"+w)}var S={};if(f.variables.forEach((function(e){var n=Av(e);x.addUniform("float "+n),S[n]=function(){if(!t.variables||void 0===t.variables[e])throw new Error("The following variable is missing from the style: "+e);var n=t.variables[e];return"string"==typeof n&&(n=Cv(l,n)),void 0!==n?n:-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,n){var r=n[t];return"string"==typeof r&&(r=Cv(l,r)),void 0!==r?r:-9999999}}})),uniforms:S}}(e.style),n.hitDetectionDisabled_=!!e.disableHitDetection,n}return Gv(e,t),e.prototype.createRenderer=function(){return new O_(this,{className:this.getClassName(),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}(Eo),zv=Nv,Bv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}();var Uv=function(t){function e(e){var n=this,i=void 0!==e.hidpi&&e.hidpi;return(n=t.call(this,{cacheSize:e.cacheSize,crossOrigin:"anonymous",imageSmoothing:e.imageSmoothing,opaque:!0,projection:wn("EPSG:3857"),reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:vo,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:i?2:1,wrapX:void 0===e.wrapX||e.wrapX,transition:e.transition,zDirection:e.zDirection})||this).hidpi_=i,n.culture_=void 0!==e.culture?e.culture:"en-us",n.maxZoom_=void 0!==e.maxZoom?e.maxZoom:-1,n.apiKey_=e.key,n.imagerySet_=e.imagerySet,function(t,e,n,i){var o=document.createElement("script"),s="olc_"+r(e);function a(){delete window[s],o.parentNode.removeChild(o)}o.async=!0,o.src=t+(-1==t.indexOf("?")?"?":"&")+(i||"callback")+"="+s;var l=setTimeout((function(){a(),n&&n()}),1e4);window[s]=function(t){clearTimeout(l),a(),e(t)},document.getElementsByTagName("head")[0].appendChild(o)}("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+n.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+n.apiKey_+"&c="+n.culture_,n.handleImageryMetadataResponse.bind(n),void 0,"jsonp"),n}return Bv(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],n=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,r=dy(this.getProjection()),i=this.hidpi_?2:1,o=e.imageWidth==e.imageHeight?e.imageWidth/i:[e.imageWidth/i,e.imageHeight/i],s=cy({extent:r,minZoom:e.zoomMin,maxZoom:n,tileSize:o});this.tileGrid=s;var a=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=xy(e.imageUrlSubdomains.map((function(t){var n=[0,0,0],r=e.imageUrl.replace("{subdomain}",t).replace("{culture}",a);return function(t,e,i){if(t){tp(t[0],t[1],t[2],n);var o=r;return l&&(o+="&dpi=d1&device=mobile"),o.replace("{quadkey}",function(t){var e,n,r=t[0],i=new Array(r),o=1<<r-1;for(e=0;e<r;++e)n=48,t[1]&o&&(n+=1),t[2]&o&&(n+=2),i[e]=String.fromCharCode(n),o>>=1;return i.join("")}(n))}}}))),e.imageryProviders){var u=bn(wn("EPSG:4326"),this.getProjection());this.setAttributions(function(t){var n=[],r=t.viewState,i=this.getTileGrid(),o=i.getZForResolution(r.resolution,this.zDirection),s=i.getTileCoordForCoordAndZ(r.center,o)[0];return e.imageryProviders.map((function(e){for(var r=!1,i=e.coverageAreas,o=0,a=i.length;o<a;++o){var l=i[o];if(s>=l.zoomMin&&s<=l.zoomMax){var h=l.bbox;if(Re(Oe([h[1],h[0],h[3],h[2]],u),t.extent)){r=!0;break}}}r&&n.push(e.attribution)})),n.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),n}.bind(this))}this.setState(mo)}else this.setState(xo)},e}(By),Vv=Uv,Xv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wv=function(t){function e(e){var n=e||{},r=void 0!==n.projection?n.projection:"EPSG:3857",i=void 0!==n.tileGrid?n.tileGrid:cy({extent:dy(r),maxResolution:n.maxResolution,maxZoom:n.maxZoom,minZoom:n.minZoom,tileSize:n.tileSize});return t.call(this,{attributions:n.attributions,cacheSize:n.cacheSize,crossOrigin:n.crossOrigin,imageSmoothing:n.imageSmoothing,opaque:n.opaque,projection:r,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:n.tileLoadFunction,tilePixelRatio:n.tilePixelRatio,tileUrlFunction:n.tileUrlFunction,url:n.url,urls:n.urls,wrapX:void 0===n.wrapX||n.wrapX,transition:n.transition,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this}return Xv(e,t),e}(By),Yv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Kv=function(t){function e(e,n,r,i,o,s,a){var l=this,u=e.getExtent(),h=n.getExtent(),c=h?Ce(r,h):r,p=Ay(e,n,me(c),i),f=new Oy(e,n,c,u,.5*p,i),d=s(f.calculateSourceExtent(),p,o),g=d?Yr:qr,_=d?d.getPixelRatio():1;return(l=t.call(this,r,i,_,g)||this).targetProj_=n,l.maxSourceExtent_=u,l.triangulation_=f,l.targetResolution_=i,l.targetExtent_=r,l.sourceImage_=d,l.sourcePixelRatio_=_,l.contextOptions_=a,l.canvas_=null,l.sourceListenerKey_=null,l}return Yv(e,t),e.prototype.disposeInternal=function(){this.state==Kr&&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==Zr){var e=be(this.targetExtent_)/this.targetResolution_,n=Se(this.targetExtent_)/this.targetResolution_;this.canvas_=Dy(e,n,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.contextOptions_)}this.state=t,this.changed()},e.prototype.load=function(){if(this.state==Yr){this.state=Kr,this.changed();var t=this.sourceImage_.getState();t==Zr||t==Hr?this.reproject_():(this.sourceListenerKey_=N(this.sourceImage_,T,(function(t){var e=this.sourceImage_.getState();e!=Zr&&e!=Hr||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}},e.prototype.unlistenSource_=function(){B(this.sourceListenerKey_),this.sourceListenerKey_=null},e}(oa),Zv=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Hv="imageloadstart",qv="imageloadend",Jv="imageloaderror",Qv=function(t){function e(e,n){var r=t.call(this,e)||this;return r.image=n,r}return Zv(e,t),e}(a);function $v(t,e){t.getImage().src=e}var tm=function(t){function n(e){var n=t.call(this,{attributions:e.attributions,projection:e.projection,state:e.state})||this;return n.on,n.once,n.un,n.resolutions_=void 0!==e.resolutions?e.resolutions:null,n.reprojectedImage_=null,n.reprojectedRevision_=0,n.contextOptions_=!1===e.imageSmoothing?Iy:void 0,n}return Zv(n,t),n.prototype.getResolutions=function(){return this.resolutions_},n.prototype.getContextOptions=function(){return this.contextOptions_},n.prototype.findNearestResolution=function(t){if(this.resolutions_){var e=p(this.resolutions_,t,0);t=this.resolutions_[e]}return t},n.prototype.getImage=function(t,e,n,r){var i=this.getProjection();if(i&&r&&!Tn(i,r)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Tn(this.reprojectedImage_.getProjection(),r)&&this.reprojectedImage_.getResolution()==e&&he(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Kv(i,r,t,e,n,function(t,e,n){return this.getImageInternal(t,e,n,i)}.bind(this),this.contextOptions_),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return i&&(r=i),this.getImageInternal(t,e,n,r)},n.prototype.getImageInternal=function(t,n,r,i){return e()},n.prototype.handleImageChange=function(t){var e=t.target;switch(e.getState()){case Kr:this.loading=!0,this.dispatchEvent(new Qv(Hv,e));break;case Zr:this.loading=!1,this.dispatchEvent(new Qv(qv,e));break;case Hr:this.loading=!1,this.dispatchEvent(new Qv(Jv,e))}},n}(Ma);function em(t,e){var n=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&n.push(t+"="+encodeURIComponent(e[t]))}));var r=n.join("&");return(t=-1===(t=t.replace(/[?&]$/,"")).indexOf("?")?t+"?":t+"&")+r}var nm="carmentaserver",rm="geoserver",im="mapserver",om="qgis",sm=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),am=[101,101],lm=function(t){function e(e){var n=this,r=e||{};return(n=t.call(this,{attributions:r.attributions,imageSmoothing:r.imageSmoothing,projection:r.projection,resolutions:r.resolutions})||this).crossOrigin_=void 0!==r.crossOrigin?r.crossOrigin:null,n.url_=r.url,n.imageLoadFunction_=void 0!==r.imageLoadFunction?r.imageLoadFunction:$v,n.params_=r.params||{},n.v13_=!0,n.updateV13_(),n.serverType_=r.serverType,n.hidpi_=void 0===r.hidpi||r.hidpi,n.image_=null,n.imageSize_=[0,0],n.renderedRevision_=0,n.ratio_=void 0!==r.ratio?r.ratio:1.5,n}return sm(e,t),e.prototype.getFeatureInfoUrl=function(t,e,n,r){if(void 0!==this.url_){var i=wn(n),o=this.getProjection();o&&o!==i&&(e=Ay(o,i,t,e),t=Pn(t,i,o));var s=we(t,e,0,am),a={SERVICE:"WMS",VERSION:Fy,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(a,this.params_,r);var l=Math.floor((t[0]-s[0])/e),u=Math.floor((s[3]-t[1])/e);return a[this.v13_?"I":"X"]=l,a[this.v13_?"J":"Y"]=u,this.getRequestUrl_(s,am,1,o||i,a)}},e.prototype.getLegendUrl=function(t,e){if(void 0!==this.url_){var n={SERVICE:"WMS",VERSION:Fy,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var r=this.params_.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;n.LAYER=r}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;n.SCALE=t*i/28e-5}return m(n,e),em(this.url_,n)}},e.prototype.getParams=function(){return this.params_},e.prototype.getImageInternal=function(t,e,n,r){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==n||this.hidpi_&&void 0!==this.serverType_||(n=1);var i=e/n,o=me(t),s=we(o,i,0,[Math.ceil(be(t)/i),Math.ceil(Se(t)/i)]),a=we(o,i,0,[Math.ceil(this.ratio_*be(t)/i),Math.ceil(this.ratio_*Se(t)/i)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==n&&ne(l.getExtent(),s))return l;var u={SERVICE:"WMS",VERSION:Fy,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};m(u,this.params_),this.imageSize_[0]=Math.round(be(a)/i),this.imageSize_[1]=Math.round(Se(a)/i);var h=this.getRequestUrl_(a,this.imageSize_,n,r,u);return this.image_=new la(a,e,n,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,n,r,i){if(rt(void 0!==this.url_,9),i[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(i.STYLES=""),1!=n)switch(this.serverType_){case rm:var o=90*n+.5|0;"FORMAT_OPTIONS"in i?i.FORMAT_OPTIONS+=";dpi:"+o:i.FORMAT_OPTIONS="dpi:"+o;break;case im:i.MAP_RESOLUTION=90*n;break;case nm:case om:i.DPI=90*n;break;default:rt(!1,8)}i.WIDTH=e[0],i.HEIGHT=e[1];var s,a=r.getAxisOrientation();return s=this.v13_&&"ne"==a.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,i.BBOX=s.join(","),em(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||Fy;this.v13_=hn(t,"1.3")>=0},e}(tm),um=lm,hm=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),cm=function(t){function e(e){var n,r=e||{};n=void 0!==r.attributions?r.attributions:['&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var i=void 0!==r.crossOrigin?r.crossOrigin:"anonymous",o=void 0!==r.url?r.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:n,attributionsCollapsible:!1,cacheSize:r.cacheSize,crossOrigin:i,imageSmoothing:r.imageSmoothing,maxZoom:void 0!==r.maxZoom?r.maxZoom:19,opaque:void 0===r.opaque||r.opaque,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileLoadFunction:r.tileLoadFunction,transition:r.transition,url:o,wrapX:r.wrapX,zDirection:r.zDirection})||this}return hm(e,t),e}(Wv),pm=cm,fm=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),dm=function(t){function e(e){var n=this,r=e||{},i=r.params||{},o=!("TRANSPARENT"in i)||i.TRANSPARENT;return(n=t.call(this,{attributions:r.attributions,attributionsCollapsible:r.attributionsCollapsible,cacheSize:r.cacheSize,crossOrigin:r.crossOrigin,imageSmoothing:r.imageSmoothing,opaque:!o,projection:r.projection,reprojectionErrorThreshold:r.reprojectionErrorThreshold,tileClass:r.tileClass,tileGrid:r.tileGrid,tileLoadFunction:r.tileLoadFunction,url:r.url,urls:r.urls,wrapX:void 0===r.wrapX||r.wrapX,transition:r.transition,zDirection:r.zDirection})||this).gutter_=void 0!==r.gutter?r.gutter:0,n.params_=i,n.v13_=!0,n.serverType_=r.serverType,n.hidpi_=void 0===r.hidpi||r.hidpi,n.tmpExtent_=[1/0,1/0,-1/0,-1/0],n.updateV13_(),n.setKey(n.getKeyForParams_()),n}return fm(e,t),e.prototype.getFeatureInfoUrl=function(t,e,n,r){var i=wn(n),o=this.getProjection(),s=this.getTileGrid();s||(s=this.getTileGridForProjection(i));var a=s.getZForResolution(e,this.zDirection),l=s.getTileCoordForCoordAndZ(t,a);if(!(s.getResolutions().length<=l[0])){var u=s.getResolution(l[0]),h=s.getTileCoordExtent(l,this.tmpExtent_),c=ti(s.getTileSize(l[0]),this.tmpSize),p=this.gutter_;0!==p&&(c=Jr(c,p,this.tmpSize),h=Qt(h,u*p,h)),o&&o!==i&&(u=Ay(o,i,t,u),h=function(t,e,n,r){return Oe(t,Rn(e,n),void 0,r)}(h,i,o),t=Pn(t,i,o));var f={SERVICE:"WMS",VERSION:Fy,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};m(f,this.params_,r);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 n={SERVICE:"WMS",VERSION:Fy,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){var r=this.params_.LAYERS;if(!(!Array.isArray(r)||1===r.length))return;n.LAYER=r}if(void 0!==t){var i=this.getProjection()?this.getProjection().getMetersPerUnit():1;n.SCALE=t*i/28e-5}return m(n,e),em(this.urls[0],n)}},e.prototype.getGutter=function(){return this.gutter_},e.prototype.getParams=function(){return this.params_},e.prototype.getRequestUrl_=function(t,e,n,r,i,o){var s=this.urls;if(s){if(o.WIDTH=e[0],o.HEIGHT=e[1],o[this.v13_?"CRS":"SRS"]=i.getCode(),"STYLES"in this.params_||(o.STYLES=""),1!=r)switch(this.serverType_){case rm:var a=90*r+.5|0;"FORMAT_OPTIONS"in o?o.FORMAT_OPTIONS+=";dpi:"+a:o.FORMAT_OPTIONS="dpi:"+a;break;case im:o.MAP_RESOLUTION=90*r;break;case nm:case om:o.DPI=90*r;break;default:rt(!1,52)}var l,u=i.getAxisOrientation(),h=n;if(this.v13_&&"ne"==u.substr(0,2)){var c=void 0;c=n[0],h[0]=n[1],h[1]=c,c=n[2],h[2]=n[3],h[3]=c}if(o.BBOX=h.join(","),1==s.length)l=s[0];else l=s[Ge(ip(t),s.length)];return em(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 n in this.params_)e[t++]=n+"-"+this.params_[n];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||Fy;this.v13_=hn(t,"1.3")>=0},e.prototype.tileUrlFunction=function(t,e,n){var r=this.getTileGrid();if(r||(r=this.getTileGridForProjection(n)),!(r.getResolutions().length<=t[0])){1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);var i=r.getResolution(t[0]),o=r.getTileCoordExtent(t,this.tmpExtent_),s=ti(r.getTileSize(t[0]),this.tmpSize),a=this.gutter_;0!==a&&(s=Jr(s,a,this.tmpSize),o=Qt(o,i*a,o)),1!=e&&(s=$r(s,e,this.tmpSize));var l={SERVICE:"WMS",VERSION:Fy,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return m(l,this.params_),this.getRequestUrl_(t,s,o,e,n,l)}},e}(By),gm=dm;W.unByKey=X;let _m={Control:hu,Zoom:mu,Attribution:du,ScaleLine:Fu,LayerSwitcher:Cp},ym={GeoJSON:jp,KML:_g,MVT:Zg},vm={Group:wl,Tile:Yy,Vector:Pa,VectorTile:ry,WebGLPoints:zv,Heatmap:D_,Image:U_},mm={toLonLat:function(t,e){var n=Pn(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),r=n[0];return(r<-180||r>180)&&(n[0]=Ge(r+180,360)-180),n},fromLonLat:function(t,e){return Pn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}},xm={LineString:Xr,Point:gr,MultiPoint:Hh},wm={Icon:da,Style:to,Text:io,Stroke:Wr,Fill:Gr,Circle:Zi},Sm={OSM:pm,XYZ:Wv,TileWMS:gm,BingMaps:Vv,Vector:qa,VectorTile:by,ImageWMS:um};t.Collection=nt,t.Feature=st,t.Map=Qc,t.Observable=W,t.View=ou,t.control=_m,t.format=ym,t.geom=xm,t.interaction=qc,t.layer=vm,t.proj=mm,t.source=Sm,t.sphere=un,t.style=wm,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ol-custom.js.map