@htmlbricks/hb-map 0.19.4 → 0.19.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function o(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode.removeChild(t)}function h(t){return document.createElement(t)}function u(){return t=" ",document.createTextNode(t);var t}function c(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function p(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function f(t,e,n,i){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function d(t){const e={};for(const n of t)e[n.name]=n.value;return e}let g;function _(t){g=t}function y(){if(!g)throw new Error("Function called outside component initialization");return g}function v(){const t=y();return(e,n,{cancelable:i=!1}={})=>{const o=t.$$.callbacks[e];if(o){const r=function(t,e,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,n,i,e),o}(e,n,{cancelable:i});return o.slice().forEach((e=>{e.call(t,r)})),!r.defaultPrevented}return!0}}const m=[],x=[],w=[],C=[],S=Promise.resolve();let b=!1;function E(t){w.push(t)}const T=new Set;let O=0;function R(){const t=g;do{for(;O<m.length;){const t=m[O];O++,_(t),I(t.$$)}for(_(null),m.length=0,O=0;x.length;)x.pop()();for(let t=0;t<w.length;t+=1){const e=w[t];T.has(e)||(T.add(e),e())}w.length=0}while(m.length);for(;C.length;)C.pop()();b=!1,T.clear(),_(t)}function I(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(E)}}const P=new Set;function M(t,e){-1===t.$$.dirty[0]&&(m.push(t),b||(b=!0,S.then(R)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function L(r,s,a,h,u,c,p,f=[-1]){const d=g;_(r);const y=r.$$={fragment:null,ctx:null,props:c,update:t,not_equal:u,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(d?d.$$.context:[])),callbacks:n(),dirty:f,skip_bound:!1,root:s.target||d.$$.root};p&&p(y.root);let v=!1;if(y.ctx=a?a(r,s.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return y.ctx&&u(y.ctx[t],y.ctx[t]=i)&&(!y.skip_bound&&y.bound[t]&&y.bound[t](i),v&&M(r,t)),e})):[],y.update(),v=!0,i(y.before_update),y.fragment=!!h&&h(y.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);y.fragment&&y.fragment.l(t),t.forEach(l)}else y.fragment&&y.fragment.c();s.intro&&((m=r.$$.fragment)&&m.i&&(P.delete(m),m.i(x))),function(t,n,r,s){const{fragment:a,on_mount:l,on_destroy:h,after_update:u}=t.$$;a&&a.m(n,r),s||E((()=>{const n=l.map(e).filter(o);h?h.push(...n):i(n),t.$$.on_mount=[]})),u.forEach(E)}(r,s.target,s.anchor,s.customElement),R()}var m,x;_(d)}let F;function A(){return function(){throw new Error("Unimplemented abstract method.")}()}"function"==typeof HTMLElement&&(F=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var k=0;function D(t){return t.ol_uid||(t.ol_uid=String(++k))}var j,z=(j=function(t,e){return j=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])},j(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}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),G=function(t){function e(e){var n=this,i="Assertion failed. See https://openlayers.org/en/"+("v"+"6.14.1".split("-")[0])+"/doc/errors/#"+e+" for details.";return(n=t.call(this,i)||this).code=e,n.name="AssertionError",n.message=i,n}return z(e,t),e}(Error),W=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}(),N="propertychange",X=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function Y(t,e){return t>e?1:t<e?-1:0}function K(t,e,n){var i=t.length;if(t[0]<=e)return 0;if(e<=t[i-1])return i-1;var o=void 0;if(n>0){for(o=1;o<i;++o)if(t[o]<e)return o-1}else if(n<0){for(o=1;o<i;++o)if(t[o]<=e)return o}else for(o=1;o<i;++o){if(t[o]==e)return o;if(t[o]<e)return"function"==typeof n?n(e,t[o-1],t[o])>0?o-1:o:t[o-1]-e<e-t[o]?o-1:o}return i-1}function B(t,e,n){for(;e<n;){var i=t[e];t[e]=t[n],t[n]=i,++e,--n}}function Z(t,e){for(var n=Array.isArray(e)?e:[e],i=n.length,o=0;o<i;o++)t[t.length]=n[o]}function V(t,e){var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function U(){return!0}function H(){return!1}function q(){}var $="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),i=1,o=arguments.length;i<o;++i){var r=arguments[i];if(null!=r)for(var s in r)r.hasOwnProperty(s)&&(n[s]=r[s])}return n};function J(t){for(var e in t)delete t[e]}var Q="function"==typeof Object.values?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e};function tt(t){var e;for(e in t)return!1;return!e}var et=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),nt=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 et(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),i=n[t]||(n[t]=[]);-1===i.indexOf(e)&&i.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t,n=e?t:t.type,i=this.listeners_&&this.listeners_[n];if(i){var o=e?new W(t):t;o.target||(o.target=this.eventTarget_||this);var r,s=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in s||(s[n]=0,a[n]=0),++s[n];for(var l=0,h=i.length;l<h;++l)if(!1===(r="handleEvent"in i[l]?i[l].handleEvent(o):i[l].call(this,o))||o.propagationStopped){r=!1;break}if(0==--s[n]){var u=a[n];for(delete a[n];u--;)this.removeEventListener(n,q);delete s[n]}return r}},e.prototype.disposeInternal=function(){this.listeners_&&J(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 i=n.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[i]=q,++this.pendingRemovals_[t]):(n.splice(i,1),0===n.length&&delete this.listeners_[t]))}},e}(X),it="change",ot="error",rt="contextmenu",st="click",at="dblclick",lt="keydown",ht="keypress",ut="load",ct="resize",pt="touchmove",ft="wheel";function dt(t,e,n,i,o){if(i&&i!==t&&(n=n.bind(i)),o){var r=n;n=function(){t.removeEventListener(e,n),r.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function gt(t,e,n,i){return dt(t,e,n,i,!0)}function _t(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),J(t))}var yt=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vt=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 yt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(it)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,i=new Array(n),o=0;o<n;++o)i[o]=dt(this,t[o],e);return i}return dt(this,t,e)},e.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var i=t.length;n=new Array(i);for(var o=0;o<i;++o)n[o]=gt(this,t[o],e)}else n=gt(this,t,e);return e.ol_key=n,n},e.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)!function(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)_t(t[e]);else _t(t)}(n);else if(Array.isArray(t))for(var i=0,o=t.length;i<o;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)},e}(nt);vt.prototype.on,vt.prototype.once,vt.prototype.un;var mt=vt,xt=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),wt=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.key=n,o.oldValue=i,o}return xt(e,t),e}(W),Ct=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,D(n),n.values_=null,void 0!==e&&n.setProperties(e),n}return xt(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_&&$({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var n;n="change:".concat(t),this.hasListener(n)&&this.dispatchEvent(new wt(n,t,e)),n=N,this.hasListener(n)&&this.dispatchEvent(new wt(n,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},e.prototype.set=function(t,e,n){var i=this.values_||(this.values_={});if(n)i[t]=e;else{var o=i[t];i[t]=e,o!==e&&this.notify(t,o)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},e.prototype.applyProperties=function(t){t.values_&&$(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],tt(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(mt),St="add",bt="remove",Et=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Tt="length",Ot=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.element=n,o.index=i,o}return Et(e,t),e}(W),Rt=function(t){function e(e,n){var i=t.call(this)||this;i.on,i.once,i.un;var o=n||{};if(i.unique_=!!o.unique,i.array_=e||[],i.unique_)for(var r=0,s=i.array_.length;r<s;++r)i.assertUnique_(i.array_[r],r);return i.updateLength_(),i}return Et(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,i=e.length;n<i;++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 Ot(St,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,i=e.length;n<i;++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 Ot(bt,e,t)),e},e.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Ot(bt,i,t)),this.dispatchEvent(new Ot(St,e,t))}else{for(var o=n;o<t;++o)this.insertAt(o,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,i=this.array_.length;n<i;++n)if(this.array_[n]===t&&n!==e)throw new G(58)},e}(Ct);function It(t,e){if(!t)throw new G(e)}var Pt=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Mt=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 i=e;n.setGeometry(i)}else{var o=e;n.setProperties(o)}return n}return Pt(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 i=this.getStyle();return i&&t.setStyle(i),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_&&(_t(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=dt(t,it,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:(It("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}(Ct);var Lt=Mt,Ft="XY",At="XYZ",kt="XYM",Dt="XYZM",jt="Point",zt="LineString",Gt="LinearRing",Wt="Polygon",Nt="MultiPoint",Xt="MultiLineString",Yt="MultiPolygon",Kt="GeometryCollection",Bt="Circle",Zt={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Vt={};Vt[Zt.RADIANS]=6370997/(2*Math.PI),Vt[Zt.DEGREES]=2*Math.PI*6370997/360,Vt[Zt.FEET]=.3048,Vt[Zt.METERS]=1,Vt[Zt.USFEET]=1200/3937;var Ut=Zt,Ht="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",qt=-1!==Ht.indexOf("firefox");-1!==Ht.indexOf("safari")&&-1==Ht.indexOf("chrom")&&(Ht.indexOf("version/15.4")>=0||Ht.match(/cpu (os|iphone os) 15_4 like mac os x/));var $t,Jt=-1!==Ht.indexOf("webkit")&&-1==Ht.indexOf("edge"),Qt=-1!==Ht.indexOf("macintosh"),te="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ee="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,ne="undefined"!=typeof Image&&Image.prototype.decode,ie=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}();function oe(t,e){var n=e[0],i=e[1];return e[0]=t[0]*n+t[2]*i+t[4],e[1]=t[1]*n+t[3]*i+t[5],e}function re(t,e,n,i,o,r,s,a){var l=Math.sin(r),h=Math.cos(r);return t[0]=i*h,t[1]=o*l,t[2]=-i*l,t[3]=o*h,t[4]=s*i*h-a*i*l+e,t[5]=s*o*l+a*o*h+n,t}function se(t,e){var n,i=(n=e)[0]*n[3]-n[1]*n[2];It(0!==i,32);var o=e[0],r=e[1],s=e[2],a=e[3],l=e[4],h=e[5];return t[0]=a/i,t[1]=-r/i,t[2]=-s/i,t[3]=o/i,t[4]=(s*h-a*l)/i,t[5]=-(o*h-r*l)/i,t}function ae(t){var e="matrix("+t.join(", ")+")";if(ee)return e;var n=$t||($t=document.createElement("div"));return n.style.transform=e,n.style.transform}new Array(6);var le="bottom-left",he="bottom-right",ue="top-left",ce="top-right",pe=0,fe=1,de=2,ge=4,_e=8,ye=16;function ve(t){for(var e=Te(),n=0,i=t.length;n<i;++n)Me(e,t[n]);return e}function me(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 xe(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function we(t,e,n){var i,o;return(i=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*i+(o=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*o}function Ce(t,e){return be(t,e[0],e[1])}function Se(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function be(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function Ee(t,e){var n=t[0],i=t[1],o=t[2],r=t[3],s=e[0],a=e[1],l=pe;return s<n?l|=ye:s>o&&(l|=ge),a<i?l|=_e:a>r&&(l|=de),l===pe&&(l=fe),l}function Te(){return[1/0,1/0,-1/0,-1/0]}function Oe(t,e,n,i,o){return o?(o[0]=t,o[1]=e,o[2]=n,o[3]=i,o):[t,e,n,i]}function Re(t){return Oe(1/0,1/0,-1/0,-1/0,t)}function Ie(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Pe(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 Me(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 Le(t,e,n,i,o){for(;n<i;n+=o)Fe(t,e[n],e[n+1]);return t}function Fe(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 Ae(t,e){var n;return(n=e(De(t)))||(n=e(je(t)))||(n=e(Ke(t)))?n:(n=e(Ye(t)))||!1}function ke(t){var e=0;return Ve(t)||(e=Be(t)*Ne(t)),e}function De(t){return[t[0],t[1]]}function je(t){return[t[2],t[1]]}function ze(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Ge(t,e){var n;return e===le?n=De(t):e===he?n=je(t):e===ue?n=Ye(t):e===ce?n=Ke(t):It(!1,13),n}function We(t,e,n,i,o){var r=e*i[0]/2,s=e*i[1]/2,a=Math.cos(n),l=Math.sin(n),h=r*a,u=r*l,c=s*a,p=s*l,f=t[0],d=t[1],g=f-h+p,_=f-h-p,y=f+h-p,v=f+h+p,m=d-u-c,x=d-u+c,w=d+u+c,C=d+u-c;return Oe(Math.min(g,_,y,v),Math.min(m,x,w,C),Math.max(g,_,y,v),Math.max(m,x,w,C),o)}function Ne(t){return t[3]-t[1]}function Xe(t,e,n){var i=n||[1/0,1/0,-1/0,-1/0];return Ze(t,e)?(t[0]>e[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]<e[2]?i[2]=t[2]:i[2]=e[2],t[3]<e[3]?i[3]=t[3]:i[3]=e[3]):Re(i),i}function Ye(t){return[t[0],t[3]]}function Ke(t){return[t[2],t[3]]}function Be(t){return t[2]-t[0]}function Ze(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Ve(t){return t[2]<t[0]||t[3]<t[1]}var Ue=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_||Vt[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 He(t,e,n){return Math.min(Math.max(t,e),n)}var qe="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},$e="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function Je(t,e,n,i,o,r){var s=o-n,a=r-i;if(0!==s||0!==a){var l=((t-n)*s+(e-i)*a)/(s*s+a*a);l>1?(n=o,i=r):l>0&&(n+=s*l,i+=a*l)}return Qe(t,e,n,i)}function Qe(t,e,n,i){var o=n-t,r=i-e;return o*o+r*r}function tn(t){return t*Math.PI/180}function en(t,e){var n=t%e;return n*e<0?n+e:n}function nn(t,e,n){return t+n*(e-t)}function on(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function rn(t,e){return Math.floor(on(t,e))}function sn(t,e){return Math.ceil(on(t,e))}var an=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ln=6378137,hn=Math.PI*ln,un=[-hn,-hn,hn,hn],cn=[-180,-85,180,85],pn=ln*Math.log(Math.tan(Math.PI/2)),fn=function(t){function e(e){return t.call(this,{code:e,units:Ut.METERS,extent:un,global:!0,worldExtent:cn,getPointResolution:function(t,e){return t/qe(e[1]/ln)}})||this}return an(e,t),e}(Ue),dn=[new fn("EPSG:3857"),new fn("EPSG:102100"),new fn("EPSG:102113"),new fn("EPSG:900913"),new fn("http://www.opengis.net/def/crs/EPSG/0/3857"),new fn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function gn(t,e,n){var i=t.length,o=n>1?n:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(i));for(var s=0;s<i;s+=o){r[s]=hn*t[s]/180;var a=ln*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>pn?a=pn:a<-pn&&(a=-pn),r[s+1]=a}return r}function _n(t,e,n){var i=t.length,o=n>1?n:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(i));for(var s=0;s<i;s+=o)r[s]=180*t[s]/hn,r[s+1]=360*Math.atan(Math.exp(t[s+1]/ln))/Math.PI-90;return r}var yn=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vn=[-180,-90,180,90],mn=6378137*Math.PI/180,xn=function(t){function e(e,n){return t.call(this,{code:e,units:Ut.DEGREES,extent:vn,axisOrientation:n,global:!0,metersPerUnit:mn,worldExtent:vn})||this}return yn(e,t),e}(Ue),wn=[new xn("CRS:84"),new xn("EPSG:4326","neu"),new xn("urn:ogc:def:crs:OGC:1.3:CRS84"),new xn("urn:ogc:def:crs:OGC:2:84"),new xn("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new xn("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new xn("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Cn={};var Sn={};function bn(t,e,n){var i=t.getCode(),o=e.getCode();i in Sn||(Sn[i]={}),Sn[i][o]=n}function En(t,e){for(var n=!0,i=t.length-1;i>=0;--i)if(t[i]!=e[i]){n=!1;break}return n}function Tn(t,e){var n=Math.cos(e),i=Math.sin(e),o=t[0]*n-t[1]*i,r=t[1]*n+t[0]*i;return t[0]=o,t[1]=r,t}function On(t,e){if(e.canWrapX()){var n=Be(e.getExtent()),i=function(t,e,n){var i=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){var r=n||Be(i);o=Math.floor((t[0]-i[0])/r)}return o}(t,e,n);i&&(t[0]-=i*n)}return t}function Rn(t,e,n){var i=n||6371008.8,o=tn(t[1]),r=tn(e[1]),s=(r-o)/2,a=tn(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(o)*Math.cos(r);return 2*i*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var In=!0;function Pn(t){In=!(void 0===t||t)}function Mn(t,e,n){var i;if(void 0!==e){for(var o=0,r=t.length;o<r;++o)e[o]=t[o];i=e}else i=t.slice();return i}function Ln(t,e,n){if(void 0!==e&&t!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];t=e}return t}function Fn(t){!function(t,e){Cn[t]=e}(t.getCode(),t),bn(t,t,Mn)}function An(t){return"string"==typeof t?Cn[e=t]||Cn[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function kn(t,e,n,i){var o,r=(t=An(t)).getPointResolutionFunc();if(r){if(o=r(e,n),i&&i!==t.getUnits())(a=t.getMetersPerUnit())&&(o=o*a/Vt[i])}else{var s=t.getUnits();if(s==Ut.DEGREES&&!i||i==Ut.DEGREES)o=e;else{var a,l=Wn(t,An("EPSG:4326"));if(l===Ln&&s!==Ut.DEGREES)o=e*t.getMetersPerUnit();else{var h=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];o=(Rn((h=l(h,h,2)).slice(0,2),h.slice(2,4))+Rn(h.slice(4,6),h.slice(6,8)))/2}void 0!==(a=i?Vt[i]:t.getMetersPerUnit())&&(o/=a)}}return o}function Dn(t){!function(t){t.forEach(Fn)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&bn(e,t,Mn)}))}))}function jn(t,e){return t?"string"==typeof t?An(t):t:An(e)}function zn(t,e){return Pn(),Xn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function Gn(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||Wn(t,e)===Mn)&&n}function Wn(t,e){var n=function(t,e){var n;return t in Sn&&e in Sn[t]&&(n=Sn[t][e]),n}(t.getCode(),e.getCode());return n||(n=Ln),n}function Nn(t,e){return Wn(An(t),An(e))}function Xn(t,e,n){return Nn(e,n)(t,void 0,t.length)}var Yn,Kn,Bn;function Zn(t,e){return t}function Vn(t,e){return In&&!En(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(In=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Un(t,e){return t}function Hn(t,e){return t}function qn(t,e,n,i,o,r){for(var s=r||[],a=0,l=e;l<n;l+=i){var h=t[l],u=t[l+1];s[a++]=o[0]*h+o[2]*u+o[4],s[a++]=o[1]*h+o[3]*u+o[5]}return r&&s.length!=a&&(s.length=a),s}function $n(t,e,n,i,o,r,s){for(var a=s||[],l=Math.cos(o),h=Math.sin(o),u=r[0],c=r[1],p=0,f=e;f<n;f+=i){var d=t[f]-u,g=t[f+1]-c;a[p++]=u+d*l-g*h,a[p++]=c+d*h+g*l;for(var _=f+2;_<f+i;++_)a[p++]=t[_]}return s&&a.length!=p&&(a.length=p),a}Dn(dn),Dn(wn),Yn=dn,Kn=gn,Bn=_n,wn.forEach((function(t){Yn.forEach((function(e){bn(t,e,Kn),bn(e,t,Bn)}))}));var Jn=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qn=[1,0,0,1,0,0],ti=function(t){function e(){var e,n,i,o,r,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 i=this.clone();return i.applyTransform(n),i.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===o&&V(t,i)||(r=!0,o=this,i=t,n=e.apply(this,arguments)),n}),s}return Jn(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return A()},e.prototype.closestPointXY=function(t,e,n,i){return A()},e.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},e.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return A()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Re(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)},e.prototype.rotate=function(t,e){A()},e.prototype.scale=function(t,e,n){A()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return A()},e.prototype.getType=function(){return A()},e.prototype.applyTransform=function(t){A()},e.prototype.intersectsExtent=function(t){return A()},e.prototype.translate=function(t,e){A()},e.prototype.transform=function(t,e){var n=An(t),i=n.getUnits()==Ut.TILE_PIXELS?function(t,i,o){var r=n.getExtent(),s=n.getWorldExtent(),a=Ne(s)/Ne(r);return re(Qn,s[0],s[3],a,-a,0,0,0),qn(t,0,t.length,o,Qn,i),Nn(n,e)(t,i,o)}:Nn(n,e);return this.applyTransform(i),this},e}(Ct),ei=ti,ni=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ii=function(t){function e(){var e=t.call(this)||this;return e.layout=Ft,e.stride=2,e.flatCoordinates=null,e}return ni(e,t),e.prototype.computeExtent=function(t){return e=this.flatCoordinates,n=0,i=this.flatCoordinates.length,o=this.stride,Le(Re(t),e,n,i,o);var e,n,i,o},e.prototype.getCoordinates=function(){return A()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},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;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=oi(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){A()},e.prototype.setLayout=function(t,e,n){var i;if(t)i=oi(t);else{for(var o=0;o<n;++o){if(0===e.length)return this.layout=Ft,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Ft:3==t?e=At:4==t&&(e=Dt);return e}(i=e.length)}this.layout=t,this.stride=i},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var i=this.getStride();$n(n,0,n.length,i,t,e,n),this.changed()}},e.prototype.scale=function(t,e,n){var i=e;void 0===i&&(i=t);var o=n;o||(o=ze(this.getExtent()));var r=this.getFlatCoordinates();if(r){var s=this.getStride();!function(t,e,n,i,o,r,s,a){for(var l=a||[],h=s[0],u=s[1],c=0,p=e;p<n;p+=i){var f=t[p]-h,d=t[p+1]-u;l[c++]=h+o*f,l[c++]=u+r*d;for(var g=p+2;g<p+i;++g)l[c++]=t[g]}a&&l.length!=c&&(l.length=c)}(r,0,r.length,s,t,i,o,r),this.changed()}},e.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var i=this.getStride();!function(t,e,n,i,o,r,s){for(var a=s||[],l=0,h=e;h<n;h+=i){a[l++]=t[h]+o,a[l++]=t[h+1]+r;for(var u=h+2;u<h+i;++u)a[l++]=t[u]}s&&a.length!=l&&(a.length=l)}(n,0,n.length,i,t,e,n),this.changed()}},e}(ei);function oi(t){var e;return t==Ft?e=2:t==At||t==kt?e=3:t==Dt&&(e=4),e}var ri=ii;function si(t,e,n,i,o,r,s){var a,l=t[e],h=t[e+1],u=t[n]-l,c=t[n+1]-h;if(0===u&&0===c)a=e;else{var p=((o-l)*u+(r-h)*c)/(u*u+c*c);if(p>1)a=n;else{if(p>0){for(var f=0;f<i;++f)s[f]=nn(t[e+f],t[n+f],p);return void(s.length=i)}a=e}}for(f=0;f<i;++f)s[f]=t[a+f];s.length=i}function ai(t,e,n,i,o){var r=t[e],s=t[e+1];for(e+=i;e<n;e+=i){var a=t[e],l=t[e+1],h=Qe(r,s,a,l);h>o&&(o=h),r=a,s=l}return o}function li(t,e,n,i,o,r,s,a,l,h,u){if(e==n)return h;var c,p;if(0===o){if((p=Qe(s,a,t[e],t[e+1]))<h){for(c=0;c<i;++c)l[c]=t[e+c];return l.length=i,p}return h}for(var f=u||[NaN,NaN],d=e+i;d<n;)if(si(t,d-i,d,i,s,a,f),(p=Qe(s,a,f[0],f[1]))<h){for(h=p,c=0;c<i;++c)l[c]=f[c];l.length=i,d+=i}else d+=i*Math.max((Math.sqrt(p)-Math.sqrt(h))/o|0,1);if(r&&(si(t,n-i,e,i,s,a,f),(p=Qe(s,a,f[0],f[1]))<h)){for(h=p,c=0;c<i;++c)l[c]=f[c];l.length=i}return h}function hi(t,e,n,i){for(var o=0,r=n.length;o<r;++o)for(var s=n[o],a=0;a<i;++a)t[e++]=s[a];return e}function ui(t,e){return e*Math.round(t/e)}function ci(t,e,n,i,o,r,s){if(e==n)return s;var a,l,h=ui(t[e],o),u=ui(t[e+1],o);e+=i,r[s++]=h,r[s++]=u;do{if(a=ui(t[e],o),l=ui(t[e+1],o),(e+=i)==n)return r[s++]=a,r[s++]=l,s}while(a==h&&l==u);for(;e<n;){var c=ui(t[e],o),p=ui(t[e+1],o);if(e+=i,c!=a||p!=l){var f=a-h,d=l-u,g=c-h,_=p-u;f*_==d*g&&(f<0&&g<f||f==g||f>0&&g>f)&&(d<0&&_<d||d==_||d>0&&_>d)?(a=c,l=p):(r[s++]=a,r[s++]=l,h=a,u=l,a=c,l=p)}}return r[s++]=a,r[s++]=l,s}function pi(t,e,n,i,o){for(var r=void 0!==o?o:[],s=0,a=e;a<n;a+=i)r[s++]=t.slice(a,a+i);return r.length=s,r}function fi(t,e,n,i,o){for(var r=void 0!==o?o:[],s=0,a=0,l=n.length;a<l;++a){var h=n[a];r[s++]=pi(t,e,h,i,r[s]),e=h}return r.length=s,r}function di(t,e,n,i,o){for(var r=void 0!==o?o:[],s=0,a=0,l=n.length;a<l;++a){var h=n[a];r[s++]=fi(t,e,h,i,r[s]),e=h[h.length-1]}return r.length=s,r}function gi(t,e,n,i){for(var o=0,r=t[n-i],s=t[n-i+1];e<n;e+=i){var a=t[e],l=t[e+1];o+=s*a-r*l,r=a,s=l}return o/2}var _i=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),yi=function(t){function e(e,n){var i=t.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?i.setCoordinates(e,n):i.setFlatCoordinates(n,e),i}return _i(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,i){return i<we(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ai(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),li(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.getArea=function(){return gi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return pi(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=function(t,e,n,i,o,r,s){var a=(n-e)/i;if(a<3){for(;e<n;e+=i)r[s++]=t[e],r[s++]=t[e+1];return s}var l=new Array(a);l[0]=1,l[a-1]=1;for(var h=[e,n-i],u=0;h.length>0;){for(var c=h.pop(),p=h.pop(),f=0,d=t[p],g=t[p+1],_=t[c],y=t[c+1],v=p+i;v<c;v+=i){var m=Je(t[v],t[v+1],d,g,_,y);m>f&&(u=v,f=m)}f>o&&(l[(u-e)/i]=1,p+i<u&&h.push(p,u),u+i<c&&h.push(u,c))}for(v=0;v<a;++v)l[v]&&(r[s++]=t[e+v*i],r[s++]=t[e+v*i+1]);return s}(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,Ft)},e.prototype.getType=function(){return Gt},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=hi(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ri),vi=yi,mi=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),xi=function(t){function e(e,n){var i=t.call(this)||this;return i.setCoordinates(e,n),i}return mi(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,i){var o=this.flatCoordinates,r=Qe(t,e,o[0],o[1]);if(r<i){for(var s=this.stride,a=0;a<s;++a)n[a]=o[a];return n.length=s,r}return i},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return e=this.flatCoordinates,n=t,i=e[0],o=e[1],Oe(i,o,i,o,n);var e,n,i,o},e.prototype.getType=function(){return jt},e.prototype.intersectsExtent=function(t){return be(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=function(t,e,n,i){for(var o=0,r=n.length;o<r;++o)t[e++]=n[o];return e}(this.flatCoordinates,0,t,this.stride),this.changed()},e}(ri),wi=xi;function Ci(t,e,n,i,o){return!Ae(o,(function(o){return!Si(t,e,n,i,o[0],o[1])}))}function Si(t,e,n,i,o,r){for(var s=0,a=t[n-i],l=t[n-i+1];e<n;e+=i){var h=t[e],u=t[e+1];l<=r?u>r&&(h-a)*(r-l)-(o-a)*(u-l)>0&&s++:u<=r&&(h-a)*(r-l)-(o-a)*(u-l)<0&&s--,a=h,l=u}return 0!==s}function bi(t,e,n,i,o,r){if(0===n.length)return!1;if(!Si(t,e,n[0],i,o,r))return!1;for(var s=1,a=n.length;s<a;++s)if(Si(t,n[s-1],n[s],i,o,r))return!1;return!0}function Ei(t,e,n,i,o){var r=Le([1/0,1/0,-1/0,-1/0],t,e,n,i);return!!Ze(o,r)&&(!!Se(o,r)||(r[0]>=o[0]&&r[2]<=o[2]||(r[1]>=o[1]&&r[3]<=o[3]||function(t,e,n,i,o){var r;for(e+=i;e<n;e+=i)if(r=o(t.slice(e-i,e),t.slice(e,e+i)))return r;return!1}(t,e,n,i,(function(t,e){return function(t,e,n){var i=!1,o=Ee(t,e),r=Ee(t,n);if(o===fe||r===fe)i=!0;else{var s=t[0],a=t[1],l=t[2],h=t[3],u=e[0],c=e[1],p=n[0],f=n[1],d=(f-c)/(p-u),g=void 0,_=void 0;r&de&&!(o&de)&&(i=(g=p-(f-h)/d)>=s&&g<=l),i||!(r&ge)||o&ge||(i=(_=f-(p-l)*d)>=a&&_<=h),i||!(r&_e)||o&_e||(i=(g=p-(f-a)/d)>=s&&g<=l),i||!(r&ye)||o&ye||(i=(_=f-(p-s)*d)>=a&&_<=h)}return i}(o,t,e)})))))}function Ti(t,e,n,i,o){if(!function(t,e,n,i,o){return!!(Ei(t,e,n,i,o)||Si(t,e,n,i,o[0],o[1])||Si(t,e,n,i,o[0],o[3])||Si(t,e,n,i,o[2],o[1])||Si(t,e,n,i,o[2],o[3]))}(t,e,n[0],i,o))return!1;if(1===n.length)return!0;for(var r=1,s=n.length;r<s;++r)if(Ci(t,n[r-1],n[r],i,o)&&!Ei(t,n[r-1],n[r],i,o))return!1;return!0}function Oi(t,e,n,i){for(;e<n-i;){for(var o=0;o<i;++o){var r=t[e+o];t[e+o]=t[n-i+o],t[n-i+o]=r}e+=i,n-=i}}function Ri(t,e,n,i){for(var o=0,r=t[n-i],s=t[n-i+1];e<n;e+=i){var a=t[e],l=t[e+1];o+=(a-r)*(l+s),r=a,s=l}return 0===o?void 0:o>0}function Ii(t,e,n,i,o){for(var r=void 0!==o&&o,s=0,a=n.length;s<a;++s){var l=n[s],h=Ri(t,e,l,i);(0===s?r&&h||!r&&!h:r&&!h||!r&&h)&&Oi(t,e,l,i),e=l}return e}var Pi=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Mi=function(t){function e(e,n,i){var o=t.call(this)||this;return o.ends_=[],o.flatInteriorPointRevision_=-1,o.flatInteriorPoint_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,void 0!==n&&i?(o.setFlatCoordinates(n,e),o.ends_=i):o.setCoordinates(e,n),o}return Pi(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?Z(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,i){return i<we(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,i,o){for(var r=0,s=n.length;r<s;++r){var a=n[r];o=ai(t,e,a,i,o),e=a}return o}(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,i,o,r,s,a,l,h,u){for(var c=u||[NaN,NaN],p=0,f=n.length;p<f;++p){var d=n[p];h=li(t,e,d,i,o,r,s,a,l,h,c),e=d}return h}(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.containsXY=function(t,e){return bi(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,n,i){for(var o=0,r=0,s=n.length;r<s;++r){var a=n[r];o+=gi(t,e,a,i),e=a}return o}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?Ii(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,fi(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=ze(this.getExtent());this.flatInteriorPoint_=function(t,e,n,i,o,r,s){for(var a,l,h,u,c,p,f,d=o[r+1],g=[],_=0,y=n.length;_<y;++_){var v=n[_];for(u=t[v-i],p=t[v-i+1],a=e;a<v;a+=i)c=t[a],f=t[a+1],(d<=p&&f<=d||p<=d&&d<=f)&&(h=(d-p)/(f-p)*(c-u)+u,g.push(h)),u=c,p=f}var m=NaN,x=-1/0;for(g.sort(Y),u=g[0],a=1,l=g.length;a<l;++a){c=g[a];var w=Math.abs(c-u);w>x&&bi(t,e,n,i,h=(u+c)/2,d)&&(m=h,x=w),u=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,d,x),s):[m,d,x]}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new wi(this.getFlatInteriorPoint(),kt)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new vi(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_,i=[],o=0,r=0,s=n.length;r<s;++r){var a=n[r],l=new vi(e.slice(o,a),t);i.push(l),o=a}return i},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,i,o){for(var r=void 0!==o&&o,s=0,a=n.length;s<a;++s){var l=n[s],h=Ri(t,e,l,i);if(0===s){if(r&&h||!r&&!h)return!1}else if(r&&!h||!r&&h)return!1;e=l}return!0}(t,0,this.ends_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Ii(this.orientedFlatCoordinates_,0,this.ends_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],i=[];return n.length=function(t,e,n,i,o,r,s,a){for(var l=0,h=n.length;l<h;++l){var u=n[l];s=ci(t,e,u,i,o,r,s),a.push(s),e=u}return s}(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,i),new e(n,Ft,i)},e.prototype.getType=function(){return Wt},e.prototype.intersectsExtent=function(t){return Ti(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=function(t,e,n,i,o){for(var r=o||[],s=0,a=0,l=n.length;a<l;++a){var h=hi(t,e,n[a],i);r[s++]=h,e=h}return r.length=s,r}(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(ri);function Li(t){var e=t[0],n=t[1],i=t[2],o=t[3],r=[e,n,e,o,i,o,i,n,e,n];return new Mi(r,Ft,[r.length])}var Fi="prerender",Ai="postrender",ki="precompose",Di="postcompose",ji="rendercomplete",zi=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 Gi(t,e,n,i){for(var o=t[e],r=t[e+1],s=0,a=e+i;a<n;a+=i){var l=t[a],h=t[a+1];s+=Math.sqrt((l-o)*(l-o)+(h-r)*(h-r)),o=l,r=h}return s}var Wi=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}(),Ni=0,Xi=1,Yi=2,Ki=3;function Bi(t){return t[0]>0&&t[1]>0}function Zi(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var Vi=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Zi(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 A()},t.prototype.getImage=function(t){return A()},t.prototype.getHitDetectionImage=function(){return A()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return A()},t.prototype.getImageSize=function(){return A()},t.prototype.getOrigin=function(){return A()},t.prototype.getSize=function(){return A()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=Zi(t)},t.prototype.listenImageChange=function(t){A()},t.prototype.load=function(){A()},t.prototype.unlistenImageChange=function(t){A()},t}(),Ui=Vi,Hi=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,qi=/^([a-z]*)$|^hsla?\(.*\)$/i;function $i(t){return"string"==typeof t?t:eo(t)}var Ji=function(){var t={},e=0;return function(n){var i;if(t.hasOwnProperty(n))i=t[n];else{if(e>=1024){var o=0;for(var r in t)0==(3&o++)&&(delete t[r],--e)}i=function(t){var e,n,i,o,r;qi.exec(t)&&(t=function(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""}(t));if(Hi.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),i=parseInt(t.substr(1+2*a,a),16),o=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,l&&(o=(o<<4)+o)),r=[e,n,i,o/255]}else 0==t.indexOf("rgba(")?to(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),to(r)):It(!1,14);return r}(n),t[n]=i,++e}return i}}();function Qi(t){return Array.isArray(t)?t:Ji(t)}function to(t){return t[0]=He(t[0]+.5|0,0,255),t[1]=He(t[1]+.5|0,0,255),t[2]=He(t[2]+.5|0,0,255),t[3]=He(t[3],0,1),t}function eo(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+n+","+i+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function no(t){return Array.isArray(t)?eo(t):t}function io(t,e,n,i){var o;return o=n&&n.length?n.shift():ee?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(o.width=t),e&&(o.height=e),o.getContext("2d",i)}function oo(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10)}function ro(t){var e=t.offsetHeight,n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10)}function so(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function ao(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function lo(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var ho="ol-hidden",uo="ol-control",co="ol-collapsed",po=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"),fo=["style","variant","weight","size","lineHeight","family"],go=function(t){var e=t.match(po);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},i=0,o=fo.length;i<o;++i){var r=e[i+1];void 0!==r&&(n[fo[i]]=r)}return n.families=n.family.split(/,\s?/),n};function _o(t){return 1===t?"":String(Math.round(100*t)/100)}var yo="10px sans-serif",vo="#000",mo="round",xo=[],wo="round",Co="#000",So="center",bo="middle",Eo=[0,0,0,0],To=new Ct;(new nt).setSize=function(){console.warn("labelCache is deprecated.")};var Oo,Ro,Io=null,Po={},Mo=function(){var t,e,n="32px ",i=["monospace","serif"],o=i.length,r="wmytzilWMYTZIL@#/&?$%10";function s(t,s,a){for(var l=!0,h=0;h<o;++h){var u=i[h];if(e=Ao(t+" "+s+" "+n+u,r),a!=u){var c=Ao(t+" "+s+" "+n+a+","+u,r);l=l&&c!=e}}return!!l}function a(){for(var e=!0,n=To.getKeys(),i=0,o=n.length;i<o;++i){var r=n[i];To.get(r)<100&&(s.apply(this,r.split("\n"))?(J(Po),Io=null,Oo=void 0,To.set(r,100)):(To.set(r,To.get(r)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var n=go(e);if(n)for(var i=n.families,o=0,r=i.length;o<r;++o){var l=i[o],h=n.style+"\n"+n.weight+"\n"+l;void 0===To.get(h)&&(To.set(h,100,!0),s(n.style,n.weight,l)||(To.set(h,0,!0),void 0===t&&(t=setInterval(a,32))))}}}(),Lo=function(t){var e=Po[t];if(null==e){if(ee){var n=go(t),i=Fo(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else Ro||((Ro=document.createElement("div")).innerHTML="M",Ro.style.minHeight="0",Ro.style.maxHeight="none",Ro.style.height="auto",Ro.style.padding="0",Ro.style.border="none",Ro.style.position="absolute",Ro.style.display="block",Ro.style.left="-99999px"),Ro.style.font=t,document.body.appendChild(Ro),e=Ro.offsetHeight,document.body.removeChild(Ro);Po[t]=e}return e};function Fo(t,e){return Io||(Io=io(1,1)),t!=Oo&&(Io.font=t,Oo=Io.font),Io.measureText(e)}function Ao(t,e){return Fo(t,e).width}function ko(t,e,n){if(e in n)return n[e];var i=Ao(t,e);return n[e]=i,i}function Do(t,e,n,i,o,r,s,a,l,h,u){t.save(),1!==n&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),i.contextInstructions?(t.translate(l,h),t.scale(u[0],u[1]),function(t,e){for(var n=t.contextInstructions,i=0,o=n.length;i<o;i+=2)Array.isArray(n[i+1])?e[n[i]].apply(e,n[i+1]):e[n[i]]=n[i+1]}(i,t)):u[0]<0||u[1]<0?(t.translate(l,h),t.scale(u[0],u[1]),t.drawImage(i,o,r,s,a,0,0,s,a)):t.drawImage(i,o,r,s,a,l,h,s*u[0],a*u[1]),t.restore()}var jo=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),zo=function(t){function e(e){var n=this,i=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:i,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.size_=null,n.renderOptions_=null,n.render(),n}return jo(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(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_},e.prototype.getImage=function(t){var e=this.canvas_[t];if(!e){var n=this.renderOptions_,i=io(n.size*t,n.size*t);this.draw_(n,i,t),e=i.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 Yi},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 i=this.radius_,o=void 0===this.radius2_?i:this.radius2_;if(i<o){var r=i;i=o,o=r}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,l=o*Math.sin(a),h=i-Math.sqrt(o*o-l*l),u=Math.sqrt(l*l+h*h),c=u/l;if("miter"===t&&c<=n)return c*e;var p=e/2/c,f=e/2*(h/u),d=Math.sqrt((i+p)*(i+p)+f*f)-i;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=i*Math.sin(a),_=o-Math.sqrt(i*i-g*g),y=Math.sqrt(g*g+_*_)/g;if(y<=n){var v=y*e/2-o-i;return 2*Math.max(d,v)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=wo,n=0,i=null,o=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Co),t=no(t),void 0===(r=this.stroke_.getWidth())&&(r=1),i=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=wo),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=this.calculateLineJoinSize_(e,r,n),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*a+s),lineDash:i,lineDashOffset:o,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var i=this.fill_.getColor();null===i&&(i=vo),e.fillStyle=no(i),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=Qi(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var i=io(t.size,t.size);this.hitDetectionCanvas_=i.canvas,this.drawHitDetectionCanvas_(t,i)}}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 i=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var o=this.angle_-Math.PI/2,r=2*Math.PI/e,s=0;s<e;s++){var a=o+s*r,l=s%2==0?n:i;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=vo,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}(Ui),Go=zo,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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),No=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 Wo(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}(Go),Xo=No,Yo=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Zo,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_=Zo,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var Ko=null;function Bo(t,e){if(!Ko){var n=new zi({color:"rgba(255,255,255,0.4)"}),i=new Wi({color:"#3399CC",width:1.25});Ko=[new Yo({image:new Xo({fill:n,stroke:i,radius:5}),fill:n,stroke:i})]}return Ko}function Zo(t){return t.getGeometry()}var Vo=Yo,Uo="line",Ho="opacity",qo="visible",$o="extent",Jo="zIndex",Qo="maxResolution",tr="minResolution",er="maxZoom",nr="minZoom",ir="source",or="map",rr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sr=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.background_=e.background;var i=$({},e);return"object"==typeof e.properties&&(delete i.properties,$(i,e.properties)),i[Ho]=void 0!==e.opacity?e.opacity:1,It("number"==typeof i[Ho],64),i[qo]=void 0===e.visible||e.visible,i[Jo]=e.zIndex,i[Qo]=void 0!==e.maxResolution?e.maxResolution:1/0,i[tr]=void 0!==e.minResolution?e.minResolution:0,i[nr]=void 0!==e.minZoom?e.minZoom:-1/0,i[er]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==i.className?i.className:"ol-layer",delete i.className,n.setProperties(i),n.state_=null,n}return rr(e,t),e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=He(Math.round(100*this.getOpacity())/100,0,1),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},e.prototype.getLayersArray=function(t){return A()},e.prototype.getLayerStatesArray=function(t){return A()},e.prototype.getExtent=function(){return this.get($o)},e.prototype.getMaxResolution=function(){return this.get(Qo)},e.prototype.getMinResolution=function(){return this.get(tr)},e.prototype.getMinZoom=function(){return this.get(nr)},e.prototype.getMaxZoom=function(){return this.get(er)},e.prototype.getOpacity=function(){return this.get(Ho)},e.prototype.getSourceState=function(){return A()},e.prototype.getVisible=function(){return this.get(qo)},e.prototype.getZIndex=function(){return this.get(Jo)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set($o,t)},e.prototype.setMaxResolution=function(t){this.set(Qo,t)},e.prototype.setMinResolution=function(t){this.set(tr,t)},e.prototype.setMaxZoom=function(t){this.set(er,t)},e.prototype.setMinZoom=function(t){this.set(nr,t)},e.prototype.setOpacity=function(t){It("number"==typeof t,64),this.set(Ho,t)},e.prototype.setVisible=function(t){this.set(qo,t)},e.prototype.setZIndex=function(t){this.set(Jo,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(Ct),ar="undefined",lr="ready",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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function ur(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}var cr=function(t){function e(e){var n=this,i=$({},e);delete i.source,(n=t.call(this,i)||this).on,n.once,n.un,n.mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,n.rendered=!1,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addChangeListener(ir,n.handleSourcePropertyChange_);var o=e.source?e.source:null;return n.setSource(o),n}return hr(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(ir)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():ar},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(_t(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=dt(t,it,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.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return this.rendered=!0,n.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(or,t)},e.prototype.getMapInternal=function(){return this.get(or)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(_t(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(_t(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=dt(t,ki,(function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);It(!e.some((function(t){return t.layer===n.layer})),67),e.push(n)}),this),this.mapRenderKey_=dt(this,it,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(ir,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}(sr);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var pr,fr,dr=(pr=function(t,e){t.exports=function(){function t(t,i,o,r,s){!function t(n,i,o,r,s){for(;r>o;){if(r-o>600){var a=r-o+1,l=i-o+1,h=Math.log(a),u=.5*Math.exp(2*h/3),c=.5*Math.sqrt(h*u*(a-u)/a)*(l-a/2<0?-1:1);t(n,i,Math.max(o,Math.floor(i-l*u/a+c)),Math.min(r,Math.floor(i+(a-l)*u/a+c)),s)}var p=n[i],f=o,d=r;for(e(n,o,i),s(n[r],p)>0&&e(n,o,r);f<d;){for(e(n,f,d),f++,d--;s(n[f],p)<0;)f++;for(;s(n[d],p)>0;)d--}0===s(n[o],p)?e(n,o,d):e(n,++d,r),d<=i&&(o=d+1),i<=d&&(r=d-1)}}(t,i,o||0,r||t.length-1,s||n)}function e(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function n(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function r(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,o){o||(o=d(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var r=e;r<n;r++){var s=t.children[r];a(o,t.leaf?i(s):s)}return o}function a(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 l(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function u(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,i,o,r){for(var s=[n,i];s.length;)if(!((i=s.pop())-(n=s.pop())<=o)){var a=n+Math.ceil((i-n)/o/2)*o;t(e,a,n,i,r),s.push(n,a,a,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var i=this.toBBox,o=[];e;){for(var r=0;r<e.children.length;r++){var s=e.children[r],a=e.leaf?i(s):s;f(t,a)&&(e.leaf?n.push(s):p(t,a)?this._all(s,n):o.push(s))}e=o.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var n=[];e;){for(var i=0;i<e.children.length;i++){var o=e.children[i],r=e.leaf?this.toBBox(o):o;if(f(t,r)){if(e.leaf||p(t,r))return!0;n.push(o)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=d([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,i,r,s=this.data,a=this.toBBox(t),l=[],h=[];s||l.length;){if(s||(s=l.pop(),i=l[l.length-1],n=h.pop(),r=!0),s.leaf){var u=o(t,s.children,e);if(-1!==u)return s.children.splice(u,1),l.push(s),this._condense(l),this}r||s.leaf||!p(s,a)?i?(n++,s=i.children[n],r=!1):s=null:(l.push(s),h.push(n),n=0,i=s,s=s.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,i){var o,s=n-e+1,a=this._maxEntries;if(s<=a)return r(o=d(t.slice(e,n+1)),this.toBBox),o;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),(o=d([])).leaf=!1,o.height=i;var l=Math.ceil(s/a),h=l*Math.ceil(Math.sqrt(a));g(t,e,n,h,this.compareMinX);for(var u=e;u<=n;u+=h){var c=Math.min(u+h-1,n);g(t,u,c,l,this.compareMinY);for(var p=u;p<=c;p+=l){var f=Math.min(p+l-1,c);o.children.push(this._build(t,p,f,i-1))}}return r(o,this.toBBox),o},i.prototype._chooseSubtree=function(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){for(var o=1/0,r=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],h=u(l),c=(p=t,f=l,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-h);c<r?(r=c,o=h<o?h:o,s=l):c===r&&h<o&&(o=h,s=l)}e=s||e.children[0]}var p,f;return e},i.prototype._insert=function(t,e,n){var i=n?t:this.toBBox(t),o=[],r=this._chooseSubtree(i,this.data,e,o);for(r.children.push(t),a(r,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},i.prototype._split=function(t,e){var n=t[e],i=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,i);var s=this._chooseSplitIndex(n,o,i),a=d(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,r(n,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},i.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var i,o,r,a,l,h,c,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=s(t,0,d,this.toBBox),_=s(t,d,n,this.toBBox),y=(o=g,r=_,a=void 0,l=void 0,h=void 0,c=void 0,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),h=Math.min(o.maxX,r.maxX),c=Math.min(o.maxY,r.maxY),Math.max(0,h-a)*Math.max(0,c-l)),v=u(g)+u(_);y<p?(p=y,i=d,f=v<f?v:f):y===p&&v<f&&(f=v,i=d)}return i||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var i=t.leaf?this.compareMinX:l,o=t.leaf?this.compareMinY:h;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,o)&&t.children.sort(i)},i.prototype._allDistMargin=function(t,e,n,i){t.children.sort(i);for(var o=this.toBBox,r=s(t,0,e,o),l=s(t,n-e,n,o),h=c(r)+c(l),u=e;u<n-e;u++){var p=t.children[u];a(r,t.leaf?o(p):p),h+=c(r)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];a(l,t.leaf?o(d):d),h+=c(l)}return h},i.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},i}()},pr(fr={exports:{}},fr.exports),fr.exports),gr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_r="renderOrder",yr=function(t){function e(e){var n=this,i=e||{},o=$({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,(n=t.call(this,o)||this).declutter_=void 0!==i.declutter&&i.declutter,n.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(i.style),n.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,n.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,n}return gr(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(_r)},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 dr(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(_r,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Bo,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;Array.isArray(t)?n=t:(It("function"==typeof t.getZIndex,41),n=[t]),e=function(){return n}}return e}(this.style_),this.changed()},e}(cr),vr={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},mr=[vr.FILL],xr=[vr.STROKE],wr=[vr.BEGIN_PATH],Cr=[vr.CLOSE_PATH],Sr=vr,br=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,i){},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}(),Er=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Tr=function(t){function e(e,n,i,o){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=n,r.pixelRatio=o,r.maxLineWidth=0,r.resolution=i,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return Er(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(),i=this.tmpCoordinate_,o=this.coordinates,r=o.length,s=0,a=t.length;s<a;s+=e)i[0]=t[s],i[1]=t[s+1],Ce(n,i)&&(o[r++]=i[0],o[r++]=i[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,n,i,o,r){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();r&&(e+=i);var h,u,c,p=t[e],f=t[e+1],d=this.tmpCoordinate_,g=!0;for(h=e+i;h<n;h+=i)d[0]=t[h],d[1]=t[h+1],(c=Ee(l,d))!==u?(g&&(s[a++]=p,s[a++]=f,g=!1),s[a++]=d[0],s[a++]=d[1]):c===fe?(s[a++]=d[0],s[a++]=d[1],g=!1):g=!0,p=d[0],f=d[1],u=c;return(o&&g||h===e+i)&&(s[a++]=p,s[a++]=f),a},e.prototype.drawCustomCoordinates_=function(t,e,n,i,o){for(var r=0,s=n.length;r<s;++r){var a=n[r],l=this.appendFlatLineCoordinates(t,e,a,i,!1,!1);o.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,n,i){this.beginGeometry(t,e);var o,r,s,a,l,h=t.getType(),u=t.getStride(),c=this.coordinates.length;switch(h){case Yt:o=t.getOrientedFlatCoordinates(),a=[];var p=t.getEndss();l=0;for(var f=0,d=p.length;f<d;++f){var g=[];l=this.drawCustomCoordinates_(o,l,p[f],u,g),a.push(g)}this.instructions.push([Sr.CUSTOM,c,a,t,n,di]),this.hitDetectionInstructions.push([Sr.CUSTOM,c,a,t,i||n,di]);break;case Wt:case Xt:s=[],o=h==Wt?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(o,0,t.getEnds(),u,s),this.instructions.push([Sr.CUSTOM,c,s,t,n,fi]),this.hitDetectionInstructions.push([Sr.CUSTOM,c,s,t,i||n,fi]);break;case zt:case Bt:o=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(o,0,o.length,u,!1,!1),this.instructions.push([Sr.CUSTOM,c,r,t,n,pi]),this.hitDetectionInstructions.push([Sr.CUSTOM,c,r,t,i||n,pi]);break;case Nt:o=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(o,u))>c&&(this.instructions.push([Sr.CUSTOM,c,r,t,n,pi]),this.hitDetectionInstructions.push([Sr.CUSTOM,c,r,t,i||n,pi]));break;case jt:o=t.getFlatCoordinates(),this.coordinates.push(o[0],o[1]),r=this.coordinates.length,this.instructions.push([Sr.CUSTOM,c,r,t,n]),this.hitDetectionInstructions.push([Sr.CUSTOM,c,r,t,i||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Sr.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Sr.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,i,o=e.length,r=-1;for(t=0;t<o;++t)(i=(n=e[t])[0])==Sr.END_GEOMETRY?r=t:i==Sr.BEGIN_GEOMETRY&&(n[2]=t,B(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var i=t.getColor();n.fillStyle=no(i||vo)}else n.fillStyle=void 0;if(e){var o=e.getColor();n.strokeStyle=no(o||Co);var r=e.getLineCap();n.lineCap=void 0!==r?r:mo;var s=e.getLineDash();n.lineDash=s?s.slice():xo;var a=e.getLineDashOffset();n.lineDashOffset=a||0;var l=e.getLineJoin();n.lineJoin=void 0!==l?l:wo;var h=e.getWidth();n.lineWidth=void 0!==h?h:1;var u=e.getMiterLimit();n.miterLimit=void 0!==u?u: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=[Sr.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[Sr.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,i=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||o!=t.currentLineDash&&!V(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=o,t.currentLineDashOffset=r,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=[Sr.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=xe(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;me(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(br),Or=Tr,Rr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ir=function(t){function e(e,n,i,o){var r=t.call(this,e,n,i,o)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterImageWithText_=void 0,r}return Rr(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),i=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(n,i);this.instructions.push([Sr.DRAW_IMAGE,o,r,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([Sr.DRAW_IMAGE,o,r,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(),i=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(n,i);this.instructions.push([Sr.DRAW_IMAGE,o,r,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([Sr.DRAW_IMAGE,o,r,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(),i=t.getSize(),o=t.getHitDetectionImage(),r=t.getImage(this.pixelRatio),s=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=o,this.image_=r,this.height_=i[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_=i[0],this.declutterImageWithText_=e},e}(Or),Pr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Mr=function(t){function e(e,n,i,o){return t.call(this,e,n,i,o)||this}return Pr(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,i){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,n,i,!1,!1),s=[Sr.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,i=n.strokeStyle,o=n.lineWidth;if(void 0!==i&&void 0!==o){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Sr.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,xo,0],wr);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push(xr),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,i=n.strokeStyle,o=n.lineWidth;if(void 0!==i&&void 0!==o){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Sr.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],wr);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;h<u;++h)l=this.drawFlatCoordinates_(s,l,r[h],a);this.hitDetectionInstructions.push(xr),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(xr),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(xr),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(wr)},e}(Or),Lr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fr=function(t){function e(e,n,i,o){return t.call(this,e,n,i,o)||this}return Lr(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,i){var o=this.state,r=void 0!==o.fillStyle,s=void 0!==o.strokeStyle,a=n.length;this.instructions.push(wr),this.hitDetectionInstructions.push(wr);for(var l=0;l<a;++l){var h=n[l],u=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,h,i,!0,!s),p=[Sr.MOVE_TO_LINE_TO,u,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(Cr),this.hitDetectionInstructions.push(Cr)),e=h}return r&&(this.instructions.push(mr),this.hitDetectionInstructions.push(mr)),s&&(this.instructions.push(xr),this.hitDetectionInstructions.push(xr)),e},e.prototype.drawCircle=function(t,e){var n=this.state,i=n.fillStyle,o=n.strokeStyle;if(void 0!==i||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Sr.SET_FILL_STYLE,vo]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Sr.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var r=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,s,!1,!1);var l=[Sr.CIRCLE,a];this.instructions.push(wr,l),this.hitDetectionInstructions.push(wr,l),void 0!==n.fillStyle&&(this.instructions.push(mr),this.hitDetectionInstructions.push(mr)),void 0!==n.strokeStyle&&(this.instructions.push(xr),this.hitDetectionInstructions.push(xr)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,i=n.fillStyle,o=n.strokeStyle;if(void 0!==i||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Sr.SET_FILL_STYLE,vo]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Sr.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var r=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,r,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,i=n.fillStyle,o=n.strokeStyle;if(void 0!==i||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Sr.SET_FILL_STYLE,vo]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Sr.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var r=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,h=0,u=r.length;h<u;++h)l=this.drawFlatCoordinatess_(s,l,r[h],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,i=0,o=n.length;i<o;++i)n[i]=ui(n[i],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}(Or),Ar=Fr;function kr(t,e,n,i,o){var r,s,a,l,h,u,c,p,f,d=n,g=n,_=0,y=0,v=n;for(r=n;r<i;r+=o){var m=e[r],x=e[r+1];void 0!==l&&(p=m-l,f=x-h,a=Math.sqrt(p*p+f*f),void 0!==u&&(y+=s,Math.acos((u*p+c*f)/(s*a))>t&&(y>_&&(_=y,d=v,g=r),y=0,v=r-o)),s=a,u=p,c=f),l=m,h=x}return(y+=a)>_?[v,r]:[d,g]}var Dr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),jr={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},zr=function(t){function e(e,n,i,o){var r=t.call(this,e,n,i,o)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Dr(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_,i=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(n||i)){var r=this.coordinates,s=r.length,a=t.getType(),l=null,h=t.getStride();if(o.placement!==Uo||a!=zt&&a!=Xt&&a!=Wt&&a!=Yt){var u=o.overflow?null:[];switch(a){case jt:case Nt:l=t.getFlatCoordinates();break;case zt:l=t.getFlatMidpoint();break;case Bt:l=t.getCenter();break;case Xt:l=t.getFlatMidpoints(),h=2;break;case Wt:l=t.getFlatInteriorPoint(),o.overflow||u.push(l[2]/this.resolution),h=3;break;case Yt:var c=t.getFlatInteriorPoints();l=[];for(C=0,S=c.length;C<S;C+=3)o.overflow||u.push(c[C+2]/this.resolution),l.push(c[C],c[C+1]);if(0===l.length)return;h=2}if((P=this.appendFlatPointCoordinates(l,h))===s)return;if(u&&(P-s)/2!=l.length/h){var p=s/2;u=u.filter((function(t,e){var n=r[2*(p+e)]===l[e*h]&&r[2*(p+e)+1]===l[e*h+1];return n||--p,n}))}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var f=o.padding;if(f!=Eo&&(o.scale[0]<0||o.scale[1]<0)){var d=o.padding[0],g=o.padding[1],_=o.padding[2],y=o.padding[3];o.scale[0]<0&&(g=-g,y=-y),o.scale[1]<0&&(d=-d,_=-_),f=[d,g,_,y]}var v=this.pixelRatio;this.instructions.push([Sr.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterImageWithText_,f==Eo?Eo:f.map((function(t){return t*v})),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]);var m=1/v;this.hitDetectionInstructions.push([Sr.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,this.declutterImageWithText_,f,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,u]),this.endGeometry(e)}else{if(!Ze(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),a==zt)x=[l.length];else if(a==Xt)x=t.getEnds();else if(a==Wt)x=t.getEnds().slice(0,1);else if(a==Yt){var w=t.getEndss();x=[];for(var C=0,S=w.length;C<S;++C)x.push(w[C][0])}this.beginGeometry(t,e);for(var b=o.textAlign,E=0,T=void 0,O=0,R=x.length;O<R;++O){if(null==b){var I=kr(o.maxAngle,l,E,x[O],h);E=I[0],T=I[1]}else T=x[O];for(var C=E;C<T;C+=h)r.push(l[C],l[C+1]);var P=r.length;E=x[O],this.drawChars_(s,P),s=P}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var o=this.textKey_;o in this.textStates||(this.textStates[o]={font:e.font,textAlign:e.textAlign||So,textBaseline:e.textBaseline||bo,scale:e.scale});var r=this.fillKey_;n&&(r in this.fillStates||(this.fillStates[r]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,i=this.textState_,o=this.strokeKey_,r=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=jr[i.textBaseline],h=this.textOffsetY_*a,u=this.text_,c=n?n.lineWidth*Math.abs(i.scale[0])/2:0;this.instructions.push([Sr.DRAW_CHARS,t,e,l,i.overflow,s,i.maxAngle,a,h,o,c*a,u,r,1]),this.hitDetectionInstructions.push([Sr.DRAW_CHARS,t,e,l,i.overflow,s,i.maxAngle,1,h,o,c,u,r,1/a])},e.prototype.setTextStyle=function(t,e){var n,i,o;if(t){var r=t.getFill();r?((i=this.textFillState_)||(i={},this.textFillState_=i),i.fillStyle=no(r.getColor()||vo)):(i=null,this.textFillState_=i);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var a=s.getLineDash(),l=s.getLineDashOffset(),h=s.getWidth(),u=s.getMiterLimit();o.lineCap=s.getLineCap()||mo,o.lineDash=a?a.slice():xo,o.lineDashOffset=void 0===l?0:l,o.lineJoin=s.getLineJoin()||wo,o.lineWidth=void 0===h?1:h,o.miterLimit=void 0===u?10:u,o.strokeStyle=no(s.getColor()||Co)}else o=null,this.textStrokeState_=o;n=this.textState_;var c=t.getFont()||yo;Mo(c);var p=t.getScaleArray();n.overflow=t.getOverflow(),n.font=c,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.textBaseline=t.getTextBaseline()||bo,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Eo,n.scale=void 0===p?[1,1]:p;var f=t.getOffsetX(),d=t.getOffsetY(),g=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===_?0:_,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:D(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:"|"+D(i.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Or),Gr={Circle:Ar,Default:Or,Image:Ir,LineString:Mr,Polygon:Ar,Text:zr},Wr=function(){function t(t,e,n,i){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,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 i in n){var o=n[i].finish();t[e][i]=o}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",i=this.buildersByZIndex_[n];void 0===i&&(i={},this.buildersByZIndex_[n]=i);var o=i[e];void 0===o&&(o=new(0,Gr[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=o);return o},t}(),Nr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xr=function(t){function e(e){var n=t.call(this)||this;return n.ready=!0,n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return Nr(e,t),e.prototype.getFeatures=function(t){return A()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return A()},e.prototype.renderFrame=function(t,e){return A()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(i,o){var r=this.loadedTileCallback.bind(this,n,i);return t.forEachLoadedTile(e,i,o,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o){},e.prototype.getDataAtPixel=function(t,e,n){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===Yi&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=Yi&&e!=Ki&&t.addEventListener(it,this.boundHandleImageChange_),e==Ni&&(t.load(),e=t.getState()),e==Yi},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==lr&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(mt),Yr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Kr=function(t){function e(e,n,i,o){var r=t.call(this,e)||this;return r.inversePixelTransform=n,r.frameState=i,r.context=o,r}return Yr(e,t),e}(W),Br=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zr=null;var Vr=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.pixelContext_=null,n.frameState=null,n}return Br(e,t),e.prototype.getImageData=function(t,e,n){var i,o;Zr||((i=document.createElement("canvas")).width=1,i.height=1,Zr=i.getContext("2d")),Zr.clearRect(0,0,1,1);try{Zr.drawImage(t,e,n,1,1,0,0,1,1),o=Zr.getImageData(0,0,1,1).data}catch(t){return null}return o},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,n,i){var o,r,s=this.getLayer().getClassName();t&&t.className===s&&""===t.style.opacity&&1===n&&(!i||t.style.backgroundColor&&V(Qi(t.style.backgroundColor),Qi(i)))&&((l=t.firstElementChild)instanceof HTMLCanvasElement&&(r=l.getContext("2d")));if(r&&r.canvas.style.transform===e?(this.container=t,this.context=r,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(o=document.createElement("div")).className=s;var a=o.style;a.position="absolute",a.width="100%",a.height="100%",i&&(a.backgroundColor=i);var l=(r=io()).canvas;o.appendChild(l),(a=l.style).position="absolute",a.left="0",a.transformOrigin="top left",this.container=o,this.context=r}},e.prototype.clipUnrotated=function(t,e,n){var i=Ye(n),o=Ke(n),r=je(n),s=De(n);oe(e.coordinateToPixelTransform,i),oe(e.coordinateToPixelTransform,o),oe(e.coordinateToPixelTransform,r),oe(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;oe(a,i),oe(a,o),oe(a,r),oe(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var i=this.getLayer();if(i.hasListener(t)){var o=new Kr(t,this.inversePixelTransform,n,e);i.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(Fi,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(Ai,t,e)},e.prototype.getRenderTransform=function(t,e,n,i,o,r,s){var a=o/2,l=r/2,h=i/e,u=-h,c=-t[0]+s,p=-t[1];return re(this.tempTransform,a,l,h,u,-n,c,p)},e.prototype.getDataAtPixel=function(t,e,n){var i=oe(this.inversePixelTransform,t.slice()),o=this.context,r=this.getLayer().getExtent();if(r&&!Ce(r,oe(e.pixelToCoordinateTransform,t.slice())))return null;var s,a=Math.round(i[0]),l=Math.round(i[1]),h=this.pixelContext_;if(!h){var u=document.createElement("canvas");u.width=1,u.height=1,h=u.getContext("2d"),this.pixelContext_=h}h.clearRect(0,0,1,1);try{h.drawImage(o.canvas,a,l,1,1,0,0,1,1),s=h.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):s}return 0===s[3]?null:s},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(Xr),Ur=Vr,Hr="Circle",qr="Default",$r="Image",Jr="LineString",Qr="Polygon",ts="Text";function es(t,e,n,i,o,r,s,a,l,h,u,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+=i],f=t[e+1],y+=_,_=Math.sqrt((p-d)*(p-d)+(f-g)*(f-g))}do{v()}while(e<n-i&&y+_<r);for(var m=0===_?0:(r-y)/_,x=nn(d,p,m),w=nn(g,f,m),C=e-i,S=y,b=r+a*l(h,o,u);e<n-i&&y+_<b;)v();var E,T=nn(d,p,m=0===_?0:(b-y)/_),O=nn(g,f,m);if(c){var R=[x,w,T,O];$n(R,0,4,2,c,R,R),E=R[0]>R[2]}else E=x>T;var I,P=Math.PI,M=[],L=C+i===e;if(_=0,y=S,p=t[e=C],f=t[e+1],L){v(),I=Math.atan2(f-g,p-d),E&&(I+=I>0?-P:P);var F=(T+x)/2,A=(O+w)/2;return M[0]=[F,A,(b-r)/2,I,o],M}for(var k=0,D=o.length;k<D;){v();var j=Math.atan2(f-g,p-d);if(E&&(j+=j>0?-P:P),void 0!==I){var z=j-I;if(z+=z>P?-2*P:z<-P?2*P:0,Math.abs(z)>s)return null}I=j;for(var G=k,W=0;k<D;++k){var N=a*l(h,o[E?D-k-1:k],u);if(e+i<n&&y+_<r+W+N/2)break;W+=N}if(k!==G){var X=E?o.substring(D-G,D-k):o.substring(G,k);F=nn(d,p,m=0===_?0:(r+W/2-y)/_),A=nn(g,f,m);M.push([F,A,W/2,j,X]),r+=W}}return M}var ns=[1/0,1/0,-1/0,-1/0],is=[],os=[],rs=[],ss=[];function as(t){return t[3].declutterBox}var ls=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 hs(t,e){return"start"!==e&&"end"!==e||ls.test(t)||(e="start"===e?"left":"right"),jr[e]}function us(t,e,n){return n>0&&t.push("\n",""),t.push(e,""),t}var cs=function(){function t(t,e,n,i){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,i){var o=t+e+n+i;if(this.labels_[o])return this.labels_[o];var r=i?this.strokeStates[i]:null,s=n?this.fillStates[n]:null,a=this.textStates[e],l=this.pixelRatio,h=[a.scale[0]*l,a.scale[1]*l],u=Array.isArray(t),c=hs(u?t[0]:t,a.textAlign||So),p=i&&r.lineWidth?r.lineWidth:0,f=u?t:t.split("\n").reduce(us,[]),d=function(t,e){for(var n=[],i=[],o=[],r=0,s=0,a=0,l=0,h=0,u=e.length;h<=u;h+=2){var c=e[h];if("\n"!==c&&h!==u){var p=e[h+1]||t.font,f=Ao(p,c);n.push(f),s+=f;var d=Lo(p);i.push(d),l=Math.max(l,d)}else r=Math.max(r,s),o.push(s),s=0,a+=l}return{width:r,height:a,widths:n,heights:i,lineWidths:o}}(a,f),g=d.width,_=d.height,y=d.widths,v=d.heights,m=d.lineWidths,x=g+p,w=[],C=(x+2)*h[0],S=(_+p)*h[1],b={width:C<0?Math.floor(C):Math.ceil(C),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:w};(1==h[0]&&1==h[1]||w.push("scale",h),i)&&(w.push("strokeStyle",r.strokeStyle),w.push("lineWidth",p),w.push("lineCap",r.lineCap),w.push("lineJoin",r.lineJoin),w.push("miterLimit",r.miterLimit),(ee?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(w.push("setLineDash",[r.lineDash]),w.push("lineDashOffset",r.lineDashOffset)));n&&w.push("fillStyle",s.fillStyle),w.push("textBaseline","middle"),w.push("textAlign","center");for(var E,T=.5-c,O=c*x+T*p,R=[],I=[],P=0,M=0,L=0,F=0,A=0,k=f.length;A<k;A+=2){var D=f[A];if("\n"!==D){var j=f[A+1]||a.font;j!==E&&(i&&R.push("font",j),n&&I.push("font",j),E=j),P=Math.max(P,v[L]);var z=[D,O+T*y[L]+c*(y[L]-m[F]),.5*(p+P)+M];O+=y[L],i&&R.push("strokeText",z),n&&I.push("fillText",z),++L}else M+=P,P=0,O=c*x+T*p,++F}return Array.prototype.push.apply(w,R),Array.prototype.push.apply(w,I),this.labels_[o]=b,b},t.prototype.replayTextBackground_=function(t,e,n,i,o,r,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,i,o,r,s,a,l,h,u,c,p,f,d,g){var _,y=n-(s*=c[0]),v=i-(a*=c[1]),m=o+l>t?t-l:o,x=r+h>e?e-h:r,w=f[3]+m*c[0]+f[1],C=f[0]+x*c[1]+f[2],S=y-f[3],b=v-f[0];return(d||0!==u)&&(is[0]=S,ss[0]=S,is[1]=b,os[1]=b,os[0]=S+w,rs[0]=os[0],rs[1]=b+C,ss[1]=rs[1]),0!==u?(oe(_=re([1,0,0,1,0,0],n,i,1,1,u,-n,-i),is),oe(_,os),oe(_,rs),oe(_,ss),Oe(Math.min(is[0],os[0],rs[0],ss[0]),Math.min(is[1],os[1],rs[1],ss[1]),Math.max(is[0],os[0],rs[0],ss[0]),Math.max(is[1],os[1],rs[1],ss[1]),ns)):Oe(Math.min(S,S+w),Math.min(b,b+C),Math.max(S,S+w),Math.max(b,b+C),ns),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:h,declutterBox:{minX:ns[0],minY:ns[1],maxX:ns[2],maxY:ns[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,n,i,o,r,s){var a=!(!r&&!s),l=i.declutterBox,h=t.canvas,u=s?s[2]*i.scale[0]/2:0;return l.minX-u<=h.width/e&&l.maxX+u>=0&&l.minY-u<=h.height/e&&l.maxY+u>=0&&(a&&this.replayTextBackground_(t,is,os,rs,ss,r,s),Do(t,i.canvasTransform,o,n,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0},t.prototype.fill_=function(t){if(this.alignFill_){var e=oe(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,i){var o=this.textStates[e],r=this.createLabel(t,e,i,n),s=this.strokeStates[n],a=this.pixelRatio,l=hs(Array.isArray(t)?t[0]:t,o.textAlign||So),h=jr[o.textBaseline||bo],u=s&&s.lineWidth?s.lineWidth:0;return{label:r,anchorX:l*(r.width/a-2*o.scale[0])+2*(.5-l)*u,anchorY:h*r.height/a+2*(.5-h)*u}},t.prototype.execute_=function(t,e,n,i,o,r,s,a){var l,h,u;this.pixelCoordinates_&&V(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=qn(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),h=this.renderedTransform_,u=n,h[0]=u[0],h[1]=u[1],h[2]=u[2],h[3]=u[3],h[4]=u[4],h[5]=u[5]);for(var c,p,f,d,g,_,y,v,m,x,w,C,S,b,E,T,O=0,R=i.length,I=0,P=0,M=0,L=null,F=null,A=this.coordinateCache_,k=this.viewRotation_,D=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:k},z=this.instructions!=i||this.overlaps?0:200;O<R;){var G=i[O];switch(G[0]){case Sr.BEGIN_GEOMETRY:S=G[1],T=G[3],S.getGeometry()?void 0===s||Ze(s,T.getExtent())?++O:O=G[2]+1:O=G[2];break;case Sr.BEGIN_PATH:P>z&&(this.fill_(t),P=0),M>z&&(t.stroke(),M=0),P||M||(t.beginPath(),d=NaN,g=NaN),++O;break;case Sr.CIRCLE:var W=l[I=G[1]],N=l[I+1],X=l[I+2]-W,Y=l[I+3]-N,K=Math.sqrt(X*X+Y*Y);t.moveTo(W+K,N),t.arc(W,N,K,0,2*Math.PI,!0),++O;break;case Sr.CLOSE_PATH:t.closePath(),++O;break;case Sr.CUSTOM:I=G[1],c=G[2];var B=G[3],Z=G[4],U=6==G.length?G[5]:void 0;j.geometry=B,j.feature=S,O in A||(A[O]=[]);var H=A[O];U?U(l,I,c,2,H):(H[0]=l[I],H[1]=l[I+1],H.length=2),Z(H,j),++O;break;case Sr.DRAW_IMAGE:I=G[1],c=G[2],v=G[3],p=G[4],f=G[5];var q=G[6],$=G[7],J=G[8],Q=G[9],tt=G[10],et=G[11],nt=G[12],it=G[13],ot=G[14];if(!v&&G.length>=19){m=G[18],x=G[19],w=G[20],C=G[21];var rt=this.drawLabelWithPointPlacement_(m,x,w,C);v=rt.label,G[3]=v;var st=G[22];p=(rt.anchorX-st)*this.pixelRatio,G[4]=p;var at=G[23];f=(rt.anchorY-at)*this.pixelRatio,G[5]=f,q=v.height,G[6]=q,it=v.width,G[13]=it}var lt=void 0;G.length>24&&(lt=G[24]);var ht=void 0,ut=void 0,ct=void 0;G.length>16?(ht=G[15],ut=G[16],ct=G[17]):(ht=Eo,ut=!1,ct=!1),tt&&D?et+=k:tt||D||(et-=k);for(var pt=0;I<c;I+=2)if(!(lt&&lt[pt++]<it/this.pixelRatio)){var ft=[t,e,v,Wt=this.calculateImageOrLabelDimensions_(v.width,v.height,l[I],l[I+1],it,q,p,f,J,Q,et,nt,o,ht,ut||ct,S),$,ut?L:null,ct?F:null],dt=void 0,gt=void 0;if(a&&ot){var _t=c-I;if(!ot[_t]){ot[_t]=ft;continue}if(dt=ot[_t],delete ot[_t],gt=as(dt),a.collides(gt))continue}a&&a.collides(Wt.declutterBox)||(dt&&(a&&a.insert(gt),this.replayImageOrLabel_.apply(this,dt)),a&&a.insert(Wt.declutterBox),this.replayImageOrLabel_.apply(this,ft))}++O;break;case Sr.DRAW_CHARS:var yt=G[1],vt=G[2],mt=G[3],xt=G[4];C=G[5];var wt=G[6],Ct=G[7],St=G[8];w=G[9];var bt=G[10];m=G[11],x=G[12];var Et=[G[13],G[13]],Tt=this.textStates[x],Ot=Tt.font,Rt=[Tt.scale[0]*Ct,Tt.scale[1]*Ct],It=void 0;Ot in this.widths_?It=this.widths_[Ot]:(It={},this.widths_[Ot]=It);var Pt=Gi(l,yt,vt,2),Mt=Math.abs(Rt[0])*ko(Ot,m,It);if(xt||Mt<=Pt){var Lt=this.textStates[x].textAlign,Ft=es(l,yt,vt,2,m,(Pt-Mt)*jr[Lt],wt,Math.abs(Rt[0]),ko,Ot,It,D?0:this.viewRotation_);t:if(Ft){var At=[],kt=void 0,Dt=void 0,jt=void 0,zt=void 0,Gt=void 0;if(w)for(kt=0,Dt=Ft.length;kt<Dt;++kt){jt=(Gt=Ft[kt])[4],zt=this.createLabel(jt,x,"",w),p=Gt[2]+(Rt[0]<0?-bt:bt),f=mt*zt.height+2*(.5-mt)*bt*Rt[1]/Rt[0]-St;var Wt=this.calculateImageOrLabelDimensions_(zt.width,zt.height,Gt[0],Gt[1],zt.width,zt.height,p,f,0,0,Gt[3],Et,!1,Eo,!1,S);if(a&&a.collides(Wt.declutterBox))break t;At.push([t,e,zt,Wt,1,null,null])}if(C)for(kt=0,Dt=Ft.length;kt<Dt;++kt){jt=(Gt=Ft[kt])[4],zt=this.createLabel(jt,x,C,""),p=Gt[2],f=mt*zt.height-St;Wt=this.calculateImageOrLabelDimensions_(zt.width,zt.height,Gt[0],Gt[1],zt.width,zt.height,p,f,0,0,Gt[3],Et,!1,Eo,!1,S);if(a&&a.collides(Wt.declutterBox))break t;At.push([t,e,zt,Wt,1,null,null])}a&&a.load(At.map(as));for(var Nt=0,Xt=At.length;Nt<Xt;++Nt)this.replayImageOrLabel_.apply(this,At[Nt])}}++O;break;case Sr.END_GEOMETRY:if(void 0!==r){var Yt=r(S=G[1],T);if(Yt)return Yt}++O;break;case Sr.FILL:z?P++:this.fill_(t),++O;break;case Sr.MOVE_TO_LINE_TO:for(I=G[1],c=G[2],b=l[I],y=(E=l[I+1])+.5|0,(_=b+.5|0)===d&&y===g||(t.moveTo(b,E),d=_,g=y),I+=2;I<c;I+=2)_=(b=l[I])+.5|0,y=(E=l[I+1])+.5|0,I!=c-2&&_===d&&y===g||(t.lineTo(b,E),d=_,g=y);++O;break;case Sr.SET_FILL_STYLE:L=G,this.alignFill_=G[2],P&&(this.fill_(t),P=0,M&&(t.stroke(),M=0)),t.fillStyle=G[1],++O;break;case Sr.SET_STROKE_STYLE:F=G,M&&(t.stroke(),M=0),this.setStrokeStyle_(t,G),++O;break;case Sr.STROKE:z?M++:t.stroke(),++O;break;default:++O}}P&&this.fill_(t),M&&t.stroke()},t.prototype.execute=function(t,e,n,i,o,r){this.viewRotation_=i,this.execute_(t,e,n,this.instructions,o,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,n,i,o){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,i,o)},t}(),ps=cs,fs=[Qr,Hr,Jr,$r,ts,qr],ds=function(){function t(t,e,n,i,o,r){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(o)}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 i=t[e];for(var o in i){var r=i[o];n[o]=new ps(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],i=0,o=t.length;i<o;++i)if(t[i]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o,r){var s=2*(i=Math.round(i))+1,a=re(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-n,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=io(s,s));var h,u=this.hitDetectionContext_;u.canvas.width!==s||u.canvas.height!==s?(u.canvas.width=s,u.canvas.height=s):l||u.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(Me(h=[1/0,1/0,-1/0,-1/0],t),me(h,e*(this.renderBuffer_+i),h));var c,p=function(t){if(void 0!==gs[t])return gs[t];for(var e=2*t+1,n=t*t,i=new Array(n+1),o=0;o<=t;++o)for(var r=0;r<=t;++r){var s=o*o+r*r;if(s>n)break;var a=i[s];a||(a=[],i[s]=a),a.push(4*((t+o)*e+(t+r))+3),o>0&&a.push(4*((t-o)*e+(t+r))+3),r>0&&(a.push(4*((t+o)*e+(t-r))+3),o>0&&a.push(4*((t-o)*e+(t-r))+3))}for(var l=[],h=(o=0,i.length);o<h;++o)i[o]&&l.push.apply(l,i[o]);return gs[t]=l,l}(i);function f(t,e){for(var n=u.getImageData(0,0,s,s).data,a=0,l=p.length;a<l;a++)if(n[p[a]]>0){if(!r||c!==$r&&c!==ts||-1!==r.indexOf(t)){var h=(p[a]-3)/4,f=i-h%s,d=i-(h/s|0),g=o(t,e,f*f+d*d);if(g)return g}u.clearRect(0,0,s,s);break}}var d,g,_,y,v,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(Y),d=m.length-1;d>=0;--d){var x=m[d].toString();for(_=this.executorsByZIndex_[x],g=fs.length-1;g>=0;--g)if(void 0!==(y=_[c=fs[g]])&&(v=y.executeHitDetection(u,a,n,f,h)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],i=e[1],o=e[2],r=e[3],s=[n,i,n,r,o,r,o,i];return qn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return tt(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,i,o,r,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(Y),this.maxExtent_&&(t.save(),this.clip(t,n));var l,h,u,c,p,f,d=r||fs;for(s&&a.reverse(),l=0,h=a.length;l<h;++l){var g=a[l].toString();for(p=this.executorsByZIndex_[g],u=0,c=d.length;u<c;++u){void 0!==(f=p[d[u]])&&f.execute(t,e,n,i,o,s)}}this.maxExtent_&&t.restore()},t}(),gs={};var _s=ds,ys=0,vs=1,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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),xs=function(t){function e(e,n,i,o,r,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=n,l.extent_=i,l.transform_=o,l.viewRotation_=r,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 ms(e,t),e.prototype.drawImages_=function(t,e,n,i){if(this.image_){var o=qn(t,e,n,i,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.tmpLocalTransform_,a=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var h=0,u=o.length;h<u;h+=2){var c=o[h]-this.imageAnchorX_,p=o[h+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;re(s,f,d,1,1,l,-f,-d),r.setTransform.apply(r,s),r.translate(f,d),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=a)}},e.prototype.drawText_=function(t,e,n,i){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=qn(t,e,n,i,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<n;e+=i){var a=o[e]+this.textOffsetX_,l=o[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var h=re(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);r.setTransform.apply(r,h),r.translate(a,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,a,l),this.textFillState_&&r.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,n,i,o){var r=this.context_,s=qn(t,e,n,i,this.transform_,this.pixelCoordinates_);r.moveTo(s[0],s[1]);var a=s.length;o&&(a-=2);for(var l=2;l<a;l+=2)r.lineTo(s[l],s[l+1]);return o&&r.closePath(),n},e.prototype.drawRings_=function(t,e,n,i){for(var o=0,r=n.length;o<r;++o)e=this.moveToLineTo_(t,e,n[o],i,!0);return e},e.prototype.drawCircle=function(t){if(Ze(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 i=t.getFlatCoordinates();if(i){var o=t.getStride();return qn(i,0,i.length,o,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],i=e[3]-e[1],o=Math.sqrt(n*n+i*i),r=this.context_;r.beginPath(),r.arc(e[0],e[1],o,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.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 jt:this.drawPoint(t);break;case zt:this.drawLineString(t);break;case Wt:this.drawPolygon(t);break;case Nt:this.drawMultiPoint(t);break;case Xt:this.drawMultiLineString(t);break;case Yt:this.drawMultiPolygon(t);break;case Kt:this.drawGeometryCollection(t);break;case Bt:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&Ze(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,i=e.length;n<i;++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_)),Ze(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 i=t.getFlatMidpoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(Ze(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,i=t.getFlatCoordinates(),o=0,r=t.getEnds(),s=t.getStride();n.beginPath();for(var a=0,l=r.length;a<l;++a)o=this.moveToLineTo_(i,o,r[a],s,!1);n.stroke()}if(""!==this.text_){var h=t.getFlatMidpoints();this.drawText_(h,0,h.length,2)}}},e.prototype.drawPolygon=function(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Ze(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_)),Ze(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(),i=0,o=t.getEndss(),r=t.getStride();e.beginPath();for(var s=0,a=o.length;s<a;++s){var l=o[s];i=this.drawRings_(n,i,l,r)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var h=t.getFlatInteriorPoints();this.drawText_(h,0,h.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&&(V(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_,i=t.textAlign?t.textAlign:So;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=i&&(n.textAlign=i,e.textAlign=i),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=i,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:i,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var i=t.getColor();this.fillState_={fillStyle:no(i||vo)}}else this.fillState_=null;if(e){var o=e.getColor(),r=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),h=e.getWidth(),u=e.getMiterLimit(),c=s||xo;this.strokeState_={lineCap:void 0!==r?r:mo,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*n.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:wo,lineWidth:(void 0!==h?h:1)*this.pixelRatio_,miterLimit:void 0!==u?u:10,strokeStyle:no(o||Co)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),i=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_=i[0],this.imageOriginY_=i[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:no(n||vo)}}else this.textFillState_=null;var i=t.getStroke();if(i){var o=i.getColor(),r=i.getLineCap(),s=i.getLineDash(),a=i.getLineDashOffset(),l=i.getLineJoin(),h=i.getWidth(),u=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:mo,lineDash:s||xo,lineDashOffset:a||0,lineJoin:void 0!==l?l:wo,lineWidth:void 0!==h?h:1,miterLimit:void 0!==u?u:10,strokeStyle:no(o||Co)}}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:yo,textAlign:void 0!==v?v:So,textBaseline:void 0!==m?m:bo},this.text_=void 0!==y?Array.isArray(y)?y.reduce((function(t,e,n){return t+(n%2?" ":e)}),""):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}(br),ws=xs,Cs="fraction",Ss="pixels",bs="bottom-left",Es="bottom-right",Ts="top-left",Os="top-right";function Rs(t,e,n){return e+":"+t+":"+(n?$i(n):"null")}var Is=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 i=Rs(t,e,n);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(t,e,n,i){var o=Rs(t,e,n);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),Ps=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ms=function(t){function e(e,n,i,o){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=i,r.resolution=n,r.state=o,r}return Ps(e,t),e.prototype.changed=function(){this.dispatchEvent(it)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return A()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){A()},e}(nt),Ls=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Fs(t,e,n){var i=t,o=!0,r=!1,s=!1,a=[gt(i,ut,(function(){s=!0,r||e()}))];return i.src&&ne?(r=!0,i.decode().then((function(){o&&e()})).catch((function(t){o&&(s?e():n())}))):a.push(gt(i,ot,n)),function(){o=!1,a.forEach(_t)}}!function(t){function e(e,n,i,o,r,s){var a=t.call(this,e,n,i,Ni)||this;return a.src_=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.state=Ni,a.imageLoadFunction_=s,a}Ls(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=Ki,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=Ne(this.extent)/this.image_.height),this.state=Yi,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=Ni&&this.state!=Ki||(this.state=Xi,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Fs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=Ne(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(Ms);var 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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ks=null,Ds=function(t){function e(e,n,i,o,r,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==o&&(a.image_.crossOrigin=o),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=r,a.size_=i,a.src_=n,a.tainted_,a}return As(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===Yi){ks||(ks=io(1,1)),ks.drawImage(this.image_,0,0);try{ks.getImageData(0,0,1,1),this.tainted_=!1}catch(t){ks=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(it)},e.prototype.handleImageError_=function(){this.imageState_=Ki,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=Yi,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=io(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_==Ni){this.imageState_=Xi;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Fs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===Yi){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=$i(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 i=n.getImageData(0,0,e.width,e.height),o=i.data,r=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],h=0,u=o.length;h<u;h+=4)o[h]*=r,o[h+1]*=s,o[h+2]*=a,o[h+3]*=l;n.putImageData(i,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(nt);var js=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),zs=function(t){function e(e){var n=this,i=e||{},o=void 0!==i.opacity?i.opacity:1,r=void 0!==i.rotation?i.rotation:0,s=void 0!==i.scale?i.scale:1,a=void 0!==i.rotateWithView&&i.rotateWithView;(n=t.call(this,{opacity:o,rotation:r,scale:s,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:a})||this).anchor_=void 0!==i.anchor?i.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:Ts,n.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:Cs,n.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:Cs,n.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var l=void 0!==i.img?i.img:null;n.imgSize_=i.imgSize;var h=i.src;It(!(void 0!==h&&l),4),It(!l||l&&n.imgSize_,5),void 0!==h&&0!==h.length||!l||(h=l.src||D(l)),It(void 0!==h&&h.length>0,6);var u=void 0!==i.src?Ni:Yi;return n.color_=void 0!==i.color?Qi(i.color):null,n.iconImage_=function(t,e,n,i,o,r){var s=Is.get(e,i,r);return s||(s=new Ds(t,e,n,i,o,r),Is.set(e,i,r,s)),s}(l,h,void 0!==n.imgSize_?n.imgSize_:null,n.crossOrigin_,u,n.color_),n.offset_=void 0!==i.offset?i.offset:[0,0],n.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:Ts,n.origin_=null,n.size_=void 0!==i.size?i.size:null,n}return js(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_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==Cs||this.anchorYUnits_==Cs){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Cs&&(t[0]*=e[0]),this.anchorYUnits_==Cs&&(t[1]*=e[1])}if(this.anchorOrigin_!=Ts){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Os&&this.anchorOrigin_!=Es||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=bs&&this.anchorOrigin_!=Es||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Ts){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=Os&&this.offsetOrigin_!=Es||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=bs&&this.offsetOrigin_!=Es||(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(it,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(it,t)},e}(Ui),Gs=zs,Ws=.5;var Ns={Point:function(t,e,n,i,o){var r,s=n.getImage(),a=n.getText();o&&(t=o,r=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Yi)return;var l=t.getBuilder(n.getZIndex(),$r);l.setImageStyle(s,r),l.drawPoint(e,i)}if(a&&a.getText()){var h=t.getBuilder(n.getZIndex(),ts);h.setTextStyle(a,r),h.drawText(e,i)}},LineString:function(t,e,n,i,o){var r=n.getStroke();if(r){var s=t.getBuilder(n.getZIndex(),Jr);s.setFillStrokeStyle(null,r),s.drawLineString(e,i)}var a=n.getText();if(a&&a.getText()){var l=(o||t).getBuilder(n.getZIndex(),ts);l.setTextStyle(a),l.drawText(e,i)}},Polygon:function(t,e,n,i,o){var r=n.getFill(),s=n.getStroke();if(r||s){var a=t.getBuilder(n.getZIndex(),Qr);a.setFillStrokeStyle(r,s),a.drawPolygon(e,i)}var l=n.getText();if(l&&l.getText()){var h=(o||t).getBuilder(n.getZIndex(),ts);h.setTextStyle(l),h.drawText(e,i)}},MultiPoint:function(t,e,n,i,o){var r,s=n.getImage(),a=n.getText();o&&(t=o,r=s&&a&&a.getText()?{}:void 0);if(s){if(s.getImageState()!=Yi)return;var l=t.getBuilder(n.getZIndex(),$r);l.setImageStyle(s,r),l.drawMultiPoint(e,i)}if(a&&a.getText()){var h=(o||t).getBuilder(n.getZIndex(),ts);h.setTextStyle(a,r),h.drawText(e,i)}},MultiLineString:function(t,e,n,i,o){var r=n.getStroke();if(r){var s=t.getBuilder(n.getZIndex(),Jr);s.setFillStrokeStyle(null,r),s.drawMultiLineString(e,i)}var a=n.getText();if(a&&a.getText()){var l=(o||t).getBuilder(n.getZIndex(),ts);l.setTextStyle(a),l.drawText(e,i)}},MultiPolygon:function(t,e,n,i,o){var r=n.getFill(),s=n.getStroke();if(s||r){var a=t.getBuilder(n.getZIndex(),Qr);a.setFillStrokeStyle(r,s),a.drawMultiPolygon(e,i)}var l=n.getText();if(l&&l.getText()){var h=(o||t).getBuilder(n.getZIndex(),ts);h.setTextStyle(l),h.drawText(e,i)}},GeometryCollection:function(t,e,n,i,o){var r,s,a=e.getGeometriesArray();for(r=0,s=a.length;r<s;++r){(0,Ns[a[r].getType()])(t,a[r],n,i,o)}},Circle:function(t,e,n,i,o){var r=n.getFill(),s=n.getStroke();if(r||s){var a=t.getBuilder(n.getZIndex(),Hr);a.setFillStrokeStyle(r,s),a.drawCircle(e,i)}var l=n.getText();if(l&&l.getText()){var h=(o||t).getBuilder(n.getZIndex(),ts);h.setTextStyle(l),h.drawText(e,i)}}};function Xs(t,e){return parseInt(D(t),10)-parseInt(D(e),10)}function Ys(t,e){return.5*t/e}function Ks(t,e,n,i,o,r,s){var a=!1,l=n.getImage();if(l){var h=l.getImageState();h==Yi||h==Ki?l.unlistenImageChange(o):(h==Ni&&l.load(),h=l.getImageState(),l.listenImageChange(o),a=!0)}return function(t,e,n,i,o,r){var s=n.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(i,o);if(n.getRenderer())Bs(t,a,n,e);else{(0,Ns[a.getType()])(t,a,n,e,r)}}(t,e,n,i,r,s),a}function Bs(t,e,n,i){if(e.getType()!=Kt)t.getBuilder(n.getZIndex(),qr).drawCustom(e,i,n.getRenderer(),n.getHitDetectionRenderer());else for(var o=e.getGeometries(),r=0,s=o.length;r<s;++r)Bs(t,o[r],n,i)}var Zs=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Vs=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 Zs(e,t),e.prototype.renderWorlds=function(t,e,n){var i=e.extent,o=e.viewState,r=o.center,s=o.resolution,a=o.projection,l=o.rotation,h=a.getExtent(),u=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,f=!(p[ys]||p[vs]),d=this.context,g=Math.round(e.size[0]*c),_=Math.round(e.size[1]*c),y=u.getWrapX()&&a.canWrapX(),v=y?Be(h):null,m=y?Math.ceil((i[2]-h[2])/v)+1:1,x=y?Math.floor((i[0]-h[0])/v):0;do{var w=this.getRenderTransform(r,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,i=t.layerStatesArray[t.layerIndex];!function(t,e,n){(function(t,e,n,i,o,r,s){t[0]=e,t[1]=n,t[2]=i,t[3]=o,t[4]=r,t[5]=s})(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),se(this.inversePixelTransform,this.pixelTransform);var o=ae(this.pixelTransform);this.useContainer(e,o,i.opacity,this.getBackground(t));var r=this.context,s=r.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return null;var h=Math.round(t.size[0]*n),u=Math.round(t.size[1]*n);s.width!=h||s.height!=u?(s.width=h,s.height=u,s.style.transform!==o&&(s.style.transform=o)):this.containerReused||r.clearRect(0,0,h,u),this.preRender(r,t);var c=t.viewState;c.projection;var p=!1,f=!0;if(i.extent&&this.clipping){var d=Hn(i.extent);(p=(f=Ze(d,t.extent))&&!Se(d,t.extent))&&this.clipUnrotated(r,t,d)}f&&this.renderWorlds(a,t),p&&r.restore(),this.postRender(r,t);var g=_o(i.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];oe(this.pixelTransform,n);var i=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),h=[],u=n[0]*Ws,c=n[1]*Ws;h.push(this.getRenderTransform(i,o,r,Ws,u,c,0).slice());var p=l.getSource(),f=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!Se(f,a)){for(var d=a[0],g=Be(f),_=0,y=void 0;d<f[0];)y=g*--_,h.push(this.getRenderTransform(i,o,r,Ws,u,c,y).slice()),d+=g;for(_=0,d=a[2];d>f[2];)y=g*++_,h.push(this.getRenderTransform(i,o,r,Ws,u,c,y).slice()),d-=g}this.hitDetectionImageData_=function(t,e,n,i,o,r,s){var a=io(t[0]*Ws,t[1]*Ws);a.imageSmoothingEnabled=!1;for(var l=a.canvas,h=new ws(a,Ws,o,null,s),u=n.length,c=Math.floor(16777215/u),p={},f=1;f<=u;++f){var d=n[f-1],g=d.getStyleFunction()||i;if(i){var _=g(d,r);if(_){Array.isArray(_)||(_=[_]);for(var y="#"+("000000"+(f*c).toString(16)).slice(-6),v=0,m=_.length;v<m;++v){var x=_[v],w=x.getGeometryFunction()(d);if(w&&Ze(o,w.getExtent())){var C=x.clone(),S=C.getFill();S&&S.setColor(y);var b=C.getStroke();b&&(b.setColor(y),b.setLineDash(null)),C.setText(void 0);var E=x.getImage();if(E&&0!==E.getOpacity()){var T=E.getImageSize();if(!T)continue;var O=io(T[0],T[1],void 0,{alpha:!1}),R=O.canvas;O.fillStyle=y,O.fillRect(0,0,R.width,R.height),C.setImage(new Gs({img:R,imgSize:T,anchor:E.getAnchor(),anchorXUnits:Ss,anchorYUnits:Ss,offset:E.getOrigin(),opacity:1,size:E.getSize(),scale:E.getScale(),rotation:E.getRotation(),rotateWithView:E.getRotateWithView()}))}var I=C.getZIndex()||0;(L=p[I])||(L={},p[I]=L,L[Wt]=[],L[Bt]=[],L[zt]=[],L[jt]=[]),L[w.getType().replace("Multi","")].push(w,C)}}}}}for(var P=Object.keys(p).map(Number).sort(Y),M=(f=0,P.length);f<M;++f){var L=p[P[f]];for(var F in L){var A=L[F];for(v=0,m=A.length;v<m;v+=2){h.setStyle(A[v+1]);for(var k=0,D=e.length;k<D;++k)h.setTransform(e[k]),h.drawGeometry(A[v])}}}return a.getImageData(0,0,l.width,l.height)}(n,h,this.renderedFeatures_,l.getStyleFunction(),a,o,r)}e(function(t,e,n){var i=[];if(n){var o=Math.floor(Math.round(t[0])*Ws),r=Math.floor(Math.round(t[1])*Ws),s=4*(He(o,0,n.width-1)+He(r,0,n.height-1)*n.width),a=n.data[s],l=n.data[s+1],h=n.data[s+2]+256*(l+256*a),u=Math.floor(16777215/e.length);h&&h%u==0&&i.push(e[h/u-1])}return i}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o){var r=this;if(this.replayGroup_){var s,a=e.viewState.resolution,l=e.viewState.rotation,h=this.getLayer(),u={},c=function(t,e,n){var r=D(t),s=u[r];if(s){if(!0!==s&&n<s.distanceSq){if(0===n)return u[r]=!0,o.splice(o.lastIndexOf(s),1),i(t,h,e);s.geometry=e,s.distanceSq=n}}else{if(0===n)return u[r]=!0,i(t,h,e);o.push(u[r]={feature:t,layer:h,geometry:e,distanceSq:n,callback:i})}},p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some((function(i){return s=i.forEachFeatureAtCoordinate(t,a,l,n,c,i===r.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var i=t.viewHints[ys],o=t.viewHints[vs],r=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(!this.dirty_&&!r&&i||!s&&o)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;var a=t.extent,l=t.viewState,h=l.projection,u=l.resolution,c=t.pixelRatio,p=e.getRevision(),f=e.getRenderBuffer(),d=e.getRenderOrder();void 0===d&&(d=Xs);var g=l.center.slice(),_=me(a,f*u),y=_.slice(),v=[_.slice()],m=h.getExtent();if(n.getWrapX()&&h.canWrapX()&&!Se(m,t.extent)){var x=Be(m),w=Math.max(Be(_)/2,x);_[0]=m[0]-w,_[2]=m[2]+w,On(g,h);var C=function(t,e){var n=e.getExtent(),i=ze(t);if(e.canWrapX()&&(i[0]<n[0]||i[0]>=n[2])){var o=Be(n),r=Math.floor((i[0]-n[0])/o)*o;t[0]-=r,t[2]-=r}return t}(v[0],h);C[0]<m[0]&&C[2]<m[2]?v.push([C[0]+x,C[1],C[2]+x,C[3]]):C[0]>m[0]&&C[2]>m[2]&&v.push([C[0]-x,C[1],C[2]-x,C[3]])}if(!this.dirty_&&this.renderedResolution_==u&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&Se(this.wrappedRenderedExtent_,_))return V(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var S,b=new Wr(Ys(u,c),_,u,c);this.getLayer().getDeclutter()&&(S=new Wr(Ys(u,c),_,u,c));for(var E=0,T=v.length;E<T;++E)n.loadFeatures(v[E],u,h);var O=function(t,e){var n=Ys(t,e);return n*n}(u,c),R=function(t){var n,i=t.getStyleFunction()||e.getStyleFunction();if(i&&(n=i(t,u)),n){var o=this.renderFeature(t,O,n,b,undefined,S);this.dirty_=this.dirty_||o}}.bind(this),I=Un(_),P=n.getFeaturesInExtent(I);d&&P.sort(d);for(E=0,T=P.length;E<T;++E)R(P[E]);this.renderedFeatures_=P;var M=b.finish(),L=new _s(_,u,c,n.getOverlaps(),M,e.getRenderBuffer());return S&&(this.declutterExecutorGroup=new _s(_,u,c,n.getOverlaps(),S.finish(),e.getRenderBuffer())),this.renderedResolution_=u,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=y,this.wrappedRenderedExtent_=_,this.renderedCenter_=g,this.renderedProjection_=h,this.replayGroup_=L,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,n,i,o,r){if(!n)return!1;var s=!1;if(Array.isArray(n))for(var a=0,l=n.length;a<l;++a)s=Ks(i,t,n[a],e,this.boundHandleStyleImageChange_,o,r)||s;else s=Ks(i,t,n,e,this.boundHandleStyleImageChange_,o,r);return s},e}(Ur),Us=Vs,Hs=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),qs=function(t){function e(e){return t.call(this,e)||this}return Hs(e,t),e.prototype.createRenderer=function(){return new Us(this)},e}(yr),$s=function(){function t(t){this.rbush_=new dr(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_[D(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),i=0,o=e.length;i<o;i++){var r=t[i],s=e[i],a={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:s};n[i]=a,this.items_[D(s)]=a}this.rbush_.load(n)},t.prototype.remove=function(t){var e=D(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_[D(e)];Ie([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,i=0,o=t.length;i<o;i++)if(n=e(t[i]))return n;return n},t.prototype.isEmpty=function(){return tt(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return Oe(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}(),Js=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Qs(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var ta=function(t){function e(e){var n=t.call(this)||this;n.projection=An(e.projection),n.attributions_=Qs(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:lr,n.wrapX_=void 0!==e.wrapX&&e.wrapX,n.interpolate_=!!e.interpolate,n.viewResolver=null,n.viewRejector=null;var i=n;return n.viewPromise_=new Promise((function(t,e){i.viewResolver=t,i.viewRejector=e})),n}return Js(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return A()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=Qs(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Ct),ea="addfeature",na="changefeature",ia="clear",oa="removefeature",ra="featuresloadstart",sa="featuresloadend",aa="featuresloaderror";function la(t,e){return[[-1/0,-1/0,1/0,1/0]]}var ha="arraybuffer",ua="json",ca="text",pa="xml";function fa(t,e){return function(n,i,o,r,s){var a=this;!function(t,e,n,i,o,r,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,i,o):t,!0),e.getType()==ha&&(a.responseType="arraybuffer"),a.withCredentials=!1,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var i=e.getType(),l=void 0;i==ua||i==ca?l=a.responseText:i==pa?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):i==ha&&(l=a.response),l?r(e.readFeatures(l,{extent:n,featureProjection:o}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,n,i,o,(function(t,e){a.addFeatures(t),void 0!==r&&r(t)}),s||q)}}var da=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ga=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.feature=n,o.features=i,o}return da(e,t),e}(W),_a=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:lr,wrapX:void 0===i.wrapX||i.wrapX})||this).on,n.once,n.un,n.loader_=q,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&(It(n.format_,7),n.loader_=fa(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:la;var o,r,s=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=s?new $s:null,n.loadedExtentsRtree_=new $s,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?r=i.features:i.features&&(r=(o=i.features).getArray()),s||void 0!==o||(o=new Rt(r)),void 0!==r&&n.addFeaturesInternal(r),void 0!==o&&n.bindFeaturesCollection_(o),n}return da(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=D(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 ga(ea,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[dt(e,it,this.handleFeatureChange_,this),dt(e,N,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,i=e.getId();return void 0!==i&&(i.toString()in this.idIndex_?n=!1:this.idIndex_[i.toString()]=e),n&&(It(!(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,r=t.length;o<r;o++){var s=D(l=t[o]);this.addToIndex_(s,l)&&n.push(l)}o=0;for(var a=n.length;o<a;o++){var l;s=D(l=n[o]);this.setupChangeEvents_(s,l);var h=l.getGeometry();if(h){var u=h.getExtent();e.push(u),i.push(l)}else this.nullGeometryFeatures_[s]=l}if(this.featuresRtree_&&this.featuresRtree_.load(e,i),this.hasListener(ea)){o=0;for(var c=n.length;o<c;o++)this.dispatchEvent(new ga(ea,n[o]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(ea,(function(n){e||(e=!0,t.push(n.feature),e=!1)})),this.addEventListener(oa,(function(n){e||(e=!0,t.remove(n.feature),e=!1)})),t.addEventListener(St,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(bt,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(_t)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var n=function(t){this.removeFeatureInternal(t)}.bind(this);for(var i in this.featuresRtree_.forEach(n),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new ga(ia);this.dispatchEvent(o),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 i=e(n);if(i)return i}}))},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(),tt(this.nullGeometryFeatures_)||Z(t,Q(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],i=t[1],o=null,r=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||U;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),h=s;if((s=e.closestPointXY(n,i,r,s))<h){o=t;var u=Math.sqrt(s);a[0]=n-u,a[1]=i-u,a[2]=n+u,a[3]=i+u}}})),o},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=D(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 r=e.getId();if(void 0!==r){var s=r.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new ga(na,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:D(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&tt(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,n){for(var i=this.loadedExtentsRtree_,o=this.strategy_(t,e,n),r=function(t,r){var a=o[t];i.forEachInExtent(a,(function(t){return Se(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new ga(ra)),s.loader_.call(s,a,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new ga(sa,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new ga(aa))}.bind(s)),i.insert(a,{extent:a.slice()}))},s=this,a=0,l=o.length;a<l;++a)r(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(Ie(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=D(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=D(t),n=this.featureChangeKeys_[e];if(n){n.forEach(_t),delete this.featureChangeKeys_[e];var i=t.getId();return void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new ga(oa,t)),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){It(this.format_,7),this.url_=t,this.setLoader(fa(t,this.format_))},e}(ta),ya=0,va=1,ma=2,xa=3,wa=4;function Ca(t){return Math.pow(t,3)}function Sa(t){return 1-Ca(1-t)}function ba(t){return 3*t*t-2*t*t*t}function Ea(t){return t}var Ta=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Oa=function(t){function e(e,n,i){var o=t.call(this)||this,r=i||{};return o.tileCoord=e,o.state=n,o.interimTile=null,o.key="",o.transition_=void 0===r.transition?250:r.transition,o.transitionStarts_={},o.interpolate=!!r.interpolate,o}return Ta(e,t),e.prototype.changed=function(){this.dispatchEvent(it)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==ma)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==ma){t.interimTile=null;break}t.getState()==va?e=t:t.getState()==ya?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==xa&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){A()},e.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 i=e-n+1e3/60;return i>=this.transition_?1:Ca(i/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(nt),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ia=function(t){function e(e,n,i,o,r,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=o,a.src_=i,a.key=i,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.tileLoadFunction_=r,a}return Ra(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=ma,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=xa,this.unlistenImage_(),this.image_=((t=io(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=ma:this.state=wa,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==xa&&(this.state=ya,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==ya&&(this.state=va,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Fs(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(Oa);var Pa=Ia,Ma=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 i=this.points_[e+2]-this.points_[n+2];if(i<1e3/60)return!1;var o=this.points_[e]-this.points_[n],r=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),La=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fa=function(t){function e(e){var n=t.call(this)||this;return n.map_=e,n}return La(e,t),e.prototype.dispatchRenderEvent=function(t,e){A()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;re(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),se(i,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o,r,s,a){var l,h=e.viewState;function u(t,e,n,i){return o.call(r,e,t?n:null,i)}var c=h.projection,p=On(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&i){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],C=w.layer;if(C.hasRenderer()&&ur(w,h)&&s.call(a,C)){var S=C.getRenderer(),b=C.getSource();if(S&&b){var E=b.getWrapX()?p:t,T=u.bind(null,w.managed);v[0]=E[0]+f[m][0],v[1]=E[1]+f[m][1],l=S.forEachFeatureAtCoordinate(v,e,n,T,y)}if(l)return l}}if(0!==y.length){var O=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*O})),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}},e.prototype.forEachLayerAtPixel=function(t,e,n,i,o){return A()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,i,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,i,U,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){A()},e.prototype.scheduleExpireIconCache=function(t){Is.canExpireCache()&&t.postRenderFunctions.push(Aa)},e}(X);function Aa(t,e){Is.expire()}var ka=Fa,Da=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ja=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=dt(To,N,e.redrawText.bind(e)),n.element_=document.createElement("div");var i=n.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",n.element_.className="ol-unselectable ol-layers";var o=e.getViewport();return o.insertBefore(n.element_,o.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return Da(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var i=new Kr(t,void 0,e);n.dispatchEvent(i)}},e.prototype.disposeInternal=function(){_t(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(ki,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=t.viewState;this.children_.length=0;for(var i=[],o=null,r=0,s=e.length;r<s;++r){var a=e[r];t.layerIndex=r;var l=a.layer,h=l.getSourceState();if(!ur(a,n)||h!=lr&&h!=ar)l.unrender();else{var u=l.render(t,o);u&&(u!==o&&(this.children_.push(u),o=u),"getDeclutter"in l&&i.push(l))}}for(r=i.length-1;r>=0;--r)i[r].renderDeclutter(t);!function(t,e){for(var n=t.childNodes,i=0;;++i){var o=n[i],r=e[i];if(!o&&!r)break;o!==r&&(o?r?t.insertBefore(r,o):(t.removeChild(o),--i):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent(Di,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,i,o){for(var r=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],h=l.layer;if(h.hasRenderer()&&ur(l,r)&&o(h)){var u=h.getRenderer().getDataAtPixel(t,e,n);if(u){var c=i(h,u);if(c)return c}}}},e}(ka),za=ja,Ga=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wa=function(t){function e(e,n){var i=t.call(this,e)||this;return i.layer=n,i}return Ga(e,t),e}(W),Na="layers",Xa=function(t){function e(e){var n=this,i=e||{},o=$({},i);delete o.layers;var r=i.layers;return(n=t.call(this,o)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(Na,n.handleLayersChanged_),r?Array.isArray(r)?r=new Rt(r.slice(),{unique:!0}):It("function"==typeof r.getArray,43):r=new Rt(void 0,{unique:!0}),n.setLayers(r),n}return Ga(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(_t),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(dt(t,St,this.handleLayersAdd_,this),dt(t,bt,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(_t);J(this.listenerKeys_);for(var n=t.getArray(),i=0,o=n.length;i<o;i++){var r=n[i];this.registerLayerListeners_(r),this.dispatchEvent(new Wa("addlayer",r))}this.changed()},e.prototype.registerLayerListeners_=function(t){var n=[dt(t,N,this.handleLayerChange_,this),dt(t,it,this.handleLayerChange_,this)];t instanceof e&&n.push(dt(t,"addlayer",this.handleLayerGroupAdd_,this),dt(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[D(t)]=n},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new Wa("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new Wa("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Wa("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,n=D(e);this.listenerKeys_[n].forEach(_t),delete this.listenerKeys_[n],this.dispatchEvent(new Wa("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(Na)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var n=e.getArray(),i=0,o=n.length;i<o;++i)this.dispatchEvent(new Wa("removelayer",n[i]));this.set(Na,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 i=this.getLayerState(),o=i.zIndex;t||void 0!==i.zIndex||(o=0);for(var r=n,s=e.length;r<s;r++){var a=e[r];a.opacity*=i.opacity,a.visible=a.visible&&i.visible,a.maxResolution=Math.min(a.maxResolution,i.maxResolution),a.minResolution=Math.max(a.minResolution,i.minResolution),a.minZoom=Math.max(a.minZoom,i.minZoom),a.maxZoom=Math.min(a.maxZoom,i.maxZoom),void 0!==i.extent&&(void 0!==a.extent?a.extent=Xe(a.extent,i.extent):a.extent=i.extent),void 0===a.zIndex&&(a.zIndex=o)}return e},e.prototype.getSourceState=function(){return lr},e}(sr),Ya=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ka=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.map=n,o.frameState=void 0!==i?i:null,o}return Ya(e,t),e}(W),Ba=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Za=function(t){function e(e,n,i,o,r){var s=t.call(this,e,n,r)||this;return s.originalEvent=i,s.pixel_=null,s.coordinate_=null,s.dragging=void 0!==o&&o,s}return Ba(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}(Ka),Va={SINGLECLICK:"singleclick",CLICK:st,DBLCLICK:at,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ua="pointermove",Ha="pointerdown",qa=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),$a=function(t){function e(e,n){var i=t.call(this,e)||this;i.map_=e,i.clickTimeoutId_,i.emulateClicks_=!1,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=void 0===n?1:n,i.down_=null;var o=i.map_.getViewport();return i.activePointers_=0,i.trackedTouches_={},i.element_=o,i.pointerdownListenerKey_=dt(o,Ha,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=dt(o,Ua,i.relayEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(pt,i.boundHandleTouchMove_,!!ie&&{passive:!1}),i}return qa(e,t),e.prototype.emulateClick_=function(t){var e=new Za(Va.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Za(Va.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Za(Va.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==Va.POINTERUP||e.type==Va.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==Va.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Za(Va.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(_t),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 Za(Va.POINTERDOWN,this.map_,t);for(var n in this.dispatchEvent(e),this.down_={},t){var i=t[n];this.down_[n]="function"==typeof i?q:i}if(0===this.dragListenerKeys_.length){var o=this.map_.getOwnerDocument();this.dragListenerKeys_.push(dt(o,Va.POINTERMOVE,this.handlePointerMove_,this),dt(o,Va.POINTERUP,this.handlePointerUp_,this),dt(this.element_,Va.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==o&&this.dragListenerKeys_.push(dt(this.element_.getRootNode(),Va.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new Za(Va.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 Za(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_&&(_t(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(pt,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(_t(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(_t),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(nt),Ja=$a,Qa="postrender",tl="movestart",el="moveend",nl="loadstart",il="loadend",ol="layergroup",rl="size",sl="target",al="view",ll=1/0,hl=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,J(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 i=this.keyFunction_(n);return delete this.queuedElements_[i],n},t.prototype.enqueue=function(t){It(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=ll&&(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_,i=e.length,o=e[t],r=n[t],s=t;t<i>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),h=l<i&&n[l]<n[a]?l:a;e[t]=e[h],n[t]=n[h],t=h}e[t]=o,n[t]=r,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var n=this.elements_,i=this.priorities_,o=n[e],r=i[e];e>t;){var s=this.getParentIndex_(e);if(!(i[s]>r))break;n[e]=n[s],i[e]=i[s],e=s}n[e]=o,i[e]=r},t.prototype.reprioritize=function(){var t,e,n,i=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e<a;++e)(n=i(t=o[e]))==ll?delete this.queuedElements_[this.keyFunction_(t)]:(r[s]=n,o[s++]=t);o.length=s,r.length=s,this.heapify_()},t}(),ul=hl,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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),pl=function(t){function e(e,n){var i=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return i.boundHandleTileChange_=i.handleTileChange.bind(i),i.tileChangeCallback_=n,i.tilesLoading_=0,i.tilesLoadingKeys_={},i}return cl(e,t),e.prototype.enqueue=function(e){var n=t.prototype.enqueue.call(this,e);n&&e[0].addEventListener(it,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===ma||n===xa||n===wa){e.removeEventListener(it,this.boundHandleTileChange_);var i=e.getKey();i in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[i],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var n,i,o=0;this.tilesLoading_<t&&o<e&&this.getCount()>0;)i=(n=this.dequeue()[0]).getKey(),n.getState()!==ya||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++o,n.load())},e}(ul),fl=pl;var dl={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},gl=256;function _l(t,e,n){return function(i,o,r,s,a){if(i){if(!o&&!e)return i;var l=e?0:r[0]*o,h=e?0:r[1]*o,u=a?a[0]:0,c=a?a[1]:0,p=t[0]+l/2+u,f=t[2]-l/2+u,d=t[1]+h/2+c,g=t[3]-h/2+c;p>f&&(f=p=(f+p)/2),d>g&&(g=d=(g+d)/2);var _=He(i[0],p,f),y=He(i[1],d,g);if(s&&n&&o){var v=30*o;_+=-v*Math.log(1+Math.max(0,p-i[0])/v)+v*Math.log(1+Math.max(0,i[0]-f)/v),y+=-v*Math.log(1+Math.max(0,d-i[1])/v)+v*Math.log(1+Math.max(0,i[1]-g)/v)}return[_,y]}}}function yl(t){return t}function vl(t,e,n,i){var o=Be(e)/n[0],r=Ne(e)/n[1];return i?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function ml(t,e,n){var i=Math.min(t,e);return i*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(i=Math.max(i,n),i/=Math.log(1+50*Math.max(0,n/t-1))/50+1),He(i,n/2,2*e)}function xl(t,e,n,i,o){return function(r,s,a,l){if(void 0!==r){var h=i?vl(t,i,a,o):t;return(void 0===n||n)&&l?ml(r,h,e):He(r,e,h)}}}function wl(t){return void 0!==t?0:void 0}function Cl(t){return void 0!==t?t:void 0}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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bl=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=$({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=jn(i.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,i.projection&&Pn(),i.center&&(i.center=Vn(i.center,n.projection_)),i.extent&&(i.extent=Hn(i.extent,n.projection_)),n.applyOptions_(i),n}return Sl(e,t),e.prototype.applyOptions_=function(t){var e=$({},t);for(var n in dl)delete e[n];this.setProperties(e,!0);var i=function(t){var e,n,i,o=28,r=2,s=void 0!==t.minZoom?t.minZoom:0,a=void 0!==t.maxZoom?t.maxZoom:o,l=void 0!==t.zoomFactor?t.zoomFactor:r,h=void 0!==t.multiWorld&&t.multiWorld,u=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,p=jn(t.projection,"EPSG:3857"),f=p.getExtent(),d=t.constrainOnlyCenter,g=t.extent;h||g||!p.isGlobal()||(d=!1,g=f);if(void 0!==t.resolutions){var _=t.resolutions;n=_[s],i=void 0!==_[a]?_[a]:_[_.length-1],e=t.constrainResolution?function(t,e,n,i){return function(o,r,s,a){if(void 0!==o){var l=t[0],h=t[t.length-1],u=n?vl(l,n,s,i):l;if(a)return void 0===e||e?ml(o,u,h):He(o,h,u);var c=Math.min(u,o),p=Math.floor(K(t,c,r));return t[p]>u&&p<t.length-1?t[p+1]:t[p]}}}(_,u,!d&&g,c):xl(n,i,u,!d&&g,c)}else{var y=(f?Math.max(Be(f),Ne(f)):360*Vt[Ut.DEGREES]/p.getMetersPerUnit())/gl/Math.pow(r,0),v=y/Math.pow(r,o-0);void 0!==(n=t.maxResolution)?s=0:n=y/Math.pow(l,s),void 0===(i=t.minResolution)&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(l,a):y/Math.pow(l,a):v),a=s+Math.floor(Math.log(n/i)/Math.log(l)),i=n/Math.pow(l,a-s),e=t.constrainResolution?function(t,e,n,i,o,r){return function(s,a,l,h){if(void 0!==s){var u=o?vl(e,o,l,r):e,c=void 0!==n?n:0;if(h)return void 0===i||i?ml(s,u,c):He(s,c,u);var p=Math.ceil(Math.log(e/u)/Math.log(t)-1e-9),f=-a*(.5-1e-9)+.5,d=Math.min(u,s),g=Math.floor(Math.log(e/d)/Math.log(t)+f),_=Math.max(p,g);return He(e/Math.pow(t,_),c,u)}}}(l,n,i,u,!d&&g,c):xl(n,i,u,!d&&g,c)}return{constraint:e,maxResolution:n,minResolution:i,minZoom:s,zoomFactor:l}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;var o=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return _l(t.extent,t.constrainOnlyCenter,e)}var n=jn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&n.isGlobal()){var i=n.getExtent().slice();return i[0]=-1/0,i[2]=1/0,_l(i,!1,!1)}return yl}(t),r=i.constraint,s=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=o||tn(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=r?0:t:void 0}):!1===e?Cl:"number"==typeof e?(n=e,i=2*Math.PI/n,function(t,e){return e?t:void 0!==t?t=Math.floor(t/i+.5)*i:void 0}):Cl}return wl;var n,i;var o,r}(t);this.constraints_={center:o,resolution:r,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var n=this.getCenter();if(n){var i=t||[0,0,0,0];e=e||[0,0,0,0];var o=this.getResolution(),r=o/2*(i[3]-e[3]+e[1]-i[1]),s=o/2*(i[0]-e[0]+e[2]-i[2]);this.setCenterInternal([n[0]+r,n[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),$({},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 i=arguments[n];i.center&&((i=$({},i)).center=Vn(i.center,this.getProjection())),i.anchor&&((i=$({},i)).anchor=Vn(i.anchor,this.getProjection())),e[n]=i}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 i=0;i<n&&!this.isDef();++i){var o=arguments[i];o.center&&this.setCenterInternal(o.center),void 0!==o.zoom?this.setZoom(o.zoom):o.resolution&&this.setResolution(o.resolution),void 0!==o.rotation&&this.setRotation(o.rotation)}if(i!==n){for(var r=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_,h=[];i<n;++i){var u=arguments[i],c={start:r,complete:!1,anchor:u.anchor,duration:void 0!==u.duration?u.duration:1e3,easing:u.easing||ba,callback:e};if(u.center&&(c.sourceCenter=s,c.targetCenter=u.center.slice(),s=c.targetCenter),void 0!==u.zoom?(c.sourceResolution=a,c.targetResolution=this.getResolutionForZoom(u.zoom),a=c.targetResolution):u.resolution&&(c.sourceResolution=a,c.targetResolution=u.resolution,a=c.targetResolution),void 0!==u.rotation){c.sourceRotation=l;var p=en(u.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+p,l=c.targetRotation}Tl(c)?c.complete=!0:r+=c.duration,h.push(c)}this.animations_.push(h),this.setHint(ys,1),this.updateAnimations_()}else e&&El(e,!0)},e.prototype.getAnimating=function(){return this.hints_[ys]>0},e.prototype.getInteracting=function(){return this.hints_[vs]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(ys,-this.hints_[ys]);for(var e=0,n=this.animations_.length;e<n;++e){var i=this.animations_[e];if(i[0].callback&&El(i[0].callback,!1),!t)for(var o=0,r=i.length;o<r;++o){var s=i[o];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 i=this.animations_[n],o=!0,r=0,s=i.length;r<s;++r){var a=i[r];if(!a.complete){var l=t-a.start,h=a.duration>0?l/a.duration:1;h>=1?(a.complete=!0,h=1):o=!1;var u=a.easing(h);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+u*(f-c),_=p+u*(d-p);this.targetCenter_=[g,_]}if(a.sourceResolution&&a.targetResolution){var y=1===u?a.targetResolution:a.sourceResolution+u*(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===u?en(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(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(o){this.animations_[n]=null,this.setHint(ys,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var C=i[0].callback;C&&El(C,!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,i,o,r=this.getCenterInternal();return void 0!==r&&(Tn(n=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),o=e,(i=n)[0]+=+o[0],i[1]+=+o[1]),n},e.prototype.calculateCenterZoom=function(t,e){var n,i=this.getCenterInternal(),o=this.getResolution();void 0!==i&&void 0!==o&&(n=[e[0]-t*(e[0]-i[0])/o,e[1]-t*(e[1]-i[1])/o]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*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?Zn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(dl.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Un(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();It(n,1);var i=this.getResolution();It(void 0!==i,2);var o=this.getRotation();return It(void 0!==o,3),We(n,i,o,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(dl.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(Hn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),i=Be(t)/n[0],o=Ne(t)/n[1];return Math.max(i,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,o=Math.log(n/i)/Math.log(e);return function(t){return n/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(dl.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,o=Math.log(n/i)/e;return function(t){return Math.log(n/t)/e/o}},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(),i=this.getCenterInternal(),o=this.padding_;if(o){var r=this.getViewportSizeMinusPadding_();i=Ol(i,this.getViewportSize_(),[r[0]/2+o[3],r[1]/2+o[0]],e,n)}return{center:i.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,i=this.minZoom_||0;if(this.resolutions_){var o=K(this.resolutions_,t,1);i=o,e=this.resolutions_[o],n=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,n=this.zoomFactor_;return i+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=He(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,He(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(It(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))It(!Ve(t),25),n=Li(i=Hn(t,this.getProjection()));else if(t.getType()===Bt){var i;(n=Li(i=Hn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),ze(i))}else{n=t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),i=Math.sin(-e),o=t.getFlatCoordinates(),r=t.getStride(),s=1/0,a=1/0,l=-1/0,h=-1/0,u=0,c=o.length;u<c;u+=r){var p=o[u]*n-o[u+1]*i,f=o[u]*i+o[u+1]*n;s=Math.min(s,p),a=Math.min(a,f),l=Math.max(l,p),h=Math.max(h,f)}return[s,a,l,h]},e.prototype.fitInternal=function(t,e){var n=e||{},i=n.size;i||(i=this.getViewportSizeMinusPadding_());var o,r=void 0!==n.padding?n.padding:[0,0,0,0],s=void 0!==n.nearest&&n.nearest;o=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.getResolutionForZoom(n.maxZoom):0;var a=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(a,[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,s?0:1);var h=this.getRotation(),u=Math.sin(h),c=Math.cos(h),p=ze(a);p[0]+=(r[1]-r[3])/2*l,p[1]+=(r[0]-r[2])/2*l;var f=p[0]*c-p[1]*u,d=p[1]*c+p[0]*u,g=this.getConstrainedCenter([f,d],l),_=n.callback?n.callback:q;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),El(_,!0))},e.prototype.centerOn=function(t,e,n){this.centerOnInternal(Vn(t,this.getProjection()),e,n)},e.prototype.centerOnInternal=function(t,e,n){this.setCenterInternal(Ol(t,e,n,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,n,i){var o,r=this.padding_;if(r&&t){var s=this.getViewportSizeMinusPadding_(-n),a=Ol(t,i,[s[0]/2+r[3],s[1]/2+r[0]],e,n);o=[t[0]-a[0],t[1]-a[1]]}return o},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=Zn(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&&Vn(e,this.getProjection());this.adjustResolutionInternal(t,n)},e.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,i,n);e&&(this.targetCenter_=this.calculateCenterZoom(o,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=Vn(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(i,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?Vn(t,this.getProjection()):t)},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,i=this.constraints_.rotation(this.targetRotation_,n),o=this.getViewportSize_(i),r=this.constraints_.resolution(this.targetResolution_,0,o,n),s=this.constraints_.center(this.targetCenter_,r,o,n,this.calculateCenterShift(this.targetCenter_,r,i,o));this.get(dl.ROTATION)!==i&&this.set(dl.ROTATION,i),this.get(dl.RESOLUTION)!==r&&(this.set(dl.RESOLUTION,r),this.set("zoom",this.getZoom(),!0)),s&&this.get(dl.CENTER)&&En(this.get(dl.CENTER),s)||this.set(dl.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,n){var i=void 0!==t?t:200,o=e||0,r=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,o,s),l=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,r,s));if(0===i&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var h=n||(0===i?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===r&&this.getCenterInternal()&&En(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:i,easing:Sa,anchor:h}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(vs,1)},e.prototype.endInteraction=function(t,e,n){var i=n&&Vn(n,this.getProjection());this.endInteractionInternal(t,e,i)},e.prototype.endInteractionInternal=function(t,e,n){this.setHint(vs,-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,i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,i)},e}(Ct);function El(t,e){setTimeout((function(){t(e)}),0)}function Tl(t){return!(t.sourceCenter&&t.targetCenter&&!En(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ol(t,e,n,i,o){var r=Math.cos(-o),s=Math.sin(-o),a=t[0]*r-t[1]*s,l=t[1]*r+t[0]*s;return[(a+=(e[0]/2-n[0])*i)*r-(l+=(n[1]-e[1]/2)*i)*(s=-s),l*r+a*s]}var Rl=bl,Il=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Pl(t){t instanceof cr?t.setMapInternal(null):t instanceof Xa&&t.getLayers().forEach(Pl)}function Ml(t,e){if(t instanceof cr)t.setMapInternal(e);else if(t instanceof Xa)for(var n=t.getLayers().getArray(),i=0,o=n.length;i<o;++i)Ml(n[i],e)}var Ll=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,i,o,r={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Xa({layers:t.layers});r[ol]=s,r[sl]=t.target,r[al]=t.view instanceof Rl?t.view:new Rl,void 0!==t.controls&&(Array.isArray(t.controls)?n=new Rt(t.controls.slice()):(It("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?i=new Rt(t.interactions.slice()):(It("function"==typeof t.interactions.getArray,48),i=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?o=new Rt(t.overlays.slice()):(It("function"==typeof t.overlays.getArray,49),o=t.overlays):o=new Rt;return{controls:n,interactions:i,keyboardEventTarget:e,overlays:o,values:r}}(e);n.renderComplete_,n.loaded_=!0,n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:te,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_=i.keyboardEventTarget,n.targetChangeHandlerKeys_=null,n.controls=i.controls||new Rt,n.interactions=i.interactions||new Rt,n.overlays_=i.overlays,n.overlayIdIndex_={},n.renderer_=null,n.postRenderFunctions_=[],n.tileQueue_=new fl(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(ol,n.handleLayerGroupChanged_),n.addChangeListener(al,n.handleViewChanged_),n.addChangeListener(rl,n.handleSizeChanged_),n.addChangeListener(sl,n.handleTargetChanged_),n.setProperties(i.values);var o=n;return!e.view||e.view instanceof Rl||e.view.then((function(t){o.setView(new Rl(t))})),n.controls.addEventListener(St,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(bt,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(St,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(bt,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(St,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(bt,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 Il(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){Ml(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_&&this.renderer_){var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,r=void 0!==n.layerFilter?n.layerFilter:U,s=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,o,s,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.getAllLayers=function(){var t=[];return function e(n){n.forEach((function(n){n instanceof Xa?e(n.getLayers()):t.push(n)}))}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_&&this.renderer_){var i=n||{},o=void 0!==i.hitTolerance?i.hitTolerance:0,r=i.layerFilter||U;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,o,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:U,o=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,o,r,i,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(sl)},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 Zn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())},e.prototype.getCoordinateFromPixelInternal=function(t){var e=this.frameState_;return e?oe(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(ol)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof Rt)e.setLayers(t);else{var n=e.getLayers();n.clear(),n.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var i=t[e];if(i.visible){var o=i.layer.getRenderer();if(o&&!o.ready)return!0;var r=i.layer.getSource();if(r&&r.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=Vn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)},e.prototype.getPixelFromCoordinateInternal=function(t){var e=this.frameState_;return e?oe(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(rl)},e.prototype.getView=function(){return this.get(al)},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,i){return function(t,e,n,i,o){if(!t||!(n in t.wantedTiles))return ll;if(!t.wantedTiles[n][e.getKey()])return ll;var r=t.viewState.center,s=i[0]-r[0],a=i[1]-r[1];return 65536*Math.log(o)+Math.sqrt(s*s+a*a)/o}(this.frameState_,t,e,n,i)},e.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,i=new Za(n,this,t);this.handleMapBrowserEvent(i)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,n=e.type;if(n===Ha||n===ft||n===lt){var i=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():i,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(o===i?i.documentElement:o).contains(r))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_,i=n;if(t){var o=t.viewHints;if(o[ys]||o[vs]){var r=Date.now()-t.time>8;n=r?0:8,i=r?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,i))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(ji)&&this.renderer_.dispatchRenderEvent(ji,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Ka(il,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Ka(nl,this,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(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)_t(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(rt,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(ft,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,ao(this.viewport_)}var n=this.getTargetElement();if(n){for(var i in n.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new Ja(this,this.moveTolerance_),Va)this.mapBrowserEventHandler_.addEventListener(Va[i],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(rt,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(ft,this.boundHandleBrowserEvent_,!!ie&&{passive:!1});var o=this.getOwnerDocument().defaultView,r=this.keyboardEventTarget_?this.keyboardEventTarget_:n;this.targetChangeHandlerKeys_=[dt(r,lt,this.handleBrowserEvent,this),dt(r,ht,this.handleBrowserEvent,this),dt(o,ct,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(_t(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(_t(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=dt(t,N,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=dt(t,it,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(_t),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Wa("addlayer",t)),this.layerGroupPropertyListenerKeys_=[dt(t,N,this.render,this),dt(t,it,this.render,this),dt(t,"addlayer",this.handleLayerAdd_,this),dt(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var i=t[e].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){Pl(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,n=this.getSize(),i=this.getView(),o=this.frameState_,r=null;if(void 0!==n&&Bi(n)&&i&&i.isDef()){var s=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();if(r={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:{},mapId:D(this),renderTargets:{}},a.nextCenter&&a.nextResolution){var l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;r.nextExtent=We(a.nextCenter,a.nextResolution,l,n)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),o)(!this.previousExtent_||!Ve(this.previousExtent_)&&!Ie(r.extent,this.previousExtent_))&&(this.dispatchEvent(new Ka(tl,this,o)),this.previousExtent_=Re(this.previousExtent_));this.previousExtent_&&!r.viewHints[ys]&&!r.viewHints[vs]&&!Ie(r.extent,this.previousExtent_)&&(this.dispatchEvent(new Ka(el,this,r)),xe(r.extent,this.previousExtent_))}this.dispatchEvent(new Ka(Qa,this,r)),this.renderComplete_=this.hasListener(nl)||this.hasListener(il)||this.hasListener(ji)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new Wa("removelayer",e)),this.set(ol,t)},e.prototype.setSize=function(t){this.set(rl,t)},e.prototype.setTarget=function(t){this.set(sl,t)},e.prototype.setView=function(t){if(!t||t instanceof Rl)this.set(al,t);else{this.set(al,new Rl);var e=this;t.then((function(t){e.setView(new Rl(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var n=getComputedStyle(t),i=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),o=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);isNaN(i)||isNaN(o)||!Bi(e=[i,o])&&(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}(Ct),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Al=function(t){function e(e){var n=t.call(this)||this,i=e.element;return!i||e.target||i.style.pointerEvents||(i.style.pointerEvents="auto"),n.element=i||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return Fl(e,t),e.prototype.disposeInternal=function(){ao(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&ao(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)_t(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==q&&this.listenerKeys.push(dt(t,Qa,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}(Ct),kl=Al,Dl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),jl=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).ulElement_=document.createElement("ul"),n.collapsed_=void 0===i.collapsed||i.collapsed,n.userCollapsed_=n.collapsed_,n.overrideCollapsible_=void 0!==i.collapsible,n.collapsible_=void 0===i.collapsible||i.collapsible,n.collapsible_||(n.collapsed_=!1);var o=void 0!==i.className?i.className:"ol-attribution",r=void 0!==i.tipLabel?i.tipLabel:"Attributions",s=void 0!==i.expandClassName?i.expandClassName:o+"-expand",a=void 0!==i.collapseLabel?i.collapseLabel:"›",l=void 0!==i.collapseClassName?i.collapseClassName:o+"-collapse";"string"==typeof a?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=a,n.collapseLabel_.className=l):n.collapseLabel_=a;var h=void 0!==i.label?i.label:"i";"string"==typeof h?(n.label_=document.createElement("span"),n.label_.textContent=h,n.label_.className=s):n.label_=h;var u=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=r,n.toggleButton_.appendChild(u),n.toggleButton_.addEventListener(st,n.handleClick_.bind(n),!1);var c=o+" "+"ol-unselectable "+uo+(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 Dl(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],i=!0,o=t.layerStatesArray,r=0,s=o.length;r<s;++r){var a=o[r];if(ur(a,t.viewState)){var l=a.layer.getSource();if(l){var h=l.getAttributions();if(h){var u=h(t);if(u)if(i=i&&!1!==l.getAttributionsCollapsible(),Array.isArray(u))for(var c=0,p=u.length;c<p;++c)u[c]in e||(n.push(u[c]),e[u[c]]=!0);else u in e||(n.push(u),e[u]=!0)}}}}return this.overrideCollapsible_||this.setCollapsible(i),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),!V(e,this.renderedAttributions_)){lo(this.ulElement_);for(var i=0,o=e.length;i<o;++i){var r=document.createElement("li");r.innerHTML=e[i],this.ulElement_.appendChild(r)}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(co),this.collapsed_?so(this.collapseLabel_,this.label_):so(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}(kl),zl=jl,Gl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wl=function(t){function e(e){var n=this,i=e||{};n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var o=void 0!==i.className?i.className:"ol-rotate",r=void 0!==i.label?i.label:"⇧",s=void 0!==i.compassClassName?i.compassClassName:"ol-compass";n.label_=null,"string"==typeof r?(n.label_=document.createElement("span"),n.label_.className=s,n.label_.textContent=r):(n.label_=r,n.label_.classList.add(s));var a=i.tipLabel?i.tipLabel:"Reset rotation",l=document.createElement("button");l.className=o+"-reset",l.setAttribute("type","button"),l.title=a,l.appendChild(n.label_),l.addEventListener(st,n.handleClick_.bind(n),!1);var h=o+" "+"ol-unselectable "+uo,u=n.element;return u.className=h,u.appendChild(l),n.callResetNorth_=i.resetNorth?i.resetNorth:void 0,n.duration_=void 0!==i.duration?i.duration:250,n.autoHide_=void 0===i.autoHide||i.autoHide,n.rotation_=void 0,n.autoHide_&&n.element.classList.add(ho),n}return Gl(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:Sa}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var i="rotate("+n+"rad)";if(this.autoHide_){var o=this.element.classList.contains(ho);o||0!==n?o&&0!==n&&this.element.classList.remove(ho):this.element.classList.add(ho)}this.label_.style.transform=i}this.rotation_=n}},e}(kl),Nl=Wl,Xl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Yl=function(t){function e(e){var n=this,i=e||{};n=t.call(this,{element:document.createElement("div"),target:i.target})||this;var o=void 0!==i.className?i.className:"ol-zoom",r=void 0!==i.delta?i.delta:1,s=void 0!==i.zoomInClassName?i.zoomInClassName:o+"-in",a=void 0!==i.zoomOutClassName?i.zoomOutClassName:o+"-out",l=void 0!==i.zoomInLabel?i.zoomInLabel:"+",h=void 0!==i.zoomOutLabel?i.zoomOutLabel:"–",u=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",c=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",p=document.createElement("button");p.className=s,p.setAttribute("type","button"),p.title=u,p.appendChild("string"==typeof l?document.createTextNode(l):l),p.addEventListener(st,n.handleClick_.bind(n,r),!1);var f=document.createElement("button");f.className=a,f.setAttribute("type","button"),f.title=c,f.appendChild("string"==typeof h?document.createTextNode(h):h),f.addEventListener(st,n.handleClick_.bind(n,-r),!1);var d=o+" "+"ol-unselectable "+uo,g=n.element;return g.className=d,g.appendChild(p),g.appendChild(f),n.duration_=void 0!==i.duration?i.duration:250,n}return Xl(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 i=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:Sa})):e.setZoom(i)}}},e}(kl),Kl=Yl,Bl="bottom-left",Zl="bottom-center",Vl="bottom-right",Ul="center-left",Hl="center-center",ql="center-right",$l="top-left",Jl="top-center",Ql="top-right",th=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),eh="element",nh="map",ih="offset",oh="position",rh="positioning",sh=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.options=e,n.id=e.id,n.insertFirst=void 0===e.insertFirst||e.insertFirst,n.stopEvent=void 0===e.stopEvent||e.stopEvent,n.element=document.createElement("div"),n.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",n.element.style.position="absolute",n.element.style.pointerEvents="auto";var i=e.autoPan;return i&&"object"!=typeof i&&(i={animation:e.autoPanAnimation,margin:e.autoPanMargin}),n.autoPan=i||!1,n.rendered={transform_:"",visible:!0},n.mapPostrenderListenerKey=null,n.addChangeListener(eh,n.handleElementChanged),n.addChangeListener(nh,n.handleMapChanged),n.addChangeListener(ih,n.handleOffsetChanged),n.addChangeListener(oh,n.handlePositionChanged),n.addChangeListener(rh,n.handlePositioningChanged),void 0!==e.element&&n.setElement(e.element),n.setOffset(void 0!==e.offset?e.offset:[0,0]),n.setPositioning(void 0!==e.positioning?e.positioning:$l),void 0!==e.position&&n.setPosition(e.position),n}return th(e,t),e.prototype.getElement=function(){return this.get(eh)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(nh)||null},e.prototype.getOffset=function(){return this.get(ih)},e.prototype.getPosition=function(){return this.get(oh)},e.prototype.getPositioning=function(){return this.get(rh)},e.prototype.handleElementChanged=function(){lo(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(ao(this.element),_t(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=dt(t,Qa,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(eh,t)},e.prototype.setMap=function(t){this.set(nh,t)},e.prototype.setOffset=function(t){this.set(ih,t)},e.prototype.setPosition=function(t){this.set(oh,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(oh)){var n=this.getRect(e.getTargetElement(),e.getSize()),i=this.getElement(),o=this.getRect(i,[oo(i),ro(i)]),r=t||{},s=void 0===r.margin?20:r.margin;if(!Se(n,o)){var a=o[0]-n[0],l=n[2]-o[2],h=o[1]-n[1],u=n[3]-o[3],c=[0,0];if(a<0?c[0]=a-s:l<0&&(c[0]=Math.abs(l)+s),h<0?c[1]=h-s:u<0&&(c[1]=Math.abs(u)+s),0!==c[0]||0!==c[1]){var p=e.getView().getCenterInternal(),f=e.getPixelFromCoordinateInternal(p);if(!f)return;var d=[f[0]+c[0],f[1]+c[1]],g=r.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var n=t.getBoundingClientRect(),i=n.left+window.pageXOffset,o=n.top+window.pageYOffset;return[i,o,i+e[0],o+e[1]]},e.prototype.setPositioning=function(t){this.set(rh,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var n=t.getPixelFromCoordinate(e),i=t.getSize();this.updateRenderedPosition(n,i)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var n=this.element.style,i=this.getOffset(),o=this.getPositioning();this.setVisible(!0);var r=Math.round(t[0]+i[0])+"px",s=Math.round(t[1]+i[1])+"px",a="0%",l="0%";o==Vl||o==ql||o==Ql?a="-100%":o!=Zl&&o!=Hl&&o!=Jl||(a="-50%"),o==Bl||o==Zl||o==Vl?l="-100%":o!=Ul&&o!=Hl&&o!=ql||(l="-50%");var h="translate(".concat(a,", ").concat(l,") translate(").concat(r,", ").concat(s,")");this.rendered.transform_!=h&&(this.rendered.transform_=h,n.transform=h,n.msTransform=h)},e.prototype.getOptions=function(){return this.options},e}(Ct),ah=sh;var lh="active",hh=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function uh(t,e,n,i){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),s=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:void 0!==i?i:250,easing:Sa})}}var ch=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 hh(e,t),e.prototype.getActive=function(){return this.get(lh)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(lh,t)},e.prototype.setMap=function(t){this.map_=t},e}(Ct),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),fh=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.delta_=i.delta?i.delta:1,n.duration_=void 0!==i.duration?i.duration:250,n}return ph(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Va.DBLCLICK){var n=t.originalEvent,i=t.map,o=t.coordinate,r=n.shiftKey?-this.delta_:this.delta_;uh(i.getView(),r,o,this.duration_),n.preventDefault(),e=!0}return!e},e}(ch),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function gh(t){for(var e=t.length,n=0,i=0,o=0;o<e;o++)n+=t[o].clientX,i+=t[o].clientY;return[n/e,i/e]}var _h=function(t){function e(e){var n=this,i=e||{};return n=t.call(this,i)||this,i.handleDownEvent&&(n.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(n.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(n.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(n.handleUpEvent=i.handleUpEvent),i.stopDown&&(n.stopDown=i.stopDown),n.handlingDownUpSequence=!1,n.trackedPointers_={},n.targetPointers=[],n}return dh(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==Va.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Va.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==Va.POINTERDOWN){var i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Va.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===Va.POINTERDOWN||e===Va.POINTERDRAG||e===Va.POINTERUP}(t)){var e=t.originalEvent,n=e.pointerId.toString();t.type==Va.POINTERUP?delete this.trackedPointers_[n]:(t.type==Va.POINTERDOWN||n in this.trackedPointers_)&&(this.trackedPointers_[n]=e),this.targetPointers=Q(this.trackedPointers_)}},e}(ch);function yh(t){var e=arguments;return function(t){for(var n=!0,i=0,o=e.length;i<o&&(n=n&&e[i](t));++i);return n}}var vh=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},mh=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),n=t.map.getOwnerDocument().activeElement;return e.contains(n)}(t)},xh=U,wh=function(t){var e=t.originalEvent;return 0==e.button&&!(Jt&&Qt&&e.ctrlKey)},Ch=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},Sh=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},bh=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},Eh=function(t){var e=t.originalEvent;return It(void 0!==e,56),"mouse"==e.pointerType},Th=function(t){var e=t.originalEvent;return It(void 0!==e,56),e.isPrimary&&0===e.button},Oh=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rh=function(t){function e(e){var n=t.call(this,{stopDown:H})||this,i=e||{};n.kinetic_=i.kinetic,n.lastCentroid=null,n.lastPointersCount_,n.panning_=!1;var o=i.condition?i.condition:yh(Ch,Th);return n.condition_=i.onFocusOnly?yh(mh,o):o,n.noKinetic_=!1,n}return Oh(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=gh(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var i=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],o=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(i,o.getResolution()),Tn(i,o.getRotation()),o.adjustCenterInternal(i)}}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 i=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),r=n.getCenterInternal(),s=e.getPixelFromCoordinateInternal(r),a=e.getCoordinateFromPixelInternal([s[0]-i*Math.cos(o),s[1]-i*Math.sin(o)]);n.animateInternal({center:n.getConstrainedCenter(a),duration:500,easing:Sa})}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}(_h),Ih=Rh,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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Mh=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,{stopDown:H})||this).condition_=i.condition?i.condition:vh,n.lastAngle_=void 0,n.duration_=void 0!==i.duration?i.duration:250,n}return Ph(e,t),e.prototype.handleDragEvent=function(t){if(Eh(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==wl){var i=e.getSize(),o=t.pixel,r=Math.atan2(i[1]/2-o[1],o[0]-i[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_;n.adjustRotationInternal(-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!Eh(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!Eh(t)&&(!(!wh(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(_h),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fh=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 Lh(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",i=this.element_.style;i.left=Math.min(t[0],e[0])+n,i.top=Math.min(t[1],e[1])+n,i.width=Math.abs(e[0]-t[0])+n,i.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 Mi([n])},e.prototype.getGeometry=function(){return this.geometry_},e}(X),Ah=Fh,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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dh="boxstart",jh="boxdrag",zh="boxend",Gh="boxcancel",Wh=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.coordinate=n,o.mapBrowserEvent=i,o}return kh(e,t),e}(W),Nh=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=e||{};return n.box_=new Ah(i.className||"ol-dragbox"),n.minArea_=void 0!==i.minArea?i.minArea:64,i.onBoxEnd&&(n.onBoxEnd=i.onBoxEnd),n.startPixel_=null,n.condition_=i.condition?i.condition:wh,n.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:n.defaultBoxEndCondition,n}return kh(e,t),e.prototype.defaultBoxEndCondition=function(t,e,n){var i=n[0]-e[0],o=n[1]-e[1];return i*i+o*o>=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 Wh(jh,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 Wh(e?zh:Gh,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 Wh(Dh,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(_h),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Yh=function(t){function e(e){var n=this,i=e||{},o=i.condition?i.condition:Sh;return(n=t.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this).duration_=void 0!==i.duration?i.duration:200,n.out_=void 0!==i.out&&i.out,n}return Xh(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var i=e.rotatedExtentForGeometry(n),o=e.getResolutionForExtentInternal(i),r=e.getResolution()/o;(n=n.clone()).scale(r*r)}e.fitInternal(n,{duration:this.duration_,easing:Sa})},e}(Nh),Kh=37,Bh=38,Zh=39,Vh=40,Uh=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Hh=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.defaultCondition_=function(t){return Ch(t)&&bh(t)},n.condition_=void 0!==i.condition?i.condition:n.defaultCondition_,n.duration_=void 0!==i.duration?i.duration:100,n.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128,n}return Uh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==lt){var n=t.originalEvent,i=n.keyCode;if(this.condition_(t)&&(i==Vh||i==Kh||i==Zh||i==Bh)){var o=t.map.getView(),r=o.getResolution()*this.pixelDelta_,s=0,a=0;i==Vh?a=-r:i==Kh?s=-r:i==Zh?s=r:a=r;var l=[s,a];Tn(l,o.getRotation()),function(t,e,n){var i=t.getCenterInternal();if(i){var o=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:Ea,center:t.getConstrainedCenter(o)})}}(o,l,this.duration_),n.preventDefault(),e=!0}}return!e},e}(ch),qh=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),$h=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.condition_=i.condition?i.condition:bh,n.delta_=i.delta?i.delta:1,n.duration_=void 0!==i.duration?i.duration:100,n}return qh(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==lt||t.type==ht){var n=t.originalEvent,i=n.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var o=t.map,r=i=="+".charCodeAt(0)?this.delta_:-this.delta_;uh(o.getView(),r,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(ch),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qh="trackpad",tu="wheel",eu=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,i)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==i.maxDelta?i.maxDelta:1,n.duration_=void 0!==i.duration?i.duration:250,n.timeout_=void 0!==i.timeout?i.timeout:80,n.useAnchor_=void 0===i.useAnchor||i.useAnchor,n.constrainResolution_=void 0!==i.constrainResolution&&i.constrainResolution;var o=i.condition?i.condition:xh;return n.condition_=i.onFocusOnly?yh(mh,o):o,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return Jh(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!==ft)return!0;var e,n=t.map,i=t.originalEvent;if(i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==ft&&(e=i.deltaY,qt&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=te),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Qh:tu);var r=n.getView();if(this.mode_===Qh&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(o-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=-He(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),uh(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}(ch),nu=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),iu=function(t){function e(e){var n=this,i=e||{},o=i;return o.stopDown||(o.stopDown=H),(n=t.call(this,o)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==i.threshold?i.threshold:.3,n.duration_=void 0!==i.duration?i.duration:250,n}return nu(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],i=this.targetPointers[1],o=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==wl){var l=s.getViewport().getBoundingClientRect(),h=gh(this.targetPointers);h[0]-=l.left,h[1]-=l.top,this.anchor_=s.getCoordinateFromPixelInternal(h),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}(_h),ou=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ru=function(t){function e(e){var n=this,i=e||{},o=i;return o.stopDown||(o.stopDown=H),(n=t.call(this,o)||this).anchor_=null,n.duration_=void 0!==i.duration?i.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return ou(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],i=this.targetPointers[1],o=n.clientX-i.clientX,r=n.clientY-i.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);var h=a.getViewport().getBoundingClientRect(),u=gh(this.targetPointers);u[0]-=h.left,u[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(u),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}(_h);var 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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),au=function(t){function e(e){return(e=$({},e)).controls||(e.controls=function(t){var e=t||{},n=new Rt;return(void 0===e.zoom||e.zoom)&&n.push(new Kl(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new Nl(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new zl(e.attributionOptions)),n}()),e.interactions||(e.interactions=function(t){var e=t||{},n=new Rt,i=new Ma(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new Mh),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new fh({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new Ih({onFocusOnly:e.onFocusOnly,kinetic:i})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new iu),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new ru({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new Hh),n.push(new $h({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new eu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new Yh({duration:e.zoomDuration})),n}({onFocusOnly:!0})),t.call(this,e)||this}return su(e,t),e.prototype.createRenderer=function(){return new za(this)},e}(Ll),lu=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.expireCache=function(t){for(;this.canExpireCache();)this.pop()},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 It(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 It(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){It(!(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 hu(t,e,n,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=n,i):[t,e,n]}function uu(t,e,n){return t+"/"+e+"/"+n}function cu(t){return uu(t[0],t[1],t[2])}var 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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),fu=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return pu(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=function(t){return t.split("/").map(Number)}(this.peekFirstKey()),e=t[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(cu(t.tileCoord)),t.release())}.bind(this))}},e}(lu),du=fu,gu=function(){function t(t,e,n,i){this.minX=t,this.maxX=e,this.minY=n,this.maxY=i}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 _u(t,e,n,i,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=n,o.maxY=i,o):new gu(t,e,n,i)}var yu,vu=gu,mu=function(){function t(t,e,n,i,o,r){this.sourceProj_=t,this.targetProj_=e;var s={},a=Nn(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_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&Be(i)==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=Ye(n),h=Ke(n),u=je(n),c=De(n),p=this.transformInv_(l),f=this.transformInv_(h),d=this.transformInv_(u),g=this.transformInv_(c),_=10+(r?Math.max(0,Math.ceil($e(ke(n)/(r*r*256*256)))):0);if(this.addQuad_(l,h,u,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,i,o,r){this.triangles_.push({source:[i,o,r],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,i,o,r,s,a,l){var h=ve([o,r,s,a]),u=this.sourceWorldWidth_?Be(h)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&u>.5&&u<1,f=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)f=Be(ve([t,e,n,i]))/this.targetWorldWidth_>.25||f;!p&&this.sourceProj_.isGlobal()&&u&&(f=u>.25||f)}if(!(!f&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3]))||Ze(h,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[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=(en(o[0],c)+en(s[0],c))/2-en(_[0],c);else y=(o[0]+s[0])/2-_[0];var v=(o[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=[(i[0]+t[0])/2,(i[1]+t[1])/2],C=this.transformInv_(w);this.addQuad_(t,e,m,w,o,r,x,C,l-1),this.addQuad_(w,m,n,i,C,x,s,a,l-1)}else{var S=[(t[0]+e[0])/2,(t[1]+e[1])/2],b=this.transformInv_(S),E=[(n[0]+i[0])/2,(n[1]+i[1])/2],T=this.transformInv_(E);this.addQuad_(t,S,E,i,o,b,T,a,l-1),this.addQuad_(S,e,n,E,b,r,s,T,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,n,i,o,s,a),0==(14&d)&&this.addTriangle_(t,n,e,o,s,r),d&&(0==(13&d)&&this.addTriangle_(e,i,t,r,a,o),0==(7&d)&&this.addTriangle_(e,i,n,r,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,n,i){var o=e.source;Me(t,o[0]),Me(t,o[1]),Me(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),xu={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},wu={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0};function Cu(t,e,n,i,o){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(i,o),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,o)),t.restore()}function Su(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function bu(t,e,n,i){var o=Xn(n,e,t),r=kn(e,i,n),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var l=t.getExtent();if(!l||Ce(l,o)){var h=kn(t,r,o)/r;isFinite(h)&&h>0&&(r/=h)}return r}function Eu(t,e,n,i,o,r,s,a,l,h,u,c){var p=io(Math.round(n*t),Math.round(n*e));if(c||$(p,xu),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){Pe(d,t.extent)}));var g=Be(d),_=Ne(d),y=io(Math.round(n*g/i),Math.round(n*_/i));c||$(y,xu);var v=n/i;l.forEach((function(t,e,n){var i=t.extent[0]-d[0],o=-(t.extent[3]-d[3]),r=Be(t.extent),s=Ne(t.extent);t.image.width>0&&t.image.height>0&&y.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,i*v,o*v,r*v,s*v)}));var m=Ye(s);return a.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,l=s[0][0],h=s[0][1],u=s[1][0],g=s[1][1],_=s[2][0],v=s[2][1],x=f((a[0][0]-m[0])/r),w=f(-(a[0][1]-m[1])/r),C=f((a[1][0]-m[0])/r),S=f(-(a[1][1]-m[1])/r),b=f((a[2][0]-m[0])/r),E=f(-(a[2][1]-m[1])/r),T=l,O=h;l=0,h=0;var R=function(t){for(var e=t.length,n=0;n<e;n++){for(var i=n,o=Math.abs(t[n][n]),r=n+1;r<e;r++){var s=Math.abs(t[r][n]);s>o&&(o=s,i=r)}if(0===o)return null;var a=t[i];t[i]=t[n],t[n]=a;for(var l=n+1;l<e;l++)for(var h=-t[l][n]/t[n][n],u=n;u<e+1;u++)n==u?t[l][u]=0:t[l][u]+=h*t[n][u]}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}([[u-=T,g-=O,0,0,C-x],[_-=T,v-=O,0,0,b-x],[0,0,u,g,S-w],[0,0,_,v,E-w]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===yu){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Cu(t,4,5,4,0),Cu(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;yu=Su(e,0)||Su(e,4)||Su(e,8)}return yu}()||!c){p.moveTo(C,S);for(var I=x-C,P=w-S,M=0;M<4;M++)p.lineTo(C+f((M+1)*I/4),S+f(M*P/3)),3!=M&&p.lineTo(C+f((M+1)*I/4),S+f((M+1)*P/3));p.lineTo(b,E)}else p.moveTo(C,S),p.lineTo(x,w),p.lineTo(b,E);p.clip(),p.transform(R[0],R[2],R[1],R[3],x,w),p.translate(d[0]-T,d[3]-O),p.scale(i/n,-i/n),p.drawImage(y.canvas,0,0),p.restore()}})),u&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach((function(t,e,n){var i=t.target,o=(i[0][0]-m[0])/r,s=-(i[0][1]-m[1])/r,a=(i[1][0]-m[0])/r,l=-(i[1][1]-m[1])/r,h=(i[2][0]-m[0])/r,u=-(i[2][1]-m[1])/r;p.beginPath(),p.moveTo(a,l),p.lineTo(o,s),p.lineTo(h,u),p.closePath(),p.stroke()})),p.restore()),p.canvas}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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ou=function(t){function e(e,n,i,o,r,s,a,l,h,u,c,p){var f=t.call(this,r,ya,{interpolate:!!p})||this;f.renderEdges_=void 0!==c&&c,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=n,f.targetTileGrid_=o,f.wrappedTileCoord_=s||r,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=o.getTileCoordExtent(f.wrappedTileCoord_),g=f.targetTileGrid_.getExtent(),_=f.sourceTileGrid_.getExtent(),y=g?Xe(d,g):d;if(0===ke(y))return f.state=wa,f;var v=e.getExtent();v&&(_=_?Xe(_,v):v);var m=o.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,n,i){var o=ze(n),r=bu(t,e,o,i);return(!isFinite(r)||r<=0)&&Ae(n,(function(n){return r=bu(t,e,n,i),isFinite(r)&&r>0})),r}(e,i,y,m);if(!isFinite(x)||x<=0)return f.state=wa,f;var w=void 0!==u?u:.5;if(f.triangulation_=new mu(e,i,y,_,x*w,m),0===f.triangulation_.getTriangles().length)return f.state=wa,f;f.sourceZ_=n.getZForResolution(x);var C=f.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(C[1]=He(C[1],_[1],_[3]),C[3]=He(C[3],_[1],_[3])):C=Xe(C,_)),ke(C)){for(var S=n.getTileRangeForExtentAndZ(C,f.sourceZ_),b=S.minX;b<=S.maxX;b++)for(var E=S.minY;E<=S.maxY;E++){var T=h(f.sourceZ_,b,E,a);T&&f.sourceTiles_.push(T)}0===f.sourceTiles_.length&&(f.state=wa)}else f.state=wa;return f}return Tu(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,i){e&&e.getState()==ma&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=xa;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),i="number"==typeof n?n:n[0],o="number"==typeof n?n:n[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Eu(i,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=ma}this.changed()},e.prototype.load=function(){if(this.state==ya){this.state=va,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,i){var o=e.getState();if(o==ya||o==va){t++;var r=dt(e,it,(function(n){var i=e.getState();i!=ma&&i!=xa&&i!=wa||(_t(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,n){t.getState()==ya&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(_t),this.sourcesListenerKeys_=null},e}(Oa),Ru="tileloadstart",Iu="tileloadend",Pu="tileloaderror",Mu=[0,0,0],Lu=function(){function t(t){var e,n,i,o;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,It((e=this.resolutions_,n=!0,i=function(t,e){return e-t}||Y,e.every((function(t,o){if(0===o)return!0;var r=i(e[o-1],t);return!(r>0||n&&0===r)}))),17),!t.origins)for(var r=0,s=this.resolutions_.length-1;r<s;++r)if(o){if(this.resolutions_[r]/this.resolutions_[r+1]!==o){o=void 0;break}}else o=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=o,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,It(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=Ye(a)),It(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,It(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:gl,It(!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 vu(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 i=this.getTileRangeForExtentAndZ(a,e);n.minX=Math.max(i.minX,n.minX),n.maxX=Math.min(i.maxX,n.maxX),n.minY=Math.max(i.minY,n.minY),n.maxY=Math.min(i.maxY,n.maxY)}return n}),this):a&&this.calculateTileRanges_(a)}return t.prototype.forEachTileCoord=function(t,e,n){for(var i=this.getTileRangeForExtentAndZ(t,e),o=i.minX,r=i.maxX;o<=r;++o)for(var s=i.minY,a=i.maxY;s<=a;++s)n([e,o,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,i){var o,r,s=null,a=t[0]-1;for(2===this.zoomFactor_?(o=t[1],r=t[2]):s=this.getTileCoordExtent(t,i);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?_u(o=Math.floor(o/2),o,r=Math.floor(r/2),r,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 i=2*t[1],o=2*t[2];return _u(i,i+1,o,o+1,e)}var r=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var i=t[0],o=t[1],r=t[2];if(e===i)return _u(o,r,o,r,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-i),a=Math.floor(o*s),l=Math.floor(r*s);return e<i?_u(a,a,l,l,n):_u(a,Math.floor(s*(o+1))-1,l,Math.floor(s*(r+1))-1,n)}var h=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(h,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var i=this.getOrigin(t),o=this.getResolution(t),r=Zi(this.getTileSize(t),this.tmpSize_),s=i[0]+e.minX*r[0]*o,a=i[0]+(e.maxX+1)*r[0]*o;return Oe(s,i[1]+e.minY*r[1]*o,a,i[1]+(e.maxY+1)*r[1]*o,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var i=Mu;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,i);var o=i[1],r=i[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,i),_u(o,i[1],r,i[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=Zi(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*i[0]*n,e[1]-(t[2]+.5)*i[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=Zi(this.getTileSize(t[0]),this.tmpSize_),r=n[0]+t[1]*o[0]*i,s=n[1]-(t[2]+1)*o[1]*i;return Oe(r,s,r+o[0]*i,s+o[1]*i,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,i,o){var r=this.getZForResolution(n),s=n/this.getResolution(r),a=this.getOrigin(r),l=Zi(this.getTileSize(r),this.tmpSize_),h=s*(t-a[0])/n/l[0],u=s*(a[1]-e)/n/l[1];return i?(h=sn(h,5)-1,u=sn(u,5)-1):(h=rn(h,5),u=rn(u,5)),hu(r,h,u,o)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,i,o){var r=this.getOrigin(n),s=this.getResolution(n),a=Zi(this.getTileSize(n),this.tmpSize_),l=(t-r[0])/s/a[0],h=(r[1]-e)/s/a[1];return i?(l=sn(l,5)-1,h=sn(h,5)-1):(l=rn(l,5),h=rn(h,5)),hu(n,l,h,o)},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 He(K(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),i=this.minZoom;i<e;++i)n[i]=this.getTileRangeForExtentAndZ(t,i);this.fullTileRanges_=n},t}(),Fu=Lu;function Au(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,n,i){return function(t,e,n,i){var o=void 0!==i?i:ue,r=ku(t,e,n);return new Fu({extent:t,origin:Ge(t,o),resolutions:r,tileSize:n})}(Du(t),e,n,i)}(t),t.setDefaultTileGrid(e)),e}function ku(t,e,n,i){for(var o=void 0!==e?e:42,r=Ne(t),s=Be(t),a=Zi(void 0!==n?n:gl),l=i>0?i:Math.max(s/a[0],r/a[1]),h=o+1,u=new Array(h),c=0;c<h;++c)u[c]=l/Math.pow(2,c);return u}function Du(t){var e=(t=An(t)).getExtent();if(!e){var n=180*Vt[Ut.DEGREES]/t.getMetersPerUnit();e=Oe(-n,-n,n,n)}return e}var 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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),zu=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||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;return n.tileGrid&&Zi(n.tileGrid.getTileSize(n.tileGrid.getMinZoom()),[256,256]),n.tileCache=new du(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition,interpolate:e.interpolate},n.zDirection=e.zDirection?e.zDirection:0,n}return ju(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,i){var o=this.getTileCacheForProjection(t);if(!o)return!1;for(var r,s,a,l=!0,h=n.minX;h<=n.maxX;++h)for(var u=n.minY;u<=n.maxY;++u)s=uu(e,h,u),a=!1,o.containsKey(s)&&(a=(r=o.get(s)).getState()===ma)&&(a=!1!==i(r)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,n,i,o){return A()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Au(t)},e.prototype.getTileCacheForProjection=function(t){return It(Gn(this.getProjection(),t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var i,o,r,s=this.getTileGridForProjection(n),a=this.getTilePixelRatio(e),l=Zi(s.getTileSize(t),this.tmpSize);return 1==a?l:(i=l,o=a,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=i[0]*o+.5|0,r[1]=i[1]*o+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),i=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var i=e[0],o=t.getTileCoordCenter(e),r=Du(n);if(Ce(r,o))return e;var s=Be(r),a=Math.ceil((r[0]-o[0])/s);return o[0]+=s*a,t.getTileCoordForCoordAndZ(o,i)}(i,t,n)),function(t,e){var n=t[0],i=t[1],o=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var r=e.getFullTileRange(n);return!r||r.containsXY(i,o)}(t,i)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,i){},e}(ta),Gu=function(t){function e(e,n){var i=t.call(this,e)||this;return i.tile=n,i}return ju(e,t),e}(W),Wu=zu;function Nu(t,e){var n=/\{z\}/g,i=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,l){return s?t.replace(n,s[0].toString()).replace(i,s[1].toString()).replace(o,s[2].toString()).replace(r,(function(){var t=s[0],n=e.getFullTileRange(t);return It(n,55),(n.getHeight()-s[2]-1).toString()})):void 0}}function Xu(t,e){for(var n=t.length,i=new Array(n),o=0;o<n;++o)i[o]=Nu(t[o],e);return function(t){if(1===t.length)return t[0];return function(e,n,i){if(e){var o=function(t){return(t[1]<<t[0])+t[2]}(e),r=en(o,t.length);return t[r](e,n,i)}}}(i)}var Yu=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ku=function(t){function e(n){var i=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,interpolate:n.interpolate,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return i.generateTileUrlFunction_=i.tileUrlFunction===e.prototype.tileUrlFunction,i.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(i.tileUrlFunction=n.tileUrlFunction),i.urls=null,n.urls?i.setUrls(n.urls):n.url&&i.setUrl(n.url),i.tileLoadingKeys_={},i}return Yu(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=D(n),o=n.getState();o==va?(this.tileLoadingKeys_[i]=!0,e=Ru):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],e=o==xa?Pu:o==ma?Iu:void 0),null!=e&&this.dispatchEvent(new Gu(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 i=n[1].charCodeAt(0),o=n[2].charCodeAt(0),r=void 0;for(r=i;r<=o;++r)e.push(t.replace(n[0],String.fromCharCode(r)));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(Xu(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var i=uu(t,e,n);this.tileCache.containsKey(i)&&this.tileCache.get(i)},e}(Wu),Bu=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zu=function(t){function e(e){var n=this,i=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(i=e.interpolate),(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:Vu,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:i,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:Pa,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.renderReprojectionEdges_=!1,n}return Bu(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 i in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var o=this.tileCacheForProjection[i];o.expireCache(o==n?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Gn(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Gn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Gn(e,t)){var n=D(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Au(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Gn(e,t))return this.tileCache;var n=D(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new du(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,i,o,r){var s=[t,e,n],a=this.getTileCoordForTileUrlFunction(s,o),l=a?this.tileUrlFunction(a,i,o):void 0,h=new this.tileClass(s,void 0!==l?ya:wa,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=r,h.addEventListener(it,this.handleTileChange.bind(this)),h},e.prototype.getTile=function(t,e,n,i,o){var r=this.getProjection();if(r&&o&&!Gn(r,o)){var s=this.getTileCacheForProjection(o),a=[t,e,n],l=void 0,h=cu(a);s.containsKey(h)&&(l=s.get(h));var u=this.getKey();if(l&&l.key==u)return l;var c=this.getTileGridForProjection(r),p=this.getTileGridForProjection(o),f=this.getTileCoordForTileUrlFunction(a,o),d=new Ou(r,c,o,p,a,f,this.getTilePixelRatio(i),this.getGutter(),function(t,e,n,i){return this.getTileInternal(t,e,n,i,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return d.key=u,l?(d.interimTile=l,d.refreshInterimChain(),s.replace(h,d)):s.set(h,d),d}return this.getTileInternal(t,e,n,i,r||o)},e.prototype.getTileInternal=function(t,e,n,i,o){var r=null,s=uu(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)){if((r=this.tileCache.get(s)).key!=a){var l=r;r=this.createTile_(t,e,n,i,o,a),l.getState()==ya?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(s,r)}}else r=this.createTile_(t,e,n,i,o,a),this.tileCache.set(s,r);return r},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=An(t);if(n){var i=D(n);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}},e}(Ku);function Vu(t,e){t.getImage().src=e}var Uu=Zu,Hu=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),qu=function(t){function e(e){var n=e||{},i=void 0===n.imageSmoothing||n.imageSmoothing;void 0!==n.interpolate&&(i=n.interpolate);var o=void 0!==n.projection?n.projection:"EPSG:3857",r=void 0!==n.tileGrid?n.tileGrid:function(t){var e=t||{},n=e.extent||An("EPSG:3857").getExtent(),i={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:ku(n,e.maxZoom,e.tileSize,e.maxResolution)};return new Fu(i)}({extent:Du(o),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,interpolate:i,opaque:n.opaque,projection:o,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileGrid:r,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 Hu(e,t),e}(Uu),$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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ju=function(t){function e(e){var n,i=e||{},o=void 0===i.imageSmoothing||i.imageSmoothing;void 0!==i.interpolate&&(o=i.interpolate),n=void 0!==i.attributions?i.attributions:['&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];var r=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",s=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:n,attributionsCollapsible:!1,cacheSize:i.cacheSize,crossOrigin:r,interpolate:o,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,opaque:void 0===i.opaque||i.opaque,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,transition:i.transition,url:s,wrapX:i.wrapX,zDirection:i.zDirection})||this}return $u(e,t),e}(qu),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),tc=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 vu(0,0,0,0),n}return Qu(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==ma||n==wa||n==xa&&!i},e.prototype.getTile=function(t,e,n,i){var o=i.pixelRatio,r=i.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,o,r);return a.getState()==xa&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(ma)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),i=oe(e.pixelToCoordinateTransform,t.slice()),o=n.getExtent();if(o&&!Ce(o,i))return null;for(var r=e.pixelRatio,s=e.viewState.projection,a=e.viewState,l=n.getRenderSource(),h=l.getTileGridForProjection(a.projection),u=l.getTilePixelRatio(e.pixelRatio),c=h.getZForResolution(a.resolution);c>=h.getMinZoom();--c){var p=h.getTileCoordForCoordAndZ(i,c),f=l.getTile(c,p[1],p[2],r,s);if(!(f instanceof Pa||f instanceof Ou))return null;if(f.getState()===ma){var d=h.getOrigin(c),g=Zi(h.getTileSize(c)),_=h.getResolution(c),y=Math.floor(u*((i[0]-d[0])/_-p[1]*g[0])),v=Math.floor(u*((d[1]-i[1])/_-p[2]*g[1]));return this.getImageData(f.getImage(),y,v)}}return null},e.prototype.loadedTileCallback=function(e,n,i){return!!this.isDrawableTile(i)&&t.prototype.loadedTileCallback.call(this,e,n,i)},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,r=i.resolution,s=i.center,a=i.rotation,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(o),f=p.getZForResolution(r,u.zDirection),d=p.getResolution(f),g=t.extent,_=n.extent&&Hn(n.extent);_&&(g=Xe(g,Hn(n.extent)));var y=u.getTilePixelRatio(l),v=Math.round(t.size[0]*y),m=Math.round(t.size[1]*y);if(a){var x=Math.round(Math.sqrt(v*v+m*m));v=x,m=x}var w=d*v/2/y,C=d*m/2/y,S=[s[0]-w,s[1]-C,s[0]+w,s[1]+C],b=p.getTileRangeForExtentAndZ(g,f),E={};E[f]={};var T=this.createLoadedTileFinder(u,o,E),O=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var I=b.minX;I<=b.maxX;++I)for(var P=b.minY;P<=b.maxY;++P){var M=this.getTile(f,I,P,t);if(this.isDrawableTile(M)){var L=D(this);if(M.getState()==ma){E[f][M.tileCoord.toString()]=M;var F=M.inTransition(L);this.newTiles_||!F&&-1!==this.renderedTiles.indexOf(M)||(this.newTiles_=!0)}if(1===M.getAlpha(L,t.time))continue}var A=p.getTileCoordChildTileRange(M.tileCoord,R,O),k=!1;A&&(k=T(f+1,A)),k||p.forEachTileCoordParentTileRange(M.tileCoord,T,R,O)}var j=d/r;re(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/y,1/y,a,-v/2,-m/2);var z=ae(this.pixelTransform);this.useContainer(e,z,n.opacity,this.getBackground(t));var G=this.context,W=G.canvas;se(this.inversePixelTransform,this.pixelTransform),re(this.tempTransform,v/2,m/2,j,j,0,-v/2,-m/2),W.width!=v||W.height!=m?(W.width=v,W.height=m):this.containerReused||G.clearRect(0,0,v,m),_&&this.clipUnrotated(G,t,_),u.getInterpolate()||$(G,xu),this.preRender(G,t),this.renderedTiles.length=0;var N,X,K,B=Object.keys(E).map(Number);B.sort(Y),1!==n.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(N=[],X=[]):B=B.reverse();for(var Z=B.length-1;Z>=0;--Z){var V=B[Z],U=u.getTilePixelSize(V,l,o),H=p.getResolution(V)/d,q=U[0]*H*j,J=U[1]*H*j,Q=p.getTileCoordForCoordAndZ(Ye(S),V),tt=p.getTileCoordExtent(Q),et=oe(this.tempTransform,[y*(tt[0]-S[0])/d,y*(S[3]-tt[3])/d]),nt=y*u.getGutterForProjection(o),it=E[V];for(var ot in it){var rt=(M=it[ot]).tileCoord,st=Q[1]-rt[1],at=Math.round(et[0]-(st-1)*q),lt=Q[2]-rt[2],ht=Math.round(et[1]-(lt-1)*J),ut=at-(I=Math.round(et[0]-st*q)),ct=ht-(P=Math.round(et[1]-lt*J)),pt=f===V,ft=!1;if(!(F=pt&&1!==M.getAlpha(D(this),t.time)))if(N){K=[I,P,I+ut,P,I+ut,P+ct,I,P+ct];for(var dt=0,gt=N.length;dt<gt;++dt)if(f!==V&&V<X[dt]){var _t=N[dt];Ze([I,P,I+ut,P+ct],[_t[0],_t[3],_t[4],_t[7]])&&(ft||(G.save(),ft=!0),G.beginPath(),G.moveTo(K[0],K[1]),G.lineTo(K[2],K[3]),G.lineTo(K[4],K[5]),G.lineTo(K[6],K[7]),G.moveTo(_t[6],_t[7]),G.lineTo(_t[4],_t[5]),G.lineTo(_t[2],_t[3]),G.lineTo(_t[0],_t[1]),G.clip())}N.push(K),X.push(V)}else G.clearRect(I,P,ut,ct);this.drawTileImage(M,t,I,P,ut,ct,nt,pt),N&&!F?(ft&&G.restore(),this.renderedTiles.unshift(M)):this.renderedTiles.push(M),this.updateUsedTiles(t.usedTiles,u,M)}}this.renderedRevision=c,this.renderedResolution=d,this.extentChanged=!this.renderedExtent_||!Ie(this.renderedExtent_,S),this.renderedExtent_=S,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(t,u,p,l,o,g,f,h.getPreload()),this.scheduleExpireCache(t,u),this.postRender(G,t),n.extent&&G.restore(),$(G,wu),z!==W.style.transform&&(W.style.transform=z);var yt=_o(n.opacity),vt=this.container;return yt!==vt.style.opacity&&(vt.style.opacity=yt),this.container},e.prototype.drawTileImage=function(t,e,n,i,o,r,s,a){var l=this.getTileImage(t);if(l){var h=D(this),u=a?t.getAlpha(h,e.time):1,c=u!==this.context.globalAlpha;c&&(this.context.save(),this.context.globalAlpha=u),this.context.drawImage(l,s,s,l.width-2*s,l.height-2*s,n,i,o,r),c&&this.context.restore(),1!==u?e.animate=!0:a&&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=D(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=D(e);i in t||(t[i]={}),t[i][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,i,o,r,s,a,l){var h=D(e);h in t.wantedTiles||(t.wantedTiles[h]={});var u,c,p,f,d,g,_=t.wantedTiles[h],y=t.tileQueue,v=0;for(g=n.getMinZoom();g<=s;++g)for(c=n.getTileRangeForExtentAndZ(r,g,c),p=n.getResolution(g),f=c.minX;f<=c.maxX;++f)for(d=c.minY;d<=c.maxY;++d)s-g<=a?(++v,(u=e.getTile(g,f,d,i,o)).getState()==ya&&(_[u.getKey()]=!0,y.isKeyQueued(u.getKey())||y.enqueue([u,h,n.getTileCoordCenter(u.tileCoord),p])),void 0!==l&&l(u)):e.useTile(g,f,d,o);e.updateCacheSize(v,o)},e}(Ur),ec=tc,nc="preload",ic="useInterimTilesOnError",oc=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),rc=function(t){function e(e){var n=this,i=e||{},o=$({},i);return delete o.preload,delete o.useInterimTilesOnError,(n=t.call(this,o)||this).on,n.once,n.un,n.setPreload(void 0!==i.preload?i.preload:0),n.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),n}return oc(e,t),e.prototype.getPreload=function(){return this.get(nc)},e.prototype.setPreload=function(t){this.set(nc,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(ic)},e.prototype.setUseInterimTilesOnError=function(t){this.set(ic,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(cr),sc=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ac=function(t){function e(e){return t.call(this,e)||this}return sc(e,t),e.prototype.createRenderer=function(){return new ec(this)},e}(rc);const lc='\n\t.ol-box {\n\tbox-sizing: border-box;\n\tborder-radius: 2px;\n\tborder: 1.5px solid #b3c5db;\n\tbackground-color: rgba(255, 255, 255, 0.4);\n}\n.ol-mouse-position {\n\ttop: 8px;\n\tright: 8px;\n\tposition: absolute;\n}\n.ol-scale-line {\n\tbackground: rgba(0, 60, 136, 0.3);\n\tborder-radius: 4px;\n\tbottom: 8px;\n\tleft: 8px;\n\tpadding: 2px;\n\tposition: absolute;\n}\n.ol-scale-line-inner {\n\tborder: 1px solid #eee;\n\tborder-top: none;\n\tcolor: #eee;\n\tfont-size: 10px;\n\ttext-align: center;\n\tmargin: 1px;\n\twill-change: contents, width;\n\ttransition: all 0.25s;\n}\n.ol-scale-bar {\n\tposition: absolute;\n\tbottom: 8px;\n\tleft: 8px;\n}\n.ol-scale-step-marker {\n\twidth: 1px;\n\theight: 15px;\n\tbackground-color: #000;\n\tfloat: right;\n\tz-index: 10;\n}\n.ol-scale-step-text {\n\tposition: absolute;\n\tbottom: -5px;\n\tfont-size: 12px;\n\tz-index: 11;\n\tcolor: #000;\n\ttext-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff;\n}\n.ol-scale-text {\n\tposition: absolute;\n\tfont-size: 14px;\n\ttext-align: center;\n\tbottom: 25px;\n\tcolor: #000;\n\ttext-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff;\n}\n.ol-scale-singlebar {\n\tposition: relative;\n\theight: 10px;\n\tz-index: 9;\n\tbox-sizing: border-box;\n\tborder: 1px solid #000;\n}\n.ol-unsupported {\n\tdisplay: none;\n}\n.ol-unselectable,\n.ol-viewport {\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-tap-highlight-color: transparent;\n}\n.ol-viewport canvas {\n\tall: unset;\n}\n.ol-selectable {\n\t-webkit-touch-callout: default;\n\t-webkit-user-select: text;\n\t-moz-user-select: text;\n\t-ms-user-select: text;\n\tuser-select: text;\n}\n.ol-grabbing {\n\tcursor: -webkit-grabbing;\n\tcursor: -moz-grabbing;\n\tcursor: grabbing;\n}\n.ol-grab {\n\tcursor: move;\n\tcursor: -webkit-grab;\n\tcursor: -moz-grab;\n\tcursor: grab;\n}\n.ol-control {\n\tposition: absolute;\n\tbackground-color: rgba(255, 255, 255, 0.4);\n\tborder-radius: 4px;\n\tpadding: 2px;\n}\n.ol-control:hover {\n\tbackground-color: rgba(255, 255, 255, 0.6);\n}\n.ol-zoom {\n\ttop: 0.5em;\n\tleft: 0.5em;\n}\n.ol-rotate {\n\ttop: 0.5em;\n\tright: 0.5em;\n\ttransition: opacity 0.25s linear, visibility 0s linear;\n}\n.ol-rotate.ol-hidden {\n\topacity: 0;\n\tvisibility: hidden;\n\ttransition: opacity 0.25s linear, visibility 0s linear 0.25s;\n}\n.ol-zoom-extent {\n\ttop: 4.643em;\n\tleft: 0.5em;\n}\n.ol-full-screen {\n\tright: 0.5em;\n\ttop: 0.5em;\n}\n.ol-control button {\n\tdisplay: block;\n\tmargin: 1px;\n\tpadding: 0;\n\tcolor: #fff;\n\tfont-weight: 700;\n\ttext-decoration: none;\n\tfont-size: inherit;\n\ttext-align: center;\n\theight: 1.375em;\n\twidth: 1.375em;\n\tline-height: 0.4em;\n\tbackground-color: rgba(0, 60, 136, 0.5);\n\tborder: none;\n\tborder-radius: 2px;\n}\n.ol-control button::-moz-focus-inner {\n\tborder: none;\n\tpadding: 0;\n}\n.ol-zoom-extent button {\n\tline-height: 1.4em;\n}\n.ol-compass {\n\tdisplay: block;\n\tfont-weight: 400;\n\tfont-size: 1.2em;\n\twill-change: transform;\n}\n.ol-touch .ol-control button {\n\tfont-size: 1.5em;\n}\n.ol-touch .ol-zoom-extent {\n\ttop: 5.5em;\n}\n.ol-control button:focus,\n.ol-control button:hover {\n\ttext-decoration: none;\n\tbackground-color: rgba(0, 60, 136, 0.7);\n}\n.ol-zoom .ol-zoom-in {\n\tborder-radius: 2px 2px 0 0;\n}\n.ol-zoom .ol-zoom-out {\n\tborder-radius: 0 0 2px 2px;\n}\n.ol-attribution {\n\ttext-align: right;\n\tbottom: 0.5em;\n\tright: 0.5em;\n\tmax-width: calc(100% - 1.3em);\n\tdisplay: flex;\n\tflex-flow: row-reverse;\n\talign-items: center;\n}\n.ol-attribution a {\n\tcolor: rgba(0, 60, 136, 0.7);\n\ttext-decoration: none;\n}\n.ol-attribution ul {\n\tmargin: 0;\n\tpadding: 1px 0.5em;\n\tcolor: #000;\n\ttext-shadow: 0 0 2px #fff;\n\tfont-size: 12px;\n}\n.ol-attribution li {\n\tdisplay: inline;\n\tlist-style: none;\n}\n.ol-attribution li:not(:last-child):after {\n\tcontent: " ";\n}\n.ol-attribution img {\n\tmax-height: 2em;\n\tmax-width: inherit;\n\tvertical-align: middle;\n}\n.ol-attribution button {\n\tflex-shrink: 0;\n}\n.ol-attribution.ol-collapsed ul {\n\tdisplay: none;\n}\n.ol-attribution:not(.ol-collapsed) {\n\tbackground: rgba(255, 255, 255, 0.8);\n}\n.ol-attribution.ol-uncollapsible {\n\tbottom: 0;\n\tright: 0;\n\tborder-radius: 4px 0 0;\n}\n.ol-attribution.ol-uncollapsible img {\n\tmargin-top: -0.2em;\n\tmax-height: 1.6em;\n}\n.ol-attribution.ol-uncollapsible button {\n\tdisplay: none;\n}\n.ol-zoomslider {\n\ttop: 4.5em;\n\tleft: 0.5em;\n\theight: 200px;\n}\n.ol-zoomslider button {\n\tposition: relative;\n\theight: 10px;\n}\n.ol-touch .ol-zoomslider {\n\ttop: 5.5em;\n}\n.ol-overviewmap {\n\tleft: 0.5em;\n\tbottom: 0.5em;\n}\n.ol-overviewmap.ol-uncollapsible {\n\tbottom: 0;\n\tleft: 0;\n\tborder-radius: 0 4px 0 0;\n}\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n\tdisplay: block;\n}\n.ol-overviewmap .ol-overviewmap-map {\n\tborder: 1px solid #7b98bc;\n\theight: 150px;\n\tmargin: 2px;\n\twidth: 150px;\n}\n.ol-overviewmap:not(.ol-collapsed) button {\n\tbottom: 2px;\n\tleft: 2px;\n\tposition: absolute;\n}\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n\tdisplay: none;\n}\n.ol-overviewmap:not(.ol-collapsed) {\n\tbackground: rgba(255, 255, 255, 0.8);\n}\n.ol-overviewmap-box {\n\tborder: 2px dotted rgba(0, 60, 136, 0.7);\n}\n.ol-overviewmap .ol-overviewmap-box:hover {\n\tcursor: move;\n}\n.ol-popup {\n\tposition: absolute;\n\tbackground-color: white;\n\tbox-shadow: 0 1px 4px rgba(0,0,0,0.2);\n\tpadding: 15px;\n\tborder-radius: 10px;\n\tborder: 1px solid #cccccc;\n\tbottom: 12px;\n\tleft: -50px;\n\tmin-width: 280px;\n}\n.ol-popup:after, .ol-popup:before {\n\ttop: 100%;\n\tborder: solid transparent;\n\tcontent: " ";\n\theight: 0;\n\twidth: 0;\n\tposition: absolute;\n\tpointer-events: none;\n}\n.ol-popup:after {\n\tborder-top-color: white;\n\tborder-width: 10px;\n\tleft: 48px;\n\tmargin-left: -10px;\n}\n.ol-popup:before {\n\tborder-top-color: #cccccc;\n\tborder-width: 11px;\n\tleft: 48px;\n\tmargin-left: -11px;\n}\n.ol-popup-closer {\n\ttext-decoration: none;\n\tposition: absolute;\n\ttop: 3px;\n\tright: 3px;\n\tborder: none;\n background: none;\n\tcursor: pointer;\n}\n.ol-popup-closer:after {\n\tcontent: "✖";\n}\n\t\n\t';function hc(t,e,n){var i,o,r,s,a;function l(){var h=Date.now()-s;h<e&&h>=0?i=setTimeout(l,e-h):(i=null,n||(a=t.apply(r,o),r=o=null))}null==e&&(e=100);var h=function(){r=this,o=arguments,s=Date.now();var h=n&&!i;return i||(i=setTimeout(l,e)),h&&(a=t.apply(r,o),r=o=null),a};return h.clear=function(){i&&(clearTimeout(i),i=null)},h.flush=function(){i&&(a=t.apply(r,o),r=o=null,clearTimeout(i),i=null)},h}hc.debounce=hc;var uc=hc;function cc(e){let n,o,r,d,g,_,y,v;return{c(){n=h("div"),o=u(),r=h("div"),d=h("button"),g=u(),_=h("div"),this.c=t,p(n,"id","map"),f(n,"width","100%"),f(n,"height","100%"),p(d,"id","popup-closer"),p(d,"class","ol-popup-closer"),p(_,"id","popup-content"),p(r,"id","popup"),p(r,"class","ol-popup")},m(t,i){a(t,n,i),a(t,o,i),a(t,r,i),s(r,d),s(r,g),s(r,_),y||(v=[c(window,"resize",uc(e[0],200)),c(d,"click",e[8])],y=!0)},p:t,i:t,o:t,d(t){t&&l(n),t&&l(o),t&&l(r),y=!1,i(v)}}}function pc(t,e,n){const i=y(),o=v();function r(t,e){o(t,e),i.dispatchEvent&&i.dispatchEvent(new CustomEvent(t,{detail:e}))}let s,a,l,h,u,{id:c}=e,{zoom:p}=e,{center:f}=e,{data:d}=e,{source:g}=e,{options:_}=e;function m(){if(a){if(s){s=null;const t=document.createElement("style");t.innerHTML=lc,a.innerHTML="",a.appendChild(t)}const t=[];"osm"===g.type.toLowerCase()?t.push(new ac({source:new Ju})):"xyz"===g.type.toLowerCase()&&g.url&&t.push(new ac({source:new qu({url:g.url})}));let e=[],n=[1/0,1/0,-1/0,-1/0];if(null==d?void 0:d.filter((t=>t.marker)).length){const i=[];for(const t of d.filter((t=>t.marker)).map((t=>t.marker))){const o=new Lt({geometry:new wi(zn(t.lngLat)),icon:t.icon,marker:!0,id:t.id||void 0,popupHtml:t.popupHtml});i.push(o),e.push(t.lngLat),_.centerFromGeometries&&(n=Pe(n,o.getGeometry().getExtent()))}const o=new Vo({image:new Gs({scale:3,anchor:[.5,.8],src:"https://upload.wikimedia.org/wikipedia/commons/e/e7/Maki2-marker-18.svg"})}),r=new qs({source:new _a({features:i}),style(t){const e=t.get("icon");let n;return(null==e?void 0:e.uri)?(n=new Vo({image:new Gs({scale:e.scale||.15,anchor:e.anchor||[.5,.8],src:e.uri})}),n):o}});t.push(r)}u=new ah({element:l,autoPan:{animation:{duration:250}}}),s=new au({target:a,layers:t,overlays:[u],view:new Rl({center:zn(f),zoom:p})}),_.centerFromGeometries&&e.length>1?s.getView().fit(n,{padding:[25,25,25,25]}):_.centerFromGeometries&&s.getView().setCenter(zn(e[0])),s.on("singleclick",(function(t){!function(t){const e=Xn(t.coordinate,"EPSG:3857","EPSG:4326"),n=s.forEachFeatureAtPixel(t.pixel,(function(t,e){return t}));n&&n.get("marker")?(r("markerClick",{coordinates:{latitude:e[1],longitude:e[0]},id:n.get("id")}),n.get("popupHtml")&&(h.innerHTML=n.get("popupHtml"),u.setPosition(t.coordinate))):(u.setPosition(void 0),r("pointClickCoordinates",{coordinates:{latitude:e[1],longitude:e[0]}}))}(t)}))}}function x(t){var e,n;u.setPosition(void 0),null===(n=null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.blur)||void 0===n||n.call(e)}!function(t){y().$$.on_mount.push(t)}((()=>{a=i.shadowRoot.getElementById("map"),l=i.shadowRoot.getElementById("popup"),h=i.shadowRoot.getElementById("popup-content");const t=document.createElement("style");t.innerHTML=lc,a.appendChild(t),m()}));return t.$$set=t=>{"id"in t&&n(2,c=t.id),"zoom"in t&&n(3,p=t.zoom),"center"in t&&n(4,f=t.center),"data"in t&&n(5,d=t.data),"source"in t&&n(6,g=t.source),"options"in t&&n(7,_=t.options)},t.$$.update=()=>{252&t.$$.dirty&&(c||n(2,c=""),g?"string"==typeof g&&n(6,g=JSON.parse(g)):n(6,g={type:"osm"}),_?_&&"string"==typeof _&&n(7,_=JSON.parse(_)):n(7,_={}),p?"string"==typeof p&&n(3,p=Number(p)):n(3,p=6),f?"string"==typeof f&&n(4,f=JSON.parse(f)):n(4,f=[37.5176038,15.0819224]),d?"string"==typeof d&&n(5,d=JSON.parse(d)):n(5,d=[]),m())},[m,x,c,p,f,d,g,_,t=>x(t)]}class fc extends F{constructor(t){super(),this.shadowRoot.innerHTML="<style>:host{display:block;height:100%}</style>",L(this,{target:this.shadowRoot,props:d(this.attributes),customElement:!0},pc,cc,r,{id:2,zoom:3,center:4,data:5,source:6,options:7},null),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),R()))}static get observedAttributes(){return["id","zoom","center","data","source","options"]}get id(){return this.$$.ctx[2]}set id(t){this.$$set({id:t}),R()}get zoom(){return this.$$.ctx[3]}set zoom(t){this.$$set({zoom:t}),R()}get center(){return this.$$.ctx[4]}set center(t){this.$$set({center:t}),R()}get data(){return this.$$.ctx[5]}set data(t){this.$$set({data:t}),R()}get source(){return this.$$.ctx[6]}set source(t){this.$$set({source:t}),R()}get options(){return this.$$.ctx[7]}set options(t){this.$$set({options:t}),R()}}return customElements.define("hb-map",fc),fc}();
1
+ var release=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function i(t){t.forEach(e)}function o(t){return"function"==typeof t}function r(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function s(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function l(t){t.parentNode&&t.parentNode.removeChild(t)}function u(t){return document.createElement(t)}function h(){return t=" ",document.createTextNode(t);var t}function c(t,e,n,i){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n,i)}function p(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function f(t,e,n,i){null===n?t.style.removeProperty(e):t.style.setProperty(e,n,i?"important":"")}function d(t){const e={};for(const n of t)e[n.name]=n.value;return e}let g;function _(t){g=t}function y(){if(!g)throw new Error("Function called outside component initialization");return g}function v(){const t=y();return(e,n,{cancelable:i=!1}={})=>{const o=t.$$.callbacks[e];if(o){const r=function(t,e,{bubbles:n=!1,cancelable:i=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(t,n,i,e),o}(e,n,{cancelable:i});return o.slice().forEach((e=>{e.call(t,r)})),!r.defaultPrevented}return!0}}const m=[],x=[],E=[],C=[],w=Promise.resolve();let S=!1;function T(t){E.push(t)}const O=new Set;let b=0;function R(){if(0!==b)return;const t=g;do{try{for(;b<m.length;){const t=m[b];b++,_(t),I(t.$$)}}catch(t){throw m.length=0,b=0,t}for(_(null),m.length=0,b=0;x.length;)x.pop()();for(let t=0;t<E.length;t+=1){const e=E[t];O.has(e)||(O.add(e),e())}E.length=0}while(m.length);for(;C.length;)C.pop()();S=!1,O.clear(),_(t)}function I(t){if(null!==t.fragment){t.update(),i(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(T)}}const P=new Set;function M(t,e){-1===t.$$.dirty[0]&&(m.push(t),S||(S=!0,w.then(R)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function L(r,s,a,u,h,c,p,f=[-1]){const d=g;_(r);const y=r.$$={fragment:null,ctx:[],props:c,update:t,not_equal:h,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s.context||(d?d.$$.context:[])),callbacks:n(),dirty:f,skip_bound:!1,root:s.target||d.$$.root};p&&p(y.root);let v=!1;if(y.ctx=a?a(r,s.props||{},((t,e,...n)=>{const i=n.length?n[0]:e;return y.ctx&&h(y.ctx[t],y.ctx[t]=i)&&(!y.skip_bound&&y.bound[t]&&y.bound[t](i),v&&M(r,t)),e})):[],y.update(),v=!0,i(y.before_update),y.fragment=!!u&&u(y.ctx),s.target){if(s.hydrate){const t=function(t){return Array.from(t.childNodes)}(s.target);y.fragment&&y.fragment.l(t),t.forEach(l)}else y.fragment&&y.fragment.c();s.intro&&((m=r.$$.fragment)&&m.i&&(P.delete(m),m.i(x))),function(t,n,r,s){const{fragment:a,after_update:l}=t.$$;a&&a.m(n,r),s||T((()=>{const n=t.$$.on_mount.map(e).filter(o);t.$$.on_destroy?t.$$.on_destroy.push(...n):i(n),t.$$.on_mount=[]})),l.forEach(T)}(r,s.target,s.anchor,s.customElement),R()}var m,x;_(d)}let A;function D(){return function(){throw new Error("Unimplemented abstract method.")}()}"function"==typeof HTMLElement&&(A=class extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){const{on_mount:t}=this.$$;this.$$.on_disconnect=t.map(e).filter(o);for(const t in this.$$.slotted)this.appendChild(this.$$.slotted[t])}attributeChangedCallback(t,e,n){this[t]=n}disconnectedCallback(){i(this.$$.on_disconnect)}$destroy(){!function(t,e){const n=t.$$;null!==n.fragment&&(i(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=t}$on(e,n){if(!o(n))return t;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(n),()=>{const t=i.indexOf(n);-1!==t&&i.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}});var F=0;function k(t){return t.ol_uid||(t.ol_uid=String(++F))}var j,N="6.15.1",G=(j=function(t,e){return j=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])},j(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}j(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),z=function(t){function e(e){var n=this,i="Assertion failed. See https://openlayers.org/en/"+("v"+N.split("-")[0])+"/doc/errors/#"+e+" for details.";return(n=t.call(this,i)||this).code=e,n.name="AssertionError",n.message=i,n}return G(e,t),e}(Error),W=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}(),X={PROPERTYCHANGE:"propertychange"},Y=function(){function t(){this.disposed=!1}return t.prototype.dispose=function(){this.disposed||(this.disposed=!0,this.disposeInternal())},t.prototype.disposeInternal=function(){},t}();function K(t,e){return t>e?1:t<e?-1:0}function B(t,e,n){var i=t.length;if(t[0]<=e)return 0;if(e<=t[i-1])return i-1;var o=void 0;if(n>0){for(o=1;o<i;++o)if(t[o]<e)return o-1}else if(n<0){for(o=1;o<i;++o)if(t[o]<=e)return o}else for(o=1;o<i;++o){if(t[o]==e)return o;if(t[o]<e)return"function"==typeof n?n(e,t[o-1],t[o])>0?o-1:o:t[o-1]-e<e-t[o]?o-1:o}return i-1}function Z(t,e,n){for(;e<n;){var i=t[e];t[e]=t[n],t[n]=i,++e,--n}}function V(t,e){for(var n=Array.isArray(e)?e:[e],i=n.length,o=0;o<i;o++)t[t.length]=n[o]}function U(t,e){var n=t.length;if(n!==e.length)return!1;for(var i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function H(){return!0}function q(){return!1}function $(){}var J="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),i=1,o=arguments.length;i<o;++i){var r=arguments[i];if(null!=r)for(var s in r)r.hasOwnProperty(s)&&(n[s]=r[s])}return n};function Q(t){for(var e in t)delete t[e]}var tt="function"==typeof Object.values?Object.values:function(t){var e=[];for(var n in t)e.push(t[n]);return e};function et(t){var e;for(e in t)return!1;return!e}var nt=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),it=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 nt(e,t),e.prototype.addEventListener=function(t,e){if(t&&e){var n=this.listeners_||(this.listeners_={}),i=n[t]||(n[t]=[]);-1===i.indexOf(e)&&i.push(e)}},e.prototype.dispatchEvent=function(t){var e="string"==typeof t,n=e?t:t.type,i=this.listeners_&&this.listeners_[n];if(i){var o=e?new W(t):t;o.target||(o.target=this.eventTarget_||this);var r,s=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in s||(s[n]=0,a[n]=0),++s[n];for(var l=0,u=i.length;l<u;++l)if(!1===(r="handleEvent"in i[l]?i[l].handleEvent(o):i[l].call(this,o))||o.propagationStopped){r=!1;break}if(0==--s[n]){var h=a[n];for(delete a[n];h--;)this.removeEventListener(n,$);delete s[n]}return r}},e.prototype.disposeInternal=function(){this.listeners_&&Q(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 i=n.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[i]=$,++this.pendingRemovals_[t]):(n.splice(i,1),0===n.length&&delete this.listeners_[t]))}},e}(Y),ot={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function rt(t,e,n,i,o){if(i&&i!==t&&(n=n.bind(i)),o){var r=n;n=function(){t.removeEventListener(e,n),r.apply(this,arguments)}}var s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function st(t,e,n,i){return rt(t,e,n,i,!0)}function at(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Q(t))}var lt=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ut=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 lt(e,t),e.prototype.changed=function(){++this.revision_,this.dispatchEvent(ot.CHANGE)},e.prototype.getRevision=function(){return this.revision_},e.prototype.onInternal=function(t,e){if(Array.isArray(t)){for(var n=t.length,i=new Array(n),o=0;o<n;++o)i[o]=rt(this,t[o],e);return i}return rt(this,t,e)},e.prototype.onceInternal=function(t,e){var n;if(Array.isArray(t)){var i=t.length;n=new Array(i);for(var o=0;o<i;++o)n[o]=st(this,t[o],e)}else n=st(this,t,e);return e.ol_key=n,n},e.prototype.unInternal=function(t,e){var n=e.ol_key;if(n)!function(t){if(Array.isArray(t))for(var e=0,n=t.length;e<n;++e)at(t[e]);else at(t)}(n);else if(Array.isArray(t))for(var i=0,o=t.length;i<o;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)},e}(it);ut.prototype.on,ut.prototype.once,ut.prototype.un;var ht=ut,ct=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),pt=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.key=n,o.oldValue=i,o}return ct(e,t),e}(W),ft=function(t){function e(e){var n=t.call(this)||this;return n.on,n.once,n.un,k(n),n.values_=null,void 0!==e&&n.setProperties(e),n}return ct(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_&&J({},this.values_)||{}},e.prototype.hasProperties=function(){return!!this.values_},e.prototype.notify=function(t,e){var n;n="change:".concat(t),this.hasListener(n)&&this.dispatchEvent(new pt(n,t,e)),n=X.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new pt(n,t,e))},e.prototype.addChangeListener=function(t,e){this.addEventListener("change:".concat(t),e)},e.prototype.removeChangeListener=function(t,e){this.removeEventListener("change:".concat(t),e)},e.prototype.set=function(t,e,n){var i=this.values_||(this.values_={});if(n)i[t]=e;else{var o=i[t];i[t]=e,o!==e&&this.notify(t,o)}},e.prototype.setProperties=function(t,e){for(var n in t)this.set(n,t[n],e)},e.prototype.applyProperties=function(t){t.values_&&J(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],et(this.values_)&&(this.values_=null),e||this.notify(t,n)}},e}(ht),dt={ADD:"add",REMOVE:"remove"},gt=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_t="length",yt=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.element=n,o.index=i,o}return gt(e,t),e}(W),vt=function(t){function e(e,n){var i=t.call(this)||this;i.on,i.once,i.un;var o=n||{};if(i.unique_=!!o.unique,i.array_=e||[],i.unique_)for(var r=0,s=i.array_.length;r<s;++r)i.assertUnique_(i.array_[r],r);return i.updateLength_(),i}return gt(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,i=e.length;n<i;++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(_t)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new yt(dt.ADD,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,i=e.length;n<i;++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 yt(dt.REMOVE,e,t)),e},e.prototype.setAt=function(t,e){var n=this.getLength();if(t<n){this.unique_&&this.assertUnique_(e,t);var i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new yt(dt.REMOVE,i,t)),this.dispatchEvent(new yt(dt.ADD,e,t))}else{for(var o=n;o<t;++o)this.insertAt(o,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set(_t,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var n=0,i=this.array_.length;n<i;++n)if(this.array_[n]===t&&n!==e)throw new z(58)},e}(ft);function mt(t,e){if(!t)throw new z(e)}var xt=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Et=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 i=e;n.setGeometry(i)}else{var o=e;n.setProperties(o)}return n}return xt(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 i=this.getStyle();return i&&t.setStyle(i),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_&&(at(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=rt(t,ot.CHANGE,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:(mt("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}(ft);var Ct=Et,wt={XY:"XY",XYZ:"XYZ",XYM:"XYM",XYZM:"XYZM"},St={RADIANS:"radians",DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},Tt={};Tt[St.RADIANS]=6370997/(2*Math.PI),Tt[St.DEGREES]=2*Math.PI*6370997/360,Tt[St.FEET]=.3048,Tt[St.METERS]=1,Tt[St.USFEET]=1200/3937;var Ot=St,bt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",Rt=-1!==bt.indexOf("firefox");-1!==bt.indexOf("safari")&&-1==bt.indexOf("chrom")&&(bt.indexOf("version/15.4")>=0||bt.match(/cpu (os|iphone os) 15_4 like mac os x/));var It,Pt=-1!==bt.indexOf("webkit")&&-1==bt.indexOf("edge"),Mt=-1!==bt.indexOf("macintosh"),Lt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,At="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Dt="undefined"!=typeof Image&&Image.prototype.decode,Ft=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}();function kt(t,e){var n=e[0],i=e[1];return e[0]=t[0]*n+t[2]*i+t[4],e[1]=t[1]*n+t[3]*i+t[5],e}function jt(t,e,n,i,o,r,s,a){var l=Math.sin(r),u=Math.cos(r);return t[0]=i*u,t[1]=o*l,t[2]=-i*l,t[3]=o*u,t[4]=s*i*u-a*i*l+e,t[5]=s*o*l+a*o*u+n,t}function Nt(t,e){var n,i=(n=e)[0]*n[3]-n[1]*n[2];mt(0!==i,32);var o=e[0],r=e[1],s=e[2],a=e[3],l=e[4],u=e[5];return t[0]=a/i,t[1]=-r/i,t[2]=-s/i,t[3]=o/i,t[4]=(s*u-a*l)/i,t[5]=-(o*u-r*l)/i,t}function Gt(t){var e="matrix("+t.join(", ")+")";if(At)return e;var n=It||(It=document.createElement("div"));return n.style.transform=e,n.style.transform}new Array(6);var zt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Wt(t){for(var e=Ht(),n=0,i=t.length;n<i;++n)te(e,t[n]);return e}function Xt(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 Yt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Kt(t,e,n){var i,o;return(i=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*i+(o=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0)*o}function Bt(t,e){return Vt(t,e[0],e[1])}function Zt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Vt(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function Ut(t,e){var n=t[0],i=t[1],o=t[2],r=t[3],s=e[0],a=e[1],l=zt.UNKNOWN;return s<n?l|=zt.LEFT:s>o&&(l|=zt.RIGHT),a<i?l|=zt.BELOW:a>r&&(l|=zt.ABOVE),l===zt.UNKNOWN&&(l=zt.INTERSECTING),l}function Ht(){return[1/0,1/0,-1/0,-1/0]}function qt(t,e,n,i,o){return o?(o[0]=t,o[1]=e,o[2]=n,o[3]=i,o):[t,e,n,i]}function $t(t){return qt(1/0,1/0,-1/0,-1/0,t)}function Jt(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function Qt(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 te(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 ee(t,e,n,i,o){for(;n<i;n+=o)ne(t,e[n],e[n+1]);return t}function ne(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 ie(t,e){var n;return(n=e(re(t)))||(n=e(se(t)))||(n=e(de(t)))?n:(n=e(fe(t)))||!1}function oe(t){var e=0;return ye(t)||(e=ge(t)*ce(t)),e}function re(t){return[t[0],t[1]]}function se(t){return[t[2],t[1]]}function ae(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function le(t,e){var n;return"bottom-left"===e?n=re(t):"bottom-right"===e?n=se(t):"top-left"===e?n=fe(t):"top-right"===e?n=de(t):mt(!1,13),n}function ue(t,e,n,i,o){var r=he(t,e,n,i),s=r[0],a=r[1],l=r[2],u=r[3],h=r[4],c=r[5],p=r[6],f=r[7];return qt(Math.min(s,l,h,p),Math.min(a,u,c,f),Math.max(s,l,h,p),Math.max(a,u,c,f),o)}function he(t,e,n,i){var o=e*i[0]/2,r=e*i[1]/2,s=Math.cos(n),a=Math.sin(n),l=o*s,u=o*a,h=r*s,c=r*a,p=t[0],f=t[1];return[p-l+c,f-u-h,p-l-c,f-u+h,p+l-c,f+u+h,p+l+c,f+u-h,p-l+c,f-u-h]}function ce(t){return t[3]-t[1]}function pe(t,e,n){var i=n||[1/0,1/0,-1/0,-1/0];return _e(t,e)?(t[0]>e[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]<e[2]?i[2]=t[2]:i[2]=e[2],t[3]<e[3]?i[3]=t[3]:i[3]=e[3]):$t(i),i}function fe(t){return[t[0],t[3]]}function de(t){return[t[2],t[3]]}function ge(t){return t[2]-t[0]}function _e(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function ye(t){return t[2]<t[0]||t[3]<t[1]}function ve(t,e){var n=e.getExtent(),i=ae(t);if(e.canWrapX()&&(i[0]<n[0]||i[0]>=n[2])){var o=ge(n),r=Math.floor((i[0]-n[0])/o)*o;t[0]-=r,t[2]-=r}return t}var me=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_||Tt[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 xe(t,e,n){return Math.min(Math.max(t,e),n)}var Ee="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2},Ce="log2"in Math?Math.log2:function(t){return Math.log(t)*Math.LOG2E};function we(t,e,n,i,o,r){var s=o-n,a=r-i;if(0!==s||0!==a){var l=((t-n)*s+(e-i)*a)/(s*s+a*a);l>1?(n=o,i=r):l>0&&(n+=s*l,i+=a*l)}return Se(t,e,n,i)}function Se(t,e,n,i){var o=n-t,r=i-e;return o*o+r*r}function Te(t){return t*Math.PI/180}function Oe(t,e){var n=t%e;return n*e<0?n+e:n}function be(t,e,n){return t+n*(e-t)}function Re(t,e){var n=Math.pow(10,e);return Math.round(t*n)/n}function Ie(t,e){return Math.floor(Re(t,e))}function Pe(t,e){return Math.ceil(Re(t,e))}var Me=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Le=6378137,Ae=Math.PI*Le,De=[-Ae,-Ae,Ae,Ae],Fe=[-180,-85,180,85],ke=Le*Math.log(Math.tan(Math.PI/2)),je=function(t){function e(e){return t.call(this,{code:e,units:Ot.METERS,extent:De,global:!0,worldExtent:Fe,getPointResolution:function(t,e){return t/Ee(e[1]/Le)}})||this}return Me(e,t),e}(me),Ne=[new je("EPSG:3857"),new je("EPSG:102100"),new je("EPSG:102113"),new je("EPSG:900913"),new je("http://www.opengis.net/def/crs/EPSG/0/3857"),new je("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ge(t,e,n){var i=t.length,o=n>1?n:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(i));for(var s=0;s<i;s+=o){r[s]=Ae*t[s]/180;var a=Le*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));a>ke?a=ke:a<-ke&&(a=-ke),r[s+1]=a}return r}function ze(t,e,n){var i=t.length,o=n>1?n:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(i));for(var s=0;s<i;s+=o)r[s]=180*t[s]/Ae,r[s+1]=360*Math.atan(Math.exp(t[s+1]/Le))/Math.PI-90;return r}var We=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xe=[-180,-90,180,90],Ye=6378137*Math.PI/180,Ke=function(t){function e(e,n){return t.call(this,{code:e,units:Ot.DEGREES,extent:Xe,axisOrientation:n,global:!0,metersPerUnit:Ye,worldExtent:Xe})||this}return We(e,t),e}(me),Be=[new Ke("CRS:84"),new Ke("EPSG:4326","neu"),new Ke("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ke("urn:ogc:def:crs:OGC:2:84"),new Ke("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Ke("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ke("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Ze={};var Ve={};function Ue(t,e,n){var i=t.getCode(),o=e.getCode();i in Ve||(Ve[i]={}),Ve[i][o]=n}function He(t,e){for(var n=!0,i=t.length-1;i>=0;--i)if(t[i]!=e[i]){n=!1;break}return n}function qe(t,e){var n=Math.cos(e),i=Math.sin(e),o=t[0]*n-t[1]*i,r=t[1]*n+t[0]*i;return t[0]=o,t[1]=r,t}function $e(t,e){if(e.canWrapX()){var n=ge(e.getExtent()),i=function(t,e,n){var i=e.getExtent(),o=0;if(e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])){var r=n||ge(i);o=Math.floor((t[0]-i[0])/r)}return o}(t,e,n);i&&(t[0]-=i*n)}return t}var Je=6371008.8;function Qe(t,e,n){var i=n||Je,o=Te(t[1]),r=Te(e[1]),s=(r-o)/2,a=Te(e[0]-t[0])/2,l=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(o)*Math.cos(r);return 2*i*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))}var tn=!0;function en(t){tn=!(void 0===t||t)}function nn(t,e,n){var i;if(void 0!==e){for(var o=0,r=t.length;o<r;++o)e[o]=t[o];i=e}else i=t.slice();return i}function on(t,e,n){if(void 0!==e&&t!==e){for(var i=0,o=t.length;i<o;++i)e[i]=t[i];t=e}return t}function rn(t){!function(t,e){Ze[t]=e}(t.getCode(),t),Ue(t,t,nn)}function sn(t){return"string"==typeof t?Ze[e=t]||Ze[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null:t||null;var e}function an(t,e,n,i){var o,r=(t=sn(t)).getPointResolutionFunc();if(r){if(o=r(e,n),i&&i!==t.getUnits())(a=t.getMetersPerUnit())&&(o=o*a/Tt[i])}else{var s=t.getUnits();if(s==Ot.DEGREES&&!i||i==Ot.DEGREES)o=e;else{var a,l=pn(t,sn("EPSG:4326"));if(l===on&&s!==Ot.DEGREES)o=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];o=(Qe((u=l(u,u,2)).slice(0,2),u.slice(2,4))+Qe(u.slice(4,6),u.slice(6,8)))/2}void 0!==(a=i?Tt[i]:t.getMetersPerUnit())&&(o/=a)}}return o}function ln(t){!function(t){t.forEach(rn)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Ue(e,t,nn)}))}))}function un(t,e){return t?"string"==typeof t?sn(t):t:sn(e)}function hn(t,e){return en(),dn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function cn(t,e){if(t===e)return!0;var n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||pn(t,e)===nn)&&n}function pn(t,e){var n=function(t,e){var n;return t in Ve&&e in Ve[t]&&(n=Ve[t][e]),n}(t.getCode(),e.getCode());return n||(n=on),n}function fn(t,e){return pn(sn(t),sn(e))}function dn(t,e,n){return fn(e,n)(t,void 0,t.length)}var gn,_n,yn,vn=null;function mn(){return vn}function xn(t,e){return t}function En(t,e){return tn&&!He(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(tn=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function Cn(t,e){return t}function wn(t,e){return t}function Sn(t,e,n,i,o,r){for(var s=r||[],a=0,l=e;l<n;l+=i){var u=t[l],h=t[l+1];s[a++]=o[0]*u+o[2]*h+o[4],s[a++]=o[1]*u+o[3]*h+o[5]}return r&&s.length!=a&&(s.length=a),s}function Tn(t,e,n,i,o,r,s){for(var a=s||[],l=Math.cos(o),u=Math.sin(o),h=r[0],c=r[1],p=0,f=e;f<n;f+=i){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+i;++_)a[p++]=t[_]}return s&&a.length!=p&&(a.length=p),a}ln(Ne),ln(Be),gn=Ne,_n=Ge,yn=ze,Be.forEach((function(t){gn.forEach((function(e){Ue(t,e,_n),Ue(e,t,yn)}))}));var On=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bn=[1,0,0,1,0,0],Rn=function(t){function e(){var e,n,i,o,r,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 i=this.clone();return i.applyTransform(n),i.getSimplifiedGeometry(e)},r=!1,function(){var t=Array.prototype.slice.call(arguments);return r&&this===o&&U(t,i)||(r=!0,o=this,i=t,n=e.apply(this,arguments)),n}),s}return On(e,t),e.prototype.simplifyTransformed=function(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)},e.prototype.clone=function(){return D()},e.prototype.closestPointXY=function(t,e,n,i){return D()},e.prototype.containsXY=function(t,e){var n=this.getClosestPoint([t,e]);return n[0]===t&&n[1]===e},e.prototype.getClosestPoint=function(t,e){var n=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],n,1/0),n},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return D()},e.prototype.getExtent=function(t){if(this.extentRevision_!=this.getRevision()){var e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&$t(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)},e.prototype.rotate=function(t,e){D()},e.prototype.scale=function(t,e,n){D()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return D()},e.prototype.getType=function(){return D()},e.prototype.applyTransform=function(t){D()},e.prototype.intersectsExtent=function(t){return D()},e.prototype.translate=function(t,e){D()},e.prototype.transform=function(t,e){var n=sn(t),i=n.getUnits()==Ot.TILE_PIXELS?function(t,i,o){var r=n.getExtent(),s=n.getWorldExtent(),a=ce(s)/ce(r);return jt(bn,s[0],s[3],a,-a,0,0,0),Sn(t,0,t.length,o,bn,i),fn(n,e)(t,i,o)}:fn(n,e);return this.applyTransform(i),this},e}(ft),In=Rn,Pn=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Mn=function(t){function e(){var e=t.call(this)||this;return e.layout=wt.XY,e.stride=2,e.flatCoordinates=null,e}return Pn(e,t),e.prototype.computeExtent=function(t){return e=this.flatCoordinates,n=0,i=this.flatCoordinates.length,o=this.stride,ee($t(t),e,n,i,o);var e,n,i,o},e.prototype.getCoordinates=function(){return D()},e.prototype.getFirstCoordinate=function(){return this.flatCoordinates.slice(0,this.stride)},e.prototype.getFlatCoordinates=function(){return this.flatCoordinates},e.prototype.getLastCoordinate=function(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)},e.prototype.getLayout=function(){return this.layout},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;var e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)},e.prototype.getSimplifiedGeometryInternal=function(t){return this},e.prototype.getStride=function(){return this.stride},e.prototype.setFlatCoordinates=function(t,e){this.stride=Ln(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){D()},e.prototype.setLayout=function(t,e,n){var i;if(t)i=Ln(t);else{for(var o=0;o<n;++o){if(0===e.length)return this.layout=wt.XY,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=wt.XY:3==t?e=wt.XYZ:4==t&&(e=wt.XYZM);return e}(i=e.length)}this.layout=t,this.stride=i},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var n=this.getFlatCoordinates();if(n){var i=this.getStride();Tn(n,0,n.length,i,t,e,n),this.changed()}},e.prototype.scale=function(t,e,n){var i=e;void 0===i&&(i=t);var o=n;o||(o=ae(this.getExtent()));var r=this.getFlatCoordinates();if(r){var s=this.getStride();!function(t,e,n,i,o,r,s,a){for(var l=a||[],u=s[0],h=s[1],c=0,p=e;p<n;p+=i){var f=t[p]-u,d=t[p+1]-h;l[c++]=u+o*f,l[c++]=h+r*d;for(var g=p+2;g<p+i;++g)l[c++]=t[g]}a&&l.length!=c&&(l.length=c)}(r,0,r.length,s,t,i,o,r),this.changed()}},e.prototype.translate=function(t,e){var n=this.getFlatCoordinates();if(n){var i=this.getStride();!function(t,e,n,i,o,r,s){for(var a=s||[],l=0,u=e;u<n;u+=i){a[l++]=t[u]+o,a[l++]=t[u+1]+r;for(var h=u+2;h<u+i;++h)a[l++]=t[h]}s&&a.length!=l&&(a.length=l)}(n,0,n.length,i,t,e,n),this.changed()}},e}(In);function Ln(t){var e;return t==wt.XY?e=2:t==wt.XYZ||t==wt.XYM?e=3:t==wt.XYZM&&(e=4),e}var An=Mn;function Dn(t,e,n,i,o,r,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=((o-l)*h+(r-u)*c)/(h*h+c*c);if(p>1)a=n;else{if(p>0){for(var f=0;f<i;++f)s[f]=be(t[e+f],t[n+f],p);return void(s.length=i)}a=e}}for(f=0;f<i;++f)s[f]=t[a+f];s.length=i}function Fn(t,e,n,i,o){var r=t[e],s=t[e+1];for(e+=i;e<n;e+=i){var a=t[e],l=t[e+1],u=Se(r,s,a,l);u>o&&(o=u),r=a,s=l}return o}function kn(t,e,n,i,o,r,s,a,l,u,h){if(e==n)return u;var c,p;if(0===o){if((p=Se(s,a,t[e],t[e+1]))<u){for(c=0;c<i;++c)l[c]=t[e+c];return l.length=i,p}return u}for(var f=h||[NaN,NaN],d=e+i;d<n;)if(Dn(t,d-i,d,i,s,a,f),(p=Se(s,a,f[0],f[1]))<u){for(u=p,c=0;c<i;++c)l[c]=f[c];l.length=i,d+=i}else d+=i*Math.max((Math.sqrt(p)-Math.sqrt(u))/o|0,1);if(r&&(Dn(t,n-i,e,i,s,a,f),(p=Se(s,a,f[0],f[1]))<u)){for(u=p,c=0;c<i;++c)l[c]=f[c];l.length=i}return u}function jn(t,e,n,i){for(var o=0,r=n.length;o<r;++o)for(var s=n[o],a=0;a<i;++a)t[e++]=s[a];return e}function Nn(t,e){return e*Math.round(t/e)}function Gn(t,e,n,i,o,r,s){if(e==n)return s;var a,l,u=Nn(t[e],o),h=Nn(t[e+1],o);e+=i,r[s++]=u,r[s++]=h;do{if(a=Nn(t[e],o),l=Nn(t[e+1],o),(e+=i)==n)return r[s++]=a,r[s++]=l,s}while(a==u&&l==h);for(;e<n;){var c=Nn(t[e],o),p=Nn(t[e+1],o);if(e+=i,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):(r[s++]=a,r[s++]=l,u=a,h=l,a=c,l=p)}}return r[s++]=a,r[s++]=l,s}function zn(t,e,n,i,o){for(var r=void 0!==o?o:[],s=0,a=e;a<n;a+=i)r[s++]=t.slice(a,a+i);return r.length=s,r}function Wn(t,e,n,i,o){for(var r=void 0!==o?o:[],s=0,a=0,l=n.length;a<l;++a){var u=n[a];r[s++]=zn(t,e,u,i,r[s]),e=u}return r.length=s,r}function Xn(t,e,n,i,o){for(var r=void 0!==o?o:[],s=0,a=0,l=n.length;a<l;++a){var u=n[a];r[s++]=Wn(t,e,u,i,r[s]),e=u[u.length-1]}return r.length=s,r}function Yn(t,e,n,i){for(var o=0,r=t[n-i],s=t[n-i+1];e<n;e+=i){var a=t[e],l=t[e+1];o+=s*a-r*l,r=a,s=l}return o/2}var Kn=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bn=function(t){function e(e,n){var i=t.call(this)||this;return i.maxDelta_=-1,i.maxDeltaRevision_=-1,void 0===n||Array.isArray(e[0])?i.setCoordinates(e,n):i.setFlatCoordinates(n,e),i}return Kn(e,t),e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,n,i){return i<Kt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Fn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),kn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.getArea=function(){return Yn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return zn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[];return n.length=function(t,e,n,i,o,r,s){var a=(n-e)/i;if(a<3){for(;e<n;e+=i)r[s++]=t[e],r[s++]=t[e+1];return s}var l=new Array(a);l[0]=1,l[a-1]=1;for(var u=[e,n-i],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+i;v<c;v+=i){var m=we(t[v],t[v+1],d,g,_,y);m>f&&(h=v,f=m)}f>o&&(l[(h-e)/i]=1,p+i<h&&u.push(p,h),h+i<c&&u.push(h,c))}for(v=0;v<a;++v)l[v]&&(r[s++]=t[e+v*i],r[s++]=t[e+v*i+1]);return s}(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,wt.XY)},e.prototype.getType=function(){return"LinearRing"},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=jn(this.flatCoordinates,0,t,this.stride),this.changed()},e}(An),Zn=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Un=function(t){function e(e,n){var i=t.call(this)||this;return i.setCoordinates(e,n),i}return Vn(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,i){var o=this.flatCoordinates,r=Se(t,e,o[0],o[1]);if(r<i){for(var s=this.stride,a=0;a<s;++a)n[a]=o[a];return n.length=s,r}return i},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return e=this.flatCoordinates,n=t,i=e[0],o=e[1],qt(i,o,i,o,n);var e,n,i,o},e.prototype.getType=function(){return"Point"},e.prototype.intersectsExtent=function(t){return Vt(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=function(t,e,n,i){for(var o=0,r=n.length;o<r;++o)t[e++]=n[o];return e}(this.flatCoordinates,0,t,this.stride),this.changed()},e}(An),Hn=Un;function qn(t,e,n,i,o){return!ie(o,(function(o){return!$n(t,e,n,i,o[0],o[1])}))}function $n(t,e,n,i,o,r){for(var s=0,a=t[n-i],l=t[n-i+1];e<n;e+=i){var u=t[e],h=t[e+1];l<=r?h>r&&(u-a)*(r-l)-(o-a)*(h-l)>0&&s++:h<=r&&(u-a)*(r-l)-(o-a)*(h-l)<0&&s--,a=u,l=h}return 0!==s}function Jn(t,e,n,i,o,r){if(0===n.length)return!1;if(!$n(t,e,n[0],i,o,r))return!1;for(var s=1,a=n.length;s<a;++s)if($n(t,n[s-1],n[s],i,o,r))return!1;return!0}function Qn(t,e,n,i,o){var r=ee([1/0,1/0,-1/0,-1/0],t,e,n,i);return!!_e(o,r)&&(!!Zt(o,r)||(r[0]>=o[0]&&r[2]<=o[2]||(r[1]>=o[1]&&r[3]<=o[3]||function(t,e,n,i,o){var r;for(e+=i;e<n;e+=i)if(r=o(t.slice(e-i,e),t.slice(e,e+i)))return r;return!1}(t,e,n,i,(function(t,e){return function(t,e,n){var i=!1,o=Ut(t,e),r=Ut(t,n);if(o===zt.INTERSECTING||r===zt.INTERSECTING)i=!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;r&zt.ABOVE&&!(o&zt.ABOVE)&&(i=(g=p-(f-u)/d)>=s&&g<=l),i||!(r&zt.RIGHT)||o&zt.RIGHT||(i=(_=f-(p-l)*d)>=a&&_<=u),i||!(r&zt.BELOW)||o&zt.BELOW||(i=(g=p-(f-a)/d)>=s&&g<=l),i||!(r&zt.LEFT)||o&zt.LEFT||(i=(_=f-(p-s)*d)>=a&&_<=u)}return i}(o,t,e)})))))}function ti(t,e,n,i,o){return!!Qn(t,e,n,i,o)||(!!$n(t,e,n,i,o[0],o[1])||(!!$n(t,e,n,i,o[0],o[3])||(!!$n(t,e,n,i,o[2],o[1])||!!$n(t,e,n,i,o[2],o[3]))))}function ei(t,e,n,i){for(;e<n-i;){for(var o=0;o<i;++o){var r=t[e+o];t[e+o]=t[n-i+o],t[n-i+o]=r}e+=i,n-=i}}function ni(t,e,n,i){for(var o=0,r=t[n-i],s=t[n-i+1];e<n;e+=i){var a=t[e],l=t[e+1];o+=(a-r)*(l+s),r=a,s=l}return 0===o?void 0:o>0}function ii(t,e,n,i,o){for(var r=void 0!==o&&o,s=0,a=n.length;s<a;++s){var l=n[s],u=ni(t,e,l,i);(0===s?r&&u||!r&&!u:r&&!u||!r&&u)&&ei(t,e,l,i),e=l}return e}var oi=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ri=function(t){function e(e,n,i){var o=t.call(this)||this;return o.ends_=[],o.flatInteriorPointRevision_=-1,o.flatInteriorPoint_=null,o.maxDelta_=-1,o.maxDeltaRevision_=-1,o.orientedRevision_=-1,o.orientedFlatCoordinates_=null,void 0!==n&&i?(o.setFlatCoordinates(n,e),o.ends_=i):o.setCoordinates(e,n),o}return oi(e,t),e.prototype.appendLinearRing=function(t){this.flatCoordinates?V(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,i){return i<Kt(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,i,o){for(var r=0,s=n.length;r<s;++r){var a=n[r];o=Fn(t,e,a,i,o),e=a}return o}(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,i,o,r,s,a,l,u,h){for(var c=h||[NaN,NaN],p=0,f=n.length;p<f;++p){var d=n[p];u=kn(t,e,d,i,o,r,s,a,l,u,c),e=d}return u}(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,i))},e.prototype.containsXY=function(t,e){return Jn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return function(t,e,n,i){for(var o=0,r=0,s=n.length;r<s;++r){var a=n[r];o+=Yn(t,e,a,i),e=a}return o}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?ii(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,Wn(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=ae(this.getExtent());this.flatInteriorPoint_=function(t,e,n,i,o,r,s){for(var a,l,u,h,c,p,f,d=o[r+1],g=[],_=0,y=n.length;_<y;++_){var v=n[_];for(h=t[v-i],p=t[v-i+1],a=e;a<v;a+=i)c=t[a],f=t[a+1],(d<=p&&f<=d||p<=d&&d<=f)&&(u=(d-p)/(f-p)*(c-h)+h,g.push(u)),h=c,p=f}var m=NaN,x=-1/0;for(g.sort(K),h=g[0],a=1,l=g.length;a<l;++a){c=g[a];var E=Math.abs(c-h);E>x&&Jn(t,e,n,i,u=(h+c)/2,d)&&(m=u,x=E),h=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,d,x),s):[m,d,x]}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new Hn(this.getFlatInteriorPoint(),wt.XYM)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new Zn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)},e.prototype.getLinearRings=function(){for(var t=this.layout,e=this.flatCoordinates,n=this.ends_,i=[],o=0,r=0,s=n.length;r<s;++r){var a=n[r],l=new Zn(e.slice(o,a),t);i.push(l),o=a}return i},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;!function(t,e,n,i,o){for(var r=void 0!==o&&o,s=0,a=n.length;s<a;++s){var l=n[s],u=ni(t,e,l,i);if(0===s){if(r&&u||!r&&!u)return!1}else if(r&&!u||!r&&u)return!1;e=l}return!0}(t,0,this.ends_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ii(this.orientedFlatCoordinates_,0,this.ends_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var n=[],i=[];return n.length=function(t,e,n,i,o,r,s,a){for(var l=0,u=n.length;l<u;++l){var h=n[l];s=Gn(t,e,h,i,o,r,s),a.push(s),e=h}return s}(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,i),new e(n,wt.XY,i)},e.prototype.getType=function(){return"Polygon"},e.prototype.intersectsExtent=function(t){return function(t,e,n,i,o){if(!ti(t,e,n[0],i,o))return!1;if(1===n.length)return!0;for(var r=1,s=n.length;r<s;++r)if(qn(t,n[r-1],n[r],i,o)&&!Qn(t,n[r-1],n[r],i,o))return!1;return!0}(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=function(t,e,n,i,o){for(var r=o||[],s=0,a=0,l=n.length;a<l;++a){var u=jn(t,e,n[a],i);r[s++]=u,e=u}return r.length=s,r}(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()},e}(An);function si(t){var e=t[0],n=t[1],i=t[2],o=t[3],r=[e,n,e,o,i,o,i,n,e,n];return new ri(r,wt.XY,[r.length])}var ai="prerender",li="postrender",ui="precompose",hi="postcompose",ci="rendercomplete",pi=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 fi(t,e,n,i){for(var o=t[e],r=t[e+1],s=0,a=e+i;a<n;a+=i){var l=t[a],u=t[a+1];s+=Math.sqrt((l-o)*(l-o)+(u-r)*(u-r)),o=l,r=u}return s}var di=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}(),gi={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function _i(t){return t[0]>0&&t[1]>0}function yi(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}var vi=function(){function t(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=yi(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}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(),declutterMode:this.getDeclutterMode()})},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.getDeclutterMode=function(){return this.declutterMode_},t.prototype.getAnchor=function(){return D()},t.prototype.getImage=function(t){return D()},t.prototype.getHitDetectionImage=function(){return D()},t.prototype.getPixelRatio=function(t){return 1},t.prototype.getImageState=function(){return D()},t.prototype.getImageSize=function(){return D()},t.prototype.getOrigin=function(){return D()},t.prototype.getSize=function(){return D()},t.prototype.setDisplacement=function(t){this.displacement_=t},t.prototype.setOpacity=function(t){this.opacity_=t},t.prototype.setRotateWithView=function(t){this.rotateWithView_=t},t.prototype.setRotation=function(t){this.rotation_=t},t.prototype.setScale=function(t){this.scale_=t,this.scaleArray_=yi(t)},t.prototype.listenImageChange=function(t){D()},t.prototype.load=function(){D()},t.prototype.unlistenImageChange=function(t){D()},t}(),mi=vi,xi=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Ei=/^([a-z]*)$|^hsla?\(.*\)$/i;function Ci(t){return"string"==typeof t?t:Oi(t)}var wi=function(){var t={},e=0;return function(n){var i;if(t.hasOwnProperty(n))i=t[n];else{if(e>=1024){var o=0;for(var r in t)0==(3&o++)&&(delete t[r],--e)}i=function(t){var e,n,i,o,r;Ei.exec(t)&&(t=function(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""}(t));if(xi.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),i=parseInt(t.substr(1+2*a,a),16),o=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,l&&(o=(o<<4)+o)),r=[e,n,i,o/255]}else 0==t.indexOf("rgba(")?Ti(r=t.slice(5,-1).split(",").map(Number)):0==t.indexOf("rgb(")?((r=t.slice(4,-1).split(",").map(Number)).push(1),Ti(r)):mt(!1,14);return r}(n),t[n]=i,++e}return i}}();function Si(t){return Array.isArray(t)?t:wi(t)}function Ti(t){return t[0]=xe(t[0]+.5|0,0,255),t[1]=xe(t[1]+.5|0,0,255),t[2]=xe(t[2]+.5|0,0,255),t[3]=xe(t[3],0,1),t}function Oi(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+n+","+i+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function bi(t){return Array.isArray(t)?Oi(t):t}function Ri(t,e,n,i){var o;return o=n&&n.length?n.shift():At?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(o.width=t),e&&(o.height=e),o.getContext("2d",i)}function Ii(t){var e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Pi(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10)}function Mi(t){var e=t.offsetHeight,n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10)}function Li(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)}function Ai(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Di(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var Fi="ol-hidden",ki="ol-selectable",ji="ol-unselectable",Ni="ol-control",Gi="ol-collapsed",zi=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"),Wi=["style","variant","weight","size","lineHeight","family"],Xi=function(t){var e=t.match(zi);if(!e)return null;for(var n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"},i=0,o=Wi.length;i<o;++i){var r=e[i+1];void 0!==r&&(n[Wi[i]]=r)}return n.families=n.family.split(/,\s?/),n},Yi="10px sans-serif",Ki="#000",Bi="round",Zi=[],Vi="round",Ui="#000",Hi="center",qi="middle",$i=[0,0,0,0],Ji=new ft;(new it).setSize=function(){console.warn("labelCache is deprecated.")};var Qi,to,eo=null,no={},io=function(){var t,e,n=100,i="32px ",o=["monospace","serif"],r=o.length,s="wmytzilWMYTZIL@#/&?$%10";function a(t,n,a){for(var l=!0,u=0;u<r;++u){var h=o[u];if(e=so(t+" "+n+" "+i+h,s),a!=h){var c=so(t+" "+n+" "+i+a+","+h,s);l=l&&c!=e}}return!!l}function l(){for(var e=!0,i=Ji.getKeys(),o=0,r=i.length;o<r;++o){var s=i[o];Ji.get(s)<n&&(a.apply(this,s.split("\n"))?(Q(no),eo=null,Qi=void 0,Ji.set(s,n)):(Ji.set(s,Ji.get(s)+1,!0),e=!1))}e&&(clearInterval(t),t=void 0)}return function(e){var i=Xi(e);if(i)for(var o=i.families,r=0,s=o.length;r<s;++r){var u=o[r],h=i.style+"\n"+i.weight+"\n"+u;void 0===Ji.get(h)&&(Ji.set(h,n,!0),a(i.style,i.weight,u)||(Ji.set(h,0,!0),void 0===t&&(t=setInterval(l,32))))}}}(),oo=function(t){var e=no[t];if(null==e){if(At){var n=Xi(t),i=ro(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else to||((to=document.createElement("div")).innerHTML="M",to.style.minHeight="0",to.style.maxHeight="none",to.style.height="auto",to.style.padding="0",to.style.border="none",to.style.position="absolute",to.style.display="block",to.style.left="-99999px"),to.style.font=t,document.body.appendChild(to),e=to.offsetHeight,document.body.removeChild(to);no[t]=e}return e};function ro(t,e){return eo||(eo=Ri(1,1)),t!=Qi&&(eo.font=t,Qi=eo.font),eo.measureText(e)}function so(t,e){return ro(t,e).width}function ao(t,e,n){if(e in n)return n[e];var i=e.split("\n").reduce((function(e,n){return Math.max(e,so(t,n))}),0);return n[e]=i,i}function lo(t,e,n,i,o,r,s,a,l,u,h){t.save(),1!==n&&(t.globalAlpha*=n),e&&t.setTransform.apply(t,e),i.contextInstructions?(t.translate(l,u),t.scale(h[0],h[1]),function(t,e){for(var n=t.contextInstructions,i=0,o=n.length;i<o;i+=2)Array.isArray(n[i+1])?e[n[i]].apply(e,n[i+1]):e[n[i]]=n[i+1]}(i,t)):h[0]<0||h[1]<0?(t.translate(l,u),t.scale(h[0],h[1]),t.drawImage(i,o,r,s,a,0,0,s,a)):t.drawImage(i,o,r,s,a,l,u,s*h[0],a*h[1]),t.restore()}var uo=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ho=function(t){function e(e){var n=this,i=void 0!==e.rotateWithView&&e.rotateWithView;return(n=t.call(this,{opacity:1,rotateWithView:i,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],declutterMode:e.declutterMode})||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.size_=null,n.renderOptions_=null,n.render(),n}return uo(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(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.getAnchor=function(){var t=this.size_;if(!t)return null;var e=this.getDisplacement();return[t[0]/2-e[0],t[1]/2+e[1]]},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.setFill=function(t){this.fill_=t,this.render()},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_,i=Ri(n.size*t,n.size*t);this.draw_(n,i,t),e=i.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 gi.LOADED},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.setStroke=function(t){this.stroke_=t,this.render()},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 i=this.radius_,o=void 0===this.radius2_?i:this.radius2_;if(i<o){var r=i;i=o,o=r}var s=void 0===this.radius2_?this.points_:2*this.points_,a=2*Math.PI/s,l=o*Math.sin(a),u=i-Math.sqrt(o*o-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((i+p)*(i+p)+f*f)-i;if(void 0===this.radius2_||"bevel"===t)return 2*d;var g=i*Math.sin(a),_=o-Math.sqrt(i*i-g*g),y=Math.sqrt(g*g+_*_)/g;if(y<=n){var v=y*e/2-o-i;return 2*Math.max(d,v)}return 2*d},e.prototype.createRenderOptions=function(){var t,e=Vi,n=0,i=null,o=0,r=0;this.stroke_&&(null===(t=this.stroke_.getColor())&&(t=Ui),t=bi(t),void 0===(r=this.stroke_.getWidth())&&(r=1),i=this.stroke_.getLineDash(),o=this.stroke_.getLineDashOffset(),void 0===(e=this.stroke_.getLineJoin())&&(e=Vi),void 0===(n=this.stroke_.getMiterLimit())&&(n=10));var s=this.calculateLineJoinSize_(e,r,n),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:r,size:Math.ceil(2*a+s),lineDash:i,lineDashOffset:o,lineJoin:e,miterLimit:n}},e.prototype.render=function(){this.renderOptions_=this.createRenderOptions();var t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]},e.prototype.draw_=function(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){var i=this.fill_.getColor();null===i&&(i=Ki),e.fillStyle=bi(i),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=Si(e)),null===e?n=1:Array.isArray(e)&&(n=4===e.length?e[3]:1),0===n){var i=Ri(t.size,t.size);this.hitDetectionCanvas_=i.canvas,this.drawHitDetectionCanvas_(t,i)}}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 i=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);for(var o=this.angle_-Math.PI/2,r=2*Math.PI/e,s=0;s<e;s++){var a=o+s*r,l=s%2==0?n:i;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=Ki,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}(mi),co=ho,po=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),fo=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],declutterMode:n.declutterMode})||this}return po(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(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n},e.prototype.setRadius=function(t){this.radius_=t,this.render()},e}(co),go=fo,_o=function(){function t(t){var e=t||{};this.geometry_=null,this.geometryFunction_=mo,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_=mo,this.geometry_=t},t.prototype.setZIndex=function(t){this.zIndex_=t},t}();var yo=null;function vo(t,e){if(!yo){var n=new pi({color:"rgba(255,255,255,0.4)"}),i=new di({color:"#3399CC",width:1.25});yo=[new _o({image:new go({fill:n,stroke:i,radius:5}),fill:n,stroke:i})]}return yo}function mo(t){return t.getGeometry()}var xo=_o,Eo="line",Co={OPACITY:"opacity",VISIBLE:"visible",EXTENT:"extent",Z_INDEX:"zIndex",MAX_RESOLUTION:"maxResolution",MIN_RESOLUTION:"minResolution",MAX_ZOOM:"maxZoom",MIN_ZOOM:"minZoom",SOURCE:"source",MAP:"map"},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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),So=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.background_=e.background;var i=J({},e);return"object"==typeof e.properties&&(delete i.properties,J(i,e.properties)),i[Co.OPACITY]=void 0!==e.opacity?e.opacity:1,mt("number"==typeof i[Co.OPACITY],64),i[Co.VISIBLE]=void 0===e.visible||e.visible,i[Co.Z_INDEX]=e.zIndex,i[Co.MAX_RESOLUTION]=void 0!==e.maxResolution?e.maxResolution:1/0,i[Co.MIN_RESOLUTION]=void 0!==e.minResolution?e.minResolution:0,i[Co.MIN_ZOOM]=void 0!==e.minZoom?e.minZoom:-1/0,i[Co.MAX_ZOOM]=void 0!==e.maxZoom?e.maxZoom:1/0,n.className_=void 0!==i.className?i.className:"ol-layer",delete i.className,n.setProperties(i),n.state_=null,n}return wo(e,t),e.prototype.getBackground=function(){return this.background_},e.prototype.getClassName=function(){return this.className_},e.prototype.getLayerState=function(t){var e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=xe(Math.round(100*this.getOpacity())/100,0,1),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},e.prototype.getLayersArray=function(t){return D()},e.prototype.getLayerStatesArray=function(t){return D()},e.prototype.getExtent=function(){return this.get(Co.EXTENT)},e.prototype.getMaxResolution=function(){return this.get(Co.MAX_RESOLUTION)},e.prototype.getMinResolution=function(){return this.get(Co.MIN_RESOLUTION)},e.prototype.getMinZoom=function(){return this.get(Co.MIN_ZOOM)},e.prototype.getMaxZoom=function(){return this.get(Co.MAX_ZOOM)},e.prototype.getOpacity=function(){return this.get(Co.OPACITY)},e.prototype.getSourceState=function(){return D()},e.prototype.getVisible=function(){return this.get(Co.VISIBLE)},e.prototype.getZIndex=function(){return this.get(Co.Z_INDEX)},e.prototype.setBackground=function(t){this.background_=t,this.changed()},e.prototype.setExtent=function(t){this.set(Co.EXTENT,t)},e.prototype.setMaxResolution=function(t){this.set(Co.MAX_RESOLUTION,t)},e.prototype.setMinResolution=function(t){this.set(Co.MIN_RESOLUTION,t)},e.prototype.setMaxZoom=function(t){this.set(Co.MAX_ZOOM,t)},e.prototype.setMinZoom=function(t){this.set(Co.MIN_ZOOM,t)},e.prototype.setOpacity=function(t){mt("number"==typeof t,64),this.set(Co.OPACITY,t)},e.prototype.setVisible=function(t){this.set(Co.VISIBLE,t)},e.prototype.setZIndex=function(t){this.set(Co.Z_INDEX,t)},e.prototype.disposeInternal=function(){this.state_&&(this.state_.layer=null,this.state_=null),t.prototype.disposeInternal.call(this)},e}(ft),To=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Oo(t,e){if(!t.visible)return!1;var n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;var i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}var bo=function(t){function e(e){var n=this,i=J({},e);delete i.source,(n=t.call(this,i)||this).on,n.once,n.un,n.mapPrecomposeKey_=null,n.mapRenderKey_=null,n.sourceChangeKey_=null,n.renderer_=null,n.rendered=!1,e.render&&(n.render=e.render),e.map&&n.setMap(e.map),n.addChangeListener(Co.SOURCE,n.handleSourcePropertyChange_);var o=e.source?e.source:null;return n.setSource(o),n}return To(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(Co.SOURCE)||null},e.prototype.getRenderSource=function(){return this.getSource()},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():"undefined"},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(at(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=rt(t,ot.CHANGE,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.getData=function(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null},e.prototype.render=function(t,e){var n=this.getRenderer();if(n.prepareFrame(t))return this.rendered=!0,n.renderFrame(t,e)},e.prototype.unrender=function(){this.rendered=!1},e.prototype.setMapInternal=function(t){t||this.unrender(),this.set(Co.MAP,t)},e.prototype.getMapInternal=function(){return this.get(Co.MAP)},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(at(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(at(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=rt(t,ui,(function(t){var e=t.frameState.layerStatesArray,n=this.getLayerState(!1);mt(!e.some((function(t){return t.layer===n.layer})),67),e.push(n)}),this),this.mapRenderKey_=rt(this,ot.CHANGE,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(Co.SOURCE,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}(So);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Ro,Io,Po=(Ro=function(t,e){t.exports=function(){function t(t,i,o,r,s){!function t(n,i,o,r,s){for(;r>o;){if(r-o>600){var a=r-o+1,l=i-o+1,u=Math.log(a),h=.5*Math.exp(2*u/3),c=.5*Math.sqrt(u*h*(a-h)/a)*(l-a/2<0?-1:1);t(n,i,Math.max(o,Math.floor(i-l*h/a+c)),Math.min(r,Math.floor(i+(a-l)*h/a+c)),s)}var p=n[i],f=o,d=r;for(e(n,o,i),s(n[r],p)>0&&e(n,o,r);f<d;){for(e(n,f,d),f++,d--;s(n[f],p)<0;)f++;for(;s(n[d],p)>0;)d--}0===s(n[o],p)?e(n,o,d):e(n,++d,r),d<=i&&(o=d+1),i<=d&&(r=d-1)}}(t,i,o||0,r||t.length-1,s||n)}function e(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function n(t,e){return t<e?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function r(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,i,o){o||(o=d(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var r=e;r<n;r++){var s=t.children[r];a(o,t.leaf?i(s):s)}return o}function a(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 l(t,e){return t.minX-e.minX}function u(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function c(t){return t.maxX-t.minX+(t.maxY-t.minY)}function p(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function f(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function d(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,i,o,r){for(var s=[n,i];s.length;)if(!((i=s.pop())-(n=s.pop())<=o)){var a=n+Math.ceil((i-n)/o/2)*o;t(e,a,n,i,r),s.push(n,a,a,i)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!f(t,e))return n;for(var i=this.toBBox,o=[];e;){for(var r=0;r<e.children.length;r++){var s=e.children[r],a=e.leaf?i(s):s;f(t,a)&&(e.leaf?n.push(s):p(t,a)?this._all(s,n):o.push(s))}e=o.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!f(t,e))return!1;for(var n=[];e;){for(var i=0;i<e.children.length;i++){var o=e.children[i],r=e.leaf?this.toBBox(o):o;if(f(t,r)){if(e.leaf||p(t,r))return!0;n.push(o)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0;e<t.length;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){var i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=d([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,i,r,s=this.data,a=this.toBBox(t),l=[],u=[];s||l.length;){if(s||(s=l.pop(),i=l[l.length-1],n=u.pop(),r=!0),s.leaf){var h=o(t,s.children,e);if(-1!==h)return s.children.splice(h,1),l.push(s),this._condense(l),this}r||s.leaf||!p(s,a)?i?(n++,s=i.children[n],r=!1):s=null:(l.push(s),u.push(n),n=0,i=s,s=s.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,i){var o,s=n-e+1,a=this._maxEntries;if(s<=a)return r(o=d(t.slice(e,n+1)),this.toBBox),o;i||(i=Math.ceil(Math.log(s)/Math.log(a)),a=Math.ceil(s/Math.pow(a,i-1))),(o=d([])).leaf=!1,o.height=i;var l=Math.ceil(s/a),u=l*Math.ceil(Math.sqrt(a));g(t,e,n,u,this.compareMinX);for(var h=e;h<=n;h+=u){var c=Math.min(h+u-1,n);g(t,h,c,l,this.compareMinY);for(var p=h;p<=c;p+=l){var f=Math.min(p+l-1,c);o.children.push(this._build(t,p,f,i-1))}}return r(o,this.toBBox),o},i.prototype._chooseSubtree=function(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){for(var o=1/0,r=1/0,s=void 0,a=0;a<e.children.length;a++){var l=e.children[a],u=h(l),c=(p=t,f=l,(Math.max(f.maxX,p.maxX)-Math.min(f.minX,p.minX))*(Math.max(f.maxY,p.maxY)-Math.min(f.minY,p.minY))-u);c<r?(r=c,o=u<o?u:o,s=l):c===r&&u<o&&(o=u,s=l)}e=s||e.children[0]}var p,f;return e},i.prototype._insert=function(t,e,n){var i=n?t:this.toBBox(t),o=[],r=this._chooseSubtree(i,this.data,e,o);for(r.children.push(t),a(r,i);e>=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},i.prototype._split=function(t,e){var n=t[e],i=n.children.length,o=this._minEntries;this._chooseSplitAxis(n,o,i);var s=this._chooseSplitIndex(n,o,i),a=d(n.children.splice(s,n.children.length-s));a.height=n.height,a.leaf=n.leaf,r(n,this.toBBox),r(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)},i.prototype._splitRoot=function(t,e){this.data=d([t,e]),this.data.height=t.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var i,o,r,a,l,u,c,p=1/0,f=1/0,d=e;d<=n-e;d++){var g=s(t,0,d,this.toBBox),_=s(t,d,n,this.toBBox),y=(o=g,r=_,a=void 0,l=void 0,u=void 0,c=void 0,a=Math.max(o.minX,r.minX),l=Math.max(o.minY,r.minY),u=Math.min(o.maxX,r.maxX),c=Math.min(o.maxY,r.maxY),Math.max(0,u-a)*Math.max(0,c-l)),v=h(g)+h(_);y<p?(p=y,i=d,f=v<f?v:f):y===p&&v<f&&(f=v,i=d)}return i||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var i=t.leaf?this.compareMinX:l,o=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,o)&&t.children.sort(i)},i.prototype._allDistMargin=function(t,e,n,i){t.children.sort(i);for(var o=this.toBBox,r=s(t,0,e,o),l=s(t,n-e,n,o),u=c(r)+c(l),h=e;h<n-e;h++){var p=t.children[h];a(r,t.leaf?o(p):p),u+=c(r)}for(var f=n-e-1;f>=e;f--){var d=t.children[f];a(l,t.leaf?o(d):d),u+=c(l)}return u},i.prototype._adjustParentBBoxes=function(t,e,n){for(var i=n;i>=0;i--)a(e[i],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():r(t[e],this.toBBox)},i}()},Ro(Io={exports:{}},Io.exports),Io.exports),Mo=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Lo="renderOrder",Ao=function(t){function e(e){var n=this,i=e||{},o=J({},i);return delete o.style,delete o.renderBuffer,delete o.updateWhileAnimating,delete o.updateWhileInteracting,(n=t.call(this,o)||this).declutter_=void 0!==i.declutter&&i.declutter,n.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,n.style_=null,n.styleFunction_=void 0,n.setStyle(i.style),n.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,n.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,n}return Mo(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(Lo)},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 Po(9)),this.getRenderer().renderDeclutter(t)},e.prototype.setRenderOrder=function(t){this.set(Lo,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:vo,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var n;Array.isArray(t)?n=t:(mt("function"==typeof t.getZIndex,41),n=[t]),e=function(){return n}}return e}(this.style_),this.changed()},e}(bo),Do={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},Fo=[Do.FILL],ko=[Do.STROKE],jo=[Do.BEGIN_PATH],No=[Do.CLOSE_PATH],Go=Do,zo=function(){function t(){}return t.prototype.drawCustom=function(t,e,n,i){},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}(),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xo=function(t){function e(e,n,i,o){var r=t.call(this)||this;return r.tolerance=e,r.maxExtent=n,r.pixelRatio=o,r.maxLineWidth=0,r.resolution=i,r.beginGeometryInstruction1_=null,r.beginGeometryInstruction2_=null,r.bufferedMaxExtent_=null,r.instructions=[],r.coordinates=[],r.tmpCoordinate_=[],r.hitDetectionInstructions=[],r.state={},r}return Wo(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(),i=this.tmpCoordinate_,o=this.coordinates,r=o.length,s=0,a=t.length;s<a;s+=e)i[0]=t[s],i[1]=t[s+1],Bt(n,i)&&(o[r++]=i[0],o[r++]=i[1]);return r},e.prototype.appendFlatLineCoordinates=function(t,e,n,i,o,r){var s=this.coordinates,a=s.length,l=this.getBufferedMaxExtent();r&&(e+=i);var u,h,c,p=t[e],f=t[e+1],d=this.tmpCoordinate_,g=!0;for(u=e+i;u<n;u+=i)d[0]=t[u],d[1]=t[u+1],(c=Ut(l,d))!==h?(g&&(s[a++]=p,s[a++]=f,g=!1),s[a++]=d[0],s[a++]=d[1]):c===zt.INTERSECTING?(s[a++]=d[0],s[a++]=d[1],g=!1):g=!0,p=d[0],f=d[1],h=c;return(o&&g||u===e+i)&&(s[a++]=p,s[a++]=f),a},e.prototype.drawCustomCoordinates_=function(t,e,n,i,o){for(var r=0,s=n.length;r<s;++r){var a=n[r],l=this.appendFlatLineCoordinates(t,e,a,i,!1,!1);o.push(l),e=a}return e},e.prototype.drawCustom=function(t,e,n,i){this.beginGeometry(t,e);var o,r,s,a,l,u=t.getType(),h=t.getStride(),c=this.coordinates.length;switch(u){case"MultiPolygon":o=t.getOrientedFlatCoordinates(),a=[];var p=t.getEndss();l=0;for(var f=0,d=p.length;f<d;++f){var g=[];l=this.drawCustomCoordinates_(o,l,p[f],h,g),a.push(g)}this.instructions.push([Go.CUSTOM,c,a,t,n,Xn]),this.hitDetectionInstructions.push([Go.CUSTOM,c,a,t,i||n,Xn]);break;case"Polygon":case"MultiLineString":s=[],o="Polygon"==u?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),l=this.drawCustomCoordinates_(o,0,t.getEnds(),h,s),this.instructions.push([Go.CUSTOM,c,s,t,n,Wn]),this.hitDetectionInstructions.push([Go.CUSTOM,c,s,t,i||n,Wn]);break;case"LineString":case"Circle":o=t.getFlatCoordinates(),r=this.appendFlatLineCoordinates(o,0,o.length,h,!1,!1),this.instructions.push([Go.CUSTOM,c,r,t,n,zn]),this.hitDetectionInstructions.push([Go.CUSTOM,c,r,t,i||n,zn]);break;case"MultiPoint":o=t.getFlatCoordinates(),(r=this.appendFlatPointCoordinates(o,h))>c&&(this.instructions.push([Go.CUSTOM,c,r,t,n,zn]),this.hitDetectionInstructions.push([Go.CUSTOM,c,r,t,i||n,zn]));break;case"Point":o=t.getFlatCoordinates(),this.coordinates.push(o[0],o[1]),r=this.coordinates.length,this.instructions.push([Go.CUSTOM,c,r,t,n]),this.hitDetectionInstructions.push([Go.CUSTOM,c,r,t,i||n])}this.endGeometry(e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[Go.BEGIN_GEOMETRY,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Go.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,i,o=e.length,r=-1;for(t=0;t<o;++t)(i=(n=e[t])[0])==Go.END_GEOMETRY?r=t:i==Go.BEGIN_GEOMETRY&&(n[2]=t,Z(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var n=this.state;if(t){var i=t.getColor();n.fillStyle=bi(i||Ki)}else n.fillStyle=void 0;if(e){var o=e.getColor();n.strokeStyle=bi(o||Ui);var r=e.getLineCap();n.lineCap=void 0!==r?r:Bi;var s=e.getLineDash();n.lineDash=s?s.slice():Zi;var a=e.getLineDashOffset();n.lineDashOffset=a||0;var l=e.getLineJoin();n.lineJoin=void 0!==l?l:Vi;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=[Go.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[Go.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,i=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||o!=t.currentLineDash&&!U(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==n&&e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=o,t.currentLineDashOffset=r,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=[Go.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Yt(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;Xt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(zo),Yo=Xo,Ko=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Bo=function(t){function e(e,n,i,o){var r=t.call(this,e,n,i,o)||this;return r.hitDetectionImage_=null,r.image_=null,r.imagePixelRatio_=void 0,r.anchorX_=void 0,r.anchorY_=void 0,r.height_=void 0,r.opacity_=void 0,r.originX_=void 0,r.originY_=void 0,r.rotateWithView_=void 0,r.rotation_=void 0,r.scale_=void 0,r.width_=void 0,r.declutterMode_=void 0,r.declutterImageWithText_=void 0,r}return Ko(e,t),e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),i=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(n,i);this.instructions.push([Go.DRAW_IMAGE,o,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Go.DRAW_IMAGE,o,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),i=t.getStride(),o=this.coordinates.length,r=this.appendFlatPointCoordinates(n,i);this.instructions.push([Go.DRAW_IMAGE,o,r,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Go.DRAW_IMAGE,o,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(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(),i=t.getSize(),o=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=o[0],this.originY_=o[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e},e}(Yo),Zo=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Vo=function(t){function e(e,n,i,o){return t.call(this,e,n,i,o)||this}return Zo(e,t),e.prototype.drawFlatCoordinates_=function(t,e,n,i){var o=this.coordinates.length,r=this.appendFlatLineCoordinates(t,e,n,i,!1,!1),s=[Go.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},e.prototype.drawLineString=function(t,e){var n=this.state,i=n.strokeStyle,o=n.lineWidth;if(void 0!==i&&void 0!==o){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Go.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Zi,0],jo);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push(ko),this.endGeometry(e)}},e.prototype.drawMultiLineString=function(t,e){var n=this.state,i=n.strokeStyle,o=n.lineWidth;if(void 0!==i&&void 0!==o){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Go.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],jo);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),l=0,u=0,h=r.length;u<h;++u)l=this.drawFlatCoordinates_(s,l,r[u],a);this.hitDetectionInstructions.push(ko),this.endGeometry(e)}},e.prototype.finish=function(){var e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(ko),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(ko),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(jo)},e}(Yo),Uo=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ho=function(t){function e(e,n,i,o){return t.call(this,e,n,i,o)||this}return Uo(e,t),e.prototype.drawFlatCoordinatess_=function(t,e,n,i){var o=this.state,r=void 0!==o.fillStyle,s=void 0!==o.strokeStyle,a=n.length;this.instructions.push(jo),this.hitDetectionInstructions.push(jo);for(var l=0;l<a;++l){var u=n[l],h=this.coordinates.length,c=this.appendFlatLineCoordinates(t,e,u,i,!0,!s),p=[Go.MOVE_TO_LINE_TO,h,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(No),this.hitDetectionInstructions.push(No)),e=u}return r&&(this.instructions.push(Fo),this.hitDetectionInstructions.push(Fo)),s&&(this.instructions.push(ko),this.hitDetectionInstructions.push(ko)),e},e.prototype.drawCircle=function(t,e){var n=this.state,i=n.fillStyle,o=n.strokeStyle;if(void 0!==i||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Go.SET_FILL_STYLE,Ki]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Go.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var r=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(r,0,r.length,s,!1,!1);var l=[Go.CIRCLE,a];this.instructions.push(jo,l),this.hitDetectionInstructions.push(jo,l),void 0!==n.fillStyle&&(this.instructions.push(Fo),this.hitDetectionInstructions.push(Fo)),void 0!==n.strokeStyle&&(this.instructions.push(ko),this.hitDetectionInstructions.push(ko)),this.endGeometry(e)}},e.prototype.drawPolygon=function(t,e){var n=this.state,i=n.fillStyle,o=n.strokeStyle;if(void 0!==i||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Go.SET_FILL_STYLE,Ki]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Go.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);var r=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,r,a),this.endGeometry(e)}},e.prototype.drawMultiPolygon=function(t,e){var n=this.state,i=n.fillStyle,o=n.strokeStyle;if(void 0!==i||void 0!==o){this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Go.SET_FILL_STYLE,Ki]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([Go.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset]);for(var r=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),l=0,u=0,h=r.length;u<h;++u)l=this.drawFlatCoordinatess_(s,l,r[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,i=0,o=n.length;i<o;++i)n[i]=Nn(n[i],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}(Yo),qo=Ho;function $o(t,e,n,i,o){var r,s,a,l,u,h,c,p,f,d=n,g=n,_=0,y=0,v=n;for(r=n;r<i;r+=o){var m=e[r],x=e[r+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=r),y=0,v=r-o)),s=a,h=p,c=f),l=m,u=x}return(y+=a)>_?[v,r]:[d,g]}var Jo=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Qo={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},tr=function(t){function e(e,n,i,o){var r=t.call(this,e,n,i,o)||this;return r.labels_=null,r.text_="",r.textOffsetX_=0,r.textOffsetY_=0,r.textRotateWithView_=void 0,r.textRotation_=0,r.textFillState_=null,r.fillStates={},r.textStrokeState_=null,r.strokeStates={},r.textState_={},r.textStates={},r.textKey_="",r.fillKey_="",r.strokeKey_="",r.declutterImageWithText_=void 0,r}return Jo(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_,i=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(n||i)){var r=this.coordinates,s=r.length,a=t.getType(),l=null,u=t.getStride();if(o.placement!==Eo||"LineString"!=a&&"MultiLineString"!=a&&"Polygon"!=a&&"MultiPolygon"!=a){var h=o.overflow?null:[];switch(a){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),u=2;break;case"Polygon":l=t.getFlatInteriorPoint(),o.overflow||h.push(l[2]/this.resolution),u=3;break;case"MultiPolygon":var c=t.getFlatInteriorPoints();l=[];for(C=0,w=c.length;C<w;C+=3)o.overflow||h.push(c[C+2]/this.resolution),l.push(c[C],c[C+1]);if(0===l.length)return;u=2}if((P=this.appendFlatPointCoordinates(l,u))===s)return;if(h&&(P-s)/2!=l.length/u){var p=s/2;h=h.filter((function(t,e){var n=r[2*(p+e)]===l[e*u]&&r[2*(p+e)+1]===l[e*u+1];return n||--p,n}))}this.saveTextStates_(),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);var f=o.padding;if(f!=$i&&(o.scale[0]<0||o.scale[1]<0)){var d=o.padding[0],g=o.padding[1],_=o.padding[2],y=o.padding[3];o.scale[0]<0&&(g=-g,y=-y),o.scale[1]<0&&(d=-d,_=-_),f=[d,g,_,y]}var v=this.pixelRatio;this.instructions.push([Go.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,f==$i?$i:f.map((function(t){return t*v})),!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]);var m=1/v;this.hitDetectionInstructions.push([Go.DRAW_IMAGE,s,P,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[m,m],NaN,void 0,this.declutterImageWithText_,f,!!o.backgroundFill,!!o.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,h]),this.endGeometry(e)}else{if(!_e(this.getBufferedMaxExtent(),t.getExtent()))return;var x=void 0;if(l=t.getFlatCoordinates(),"LineString"==a)x=[l.length];else if("MultiLineString"==a)x=t.getEnds();else if("Polygon"==a)x=t.getEnds().slice(0,1);else if("MultiPolygon"==a){var E=t.getEndss();x=[];for(var C=0,w=E.length;C<w;++C)x.push(E[C][0])}this.beginGeometry(t,e);for(var S=o.textAlign,T=0,O=void 0,b=0,R=x.length;b<R;++b){if(null==S){var I=$o(o.maxAngle,l,T,x[b],u);T=I[0],O=I[1]}else O=x[b];for(var C=T;C<O;C+=u)r.push(l[C],l[C+1]);var P=r.length;T=x[b],this.drawChars_(s,P),s=P}this.endGeometry(e)}}},e.prototype.saveTextStates_=function(){var t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));var o=this.textKey_;o in this.textStates||(this.textStates[o]={font:e.font,textAlign:e.textAlign||Hi,justify:e.justify,textBaseline:e.textBaseline||qi,scale:e.scale});var r=this.fillKey_;n&&(r in this.fillStates||(this.fillStates[r]={fillStyle:n.fillStyle}))},e.prototype.drawChars_=function(t,e){var n=this.textStrokeState_,i=this.textState_,o=this.strokeKey_,r=this.textKey_,s=this.fillKey_;this.saveTextStates_();var a=this.pixelRatio,l=Qo[i.textBaseline],u=this.textOffsetY_*a,h=this.text_,c=n?n.lineWidth*Math.abs(i.scale[0])/2:0;this.instructions.push([Go.DRAW_CHARS,t,e,l,i.overflow,s,i.maxAngle,a,u,o,c*a,h,r,1]),this.hitDetectionInstructions.push([Go.DRAW_CHARS,t,e,l,i.overflow,s,i.maxAngle,1,u,o,c,h,r,1/a])},e.prototype.setTextStyle=function(t,e){var n,i,o;if(t){var r=t.getFill();r?((i=this.textFillState_)||(i={},this.textFillState_=i),i.fillStyle=bi(r.getColor()||Ki)):(i=null,this.textFillState_=i);var s=t.getStroke();if(s){(o=this.textStrokeState_)||(o={},this.textStrokeState_=o);var a=s.getLineDash(),l=s.getLineDashOffset(),u=s.getWidth(),h=s.getMiterLimit();o.lineCap=s.getLineCap()||Bi,o.lineDash=a?a.slice():Zi,o.lineDashOffset=void 0===l?0:l,o.lineJoin=s.getLineJoin()||Vi,o.lineWidth=void 0===u?1:u,o.miterLimit=void 0===h?10:h,o.strokeStyle=bi(s.getColor()||Ui)}else o=null,this.textStrokeState_=o;n=this.textState_;var c=t.getFont()||Yi;io(c);var p=t.getScaleArray();n.overflow=t.getOverflow(),n.font=c,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||qi,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||$i,n.scale=void 0===p?[1,1]:p;var f=t.getOffsetX(),d=t.getOffsetY(),g=t.getRotateWithView(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===d?0:d,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===_?0:_,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:k(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=i?"string"==typeof i.fillStyle?i.fillStyle:"|"+k(i.fillStyle):""}else this.text_="";this.declutterImageWithText_=e},e}(Yo),er={Circle:qo,Default:Yo,Image:Bo,LineString:Vo,Polygon:qo,Text:tr},nr=function(){function t(t,e,n,i){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,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 i in n){var o=n[i].finish();t[e][i]=o}}return t},t.prototype.getBuilder=function(t,e){var n=void 0!==t?t.toString():"0",i=this.buildersByZIndex_[n];void 0===i&&(i={},this.buildersByZIndex_[n]=i);var o=i[e];void 0===o&&(o=new(0,er[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=o);return o},t}(),ir=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),or=function(t){function e(e){var n=t.call(this)||this;return n.ready=!0,n.boundHandleImageChange_=n.handleImageChange_.bind(n),n.layer_=e,n.declutterExecutorGroup=null,n}return ir(e,t),e.prototype.getFeatures=function(t){return D()},e.prototype.getData=function(t){return null},e.prototype.prepareFrame=function(t){return D()},e.prototype.renderFrame=function(t,e){return D()},e.prototype.loadedTileCallback=function(t,e,n){t[e]||(t[e]={}),t[e][n.tileCoord.toString()]=n},e.prototype.createLoadedTileFinder=function(t,e,n){return function(i,o){var r=this.loadedTileCallback.bind(this,n,i);return t.forEachLoadedTile(e,i,o,r)}.bind(this)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o){},e.prototype.getDataAtPixel=function(t,e,n){return null},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleFontsChanged=function(){},e.prototype.handleImageChange_=function(t){t.target.getState()===gi.LOADED&&this.renderIfReadyAndVisible()},e.prototype.loadImage=function(t){var e=t.getState();return e!=gi.LOADED&&e!=gi.ERROR&&t.addEventListener(ot.CHANGE,this.boundHandleImageChange_),e==gi.IDLE&&(t.load(),e=t.getState()),e==gi.LOADED},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()},e.prototype.disposeInternal=function(){delete this.layer_,t.prototype.disposeInternal.call(this)},e}(ht),rr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),sr=function(t){function e(e,n,i,o){var r=t.call(this,e)||this;return r.inversePixelTransform=n,r.frameState=i,r.context=o,r}return rr(e,t),e}(W),ar=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),lr=[],ur=null;var hr=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.pixelContext_=null,n.frameState=null,n}return ar(e,t),e.prototype.getImageData=function(t,e,n){var i,o;ur||((i=document.createElement("canvas")).width=1,i.height=1,ur=i.getContext("2d")),ur.clearRect(0,0,1,1);try{ur.drawImage(t,e,n,1,1,0,0,1,1),o=ur.getImageData(0,0,1,1).data}catch(t){return ur=null,null}return o},e.prototype.getBackground=function(t){var e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0},e.prototype.useContainer=function(t,e,n){var i,o,r=this.getLayer().getClassName();t&&t.className===r&&(!n||t&&t.style.backgroundColor&&U(Si(t.style.backgroundColor),Si(n)))&&((a=t.firstElementChild)instanceof HTMLCanvasElement&&(o=a.getContext("2d")));if(o&&o.canvas.style.transform===e?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){(i=document.createElement("div")).className=r;var s=i.style;s.position="absolute",s.width="100%",s.height="100%";var a=(o=Ri()).canvas;i.appendChild(a),(s=a.style).position="absolute",s.left="0",s.transformOrigin="top left",this.container=i,this.context=o}this.containerReused||!n||this.container.style.backgroundColor||(this.container.style.backgroundColor=n)},e.prototype.clipUnrotated=function(t,e,n){var i=fe(n),o=de(n),r=se(n),s=re(n);kt(e.coordinateToPixelTransform,i),kt(e.coordinateToPixelTransform,o),kt(e.coordinateToPixelTransform,r),kt(e.coordinateToPixelTransform,s);var a=this.inversePixelTransform;kt(a,i),kt(a,o),kt(a,r),kt(a,s),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.clip()},e.prototype.dispatchRenderEvent_=function(t,e,n){var i=this.getLayer();if(i.hasListener(t)){var o=new sr(t,this.inversePixelTransform,n,e);i.dispatchEvent(o)}},e.prototype.preRender=function(t,e){this.frameState=e,this.dispatchRenderEvent_(ai,t,e)},e.prototype.postRender=function(t,e){this.dispatchRenderEvent_(li,t,e)},e.prototype.getRenderTransform=function(t,e,n,i,o,r,s){var a=o/2,l=r/2,u=i/e,h=-u,c=-t[0]+s,p=-t[1];return jt(this.tempTransform,a,l,u,h,-n,c,p)},e.prototype.getDataAtPixel=function(t,e,n){var i=kt(this.inversePixelTransform,t.slice()),o=this.context,r=this.getLayer().getExtent();if(r&&!Bt(r,kt(e.pixelToCoordinateTransform,t.slice())))return null;var s,a=Math.round(i[0]),l=Math.round(i[1]),u=this.pixelContext_;if(!u){var h=document.createElement("canvas");h.width=1,h.height=1,u=h.getContext("2d"),this.pixelContext_=u}u.clearRect(0,0,1,1);try{u.drawImage(o.canvas,a,l,1,1,0,0,1,1),s=u.getImageData(0,0,1,1).data}catch(t){return"SecurityError"===t.name?(this.pixelContext_=null,new Uint8Array):s}return 0===s[3]?null:s},e.prototype.disposeInternal=function(){delete this.frameState,t.prototype.disposeInternal.call(this)},e}(or),cr=hr;function pr(t,e,n,i,o,r,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+=i],f=t[e+1],y+=_,_=Math.sqrt((p-d)*(p-d)+(f-g)*(f-g))}do{v()}while(e<n-i&&y+_<r);for(var m=0===_?0:(r-y)/_,x=be(d,p,m),E=be(g,f,m),C=e-i,w=y,S=r+a*l(u,o,h);e<n-i&&y+_<S;)v();var T,O=be(d,p,m=0===_?0:(S-y)/_),b=be(g,f,m);if(c){var R=[x,E,O,b];Tn(R,0,4,2,c,R,R),T=R[0]>R[2]}else T=x>O;var I,P=Math.PI,M=[],L=C+i===e;if(_=0,y=w,p=t[e=C],f=t[e+1],L){v(),I=Math.atan2(f-g,p-d),T&&(I+=I>0?-P:P);var A=(O+x)/2,D=(b+E)/2;return M[0]=[A,D,(S-r)/2,I,o],M}for(var F=0,k=(o=o.replace(/\n/g," ")).length;F<k;){v();var j=Math.atan2(f-g,p-d);if(T&&(j+=j>0?-P:P),void 0!==I){var N=j-I;if(N+=N>P?-2*P:N<-P?2*P:0,Math.abs(N)>s)return null}I=j;for(var G=F,z=0;F<k;++F){var W=a*l(u,o[T?k-F-1:F],h);if(e+i<n&&y+_<r+z+W/2)break;z+=W}if(F!==G){var X=T?o.substring(k-G,k-F):o.substring(G,F);A=be(d,p,m=0===_?0:(r+z/2-y)/_),D=be(g,f,m);M.push([A,D,z/2,j,X]),r+=z}}return M}var fr=[1/0,1/0,-1/0,-1/0],dr=[],gr=[],_r=[],yr=[];function vr(t){return t[3].declutterBox}var mr=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 xr(t,e){return"start"!==e&&"end"!==e||mr.test(t)||(e="start"===e?"left":"right"),Qo[e]}function Er(t,e,n){return n>0&&t.push("\n",""),t.push(e,""),t}var Cr=function(){function t(t,e,n,i){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={}}return t.prototype.createLabel=function(t,e,n,i){var o=t+e+n+i;if(this.labels_[o])return this.labels_[o];var r=i?this.strokeStates[i]:null,s=n?this.fillStates[n]:null,a=this.textStates[e],l=this.pixelRatio,u=[a.scale[0]*l,a.scale[1]*l],h=Array.isArray(t),c=a.justify?Qo[a.justify]:xr(Array.isArray(t)?t[0]:t,a.textAlign||Hi),p=i&&r.lineWidth?r.lineWidth:0,f=h?t:t.split("\n").reduce(Er,[]),d=function(t,e){for(var n=[],i=[],o=[],r=0,s=0,a=0,l=0,u=0,h=e.length;u<=h;u+=2){var c=e[u];if("\n"!==c&&u!==h){var p=e[u+1]||t.font,f=so(p,c);n.push(f),s+=f;var d=oo(p);i.push(d),l=Math.max(l,d)}else r=Math.max(r,s),o.push(s),s=0,a+=l}return{width:r,height:a,widths:n,heights:i,lineWidths:o}}(a,f),g=d.width,_=d.height,y=d.widths,v=d.heights,m=d.lineWidths,x=g+p,E=[],C=(x+2)*u[0],w=(_+p)*u[1],S={width:C<0?Math.floor(C):Math.ceil(C),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:E};(1==u[0]&&1==u[1]||E.push("scale",u),i)&&(E.push("strokeStyle",r.strokeStyle),E.push("lineWidth",p),E.push("lineCap",r.lineCap),E.push("lineJoin",r.lineJoin),E.push("miterLimit",r.miterLimit),(At?OffscreenCanvasRenderingContext2D:CanvasRenderingContext2D).prototype.setLineDash&&(E.push("setLineDash",[r.lineDash]),E.push("lineDashOffset",r.lineDashOffset)));n&&E.push("fillStyle",s.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");for(var T,O=.5-c,b=c*x+O*p,R=[],I=[],P=0,M=0,L=0,A=0,D=0,F=f.length;D<F;D+=2){var k=f[D];if("\n"!==k){var j=f[D+1]||a.font;j!==T&&(i&&R.push("font",j),n&&I.push("font",j),T=j),P=Math.max(P,v[L]);var N=[k,b+O*y[L]+c*(y[L]-m[A]),.5*(p+P)+M];b+=y[L],i&&R.push("strokeText",N),n&&I.push("fillText",N),++L}else M+=P,P=0,b=c*x+O*p,++A}return Array.prototype.push.apply(E,R),Array.prototype.push.apply(E,I),this.labels_[o]=S,S},t.prototype.replayTextBackground_=function(t,e,n,i,o,r,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,o),t.lineTo.apply(t,e),r&&(this.alignFill_=r[2],this.fill_(t)),s&&(this.setStrokeStyle_(t,s),t.stroke())},t.prototype.calculateImageOrLabelDimensions_=function(t,e,n,i,o,r,s,a,l,u,h,c,p,f,d,g){var _,y=n-(s*=c[0]),v=i-(a*=c[1]),m=o+l>t?t-l:o,x=r+u>e?e-u:r,E=f[3]+m*c[0]+f[1],C=f[0]+x*c[1]+f[2],w=y-f[3],S=v-f[0];return(d||0!==h)&&(dr[0]=w,yr[0]=w,dr[1]=S,gr[1]=S,gr[0]=w+E,_r[0]=gr[0],_r[1]=S+C,yr[1]=_r[1]),0!==h?(kt(_=jt([1,0,0,1,0,0],n,i,1,1,h,-n,-i),dr),kt(_,gr),kt(_,_r),kt(_,yr),qt(Math.min(dr[0],gr[0],_r[0],yr[0]),Math.min(dr[1],gr[1],_r[1],yr[1]),Math.max(dr[0],gr[0],_r[0],yr[0]),Math.max(dr[1],gr[1],_r[1],yr[1]),fr)):qt(Math.min(w,w+E),Math.min(S,S+C),Math.max(w,w+E),Math.max(S,S+C),fr),p&&(y=Math.round(y),v=Math.round(v)),{drawImageX:y,drawImageY:v,drawImageW:m,drawImageH:x,originX:l,originY:u,declutterBox:{minX:fr[0],minY:fr[1],maxX:fr[2],maxY:fr[3],value:g},canvasTransform:_,scale:c}},t.prototype.replayImageOrLabel_=function(t,e,n,i,o,r,s){var a=!(!r&&!s),l=i.declutterBox,u=t.canvas,h=s?s[2]*i.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,dr,gr,_r,yr,r,s),lo(t,i.canvasTransform,o,n,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.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,i){var o=this.textStates[e],r=this.createLabel(t,e,i,n),s=this.strokeStates[n],a=this.pixelRatio,l=xr(Array.isArray(t)?t[0]:t,o.textAlign||Hi),u=Qo[o.textBaseline||qi],h=s&&s.lineWidth?s.lineWidth:0;return{label:r,anchorX:l*(r.width/a-2*o.scale[0])+2*(.5-l)*h,anchorY:u*r.height/a+2*(.5-u)*h}},t.prototype.execute_=function(t,e,n,i,o,r,s,a){var l,u,h;this.pixelCoordinates_&&U(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=Sn(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,g,_,y,v,m,x,E,C,w,S,T,O,b=0,R=i.length,I=0,P=0,M=0,L=null,A=null,D=this.coordinateCache_,F=this.viewRotation_,k=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,j={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:F},N=this.instructions!=i||this.overlaps?0:200;b<R;){var G=i[b];switch(G[0]){case Go.BEGIN_GEOMETRY:w=G[1],O=G[3],w.getGeometry()?void 0===s||_e(s,O.getExtent())?++b:b=G[2]+1:b=G[2];break;case Go.BEGIN_PATH:P>N&&(this.fill_(t),P=0),M>N&&(t.stroke(),M=0),P||M||(t.beginPath(),d=NaN,g=NaN),++b;break;case Go.CIRCLE:var z=l[I=G[1]],W=l[I+1],X=l[I+2]-z,Y=l[I+3]-W,K=Math.sqrt(X*X+Y*Y);t.moveTo(z+K,W),t.arc(z,W,K,0,2*Math.PI,!0),++b;break;case Go.CLOSE_PATH:t.closePath(),++b;break;case Go.CUSTOM:I=G[1],c=G[2];var B=G[3],Z=G[4],V=6==G.length?G[5]:void 0;j.geometry=B,j.feature=w,b in D||(D[b]=[]);var H=D[b];V?V(l,I,c,2,H):(H[0]=l[I],H[1]=l[I+1],H.length=2),Z(H,j),++b;break;case Go.DRAW_IMAGE:I=G[1],c=G[2],v=G[3],p=G[4],f=G[5];var q=G[6],$=G[7],J=G[8],Q=G[9],tt=G[10],et=G[11],nt=G[12],it=G[13],ot=G[14],rt=G[15];if(!v&&G.length>=20){m=G[19],x=G[20],E=G[21],C=G[22];var st=this.drawLabelWithPointPlacement_(m,x,E,C);v=st.label,G[3]=v;var at=G[23];p=(st.anchorX-at)*this.pixelRatio,G[4]=p;var lt=G[24];f=(st.anchorY-lt)*this.pixelRatio,G[5]=f,q=v.height,G[6]=q,it=v.width,G[13]=it}var ut=void 0;G.length>25&&(ut=G[25]);var ht=void 0,ct=void 0,pt=void 0;G.length>17?(ht=G[16],ct=G[17],pt=G[18]):(ht=$i,ct=!1,pt=!1),tt&&k?et+=F:tt||k||(et-=F);for(var ft=0;I<c;I+=2)if(!(ut&&ut[ft++]<it/this.pixelRatio)){var dt=[t,e,v,Wt=this.calculateImageOrLabelDimensions_(v.width,v.height,l[I],l[I+1],it,q,p,f,J,Q,et,nt,o,ht,ct||pt,w),$,ct?L:null,pt?A:null];if(a){if("none"===ot)continue;if("obstacle"===ot){a.insert(Wt.declutterBox);continue}var gt=void 0,_t=void 0;if(rt){var yt=c-I;if(!rt[yt]){rt[yt]=dt;continue}if(gt=rt[yt],delete rt[yt],_t=vr(gt),a.collides(_t))continue}if(a.collides(Wt.declutterBox))continue;gt&&(a.insert(_t),this.replayImageOrLabel_.apply(this,gt)),a.insert(Wt.declutterBox)}this.replayImageOrLabel_.apply(this,dt)}++b;break;case Go.DRAW_CHARS:var vt=G[1],mt=G[2],xt=G[3],Et=G[4];C=G[5];var Ct=G[6],wt=G[7],St=G[8];E=G[9];var Tt=G[10];m=G[11],x=G[12];var Ot=[G[13],G[13]],bt=this.textStates[x],Rt=bt.font,It=[bt.scale[0]*wt,bt.scale[1]*wt],Pt=void 0;Rt in this.widths_?Pt=this.widths_[Rt]:(Pt={},this.widths_[Rt]=Pt);var Mt=fi(l,vt,mt,2),Lt=Math.abs(It[0])*ao(Rt,m,Pt);if(Et||Lt<=Mt){var At=this.textStates[x].textAlign,Dt=pr(l,vt,mt,2,m,(Mt-Lt)*Qo[At],Ct,Math.abs(It[0]),ao,Rt,Pt,k?0:this.viewRotation_);t:if(Dt){var Ft=[],kt=void 0,jt=void 0,Nt=void 0,Gt=void 0,zt=void 0;if(E)for(kt=0,jt=Dt.length;kt<jt;++kt){Nt=(zt=Dt[kt])[4],Gt=this.createLabel(Nt,x,"",E),p=zt[2]+(It[0]<0?-Tt:Tt),f=xt*Gt.height+2*(.5-xt)*Tt*It[1]/It[0]-St;var Wt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,zt[0],zt[1],Gt.width,Gt.height,p,f,0,0,zt[3],Ot,!1,$i,!1,w);if(a&&a.collides(Wt.declutterBox))break t;Ft.push([t,e,Gt,Wt,1,null,null])}if(C)for(kt=0,jt=Dt.length;kt<jt;++kt){Nt=(zt=Dt[kt])[4],Gt=this.createLabel(Nt,x,C,""),p=zt[2],f=xt*Gt.height-St;Wt=this.calculateImageOrLabelDimensions_(Gt.width,Gt.height,zt[0],zt[1],Gt.width,Gt.height,p,f,0,0,zt[3],Ot,!1,$i,!1,w);if(a&&a.collides(Wt.declutterBox))break t;Ft.push([t,e,Gt,Wt,1,null,null])}a&&a.load(Ft.map(vr));for(var Xt=0,Yt=Ft.length;Xt<Yt;++Xt)this.replayImageOrLabel_.apply(this,Ft[Xt])}}++b;break;case Go.END_GEOMETRY:if(void 0!==r){var Kt=r(w=G[1],O);if(Kt)return Kt}++b;break;case Go.FILL:N?P++:this.fill_(t),++b;break;case Go.MOVE_TO_LINE_TO:for(I=G[1],c=G[2],S=l[I],y=(T=l[I+1])+.5|0,(_=S+.5|0)===d&&y===g||(t.moveTo(S,T),d=_,g=y),I+=2;I<c;I+=2)_=(S=l[I])+.5|0,y=(T=l[I+1])+.5|0,I!=c-2&&_===d&&y===g||(t.lineTo(S,T),d=_,g=y);++b;break;case Go.SET_FILL_STYLE:L=G,this.alignFill_=G[2],P&&(this.fill_(t),P=0,M&&(t.stroke(),M=0)),t.fillStyle=G[1],++b;break;case Go.SET_STROKE_STYLE:A=G,M&&(t.stroke(),M=0),this.setStrokeStyle_(t,G),++b;break;case Go.STROKE:N?M++:t.stroke(),++b;break;default:++b}}P&&this.fill_(t),M&&t.stroke()},t.prototype.execute=function(t,e,n,i,o,r){this.viewRotation_=i,this.execute_(t,e,n,this.instructions,o,void 0,void 0,r)},t.prototype.executeHitDetection=function(t,e,n,i,o){return this.viewRotation_=n,this.execute_(t,1,e,this.hitDetectionInstructions,!0,i,o)},t}(),wr=Cr,Sr=["Polygon","Circle","LineString","Image","Text","Default"],Tr=function(){function t(t,e,n,i,o,r){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=r,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(o)}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 i=t[e];for(var o in i){var r=i[o];n[o]=new wr(this.resolution_,this.pixelRatio_,this.overlaps_,r)}}},t.prototype.hasExecutors=function(t){for(var e in this.executorsByZIndex_)for(var n=this.executorsByZIndex_[e],i=0,o=t.length;i<o;++i)if(t[i]in n)return!0;return!1},t.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o,r){var s=2*(i=Math.round(i))+1,a=jt(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-n,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=Ri(s,s));var u,h=this.hitDetectionContext_;h.canvas.width!==s||h.canvas.height!==s?(h.canvas.width=s,h.canvas.height=s):l||h.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(te(u=[1/0,1/0,-1/0,-1/0],t),Xt(u,e*(this.renderBuffer_+i),u));var c,p=function(t){if(void 0!==Or[t])return Or[t];for(var e=2*t+1,n=t*t,i=new Array(n+1),o=0;o<=t;++o)for(var r=0;r<=t;++r){var s=o*o+r*r;if(s>n)break;var a=i[s];a||(a=[],i[s]=a),a.push(4*((t+o)*e+(t+r))+3),o>0&&a.push(4*((t-o)*e+(t+r))+3),r>0&&(a.push(4*((t+o)*e+(t-r))+3),o>0&&a.push(4*((t-o)*e+(t-r))+3))}for(var l=[],u=(o=0,i.length);o<u;++o)i[o]&&l.push.apply(l,i[o]);return Or[t]=l,l}(i);function f(t,e){for(var n=h.getImageData(0,0,s,s).data,a=0,l=p.length;a<l;a++)if(n[p[a]]>0){if(!r||"Image"!==c&&"Text"!==c||-1!==r.indexOf(t)){var u=(p[a]-3)/4,f=i-u%s,d=i-(u/s|0),g=o(t,e,f*f+d*d);if(g)return g}h.clearRect(0,0,s,s);break}}var d,g,_,y,v,m=Object.keys(this.executorsByZIndex_).map(Number);for(m.sort(K),d=m.length-1;d>=0;--d){var x=m[d].toString();for(_=this.executorsByZIndex_[x],g=Sr.length-1;g>=0;--g)if(void 0!==(y=_[c=Sr[g]])&&(v=y.executeHitDetection(h,a,n,f,u)))return v}},t.prototype.getClipCoords=function(t){var e=this.maxExtent_;if(!e)return null;var n=e[0],i=e[1],o=e[2],r=e[3],s=[n,i,n,r,o,r,o,i];return Sn(s,0,8,2,t,s),s},t.prototype.isEmpty=function(){return et(this.executorsByZIndex_)},t.prototype.execute=function(t,e,n,i,o,r,s){var a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(K),this.maxExtent_&&(t.save(),this.clip(t,n));var l,u,h,c,p,f,d=r||Sr;for(s&&a.reverse(),l=0,u=a.length;l<u;++l){var g=a[l].toString();for(p=this.executorsByZIndex_[g],h=0,c=d.length;h<c;++h){void 0!==(f=p[d[h]])&&f.execute(t,e,n,i,o,s)}}this.maxExtent_&&t.restore()},t}(),Or={};var br=Tr,Rr={ANIMATING:0,INTERACTING:1},Ir=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Pr=function(t){function e(e,n,i,o,r,s,a){var l=t.call(this)||this;return l.context_=e,l.pixelRatio_=n,l.extent_=i,l.transform_=o,l.viewRotation_=r,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 Ir(e,t),e.prototype.drawImages_=function(t,e,n,i){if(this.image_){var o=Sn(t,e,n,i,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.tmpLocalTransform_,a=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=a*this.imageOpacity_);var l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(var u=0,h=o.length;u<h;u+=2){var c=o[u]-this.imageAnchorX_,p=o[u+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){var f=c+this.imageAnchorX_,d=p+this.imageAnchorY_;jt(s,f,d,1,1,l,-f,-d),r.setTransform.apply(r,s),r.translate(f,d),r.scale(this.imageScale_[0],this.imageScale_[1]),r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),r.setTransform(1,0,0,1,0,0)}else r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(r.globalAlpha=a)}},e.prototype.drawText_=function(t,e,n,i){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=Sn(t,e,n,i,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<n;e+=i){var a=o[e]+this.textOffsetX_,l=o[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]){var u=jt(this.tmpLocalTransform_,a,l,1,1,s,-a,-l);r.setTransform.apply(r,u),r.translate(a,l),r.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&r.strokeText(this.text_,0,0),this.textFillState_&&r.fillText(this.text_,0,0),r.setTransform(1,0,0,1,0,0)}else this.textStrokeState_&&r.strokeText(this.text_,a,l),this.textFillState_&&r.fillText(this.text_,a,l)}}},e.prototype.moveToLineTo_=function(t,e,n,i,o){var r=this.context_,s=Sn(t,e,n,i,this.transform_,this.pixelCoordinates_);r.moveTo(s[0],s[1]);var a=s.length;o&&(a-=2);for(var l=2;l<a;l+=2)r.lineTo(s[l],s[l+1]);return o&&r.closePath(),n},e.prototype.drawRings_=function(t,e,n,i){for(var o=0,r=n.length;o<r;++o)e=this.moveToLineTo_(t,e,n[o],i,!0);return e},e.prototype.drawCircle=function(t){if(_e(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 i=t.getFlatCoordinates();if(i){var o=t.getStride();return Sn(i,0,i.length,o,e,n)}return null}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],i=e[3]-e[1],o=Math.sqrt(n*n+i*i),r=this.context_;r.beginPath(),r.arc(e[0],e[1],o,0,2*Math.PI),this.fillState_&&r.fill(),this.strokeState_&&r.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"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var n=e.getGeometryFunction()(t);n&&_e(this.extent_,n.getExtent())&&(this.setStyle(e),this.drawGeometry(n))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),n=0,i=e.length;n<i;++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_)),_e(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 i=t.getFlatMidpoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiLineString=function(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));var e=t.getExtent();if(_e(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var n=this.context_,i=t.getFlatCoordinates(),o=0,r=t.getEnds(),s=t.getStride();n.beginPath();for(var a=0,l=r.length;a<l;++a)o=this.moveToLineTo_(i,o,r[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_)),_e(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_)),_e(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(),i=0,o=t.getEndss(),r=t.getStride();e.beginPath();for(var s=0,a=o.length;s<a;++s){var l=o[s];i=this.drawRings_(n,i,l,r)}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&&(U(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_,i=t.textAlign?t.textAlign:Hi;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=i&&(n.textAlign=i,e.textAlign=i),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=i,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:i,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){var n=this;if(t){var i=t.getColor();this.fillState_={fillStyle:bi(i||Ki)}}else this.fillState_=null;if(e){var o=e.getColor(),r=e.getLineCap(),s=e.getLineDash(),a=e.getLineDashOffset(),l=e.getLineJoin(),u=e.getWidth(),h=e.getMiterLimit(),c=s||Zi;this.strokeState_={lineCap:void 0!==r?r:Bi,lineDash:1===this.pixelRatio_?c:c.map((function(t){return t*n.pixelRatio_})),lineDashOffset:(a||0)*this.pixelRatio_,lineJoin:void 0!==l?l:Vi,lineWidth:(void 0!==u?u:1)*this.pixelRatio_,miterLimit:void 0!==h?h:10,strokeStyle:bi(o||Ui)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){var e;if(t&&(e=t.getSize())){var n=t.getAnchor(),i=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_=i[0],this.imageOriginY_=i[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:bi(n||Ki)}}else this.textFillState_=null;var i=t.getStroke();if(i){var o=i.getColor(),r=i.getLineCap(),s=i.getLineDash(),a=i.getLineDashOffset(),l=i.getLineJoin(),u=i.getWidth(),h=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:Bi,lineDash:s||Zi,lineDashOffset:a||0,lineJoin:void 0!==l?l:Vi,lineWidth:void 0!==u?u:1,miterLimit:void 0!==h?h:10,strokeStyle:bi(o||Ui)}}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:Yi,textAlign:void 0!==v?v:Hi,textBaseline:void 0!==m?m:qi},this.text_=void 0!==y?Array.isArray(y)?y.reduce((function(t,e,n){return t+(n%2?" ":e)}),""):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}(zo),Mr=Pr,Lr={FRACTION:"fraction",PIXELS:"pixels"},Ar={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"};function Dr(t,e,n){return e+":"+t+":"+(n?Ci(n):"null")}var Fr=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 i=Dr(t,e,n);return i in this.cache_?this.cache_[i]:null},t.prototype.set=function(t,e,n,i){var o=Dr(t,e,n);this.cache_[o]=i,++this.cacheSize_},t.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},t}()),kr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),jr=function(t){function e(e,n,i,o){var r=t.call(this)||this;return r.extent=e,r.pixelRatio_=i,r.resolution=n,r.state=o,r}return kr(e,t),e.prototype.changed=function(){this.dispatchEvent(ot.CHANGE)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return D()},e.prototype.getPixelRatio=function(){return this.pixelRatio_},e.prototype.getResolution=function(){return this.resolution},e.prototype.getState=function(){return this.state},e.prototype.load=function(){D()},e}(it),Nr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Gr(t,e,n){var i=t,o=!0,r=!1,s=!1,a=[st(i,ot.LOAD,(function(){s=!0,r||e()}))];return i.src&&Dt?(r=!0,i.decode().then((function(){o&&e()})).catch((function(t){o&&(s?e():n())}))):a.push(st(i,ot.ERROR,n)),function(){o=!1,a.forEach(at)}}!function(t){function e(e,n,i,o,r,s){var a=t.call(this,e,n,i,gi.IDLE)||this;return a.src_=o,a.image_=new Image,null!==r&&(a.image_.crossOrigin=r),a.unlisten_=null,a.state=gi.IDLE,a.imageLoadFunction_=s,a}Nr(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.handleImageError_=function(){this.state=gi.ERROR,this.unlistenImage_(),this.changed()},e.prototype.handleImageLoad_=function(){void 0===this.resolution&&(this.resolution=ce(this.extent)/this.image_.height),this.state=gi.LOADED,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state!=gi.IDLE&&this.state!=gi.ERROR||(this.state=gi.LOADING,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Gr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.setImage=function(t){this.image_=t,this.resolution=ce(this.extent)/this.image_.height},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}(jr);var zr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wr=null,Xr=function(t){function e(e,n,i,o,r,s){var a=t.call(this)||this;return a.hitDetectionImage_=null,a.image_=e||new Image,null!==o&&(a.image_.crossOrigin=o),a.canvas_={},a.color_=s,a.unlisten_=null,a.imageState_=r,a.size_=i,a.src_=n,a.tainted_,a}return zr(e,t),e.prototype.isTainted_=function(){if(void 0===this.tainted_&&this.imageState_===gi.LOADED){Wr||(Wr=Ri(1,1)),Wr.drawImage(this.image_,0,0);try{Wr.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Wr=null,this.tainted_=!0}}return!0===this.tainted_},e.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(ot.CHANGE)},e.prototype.handleImageError_=function(){this.imageState_=gi.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},e.prototype.handleImageLoad_=function(){this.imageState_=gi.LOADED,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()},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=Ri(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_==gi.IDLE){this.imageState_=gi.LOADING;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Gr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}},e.prototype.replaceColor_=function(t){if(this.color_&&!this.canvas_[t]&&this.imageState_===gi.LOADED){var e=document.createElement("canvas");this.canvas_[t]=e,e.width=Math.ceil(this.image_.width*t),e.height=Math.ceil(this.image_.height*t);var n=e.getContext("2d");if(n.scale(t,t),n.drawImage(this.image_,0,0),n.globalCompositeOperation="multiply","multiply"===n.globalCompositeOperation||this.isTainted_())n.fillStyle=Ci(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 i=n.getImageData(0,0,e.width,e.height),o=i.data,r=this.color_[0]/255,s=this.color_[1]/255,a=this.color_[2]/255,l=this.color_[3],u=0,h=o.length;u<h;u+=4)o[u]*=r,o[u+1]*=s,o[u+2]*=a,o[u+3]*=l;n.putImageData(i,0,0)}}},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(it);var Yr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Kr=function(t){function e(e){var n=this,i=e||{},o=void 0!==i.opacity?i.opacity:1,r=void 0!==i.rotation?i.rotation:0,s=void 0!==i.scale?i.scale:1,a=void 0!==i.rotateWithView&&i.rotateWithView;(n=t.call(this,{opacity:o,rotation:r,scale:s,displacement:void 0!==i.displacement?i.displacement:[0,0],rotateWithView:a,declutterMode:i.declutterMode})||this).anchor_=void 0!==i.anchor?i.anchor:[.5,.5],n.normalizedAnchor_=null,n.anchorOrigin_=void 0!==i.anchorOrigin?i.anchorOrigin:Ar.TOP_LEFT,n.anchorXUnits_=void 0!==i.anchorXUnits?i.anchorXUnits:Lr.FRACTION,n.anchorYUnits_=void 0!==i.anchorYUnits?i.anchorYUnits:Lr.FRACTION,n.crossOrigin_=void 0!==i.crossOrigin?i.crossOrigin:null;var l=void 0!==i.img?i.img:null;n.imgSize_=i.imgSize;var u=i.src;mt(!(void 0!==u&&l),4),mt(!l||l&&n.imgSize_,5),void 0!==u&&0!==u.length||!l||(u=l.src||k(l)),mt(void 0!==u&&u.length>0,6);var h=void 0!==i.src?gi.IDLE:gi.LOADED;return n.color_=void 0!==i.color?Si(i.color):null,n.iconImage_=function(t,e,n,i,o,r){var s=Fr.get(e,i,r);return s||(s=new Xr(t,e,n,i,o,r),Fr.set(e,i,r,s)),s}(l,u,void 0!==n.imgSize_?n.imgSize_:null,n.crossOrigin_,h,n.color_),n.offset_=void 0!==i.offset?i.offset:[0,0],n.offsetOrigin_=void 0!==i.offsetOrigin?i.offsetOrigin:Ar.TOP_LEFT,n.origin_=null,n.size_=void 0!==i.size?i.size:null,n}return Yr(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_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})},e.prototype.getAnchor=function(){var t=this.normalizedAnchor_;if(!t){t=this.anchor_;var e=this.getSize();if(this.anchorXUnits_==Lr.FRACTION||this.anchorYUnits_==Lr.FRACTION){if(!e)return null;t=this.anchor_.slice(),this.anchorXUnits_==Lr.FRACTION&&(t[0]*=e[0]),this.anchorYUnits_==Lr.FRACTION&&(t[1]*=e[1])}if(this.anchorOrigin_!=Ar.TOP_LEFT){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),this.anchorOrigin_!=Ar.TOP_RIGHT&&this.anchorOrigin_!=Ar.BOTTOM_RIGHT||(t[0]=-t[0]+e[0]),this.anchorOrigin_!=Ar.BOTTOM_LEFT&&this.anchorOrigin_!=Ar.BOTTOM_RIGHT||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}var n=this.getDisplacement();return[t[0]-n[0],t[1]+n[1]]},e.prototype.setAnchor=function(t){this.anchor_=t,this.normalizedAnchor_=null},e.prototype.getColor=function(){return this.color_},e.prototype.getImage=function(t){return this.iconImage_.getImage(t)},e.prototype.getPixelRatio=function(t){return this.iconImage_.getPixelRatio(t)},e.prototype.getImageSize=function(){return this.iconImage_.getSize()},e.prototype.getImageState=function(){return this.iconImage_.getImageState()},e.prototype.getHitDetectionImage=function(){return this.iconImage_.getHitDetectionImage()},e.prototype.getOrigin=function(){if(this.origin_)return this.origin_;var t=this.offset_;if(this.offsetOrigin_!=Ar.TOP_LEFT){var e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),this.offsetOrigin_!=Ar.TOP_RIGHT&&this.offsetOrigin_!=Ar.BOTTOM_RIGHT||(t[0]=n[0]-e[0]-t[0]),this.offsetOrigin_!=Ar.BOTTOM_LEFT&&this.offsetOrigin_!=Ar.BOTTOM_RIGHT||(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(ot.CHANGE,t)},e.prototype.load=function(){this.iconImage_.load()},e.prototype.unlistenImageChange=function(t){this.iconImage_.removeEventListener(ot.CHANGE,t)},e}(mi),Br=Kr,Zr=.5;var Vr=.5,Ur={Point:function(t,e,n,i,o){var r,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=gi.LOADED)return;var l=t;if(o){var u=s.getDeclutterMode();if("none"!==u)if(l=o,"obstacle"===u){var h=t.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,r),h.drawPoint(e,i)}else a&&a.getText()&&(r={})}var c=l.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,r),c.drawPoint(e,i)}if(a&&a.getText()){var p=t;o&&(p=o);var f=p.getBuilder(n.getZIndex(),"Text");f.setTextStyle(a,r),f.drawText(e,i)}},LineString:function(t,e,n,i,o){var r=n.getStroke();if(r){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,r),s.drawLineString(e,i)}var a=n.getText();if(a&&a.getText()){var l=(o||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i)}},Polygon:function(t,e,n,i,o){var r=n.getFill(),s=n.getStroke();if(r||s){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(r,s),a.drawPolygon(e,i)}var l=n.getText();if(l&&l.getText()){var u=(o||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(l),u.drawText(e,i)}},MultiPoint:function(t,e,n,i,o){var r,s=n.getImage(),a=n.getText();if(s){if(s.getImageState()!=gi.LOADED)return;var l=t;if(o){var u=s.getDeclutterMode();if("none"!==u)if(l=o,"obstacle"===u){var h=t.getBuilder(n.getZIndex(),"Image");h.setImageStyle(s,r),h.drawMultiPoint(e,i)}else a&&a.getText()&&(r={})}var c=l.getBuilder(n.getZIndex(),"Image");c.setImageStyle(s,r),c.drawMultiPoint(e,i)}if(a&&a.getText()){var p=t;o&&(p=o);var f=p.getBuilder(n.getZIndex(),"Text");f.setTextStyle(a,r),f.drawText(e,i)}},MultiLineString:function(t,e,n,i,o){var r=n.getStroke();if(r){var s=t.getBuilder(n.getZIndex(),"LineString");s.setFillStrokeStyle(null,r),s.drawMultiLineString(e,i)}var a=n.getText();if(a&&a.getText()){var l=(o||t).getBuilder(n.getZIndex(),"Text");l.setTextStyle(a),l.drawText(e,i)}},MultiPolygon:function(t,e,n,i,o){var r=n.getFill(),s=n.getStroke();if(s||r){var a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(r,s),a.drawMultiPolygon(e,i)}var l=n.getText();if(l&&l.getText()){var u=(o||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(l),u.drawText(e,i)}},GeometryCollection:function(t,e,n,i,o){var r,s,a=e.getGeometriesArray();for(r=0,s=a.length;r<s;++r){(0,Ur[a[r].getType()])(t,a[r],n,i,o)}},Circle:function(t,e,n,i,o){var r=n.getFill(),s=n.getStroke();if(r||s){var a=t.getBuilder(n.getZIndex(),"Circle");a.setFillStrokeStyle(r,s),a.drawCircle(e,i)}var l=n.getText();if(l&&l.getText()){var u=(o||t).getBuilder(n.getZIndex(),"Text");u.setTextStyle(l),u.drawText(e,i)}}};function Hr(t,e){return parseInt(k(t),10)-parseInt(k(e),10)}function qr(t,e){return Vr*t/e}function $r(t,e,n,i,o,r,s){var a=!1,l=n.getImage();if(l){var u=l.getImageState();u==gi.LOADED||u==gi.ERROR?l.unlistenImageChange(o):(u==gi.IDLE&&l.load(),l.listenImageChange(o),a=!0)}return function(t,e,n,i,o,r){var s=n.getGeometryFunction()(e);if(!s)return;var a=s.simplifyTransformed(i,o),l=n.getRenderer();if(l)Jr(t,a,n,e);else{(0,Ur[a.getType()])(t,a,n,e,r)}}(t,e,n,i,r,s),a}function Jr(t,e,n,i){if("GeometryCollection"!=e.getType())t.getBuilder(n.getZIndex(),"Default").drawCustom(e,i,n.getRenderer(),n.getHitDetectionRenderer());else for(var o=e.getGeometries(),r=0,s=o.length;r<s;++r)Jr(t,o[r],n,i)}var Qr=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ts=function(t){function e(e){var n=t.call(this,e)||this;return n.boundHandleStyleImageChange_=n.handleStyleImageChange_.bind(n),n.animatingOrInteracting_,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.compositionContext_=null,n.opacity_=1,n}return Qr(e,t),e.prototype.renderWorlds=function(t,e,n){var i=e.extent,o=e.viewState,r=o.center,s=o.resolution,a=o.projection,l=o.rotation,u=a.getExtent(),h=this.getLayer().getSource(),c=e.pixelRatio,p=e.viewHints,f=!(p[Rr.ANIMATING]||p[Rr.INTERACTING]),d=this.compositionContext_,g=Math.round(e.size[0]*c),_=Math.round(e.size[1]*c),y=h.getWrapX()&&a.canWrapX(),v=y?ge(u):null,m=y?Math.ceil((i[2]-u[2])/v)+1:1,x=y?Math.floor((i[0]-u[0])/v):0;do{var E=this.getRenderTransform(r,s,l,c,g,_,x*v);t.execute(d,1,E,l,f,void 0,n)}while(++x<m)},e.prototype.setupCompositionContext_=function(){if(1!==this.opacity_){var t=Ri(this.context.canvas.width,this.context.canvas.height,lr);this.compositionContext_=t}else this.compositionContext_=this.context},e.prototype.releaseCompositionContext_=function(){if(1!==this.opacity_){var t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,Ii(this.compositionContext_),lr.push(this.compositionContext_.canvas),this.compositionContext_=null}},e.prototype.renderDeclutter=function(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())},e.prototype.renderFrame=function(t,e){var n=t.pixelRatio,i=t.layerStatesArray[t.layerIndex];!function(t,e,n){(function(t,e,n,i,o,r,s){t[0]=e,t[1]=n,t[2]=i,t[3]=o,t[4]=r,t[5]=s})(t,e,0,0,n,0,0)}(this.pixelTransform,1/n,1/n),Nt(this.inversePixelTransform,this.pixelTransform);var o=Gt(this.pixelTransform);this.useContainer(e,o,this.getBackground(t));var r=this.context,s=r.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!==o&&(s.style.transform=o)):this.containerReused||r.clearRect(0,0,u,h),this.preRender(r,t);var c=t.viewState;c.projection,this.opacity_=i.opacity,this.setupCompositionContext_();var p=!1,f=!0;if(i.extent&&this.clipping){var d=wn(i.extent);(p=(f=_e(d,t.extent))&&!Zt(d,t.extent))&&this.clipUnrotated(this.compositionContext_,t,d)}return f&&this.renderWorlds(a,t),p&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(r,t),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 i=this.renderedCenter_,o=this.renderedResolution_,r=this.renderedRotation_,s=this.renderedProjection_,a=this.wrappedRenderedExtent_,l=this.getLayer(),u=[],h=n[0]*Zr,c=n[1]*Zr;u.push(this.getRenderTransform(i,o,r,Zr,h,c,0).slice());var p=l.getSource(),f=s.getExtent();if(p.getWrapX()&&s.canWrapX()&&!Zt(f,a)){for(var d=a[0],g=ge(f),_=0,y=void 0;d<f[0];)y=g*--_,u.push(this.getRenderTransform(i,o,r,Zr,h,c,y).slice()),d+=g;for(_=0,d=a[2];d>f[2];)y=g*++_,u.push(this.getRenderTransform(i,o,r,Zr,h,c,y).slice()),d-=g}this.hitDetectionImageData_=function(t,e,n,i,o,r,s){var a=Ri(t[0]*Zr,t[1]*Zr);a.imageSmoothingEnabled=!1;for(var l=a.canvas,u=new Mr(a,Zr,o,null,s),h=n.length,c=Math.floor(16777215/h),p={},f=1;f<=h;++f){var d=n[f-1],g=d.getStyleFunction()||i;if(i){var _=g(d,r);if(_){Array.isArray(_)||(_=[_]);for(var y="#"+("000000"+(f*c).toString(16)).slice(-6),v=0,m=_.length;v<m;++v){var x=_[v],E=x.getGeometryFunction()(d);if(E&&_e(o,E.getExtent())){var C=x.clone(),w=C.getFill();w&&w.setColor(y);var S=C.getStroke();S&&(S.setColor(y),S.setLineDash(null)),C.setText(void 0);var T=x.getImage();if(T&&0!==T.getOpacity()){var O=T.getImageSize();if(!O)continue;var b=Ri(O[0],O[1],void 0,{alpha:!1}),R=b.canvas;b.fillStyle=y,b.fillRect(0,0,R.width,R.height),C.setImage(new Br({img:R,imgSize:O,anchor:T.getAnchor(),anchorXUnits:Lr.PIXELS,anchorYUnits:Lr.PIXELS,offset:T.getOrigin(),opacity:1,size:T.getSize(),scale:T.getScale(),rotation:T.getRotation(),rotateWithView:T.getRotateWithView()}))}var I=C.getZIndex()||0;(L=p[I])||(L={},p[I]=L,L.Polygon=[],L.Circle=[],L.LineString=[],L.Point=[]),L[E.getType().replace("Multi","")].push(E,C)}}}}}for(var P=Object.keys(p).map(Number).sort(K),M=(f=0,P.length);f<M;++f){var L=p[P[f]];for(var A in L){var D=L[A];for(v=0,m=D.length;v<m;v+=2){u.setStyle(D[v+1]);for(var F=0,k=e.length;F<k;++F)u.setTransform(e[F]),u.drawGeometry(D[v])}}}return a.getImageData(0,0,l.width,l.height)}(n,u,this.renderedFeatures_,l.getStyleFunction(),a,o,r)}e(function(t,e,n){var i=[];if(n){var o=Math.floor(Math.round(t[0])*Zr),r=Math.floor(Math.round(t[1])*Zr),s=4*(xe(o,0,n.width-1)+xe(r,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&&i.push(e[u/h-1])}return i}(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o){var r=this;if(this.replayGroup_){var s,a=e.viewState.resolution,l=e.viewState.rotation,u=this.getLayer(),h={},c=function(t,e,n){var r=k(t),s=h[r];if(s){if(!0!==s&&n<s.distanceSq){if(0===n)return h[r]=!0,o.splice(o.lastIndexOf(s),1),i(t,u,e);s.geometry=e,s.distanceSq=n}}else{if(0===n)return h[r]=!0,i(t,u,e);o.push(h[r]={feature:t,layer:u,geometry:e,distanceSq:n,callback:i})}},p=[this.replayGroup_];return this.declutterExecutorGroup&&p.push(this.declutterExecutorGroup),p.some((function(i){return s=i.forEachFeatureAtCoordinate(t,a,l,n,c,i===r.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((function(t){return t.value})):null)})),s}},e.prototype.handleFontsChanged=function(){var t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t){var e=this.getLayer(),n=e.getSource();if(!n)return!1;var i=t.viewHints[Rr.ANIMATING],o=t.viewHints[Rr.INTERACTING],r=e.getUpdateWhileAnimating(),s=e.getUpdateWhileInteracting();if(this.ready&&!r&&i||!s&&o)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=Hr);var g=l.center.slice(),_=Xt(a,f*h),y=_.slice(),v=[_.slice()],m=u.getExtent();if(n.getWrapX()&&u.canWrapX()&&!Zt(m,t.extent)){var x=ge(m),E=Math.max(ge(_)/2,x);_[0]=m[0]-E,_[2]=m[2]+E,$e(g,u);var C=ve(v[0],u);C[0]<m[0]&&C[2]<m[2]?v.push([C[0]+x,C[1],C[2]+x,C[3]]):C[0]>m[0]&&C[2]>m[2]&&v.push([C[0]-x,C[1],C[2]-x,C[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedRevision_==p&&this.renderedRenderOrder_==d&&Zt(this.wrappedRenderedExtent_,_))return U(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null;var w,S=new nr(qr(h,c),_,h,c);this.getLayer().getDeclutter()&&(w=new nr(qr(h,c),_,h,c));for(var T=0,O=v.length;T<O;++T)n.loadFeatures(v[T],h,u);var b=function(t,e){var n=qr(t,e);return n*n}(h,c),R=!0,I=function(t){var n,i=t.getStyleFunction()||e.getStyleFunction();if(i&&(n=i(t,h)),n){var o=this.renderFeature(t,b,n,S,undefined,w);R=R&&!o}}.bind(this),P=Cn(_),M=n.getFeaturesInExtent(P);d&&M.sort(d);for(T=0,O=M.length;T<O;++T)I(M[T]);this.renderedFeatures_=M,this.ready=R;var L=S.finish(),A=new br(_,h,c,n.getOverlaps(),L,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new br(_,h,c,n.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=h,this.renderedRevision_=p,this.renderedRenderOrder_=d,this.renderedExtent_=y,this.wrappedRenderedExtent_=_,this.renderedCenter_=g,this.renderedProjection_=u,this.replayGroup_=A,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,n,i,o,r){if(!n)return!1;var s=!1;if(Array.isArray(n))for(var a=0,l=n.length;a<l;++a)s=$r(i,t,n[a],e,this.boundHandleStyleImageChange_,o,r)||s;else s=$r(i,t,n,e,this.boundHandleStyleImageChange_,o,r);return s},e}(cr),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),is=function(t){function e(e){return t.call(this,e)||this}return ns(e,t),e.prototype.createRenderer=function(){return new es(this)},e}(Ao),os=function(){function t(t){this.rbush_=new Po(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_[k(e)]=n},t.prototype.load=function(t,e){for(var n=new Array(e.length),i=0,o=e.length;i<o;i++){var r=t[i],s=e[i],a={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:s};n[i]=a,this.items_[k(s)]=a}this.rbush_.load(n)},t.prototype.remove=function(t){var e=k(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_[k(e)];Jt([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,i=0,o=t.length;i<o;i++)if(n=e(t[i]))return n;return n},t.prototype.isEmpty=function(){return et(this.items_)},t.prototype.clear=function(){this.rbush_.clear(),this.items_={}},t.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return qt(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}(),rs=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function ss(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var as=function(t){function e(e){var n=t.call(this)||this;n.projection=sn(e.projection),n.attributions_=ss(e.attributions),n.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,n.loading=!1,n.state_=void 0!==e.state?e.state:"ready",n.wrapX_=void 0!==e.wrapX&&e.wrapX,n.interpolate_=!!e.interpolate,n.viewResolver=null,n.viewRejector=null;var i=n;return n.viewPromise_=new Promise((function(t,e){i.viewResolver=t,i.viewRejector=e})),n}return rs(e,t),e.prototype.getAttributions=function(){return this.attributions_},e.prototype.getAttributionsCollapsible=function(){return this.attributionsCollapsible_},e.prototype.getProjection=function(){return this.projection},e.prototype.getResolutions=function(){return D()},e.prototype.getView=function(){return this.viewPromise_},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.getInterpolate=function(){return this.interpolate_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=ss(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(ft),ls="addfeature",us="changefeature",hs="clear",cs="removefeature",ps="featuresloadstart",fs="featuresloadend",ds="featuresloaderror";function gs(t,e){return[[-1/0,-1/0,1/0,1/0]]}var _s=!1;function ys(t,e){return function(n,i,o,r,s){var a=this;!function(t,e,n,i,o,r,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,i,o):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=_s,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var i=e.getType(),l=void 0;"json"==i||"text"==i?l=a.responseText:"xml"==i?(l=a.responseXML)||(l=(new DOMParser).parseFromString(a.responseText,"application/xml")):"arraybuffer"==i&&(l=a.response),l?r(e.readFeatures(l,{extent:n,featureProjection:o}),e.readProjection(l)):s()}else s()},a.onerror=s,a.send()}(t,e,n,i,o,(function(t,e){a.addFeatures(t),void 0!==r&&r(t)}),s||$)}}var vs=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),ms=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.feature=n,o.features=i,o}return vs(e,t),e}(W),xs=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{attributions:i.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===i.wrapX||i.wrapX})||this).on,n.once,n.un,n.loader_=$,n.format_=i.format,n.overlaps_=void 0===i.overlaps||i.overlaps,n.url_=i.url,void 0!==i.loader?n.loader_=i.loader:void 0!==n.url_&&(mt(n.format_,7),n.loader_=ys(n.url_,n.format_)),n.strategy_=void 0!==i.strategy?i.strategy:gs;var o,r,s=void 0===i.useSpatialIndex||i.useSpatialIndex;return n.featuresRtree_=s?new os:null,n.loadedExtentsRtree_=new os,n.loadingExtentsCount_=0,n.nullGeometryFeatures_={},n.idIndex_={},n.uidIndex_={},n.featureChangeKeys_={},n.featuresCollection_=null,Array.isArray(i.features)?r=i.features:i.features&&(r=(o=i.features).getArray()),s||void 0!==o||(o=new vt(r)),void 0!==r&&n.addFeaturesInternal(r),void 0!==o&&n.bindFeaturesCollection_(o),n}return vs(e,t),e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=k(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 ms(ls,t))}else this.featuresCollection_&&this.featuresCollection_.remove(t)},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[rt(e,ot.CHANGE,this.handleFeatureChange_,this),rt(e,X.PROPERTYCHANGE,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var n=!0,i=e.getId();return void 0!==i&&(i.toString()in this.idIndex_?n=!1:this.idIndex_[i.toString()]=e),n&&(mt(!(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,r=t.length;o<r;o++){var s=k(l=t[o]);this.addToIndex_(s,l)&&n.push(l)}o=0;for(var a=n.length;o<a;o++){var l;s=k(l=n[o]);this.setupChangeEvents_(s,l);var u=l.getGeometry();if(u){var h=u.getExtent();e.push(h),i.push(l)}else this.nullGeometryFeatures_[s]=l}if(this.featuresRtree_&&this.featuresRtree_.load(e,i),this.hasListener(ls)){o=0;for(var c=n.length;o<c;o++)this.dispatchEvent(new ms(ls,n[o]))}},e.prototype.bindFeaturesCollection_=function(t){var e=!1;this.addEventListener(ls,(function(n){e||(e=!0,t.push(n.feature),e=!1)})),this.addEventListener(cs,(function(n){e||(e=!0,t.remove(n.feature),e=!1)})),t.addEventListener(dt.ADD,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(dt.REMOVE,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(at)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){var n=function(t){this.removeFeatureInternal(t)}.bind(this);for(var i in this.featuresRtree_.forEach(n),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};var o=new ms(hs);this.dispatchEvent(o),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 i=e(n);if(i)return i}}))},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(),et(this.nullGeometryFeatures_)||V(t,tt(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,e){var n=this;if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);var i=function(t,e){if(e.canWrapX()){var n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];ve(t,e);var i=ge(n);if(ge(t)>i)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+i,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-i,t[3]]]}return[t]}(t,e);return[].concat.apply([],i.map((function(t){return n.featuresRtree_.getInExtent(t)})))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]},e.prototype.getClosestFeatureToCoordinate=function(t,e){var n=t[0],i=t[1],o=null,r=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],l=e||H;return this.featuresRtree_.forEachInExtent(a,(function(t){if(l(t)){var e=t.getGeometry(),u=s;if((s=e.closestPointXY(n,i,r,s))<u){o=t;var h=Math.sqrt(s);a[0]=n-h,a[1]=i-h,a[2]=n+h,a[3]=i+h}}})),o},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=k(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 r=e.getId();if(void 0!==r){var s=r.toString();this.idIndex_[s]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[s]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new ms(us,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:k(t)in this.uidIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&et(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()},e.prototype.loadFeatures=function(t,e,n){for(var i=this.loadedExtentsRtree_,o=this.strategy_(t,e,n),r=function(t,r){var a=o[t];i.forEachInExtent(a,(function(t){return Zt(t.extent,a)}))||(++s.loadingExtentsCount_,s.dispatchEvent(new ms(ps)),s.loader_.call(s,a,e,n,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new ms(fs,void 0,t))}.bind(s),function(){--this.loadingExtentsCount_,this.dispatchEvent(new ms(ds))}.bind(s)),i.insert(a,{extent:a.slice()}))},s=this,a=0,l=o.length;a<l;++a)r(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(Jt(n.extent,t))return e=n,!0})),e&&n.remove(e)},e.prototype.removeFeature=function(t){if(t){var e=k(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=k(t),n=this.featureChangeKeys_[e];if(n){n.forEach(at),delete this.featureChangeKeys_[e];var i=t.getId();return void 0!==i&&delete this.idIndex_[i.toString()],delete this.uidIndex_[e],this.dispatchEvent(new ms(cs,t)),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){mt(this.format_,7),this.url_=t,this.setLoader(ys(t,this.format_))},e}(as),Es={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Cs(t){return Math.pow(t,3)}function ws(t){return 1-Cs(1-t)}function Ss(t){return 3*t*t-2*t*t*t}function Ts(t){return t}var Os=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),bs=function(t){function e(e,n,i){var o=t.call(this)||this,r=i||{};return o.tileCoord=e,o.state=n,o.interimTile=null,o.key="",o.transition_=void 0===r.transition?250:r.transition,o.transitionStarts_={},o.interpolate=!!r.interpolate,o}return Os(e,t),e.prototype.changed=function(){this.dispatchEvent(ot.CHANGE)},e.prototype.release=function(){},e.prototype.getKey=function(){return this.key+"/"+this.tileCoord},e.prototype.getInterimTile=function(){if(!this.interimTile)return this;var t=this.interimTile;do{if(t.getState()==Es.LOADED)return this.transition_=0,t;t=t.interimTile}while(t);return this},e.prototype.refreshInterimChain=function(){if(this.interimTile){var t=this.interimTile,e=this;do{if(t.getState()==Es.LOADED){t.interimTile=null;break}t.getState()==Es.LOADING?e=t:t.getState()==Es.IDLE?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}},e.prototype.getTileCoord=function(){return this.tileCoord},e.prototype.getState=function(){return this.state},e.prototype.setState=function(t){if(this.state!==Es.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()},e.prototype.load=function(){D()},e.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 i=e-n+1e3/60;return i>=this.transition_?1:Cs(i/this.transition_)},e.prototype.inTransition=function(t){return!!this.transition_&&-1!==this.transitionStarts_[t]},e.prototype.endTransition=function(t){this.transition_&&(this.transitionStarts_[t]=-1)},e}(it),Rs=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Is=function(t){function e(e,n,i,o,r,s){var a=t.call(this,e,n,s)||this;return a.crossOrigin_=o,a.src_=i,a.key=i,a.image_=new Image,null!==o&&(a.image_.crossOrigin=o),a.unlisten_=null,a.tileLoadFunction_=r,a}return Rs(e,t),e.prototype.getImage=function(){return this.image_},e.prototype.setImage=function(t){this.image_=t,this.state=Es.LOADED,this.unlistenImage_(),this.changed()},e.prototype.handleImageError_=function(){var t;this.state=Es.ERROR,this.unlistenImage_(),this.image_=((t=Ri(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=Es.LOADED:this.state=Es.EMPTY,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Es.ERROR&&(this.state=Es.IDLE,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Es.IDLE&&(this.state=Es.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Gr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))},e.prototype.unlistenImage_=function(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)},e}(bs);var Ps=Is,Ms=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 i=this.points_[e+2]-this.points_[n+2];if(i<1e3/60)return!1;var o=this.points_[e]-this.points_[n],r=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/i,this.initialVelocity_>this.minVelocity_},t.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},t.prototype.getAngle=function(){return this.angle_},t}(),Ls=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),As=function(t){function e(e){var n=t.call(this)||this;return n.map_=e,n}return Ls(e,t),e.prototype.dispatchRenderEvent=function(t,e){D()},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,n=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;jt(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Nt(i,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,n,i,o,r,s,a){var l,u=e.viewState;function h(t,e,n,i){return o.call(r,e,t?n:null,i)}var c=u.projection,p=$e(t.slice(),c),f=[[0,0]];if(c.canWrapX()&&i){var d=ge(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 E=g[x],C=E.layer;if(C.hasRenderer()&&Oo(E,u)&&s.call(a,C)){var w=C.getRenderer(),S=C.getSource();if(w&&S){var T=S.getWrapX()?p:t,O=h.bind(null,E.managed);v[0]=T[0]+f[m][0],v[1]=T[1]+f[m][1],l=w.forEachFeatureAtCoordinate(v,e,n,O,y)}if(l)return l}}if(0!==y.length){var b=1/y.length;return y.forEach((function(t,e){return t.distanceSq+=e*b})),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}},e.prototype.forEachLayerAtPixel=function(t,e,n,i,o){return D()},e.prototype.hasFeatureAtCoordinate=function(t,e,n,i,o,r){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,i,H,this,o,r)},e.prototype.getMap=function(){return this.map_},e.prototype.renderFrame=function(t){D()},e.prototype.scheduleExpireIconCache=function(t){Fr.canExpireCache()&&t.postRenderFunctions.push(Ds)},e}(Y);function Ds(t,e){Fr.expire()}var Fs=As,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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),js=function(t){function e(e){var n=t.call(this,e)||this;n.fontChangeListenerKey_=rt(Ji,X.PROPERTYCHANGE,e.redrawText.bind(e)),n.element_=document.createElement("div");var i=n.element_.style;i.position="absolute",i.width="100%",i.height="100%",i.zIndex="0",n.element_.className=ji+" ol-layers";var o=e.getViewport();return o.insertBefore(n.element_,o.firstChild||null),n.children_=[],n.renderedVisible_=!0,n}return ks(e,t),e.prototype.dispatchRenderEvent=function(t,e){var n=this.getMap();if(n.hasListener(t)){var i=new sr(t,void 0,e);n.dispatchEvent(i)}},e.prototype.disposeInternal=function(){at(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(ui,t);var e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),n=t.viewState;this.children_.length=0;for(var i=[],o=null,r=0,s=e.length;r<s;++r){var a=e[r];t.layerIndex=r;var l=a.layer,u=l.getSourceState();if(!Oo(a,n)||"ready"!=u&&"undefined"!=u)l.unrender();else{var h=l.render(t,o);h&&(h!==o&&(this.children_.push(h),o=h),"getDeclutter"in l&&i.push(l))}}for(r=i.length-1;r>=0;--r)i[r].renderDeclutter(t);!function(t,e){for(var n=t.childNodes,i=0;;++i){var o=n[i],r=e[i];if(!o&&!r)break;o!==r&&(o?r?t.insertBefore(r,o):(t.removeChild(o),--i):t.appendChild(r))}}(this.element_,this.children_),this.dispatchRenderEvent(hi,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,i,o){for(var r=e.viewState,s=e.layerStatesArray,a=s.length-1;a>=0;--a){var l=s[a],u=l.layer;if(u.hasRenderer()&&Oo(l,r)&&o(u)){var h=u.getRenderer().getDataAtPixel(t,e,n);if(h){var c=i(u,h);if(c)return c}}}},e}(Fs),Ns=js,Gs=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),zs=function(t){function e(e,n){var i=t.call(this,e)||this;return i.layer=n,i}return Gs(e,t),e}(W),Ws={LAYERS:"layers"},Xs=function(t){function e(e){var n=this,i=e||{},o=J({},i);delete o.layers;var r=i.layers;return(n=t.call(this,o)||this).on,n.once,n.un,n.layersListenerKeys_=[],n.listenerKeys_={},n.addChangeListener(Ws.LAYERS,n.handleLayersChanged_),r?Array.isArray(r)?r=new vt(r.slice(),{unique:!0}):mt("function"==typeof r.getArray,43):r=new vt(void 0,{unique:!0}),n.setLayers(r),n}return Gs(e,t),e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(at),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(rt(t,dt.ADD,this.handleLayersAdd_,this),rt(t,dt.REMOVE,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(at);Q(this.listenerKeys_);for(var n=t.getArray(),i=0,o=n.length;i<o;i++){var r=n[i];this.registerLayerListeners_(r),this.dispatchEvent(new zs("addlayer",r))}this.changed()},e.prototype.registerLayerListeners_=function(t){var n=[rt(t,X.PROPERTYCHANGE,this.handleLayerChange_,this),rt(t,ot.CHANGE,this.handleLayerChange_,this)];t instanceof e&&n.push(rt(t,"addlayer",this.handleLayerGroupAdd_,this),rt(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[k(t)]=n},e.prototype.handleLayerGroupAdd_=function(t){this.dispatchEvent(new zs("addlayer",t.layer))},e.prototype.handleLayerGroupRemove_=function(t){this.dispatchEvent(new zs("removelayer",t.layer))},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new zs("addlayer",e)),this.changed()},e.prototype.handleLayersRemove_=function(t){var e=t.element,n=k(e);this.listenerKeys_[n].forEach(at),delete this.listenerKeys_[n],this.dispatchEvent(new zs("removelayer",e)),this.changed()},e.prototype.getLayers=function(){return this.get(Ws.LAYERS)},e.prototype.setLayers=function(t){var e=this.getLayers();if(e)for(var n=e.getArray(),i=0,o=n.length;i<o;++i)this.dispatchEvent(new zs("removelayer",n[i]));this.set(Ws.LAYERS,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 i=this.getLayerState(),o=i.zIndex;t||void 0!==i.zIndex||(o=0);for(var r=n,s=e.length;r<s;r++){var a=e[r];a.opacity*=i.opacity,a.visible=a.visible&&i.visible,a.maxResolution=Math.min(a.maxResolution,i.maxResolution),a.minResolution=Math.max(a.minResolution,i.minResolution),a.minZoom=Math.max(a.minZoom,i.minZoom),a.maxZoom=Math.min(a.maxZoom,i.maxZoom),void 0!==i.extent&&(void 0!==a.extent?a.extent=pe(a.extent,i.extent):a.extent=i.extent),void 0===a.zIndex&&(a.zIndex=o)}return e},e.prototype.getSourceState=function(){return"ready"},e}(So),Ys=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ks=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.map=n,o.frameState=void 0!==i?i:null,o}return Ys(e,t),e}(W),Bs=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zs=function(t){function e(e,n,i,o,r,s){var a=t.call(this,e,n,r)||this;return a.originalEvent=i,a.pixel_=null,a.coordinate_=null,a.dragging=void 0!==o&&o,a.activePointers=s,a}return Bs(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}(Ks),Vs={SINGLECLICK:"singleclick",CLICK:ot.CLICK,DBLCLICK:ot.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Us={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Hs=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),qs=function(t){function e(e,n){var i=t.call(this,e)||this;i.map_=e,i.clickTimeoutId_,i.emulateClicks_=!1,i.dragging_=!1,i.dragListenerKeys_=[],i.moveTolerance_=void 0===n?1:n,i.down_=null;var o=i.map_.getViewport();return i.activePointers_=[],i.trackedTouches_={},i.element_=o,i.pointerdownListenerKey_=rt(o,Us.POINTERDOWN,i.handlePointerDown_,i),i.originalPointerMoveEvent_,i.relayedListenerKey_=rt(o,Us.POINTERMOVE,i.relayMoveEvent_,i),i.boundHandleTouchMove_=i.handleTouchMove_.bind(i),i.element_.addEventListener(ot.TOUCHMOVE,i.boundHandleTouchMove_,!!Ft&&{passive:!1}),i}return Hs(e,t),e.prototype.emulateClick_=function(t){var e=new Zs(Vs.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Zs(Vs.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new Zs(Vs.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t,n=e.pointerId;if(e.type==Vs.POINTERUP||e.type==Vs.POINTERCANCEL){for(var i in delete this.trackedTouches_[n],this.trackedTouches_)if(this.trackedTouches_[i].target!==e.target){delete this.trackedTouches_[i];break}}else e.type!=Vs.POINTERDOWN&&e.type!=Vs.POINTERMOVE||(this.trackedTouches_[n]=e);this.activePointers_=tt(this.trackedTouches_)},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new Zs(Vs.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(at),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_.length,this.updateActivePointers_(t);var e=new Zs(Vs.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);for(var n in this.dispatchEvent(e),this.down_={},t){var i=t[n];this.down_[n]="function"==typeof i?$:i}if(0===this.dragListenerKeys_.length){var o=this.map_.getOwnerDocument();this.dragListenerKeys_.push(rt(o,Vs.POINTERMOVE,this.handlePointerMove_,this),rt(o,Vs.POINTERUP,this.handlePointerUp_,this),rt(this.element_,Vs.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==o&&this.dragListenerKeys_.push(rt(this.element_.getRootNode(),Vs.POINTERUP,this.handlePointerUp_,this))}},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;var e=new Zs(Vs.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}},e.prototype.relayMoveEvent_=function(t){this.originalPointerMoveEvent_=t;var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Zs(Vs.POINTERMOVE,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_&&(at(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ot.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(at(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(at),this.dragListenerKeys_.length=0,this.element_=null,t.prototype.disposeInternal.call(this)},e}(it),$s=qs,Js="postrender",Qs="movestart",ta="moveend",ea="loadstart",na="loadend",ia={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},oa=1/0,ra=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,Q(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 i=this.keyFunction_(n);return delete this.queuedElements_[i],n},t.prototype.enqueue=function(t){mt(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=oa&&(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_,i=e.length,o=e[t],r=n[t],s=t;t<i>>1;){var a=this.getLeftChildIndex_(t),l=this.getRightChildIndex_(t),u=l<i&&n[l]<n[a]?l:a;e[t]=e[u],n[t]=n[u],t=u}e[t]=o,n[t]=r,this.siftDown_(s,t)},t.prototype.siftDown_=function(t,e){for(var n=this.elements_,i=this.priorities_,o=n[e],r=i[e];e>t;){var s=this.getParentIndex_(e);if(!(i[s]>r))break;n[e]=n[s],i[e]=i[s],e=s}n[e]=o,i[e]=r},t.prototype.reprioritize=function(){var t,e,n,i=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e<a;++e)(n=i(t=o[e]))==oa?delete this.queuedElements_[this.keyFunction_(t)]:(r[s]=n,o[s++]=t);o.length=s,r.length=s,this.heapify_()},t}(),sa=ra,aa=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),la=function(t){function e(e,n){var i=t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()}))||this;return i.boundHandleTileChange_=i.handleTileChange.bind(i),i.tileChangeCallback_=n,i.tilesLoading_=0,i.tilesLoadingKeys_={},i}return aa(e,t),e.prototype.enqueue=function(e){var n=t.prototype.enqueue.call(this,e);n&&e[0].addEventListener(ot.CHANGE,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===Es.LOADED||n===Es.ERROR||n===Es.EMPTY){e.removeEventListener(ot.CHANGE,this.boundHandleTileChange_);var i=e.getKey();i in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[i],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var n,i,o=0;this.tilesLoading_<t&&o<e&&this.getCount()>0;)i=(n=this.dequeue()[0]).getKey(),n.getState()!==Es.IDLE||i in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[i]=!0,++this.tilesLoading_,++o,n.load())},e}(sa),ua=la;var ha={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},ca=42,pa=256;function fa(t,e,n){return function(i,o,r,s,a){if(i){if(!o&&!e)return i;var l=e?0:r[0]*o,u=e?0:r[1]*o,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 _=xe(i[0],p,f),y=xe(i[1],d,g);if(s&&n&&o){var v=30*o;_+=-v*Math.log(1+Math.max(0,p-i[0])/v)+v*Math.log(1+Math.max(0,i[0]-f)/v),y+=-v*Math.log(1+Math.max(0,d-i[1])/v)+v*Math.log(1+Math.max(0,i[1]-g)/v)}return[_,y]}}}function da(t){return t}function ga(t,e,n,i){var o=ge(e)/n[0],r=ce(e)/n[1];return i?Math.min(t,Math.max(o,r)):Math.min(t,Math.min(o,r))}function _a(t,e,n){var i=Math.min(t,e);return i*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(i=Math.max(i,n),i/=Math.log(1+50*Math.max(0,n/t-1))/50+1),xe(i,n/2,2*e)}function ya(t,e,n,i,o){return function(r,s,a,l){if(void 0!==r){var u=i?ga(t,i,a,o):t;return(void 0===n||n)&&l?_a(r,u,e):xe(r,e,u)}}}function va(t){return void 0!==t?0:void 0}function ma(t){return void 0!==t?t:void 0}var xa=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ea=0,Ca=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=J({},e);return n.hints_=[0,0],n.animations_=[],n.updateAnimationKey_,n.projection_=un(i.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,i.projection&&en(),i.center&&(i.center=En(i.center,n.projection_)),i.extent&&(i.extent=wn(i.extent,n.projection_)),n.applyOptions_(i),n}return xa(e,t),e.prototype.applyOptions_=function(t){var e=J({},t);for(var n in ha)delete e[n];this.setProperties(e,!0);var i=function(t){var e,n,i,o=28,r=2,s=void 0!==t.minZoom?t.minZoom:Ea,a=void 0!==t.maxZoom?t.maxZoom:o,l=void 0!==t.zoomFactor?t.zoomFactor:r,u=void 0!==t.multiWorld&&t.multiWorld,h=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,p=un(t.projection,"EPSG:3857"),f=p.getExtent(),d=t.constrainOnlyCenter,g=t.extent;u||g||!p.isGlobal()||(d=!1,g=f);if(void 0!==t.resolutions){var _=t.resolutions;n=_[s],i=void 0!==_[a]?_[a]:_[_.length-1],e=t.constrainResolution?function(t,e,n,i){return function(o,r,s,a){if(void 0!==o){var l=t[0],u=t[t.length-1],h=n?ga(l,n,s,i):l;if(a)return void 0===e||e?_a(o,h,u):xe(o,u,h);var c=Math.min(h,o),p=Math.floor(B(t,c,r));return t[p]>h&&p<t.length-1?t[p+1]:t[p]}}}(_,h,!d&&g,c):ya(n,i,h,!d&&g,c)}else{var y=(f?Math.max(ge(f),ce(f)):360*Tt[Ot.DEGREES]/p.getMetersPerUnit())/pa/Math.pow(r,Ea),v=y/Math.pow(r,o-Ea);void 0!==(n=t.maxResolution)?s=0:n=y/Math.pow(l,s),void 0===(i=t.minResolution)&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(l,a):y/Math.pow(l,a):v),a=s+Math.floor(Math.log(n/i)/Math.log(l)),i=n/Math.pow(l,a-s),e=t.constrainResolution?function(t,e,n,i,o,r){return function(s,a,l,u){if(void 0!==s){var h=o?ga(e,o,l,r):e,c=void 0!==n?n:0;if(u)return void 0===i||i?_a(s,h,c):xe(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 xe(e/Math.pow(t,_),c,h)}}}(l,n,i,h,!d&&g,c):ya(n,i,h,!d&&g,c)}return{constraint:e,maxResolution:n,minResolution:i,minZoom:s,zoomFactor:l}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;var o=function(t){if(void 0!==t.extent){var e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return fa(t.extent,t.constrainOnlyCenter,e)}var n=un(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&n.isGlobal()){var i=n.getExtent().slice();return i[0]=-1/0,i[2]=1/0,fa(i,!1,!1)}return da}(t),r=i.constraint,s=function(t){var e=void 0===t.enableRotation||t.enableRotation;if(e){var n=t.constrainRotation;return void 0===n||!0===n?(s=r||Te(5),function(t,e){return e?t:void 0!==t?Math.abs(t)<=s?0:t:void 0}):!1===n?ma:"number"==typeof n?(i=n,o=2*Math.PI/i,function(t,e){return e?t:void 0!==t?t=Math.floor(t/o+.5)*o:void 0}):ma}return va;var i,o;var r,s}(t);this.constraints_={center:o,resolution:r,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)},Object.defineProperty(e.prototype,"padding",{get:function(){return this.padding_},set:function(t){var e=this.padding_;this.padding_=t;var n=this.getCenter();if(n){var i=t||[0,0,0,0];e=e||[0,0,0,0];var o=this.getResolution(),r=o/2*(i[3]-e[3]+e[1]-i[1]),s=o/2*(i[0]-e[0]+e[2]-i[2]);this.setCenterInternal([n[0]+r,n[1]-s])}},enumerable:!1,configurable:!0}),e.prototype.getUpdatedOptions_=function(t){var e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),J({},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 i=arguments[n];i.center&&((i=J({},i)).center=En(i.center,this.getProjection())),i.anchor&&((i=J({},i)).anchor=En(i.anchor,this.getProjection())),e[n]=i}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 i=0;i<n&&!this.isDef();++i){var o=arguments[i];o.center&&this.setCenterInternal(o.center),void 0!==o.zoom?this.setZoom(o.zoom):o.resolution&&this.setResolution(o.resolution),void 0!==o.rotation&&this.setRotation(o.rotation)}if(i!==n){for(var r=Date.now(),s=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_,u=[];i<n;++i){var h=arguments[i],c={start:r,complete:!1,anchor:h.anchor,duration:void 0!==h.duration?h.duration:1e3,easing:h.easing||Ss,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=Oe(h.rotation-l+Math.PI,2*Math.PI)-Math.PI;c.targetRotation=l+p,l=c.targetRotation}Sa(c)?c.complete=!0:r+=c.duration,u.push(c)}this.animations_.push(u),this.setHint(Rr.ANIMATING,1),this.updateAnimations_()}else e&&wa(e,!0)},e.prototype.getAnimating=function(){return this.hints_[Rr.ANIMATING]>0},e.prototype.getInteracting=function(){return this.hints_[Rr.INTERACTING]>0},e.prototype.cancelAnimations=function(){var t;this.setHint(Rr.ANIMATING,-this.hints_[Rr.ANIMATING]);for(var e=0,n=this.animations_.length;e<n;++e){var i=this.animations_[e];if(i[0].callback&&wa(i[0].callback,!1),!t)for(var o=0,r=i.length;o<r;++o){var s=i[o];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 i=this.animations_[n],o=!0,r=0,s=i.length;r<s;++r){var a=i[r];if(!a.complete){var l=t-a.start,u=a.duration>0?l/a.duration:1;u>=1?(a.complete=!0,u=1):o=!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?Oe(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+h*(a.targetRotation-a.sourceRotation);if(a.anchor){var E=this.constraints_.rotation(x,!0);this.targetCenter_=this.calculateCenterRotate(E,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=x}if(this.applyTargetState_(!0),e=!0,!a.complete)break}}if(o){this.animations_[n]=null,this.setHint(Rr.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;var C=i[0].callback;C&&wa(C,!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,i,o,r=this.getCenterInternal();return void 0!==r&&(qe(n=[r[0]-e[0],r[1]-e[1]],t-this.getRotation()),o=e,(i=n)[0]+=+o[0],i[1]+=+o[1]),n},e.prototype.calculateCenterZoom=function(t,e){var n,i=this.getCenterInternal(),o=this.getResolution();void 0!==i&&void 0!==o&&(n=[e[0]-t*(e[0]-i[0])/o,e[1]-t*(e[1]-i[1])/o]);return n},e.prototype.getViewportSize_=function(t){var e=this.viewportSize_;if(t){var n=e[0],i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*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?xn(t,this.getProjection()):t},e.prototype.getCenterInternal=function(){return this.get(ha.CENTER)},e.prototype.getConstraints=function(){return this.constraints_},e.prototype.getConstrainResolution=function(){return this.get("constrainResolution")},e.prototype.getHints=function(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()},e.prototype.calculateExtent=function(t){return Cn(this.calculateExtentInternal(t),this.getProjection())},e.prototype.calculateExtentInternal=function(t){var e=t||this.getViewportSizeMinusPadding_(),n=this.getCenterInternal();mt(n,1);var i=this.getResolution();mt(void 0!==i,2);var o=this.getRotation();return mt(void 0!==o,3),ue(n,i,o,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(ha.RESOLUTION)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){return this.getResolutionForExtentInternal(wn(t,this.getProjection()),e)},e.prototype.getResolutionForExtentInternal=function(t,e){var n=e||this.getViewportSizeMinusPadding_(),i=ge(t)/n[0],o=ce(t)/n[1];return Math.max(i,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,o=Math.log(n/i)/Math.log(e);return function(t){return n/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(ha.ROTATION)},e.prototype.getValueForResolutionFunction=function(t){var e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,o=Math.log(n/i)/e;return function(t){return Math.log(n/t)/e/o}},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(),i=this.getCenterInternal(),o=this.padding_;if(o){var r=this.getViewportSizeMinusPadding_();i=Ta(i,this.getViewportSize_(),[r[0]/2+o[3],r[1]/2+o[0]],e,n)}return{center:i.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,i=this.minZoom_||0;if(this.resolutions_){var o=B(this.resolutions_,t,1);i=o,e=this.resolutions_[o],n=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,n=this.zoomFactor_;return i+Math.log(e/t)/Math.log(n)},e.prototype.getResolutionForZoom=function(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;var e=xe(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,xe(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)},e.prototype.fit=function(t,e){var n;if(mt(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t))mt(!ye(t),25),n=si(i=wn(t,this.getProjection()));else if("Circle"===t.getType()){var i;(n=si(i=wn(t.getExtent(),this.getProjection()))).rotate(this.getRotation(),ae(i))}else{var o=mn();n=o?t.clone().transform(o,this.getProjection()):t}this.fitInternal(n,e)},e.prototype.rotatedExtentForGeometry=function(t){for(var e=this.getRotation(),n=Math.cos(e),i=Math.sin(-e),o=t.getFlatCoordinates(),r=t.getStride(),s=1/0,a=1/0,l=-1/0,u=-1/0,h=0,c=o.length;h<c;h+=r){var p=o[h]*n-o[h+1]*i,f=o[h]*i+o[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||{},i=n.size;i||(i=this.getViewportSizeMinusPadding_());var o,r=void 0!==n.padding?n.padding:[0,0,0,0],s=void 0!==n.nearest&&n.nearest;o=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.getResolutionForZoom(n.maxZoom):0;var a=this.rotatedExtentForGeometry(t),l=this.getResolutionForExtentInternal(a,[i[0]-r[1]-r[3],i[1]-r[0]-r[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,s?0:1);var u=this.getRotation(),h=Math.sin(u),c=Math.cos(u),p=ae(a);p[0]+=(r[1]-r[3])/2*l,p[1]+=(r[0]-r[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:$;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),wa(_,!0))},e.prototype.centerOn=function(t,e,n){this.centerOnInternal(En(t,this.getProjection()),e,n)},e.prototype.centerOnInternal=function(t,e,n){this.setCenterInternal(Ta(t,e,n,this.getResolution(),this.getRotation()))},e.prototype.calculateCenterShift=function(t,e,n,i){var o,r=this.padding_;if(r&&t){var s=this.getViewportSizeMinusPadding_(-n),a=Ta(t,i,[s[0]/2+r[3],s[1]/2+r[0]],e,n);o=[t[0]-a[0],t[1]-a[1]]}return o},e.prototype.isDef=function(){return!!this.getCenterInternal()&&void 0!==this.getResolution()},e.prototype.adjustCenter=function(t){var e=xn(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&&En(e,this.getProjection());this.adjustResolutionInternal(t,n)},e.prototype.adjustResolutionInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),o=this.constraints_.resolution(this.targetResolution_*t,0,i,n);e&&(this.targetCenter_=this.calculateCenterZoom(o,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=En(e,this.getProjection())),this.adjustRotationInternal(t,e)},e.prototype.adjustRotationInternal=function(t,e){var n=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(i,e)),this.targetRotation_+=t,this.applyTargetState_()},e.prototype.setCenter=function(t){this.setCenterInternal(t?En(t,this.getProjection()):t)},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,i=this.constraints_.rotation(this.targetRotation_,n),o=this.getViewportSize_(i),r=this.constraints_.resolution(this.targetResolution_,0,o,n),s=this.constraints_.center(this.targetCenter_,r,o,n,this.calculateCenterShift(this.targetCenter_,r,i,o));this.get(ha.ROTATION)!==i&&this.set(ha.ROTATION,i),this.get(ha.RESOLUTION)!==r&&(this.set(ha.RESOLUTION,r),this.set("zoom",this.getZoom(),!0)),s&&this.get(ha.CENTER)&&He(this.get(ha.CENTER),s)||this.set(ha.CENTER,s),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0},e.prototype.resolveConstraints=function(t,e,n){var i=void 0!==t?t:200,o=e||0,r=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,o,s),l=this.constraints_.center(this.targetCenter_,a,s,!1,this.calculateCenterShift(this.targetCenter_,a,r,s));if(0===i&&!this.cancelAnchor_)return this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=l,void this.applyTargetState_();var u=n||(0===i?this.cancelAnchor_:void 0);this.cancelAnchor_=void 0,this.getResolution()===a&&this.getRotation()===r&&this.getCenterInternal()&&He(this.getCenterInternal(),l)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:i,easing:ws,anchor:u}))},e.prototype.beginInteraction=function(){this.resolveConstraints(0),this.setHint(Rr.INTERACTING,1)},e.prototype.endInteraction=function(t,e,n){var i=n&&En(n,this.getProjection());this.endInteractionInternal(t,e,i)},e.prototype.endInteractionInternal=function(t,e,n){this.setHint(Rr.INTERACTING,-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,i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,n,i)},e}(ft);function wa(t,e){setTimeout((function(){t(e)}),0)}function Sa(t){return!(t.sourceCenter&&t.targetCenter&&!He(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ta(t,e,n,i,o){var r=Math.cos(-o),s=Math.sin(-o),a=t[0]*r-t[1]*s,l=t[1]*r+t[0]*s;return[(a+=(e[0]/2-n[0])*i)*r-(l+=(n[1]-e[1]/2)*i)*(s=-s),l*r+a*s]}var Oa=Ca,ba=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Ra(t){t instanceof bo?t.setMapInternal(null):t instanceof Xs&&t.getLayers().forEach(Ra)}function Ia(t,e){if(t instanceof bo)t.setMapInternal(e);else if(t instanceof Xs)for(var n=t.getLayers().getArray(),i=0,o=n.length;i<o;++i)Ia(n[i],e)}var Pa=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var n,i,o,r={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Xs({layers:t.layers});r[ia.LAYERGROUP]=s,r[ia.TARGET]=t.target,r[ia.VIEW]=t.view instanceof Oa?t.view:new Oa,void 0!==t.controls&&(Array.isArray(t.controls)?n=new vt(t.controls.slice()):(mt("function"==typeof t.controls.getArray,47),n=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?i=new vt(t.interactions.slice()):(mt("function"==typeof t.interactions.getArray,48),i=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?o=new vt(t.overlays.slice()):(mt("function"==typeof t.overlays.getArray,49),o=t.overlays):o=new vt;return{controls:n,interactions:i,keyboardEventTarget:e,overlays:o,values:r}}(e);n.renderComplete_,n.loaded_=!0,n.boundHandleBrowserEvent_=n.handleBrowserEvent.bind(n),n.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,n.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:Lt,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_=i.keyboardEventTarget,n.targetChangeHandlerKeys_=null,n.controls=i.controls||new vt,n.interactions=i.interactions||new vt,n.overlays_=i.overlays,n.overlayIdIndex_={},n.renderer_=null,n.postRenderFunctions_=[],n.tileQueue_=new ua(n.getTilePriority.bind(n),n.handleTileChange_.bind(n)),n.addChangeListener(ia.LAYERGROUP,n.handleLayerGroupChanged_),n.addChangeListener(ia.VIEW,n.handleViewChanged_),n.addChangeListener(ia.SIZE,n.handleSizeChanged_),n.addChangeListener(ia.TARGET,n.handleTargetChanged_),n.setProperties(i.values);var o=n;return!e.view||e.view instanceof Oa||e.view.then((function(t){o.setView(new Oa(t))})),n.controls.addEventListener(dt.ADD,function(t){t.element.setMap(this)}.bind(n)),n.controls.addEventListener(dt.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.interactions.addEventListener(dt.ADD,function(t){t.element.setMap(this)}.bind(n)),n.interactions.addEventListener(dt.REMOVE,function(t){t.element.setMap(null)}.bind(n)),n.overlays_.addEventListener(dt.ADD,function(t){this.addOverlayInternal_(t.element)}.bind(n)),n.overlays_.addEventListener(dt.REMOVE,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 ba(e,t),e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.handleLayerAdd_=function(t){Ia(t.layer,this)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,n){if(this.frameState_&&this.renderer_){var i=this.getCoordinateFromPixelInternal(t),o=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,r=void 0!==n.layerFilter?n.layerFilter:H,s=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,o,s,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var n=[];return this.forEachFeatureAtPixel(t,(function(t){n.push(t)}),e),n},e.prototype.getAllLayers=function(){var t=[];return function e(n){n.forEach((function(n){n instanceof Xs?e(n.getLayers()):t.push(n)}))}(this.getLayers()),t},e.prototype.forEachLayerAtPixel=function(t,e,n){if(this.frameState_&&this.renderer_){var i=n||{},o=void 0!==i.hitTolerance?i.hitTolerance:0,r=i.layerFilter||H;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,o,e,r)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_||!this.renderer_)return!1;var n=this.getCoordinateFromPixelInternal(t),i=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:H,o=void 0!==e.hitTolerance?e.hitTolerance:0,r=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,o,r,i,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(ia.TARGET)},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 xn(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(ia.LAYERGROUP)},e.prototype.setLayers=function(t){var e=this.getLayerGroup();if(t instanceof vt)e.setLayers(t);else{var n=e.getLayers();n.clear(),n.extend(t)}},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getLoadingOrNotReady=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var i=t[e];if(i.visible){var o=i.layer.getRenderer();if(o&&!o.ready)return!0;var r=i.layer.getSource();if(r&&r.loading)return!0}}return!1},e.prototype.getPixelFromCoordinate=function(t){var e=En(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(ia.SIZE)},e.prototype.getView=function(){return this.get(ia.VIEW)},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,i){return function(t,e,n,i,o){if(!t||!(n in t.wantedTiles))return oa;if(!t.wantedTiles[n][e.getKey()])return oa;var r=t.viewState.center,s=i[0]-r[0],a=i[1]-r[1];return 65536*Math.log(o)+Math.sqrt(s*s+a*a)/o}(this.frameState_,t,e,n,i)},e.prototype.handleBrowserEvent=function(t,e){var n=e||t.type,i=new Zs(n,this,t);this.handleMapBrowserEvent(i)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){var e=t.originalEvent,n=e.type;if(n===Us.POINTERDOWN||n===ot.WHEEL||n===ot.KEYDOWN){var i=this.getOwnerDocument(),o=this.viewport_.getRootNode?this.viewport_.getRootNode():i,r=e.target;if(this.overlayContainerStopEvent_.contains(r)||!(o===i?i.documentElement:o).contains(r))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_,i=n;if(t){var o=t.viewHints;if(o[Rr.ANIMATING]||o[Rr.INTERACTING]){var r=Date.now()-t.time>8;n=r?0:8,i=r?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,i))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(ci)&&this.renderer_.dispatchRenderEvent(ci,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Ks(na,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Ks(ea,this,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(){if(this.mapBrowserEventHandler_){for(var t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)at(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(ot.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(ot.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Ai(this.viewport_)}var n=this.getTargetElement();if(n){for(var i in n.appendChild(this.viewport_),this.renderer_||(this.renderer_=this.createRenderer()),this.mapBrowserEventHandler_=new $s(this,this.moveTolerance_),Vs)this.mapBrowserEventHandler_.addEventListener(Vs[i],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(ot.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(ot.WHEEL,this.boundHandleBrowserEvent_,!!Ft&&{passive:!1});var o=this.getOwnerDocument().defaultView,r=this.keyboardEventTarget_?this.keyboardEventTarget_:n;this.targetChangeHandlerKeys_=[rt(r,ot.KEYDOWN,this.handleBrowserEvent,this),rt(r,ot.KEYPRESS,this.handleBrowserEvent,this),rt(o,ot.RESIZE,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(at(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(at(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=rt(t,X.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=rt(t,ot.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(at),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.handleLayerAdd_(new zs("addlayer",t)),this.layerGroupPropertyListenerKeys_=[rt(t,X.PROPERTYCHANGE,this.render,this),rt(t,ot.CHANGE,this.render,this),rt(t,"addlayer",this.handleLayerAdd_,this),rt(t,"removelayer",this.handleLayerRemove_,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.redrawText=function(){for(var t=this.getLayerGroup().getLayerStatesArray(),e=0,n=t.length;e<n;++e){var i=t[e].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}},e.prototype.render=function(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.handleLayerRemove_=function(t){Ra(t.layer)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e=this,n=this.getSize(),i=this.getView(),o=this.frameState_,r=null;if(void 0!==n&&_i(n)&&i&&i.isDef()){var s=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=i.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:ue(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:{},mapId:k(this),renderTargets:{}},a.nextCenter&&a.nextResolution){var l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;r.nextExtent=ue(a.nextCenter,a.nextResolution,l,n)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),o)(!this.previousExtent_||!ye(this.previousExtent_)&&!Jt(r.extent,this.previousExtent_))&&(this.dispatchEvent(new Ks(Qs,this,o)),this.previousExtent_=$t(this.previousExtent_));this.previousExtent_&&!r.viewHints[Rr.ANIMATING]&&!r.viewHints[Rr.INTERACTING]&&!Jt(r.extent,this.previousExtent_)&&(this.dispatchEvent(new Ks(ta,this,r)),Yt(r.extent,this.previousExtent_))}this.dispatchEvent(new Ks(Js,this,r)),this.renderComplete_=this.hasListener(ea)||this.hasListener(na)||this.hasListener(ci)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((function(){e.postRenderTimeoutHandle_=void 0,e.handlePostRender()}),0))},e.prototype.setLayerGroup=function(t){var e=this.getLayerGroup();e&&this.handleLayerRemove_(new zs("removelayer",e)),this.set(ia.LAYERGROUP,t)},e.prototype.setSize=function(t){this.set(ia.SIZE,t)},e.prototype.setTarget=function(t){this.set(ia.TARGET,t)},e.prototype.setView=function(t){if(!t||t instanceof Oa)this.set(ia.VIEW,t);else{this.set(ia.VIEW,new Oa);var e=this;t.then((function(t){e.setView(new Oa(t))}))}},e.prototype.updateSize=function(){var t=this.getTargetElement(),e=void 0;if(t){var n=getComputedStyle(t),i=t.offsetWidth-parseFloat(n.borderLeftWidth)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)-parseFloat(n.borderRightWidth),o=t.offsetHeight-parseFloat(n.borderTopWidth)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)-parseFloat(n.borderBottomWidth);isNaN(i)||isNaN(o)||!_i(e=[i,o])&&(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}(ft),Ma=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),La=function(t){function e(e){var n=t.call(this)||this,i=e.element;return!i||e.target||i.style.pointerEvents||(i.style.pointerEvents="auto"),n.element=i||null,n.target_=null,n.map_=null,n.listenerKeys=[],e.render&&(n.render=e.render),e.target&&n.setTarget(e.target),n}return Ma(e,t),e.prototype.disposeInternal=function(){Ai(this.element),t.prototype.disposeInternal.call(this)},e.prototype.getMap=function(){return this.map_},e.prototype.setMap=function(t){this.map_&&Ai(this.element);for(var e=0,n=this.listenerKeys.length;e<n;++e)at(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,t)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==$&&this.listenerKeys.push(rt(t,Js,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}(ft),Aa=La,Da=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fa=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this).ulElement_=document.createElement("ul"),n.collapsed_=void 0===i.collapsed||i.collapsed,n.userCollapsed_=n.collapsed_,n.overrideCollapsible_=void 0!==i.collapsible,n.collapsible_=void 0===i.collapsible||i.collapsible,n.collapsible_||(n.collapsed_=!1);var o=void 0!==i.className?i.className:"ol-attribution",r=void 0!==i.tipLabel?i.tipLabel:"Attributions",s=void 0!==i.expandClassName?i.expandClassName:o+"-expand",a=void 0!==i.collapseLabel?i.collapseLabel:"›",l=void 0!==i.collapseClassName?i.collapseClassName:o+"-collapse";"string"==typeof a?(n.collapseLabel_=document.createElement("span"),n.collapseLabel_.textContent=a,n.collapseLabel_.className=l):n.collapseLabel_=a;var u=void 0!==i.label?i.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=r,n.toggleButton_.appendChild(h),n.toggleButton_.addEventListener(ot.CLICK,n.handleClick_.bind(n),!1);var c=o+" "+ji+" "+Ni+(n.collapsed_&&n.collapsible_?" "+Gi:"")+(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 Da(e,t),e.prototype.collectSourceAttributions_=function(t){for(var e={},n=[],i=!0,o=t.layerStatesArray,r=0,s=o.length;r<s;++r){var a=o[r];if(Oo(a,t.viewState)){var l=a.layer.getSource();if(l){var u=l.getAttributions();if(u){var h=u(t);if(h)if(i=i&&!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(i),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),!U(e,this.renderedAttributions_)){Di(this.ulElement_);for(var i=0,o=e.length;i<o;++i){var r=document.createElement("li");r.innerHTML=e[i],this.ulElement_.appendChild(r)}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(Gi),this.collapsed_?Li(this.collapseLabel_,this.label_):Li(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}(Aa),ka=Fa,ja=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Na=function(t){function e(e){var n=this,i=e||{};n=t.call(this,{element:document.createElement("div"),render:i.render,target:i.target})||this;var o=void 0!==i.className?i.className:"ol-rotate",r=void 0!==i.label?i.label:"⇧",s=void 0!==i.compassClassName?i.compassClassName:"ol-compass";n.label_=null,"string"==typeof r?(n.label_=document.createElement("span"),n.label_.className=s,n.label_.textContent=r):(n.label_=r,n.label_.classList.add(s));var a=i.tipLabel?i.tipLabel:"Reset rotation",l=document.createElement("button");l.className=o+"-reset",l.setAttribute("type","button"),l.title=a,l.appendChild(n.label_),l.addEventListener(ot.CLICK,n.handleClick_.bind(n),!1);var u=o+" "+ji+" "+Ni,h=n.element;return h.className=u,h.appendChild(l),n.callResetNorth_=i.resetNorth?i.resetNorth:void 0,n.duration_=void 0!==i.duration?i.duration:250,n.autoHide_=void 0===i.autoHide||i.autoHide,n.rotation_=void 0,n.autoHide_&&n.element.classList.add(Fi),n}return ja(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:ws}):t.setRotation(0))}},e.prototype.render=function(t){var e=t.frameState;if(e){var n=e.viewState.rotation;if(n!=this.rotation_){var i="rotate("+n+"rad)";if(this.autoHide_){var o=this.element.classList.contains(Fi);o||0!==n?o&&0!==n&&this.element.classList.remove(Fi):this.element.classList.add(Fi)}this.label_.style.transform=i}this.rotation_=n}},e}(Aa),Ga=Na,za=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Wa=function(t){function e(e){var n=this,i=e||{};n=t.call(this,{element:document.createElement("div"),target:i.target})||this;var o=void 0!==i.className?i.className:"ol-zoom",r=void 0!==i.delta?i.delta:1,s=void 0!==i.zoomInClassName?i.zoomInClassName:o+"-in",a=void 0!==i.zoomOutClassName?i.zoomOutClassName:o+"-out",l=void 0!==i.zoomInLabel?i.zoomInLabel:"+",u=void 0!==i.zoomOutLabel?i.zoomOutLabel:"–",h=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",c=void 0!==i.zoomOutTipLabel?i.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(ot.CLICK,n.handleClick_.bind(n,r),!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(ot.CLICK,n.handleClick_.bind(n,-r),!1);var d=o+" "+ji+" "+Ni,g=n.element;return g.className=d,g.appendChild(p),g.appendChild(f),n.duration_=void 0!==i.duration?i.duration:250,n}return za(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 i=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:ws})):e.setZoom(i)}}},e}(Aa),Xa=Wa,Ya=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ka={ELEMENT:"element",MAP:"map",OFFSET:"offset",POSITION:"position",POSITIONING:"positioning"},Ba=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un,n.options=e,n.id=e.id,n.insertFirst=void 0===e.insertFirst||e.insertFirst,n.stopEvent=void 0===e.stopEvent||e.stopEvent,n.element=document.createElement("div"),n.element.className=void 0!==e.className?e.className:"ol-overlay-container "+ki,n.element.style.position="absolute",n.element.style.pointerEvents="auto";var i=e.autoPan;return i&&"object"!=typeof i&&(i={animation:e.autoPanAnimation,margin:e.autoPanMargin}),n.autoPan=i||!1,n.rendered={transform_:"",visible:!0},n.mapPostrenderListenerKey=null,n.addChangeListener(Ka.ELEMENT,n.handleElementChanged),n.addChangeListener(Ka.MAP,n.handleMapChanged),n.addChangeListener(Ka.OFFSET,n.handleOffsetChanged),n.addChangeListener(Ka.POSITION,n.handlePositionChanged),n.addChangeListener(Ka.POSITIONING,n.handlePositioningChanged),void 0!==e.element&&n.setElement(e.element),n.setOffset(void 0!==e.offset?e.offset:[0,0]),n.setPositioning(e.positioning||"top-left"),void 0!==e.position&&n.setPosition(e.position),n}return Ya(e,t),e.prototype.getElement=function(){return this.get(Ka.ELEMENT)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(Ka.MAP)||null},e.prototype.getOffset=function(){return this.get(Ka.OFFSET)},e.prototype.getPosition=function(){return this.get(Ka.POSITION)},e.prototype.getPositioning=function(){return this.get(Ka.POSITIONING)},e.prototype.handleElementChanged=function(){Di(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Ai(this.element),at(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=rt(t,Js,this.render,this),this.updatePixelPosition();var e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.performAutoPan()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(Ka.ELEMENT,t)},e.prototype.setMap=function(t){this.set(Ka.MAP,t)},e.prototype.setOffset=function(t){this.set(Ka.OFFSET,t)},e.prototype.setPosition=function(t){this.set(Ka.POSITION,t)},e.prototype.performAutoPan=function(){this.autoPan&&this.panIntoView(this.autoPan)},e.prototype.panIntoView=function(t){var e=this.getMap();if(e&&e.getTargetElement()&&this.get(Ka.POSITION)){var n=this.getRect(e.getTargetElement(),e.getSize()),i=this.getElement(),o=this.getRect(i,[Pi(i),Mi(i)]),r=t||{},s=void 0===r.margin?20:r.margin;if(!Zt(n,o)){var a=o[0]-n[0],l=n[2]-o[2],u=o[1]-n[1],h=n[3]-o[3],c=[0,0];if(a<0?c[0]=a-s:l<0&&(c[0]=Math.abs(l)+s),u<0?c[1]=u-s:h<0&&(c[1]=Math.abs(h)+s),0!==c[0]||0!==c[1]){var p=e.getView().getCenterInternal(),f=e.getPixelFromCoordinateInternal(p);if(!f)return;var d=[f[0]+c[0],f[1]+c[1]],g=r.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(d),duration:g.duration,easing:g.easing})}}}},e.prototype.getRect=function(t,e){var n=t.getBoundingClientRect(),i=n.left+window.pageXOffset,o=n.top+window.pageYOffset;return[i,o,i+e[0],o+e[1]]},e.prototype.setPositioning=function(t){this.set(Ka.POSITIONING,t)},e.prototype.setVisible=function(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)},e.prototype.updatePixelPosition=function(){var t=this.getMap(),e=this.getPosition();if(t&&t.isRendered()&&e){var n=t.getPixelFromCoordinate(e),i=t.getSize();this.updateRenderedPosition(n,i)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var n=this.element.style,i=this.getOffset(),o=this.getPositioning();this.setVisible(!0);var r=Math.round(t[0]+i[0])+"px",s=Math.round(t[1]+i[1])+"px",a="0%",l="0%";"bottom-right"==o||"center-right"==o||"top-right"==o?a="-100%":"bottom-center"!=o&&"center-center"!=o&&"top-center"!=o||(a="-50%"),"bottom-left"==o||"bottom-center"==o||"bottom-right"==o?l="-100%":"center-left"!=o&&"center-center"!=o&&"center-right"!=o||(l="-50%");var u="translate(".concat(a,", ").concat(l,") translate(").concat(r,", ").concat(s,")");this.rendered.transform_!=u&&(this.rendered.transform_=u,n.transform=u,n.msTransform=u)},e.prototype.getOptions=function(){return this.options},e}(ft),Za=Ba;var Va="active",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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function Ha(t,e,n,i){var o=t.getZoom();if(void 0!==o){var r=t.getConstrainedZoom(o+e),s=t.getResolutionForZoom(r);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:s,anchor:n,duration:void 0!==i?i:250,easing:ws})}}var qa=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 Ua(e,t),e.prototype.getActive=function(){return this.get(Va)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(Va,t)},e.prototype.setMap=function(t){this.map_=t},e}(ft),$a=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ja=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.delta_=i.delta?i.delta:1,n.duration_=void 0!==i.duration?i.duration:250,n}return $a(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==Vs.DBLCLICK){var n=t.originalEvent,i=t.map,o=t.coordinate,r=n.shiftKey?-this.delta_:this.delta_;Ha(i.getView(),r,o,this.duration_),n.preventDefault(),e=!0}return!e},e}(qa),Qa=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();function tl(t){for(var e=t.length,n=0,i=0,o=0;o<e;o++)n+=t[o].clientX,i+=t[o].clientY;return[n/e,i/e]}var el=function(t){function e(e){var n=this,i=e||{};return n=t.call(this,i)||this,i.handleDownEvent&&(n.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(n.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(n.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(n.handleUpEvent=i.handleUpEvent),i.stopDown&&(n.stopDown=i.stopDown),n.handlingDownUpSequence=!1,n.targetPointers=[],n}return Qa(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==Vs.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Vs.POINTERUP){var n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==Vs.POINTERDOWN){var i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Vs.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){t.activePointers&&(this.targetPointers=t.activePointers)},e}(qa);function nl(t){var e=arguments;return function(t){for(var n=!0,i=0,o=e.length;i<o&&(n=n&&e[i](t));++i);return n}}var il=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ol=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||function(t){var e=t.map.getTargetElement(),n=t.map.getOwnerDocument().activeElement;return e.contains(n)}(t)},rl=H,sl=function(t){var e=t.originalEvent;return 0==e.button&&!(Pt&&Mt&&e.ctrlKey)},al=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ll=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ul=function(t){var e=t.originalEvent,n=e.target.tagName;return"INPUT"!==n&&"SELECT"!==n&&"TEXTAREA"!==n&&!e.target.isContentEditable},hl=function(t){var e=t.originalEvent;return mt(void 0!==e,56),"mouse"==e.pointerType},cl=function(t){var e=t.originalEvent;return mt(void 0!==e,56),e.isPrimary&&0===e.button},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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),fl=function(t){function e(e){var n=t.call(this,{stopDown:q})||this,i=e||{};n.kinetic_=i.kinetic,n.lastCentroid=null,n.lastPointersCount_,n.panning_=!1;var o=i.condition?i.condition:nl(al,cl);return n.condition_=i.onFocusOnly?nl(ol,o):o,n.noKinetic_=!1,n}return pl(e,t),e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());var e=this.targetPointers,n=tl(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var i=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],o=t.map.getView();!function(t,e){t[0]*=e,t[1]*=e}(i,o.getResolution()),qe(i,o.getRotation()),o.adjustCenterInternal(i)}}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 i=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),r=n.getCenterInternal(),s=e.getPixelFromCoordinateInternal(r),a=e.getCoordinateFromPixelInternal([s[0]-i*Math.cos(o),s[1]-i*Math.sin(o)]);n.animateInternal({center:n.getConstrainedCenter(a),duration:500,easing:ws})}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}(el),dl=fl,gl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),_l=function(t){function e(e){var n=this,i=e||{};return(n=t.call(this,{stopDown:q})||this).condition_=i.condition?i.condition:il,n.lastAngle_=void 0,n.duration_=void 0!==i.duration?i.duration:250,n}return gl(e,t),e.prototype.handleDragEvent=function(t){if(hl(t)){var e=t.map,n=e.getView();if(n.getConstraints().rotation!==va){var i=e.getSize(),o=t.pixel,r=Math.atan2(i[1]/2-o[1],o[0]-i[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_;n.adjustRotationInternal(-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){return!hl(t)||(t.map.getView().endInteraction(this.duration_),!1)},e.prototype.handleDownEvent=function(t){return!!hl(t)&&(!(!sl(t)||!this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0))},e}(el),yl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),vl=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 yl(e,t),e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,n="px",i=this.element_.style;i.left=Math.min(t[0],e[0])+n,i.top=Math.min(t[1],e[1])+n,i.width=Math.abs(e[0]-t[0])+n,i.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 ri([n])},e.prototype.getGeometry=function(){return this.geometry_},e}(Y),ml=vl,xl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),El="boxstart",Cl="boxdrag",wl="boxend",Sl="boxcancel",Tl=function(t){function e(e,n,i){var o=t.call(this,e)||this;return o.coordinate=n,o.mapBrowserEvent=i,o}return xl(e,t),e}(W),Ol=function(t){function e(e){var n=t.call(this)||this;n.on,n.once,n.un;var i=e||{};return n.box_=new ml(i.className||"ol-dragbox"),n.minArea_=void 0!==i.minArea?i.minArea:64,i.onBoxEnd&&(n.onBoxEnd=i.onBoxEnd),n.startPixel_=null,n.condition_=i.condition?i.condition:sl,n.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:n.defaultBoxEndCondition,n}return xl(e,t),e.prototype.defaultBoxEndCondition=function(t,e,n){var i=n[0]-e[0],o=n[1]-e[1];return i*i+o*o>=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 Tl(Cl,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 Tl(e?wl:Sl,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 Tl(El,t.coordinate,t)),!0)},e.prototype.onBoxEnd=function(t){},e}(el),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Rl=function(t){function e(e){var n=this,i=e||{},o=i.condition?i.condition:ll;return(n=t.call(this,{condition:o,className:i.className||"ol-dragzoom",minArea:i.minArea})||this).duration_=void 0!==i.duration?i.duration:200,n.out_=void 0!==i.out&&i.out,n}return bl(e,t),e.prototype.onBoxEnd=function(t){var e=this.getMap().getView(),n=this.getGeometry();if(this.out_){var i=e.rotatedExtentForGeometry(n),o=e.getResolutionForExtentInternal(i),r=e.getResolution()/o;(n=n.clone()).scale(r*r)}e.fitInternal(n,{duration:this.duration_,easing:ws})},e}(Ol),Il=37,Pl=38,Ml=39,Ll=40,Al=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Dl=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.defaultCondition_=function(t){return al(t)&&ul(t)},n.condition_=void 0!==i.condition?i.condition:n.defaultCondition_,n.duration_=void 0!==i.duration?i.duration:100,n.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128,n}return Al(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ot.KEYDOWN){var n=t.originalEvent,i=n.keyCode;if(this.condition_(t)&&(i==Ll||i==Il||i==Ml||i==Pl)){var o=t.map.getView(),r=o.getResolution()*this.pixelDelta_,s=0,a=0;i==Ll?a=-r:i==Il?s=-r:i==Ml?s=r:a=r;var l=[s,a];qe(l,o.getRotation()),function(t,e,n){var i=t.getCenterInternal();if(i){var o=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:Ts,center:t.getConstrainedCenter(o)})}}(o,l,this.duration_),n.preventDefault(),e=!0}}return!e},e}(qa),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),kl=function(t){function e(e){var n=t.call(this)||this,i=e||{};return n.condition_=i.condition?i.condition:ul,n.delta_=i.delta?i.delta:1,n.duration_=void 0!==i.duration?i.duration:100,n}return Fl(e,t),e.prototype.handleEvent=function(t){var e=!1;if(t.type==ot.KEYDOWN||t.type==ot.KEYPRESS){var n=t.originalEvent,i=n.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var o=t.map,r=i=="+".charCodeAt(0)?this.delta_:-this.delta_;Ha(o.getView(),r,void 0,this.duration_),n.preventDefault(),e=!0}}return!e},e}(qa),jl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Nl="trackpad",Gl="wheel",zl=function(t){function e(e){var n=this,i=e||{};(n=t.call(this,i)||this).totalDelta_=0,n.lastDelta_=0,n.maxDelta_=void 0!==i.maxDelta?i.maxDelta:1,n.duration_=void 0!==i.duration?i.duration:250,n.timeout_=void 0!==i.timeout?i.timeout:80,n.useAnchor_=void 0===i.useAnchor||i.useAnchor,n.constrainResolution_=void 0!==i.constrainResolution&&i.constrainResolution;var o=i.condition?i.condition:rl;return n.condition_=i.onFocusOnly?nl(ol,o):o,n.lastAnchor_=null,n.startTime_=void 0,n.timeoutId_,n.mode_=void 0,n.trackpadEventGap_=400,n.trackpadTimeoutId_,n.deltaPerZoom_=300,n}return jl(e,t),e.prototype.endInteraction_=function(){this.trackpadTimeoutId_=void 0;var t=this.getMap();t&&t.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!==ot.WHEEL)return!0;var e,n=t.map,i=t.originalEvent;if(i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==ot.WHEEL&&(e=i.deltaY,Rt&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(e/=Lt),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(e*=40)),0===e)return!1;this.lastDelta_=e;var o=Date.now();void 0===this.startTime_&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(e)<4?Nl:Gl);var r=n.getView();if(this.mode_===Nl&&!r.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(r.getAnimating()&&r.cancelAnimations(),r.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r.adjustZoom(-e/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=o,!1;this.totalDelta_+=e;var s=Math.max(this.timeout_-(o-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=-xe(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Ha(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}(qa),Wl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xl=function(t){function e(e){var n=this,i=e||{},o=i;return o.stopDown||(o.stopDown=q),(n=t.call(this,o)||this).anchor_=null,n.lastAngle_=void 0,n.rotating_=!1,n.rotationDelta_=0,n.threshold_=void 0!==i.threshold?i.threshold:.3,n.duration_=void 0!==i.duration?i.duration:250,n}return Wl(e,t),e.prototype.handleDragEvent=function(t){var e=0,n=this.targetPointers[0],i=this.targetPointers[1],o=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(void 0!==this.lastAngle_){var r=o-this.lastAngle_;this.rotationDelta_+=r,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=r}this.lastAngle_=o;var s=t.map,a=s.getView();if(a.getConstraints().rotation!==va){var l=s.getViewport().getBoundingClientRect(),u=tl(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}(el),Yl=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Kl=function(t){function e(e){var n=this,i=e||{},o=i;return o.stopDown||(o.stopDown=q),(n=t.call(this,o)||this).anchor_=null,n.duration_=void 0!==i.duration?i.duration:400,n.lastDistance_=void 0,n.lastScaleDelta_=1,n}return Yl(e,t),e.prototype.handleDragEvent=function(t){var e=1,n=this.targetPointers[0],i=this.targetPointers[1],o=n.clientX-i.clientX,r=n.clientY-i.clientY,s=Math.sqrt(o*o+r*r);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=tl(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}(el);var 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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zl=function(t){function e(e){return(e=J({},e)).controls||(e.controls=function(t){var e=t||{},n=new vt;return(void 0===e.zoom||e.zoom)&&n.push(new Xa(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&n.push(new Ga(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&n.push(new ka(e.attributionOptions)),n}()),e.interactions||(e.interactions=function(t){var e=t||{},n=new vt,i=new Ms(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&n.push(new _l),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&n.push(new Ja({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&n.push(new dl({onFocusOnly:e.onFocusOnly,kinetic:i})),(void 0===e.pinchRotate||e.pinchRotate)&&n.push(new Xl),(void 0===e.pinchZoom||e.pinchZoom)&&n.push(new Kl({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(n.push(new Dl),n.push(new kl({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&n.push(new zl({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&n.push(new Rl({duration:e.zoomDuration})),n}({onFocusOnly:!0})),t.call(this,e)||this}return Bl(e,t),e.prototype.createRenderer=function(){return new Ns(this)},e}(Pa),Vl=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.expireCache=function(t){for(;this.canExpireCache();)this.pop()},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 mt(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 mt(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.peek=function(t){if(this.containsKey(t))return this.entries_[t].value_},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){mt(!(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 Ul(t,e,n,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=n,i):[t,e,n]}function Hl(t,e,n){return t+"/"+e+"/"+n}function ql(t){return Hl(t[0],t[1],t[2])}var $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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Jl=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return $l(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=function(t){return t.split("/").map(Number)}(this.peekFirstKey()),e=t[0];this.forEach(function(t){t.tileCoord[0]!==e&&(this.remove(ql(t.tileCoord)),t.release())}.bind(this))}},e}(Vl),Ql=Jl,tu=function(){function t(t,e,n,i){this.minX=t,this.maxX=e,this.minY=n,this.maxY=i}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 eu(t,e,n,i,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=n,o.maxY=i,o):new tu(t,e,n,i)}var nu,iu=tu,ou=.5,ru=10,su=function(){function t(t,e,n,i,o,r){this.sourceProj_=t,this.targetProj_=e;var s={},a=fn(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_=i,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&ge(i)==ge(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?ge(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?ge(this.targetProj_.getExtent()):null;var l=fe(n),u=de(n),h=se(n),c=re(n),p=this.transformInv_(l),f=this.transformInv_(u),d=this.transformInv_(h),g=this.transformInv_(c),_=ru+(r?Math.max(0,Math.ceil(Ce(oe(n)/(r*r*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,i,o,r){this.triangles_.push({source:[i,o,r],target:[t,e,n]})},t.prototype.addQuad_=function(t,e,n,i,o,r,s,a,l){var u=Wt([o,r,s,a]),h=this.sourceWorldWidth_?ge(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=ge(Wt([t,e,n,i]))/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]))||_e(u,this.maxSourceExtent_)){var d=0;if(!(f||isFinite(o[0])&&isFinite(o[1])&&isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)f=!0;else if(1!=(d=(isFinite(o[0])&&isFinite(o[1])?0:8)+(isFinite(r[0])&&isFinite(r[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=(Oe(o[0],c)+Oe(s[0],c))/2-Oe(_[0],c);else y=(o[0]+s[0])/2-_[0];var v=(o[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),E=[(i[0]+t[0])/2,(i[1]+t[1])/2],C=this.transformInv_(E);this.addQuad_(t,e,m,E,o,r,x,C,l-1),this.addQuad_(E,m,n,i,C,x,s,a,l-1)}else{var w=[(t[0]+e[0])/2,(t[1]+e[1])/2],S=this.transformInv_(w),T=[(n[0]+i[0])/2,(n[1]+i[1])/2],O=this.transformInv_(T);this.addQuad_(t,w,T,i,o,S,O,a,l-1),this.addQuad_(w,e,n,T,S,r,s,O,l-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&d)&&this.addTriangle_(t,n,i,o,s,a),0==(14&d)&&this.addTriangle_(t,n,e,o,s,r),d&&(0==(13&d)&&this.addTriangle_(e,i,t,r,a,o),0==(7&d)&&this.addTriangle_(e,i,n,r,a,s))}},t.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,n,i){var o=e.source;te(t,o[0]),te(t,o[1]),te(t,o[2])})),t},t.prototype.getTriangles=function(){return this.triangles_},t}(),au={imageSmoothingEnabled:!1,msImageSmoothingEnabled:!1},lu={imageSmoothingEnabled:!0,msImageSmoothingEnabled:!0},uu=[];function hu(t,e,n,i,o){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(i,o),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,o)),t.restore()}function cu(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function pu(t,e,n,i){var o=dn(n,e,t),r=an(e,i,n),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var l=t.getExtent();if(!l||Bt(l,o)){var u=an(t,r,o)/r;isFinite(u)&&u>0&&(r/=u)}return r}function fu(t,e,n,i,o,r,s,a,l,u,h,c){var p=Ri(Math.round(n*t),Math.round(n*e),uu);if(c||J(p,au),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){Qt(d,t.extent)}));var g=ge(d),_=ce(d),y=Ri(Math.round(n*g/i),Math.round(n*_/i));c||J(y,au);var v=n/i;l.forEach((function(t,e,n){var i=t.extent[0]-d[0],o=-(t.extent[3]-d[3]),r=ge(t.extent),s=ce(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,i*v,o*v,r*v,s*v)}));var m=fe(s);return a.getTriangles().forEach((function(t,e,o){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],x=f((a[0][0]-m[0])/r),E=f(-(a[0][1]-m[1])/r),C=f((a[1][0]-m[0])/r),w=f(-(a[1][1]-m[1])/r),S=f((a[2][0]-m[0])/r),T=f(-(a[2][1]-m[1])/r),O=l,b=u;l=0,u=0;var R=function(t){for(var e=t.length,n=0;n<e;n++){for(var i=n,o=Math.abs(t[n][n]),r=n+1;r<e;r++){var s=Math.abs(t[r][n]);s>o&&(o=s,i=r)}if(0===o)return null;var a=t[i];t[i]=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-=O,g-=b,0,0,C-x],[_-=O,v-=b,0,0,S-x],[0,0,h,g,w-E],[0,0,_,v,T-E]]);if(R){if(p.save(),p.beginPath(),function(){if(void 0===nu){var t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",hu(t,4,5,4,0),hu(t,4,5,0,5);var e=t.getImageData(0,0,3,3).data;nu=cu(e,0)||cu(e,4)||cu(e,8)}return nu}()||!c){p.moveTo(C,w);for(var I=x-C,P=E-w,M=0;M<4;M++)p.lineTo(C+f((M+1)*I/4),w+f(M*P/3)),3!=M&&p.lineTo(C+f((M+1)*I/4),w+f((M+1)*P/3));p.lineTo(S,T)}else p.moveTo(C,w),p.lineTo(x,E),p.lineTo(S,T);p.clip(),p.transform(R[0],R[2],R[1],R[3],x,E),p.translate(d[0]-O,d[3]-b),p.scale(i/n,-i/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 i=t.target,o=(i[0][0]-m[0])/r,s=-(i[0][1]-m[1])/r,a=(i[1][0]-m[0])/r,l=-(i[1][1]-m[1])/r,u=(i[2][0]-m[0])/r,h=-(i[2][1]-m[1])/r;p.beginPath(),p.moveTo(a,l),p.lineTo(o,s),p.lineTo(u,h),p.closePath(),p.stroke()})),p.restore()),p.canvas}var 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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),gu=function(t){function e(e,n,i,o,r,s,a,l,u,h,c,p){var f=t.call(this,r,Es.IDLE,{interpolate:!!p})||this;f.renderEdges_=void 0!==c&&c,f.pixelRatio_=a,f.gutter_=l,f.canvas_=null,f.sourceTileGrid_=n,f.targetTileGrid_=o,f.wrappedTileCoord_=s||r,f.sourceTiles_=[],f.sourcesListenerKeys_=null,f.sourceZ_=0;var d=o.getTileCoordExtent(f.wrappedTileCoord_),g=f.targetTileGrid_.getExtent(),_=f.sourceTileGrid_.getExtent(),y=g?pe(d,g):d;if(0===oe(y))return f.state=Es.EMPTY,f;var v=e.getExtent();v&&(_=_?pe(_,v):v);var m=o.getResolution(f.wrappedTileCoord_[0]),x=function(t,e,n,i){var o=ae(n),r=pu(t,e,o,i);return(!isFinite(r)||r<=0)&&ie(n,(function(n){return r=pu(t,e,n,i),isFinite(r)&&r>0})),r}(e,i,y,m);if(!isFinite(x)||x<=0)return f.state=Es.EMPTY,f;var E=void 0!==h?h:ou;if(f.triangulation_=new su(e,i,y,_,x*E,m),0===f.triangulation_.getTriangles().length)return f.state=Es.EMPTY,f;f.sourceZ_=n.getZForResolution(x);var C=f.triangulation_.calculateSourceExtent();if(_&&(e.canWrapX()?(C[1]=xe(C[1],_[1],_[3]),C[3]=xe(C[3],_[1],_[3])):C=pe(C,_)),oe(C)){for(var w=n.getTileRangeForExtentAndZ(C,f.sourceZ_),S=w.minX;S<=w.maxX;S++)for(var T=w.minY;T<=w.maxY;T++){var O=u(f.sourceZ_,S,T,a);O&&f.sourceTiles_.push(O)}0===f.sourceTiles_.length&&(f.state=Es.EMPTY)}else f.state=Es.EMPTY;return f}return du(e,t),e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,n,i){e&&e.getState()==Es.LOADED&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Es.ERROR;else{var e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),i="number"==typeof n?n:n[0],o="number"==typeof n?n:n[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=fu(i,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=Es.LOADED}this.changed()},e.prototype.load=function(){if(this.state==Es.IDLE){this.state=Es.LOADING,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,n,i){var o=e.getState();if(o==Es.IDLE||o==Es.LOADING){t++;var r=rt(e,ot.CHANGE,(function(n){var i=e.getState();i!=Es.LOADED&&i!=Es.ERROR&&i!=Es.EMPTY||(at(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,n){t.getState()==Es.IDLE&&t.load()}))}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(at),this.sourcesListenerKeys_=null},e.prototype.release=function(){this.canvas_&&(Ii(this.canvas_.getContext("2d")),uu.push(this.canvas_),this.canvas_=null),t.prototype.release.call(this)},e}(bs),_u="tileloadstart",yu="tileloadend",vu="tileloaderror",mu=[0,0,0],xu=function(){function t(t){var e,n,i,o;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,mt((e=this.resolutions_,n=!0,i=function(t,e){return e-t}||K,e.every((function(t,o){if(0===o)return!0;var r=i(e[o-1],t);return!(r>0||n&&0===r)}))),17),!t.origins)for(var r=0,s=this.resolutions_.length-1;r<s;++r)if(o){if(this.resolutions_[r]/this.resolutions_[r+1]!==o){o=void 0;break}}else o=this.resolutions_[r]/this.resolutions_[r+1];this.zoomFactor_=o,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,mt(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=fe(a)),mt(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,mt(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:pa,mt(!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 iu(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 i=this.getTileRangeForExtentAndZ(a,e);n.minX=Math.max(i.minX,n.minX),n.maxX=Math.min(i.maxX,n.maxX),n.minY=Math.max(i.minY,n.minY),n.maxY=Math.min(i.maxY,n.maxY)}return n}),this):a&&this.calculateTileRanges_(a)}return t.prototype.forEachTileCoord=function(t,e,n){for(var i=this.getTileRangeForExtentAndZ(t,e),o=i.minX,r=i.maxX;o<=r;++o)for(var s=i.minY,a=i.maxY;s<=a;++s)n([e,o,s])},t.prototype.forEachTileCoordParentTileRange=function(t,e,n,i){var o,r,s=null,a=t[0]-1;for(2===this.zoomFactor_?(o=t[1],r=t[2]):s=this.getTileCoordExtent(t,i);a>=this.minZoom;){if(e(a,2===this.zoomFactor_?eu(o=Math.floor(o/2),o,r=Math.floor(r/2),r,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 i=2*t[1],o=2*t[2];return eu(i,i+1,o,o+1,e)}var r=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},t.prototype.getTileRangeForTileCoordAndZ=function(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;var i=t[0],o=t[1],r=t[2];if(e===i)return eu(o,r,o,r,n);if(this.zoomFactor_){var s=Math.pow(this.zoomFactor_,e-i),a=Math.floor(o*s),l=Math.floor(r*s);return e<i?eu(a,a,l,l,n):eu(a,Math.floor(s*(o+1))-1,l,Math.floor(s*(r+1))-1,n)}var u=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(u,e,n)},t.prototype.getTileRangeExtent=function(t,e,n){var i=this.getOrigin(t),o=this.getResolution(t),r=yi(this.getTileSize(t),this.tmpSize_),s=i[0]+e.minX*r[0]*o,a=i[0]+(e.maxX+1)*r[0]*o;return qt(s,i[1]+e.minY*r[1]*o,a,i[1]+(e.maxY+1)*r[1]*o,n)},t.prototype.getTileRangeForExtentAndZ=function(t,e,n){var i=mu;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,i);var o=i[1],r=i[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,i),eu(o,i[1],r,i[2],n)},t.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=yi(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*i[0]*n,e[1]-(t[2]+.5)*i[1]*n]},t.prototype.getTileCoordExtent=function(t,e){var n=this.getOrigin(t[0]),i=this.getResolution(t[0]),o=yi(this.getTileSize(t[0]),this.tmpSize_),r=n[0]+t[1]*o[0]*i,s=n[1]-(t[2]+1)*o[1]*i;return qt(r,s,r+o[0]*i,s+o[1]*i,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,i,o){var r=this.getZForResolution(n),s=n/this.getResolution(r),a=this.getOrigin(r),l=yi(this.getTileSize(r),this.tmpSize_),u=s*(t-a[0])/n/l[0],h=s*(a[1]-e)/n/l[1];return i?(u=Pe(u,5)-1,h=Pe(h,5)-1):(u=Ie(u,5),h=Ie(h,5)),Ul(r,u,h,o)},t.prototype.getTileCoordForXYAndZ_=function(t,e,n,i,o){var r=this.getOrigin(n),s=this.getResolution(n),a=yi(this.getTileSize(n),this.tmpSize_),l=(t-r[0])/s/a[0],u=(r[1]-e)/s/a[1];return i?(l=Pe(l,5)-1,u=Pe(u,5)-1):(l=Ie(l,5),u=Ie(u,5)),Ul(n,l,u,o)},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 xe(B(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},t.prototype.tileCoordIntersectsViewport=function(t,e){return ti(e,0,e.length,2,this.getTileCoordExtent(t))},t.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,n=new Array(e),i=this.minZoom;i<e;++i)n[i]=this.getTileRangeForExtentAndZ(t,i);this.fullTileRanges_=n},t}(),Eu=xu;function Cu(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,n,i){var o=Su(t);return function(t,e,n,i){var o=void 0!==i?i:"top-left",r=wu(t,e,n);return new Eu({extent:t,origin:le(t,o),resolutions:r,tileSize:n})}(o,e,n,i)}(t),t.setDefaultTileGrid(e)),e}function wu(t,e,n,i){for(var o=void 0!==e?e:ca,r=ce(t),s=ge(t),a=yi(void 0!==n?n:pa),l=i>0?i:Math.max(s/a[0],r/a[1]),u=o+1,h=new Array(u),c=0;c<u;++c)h[c]=l/Math.pow(2,c);return h}function Su(t){var e=(t=sn(t)).getExtent();if(!e){var n=180*Tt[Ot.DEGREES]/t.getMetersPerUnit();e=qt(-n,-n,n,n)}return e}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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ou=function(t){function e(e){var n=t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate})||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;return n.tileGrid&&yi(n.tileGrid.getTileSize(n.tileGrid.getMinZoom()),[256,256]),n.tileCache=new Ql(e.cacheSize||0),n.tmpSize=[0,0],n.key_=e.key||"",n.tileOptions={transition:e.transition,interpolate:e.interpolate},n.zDirection=e.zDirection?e.zDirection:0,n}return Tu(e,t),e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var n=this.getTileCacheForProjection(t);n&&n.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,n,i){var o=this.getTileCacheForProjection(t);if(!o)return!1;for(var r,s,a,l=!0,u=n.minX;u<=n.maxX;++u)for(var h=n.minY;h<=n.maxY;++h)s=Hl(e,u,h),a=!1,o.containsKey(s)&&(a=(r=o.get(s)).getState()===Es.LOADED)&&(a=!1!==i(r)),a||(l=!1);return l},e.prototype.getGutterForProjection=function(t){return 0},e.prototype.getKey=function(){return this.key_},e.prototype.setKey=function(t){this.key_!==t&&(this.key_=t,this.changed())},e.prototype.getOpaque=function(t){return this.opaque_},e.prototype.getResolutions=function(){return this.tileGrid?this.tileGrid.getResolutions():null},e.prototype.getTile=function(t,e,n,i,o){return D()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:Cu(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return mt(null===e||cn(e,t),68),this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,n){var i,o,r,s=this.getTileGridForProjection(n),a=this.getTilePixelRatio(e),l=yi(s.getTileSize(t),this.tmpSize);return 1==a?l:(i=l,o=a,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=i[0]*o+.5|0,r[1]=i[1]*o+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var n=void 0!==e?e:this.getProjection(),i=this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){var i=e[0],o=t.getTileCoordCenter(e),r=Su(n);if(Bt(r,o))return e;var s=ge(r),a=Math.ceil((r[0]-o[0])/s);return o[0]+=s*a,t.getTileCoordForCoordAndZ(o,i)}(i,t,n)),function(t,e){var n=t[0],i=t[1],o=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;var r=e.getFullTileRange(n);return!r||r.containsXY(i,o)}(t,i)?t:null},e.prototype.clear=function(){this.tileCache.clear()},e.prototype.refresh=function(){this.clear(),t.prototype.refresh.call(this)},e.prototype.updateCacheSize=function(t,e){var n=this.getTileCacheForProjection(e);t>n.highWaterMark&&(n.highWaterMark=t)},e.prototype.useTile=function(t,e,n,i){},e}(as),bu=function(t){function e(e,n){var i=t.call(this,e)||this;return i.tile=n,i}return Tu(e,t),e}(W),Ru=Ou;function Iu(t,e){var n=/\{z\}/g,i=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,l){return s?t.replace(n,s[0].toString()).replace(i,s[1].toString()).replace(o,s[2].toString()).replace(r,(function(){var t=s[0],n=e.getFullTileRange(t);return mt(n,55),(n.getHeight()-s[2]-1).toString()})):void 0}}function Pu(t,e){for(var n=t.length,i=new Array(n),o=0;o<n;++o)i[o]=Iu(t[o],e);return function(t){if(1===t.length)return t[0];return function(e,n,i){if(e){var o=function(t){return(t[1]<<t[0])+t[2]}(e),r=Oe(o,t.length);return t[r](e,n,i)}}}(i)}var 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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Lu=function(t){function e(n){var i=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,interpolate:n.interpolate,key:n.key,attributionsCollapsible:n.attributionsCollapsible,zDirection:n.zDirection})||this;return i.generateTileUrlFunction_=i.tileUrlFunction===e.prototype.tileUrlFunction,i.tileLoadFunction=n.tileLoadFunction,n.tileUrlFunction&&(i.tileUrlFunction=n.tileUrlFunction),i.urls=null,n.urls?i.setUrls(n.urls):n.url&&i.setUrl(n.url),i.tileLoadingKeys_={},i}return Mu(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=k(n),o=n.getState();o==Es.LOADING?(this.tileLoadingKeys_[i]=!0,e=_u):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],e=o==Es.ERROR?vu:o==Es.LOADED?yu:void 0),null!=e&&this.dispatchEvent(new bu(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 i=n[1].charCodeAt(0),o=n[2].charCodeAt(0),r=void 0;for(r=i;r<=o;++r)e.push(t.replace(n[0],String.fromCharCode(r)));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(Pu(t,this.tileGrid),e):this.setKey(e)},e.prototype.tileUrlFunction=function(t,e,n){},e.prototype.useTile=function(t,e,n){var i=Hl(t,e,n);this.tileCache.containsKey(i)&&this.tileCache.get(i)},e}(Ru),Au=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Du=function(t){function e(e){var n=this,i=void 0===e.imageSmoothing||e.imageSmoothing;return void 0!==e.interpolate&&(i=e.interpolate),(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:Fu,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:i,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection})||this).crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,n.tileClass=void 0!==e.tileClass?e.tileClass:Ps,n.tileCacheForProjection={},n.tileGridForProjection={},n.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,n.renderReprojectionEdges_=!1,n}return Au(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 i in this.tileCache.expireCache(this.tileCache==n?e:{}),this.tileCacheForProjection){var o=this.tileCacheForProjection[i];o.expireCache(o==n?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!cn(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getKey=function(){var e=t.prototype.getKey.call(this);return this.getInterpolate()||(e+=":disable-interpolation"),e},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!cn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!cn(e,t)){var n=k(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Cu(t)),this.tileGridForProjection[n]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||cn(e,t))return this.tileCache;var n=k(t);return n in this.tileCacheForProjection||(this.tileCacheForProjection[n]=new Ql(this.tileCache.highWaterMark)),this.tileCacheForProjection[n]},e.prototype.createTile_=function(t,e,n,i,o,r){var s=[t,e,n],a=this.getTileCoordForTileUrlFunction(s,o),l=a?this.tileUrlFunction(a,i,o):void 0,u=new this.tileClass(s,void 0!==l?Es.IDLE:Es.EMPTY,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return u.key=r,u.addEventListener(ot.CHANGE,this.handleTileChange.bind(this)),u},e.prototype.getTile=function(t,e,n,i,o){var r=this.getProjection();if(r&&o&&!cn(r,o)){var s=this.getTileCacheForProjection(o),a=[t,e,n],l=void 0,u=ql(a);s.containsKey(u)&&(l=s.get(u));var h=this.getKey();if(l&&l.key==h)return l;var c=this.getTileGridForProjection(r),p=this.getTileGridForProjection(o),f=this.getTileCoordForTileUrlFunction(a,o),d=new gu(r,c,o,p,a,f,this.getTilePixelRatio(i),this.getGutter(),function(t,e,n,i){return this.getTileInternal(t,e,n,i,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());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,i,r||o)},e.prototype.getTileInternal=function(t,e,n,i,o){var r=null,s=Hl(t,e,n),a=this.getKey();if(this.tileCache.containsKey(s)){if((r=this.tileCache.get(s)).key!=a){var l=r;r=this.createTile_(t,e,n,i,o,a),l.getState()==Es.IDLE?r.interimTile=l.interimTile:r.interimTile=l,r.refreshInterimChain(),this.tileCache.replace(s,r)}}else r=this.createTile_(t,e,n,i,o,a),this.tileCache.set(s,r);return r},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=sn(t);if(n){var i=k(n);i in this.tileGridForProjection||(this.tileGridForProjection[i]=e)}},e}(Lu);function Fu(t,e){t.getImage().src=e}var ku=Du,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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Nu=function(t){function e(e){var n=this,i=e||{},o=void 0===i.imageSmoothing||i.imageSmoothing;void 0!==i.interpolate&&(o=i.interpolate);var r=void 0!==i.projection?i.projection:"EPSG:3857",s=void 0!==i.tileGrid?i.tileGrid:function(t){var e=t||{},n=e.extent||sn("EPSG:3857").getExtent(),i={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:wu(n,e.maxZoom,e.tileSize,e.maxResolution)};return new Eu(i)}({extent:Su(r),maxResolution:i.maxResolution,maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});return(n=t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,interpolate:o,opaque:i.opaque,projection:r,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:s,tileLoadFunction:i.tileLoadFunction,tilePixelRatio:i.tilePixelRatio,tileUrlFunction:i.tileUrlFunction,url:i.url,urls:i.urls,wrapX:void 0===i.wrapX||i.wrapX,transition:i.transition,attributionsCollapsible:i.attributionsCollapsible,zDirection:i.zDirection})||this).gutter_=void 0!==i.gutter?i.gutter:0,n}return ju(e,t),e.prototype.getGutter=function(){return this.gutter_},e}(ku),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),zu='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.',Wu=function(t){function e(e){var n,i=e||{},o=void 0===i.imageSmoothing||i.imageSmoothing;void 0!==i.interpolate&&(o=i.interpolate),n=void 0!==i.attributions?i.attributions:[zu];var r=void 0!==i.crossOrigin?i.crossOrigin:"anonymous",s=void 0!==i.url?i.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";return t.call(this,{attributions:n,attributionsCollapsible:!1,cacheSize:i.cacheSize,crossOrigin:r,interpolate:o,maxZoom:void 0!==i.maxZoom?i.maxZoom:19,opaque:void 0===i.opaque||i.opaque,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileLoadFunction:i.tileLoadFunction,transition:i.transition,url:s,wrapX:i.wrapX,zDirection:i.zDirection})||this}return Gu(e,t),e}(Nu),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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Yu=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 iu(0,0,0,0),n}return Xu(e,t),e.prototype.isDrawableTile=function(t){var e=this.getLayer(),n=t.getState(),i=e.getUseInterimTilesOnError();return n==Es.LOADED||n==Es.EMPTY||n==Es.ERROR&&!i},e.prototype.getTile=function(t,e,n,i){var o=i.pixelRatio,r=i.viewState.projection,s=this.getLayer(),a=s.getSource().getTile(t,e,n,o,r);return a.getState()==Es.ERROR&&(s.getUseInterimTilesOnError()?s.getPreload()>0&&(this.newTiles_=!0):a.setState(Es.LOADED)),this.isDrawableTile(a)||(a=a.getInterimTile()),a},e.prototype.getData=function(t){var e=this.frameState;if(!e)return null;var n=this.getLayer(),i=kt(e.pixelToCoordinateTransform,t.slice()),o=n.getExtent();if(o&&!Bt(o,i))return null;for(var r=e.pixelRatio,s=e.viewState.projection,a=e.viewState,l=n.getRenderSource(),u=l.getTileGridForProjection(a.projection),h=l.getTilePixelRatio(e.pixelRatio),c=u.getZForResolution(a.resolution);c>=u.getMinZoom();--c){var p=u.getTileCoordForCoordAndZ(i,c),f=l.getTile(c,p[1],p[2],r,s);if(!(f instanceof Ps||f instanceof gu))return null;if(f.getState()===Es.LOADED){var d=u.getOrigin(c),g=yi(u.getTileSize(c)),_=u.getResolution(c),y=Math.floor(h*((i[0]-d[0])/_-p[1]*g[0])),v=Math.floor(h*((d[1]-i[1])/_-p[2]*g[1])),m=Math.round(h*l.getGutterForProjection(a.projection));return this.getImageData(f.getImage(),y+m,v+m)}}return null},e.prototype.loadedTileCallback=function(e,n,i){return!!this.isDrawableTile(i)&&t.prototype.loadedTileCallback.call(this,e,n,i)},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,r=i.resolution,s=i.center,a=i.rotation,l=t.pixelRatio,u=this.getLayer(),h=u.getSource(),c=h.getRevision(),p=h.getTileGridForProjection(o),f=p.getZForResolution(r,h.zDirection),d=p.getResolution(f),g=t.extent,_=t.viewState.resolution,y=h.getTilePixelRatio(l),v=Math.round(ge(g)/_*l),m=Math.round(ce(g)/_*l),x=n.extent&&wn(n.extent);x&&(g=pe(g,wn(n.extent)));var E=d*v/2/y,C=d*m/2/y,w=[s[0]-E,s[1]-C,s[0]+E,s[1]+C],S=p.getTileRangeForExtentAndZ(g,f),T={};T[f]={};var O=this.createLoadedTileFinder(h,o,T),b=this.tmpExtent,R=this.tmpTileRange_;this.newTiles_=!1;for(var I=a?he(i.center,_,a,t.size):void 0,P=S.minX;P<=S.maxX;++P)for(var M=S.minY;M<=S.maxY;++M)if(!a||p.tileCoordIntersectsViewport([f,P,M],I)){var L=this.getTile(f,P,M,t);if(this.isDrawableTile(L)){var A=k(this);if(L.getState()==Es.LOADED)T[f][L.tileCoord.toString()]=L,(rt=L.inTransition(A))&&1!==n.opacity&&(L.endTransition(A),rt=!1),this.newTiles_||!rt&&-1!==this.renderedTiles.indexOf(L)||(this.newTiles_=!0);if(1===L.getAlpha(A,t.time))continue}var D=p.getTileCoordChildTileRange(L.tileCoord,R,b),F=!1;D&&(F=O(f+1,D)),F||p.forEachTileCoordParentTileRange(L.tileCoord,O,R,b)}var j=d/r*l/y;jt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/l,1/l,a,-v/2,-m/2);var N=Gt(this.pixelTransform);this.useContainer(e,N,this.getBackground(t));var G=this.context,z=G.canvas;Nt(this.inversePixelTransform,this.pixelTransform),jt(this.tempTransform,v/2,m/2,j,j,0,-v/2,-m/2),z.width!=v||z.height!=m?(z.width=v,z.height=m):this.containerReused||G.clearRect(0,0,v,m),x&&this.clipUnrotated(G,t,x),h.getInterpolate()||J(G,au),this.preRender(G,t),this.renderedTiles.length=0;var W,X,Y,B=Object.keys(T).map(Number);B.sort(K),1!==n.opacity||this.containerReused&&!h.getOpaque(t.viewState.projection)?(W=[],X=[]):B=B.reverse();for(var Z=B.length-1;Z>=0;--Z){var V=B[Z],U=h.getTilePixelSize(V,l,o),H=p.getResolution(V)/d,q=U[0]*H*j,$=U[1]*H*j,Q=p.getTileCoordForCoordAndZ(fe(w),V),tt=p.getTileCoordExtent(Q),et=kt(this.tempTransform,[y*(tt[0]-w[0])/d,y*(w[3]-tt[3])/d]),nt=y*h.getGutterForProjection(o),it=T[V];for(var ot in it){var rt,st=(L=it[ot]).tileCoord,at=Q[1]-st[1],lt=Math.round(et[0]-(at-1)*q),ut=Q[2]-st[2],ht=Math.round(et[1]-(ut-1)*$),ct=lt-(P=Math.round(et[0]-at*q)),pt=ht-(M=Math.round(et[1]-ut*$)),ft=f===V,dt=!1;if(!(rt=ft&&1!==L.getAlpha(k(this),t.time)))if(W){Y=[P,M,P+ct,M,P+ct,M+pt,P,M+pt];for(var gt=0,_t=W.length;gt<_t;++gt)if(f!==V&&V<X[gt]){var yt=W[gt];_e([P,M,P+ct,M+pt],[yt[0],yt[3],yt[4],yt[7]])&&(dt||(G.save(),dt=!0),G.beginPath(),G.moveTo(Y[0],Y[1]),G.lineTo(Y[2],Y[3]),G.lineTo(Y[4],Y[5]),G.lineTo(Y[6],Y[7]),G.moveTo(yt[6],yt[7]),G.lineTo(yt[4],yt[5]),G.lineTo(yt[2],yt[3]),G.lineTo(yt[0],yt[1]),G.clip())}W.push(Y),X.push(V)}else G.clearRect(P,M,ct,pt);this.drawTileImage(L,t,P,M,ct,pt,nt,ft),W&&!rt?(dt&&G.restore(),this.renderedTiles.unshift(L)):this.renderedTiles.push(L),this.updateUsedTiles(t.usedTiles,h,L)}}return this.renderedRevision=c,this.renderedResolution=d,this.extentChanged=!this.renderedExtent_||!Jt(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=o,this.manageTilePyramid(t,h,p,l,o,g,f,u.getPreload()),this.scheduleExpireCache(t,h),this.postRender(G,t),n.extent&&G.restore(),J(G,lu),N!==z.style.transform&&(z.style.transform=N),this.container},e.prototype.drawTileImage=function(t,e,n,i,o,r,s,a){var l=this.getTileImage(t);if(l){var u=k(this),h=e.layerStatesArray[e.layerIndex],c=h.opacity*(a?t.getAlpha(u,e.time):1),p=c!==this.context.globalAlpha;p&&(this.context.save(),this.context.globalAlpha=c),this.context.drawImage(l,s,s,l.width-2*s,l.height-2*s,n,i,o,r),p&&this.context.restore(),c!==h.opacity?e.animate=!0:a&&t.endTransition(u)}},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=k(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=k(e);i in t||(t[i]={}),t[i][n.getKey()]=!0},e.prototype.manageTilePyramid=function(t,e,n,i,o,r,s,a,l){var u=k(e);u in t.wantedTiles||(t.wantedTiles[u]={});var h,c,p,f,d,g,_=t.wantedTiles[u],y=t.tileQueue,v=n.getMinZoom(),m=t.viewState.rotation,x=m?he(t.viewState.center,t.viewState.resolution,m,t.size):void 0,E=0;for(g=v;g<=s;++g)for(c=n.getTileRangeForExtentAndZ(r,g,c),p=n.getResolution(g),f=c.minX;f<=c.maxX;++f)for(d=c.minY;d<=c.maxY;++d)m&&!n.tileCoordIntersectsViewport([g,f,d],x)||(s-g<=a?(++E,(h=e.getTile(g,f,d,i,o)).getState()==Es.IDLE&&(_[h.getKey()]=!0,y.isKeyQueued(h.getKey())||y.enqueue([h,u,n.getTileCoordCenter(h.tileCoord),p])),void 0!==l&&l(h)):e.useTile(g,f,d,o));e.updateCacheSize(E,o)},e}(cr),Ku=Yu,Bu="preload",Zu="useInterimTilesOnError",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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),Uu=function(t){function e(e){var n=this,i=e||{},o=J({},i);return delete o.preload,delete o.useInterimTilesOnError,(n=t.call(this,o)||this).on,n.once,n.un,n.setPreload(void 0!==i.preload?i.preload:0),n.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),n}return Vu(e,t),e.prototype.getPreload=function(){return this.get(Bu)},e.prototype.setPreload=function(t){this.set(Bu,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Zu)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Zu,t)},e.prototype.getData=function(e){return t.prototype.getData.call(this,e)},e}(bo),Hu=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 i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),qu=function(t){function e(e){return t.call(this,e)||this}return Hu(e,t),e.prototype.createRenderer=function(){return new Ku(this)},e}(Uu);const $u='\n\t.ol-box {\n\tbox-sizing: border-box;\n\tborder-radius: 2px;\n\tborder: 1.5px solid #b3c5db;\n\tbackground-color: rgba(255, 255, 255, 0.4);\n}\n.ol-mouse-position {\n\ttop: 8px;\n\tright: 8px;\n\tposition: absolute;\n}\n.ol-scale-line {\n\tbackground: rgba(0, 60, 136, 0.3);\n\tborder-radius: 4px;\n\tbottom: 8px;\n\tleft: 8px;\n\tpadding: 2px;\n\tposition: absolute;\n}\n.ol-scale-line-inner {\n\tborder: 1px solid #eee;\n\tborder-top: none;\n\tcolor: #eee;\n\tfont-size: 10px;\n\ttext-align: center;\n\tmargin: 1px;\n\twill-change: contents, width;\n\ttransition: all 0.25s;\n}\n.ol-scale-bar {\n\tposition: absolute;\n\tbottom: 8px;\n\tleft: 8px;\n}\n.ol-scale-step-marker {\n\twidth: 1px;\n\theight: 15px;\n\tbackground-color: #000;\n\tfloat: right;\n\tz-index: 10;\n}\n.ol-scale-step-text {\n\tposition: absolute;\n\tbottom: -5px;\n\tfont-size: 12px;\n\tz-index: 11;\n\tcolor: #000;\n\ttext-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff;\n}\n.ol-scale-text {\n\tposition: absolute;\n\tfont-size: 14px;\n\ttext-align: center;\n\tbottom: 25px;\n\tcolor: #000;\n\ttext-shadow: -2px 0 #fff, 0 2px #fff, 2px 0 #fff, 0 -2px #fff;\n}\n.ol-scale-singlebar {\n\tposition: relative;\n\theight: 10px;\n\tz-index: 9;\n\tbox-sizing: border-box;\n\tborder: 1px solid #000;\n}\n.ol-unsupported {\n\tdisplay: none;\n}\n.ol-unselectable,\n.ol-viewport {\n\t-webkit-touch-callout: none;\n\t-webkit-user-select: none;\n\t-moz-user-select: none;\n\t-ms-user-select: none;\n\tuser-select: none;\n\t-webkit-tap-highlight-color: transparent;\n}\n.ol-viewport canvas {\n\tall: unset;\n}\n.ol-selectable {\n\t-webkit-touch-callout: default;\n\t-webkit-user-select: text;\n\t-moz-user-select: text;\n\t-ms-user-select: text;\n\tuser-select: text;\n}\n.ol-grabbing {\n\tcursor: -webkit-grabbing;\n\tcursor: -moz-grabbing;\n\tcursor: grabbing;\n}\n.ol-grab {\n\tcursor: move;\n\tcursor: -webkit-grab;\n\tcursor: -moz-grab;\n\tcursor: grab;\n}\n.ol-control {\n\tposition: absolute;\n\tbackground-color: rgba(255, 255, 255, 0.4);\n\tborder-radius: 4px;\n\tpadding: 2px;\n}\n.ol-control:hover {\n\tbackground-color: rgba(255, 255, 255, 0.6);\n}\n.ol-zoom {\n\ttop: 0.5em;\n\tleft: 0.5em;\n}\n.ol-rotate {\n\ttop: 0.5em;\n\tright: 0.5em;\n\ttransition: opacity 0.25s linear, visibility 0s linear;\n}\n.ol-rotate.ol-hidden {\n\topacity: 0;\n\tvisibility: hidden;\n\ttransition: opacity 0.25s linear, visibility 0s linear 0.25s;\n}\n.ol-zoom-extent {\n\ttop: 4.643em;\n\tleft: 0.5em;\n}\n.ol-full-screen {\n\tright: 0.5em;\n\ttop: 0.5em;\n}\n.ol-control button {\n\tdisplay: block;\n\tmargin: 1px;\n\tpadding: 0;\n\tcolor: #fff;\n\tfont-weight: 700;\n\ttext-decoration: none;\n\tfont-size: inherit;\n\ttext-align: center;\n\theight: 1.375em;\n\twidth: 1.375em;\n\tline-height: 0.4em;\n\tbackground-color: rgba(0, 60, 136, 0.5);\n\tborder: none;\n\tborder-radius: 2px;\n}\n.ol-control button::-moz-focus-inner {\n\tborder: none;\n\tpadding: 0;\n}\n.ol-zoom-extent button {\n\tline-height: 1.4em;\n}\n.ol-compass {\n\tdisplay: block;\n\tfont-weight: 400;\n\tfont-size: 1.2em;\n\twill-change: transform;\n}\n.ol-touch .ol-control button {\n\tfont-size: 1.5em;\n}\n.ol-touch .ol-zoom-extent {\n\ttop: 5.5em;\n}\n.ol-control button:focus,\n.ol-control button:hover {\n\ttext-decoration: none;\n\tbackground-color: rgba(0, 60, 136, 0.7);\n}\n.ol-zoom .ol-zoom-in {\n\tborder-radius: 2px 2px 0 0;\n}\n.ol-zoom .ol-zoom-out {\n\tborder-radius: 0 0 2px 2px;\n}\n.ol-attribution {\n\ttext-align: right;\n\tbottom: 0.5em;\n\tright: 0.5em;\n\tmax-width: calc(100% - 1.3em);\n\tdisplay: flex;\n\tflex-flow: row-reverse;\n\talign-items: center;\n}\n.ol-attribution a {\n\tcolor: rgba(0, 60, 136, 0.7);\n\ttext-decoration: none;\n}\n.ol-attribution ul {\n\tmargin: 0;\n\tpadding: 1px 0.5em;\n\tcolor: #000;\n\ttext-shadow: 0 0 2px #fff;\n\tfont-size: 12px;\n}\n.ol-attribution li {\n\tdisplay: inline;\n\tlist-style: none;\n}\n.ol-attribution li:not(:last-child):after {\n\tcontent: " ";\n}\n.ol-attribution img {\n\tmax-height: 2em;\n\tmax-width: inherit;\n\tvertical-align: middle;\n}\n.ol-attribution button {\n\tflex-shrink: 0;\n}\n.ol-attribution.ol-collapsed ul {\n\tdisplay: none;\n}\n.ol-attribution:not(.ol-collapsed) {\n\tbackground: rgba(255, 255, 255, 0.8);\n}\n.ol-attribution.ol-uncollapsible {\n\tbottom: 0;\n\tright: 0;\n\tborder-radius: 4px 0 0;\n}\n.ol-attribution.ol-uncollapsible img {\n\tmargin-top: -0.2em;\n\tmax-height: 1.6em;\n}\n.ol-attribution.ol-uncollapsible button {\n\tdisplay: none;\n}\n.ol-zoomslider {\n\ttop: 4.5em;\n\tleft: 0.5em;\n\theight: 200px;\n}\n.ol-zoomslider button {\n\tposition: relative;\n\theight: 10px;\n}\n.ol-touch .ol-zoomslider {\n\ttop: 5.5em;\n}\n.ol-overviewmap {\n\tleft: 0.5em;\n\tbottom: 0.5em;\n}\n.ol-overviewmap.ol-uncollapsible {\n\tbottom: 0;\n\tleft: 0;\n\tborder-radius: 0 4px 0 0;\n}\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n\tdisplay: block;\n}\n.ol-overviewmap .ol-overviewmap-map {\n\tborder: 1px solid #7b98bc;\n\theight: 150px;\n\tmargin: 2px;\n\twidth: 150px;\n}\n.ol-overviewmap:not(.ol-collapsed) button {\n\tbottom: 2px;\n\tleft: 2px;\n\tposition: absolute;\n}\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n\tdisplay: none;\n}\n.ol-overviewmap:not(.ol-collapsed) {\n\tbackground: rgba(255, 255, 255, 0.8);\n}\n.ol-overviewmap-box {\n\tborder: 2px dotted rgba(0, 60, 136, 0.7);\n}\n.ol-overviewmap .ol-overviewmap-box:hover {\n\tcursor: move;\n}\n.ol-popup {\n\tposition: absolute;\n\tbackground-color: white;\n\tbox-shadow: 0 1px 4px rgba(0,0,0,0.2);\n\tpadding: 15px;\n\tborder-radius: 10px;\n\tborder: 1px solid #cccccc;\n\tbottom: 12px;\n\tleft: -50px;\n\tmin-width: 280px;\n}\n.ol-popup:after, .ol-popup:before {\n\ttop: 100%;\n\tborder: solid transparent;\n\tcontent: " ";\n\theight: 0;\n\twidth: 0;\n\tposition: absolute;\n\tpointer-events: none;\n}\n.ol-popup:after {\n\tborder-top-color: white;\n\tborder-width: 10px;\n\tleft: 48px;\n\tmargin-left: -10px;\n}\n.ol-popup:before {\n\tborder-top-color: #cccccc;\n\tborder-width: 11px;\n\tleft: 48px;\n\tmargin-left: -11px;\n}\n.ol-popup-closer {\n\ttext-decoration: none;\n\tposition: absolute;\n\ttop: 3px;\n\tright: 3px;\n\tborder: none;\n background: none;\n\tcursor: pointer;\n}\n.ol-popup-closer:after {\n\tcontent: "✖";\n}\n\t\n\t';function Ju(t,e,n){var i,o,r,s,a;function l(){var u=Date.now()-s;u<e&&u>=0?i=setTimeout(l,e-u):(i=null,n||(a=t.apply(r,o),r=o=null))}null==e&&(e=100);var u=function(){r=this,o=arguments,s=Date.now();var u=n&&!i;return i||(i=setTimeout(l,e)),u&&(a=t.apply(r,o),r=o=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=t.apply(r,o),r=o=null,clearTimeout(i),i=null)},u}Ju.debounce=Ju;var Qu=Ju;function th(e){let n,o,r,d,g,_,y,v;return{c(){n=u("div"),o=h(),r=u("div"),d=u("button"),g=h(),_=u("div"),this.c=t,p(n,"id","map"),f(n,"width","100%"),f(n,"height","100%"),p(d,"id","popup-closer"),p(d,"class","ol-popup-closer"),p(_,"id","popup-content"),p(r,"id","popup"),p(r,"class","ol-popup")},m(t,i){a(t,n,i),a(t,o,i),a(t,r,i),s(r,d),s(r,g),s(r,_),y||(v=[c(window,"resize",Qu(e[0],200)),c(d,"click",e[8])],y=!0)},p:t,i:t,o:t,d(t){t&&l(n),t&&l(o),t&&l(r),y=!1,i(v)}}}function eh(t,e,n){const i=y(),o=v();function r(t,e){o(t,e),i.dispatchEvent&&i.dispatchEvent(new CustomEvent(t,{detail:e}))}let s,a,l,u,h,{id:c}=e,{zoom:p}=e,{center:f}=e,{data:d}=e,{source:g}=e,{options:_}=e;function m(){if(a){if(s){s=null;const t=document.createElement("style");t.innerHTML=$u,a.innerHTML="",a.appendChild(t)}const t=[];"osm"===g.type.toLowerCase()?t.push(new qu({source:new Wu})):"xyz"===g.type.toLowerCase()&&g.url&&t.push(new qu({source:new Nu({url:g.url})}));let e=[],n=[1/0,1/0,-1/0,-1/0];if(null==d?void 0:d.filter((t=>t.marker)).length){const i=[];for(const t of d.filter((t=>t.marker)).map((t=>t.marker))){const o=new Ct({geometry:new Hn(hn(t.lngLat)),icon:t.icon,marker:!0,id:t.id||void 0,popupHtml:t.popupHtml});i.push(o),e.push(t.lngLat),_.centerFromGeometries&&(n=Qt(n,o.getGeometry().getExtent()))}const o=new xo({image:new Br({scale:3,anchor:[.5,.8],src:"https://upload.wikimedia.org/wikipedia/commons/e/e7/Maki2-marker-18.svg"})}),r=new is({source:new xs({features:i}),style(t){const e=t.get("icon");let n;return(null==e?void 0:e.uri)?(n=new xo({image:new Br({scale:e.scale||.15,anchor:e.anchor||[.5,.8],src:e.uri})}),n):o}});t.push(r)}h=new Za({element:l,autoPan:{animation:{duration:250}}}),s=new Zl({target:a,layers:t,overlays:[h],view:new Oa({center:hn(f),zoom:p})}),_.centerFromGeometries&&e.length>1?s.getView().fit(n,{padding:[25,25,25,25]}):_.centerFromGeometries&&s.getView().setCenter(hn(e[0])),s.on("singleclick",(function(t){!function(t){const e=dn(t.coordinate,"EPSG:3857","EPSG:4326"),n=s.forEachFeatureAtPixel(t.pixel,(function(t,e){return t}));n&&n.get("marker")?(r("markerClick",{coordinates:{latitude:e[1],longitude:e[0]},id:n.get("id")}),n.get("popupHtml")&&(u.innerHTML=n.get("popupHtml"),h.setPosition(t.coordinate))):(h.setPosition(void 0),r("pointClickCoordinates",{coordinates:{latitude:e[1],longitude:e[0]}}))}(t)}))}}function x(t){var e,n;h.setPosition(void 0),null===(n=null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.blur)||void 0===n||n.call(e)}!function(t){y().$$.on_mount.push(t)}((()=>{a=i.shadowRoot.getElementById("map"),l=i.shadowRoot.getElementById("popup"),u=i.shadowRoot.getElementById("popup-content");const t=document.createElement("style");t.innerHTML=$u,a.appendChild(t),m()}));return t.$$set=t=>{"id"in t&&n(2,c=t.id),"zoom"in t&&n(3,p=t.zoom),"center"in t&&n(4,f=t.center),"data"in t&&n(5,d=t.data),"source"in t&&n(6,g=t.source),"options"in t&&n(7,_=t.options)},t.$$.update=()=>{252&t.$$.dirty&&(c||n(2,c=""),g?"string"==typeof g&&n(6,g=JSON.parse(g)):n(6,g={type:"osm"}),_?_&&"string"==typeof _&&n(7,_=JSON.parse(_)):n(7,_={}),p?"string"==typeof p&&n(3,p=Number(p)):n(3,p=6),f?"string"==typeof f&&n(4,f=JSON.parse(f)):n(4,f=[37.5176038,15.0819224]),d?"string"==typeof d&&n(5,d=JSON.parse(d)):n(5,d=[]),m())},[m,x,c,p,f,d,g,_,t=>x(t)]}class nh extends A{constructor(t){super(),this.shadowRoot.innerHTML="<style>:host{display:block;height:100%}</style>",L(this,{target:this.shadowRoot,props:d(this.attributes),customElement:!0},eh,th,r,{id:2,zoom:3,center:4,data:5,source:6,options:7},null),t&&(t.target&&a(t.target,this,t.anchor),t.props&&(this.$set(t.props),R()))}static get observedAttributes(){return["id","zoom","center","data","source","options"]}get id(){return this.$$.ctx[2]}set id(t){this.$$set({id:t}),R()}get zoom(){return this.$$.ctx[3]}set zoom(t){this.$$set({zoom:t}),R()}get center(){return this.$$.ctx[4]}set center(t){this.$$set({center:t}),R()}get data(){return this.$$.ctx[5]}set data(t){this.$$set({data:t}),R()}get source(){return this.$$.ctx[6]}set source(t){this.$$set({source:t}),R()}get options(){return this.$$.ctx[7]}set options(t){this.$$set({options:t}),R()}}return customElements.define("hb-map",nh),nh}();
2
2
  //# sourceMappingURL=release.js.map