!function(){let t=L.Marker.prototype.onAdd,n=L.Marker.prototype.onRemove;L.Marker.mergeOptions({bounceOnAdd:!1,bounceOnAddOptions:{duration:1e3,height:-1,loop:1},bounceOnAddCallback:function(){}}),L.Marker.include({_toPoint:function(t){return this._map.latLngToContainerPoint(t)},_toLatLng:function(t){return this._map.containerPointToLatLng(t)},_motionStep:function(t){let n=this,o=(new Date-t.start)/t.duration;o>1&&(o=1);let i=n._easeOutBounce(o);t.step(i),1!==o||(t.start=new Date,o=0,t.loop>0&&(t.loop=t.loop-1),0!==t.loop)?n._animationId=L.Util.requestAnimFrame((function(o){n._motionStep(t)})):t.end()},_bounceMotion:function(t,n){let o=L.latLng(this._origLatlng),i=this._dropPoint.y,e=this._dropPoint.x,a=this._point.y-i,r=this;r._animationId=L.Util.requestAnimFrame((function(){r._motionStep({duration:t.duration||1e3,loop:t.loop||1,start:new Date,step:function(t){r._dropPoint.y=i+a*t-(r._map.project(r._map.getCenter()).y-r._origMapCenter.y),r._dropPoint.x=e-(r._map.project(r._map.getCenter()).x-r._origMapCenter.x),r.setLatLng(r._toLatLng(r._dropPoint))},end:function(){r.setLatLng(o),"function"==typeof n&&n()}})}))},_easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounce:function(t,n){"function"==typeof t&&(n=t,t=null),"number"==typeof(t=t||{duration:1e3,height:-1,loop:1})&&(t.duration=arguments[0],t.height=arguments[1]),this._origLatlng=this.getLatLng(),this._origMapCenter=this._map.project(this._map.getCenter()),this._dropPoint=this._getDropPoint(t.height),this._bounceMotion(t,n)},stopBounce:function(){void 0!==this._origLatlng&&this.setLatLng(this._origLatlng),L.Util.cancelAnimFrame(this._animationId)},_getDropPoint:function(t){let n;return this._point=this._toPoint(this._origLatlng),n=void 0===t||t<0?this._toPoint(this._map.getBounds()._northEast).y:this._point.y-t,new L.Point(this._point.x,n)},onAdd:function(n){this._map=n,t.call(this,n),!0===this.options.bounceOnAdd&&this.bounce(this.options.bounceOnAddOptions,this.options.bounceOnAddCallback)},onRemove:function(t){this.stopBounce(),n.call(this,t)}})}();