!function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=56)}([function(t,e,r){var n=r(9)(Object,"create");t.exports=n},function(t,e,r){var n=r(41);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e,r){var n=r(47);t.exports=function(t,e){var r=t.__data__;return n(e)?r["string"==typeof e?"string":"hash"]:r.map}},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){var n=r(8),o=r(20);t.exports=function(t){return"symbol"==typeof t||o(t)&&"[object Symbol]"==n(t)}},function(t,e,r){var n=r(6).Symbol;t.exports=n},function(t,e,r){var n=r(16),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(11),o=r(55);function i(t,e,r){if(void 0===r&&(r={}),!0===r.final)return function(t,e){var r=i(e,t);return r=(r+180)%360}(t,e);var a=o.getCoord(t),s=o.getCoord(e),p=n.degreesToRadians(a[0]),h=n.degreesToRadians(s[0]),u=n.degreesToRadians(a[1]),m=n.degreesToRadians(s[1]),l=Math.sin(h-p)*Math.cos(m),c=Math.cos(u)*Math.sin(m)-Math.sin(u)*Math.cos(m)*Math.cos(h-p);return n.radiansToDegrees(Math.atan2(l,c))}e.default=i},function(t,e,r){var n=r(5),o=r(18),i=r(19),a=n?n.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?o(t):i(t)}},function(t,e,r){var n=r(28),o=r(33);t.exports=function(t,e){var r=o(t,e);return n(r)?r:void 0}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,r){"use strict";function n(t,e,r){void 0===r&&(r={});var n={type:"Feature"};return(0===r.id||r.id)&&(n.id=r.id),r.bbox&&(n.bbox=r.bbox),n.properties=e||{},n.geometry=t,n}function o(t,e,r){return void 0===r&&(r={}),n({type:"Point",coordinates:t},e,r)}function i(t,e,r){void 0===r&&(r={});for(var o=0,i=t;o=0))throw new Error("precision must be a positive number");var r=Math.pow(10,e||0);return Math.round(t*r)/r},e.radiansToLength=m,e.lengthToRadians=l,e.lengthToDegrees=function(t,e){return c(l(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=c,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,r){if(void 0===e&&(e="kilometers"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("length must be a positive number");return m(l(t,e),r)},e.convertArea=function(t,r,n){if(void 0===r&&(r="meters"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("area must be a positive number");var o=e.areaFactors[r];if(!o)throw new Error("invalid original units");var i=e.areaFactors[n];if(!i)throw new Error("invalid final units");return t/o*i},e.isNumber=f,e.isObject=function(t){return!!t&&t.constructor===Object},e.validateBBox=function(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(4!==t.length&&6!==t.length)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach((function(t){if(!f(t))throw new Error("bbox must only contain numbers")}))},e.validateId=function(t){if(!t)throw new Error("id is required");if(-1===["string","number"].indexOf(typeof t))throw new Error("id must be a number or a string")},e.radians2degrees=function(){throw new Error("method has been renamed to `radiansToDegrees`")},e.degrees2radians=function(){throw new Error("method has been renamed to `degreesToRadians`")},e.distanceToDegrees=function(){throw new Error("method has been renamed to `lengthToDegrees`")},e.distanceToRadians=function(){throw new Error("method has been renamed to `lengthToRadians`")},e.radiansToDistance=function(){throw new Error("method has been renamed to `radiansToLength`")},e.bearingToAngle=function(){throw new Error("method has been renamed to `bearingToAzimuth`")},e.convertDistance=function(){throw new Error("method has been renamed to `convertLength`")}},function(t,e,r){var n=r(13);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},function(t,e,r){var n=r(14),o=r(54);t.exports=function(t,e){for(var r=0,i=(e=n(e,t)).length;null!=t&&r-1}},function(t,e,r){var n=r(1);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},function(t,e,r){var n=r(9)(r(6),"Map");t.exports=n},function(t,e,r){var n=r(2);t.exports=function(t){var e=n(this,t).delete(t);return this.size-=e?1:0,e}},function(t,e){t.exports=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}},function(t,e,r){var n=r(2);t.exports=function(t){return n(this,t).get(t)}},function(t,e,r){var n=r(2);t.exports=function(t){return n(this,t).has(t)}},function(t,e,r){var n=r(2);t.exports=function(t,e){var r=n(this,t),o=r.size;return r.set(t,e),this.size+=r.size==o?0:1,this}},function(t,e,r){var n=r(52);t.exports=function(t){return null==t?"":n(t)}},function(t,e,r){var n=r(5),o=r(53),i=r(3),a=r(4),s=n?n.prototype:void 0,p=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(i(e))return o(e,t)+"";if(a(e))return p?p.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r}},function(t,e){t.exports=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")},e.getCoords=function(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")},e.containsNumber=function t(e){if(e.length>1&&n.isNumber(e[0])&&n.isNumber(e[1]))return!0;if(Array.isArray(e[0])&&e[0].length)return t(e[0]);throw new Error("coordinates must only contain numbers")},e.geojsonType=function(t,e,r){if(!e||!r)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,r){if(!t)throw new Error("No feature passed");if(!r)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+r+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+r+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,r){if(!t)throw new Error("No featureCollection passed");if(!r)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+r+", FeatureCollection required");for(var n=0,o=t.features;n2&&void 0!==arguments[2]?arguments[2]:0,n=this.map.latLngToContainerPoint(t),o=this.map.latLngToContainerPoint(e),i=this._getDistance(n,o),a=this._getAngle(n,o),s=this.options.snapAngle||45,p=0,h=[],u=0,m=0;m<360/s;)u=(m*s+r)%360,h.push(u),m++;r%90==0&&h.push(360),h.sort((function(t,e){return t-e})),p=h.reduce((function(t,e){return Math.abs(e-a)s){var u={x:h.x,y:p.y},m=i<0?180:0;r=this.map.pm.pmOrtho._findDestinationPoint(u,a,m)}else{var l={x:p.x,y:h.y},c=o<0?90:-90;r=this.map.pm.pmOrtho._findDestinationPoint(l,s,c)}return this.map.containerPointToLatLng(r)}},o=r(12),i=r.n(o),a={meters:6371008.8,metres:6371008.8,millimeters:6371008800,millimetres:6371008800,centimeters:637100880,centimetres:637100880,kilometers:6371.0088,kilometres:6371.0088,miles:3958.761333810546,nauticalmiles:6371008.8/1852,inches:6371008.8*39.37,yards:6371008.8/1.0936,feet:20902260.511392,radians:1,degrees:6371008.8/111325};function s(t,e,r){if(!g(r=r||{}))throw new Error("options is invalid");var n=r.bbox,o=r.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");n&&d(n),o&&_(o);var i={type:"Feature"};return o&&(i.id=o),n&&(i.bbox=n),i.properties=e||{},i.geometry=t,i}function p(t,e,r){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!f(t[0])||!f(t[1]))throw new Error("coordinates must contain numbers");return s({type:"Point",coordinates:t},e,r)}function h(t,e,r){if(!t)throw new Error("coordinates is required");for(var n=0;n=2&&void 0===t[0].length&&void 0===t[1].length)return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}(t),s=c(a[0]),h=c(a[1]),u=c(r),f=m(e,o),d=Math.asin(Math.sin(h)*Math.cos(f)+Math.cos(h)*Math.sin(f)*Math.cos(u));return p([l(s+Math.atan2(Math.sin(u)*Math.sin(f)*Math.cos(h),Math.cos(f)-Math.sin(h)*Math.sin(d))),l(d)],i)};var v=function(t,e,r){var n=(r=r||{}).steps||64,o=r.properties;if(!t)throw new Error("center is required");if(!e)throw new Error("radius is required");if("object"!=typeof r)throw new Error("options must be an object");if("number"!=typeof n)throw new Error("steps must be a number");n=n||64,o=o||t.properties||{};for(var i=[],a=0;al&&f.push(y(t,e,l,a).geometry.coordinates),u(f,h)};function O(t,e,r){if(null!==t)for(var n,o,i,a,s,p,h,u,m=0,l=0,c=t.type,f="FeatureCollection"===c,g="Feature"===c,d=f?t.features.length:1,_=0;_1?i()(this._markers,s):this._markers,h=(a+(p.length-1))%p.length,u=(a+(p.length+1))%p.length,m=p[h].getLatLng(),l=p[u].getLatLng();if(this._map.pm.pmOrtho._shiftpressed&&this._map.pm.pmOrtho.options.allowOrtho){var c=0;if(this._map.pm.pmOrtho.options.baseAngleOfLastSegment&&p.length>1){var f=p[(a+(p.length-2))%p.length].getLatLng(),g=this._map.latLngToContainerPoint(m),d=this._map.latLngToContainerPoint(f);c=(c=this._map.pm.pmOrtho._getAngle(d,g)+90)>180?c-180:c}var _=this._map.pm.pmOrtho._getPointofAngle(m,r.getLatLng(),c);e.target._latlng=_,e.target.update()}if(p.length>1){this._map.pm.pmOrtho._angleLine||(this._map.pm.pmOrtho._angleLine=L.polyline([],{smoothFactor:0}).addTo(this._map));var y=this._map.latLngToContainerPoint(r.getLatLng()),v=this._map.latLngToContainerPoint(m),w=this._map.latLngToContainerPoint(l),b=this._map.pm.pmOrtho._getAngle(y,w);b=this._map.pm.pmOrtho._formatAngle(b-this._map.pm.pmOrtho._getAngle(y,v));var O=!0;if(this._layer instanceof L.Polygon?O=!0:this._layer instanceof L.Polyline&&(O=h0&&this._map.pm.pmOrtho._shiftpressed&&this._map.pm.pmOrtho.options.allowOrtho){var r=e[e.length-1],n=t.latlng,o=0;if(this._map.pm.pmOrtho.options.baseAngleOfLastSegment&&e.length>1){var i=e[e.length-2],a=this._map.latLngToContainerPoint(r),s=this._map.latLngToContainerPoint(i);o=this._map.pm.pmOrtho._getAngle(s,a)}var p=this._map.pm.pmOrtho._getPointofAngle(r,n,o);this._hintMarker.setLatLng(p),t.latlng=p}else this._hintMarker.setLatLng(t.latlng);if(this.options.snappable){var h=t;h.target=this._hintMarker,this._handleSnapping(h)}if(this.options.allowSelfIntersection||this._handleSelfIntersection(!0,this._hintMarker.getLatLng()),e.length>1){this._map.pm.pmOrtho._angleLine||(this._map.pm.pmOrtho._angleLine=L.polyline([],{smoothFactor:0}).addTo(this._map),this._map.pm.pmOrtho._angleLine.setStyle(this._layer.options));var u=0,m=e[e.length-2],l=e[e.length-1],c=this._map.latLngToContainerPoint(l);if(this._map.pm.pmOrtho.options.baseAngleOfLastSegment&&e.length>1){var f=this._map.latLngToContainerPoint(m);u=this._map.pm.pmOrtho._getAngle(f,c)}var g=this._hintMarker.getLatLng(),d=this._map.latLngToContainerPoint(g),_=this._map.pm.pmOrtho._formatAngle(this._map.pm.pmOrtho._getAngle(d,c)-u);if(this._map.pm.pmOrtho.options.showAngleTooltip){var y=this._map.pm.pmOrtho._addAngleLine(m,l,g).getLatLngs();0===y.length?(this._map.pm.pmOrtho._angleLine.remove(),this._map.pm.pmOrtho._angleLine=null):this._map.pm.pmOrtho._angleLine.setLatLngs(y),this._map.pm.pmOrtho.tooltip?this._map.pm.pmOrtho.tooltip.setLatLng(l).setContent(this._map.pm.pmOrtho.options.angleText+_):this._map.pm.pmOrtho.tooltip=L.tooltip({permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).setContent(this._map.pm.pmOrtho.options.angleText+_).setLatLng(l).addTo(this._map)}else this._map.pm.pmOrtho._angleLine.remove(),this._map.pm.pmOrtho._angleLine=null,this._map.pm.pmOrtho.tooltip&&(this._map.pm.pmOrtho.tooltip.remove(),this._map.pm.pmOrtho.tooltip=null)}}},_createVertexNew:function(t){var e=this._layer.getLatLngs();if(e.length>0&&this._map.pm.pmOrtho._shiftpressed&&this._map.pm.pmOrtho.options.allowOrtho){var r=e[e.length-1],n=t.latlng,o=0;if(this._map.pm.pmOrtho.options.baseAngleOfLastSegment&&e.length>1){var i=e[e.length-2],a=this._map.latLngToContainerPoint(r),s=this._map.latLngToContainerPoint(i);o=(o=this._map.pm.pmOrtho._getAngle(s,a)+90)>180?o-180:o}this._map.pm.pmOrtho._angleLine&&(this._map.pm.pmOrtho._angleLine.removeFrom(this._map),this._map.pm.pmOrtho._angleLine=null),this._map.pm.pmOrtho.tooltip&&(this._map.pm.pmOrtho.tooltip.removeFrom(this._map),this._map.pm.pmOrtho.tooltip=null);var p=this._map.pm.pmOrtho._getPointofAngle(r,n,o);t.latlng=p}this._createVertex(t)},_syncRectangleSize:function(){var t=this,e=this._startMarker.getLatLng(),r=this._hintMarker.getLatLng();(this._layer.setBounds([e,r]),this._map.pm.pmOrtho.options.allowOrtho&&this._map.pm.pmOrtho._shiftpressed?(this._cornerPoint=this._map.pm.pmOrtho._getRectanglePoint(e,r),this._layer.setBounds([e,this._cornerPoint])):this._cornerPoint=null,this.options.cursorMarker&&this._styleMarkers)&&this._findCorners().forEach((function(e,r){t._styleMarkers[r].setLatLng(e)}))},_addAngleLine:function(t,e,r){var n=E()(this._toLngLat(e),this._toLngLat(t)),o=E()(this._toLngLat(e),this._toLngLat(r));n=n<0?n+360:n,o=o<0?o+360:o;var i=t.distanceTo(e),a=r.distanceTo(e),s=i;if(a1?parseInt(e)-parseInt(Math.ceil(r)):r>2.5?parseInt(e)+parseInt(Math.ceil(5-r)):parseInt(e)}return e.toFixed(2)}})}]);