!function(t){"function"==typeof define&&define.amd?define(t):t()}((function(){"use strict";L.ShapeMarker=L.CircleMarker.extend({options:{fill:!0,shape:"triangle",radius:10,rotation:0},setRadius:function(t){return this.options.radius=t,this.redraw()},getRadius:function(){return this.options.radius},setRotation:function(t){return this.options.rotation=t,this.redraw()},getRotation:function(){return this.options.rotation},_updatePath:function(){this._renderer._updateShape(this)},toGeoJSON:function(){return L.GeoJSON.getFeature(this,{type:"Point",coordinates:L.GeoJSON.latLngToCoords(this.getLatLng())})}}),L.shapeMarker=function(t,a){return new L.ShapeMarker(t,a)},L.SVG.include({_updateShape:function(t){var a=t._point,i=t.options.radius,e=t.options.shape,r=t.options.rotation;if(t._path.setAttribute("transform",`rotate(${r},${a.x},${a.y})`),"diamond"===e){var s="M"+(a.x-Math.sqrt(2)*i)+" "+a.y+" L "+a.x+" "+(a.y-Math.sqrt(2)*i)+" L"+(a.x+Math.sqrt(2)*i)+" "+a.y+" L"+a.x+" "+(a.y+Math.sqrt(2)*i)+" L"+(a.x-Math.sqrt(2)*i)+" "+a.y;this._setPath(t,s)}if("square"===e){s="M"+(a.x-i)+" "+(a.y-i)+" L "+(a.x+i)+" "+(a.y-i)+" L"+(a.x+i)+" "+(a.y+i)+" L"+(a.x-i)+" "+(a.y+i)+" L"+(a.x-i)+" "+(a.y-i);this._setPath(t,s)}if("triangle"===e||"triangle-up"===e){s="M"+(a.x-1.3*i)+" "+(a.y+.75*i)+" L"+a.x+" "+(a.y-1.5*i)+" L"+(a.x+1.3*i)+" "+(a.y+.75*i)+" Z";this._setPath(t,s)}if("triangle-down"===e){s="M"+(a.x-1.3*i)+" "+(a.y-.75*i)+" L"+a.x+" "+(a.y+1.5*i)+" L"+(a.x+1.3*i)+" "+(a.y-.75*i)+" Z";this._setPath(t,s)}if("arrowhead"===e||"arrowhead-up"===e){s="M "+(a.x+1.3*i)+" "+(a.y+1.3*i)+" L "+a.x+" "+(a.y-1.3*i)+" L "+(a.x-1.3*i)+" "+(a.y+1.3*i)+" L "+a.x+" "+(a.y+.5*i)+" L "+(a.x+1.3*i)+" "+(a.y+1.3*i)+" Z";this._setPath(t,s)}if("arrowhead-down"===e){s="M "+(a.x-1.3*i)+" "+(a.y-1.3*i)+" L "+a.x+" "+(a.y+1.3*i)+" L "+(a.x+1.3*i)+" "+(a.y-1.3*i)+" L "+a.x+" "+(a.y-.5*i)+" L "+(a.x-1.3*i)+" "+(a.y-1.3*i)+" Z";this._setPath(t,s)}if("circle"===e&&this._updateCircle(t),e.startsWith("star")){var n=e.split(/[^0-9a-z]/gi,2),o=parseInt(n[1]);if("star"===n[0]&&!isNaN(o)&&o>2)var h=o;else h=5;for(var u=.5*(1+Math.sqrt(5))+1,x=[],y=0;y