!function(e){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=e();elseif("function"==typeofdefine&&define.amd)define([],e);else{vart;"undefined"!=typeofwindow?t=window:"undefined"!=typeofglobal?t=global:"undefined"!=typeofself&&(t=self),t.torque=e()}}(function(){vardefine,module,exports;returnfunctione(t,n,r){functioni(o,u){if(!n[o]){if(!t[o]){vara=typeofrequire=="function"&&require;if(!u&&a)returna(o,!0);if(s)returns(o,!0);varf=newError("Cannot find module '"+o+"'");throwf.code="MODULE_NOT_FOUND",f}varl=n[o]={exports:{}};t[o][0].call(l.exports,function(e){varn=t[o][1][e];returni(n?n:e)},l,l.exports,e,t,n,r)}returnn[o].exports}vars=typeofrequire=="function"&&require;for(varo=0;o<r.length;o++)i(r[o]);returni}({1:[function(e,t,n){(function(n){functiono(e,t){if(!t.steps)thrownewError("steps option missing");this.options=t,this.running=!1,this._tick=this._tick.bind(this),this._t0=+(newDate),this.callback=e,this._time=0,this.options=r.extend({animationDelay:0,maxDelta:.2,loop:!0},this.options),this.rescale()}varr=e("./"),i=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||n.msRequestAnimationFrame||function(e){returnn.setTimeout(e,1e3/60)},s=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||n.msCancelAnimationFrame||function(e){clearTimeout(e)};o.prototype={start:function(){this.running=!0,i(this._tick),this.options.onStart&&this.options.onStart()},isRunning:function(){returnthis.running},stop:function(){this.pause(),this.time(0),this.options.onStop&&this.options.onStop()},time:function(e){if(!arguments.length)returnthis._time;this._time=e;vart=this.range(this.domain(this._time));this.callback(t)},toggle:function(){this.running?this.pause():this.start()},rescale:function(){returnthis.domainInv=r.math.linear(this.options.animationDelay,this.options.animationDelay+this.options.animationDuration),this.domain=this.domainInv.invert(),this.range=r.math.linear(0,this.options.steps),this.rangeInv=this.range.invert(),this.time(this._time),this},duration:function(e){returnarguments.length?(this.options.animationDuration=e,this.time()>e&&this.time(0),this.rescale(),this):this.options.animationDuration},steps:function(e){returnthis.options.steps=e,this.rescale()},step:function(e){if(arguments.length===0)returnthis.range(this.domain(this._time));this._time=this.domainInv(this.rangeInv(e))},pause:function(){this.running=!1,s(this._tick),this.options.onPause&&this.options.onPause()},_tick:function(){vare=+(newDate),t=(e-this._t0)*.001;t=Math.min(this.options.maxDelta,t),this._t0=e,this._time+=t,this.time(this._time),this.step()>=this.options.steps&&(this._time=0),this.running&&i(this._tick)}},t.exports=o}).call(this,typeofglobal!="undefined"?global:typeofself!="undefined"?self:typeofwindow!="undefined"?window:{})},{"./":10}],2:[function(e,t,n){varr={version:"1.0.0",style:{"comp-op":{css:"comp-op","default-value":"src-over","default-meaning":"add the current layer on top of other layers",doc:"Composite operation. This defines how this layer should behave relative to layers atop or below it.",type:["src","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","darken","lighten"]}},layer:{"buffer-size":{"default-value":"0",type:"float","default-meaning":"No buffer will be used",doc:"Extra tolerance around the Layer extent (in pixels) used to when querying and (potentially) clipping the layer data during rendering"},"-torque-frame-count":{css:"-torque-frame-count","default-value":"128",type:"number","default-meaning":"the data is broken into 128 time frames",doc:"Number of animation steps/frames used in the animation. If the data contains a fewere number of total frames, the lesser value will be used."},"-torque-resolution":{css:"-torque-resolution","default-value":"2",type:"number","default-meaning":"",doc:"Spatialresolutioninpixels.Aresolutionof1meansnospatialaggregationofthedata.AnyotherresolutionofNresultsinspatialaggregationintocellsofNxNpixels.Thev
:function(){this._animating=!1,this._canvas.style.display="block",this._backCanvas.style.display="none",this._backCanvas.style[L.DomUtil.TRANSFORM]=""},getCanvas:function(){returnthis._canvas},getAttribution:function(){returnthis.options.attribution},draw:function(){returnthis._reset()},onRemove:function(e){this._container.parentNode.removeChild(this._container),e.off({viewreset:this._reset,move:this._render,moveend:this._reset,resize:this._reset,zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this)},addTo:function(e){returne.addLayer(this),this},setOpacity:function(e){returnthis.options.opacity=e,this._updateOpacity(),this},setZIndex:function(e){this._canvas.style.zIndex=e,this.options.zoomAnimation&&(this._backCanvas.style.zIndex=e)},bringToFront:function(){returnthis},bringToBack:function(){returnthis},_reset:function(){vare=this._map.getSize();this._canvas.width=e.x,this._canvas.height=e.y;vart=L.DomUtil.getPosition(this._map.getPanes().mapPane);t&&L.DomUtil.setPosition(this._canvas,{x:-t.x,y:-t.y}),this.onResize(),this._render()},_updateOpacity:function(){},_render:function(){this.currentAnimationFrame>=0&&this.cancelAnimationFrame.call(window,this.currentAnimationFrame),this.currentAnimationFrame=this.requestAnimationFrame.call(window,this.render)},redraw:function(e){e?this.render():this._render()},onResize:function(){},render:function(){thrownewError("render function should be implemented")}})},{"./leaflet_tileloader_mixin":13}],12:[function(e,t,n){typeofL!="undefined"&&e("./torque")},{"./torque":14}],13:[function(e,t,n){L.Mixin.TileLoader={_initTileLoader:function(){this._tiles={},this._tilesLoading={},this._tilesToLoad=0,this._map.on({moveend:this._updateTiles},this),this._updateTiles()},_removeTileLoader:function(){this._map.off({moveend:this._updateTiles},this),this._removeTiles()},_updateTiles:function(){if(!this._map)return;vare=this._map.getPixelBounds(),t=this._map.getZoom(),n=this.options.tileSize;if(t>this.options.maxZoom||t<this.options.minZoom)return;varr=newL.Point(Math.floor(e.min.x/n),Math.floor(e.min.y/n)),i=newL.Point(Math.floor(e.max.x/n),Math.floor(e.max.y/n)),s=newL.Bounds(r,i);this._addTilesFromCenterOut(s),this._removeOtherTiles(s)},_removeTiles:function(e){for(vartinthis._tiles)this._removeTile(t)},_reloadTiles:function(){this._removeTiles(),this._updateTiles()},_removeOtherTiles:function(e){vart,n,r,i,s,o=this._map.getZoom();for(sinthis._tiles)this._tiles.hasOwnProperty(s)&&(t=s.split(":"),n=parseInt(t[0],10),r=parseInt(t[1],10),i=parseInt(t[2],10),(o!==i||n<e.min.x||n>e.max.x||r<e.min.y||r>e.max.y)&&this._removeTile(s))},_removeTile:function(e){this.fire("tileRemoved",this._tiles[e]),deletethis._tiles[e],deletethis._tilesLoading[e]},_tileKey:function(e){returne.x+":"+e.y+":"+e.zoom},_tileShouldBeLoaded:function(e){vart=this._tileKey(e);return!(tinthis._tiles)&&!(tinthis._tilesLoading)},_tileLoaded:function(e,t){this._tilesToLoad--;varn=e.x+":"+e.y+":"+e.zoom;this._tiles[n]=t,deletethis._tilesLoading[n],this._tilesToLoad===0&&this.fire("tilesLoaded")},getTilePos:function(e){e=newL.Point(e.x,e.y);vart=this._map._getNewTopLeftPoint(this._map.getCenter()),n=this.options.tileSize;returne.multiplyBy(n).subtract(t)},_addTilesFromCenterOut:function(e){vart=[],n=e.getCenter(),r=this._map.getZoom(),i,s,o;for(i=e.min.y;i<=e.max.y;i++)for(s=e.min.x;s<=e.max.x;s++)o=newL.Point(s,i),o.zoom=r,this._tileShouldBeLoaded(o)&&t.push(o);varu=t.length;if(u===0)return;t.sort(function(e,t){returne.distanceTo(n)-t.distanceTo(n)}),this._tilesToLoad+=u;for(s=0;s<u;s++){vara=t[s],f=this._tileKey(a);this._tilesLoading[f]=a,this.fire("tileAdded",a)}this.fire("tilesLoading")}}},{}],14:[function(e,t,n){(function(t){varn=t.carto||e("carto"),r=e("../");e("./canvas_layer"),L.TorqueLayer=L.CanvasLayer.extend({providers:{sql_api:r.providers.json,url_template:r.providers.jsonarray,windshaft:r.providers.windshaft},renderers:{point:r.renderer.Point,pixel:r.renderer.Rectangle},initialize:function(e){vart=this;if(!r.isBrowserSupported())thrownewError("browserisnotsupportedby
(t=y(this.operand)))r=newi.Operation(n,[r||e,t],a);returnr||e}},addition:function(){vare,t,s,o;if(e=y(this.multiplication)){while((s=y(/^[-+]\s+/)||n.charAt(r-1)!=" "&&(y("+")||y("-")))&&(t=y(this.multiplication)))o=newi.Operation(s,[o||e,t],a);returno||e}},operand:function(){returny(this.sub)||y(this.entity)},expression:function(){vare,t,n=[],r;while(e=y(this.addition)||y(this.entity))n.push(e);if(n.length>0)returnnewi.Expression(n)},property:function(){vare=y(/^(([a-z][-a-z_0-9]*\/)?\*?-?[-a-z_0-9]+)\s*:/);if(e)returne[1]}}},h}},{"./tree":40,underscore:70}],37:[function(e,t,n){functions(e,t,n,r){vari=t.filters,s=t.rules,o,u,a;for(varf=0;f<e.length;f++)o=e[f].filters.cloneWith(i),o?(a=n[o],a?a.addRules(s):(u=e[f].clone(o),u.addRules(s)&&(n[o]=u,e.splice(f,0,u),f++))):o===null&&(e[f]=e[f].clone(),e[f].addRules(s));returne}functiono(e,t){varn=+(newDate),r={},i={},o=[],u,a,f;e.forEach(function(e){e.filters.ev(t)});for(varl=0;l<e.length;l++){f=e[l].attachment,u=[e[l]],r[f]||(r[f]=[],r[f].attachment=f,i[f]={},o.push(r[f]));for(varc=l+1;c<e.length;c++)e[c].attachment===f&&(u=s(u,e[c],i[f],t));for(varh=0;h<u.length;h++)i[f][u[h].filters]=u[h],r[f].push(u[h])}returnt.benchmark&&console.warn("Inheritance time: "+(newDate-n)+"ms"),o}functionu(e,t){returnt.index-e.index}functiona(e,t){for(varn=0;n<e.length;n++){varr=e[n];r.index=Infinity;for(vari=0;i<r.length;i++){vars=r[i].rules;for(varo=0;o<s.length;o++){vara=s[o];a.index<r.index&&(r.index=a.index)}}}varf=e.slice();returnf.sort(u),f}functionf(e,t,n){vars={},o=i.tree.Reference.data.symbolizers.map;returnr(e).each(function(e,t){tino&&(s[t]=t+'="'+e+'"')}),t.filter(function(e){returne.elements.join("")==="Map"}).forEach(function(e){for(vart=0;t<e.rules.length;t++){varr=e.rules[t].name;rino||n.error({message:"Rule "+r+" not allowed for Map.",index:e.rules[t].index}),s[r]=e.rules[t].ev(n).toXML(n)}}),s}varr=e("underscore"),i=e("./index");i.Renderer=function(t,n){this.env=t||{},this.options=n||{},this.options.mapnik_version=this.options.mapnik_version||"3.0.0"},i.Renderer.prototype.renderMSS=function(t){varn=r(this.env).defaults({benchmark:!1,validation_data:!1,effects:[]});if(!i.tree.Reference.setVersion(this.options.mapnik_version))thrownewError("Could not set mapnik version to "+this.options.mapnik_version);vars=[],u=[];n.benchmark&&console.time("Parsing MSS");varf=i.Parser(n).parse(t);n.benchmark&&console.timeEnd("Parsing MSS"),n.benchmark&&console.time("Rule generation");varl=f.toList(n);n.benchmark&&console.timeEnd("Rule generation"),n.benchmark&&console.time("Rule inheritance");varc=o(l,n);n.benchmark&&console.timeEnd("Rule inheritance"),n.benchmark&&console.time("Style sort");varh=a(c,n);n.benchmark&&console.timeEnd("Style sort"),n.benchmark&&console.time("Total Style generation");for(varp=0,d,v;p<h.length;p++){d=h[p],v="style"+(d.attachment!=="__default__"?"-"+d.attachment:""),u.push(v);varm=' Style "'+v+'" (#'+p+") toXML";n.benchmark&&console.time(m),s.push(i.tree.StyleXML(v,d.attachment,d,n)),n.benchmark&&console.timeEnd(m)}n.benchmark&&console.timeEnd("Total Style generation");if(n.errors)thrown.errors;returns.join("\n")},i.Renderer.prototype.render=function(t){functionl(e,t){returnfunction(e){returne.appliesTo(h.name,t)}}varn=r(this.env).defaults({benchmark:!1,validation_data:!1,effects:[],ppi:90.714});if(!i.tree.Reference.setVersion(this.options.mapnik_version))thrownewError("Could not set mapnik version to "+this.options.mapnik_version);vars=[],u=r(t.Stylesheet).chain().map(function(e){if(typeofe=="string")thrownewError("Stylesheet object is expected not a string: '"+e+"'");n=r(n).extend({filename:e.id});vart=+(newDate),s=i.Parser(n).parse(e.data);returnn.benchmark&&console.warn("Parsing time: "+(newDate-t)+"ms"),s.toList(n)}).flatten().value(),c,h,p,d,v,m;for(varg=0;g<t.Layer.length;g++){h=t.Layer[g],c=[],p={},n.benchmark&&console.warn("processing layer: "+h.id);vary=(h["class"]||"").split(/\s+/g);for(varb=0;b<y.length;b++)p[y[b]]=!0;m=u.filter(l(h.name,p)),d=o(m,n),v=a(d,n);for(varw=0,E,S;w<v.
,"default-value":!1,doc:"Control whether overlapping shields are shown or hidden.","default-meaning":"Do not allow shields to overlap with other map elements already placed."},"minimum-distance":{css:"shield-min-distance",type:"float","default-value":0,doc:"Minimum distance to the next shield symbol, not necessarily the same shield."},spacing:{css:"shield-spacing",type:"float","default-value":0,doc:"The spacing between repeated occurrences of the same shield on a line"},"minimum-padding":{css:"shield-min-padding","default-value":0,doc:"Determines the minimum amount of padding that a shield gets relative to other shields",type:"float"},"wrap-width":{css:"shield-wrap-width",type:"unsigned","default-value":0,doc:"Length of a chunk of text in characters before wrapping text"},"wrap-before":{css:"shield-wrap-before",type:"boolean","default-value":!1,doc:"Wrap text before wrap-width is reached. If false, wrapped lines will be a bit longer than wrap-width."},"wrap-character":{css:"shield-wrap-character",type:"string","default-value":" ",doc:"Use this character instead of a space to wrap long names."},"halo-fill":{css:"shield-halo-fill",type:"color","default-value":"#FFFFFF","default-meaning":"white",doc:"Specifies the color of the halo around the text."},"halo-radius":{css:"shield-halo-radius",doc:"Specify the radius of the halo in pixels","default-value":0,"default-meaning":"no halo",type:"float"},"character-spacing":{css:"shield-character-spacing",type:"unsigned","default-value":0,doc:"Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."},"line-spacing":{css:"shield-line-spacing",doc:"Vertical spacing between lines of multiline labels (in pixels)",type:"unsigned"},dx:{css:"shield-text-dx",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},dy:{css:"shield-text-dy",type:"float",doc:"Displace text within shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},"shield-dx":{css:"shield-dx",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the X axis. A positive value will shift the text right","default-value":0},"shield-dy":{css:"shield-dy",type:"float",doc:"Displace shield by fixed amount, in pixels, +/- along the Y axis. A positive value will shift the text down","default-value":0},opacity:{css:"shield-opacity",type:"float",doc:"(Default 1.0) - opacity of the image used for the shield","default-value":1},"text-opacity":{css:"shield-text-opacity",type:"float",doc:"(Default 1.0) - opacity of the text placed on top of the shield","default-value":1},"horizontal-alignment":{css:"shield-horizontal-alignment",type:["left","middle","right","auto"],doc:"The shield's horizontal alignment from its centerpoint","default-value":"auto"},"vertical-alignment":{css:"shield-vertical-alignment",type:["top","middle","bottom","auto"],doc:"The shield's vertical alignment from its centerpoint","default-value":"middle"},"text-transform":{css:"shield-text-transform",type:["none","uppercase","lowercase","capitalize"],doc:"Transform the case of the characters","default-value":"none"},"justify-alignment":{css:"shield-justify-alignment",type:["left","center","right","auto"],doc:"Define how text in a shield's label is justified","default-value":"auto"},clip:{css:"shield-clip",type:"boolean","default-value":!0,"default-meaning":"geometry will be clipped to map bounds before rendering",doc:"geometries are clipped to map bounds by default for best rendering performance. In some cases users may wish to disable this to avoid rendering artifacts."},"comp-op":{css:"shield-comp-op","default-value":"src-over","default-meaning":"add the current symbolizer on top of other symbolizer",doc:"Composite operation. This defines how this symbolizer should behave relative to symbolizers atop or below it.",type:["clear","src","dst","src-over","dst-over","src-in","dst-in","src-out","dst-out","src-atop","dst-atop","xor","plus
.type="wildcard")},e.Element.prototype.specificity=function(){return[this.type==="id"?1:0,this.type==="class"?1:0]},e.Element.prototype.toString=function(){returnthis.value}})(e("../tree"))},{"../tree":40}],47:[function(e,t,n){(function(e){e.Expression=function(t){this.value=t},e.Expression.prototype={is:"expression",ev:function(t){returnthis.value.length>1?newe.Expression(this.value.map(function(e){returne.ev(t)})):this.value[0].ev(t)},toString:function(e){returnthis.value.map(function(t){returnt.toString(e)}).join(" ")}}})(e("../tree"))},{"../tree":40}],48:[function(e,t,n){(function(e){e.Field=function(t){this.value=t||""},e.Field.prototype={is:"field",toString:function(){return"["+this.value+"]"},ev:function(){returnthis}}})(e("../tree"))},{"../tree":40}],49:[function(e,t,n){(function(e){e.Filter=function(t,n,r,i,s){this.key=t,this.op=n,this.val=r,this.index=i,this.filename=s,this.id=this.key+this.op+this.val};vart={"<":[" < ","numeric"],">":[" > ","numeric"],"=":[" = ","both"],"!=":[" != ","both"],"<=":[" <= ","numeric"],">=":[" >= ","numeric"],"=~":[".match(","string",")"]};e.Filter.prototype.ev=function(e){returnthis.key=this.key.ev(e),this.val=this.val.ev(e),this},e.Filter.prototype.toXML=function(n){e.Reference.data.filter&&(this.key.is==="keyword"&&-1===e.Reference.data.filter.value.indexOf(this.key.toString())&&n.error({message:this.key.toString()+" is not a valid keyword in a filter expression",index:this.index,filename:this.filename}),this.val.is==="keyword"&&-1===e.Reference.data.filter.value.indexOf(this.val.toString())&&n.error({message:this.val.toString()+" is not a valid keyword in a filter expression",index:this.index,filename:this.filename}));varr=this.key.toString(!1),i=this.val.toString(this.val.is=="string");return(t[this.op][1]=="numeric"&&isNaN(i)&&this.val.is!=="field"||t[this.op][1]=="string"&&i[0]!="'")&&n.error({message:'Cannot use operator "'+this.op+'" with value '+this.val,index:this.index,filename:this.filename}),r+t[this.op][0]+i+(t[this.op][2]||"")},e.Filter.prototype.toString=function(){return"["+this.id+"]"}})(e("../tree"))},{"../tree":40}],50:[function(e,t,n){varr=e("../tree"),i=e("underscore");r.Filterset=function(){this.filters={}},r.Filterset.prototype.toXML=function(e){vart=[];for(varninthis.filters)t.push("("+this.filters[n].toXML(e).trim()+")");returnt.length?" <Filter>"+t.join(" and ")+"</Filter>\n":""},r.Filterset.prototype.toString=function(){vare=[];for(vartinthis.filters)e.push(this.filters[t].id);returne.sort().join(" ")},r.Filterset.prototype.ev=function(e){for(vartinthis.filters)this.filters[t].ev(e);returnthis},r.Filterset.prototype.clone=function(){vare=newr.Filterset;for(vartinthis.filters)e.filters[t]=this.filters[t];returne},r.Filterset.prototype.cloneWith=function(e){vart=[];for(varnine.filters){vari=this.addable(e.filters[n]);if(i===!1)return!1;i===!0&&t.push(e.filters[n])}if(!t.length)returnnull;vars=newr.Filterset;for(ninthis.filters)s.filters[n]=this.filters[n];while(n=t.shift())s.add(n);returns},r.Filterset.prototype.toJS=function(e){vart={"=":"==="};returni.map(this.filters,function(e){varn=e.op;nint&&(n=t[n]);varr=e.val;e._val!==undefined&&(r=e._val.toString(!0));vari="data";returni+"."+e.key.value+" "+n+" "+(r.is==="string"?"'"+r+"'":r)}).join(" && ")},r.Filterset.prototype.addable=function(e){vart=e.key.toString(),n=e.val.toString();n.match(/^[0-9]+(\.[0-9]*)?$/)&&(n=parseFloat(n));switch(e.op){case"=":if(this.filters[t+"="]!==undefined)returnthis.filters[t+"="].val.toString()!=n?!1:null;if(this.filters[t+"!="+n]!==undefined)return!1;if(this.filters[t+">"]!==undefined&&this.filters[t+">"].val>=n)return!1;if(this.filters[t+"<"]!==undefined&&this.filters[t+"<"].val<=n)return!1;if(this.filters[t+">="]!==undefined&&this.filters[t+">="].val>n)return!1;if(this.filters[t+"<="]!==undefined&&this.filters[t+"<="].val<n)return!1;return!0;case"=~":return!0;case"!=":if(this.filters[t+"="]!==undefined)returnthis.filters[t+"="].val==n?!1:null;if(this.filters[t+"!="+n]!==undefined)returnnull;if(this.fil