define(["./createTaskProcessorWorker","./Color-5008547b","./when-b60132fc","./Check-7b2a090c","./pbf-2b242707","./FeatureDetection-c3b71206","./Math-119be1a3"],(function(t,e,n,i,r,o,s){"use strict";function a(){}function l(t){var e=null,n=null,i=null;return h(t[0])?(i=t[0],t.length>1&&"$"===(n=t[1])[0]?null:(t.length>2&&(e=t[2]),{filterOperator:i,filterFieldName:n,filterCompareValue:e})):null}function h(t){return-1!==["==","===",">=","<=",">","<","!=","has"].indexOf(t)}function c(t,e,n){return t[e]==n}a.parseLayerFilter=function(t){if(!(n.defined(t)&&t instanceof Array))return null;var e,i=[];if(h(t[0]))e=l(t),n.defined(e)&&i.push(e);else for(var r=0;r":function(t,e,n){return t[e]>n},"<":function(t,e,n){return t[e]=":function(t,e,n){return t[e]>=n},"<=":function(t,e,n){return t[e]<=n},"!=":function(t,e,n){return t[e]!=n},has:function(t,e){return n.defined(t[e])}};function d(t,e){if(!t)throw new i.DeveloperError("need include ol-debug.js");this._useOffscreen=e,this._openlayer=t}function f(t){var e=t.substring(t.indexOf("(")+1,t.indexOf(")"));e=e.split(",");var n=[];return n.push(parseFloat(e[0])),n.push(parseFloat(e[1])),n.push(parseFloat(e[2])),n.push(parseFloat(e[3])),n}function g(t,e){if(t&&void 0!==e){var n={color:[255*t[0]/t[3],255*t[1]/t[3],255*t[2]/t[3],t[3]],opacity:t[3]};(t=n.color)[3]=n.opacity*e,0===t[3]&&(t=void 0)}return t}Object.defineProperties(d.prototype,{proxy:{get:function(){}}}),d.prototype.getStyle=function(){var t=this._openlayer,e=new t.style.Fill({color:""});e.setColor("#ffffff");var n=new t.style.Stroke({color:"",width:1});return n.setWidth(1),n.setColor("#000000"),new t.style.Style({fill:e,stroke:n})},d.prototype.getStyleByMapboxStyle=function(t){var e=this._openlayer,i=t.type,r=t.paint,o=t.layout;if(!n.defined(i)||!n.defined(r))return this.getStyle();if("fill"==i){var s=new e.style.Style({}),a=new e.style.Fill({color:"[255,255,255,1]"});s.setFill(a);var l=r["fill-opacity"];if(n.defined(r["fill-color"])){var h=f(r["fill-color"]);n.defined(l)&&(h[3]*=l),a.setColor(h)}if(n.defined(r["fill-outline-color"])){var c=new e.style.Stroke({color:"",width:1});c.setColor(r["fill-outline-color"]),s.setStroke(c)}return n.defined(r["fill-pattern"])&&(s.fillPatternName=r["fill-pattern"]),s}if("line"==i){var u=new e.style.Style({}),d=new e.style.Stroke({color:"#000000",width:1});u.setStroke(d);var p=r["line-opacity"];if(n.defined(r["line-color"])){var y=f(r["line-color"]);n.defined(p)&&(y[3]*=p)}if(n.defined(r["line-width"])){var m=r["line-width"];d.setWidth(m)}if(n.defined(r["line-dasharray"])){var v=r["line-dasharray"];d.setLineDash(v)}if(n.defined(o)){if(n.defined(o["line-cap"])){var _=o["line-cap"];d.setLineCap(_)}if(n.defined(o["line-join"])){var S=o["line-join"];d.setLineJoin(S)}if(n.defined(o["line-miter-limit"])){var x=o["line-miter-limit"];d.setMiterLimit(x)}}return d.setColor(y),u}if("symbol"==i){var I=new e.style.Style({});return n.defined(o)&&n.defined(o["icon-image"])&&(I.hasIconImage=!0),n.defined(o)&&n.defined(o["text-field"])&&(I.hasTextStyle=!0),I}if("circle"==i){var C=r["circle-radius"],T=r["circle-color"],R=r["circle-stroke-color"],L=r["circle-opacity"],E=r["circle-stroke-opacity"],O=r["circle-stroke-width"],G=new e.style.Circle({radius:C,stroke:0===O?void 0:new e.style.Stroke({width:O,color:g(R,E)}),fill:new e.style.Fill({color:g(T,L)})}),M=new e.style.Style({});return M.setImage(G),M}return this.getStyle()};var p=new e.Color;d.prototype.getIDColorStyle=function(t,e,i,r,o,s){var a=this._openlayer,l=function(t,e){var n=Math.floor(t/65536),i=t-65536*n,r=Math.floor(i/256),o=i-256*r;return p.red=o/256,p.green=r/256,p.blue=n/256,p.alpha=1,p}(e),h=l.toCssColorString();if("LineString"==t||"LinearRing"==t||"MultiLineString"==t){var c=4;return n.defined(r)&&(c=2*r+s),(g=new a.style.Stroke({color:"",width:c})).setColor(h),new a.style.Style({stroke:g})}if("Point"==t||"MultiPoint"==t){var u=new a.style.Circle({radius:o-.5,fill:new a.style.Fill({color:h})}),d=new a.style.Style({});return d.setImage(u),d}var f=new a.style.Fill({color:""});f.setColor(h);var g,y=new a.style.Style({fill:f});return n.defined(r)&&((g=new a.style.Stroke({color:"",width:n.defined(r)?2*r:4})).setColor(h),y.setStroke(g)),y};var y=/^([^]*)\{(.*)\}([^]*)$/;d.prototype.getTextStyle=function(t,e,i){var r=this._openlayer,o=i.paint,s=i.layout,a=function(t,e){var n;do{if(n=t.match(y)){const i=e[n[2]]||"";t=n[1]+i+n[3]}}while(n);return t}(s["text-field"],e.getProperties());if(n.defined(a)){var l=new r.style.Style,h=new r.style.Text;l.setText(h);var c=s["text-size"],u=n.defaultValue(s["text-font"],["Open Sans Regular","Arial Unicode MS Regular"]),d=s["text-transform"];"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase()),n.defaultValue(s["text-max-width"],10);var g=a;h.setText(g),h.setFont(u),h.setRotation(0);var p=n.defaultValue(s["text-anchor"],"center"),m=n.defaultValue(s["symbol-placement"],"point");if(h.setPlacement(m),"point"==m){var v="center";-1!==p.indexOf("left")?v="left":-1!==p.indexOf("right")&&(v="right"),h.setTextAlign(v)}else h.setTextAlign();var _="middle";0==p.indexOf("bottom")?_="bottom":0==p.indexOf("top")&&(_="top"),h.setTextBaseline(_);var S=n.defaultValue(s["text-offset"],[0,0]),x=n.defaultValue(s["text-translate"],[0,0]);h.setOffsetX(S[0]*c+x[0]),h.setOffsetY(S[1]*c+x[1]),o["text-opacity"];var I=new r.style.Fill,C=o["text-color"];n.defined(C)&&(C=f(C),I.setColor(C)),h.setFill(I);var T=o["text-halo-color"];if(n.defined(T)){var R=new r.style.Stroke;T=f(T),R.setColor(T),R.setWidth(o["text-halo-width"]),h.setStroke(R)}else h.setStroke(void 0);return l.setZIndex(t.getZIndex()),l.hasIconImage=t.hasIconImage,l.textSize=c,l}};var m={};d.prototype.setIconImageForStyle=function(t,e,i){var r=this._openlayer,o=i.paint,s=i.layout,a=n.defaultValue(s["icon-size"],1),l=o["icon-color"],h=n.defaultValue(o["icon-translate"],[0,0]),c=n.defaultValue(o["icon-translate-anchor"],"map"),u=n.defaultValue(s["icon-anchor"],"center"),d=function(t){var e=[.5,.5];return["top-left","top-right","bottom-left","bottom-right"].includes(t)&&(e=[0,0]),"left"===t&&(t="top-left",e=[0,.5]),"right"===t&&(t="top-left",e=[1,.5]),"bottom"===t&&(t="top-left",e=[.5,1]),"top"===t&&(t="top-left",e=[.5,0]),{anchorOffset:e,iconAnchor:t}}(u),f=d.anchorOffset,g=n.defaultValue(s.iconoffset,[0,0]),p=n.defaultValue(s["icon-opacity"],1),y=s["icon-image"];if(n.defined(t[y])){var v=y+"."+a+"."+h+"."+c+"."+u+"."+g;n.defined(l)&&(v+="."+l);var _=m[v];if(!n.defined(_)){var S,x=t[y];this._useOffscreen?S=new OffscreenCanvas(x.width,x.height):((S=document.createElement("canvas")).width=x.width,S.height=x.height),S.getContext("2d").putImageData(x,0,0);var I=[h[0]/x.width,h[1]/x.height];(_=new r.style.Icon({img:S,anchorOrigin:d.iconAnchor,anchor:[g[0]+f[0]+I[0],g[1]+f[1]-I[1]],imgSize:[S.width,S.height],scale:a})).setOpacity(p),m[v]=_}e.setImage(_)}else console.log("miss icon-image "+y)};var v=4096,_=["Default","Polygon","LineString","Image","Symbol","Text"];function S(t){this._mvtStyleClass=t.mvtStyle,this._openlayer=t.openlayer}function x(t){var e=t.getId();return e-=16777216*Math.floor(e/16777216)}function I(){}Object.defineProperties(S.prototype,{}),S.prototype.renderFeatures=function(t){for(var e=t.colorCanvas,i=t.idCanvas,r=t.transform,o=t.layers,s=t.features,l=t.tileLevel,h=t.spriteImageCanvas,c=t.spriteImageDatas,u=t.squaredTolerance,d=t.showBillboard,f=t.renderID,g=t.renderColor,p=t.lineWidthExpand,y=this._openlayer,m=e.getContext("2d"),S=[],x=[],I=[],C=null,T=y.ext.rbush(9),R=new y.render.canvas.ReplayGroup(0,[0,0,v,v],8,2,!0,T),L=s.length,E=0;ED)){var A=k.filterArray;if(n.defined(A)){var b=O.getProperties();if(!a.filterTest(b,A))continue;C=this._mvtStyleClass.getStyleByMapboxStyle(k.mapboxStyleLayer)}else C=this._mvtStyleClass.getStyleByMapboxStyle(k.mapboxStyleLayer);if(n.defined(C)){if(this.createFillPatternForStyle(C,h,c,m),n.defined(C.hasTextStyle)){var N=this._mvtStyleClass.getTextStyle(C,O,k.mapboxStyleLayer);N.setZIndex(w),d?I.push({feature:O,style:N}):g&&y.renderer.vector.renderFeature_(R,O,N,-1)}if(n.defined(C.hasIconImage)&&!n.defined(C.getImage())){if(d){x.push({feature:O,style:k.mapboxStyleLayer});continue}this._mvtStyleClass.setIconImageForStyle(c,C,k.mapboxStyleLayer)}C.setZIndex(w),this.setPickStyleInFeature(O,C),w++,g&&y.renderer.vector.renderFeature_(R,O,C,-1),M=!0}}}M&&S.push(O)}if(g){R.finish();var Y={};R.replay(m,r,0,{},_,Y),Y&&y.render.canvas.ReplayGroup.replayDeclutter(Y,m,0)}return R=null,f&&this.renderIDtoTexture(r,i,S,0,u,p),{idFeatures:S,iconImageObjects:x,textObjects:I}},S.prototype.renderIDtoTexture=function(t,e,n,i,r,o){for(var s=this._openlayer,a=e.getContext("2d"),l=s.ext.rbush(9),h=new s.render.canvas.ReplayGroup(0,[0,0,v,v],8,2,!0,l),c=n.length,u=0;u>1)],e))<0?s=i+1:(a=i,l=!r);return l?s:~s},I.array.numberSafeCompareFunction=function(t,e){return t>e?1:t=0},I.array.linearFindNearest=function(t,e,n){var i,r=t.length;if(t[0]<=e)return 0;if(e<=t[r-1])return r-1;if(n>0){for(i=1;i-1;return i&&t.splice(n,1),i},I.array.find=function(t,e){for(var n,i=t.length>>>0,r=0;r0||n&&0===o)}))},I.ASSUME_TOUCH=!1,I.DEFAULT_MAX_ZOOM=42,I.DEFAULT_MIN_ZOOM=0,I.DEFAULT_RASTER_REPROJECTION_ERROR_THRESHOLD=.5,I.DEFAULT_TILE_SIZE=256,I.DEFAULT_WMS_VERSION="1.3.0",I.ENABLE_CANVAS=!0,I.ENABLE_PROJ4JS=!0,I.ENABLE_RASTER_REPROJECTION=!0,I.ENABLE_WEBGL=!0,I.DEBUG_WEBGL=!0,I.INITIAL_ATLAS_SIZE=256,I.MAX_ATLAS_SIZE=-1,I.MOUSEWHEELZOOM_MAXDELTA=1,I.OVERVIEWMAP_MAX_RATIO=.75,I.OVERVIEWMAP_MIN_RATIO=.1,I.RASTER_REPROJECTION_MAX_SOURCE_TILES=100,I.RASTER_REPROJECTION_MAX_SUBDIVISION=10,I.RASTER_REPROJECTION_MAX_TRIANGLE_WIDTH=.25,I.SIMPLIFY_TOLERANCE=.5,I.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK=1024,I.VERSION="",I.inherits=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},I.nullFunction=function(){},I.getUid=function(t){return t.ol_uid||(t.ol_uid=++I.uidCounter_)},I.asserts={},I.asserts.assert=function(t,e){},I.has={};var C,T,R,L="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"";I.has.FIREFOX=-1!==L.indexOf("firefox"),I.has.SAFARI=-1!==L.indexOf("safari")&&-1==L.indexOf("chrom"),I.has.WEBKIT=-1!==L.indexOf("webkit")&&-1==L.indexOf("edge"),I.has.MAC=-1!==L.indexOf("macintosh"),I.has.DEVICE_PIXEL_RATIO=1,I.has.CANVAS_LINE_DASH=!0,I.structs={},I.CollectionEventType={ADD:"add",REMOVE:"remove"},I.ObjectEventType={PROPERTYCHANGE:"propertychange"},I.events={},I.events.bindListener_=function(t){var e=function(e){var n=t.listener,i=t.bindTo||t.target;return t.callOnce&&I.events.unlistenByKey(t),n.call(i,e)};return t.boundListener=e,e},I.events.findListener_=function(t,e,n,i){for(var r,o=0,s=t.length;o0},I.events.EventTarget.prototype.removeEventListener=function(t,e){var n=this.listeners_[t];if(n){var i=n.indexOf(e);t in this.pendingRemovals_?(n[i]=I.nullFunction,++this.pendingRemovals_[t]):(n.splice(i,1),0===n.length&&delete this.listeners_[t])}},I.events.EventType={CHANGE:"change",CLEAR:"clear",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",ERROR:"error",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",MOUSEDOWN:"mousedown",MOUSEMOVE:"mousemove",MOUSEOUT:"mouseout",MOUSEUP:"mouseup",MOUSEWHEEL:"mousewheel",MSPOINTERDOWN:"MSPointerDown",RESIZE:"resize",TOUCHSTART:"touchstart",TOUCHMOVE:"touchmove",TOUCHEND:"touchend",WHEEL:"wheel"},I.Observable=function(){this.revision_=0},I.inherits(I.Observable,I.events.EventTarget),I.Observable.unByKey=function(t){if(Array.isArray(t))for(var e=0,n=t.length;e1?(n=r,i=o):l>0&&(n+=s*l,i+=a*l)}return I.math.squaredDistance(t,e,n,i)},I.math.squaredDistance=function(t,e,n,i){var r=n-t,o=i-e;return r*r+o*o},I.math.solveLinearSystem=function(t){for(var e=t.length,n=0;nr&&(r=s,i=o)}if(0===r)return null;var a=t[i];t[i]=t[n],t[n]=a;for(var l=n+1;l=0;d--){u[d]=t[d][e]/t[d][d];for(var f=d-1;f>=0;f--)t[f][e]-=t[f][d]*u[d]}return u},I.math.toDegrees=function(t){return 180*t/Math.PI},I.math.toRadians=function(t){return t*Math.PI/180},I.math.modulo=function(t,e){var n=t%e;return n*e<0?n+e:n},I.math.lerp=function(t,e,n){return t+n*(e-t)},I.ImageState={IDLE:0,LOADING:1,LOADED:2,ERROR:3},I.color={},I.color.HEX_COLOR_RE_=/^#(?:[0-9a-f]{3,4}){1,2}$/i,I.color.NAMED_COLOR_RE_=/^([a-z]*)$/i,I.color.asArray=function(t){return Array.isArray(t)?t:I.color.fromString(t)},I.color.asString=function(t){return"string"==typeof t?t:I.color.toString(t)},I.color.fromNamed=function(t){var e=document.createElement("div");e.style.color=t,document.body.appendChild(e);var n=getComputedStyle(e).color;return document.body.removeChild(e),n},I.color.fromString=(C={},T=0,function(t){var e;if(C.hasOwnProperty(t))e=C[t];else{if(T>=1024){var n,i=0;for(n in C)0==(3&i++)&&(delete C[n],--T)}e=I.color.fromStringInternal_(t),C[t]=e,++T}return e}),I.color.fromStringInternal_=function(t){var e,n,i,r,o,s;if(I.color.NAMED_COLOR_RE_.exec(t)&&(t=I.color.fromNamed(t)),I.color.HEX_COLOR_RE_.exec(t)){var a,l=t.length-1;a=l<=4?1:2;var h=4===l||8===l;e=parseInt(t.substr(1+0*a,a),16),n=parseInt(t.substr(1+1*a,a),16),i=parseInt(t.substr(1+2*a,a),16),r=h?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,n=(n<<4)+n,i=(i<<4)+i,h&&(r=(r<<4)+r)),o=[e,n,i,r/255]}else 0==t.indexOf("rgba(")?(s=t.slice(5,-1).split(",").map(Number),o=I.color.normalize(s)):0==t.indexOf("rgb(")?((s=t.slice(4,-1).split(",").map(Number)).push(1),o=I.color.normalize(s)):I.asserts.assert(!1,14);return o},I.color.normalize=function(t,e){var n=e||[];return n[0]=I.math.clamp(t[0]+.5|0,0,255),n[1]=I.math.clamp(t[1]+.5|0,0,255),n[2]=I.math.clamp(t[2]+.5|0,0,255),n[3]=I.math.clamp(t[3],0,1),n},I.color.toString=function(t){var e=t[0];e!=(0|e)&&(e=e+.5|0);var n=t[1];n!=(0|n)&&(n=n+.5|0);var i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+n+","+i+","+(void 0===t[3]?1:t[3])+")"},I.colorlike={},I.colorlike.asColorLike=function(t){return I.colorlike.isColorLike(t)?t:I.color.asString(t)},I.colorlike.isColorLike=function(t){return"string"==typeof t||t instanceof CanvasPattern||t instanceof CanvasGradient},I.css={},I.css.CLASS_HIDDEN="ol-hidden",I.css.CLASS_SELECTABLE="ol-selectable",I.css.CLASS_UNSELECTABLE="ol-unselectable",I.css.CLASS_UNSUPPORTED="ol-unsupported",I.css.CLASS_CONTROL="ol-control",I.css.getFontFamilies=function(){var t,e={};return function(n){if(t||(t=document.createElement("div").style),!(n in e)){t.font=n;var i=t.fontFamily;if(t.font="",!i)return null;e[n]=i.split(/,\s?/)}return e[n]}}(),I.dom={},I.dom.createCanvasContext2D=function(t,e){return(t&&e?new OffscreenCanvas(t,e):new OffscreenCanvas(1,1)).getContext("2d")},I.dom.outerWidth=function(t){var e=t.offsetWidth,n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10)},I.dom.outerHeight=function(t){var e=t.offsetHeight,n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10)},I.dom.replaceNode=function(t,e){var n=e.parentNode;n&&n.replaceChild(t,e)},I.dom.removeNode=function(t){return t&&t.parentNode?t.parentNode.removeChild(t):null},I.dom.removeChildren=function(t){for(;t.lastChild;)t.removeChild(t.lastChild)},I.extent={},I.extent.Corner={BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",TOP_LEFT:"top-left",TOP_RIGHT:"top-right"},I.extent.Relationship={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16},I.extent.boundingExtent=function(t){for(var e=I.extent.createEmpty(),n=0,i=t.length;nr&&(l|=I.extent.Relationship.RIGHT),ao&&(l|=I.extent.Relationship.ABOVE),l===I.extent.Relationship.UNKNOWN&&(l=I.extent.Relationship.INTERSECTING),l},I.extent.createEmpty=function(){return[1/0,1/0,-1/0,-1/0]},I.extent.createOrUpdate=function(t,e,n,i,r){return r?(r[0]=t,r[1]=e,r[2]=n,r[3]=i,r):[t,e,n,i]},I.extent.createOrUpdateEmpty=function(t){return I.extent.createOrUpdate(1/0,1/0,-1/0,-1/0,t)},I.extent.createOrUpdateFromCoordinate=function(t,e){var n=t[0],i=t[1];return I.extent.createOrUpdate(n,i,n,i,e)},I.extent.createOrUpdateFromCoordinates=function(t,e){var n=I.extent.createOrUpdateEmpty(e);return I.extent.extendCoordinates(n,t)},I.extent.createOrUpdateFromFlatCoordinates=function(t,e,n,i,r){var o=I.extent.createOrUpdateEmpty(r);return I.extent.extendFlatCoordinates(o,t,e,n,i)},I.extent.createOrUpdateFromRings=function(t,e){var n=I.extent.createOrUpdateEmpty(e);return I.extent.extendRings(n,t)},I.extent.equals=function(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]},I.extent.extend=function(t,e){return e[0]t[2]&&(t[2]=e[2]),e[1]t[3]&&(t[3]=e[3]),t},I.extent.extendCoordinate=function(t,e){e[0]t[2]&&(t[2]=e[0]),e[1]t[3]&&(t[3]=e[1])},I.extent.extendCoordinates=function(t,e){var n,i;for(n=0,i=e.length;ne[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]=e[0]&&t[1]<=e[3]&&t[3]>=e[1]},I.extent.isEmpty=function(t){return t[2]=l&&s<=c),i||!(o&I.extent.Relationship.RIGHT)||r&I.extent.Relationship.RIGHT||(i=(a=p-(g-c)*y)>=h&&a<=u),i||!(o&I.extent.Relationship.BELOW)||r&I.extent.Relationship.BELOW||(i=(s=g-(p-h)/y)>=l&&s<=c),i||!(o&I.extent.Relationship.LEFT)||r&I.extent.Relationship.LEFT||(i=(a=p-(g-l)*y)>=h&&a<=u)}return i},I.extent.applyTransform=function(t,e,n){var i=[t[0],t[1],t[0],t[3],t[2],t[1],t[2],t[3]];e(i,i,2);var r=[i[0],i[2],i[4],i[6]],o=[i[1],i[3],i[5],i[7]];return I.extent.boundingExtentXYs_(r,o,n)},I.obj={},I.obj.assign="function"==typeof Object.assign?Object.assign:function(t,e){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var n=Object(t),i=1,r=arguments.length;i0},I.geom.flat.orient.linearRingsAreOriented=function(t,e,n,i,r){var o,s,a=void 0!==r&&r;for(o=0,s=n.length;o0;){var d=c.pop(),f=c.pop(),g=0,p=t[f],y=t[f+1],m=t[d],v=t[d+1];for(h=f+i;hg&&(u=h,g=x)}g>r&&(l[(u-e)/i]=1,f+ir&&(o[s++]=h,o[s++]=c,a=h,l=c);return h==a&&c==l||(o[s++]=h,o[s++]=c),s},I.geom.flat.simplify.snap=function(t,e){return e*Math.round(t/e)},I.geom.flat.simplify.quantize=function(t,e,n,i,r,o,s){if(e==n)return s;var a,l,h=I.geom.flat.simplify.snap(t[e],r),c=I.geom.flat.simplify.snap(t[e+1],r);e+=i,o[s++]=h,o[s++]=c;do{if(a=I.geom.flat.simplify.snap(t[e],r),l=I.geom.flat.simplify.snap(t[e+1],r),(e+=i)==n)return o[s++]=a,o[s++]=l,s}while(a==h&&l==c);for(;e0&&p>f)&&(g<0&&y0&&y>g)?(a=u,l=d):(o[s++]=a,o[s++]=l,h=a,c=l,a=u,l=d)}}return o[s++]=a,o[s++]=l,s},I.geom.flat.simplify.quantizes=function(t,e,n,i,r,o,s,a){var l,h;for(l=0,h=n.length;l>3)?n.readString():2===t?n.readFloat():3===t?n.readDouble():4===t?n.readVarint64():5===t?n.readVarint():6===t?n.readSVarint():7===t?n.readBoolean():null;e.values.push(i)}},feature:function(t,e,n){if(1==t)e.id=n.readVarint();else if(2==t)for(var i=n.readVarint()+n.pos;n.pos>3}s--,1===o||2===o?(a+=t.readSVarint(),l+=t.readSVarint(),1===o&&h>c&&(i.push(h),c=h),n.push(a,l),h+=2):7===o?h>c&&(n.push(n[c],n[c+1]),h+=2):I.asserts.assert(!1,59)}h>c&&(i.push(h),c=h)},I.format.MVT.getGeometryType_=function(t,e){var n;return 1===t?n=1===e?I.geom.GeometryType.POINT:I.geom.GeometryType.MULTI_POINT:2===t?n=1===e?I.geom.GeometryType.LINE_STRING:I.geom.GeometryType.MULTI_LINE_STRING:3===t&&(n=I.geom.GeometryType.POLYGON),n},I.format.MVT.prototype.createFeature_=function(t,e,n){var i,r=e.type;if(0===r)return null;var o=e.id,s=e.properties;s[this.layerName_]=e.layer.name;var a=[],l=[];I.format.MVT.readRawGeometry_(t,e,a,l);var h,c=I.format.MVT.getGeometryType_(r,l.length);if(c==I.geom.GeometryType.POLYGON){for(var u=[],d=0,f=0,g=0,p=l.length;g1?(l=u,h=new I.geom.MultiPolygon(null)):h=new I.geom.Polygon(null)}else h=c===I.geom.GeometryType.POINT?new I.geom.Point(null):c===I.geom.GeometryType.LINE_STRING?new I.geom.LineString(null):c===I.geom.GeometryType.POLYGON?new I.geom.Polygon(null):c===I.geom.GeometryType.MULTI_POINT?new I.geom.MultiPoint(null):c===I.geom.GeometryType.MULTI_LINE_STRING?new I.geom.MultiLineString(null):null;h.setFlatCoordinates(I.geom.GeometryLayout.XY,a,l),i=new this.featureClass_,this.geometryName_&&i.setGeometryName(this.geometryName_);var m=I.format.Feature.transformWithOptions(h,!1,this.adaptOptions(n));return i.setGeometry(m),i.setId(o),i.setProperties(s),i},I.format.MVT.prototype.readFeatures=function(t,e){var n,i=this.layers_,o=new r.Pbf(t),s=o.readFields(I.format.MVT.pbfReaders_.layers,{}),a=[];for(var l in s)if(!i||-1!=i.indexOf(l)){if(void 0!==e){var h=e.needSourceLayerNames;if(void 0!==h&&void 0===h[l])continue}for(var c,u=0,d=(n=s[l]).length;uthis.maxCacheSize_){var t,e,n=0;for(t in this.cache_)e=this.cache_[t],0!=(3&n++)||e.hasListener()||(delete this.cache_[t],--this.cacheSize_)}},I.style.IconImageCache.prototype.get=function(t,e,n){var i=I.style.IconImageCache.getKey(t,e,n);return i in this.cache_?this.cache_[i]:null},I.style.IconImageCache.prototype.set=function(t,e,n,i){var r=I.style.IconImageCache.getKey(t,e,n);this.cache_[r]=i,++this.cacheSize_},I.style.IconImageCache.prototype.setSize=function(t){this.maxCacheSize_=t,this.expire()},I.style.iconImageCache=new I.style.IconImageCache,I.style.Image=function(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.snapToPixel_=t.snapToPixel},I.style.Image.prototype.getOpacity=function(){return this.opacity_},I.style.Image.prototype.getRotateWithView=function(){return this.rotateWithView_},I.style.Image.prototype.getRotation=function(){return this.rotation_},I.style.Image.prototype.getScale=function(){return this.scale_},I.style.Image.prototype.getSnapToPixel=function(){return this.snapToPixel_},I.style.Image.prototype.getAnchor=function(){},I.style.Image.prototype.getImage=function(t){},I.style.Image.prototype.getHitDetectionImage=function(t){},I.style.Image.prototype.getImageState=function(){},I.style.Image.prototype.getImageSize=function(){},I.style.Image.prototype.getHitDetectionImageSize=function(){},I.style.Image.prototype.getOrigin=function(){},I.style.Image.prototype.getSize=function(){},I.style.Image.prototype.setOpacity=function(t){this.opacity_=t},I.style.Image.prototype.setRotateWithView=function(t){this.rotateWithView_=t},I.style.Image.prototype.setRotation=function(t){this.rotation_=t},I.style.Image.prototype.setScale=function(t){this.scale_=t},I.style.Image.prototype.setSnapToPixel=function(t){this.snapToPixel_=t},I.style.Image.prototype.listenImageChange=function(t,e){},I.style.Image.prototype.load=function(){},I.style.Image.prototype.unlistenImageChange=function(t,e){},I.style.RegularShape=function(t){this.checksums_=null,this.canvas_=null,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.anchor_=null,this.size_=null,this.imageSize_=null,this.hitDetectionImageSize_=null,this.atlasManager_=t.atlasManager,this.render_(this.atlasManager_);var e=void 0===t.snapToPixel||t.snapToPixel,n=void 0!==t.rotateWithView&&t.rotateWithView;I.style.Image.call(this,{opacity:1,rotateWithView:n,rotation:void 0!==t.rotation?t.rotation:0,scale:1,snapToPixel:e})},I.inherits(I.style.RegularShape,I.style.Image),I.style.RegularShape.prototype.clone=function(){var t=new I.style.RegularShape({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),snapToPixel:this.getSnapToPixel(),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},I.style.RegularShape.prototype.getAnchor=function(){return this.anchor_},I.style.RegularShape.prototype.getAngle=function(){return this.angle_},I.style.RegularShape.prototype.getFill=function(){return this.fill_},I.style.RegularShape.prototype.getHitDetectionImage=function(t){return this.hitDetectionCanvas_},I.style.RegularShape.prototype.getImage=function(t){return this.canvas_},I.style.RegularShape.prototype.getImageSize=function(){return this.imageSize_},I.style.RegularShape.prototype.getHitDetectionImageSize=function(){return this.hitDetectionImageSize_},I.style.RegularShape.prototype.getImageState=function(){return I.ImageState.LOADED},I.style.RegularShape.prototype.getOrigin=function(){return this.origin_},I.style.RegularShape.prototype.getPoints=function(){return this.points_},I.style.RegularShape.prototype.getRadius=function(){return this.radius_},I.style.RegularShape.prototype.getRadius2=function(){return this.radius2_},I.style.RegularShape.prototype.getSize=function(){return this.size_},I.style.RegularShape.prototype.getStroke=function(){return this.stroke_},I.style.RegularShape.prototype.listenImageChange=function(t,e){},I.style.RegularShape.prototype.load=function(){},I.style.RegularShape.prototype.unlistenImageChange=function(t,e){},I.style.RegularShape.prototype.render_=function(t){var e,n,i="",r="",o=0,s=null,a=0,l=0;this.stroke_&&(null===(n=this.stroke_.getColor())&&(n=I.render.canvas.defaultStrokeStyle),n=I.colorlike.asColorLike(n),void 0===(l=this.stroke_.getWidth())&&(l=I.render.canvas.defaultLineWidth),s=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset(),I.has.CANVAS_LINE_DASH||(s=null,a=0),void 0===(r=this.stroke_.getLineJoin())&&(r=I.render.canvas.defaultLineJoin),void 0===(i=this.stroke_.getLineCap())&&(i=I.render.canvas.defaultLineCap),void 0===(o=this.stroke_.getMiterLimit())&&(o=I.render.canvas.defaultMiterLimit));var h=2*(this.radius_+l)+1,c={strokeStyle:n,strokeWidth:l,size:h,lineCap:i,lineDash:s,lineDashOffset:a,lineJoin:r,miterLimit:o};if(void 0===t){var u=I.dom.createCanvasContext2D(h,h);this.canvas_=u.canvas,e=h=this.canvas_.width,this.draw_(c,u,0,0),this.createHitDetectionCanvas_(c)}else{h=Math.round(h);var d,f=!this.fill_;f&&(d=this.drawHitDetectionCanvas_.bind(this,c));var g=this.getChecksum(),p=t.add(g,h,h,this.draw_.bind(this,c),d);this.canvas_=p.image,this.origin_=[p.offsetX,p.offsetY],e=p.image.width,f?(this.hitDetectionCanvas_=p.hitImage,this.hitDetectionImageSize_=[p.hitImage.width,p.hitImage.height]):(this.hitDetectionCanvas_=this.canvas_,this.hitDetectionImageSize_=[e,e])}this.anchor_=[h/2,h/2],this.size_=[h,h],this.imageSize_=[e,e]},I.style.RegularShape.prototype.draw_=function(t,e,n,i){var r,o,s;e.setTransform(1,0,0,1,0,0),e.translate(n,i),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 l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(a*=2),r=0;r<=a;r++)o=2*r*Math.PI/a-Math.PI/2+this.angle_,s=r%2==0?this.radius_:l,e.lineTo(t.size/2+s*Math.cos(o),t.size/2+s*Math.sin(o))}if(this.fill_){var h=this.fill_.getColor();null===h&&(h=I.render.canvas.defaultFillStyle),e.fillStyle=I.colorlike.asColorLike(h),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()},I.style.RegularShape.prototype.createHitDetectionCanvas_=function(t){if(this.hitDetectionImageSize_=[t.size,t.size],this.fill_)this.hitDetectionCanvas_=this.canvas_;else{var e=I.dom.createCanvasContext2D(t.size,t.size);this.hitDetectionCanvas_=e.canvas,this.drawHitDetectionCanvas_(t,e,0,0)}},I.style.RegularShape.prototype.drawHitDetectionCanvas_=function(t,e,n,i){e.setTransform(1,0,0,1,0,0),e.translate(n,i),e.beginPath();var r=this.points_;if(r===1/0)e.arc(t.size/2,t.size/2,this.radius_,0,2*Math.PI,!0);else{var o,s,a,l=void 0!==this.radius2_?this.radius2_:this.radius_;for(l!==this.radius_&&(r*=2),o=0;o<=r;o++)a=2*o*Math.PI/r-Math.PI/2+this.angle_,s=o%2==0?this.radius_:l,e.lineTo(t.size/2+s*Math.cos(a),t.size/2+s*Math.sin(a))}e.fillStyle=I.render.canvas.defaultFillStyle,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()},I.style.RegularShape.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 n="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_=[n,t,e,this.radius_,this.radius2_,this.angle_,this.points_]}return this.checksums_[0]},I.style.Circle=function(t){var e=t||{};I.style.RegularShape.call(this,{points:1/0,fill:e.fill,radius:e.radius,snapToPixel:e.snapToPixel,stroke:e.stroke,atlasManager:e.atlasManager})},I.inherits(I.style.Circle,I.style.RegularShape),I.style.Circle.prototype.clone=function(){var t=new I.style.Circle({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),snapToPixel:this.getSnapToPixel(),atlasManager:this.atlasManager_});return t.setOpacity(this.getOpacity()),t.setScale(this.getScale()),t},I.style.Circle.prototype.setRadius=function(t){this.radius_=t,this.render_(this.atlasManager_)},I.style.Fill=function(t){var e=t||{};this.color_=void 0!==e.color?e.color:null,this.checksum_=void 0},I.style.Fill.prototype.clone=function(){var t=this.getColor();return new I.style.Fill({color:t&&t.slice?t.slice():t||void 0})},I.style.Fill.prototype.getColor=function(){return this.color_},I.style.Fill.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},I.style.Fill.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.color_ instanceof CanvasPattern||this.color_ instanceof CanvasGradient?this.checksum_=I.getUid(this.color_).toString():this.checksum_="f"+(this.color_?I.color.asString(this.color_):"-")),this.checksum_},I.style.Stroke=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},I.style.Stroke.prototype.clone=function(){var t=this.getColor();return new I.style.Stroke({color:t&&t.slice?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()})},I.style.Stroke.prototype.getColor=function(){return this.color_},I.style.Stroke.prototype.getLineCap=function(){return this.lineCap_},I.style.Stroke.prototype.getLineDash=function(){return this.lineDash_},I.style.Stroke.prototype.getLineDashOffset=function(){return this.lineDashOffset_},I.style.Stroke.prototype.getLineJoin=function(){return this.lineJoin_},I.style.Stroke.prototype.getMiterLimit=function(){return this.miterLimit_},I.style.Stroke.prototype.getWidth=function(){return this.width_},I.style.Stroke.prototype.setColor=function(t){this.color_=t,this.checksum_=void 0},I.style.Stroke.prototype.setLineCap=function(t){this.lineCap_=t,this.checksum_=void 0},I.style.Stroke.prototype.setLineDash=function(t){this.lineDash_=t,this.checksum_=void 0},I.style.Stroke.prototype.setLineDashOffset=function(t){this.lineDashOffset_=t,this.checksum_=void 0},I.style.Stroke.prototype.setLineJoin=function(t){this.lineJoin_=t,this.checksum_=void 0},I.style.Stroke.prototype.setMiterLimit=function(t){this.miterLimit_=t,this.checksum_=void 0},I.style.Stroke.prototype.setWidth=function(t){this.width_=t,this.checksum_=void 0},I.style.Stroke.prototype.getChecksum=function(){return void 0===this.checksum_&&(this.checksum_="s",this.color_?"string"==typeof this.color_?this.checksum_+=this.color_:this.checksum_+=I.getUid(this.color_).toString():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_},I.style.IconAnchorUnits={FRACTION:"fraction",PIXELS:"pixels"},I.style.IconImage=function(t,e,n,i,r,o){I.events.EventTarget.call(this),this.hitDetectionImage_=null,this.image_=t||new Image,null!==i&&(this.image_.crossOrigin=i),this.canvas_=o?document.createElement("CANVAS"):null,this.color_=o,this.imageListenerKeys_=null,this.imageState_=r,this.size_=n,this.src_=e,this.tainting_=!1,this.imageState_==I.ImageState.LOADED&&this.determineTainting_()},I.inherits(I.style.IconImage,I.events.EventTarget),I.style.IconImage.get=function(t,e,n,i,r,o){var s=I.style.iconImageCache,a=s.get(e,i,o);return a||(a=new I.style.IconImage(t,e,n,i,r,o),s.set(e,i,o,a)),a},I.style.IconImage.prototype.determineTainting_=function(){var t=I.dom.createCanvasContext2D(1,1);try{t.drawImage(this.image_,0,0),t.getImageData(0,0,1,1)}catch(t){this.tainting_=!0}},I.style.IconImage.prototype.dispatchChangeEvent_=function(){this.dispatchEvent(I.events.EventType.CHANGE)},I.style.IconImage.prototype.handleImageError_=function(){this.imageState_=I.ImageState.ERROR,this.unlistenImage_(),this.dispatchChangeEvent_()},I.style.IconImage.prototype.handleImageLoad_=function(){this.imageState_=I.ImageState.LOADED,this.size_&&(this.image_.width=this.size_[0],this.image_.height=this.size_[1]),this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.determineTainting_(),this.replaceColor_(),this.dispatchChangeEvent_()},I.style.IconImage.prototype.getImage=function(t){return this.canvas_?this.canvas_:this.image_},I.style.IconImage.prototype.getImageState=function(){return this.imageState_},I.style.IconImage.prototype.getHitDetectionImage=function(t){if(!this.hitDetectionImage_)if(this.tainting_){var e=this.size_[0],n=this.size_[1],i=I.dom.createCanvasContext2D(e,n);i.fillRect(0,0,e,n),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_},I.style.IconImage.prototype.getSize=function(){return this.size_},I.style.IconImage.prototype.getSrc=function(){return this.src_},I.style.IconImage.prototype.load=function(){if(this.imageState_==I.ImageState.IDLE){this.imageState_=I.ImageState.LOADING,this.imageListenerKeys_=[I.events.listenOnce(this.image_,I.events.EventType.ERROR,this.handleImageError_,this),I.events.listenOnce(this.image_,I.events.EventType.LOAD,this.handleImageLoad_,this)];try{this.image_.src=this.src_}catch(t){this.handleImageError_()}}},I.style.IconImage.prototype.replaceColor_=function(){if(!this.tainting_&&null!==this.color_){this.canvas_.width=this.image_.width,this.canvas_.height=this.image_.height;var t=this.canvas_.getContext("2d");t.drawImage(this.image_,0,0);for(var e=t.getImageData(0,0,this.image_.width,this.image_.height),n=e.data,i=this.color_[0]/255,r=this.color_[1]/255,o=this.color_[2]/255,s=0,a=n.length;sn;){if(i-n>600){var a=i-n+1,l=e-n+1,h=Math.log(a),c=.5*Math.exp(2*h/3),u=.5*Math.sqrt(h*c*(a-c)/a)*(l-a/2<0?-1:1);r(t,e,Math.max(n,Math.floor(e-l*c/a+u)),Math.min(i,Math.floor(e+(a-l)*c/a+u)),s)}var d=t[e],f=n,g=i;for(o(t,n,e),s(t[i],d)>0&&o(t,n,i);f0;)g--}0===s(t[n],d)?o(t,n,g):o(t,++g,i),g<=e&&(n=g+1),e<=g&&(i=g-1)}}function o(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function s(t,e){return te?1:0}e.default=n;var a=l;function l(t,e){if(!(this instanceof l))return new l(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 h(t,e,n){if(!n)return e.indexOf(t);for(var i=0;i=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 S(t,n,i,r,o){for(var s,a=[n,i];a.length;)(i=a.pop())-(n=a.pop())<=r||(s=n+Math.ceil((i-n)/r/2)*r,e(t,s,n,i,o),a.push(n,s,s,i))}l.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],i=this.toBBox;if(!v(t,e))return n;for(var r,o,s,a,l=[];e;){for(r=0,o=e.children.length;r=0&&o[e].children.length>this._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(r,o,e)},_split:function(t,e){var n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);var o=this._chooseSplitIndex(n,r,i),s=_(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,c(n,this.toBBox),c(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=_([t,e]),this.data.height=t.height+1,this.data.leaf=!1,c(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var i,r,o,s,a,l,h,c,d,f,g,y,m,v;for(l=h=1/0,i=e;i<=n-e;i++)r=u(t,0,i,this.toBBox),o=u(t,i,n,this.toBBox),d=r,f=o,g=void 0,y=void 0,m=void 0,v=void 0,g=Math.max(d.minX,f.minX),y=Math.max(d.minY,f.minY),m=Math.min(d.maxX,f.maxX),v=Math.min(d.maxY,f.maxY),s=Math.max(0,m-g)*Math.max(0,v-y),a=p(r)+p(o),s=e;r--)o=t.children[r],d(l,t.leaf?s(o):o),h+=y(l);return h},_adjustParentBBoxes:function(t,e,n){for(var i=n;i>=0;i--)d(e[i],t)},_condense:function(t){for(var e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children).splice(e.indexOf(t[n]),1):this.clear():c(t[n],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]+"};")}},t.default=a}(this.rbush=this.rbush||{})}.call(I.ext),I.ext.rbush=I.ext.rbush.default,I.render={},I.render.VectorContext=function(){},I.render.VectorContext.prototype.drawCustom=function(t,e,n){},I.render.VectorContext.prototype.drawGeometry=function(t){},I.render.VectorContext.prototype.setStyle=function(t){},I.render.VectorContext.prototype.drawCircle=function(t,e){},I.render.VectorContext.prototype.drawFeature=function(t,e){},I.render.VectorContext.prototype.drawGeometryCollection=function(t,e){},I.render.VectorContext.prototype.drawLineString=function(t,e){},I.render.VectorContext.prototype.drawMultiLineString=function(t,e){},I.render.VectorContext.prototype.drawMultiPoint=function(t,e){},I.render.VectorContext.prototype.drawMultiPolygon=function(t,e){},I.render.VectorContext.prototype.drawPoint=function(t,e){},I.render.VectorContext.prototype.drawPolygon=function(t,e){},I.render.VectorContext.prototype.drawText=function(t,e){},I.render.VectorContext.prototype.setFillStrokeStyle=function(t,e){},I.render.VectorContext.prototype.setImageStyle=function(t,e){},I.render.VectorContext.prototype.setTextStyle=function(t,e){},I.render.ReplayGroup={},I.render.ReplayGroup=function(){},I.render.ReplayGroup.prototype.getReplay=function(t,e){},I.render.ReplayGroup.prototype.isEmpty=function(){},I.render.ReplayType={CIRCLE:"Circle",DEFAULT:"Default",IMAGE:"Image",LINE_STRING:"LineString",POLYGON:"Polygon",TEXT:"Text"},I.geom.flat.length={},I.geom.flat.length.lineString=function(t,e,n,i){var r,o=t[e],s=t[e+1],a=0;for(r=e+i;rt[n-i],f=r.length,g=t[e],p=t[e+1],y=t[e+=i],m=t[e+1],v=0,_=Math.sqrt(Math.pow(y-g,2)+Math.pow(m-p,2)),S="",x=0,C=0;C0?-Math.PI:Math.PI),void 0!==c){var G=O-c;if(G+=G>Math.PI?-2*Math.PI:G<-Math.PI?2*Math.PI:0,Math.abs(G)>a)return null}var M=E/_,F=I.math.lerp(g,y,M),w=I.math.lerp(p,m,M);c==O?(d&&(l[0]=F,l[1]=w,l[2]=R/2),l[4]=S):(x=R,l=[F,w,R/2,O,S=T],d?u.unshift(l):u.push(l),c=O),s+=R}return u},I.structs.LRUCache=function(t){I.events.EventTarget.call(this),this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null},I.inherits(I.structs.LRUCache,I.events.EventTarget),I.structs.LRUCache.prototype.canExpireCache=function(){return this.getCount()>this.highWaterMark},I.structs.LRUCache.prototype.clear=function(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null,this.dispatchEvent(I.events.EventType.CLEAR)},I.structs.LRUCache.prototype.containsKey=function(t){return this.entries_.hasOwnProperty(t)},I.structs.LRUCache.prototype.forEach=function(t,e){for(var n=this.oldest_;n;)t.call(e,n.value_,n.key_,this),n=n.newer},I.structs.LRUCache.prototype.get=function(t){var e=this.entries_[t];return I.asserts.assert(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_},I.structs.LRUCache.prototype.remove=function(t){var e=this.entries_[t];return I.asserts.assert(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_},I.structs.LRUCache.prototype.getCount=function(){return this.count_},I.structs.LRUCache.prototype.getKeys=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.key_;return e},I.structs.LRUCache.prototype.getValues=function(){var t,e=new Array(this.count_),n=0;for(t=this.newest_;t;t=t.older)e[n++]=t.value_;return e},I.structs.LRUCache.prototype.peekLast=function(){return this.oldest_.value_},I.structs.LRUCache.prototype.peekLastKey=function(){return this.oldest_.key_},I.structs.LRUCache.prototype.peekFirstKey=function(){return this.newest_.key_},I.structs.LRUCache.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_},I.structs.LRUCache.prototype.replace=function(t,e){this.get(t),this.entries_[t].value_=e},I.structs.LRUCache.prototype.set=function(t,e){I.asserts.assert(!(t in this.entries_),16);var n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_},I.structs.LRUCache.prototype.prune=function(){for(;this.canExpireCache();)this.pop()},I.render.canvas={},I.render.canvas.defaultFont="10px sans-serif",I.render.canvas.defaultFillStyle=[0,0,0,1],I.render.canvas.defaultLineCap="round",I.render.canvas.defaultLineDash=[],I.render.canvas.defaultLineDashOffset=0,I.render.canvas.defaultLineJoin="round",I.render.canvas.defaultMiterLimit=10,I.render.canvas.defaultStrokeStyle=[0,0,0,1],I.render.canvas.defaultTextAlign="center",I.render.canvas.defaultTextBaseline="middle",I.render.canvas.defaultPadding=[0,0,0,0],I.render.canvas.defaultLineWidth=1,I.render.canvas.labelCache=new I.structs.LRUCache,I.render.canvas.checkedFonts_={},I.render.canvas.measureContext_=null,I.render.canvas.textHeights_={},I.render.canvas.checkFont=function(){var t,e,n=I.render.canvas.checkedFonts_,i=I.render.canvas.labelCache,r="wmytzilWMYTZIL@#/&?$%10";function o(t){var n=I.render.canvas.getMeasureContext();n.font="32px monospace",e=n.measureText(r).width;var i=!0;"monospace"!=t&&(n.font="32px "+t+",monospace",i=n.measureText(r).width!=e);return i}function s(){var e=!0;for(var r in n)n[r]<60&&(o(r)?(n[r]=60,I.obj.clear(I.render.canvas.textHeights_),I.render.canvas.measureContext_=null,i.clear()):(++n[r],e=!1));e&&(window.clearInterval(t),t=void 0)}return function(e){var i=I.css.getFontFamilies(e);if(i)for(var r=0,a=i.length;ri.width?i.width-h:g,L=a+c>i.height?i.height-c:a,E=this.tmpExtent_,O=p[3]+R*d+p[1],G=p[0]+L*d+p[2],M=e-p[3],F=n-p[0];(v||0!==u)&&(S=[M,F],x=[M+O,F],C=[M+O,F+G],T=[M,F+G]);var w=null;if(0!==u){var P=e+r,k=n+o;w=I.transform.compose(_,P,k,1,1,u,-P,-k),I.extent.createOrUpdateEmpty(E),I.extent.extendCoordinate(E,I.transform.apply(_,S)),I.extent.extendCoordinate(E,I.transform.apply(_,x)),I.extent.extendCoordinate(E,I.transform.apply(_,C)),I.extent.extendCoordinate(E,I.transform.apply(_,T))}else I.extent.createOrUpdate(M,F,M+O,F+G,E);var D=t.canvas,A=E[0]<=D.width&&E[2]>=0&&E[1]<=D.height&&E[3]>=0;if(s){if(!A&&1==s[4])return;I.extent.extend(s,E);var b=A?[t,w?w.slice(0):null,l,i,h,c,R,L,e,n,d]:null;b&&v&&b.push(y,m,S,x,C,T),s.push(b)}else A&&(v&&this.replayTextBackground_(t,S,x,C,T,y,m),I.render.canvas.drawImage(t,w,l,i,h,c,R,L,e,n,d))},I.render.canvas.Replay.prototype.applyPixelRatio=function(t){var e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))},I.render.canvas.Replay.prototype.appendFlatCoordinates=function(t,e,n,i,r,o){var s=this.coordinates.length,a=this.getBufferedMaxExtent();o&&(e+=i);var l,h,c,u=[t[e],t[e+1]],d=[NaN,NaN],f=!0;for(l=e+i;l5){var n=t[4];if(1==n||n==t.length-5){var i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};if(!this.declutterTree.collides(i)){this.declutterTree.insert(i);for(var r=I.render.canvas.drawImage,o=5,s=t.length;o11&&this.replayTextBackground_(a[0],a[13],a[14],a[15],a[16],a[11],a[12]),r.apply(void 0,a))}}t.length=5,I.extent.createOrUpdateEmpty(t)}}},I.render.canvas.Replay.prototype.replay_=function(t,e,n,i,r,o){var s;this.pixelCoordinates_&&I.array.equals(e,this.renderedTransform_)?s=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),s=I.geom.flat.transform.transform2D(this.coordinates,0,this.coordinates.length,2,e,this.pixelCoordinates_),I.transform.setFromArray(this.renderedTransform_,e));for(var a,l,h,c,u,d,f,g,p,y=!I.obj.isEmpty(n),m=0,v=i.length,_=0,S=0,x=0,C=null,T=null,R=this.coordinateCache_,L=this.viewRotation_,E={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:L},O=this.instructions!=i||this.overlaps?0:200;mO&&(this.fill_(t),S=0),x>O&&(t.stroke(),x=0),S||x||(t.beginPath(),c=u=NaN),++m;break;case I.render.canvas.Instruction.CIRCLE:var P=s[_=w[1]],k=s[_+1],D=s[_+2]-P,A=s[_+3]-k,b=Math.sqrt(D*D+A*A);t.moveTo(P+b,k),t.arc(P,k,b,0,2*Math.PI,!0),++m;break;case I.render.canvas.Instruction.CLOSE_PATH:t.closePath(),++m;break;case I.render.canvas.Instruction.CUSTOM:_=w[1],a=w[2];var N=w[3],Y=w[4],X=6==w.length?w[5]:void 0;E.geometry=N,E.feature=G,m in R||(R[m]=[]);var B=R[m];X?X(s,_,a,2,B):(B[0]=s[_],B[1]=s[_+1],B.length=2),Y(B,E),++m;break;case I.render.canvas.Instruction.DRAW_IMAGE:_=w[1],a=w[2],p=w[3],l=w[4],h=w[5],g=r?null:w[6];var W,U,V,z=w[7],H=w[8],j=w[9],K=w[10],Z=w[11],q=w[12],J=w[13],$=w[14],Q=w[15];for(w.length>16?(W=w[16],U=w[17],V=w[18]):(W=I.render.canvas.defaultPadding,U=V=!1),Z&&(q+=L);_this.maxLineWidth&&(this.maxLineWidth=n.lineWidth,this.bufferedMaxExtent_=null)}else n.strokeStyle=void 0,n.lineCap=void 0,n.lineDash=null,n.lineDashOffset=void 0,n.lineJoin=void 0,n.lineWidth=void 0,n.miterLimit=void 0},I.render.canvas.Replay.prototype.applyFill=function(t,e){var n=t.fillStyle,i=[I.render.canvas.Instruction.SET_FILL_STYLE,n];if("string"!=typeof n){var r=e.getExtent();i.push([r[0],r[3]])}this.instructions.push(i)},I.render.canvas.Replay.prototype.applyStroke=function(t){this.instructions.push([I.render.canvas.Instruction.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio])},I.render.canvas.Replay.prototype.updateFillStyle=function(t,e,n){var i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(e.call(this,t,n),t.currentFillStyle=i)},I.render.canvas.Replay.prototype.updateStrokeStyle=function(t,e){var n=t.strokeStyle,i=t.lineCap,r=t.lineDash,o=t.lineDashOffset,s=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||r!=t.currentLineDash&&!I.array.equals(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=s||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=s,t.currentLineWidth=a,t.currentMiterLimit=l)},I.render.canvas.Replay.prototype.endGeometry=function(t,e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;var n=[I.render.canvas.Instruction.END_GEOMETRY,e];this.instructions.push(n),this.hitDetectionInstructions.push(n)},I.render.canvas.Replay.prototype.finish=I.nullFunction,I.render.canvas.Replay.prototype.getBufferedMaxExtent=function(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=I.extent.clone(this.maxExtent),this.maxLineWidth>0)){var t=this.resolution*(this.maxLineWidth+1)/2;I.extent.buffer(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_},I.render.canvas.ImageReplay=function(t,e,n,i,r,o){I.render.canvas.Replay.call(this,t,e,n,i,r,o),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.snapToPixel_=void 0,this.width_=void 0},I.inherits(I.render.canvas.ImageReplay,I.render.canvas.Replay),I.render.canvas.ImageReplay.prototype.drawCoordinates_=function(t,e,n,i){return this.appendFlatCoordinates(t,e,n,i,!1,!1)},I.render.canvas.ImageReplay.prototype.drawPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),i=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(n,0,n.length,i);this.instructions.push([I.render.canvas.Instruction.DRAW_IMAGE,r,o,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.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([I.render.canvas.Instruction.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,e)}},I.render.canvas.ImageReplay.prototype.drawMultiPoint=function(t,e){if(this.image_){this.beginGeometry(t,e);var n=t.getFlatCoordinates(),i=t.getStride(),r=this.coordinates.length,o=this.drawCoordinates_(n,0,n.length,i);this.instructions.push([I.render.canvas.Instruction.DRAW_IMAGE,r,o,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.snapToPixel_,this.width_]),this.hitDetectionInstructions.push([I.render.canvas.Instruction.DRAW_IMAGE,r,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.declutterGroup_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.snapToPixel_,this.width_]),this.endGeometry(t,e)}},I.render.canvas.ImageReplay.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.snapToPixel_=void 0,this.width_=void 0},I.render.canvas.ImageReplay.prototype.setImageStyle=function(t,e){var n=t.getAnchor(),i=t.getSize(),r=t.getHitDetectionImage(1),o=t.getImage(1),s=t.getOrigin();this.anchorX_=n[0],this.anchorY_=n[1],this.declutterGroup_=e,this.hitDetectionImage_=r,this.image_=o,this.height_=i[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.snapToPixel_=t.getSnapToPixel(),this.width_=i[0]},I.render.canvas.LineStringReplay=function(t,e,n,i,r,o){I.render.canvas.Replay.call(this,t,e,n,i,r,o)},I.inherits(I.render.canvas.LineStringReplay,I.render.canvas.Replay),I.render.canvas.LineStringReplay.prototype.drawFlatCoordinates_=function(t,e,n,i){var r=this.coordinates.length,o=this.appendFlatCoordinates(t,e,n,i,!1,!1),s=[I.render.canvas.Instruction.MOVE_TO_LINE_TO,r,o];return this.instructions.push(s),this.hitDetectionInstructions.push(s),n},I.render.canvas.LineStringReplay.prototype.drawLineString=function(t,e){var n=this.state,i=n.strokeStyle,r=n.lineWidth;if(void 0!==i&&void 0!==r){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([I.render.canvas.Instruction.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],[I.render.canvas.Instruction.BEGIN_PATH]);var o=t.getFlatCoordinates(),s=t.getStride();this.drawFlatCoordinates_(o,0,o.length,s),this.hitDetectionInstructions.push([I.render.canvas.Instruction.STROKE]),this.endGeometry(t,e)}},I.render.canvas.LineStringReplay.prototype.drawMultiLineString=function(t,e){var n=this.state,i=n.strokeStyle,r=n.lineWidth;if(void 0!==i&&void 0!==r){this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([I.render.canvas.Instruction.SET_STROKE_STYLE,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,n.lineDash,n.lineDashOffset],[I.render.canvas.Instruction.BEGIN_PATH]);var o,s,a=t.getEnds(),l=t.getFlatCoordinates(),h=t.getStride(),c=0;for(o=0,s=a.length;ot&&(m>y&&(y=m,g=v,p=o),m=0,v=o-r)),s=a,c=d,u=f),l=_,h=S}return(m+=a)>y?[v,o]:[g,p]},I.style.TextPlacement={POINT:"point",LINE:"line"},I.render.canvas.TextReplay=function(t,e,n,i,r,o){I.render.canvas.Replay.call(this,t,e,n,i,r,o),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_={},I.render.canvas.labelCache.prune()},I.inherits(I.render.canvas.TextReplay,I.render.canvas.Replay),I.render.canvas.TextReplay.measureTextWidths=function(t,e,n){var i,r,o=e.length,s=0;for(r=0;r=x)&&h.push(C[o],C[o+1]);if(0==(c=h.length))return}c=this.appendFlatCoordinates(h,0,c,u,!1,!1),this.beginGeometry(t,e),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),this.updateFillStyle(this.state,this.applyFill,t),this.updateStrokeStyle(this.state,this.applyStroke)),this.drawTextImage_(S,a,c),this.endGeometry(t,e)}}},I.render.canvas.TextReplay.prototype.getImage=function(t,e,n,i){var r,o=i+e+t+n+this.pixelRatio,s=I.render.canvas.labelCache;if(!s.containsKey(o)){var a=i?this.strokeStates[i]||this.textStrokeState_:null,l=n?this.fillStates[n]||this.textFillState_:null,h=this.textStates[e]||this.textState_,c=this.pixelRatio,u=h.scale*c,d=I.render.replay.TEXT_ALIGN[h.textAlign||I.render.canvas.defaultTextAlign],f=i&&a.lineWidth?a.lineWidth:0,g=t.split("\n"),p=g.length,y=[],m=I.render.canvas.TextReplay.measureTextWidths(h.font,g,y),v=I.render.canvas.measureTextHeight(h.font),_=v*p,S=m+f,x=I.dom.createCanvasContext2D(Math.ceil(S*u),Math.ceil((_+f)*u));r=x.canvas,s.set(o,r),1!=u&&x.scale(u,u),x.font=h.font,i&&(x.strokeStyle=a.strokeStyle,x.lineWidth=f*(I.has.SAFARI?u:1),x.lineCap=a.lineCap,x.lineJoin=a.lineJoin,x.miterLimit=a.miterLimit,I.has.CANVAS_LINE_DASH&&a.lineDash.length&&(x.setLineDash(a.lineDash),x.lineDashOffset=a.lineDashOffset)),n&&(x.fillStyle=l.fillStyle),x.textBaseline="middle",x.textAlign="center";var C,T=.5-d,R=d*r.width/u+T*f;if(i)for(C=0;C=r)for(i=r;i=o;)I.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(n,t+r,t+o),I.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(n,t+o,t+r),I.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(n,t-o,t+r),I.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(n,t-r,t+o),I.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(n,t-r,t-o),I.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(n,t-o,t-r),I.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(n,t+o,t-r),I.render.canvas.ReplayGroup.fillCircleArrayRowToMiddle_(n,t+r,t-o),2*((s+=1+2*++o)-r)+1>0&&(s+=1-2*(r-=1));return I.render.canvas.ReplayGroup.circleArrayCache_[t]=n,n},I.render.canvas.ReplayGroup.replayDeclutter=function(t,e,n){for(var i=Object.keys(t).map(Number).sort(I.array.numberSafeCompareFunction),r={},o=0,s=i.length;o0)return(!u||d!=I.render.ReplayType.IMAGE&&d!=I.render.ReplayType.TEXT||-1!==u.indexOf(t))&&(r=o(t)),r||void c.clearRect(0,0,l,l)}}this.declutterTree_&&(u=this.declutterTree_.all().map((function(t){return t.value})));var p,y,m,v,_,S=Object.keys(this.replaysByZIndex_).map(Number);for(S.sort(I.array.numberSafeCompareFunction),p=S.length-1;p>=0;--p){var x=S[p].toString();for(m=this.replaysByZIndex_[x],y=I.render.replay.ORDER.length-1;y>=0;--y)if(void 0!==(v=m[d=I.render.replay.ORDER[y]]))if(!s||d!=I.render.ReplayType.IMAGE&&d!=I.render.ReplayType.TEXT){if(_=v.replayHitDetection(c,h,n,r,g,a))return _}else{var C=s[x];C?C.push(v,h.slice(0)):s[x]=[v,h.slice(0)]}}},I.render.canvas.ReplayGroup.prototype.getClipCoords=function(t){var e=this.maxExtent_,n=e[0],i=e[1],r=e[2],o=e[3],s=[n,i,n,o,r,o,r,i];return I.geom.flat.transform.transform2D(s,0,8,2,t,s),s},I.render.canvas.ReplayGroup.prototype.getReplay=function(t,e){var n=void 0!==t?t.toString():"0",i=this.replaysByZIndex_[n];void 0===i&&(i={},this.replaysByZIndex_[n]=i);var r=i[e];void 0===r&&(r=new(0,I.render.canvas.ReplayGroup.BATCH_CONSTRUCTORS_[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_,this.overlaps_,this.declutterTree_),i[e]=r);return r},I.render.canvas.ReplayGroup.prototype.getReplays=function(){return this.replaysByZIndex_},I.render.canvas.ReplayGroup.prototype.isEmpty=function(){return I.obj.isEmpty(this.replaysByZIndex_)},I.render.canvas.ReplayGroup.prototype.replay=function(t,e,n,i,r,o){var s=Object.keys(this.replaysByZIndex_).map(Number);s.sort(I.array.numberSafeCompareFunction),t.save(),this.clip(t,e);var a,l,h,c,u,d,f=r||I.render.replay.ORDER;for(a=0,l=s.length;a