text: !function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=11)}({0:function(t,e,i){"use strict";t.exports=o,t.exports.default=o;var n=i(10);function o(t,e){if(!(this instanceof o))return new o(t,e);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),e&&this._initFormat(e),this.clear()}function r(t,e,i){if(!i)return e.indexOf(t);for(var n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function s(t,e){a(t,0,t.children.length,e,t)}function a(t,e,i,n,o){o||(o=_(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(var r,s=e;s<i;s++)r=t.children[s],h(o,t.leaf?n(r):r);return o}function h(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 c(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(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 _(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,e,i,o,r){for(var s,a=[e,i];a.length;)(i=a.pop())-(e=a.pop())<=o||(s=e+Math.ceil((i-e)/o/2)*o,n(t,s,e,i,r),a.push(e,s,s,i))}o.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,i=[],n=this.toBBox;if(!f(t,e))return i;for(var o,r,s,a,h=[];e;){for(o=0,r=e.children.length;o<r;o++)s=e.children[o],f(t,a=e.leaf?n(s):s)&&(e.leaf?i.push(s):d(t,a)?this._all(s,i):h.push(s));e=h.pop()}return i},collides:function(t){var e=this.data,i=this.toBBox;if(!f(t,e))return!1;for(var n,o,r,s,a=[];e;){for(n=0,o=e.children.length;n<o;n++)if(r=e.children[n],f(t,s=e.leaf?i(r):r)){if(e.leaf||d(t,s))return!0;a.push(r)}e=a.pop()}return!1},load:function(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(var e=0,i=t.length;e<i;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 o=this.data;this.data=n,n=o}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=_([]),this},remove:function(t,e){if(!t)return this;for(var i,n,o,s,a=this.data,h=this.toBBox(t),l=[],u=[];a||l.length;){if(a||(a=l.pop(),n=l[l.length-1],i=u.pop(),s=!0),a.leaf&&-1!==(o=r(t,a.children,e)))return a.children.splice(o,1),l.push(a),this._condense(l),this;s||a.leaf||!d(a,h)?n?(i++,a=n.children[i],s=!1):a=null:(l.push(a),u.push(i),i=0,n=a,a=a.children[0])}return this},toBBox:function(t){return t},compareMinX:l,compareMinY:u,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,e){for(var i=[];t;)t.leaf?e.push.apply(e,t.children):i.push.apply(i,t.children),t=i.pop();return e},_build:function(t,e,i,n){var o,r=i-e+1,a=this._maxEntries;if(r<=a)return s(o=_(t.slice(e,i+1)),this.toBBox),o;n||(n=Math.ceil(Math.log(r)/Math.log(a)),a=Math.ceil(r/Math.pow(a,n-1))),(o=_([])).leaf=!1,o.height=n;var h,l,u,c,p=Math.ceil(r/a),d=p*Math.ceil(Math.sqrt(a));for(g(t,e,i,d,this.compareMinX),h=e;h<=i;h+=d)for(g(t,h,u=Math.min(h+d-1,i),p,this.compareMinY),l=h;l<=u;l+=p)c=Math.min(l+p-1,u),o.children.push(this._build(t,l,c,n-1));return s(o,this.toBBox),o},_chooseSubtree:function(t,e,i,n){for(var o,r,s,a,h,l,u,p,d,f;n.push(e),!e.leaf&&n.length-1!==i;){for(u=p=1/0,o=0,r=e.children.length;o<r;o++)h=c(s=e.children[o]),d=t,f=s,(l=(Math.max(f.maxX,d.maxX)-Math.min(f.minX,d.minX))*(Math.max(f.maxY,d.maxY)-Math.min(f.minY,d.minY))-h)<p?(p=l,u=h<u?h:u,a=s):l===p&&h<u&&(u=h,a=s);e=a||e.children[0]}return e},_insert:function(t,e,i){var n=this.toBBox,o=i?t:n(t),r=[],s=this._chooseSubtree(o,this.data,e,r);for(s.children.push(t),h(s,o);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(o,r,e)},_split:function(t,e){var i=t[e],n=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,n);var r=this._chooseSplitIndex(i,o,n),a=_(i.children.splice(r,i.children.length-r));a.height=i.height,a.leaf=i.leaf,s(i,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)},_splitRoot:function(t,e){this.data=_([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,i){var n,o,r,s,h,l,u,p,d,f,_,g,v,y;for(l=u=1/0,n=e;n<=i-e;n++)o=a(t,0,n,this.toBBox),r=a(t,n,i,this.toBBox),d=o,f=r,_=void 0,g=void 0,v=void 0,y=void 0,_=Math.max(d.minX,f.minX),g=Math.max(d.minY,f.minY),v=Math.min(d.maxX,f.maxX),y=Math.min(d.maxY,f.maxY),s=Math.max(0,v-_)*Math.max(0,y-g),h=c(o)+c(r),s<l?(l=s,p=n,u=h<u?h:u):s===l&&h<u&&(u=h,p=n);return p},_chooseSplitAxis:function(t,e,i){var n=t.leaf?this.compareMinX:l,o=t.leaf?this.compareMinY:u;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,o)&&t.children.sort(n)},_allDistMargin:function(t,e,i,n){t.children.sort(n);var o,r,s=this.toBBox,l=a(t,0,e,s),u=a(t,i-e,i,s),c=p(l)+p(u);for(o=e;o<i-e;o++)r=t.children[o],h(l,t.leaf?s(r):r),c+=p(l);for(o=i-e-1;o>=e;o--)r=t.children[o],h(u,t.leaf?s(r):r),c+=p(u);return c},_adjustParentBBoxes:function(t,e,i){for(var n=i;n>=0;n--)h(e[n],t)},_condense:function(t){for(var e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children).splice(e.indexOf(t[i]),1):this.clear():s(t[i],this.toBBox)},_initFormat:function(t){var e=["return a"," - b",";"];this.compareMinX=new Function("a","b",e.join(t[0])),this.compareMinY=new Function("a","b",e.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}},10:function(t,e,i){t.exports=function(){"use strict";function t(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function e(t,e){return t<e?-1:t>e?1:0}return function(i,n,o,r,s){!function e(i,n,o,r,s){for(;r>o;){if(r-o>600){var a=r-o+1,h=n-o+1,l=Math.log(a),u=.5*Math.exp(2*l/3),c=.5*Math.sqrt(l*u*(a-u)/a)*(h-a/2<0?-1:1),p=Math.max(o,Math.floor(n-h*u/a+c)),d=Math.min(r,Math.floor(n+(a-h)*u/a+c));e(i,n,p,d,s)}var f=i[n],_=o,g=r;for(t(i,o,n),s(i[r],f)>0&&t(i,o,r);_<g;){for(t(i,_,g),_++,g--;s(i[_],f)<0;)_++;for(;s(i[g],f)>0;)g--}0===s(i[o],f)?t(i,o,g):(g++,t(i,g,r)),g<=n&&(o=g+1),n<=g&&(r=g-1)}}(i,n,o||0,r||i.length-1,s||e)}}()},11:function(t,e,i){"use strict";function n(){return function(){throw new Error("Unimplemented abstract method.")}()}i.r(e);var o=0;function r(t){return t.ol_uid||(t.ol_uid=String(++o))}var s=function(t){function e(e){var i="Assertion failed. See https://openlayers.org/en/"+("v"+"5.3.3".split("-")[0])+"/doc/errors/#"+e+" for details.";t.call(this,i),this.code=e,this.name="AssertionError",this.message=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Error),a="add",h="remove",l="propertychange",u="function"==typeof Object.assign?Object.assign:function(t,e){var i=arguments;if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),o=1,r=arguments.length;o<r;++o){var s=i[o];if(null!=s)for(var a in s)s.hasOwnProperty(a)&&(n[a]=s[a])}return n};function c(t){for(var e in t)delete t[e]}function p(t){var e=[];for(var i in t)e.push(t[i]);return e}function d(t){var e;for(e in t)return!1;return!e}function f(t,e,i,n){for(var o,r=0,s=t.length;r<s;++r)if((o=t[r]).listener===e&&o.bindTo===i)return n&&(o.deleteIndex=r),o}function _(t,e){var i=g(t);return i?i[e]:void 0}function g(t,e){var i=t.ol_lm;return!i&&e&&(i=t.ol_lm={}),i}function v(t,e){var i=_(t,e);if(i){for(var n=0,o=i.length;n<o;++n)t.removeEventListener(e,i[n].boundListener),c(i[n]);i.length=0;var r=g(t);r&&(delete r[e],0===Object.keys(r).length&&function(t){delete t.ol_lm}(t))}}function y(t,e,i,n,o){var r=g(t,!0),s=r[e];s||(s=r[e]=[]);var a=f(s,i,n,!1);return a?o||(a.callOnce=!1):(a={bindTo:n,callOnce:!!o,listener:i,target:t,type:e},t.addEventListener(e,function(t){var e=function(e){var i=t.listener,n=t.bindTo||t.target;return t.callOnce&&S(t),i.call(n,e)};return t.boundListener=e,e}(a)),s.push(a)),a}function m(t,e,i,n){return y(t,e,i,n,!0)}function x(t,e,i,n){var o=_(t,e);if(o){var r=f(o,i,n,!0);r&&S(r)}}function S(t){if(t&&t.target){t.target.removeEventListener(t.type,t.boundListener);var e=_(t.target,t.type);if(e){var i="deleteIndex"in t?t.deleteIndex:e.indexOf(t);-1!==i&&e.splice(i,1),0===e.length&&v(t.target,t.type)}c(t)}}var C=function(){this.disposed_=!1};C.prototype.dispose=function(){this.disposed_||(this.disposed_=!0,this.disposeInternal())},C.prototype.disposeInternal=function(){};var E=C;function w(){return!0}function T(){return!1}function R(){}var b=function(t){this.propagationStopped,this.type=t,this.target=null};function I(t){t.stopPropagation()}b.prototype.preventDefault=function(){this.propagationStopped=!0},b.prototype.stopPropagation=function(){this.propagationStopped=!0};var F=b,M=function(t){function e(){t.call(this),this.pendingRemovals_={},this.dispatching_={},this.listeners_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addEventListener=function(t,e){var i=this.listeners_[t];i||(i=this.listeners_[t]=[]),-1===i.indexOf(e)&&i.push(e)},e.prototype.dispatchEvent=function(t){var e="string"==typeof t?new F(t):t,i=e.type;e.target=this;var n,o=this.listeners_[i];if(o){i in this.dispatching_||(this.dispatching_[i]=0,this.pendingRemovals_[i]=0),++this.dispatching_[i];for(var r=0,s=o.length;r<s;++r)if(!1===o[r].call(this,e)||e.propagationStopped){n=!1;break}if(--this.dispatching_[i],0===this.dispatching_[i]){var a=this.pendingRemovals_[i];for(delete this.pendingRemovals_[i];a--;)this.removeEventListener(i,R);delete this.dispatching_[i]}return n}},e.prototype.disposeInternal=function(){!function(t){var e=g(t);if(e)for(var i in e)v(t,i)}(this)},e.prototype.getListeners=function(t){return this.listeners_[t]},e.prototype.hasListener=function(t){return t?t in this.listeners_:Object.keys(this.listeners_).length>0},e.prototype.removeEventListener=function(t,e){var i=this.listeners_[t];if(i){var n=i.indexOf(e);t in this.pendingRemovals_?(i[n]=R,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t])}},e}(E),P="change",L="clear",k="contextmenu",O="click",D="dblclick",A="error",G="keydown",z="keypress",K="load",j="mousedown",X="mousemove",W="mouseup",Y="mousewheel",N="MSPointerDown",V="resize",B="touchstart",Z="wheel";var U=function(t){function e(){t.call(this),this.revision_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){++this.revision_,this.dispatchEvent(P)},e.prototype.getRevision=function(){return this.revision_},e.prototype.on=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o<i;++o)n[o]=y(this,t[o],e);return n}return y(this,t,e)},e.prototype.once=function(t,e){if(Array.isArray(t)){for(var i=t.length,n=new Array(i),o=0;o<i;++o)n[o]=m(this,t[o],e);return n}return m(this,t,e)},e.prototype.un=function(t,e){if(Array.isArray(t))for(var i=0,n=t.length;i<n;++i)x(this,t[i],e);else x(this,t,e)},e}(M),H=function(t){function e(e,i,n){t.call(this,e),this.key=i,this.oldValue=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(F),q={};function J(t){return q.hasOwnProperty(t)?q[t]:q[t]="change:"+t}var Q=function(t){function e(e){t.call(this),r(this),this.values_={},void 0!==e&&this.setProperties(e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.get=function(t){var e;return this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e},e.prototype.getKeys=function(){return Object.keys(this.values_)},e.prototype.getProperties=function(){return u({},this.values_)},e.prototype.notify=function(t,e){var i;i=J(t),this.dispatchEvent(new H(i,t,e)),i=l,this.dispatchEvent(new H(i,t,e))},e.prototype.set=function(t,e,i){if(i)this.values_[t]=e;else{var n=this.values_[t];this.values_[t]=e,n!==e&&this.notify(t,n)}},e.prototype.setProperties=function(t,e){for(var i in t)this.set(i,t[i],e)},e.prototype.unset=function(t,e){if(t in this.values_){var i=this.values_[t];delete this.values_[t],e||this.notify(t,i)}},e}(U),$="length",tt=function(t){function e(e,i){t.call(this,e),this.element=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(F),et=function(t){function e(e,i){t.call(this);var n=i||{};if(this.unique_=!!n.unique,this.array_=e||[],this.unique_)for(var o=0,r=this.array_.length;o<r;++o)this.assertUnique_(this.array_[o],o);this.updateLength_()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clear=function(){for(;this.getLength()>0;)this.pop()},e.prototype.extend=function(t){for(var e=0,i=t.length;e<i;++e)this.push(t[e]);return this},e.prototype.forEach=function(t){for(var e=this.array_,i=0,n=e.length;i<n;++i)t(e[i],i,e)},e.prototype.getArray=function(){return this.array_},e.prototype.item=function(t){return this.array_[t]},e.prototype.getLength=function(){return this.get($)},e.prototype.insertAt=function(t,e){this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new tt(a,e))},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_,i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)},e.prototype.removeAt=function(t){var e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new tt(h,e)),e},e.prototype.setAt=function(t,e){var i=this.getLength();if(t<i){this.unique_&&this.assertUnique_(e,t);var n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new tt(h,n)),this.dispatchEvent(new tt(a,e))}else{for(var o=i;o<t;++o)this.insertAt(o,void 0);this.insertAt(t,e)}},e.prototype.updateLength_=function(){this.set($,this.array_.length)},e.prototype.assertUnique_=function(t,e){for(var i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new s(58)},e}(Q),it=function(t){function e(e,i,n){t.call(this,e),this.map=i,this.frameState=void 0!==n?n:null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(F),nt=function(t){function e(e,i,n,o,r){t.call(this,e,i,r),this.originalEvent=n,this.pixel=i.getEventPixel(n),this.coordinate=i.getCoordinateFromPixel(this.pixel),this.dragging=void 0!==o&&o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.preventDefault=function(){t.prototype.preventDefault.call(this),this.originalEvent.preventDefault()},e.prototype.stopPropagation=function(){t.prototype.stopPropagation.call(this),this.originalEvent.stopPropagation()},e}(it),ot="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",rt=-1!==ot.indexOf("firefox"),st=-1!==ot.indexOf("safari")&&-1==ot.indexOf("chrom"),at=-1!==ot.indexOf("webkit")&&-1==ot.indexOf("edge"),ht=-1!==ot.indexOf("macintosh"),lt=window.devicePixelRatio||1,ut=function(){var t=!1;try{t=!!document.createElement("canvas").getContext("2d").setLineDash}catch(t){}return t}(),ct=(navigator,"ontouchstart"in window),pt="PointerEvent"in window,dt=!!navigator.msPointerEnabled,ft={SINGLECLICK:"singleclick",CLICK:O,DBLCLICK:D,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},_t=function(t){function e(e,i,n,o,r){t.call(this,e,i,n.originalEvent,o,r),this.pointerEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(nt),gt="pointermove",vt="pointerdown",yt="pointerup",mt="pointerover",xt="pointerout",St="pointerenter",Ct="pointerleave",Et="pointercancel",wt=function(t,e){this.dispatcher=t,this.mapping_=e};wt.prototype.getEvents=function(){return Object.keys(this.mapping_)},wt.prototype.getHandlerForEvent=function(t){return this.mapping_[t]};var Tt=wt;function Rt(t){if(!this.isEventSimulatedFromTouch_(t)){1..toString()in this.pointerMap&&this.cancel(t);var e=Pt(t,this.dispatcher);this.pointerMap[1..toString()]=t,this.dispatcher.down(e,t)}}function bt(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Pt(t,this.dispatcher);this.dispatcher.move(e,t)}}function It(t){if(!this.isEventSimulatedFromTouch_(t)){var e=this.pointerMap[1..toString()];if(e&&e.button===t.button){var i=Pt(t,this.dispatcher);this.dispatcher.up(i,t),this.cleanupMouse()}}}function Ft(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Pt(t,this.dispatcher);this.dispatcher.enterOver(e,t)}}function Mt(t){if(!this.isEventSimulatedFromTouch_(t)){var e=Pt(t,this.dispatcher);this.dispatcher.leaveOut(e,t)}}function Pt(t,e){var i=e.cloneEvent(t,t),n=i.preventDefault;return i.preventDefault=function(){t.preventDefault(),n()},i.pointerId=1,i.isPrimary=!0,i.pointerType="mouse",i}var Lt=function(t){function e(e){var i={mousedown:Rt,mousemove:bt,mouseup:It,mouseover:Ft,mouseout:Mt};t.call(this,e,i),this.pointerMap=e.pointerMap,this.lastTouches=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isEventSimulatedFromTouch_=function(t){for(var e=this.lastTouches,i=t.clientX,n=t.clientY,o=0,r=e.length,s=void 0;o<r&&(s=e[o]);o++){var a=Math.abs(i-s[0]),h=Math.abs(n-s[1]);if(a<=25&&h<=25)return!0}return!1},e.prototype.cancel=function(t){var e=Pt(t,this.dispatcher);this.dispatcher.cancel(e,t),this.cleanupMouse()},e.prototype.cleanupMouse=function(){delete this.pointerMap[1..toString()]},e}(Tt),kt=["","unavailable","touch","pen","mouse"];function Ot(t){this.pointerMap[t.pointerId.toString()]=t;var e=this.prepareEvent_(t);this.dispatcher.down(e,t)}function Dt(t){var e=this.prepareEvent_(t);this.dispatcher.move(e,t)}function At(t){var e=this.prepareEvent_(t);this.dispatcher.up(e,t),this.cleanup(t.pointerId)}function Gt(t){var e=this.prepareEvent_(t);this.dispatcher.leaveOut(e,t)}function zt(t){var e=this.prepareEvent_(t);this.dispatcher.enterOver(e,t)}function Kt(t){var e=this.prepareEvent_(t);this.dispatcher.cancel(e,t),this.cleanup(t.pointerId)}function jt(t){var e=this.dispatcher.makeEvent("lostpointercapture",t,t);this.dispatcher.dispatchEvent(e)}function Xt(t){var e=this.dispatcher.makeEvent("gotpointercapture",t,t);this.dispatcher.dispatchEvent(e)}var Wt=function(t){function e(e){var i={MSPointerDown:Ot,MSPointerMove:Dt,MSPointerUp:At,MSPointerOut:Gt,MSPointerOver:zt,MSPointerCancel:Kt,MSGotPointerCapture:Xt,MSLostPointerCapture:jt};t.call(this,e,i),this.pointerMap=e.pointerMap}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.prepareEvent_=function(t){var e=t;return"number"==typeof t.pointerType&&((e=this.dispatcher.cloneEvent(t,t)).pointerType=kt[t.pointerType]),e},e.prototype.cleanup=function(t){delete this.pointerMap[t.toString()]},e}(Tt);function Yt(t){this.dispatcher.fireNativeEvent(t)}function Nt(t){this.dispatcher.fireNativeEvent(t)}function Vt(t){this.dispatcher.fireNativeEvent(t)}function Bt(t){this.dispatcher.fireNativeEvent(t)}function Zt(t){this.dispatcher.fireNativeEvent(t)}function Ut(t){this.dispatcher.fireNativeEvent(t)}function Ht(t){this.dispatcher.fireNativeEvent(t)}function qt(t){this.dispatcher.fireNativeEvent(t)}var Jt=function(t){function e(e){var i={pointerdown:Yt,pointermove:Nt,pointerup:Vt,pointerout:Bt,pointerover:Zt,pointercancel:Ut,gotpointercapture:qt,lostpointercapture:Ht};t.call(this,e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(Tt),Qt=!1,$t=function(t){function e(e,i,n){t.call(this,e),this.originalEvent=i;var o=n||{};this.buttons=function(t){var e;if(t.buttons||Qt)e=t.buttons;else switch(t.which){case 1:e=1;break;case 2:e=4;break;case 3:e=2;break;default:e=0}return e}(o),this.pressure=function(t,e){var i=0;i=t.pressure?t.pressure:e?.5:0;return i}(o,this.buttons),this.bubbles="bubbles"in o&&o.bubbles,this.cancelable="cancelable"in o&&o.cancelable,this.view="view"in o?o.view:null,this.detail="detail"in o?o.detail:null,this.screenX="screenX"in o?o.screenX:0,this.screenY="screenY"in o?o.screenY:0,this.clientX="clientX"in o?o.clientX:0,this.clientY="clientY"in o?o.clientY:0,this.ctrlKey="ctrlKey"in o&&o.ctrlKey,this.altKey="altKey"in o&&o.altKey,this.shiftKey="shiftKey"in o&&o.shiftKey,this.metaKey="metaKey"in o&&o.metaKey,this.button="button"in o?o.button:0,this.relatedTarget="relatedTarget"in o?o.relatedTarget:null,this.pointerId="pointerId"in o?o.pointerId:0,this.width="width"in o?o.width:0,this.height="height"in o?o.height:0,this.tiltX="tiltX"in o?o.tiltX:0,this.tiltY="tiltY"in o?o.tiltY:0,this.pointerType="pointerType"in o?o.pointerType:"",this.hwTimestamp="hwTimestamp"in o?o.hwTimestamp:0,this.isPrimary="isPrimary"in o&&o.isPrimary,i.preventDefault&&(this.preventDefault=function(){i.preventDefault()})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(F);!function(){try{var t=new MouseEvent("click",{buttons:1});Qt=1===t.buttons}catch(t){}}();var te=$t;function ee(t,e){return t>e?1:t<e?-1:0}function ie(t,e,i){var n,o=t.length;if(t[0]<=e)return 0;if(e<=t[o-1])return o-1;if(i>0){for(n=1;n<o;++n)if(t[n]<e)return n-1}else if(i<0){for(n=1;n<o;++n)if(t[n]<=e)return n}else for(n=1;n<o;++n){if(t[n]==e)return n;if(t[n]<e)return t[n-1]-e<e-t[n]?n-1:n}return o-1}function ne(t,e,i){for(;e<i;){var n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function oe(t,e){for(var i=Array.isArray(e)?e:[e],n=i.length,o=0;o<n;o++)t[t.length]=i[o]}function re(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function se(t){this.vacuumTouches_(t),this.setPrimaryTouch_(t.changedTouches[0]),this.dedupSynthMouse_(t),this.clickCount_++,this.processTouches_(t,this.overDown_)}function ae(t){this.processTouches_(t,this.moveOverOut_)}function he(t){this.dedupSynthMouse_(t),this.processTouches_(t,this.upOut_)}function le(t){this.processTouches_(t,this.cancelOut_)}var ue=function(t){function e(e,i){var n={touchstart:se,touchmove:ae,touchend:he,touchcancel:le};t.call(this,e,n),this.pointerMap=e.pointerMap,this.mouseSource=i,this.firstTouchId_=void 0,this.clickCount_=0,this.resetId_,this.dedupTimeout_=2500}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isPrimaryTouch_=function(t){return this.firstTouchId_===t.identifier},e.prototype.setPrimaryTouch_=function(t){var e=Object.keys(this.pointerMap).length;(0===e||1===e&&1..toString()in this.pointerMap)&&(this.firstTouchId_=t.identifier,this.cancelResetClickCount_())},e.prototype.removePrimaryPointer_=function(t){t.isPrimary&&(this.firstTouchId_=void 0,this.resetClickCount_())},e.prototype.resetClickCount_=function(){this.resetId_=setTimeout(this.resetClickCountHandler_.bind(this),200)},e.prototype.resetClickCountHandler_=function(){this.clickCount_=0,this.resetId_=void 0},e.prototype.cancelResetClickCount_=function(){void 0!==this.resetId_&&clearTimeout(this.resetId_)},e.prototype.touchToPointer_=function(t,e){var i=this.dispatcher.cloneEvent(t,e);return i.pointerId=e.identifier+2,i.bubbles=!0,i.cancelable=!0,i.detail=this.clickCount_,i.button=0,i.buttons=1,i.width=e.radiusX||0,i.height=e.radiusY||0,i.pressure=e.force||.5,i.isPrimary=this.isPrimaryTouch_(e),i.pointerType="touch",i.clientX=e.clientX,i.clientY=e.clientY,i.screenX=e.screenX,i.screenY=e.screenY,i},e.prototype.processTouches_=function(t,e){var i=Array.prototype.slice.call(t.changedTouches),n=i.length;function o(){t.preventDefault()}for(var r=0;r<n;++r){var s=this.touchToPointer_(t,i[r]);s.preventDefault=o,e.call(this,t,s)}},e.prototype.findTouch_=function(t,e){for(var i=t.length,n=0;n<i;n++){if(t[n].identifier===e)return!0}return!1},e.prototype.vacuumTouches_=function(t){var e=t.touches,i=Object.keys(this.pointerMap),n=i.length;if(n>=e.length){for(var o=[],r=0;r<n;++r){var s=Number(i[r]),a=this.pointerMap[s];1==s||this.findTouch_(e,s-2)||o.push(a.out)}for(var h=0;h<o.length;++h)this.cancelOut_(t,o[h])}},e.prototype.overDown_=function(t,e){this.pointerMap[e.pointerId]={target:e.target,out:e,outTarget:e.target},this.dispatcher.over(e,t),this.dispatcher.enter(e,t),this.dispatcher.down(e,t)},e.prototype.moveOverOut_=function(t,e){var i=e,n=this.pointerMap[i.pointerId];if(n){var o=n.out,r=n.outTarget;this.dispatcher.move(i,t),o&&r!==i.target&&(o.relatedTarget=i.target,i.relatedTarget=r,o.target=r,i.target?(this.dispatcher.leaveOut(o,t),this.dispatcher.enterOver(i,t)):(i.target=r,i.relatedTarget=null,this.cancelOut_(t,i))),n.out=i,n.outTarget=i.target}},e.prototype.upOut_=function(t,e){this.dispatcher.up(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},e.prototype.cancelOut_=function(t,e){this.dispatcher.cancel(e,t),this.dispatcher.out(e,t),this.dispatcher.leave(e,t),this.cleanUpPointer_(e)},e.prototype.cleanUpPointer_=function(t){delete this.pointerMap[t.pointerId],this.removePrimaryPointer_(t)},e.prototype.dedupSynthMouse_=function(t){var e=this.mouseSource.lastTouches,i=t.changedTouches[0];if(this.isPrimaryTouch_(i)){var n=[i.clientX,i.clientY];e.push(n),setTimeout((function(){var t,i,o;i=n,o=(t=e).indexOf(i),o>-1&&t.splice(o,1)}),this.dedupTimeout_)}},e}(Tt),ce=[["bubbles",!1],["cancelable",!1],["view",null],["detail",null],["screenX",0],["screenY",0],["clientX",0],["clientY",0],["ctrlKey",!1],["altKey",!1],["shiftKey",!1],["metaKey",!1],["button",0],["relatedTarget",null],["buttons",0],["pointerId",0],["width",0],["height",0],["pressure",0],["tiltX",0],["tiltY",0],["pointerType",""],["hwTimestamp",0],["isPrimary",!1],["type",""],["target",null],["currentTarget",null],["which",0]],pe=function(t){function e(e){t.call(this),this.element_=e,this.pointerMap={},this.eventMap_={},this.eventSourceList_=[],this.registerSources()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.registerSources=function(){if(pt)this.registerSource("native",new Jt(this));else if(dt)this.registerSource("ms",new Wt(this));else{var t=new Lt(this);this.registerSource("mouse",t),ct&&this.registerSource("touch",new ue(this,t))}this.register_()},e.prototype.registerSource=function(t,e){var i=e,n=i.getEvents();n&&(n.forEach(function(t){var e=i.getHandlerForEvent(t);e&&(this.eventMap_[t]=e.bind(i))}.bind(this)),this.eventSourceList_.push(i))},e.prototype.register_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.addEvents_(i.getEvents())}},e.prototype.unregister_=function(){for(var t=this.eventSourceList_.length,e=0;e<t;e++){var i=this.eventSourceList_[e];this.removeEvents_(i.getEvents())}},e.prototype.eventHandler_=function(t){var e=t.type,i=this.eventMap_[e];i&&i(t)},e.prototype.addEvents_=function(t){t.forEach(function(t){y(this.element_,t,this.eventHandler_,this)}.bind(this))},e.prototype.removeEvents_=function(t){t.forEach(function(t){x(this.element_,t,this.eventHandler_,this)}.bind(this))},e.prototype.cloneEvent=function(t,e){for(var i={},n=0,o=ce.length;n<o;n++){var r=ce[n][0];i[r]=t[r]||e[r]||ce[n][1]}return i},e.prototype.down=function(t,e){this.fireEvent(vt,t,e)},e.prototype.move=function(t,e){this.fireEvent(gt,t,e)},e.prototype.up=function(t,e){this.fireEvent(yt,t,e)},e.prototype.enter=function(t,e){t.bubbles=!1,this.fireEvent(St,t,e)},e.prototype.leave=function(t,e){t.bubbles=!1,this.fireEvent(Ct,t,e)},e.prototype.over=function(t,e){t.bubbles=!0,this.fireEvent(mt,t,e)},e.prototype.out=function(t,e){t.bubbles=!0,this.fireEvent(xt,t,e)},e.prototype.cancel=function(t,e){this.fireEvent(Et,t,e)},e.prototype.leaveOut=function(t,e){this.out(t,e),this.contains_(t.target,t.relatedTarget)||this.leave(t,e)},e.prototype.enterOver=function(t,e){this.over(t,e),this.contains_(t.target,t.relatedTarget)||this.enter(t,e)},e.prototype.contains_=function(t,e){return!(!t||!e)&&t.contains(e)},e.prototype.makeEvent=function(t,e,i){return new te(t,i,e)},e.prototype.fireEvent=function(t,e,i){var n=this.makeEvent(t,e,i);this.dispatchEvent(n)},e.prototype.fireNativeEvent=function(t){var e=this.makeEvent(t.type,t,t);this.dispatchEvent(e)},e.prototype.wrapMouseEvent=function(t,e){return this.makeEvent(t,Pt(e,this),e)},e.prototype.disposeInternal=function(){this.unregister_(),t.prototype.disposeInternal.call(this)},e}(M),de=function(t){function e(e,i){t.call(this),this.map_=e,this.clickTimeoutId_,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=i?i*lt:lt,this.down_=null;var n=this.map_.getViewport();this.activePointers_=0,this.trackedTouches_={},this.pointerEventHandler_=new pe(n),this.documentPointerEventHandler_=null,this.pointerdownListenerKey_=y(this.pointerEventHandler_,vt,this.handlePointerDown_,this),this.relayedListenerKey_=y(this.pointerEventHandler_,gt,this.relayEvent_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.emulateClick_=function(t){var e=new _t(ft.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new _t(ft.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;var e=new _t(ft.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)},e.prototype.updateActivePointers_=function(t){var e=t;e.type==ft.POINTERUP||e.type==ft.POINTERCANCEL?delete this.trackedTouches_[e.pointerId]:e.type==ft.POINTERDOWN&&(this.trackedTouches_[e.pointerId]=!0),this.activePointers_=Object.keys(this.trackedTouches_).length},e.prototype.handlePointerUp_=function(t){this.updateActivePointers_(t);var e=new _t(ft.POINTERUP,this.map_,t);this.dispatchEvent(e),e.propagationStopped||this.dragging_||!this.isMouseActionButton_(t)||this.emulateClick_(this.down_),0===this.activePointers_&&(this.dragListenerKeys_.forEach(S),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null,this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null)},e.prototype.isMouseActionButton_=function(t){return 0===t.button},e.prototype.handlePointerDown_=function(t){this.updateActivePointers_(t);var e=new _t(ft.POINTERDOWN,this.map_,t);this.dispatchEvent(e),this.down_=t,0===this.dragListenerKeys_.length&&(this.documentPointerEventHandler_=new pe(document),this.dragListenerKeys_.push(y(this.documentPointerEventHandler_,ft.POINTERMOVE,this.handlePointerMove_,this),y(this.documentPointerEventHandler_,ft.POINTERUP,this.handlePointerUp_,this),y(this.pointerEventHandler_,ft.POINTERCANCEL,this.handlePointerUp_,this)))},e.prototype.handlePointerMove_=function(t){if(this.isMoving_(t)){this.dragging_=!0;var e=new _t(ft.POINTERDRAG,this.map_,t,this.dragging_);this.dispatchEvent(e)}t.preventDefault()},e.prototype.relayEvent_=function(t){var e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new _t(t.type,this.map_,t,e))},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_&&(S(this.relayedListenerKey_),this.relayedListenerKey_=null),this.pointerdownListenerKey_&&(S(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(S),this.dragListenerKeys_.length=0,this.documentPointerEventHandler_&&(this.documentPointerEventHandler_.dispose(),this.documentPointerEventHandler_=null),this.pointerEventHandler_&&(this.pointerEventHandler_.dispose(),this.pointerEventHandler_=null),t.prototype.disposeInternal.call(this)},e}(M),fe="postrender",_e="movestart",ge="moveend",ve="layergroup",ye="size",me="target",xe="view",Se="postcompose",Ce="precompose",Ee="render",we="rendercomplete",Te=0,Re=1,be=2,Ie=3,Fe=4,Me=5;function Pe(t,e){if(!t)throw new s(e)}var Le=function(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}};Le.prototype.clear=function(){this.elements_.length=0,this.priorities_.length=0,c(this.queuedElements_)},Le.prototype.dequeue=function(){var t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));var n=this.keyFunction_(i);return delete this.queuedElements_[n],i},Le.prototype.enqueue=function(t){Pe(!(this.keyFunction_(t)in this.queuedElements_),31);var e=this.priorityFunction_(t);return e!=1/0&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)},Le.prototype.getCount=function(){return this.elements_.length},Le.prototype.getLeftChildIndex_=function(t){return 2*t+1},Le.prototype.getRightChildIndex_=function(t){return 2*t+2},Le.prototype.getParentIndex_=function(t){return t-1>>1},Le.prototype.heapify_=function(){var t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)},Le.prototype.isEmpty=function(){return 0===this.elements_.length},Le.prototype.isKeyQueued=function(t){return t in this.queuedElements_},Le.prototype.isQueued=function(t){return this.isKeyQueued(this.keyFunction_(t))},Le.prototype.siftUp_=function(t){for(var e=this.elements_,i=this.priorities_,n=e.length,o=e[t],r=i[t],s=t;t<n>>1;){var a=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),l=h<n&&i[h]<i[a]?h:a;e[t]=e[l],i[t]=i[l],t=l}e[t]=o,i[t]=r,this.siftDown_(s,t)},Le.prototype.siftDown_=function(t,e){for(var i=this.elements_,n=this.priorities_,o=i[e],r=n[e];e>t;){var s=this.getParentIndex_(e);if(!(n[s]>r))break;i[e]=i[s],n[e]=n[s],e=s}i[e]=o,n[e]=r},Le.prototype.reprioritize=function(){var t,e,i,n=this.priorityFunction_,o=this.elements_,r=this.priorities_,s=0,a=o.length;for(e=0;e<a;++e)(i=n(t=o[e]))==1/0?delete this.queuedElements_[this.keyFunction_(t)]:(r[s]=i,o[s++]=t);o.length=s,r.length=s,this.heapify_()};var ke=function(t){function e(e,i){t.call(this,(function(t){return e.apply(null,t)}),(function(t){return t[0].getKey()})),this.tileChangeCallback_=i,this.tilesLoading_=0,this.tilesLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.enqueue=function(e){var i=t.prototype.enqueue.call(this,e);i&&y(e[0],P,this.handleTileChange,this);return i},e.prototype.getTilesLoading=function(){return this.tilesLoading_},e.prototype.handleTileChange=function(t){var e=t.target,i=e.getState();if(i===be||i===Ie||i===Fe||i===Me){x(e,P,this.handleTileChange,this);var n=e.getKey();n in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[n],--this.tilesLoading_),this.tileChangeCallback_()}},e.prototype.loadMoreTiles=function(t,e){for(var i,n,o,r=0,s=!1;this.tilesLoading_<t&&r<e&&this.getCount()>0;)o=(n=this.dequeue()[0]).getKey(),(i=n.getState())===Me?s=!0:i!==Te||o in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[o]=!0,++this.tilesLoading_,++r,n.load());0===r&&s&&this.tileChangeCallback_()},e}(Le);function Oe(t,e,i){return Math.min(Math.max(t,e),i)}var De="cosh"in Math?Math.cosh:function(t){var e=Math.exp(t);return(e+1/e)/2};function Ae(t,e,i,n,o,r){var s=o-i,a=r-n;if(0!==s||0!==a){var h=((t-i)*s+(e-n)*a)/(s*s+a*a);h>1?(i=o,n=r):h>0&&(i+=s*h,n+=a*h)}return Ge(t,e,i,n)}function Ge(t,e,i,n){var o=i-t,r=n-e;return o*o+r*r}function ze(t){return t*Math.PI/180}function Ke(t,e){var i=t%e;return i*e<0?i+e:i}function je(t,e,i){return t+i*(e-t)}function Xe(t){return t}function We(t,e){return void 0!==t?0:void 0}function Ye(t,e){return void 0!==t?t+e:void 0}var Ne=0,Ve=1,Be="center",Ze="resolution",Ue="rotation";function He(t,e){return t[0]+=e[0],t[1]+=e[1],t}function qe(t,e){var i=Math.cos(e),n=Math.sin(e),o=t[0]*i-t[1]*n,r=t[1]*i+t[0]*n;return t[0]=o,t[1]=r,t}function Je(t,e){return t[0]*=e,t[1]*=e,t}function Qe(t){return Math.pow(t,3)}function $e(t){return 1-Qe(1-t)}function ti(t){return 3*t*t-2*t*t*t}function ei(t){return t}var ii="bottom-left",ni="bottom-right",oi="top-left",ri="top-right",si=0,ai=1,hi=2,li=4,ui=8,ci=16;function pi(t){for(var e=xi(),i=0,n=t.length;i<n;++i)Ti(e,t[i]);return e}function di(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function fi(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function _i(t,e,i){var n,o;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(o=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*o}function gi(t,e){return yi(t,e[0],e[1])}function vi(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function yi(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function mi(t,e){var i=t[0],n=t[1],o=t[2],r=t[3],s=e[0],a=e[1],h=si;return s<i?h|=ci:s>o&&(h|=li),a<n?h|=ui:a>r&&(h|=hi),h===si&&(h=ai),h}function xi(){return[1/0,1/0,-1/0,-1/0]}function Si(t,e,i,n,o){return o?(o[0]=t,o[1]=e,o[2]=i,o[3]=n,o):[t,e,i,n]}function Ci(t){return Si(1/0,1/0,-1/0,-1/0,t)}function Ei(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function wi(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 Ti(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 Ri(t,e){for(var i=0,n=e.length;i<n;++i)Ti(t,e[i]);return t}function bi(t,e,i,n,o){for(;i<n;i+=o)Ii(t,e[i],e[i+1]);return t}function Ii(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function Fi(t){var e=0;return Xi(t)||(e=Ki(t)*Di(t)),e}function Mi(t){return[t[0],t[1]]}function Pi(t){return[t[2],t[1]]}function Li(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function ki(t,e){var i;return e===ii?i=Mi(t):e===ni?i=Pi(t):e===oi?i=Gi(t):e===ri?i=zi(t):Pe(!1,13),i}function Oi(t,e,i,n,o){var r=e*n[0]/2,s=e*n[1]/2,a=Math.cos(i),h=Math.sin(i),l=r*a,u=r*h,c=s*a,p=s*h,d=t[0],f=t[1],_=d-l+p,g=d-l-p,v=d+l-p,y=d+l+p,m=f-u-c,x=f-u+c,S=f+u+c,C=f+u-c;return Si(Math.min(_,g,v,y),Math.min(m,x,S,C),Math.max(_,g,v,y),Math.max(m,x,S,C),o)}function Di(t){return t[3]-t[1]}function Ai(t,e,i){var n=i||[1/0,1/0,-1/0,-1/0];return ji(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):Ci(n),n}function Gi(t){return[t[0],t[3]]}function zi(t){return[t[2],t[3]]}function Ki(t){return t[2]-t[0]}function ji(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Xi(t){return t[2]<t[0]||t[3]<t[1]}function Wi(t,e){var i=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=n,t[3]+=n}var Yi="Point",Ni="LineString",Vi="LinearRing",Bi="Polygon",Zi="MultiPoint",Ui="MultiLineString",Hi="MultiPolygon",qi="GeometryCollection",Ji="Circle",Qi="XY",$i="XYZ",tn="XYM",en="XYZM";function nn(t,e,i,n,o,r){for(var s=r||[],a=0,h=e;h<i;h+=n){var l=t[h],u=t[h+1];s[a++]=o[0]*l+o[2]*u+o[4],s[a++]=o[1]*l+o[3]*u+o[5]}return r&&s.length!=a&&(s.length=a),s}function on(t,e,i){var n=i||6371008.8,o=ze(t[1]),r=ze(e[1]),s=(r-o)/2,a=ze(e[0]-t[0])/2,h=Math.sin(s)*Math.sin(s)+Math.sin(a)*Math.sin(a)*Math.cos(o)*Math.cos(r);return 2*n*Math.atan2(Math.sqrt(h),Math.sqrt(1-h))}var rn={DEGREES:"degrees",FEET:"ft",METERS:"m",PIXELS:"pixels",TILE_PIXELS:"tile-pixels",USFEET:"us-ft"},sn={};sn[rn.DEGREES]=2*Math.PI*6370997/360,sn[rn.FEET]=.3048,sn[rn.METERS]=1,sn[rn.USFEET]=1200/3937;var an=rn,hn=function(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};hn.prototype.canWrapX=function(){return this.canWrapX_},hn.prototype.getCode=function(){return this.code_},hn.prototype.getExtent=function(){return this.extent_},hn.prototype.getUnits=function(){return this.units_},hn.prototype.getMetersPerUnit=function(){return this.metersPerUnit_||sn[this.units_]},hn.prototype.getWorldExtent=function(){return this.worldExtent_},hn.prototype.getAxisOrientation=function(){return this.axisOrientation_},hn.prototype.isGlobal=function(){return this.global_},hn.prototype.setGlobal=function(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)},hn.prototype.getDefaultTileGrid=function(){return this.defaultTileGrid_},hn.prototype.setDefaultTileGrid=function(t){this.defaultTileGrid_=t},hn.prototype.setExtent=function(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)},hn.prototype.setWorldExtent=function(t){this.worldExtent_=t},hn.prototype.setGetPointResolution=function(t){this.getPointResolutionFunc_=t},hn.prototype.getPointResolutionFunc=function(){return this.getPointResolutionFunc_};var ln=hn,un=6378137*Math.PI,cn=[-un,-un,un,un],pn=[-180,-85,180,85],dn=function(t){function e(e){t.call(this,{code:e,units:an.METERS,extent:cn,global:!0,worldExtent:pn,getPointResolution:function(t,e){return t/De(e[1]/6378137)}})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ln),fn=[new dn("EPSG:3857"),new dn("EPSG:102100"),new dn("EPSG:102113"),new dn("EPSG:900913"),new dn("urn:ogc:def:crs:EPSG:6.18:3:3857"),new dn("urn:ogc:def:crs:EPSG::3857"),new dn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function _n(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=un,a=0;a<n;a+=o){r[a]=s*t[a]/180;var h=6378137*Math.log(Math.tan(Math.PI*(t[a+1]+90)/360));h>s?h=s:h<-s&&(h=-s),r[a+1]=h}return r}function gn(t,e,i){var n=t.length,o=i>1?i:2,r=e;void 0===r&&(r=o>2?t.slice():new Array(n));for(var s=0;s<n;s+=o)r[s]=180*t[s]/un,r[s+1]=360*Math.atan(Math.exp(t[s+1]/6378137))/Math.PI-90;return r}var vn=[-180,-90,180,90],yn=6378137*Math.PI/180,mn=function(t){function e(e,i){t.call(this,{code:e,units:an.DEGREES,extent:vn,axisOrientation:i,global:!0,metersPerUnit:yn,worldExtent:vn})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(ln),xn=[new mn("CRS:84"),new mn("EPSG:4326","neu"),new mn("urn:ogc:def:crs:EPSG::4326","neu"),new mn("urn:ogc:def:crs:EPSG:6.6:4326","neu"),new mn("urn:ogc:def:crs:OGC:1.3:CRS84"),new mn("urn:ogc:def:crs:OGC:2:84"),new mn("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new mn("urn:x-ogc:def:crs:EPSG:4326","neu")],Sn={};var Cn,En,wn,Tn={};function Rn(t,e,i){var n=t.getCode(),o=e.getCode();n in Tn||(Tn[n]={}),Tn[n][o]=i}function bn(t,e,i){var n;if(void 0!==e){for(var o=0,r=t.length;o<r;++o)e[o]=t[o];n=e}else n=t.slice();return n}function In(t,e,i){if(void 0!==e&&t!==e){for(var n=0,o=t.length;n<o;++n)e[n]=t[n];t=e}return t}function Fn(t){!function(t,e){Sn[t]=e}(t.getCode(),t),Rn(t,t,bn)}function Mn(t){return"string"==typeof t?Sn[t]||null:t||null}function Pn(t,e,i,n){var o,r=(t=Mn(t)).getPointResolutionFunc();if(r)o=r(e,i);else if(t.getUnits()==an.DEGREES&&!n||n==an.DEGREES)o=e;else{var s=An(t,Mn("EPSG:4326")),a=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];o=(on((a=s(a,a,2)).slice(0,2),a.slice(2,4))+on(a.slice(4,6),a.slice(6,8)))/2;var h=n?sn[n]:t.getMetersPerUnit();void 0!==h&&(o/=h)}return o}function Ln(t){!function(t){t.forEach(Fn)}(t),t.forEach((function(e){t.forEach((function(t){e!==t&&Rn(e,t,bn)}))}))}function kn(t,e){return t?"string"==typeof t?Mn(t):t:Mn(e)}function On(t,e){return zn(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function Dn(t,e){if(t===e)return!0;var i=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||An(t,e)===bn)&&i}function An(t,e){var i=function(t,e){var i;return t in Tn&&e in Tn[t]&&(i=Tn[t][e]),i}(t.getCode(),e.getCode());return i||(i=In),i}function Gn(t,e){return An(Mn(t),Mn(e))}function zn(t,e,i){return Gn(e,i)(t,void 0,t.length)}Ln(fn),Ln(xn),Cn=fn,En=_n,wn=gn,xn.forEach((function(t){Cn.forEach((function(e){Rn(t,e,En),Rn(e,t,wn)}))}));var Kn=new Array(6);function jn(t){return Wn(t,1,0,0,1,0,0)}function Xn(t,e){var i=t[0],n=t[1],o=t[2],r=t[3],s=t[4],a=t[5],h=e[0],l=e[1],u=e[2],c=e[3],p=e[4],d=e[5];return t[0]=i*h+o*l,t[1]=n*h+r*l,t[2]=i*u+o*c,t[3]=n*u+r*c,t[4]=i*p+o*d+s,t[5]=n*p+r*d+a,t}function Wn(t,e,i,n,o,r,s){return t[0]=e,t[1]=i,t[2]=n,t[3]=o,t[4]=r,t[5]=s,t}function Yn(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Nn(t,e){var i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function Vn(t,e,i){return Xn(t,Wn(Kn,e,0,0,i,0,0))}function Bn(t,e,i){return Xn(t,Wn(Kn,1,0,0,1,e,i))}function Zn(t,e,i,n,o,r,s,a){var h=Math.sin(r),l=Math.cos(r);return t[0]=n*l,t[1]=o*h,t[2]=-n*h,t[3]=o*l,t[4]=s*n*l-a*n*h+e,t[5]=s*o*h+a*o*l+i,t}var Un=[1,0,0,1,0,0];function Hn(t){var e;return t==Qi?e=2:t==$i||t==tn?e=3:t==en&&(e=4),e}var qn=function(t){function e(){t.call(this),this.layout=Qi,this.stride=2,this.flatCoordinates=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.computeExtent=function(t){return e=this.flatCoordinates,i=0,n=this.flatCoordinates.length,o=this.stride,bi(Ci(t),e,i,n,o);var e,i,n,o},e.prototype.getCoordinates=function(){return n()},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()&&(c(this.simplifiedGeometryCache),this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;var e=t.toString();if(this.simplifiedGeometryCache.hasOwnProperty(e))return this.simplifiedGeometryCache[e];var i=this.getSimplifiedGeometryInternal(t);return i.getFlatCoordinates().length<this.flatCoordinates.length?(this.simplifiedGeometryCache[e]=i,i):(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=Hn(t),this.layout=t,this.flatCoordinates=e},e.prototype.setCoordinates=function(t,e){n()},e.prototype.setLayout=function(t,e,i){var n;if(t)n=Hn(t);else{for(var o=0;o<i;++o){if(0===e.length)return this.layout=Qi,void(this.stride=2);e=e[0]}t=function(t){var e;2==t?e=Qi:3==t?e=$i:4==t&&(e=en);return e}(n=e.length)}this.layout=t,this.stride=n},e.prototype.applyTransform=function(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())},e.prototype.rotate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();!function(t,e,i,n,o,r,s){for(var a=s||[],h=Math.cos(o),l=Math.sin(o),u=r[0],c=r[1],p=0,d=e;d<i;d+=n){var f=t[d]-u,_=t[d+1]-c;a[p++]=u+f*h-_*l,a[p++]=c+f*l+_*h;for(var g=d+2;g<d+n;++g)a[p++]=t[g]}s&&a.length!=p&&(a.length=p)}(i,0,i.length,n,t,e,i),this.changed()}},e.prototype.scale=function(t,e,i){var n=e;void 0===n&&(n=t);var o=i;o||(o=Li(this.getExtent()));var r=this.getFlatCoordinates();if(r){var s=this.getStride();!function(t,e,i,n,o,r,s,a){for(var h=a||[],l=s[0],u=s[1],c=0,p=e;p<i;p+=n){var d=t[p]-l,f=t[p+1]-u;h[c++]=l+o*d,h[c++]=u+r*f;for(var _=p+2;_<p+n;++_)h[c++]=t[_]}a&&h.length!=c&&(h.length=c)}(r,0,r.length,s,t,n,o,r),this.changed()}},e.prototype.translate=function(t,e){var i=this.getFlatCoordinates();if(i){var n=this.getStride();!function(t,e,i,n,o,r,s){for(var a=s||[],h=0,l=e;l<i;l+=n){a[h++]=t[l]+o,a[h++]=t[l+1]+r;for(var u=l+2;u<l+n;++u)a[h++]=t[u]}s&&a.length!=h&&(a.length=h)}
  /**
   * @license
   * Latitude/longitude spherical geodesy formulae taken from
   * http://www.movable-type.co.uk/scripts/latlong.html
   * Licensed under CC-BY-3.0.
   */(i,0,i.length,n,t,e,i),this.changed()}},e}(function(t){function e(){t.call(this),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryCache={},this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return n()},e.prototype.closestPointXY=function(t,e,i,o){return n()},e.prototype.containsXY=function(t,e){return!1},e.prototype.getClosestPoint=function(t,e){var i=e||[NaN,NaN];return this.closestPointXY(t[0],t[1],i,1/0),i},e.prototype.intersectsCoordinate=function(t){return this.containsXY(t[0],t[1])},e.prototype.computeExtent=function(t){return n()},e.prototype.getExtent=function(t){return this.extentRevision_!=this.getRevision()&&(this.extent_=this.computeExtent(this.extent_),this.extentRevision_=this.getRevision()),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){n()},e.prototype.scale=function(t,e,i){n()},e.prototype.simplify=function(t){return this.getSimplifiedGeometry(t*t)},e.prototype.getSimplifiedGeometry=function(t){return n()},e.prototype.getType=function(){return n()},e.prototype.applyTransform=function(t){n()},e.prototype.intersectsExtent=function(t){return n()},e.prototype.translate=function(t,e){n()},e.prototype.transform=function(t,e){var i=Mn(t),n=i.getUnits()==an.TILE_PIXELS?function(t,n,o){var r=i.getExtent(),s=i.getWorldExtent(),a=Di(s)/Di(r);return Zn(Un,s[0],s[3],a,-a,0,0,0),nn(t,0,t.length,o,Un,n),Gn(i,e)(t,n,o)}:Gn(i,e);return this.applyTransform(n),this},e}(Q));function Jn(t,e,i,n){for(var o=0,r=t[i-n],s=t[i-n+1];e<i;e+=n){var a=t[e],h=t[e+1];o+=s*a-r*h,r=a,s=h}return o/2}function Qn(t,e,i,n){for(var o=0,r=0,s=i.length;r<s;++r){var a=i[r];o+=Jn(t,e,a,n),e=a}return o}function $n(t,e,i,n,o,r,s){var a,h=t[e],l=t[e+1],u=t[i]-h,c=t[i+1]-l;if(0===u&&0===c)a=e;else{var p=((o-h)*u+(r-l)*c)/(u*u+c*c);if(p>1)a=i;else{if(p>0){for(var d=0;d<n;++d)s[d]=je(t[e+d],t[i+d],p);return void(s.length=n)}a=e}}for(var f=0;f<n;++f)s[f]=t[a+f];s.length=n}function to(t,e,i,n,o){var r=t[e],s=t[e+1];for(e+=n;e<i;e+=n){var a=t[e],h=t[e+1],l=Ge(r,s,a,h);l>o&&(o=l),r=a,s=h}return o}function eo(t,e,i,n,o){for(var r=0,s=i.length;r<s;++r){var a=i[r];o=to(t,e,a,n,o),e=a}return o}function io(t,e,i,n,o,r,s,a,h,l,u){if(e==i)return l;var c,p;if(0===o){if((p=Ge(s,a,t[e],t[e+1]))<l){for(c=0;c<n;++c)h[c]=t[e+c];return h.length=n,p}return l}for(var d=u||[NaN,NaN],f=e+n;f<i;)if($n(t,f-n,f,n,s,a,d),(p=Ge(s,a,d[0],d[1]))<l){for(l=p,c=0;c<n;++c)h[c]=d[c];h.length=n,f+=n}else f+=n*Math.max((Math.sqrt(p)-Math.sqrt(l))/o|0,1);if(r&&($n(t,i-n,e,n,s,a,d),(p=Ge(s,a,d[0],d[1]))<l)){for(l=p,c=0;c<n;++c)h[c]=d[c];h.length=n}return l}function no(t,e,i,n,o,r,s,a,h,l,u){for(var c=u||[NaN,NaN],p=0,d=i.length;p<d;++p){var f=i[p];l=io(t,e,f,n,o,r,s,a,h,l,c),e=f}return l}function oo(t,e,i,n){for(var o=0,r=i.length;o<r;++o)for(var s=i[o],a=0;a<n;++a)t[e++]=s[a];return e}function ro(t,e,i,n,o){for(var r=o||[],s=0,a=0,h=i.length;a<h;++a){var l=oo(t,e,i[a],n);r[s++]=l,e=l}return r.length=s,r}function so(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=e;a<i;a+=n)r[s++]=t.slice(a,a+n);return r.length=s,r}function ao(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];r[s++]=so(t,e,l,n,r[s]),e=l}return r.length=s,r}function ho(t,e,i,n,o){for(var r=void 0!==o?o:[],s=0,a=0,h=i.length;a<h;++a){var l=i[a];r[s++]=ao(t,e,l,n,r[s]),e=l[l.length-1]}return r.length=s,r}function lo(t,e,i,n,o,r,s){var a=(i-e)/n;if(a<3){for(;e<i;e+=n)r[s++]=t[e],r[s++]=t[e+1];return s}var h=new Array(a);h[0]=1,h[a-1]=1;for(var l=[e,i-n],u=0;l.length>0;){for(var c=l.pop(),p=l.pop(),d=0,f=t[p],_=t[p+1],g=t[c],v=t[c+1],y=p+n;y<c;y+=n){var m=Ae(t[y],t[y+1],f,_,g,v);m>d&&(u=y,d=m)}d>o&&(h[(u-e)/n]=1,p+n<u&&l.push(p,u),u+n<c&&l.push(u,c))}for(var x=0;x<a;++x)h[x]&&(r[s++]=t[e+x*n],r[s++]=t[e+x*n+1]);return s}function uo(t,e){return e*Math.round(t/e)}function co(t,e,i,n,o,r,s){if(e==i)return s;var a,h,l=uo(t[e],o),u=uo(t[e+1],o);e+=n,r[s++]=l,r[s++]=u;do{if(a=uo(t[e],o),h=uo(t[e+1],o),(e+=n)==i)return r[s++]=a,r[s++]=h,s}while(a==l&&h==u);for(;e<i;){var c=uo(t[e],o),p=uo(t[e+1],o);if(e+=n,c!=a||p!=h){var d=a-l,f=h-u,_=c-l,g=p-u;d*g==f*_&&(d<0&&_<d||d==_||d>0&&_>d)&&(f<0&&g<f||f==g||f>0&&g>f)?(a=c,h=p):(r[s++]=a,r[s++]=h,l=a,u=h,a=c,h=p)}}return r[s++]=a,r[s++]=h,s}function po(t,e,i,n,o,r,s,a){for(var h=0,l=i.length;h<l;++h){var u=i[h];s=co(t,e,u,n,o,r,s),a.push(s),e=u}return s}var fo=function(t){function e(e,i){t.call(this),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===i||Array.isArray(e[0])?this.setCoordinates(e,i):this.setFlatCoordinates(i,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,n){return n<_i(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(to(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),io(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.getArea=function(){return Jn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getCoordinates=function(){return so(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[];return i.length=lo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,i,0),new e(i,Qi)},e.prototype.getType=function(){return Vi},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=oo(this.flatCoordinates,0,t,this.stride),this.changed()},e}(qn),_o=function(t){function e(e,i){t.call(this),this.setCoordinates(e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout)},e.prototype.closestPointXY=function(t,e,i,n){var o=this.flatCoordinates,r=Ge(t,e,o[0],o[1]);if(r<n){for(var s=this.stride,a=0;a<s;++a)i[a]=o[a];return i.length=s,r}return n},e.prototype.getCoordinates=function(){return this.flatCoordinates?this.flatCoordinates.slice():[]},e.prototype.computeExtent=function(t){return e=this.flatCoordinates,i=t,n=e[0],o=e[1],Si(n,o,n,o,i);var e,i,n,o},e.prototype.getType=function(){return Yi},e.prototype.intersectsExtent=function(t){return yi(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,i,n){for(var o=0,r=i.length;o<r;++o)t[e++]=i[o];return e}(this.flatCoordinates,0,t,this.stride),this.changed()},e}(qn);function go(t,e,i,n,o){return!function(t,e,i){var n;return(n=e.call(i,Mi(t)))||(n=e.call(i,Pi(t)))||(n=e.call(i,zi(t)))?n:(n=e.call(i,Gi(t)))||!1}(o,(function(o){return!vo(t,e,i,n,o[0],o[1])}))}function vo(t,e,i,n,o,r){for(var s=0,a=t[i-n],h=t[i-n+1];e<i;e+=n){var l=t[e],u=t[e+1];h<=r?u>r&&(l-a)*(r-h)-(o-a)*(u-h)>0&&s++:u<=r&&(l-a)*(r-h)-(o-a)*(u-h)<0&&s--,a=l,h=u}return 0!==s}function yo(t,e,i,n,o,r){if(0===i.length)return!1;if(!vo(t,e,i[0],n,o,r))return!1;for(var s=1,a=i.length;s<a;++s)if(vo(t,i[s-1],i[s],n,o,r))return!1;return!0}function mo(t,e,i,n,o,r,s){for(var a,h,l,u,c,p,d,f=o[r+1],_=[],g=0,v=i.length;g<v;++g){var y=i[g];for(u=t[y-n],p=t[y-n+1],a=e;a<y;a+=n)c=t[a],d=t[a+1],(f<=p&&d<=f||p<=f&&f<=d)&&(l=(f-p)/(d-p)*(c-u)+u,_.push(l)),u=c,p=d}var m=NaN,x=-1/0;for(_.sort(ee),u=_[0],a=1,h=_.length;a<h;++a){c=_[a];var S=Math.abs(c-u);S>x&&yo(t,e,i,n,l=(u+c)/2,f)&&(m=l,x=S),u=c}return isNaN(m)&&(m=o[r]),s?(s.push(m,f,x),s):[m,f,x]}function xo(t,e,i,n,o){var r=bi([1/0,1/0,-1/0,-1/0],t,e,i,n);return!!ji(o,r)&&(!!vi(o,r)||(r[0]>=o[0]&&r[2]<=o[2]||(r[1]>=o[1]&&r[3]<=o[3]||function(t,e,i,n,o,r){for(var s,a=[t[e],t[e+1]],h=[];e+n<i;e+=n){if(h[0]=t[e+n],h[1]=t[e+n+1],s=o.call(r,a,h))return s;a[0]=h[0],a[1]=h[1]}return!1}(t,e,i,n,(function(t,e){return function(t,e,i){var n=!1,o=mi(t,e),r=mi(t,i);if(o===ai||r===ai)n=!0;else{var s,a,h=t[0],l=t[1],u=t[2],c=t[3],p=e[0],d=e[1],f=i[0],_=i[1],g=(_-d)/(f-p);r&hi&&!(o&hi)&&(n=(s=f-(_-c)/g)>=h&&s<=u),n||!(r&li)||o&li||(n=(a=_-(f-u)*g)>=l&&a<=c),n||!(r&ui)||o&ui||(n=(s=f-(_-l)/g)>=h&&s<=u),n||!(r&ci)||o&ci||(n=(a=_-(f-h)*g)>=l&&a<=c)}return n}(o,t,e)})))))}function So(t,e,i,n,o){if(!function(t,e,i,n,o){return!!xo(t,e,i,n,o)||(!!vo(t,e,i,n,o[0],o[1])||(!!vo(t,e,i,n,o[0],o[3])||(!!vo(t,e,i,n,o[2],o[1])||!!vo(t,e,i,n,o[2],o[3]))))}(t,e,i[0],n,o))return!1;if(1===i.length)return!0;for(var r=1,s=i.length;r<s;++r)if(go(t,i[r-1],i[r],n,o)&&!xo(t,i[r-1],i[r],n,o))return!1;return!0}function Co(t,e,i,n){for(;e<i-n;){for(var o=0;o<n;++o){var r=t[e+o];t[e+o]=t[i-n+o],t[i-n+o]=r}e+=n,i-=n}}function Eo(t,e,i,n){for(var o=0,r=t[i-n],s=t[i-n+1];e<i;e+=n){var a=t[e],h=t[e+1];o+=(a-r)*(h+s),r=a,s=h}return o>0}function wo(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;s<a;++s){var h=i[s],l=Eo(t,e,h,n);if(0===s){if(r&&l||!r&&!l)return!1}else if(r&&!l||!r&&l)return!1;e=h}return!0}function To(t,e,i,n,o){for(var r=void 0!==o&&o,s=0,a=i.length;s<a;++s){var h=i[s],l=Eo(t,e,h,n);(0===s?r&&l||!r&&!l:r&&!l||!r&&l)&&Co(t,e,h,n),e=h}return e}var Ro=function(t){function e(e,i,n){t.call(this),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==i&&n?(this.setFlatCoordinates(i,e),this.ends_=n):this.setCoordinates(e,i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.appendLinearRing=function(t){this.flatCoordinates?oe(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()},e.prototype.clone=function(){return new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice())},e.prototype.closestPointXY=function(t,e,i,n){return n<_i(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(eo(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),no(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))},e.prototype.containsXY=function(t,e){return yo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)},e.prototype.getArea=function(){return Qn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)},e.prototype.getCoordinates=function(t){var e;return void 0!==t?To(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,ao(e,0,this.ends_,this.stride)},e.prototype.getEnds=function(){return this.ends_},e.prototype.getFlatInteriorPoint=function(){if(this.flatInteriorPointRevision_!=this.getRevision()){var t=Li(this.getExtent());this.flatInteriorPoint_=mo(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_},e.prototype.getInteriorPoint=function(){return new _o(this.getFlatInteriorPoint(),tn)},e.prototype.getLinearRingCount=function(){return this.ends_.length},e.prototype.getLinearRing=function(t){return t<0||this.ends_.length<=t?null:new fo(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,i=this.ends_,n=[],o=0,r=0,s=i.length;r<s;++r){var a=i[r],h=new fo(e.slice(o,a),t);n.push(h),o=a}return n},e.prototype.getOrientedFlatCoordinates=function(){if(this.orientedRevision_!=this.getRevision()){var t=this.flatCoordinates;wo(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=To(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_},e.prototype.getSimplifiedGeometryInternal=function(t){var i=[],n=[];return i.length=po(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),i,0,n),new e(i,Qi,n)},e.prototype.getType=function(){return Bi},e.prototype.intersectsExtent=function(t){return So(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)},e.prototype.setCoordinates=function(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);var i=ro(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()},e}(qn),bo=Ro;function Io(t){var e=t[0],i=t[1],n=t[2],o=t[3],r=[e,i,e,o,n,o,n,i,e,i];return new Ro(r,Qi,[r.length])}function Fo(t,e){setTimeout((function(){t(e)}),0)}function Mo(t){return!(t.sourceCenter&&t.targetCenter&&!function(t,e){for(var i=!0,n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}var Po=function(t){function e(e){t.call(this);var i=u({},e);this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.updateAnimations_=this.updateAnimations_.bind(this),this.projection_=kn(i.projection,"EPSG:3857"),this.applyOptions_(i)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.applyOptions_=function(t){var e={};e[Be]=void 0!==t.center?t.center:null;var i=function(t){var e,i,n,o=void 0!==t.minZoom?t.minZoom:0,r=void 0!==t.maxZoom?t.maxZoom:28,s=void 0!==t.zoomFactor?t.zoomFactor:2;if(void 0!==t.resolutions){var a=t.resolutions;i=a[o],n=void 0!==a[r]?a[r]:a[a.length-1],e=function(t){return function(e,i,n){if(void 0!==e){var o=ie(t,e,n);o=Oe(o+i,0,t.length-1);var r=Math.floor(o);if(o!=r&&r<t.length-1){var s=t[r]/t[r+1];return t[r]/Math.pow(s,o-r)}return t[r]}}}(a)}else{var h=kn(t.projection,"EPSG:3857"),l=h.getExtent(),u=(l?Math.max(Ki(l),Di(l)):360*sn[an.DEGREES]/h.getMetersPerUnit())/256/Math.pow(2,0),c=u/Math.pow(2,28);void 0!==(i=t.maxResolution)?o=0:i=u/Math.pow(s,o),void 0===(n=t.minResolution)&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(s,r):u/Math.pow(s,r):c),r=o+Math.floor(Math.log(i/n)/Math.log(s)),n=i/Math.pow(s,r-o),e=function(t,e,i){return function(n,o,r){if(void 0!==n){var s=-r/2+.5,a=Math.floor(Math.log(e/n)/Math.log(t)+s),h=Math.max(a+o,0);return void 0!==i&&(h=Math.min(h,i)),e/Math.pow(t,h)}}}(s,i,r-o)}return{constraint:e,maxResolution:i,minResolution:n,minZoom:o,zoomFactor:s}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.minZoom_=i.minZoom;var n=function(t){return void 0!==t.extent?(e=t.extent,function(t){return t?[Oe(t[0],e[0],e[2]),Oe(t[1],e[1],e[3])]:void 0}):Xe;var e}(t),o=i.constraint,r=function(t){if(void 0===t.enableRotation||t.enableRotation){var e=t.constrainRotation;return void 0===e||!0===e?(r=o||ze(5),function(t,e){return void 0!==t?Math.abs(t+e)<=r?0:t+e:void 0}):!1===e?Ye:"number"==typeof e?(i=e,n=2*Math.PI/i,function(t,e){return void 0!==t?t=Math.floor((t+e)/n+.5)*n:void 0}):Ye}return We;var i,n;var o,r}(t);this.constraints_={center:n,resolution:o,rotation:r},void 0!==t.resolution?e[Ze]=t.resolution:void 0!==t.zoom&&(e[Ze]=this.constrainResolution(this.maxResolution_,t.zoom-this.minZoom_),this.resolutions_&&(e[Ze]=Oe(Number(this.getResolution()||e[Ze]),this.minResolution_,this.maxResolution_))),e[Ue]=void 0!==t.rotation?t.rotation:0,this.setProperties(e),this.options_=t},e.prototype.getUpdatedOptions_=function(t){var e=u({},this.options_);return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenter(),e.rotation=this.getRotation(),u({},e,t)},e.prototype.animate=function(t){var e,i=arguments,n=arguments.length;if(n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n),!this.isDef()){var o=arguments[n-1];return o.center&&this.setCenter(o.center),void 0!==o.zoom&&this.setZoom(o.zoom),void 0!==o.rotation&&this.setRotation(o.rotation),void(e&&Fo(e,!0))}for(var r=Date.now(),s=this.getCenter().slice(),a=this.getResolution(),h=this.getRotation(),l=[],u=0;u<n;++u){var c=i[u],p={start:r,complete:!1,anchor:c.anchor,duration:void 0!==c.duration?c.duration:1e3,easing:c.easing||ti};if(c.center&&(p.sourceCenter=s,p.targetCenter=c.center,s=p.targetCenter),void 0!==c.zoom?(p.sourceResolution=a,p.targetResolution=this.constrainResolution(this.maxResolution_,c.zoom-this.minZoom_,0),a=p.targetResolution):c.resolution&&(p.sourceResolution=a,p.targetResolution=c.resolution,a=p.targetResolution),void 0!==c.rotation){p.sourceRotation=h;var d=Ke(c.rotation-h+Math.PI,2*Math.PI)-Math.PI;p.targetRotation=h+d,h=p.targetRotation}p.callback=e,Mo(p)?p.complete=!0:r+=p.duration,l.push(p)}this.animations_.push(l),this.setHint(Ne,1),this.updateAnimations_()},e.prototype.getAnimating=function(){return this.hints_[Ne]>0},e.prototype.getInteracting=function(){return this.hints_[Ve]>0},e.prototype.cancelAnimations=function(){this.setHint(Ne,-this.hints_[Ne]);for(var t=0,e=this.animations_.length;t<e;++t){var i=this.animations_[t];i[0].callback&&Fo(i[0].callback,!1)}this.animations_.length=0},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,i=this.animations_.length-1;i>=0;--i){for(var n=this.animations_[i],o=!0,r=0,s=n.length;r<s;++r){var a=n[r];if(!a.complete){var h=t-a.start,l=a.duration>0?h/a.duration:1;l>=1?(a.complete=!0,l=1):o=!1;var u=a.easing(l);if(a.sourceCenter){var c=a.sourceCenter[0],p=a.sourceCenter[1],d=c+u*(a.targetCenter[0]-c),f=p+u*(a.targetCenter[1]-p);this.set(Be,[d,f])}if(a.sourceResolution&&a.targetResolution){var _=1===u?a.targetResolution:a.sourceResolution+u*(a.targetResolution-a.sourceResolution);a.anchor&&this.set(Be,this.calculateCenterZoom(_,a.anchor)),this.set(Ze,_)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){var g=1===u?Ke(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+u*(a.targetRotation-a.sourceRotation);a.anchor&&this.set(Be,this.calculateCenterRotate(g,a.anchor)),this.set(Ue,g)}if(e=!0,!a.complete)break}}if(o){this.animations_[i]=null,this.setHint(Ne,-1);var v=n[0].callback;v&&Fo(v,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_))}},e.prototype.calculateCenterRotate=function(t,e){var i,n=this.getCenter();return void 0!==n&&(qe(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),He(i,e)),i},e.prototype.calculateCenterZoom=function(t,e){var i,n=this.getCenter(),o=this.getResolution();void 0!==n&&void 0!==o&&(i=[e[0]-t*(e[0]-n[0])/o,e[1]-t*(e[1]-n[1])/o]);return i},e.prototype.getSizeFromViewport_=function(){var t=[100,100],e='.ol-viewport[data-view="'+r(this)+'"]',i=document.querySelector(e);if(i){var n=getComputedStyle(i);t[0]=parseInt(n.width,10),t[1]=parseInt(n.height,10)}return t},e.prototype.constrainCenter=function(t){return this.constraints_.center(t)},e.prototype.constrainResolution=function(t,e,i){var n=e||0,o=i||0;return this.constraints_.resolution(t,n,o)},e.prototype.constrainRotation=function(t,e){var i=e||0;return this.constraints_.rotation(t,i)},e.prototype.getCenter=function(){return this.get(Be)},e.prototype.getConstraints=function(){return this.constraints_},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){var e=t||this.getSizeFromViewport_(),i=this.getCenter();Pe(i,1);var n=this.getResolution();Pe(void 0!==n,2);var o=this.getRotation();return Pe(void 0!==o,3),Oi(i,n,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.getProjection=function(){return this.projection_},e.prototype.getResolution=function(){return this.get(Ze)},e.prototype.getResolutions=function(){return this.resolutions_},e.prototype.getResolutionForExtent=function(t,e){var i=e||this.getSizeFromViewport_(),n=Ki(t)/i[0],o=Di(t)/i[1];return Math.max(n,o)},e.prototype.getResolutionForValueFunction=function(t){var e=t||2,i=this.maxResolution_,n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return i/Math.pow(e,t*o)}},e.prototype.getRotation=function(){return this.get(Ue)},e.prototype.getValueForResolutionFunction=function(t){var e=t||2,i=this.maxResolution_,n=this.minResolution_,o=Math.log(i/n)/Math.log(e);return function(t){return Math.log(i/t)/Math.log(e)/o}},e.prototype.getState=function(t){var e=this.getCenter(),i=this.getProjection(),n=this.getResolution(),o=n/t,r=this.getRotation();return{center:[Math.round(e[0]/o)*o,Math.round(e[1]/o)*o],projection:void 0!==i?i:null,resolution:n,rotation:r,zoom:this.getZoom()}},e.prototype.getZoom=function(){var t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t},e.prototype.getZoomForResolution=function(t){var e,i,n=this.minZoom_||0;if(this.resolutions_){var o=ie(this.resolutions_,t,1);n=o,e=this.resolutions_[o],i=o==this.resolutions_.length-1?2:e/this.resolutions_[o+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)},e.prototype.getResolutionForZoom=function(t){return this.constrainResolution(this.maxResolution_,t-this.minZoom_,0)},e.prototype.fit=function(t,e){var i,n=e||{},o=n.size;o||(o=this.getSizeFromViewport_()),Pe(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)?(Pe(!Xi(t),25),i=Io(t)):t.getType()===Ji?(i=Io(t=t.getExtent())).rotate(this.getRotation(),Li(t)):i=t;var r,s=void 0!==n.padding?n.padding:[0,0,0,0],a=void 0===n.constrainResolution||n.constrainResolution,h=void 0!==n.nearest&&n.nearest;r=void 0!==n.minResolution?n.minResolution:void 0!==n.maxZoom?this.constrainResolution(this.maxResolution_,n.maxZoom-this.minZoom_,0):0;for(var l=i.getFlatCoordinates(),u=this.getRotation(),c=Math.cos(-u),p=Math.sin(-u),d=1/0,f=1/0,_=-1/0,g=-1/0,v=i.getStride(),y=0,m=l.length;y<m;y+=v){var x=l[y]*c-l[y+1]*p,S=l[y]*p+l[y+1]*c;d=Math.min(d,x),f=Math.min(f,S),_=Math.max(_,x),g=Math.max(g,S)}var C=this.getResolutionForExtent([d,f,_,g],[o[0]-s[1]-s[3],o[1]-s[0]-s[2]]);if(C=isNaN(C)?r:Math.max(C,r),a){var E=this.constrainResolution(C,0,0);!h&&E<C&&(E=this.constrainResolution(E,-1,0)),C=E}p=-p;var w=(d+_)/2,T=(f+g)/2,b=[(w+=(s[1]-s[3])/2*C)*c-(T+=(s[0]-s[2])/2*C)*p,T*c+w*p],I=n.callback?n.callback:R;void 0!==n.duration?this.animate({resolution:C,center:b,duration:n.duration,easing:n.easing},I):(this.setResolution(C),this.setCenter(b),Fo(I,!0))},e.prototype.centerOn=function(t,e,i){var n=this.getRotation(),o=Math.cos(-n),r=Math.sin(-n),s=t[0]*o-t[1]*r,a=t[1]*o+t[0]*r,h=this.getResolution(),l=(s+=(e[0]/2-i[0])*h)*o-(a+=(i[1]-e[1]/2)*h)*(r=-r),u=a*o+s*r;this.setCenter([l,u])},e.prototype.isDef=function(){return!!this.getCenter()&&void 0!==this.getResolution()},e.prototype.rotate=function(t,e){if(void 0!==e){var i=this.calculateCenterRotate(t,e);this.setCenter(i)}this.setRotation(t)},e.prototype.setCenter=function(t){this.set(Be,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setHint=function(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]},e.prototype.setResolution=function(t){this.set(Ze,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setRotation=function(t){this.set(Ue,t),this.getAnimating()&&this.cancelAnimations()},e.prototype.setZoom=function(t){this.setResolution(this.getResolutionForZoom(t))},e}(Q);function Lo(t,e){var i=document.createElement("canvas");return t&&(i.width=t),e&&(i.height=e),i.getContext("2d")}function ko(t){var e=t.offsetWidth,i=getComputedStyle(t);return e+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10)}function Oo(t){var e=t.offsetHeight,i=getComputedStyle(t);return e+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10)}function Do(t,e){var i=e.parentNode;i&&i.replaceChild(t,e)}function Ao(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function Go(t){for(;t.lastChild;)t.removeChild(t.lastChild)}var zo="opacity",Ko="visible",jo="extent",Xo="zIndex",Wo="maxResolution",Yo="minResolution",No="source",Vo=function(t){function e(e){t.call(this);var i=u({},e);i[zo]=void 0!==e.opacity?e.opacity:1,i[Ko]=void 0===e.visible||e.visible,i[Xo]=e.zIndex,i[Wo]=void 0!==e.maxResolution?e.maxResolution:1/0,i[Yo]=void 0!==e.minResolution?e.minResolution:0,this.setProperties(i),this.state_=null,this.type}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getType=function(){return this.type},e.prototype.getLayerState=function(){var t=this.state_||{layer:this,managed:!0};return t.opacity=Oe(this.getOpacity(),0,1),t.sourceState=this.getSourceState(),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=this.getZIndex()||0,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),this.state_=t,t},e.prototype.getLayersArray=function(t){return n()},e.prototype.getLayerStatesArray=function(t){return n()},e.prototype.getExtent=function(){return this.get(jo)},e.prototype.getMaxResolution=function(){return this.get(Wo)},e.prototype.getMinResolution=function(){return this.get(Yo)},e.prototype.getOpacity=function(){return this.get(zo)},e.prototype.getSourceState=function(){return n()},e.prototype.getVisible=function(){return this.get(Ko)},e.prototype.getZIndex=function(){return this.get(Xo)},e.prototype.setExtent=function(t){this.set(jo,t)},e.prototype.setMaxResolution=function(t){this.set(Wo,t)},e.prototype.setMinResolution=function(t){this.set(Yo,t)},e.prototype.setOpacity=function(t){this.set(zo,t)},e.prototype.setVisible=function(t){this.set(Ko,t)},e.prototype.setZIndex=function(t){this.set(Xo,t)},e}(Q),Bo="undefined",Zo="ready",Uo="layers",Ho=function(t){function e(e){var i=e||{},n=u({},i);delete n.layers;var o=i.layers;t.call(this,n),this.layersListenerKeys_=[],this.listenerKeys_={},y(this,J(Uo),this.handleLayersChanged_,this),o?Array.isArray(o)?o=new et(o.slice(),{unique:!0}):Pe("function"==typeof o.getArray,43):o=new et(void 0,{unique:!0}),this.setLayers(o)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleLayerChange_=function(){this.changed()},e.prototype.handleLayersChanged_=function(){this.layersListenerKeys_.forEach(S),this.layersListenerKeys_.length=0;var t=this.getLayers();for(var e in this.layersListenerKeys_.push(y(t,a,this.handleLayersAdd_,this),y(t,h,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(S);c(this.listenerKeys_);for(var i=t.getArray(),n=0,o=i.length;n<o;n++){var s=i[n];this.listenerKeys_[r(s)]=[y(s,l,this.handleLayerChange_,this),y(s,P,this.handleLayerChange_,this)]}this.changed()},e.prototype.handleLayersAdd_=function(t){var e=t.element;this.listenerKeys_[r(e)]=[y(e,l,this.handleLayerChange_,this),y(e,P,this.handleLayerChange_,this)],this.changed()},e.prototype.handleLayersRemove_=function(t){var e=r(t.element);this.listenerKeys_[e].forEach(S),delete this.listenerKeys_[e],this.changed()},e.prototype.getLayers=function(){return this.get(Uo)},e.prototype.setLayers=function(t){this.set(Uo,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:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));for(var n=this.getLayerState(),o=i,r=e.length;o<r;o++){var s=e[o];s.opacity*=n.opacity,s.visible=s.visible&&n.visible,s.maxResolution=Math.min(s.maxResolution,n.maxResolution),s.minResolution=Math.max(s.minResolution,n.minResolution),void 0!==n.extent&&(void 0!==s.extent?s.extent=Ai(s.extent,n.extent):s.extent=n.extent)}return e},e.prototype.getSourceState=function(){return Zo},e}(Vo);function qo(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:e[0]=e[1]=t,e)}var Jo=function(t){function e(e){t.call(this);var i=function(t){var e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);var i,n,o,r={},s=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new Ho({layers:t.layers});r[ve]=s,r[me]=t.target,r[xe]=void 0!==t.view?t.view:new Po,void 0!==t.controls&&(Array.isArray(t.controls)?i=new et(t.controls.slice()):(Pe("function"==typeof t.controls.getArray,47),i=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?n=new et(t.interactions.slice()):(Pe("function"==typeof t.interactions.getArray,48),n=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?o=new et(t.overlays.slice()):(Pe("function"==typeof t.overlays.getArray,49),o=t.overlays):o=new et;return{controls:i,interactions:n,keyboardEventTarget:e,overlays:o,values:r}}(e);this.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,this.loadTilesWhileAnimating_=void 0!==e.loadTilesWhileAnimating&&e.loadTilesWhileAnimating,this.loadTilesWhileInteracting_=void 0!==e.loadTilesWhileInteracting&&e.loadTilesWhileInteracting,this.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:lt,this.animationDelayKey_,this.animationDelay_=function(){this.animationDelayKey_=void 0,this.renderFrame_.call(this,Date.now())}.bind(this),this.coordinateToPixelTransform_=[1,0,0,1,0,0],this.pixelToCoordinateTransform_=[1,0,0,1,0,0],this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+(ct?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.viewport_.style.msTouchAction="none",this.viewport_.style.touchAction="none",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent";for(var n=[O,D,j,B,N,ft.POINTERDOWN,Y,Z],o=0,r=n.length;o<r;++o)y(this.overlayContainerStopEvent_,n[o],I);for(var s in this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=new de(this,e.moveTolerance),ft)y(this.mapBrowserEventHandler_,ft[s],this.handleMapBrowserEvent,this);this.keyboardEventTarget_=i.keyboardEventTarget,this.keyHandlerKeys_=null,y(this.viewport_,k,this.handleBrowserEvent,this),y(this.viewport_,Z,this.handleBrowserEvent,this),y(this.viewport_,Y,this.handleBrowserEvent,this),this.controls=i.controls||new et,this.interactions=i.interactions||new et,this.overlays_=i.overlays,this.overlayIdIndex_={},this.renderer_=this.createRenderer(),this.handleResize_,this.focus_=null,this.postRenderFunctions_=[],this.tileQueue_=new ke(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.skippedFeatureUids_={},y(this,J(ve),this.handleLayerGroupChanged_,this),y(this,J(xe),this.handleViewChanged_,this),y(this,J(ye),this.handleSizeChanged_,this),y(this,J(me),this.handleTargetChanged_,this),this.setProperties(i.values),this.controls.forEach(function(t){t.setMap(this)}.bind(this)),y(this.controls,a,(function(t){t.element.setMap(this)}),this),y(this.controls,h,(function(t){t.element.setMap(null)}),this),this.interactions.forEach(function(t){t.setMap(this)}.bind(this)),y(this.interactions,a,(function(t){t.element.setMap(this)}),this),y(this.interactions,h,(function(t){t.element.setMap(null)}),this),this.overlays_.forEach(this.addOverlayInternal_.bind(this)),y(this.overlays_,a,(function(t){this.addOverlayInternal_(t.element)}),this),y(this.overlays_,h,(function(t){var e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}),this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRenderer=function(){throw new Error("Use a map type that has a createRenderer method")},e.prototype.addControl=function(t){this.getControls().push(t)},e.prototype.addInteraction=function(t){this.getInteractions().push(t)},e.prototype.addLayer=function(t){this.getLayerGroup().getLayers().push(t)},e.prototype.addOverlay=function(t){this.getOverlays().push(t)},e.prototype.addOverlayInternal_=function(t){var e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)},e.prototype.disposeInternal=function(){this.mapBrowserEventHandler_.dispose(),x(this.viewport_,k,this.handleBrowserEvent,this),x(this.viewport_,Z,this.handleBrowserEvent,this),x(this.viewport_,Y,this.handleBrowserEvent,this),void 0!==this.handleResize_&&(removeEventListener(V,this.handleResize_,!1),this.handleResize_=void 0),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0),this.setTarget(null),t.prototype.disposeInternal.call(this)},e.prototype.forEachFeatureAtPixel=function(t,e,i){if(this.frameState_){var n=this.getCoordinateFromPixel(t),o=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,r=void 0!==i.layerFilter?i.layerFilter:w;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,o,e,null,r,null)}},e.prototype.getFeaturesAtPixel=function(t,e){var i=null;return this.forEachFeatureAtPixel(t,(function(t){i||(i=[]),i.push(t)}),e),i},e.prototype.forEachLayerAtPixel=function(t,e,i){if(this.frameState_){var n=i||{},o=void 0!==n.hitTolerance?i.hitTolerance*this.frameState_.pixelRatio:0,r=n.layerFilter||w;return this.renderer_.forEachLayerAtPixel(t,this.frameState_,o,e,null,r,null)}},e.prototype.hasFeatureAtPixel=function(t,e){if(!this.frameState_)return!1;var i=this.getCoordinateFromPixel(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:w,o=void 0!==e.hitTolerance?e.hitTolerance*this.frameState_.pixelRatio:0;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,o,n,null)},e.prototype.getEventCoordinate=function(t){return this.getCoordinateFromPixel(this.getEventPixel(t))},e.prototype.getEventPixel=function(t){var e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]},e.prototype.getTarget=function(){return this.get(me)},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){var e=this.frameState_;return e?Nn(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(ve)},e.prototype.getLayers=function(){return this.getLayerGroup().getLayers()},e.prototype.getPixelFromCoordinate=function(t){var e=this.frameState_;return e?Nn(e.coordinateToPixelTransform,t.slice(0,2)):null},e.prototype.getRenderer=function(){return this.renderer_},e.prototype.getSize=function(){return this.get(ye)},e.prototype.getView=function(){return this.get(xe)},e.prototype.getViewport=function(){return this.viewport_},e.prototype.getOverlayContainer=function(){return this.overlayContainer_},e.prototype.getOverlayContainerStopEvent=function(){return this.overlayContainerStopEvent_},e.prototype.getTilePriority=function(t,e,i,n){var o=this.frameState_;if(!o||!(e in o.wantedTiles))return 1/0;if(!o.wantedTiles[e][t.getKey()])return 1/0;var r=i[0]-o.focus[0],s=i[1]-o.focus[1];return 65536*Math.log(n)+Math.sqrt(r*r+s*s)/n},e.prototype.handleBrowserEvent=function(t,e){var i=e||t.type,n=new nt(i,this,t);this.handleMapBrowserEvent(n)},e.prototype.handleMapBrowserEvent=function(t){if(this.frameState_){this.focus_=t.coordinate,t.frameState=this.frameState_;var e=this.getInteractions().getArray();if(!1!==this.dispatchEvent(t))for(var i=e.length-1;i>=0;i--){var n=e[i];if(n.getActive())if(!n.handleEvent(t))break}}},e.prototype.handlePostRender=function(){var t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){var i=this.maxTilesLoading_,n=i;if(t){var o=t.viewHints;o[Ne]&&(i=this.loadTilesWhileAnimating_?8:0,n=2),o[Ve]&&(i=this.loadTilesWhileInteracting_?8:0,n=2)}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}!t||!this.hasListener(we)||t.animate||this.tileQueue_.getTilesLoading()||function t(e){for(var i=0,n=e.length;i<n;++i){var o=e[i];if("function"==typeof o.getLayers)return t(o.getLayers().getArray());var r=o.getSource();if(r&&r.loading)return!0}return!1}(this.getLayers().getArray())||this.renderer_.dispatchRenderEvent(we,t);for(var r=this.postRenderFunctions_,s=0,a=r.length;s<a;++s)r[s](this,t);r.length=0},e.prototype.handleSizeChanged_=function(){this.render()},e.prototype.handleTargetChanged_=function(){var t;if(this.getTarget()&&(t=this.getTargetElement()),this.keyHandlerKeys_){for(var e=0,i=this.keyHandlerKeys_.length;e<i;++e)S(this.keyHandlerKeys_[e]);this.keyHandlerKeys_=null}if(t){t.appendChild(this.viewport_);var n=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.keyHandlerKeys_=[y(n,G,this.handleBrowserEvent,this),y(n,z,this.handleBrowserEvent,this)],this.handleResize_||(this.handleResize_=this.updateSize.bind(this),window.addEventListener(V,this.handleResize_,!1))}else this.renderer_.removeLayerRenderers(),Ao(this.viewport_),void 0!==this.handleResize_&&(removeEventListener(V,this.handleResize_,!1),this.handleResize_=void 0);this.updateSize()},e.prototype.handleTileChange_=function(){this.render()},e.prototype.handleViewPropertyChanged_=function(){this.render()},e.prototype.handleViewChanged_=function(){this.viewPropertyListenerKey_&&(S(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(S(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);var t=this.getView();t&&(this.viewport_.setAttribute("data-view",r(t)),this.viewPropertyListenerKey_=y(t,l,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=y(t,P,this.handleViewPropertyChanged_,this)),this.render()},e.prototype.handleLayerGroupChanged_=function(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(S),this.layerGroupPropertyListenerKeys_=null);var t=this.getLayerGroup();t&&(this.layerGroupPropertyListenerKeys_=[y(t,l,this.render,this),y(t,P,this.render,this)]),this.render()},e.prototype.isRendered=function(){return!!this.frameState_},e.prototype.renderSync=function(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()},e.prototype.render=function(){void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))},e.prototype.removeControl=function(t){return this.getControls().remove(t)},e.prototype.removeInteraction=function(t){return this.getInteractions().remove(t)},e.prototype.removeLayer=function(t){return this.getLayerGroup().getLayers().remove(t)},e.prototype.removeOverlay=function(t){return this.getOverlays().remove(t)},e.prototype.renderFrame_=function(t){var e,i=this.getSize(),n=this.getView(),o=[1/0,1/0,-1/0,-1/0],s=this.frameState_,a=null;if(void 0!==i&&function(t){return t[0]>0&&t[1]>0}(i)&&n&&n.isDef()){for(var h=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),l=this.getLayerGroup().getLayerStatesArray(),u={},c=0,p=l.length;c<p;++c)u[r(l[c].layer)]=l[c];e=n.getState(this.pixelRatio_),a={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,extent:o,focus:this.focus_?this.focus_:e.center,index:this.frameIndex_++,layerStates:u,layerStatesArray:l,pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:i,skippedFeatureUids:this.skippedFeatureUids_,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:e,viewHints:h,wantedTiles:{}}}if(a&&(a.extent=Oi(e.center,e.resolution,e.rotation,a.size,o)),this.frameState_=a,this.renderer_.renderFrame(a),a){if(a.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,a.postRenderFunctions),s)(!this.previousExtent_||!Xi(this.previousExtent_)&&!Ei(a.extent,this.previousExtent_))&&(this.dispatchEvent(new it(_e,this,s)),this.previousExtent_=Ci(this.previousExtent_));this.previousExtent_&&!a.viewHints[Ne]&&!a.viewHints[Ve]&&!Ei(a.extent,this.previousExtent_)&&(this.dispatchEvent(new it(ge,this,a)),fi(a.extent,this.previousExtent_))}this.dispatchEvent(new it(fe,this,a)),setTimeout(this.handlePostRender.bind(this),0)},e.prototype.setLayerGroup=function(t){this.set(ve,t)},e.prototype.setSize=function(t){this.set(ye,t)},e.prototype.setTarget=function(t){this.set(me,t)},e.prototype.setView=function(t){this.set(xe,t)},e.prototype.skipFeature=function(t){this.skippedFeatureUids_[r(t)]=!0,this.render()},e.prototype.updateSize=function(){var t=this.getTargetElement();if(t){var e=getComputedStyle(t);this.setSize([t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)])}else this.setSize(void 0)},e.prototype.unskipFeature=function(t){delete this.skippedFeatureUids_[r(t)],this.render()},e}(Q);var Qo,$o,tr=function(t){function e(e){t.call(this),this.element=e.element?e.element:null,this.target_=null,this.map_=null,this.listenerKeys=[],this.render=e.render?e.render:R,e.target&&this.setTarget(e.target)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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,i=this.listenerKeys.length;e<i;++e)S(this.listenerKeys[e]);(this.listenerKeys.length=0,this.map_=t,this.map_)&&((this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==R&&this.listenerKeys.push(y(t,fe,this.render,this)),t.render())},e.prototype.setTarget=function(t){this.target_="string"==typeof t?document.getElementById(t):t},e}(Q),er=($o={},function(t){if(Qo||(Qo=document.createElement("div").style),!(t in $o)){Qo.font=t;var e=Qo.fontFamily;if(Qo.font="",!e)return null;$o[t]=e.split(/,\s?/)}return $o[t]});function ir(t,e){return t.visible&&e>=t.minResolution&&e<t.maxResolution}var nr=function(t){function e(e){var i=u({},e);delete i.source,t.call(this,i),this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,e.map&&this.setMap(e.map),y(this,J(No),this.handleSourcePropertyChange_,this);var n=e.source?e.source:null;this.setSource(n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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(No)||null},e.prototype.getSourceState=function(){var t=this.getSource();return t?t.getState():Bo},e.prototype.handleSourceChange_=function(){this.changed()},e.prototype.handleSourcePropertyChange_=function(){this.sourceChangeKey_&&(S(this.sourceChangeKey_),this.sourceChangeKey_=null);var t=this.getSource();t&&(this.sourceChangeKey_=y(t,P,this.handleSourceChange_,this)),this.changed()},e.prototype.setMap=function(t){this.mapPrecomposeKey_&&(S(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(S(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=y(t,Ce,(function(t){var e=t,i=this.getLayerState();i.managed=!1,void 0===this.getZIndex()&&(i.zIndex=1/0),e.frameState.layerStatesArray.push(i),e.frameState.layerStates[r(this)]=i}),this),this.mapRenderKey_=y(this,P,t.render,t),this.changed())},e.prototype.setSource=function(t){this.set(No,t)},e}(Vo);function or(t){this.updateElement_(t.frameState)}var rr=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||or,target:i.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===i.collapsed||i.collapsed,this.overrideCollapsible_=void 0!==i.collapsible,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var n=void 0!==i.className?i.className:"ol-attribution",o=void 0!==i.tipLabel?i.tipLabel:"Attributions",r=void 0!==i.collapseLabel?i.collapseLabel:"»";"string"==typeof r?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r):this.collapseLabel_=r;var s=void 0!==i.label?i.label:"i";"string"==typeof s?(this.label_=document.createElement("span"),this.label_.textContent=s):this.label_=s;var a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=o,h.appendChild(a),y(h,O,this.handleClick_,this);var l=n+" ol-unselectable ol-control"+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible"),u=this.element;u.className=l,u.appendChild(this.ulElement_),u.appendChild(h),this.renderedAttributions_=[],this.renderedVisible_=!0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.collectSourceAttributions_=function(t){for(var e={},i=[],n=t.layerStatesArray,o=t.viewState.resolution,r=0,s=n.length;r<s;++r){var a=n[r];if(ir(a,o)){var h=a.layer.getSource();if(h){var l=h.getAttributions();if(l){var u=l(t);if(u)if(this.overrideCollapsible_||!1!==h.getAttributionsCollapsible()||this.setCollapsible(!1),Array.isArray(u))for(var c=0,p=u.length;c<p;++c)u[c]in e||(i.push(u[c]),e[u[c]]=!0);else u in e||(i.push(u),e[u]=!0)}}}}return i},e.prototype.updateElement_=function(t){if(t){var e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!re(e,this.renderedAttributions_)){Go(this.ulElement_);for(var n=0,o=e.length;n<o;++n){var r=document.createElement("li");r.innerHTML=e[n],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_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Do(this.collapseLabel_,this.label_):Do(this.label_,this.collapseLabel_),this.collapsed_=!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"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e}(tr);function sr(t){var e=t.frameState;if(e){var i=e.viewState.rotation;if(i!=this.rotation_){var n="rotate("+i+"rad)";if(this.autoHide_){var o=this.element.classList.contains("ol-hidden");o||0!==i?o&&0!==i&&this.element.classList.remove("ol-hidden"):this.element.classList.add("ol-hidden")}this.label_.style.msTransform=n,this.label_.style.webkitTransform=n,this.label_.style.transform=n}this.rotation_=i}}var ar=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||sr,target:i.target});var n=void 0!==i.className?i.className:"ol-rotate",o=void 0!==i.label?i.label:"⇧";this.label_=null,"string"==typeof o?(this.label_=document.createElement("span"),this.label_.className="ol-compass",this.label_.textContent=o):(this.label_=o,this.label_.classList.add("ol-compass"));var r=i.tipLabel?i.tipLabel:"Reset rotation",s=document.createElement("button");s.className=n+"-reset",s.setAttribute("type","button"),s.title=r,s.appendChild(this.label_),y(s,O,this.handleClick_,this);var a=n+" ol-unselectable ol-control",h=this.element;h.className=a,h.appendChild(s),this.callResetNorth_=i.resetNorth?i.resetNorth:void 0,this.duration_=void 0!==i.duration?i.duration:250,this.autoHide_=void 0===i.autoHide||i.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add("ol-hidden")}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()},e.prototype.resetNorth_=function(){var t=this.getMap().getView();t&&void 0!==t.getRotation()&&(this.duration_>0?t.animate({rotation:0,duration:this.duration_,easing:$e}):t.setRotation(0))},e}(tr),hr=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),target:i.target});var n=void 0!==i.className?i.className:"ol-zoom",o=void 0!==i.delta?i.delta:1,r=void 0!==i.zoomInLabel?i.zoomInLabel:"+",s=void 0!==i.zoomOutLabel?i.zoomOutLabel:"−",a=void 0!==i.zoomInTipLabel?i.zoomInTipLabel:"Zoom in",h=void 0!==i.zoomOutTipLabel?i.zoomOutTipLabel:"Zoom out",l=document.createElement("button");l.className=n+"-in",l.setAttribute("type","button"),l.title=a,l.appendChild("string"==typeof r?document.createTextNode(r):r),y(l,O,this.handleClick_.bind(this,o));var u=document.createElement("button");u.className=n+"-out",u.setAttribute("type","button"),u.title=h,u.appendChild("string"==typeof s?document.createTextNode(s):s),y(u,O,this.handleClick_.bind(this,-o));var c=n+" ol-unselectable ol-control",p=this.element;p.className=c,p.appendChild(l),p.appendChild(u),this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t,e){e.preventDefault(),this.zoomByDelta_(t)},e.prototype.zoomByDelta_=function(t){var e=this.getMap().getView();if(e){var i=e.getResolution();if(i){var n=e.constrainResolution(i,t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:n,duration:this.duration_,easing:$e})):e.setResolution(n)}}},e}(tr);var lr=function(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0};lr.prototype.begin=function(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0},lr.prototype.update=function(t,e){this.points_.push(t,e,Date.now())},lr.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 i=e-3;i>0&&this.points_[i+2]>t;)i-=3;var n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;var o=this.points_[e]-this.points_[i],r=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(r,o),this.initialVelocity_=Math.sqrt(o*o+r*r)/n,this.initialVelocity_>this.minVelocity_},lr.prototype.getDistance=function(){return(this.minVelocity_-this.initialVelocity_)/this.decay_},lr.prototype.getAngle=function(){return this.angle_};var ur=lr,cr="active";function pr(t,e,i,n){e=t.constrainRotation(e,0),dr(t,e,i,n)}function dr(t,e,i,n){if(void 0!==e){var o=t.getRotation(),r=t.getCenter();void 0!==o&&r&&n>0?t.animate({rotation:e,anchor:i,duration:n,easing:$e}):t.rotate(e,i)}}function fr(t,e,i,n){var o=t.getResolution(),r=t.constrainResolution(o,e,0);if(void 0!==r){var s=t.getResolutions();r=Oe(r,t.getMinResolution()||s[s.length-1],t.getMaxResolution()||s[0])}if(i&&void 0!==r&&r!==o){var a=t.getCenter(),h=t.calculateCenterZoom(r,i);h=t.constrainCenter(h),i=[(r*a[0]-o*h[0])/(r-o),(r*a[1]-o*h[1])/(r-o)]}_r(t,r,i,n)}function _r(t,e,i,n){if(e){var o=t.getResolution(),r=t.getCenter();if(void 0!==o&&r&&e!==o&&n)t.animate({resolution:e,anchor:i,duration:n,easing:$e});else{if(i){var s=t.calculateCenterZoom(e,i);t.setCenter(s)}t.setResolution(e)}}}var gr=function(t){function e(e){t.call(this),e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getActive=function(){return this.get(cr)},e.prototype.getMap=function(){return this.map_},e.prototype.handleEvent=function(t){return!0},e.prototype.setActive=function(t){this.set(cr,t)},e.prototype.setMap=function(t){this.map_=t},e}(Q);function vr(t){var e=!1;if(t.type==ft.DBLCLICK){var i=t.originalEvent,n=t.map,o=t.coordinate,r=i.shiftKey?-this.delta_:this.delta_;fr(n.getView(),r,o,this.duration_),t.preventDefault(),e=!0}return!e}var yr=function(t){function e(e){t.call(this,{handleEvent:vr});var i=e||{};this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(gr),mr=function(t){var e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},xr=function(t){return t.target.getTargetElement()===document.activeElement},Sr=w,Cr=function(t){var e=t.originalEvent;return 0==e.button&&!(at&&ht&&e.ctrlKey)},Er=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},wr=function(t){var e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Tr=function(t){var e=t.originalEvent.target.tagName;return"INPUT"!==e&&"SELECT"!==e&&"TEXTAREA"!==e},Rr=function(t){var e=t.pointerEvent;return Pe(void 0!==e,56),"mouse"==e.pointerType};function br(t){for(var e=t.length,i=0,n=0,o=0;o<e;o++)i+=t[o].clientX,n+=t[o].clientY;return[i/e,n/e]}var Ir=function(t){function e(e){var i=e||{};t.call(this,i),i.handleDownEvent&&(this.handleDownEvent=i.handleDownEvent),i.handleDragEvent&&(this.handleDragEvent=i.handleDragEvent),i.handleMoveEvent&&(this.handleMoveEvent=i.handleMoveEvent),i.handleUpEvent&&(this.handleUpEvent=i.handleUpEvent),i.stopDown&&(this.stopDown=i.stopDown),this.handlingDownUpSequence=!1,this.trackedPointers_={},this.targetPointers=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDownEvent=function(t){return!1},e.prototype.handleDragEvent=function(t){},e.prototype.handleEvent=function(t){if(!t.pointerEvent)return!0;var e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==ft.POINTERDRAG)this.handleDragEvent(t);else if(t.type==ft.POINTERUP){var i=this.handleUpEvent(t);this.handlingDownUpSequence=i&&this.targetPointers.length>0}}else if(t.type==ft.POINTERDOWN){var n=this.handleDownEvent(t);n&&t.preventDefault(),this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==ft.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===ft.POINTERDOWN||e===ft.POINTERDRAG||e===ft.POINTERUP}(t)){var e=t.pointerEvent,i=e.pointerId.toString();t.type==ft.POINTERUP?delete this.trackedPointers_[i]:(t.type==ft.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=p(this.trackedPointers_)}},e}(gr),Fr=function(t){function e(e){t.call(this,{stopDown:T});var i=e||{};this.kinetic_=i.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1,this.condition_=i.condition?i.condition:Er,this.noKinetic_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){this.panning_||(this.panning_=!0,this.getMap().getView().setHint(Ve,1));var e=this.targetPointers,i=br(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){var n=this.lastCentroid[0]-i[0],o=i[1]-this.lastCentroid[1],r=t.map.getView(),s=[n,o];Je(s,r.getResolution()),qe(s,r.getRotation()),He(s,r.getCenter()),s=r.constrainCenter(s),r.setCenter(s)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length},e.prototype.handleUpEvent=function(t){var e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){var n=this.kinetic_.getDistance(),o=this.kinetic_.getAngle(),r=i.getCenter(),s=e.getPixelFromCoordinate(r),a=e.getCoordinateFromPixel([s[0]-n*Math.cos(o),s[1]-n*Math.sin(o)]);i.animate({center:i.constrainCenter(a),duration:500,easing:$e})}return this.panning_&&(this.panning_=!1,i.setHint(Ve,-1)),!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.setCenter(t.frameState.viewState.center),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1},e}(Ir),Mr=function(t){function e(e){var i=e||{};t.call(this,{stopDown:T}),this.condition_=i.condition?i.condition:mr,this.lastAngle_=void 0,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){if(Rr(t)){var e=t.map,i=e.getView();if(i.getConstraints().rotation!==We){var n=e.getSize(),o=t.pixel,r=Math.atan2(n[1]/2-o[1],o[0]-n[0]/2);if(void 0!==this.lastAngle_){var s=r-this.lastAngle_,a=i.getRotation();dr(i,a-s)}this.lastAngle_=r}}},e.prototype.handleUpEvent=function(t){if(!Rr(t))return!0;var e=t.map.getView();e.setHint(Ve,-1);var i=e.getRotation();return pr(e,i,void 0,this.duration_),!1},e.prototype.handleDownEvent=function(t){return!!Rr(t)&&(!(!Cr(t)||!this.condition_(t))&&(t.map.getView().setHint(Ve,1),this.lastAngle_=void 0,!0))},e}(Ir),Pr=function(t){function e(e){t.call(this),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.setMap(null)},e.prototype.render_=function(){var t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"},e.prototype.setMap=function(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);var e=this.element_.style;e.left=e.top=e.width=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_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixel,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new bo([i])},e.prototype.getGeometry=function(){return this.geometry_},e}(E),Lr="boxstart",kr="boxdrag",Or="boxend",Dr=function(t){function e(e,i,n){t.call(this,e),this.coordinate=i,this.mapBrowserEvent=n}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(F);function Ar(){var t,e,i=this.getMap(),n=i.getView(),o=i.getSize(),r=this.getGeometry().getExtent();if(this.out_){var s=n.calculateExtent(o),a=(t=[i.getPixelFromCoordinate(Mi(r)),i.getPixelFromCoordinate(zi(r))],Ri(Ci(e),t));Wi(s,1/n.getResolutionForExtent(a,o)),r=s}var h=n.constrainResolution(n.getResolutionForExtent(r,o)),l=Li(r);l=n.constrainCenter(l),n.animate({resolution:h,center:l,duration:this.duration_,easing:$e})}var Gr=function(t){function e(e){var i=e||{},n=i.condition?i.condition:wr;t.call(this,{condition:n,className:i.className||"ol-dragzoom",onBoxEnd:Ar}),this.duration_=void 0!==i.duration?i.duration:200,this.out_=void 0!==i.out&&i.out}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(function(t){function e(e){t.call(this);var i=e||{};this.box_=new Pr(i.className||"ol-dragbox"),this.minArea_=void 0!==i.minArea?i.minArea:64,this.onBoxEnd_=i.onBoxEnd?i.onBoxEnd:R,this.startPixel_=null,this.condition_=i.condition?i.condition:Sr,this.boxEndCondition_=i.boxEndCondition?i.boxEndCondition:this.defaultBoxEndCondition}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.defaultBoxEndCondition=function(t,e,i){var n=i[0]-e[0],o=i[1]-e[1];return n*n+o*o>=this.minArea_},e.prototype.getGeometry=function(){return this.box_.getGeometry()},e.prototype.handleDragEvent=function(t){Rr(t)&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Dr(kr,t.coordinate,t)))},e.prototype.handleUpEvent=function(t){return!Rr(t)||(this.box_.setMap(null),this.boxEndCondition_(t,this.startPixel_,t.pixel)&&(this.onBoxEnd_(t),this.dispatchEvent(new Dr(Or,t.coordinate,t))),!1)},e.prototype.handleDownEvent=function(t){return!!Rr(t)&&(!(!Cr(t)||!this.condition_(t))&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Dr(Lr,t.coordinate,t)),!0))},e}(Ir)),zr=37,Kr=38,jr=39,Xr=40;function Wr(t){var e=!1;if(t.type==G){var i=t.originalEvent.keyCode;if(this.condition_(t)&&(i==Xr||i==zr||i==jr||i==Kr)){var n=t.map.getView(),o=n.getResolution()*this.pixelDelta_,r=0,s=0;i==Xr?s=-o:i==zr?r=-o:i==jr?r=o:s=o;var a=[r,s];qe(a,n.getRotation()),function(t,e,i){var n=t.getCenter();if(n){var o=t.constrainCenter([n[0]+e[0],n[1]+e[1]]);i?t.animate({duration:i,easing:ei,center:o}):t.setCenter(o)}}(n,a,this.duration_),t.preventDefault(),e=!0}}return!e}var Yr=function(t){function e(e){t.call(this,{handleEvent:Wr});var i=e||{};this.defaultCondition_=function(t){return Er(t)&&Tr(t)},this.condition_=void 0!==i.condition?i.condition:this.defaultCondition_,this.duration_=void 0!==i.duration?i.duration:100,this.pixelDelta_=void 0!==i.pixelDelta?i.pixelDelta:128}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(gr);function Nr(t){var e=!1;if(t.type==G||t.type==z){var i=t.originalEvent.charCode;if(this.condition_(t)&&(i=="+".charCodeAt(0)||i=="-".charCodeAt(0))){var n=t.map,o=i=="+".charCodeAt(0)?this.delta_:-this.delta_;fr(n.getView(),o,void 0,this.duration_),t.preventDefault(),e=!0}}return!e}var Vr=function(t){function e(e){t.call(this,{handleEvent:Nr});var i=e||{};this.condition_=i.condition?i.condition:Tr,this.delta_=i.delta?i.delta:1,this.duration_=void 0!==i.duration?i.duration:100}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(gr),Br="trackpad",Zr="wheel",Ur=function(t){function e(e){var i=e||{};t.call(this,i),this.delta_=0,this.duration_=void 0!==i.duration?i.duration:250,this.timeout_=void 0!==i.timeout?i.timeout:80,this.useAnchor_=void 0===i.useAnchor||i.useAnchor,this.constrainResolution_=i.constrainResolution||!1,this.condition_=i.condition?i.condition:Sr,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.trackpadDeltaPerZoom_=300,this.trackpadZoomBuffer_=1.5}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.decrementInteractingHint_=function(){this.trackpadTimeoutId_=void 0,this.getMap().getView().setHint(Ve,-1)},e.prototype.handleEvent=function(t){if(!this.condition_(t))return!0;var e=t.type;if(e!==Z&&e!==Y)return!0;t.preventDefault();var i,n=t.map,o=t.originalEvent;if(this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==Z?(i=o.deltaY,rt&&o.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(i/=lt),o.deltaMode===WheelEvent.DOM_DELTA_LINE&&(i*=40)):t.type==Y&&(i=-o.wheelDeltaY,st&&(i/=3)),0===i)return!1;var r=Date.now();if(void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?Br:Zr),this.mode_===Br){var s=n.getView();this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):s.setHint(Ve,1),this.trackpadTimeoutId_=setTimeout(this.decrementInteractingHint_.bind(this),this.trackpadEventGap_);var a=s.getResolution()*Math.pow(2,i/this.trackpadDeltaPerZoom_),h=s.getMinResolution(),l=s.getMaxResolution(),u=0;if(a<h?(a=Math.max(a,h/this.trackpadZoomBuffer_),u=1):a>l&&(a=Math.min(a,l*this.trackpadZoomBuffer_),u=-1),this.lastAnchor_){var c=s.calculateCenterZoom(a,this.lastAnchor_);s.setCenter(s.constrainCenter(c))}return s.setResolution(a),0===u&&this.constrainResolution_&&s.animate({resolution:s.constrainResolution(a,i>0?-1:1),easing:$e,anchor:this.lastAnchor_,duration:this.duration_}),u>0?s.animate({resolution:h,easing:$e,anchor:this.lastAnchor_,duration:500}):u<0&&s.animate({resolution:l,easing:$e,anchor:this.lastAnchor_,duration:500}),this.startTime_=r,!1}this.delta_+=i;var p=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),p),!1},e.prototype.handleWheelZoom_=function(t){var e=t.getView();e.getAnimating()&&e.cancelAnimations();fr(e,-Oe(this.delta_,-1,1),this.lastAnchor_,this.duration_),this.mode_=void 0,this.delta_=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}(gr),Hr=function(t){function e(e){var i=e||{},n=i;n.stopDown||(n.stopDown=T),t.call(this,n),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==i.threshold?i.threshold:.3,this.duration_=void 0!==i.duration?i.duration:250}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=0,i=this.targetPointers[0],n=this.targetPointers[1],o=Math.atan2(n.clientY-i.clientY,n.clientX-i.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!==We){var h=s.getViewport().getBoundingClientRect(),l=br(this.targetPointers);if(l[0]-=h.left,l[1]-=h.top,this.anchor_=s.getCoordinateFromPixel(l),this.rotating_){var u=a.getRotation();s.render(),dr(a,u+e,this.anchor_)}}},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();if(e.setHint(Ve,-1),this.rotating_){var i=e.getRotation();pr(e,i,this.anchor_,this.duration_)}return!1}return!0},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().setHint(Ve,1),!0}return!1},e}(Ir),qr=function(t){function e(e){var i=e||{},n=i;n.stopDown||(n.stopDown=T),t.call(this,n),this.constrainResolution_=i.constrainResolution||!1,this.anchor_=null,this.duration_=void 0!==i.duration?i.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleDragEvent=function(t){var e=1,i=this.targetPointers[0],n=this.targetPointers[1],o=i.clientX-n.clientX,r=i.clientY-n.clientY,s=Math.sqrt(o*o+r*r);void 0!==this.lastDistance_&&(e=this.lastDistance_/s),this.lastDistance_=s;var a=t.map,h=a.getView(),l=h.getResolution(),u=h.getMaxResolution(),c=h.getMinResolution(),p=l*e;p>u?(e=u/l,p=u):p<c&&(e=c/l,p=c),1!=e&&(this.lastScaleDelta_=e);var d=a.getViewport().getBoundingClientRect(),f=br(this.targetPointers);f[0]-=d.left,f[1]-=d.top,this.anchor_=a.getCoordinateFromPixel(f),a.render(),_r(h,p,this.anchor_)},e.prototype.handleUpEvent=function(t){if(this.targetPointers.length<2){var e=t.map.getView();e.setHint(Ve,-1);var i=e.getResolution();if(this.constrainResolution_||i<e.getMinResolution()||i>e.getMaxResolution()){var n=this.lastScaleDelta_-1;!function(t,e,i,n,o){e=t.constrainResolution(e,0,o),_r(t,e,i,n)}(e,i,this.anchor_,this.duration_,n)}return!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().setHint(Ve,1),!0}return!1},e}(Ir);var Jr=0,Qr=1,$r=2,ts=3,es=function(t){function e(e,i,n,o,r){var s=void 0!==r?Jr:$r;t.call(this,e,i,n,s),this.loader_=void 0!==r?r:null,this.canvas_=o,this.error_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getError=function(){return this.error_},e.prototype.handleLoad_=function(t){t?(this.error_=t,this.state=ts):this.state=$r,this.changed()},e.prototype.load=function(){this.state==Jr&&(this.state=Qr,this.changed(),this.loader_(this.handleLoad_.bind(this)))},e.prototype.getImage=function(){return this.canvas_},e}(function(t){function e(e,i,n,o){t.call(this),this.extent=e,this.pixelRatio_=n,this.resolution=i,this.state=o}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){this.dispatchEvent(P)},e.prototype.getExtent=function(){return this.extent},e.prototype.getImage=function(){return n()},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(){n()},e}(M)),is="IMAGE",ns="TILE",os="VECTOR_TILE",rs="VECTOR",ss="image",as="vector",hs=function(t){function e(e,i,n,o,r){t.call(this,e),this.vectorContext=i,this.frameState=n,this.context=o,this.glContext=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(F),ls=function(t){function e(e){t.call(this),this.highWaterMark=void 0!==e?e:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},e.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(L)},e.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},e.prototype.forEach=function(t,e){for(var i=this.oldest_;i;)t.call(e,i.value_,i.key_,this),i=i.newer},e.prototype.get=function(t){var e=this.entries_[t];return Pe(void 0!==e,15),e===this.newest_||(e===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(e.newer.older=e.older,e.older.newer=e.newer),e.newer=null,e.older=this.newest_,this.newest_.newer=e,this.newest_=e),e.value_},e.prototype.remove=function(t){var e=this.entries_[t];return Pe(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_},e.prototype.getCount=function(){return this.count_},e.prototype.getKeys=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e},e.prototype.getValues=function(){var t,e=new Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e},e.prototype.peekLast=function(){return this.oldest_.value_},e.prototype.peekLastKey=function(){return this.oldest_.key_},e.prototype.peekFirstKey=function(){return this.newest_.key_},e.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_},e.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},e.prototype.set=function(t,e){Pe(!(t in this.entries_),16);var i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_},e.prototype.setSize=function(t){this.highWaterMark=t},e.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},e}(M),us=[0,0,0,1],cs=[],ps=[0,0,0,1],ds=[0,0,0,0],fs=new ls,_s={},gs=null,vs={},ys=function(){var t,e,i=_s,n=["monospace","serif"],o=n.length,r="wmytzilWMYTZIL@#/&?$%10";function s(t){for(var i=ms(),s=100;s<=700;s+=300){for(var a=s+" ",h=!0,l=0;l<o;++l){var u=n[l];if(i.font=a+"32px "+u,e=i.measureText(r).width,t!=u){i.font=a+"32px "+t+","+u;var c=i.measureText(r).width;h=h&&c!=e}}if(h)return!0}return!1}function a(){var e=!0;for(var n in i)i[n]<60&&(s(n)?(i[n]=60,c(vs),gs=null,fs.clear()):(++i[n],e=!1));e&&(clearInterval(t),t=void 0)}return function(e){var n=er(e);if(n)for(var o=0,r=n.length;o<r;++o){var h=n[o];h in i||(i[h]=60,s(h)||(i[h]=0,void 0===t&&(t=setInterval(a,32))))}}}();function ms(){return gs||(gs=Lo(1,1)),gs}var xs,Ss,Cs=(Ss=vs,function(t){var e=Ss[t];return null==e&&(xs||((xs=document.createElement("span")).textContent="M",xs.style.margin=xs.style.padding="0 !important",xs.style.position="absolute !important",xs.style.left="-99999px !important"),xs.style.font=t,document.body.appendChild(xs),e=Ss[t]=xs.offsetHeight,document.body.removeChild(xs)),e});function Es(t,e){var i=ms();return t!=i.font&&(i.font=t),i.measureText(e).width}function ws(t,e,i,n){0!==e&&(t.translate(i,n),t.rotate(e),t.translate(-i,-n))}var Ts=[1,0,0,1,0,0];function Rs(t,e,i,n,o,r,s,a,h,l,u){var c;1!=i&&(c=t.globalAlpha,t.globalAlpha=c*i),e&&t.setTransform.apply(t,e),t.drawImage(n,o,r,s,a,h,l,s*u,a*u),c&&(t.globalAlpha=c),e&&t.setTransform.apply(t,Ts)}var bs=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Is=/^([a-z]*)$/i;function Fs(t){return"string"==typeof t?t:Ps(t)}!function(){var t={},e=0}();function Ms(t){return t[0]=Oe(t[0]+.5|0,0,255),t[1]=Oe(t[1]+.5|0,0,255),t[2]=Oe(t[2]+.5|0,0,255),t[3]=Oe(t[3],0,1),t}function Ps(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var i=t[1];i!=(0|i)&&(i=i+.5|0);var n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:t[3])+")"}function Ls(t){return Array.isArray(t)?Ps(t):t}var ks=function(){};ks.prototype.drawCustom=function(t,e,i){},ks.prototype.drawGeometry=function(t){},ks.prototype.setStyle=function(t){},ks.prototype.drawCircle=function(t,e){},ks.prototype.drawFeature=function(t,e){},ks.prototype.drawGeometryCollection=function(t,e){},ks.prototype.drawLineString=function(t,e){},ks.prototype.drawMultiLineString=function(t,e){},ks.prototype.drawMultiPoint=function(t,e){},ks.prototype.drawMultiPolygon=function(t,e){},ks.prototype.drawPoint=function(t,e){},ks.prototype.drawPolygon=function(t,e){},ks.prototype.drawText=function(t,e){},ks.prototype.setFillStrokeStyle=function(t,e){},ks.prototype.setImageStyle=function(t,e){},ks.prototype.setTextStyle=function(t,e){};var Os=ks,Ds=function(t){function e(e,i,n,o,r){t.call(this),this.context_=e,this.pixelRatio_=i,this.extent_=n,this.transform_=o,this.viewRotation_=r,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=0,this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=0,this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawImages_=function(t,e,i,n){if(this.image_){var o=nn(t,e,i,2,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.tmpLocalTransform_,a=r.globalAlpha;1!=this.imageOpacity_&&(r.globalAlpha=a*this.imageOpacity_);var h=this.imageRotation_;this.imageRotateWithView_&&(h+=this.viewRotation_);for(var l=0,u=o.length;l<u;l+=2){var c=o[l]-this.imageAnchorX_,p=o[l+1]-this.imageAnchorY_;if(0!==h||1!=this.imageScale_){var d=c+this.imageAnchorX_,f=p+this.imageAnchorY_;Zn(s,d,f,this.imageScale_,this.imageScale_,h,-d,-f),r.setTransform.apply(r,s)}r.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,c,p,this.imageWidth_,this.imageHeight_)}0===h&&1==this.imageScale_||r.setTransform(1,0,0,1,0,0),1!=this.imageOpacity_&&(r.globalAlpha=a)}},e.prototype.drawText_=function(t,e,i,n){if(this.textState_&&""!==this.text_){this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);var o=nn(t,e,i,n,this.transform_,this.pixelCoordinates_),r=this.context_,s=this.textRotation_;for(this.textRotateWithView_&&(s+=this.viewRotation_);e<i;e+=n){var a=o[e]+this.textOffsetX_,h=o[e+1]+this.textOffsetY_;if(0!==s||1!=this.textScale_){var l=Zn(this.tmpLocalTransform_,a,h,this.textScale_,this.textScale_,s,-a,-h);r.setTransform.apply(r,l)}this.textStrokeState_&&r.strokeText(this.text_,a,h),this.textFillState_&&r.fillText(this.text_,a,h)}0===s&&1==this.textScale_||r.setTransform(1,0,0,1,0,0)}},e.prototype.moveToLineTo_=function(t,e,i,n,o){var r=this.context_,s=nn(t,e,i,n,this.transform_,this.pixelCoordinates_);r.moveTo(s[0],s[1]);var a=s.length;o&&(a-=2);for(var h=2;h<a;h+=2)r.lineTo(s[h],s[h+1]);return o&&r.closePath(),i},e.prototype.drawRings_=function(t,e,i,n){for(var o=0,r=i.length;o<r;++o)e=this.moveToLineTo_(t,e,i[o],n,!0);return e},e.prototype.drawCircle=function(t){if(ji(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,i){var n=t.getFlatCoordinates();if(n){var o=t.getStride();return nn(n,0,n.length,o,e,i)}return null}(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],o=Math.sqrt(i*i+n*n),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.drawGeometry=function(t){switch(t.getType()){case Yi:this.drawPoint(t);break;case Ni:this.drawLineString(t);break;case Bi:this.drawPolygon(t);break;case Zi:this.drawMultiPoint(t);break;case Ui:this.drawMultiLineString(t);break;case Hi:this.drawMultiPolygon(t);break;case qi:this.drawGeometryCollection(t);break;case Ji:this.drawCircle(t)}},e.prototype.drawFeature=function(t,e){var i=e.getGeometryFunction()(t);i&&ji(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))},e.prototype.drawGeometryCollection=function(t){for(var e=t.getGeometriesArray(),i=0,n=e.length;i<n;++i)this.drawGeometry(e[i])},e.prototype.drawPoint=function(t){var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawMultiPoint=function(t){var e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)},e.prototype.drawLineString=function(t){if(ji(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){var n=t.getFlatMidpoint();this.drawText_(n,0,2,2)}}},e.prototype.drawMultiLineString=function(t){var e=t.getExtent();if(ji(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);var i=this.context_,n=t.getFlatCoordinates(),o=0,r=t.getEnds(),s=t.getStride();i.beginPath();for(var a=0,h=r.length;a<h;++a)o=this.moveToLineTo_(n,o,r[a],s,!1);i.stroke()}if(""!==this.text_){var l=t.getFlatMidpoints();this.drawText_(l,0,l.length,2)}}},e.prototype.drawPolygon=function(t){if(ji(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 i=t.getFlatInteriorPoint();this.drawText_(i,0,2,2)}}},e.prototype.drawMultiPolygon=function(t){if(ji(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_,i=t.getOrientedFlatCoordinates(),n=0,o=t.getEndss(),r=t.getStride();e.beginPath();for(var s=0,a=o.length;s<a;++s){var h=o[s];n=this.drawRings_(i,n,h,r)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){var l=t.getFlatInteriorPoints();this.drawText_(l,0,l.length,2)}}},e.prototype.setContextFillState_=function(t){var e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})},e.prototype.setContextStrokeState_=function(t){var e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=e.lineCap=t.lineCap),ut&&(re(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=e.lineDashOffset=t.lineDashOffset)),i.lineJoin!=t.lineJoin&&(i.lineJoin=e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,ut&&(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_,i=this.contextTextState_,n=t.textAlign?t.textAlign:"center";i?(i.font!=t.font&&(i.font=e.font=t.font),i.textAlign!=n&&(i.textAlign=e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})},e.prototype.setFillStrokeStyle=function(t,e){if(t){var i=t.getColor();this.fillState_={fillStyle:Ls(i||us)}}else this.fillState_=null;if(e){var n=e.getColor(),o=e.getLineCap(),r=e.getLineDash(),s=e.getLineDashOffset(),a=e.getLineJoin(),h=e.getWidth(),l=e.getMiterLimit();this.strokeState_={lineCap:void 0!==o?o:"round",lineDash:r||cs,lineDashOffset:s||0,lineJoin:void 0!==a?a:"round",lineWidth:this.pixelRatio_*(void 0!==h?h:1),miterLimit:void 0!==l?l:10,strokeStyle:Ls(n||ps)}}else this.strokeState_=null},e.prototype.setImageStyle=function(t){if(t){var e=t.getAnchor(),i=t.getImage(1),n=t.getOrigin(),o=t.getSize();this.imageAnchorX_=e[0],this.imageAnchorY_=e[1],this.imageHeight_=o[1],this.image_=i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation(),this.imageScale_=t.getScale()*this.pixelRatio_,this.imageWidth_=o[0]}else this.image_=null},e.prototype.setTextStyle=function(t){if(t){var e=t.getFill();if(e){var i=e.getColor();this.textFillState_={fillStyle:Ls(i||us)}}else this.textFillState_=null;var n=t.getStroke();if(n){var o=n.getColor(),r=n.getLineCap(),s=n.getLineDash(),a=n.getLineDashOffset(),h=n.getLineJoin(),l=n.getWidth(),u=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==r?r:"round",lineDash:s||cs,lineDashOffset:a||0,lineJoin:void 0!==h?h:"round",lineWidth:void 0!==l?l:1,miterLimit:void 0!==u?u:10,strokeStyle:Ls(o||ps)}}else this.textStrokeState_=null;var c=t.getFont(),p=t.getOffsetX(),d=t.getOffsetY(),f=t.getRotateWithView(),_=t.getRotation(),g=t.getScale(),v=t.getText(),y=t.getTextAlign(),m=t.getTextBaseline();this.textState_={font:void 0!==c?c:"10px sans-serif",textAlign:void 0!==y?y:"center",textBaseline:void 0!==m?m:"middle"},this.text_=void 0!==v?v:"",this.textOffsetX_=void 0!==p?this.pixelRatio_*p:0,this.textOffsetY_=void 0!==d?this.pixelRatio_*d:0,this.textRotateWithView_=void 0!==f&&f,this.textRotation_=void 0!==_?_:0,this.textScale_=this.pixelRatio_*(void 0!==g?g:1)}else this.text_=""},e}(Os),As=function(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32};function Gs(t,e,i){return e+":"+t+":"+(i?Fs(i):"null")}As.prototype.clear=function(){this.cache_={},this.cacheSize_=0},As.prototype.expire=function(){if(this.cacheSize_>this.maxCacheSize_){var t=0;for(var e in this.cache_){var i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}},As.prototype.get=function(t,e,i){var n=Gs(t,e,i);return n in this.cache_?this.cache_[n]:null},As.prototype.set=function(t,e,i,n){var o=Gs(t,e,i);this.cache_[o]=n,++this.cacheSize_},As.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()};var zs=new As;function Ks(t,e){zs.expire()}function js(t,e){return t.zIndex-e.zIndex}var Xs=[],Ws=function(t){function e(e){t.call(this,e);var i=e.getViewport();this.context_=Lo(),this.canvas_=this.context_.canvas,this.canvas_.style.width="100%",this.canvas_.style.height="100%",this.canvas_.style.display="block",this.canvas_.className="ol-unselectable",i.insertBefore(this.canvas_,i.childNodes[0]||null),this.renderedVisible_=!0,this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispatchRenderEvent=function(t,e){var i=this.getMap(),n=this.context_;if(i.hasListener(t)){var o=e.extent,r=e.pixelRatio,s=e.viewState.rotation,a=this.getTransform(e),h=new Ds(n,r,o,a,s),l=new hs(t,h,e,n,null);i.dispatchEvent(l)}},e.prototype.getTransform=function(t){var e=t.viewState,i=this.canvas_.width/2,n=this.canvas_.height/2,o=t.pixelRatio/e.resolution,r=-o,s=-e.rotation,a=-e.center[0],h=-e.center[1];return Zn(this.transform_,i,n,o,r,s,a,h)},e.prototype.renderFrame=function(t){if(t){var e=this.context_,i=t.pixelRatio,n=Math.round(t.size[0]*i),o=Math.round(t.size[1]*i);this.canvas_.width!=n||this.canvas_.height!=o?(this.canvas_.width=n,this.canvas_.height=o):e.clearRect(0,0,n,o);var r=t.viewState.rotation;this.calculateMatrices2D(t),this.dispatchRenderEvent(Ce,t);var s=t.layerStatesArray;!function(t,e){var i,n=t.length,o=Array(t.length);for(i=0;i<n;i++)o[i]={index:i,value:t[i]};for(o.sort((function(t,i){return e(t.value,i.value)||t.index-i.index})),i=0;i<t.length;i++)t[i]=o[i].value}(s,js),r&&(e.save(),ws(e,r,n/2,o/2));var a,h,l=t.viewState.resolution;for(a=0,h=s.length;a<h;++a){var u=s[a],c=u.layer,p=this.getLayerRenderer(c);ir(u,l)&&u.sourceState==Zo&&(p.prepareFrame(t,u)&&p.composeFrame(t,u,e))}r&&e.restore(),this.dispatchRenderEvent(Se,t),this.renderedVisible_||(this.canvas_.style.display="",this.renderedVisible_=!0),this.scheduleRemoveUnusedLayerRenderers(t),this.scheduleExpireIconCache(t)}else this.renderedVisible_&&(this.canvas_.style.display="none",this.renderedVisible_=!1)},e.prototype.forEachLayerAtPixel=function(t,e,i,n,o,r,s){var a,h,l=e.viewState.resolution,u=e.layerStatesArray,c=u.length,p=Nn(e.pixelToCoordinateTransform,t.slice());for(h=c-1;h>=0;--h){var d=u[h],f=d.layer;if(ir(d,l)&&r.call(s,f))if(a=this.getLayerRenderer(f).forEachLayerAtCoordinate(p,e,i,n,o))return a}},e.prototype.registerLayerRenderers=function(e){t.prototype.registerLayerRenderers.call(this,e);for(var i=0,n=e.length;i<n;++i){var o=e[i];r=o,Xs.indexOf(r)>=0||Xs.push(o)}var r},e}(function(t){function e(e){t.call(this),this.map_=e,this.layerRenderers_={},this.layerRendererListeners_={},this.layerRendererConstructors_=[]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.dispatchRenderEvent=function(t,e){n()},e.prototype.registerLayerRenderers=function(t){this.layerRendererConstructors_.push.apply(this.layerRendererConstructors_,t)},e.prototype.calculateMatrices2D=function(t){var e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Zn(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),function(t){var e,i=(e=t)[0]*e[3]-e[1]*e[2];Pe(0!==i,32);var n=t[0],o=t[1],r=t[2],s=t[3],a=t[4],h=t[5];t[0]=s/i,t[1]=-o/i,t[2]=-r/i,t[3]=n/i,t[4]=(r*h-s*a)/i,t[5]=-(n*h-o*a)/i}(Yn(n,i))},e.prototype.removeLayerRenderers=function(){for(var t in this.layerRenderers_)this.removeLayerRendererByKey_(t).dispose()},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,s,a){var h,l=e.viewState,u=l.resolution;function c(t,i){var s=e.layerStates[r(i)].managed;if(!(r(t)in e.skippedFeatureUids)||s)return n.call(o,t,s?i:null)}var p=l.projection,d=t;if(p.canWrapX()){var f=p.getExtent(),_=Ki(f),g=t[0];if(g<f[0]||g>f[2])d=[g+_*Math.ceil((f[0]-g)/_),t[1]]}var v,y=e.layerStatesArray;for(v=y.length-1;v>=0;--v){var m=y[v],x=m.layer;if(ir(m,u)&&s.call(a,x)){var S=this.getLayerRenderer(x),C=x.getSource();if(C&&(h=S.forEachFeatureAtCoordinate(C.getWrapX()?d:t,e,i,c)),h)return h}}},e.prototype.forEachLayerAtPixel=function(t,e,i,o,r,s,a){return n()},e.prototype.hasFeatureAtCoordinate=function(t,e,i,n,o){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,w,this,n,o)},e.prototype.getLayerRenderer=function(t){var e=r(t);if(e in this.layerRenderers_)return this.layerRenderers_[e];for(var i,n=0,o=this.layerRendererConstructors_.length;n<o;++n){var s=this.layerRendererConstructors_[n];if(s.handles(t)){i=s.create(this,t);break}}if(!i)throw new Error("Unable to create renderer for layer: "+t.getType());return this.layerRenderers_[e]=i,this.layerRendererListeners_[e]=y(i,P,this.handleLayerRendererChange_,this),i},e.prototype.getLayerRendererByKey=function(t){return this.layerRenderers_[t]},e.prototype.getLayerRenderers=function(){return this.layerRenderers_},e.prototype.getMap=function(){return this.map_},e.prototype.handleLayerRendererChange_=function(){this.map_.render()},e.prototype.removeLayerRendererByKey_=function(t){var e=this.layerRenderers_[t];return delete this.layerRenderers_[t],S(this.layerRendererListeners_[t]),delete this.layerRendererListeners_[t],e},e.prototype.removeUnusedLayerRenderers_=function(t,e){for(var i in this.layerRenderers_)e&&i in e.layerStates||this.removeLayerRendererByKey_(i).dispose()},e.prototype.renderFrame=function(t){n()},e.prototype.scheduleExpireIconCache=function(t){t.postRenderFunctions.push(Ks)},e.prototype.scheduleRemoveUnusedLayerRenderers=function(t){for(var e in this.layerRenderers_)if(!(e in t.layerStates))return void t.postRenderFunctions.push(this.removeUnusedLayerRenderers_.bind(this))},e}(E)),Ys=function(t){function e(e){t.call(this,e),this.renderedResolution,this.transform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clip=function(t,e,i){var n=e.pixelRatio,o=e.size[0]*n,r=e.size[1]*n,s=e.viewState.rotation,a=Gi(i),h=zi(i),l=Pi(i),u=Mi(i);Nn(e.coordinateToPixelTransform,a),Nn(e.coordinateToPixelTransform,h),Nn(e.coordinateToPixelTransform,l),Nn(e.coordinateToPixelTransform,u),t.save(),ws(t,-s,o/2,r/2),t.beginPath(),t.moveTo(a[0]*n,a[1]*n),t.lineTo(h[0]*n,h[1]*n),t.lineTo(l[0]*n,l[1]*n),t.lineTo(u[0]*n,u[1]*n),t.clip(),ws(t,s,o/2,r/2)},e.prototype.dispatchComposeEvent_=function(t,e,i,n){var o=this.getLayer();if(o.hasListener(t)){var r=i.size[0]*i.pixelRatio,s=i.size[1]*i.pixelRatio,a=i.viewState.rotation;ws(e,-a,r/2,s/2);var h=void 0!==n?n:this.getTransform(i,0),l=new Ds(e,i.pixelRatio,i.extent,h,i.viewState.rotation),u=new hs(t,l,i,e,null);o.dispatchEvent(u),ws(e,a,r/2,s/2)}},e.prototype.forEachLayerAtCoordinate=function(t,e,i,n,o){return this.forEachFeatureAtCoordinate(t,e,i,w)?n.call(o,this.getLayer(),null):void 0},e.prototype.postCompose=function(t,e,i,n){this.dispatchComposeEvent_(Se,t,e,n)},e.prototype.preCompose=function(t,e,i){this.dispatchComposeEvent_(Ce,t,e,i)},e.prototype.dispatchRenderEvent=function(t,e,i){this.dispatchComposeEvent_(Ee,t,e,i)},e.prototype.getTransform=function(t,e){var i=t.viewState,n=t.pixelRatio,o=n*t.size[0]/2,r=n*t.size[1]/2,s=n/i.resolution,a=-s,h=-i.rotation,l=-i.center[0]+e,u=-i.center[1];return Zn(this.transform_,o,r,s,a,h,l,u)},e.prototype.composeFrame=function(t,e,i){n()},e.prototype.prepareFrame=function(t,e){return n()},e}(function(t){function e(e){t.call(this),this.layer_=e}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createLoadedTileFinder=function(t,e,i){return function(n,o){return t.forEachLoadedTile(e,n,o,(function(t){i[n]||(i[n]={}),i[n][t.tileCoord.toString()]=t}))}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n){},e.prototype.getLayer=function(){return this.layer_},e.prototype.handleImageChange_=function(t){t.target.getState()===$r&&this.renderIfReadyAndVisible()},e.prototype.hasFeatureAtCoordinate=function(t,e){return!1},e.prototype.loadImage=function(t){var e=t.getState();return e!=$r&&e!=ts&&y(t,P,this.handleImageChange_,this),e==Jr&&(t.load(),e=t.getState()),e==$r},e.prototype.renderIfReadyAndVisible=function(){var t=this.getLayer();t.getVisible()&&t.getSourceState()==Zo&&this.changed()},e.prototype.scheduleExpireCache=function(t,e){if(e.canExpireCache()){var i=function(t,e,i){var n=r(t);n in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(i)}},e.prototype.updateUsedTiles=function(t,e,i,n){var o=r(e),s=i.toString();o in t?s in t[o]?t[o][s].extend(n):t[o][s]=n:(t[o]={},t[o][s]=n)},e.prototype.manageTilePyramid=function(t,e,i,n,o,s,a,h,l,u){var c=r(e);c in t.wantedTiles||(t.wantedTiles[c]={});var p,d,f,_,g,v,y=t.wantedTiles[c],m=t.tileQueue;for(v=i.getMinZoom();v<=a;++v)for(d=i.getTileRangeForExtentAndZ(s,v,d),f=i.getResolution(v),_=d.minX;_<=d.maxX;++_)for(g=d.minY;g<=d.maxY;++g)a-v<=h?((p=e.getTile(v,_,g,n,o)).getState()==Te&&(y[p.getKey()]=!0,m.isKeyQueued(p.getKey())||m.enqueue([p,c,i.getTileCoordCenter(p.tileCoord),f])),void 0!==l&&l.call(u,p)):e.useTile(v,_,g,o)},e}(U)),Ns=function(t){function e(e){t.call(this,e),this.coordinateToCanvasPixelTransform=[1,0,0,1,0,0],this.hitCanvasContext_=null}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.composeFrame=function(t,e,i){this.preCompose(i,t);var n=this.getImage();if(n){var o=e.extent,r=void 0!==o&&!vi(o,t.extent)&&ji(o,t.extent);r&&this.clip(i,t,o);var s=this.getImageTransform(),a=i.globalAlpha;i.globalAlpha=e.opacity;var h=s[4],l=s[5],u=n.width*s[0],c=n.height*s[3];u>=.5&&c>=.5&&i.drawImage(n,0,0,+n.width,+n.height,Math.round(h),Math.round(l),Math.round(u),Math.round(c)),i.globalAlpha=a,r&&i.restore()}this.postCompose(i,t,e)},e.prototype.getImage=function(){return n()},e.prototype.getImageTransform=function(){return n()},e.prototype.forEachLayerAtCoordinate=function(t,e,i,n,o){if(this.getImage()){var r=Nn(this.coordinateToCanvasPixelTransform,t.slice());Je(r,e.viewState.resolution/this.renderedResolution),this.hitCanvasContext_||(this.hitCanvasContext_=Lo(1,1)),this.hitCanvasContext_.clearRect(0,0,1,1),this.hitCanvasContext_.drawImage(this.getImage(),r[0],r[1],1,1,0,0,1,1);var s=this.hitCanvasContext_.getImageData(0,0,1,1).data;return s[3]>0?n.call(o,this.getLayer(),s):void 0}},e}(Ys),Vs=function(t){function e(i){if(t.call(this,i),this.image_=null,this.imageTransform_=[1,0,0,1,0,0],this.skippedFeatures_=[],this.vectorRenderer_=null,i.getType()===rs)for(var n=0,o=Xs.length;n<o;++n){var r=Xs[n];if(r!==e&&r.handles(i)){this.vectorRenderer_=new r(i);break}}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.vectorRenderer_&&this.vectorRenderer_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_?this.image_.getImage():null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.prepareFrame=function(t,e){var i,n=t.pixelRatio,o=t.size,r=t.viewState,s=r.center,a=r.resolution,h=this.getLayer().getSource(),l=t.viewHints,c=this.vectorRenderer_,p=t.extent;if(c||void 0===e.extent||(p=Ai(p,e.extent)),!l[Ne]&&!l[Ve]&&!Xi(p)){var d=r.projection,f=this.skippedFeatures_;if(c){var _=c.context,g=u({},t,{size:[Ki(p)/a,Di(p)/a],viewState:u({},t.viewState,{rotation:0})}),v=Object.keys(g.skippedFeatureUids).sort();i=new es(p,a,n,_.canvas,(function(t){!c.prepareFrame(g,e)||!c.replayGroupChanged&&re(f,v)||(_.canvas.width=g.size[0]*n,_.canvas.height=g.size[1]*n,c.compose(_,g,e),f=v,t())}))}else i=h.getImage(p,a,n,d);i&&this.loadImage(i)&&(this.image_=i,this.skippedFeatures_=f)}if(this.image_){var y=(i=this.image_).getExtent(),m=i.getResolution(),x=i.getPixelRatio(),S=n*m/(a*x),C=Zn(this.imageTransform_,n*o[0]/2,n*o[1]/2,S,S,0,x*(y[0]-s[0])/m,x*(s[1]-y[3])/m);Zn(this.coordinateToCanvasPixelTransform,n*o[0]/2-C[4],n*o[1]/2-C[5],n/a,-n/a,0,-s[0],-s[1]),this.renderedResolution=m*n/x}return!!this.image_},e.prototype.forEachFeatureAtCoordinate=function(e,i,n,o){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(e,i,n,o):t.prototype.forEachFeatureAtCoordinate.call(this,e,i,n,o)},e}(Ns);Vs.handles=function(t){return t.getType()===is||t.getType()===rs&&t.getRenderMode()===ss},Vs.create=function(t,e){return new Vs(e)};var Bs=Vs,Zs=function(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n};function Us(t,e,i,n,o){return void 0!==o?(o.minX=t,o.maxX=e,o.minY=i,o.maxY=n,o):new Zs(t,e,i,n)}Zs.prototype.contains=function(t){return this.containsXY(t[1],t[2])},Zs.prototype.containsTileRange=function(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY},Zs.prototype.containsXY=function(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY},Zs.prototype.equals=function(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY},Zs.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)},Zs.prototype.getHeight=function(){return this.maxY-this.minY+1},Zs.prototype.getSize=function(){return[this.getWidth(),this.getHeight()]},Zs.prototype.getWidth=function(){return this.maxX-this.minX+1},Zs.prototype.intersects=function(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY};var Hs=Zs,qs=function(t){function e(e,i){t.call(this,e),this.context=i?null:Lo(),this.oversampling_,this.renderedExtent_=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new Hs(0,0,0,0),this.imageTransform_=[1,0,0,1,0,0],this.zDirection=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.isDrawableTile_=function(t){var e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==be||i==Fe||i==Ie&&!n},e.prototype.getTile=function(t,e,i,n,o){var r=this.getLayer(),s=r.getSource().getTile(t,e,i,n,o);return s.getState()==Ie&&(r.getUseInterimTilesOnError()?r.getPreload()>0&&(this.newTiles_=!0):s.setState(be)),this.isDrawableTile_(s)||(s=s.getInterimTile()),s},e.prototype.prepareFrame=function(t,e){var i=t.pixelRatio,n=t.size,o=t.viewState,s=o.projection,a=o.resolution,h=o.center,l=this.getLayer(),u=l.getSource(),c=u.getRevision(),p=u.getTileGridForProjection(s),d=p.getZForResolution(a,this.zDirection),f=p.getResolution(d),_=Math.round(a/f)||1,g=t.extent;if(void 0!==e.extent&&(g=Ai(g,e.extent)),Xi(g))return!1;var v=p.getTileRangeForExtentAndZ(g,d),y=p.getTileRangeExtent(d,v),m=u.getTilePixelRatio(i),x={};x[d]={};var S,C,E,w=this.createLoadedTileFinder(u,s,x),T=t.viewHints,R=T[Ne]||T[Ve],b=this.tmpExtent,I=this.tmpTileRange_;for(this.newTiles_=!1,C=v.minX;C<=v.maxX;++C)for(E=v.minY;E<=v.maxY;++E)if(!(Date.now()-t.time>16&&R)){if(S=this.getTile(d,C,E,i,s),this.isDrawableTile_(S)){var F=r(this);if(S.getState()==be){x[d][S.tileCoord.toString()]=S;var M=S.inTransition(F);this.newTiles_||!M&&-1!==this.renderedTiles.indexOf(S)||(this.newTiles_=!0)}if(1===S.getAlpha(F,t.time))continue}var P=p.getTileCoordChildTileRange(S.tileCoord,I,b),L=!1;P&&(L=w(d+1,P)),L||p.forEachTileCoordParentTileRange(S.tileCoord,w,null,I,b)}var k=f*i/m*_;if(!(this.renderedResolution&&Date.now()-t.time>16&&R)&&(this.newTiles_||!this.renderedExtent_||!vi(this.renderedExtent_,g)||this.renderedRevision!=c||_!=this.oversampling_||!R&&k!=this.renderedResolution)){var O=this.context;if(O){var D=u.getTilePixelSize(d,i,s),A=Math.round(v.getWidth()*D[0]/_),G=Math.round(v.getHeight()*D[1]/_),z=O.canvas;z.width!=A||z.height!=G?(this.oversampling_=_,z.width=A,z.height=G):((this.renderedExtent_&&!Ei(y,this.renderedExtent_)||this.renderedRevision!=c)&&O.clearRect(0,0,A,G),_=this.oversampling_)}this.renderedTiles.length=0;var K,j,X,W,Y,N,V,B,Z,U,H=Object.keys(x).map(Number);for(H.sort((function(t,e){return t===d?1:e===d?-1:t>e?1:t<e?-1:0})),W=0,Y=H.length;W<Y;++W)for(var q in X=H[W],j=u.getTilePixelSize(X,i,s),K=p.getResolution(X)/f,V=m*u.getGutterForProjection(s),B=x[X])S=B[q],C=((N=p.getTileCoordExtent(S.getTileCoord(),b))[0]-y[0])/f*m/_,E=(y[3]-N[3])/f*m/_,Z=j[0]*K/_,U=j[1]*K/_,this.drawTileImage(S,t,e,C,E,Z,U,V,d===X),this.renderedTiles.push(S);this.renderedRevision=c,this.renderedResolution=f*i/m*_,this.renderedExtent_=y}var J=this.renderedResolution/a,Q=Zn(this.imageTransform_,i*n[0]/2,i*n[1]/2,J,J,0,(this.renderedExtent_[0]-h[0])/this.renderedResolution*i,(h[1]-this.renderedExtent_[3])/this.renderedResolution*i);return Zn(this.coordinateToCanvasPixelTransform,i*n[0]/2-Q[4],i*n[1]/2-Q[5],i/a,-i/a,0,-h[0],-h[1]),this.updateUsedTiles(t.usedTiles,u,d,v),this.manageTilePyramid(t,u,p,i,s,g,d,l.getPreload()),this.scheduleExpireCache(t,u),this.renderedTiles.length>0},e.prototype.drawTileImage=function(t,e,i,n,o,s,a,h,l){var u=this.getTileImage(t);if(u){var c=r(this),p=l?t.getAlpha(c,e.time):1,d=this.getLayer().getSource();1!==p||d.getOpaque(e.viewState.projection)||this.context.clearRect(n,o,s,a);var f=p!==this.context.globalAlpha;f&&(this.context.save(),this.context.globalAlpha=p),this.context.drawImage(u,h,h,u.width-2*h,u.height-2*h,n,o,s,a),f&&this.context.restore(),1!==p?e.animate=!0:l&&t.endTransition(c)}},e.prototype.getImage=function(){var t=this.context;return t?t.canvas:null},e.prototype.getImageTransform=function(){return this.imageTransform_},e.prototype.getTileImage=function(t){return t.getImage()},e}(Ns);qs.handles=function(t){return t.getType()===ns},qs.create=function(t,e){return new qs(e)},qs.prototype.getLayer;var Js=qs,Qs=i(0),$s=i.n(Qs),ta=function(){};ta.prototype.getReplay=function(t,e){return n()},ta.prototype.isEmpty=function(){return n()},ta.prototype.addDeclutter=function(t){return n()};var ea=ta,ia="Circle",na="Default",oa="Image",ra="LineString",sa="Polygon",aa="Text";function ha(t,e,i,n){for(var o=t[e],r=t[e+1],s=0,a=e+n;a<i;a+=n){var h=t[a],l=t[a+1];s+=Math.sqrt((h-o)*(h-o)+(l-r)*(l-r)),o=h,r=l}return s}function la(t,e,i,n,o,r,s,a){for(var h,l,u,c=[],p=t[e]>t[i-n],d=o.length,f=t[e],_=t[e+1],g=t[e+=n],v=t[e+1],y=0,m=Math.sqrt(Math.pow(g-f,2)+Math.pow(v-_,2)),x="",S=0,C=0;C<d;++C){l=p?d-C-1:C;var E=o.charAt(l),w=r(x=p?E+x:x+E)-S;S+=w;for(var T=s+w/2;e<i-n&&y+m<T;)f=g,_=v,g=t[e+=n],v=t[e+1],y+=m,m=Math.sqrt(Math.pow(g-f,2)+Math.pow(v-_,2));var R=T-y,b=Math.atan2(v-_,g-f);if(p&&(b+=b>0?-Math.PI:Math.PI),void 0!==u){var I=b-u;if(I+=I>Math.PI?-2*Math.PI:I<-Math.PI?2*Math.PI:0,Math.abs(I)>a)return null}var F=R/m,M=je(f,g,F),P=je(_,v,F);u==b?(p&&(h[0]=M,h[1]=P,h[2]=w/2),h[4]=x):(S=w,h=[M,P,w/2,b,x=E],p?c.unshift(h):c.push(h),u=b),s+=w}return c}var ua={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},ca=[ua.FILL],pa=[ua.STROKE],da=[ua.BEGIN_PATH],fa=[ua.CLOSE_PATH],_a=ua,ga=[sa,ia,ra,oa,aa,na],va={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},ya=[1/0,1/0,-1/0,-1/0],ma=[1,0,0,1,0,0],xa=function(t){function e(e,i,n,o,r,s){t.call(this),this.declutterTree=s,this.tolerance=e,this.maxExtent=i,this.overlaps=r,this.pixelRatio=o,this.maxLineWidth=0,this.resolution=n,this.alignFill_,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=[],this.pixelCoordinates_=null,this.state={},this.viewRotation_=0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.replayTextBackground_=function(t,e,i,n,o,r,s){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),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())},e.prototype.replayImage_=function(t,e,i,n,o,r,s,a,h,l,u,c,p,d,f,_,g,v){var y=g||v;e-=o*=p,i-=r*=p;var m,x,S,C,E=f+l>n.width?n.width-l:f,w=a+u>n.height?n.height-u:a,T=_[3]+E*p+_[1],R=_[0]+w*p+_[2],b=e-_[3],I=i-_[0];(y||0!==c)&&(m=[b,I],x=[b+T,I],S=[b+T,I+R],C=[b,I+R]);var F=null;if(0!==c){var M=e+o,P=i+r;F=Zn(ma,M,P,1,1,c,-M,-P),Ci(ya),Ti(ya,Nn(ma,m)),Ti(ya,Nn(ma,x)),Ti(ya,Nn(ma,S)),Ti(ya,Nn(ma,C))}else Si(b,I,b+T,I+R,ya);var L=t.canvas,k=v?v[2]*p/2:0,O=ya[0]-k<=L.width&&ya[2]+k>=0&&ya[1]-k<=L.height&&ya[3]+k>=0;if(d&&(e=Math.round(e),i=Math.round(i)),s){if(!O&&1==s[4])return;wi(s,ya);var D=O?[t,F?F.slice(0):null,h,n,l,u,E,w,e,i,p]:null;D&&y&&D.push(g,v,m,x,S,C),s.push(D)}else O&&(y&&this.replayTextBackground_(t,m,x,S,C,g,v),Rs(t,F,h,n,l,u,E,w,e,i,p))},e.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},e.prototype.appendFlatCoordinates=function(t,e,i,n,o,r){var s=this.coordinates.length,a=this.getBufferedMaxExtent();r&&(e+=n);var h,l,u,c=[t[e],t[e+1]],p=[NaN,NaN],d=!0;for(h=e+n;h<i;h+=n)p[0]=t[h],p[1]=t[h+1],(u=mi(a,p))!==l?(d&&(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1]),this.coordinates[s++]=p[0],this.coordinates[s++]=p[1],d=!1):u===ai?(this.coordinates[s++]=p[0],this.coordinates[s++]=p[1],d=!1):d=!0,c[0]=p[0],c[1]=p[1],l=u;return(o&&d||h===e+n)&&(this.coordinates[s++]=c[0],this.coordinates[s++]=c[1]),s},e.prototype.drawCustomCoordinates_=function(t,e,i,n,o){for(var r=0,s=i.length;r<s;++r){var a=i[r],h=this.appendFlatCoordinates(t,e,a,n,!1,!1);o.push(h),e=a}return e},e.prototype.drawCustom=function(t,e,i){this.beginGeometry(t,e);var n,o,r,s,a,h=t.getType(),l=t.getStride(),u=this.coordinates.length;if(h==Hi){n=(t=t).getOrientedFlatCoordinates(),s=[];var c=t.getEndss();a=0;for(var p=0,d=c.length;p<d;++p){var f=[];a=this.drawCustomCoordinates_(n,a,c[p],l,f),s.push(f)}this.instructions.push([_a.CUSTOM,u,s,t,i,ho])}else h==Bi||h==Ui?(r=[],n=h==Bi?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),a=this.drawCustomCoordinates_(n,0,t.getEnds(),l,r),this.instructions.push([_a.CUSTOM,u,r,t,i,ao])):h==Ni||h==Zi?(n=t.getFlatCoordinates(),o=this.appendFlatCoordinates(n,0,n.length,l,!1,!1),this.instructions.push([_a.CUSTOM,u,o,t,i,so])):h==Yi&&(n=t.getFlatCoordinates(),this.coordinates.push(n[0],n[1]),o=this.coordinates.length,this.instructions.push([_a.CUSTOM,u,o,t,i]));this.endGeometry(t,e)},e.prototype.beginGeometry=function(t,e){this.beginGeometryInstruction1_=[_a.BEGIN_GEOMETRY,e,0],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[_a.BEGIN_GEOMETRY,e,0],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)},e.prototype.finish=function(){},e.prototype.fill_=function(t){if(this.alignFill_){var e=Nn(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.setTransform.apply(t,Ts)},e.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],ut&&(t.lineDashOffset=e[7],t.setLineDash(e[6]))},e.prototype.renderDeclutter_=function(t,e){if(t&&t.length>5){var i=t[4];if(1==i||i==t.length-5){var n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(n)){this.declutterTree.insert(n);for(var o=5,r=t.length;o<r;++o){var s=t[o];s&&(s.length>11&&this.replayTextBackground_(s[0],s[13],s[14],s[15],s[16],s[11],s[12]),Rs.apply(void 0,s))}}t.length=5,Ci(t)}}},e.prototype.replay_=function(t,e,i,n,o,s,a){var h;this.pixelCoordinates_&&re(e,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=nn(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),Yn(this.renderedTransform_,e));for(var l,u,c,p,f,_,g,v,y,m,x,S,C=!d(i),E=0,w=n.length,T=0,R=0,b=0,I=null,F=null,M=this.coordinateCache_,P=this.viewRotation_,L={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:P},k=this.instructions!=n||this.overlaps?0:200;E<w;){var O=n[E];switch(O[0]){case _a.BEGIN_GEOMETRY:m=O[1],C&&i[r(m)]||!m.getGeometry()?E=O[2]:void 0===a||ji(a,m.getGeometry().getExtent())?++E:E=O[2]+1;break;case _a.BEGIN_PATH:R>k&&(this.fill_(t),R=0),b>k&&(t.stroke(),b=0),R||b||(t.beginPath(),p=f=NaN),++E;break;case _a.CIRCLE:var D=h[T=O[1]],A=h[T+1],G=h[T+2]-D,z=h[T+3]-A,K=Math.sqrt(G*G+z*z);t.moveTo(D+K,A),t.arc(D,A,K,0,2*Math.PI,!0),++E;break;case _a.CLOSE_PATH:t.closePath(),++E;break;case _a.CUSTOM:T=O[1],l=O[2];var j=O[3],X=O[4],W=6==O.length?O[5]:void 0;L.geometry=j,L.feature=m,E in M||(M[E]=[]);var Y=M[E];W?W(h,T,l,2,Y):(Y[0]=h[T],Y[1]=h[T+1],Y.length=2),X(Y,L),++E;break;case _a.DRAW_IMAGE:T=O[1],l=O[2],y=O[3],u=O[4],c=O[5],v=s?null:O[6];var N=O[7],V=O[8],B=O[9],Z=O[10],U=O[11],H=O[12],q=O[13],J=O[14],Q=void 0,$=void 0,tt=void 0;for(O.length>16?(Q=O[15],$=O[16],tt=O[17]):(Q=ds,$=tt=!1),U&&(H+=P);T<l;T+=2)this.replayImage_(t,h[T],h[T+1],y,u,c,v,N,V,B,Z,H,q,o,J,Q,$?I:null,tt?F:null);this.renderDeclutter_(v,m),++E;break;case _a.DRAW_CHARS:var et=O[1],it=O[2],nt=O[3];v=s?null:O[4];var ot=O[5],rt=O[6],st=O[7],at=O[8],ht=O[9],lt=O[10],ut=O[11],ct=O[12],pt=O[13],dt=O[14],ft=ha(h,et,it,2),_t=at(ct);if(ot||_t<=ft){var gt=this.textStates[pt].textAlign,vt=la(h,et,it,2,ct,at,(ft-_t)*va[gt],st);if(vt){var yt=void 0,mt=void 0,xt=void 0,St=void 0,Ct=void 0;if(lt)for(yt=0,mt=vt.length;yt<mt;++yt)xt=(Ct=vt[yt])[4],St=this.getImage(xt,pt,"",lt),u=Ct[2]+ut,c=nt*St.height+2*(.5-nt)*ut-ht,this.replayImage_(t,Ct[0],Ct[1],St,u,c,v,St.height,1,0,0,Ct[3],dt,!1,St.width,ds,null,null);if(rt)for(yt=0,mt=vt.length;yt<mt;++yt)xt=(Ct=vt[yt])[4],St=this.getImage(xt,pt,rt,""),u=Ct[2],c=nt*St.height-ht,this.replayImage_(t,Ct[0],Ct[1],St,u,c,v,St.height,1,0,0,Ct[3],dt,!1,St.width,ds,null,null)}}this.renderDeclutter_(v,m),++E;break;case _a.END_GEOMETRY:if(void 0!==s){var Et=s(m=O[1]);if(Et)return Et}++E;break;case _a.FILL:k?R++:this.fill_(t),++E;break;case _a.MOVE_TO_LINE_TO:for(T=O[1],l=O[2],x=h[T],g=(S=h[T+1])+.5|0,(_=x+.5|0)===p&&g===f||(t.moveTo(x,S),p=_,f=g),T+=2;T<l;T+=2)_=(x=h[T])+.5|0,g=(S=h[T+1])+.5|0,T!=l-2&&_===p&&g===f||(t.lineTo(x,S),p=_,f=g);++E;break;case _a.SET_FILL_STYLE:I=O,this.alignFill_=O[2],R&&(this.fill_(t),R=0,b&&(t.stroke(),b=0)),t.fillStyle=O[1],++E;break;case _a.SET_STROKE_STYLE:F=O,b&&(t.stroke(),b=0),this.setStrokeStyle_(t,O),++E;break;case _a.STROKE:k?b++:t.stroke(),++E;break;default:++E}}R&&this.fill_(t),b&&t.stroke()},e.prototype.replay=function(t,e,i,n,o){this.viewRotation_=i,this.replay_(t,e,n,this.instructions,o,void 0,void 0)},e.prototype.replayHitDetection=function(t,e,i,n,o,r){return this.viewRotation_=i,this.replay_(t,e,n,this.hitDetectionInstructions,!0,o,r)},e.prototype.reverseHitDetectionInstructions=function(){var t,e=this.hitDetectionInstructions;e.reverse();var i,n,o=e.length,r=-1;for(t=0;t<o;++t)(n=(i=e[t])[0])==_a.END_GEOMETRY?r=t:n==_a.BEGIN_GEOMETRY&&(i[2]=t,ne(this.hitDetectionInstructions,r,t),r=-1)},e.prototype.setFillStrokeStyle=function(t,e){var i=this.state;if(t){var n=t.getColor();i.fillStyle=Ls(n||us)}else i.fillStyle=void 0;if(e){var o=e.getColor();i.strokeStyle=Ls(o||ps);var r=e.getLineCap();i.lineCap=void 0!==r?r:"round";var s=e.getLineDash();i.lineDash=s?s.slice():cs;var a=e.getLineDashOffset();i.lineDashOffset=a||0;var h=e.getLineJoin();i.lineJoin=void 0!==h?h:"round";var l=e.getWidth();i.lineWidth=void 0!==l?l:1;var u=e.getMiterLimit();i.miterLimit=void 0!==u?u:10,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0},e.prototype.createFill=function(t,e){var i=t.fillStyle,n=[_a.SET_FILL_STYLE,i];return"string"!=typeof i&&n.push(!0),n},e.prototype.applyStroke=function(t){this.instructions.push(this.createStroke(t))},e.prototype.createStroke=function(t){return[_a.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,i){var n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(void 0!==n&&this.instructions.push(e.call(this,t,i)),t.currentFillStyle=n)},e.prototype.updateStrokeStyle=function(t,e){var i=t.strokeStyle,n=t.lineCap,o=t.lineDash,r=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||o!=t.currentLineDash&&!re(t.currentLineDash,o)||t.currentLineDashOffset!=r||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=h)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=o,t.currentLineDashOffset=r,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=h)},e.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var i=[_a.END_GEOMETRY,e];this.instructions.push(i),this.hitDetectionInstructions.push(i)},e.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=fi(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;di(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},e}(Os),Sa=function(t){function e(e,i,n,o,r,s){t.call(this,e,i,n,o,r,s),this.declutterGroup_=null,this.hitDetectionImage_=null,this.image_=null,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawCoordinates_=function(t,e,i,n){return this.appendFlatCoordinates(t,e,i,n,!1,!1)},e.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([_a.DRAW_IMAGE,o,r,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([_a.DRAW_IMAGE,o,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var i=t.getFlatCoordinates(),n=t.getStride(),o=this.coordinates.length,r=this.drawCoordinates_(i,0,i.length,n);this.instructions.push([_a.DRAW_IMAGE,o,r,this.image_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_*this.pixelRatio,this.width_]),this.hitDetectionInstructions.push([_a.DRAW_IMAGE,o,r,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_]),this.endGeometry(t,e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,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},e.prototype.setImageStyle=function(t,e){var i=t.getAnchor(),n=t.getSize(),o=t.getHitDetectionImage(1),r=t.getImage(1),s=t.getOrigin();this.anchorX_=i[0],this.anchorY_=i[1],this.declutterGroup_=e,this.hitDetectionImage_=o,this.image_=r,this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=s[0],this.originY_=s[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScale(),this.width_=n[0]},e}(xa),Ca=function(t){function e(e,i,n,o,r,s){t.call(this,e,i,n,o,r,s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawFlatCoordinates_=function(t,e,i,n){var o=this.coordinates.length,r=this.appendFlatCoordinates(t,e,i,n,!1,!1),s=[_a.MOVE_TO_LINE_TO,o,r];return this.instructions.push(s),this.hitDetectionInstructions.push(s),i},e.prototype.drawLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([_a.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],da);var r=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(r,0,r.length,s),this.hitDetectionInstructions.push(pa),this.endGeometry(t,e)}},e.prototype.drawMultiLineString=function(t,e){var i=this.state,n=i.strokeStyle,o=i.lineWidth;if(void 0!==n&&void 0!==o){this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([_a.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],da);for(var r=t.getEnds(),s=t.getFlatCoordinates(),a=t.getStride(),h=0,l=0,u=r.length;l<u;++l)h=this.drawFlatCoordinates_(s,h,r[l],a);this.hitDetectionInstructions.push(pa),this.endGeometry(t,e)}},e.prototype.finish=function(){var t=this.state;null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(pa),this.reverseHitDetectionInstructions(),this.state=null},e.prototype.applyStroke=function(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(pa),e.lastStroke=this.coordinates.length),e.lastStroke=0,t.prototype.applyStroke.call(this,e),this.instructions.push(da)},e}(xa),Ea=function(t){function e(e,i,n,o,r,s){t.call(this,e,i,n,o,r,s)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawFlatCoordinatess_=function(t,e,i,n){var o=this.state,r=void 0!==o.fillStyle,s=null!=o.strokeStyle,a=i.length;this.instructions.push(da),this.hitDetectionInstructions.push(da);for(var h=0;h<a;++h){var l=i[h],u=this.coordinates.length,c=this.appendFlatCoordinates(t,e,l,n,!0,!s),p=[_a.MOVE_TO_LINE_TO,u,c];this.instructions.push(p),this.hitDetectionInstructions.push(p),s&&(this.instructions.push(fa),this.hitDetectionInstructions.push(fa)),e=l}return r&&(this.instructions.push(ca),this.hitDetectionInstructions.push(ca)),s&&(this.instructions.push(pa),this.hitDetectionInstructions.push(pa)),e},e.prototype.drawCircle=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_a.SET_FILL_STYLE,Fs(us)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_a.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getFlatCoordinates(),s=t.getStride(),a=this.coordinates.length;this.appendFlatCoordinates(r,0,r.length,s,!1,!1);var h=[_a.CIRCLE,a];this.instructions.push(da,h),this.hitDetectionInstructions.push(da,h),this.hitDetectionInstructions.push(ca),void 0!==i.fillStyle&&this.instructions.push(ca),void 0!==i.strokeStyle&&(this.instructions.push(pa),this.hitDetectionInstructions.push(pa)),this.endGeometry(t,e)}},e.prototype.drawPolygon=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_a.SET_FILL_STYLE,Fs(us)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_a.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);var r=t.getEnds(),s=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(s,0,r,a),this.endGeometry(t,e)}},e.prototype.drawMultiPolygon=function(t,e){var i=this.state,n=i.fillStyle,o=i.strokeStyle;if(void 0!==n||void 0!==o){this.setFillStrokeStyles_(t),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([_a.SET_FILL_STYLE,Fs(us)]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([_a.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);for(var r=t.getEndss(),s=t.getOrientedFlatCoordinates(),a=t.getStride(),h=0,l=0,u=r.length;l<u;++l)h=this.drawFlatCoordinatess_(s,h,r[l],a);this.endGeometry(t,e)}},e.prototype.finish=function(){this.reverseHitDetectionInstructions(),this.state=null;var t=this.tolerance;if(0!==t)for(var e=this.coordinates,i=0,n=e.length;i<n;++i)e[i]=uo(e[i],t)},e.prototype.setFillStrokeStyles_=function(t){var e=this.state;void 0!==e.fillStyle&&this.updateFillStyle(e,this.createFill,t),void 0!==e.strokeStyle&&this.updateStrokeStyle(e,this.applyStroke)},e}(xa);function wa(t,e,i,n,o){var r,s,a,h,l,u,c,p,d,f=i,_=i,g=0,v=0,y=i;for(r=i;r<n;r+=o){var m=e[r],x=e[r+1];void 0!==h&&(p=m-h,d=x-l,a=Math.sqrt(p*p+d*d),void 0!==u&&(v+=s,Math.acos((u*p+c*d)/(s*a))>t&&(v>g&&(g=v,f=y,_=r),v=0,y=r-o)),s=a,u=p,c=d),h=m,l=x}return(v+=a)>g?[y,r]:[f,_]}var Ta="line";var Ra={Circle:Ea,Default:xa,Image:Sa,LineString:Ca,Polygon:Ea,Text:function(t){function e(e,i,n,o,r,s){t.call(this,e,i,n,o,r,s),this.declutterGroup_,this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.widths_={},fs.prune()}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.drawText=function(t,e){var i=this.textFillState_,n=this.textStrokeState_,o=this.textState_;if(""!==this.text_&&o&&(i||n)){var r,s,a=this.coordinates.length,h=t.getType(),l=null,u=2,c=2;if(o.placement===Ta){if(!ji(this.getBufferedMaxExtent(),t.getExtent()))return;var p;if(l=t.getFlatCoordinates(),c=t.getStride(),h==Ni)p=[l.length];else if(h==Ui)p=t.getEnds();else if(h==Bi)p=t.getEnds().slice(0,1);else if(h==Hi){var d=t.getEndss();for(p=[],r=0,s=d.length;r<s;++r)p.push(d[r][0])}this.beginGeometry(t,e);for(var f,_=o.textAlign,g=0,v=0,y=p.length;v<y;++v){if(null==_){var m=wa(o.maxAngle,l,g,p[v],c);g=m[0],f=m[1]}else f=p[v];for(r=g;r<f;r+=c)this.coordinates.push(l[r],l[r+1]);u=this.coordinates.length,g=p[v],this.drawChars_(a,u,this.declutterGroup_),a=u}this.endGeometry(t,e)}else{var x=this.getImage(this.text_,this.textKey_,this.fillKey_,this.strokeKey_),S=x.width/this.pixelRatio;switch(h){case Yi:case Zi:u=(l=t.getFlatCoordinates()).length;break;case Ni:l=t.getFlatMidpoint();break;case Ji:l=t.getCenter();break;case Ui:u=(l=t.getFlatMidpoints()).length;break;case Bi:if(l=t.getFlatInteriorPoint(),!o.overflow&&l[2]/this.resolution<S)return;c=3;break;case Hi:var C=t.getFlatInteriorPoints();for(l=[],r=0,s=C.length;r<s;r+=3)(o.overflow||C[r+2]/this.resolution>=S)&&l.push(C[r],C[r+1]);if(0==(u=l.length))return}u=this.appendFlatCoordinates(l,0,u,c,!1,!1),(o.backgroundFill||o.backgroundStroke)&&(this.setFillStrokeStyle(o.backgroundFill,o.backgroundStroke),o.backgroundFill&&(this.updateFillStyle(this.state,this.createFill,t),this.hitDetectionInstructions.push(this.createFill(this.state,t))),o.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e),this.drawTextImage_(x,a,u),this.endGeometry(t,e)}}},e.prototype.getImage=function(t,e,i,n){var o,r=n+e+t+i+this.pixelRatio;if(!fs.containsKey(r)){var s=n?this.strokeStates[n]||this.textStrokeState_:null,a=i?this.fillStates[i]||this.textFillState_:null,h=this.textStates[e]||this.textState_,l=this.pixelRatio,u=h.scale*l,c=va[h.textAlign||"center"],p=n&&s.lineWidth?s.lineWidth:0,d=t.split("\n"),f=d.length,_=[],g=function(t,e,i){for(var n=e.length,o=0,r=0;r<n;++r){var s=Es(t,e[r]);o=Math.max(o,s),i.push(s)}return o}(h.font,d,_),v=Cs(h.font),y=v*f,m=g+p,x=Lo(Math.ceil(m*u),Math.ceil((y+p)*u));o=x.canvas,fs.set(r,o),1!=u&&x.scale(u,u),x.font=h.font,n&&(x.strokeStyle=s.strokeStyle,x.lineWidth=p,x.lineCap=s.lineCap,x.lineJoin=s.lineJoin,x.miterLimit=s.miterLimit,ut&&s.lineDash.length&&(x.setLineDash(s.lineDash),x.lineDashOffset=s.lineDashOffset)),i&&(x.fillStyle=a.fillStyle),x.textBaseline="middle",x.textAlign="center";var S,C=.5-c,E=c*o.width/u+C*p;if(n)for(S=0;S<f;++S)x.strokeText(d[S],E+C*_[S],.5*(p+v)+S*v);if(i)for(S=0;S<f;++S)x.fillText(d[S],E+C*_[S],.5*(p+v)+S*v)}return fs.get(r)},e.prototype.drawTextImage_=function(t,e,i){var n=this.textState_,o=this.textStrokeState_,r=this.pixelRatio,s=va[n.textAlign||"center"],a=va[n.textBaseline],h=o&&o.lineWidth?o.lineWidth:0,l=s*t.width/r+2*(.5-s)*h,u=a*t.height/r+2*(.5-a)*h;this.instructions.push([_a.DRAW_IMAGE,e,i,t,(l-this.textOffsetX_)*r,(u-this.textOffsetY_)*r,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1,t.width,n.padding==ds?ds:n.padding.map((function(t){return t*r})),!!n.backgroundFill,!!n.backgroundStroke]),this.hitDetectionInstructions.push([_a.DRAW_IMAGE,e,i,t,(l-this.textOffsetX_)*r,(u-this.textOffsetY_)*r,this.declutterGroup_,t.height,1,0,0,this.textRotateWithView_,this.textRotation_,1/r,t.width,n.padding,!!n.backgroundFill,!!n.backgroundStroke])},e.prototype.drawChars_=function(t,e,i){var n=this.textStrokeState_,o=this.textState_,r=this.textFillState_,s=this.strokeKey_;n&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:n.strokeStyle,lineCap:n.lineCap,lineDashOffset:n.lineDashOffset,lineWidth:n.lineWidth,lineJoin:n.lineJoin,miterLimit:n.miterLimit,lineDash:n.lineDash}));var a=this.textKey_;this.textKey_ in this.textStates||(this.textStates[this.textKey_]={font:o.font,textAlign:o.textAlign||"center",scale:o.scale});var h=this.fillKey_;r&&(h in this.fillStates||(this.fillStates[h]={fillStyle:r.fillStyle}));var l=this.pixelRatio,u=va[o.textBaseline],c=this.textOffsetY_*l,p=this.text_,d=o.font,f=o.scale,_=n?n.lineWidth*f/2:0,g=this.widths_[d];g||(this.widths_[d]=g={}),this.instructions.push([_a.DRAW_CHARS,t,e,u,i,o.overflow,h,o.maxAngle,function(t){var e=g[t];return e||(e=g[t]=Es(d,t)),e*f*l},c,s,_*l,p,a,1]),this.hitDetectionInstructions.push([_a.DRAW_CHARS,t,e,u,i,o.overflow,h,o.maxAngle,function(t){var e=g[t];return e||(e=g[t]=Es(d,t)),e*f},c,s,_,p,a,1/l])},e.prototype.setTextStyle=function(t,e){var i,n,o;if(t){this.declutterGroup_=e;var s=t.getFill();s?((n=this.textFillState_)||(n=this.textFillState_={}),n.fillStyle=Ls(s.getColor()||us)):n=this.textFillState_=null;var a=t.getStroke();if(a){(o=this.textStrokeState_)||(o=this.textStrokeState_={});var h=a.getLineDash(),l=a.getLineDashOffset(),u=a.getWidth(),c=a.getMiterLimit();o.lineCap=a.getLineCap()||"round",o.lineDash=h?h.slice():cs,o.lineDashOffset=void 0===l?0:l,o.lineJoin=a.getLineJoin()||"round",o.lineWidth=void 0===u?1:u,o.miterLimit=void 0===c?10:c,o.strokeStyle=Ls(a.getColor()||ps)}else o=this.textStrokeState_=null;i=this.textState_;var p=t.getFont()||"10px sans-serif";ys(p);var d=t.getScale();i.overflow=t.getOverflow(),i.font=p,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.textBaseline=t.getTextBaseline()||"middle",i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||ds,i.scale=void 0===d?1:d;var f=t.getOffsetX(),_=t.getOffsetY(),g=t.getRotateWithView(),v=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===f?0:f,this.textOffsetY_=void 0===_?0:_,this.textRotateWithView_=void 0!==g&&g,this.textRotation_=void 0===v?0:v,this.strokeKey_=o?("string"==typeof o.strokeStyle?o.strokeStyle:r(o.strokeStyle))+o.lineCap+o.lineDashOffset+"|"+o.lineWidth+o.lineJoin+o.miterLimit+"["+o.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+r(n.fillStyle):""}else this.text_=""},e}(xa)},ba=function(t){function e(e,i,n,o,r,s,a){t.call(this),this.declutterTree_=s,this.declutterGroup_=null,this.tolerance_=e,this.maxExtent_=i,this.overlaps_=r,this.pixelRatio_=o,this.resolution_=n,this.renderBuffer_=a,this.replaysByZIndex_={},this.hitDetectionContext_=Lo(1,1),this.hitDetectionTransform_=[1,0,0,1,0,0]}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addDeclutter=function(t){var e=null;return this.declutterTree_&&(t?(e=this.declutterGroup_)[4]++:(e=this.declutterGroup_=[1/0,1/0,-1/0,-1/0]).push(1)),e},e.prototype.clip=function(t,e){var i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()},e.prototype.hasReplays=function(t){for(var e in this.replaysByZIndex_)for(var i=this.replaysByZIndex_[e],n=0,o=t.length;n<o;++n)if(t[n]in i)return!0;return!1},e.prototype.finish=function(){for(var t in this.replaysByZIndex_){var e=this.replaysByZIndex_[t];for(var i in e)e[i].finish()}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o,r,s){var a,h=2*(n=Math.round(n))+1,l=Zn(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),u=this.hitDetectionContext_;u.canvas.width!==h||u.canvas.height!==h?(u.canvas.width=h,u.canvas.height=h):u.clearRect(0,0,h,h),void 0!==this.renderBuffer_&&(Ti(a=[1/0,1/0,-1/0,-1/0],t),di(a,e*(this.renderBuffer_+n),a));var c,p,d=function(t){if(void 0!==Ia[t])return Ia[t];for(var e=2*t+1,i=new Array(e),n=0;n<e;n++)i[n]=new Array(e);var o=t,r=0,s=0;for(;o>=r;)Fa(i,t+o,t+r),Fa(i,t+r,t+o),Fa(i,t-r,t+o),Fa(i,t-o,t+r),Fa(i,t-o,t-r),Fa(i,t-r,t-o),Fa(i,t+r,t-o),Fa(i,t+o,t-r),r++,2*((s+=1+2*r)-o)+1>0&&(s+=1-2*(o-=1));return Ia[t]=i,i}(n);function f(t){for(var e=u.getImageData(0,0,h,h).data,i=0;i<h;i++)for(var n=0;n<h;n++)if(d[i][n]&&e[4*(n*h+i)+3]>0){var o=void 0;return(!c||p!=oa&&p!=aa||-1!==c.indexOf(t))&&(o=r(t)),o||void u.clearRect(0,0,h,h)}}this.declutterTree_&&(c=this.declutterTree_.all().map((function(t){return t.value})));var _,g,v,y,m,x=Object.keys(this.replaysByZIndex_).map(Number);for(x.sort(ee),_=x.length-1;_>=0;--_){var S=x[_].toString();for(v=this.replaysByZIndex_[S],g=ga.length-1;g>=0;--g)if(void 0!==(y=v[p=ga[g]]))if(!s||p!=oa&&p!=aa){if(m=y.replayHitDetection(u,l,i,o,f,a))return m}else{var C=s[S];C?C.push(y,l.slice(0)):s[S]=[y,l.slice(0)]}}},e.prototype.getClipCoords=function(t){var e=this.maxExtent_,i=e[0],n=e[1],o=e[2],r=e[3],s=[i,n,i,r,o,r,o,n];return nn(s,0,8,2,t,s),s},e.prototype.getReplay=function(t,e){var i=void 0!==t?t.toString():"0",n=this.replaysByZIndex_[i];void 0===n&&(n={},this.replaysByZIndex_[i]=n);var o=n[e];void 0===o&&(o=new(0,Ra[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),n[e]=o);return o},e.prototype.getReplays=function(){return this.replaysByZIndex_},e.prototype.isEmpty=function(){return d(this.replaysByZIndex_)},e.prototype.replay=function(t,e,i,n,o,r,s){var a=Object.keys(this.replaysByZIndex_).map(Number);a.sort(ee),t.save(),this.clip(t,e);var h,l,u,c,p,d,f=r||ga;for(h=0,l=a.length;h<l;++h){var _=a[h].toString();for(p=this.replaysByZIndex_[_],u=0,c=f.length;u<c;++u){var g=f[u];if(d=p[g],void 0!==d)if(!s||g!=oa&&g!=aa)d.replay(t,e,i,n,o);else{var v=s[_];v?v.push(d,e.slice(0)):s[_]=[d,e.slice(0)]}}}t.restore()},e}(ea),Ia={0:[[!0]]};function Fa(t,e,i){var n,o=Math.floor(t.length/2);if(e>=o)for(n=o;n<e;n++)t[n][i]=!0;else if(e<o)for(n=e+1;n<o;n++)t[n][i]=!0}var Ma=ba,Pa={Point:function(t,e,i,n){var o=i.getImage();if(o){if(o.getImageState()!=$r)return;var r=t.getReplay(i.getZIndex(),oa);r.setImageStyle(o,t.addDeclutter(!1)),r.drawPoint(e,n)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),aa);a.setTextStyle(s,t.addDeclutter(!!o)),a.drawText(e,n)}},LineString:function(t,e,i,n){var o=i.getStroke();if(o){var r=t.getReplay(i.getZIndex(),ra);r.setFillStrokeStyle(null,o),r.drawLineString(e,n)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),aa);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,n)}},Polygon:function(t,e,i,n){var o=i.getFill(),r=i.getStroke();if(o||r){var s=t.getReplay(i.getZIndex(),sa);s.setFillStrokeStyle(o,r),s.drawPolygon(e,n)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),aa);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,n)}},MultiPoint:function(t,e,i,n){var o=i.getImage();if(o){if(o.getImageState()!=$r)return;var r=t.getReplay(i.getZIndex(),oa);r.setImageStyle(o,t.addDeclutter(!1)),r.drawMultiPoint(e,n)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),aa);a.setTextStyle(s,t.addDeclutter(!!o)),a.drawText(e,n)}},MultiLineString:function(t,e,i,n){var o=i.getStroke();if(o){var r=t.getReplay(i.getZIndex(),ra);r.setFillStrokeStyle(null,o),r.drawMultiLineString(e,n)}var s=i.getText();if(s){var a=t.getReplay(i.getZIndex(),aa);a.setTextStyle(s,t.addDeclutter(!1)),a.drawText(e,n)}},MultiPolygon:function(t,e,i,n){var o=i.getFill(),r=i.getStroke();if(r||o){var s=t.getReplay(i.getZIndex(),sa);s.setFillStrokeStyle(o,r),s.drawMultiPolygon(e,n)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),aa);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,n)}},GeometryCollection:function(t,e,i,n){var o,r,s=e.getGeometriesArray();for(o=0,r=s.length;o<r;++o){(0,Pa[s[o].getType()])(t,s[o],i,n)}},Circle:function(t,e,i,n){var o=i.getFill(),r=i.getStroke();if(o||r){var s=t.getReplay(i.getZIndex(),ia);s.setFillStrokeStyle(o,r),s.drawCircle(e,n)}var a=i.getText();if(a){var h=t.getReplay(i.getZIndex(),aa);h.setTextStyle(a,t.addDeclutter(!1)),h.drawText(e,n)}}};function La(t,e){return parseInt(r(t),10)-parseInt(r(e),10)}function ka(t,e){var i=Oa(t,e);return i*i}function Oa(t,e){return.5*t/e}function Da(t,e,i,n,o,r){var s=!1,a=i.getImage();if(a){var h=a.getImageState();h==$r||h==ts?a.unlistenImageChange(o,r):(h==Jr&&a.load(),h=a.getImageState(),a.listenImageChange(o,r),s=!0)}return function(t,e,i,n){var o=i.getGeometryFunction()(e);if(!o)return;var r=o.getSimplifiedGeometry(n);if(i.getRenderer())!function t(e,i,n,o){if(i.getType()==qi){for(var r=i.getGeometries(),s=0,a=r.length;s<a;++s)t(e,r[s],n,o);return}e.getReplay(n.getZIndex(),na).drawCustom(i,o,n.getRenderer())}(t,r,i,e);else{(0,Pa[r.getType()])(t,r,i,e)}}(t,e,i,n),s}var Aa=function(t){function e(e){t.call(this,e),this.declutterTree_=e.getDeclutter()?$s()(9,void 0):null,this.dirty_=!1,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.context=Lo(),y(fs,L,this.handleFontsChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){x(fs,L,this.handleFontsChanged_,this),t.prototype.disposeInternal.call(this)},e.prototype.compose=function(t,e,i){var n=e.extent,o=e.pixelRatio,r=i.managed?e.skippedFeatureUids:{},s=e.viewState,a=s.projection,h=s.rotation,l=a.getExtent(),u=this.getLayer().getSource(),c=this.getTransform(e,0),p=i.extent,d=void 0!==p;d&&this.clip(t,e,p);var f=this.replayGroup_;if(f&&!f.isEmpty()){this.declutterTree_&&this.declutterTree_.clear();var _,g=this.getLayer(),v=0,y=0,m=1!==i.opacity,x=g.hasListener(Ee);if(m||x){var S=t.canvas.width,C=t.canvas.height;if(h){var E=Math.round(Math.sqrt(S*S+C*C));v=(E-S)/2,y=(E-C)/2,S=C=E}this.context.canvas.width=S,this.context.canvas.height=C,_=this.context}else _=t;var w=_.globalAlpha;m||(_.globalAlpha=i.opacity),_!=t&&_.translate(v,y);var T=e.viewHints,R=!(T[Ne]||T[Ve]),b=e.size[0]*o,I=e.size[1]*o;if(ws(_,-h,b/2,I/2),f.replay(_,c,h,r,R),u.getWrapX()&&a.canWrapX()&&!vi(l,n)){for(var F,M=n[0],P=Ki(l),L=0;M<l[0];)F=P*--L,c=this.getTransform(e,F),f.replay(_,c,h,r,R),M+=P;for(L=0,M=n[2];M>l[2];)F=P*++L,c=this.getTransform(e,F),f.replay(_,c,h,r,R),M-=P}if(ws(_,h,b/2,I/2),x&&this.dispatchRenderEvent(_,e,c),_!=t){if(m){var k=t.globalAlpha;t.globalAlpha=i.opacity,t.drawImage(_.canvas,-v,-y),t.globalAlpha=k}else t.drawImage(_.canvas,-v,-y);_.translate(-v,-y)}m||(_.globalAlpha=w)}d&&t.restore()},e.prototype.composeFrame=function(t,e,i){var n=this.getTransform(t,0);this.preCompose(i,t,n),this.compose(i,t,e),this.postCompose(i,t,e,n)},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){if(this.replayGroup_){var s=e.viewState.resolution,a=e.viewState.rotation,h=this.getLayer(),l={};return this.replayGroup_.forEachFeatureAtCoordinate(t,s,a,i,{},(function(t){var e=r(t);if(!(e in l))return l[e]=!0,n.call(o,t,h)}),null)}},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.prepareFrame=function(t,e){var i=this.getLayer(),n=i.getSource(),o=t.viewHints[Ne],r=t.viewHints[Ve],s=i.getUpdateWhileAnimating(),a=i.getUpdateWhileInteracting();if(!this.dirty_&&!s&&o||!a&&r)return!0;var h=t.extent,l=t.viewState,u=l.projection,c=l.resolution,p=t.pixelRatio,d=i.getRevision(),f=i.getRenderBuffer(),_=i.getRenderOrder();void 0===_&&(_=La);var g=di(h,f*c),v=l.projection.getExtent();if(n.getWrapX()&&l.projection.canWrapX()&&!vi(v,t.extent)){var y=Ki(v),m=Math.max(Ki(g)/2,y);g[0]=v[0]-m,g[2]=v[2]+m}if(!this.dirty_&&this.renderedResolution_==c&&this.renderedRevision_==d&&this.renderedRenderOrder_==_&&vi(this.renderedExtent_,g))return this.replayGroupChanged=!1,!0;this.replayGroup_=null,this.dirty_=!1;var x=new Ma(Oa(c,p),g,c,p,n.getOverlaps(),this.declutterTree_,i.getRenderBuffer());n.loadFeatures(g,c,u);var S=function(t){var e,n=t.getStyleFunction()||i.getStyleFunction();if(n&&(e=n(t,c)),e){var o=this.renderFeature(t,c,p,e,x);this.dirty_=this.dirty_||o}}.bind(this);if(_){var C=[];n.forEachFeatureInExtent(g,(function(t){C.push(t)})),C.sort(_);for(var E=0,w=C.length;E<w;++E)S(C[E])}else n.forEachFeatureInExtent(g,S);return x.finish(),this.renderedResolution_=c,this.renderedRevision_=d,this.renderedRenderOrder_=_,this.renderedExtent_=g,this.replayGroup_=x,this.replayGroupChanged=!0,!0},e.prototype.renderFeature=function(t,e,i,n,o){if(!n)return!1;var r=!1;if(Array.isArray(n))for(var s=0,a=n.length;s<a;++s)r=Da(o,t,n[s],ka(e,i),this.handleStyleImageChange_,this)||r;else r=Da(o,t,n,ka(e,i),this.handleStyleImageChange_,this);return r},e}(Ys);Aa.handles=function(t){return t.getType()===rs},Aa.create=function(t,e){return new Aa(e)};var Ga=Aa,za="image",Ka="vector",ja={image:[sa,ia,ra,oa,aa],hybrid:[sa,ra]},Xa={image:[na],hybrid:[oa,aa,na],vector:ga},Wa=function(t){function e(e){t.call(this,e,!0),this.declutterTree_=e.getDeclutter()?$s()(9,void 0):null,this.dirty_=!1,this.renderedLayerRevision_,this.tmpTransform_=[1,0,0,1,0,0];var i=e.getRenderMode();this.zDirection=i===Ka?1:0,i!==Ka&&(this.context=Lo()),y(fs,L,this.handleFontsChanged_,this)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){x(fs,L,this.handleFontsChanged_,this),t.prototype.disposeInternal.call(this)},e.prototype.getTile=function(e,i,n,o,r){var s=t.prototype.getTile.call(this,e,i,n,o,r);return s.getState()===be&&(this.createReplayGroup_(s,o,r),this.context&&this.renderTileImage_(s,o,r)),s},e.prototype.getTileImage=function(t){var e=this.getLayer();return t.getImage(e)},e.prototype.prepareFrame=function(e,i){var n=this.getLayer().getRevision();return this.renderedLayerRevision_!=n&&(this.renderedTiles.length=0),this.renderedLayerRevision_=n,t.prototype.prepareFrame.call(this,e,i)},e.prototype.createReplayGroup_=function(t,e,i){var n=this,o=this.getLayer(),r=o.getRevision(),s=o.getRenderOrder()||null,a=t.getReplayState(o);if(a.dirty||a.renderedRevision!=r||a.renderedRenderOrder!=s){for(var h=o.getSource(),l=h.getTileGrid(),u=h.getTileGridForProjection(i).getResolution(t.tileCoord[0]),c=t.extent,p=function(r,p){var d=t.getTile(t.tileKeys[r]);if(d.getState()==be){var f=d.tileCoord,_=l.getTileCoordExtent(f),g=Ai(c,_),v=Ei(_,g)?null:di(g,o.getRenderBuffer()*u,n.tmpExtent),y=d.getProjection(),m=!1;Dn(i,y)||(m=!0,d.setProjection(i)),a.dirty=!1;var x=new Ma(0,g,u,e,h.getOverlaps(),n.declutterTree_,o.getRenderBuffer()),S=ka(u,e),C=function(t){var e,i=t.getStyleFunction()||o.getStyleFunction();if(i&&(e=i(t,u)),e){var n=this.renderFeature(t,S,e,x);this.dirty_=this.dirty_||n,a.dirty=a.dirty||n}},E=d.getFeatures();s&&s!==a.renderedRenderOrder&&E.sort(s);for(var w=0,T=E.length;w<T;++w){var R=E[w];m&&(y.getUnits()==an.TILE_PIXELS&&(y.setWorldExtent(_),y.setExtent(d.getExtent())),R.getGeometry().transform(y,i)),v&&!ji(v,R.getGeometry().getExtent())||C.call(n,R)}x.finish(),d.setReplayGroup(o,t.tileCoord.toString(),x)}},d=0,f=t.tileKeys.length;d<f;++d)p(d);a.renderedRevision=r,a.renderedRenderOrder=s}},e.prototype.forEachFeatureAtCoordinate=function(t,e,i,n,o){var s=e.viewState.resolution,a=e.viewState.rotation;i=null==i?0:i;var h,l,u,c,p=this.getLayer(),d={},f=this.renderedTiles;for(u=0,c=f.length;u<c;++u){var _=f[u];if(gi(h=di(_.extent,i*s,h),t))for(var g=0,v=_.tileKeys.length;g<v;++g){var y=_.getTile(_.tileKeys[g]);if(y.getState()==be){var m=y.getReplayGroup(p,_.tileCoord.toString());l=l||m.forEachFeatureAtCoordinate(t,s,a,i,{},(function(t){var e=r(t);if(!(e in d))return d[e]=!0,n.call(o,t,p)}),null)}}}return l},e.prototype.getReplayTransform_=function(t,e){var i=this.getLayer().getSource().getTileGrid(),n=t.tileCoord,o=i.getResolution(n[0]),r=e.viewState,s=e.pixelRatio,a=r.resolution/s,h=i.getTileCoordExtent(n,this.tmpExtent),l=r.center,u=Gi(h),c=e.size,p=Math.round(s*c[0]/2),d=Math.round(s*c[1]/2);return Zn(this.tmpTransform_,p,d,o/a,o/a,r.rotation,(u[0]-l[0])/o,(l[1]-u[1])/o)},e.prototype.handleFontsChanged_=function(t){var e=this.getLayer();e.getVisible()&&void 0!==this.renderedLayerRevision_&&e.changed()},e.prototype.handleStyleImageChange_=function(t){this.renderIfReadyAndVisible()},e.prototype.postCompose=function(e,i,n){var o=this.getLayer(),r=o.getRenderMode();if(r!=za){var s,a,h=o.getDeclutter()?{}:null,l=o.getSource(),u=Xa[r],c=i.pixelRatio,p=i.viewState.rotation,d=i.size;p&&ws(e,-p,s=Math.round(c*d[0]/2),a=Math.round(c*d[1]/2)),h&&this.declutterTree_.clear();for(var f=i.viewHints,_=!(f[Ne]||f[Ve]),g=this.renderedTiles,v=l.getTileGridForProjection(i.viewState.projection),y=[],m=[],x=g.length-1;x>=0;--x){var S=g[x];if(S.getState()!=Me)for(var C=S.tileCoord,E=v.getTileCoordExtent(C,this.tmpExtent)[0]-S.extent[0],w=void 0,T=0,R=S.tileKeys.length;T<R;++T){var b=S.getTile(S.tileKeys[T]);if(b.getState()==be){var I=b.getReplayGroup(o,C.toString());if(I&&I.hasReplays(u)){w||(w=this.getTransform(i,E));var F=b.tileCoord[0],M=I.getClipCoords(w);e.save(),e.globalAlpha=n.opacity;for(var P=0,L=y.length;P<L;++P){var k=y[P];F<m[P]&&(e.beginPath(),e.moveTo(M[0],M[1]),e.lineTo(M[2],M[3]),e.lineTo(M[4],M[5]),e.lineTo(M[6],M[7]),e.moveTo(k[6],k[7]),e.lineTo(k[4],k[5]),e.lineTo(k[2],k[3]),e.lineTo(k[0],k[1]),e.clip())}I.replay(e,w,p,{},_,u,h),e.restore(),y.push(M),m.push(F)}}}}h&&function(t,e,i,n){for(var o=Object.keys(t).map(Number).sort(ee),r={},s=0,a=o.length;s<a;++s)for(var h=t[o[s].toString()],l=0,u=h.length;l<u;){var c=h[l++],p=h[l++];c.replay(e,p,i,r,n)}}(h,e,p,_),p&&ws(e,p,s,a)}t.prototype.postCompose.call(this,e,i,n)},e.prototype.renderFeature=function(t,e,i,n){if(!i)return!1;var o=!1;if(Array.isArray(i))for(var r=0,s=i.length;r<s;++r)o=Da(n,t,i[r],e,this.handleStyleImageChange_,this)||o;else o=Da(n,t,i,e,this.handleStyleImageChange_,this);return o},e.prototype.renderTileImage_=function(t,e,i){var n=this.getLayer(),o=t.getReplayState(n),r=n.getRevision(),s=ja[n.getRenderMode()];if(s&&o.renderedTileRevision!==r){o.renderedTileRevision=r;var a=t.wrappedTileCoord,h=a[0],l=n.getSource(),u=l.getTileGridForProjection(i),c=u.getResolution(h),p=t.getContext(n),d=l.getTilePixelSize(h,e,i);p.canvas.width=d[0],p.canvas.height=d[1];for(var f=u.getTileCoordExtent(a,this.tmpExtent),_=0,g=t.tileKeys.length;_<g;++_){var v=t.getTile(t.tileKeys[_]);if(v.getState()==be){var y=e/c,m=jn(this.tmpTransform_);Vn(m,y,-y),Bn(m,-f[0],-f[3]),v.getReplayGroup(n,t.tileCoord.toString()).replay(p,m,0,{},!0,s)}}}},e}(Js);Wa.handles=function(t){return t.getType()===os},Wa.create=function(t,e){return new Wa(e)};var Ya=Wa,Na=function(t){function e(e){(e=u({},e)).controls||(e.controls=function(t){var e=t||{},i=new et;return(void 0===e.zoom||e.zoom)&&i.push(new hr(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&i.push(new ar(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&i.push(new rr(e.attributionOptions)),i}()),e.interactions||(e.interactions=function(t){var e=t||{},i=new et,n=new ur(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&i.push(new Mr),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&i.push(new yr({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&i.push(new Fr({condition:e.onFocusOnly?xr:void 0,kinetic:n})),(void 0===e.pinchRotate||e.pinchRotate)&&i.push(new Hr),(void 0===e.pinchZoom||e.pinchZoom)&&i.push(new qr({constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(i.push(new Yr),i.push(new Vr({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&i.push(new Ur({condition:e.onFocusOnly?xr:void 0,constrainResolution:e.constrainResolution,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&i.push(new Gr({duration:e.zoomDuration})),i}()),t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.createRenderer=function(){var t=new Ws(this);return t.registerLayerRenderers([Bs,Js,Ga,Ya]),t},e}(Jo);var Va=function(t){function e(e){if(t.call(this),this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,y(this,J(this.geometryName_),this.handleGeometryChanged_,this),e)if("function"==typeof e.getSimplifiedGeometry){var i=e;this.setGeometry(i)}else{var n=e;this.setProperties(n)}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e(this.getProperties());t.setGeometryName(this.getGeometryName());var i=this.getGeometry();i&&t.setGeometry(i.clone());var n=this.getStyle();return n&&t.setStyle(n),t},e.prototype.getGeometry=function(){return this.get(this.geometryName_)},e.prototype.getId=function(){return this.id_},e.prototype.getGeometryName=function(){return this.geometryName_},e.prototype.getStyle=function(){return this.style_},e.prototype.getStyleFunction=function(){return this.styleFunction_},e.prototype.handleGeometryChange_=function(){this.changed()},e.prototype.handleGeometryChanged_=function(){this.geometryChangeKey_&&(S(this.geometryChangeKey_),this.geometryChangeKey_=null);var t=this.getGeometry();t&&(this.geometryChangeKey_=y(t,P,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:(Pe("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){x(this,J(this.geometryName_),this.handleGeometryChanged_,this),this.geometryName_=t,y(this,J(this.geometryName_),this.handleGeometryChanged_,this),this.handleGeometryChanged_()},e}(Q),Ba="preload",Za="useInterimTilesOnError",Ua=function(t){function e(e){var i=e||{},n=u({},i);delete n.preload,delete n.useInterimTilesOnError,t.call(this,n),this.setPreload(void 0!==i.preload?i.preload:0),this.setUseInterimTilesOnError(void 0===i.useInterimTilesOnError||i.useInterimTilesOnError),this.type=ns}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getPreload=function(){return this.get(Ba)},e.prototype.setPreload=function(t){this.set(Ba,t)},e.prototype.getUseInterimTilesOnError=function(){return this.get(Za)},e.prototype.setUseInterimTilesOnError=function(t){this.set(Za,t)},e}(nr);Ua.prototype.getSource;var Ha=Ua,qa=function(t){function e(e,i,n){t.call(this);var o=n||{};this.tileCoord=e,this.state=i,this.interimTile=null,this.key="",this.transition_=void 0===o.transition?250:o.transition,this.transitionStarts_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.changed=function(){this.dispatchEvent(P)},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()==be)return 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()==be){t.interimTile=null;break}t.getState()==Re?e=t:t.getState()==Te?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){this.state=t,this.changed()},e.prototype.load=function(){},e.prototype.getAlpha=function(t,e){if(!this.transition_)return 1;var i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;var n=e-i+1e3/60;return n>=this.transition_?1:Qe(n/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}(M);function Ja(){var t=Lo(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}var Qa=function(t){function e(e,i,n,o,r,s){t.call(this,e,i,s),this.crossOrigin_=o,this.src_=n,this.image_=new Image,null!==o&&(this.image_.crossOrigin=o),this.imageListenerKeys_=null,this.tileLoadFunction_=r}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==Re&&(this.unlistenImage_(),this.image_=Ja()),this.interimTile&&this.interimTile.dispose(),this.state=Me,this.changed(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.image_},e.prototype.getKey=function(){return this.src_},e.prototype.handleImageError_=function(){this.state=Ie,this.unlistenImage_(),this.image_=Ja(),this.changed()},e.prototype.handleImageLoad_=function(){var t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=be:this.state=Fe,this.unlistenImage_(),this.changed()},e.prototype.load=function(){this.state==Ie&&(this.state=Te,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Te&&(this.state=Re,this.changed(),this.imageListenerKeys_=[m(this.image_,A,this.handleImageError_,this),m(this.image_,K,this.handleImageLoad_,this)],this.tileLoadFunction_(this,this.src_))},e.prototype.unlistenImage_=function(){this.imageListenerKeys_.forEach(S),this.imageListenerKeys_=null},e}(qa);function $a(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function th(t,e,i){return t+"/"+e+"/"+i}function eh(t){return th(t[0],t[1],t[2])}var ih=function(t){function e(e){t.call(this,e)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.expireCache=function(t){for(;this.canExpireCache();){var e=this.peekLast(),i=e.tileCoord[0].toString();if(i in t&&t[i].contains(e.tileCoord))break;this.pop().dispose()}},e.prototype.pruneExceptNewestZ=function(){if(0!==this.getCount()){var t=function(t){return t.split("/").map(Number)}(this.peekFirstKey())[0];this.forEach((function(e){e.tileCoord[0]!==t&&(this.remove(eh(e.tileCoord)),e.dispose())}),this)}},e}(ls);function nh(t,e,i,n){var o=i-t,r=n-e,s=Math.sqrt(o*o+r*r);return[Math.round(i+o/s),Math.round(n+r/s)]}function oh(t,e,i,n,o,r,s,a,h,l,u){var c=Lo(Math.round(i*t),Math.round(i*e));if(0===h.length)return c.canvas;c.scale(i,i);var p=[1/0,1/0,-1/0,-1/0];h.forEach((function(t,e,i){wi(p,t.extent)}));var d=Ki(p),f=Di(p),_=Lo(Math.round(i*d/n),Math.round(i*f/n)),g=i/n;h.forEach((function(t,e,i){var n=t.extent[0]-p[0],o=-(t.extent[3]-p[3]),r=Ki(t.extent),s=Di(t.extent);_.drawImage(t.image,l,l,t.image.width-2*l,t.image.height-2*l,n*g,o*g,r*g,s*g)}));var v=Gi(s);return a.getTriangles().forEach((function(t,e,o){var s=t.source,a=t.target,h=s[0][0],l=s[0][1],u=s[1][0],d=s[1][1],f=s[2][0],g=s[2][1],y=(a[0][0]-v[0])/r,m=-(a[0][1]-v[1])/r,x=(a[1][0]-v[0])/r,S=-(a[1][1]-v[1])/r,C=(a[2][0]-v[0])/r,E=-(a[2][1]-v[1])/r,w=h,T=l;h=0,l=0;var R=function(t){for(var e=t.length,i=0;i<e;i++){for(var n=i,o=Math.abs(t[i][i]),r=i+1;r<e;r++){var s=Math.abs(t[r][i]);s>o&&(o=s,n=r)}if(0===o)return null;var a=t[n];t[n]=t[i],t[i]=a;for(var h=i+1;h<e;h++)for(var l=-t[h][i]/t[i][i],u=i;u<e+1;u++)i==u?t[h][u]=0:t[h][u]+=l*t[i][u]}for(var c=new Array(e),p=e-1;p>=0;p--){c[p]=t[p][e]/t[p][p];for(var d=p-1;d>=0;d--)t[d][e]-=t[d][p]*c[p]}return c}([[u-=w,d-=T,0,0,x-y],[f-=w,g-=T,0,0,C-y],[0,0,u,d,S-m],[0,0,f,g,E-m]]);if(R){c.save(),c.beginPath();var b=(y+x+C)/3,I=(m+S+E)/3,F=nh(b,I,y,m),M=nh(b,I,x,S),P=nh(b,I,C,E);c.moveTo(M[0],M[1]),c.lineTo(F[0],F[1]),c.lineTo(P[0],P[1]),c.clip(),c.transform(R[0],R[2],R[1],R[3],y,m),c.translate(p[0]-w,p[3]-T),c.scale(n/i,-n/i),c.drawImage(_.canvas,0,0),c.restore()}})),u&&(c.save(),c.strokeStyle="black",c.lineWidth=1,a.getTriangles().forEach((function(t,e,i){var n=t.target,o=(n[0][0]-v[0])/r,s=-(n[0][1]-v[1])/r,a=(n[1][0]-v[0])/r,h=-(n[1][1]-v[1])/r,l=(n[2][0]-v[0])/r,u=-(n[2][1]-v[1])/r;c.beginPath(),c.moveTo(a,h),c.lineTo(o,s),c.lineTo(l,u),c.closePath(),c.stroke()})),c.restore()),c.canvas}var rh=function(t,e,i,n,o){this.sourceProj_=t,this.targetProj_=e;var r={},s=Gn(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){var e=t[0]+"/"+t[1];return r[e]||(r[e]=s(t)),r[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=o*o,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Ki(n)==Ki(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Ki(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Ki(this.targetProj_.getExtent()):null;var a=Gi(i),h=zi(i),l=Pi(i),u=Mi(i),c=this.transformInv_(a),p=this.transformInv_(h),d=this.transformInv_(l),f=this.transformInv_(u);if(this.addQuad_(a,h,l,u,c,p,d,f,10),this.wrapsXInSource_){var _=1/0;this.triangles_.forEach((function(t,e,i){_=Math.min(_,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])-_>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]-_>this.sourceWorldWidth_/2&&(e[0][0]-=this.sourceWorldWidth_),e[1][0]-_>this.sourceWorldWidth_/2&&(e[1][0]-=this.sourceWorldWidth_),e[2][0]-_>this.sourceWorldWidth_/2&&(e[2][0]-=this.sourceWorldWidth_);var i=Math.min(e[0][0],e[1][0],e[2][0]);Math.max(e[0][0],e[1][0],e[2][0])-i<this.sourceWorldWidth_/2&&(t.source=e)}}.bind(this))}r={}};rh.prototype.addTriangle_=function(t,e,i,n,o,r){this.triangles_.push({source:[n,o,r],target:[t,e,i]})},rh.prototype.addQuad_=function(t,e,i,n,o,r,s,a,h){var l=pi([o,r,s,a]),u=this.sourceWorldWidth_?Ki(l)/this.sourceWorldWidth_:null,c=this.sourceWorldWidth_,p=this.sourceProj_.canWrapX()&&u>.5&&u<1,d=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_)d=Ki(pi([t,e,i,n]))/this.targetWorldWidth_>.25||d;!p&&this.sourceProj_.isGlobal()&&u&&(d=u>.25||d)}if(d||!this.maxSourceExtent_||ji(l,this.maxSourceExtent_)){if(!(d||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(!(h>0))return;d=!0}if(h>0){if(!d){var f,_=[(t[0]+i[0])/2,(t[1]+i[1])/2],g=this.transformInv_(_);if(p)f=(Ke(o[0],c)+Ke(s[0],c))/2-Ke(g[0],c);else f=(o[0]+s[0])/2-g[0];var v=(o[1]+s[1])/2-g[1];d=f*f+v*v>this.errorThresholdSquared_}if(d){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){var y=[(e[0]+i[0])/2,(e[1]+i[1])/2],m=this.transformInv_(y),x=[(n[0]+t[0])/2,(n[1]+t[1])/2],S=this.transformInv_(x);this.addQuad_(t,e,y,x,o,r,m,S,h-1),this.addQuad_(x,y,i,n,S,m,s,a,h-1)}else{var C=[(t[0]+e[0])/2,(t[1]+e[1])/2],E=this.transformInv_(C),w=[(i[0]+n[0])/2,(i[1]+n[1])/2],T=this.transformInv_(w);this.addQuad_(t,C,w,n,o,E,T,a,h-1),this.addQuad_(C,e,i,w,E,r,s,T,h-1)}return}}if(p){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}this.addTriangle_(t,i,n,o,s,a),this.addTriangle_(t,e,i,o,r,s)}},rh.prototype.calculateSourceExtent=function(){var t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){var o=e.source;Ti(t,o[0]),Ti(t,o[1]),Ti(t,o[2])})),t},rh.prototype.getTriangles=function(){return this.triangles_};var sh=rh,ah=function(t){function e(e,i,n,o,r,s,a,h,l,u,c){t.call(this,r,Te),this.renderEdges_=void 0!==c&&c,this.pixelRatio_=a,this.gutter_=h,this.canvas_=null,this.sourceTileGrid_=i,this.targetTileGrid_=o,this.wrappedTileCoord_=s||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;var p=o.getTileCoordExtent(this.wrappedTileCoord_),d=this.targetTileGrid_.getExtent(),f=this.sourceTileGrid_.getExtent(),_=d?Ai(p,d):p;if(0!==Fi(_)){var g=e.getExtent();g&&(f=f?Ai(f,g):g);var v=o.getResolution(this.wrappedTileCoord_[0]),y=function(t,e,i,n){var o=zn(i,e,t),r=Pn(e,n,i),s=e.getMetersPerUnit();void 0!==s&&(r*=s);var a=t.getMetersPerUnit();void 0!==a&&(r/=a);var h=t.getExtent();if(!h||gi(h,o)){var l=Pn(t,r,o)/r;isFinite(l)&&l>0&&(r/=l)}return r}(e,n,Li(_),v);if(!isFinite(y)||y<=0)this.state=Fe;else{var m=void 0!==u?u:.5;if(this.triangulation_=new sh(e,n,_,f,y*m),0!==this.triangulation_.getTriangles().length){this.sourceZ_=i.getZForResolution(y);var x=this.triangulation_.calculateSourceExtent();if(f&&(e.canWrapX()?(x[1]=Oe(x[1],f[1],f[3]),x[3]=Oe(x[3],f[1],f[3])):x=Ai(x,f)),Fi(x)){for(var S=i.getTileRangeForExtentAndZ(x,this.sourceZ_),C=S.minX;C<=S.maxX;C++)for(var E=S.minY;E<=S.maxY;E++){var w=l(this.sourceZ_,C,E,a);w&&this.sourceTiles_.push(w)}0===this.sourceTiles_.length&&(this.state=Fe)}else this.state=Fe}else this.state=Fe}}else this.state=Fe}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.state==Re&&this.unlistenSources_(),t.prototype.disposeInternal.call(this)},e.prototype.getImage=function(){return this.canvas_},e.prototype.reproject_=function(){var t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==be&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Ie;else{var e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],o="number"==typeof i?i:i[1],r=this.targetTileGrid_.getResolution(e),s=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=oh(n,o,this.pixelRatio_,s,this.sourceTileGrid_.getExtent(),r,a,this.triangulation_,t,this.gutter_,this.renderEdges_),this.state=be}this.changed()},e.prototype.load=function(){if(this.state==Te){this.state=Re,this.changed();var t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){var o=e.getState();if(o==Te||o==Re){t++;var r=y(e,P,(function(i){var n=e.getState();n!=be&&n!=Ie&&n!=Fe||(S(r),0===--t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(r)}}.bind(this)),this.sourceTiles_.forEach((function(t,e,i){t.getState()==Te&&t.load()})),0===t&&setTimeout(this.reproject_.bind(this),0)}},e.prototype.unlistenSources_=function(){this.sourcesListenerKeys_.forEach(S),this.sourcesListenerKeys_=null},e}(qa);function hh(t,e){var i=/\{z\}/g,n=/\{x\}/g,o=/\{y\}/g,r=/\{-y\}/g;return function(s,a,h){return s?t.replace(i,s[0].toString()).replace(n,s[1].toString()).replace(o,(function(){return(-s[2]-1).toString()})).replace(r,(function(){var t=s[0],i=e.getFullTileRange(t);return Pe(i,55),(i.getHeight()+s[2]).toString()})):void 0}}function lh(t,e){for(var i=t.length,n=new Array(i),o=0;o<i;++o)n[o]=hh(t[o],e);return function(t){if(1===t.length)return t[0];return function(e,i,n){if(e){var o=Ke(function(t){return(t[1]<<t[0])+t[2]}(e),t.length);return t[o](e,i,n)}}}(n)}function uh(t,e,i){}function ch(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}var ph=function(t){function e(e){t.call(this),this.projection_=Mn(e.projection),this.attributions_=ch(e.attributions),this.attributionsCollapsible_=void 0===e.attributionsCollapsible||e.attributionsCollapsible,this.loading=!1,this.state_=void 0!==e.state?e.state:Zo,this.wrapX_=void 0!==e.wrapX&&e.wrapX}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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 n()},e.prototype.getState=function(){return this.state_},e.prototype.getWrapX=function(){return this.wrapX_},e.prototype.refresh=function(){this.changed()},e.prototype.setAttributions=function(t){this.attributions_=ch(t),this.changed()},e.prototype.setState=function(t){this.state_=t,this.changed()},e}(Q),dh=[0,0,0],fh=function(t){var e,i,n,o;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Pe((e=this.resolutions_,i=!0,n=function(t,e){return e-t}||ee,e.every((function(t,o){if(0===o)return!0;var r=n(e[o-1],t);return!(r>0||i&&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,Pe(this.origins_.length==this.resolutions_.length,20));var a=t.extent;void 0===a||this.origin_||this.origins_||(this.origin_=Gi(a)),Pe(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Pe(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,Pe(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==a?a:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){return new Hs(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1))}),this):a&&this.calculateTileRanges_(a)};fh.prototype.forEachTileCoord=function(t,e,i){for(var n=this.getTileRangeForExtentAndZ(t,e),o=n.minX,r=n.maxX;o<=r;++o)for(var s=n.minY,a=n.maxY;s<=a;++s)i([e,o,s])},fh.prototype.forEachTileCoordParentTileRange=function(t,e,i,n,o){var r,s,a,h=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],a=t[2]):h=this.getTileCoordExtent(t,o);l>=this.minZoom;){if(r=2===this.zoomFactor_?Us(s=Math.floor(s/2),s,a=Math.floor(a/2),a,n):this.getTileRangeForExtentAndZ(h,l,n),e.call(i,l,r))return!0;--l}return!1},fh.prototype.getExtent=function(){return this.extent_},fh.prototype.getMaxZoom=function(){return this.maxZoom},fh.prototype.getMinZoom=function(){return this.minZoom},fh.prototype.getOrigin=function(t){return this.origin_?this.origin_:this.origins_[t]},fh.prototype.getResolution=function(t){return this.resolutions_[t]},fh.prototype.getResolutions=function(){return this.resolutions_},fh.prototype.getTileCoordChildTileRange=function(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){var n=2*t[1],o=2*t[2];return Us(n,n+1,o,o+1,e)}var r=this.getTileCoordExtent(t,i);return this.getTileRangeForExtentAndZ(r,t[0]+1,e)}return null},fh.prototype.getTileRangeExtent=function(t,e,i){var n=this.getOrigin(t),o=this.getResolution(t),r=qo(this.getTileSize(t),this.tmpSize_),s=n[0]+e.minX*r[0]*o,a=n[0]+(e.maxX+1)*r[0]*o;return Si(s,n[1]+e.minY*r[1]*o,a,n[1]+(e.maxY+1)*r[1]*o,i)},fh.prototype.getTileRangeForExtentAndZ=function(t,e,i){var n=dh;this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n);var o=n[1],r=n[2];return this.getTileCoordForXYAndZ_(t[2],t[3],e,!0,n),Us(o,n[1],r,n[2],i)},fh.prototype.getTileCoordCenter=function(t){var e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=qo(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]+(t[2]+.5)*n[1]*i]},fh.prototype.getTileCoordExtent=function(t,e){var i=this.getOrigin(t[0]),n=this.getResolution(t[0]),o=qo(this.getTileSize(t[0]),this.tmpSize_),r=i[0]+t[1]*o[0]*n,s=i[1]+t[2]*o[1]*n;return Si(r,s,r+o[0]*n,s+o[1]*n,e)},fh.prototype.getTileCoordForCoordAndResolution=function(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)},fh.prototype.getTileCoordForXYAndResolution_=function(t,e,i,n,o){var r=this.getZForResolution(i),s=i/this.getResolution(r),a=this.getOrigin(r),h=qo(this.getTileSize(r),this.tmpSize_),l=n?.5:0,u=n?0:.5,c=Math.floor((t-a[0])/i+l),p=Math.floor((e-a[1])/i+u),d=s*c/h[0],f=s*p/h[1];return n?(d=Math.ceil(d)-1,f=Math.ceil(f)-1):(d=Math.floor(d),f=Math.floor(f)),$a(r,d,f,o)},fh.prototype.getTileCoordForXYAndZ_=function(t,e,i,n,o){var r=this.getOrigin(i),s=this.getResolution(i),a=qo(this.getTileSize(i),this.tmpSize_),h=n?.5:0,l=n?0:.5,u=Math.floor((t-r[0])/s+h),c=Math.floor((e-r[1])/s+l),p=u/a[0],d=c/a[1];return n?(p=Math.ceil(p)-1,d=Math.ceil(d)-1):(p=Math.floor(p),d=Math.floor(d)),$a(i,p,d,o)},fh.prototype.getTileCoordForCoordAndZ=function(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)},fh.prototype.getTileCoordResolution=function(t){return this.resolutions_[t[0]]},fh.prototype.getTileSize=function(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]},fh.prototype.getFullTileRange=function(t){return this.fullTileRanges_?this.fullTileRanges_[t]:null},fh.prototype.getZForResolution=function(t,e){return Oe(ie(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)},fh.prototype.calculateTileRanges_=function(t){for(var e=this.resolutions_.length,i=new Array(e),n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i};var _h=fh;function gh(t){var e=t.getDefaultTileGrid();return e||(e=function(t,e,i,n){return function(t,e,i,n){var o=void 0!==n?n:oi,r=vh(t,e,i);return new _h({extent:t,origin:ki(t,o),resolutions:r,tileSize:i})}(yh(t),e,i,n)}(t),t.setDefaultTileGrid(e)),e}function vh(t,e,i){for(var n=void 0!==e?e:42,o=Di(t),r=Ki(t),s=qo(void 0!==i?i:256),a=Math.max(r/s[0],o/s[1]),h=n+1,l=new Array(h),u=0;u<h;++u)l[u]=a/Math.pow(2,u);return l}function yh(t){var e=(t=Mn(t)).getExtent();if(!e){var i=180*sn[an.DEGREES]/t.getMetersPerUnit();e=Si(-i,-i,i,i)}return e}var mh=function(t){function e(e){t.call(this,{attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX}),this.opaque_=void 0!==e.opaque&&e.opaque,this.tilePixelRatio_=void 0!==e.tilePixelRatio?e.tilePixelRatio:1,this.tileGrid=void 0!==e.tileGrid?e.tileGrid:null,this.tileCache=new ih(e.cacheSize),this.tmpSize=[0,0],this.key_=e.key||"",this.tileOptions={transition:e.transition}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.canExpireCache=function(){return this.tileCache.canExpireCache()},e.prototype.expireCache=function(t,e){var i=this.getTileCacheForProjection(t);i&&i.expireCache(e)},e.prototype.forEachLoadedTile=function(t,e,i,n){var o=this.getTileCacheForProjection(t);if(!o)return!1;for(var r,s,a,h=!0,l=i.minX;l<=i.maxX;++l)for(var u=i.minY;u<=i.maxY;++u)s=th(e,l,u),a=!1,o.containsKey(s)&&(a=(r=o.get(s)).getState()===be)&&(a=!1!==n(r)),a||(h=!1);return h},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.getResolutions()},e.prototype.getTile=function(t,e,i,o,r){return n()},e.prototype.getTileGrid=function(){return this.tileGrid},e.prototype.getTileGridForProjection=function(t){return this.tileGrid?this.tileGrid:gh(t)},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();return e&&!Dn(e,t)?null:this.tileCache},e.prototype.getTilePixelRatio=function(t){return this.tilePixelRatio_},e.prototype.getTilePixelSize=function(t,e,i){var n,o,r,s=this.getTileGridForProjection(i),a=this.getTilePixelRatio(e),h=qo(s.getTileSize(t),this.tmpSize);return 1==a?h:(n=h,o=a,void 0===(r=this.tmpSize)&&(r=[0,0]),r[0]=n[0]*o+.5|0,r[1]=n[1]*o+.5|0,r)},e.prototype.getTileCoordForTileUrlFunction=function(t,e){var i=void 0!==e?e:this.getProjection(),n=this.getTileGridForProjection(i);return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){var n=e[0],o=t.getTileCoordCenter(e),r=yh(i);if(gi(r,o))return e;var s=Ki(r),a=Math.ceil((r[0]-o[0])/s);return o[0]+=s*a,t.getTileCoordForCoordAndZ(o,n)}(n,t,i)),function(t,e){var i=t[0],n=t[1],o=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;var r,s=e.getExtent();return!(r=s?e.getTileRangeForExtentAndZ(s,i):e.getFullTileRange(i))||r.containsXY(n,o)}(t,n)?t:null},e.prototype.refresh=function(){this.tileCache.clear(),this.changed()},e.prototype.useTile=function(t,e,i,n){},e}(ph),xh=function(t){function e(e,i){t.call(this,e),this.tile=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(F),Sh="tileloadstart",Ch="tileloadend",Eh="tileloaderror";function wh(t,e){t.getImage().src=e}var Th=function(t){function e(e){var i,n=e||{};i=void 0!==n.attributions?n.attributions:['&#169; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors.'];var o=void 0!==n.crossOrigin?n.crossOrigin:"anonymous",r=void 0!==n.url?n.url:"https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png";t.call(this,{attributions:i,cacheSize:n.cacheSize,crossOrigin:o,opaque:void 0===n.opaque||n.opaque,maxZoom:void 0!==n.maxZoom?n.maxZoom:19,reprojectionErrorThreshold:n.reprojectionErrorThreshold,tileLoadFunction:n.tileLoadFunction,url:r,wrapX:n.wrapX,attributionsCollapsible:!1})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(function(t){function e(e){var i=e||{},n=void 0!==i.projection?i.projection:"EPSG:3857",o=void 0!==i.tileGrid?i.tileGrid:function(t){var e=t||{},i=e.extent||Mn("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:vh(i,e.maxZoom,e.tileSize)};return new _h(n)}({extent:yh(n),maxZoom:i.maxZoom,minZoom:i.minZoom,tileSize:i.tileSize});t.call(this,{attributions:i.attributions,cacheSize:i.cacheSize,crossOrigin:i.crossOrigin,opaque:i.opaque,projection:n,reprojectionErrorThreshold:i.reprojectionErrorThreshold,tileGrid:o,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})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(function(t){function e(e){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:wh,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.crossOrigin=void 0!==e.crossOrigin?e.crossOrigin:null,this.tileClass=void 0!==e.tileClass?e.tileClass:Qa,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,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 i=this.getTileCacheForProjection(t);for(var n in this.tileCache.expireCache(this.tileCache==i?e:{}),this.tileCacheForProjection){var o=this.tileCacheForProjection[n];o.expireCache(o==i?e:{})}},e.prototype.getGutterForProjection=function(t){return this.getProjection()&&t&&!Dn(this.getProjection(),t)?0:this.getGutter()},e.prototype.getGutter=function(){return 0},e.prototype.getOpaque=function(e){return!(this.getProjection()&&e&&!Dn(this.getProjection(),e))&&t.prototype.getOpaque.call(this,e)},e.prototype.getTileGridForProjection=function(t){var e=this.getProjection();if(!this.tileGrid||e&&!Dn(e,t)){var i=r(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=gh(t)),this.tileGridForProjection[i]}return this.tileGrid},e.prototype.getTileCacheForProjection=function(t){var e=this.getProjection();if(!e||Dn(e,t))return this.tileCache;var i=r(t);return i in this.tileCacheForProjection||(this.tileCacheForProjection[i]=new ih(this.tileCache.highWaterMark)),this.tileCacheForProjection[i]},e.prototype.createTile_=function(t,e,i,n,o,r){var s=[t,e,i],a=this.getTileCoordForTileUrlFunction(s,o),h=a?this.tileUrlFunction(a,n,o):void 0,l=new this.tileClass(s,void 0!==h?Te:Fe,void 0!==h?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return l.key=r,y(l,P,this.handleTileChange,this),l},e.prototype.getTile=function(t,e,i,n,o){var r=this.getProjection();if(r&&o&&!Dn(r,o)){var s,a=this.getTileCacheForProjection(o),h=[t,e,i],l=eh(h);a.containsKey(l)&&(s=a.get(l));var u=this.getKey();if(s&&s.key==u)return s;var c=this.getTileGridForProjection(r),p=this.getTileGridForProjection(o),d=this.getTileCoordForTileUrlFunction(h,o),f=new ah(r,c,o,p,h,d,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,r)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_);return f.key=u,s?(f.interimTile=s,f.refreshInterimChain(),a.replace(l,f)):a.set(l,f),f}return this.getTileInternal(t,e,i,n,r||o)},e.prototype.getTileInternal=function(t,e,i,n,o){var r=null,s=th(t,e,i),a=this.getKey();if(this.tileCache.containsKey(s)){if((r=this.tileCache.get(s)).key!=a){var h=r;r=this.createTile_(t,e,i,n,o,a),h.getState()==Te?r.interimTile=h.interimTile:r.interimTile=h,r.refreshInterimChain(),this.tileCache.replace(s,r)}}else r=this.createTile_(t,e,i,n,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 i=Mn(t);if(i){var n=r(i);n in this.tileGridForProjection||(this.tileGridForProjection[n]=e)}},e}(function(t){function e(e){t.call(this,{attributions:e.attributions,cacheSize:e.cacheSize,opaque:e.opaque,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tilePixelRatio:e.tilePixelRatio,wrapX:e.wrapX,transition:e.transition,key:e.key,attributionsCollapsible:e.attributionsCollapsible}),this.generateTileUrlFunction_=!e.tileUrlFunction,this.tileLoadFunction=e.tileLoadFunction,this.tileUrlFunction=e.tileUrlFunction?e.tileUrlFunction.bind(this):uh,this.urls=null,e.urls?this.setUrls(e.urls):e.url&&this.setUrl(e.url),e.tileUrlFunction&&this.setTileUrlFunction(e.tileUrlFunction,this.key_),this.tileLoadingKeys_={}}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getTileLoadFunction=function(){return this.tileLoadFunction},e.prototype.getTileUrlFunction=function(){return this.tileUrlFunction},e.prototype.getUrls=function(){return this.urls},e.prototype.handleTileChange=function(t){var e,i=t.target,n=r(i),o=i.getState();o==Re?(this.tileLoadingKeys_[n]=!0,e=Sh):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=o==Ie?Eh:o==be||o==Me?Ch:void 0),null!=e&&this.dispatchEvent(new xh(e,i))},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=this.urls=function(t){var e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){var n,o=i[1].charCodeAt(0),r=i[2].charCodeAt(0);for(n=o;n<=r;++n)e.push(t.replace(i[0],String.fromCharCode(n)));return e}if(i=i=/\{(\d+)-(\d+)\}/.exec(t)){for(var s=parseInt(i[2],10),a=parseInt(i[1],10);a<=s;a++)e.push(t.replace(i[0],a.toString()));return e}return e.push(t),e}(t);this.setUrls(e)},e.prototype.setUrls=function(t){this.urls=t;var e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(lh(t,this.tileGrid),e):this.setKey(e)},e.prototype.useTile=function(t,e,i){var n=th(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)},e}(mh)))),Rh=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale};Rh.prototype.clone=function(){return new Rh({opacity:this.getOpacity(),scale:this.getScale(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView()})},Rh.prototype.getOpacity=function(){return this.opacity_},Rh.prototype.getRotateWithView=function(){return this.rotateWithView_},Rh.prototype.getRotation=function(){return this.rotation_},Rh.prototype.getScale=function(){return this.scale_},Rh.prototype.getSnapToPixel=function(){return!1},Rh.prototype.getAnchor=function(){return n()},Rh.prototype.getImage=function(t){return n()},Rh.prototype.getHitDetectionImage=function(t){return n()},Rh.prototype.getImageState=function(){return n()},Rh.prototype.getImageSize=function(){return n()},Rh.prototype.getHitDetectionImageSize=function(){return n()},Rh.prototype.getOrigin=function(){return n()},Rh.prototype.getSize=function(){return n()},Rh.prototype.setOpacity=function(t){this.opacity_=t},Rh.prototype.setRotateWithView=function(t){this.rotateWithView_=t},Rh.prototype.setRotation=function(t){this.rotation_=t},Rh.prototype.setScale=function(t){this.scale_=t},Rh.prototype.setSnapToPixel=function(t){},Rh.prototype.listenImageChange=function(t,e){return n()},Rh.prototype.load=function(){n()},Rh.prototype.unlistenImageChange=function(t,e){n()};var bh=function(t){function e(e){var i=e||{};t.call(this,{points:1/0,fill:i.fill,radius:i.radius,stroke:i.stroke,atlasManager:i.atlasManager})}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)},e}(function(t){function e(e){var i=void 0!==e.rotateWithView&&e.rotateWithView;t.call(this,{opacity:1,rotateWithView:i,rotation:void 0!==e.rotation?e.rotation:0,scale:1}),this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==e.fill?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius_=void 0!==e.radius?e.radius:e.radius1,this.radius2_=e.radius2,this.angle_=void 0!==e.angle?e.angle:0,this.stroke_=void 0!==e.stroke?e.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=e.atlasManager,this.render_(this.atlasManager_)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.clone=function(){var t=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(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},e.prototype.getAnchor=function(){return this.anchor_},e.prototype.getAngle=function(){return this.angle_},e.prototype.getFill=function(){return this.fill_},e.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_},e.prototype.getImage=function(t){return this.canvas_},e.prototype.getImageSize=function(){return this.imageSize_},e.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},e.prototype.getImageState=function(){return $r},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){},e.prototype.load=function(){},e.prototype.unlistenImageChange=function(t,e){},e.prototype.render_=function(t){var e,i,n="",o="",r=0,s=null,a=0,h=0;this.stroke_&&(null===(i=this.stroke_.getColor())&&(i=ps),i=Ls(i),void 0===(h=this.stroke_.getWidth())&&(h=1),s=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),ut||(s=null,a=0),void 0===(o=this.stroke_.getLineJoin())&&(o="round"),void 0===(n=this.stroke_.getLineCap())&&(n="round"),void 0===(r=this.stroke_.getMiterLimit())&&(r=10));var l=2*(this.radius_+h)+1,u={strokeStyle:i,strokeWidth:h,size:l,lineCap:n,lineDash:s,lineDashOffset:a,lineJoin:o,miterLimit:r};if(void 0===t){var c=Lo(l,l);this.canvas_=c.canvas,e=l=this.canvas_.width,this.draw_(u,c,0,0),this.createHitDetectionCanvas_(u)}else{l=Math.round(l);var p,d=!this.fill_;d&&(p=this.drawHitDetectionCanvas_.bind(this,u));var f=this.getChecksum(),_=t.add(f,l,l,this.draw_.bind(this,u),p);this.canvas_=_.image,this.origin_=[_.offsetX,_.offsetY],e=_.image.width,d?(this.hitDetectionCanvas_=_.hitImage,this.hitDetectionImageSize_=[_.hitImage.width,_.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[e,e])}this.anchor_=[l/2,l/2],this.size_=[l,l],this.imageSize_=[e,e]},e.prototype.draw_=function(t,e,i,n){var o,r,s;e.setTransform(1,0,0,1,0,0),e.translate(i,n),e.beginPath();var a=this.points_;if(a===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(a*=2),o=0;o<=a;o++)r=2*o*Math.PI/a-Math.PI/2+this.angle_,s=o%2==0?this.radius_:h,e.lineTo(t.size/2+s*Math.cos(r),t.size/2+s*Math.sin(r))}if(this.fill_){var l=this.fill_.getColor();null===l&&(l=us),e.fillStyle=Ls(l),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke()),e.closePath()},e.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var e=Lo(t.size,t.size);this.hitDetectionCanvas_=e.canvas,this.drawHitDetectionCanvas_(t,e,0,0)}},e.prototype.drawHitDetectionCanvas_=function(t,e,i,n){e.setTransform(1,0,0,1,0,0),e.translate(i,n),e.beginPath();var o=this.points_;if(o===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var r,s,a,h=void 0!==this.radius2_?this.radius2_:this.radius_;for(h!==this.radius_&&(o*=2),r=0;r<=o;r++)a=2*r*Math.PI/o-Math.PI/2+this.angle_,s=r%2==0?this.radius_:h,e.lineTo(t.size/2+s*Math.cos(a),t.size/2+s*Math.sin(a))}e.fillStyle=Fs(us),e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.stroke()),e.closePath()},e.prototype.getChecksum=function(){var t=this.stroke_?this.stroke_.getChecksum():"-",e=this.fill_?this.fill_.getChecksum():"-";if(!this.checksums_||t!=this.checksums_[1]||e!=this.checksums_[2]||this.radius_!=this.checksums_[3]||this.radius2_!=this.checksums_[4]||this.angle_!=this.checksums_[5]||this.points_!=this.checksums_[6]){var i="r"+t+e+(void 0!==this.radius_?this.radius_.toString():"-")+(void 0!==this.radius2_?this.radius2_.toString():"-")+(void 0!==this.angle_?this.angle_.toString():"-")+(void 0!==this.points_?this.points_.toString():"-");this.checksums_=[i,t,e,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},e}(Rh)),Ih=function(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.checksum_=void 0};Ih.prototype.clone=function(){var t=this.getColor();return new Ih({color:Array.isArray(t)?t.slice():t||void 0})},Ih.prototype.getColor=function(){return this.color_},Ih.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},Ih.prototype.getChecksum=function(){if(void 0===this.checksum_){var t=this.color_;t?Array.isArray(t)||"string"==typeof t?this.checksum_="f"+Fs(t):this.checksum_=r(this.color_):this.checksum_="f-"}return this.checksum_};var Fh=Ih,Mh=function(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,this.checksum_=void 0};Mh.prototype.clone=function(){var t=this.getColor();return new Mh({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})},Mh.prototype.getColor=function(){return this.color_},Mh.prototype.getLineCap=function(){return this.lineCap_},Mh.prototype.getLineDash=function(){return this.lineDash_},Mh.prototype.getLineDashOffset=function(){return this.lineDashOffset_},Mh.prototype.getLineJoin=function(){return this.lineJoin_},Mh.prototype.getMiterLimit=function(){return this.miterLimit_},Mh.prototype.getWidth=function(){return this.width_},Mh.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},Mh.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},Mh.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},Mh.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},Mh.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},Mh.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},Mh.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},Mh.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=r(this.color_):this.checksum_+="-",this.checksum_+=","+(void 0!==this.lineCap_?this.lineCap_.toString():"-")+","+(this.lineDash_?this.lineDash_.toString():"-")+","+(void 0!==this.lineDashOffset_?this.lineDashOffset_:"-")+","+(void 0!==this.lineJoin_?this.lineJoin_:"-")+","+(void 0!==this.miterLimit_?this.miterLimit_.toString():"-")+","+(void 0!==this.width_?this.width_.toString():"-")),this.checksum_};var Ph=Mh,Lh=function(t){var e=t||{};this.geometry_=null,this.geometryFunction_=Dh,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.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex};Lh.prototype.clone=function(){var t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new Lh({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})},Lh.prototype.getRenderer=function(){return this.renderer_},Lh.prototype.setRenderer=function(t){this.renderer_=t},Lh.prototype.getGeometry=function(){return this.geometry_},Lh.prototype.getGeometryFunction=function(){return this.geometryFunction_},Lh.prototype.getFill=function(){return this.fill_},Lh.prototype.setFill=function(t){this.fill_=t},Lh.prototype.getImage=function(){return this.image_},Lh.prototype.setImage=function(t){this.image_=t},Lh.prototype.getStroke=function(){return this.stroke_},Lh.prototype.setStroke=function(t){this.stroke_=t},Lh.prototype.getText=function(){return this.text_},Lh.prototype.setText=function(t){this.text_=t},Lh.prototype.getZIndex=function(){return this.zIndex_},Lh.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_=Dh,this.geometry_=t},Lh.prototype.setZIndex=function(t){this.zIndex_=t};var kh=null;function Oh(t,e){if(!kh){var i=new Fh({color:"rgba(255,255,255,0.4)"}),n=new Ph({color:"#3399CC",width:1.25});kh=[new Lh({image:new bh({fill:i,stroke:n,radius:5}),fill:i,stroke:n})]}return kh}function Dh(t){return t.getGeometry()}var Ah="renderOrder",Gh=function(t){function e(e){var i=e||{},n=u({},i);delete n.style,delete n.renderBuffer,delete n.updateWhileAnimating,delete n.updateWhileInteracting,t.call(this,n),this.declutter_=void 0!==i.declutter&&i.declutter,this.renderBuffer_=void 0!==i.renderBuffer?i.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(i.style),this.updateWhileAnimating_=void 0!==i.updateWhileAnimating&&i.updateWhileAnimating,this.updateWhileInteracting_=void 0!==i.updateWhileInteracting&&i.updateWhileInteracting,this.renderMode_=i.renderMode||as,this.type=rs}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getDeclutter=function(){return this.declutter_},e.prototype.setDeclutter=function(t){this.declutter_=t},e.prototype.getRenderBuffer=function(){return this.renderBuffer_},e.prototype.getRenderOrder=function(){return this.get(Ah)},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.setRenderOrder=function(t){this.set(Ah,t)},e.prototype.setStyle=function(t){this.style_=void 0!==t?t:Oh,this.styleFunction_=null===t?void 0:function(t){var e;if("function"==typeof t)e=t;else{var i;if(Array.isArray(t))i=t;else Pe("function"==typeof t.getZIndex,41),i=[t];e=function(){return i}}return e}(this.style_),this.changed()},e.prototype.getRenderMode=function(){return this.renderMode_},e}(nr);Gh.prototype.getSource;var zh=Gh,Kh="arraybuffer",jh="json",Xh="text",Wh="xml";function Yh(t,e){return function(t,e,i,n){return function(o,r,s){var a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(o,r,s):t,!0),e.getType()==Kh&&(a.responseType="arraybuffer"),a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){var o,r=e.getType();r==jh||r==Xh?o=a.responseText:r==Wh?(o=a.responseXML)||(o=(new DOMParser).parseFromString(a.responseText,"application/xml")):r==Kh&&(o=a.response),o?i.call(this,e.readFeatures(o,{featureProjection:s}),e.readProjection(o),e.getLastExtent()):n.call(this)}else n.call(this)}.bind(this),a.onerror=function(){n.call(this)}.bind(this),a.send()}}(t,e,(function(t,e){"function"==typeof this.addFeatures&&this.addFeatures(t)}),R)}function Nh(t,e){return[[-1/0,-1/0,1/0,1/0]]}var Vh="addfeature",Bh="changefeature",Zh="clear",Uh="removefeature",Hh=function(t){this.rbush_=$s()(t,void 0),this.items_={}};Hh.prototype.insert=function(t,e){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[r(e)]=i},Hh.prototype.load=function(t,e){for(var i=new Array(e.length),n=0,o=e.length;n<o;n++){var s=t[n],a=e[n],h={minX:s[0],minY:s[1],maxX:s[2],maxY:s[3],value:a};i[n]=h,this.items_[r(a)]=h}this.rbush_.load(i)},Hh.prototype.remove=function(t){var e=r(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)},Hh.prototype.update=function(t,e){var i=this.items_[r(e)];Ei([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))},Hh.prototype.getAll=function(){return this.rbush_.all().map((function(t){return t.value}))},Hh.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}))},Hh.prototype.forEach=function(t,e){return this.forEach_(this.getAll(),t,e)},Hh.prototype.forEachInExtent=function(t,e,i){return this.forEach_(this.getInExtent(t),e,i)},Hh.prototype.forEach_=function(t,e,i){for(var n,o=0,r=t.length;o<r;o++)if(n=e.call(i,t[o]))return n;return n},Hh.prototype.isEmpty=function(){return d(this.items_)},Hh.prototype.clear=function(){this.rbush_.clear(),this.items_={}},Hh.prototype.getExtent=function(t){var e=this.rbush_.toJSON();return Si(e.minX,e.minY,e.maxX,e.maxY,t)},Hh.prototype.concat=function(t){for(var e in this.rbush_.load(t.rbush_.all()),t.items_)this.items_[e]=t.items_[e]};var qh=Hh,Jh=function(t){function e(e,i){t.call(this,e),this.feature=i}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e}(F),Qh=function(t){function e(e){var i=e||{};t.call(this,{attributions:i.attributions,projection:void 0,state:Zo,wrapX:void 0===i.wrapX||i.wrapX}),this.loader_=R,this.format_=i.format,this.overlaps_=null==i.overlaps||i.overlaps,this.url_=i.url,void 0!==i.loader?this.loader_=i.loader:void 0!==this.url_&&(Pe(this.format_,7),this.loader_=Yh(this.url_,this.format_)),this.strategy_=void 0!==i.strategy?i.strategy:Nh;var n,o,r=void 0===i.useSpatialIndex||i.useSpatialIndex;this.featuresRtree_=r?new qh:null,this.loadedExtentsRtree_=new qh,this.nullGeometryFeatures_={},this.idIndex_={},this.undefIdIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(i.features)?o=i.features:i.features&&(o=(n=i.features).getArray()),r||void 0!==n||(n=new et(o)),void 0!==o&&this.addFeaturesInternal(o),void 0!==n&&this.bindFeaturesCollection_(n)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.addFeature=function(t){this.addFeatureInternal(t),this.changed()},e.prototype.addFeatureInternal=function(t){var e=r(t);if(this.addToIndex_(e,t)){this.setupChangeEvents_(e,t);var i=t.getGeometry();if(i){var n=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(n,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Jh(Vh,t))}},e.prototype.setupChangeEvents_=function(t,e){this.featureChangeKeys_[t]=[y(e,P,this.handleFeatureChange_,this),y(e,l,this.handleFeatureChange_,this)]},e.prototype.addToIndex_=function(t,e){var i=!0,n=e.getId();return void 0!==n?n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e:(Pe(!(t in this.undefIdIndex_),30),this.undefIdIndex_[t]=e),i},e.prototype.addFeatures=function(t){this.addFeaturesInternal(t),this.changed()},e.prototype.addFeaturesInternal=function(t){for(var e=[],i=[],n=[],o=0,s=t.length;o<s;o++){var a=t[o],h=r(a);this.addToIndex_(h,a)&&i.push(a)}for(var l=0,u=i.length;l<u;l++){var c=i[l],p=r(c);this.setupChangeEvents_(p,c);var d=c.getGeometry();if(d){var f=d.getExtent();e.push(f),n.push(c)}else this.nullGeometryFeatures_[p]=c}this.featuresRtree_&&this.featuresRtree_.load(e,n);for(var _=0,g=i.length;_<g;_++)this.dispatchEvent(new Jh(Vh,i[_]))},e.prototype.bindFeaturesCollection_=function(t){var e=!1;y(this,Vh,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),y(this,Uh,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),y(t,a,(function(t){e||(e=!0,this.addFeature(t.element),e=!1)}),this),y(t,h,(function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}),this),this.featuresCollection_=t},e.prototype.clear=function(t){if(t){for(var e in this.featureChangeKeys_){this.featureChangeKeys_[e].forEach(S)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.undefIdIndex_={})}else if(this.featuresRtree_)for(var i in this.featuresRtree_.forEach(this.removeFeatureInternal,this),this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[i]);this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.loadedExtentsRtree_.clear(),this.nullGeometryFeatures_={};var n=new Jh(Zh);this.dispatchEvent(n),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 i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):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(i){if(i.getGeometry().intersectsExtent(t)){var n=e(i);if(n)return n}}))},e.prototype.getFeaturesCollection=function(){return this.featuresCollection_},e.prototype.getFeatures=function(){var t;return this.featuresCollection_?t=this.featuresCollection_.getArray():this.featuresRtree_&&(t=this.featuresRtree_.getAll(),d(this.nullGeometryFeatures_)||oe(t,p(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_.getInExtent(t)},e.prototype.getClosestFeatureToCoordinate=function(t,e){var i=t[0],n=t[1],o=null,r=[NaN,NaN],s=1/0,a=[-1/0,-1/0,1/0,1/0],h=e||w;return this.featuresRtree_.forEachInExtent(a,(function(t){if(h(t)){var e=t.getGeometry(),l=s;if((s=e.closestPointXY(i,n,r,s))<l){o=t;var u=Math.sqrt(s);a[0]=i-u,a[1]=n-u,a[2]=i+u,a[3]=n+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.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,i=r(e),n=e.getGeometry();if(n){var o=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);var s=e.getId();if(void 0!==s){var a=s.toString();i in this.undefIdIndex_?(delete this.undefIdIndex_[i],this.idIndex_[a]=e):this.idIndex_[a]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[a]=e)}else i in this.undefIdIndex_||(this.removeFromIdIndex_(e),this.undefIdIndex_[i]=e);this.changed(),this.dispatchEvent(new Jh(Bh,e))},e.prototype.hasFeature=function(t){var e=t.getId();return void 0!==e?e in this.idIndex_:r(t)in this.undefIdIndex_},e.prototype.isEmpty=function(){return this.featuresRtree_.isEmpty()&&d(this.nullGeometryFeatures_)},e.prototype.loadFeatures=function(t,e,i){var n=this,o=this.loadedExtentsRtree_,r=this.strategy_(t,e);this.loading=!1;for(var s=function(t,s){var a=r[t];o.forEachInExtent(a,(function(t){return vi(t.extent,a)}))||(n.loader_.call(n,a,e,i),o.insert(a,{extent:a.slice()}),n.loading=n.loader_!==R)},a=0,h=r.length;a<h;++a)s(a)},e.prototype.removeLoadedExtent=function(t){var e,i=this.loadedExtentsRtree_;i.forEachInExtent(t,(function(i){if(Ei(i.extent,t))return e=i,!0})),e&&i.remove(e)},e.prototype.removeFeature=function(t){var e=r(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.removeFeatureInternal(t),this.changed()},e.prototype.removeFeatureInternal=function(t){var e=r(t);this.featureChangeKeys_[e].forEach(S),delete this.featureChangeKeys_[e];var i=t.getId();void 0!==i?delete this.idIndex_[i.toString()]:delete this.undefIdIndex_[e],this.dispatchEvent(new Jh(Uh,t))},e.prototype.removeFromIdIndex_=function(t){var e=!1;for(var i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e},e.prototype.setLoader=function(t){this.loader_=t},e}(ph),$h=0,tl=1;function el(t){if(t.frameState){this.sliderInitialized_||this.initSlider_();var e=t.frameState.viewState.resolution;e!==this.currentResolution_&&(this.currentResolution_=e,this.setThumbPosition_(e))}}var il,nl=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||el}),this.dragListenerKeys_=[],this.currentResolution_=void 0,this.direction_=$h,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.previousX_,this.previousY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=void 0!==i.duration?i.duration:200;var n=void 0!==i.className?i.className:"ol-zoomslider",o=document.createElement("button");o.setAttribute("type","button"),o.className=n+"-thumb ol-unselectable";var r=this.element;r.className=n+" ol-unselectable ol-control",r.appendChild(o),this.dragger_=new pe(r),y(this.dragger_,vt,this.handleDraggerStart_,this),y(this.dragger_,gt,this.handleDraggerDrag_,this),y(this.dragger_,yt,this.handleDraggerEnd_,this),y(r,O,this.handleContainerClick_,this),y(o,O,I)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.disposeInternal=function(){this.dragger_.dispose(),t.prototype.disposeInternal.call(this)},e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&e.render()},e.prototype.initSlider_=function(){var t=this.element,e=t.offsetWidth,i=t.offsetHeight,n=t.firstElementChild,o=getComputedStyle(n),r=n.offsetWidth+parseFloat(o.marginRight)+parseFloat(o.marginLeft),s=n.offsetHeight+parseFloat(o.marginTop)+parseFloat(o.marginBottom);this.thumbSize_=[r,s],e>i?(this.direction_=tl,this.widthLimit_=e-r):(this.direction_=$h,this.heightLimit_=i-s),this.sliderInitialized_=!0},e.prototype.handleContainerClick_=function(t){var e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(i);e.animate({resolution:e.constrainResolution(n),duration:this.duration_,easing:$e})},e.prototype.handleDraggerStart_=function(t){if(!this.dragging_&&t.originalEvent.target===this.element.firstElementChild&&(this.getMap().getView().setHint(Ve,1),this.previousX_=t.clientX,this.previousY_=t.clientY,this.dragging_=!0,0===this.dragListenerKeys_.length)){var e=this.handleDraggerDrag_,i=this.handleDraggerEnd_;this.dragListenerKeys_.push(y(document,X,e,this),y(document,gt,e,this),y(document,W,i,this),y(document,yt,i,this))}},e.prototype.handleDraggerDrag_=function(t){if(this.dragging_){var e=this.element.firstElementChild,i=t.clientX-this.previousX_+parseFloat(e.style.left),n=t.clientY-this.previousY_+parseFloat(e.style.top),o=this.getRelativePosition_(i,n);this.currentResolution_=this.getResolutionForPosition_(o),this.getMap().getView().setResolution(this.currentResolution_),this.setThumbPosition_(this.currentResolution_),this.previousX_=t.clientX,this.previousY_=t.clientY}},e.prototype.handleDraggerEnd_=function(t){if(this.dragging_){var e=this.getMap().getView();e.setHint(Ve,-1),e.animate({resolution:e.constrainResolution(this.currentResolution_),duration:this.duration_,easing:$e}),this.dragging_=!1,this.previousX_=void 0,this.previousY_=void 0,this.dragListenerKeys_.forEach(S),this.dragListenerKeys_.length=0}},e.prototype.setThumbPosition_=function(t){var e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==tl?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"},e.prototype.getRelativePosition_=function(t,e){return Oe(this.direction_===tl?t/this.widthLimit_:e/this.heightLimit_,0,1)},e.prototype.getResolutionForPosition_=function(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)},e.prototype.getPositionForResolution_=function(t){return 1-this.getMap().getView().getValueForResolutionFunction()(t)},e}(tr),ol=function(){if(!il){var t=document.body;t.webkitRequestFullscreen?il="webkitfullscreenchange":t.mozRequestFullScreen?il="mozfullscreenchange":t.msRequestFullscreen?il="MSFullscreenChange":t.requestFullscreen&&(il="fullscreenchange")}return il};function rl(){var t=document.body;return!!(t.webkitRequestFullscreen||t.mozRequestFullScreen&&document.mozFullScreenEnabled||t.msRequestFullscreen&&document.msFullscreenEnabled||t.requestFullscreen&&document.fullscreenEnabled)}function sl(){return!!(document.webkitIsFullScreen||document.mozFullScreen||document.msFullscreenElement||document.fullscreenElement)}function al(t){t.requestFullscreen?t.requestFullscreen():t.msRequestFullscreen?t.msRequestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}var hl=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),target:i.target}),this.cssClassName_=void 0!==i.className?i.className:"ol-full-screen";var n=void 0!==i.label?i.label:"⤢";this.labelNode_="string"==typeof n?document.createTextNode(n):n;var o=void 0!==i.labelActive?i.labelActive:"×";this.labelActiveNode_="string"==typeof o?document.createTextNode(o):o,this.button_=document.createElement("button");var r=i.tipLabel?i.tipLabel:"Toggle full-screen";this.setClassName_(this.button_,sl()),this.button_.setAttribute("type","button"),this.button_.title=r,this.button_.appendChild(this.labelNode_),y(this.button_,O,this.handleClick_,this);var s=this.cssClassName_+" ol-unselectable ol-control "+(rl()?"":"ol-unsupported"),a=this.element;a.className=s,a.appendChild(this.button_),this.keys_=void 0!==i.keys&&i.keys,this.source_=i.source}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.handleClick_=function(t){t.preventDefault(),this.handleFullScreen_()},e.prototype.handleFullScreen_=function(){if(rl()){var t,e=this.getMap();if(e)if(sl())document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen();else t=this.source_?"string"==typeof this.source_?document.getElementById(this.source_):this.source_:e.getTargetElement(),this.keys_?function(t){t.mozRequestFullScreenWithKeys?t.mozRequestFullScreenWithKeys():t.webkitRequestFullscreen?t.webkitRequestFullscreen():al(t)}(t):al(t)}},e.prototype.handleFullScreenChange_=function(){var t=this.getMap();sl()?(this.setClassName_(this.button_,!0),Do(this.labelActiveNode_,this.labelNode_)):(this.setClassName_(this.button_,!1),Do(this.labelNode_,this.labelActiveNode_)),t&&t.updateSize()},e.prototype.setClassName_=function(t,e){var i=this.cssClassName_+"-true",n=this.cssClassName_+"-false",o=e?i:n;t.classList.remove(i),t.classList.remove(n),t.classList.add(o)},e.prototype.setMap=function(e){t.prototype.setMap.call(this,e),e&&this.listenerKeys.push(y(document,ol(),this.handleFullScreenChange_,this))},e}(tr),ll="bottom-left",ul="bottom-center",cl="bottom-right",pl="center-left",dl="center-center",fl="center-right",_l="top-left",gl="top-center",vl="top-right",yl="element",ml="map",xl="offset",Sl="position",Cl="positioning",El=function(t){function e(e){t.call(this),this.options=e,this.id=e.id,this.insertFirst=void 0===e.insertFirst||e.insertFirst,this.stopEvent=void 0===e.stopEvent||e.stopEvent,this.element=document.createElement("div"),this.element.className=void 0!==e.className?e.className:"ol-overlay-container ol-selectable",this.element.style.position="absolute",this.autoPan=void 0!==e.autoPan&&e.autoPan,this.autoPanAnimation=e.autoPanAnimation||{},this.autoPanMargin=void 0!==e.autoPanMargin?e.autoPanMargin:20,this.rendered={bottom_:"",left_:"",right_:"",top_:"",visible:!0},this.mapPostrenderListenerKey=null,y(this,J(yl),this.handleElementChanged,this),y(this,J(ml),this.handleMapChanged,this),y(this,J(xl),this.handleOffsetChanged,this),y(this,J(Sl),this.handlePositionChanged,this),y(this,J(Cl),this.handlePositioningChanged,this),void 0!==e.element&&this.setElement(e.element),this.setOffset(void 0!==e.offset?e.offset:[0,0]),this.setPositioning(void 0!==e.positioning?e.positioning:_l),void 0!==e.position&&this.setPosition(e.position)}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.getElement=function(){return this.get(yl)},e.prototype.getId=function(){return this.id},e.prototype.getMap=function(){return this.get(ml)},e.prototype.getOffset=function(){return this.get(xl)},e.prototype.getPosition=function(){return this.get(Sl)},e.prototype.getPositioning=function(){return this.get(Cl)},e.prototype.handleElementChanged=function(){Go(this.element);var t=this.getElement();t&&this.element.appendChild(t)},e.prototype.handleMapChanged=function(){this.mapPostrenderListenerKey&&(Ao(this.element),S(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);var t=this.getMap();if(t){this.mapPostrenderListenerKey=y(t,fe,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)}},e.prototype.render=function(){this.updatePixelPosition()},e.prototype.handleOffsetChanged=function(){this.updatePixelPosition()},e.prototype.handlePositionChanged=function(){this.updatePixelPosition(),this.get(Sl)&&this.autoPan&&this.panIntoView()},e.prototype.handlePositioningChanged=function(){this.updatePixelPosition()},e.prototype.setElement=function(t){this.set(yl,t)},e.prototype.setMap=function(t){this.set(ml,t)},e.prototype.setOffset=function(t){this.set(xl,t)},e.prototype.setPosition=function(t){this.set(Sl,t)},e.prototype.panIntoView=function(){var t=this.getMap();if(t&&t.getTargetElement()){var e=this.getRect(t.getTargetElement(),t.getSize()),i=this.getElement(),n=this.getRect(i,[ko(i),Oo(i)]),o=this.autoPanMargin;if(!vi(e,n)){var r=n[0]-e[0],s=e[2]-n[2],a=n[1]-e[1],h=e[3]-n[3],l=[0,0];if(r<0?l[0]=r-o:s<0&&(l[0]=Math.abs(s)+o),a<0?l[1]=a-o:h<0&&(l[1]=Math.abs(h)+o),0!==l[0]||0!==l[1]){var u=t.getView().getCenter(),c=t.getPixelFromCoordinate(u),p=[c[0]+l[0],c[1]+l[1]];t.getView().animate({center:t.getCoordinateFromPixel(p),duration:this.autoPanAnimation.duration,easing:this.autoPanAnimation.easing})}}}},e.prototype.getRect=function(t,e){var i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,o=i.top+window.pageYOffset;return[n,o,n+e[0],o+e[1]]},e.prototype.setPositioning=function(t){this.set(Cl,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 i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}else this.setVisible(!1)},e.prototype.updateRenderedPosition=function(t,e){var i=this.element.style,n=this.getOffset(),o=this.getPositioning();this.setVisible(!0);var r=n[0],s=n[1];if(o==cl||o==fl||o==vl){""!==this.rendered.left_&&(this.rendered.left_=i.left="");var a=Math.round(e[0]-t[0]-r)+"px";this.rendered.right_!=a&&(this.rendered.right_=i.right=a)}else{""!==this.rendered.right_&&(this.rendered.right_=i.right=""),o!=ul&&o!=dl&&o!=gl||(r-=this.element.offsetWidth/2);var h=Math.round(t[0]+r)+"px";this.rendered.left_!=h&&(this.rendered.left_=i.left=h)}if(o==ll||o==ul||o==cl){""!==this.rendered.top_&&(this.rendered.top_=i.top="");var l=Math.round(e[1]-t[1]-s)+"px";this.rendered.bottom_!=l&&(this.rendered.bottom_=i.bottom=l)}else{""!==this.rendered.bottom_&&(this.rendered.bottom_=i.bottom=""),o!=pl&&o!=dl&&o!=fl||(s-=this.element.offsetHeight/2);var u=Math.round(t[1]+s)+"px";this.rendered.top_!=u&&(this.rendered.top_=i.top=u)}},e.prototype.getOptions=function(){return this.options},e}(Q);function wl(t){this.validateExtent_(),this.updateBox_()}var Tl=function(t){function e(e){var i=e||{};t.call(this,{element:document.createElement("div"),render:i.render||wl,target:i.target}),this.collapsed_=void 0===i.collapsed||i.collapsed,this.collapsible_=void 0===i.collapsible||i.collapsible,this.collapsible_||(this.collapsed_=!1);var n=void 0!==i.className?i.className:"ol-overviewmap",o=void 0!==i.tipLabel?i.tipLabel:"Overview map",r=void 0!==i.collapseLabel?i.collapseLabel:"«";"string"==typeof r?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r):this.collapseLabel_=r;var s=void 0!==i.label?i.label:"»";"string"==typeof s?(this.label_=document.createElement("span"),this.label_.textContent=s):this.label_=s;var a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,h=document.createElement("button");h.setAttribute("type","button"),h.title=o,h.appendChild(a),y(h,O,this.handleClick_,this),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.ovmap_=new Na({controls:new et,interactions:new et,view:i.view});var l=this.ovmap_;i.layers&&i.layers.forEach(function(t){l.addLayer(t)}.bind(this));var u=document.createElement("div");u.className="ol-overviewmap-box",u.style.boxSizing="border-box",this.boxOverlay_=new El({position:[0,0],positioning:ll,element:u}),this.ovmap_.addOverlay(this.boxOverlay_);var c=n+" ol-unselectable ol-control"+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible"),p=this.element;p.className=c,p.appendChild(this.ovmapDiv_),p.appendChild(h);var d=this,f=this.boxOverlay_,_=this.boxOverlay_.getElement(),g=function(t){var e,i={clientX:(e=t).clientX-_.offsetWidth/2,clientY:e.clientY+_.offsetHeight/2},n=l.getEventCoordinate(i);f.setPosition(n)},v=function(t){var e=l.getEventCoordinate(t);d.getMap().getView().setCenter(e),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",v)};_.addEventListener("mousedown",(function(){window.addEventListener("mousemove",g),window.addEventListener("mouseup",v)}))}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.setMap=function(e){var i=this.getMap();if(e!==i){if(i){var n=i.getView();n&&this.unbindView_(n),this.ovmap_.setTarget(null)}if(t.prototype.setMap.call(this,e),e){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(y(e,l,this.handleMapPropertyChange_,this)),0===this.ovmap_.getLayers().getLength()&&this.ovmap_.setLayerGroup(e.getLayerGroup());var o=e.getView();o&&(this.bindView_(o),o.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_()))}}},e.prototype.handleMapPropertyChange_=function(t){if(t.key===xe){var e=t.oldValue;e&&this.unbindView_(e);var i=this.getMap().getView();this.bindView_(i)}},e.prototype.bindView_=function(t){y(t,J(Ue),this.handleRotationChanged_,this)},e.prototype.unbindView_=function(t){x(t,J(Ue),this.handleRotationChanged_,this)},e.prototype.handleRotationChanged_=function(){this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())},e.prototype.validateExtent_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var i=t.getSize(),n=t.getView().calculateExtent(i),o=e.getSize(),r=e.getView().calculateExtent(o),s=e.getPixelFromCoordinate(Gi(n)),a=e.getPixelFromCoordinate(Pi(n)),h=Math.abs(s[0]-a[0]),l=Math.abs(s[1]-a[1]),u=o[0],c=o[1];h<.1*u||l<.1*c||h>.75*u||l>.75*c?this.resetExtent_():vi(r,n)||this.recenter_()}},e.prototype.resetExtent_=function(){var t=this.getMap(),e=this.ovmap_,i=t.getSize(),n=t.getView().calculateExtent(i),o=e.getView(),r=Math.log(7.5)/Math.LN2;Wi(n,1/(.1*Math.pow(2,r/2))),o.fit(n)},e.prototype.recenter_=function(){var t=this.getMap(),e=this.ovmap_,i=t.getView();e.getView().setCenter(i.getCenter())},e.prototype.updateBox_=function(){var t=this.getMap(),e=this.ovmap_;if(t.isRendered()&&e.isRendered()){var i=t.getSize(),n=t.getView(),o=e.getView(),r=n.getRotation(),s=this.boxOverlay_,a=this.boxOverlay_.getElement(),h=n.calculateExtent(i),l=o.getResolution(),u=Mi(h),c=zi(h),p=this.calculateCoordinateRotate_(r,u);s.setPosition(p),a&&(a.style.width=Math.abs((u[0]-c[0])/l)+"px",a.style.height=Math.abs((c[1]-u[1])/l)+"px")}},e.prototype.calculateCoordinateRotate_=function(t,e){var i,n=this.getMap().getView().getCenter();return n&&(qe(i=[e[0]-n[0],e[1]-n[1]],t),He(i,n)),i},e.prototype.handleClick_=function(t){t.preventDefault(),this.handleToggle_()},e.prototype.handleToggle_=function(){this.element.classList.toggle("ol-collapsed"),this.collapsed_?Do(this.collapseLabel_,this.label_):Do(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;var t=this.ovmap_;this.collapsed_||t.isRendered()||(t.updateSize(),this.resetExtent_(),m(t,fe,(function(t){this.updateBox_()}),this))},e.prototype.getCollapsible=function(){return this.collapsible_},e.prototype.setCollapsible=function(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())},e.prototype.setCollapsed=function(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()},e.prototype.getCollapsed=function(){return this.collapsed_},e.prototype.getOverviewMap=function(){return this.ovmap_},e}(tr),Rl=new Na({target:"map",layers:[new Ha({source:new Th})],view:new Po({center:On([6.139751866080319,46.20483094450376]),zoom:15,maxZoom:18,minZoom:12})}),bl=new zh({source:new Qh({features:[new Va({geometry:new _o(On([6.139751866080319,46.20483094450376]))})]})});Rl.addControl(new nl),Rl.addControl(new hl),Rl.addControl(new Tl({collapsed:!1})),Rl.addLayer(bl)}});