(function(e){functionr(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,_.defaults(this.options,{animationDelay:0,maxDelta:.2,loop:!0}),this.rescale()}e.torque=e.torque||{};vart=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,16)},n=window.requestAnimationFrame||window.mozCancelAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame||function(e){};r.prototype={start:function(){this.running=!0,t(this._tick)},isRunning:function(){returnthis.running},stop:function(){this.pause(),this.time(0)},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=torque.math.linear(this.options.animationDelay,this.options.animationDelay+this.options.animationDuration),this.domain=this.domainInv.invert(),this.range=torque.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,n(this._tick)},_tick:function(){vare=+(newDate),n=(e-this._t0)*.001;n=Math.min(this.options.maxDelta,n),this._t0=e,this._time+=n,this.time(this._time),this.step()>=this.options.steps&&(this._time=0),this.running&&t(this._tick)}},e.torque.Animator=r})(typeofexports=="undefined"?this:exports),function(e){e.torque=e.torque||{};vart={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":{"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":{"default-value":"2",type:"number","default-meaning":"",doc:"Spatial resolution in pixels. A resolution of 1 means no spatial aggregation of the data. Any other resolution of N results in spatial aggregation into cells of NxN pixels. The value N must be power of 2"},"-torque-animation-duration":{"default-value":"30",type:"number","default-meaning":"the animation lasts 30 seconds",doc:"Animation duration in seconds"},"-torque-aggregation-function":{"default-value":"count(cartodb_id)",type:"string","default-meaning":"the value for each cell is the count of points in that cell",doc:"A function used to calculate a value from the aggregate data for each cell. See -torque-resolution"},"-torque-time-attribute":{"default-value":"time",type:"string","default-meaning":"the data column in your table that is of a time based type",doc:"The table column that contains the time information used create the animation"},"-torque-data-aggregation":{"default-value":"linear",type:["cumulative"],"default-meaning":"previous values are discarded",doc:"A linear animation will discard previous values while a cumulative animation will accumulate them until it restarts"}},symbolizers:{"*":{"comp-op":{css:"comp-op","default-value":"src-over","default-
t,this.repositionFunction_=n(this,this.repositionCanvas_),this.resizeFunction_=n(this,this.resize_),this.requestUpdateFunction_=n(this,this.update_),e&&this.setOptions(e)}CanvasLayer.prototype=newgoogle.maps.OverlayView,CanvasLayer.DEFAULT_PANE_NAME_="overlayLayer",CanvasLayer.CSS_TRANSFORM_=function(){vare=document.createElement("div"),t=["transform","WebkitTransform","MozTransform","OTransform","msTransform"];for(varn=0;n<t.length;n++){varr=t[n];if(e.style[r]!==undefined)returnr}returnt[0]}(),CanvasLayer.prototype.requestAnimFrame_=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){returnwindow.setTimeout(e,1e3/60)},CanvasLayer.prototype.cancelAnimFrame_=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(e){},CanvasLayer.prototype.setOptions=function(e){e.animate!==undefined&&this.setAnimate(e.animate),e.paneName!==undefined&&this.setPane(e.paneName),e.updateHandler!==undefined&&this.setUpdateHandler(e.updateHandler),e.resizeHandler!==undefined&&this.setResizeHandler(e.resizeHandler),e.readyHandler&&(this.readyHandler=e.readyHandler)},CanvasLayer.prototype.setAnimate=function(e){this.isAnimated_=!!e,this.isAnimated_&&this.scheduleUpdate()},CanvasLayer.prototype.isAnimated=function(){returnthis.isAnimated_},CanvasLayer.prototype.setPaneName=function(e){this.paneName_=e,this.setPane_()},CanvasLayer.prototype.getPaneName=function(){returnthis.paneName_},CanvasLayer.prototype.setPane_=function(){if(!this.isAdded_)return;vare=this.getPanes();if(!e[this.paneName_])thrownewError('"'+this.paneName_+'" is not a valid MapPane name.');e[this.paneName_].appendChild(this.canvas)},CanvasLayer.prototype.setResizeHandler=function(e){this.resizeHandler_=e},CanvasLayer.prototype.setUpdateHandler=function(e){this.updateHandler_=e},CanvasLayer.prototype.onAdd=function(){if(this.isAdded_)return;this.isAdded_=!0,this.setPane_(),this.resizeListener_=google.maps.event.addListener(this.getMap(),"resize",this.resizeFunction_),this.centerListener_=google.maps.event.addListener(this.getMap(),"center_changed",this.repositionFunction_),this.resize_(),this.repositionCanvas_(),this.readyHandler&&this.readyHandler()},CanvasLayer.prototype.onRemove=function(){if(!this.isAdded_)return;this.isAdded_=!1,this.topLeft_=null,this.canvas.parentElement.removeChild(this.canvas),this.centerListener_&&(google.maps.event.removeListener(this.centerListener_),this.centerListener_=null),this.resizeListener_&&(google.maps.event.removeListener(this.resizeListener_),this.resizeListener_=null),this.requestAnimationFrameId_&&(this.cancelAnimFrame_.call(window,this.requestAnimationFrameId_),this.requestAnimationFrameId_=null)},CanvasLayer.prototype.resize_=function(){if(!this.isAdded_)return;vare=this.getMap(),t=e.getDiv().offsetWidth,n=e.getDiv().offsetHeight,r=this.canvas.width,i=this.canvas.height;if(r!==t||i!==n)this.canvas.width=t,this.canvas.height=n,this.canvas.style.width=t+"px",this.canvas.style.height=n+"px",this.needsResize_=!0,this.scheduleUpdate()},CanvasLayer.prototype.draw=function(){this.repositionCanvas_()},CanvasLayer.prototype.repositionCanvas_=function(){vare=this.getMap().getBounds();this.topLeft_=newgoogle.maps.LatLng(e.getNorthEast().lat(),e.getSouthWest().lng());vart=this.getProjection(),n=t.fromLatLngToDivPixel(this.topLeft_),r=(1<<this.getMap().getZoom())*256;Math.abs(n.x)>r&&(n.x-=r),this.canvas.style[CanvasLayer.CSS_TRANSFORM_]="translate("+Math.round(n.x)+"px,"+Math.round(n.y)+"px)",this.scheduleUpdate()},CanvasLayer.prototype.update_=function(){this.requestAnimationFrameId_=null;if(!this.isAdded_)return;this.isAnimated_&&this.scheduleUpdate(),this.needsResize_&&this.resizeHandler_&&(this.needsResize_=!1,this.resizeHandler_()),this.updateHandler_&&this.updateHandler_()},CanvasLayer.prototype.getTopLeft=function(){returnthis.topLeft_},CanvasLayer.prototype.scheduleUpdate=function(){this.isAdded