!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=46)}([function(t,e,n){"use strict";e.a=function(t){var e=L.PM.activeLang;o()(s.a,e)||(e="en");return i()(s.a[e],t)},e.b=function(t){return!function e(t){return t.filter(function(t){return![null,"",undefined].includes(t)}).reduce(function(t,n){return t.concat(Array.isArray(n)?e(n):n)},[])}(t).length};var r=n(37),i=n.n(r),a=n(138),o=n.n(a),s=n(36)},function(t,e,n){"use strict";var r=n(40),i=L.Class.extend({includes:[r.a],options:{snappable:!0,snapDistance:20,tooltips:!0,cursorMarker:!0,finishOnDoubleClick:!1,finishOn:null,allowSelfIntersection:!0,templineStyle:{},hintlineStyle:{color:"#3388ff",dashArray:"5,5"},markerStyle:{draggable:!0}},initialize:function(t){var e=this;this._map=t,this.shapes=["Marker","CircleMarker","Line","Polygon","Rectangle","Circle","Cut"],this.shapes.forEach(function(t){e[t]=new L.PM.Draw[t](e._map)})},setPathOptions:function(t){this.options.pathOptions=t},getShapes:function(){return this.shapes},enable:function(t,e){if(!t)throw new Error("Error: Please pass a shape as a parameter. Possible shapes are: ".concat(this.getShapes().join(",")));this.disable(),this[t].enable(e)},disable:function(){var t=this;this.shapes.forEach(function(e){t[e].disable()})},addControls:function(){var t=this;this.shapes.forEach(function(e){t[e].addButton()})}});e.a=i},function(t,e,n){"use strict";var r=n(40),i=n(151),a=L.Class.extend({includes:[i.a,r.a],options:{snappable:!0,snapDistance:20,allowSelfIntersection:!0,draggable:!0},isPolygon:function(){return this._layer instanceof L.Polygon}});e.a=a},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e,n){var r=n(25),i="object"==typeof self&&self&&self.Object===Object&&self,a=r||i||Function("return this")();t.exports=a},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){var r=n(16),i=n(66),a=n(67),o="[object Null]",s="[object Undefined]",l=r?r.toStringTag:undefined;t.exports=function(t){return null==t?t===undefined?s:o:l&&l in Object(t)?i(t):a(t)}},function(t,e,n){"use strict";function r(t,e,n){void 0===n&&(n={});var r={type:"Feature"};return(0===n.id||n.id)&&(r.id=n.id),n.bbox&&(r.bbox=n.bbox),r.properties=e||{},r.geometry=t,r}function i(t,e,n){return void 0===n&&(n={}),r({type:"Point",coordinates:t},e,n)}function a(t,e,n){void 0===n&&(n={});for(var i=0,a=t;i=0))throw new Error("precision must be a positive number");var n=Math.pow(10,e||0);return Math.round(t*n)/n},e.radiansToLength=h,e.lengthToRadians=p,e.lengthToDegrees=function(t,e){return f(p(t,e))},e.bearingToAzimuth=function(t){var e=t%360;return e<0&&(e+=360),e},e.radiansToDegrees=f,e.degreesToRadians=function(t){return t%360*Math.PI/180},e.convertLength=function(t,e,n){if(void 0===e&&(e="kilometers"),void 0===n&&(n="kilometers"),!(t>=0))throw new Error("length must be a positive number");return h(p(t,e),n)},e.convertArea=function(t,n,r){if(void 0===n&&(n="meters"),void 0===r&&(r="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=e.areaFactors[n];if(!i)throw new Error("invalid original units");var a=e.areaFactors[r];if(!a)throw new Error("invalid final units");return t/i*a},e.isNumber=d,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(!d(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,n){var r=n(54),i=n(55),a=n(56),o=n(57),s=n(58);function l(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e-1&&t%1==0&&t<=n}},function(t,e){var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;t.exports=function(t,e){var i=typeof t;return!!(e=null==e?n:e)&&("number"==i||"symbol"!=i&&r.test(t))&&t>-1&&t%1==0&&t0})).filter(function(t){return!t._pmTempLayer}),this._otherSnapLayers?this._snapList=e.concat(this._otherSnapLayers):this._snapList=e,this.debugIndicatorLines=n},_calcClosestLayer:function(t,e){var n=this,r={};return e.forEach(function(e,i){var a=n._calcLayerDistances(t,e);n.debugIndicatorLines[i].setLatLngs([t,a.latlng]),(r.distance===undefined||a.distance=0&&u<=1&&(p.onLine1=!0),c>=0&&c<=1&&(p.onLine2=!0),!(!p.onLine1||!p.onLine2)&&[p.x,p.y])}e["default"]=function(t){var e,n,a={type:"FeatureCollection",features:[]};if("LineString"===(n="Feature"===t.type?t.geometry:t).type)e=[n.coordinates];else if("MultiLineString"===n.type)e=n.coordinates;else if("MultiPolygon"===n.type)e=[].concat.apply([],n.coordinates);else{if("Polygon"!==n.type)throw new Error("Input must be a LineString, MultiLineString, Polygon, or MultiPolygon Feature or Geometry");e=n.coordinates}return e.forEach(function(t){e.forEach(function(e){for(var n=0;n=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 i(t){if(t.length>1&&r.isNumber(t[0])&&r.isNumber(t[1]))return!0;if(Array.isArray(t[0])&&t[0].length)return i(t[0]);throw new Error("coordinates must only contain numbers")},e.geojsonType=function(t,e,n){if(!e||!n)throw new Error("type and name required");if(!t||t.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.type)},e.featureOf=function(t,e,n){if(!t)throw new Error("No feature passed");if(!n)throw new Error(".featureOf() requires a name");if(!t||"Feature"!==t.type||!t.geometry)throw new Error("Invalid input to "+n+", Feature with geometry required");if(!t.geometry||t.geometry.type!==e)throw new Error("Invalid input to "+n+": must be a "+e+", given "+t.geometry.type)},e.collectionOf=function(t,e,n){if(!t)throw new Error("No featureCollection passed");if(!n)throw new Error(".collectionOf() requires a name");if(!t||"FeatureCollection"!==t.type)throw new Error("Invalid input to "+n+", FeatureCollection required");for(var r=0,i=t.features;re?1:t0))return e;e=e.left}}return null},n.prototype.contains=function(t){for(var e=this._root,n=this._compare;e;){var r=n(t,e.key);if(0===r)return!0;e=r<0?e.left:e.right}return!1},n.prototype.remove=function(t){var e=this.find(t);if(!e)return!1;if(this.splay(e),e.left)if(e.right){var n=this.minNode(e.right);n.parent!==e&&(this.replace(n,n.right),n.right=e.right,n.right.parent=n),this.replace(e,n),n.left=e.left,n.left.parent=n}else this.replace(e,e.left);else this.replace(e,e.right);return this._size--,!0},n.prototype.removeNode=function(t){if(!t)return!1;if(this.splay(t),t.left)if(t.right){var e=this.minNode(t.right);e.parent!==t&&(this.replace(e,e.right),e.right=t.right,e.right.parent=e),this.replace(t,e),e.left=t.left,e.left.parent=e}else this.replace(t,t.left);else this.replace(t,t.right);return this._size--,!0},n.prototype.erase=function(t){var e=this.find(t);if(e){this.splay(e);var n=e.left,r=e.right,i=null;n&&(n.parent=null,i=this.maxNode(n),this.splay(i),this._root=i),r&&(n?i.right=r:this._root=r,r.parent=i),this._size--}},n.prototype.pop=function(){var t=this._root,e=null;if(t){for(;t.left;)t=t.left;e={key:t.key,data:t.data},this.remove(t.key)}return e},n.prototype.next=function(t){var e=t;if(e)if(e.right)for(e=e.right;e&&e.left;)e=e.left;else for(e=t.parent;e&&e.right===t;)t=e,e=e.parent;return e},n.prototype.prev=function(t){var e=t;if(e)if(e.left)for(e=e.left;e&&e.right;)e=e.right;else for(e=t.parent;e&&e.left===t;)t=e,e=e.parent;return e},n.prototype.forEach=function(t){for(var e=this._root,n=[],r=!1,i=0;!r;)e?(n.push(e),e=e.left):n.length>0?(t(e=n.pop(),i++),e=e.right):r=!0;return this},n.prototype.range=function(t,e,n,r){for(var i=[],a=this._compare,o=this._root;0!==i.length||o;)if(o)i.push(o),o=o.left;else{if(a((o=i.pop()).key,e)>0)break;if(a(o.key,t)>=0&&n.call(r,o))return this;o=o.right}return this},n.prototype.keys=function(){for(var t=this._root,e=[],n=[],r=!1;!r;)t?(e.push(t),t=t.left):e.length>0?(t=e.pop(),n.push(t.key),t=t.right):r=!0;return n},n.prototype.values=function(){for(var t=this._root,e=[],n=[],r=!1;!r;)t?(e.push(t),t=t.left):e.length>0?(t=e.pop(),n.push(t.data),t=t.right):r=!0;return n},n.prototype.at=function(t){for(var e=this._root,n=[],r=!1,i=0;!r;)if(e)n.push(e),e=e.left;else if(n.length>0){if(e=n.pop(),i===t)return e;i++,e=e.right}else r=!0;return null},n.prototype.load=function(t,e,n){if(void 0===t&&(t=[]),void 0===e&&(e=[]),void 0===n&&(n=!1),0!==this._size)throw new Error("bulk-load: tree is not empty");var r=t.length;return n&&function i(t,e,n,r,a){if(n>=r)return;var o=t[n+r>>1];var s=n-1;var l=r+1;for(;;){do{s++}while(a(t[s],o)<0);do{l--}while(a(t[l],o)>0);if(s>=l)break;var u=t[s];t[s]=t[l],t[l]=u,u=e[s],e[s]=e[l],e[l]=u}i(t,e,n,l,a);i(t,e,l+1,r,a)}(t,e,0,r-1,this._compare),this._root=function a(t,e,n,r,i){var o=i-r;if(o>0){var s=r+Math.floor(o/2),l=e[s],u=n[s],c={key:l,data:u,parent:t};return c.left=a(c,e,n,r,s),c.right=a(c,e,n,s+1,i),c}return null}(null,t,e,0,r),this._size=r,this},n.prototype.min=function(){var t=this.minNode(this._root);return t?t.key:null},n.prototype.max=function(){var t=this.maxNode(this._root);return t?t.key:null},n.prototype.isEmpty=function(){return null===this._root},r.size.get=function(){return this._size},n.createTree=function(t,e,r,i,a){return new n(r,a).load(t,e,i)},Object.defineProperties(n.prototype,r);var i=0,a=1,o=2,s=3,l=0,u=1,c=2,h=3;function p(t,e,n){null===e?(t.inOut=!1,t.otherInOut=!0):(t.isSubject===e.isSubject?(t.inOut=!e.inOut,t.otherInOut=e.otherInOut):(t.inOut=!e.otherInOut,t.otherInOut=e.isVertical()?!e.inOut:e.inOut),e&&(t.prevInResult=!f(e,n)||e.isVertical()?e.prevInResult:e)),t.inResult=f(t,n)}function f(t,e){switch(t.type){case i:switch(e){case l:return!t.otherInOut;case u:return t.otherInOut;case c:return t.isSubject&&t.otherInOut||!t.isSubject&&!t.otherInOut;case h:return!0}break;case o:return e===l||e===u;case s:return e===c;case a:return!1}return!1}var d=function(t,e,n,r,a){this.left=e,this.point=t,this.otherEvent=n,this.isSubject=r,this.type=a||i,this.inOut=!1,this.otherInOut=!1,this.prevInResult=null,this.inResult=!1,this.resultInOut=!1,this.isExteriorRing=!0};function g(t,e){return t[0]===e[0]&&t[1]===e[1]}function _(t,e,n){return(t[0]-n[0])*(e[1]-n[1])-(e[0]-n[0])*(t[1]-n[1])}function m(t,e){var n=t.point,r=e.point;return n[0]>r[0]?1:n[0]r[1]?1:-1:function(t,e,n,r){if(t.left!==e.left)return t.left?1:-1;if(0!==_(n,t.otherEvent.point,e.otherEvent.point))return t.isBelow(e.otherEvent.point)?-1:1;return!t.isSubject&&e.isSubject?1:-1}(t,e,n)}function y(t,e,n){var r=new d(e,!1,t,t.isSubject),i=new d(e,!0,t.otherEvent,t.isSubject);return g(t.point,t.otherEvent.point)&&console.warn("what is that, a collapsed segment?",t),r.contourId=i.contourId=t.contourId,m(i,t.otherEvent)>0&&(t.otherEvent.left=!0,i.left=!1),t.otherEvent.otherEvent=i,t.otherEvent=r,n.push(i),n.push(r),n}function v(t,e){return t[0]*e[1]-t[1]*e[0]}function b(t,e){return t[0]*e[0]+t[1]*e[1]}function L(t,e,n){var r=function(t,e,n,r,i){var a=[e[0]-t[0],e[1]-t[1]],o=[r[0]-n[0],r[1]-n[1]];function s(t,e,n){return[t[0]+e*n[0],t[1]+e*n[1]]}var l=[n[0]-t[0],n[1]-t[1]],u=v(a,o),c=u*u,h=b(a,a);if(c>0){var p=v(l,o)/u;if(p<0||p>1)return null;var f=v(l,a)/u;return f<0||f>1?null:0===p||1===p?i?null:[s(t,p,a)]:0===f||1===f?i?null:[s(n,f,o)]:[s(t,p,a)]}if((c=(u=v(l,a))*u)>0)return null;var d=b(a,l)/h,g=d+b(a,o)/h,_=Math.min(d,g),m=Math.max(d,g);return _<=1&&m>=0?1===_?i?null:[s(t,_>0?_:0,a)]:0===m?i?null:[s(t,m<1?m:1,a)]:i&&0===_&&1===m?null:[s(t,_>0?_:0,a),s(t,m<1?m:1,a)]:null}(t.point,t.otherEvent.point,e.point,e.otherEvent.point),i=r?r.length:0;if(0===i)return 0;if(1===i&&(g(t.point,e.point)||g(t.otherEvent.point,e.otherEvent.point)))return 0;if(2===i&&t.isSubject===e.isSubject)return 0;if(1===i)return g(t.point,r[0])||g(t.otherEvent.point,r[0])||y(t,r[0],n),g(e.point,r[0])||g(e.otherEvent.point,r[0])||y(e,r[0],n),1;var l=[],u=!1,c=!1;return g(t.point,e.point)?u=!0:1===m(t,e)?l.push(e,t):l.push(t,e),g(t.otherEvent.point,e.otherEvent.point)?c=!0:1===m(t.otherEvent,e.otherEvent)?l.push(e.otherEvent,t.otherEvent):l.push(t.otherEvent,e.otherEvent),u&&c||u?(e.type=a,t.type=e.inOut===t.inOut?o:s,u&&!c&&y(l[1].otherEvent,l[0].point,n),2):c?(y(l[0],l[1].point,n),3):l[0]!==l[3].otherEvent?(y(l[0],l[1].point,n),y(l[1],l[2].point,n),3):(y(l[0],l[1].point,n),y(l[3].otherEvent,l[2].point,n),3)}function k(t,e){if(t===e)return 0;if(0!==_(t.point,t.otherEvent.point,e.point)||0!==_(t.point,t.otherEvent.point,e.otherEvent.point))return g(t.point,e.point)?t.isBelow(e.otherEvent.point)?-1:1:t.point[0]===e.point[0]?t.point[1]e.contourId?1:-1):1===m(t,e)?1:-1}function M(t,e,n,r){var i=t+1,a=e.length;if(i>a-1)return t-1;for(var o=e[t].point,s=e[i].point;i=r;)i--;return i}function w(t,e){var n,r,i,a=function(t){var e,n,r,i,a=[];for(n=0,r=t.length;n1?s[s.length-1].push(l[0]):s.push(l):e!==c||a[n].isSubject||0!==s.length?0===s.length?s.push([[l]]):s[s.length-1].push(l[0]):s.push(l);var u=s.length-1,h=n,p=a[n].point;for(l[0].push(p);h>=n;)i=a[h],o[h]=!0,i.left?(i.resultInOut=!1,i.contourId=u):(i.otherEvent.resultInOut=!0,i.otherEvent.contourId=u),o[h=i.pos]=!0,l[0].push(a[h].point),h=M(h,a,o,n);i=a[h=-1===h?n:h],o[h]=o[i.pos]=!0,i.otherEvent.resultInOut=!0,i.otherEvent.contourId=u}return s}d.prototype.isBelow=function(t){var e=this.point,n=this.otherEvent.point;return this.left?(e[0]-t[0])*(n[1]-t[1])-(n[0]-t[0])*(e[1]-t[1])>0:(n[0]-t[0])*(e[1]-t[1])-(e[0]-t[0])*(n[1]-t[1])>0},d.prototype.isAbove=function(t){return!this.isBelow(t)},d.prototype.isVertical=function(){return this.point[0]===this.otherEvent.point[0]},d.prototype.clone=function(){var t=new d(this.point,this.left,this.otherEvent,this.isSubject,this.type);return t.inResult=this.inResult,t.prevInResult=this.prevInResult,t.isExteriorRing=this.isExteriorRing,t.inOut=this.inOut,t.otherInOut=this.otherInOut,t};var C=E,x=E;function E(t,e){if(!(this instanceof E))return new E(t,e);if(this.data=t||[],this.length=this.data.length,this.compare=e||S,this.length>0)for(var n=(this.length>>1)-1;n>=0;n--)this._down(n)}function S(t,e){return te?1:0}E.prototype={push:function(t){this.data.push(t),this.length++,this._up(this.length-1)},pop:function(){if(0===this.length)return undefined;var t=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),t},peek:function(){return this.data[0]},_up:function(t){for(var e=this.data,n=this.compare,r=e[t];t>0;){var i=t-1>>1,a=e[i];if(n(r,a)>=0)break;e[t]=a,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];t=0)break;e[t]=s,t=a}e[t]=i}},C["default"]=x;var P=Math.max,O=Math.min,B=0;function j(t,e,n,r,i,a){var o,s,l,u,c,h;for(o=0,s=t.length-1;o0?h.left=!0:c.left=!0;var p=l[0],f=l[1];i[0]=O(i[0],p),i[1]=O(i[1],f),i[2]=P(i[2],p),i[3]=P(i[3],f),r.push(c),r.push(h)}}var D=[];function T(t,e,r){"number"==typeof t[0][0][0]&&(t=[t]),"number"==typeof e[0][0][0]&&(e=[e]);var i=function(t,e,n){var r=null;return t.length*e.length==0&&(n===l?r=D:n===c?r=t:n!==u&&n!==h||(r=0===t.length?e:t)),r}(t,e,r);if(i)return i===D?null:i;var a=[Infinity,Infinity,-Infinity,-Infinity],o=[Infinity,Infinity,-Infinity,-Infinity],s=function(t,e,n,r,i){var a,o,s,l,u,h,p=new C(null,m);for(s=0,l=t.length;sr[2]||r[0]>n[2]||n[1]>r[3]||r[1]>n[3])&&(i===l?a=D:i===c?a=t:i!==u&&i!==h||(a=t.concat(e))),a}(t,e,a,o,r))?i===D?null:i:w(function(t,e,r,i,a,o){for(var s,u,h,f=new n(k),d=[],g=Math.min(i[2],a[2]);0!==t.length;){var _=t.pop();if(d.push(_),o===l&&_.point[0]>g||o===c&&_.point[0]>i[2])break;if(_.left){u=s=f.insert(_),s=s!==(h=f.minNode())?f.prev(s):null,u=f.next(u);var m=s?s.key:null;if(p(_,m,o),u&&2===L(_,u.key,t)&&(p(_,m,o),p(_,u.key,o)),s&&2===L(s.key,_,t)){var y=s;p(m,(y=y!==h?f.prev(y):null)?y.key:null,o),p(_,m,o)}}else _=_.otherEvent,u=s=f.find(_),s&&u&&(s=s!==h?f.prev(s):null,u=f.next(u),f.remove(_),u&&s&&L(s.key,u.key,t))}return d}(s,0,0,a,o,r),r)}var I={UNION:u,DIFFERENCE:c,INTERSECTION:l,XOR:h};t.union=function(t,e){return T(t,e,u)},t.diff=function(t,e){return T(t,e,c)},t.xor=function(t,e){return T(t,e,h)},t.intersection=function(t,e){return T(t,e,l)},t.operations=I,Object.defineProperty(t,"__esModule",{value:!0})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8);function i(t,e,n){if(null!==t)for(var r,a,o,s,l,u,c,h,p=0,f=0,d=t.type,g="FeatureCollection"===d,_="Feature"===d,m=g?t.features.length:1,y=0;yu||f>c||d>h)return l=i,u=n,c=f,h=d,void(o=0);var g=r.lineString([l,i],t.properties);if(!1===e(g,n,a,d,o))return!1;o++,l=i})&&void 0}}})}function c(t,e){if(!t)throw new Error("geojson is required");l(t,function(t,n,i){if(null!==t.geometry){var a=t.geometry.type,o=t.geometry.coordinates;switch(a){case"LineString":if(!1===e(t,n,i,0,0))return!1;break;case"Polygon":for(var s=0;s>>0,r=arguments[1],i=0;i>>0,r=arguments[1],i=0;i0&&arguments[0]!==undefined?arguments[0]:"en",e=arguments.length>1?arguments[1]:undefined,n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:"en";e&&(a.a[t]=i()(a.a[n],e)),L.PM.activeLang=t,this.map.pm.Toolbar.reinit()},addControls:function(t){this.Toolbar.addControls(t)},removeControls:function(){this.Toolbar.removeControls()},toggleControls:function(){this.Toolbar.toggleControls()},controlsVisible:function(){return this.Toolbar.isVisible},enableDraw:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"Polygon",e=arguments.length>1?arguments[1]:undefined;"Poly"===t&&(t="Polygon"),this.Draw.enable(t,e)},disableDraw:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:"Polygon";"Poly"===t&&(t="Polygon"),this.Draw.disable(t)},setPathOptions:function(t){this.Draw.setPathOptions(t)},findLayers:function(){var t=[];return this.map.eachLayer(function(e){(e instanceof L.Polyline||e instanceof L.Marker||e instanceof L.Circle||e instanceof L.CircleMarker)&&t.push(e)}),t=(t=t.filter(function(t){return!!t.pm})).filter(function(t){return!t._pmTempLayer})},removeLayer:function(t){var e=t.target;!(e._pmTempLayer||e.pm&&e.pm.dragging())&&(e.remove(),this.map.fire("pm:remove",{layer:e}))},globalDragModeEnabled:function(){return!!this._globalDragMode},enableGlobalDragMode:function(){var t=this.findLayers();this._globalDragMode=!0,t.forEach(function(t){t.pm.enableLayerDrag()}),this.map.on("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("dragMode",this._globalDragMode),this._fireDragModeEvent(!0)},disableGlobalDragMode:function(){var t=this.findLayers();this._globalDragMode=!1,t.forEach(function(t){t.pm.disableLayerDrag()}),this.map.off("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("dragMode",this._globalDragMode),this._fireDragModeEvent(!1)},_fireDragModeEvent:function(t){this.map.fire("pm:globaldragmodetoggled",{enabled:t,map:this.map})},toggleGlobalDragMode:function(){this.globalDragModeEnabled()?this.disableGlobalDragMode():this.enableGlobalDragMode()},layerAddHandler:function(t){var e=t.layer;!!e.pm&&!e._pmTempLayer&&(this.globalRemovalEnabled()&&(this.disableGlobalRemovalMode(),this.enableGlobalRemovalMode()),this.globalEditEnabled()&&(this.disableGlobalEditMode(),this.enableGlobalEditMode()),this.globalDragModeEnabled()&&(this.disableGlobalDragMode(),this.enableGlobalDragMode()))},disableGlobalRemovalMode:function(){var t=this;this._globalRemovalMode=!1,this.map.eachLayer(function(e){e.off("click",t.removeLayer,t)}),this.map.off("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("deleteLayer",this._globalRemovalMode),this._fireRemovalModeEvent(!1)},enableGlobalRemovalMode:function(){var t=this;this._globalRemovalMode=!0,this.map.eachLayer(function(e){(function(t){return t.pm&&!(t.pm.options&&t.pm.options.preventMarkerRemoval)&&!(t instanceof L.LayerGroup)})(e)&&e.on("click",t.removeLayer,t)}),this.map.on("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("deleteLayer",this._globalRemovalMode),this._fireRemovalModeEvent(!0)},_fireRemovalModeEvent:function(t){this.map.fire("pm:globalremovalmodetoggled",{enabled:t,map:this.map})},toggleGlobalRemovalMode:function(){this.globalRemovalEnabled()?this.disableGlobalRemovalMode():this.enableGlobalRemovalMode()},globalRemovalEnabled:function(){return!!this._globalRemovalMode},globalEditEnabled:function(){return this._globalEditMode},enableGlobalEditMode:function(t){var e=this.findLayers();this._globalEditMode=!0,e.forEach(function(e){e.pm.enable(t)}),this.map.on("layeradd",this.layerAddHandler,this),this.Toolbar.toggleButton("editPolygon",this._globalEditMode),this._fireEditModeEvent(!0)},disableGlobalEditMode:function(){var t=this.findLayers();this._globalEditMode=!1,t.forEach(function(t){t.pm.disable()}),this.map.on("layeroff",this.layerAddHandler,this),this.Toolbar.toggleButton("editPolygon",this._globalEditMode),this._fireEditModeEvent(!1)},_fireEditModeEvent:function(t){this.map.fire("pm:globaleditmodetoggled",{enabled:t,map:this.map})},toggleGlobalEditMode:function(t){this.globalEditEnabled()?this.disableGlobalEditMode():this.enableGlobalEditMode(t)}});e.a=o},function(t,e,n){var r=n(52),i=n(109)(function(t,e,n){r(t,e,n)});t.exports=i},function(t,e,n){var r=n(53),i=n(27),a=n(84),o=n(86),s=n(3),l=n(34),u=n(33);t.exports=function c(t,e,n,h,p){t!==e&&a(e,function(a,l){if(p||(p=new r),s(a))o(t,e,l,n,c,h,p);else{var f=h?h(u(t,l),a,l+"",t,e,p):undefined;f===undefined&&(f=a),i(t,l,f)}},l)}},function(t,e,n){var r=n(9),i=n(59),a=n(60),o=n(61),s=n(62),l=n(63);function u(t){var e=this.__data__=new r(t);this.size=e.size}u.prototype.clear=i,u.prototype["delete"]=a,u.prototype.get=o,u.prototype.has=s,u.prototype.set=l,t.exports=u},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,n){var r=n(10),i=Array.prototype.splice;t.exports=function(t){var e=this.__data__,n=r(e,t);return!(n<0||(n==e.length-1?e.pop():i.call(e,n,1),--this.size,0))}},function(t,e,n){var r=n(10);t.exports=function(t){var e=this.__data__,n=r(e,t);return n<0?undefined:e[n][1]}},function(t,e,n){var r=n(10);t.exports=function(t){return r(this.__data__,t)>-1}},function(t,e,n){var r=n(10);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(9);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e["delete"](t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(9),i=n(24),a=n(26),o=200;t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var s=n.__data__;if(!i||s.length1?n[a-1]:undefined,s=a>2?n[2]:undefined;for(o=t.length>3&&"function"==typeof o?(a--,o):undefined,s&&i(n[0],n[1],s)&&(o=a<3?undefined:o,a=1),e=Object(e);++r0){if(++e>=n)return arguments[0]}else e=0;return t.apply(undefined,arguments)}}},function(t,e,n){var r=n(11),i=n(20),a=n(22),o=n(3);t.exports=function(t,e,n){if(!o(n))return!1;var s=typeof e;return!!("number"==s?i(n)&&a(e,n.length):"string"==s&&e in n)&&r(n[e],t)}},function(t,e){t.exports={tooltips:{placeMarker:"Click to place marker",firstVertex:"Click to place first vertex",continueLine:"Click to continue drawing",finishLine:"Click any existing marker to finish",finishPoly:"Click first marker to finish",finishRect:"Click to finish",startCircle:"Click to place circle center",finishCircle:"Click to finish circle",placeCircleMarker:"Click to place circle marker"},actions:{finish:"Finish",cancel:"Cancel",removeLastVertex:"Remove Last Vertex"},buttonTitles:{drawMarkerButton:"Draw Marker",drawPolyButton:"Draw Polygons",drawLineButton:"Draw Polyline",drawCircleButton:"Draw Circle",drawRectButton:"Draw Rectangle",editButton:"Edit Layers",dragButton:"Drag Layers",cutButton:"Cut Layers",deleteButton:"Remove Layers",drawCircleMarkerButton:"Draw Circle Marker"}}},function(t,e){t.exports={tooltips:{placeMarker:"Platziere den Marker mit Klick",firstVertex:"Platziere den ersten Marker mit Klick",continueLine:"Klicke, um weiter zu zeichnen",finishLine:"Beende mit Klick auf existierenden Marker",finishPoly:"Beende mit Klick auf ersten Marker",finishRect:"Beende mit Klick",startCircle:"Platziere das Kreiszentrum mit Klick",finishCircle:"Beende den Kreis mit Klick",placeCircleMarker:"Platziere den Kreismarker mit Klick"},actions:{finish:"Beenden",cancel:"Abbrechen",removeLastVertex:"Letzten Vertex löschen"},buttonTitles:{drawMarkerButton:"Marker zeichnen",drawPolyButton:"Polygon zeichnen",drawLineButton:"Polyline zeichnen",drawCircleButton:"Kreis zeichnen",drawRectButton:"Rechteck zeichnen",editButton:"Layer editieren",dragButton:"Layer bewegen",cutButton:"Layer schneiden",deleteButton:"Layer löschen",drawCircleMarkerButton:"Kreismarker zeichnen"}}},function(t,e){t.exports={tooltips:{placeMarker:"Clicca per posizionare un Marker",firstVertex:"Clicca per posizionare il primo vertice",continueLine:"Clicca per continuare a disegnare",finishLine:"Clicca qualsiasi marker esistente per terminare",finishPoly:"Clicca il primo marker per terminare",finishRect:"Clicca per terminare",startCircle:"Clicca per posizionare il punto centrale del cerchio",finishCircle:"Clicca per terminare il cerchio",placeCircleMarker:"Clicca per posizionare un Marker del cherchio"},actions:{finish:"Termina",cancel:"Annulla",removeLastVertex:"Rimuovi l'ultimo vertice"},buttonTitles:{drawMarkerButton:"Disegna Marker",drawPolyButton:"Disegna Poligoni",drawLineButton:"Disegna Polilinea",drawCircleButton:"Disegna Cerchio",drawRectButton:"Disegna Rettangolo",editButton:"Modifica Livelli",dragButton:"Sposta Livelli",cutButton:"Ritaglia Livelli",deleteButton:"Elimina Livelli",drawCircleMarkerButton:"Disegna Marker del Cherchio"}}},function(t,e){t.exports={tooltips:{placeMarker:"Adaugă un punct",firstVertex:"Apasă aici pentru a adăuga primul Vertex",continueLine:"Apasă aici pentru a continua desenul",finishLine:"Apasă pe orice obiect pentru a finisa desenul",finishPoly:"Apasă pe primul obiect pentru a finisa",finishRect:"Apasă pentru a finisa",startCircle:"Apasă pentru a desena un cerc",finishCircle:"Apasă pentru a finisa un cerc",placeCircleMarker:"Adaugă un punct"},actions:{finish:"Termină",cancel:"Anulează",removeLastVertex:"Șterge ultimul Vertex"},buttonTitles:{drawMarkerButton:"Adaugă o bulină",drawPolyButton:"Desenează un poligon",drawLineButton:"Desenează o linie",drawCircleButton:"Desenează un cerc",drawRectButton:"Desenează un dreptunghi",editButton:"Editează straturile",dragButton:"Mută straturile",cutButton:"Taie straturile",deleteButton:"Șterge straturile",placeCircleMarker:"Adaugă o bulină"}}},function(t,e){t.exports={tooltips:{placeMarker:"Щелкните, чтобы поместить маркер",firstVertex:"Нажмите, чтобы поместить первый объект",continueLine:"Нажмите, чтобы продолжить рисование",finishLine:"Щелкните любой существующий маркер для завершения",finishPoly:"Выберите первую точку, чтобы закончить",finishRect:"Нажмите, чтобы закончить",startCircle:"Нажмите чтобы добавить круг",finishCircle:"Нажмите чтобы закончить круг",placeCircleMarker:"Click to place circle marker"},actions:{finish:"Заканчивать",cancel:"Отмена",removeLastVertex:"Удалить последний объект на карте"},buttonTitles:{drawMarkerButton:"Добавить маркер",drawPolyButton:"Рисовать полигон",drawLineButton:"Рисовать Полилинию",drawCircleButton:"Рисовать круг",drawRectButton:"Рисовать Прямоугольник",editButton:"Редактировать слой",dragButton:"Перетаскивать слой",cutButton:"Вырезать слой",deleteButton:"Удалить слой",placeCircleMarker:"Щелкните, чтобы поместить маркер"}}},function(t,e){t.exports={tooltips:{placeMarker:"Presiona para colocar un marcador",firstVertex:"Presiona para colocar el primer vértice",continueLine:"Presiona para continuar dibujando",finishLine:"Presiona cualquier marcador existente para finalizar",finishPoly:"Presiona el primer marcador para finalizar",finishRect:"Presiona para finalizar",startCircle:"Presiona para colocar el centro del circulo",finishCircle:"Presiona para finalizar el circulo",placeCircleMarker:"Presiona para colocar un marcador de circulo"},actions:{finish:"Finalizar",cancel:"Cancelar",removeLastVertex:"Remover ultimo vértice"},buttonTitles:{drawMarkerButton:"Dibujar Marcador",drawPolyButton:"Dibujar Polígono",drawLineButton:"Dibujar Línea",drawCircleButton:"Dibujar Circulo",drawRectButton:"Dibujar Rectángulo",editButton:"Editar Capas",dragButton:"Arrastrar Capas",cutButton:"Cortar Capas",deleteButton:"Remover Capas",drawCircleMarkerButton:"Dibujar Marcador de Circulo"}}},function(t,e){t.exports={tooltips:{placeMarker:"Klik om een marker te plaatsen",firstVertex:"Klik om het eerste punt te plaatsen",continueLine:"Klik om te blijven tekenen",finishLine:"Klik op een bestaand punt om te beëindigen",finishPoly:"Klik op het eerst punt om te beëindigen",finishRect:"Klik om te beëindigen",startCircle:"Klik om het middelpunt te plaatsen",finishCircle:"Klik om de cirkel te beëindigen",placeCircleMarker:"Klik om een marker te plaatsen"},actions:{finish:"Bewaar",cancel:"Annuleer",removeLastVertex:"Verwijder laatste punt"},buttonTitles:{drawMarkerButton:"Plaats Marker",drawPolyButton:"Teken een vlak",drawLineButton:"Teken een lijn",drawCircleButton:"Teken een cirkel",drawRectButton:"Teken een vierkant",editButton:"Bewerk",dragButton:"Verplaats",cutButton:"Knip",deleteButton:"Verwijder",drawCircleMarkerButton:"Plaats Marker"}}},function(t,e){t.exports={tooltips:{placeMarker:"Cliquez pour placer un marqueur",firstVertex:"Cliquez pour placer le premier sommet",continueLine:"Cliquez pour continuer à dessiner",finishLine:"Cliquez sur n'importe quel marqueur pour terminer",finishPoly:"Cliquez sur le premier marqueur pour terminer",finishRect:"Cliquez pour terminer",startCircle:"Cliquez pour placer le centre du cercle",finishCircle:"Cliquez pour finir le cercle"},actions:{finish:"Terminer",cancel:"Annuler",removeLastVertex:"Retirer le dernier sommet"},buttonTitles:{drawMarkerButton:"Placer des marqueurs",drawPolyButton:"Dessiner des polygones",drawLineButton:"Dessiner des polylignes",drawCircleButton:"Dessiner un cercle",drawRectButton:"Dessiner un rectangle",editButton:"Éditer des calques",dragButton:"Déplacer des calques",cutButton:"Couper des calques",deleteButton:"Supprimer des calques"}}},function(t,e){t.exports={tooltips:{placeMarker:"单击放置标记",firstVertex:"单击放置首个顶点",continueLine:"单击继续绘制",finishLine:"单击任何存在的标记以完成",finishPoly:"单击第一个标记以完成",finishRect:"单击完成",startCircle:"单击放置圆心",finishCircle:"单击完成圆形"},actions:{finish:"完成",cancel:"取消",removeLastVertex:"移除最后的顶点"},buttonTitles:{drawMarkerButton:"绘制标记",drawPolyButton:"绘制多边形",drawLineButton:"绘制线段",drawCircleButton:"绘制圆形",drawRectButton:"绘制长方形",editButton:"编辑图层",dragButton:"拖拽图层",cutButton:"剪切图层",deleteButton:"删除图层"}}},function(t,e){t.exports={tooltips:{placeMarker:"Clique para posicionar o marcador",firstVertex:"Clique para posicionar o primeiro vértice",continueLine:"Clique para continuar desenhando",finishLine:"Clique em qualquer marcador existente para finalizar",finishPoly:"Clique no primeiro ponto para fechar o polígono",finishRect:"Clique para finalizar",startCircle:"Clique para posicionar o centro do círculo",finishCircle:"Clique para fechar o círculo"},actions:{finish:"Finalizar",cancel:"Cancelar",removeLastVertex:"Remover último vértice"},buttonTitles:{drawMarkerButton:"Desenhar um marcador",drawPolyButton:"Desenhar um polígono",drawLineButton:"Desenhar uma polilinha",drawCircleButton:"Desenhar um círculo",drawRectButton:"Desenhar um retângulo",editButton:"Editar camada(s)",dragButton:"Mover camada(s)",cutButton:"Recortar camada(s)",deleteButton:"Remover camada(s)"}}},function(t,e,n){"use strict";var r=n(129),i=n(0);L.Control.PMButton=r.a;var a=L.Class.extend({options:{drawMarker:!0,drawRectangle:!0,drawPolyline:!0,drawPolygon:!0,drawCircle:!0,drawCircleMarker:!0,editMode:!0,dragMode:!0,cutPolygon:!0,removalMode:!0,position:"topleft"},initialize:function(t){this.init(t)},reinit:function(){var t=this.isVisible;this.removeControls(),this._defineButtons(),t&&this.addControls()},init:function(t){this.map=t,this.buttons={},this.isVisible=!1,this.drawContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-draw leaflet-bar leaflet-control"),this.editContainer=L.DomUtil.create("div","leaflet-pm-toolbar leaflet-pm-edit leaflet-bar leaflet-control"),this._defineButtons()},getButtons:function(){return this.buttons},addControls:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.options;"undefined"!=typeof t.editPolygon&&(t.editMode=t.editPolygon),"undefined"!=typeof t.deleteLayer&&(t.removalMode=t.deleteLayer),L.Util.setOptions(this,t),this.applyIconStyle(),this._showHideButtons(),this.isVisible=!0},applyIconStyle:function(){var t=this.getButtons(),e={geomanIcons:{drawMarker:"control-icon leaflet-pm-icon-marker",drawPolyline:"control-icon leaflet-pm-icon-polyline",drawRectangle:"control-icon leaflet-pm-icon-rectangle",drawPolygon:"control-icon leaflet-pm-icon-polygon",drawCircle:"control-icon leaflet-pm-icon-circle",drawCircleMarker:"control-icon leaflet-pm-icon-circle-marker",editMode:"control-icon leaflet-pm-icon-edit",dragMode:"control-icon leaflet-pm-icon-drag",cutPolygon:"control-icon leaflet-pm-icon-cut",removalMode:"control-icon leaflet-pm-icon-delete"}};for(var n in t){var r=t[n];L.Util.setOptions(r,{className:e.geomanIcons[n]})}},removeControls:function(){var t=this.getButtons();for(var e in t)t[e].remove();this.isVisible=!1},toggleControls:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this.options;this.isVisible?this.removeControls():this.addControls(t)},_addButton:function(t,e){return this.buttons[t]=e,this.options[t]=this.options[t]||!1,this.buttons[t]},triggerClickOnToggledButtons:function(t){for(var e in this.buttons)this.buttons[e]!==t&&this.buttons[e].toggled()&&this.buttons[e]._triggerClick()},toggleButton:function(t,e){return"editPolygon"===t&&(t="editMode"),"deleteLayer"===t&&(t="removalMode"),this.triggerClickOnToggledButtons(this.buttons[t]),this.buttons[t].toggle(e)},_defineButtons:function(){var t=this,e={className:"control-icon leaflet-pm-icon-marker",title:Object(i.a)("buttonTitles.drawMarkerButton"),jsClass:"Marker",onClick:function(){},afterClick:function(){t.map.pm.Draw.Marker.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},n={title:Object(i.a)("buttonTitles.drawPolyButton"),className:"control-icon leaflet-pm-icon-polygon",jsClass:"Polygon",onClick:function(){},afterClick:function(){t.map.pm.Draw.Polygon.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},r={className:"control-icon leaflet-pm-icon-polyline",title:Object(i.a)("buttonTitles.drawLineButton"),jsClass:"Line",onClick:function(){},afterClick:function(){t.map.pm.Draw.Line.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["finish","removeLastVertex","cancel"]},a={title:Object(i.a)("buttonTitles.drawCircleButton"),className:"control-icon leaflet-pm-icon-circle",jsClass:"Circle",onClick:function(){},afterClick:function(){t.map.pm.Draw.Circle.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},o={title:Object(i.a)("buttonTitles.drawCircleMarkerButton"),className:"control-icon leaflet-pm-icon-circle-marker",jsClass:"CircleMarker",onClick:function(){},afterClick:function(){t.map.pm.Draw.CircleMarker.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},s={title:Object(i.a)("buttonTitles.drawRectButton"),className:"control-icon leaflet-pm-icon-rectangle",jsClass:"Rectangle",onClick:function(){},afterClick:function(){t.map.pm.Draw.Rectangle.toggle()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,actions:["cancel"]},l={title:Object(i.a)("buttonTitles.editButton"),className:"control-icon leaflet-pm-icon-edit",onClick:function(){},afterClick:function(){t.map.pm.toggleGlobalEditMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["cancel"]},u={title:Object(i.a)("buttonTitles.dragButton"),className:"control-icon leaflet-pm-icon-drag",onClick:function(){},afterClick:function(){t.map.pm.toggleGlobalDragMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["cancel"]},c={title:Object(i.a)("buttonTitles.cutButton"),className:"control-icon leaflet-pm-icon-cut",jsClass:"Cut",onClick:function(){},afterClick:function(){t.map.pm.Draw.Cut.toggle({snappable:!0,cursorMarker:!0,allowSelfIntersection:!1})},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["finish","removeLastVertex","cancel"]},h={title:Object(i.a)("buttonTitles.deleteButton"),className:"control-icon leaflet-pm-icon-delete",onClick:function(){},afterClick:function(){t.map.pm.toggleGlobalRemovalMode()},doToggle:!0,toggleStatus:!1,disableOtherButtons:!0,position:this.options.position,tool:"edit",actions:["cancel"]};this._addButton("drawMarker",new L.Control.PMButton(e)),this._addButton("drawPolyline",new L.Control.PMButton(r)),this._addButton("drawRectangle",new L.Control.PMButton(s)),this._addButton("drawPolygon",new L.Control.PMButton(n)),this._addButton("drawCircle",new L.Control.PMButton(a)),this._addButton("drawCircleMarker",new L.Control.PMButton(o)),this._addButton("editMode",new L.Control.PMButton(l)),this._addButton("dragMode",new L.Control.PMButton(u)),this._addButton("cutPolygon",new L.Control.PMButton(c)),this._addButton("removalMode",new L.Control.PMButton(h))},_showHideButtons:function(){this.removeControls();var t=this.getButtons();for(var e in t)this.options[e]&&(t[e].setPosition(this.options.position),t[e].addTo(this.map))}});e.a=a},function(t,e,n){"use strict";var r=n(0),i=L.Control.extend({options:{position:"topleft"},initialize:function(t){this._button=L.Util.setOptions(this,t)},onAdd:function(t){return this._map=t,this._container="edit"===this._button.tool?this._map.pm.Toolbar.editContainer:this._map.pm.Toolbar.drawContainer,this.buttonsDomNode=this._makeButton(this._button),this._container.appendChild(this.buttonsDomNode),this._container},onRemove:function(){return this.buttonsDomNode.remove(),this._container},getText:function(){return this._button.text},getIconUrl:function(){return this._button.iconUrl},destroy:function(){this._button={},this._update()},toggle:function(t){return this._button.toggleStatus="boolean"==typeof t?t:!this._button.toggleStatus,this._applyStyleClasses(),this._button.toggleStatus},toggled:function(){return this._button.toggleStatus},onCreate:function(){this.toggle(!1)},_triggerClick:function(t){this._button.onClick(t),this._clicked(t),this._button.afterClick(t)},_makeButton:function(t){var e=this,n=L.DomUtil.create("div","button-container",this._container),i=L.DomUtil.create("a","leaflet-buttons-control-button",n),a=L.DomUtil.create("div","leaflet-pm-actions-container",n),o=t.actions,s={cancel:{text:Object(r.a)("actions.cancel"),onClick:function(){this._triggerClick()}},removeLastVertex:{text:Object(r.a)("actions.removeLastVertex"),onClick:function(){this._map.pm.Draw[t.jsClass]._removeLastVertex()}},finish:{text:Object(r.a)("actions.finish"),onClick:function(e){this._map.pm.Draw[t.jsClass]._finishShape(e)}}};o.forEach(function(t){var n=s[t],r=L.DomUtil.create("a","leaflet-pm-action action-".concat(t),a);r.innerHTML=n.text,L.DomEvent.addListener(r,"click",n.onClick,e),L.DomEvent.disableClickPropagation(r)}),t.toggleStatus&&L.DomUtil.addClass(i,"active");var l=L.DomUtil.create("div","control-icon",i);return t.title&&l.setAttribute("title",t.title),t.iconUrl&&l.setAttribute("src",t.iconUrl),t.className&&L.DomUtil.addClass(l,t.className),L.DomEvent.addListener(i,"click",function(){e._button.disableOtherButtons&&e._map.pm.Toolbar.triggerClickOnToggledButtons(e)}),L.DomEvent.addListener(i,"click",this._triggerClick,this),L.DomEvent.disableClickPropagation(i),n},_applyStyleClasses:function(){this._container&&(this._button.toggleStatus?L.DomUtil.addClass(this.buttonsDomNode,"active"):L.DomUtil.removeClass(this.buttonsDomNode,"active"))},_clicked:function(){this._button.doToggle&&this.toggle()}});e.a=i},function(t,e,n){var r=n(38),i=n(39);t.exports=function(t,e){for(var n=0,a=(e=r(e,t)).length;null!=t&&n0},_syncHintLine:function(){var t=this._layer.getLatLngs();if(t.length>0){var e=t[t.length-1];this._hintline.setLatLngs([e,this._hintMarker.getLatLng()])}},_syncHintMarker:function(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){var e=t;e.target=this._hintMarker,this._handleSnapping(e)}this.options.allowSelfIntersection||this._handleSelfIntersection(!0,t.latlng)},_handleSelfIntersection:function(t,e){var n=L.polyline(this._layer.getLatLngs());t&&(e||(e=this._hintMarker.getLatLng()),n.addLatLng(e));var r=i()(n.toGeoJSON(15));this._doesSelfIntersect=r.features.length>0,this._doesSelfIntersect?this._hintline.setStyle({color:"red"}):this._hintline.setStyle(this.options.hintlineStyle)},_removeLastVertex:function(){var t=this._layer.getLatLngs(),e=t.pop();if(t.length<1)this.disable();else{var n=this._layerGroup.getLayers().filter(function(t){return t instanceof L.Marker}).filter(function(t){return!L.DomUtil.hasClass(t._icon,"cursor-marker")}).find(function(t){return t.getLatLng()===e});this._layerGroup.removeLayer(n),this._layer.setLatLngs(t),this._syncHintLine()}},_createVertex:function(t){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!0,t.latlng),!this._doesSelfIntersect)){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng();if(e.equals(this._layer.getLatLngs()[0]))this._finishShape(t);else{var n=0===this._layer.getLatLngs().length;this._layer.addLatLng(e);var r=this._createMarker(e,n);this._hintline.setLatLngs([e,e]),this._layer.fire("pm:vertexadded",{shape:this._shape,workingLayer:this._layer,marker:r,latlng:e})}}},_finishShape:function(){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!1),!this._doesSelfIntersect)){var t=this._layer.getLatLngs();if(!(t.length<=1)){var e=L.polyline(t,this.options.pathOptions).addTo(this._map);this.disable(),this._map.fire("pm:create",{shape:this._shape,layer:e}),this.options.snappable&&this._cleanupSnapping()}}},_createMarker:function(t,e){var n=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return n._pmTempLayer=!0,this._layerGroup.addLayer(n),n.on("click",this._finishShape,this),e&&this._hintMarker.setTooltipContent(Object(o.a)("tooltips.continueLine")),2===this._layer.getLatLngs().length&&this._hintMarker.setTooltipContent(Object(o.a)("tooltips.finishLine")),n}})},function(t,e,n){"use strict";var r=n(1),i=n(0);r.a.Polygon=r.a.Line.extend({initialize:function(t){this._map=t,this._shape="Polygon",this.toolbarButtonName="drawPolygon"},_finishShape:function(t){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!1),!this._doesSelfIntersect)){var e=this._layer.getLatLngs();if(console.log(e),!(e.length<=2)){t&&"dblclick"===t.type&&e.splice(e.length-1,1);var n=L.polygon(e,this.options.pathOptions).addTo(this._map);this.disable(),this._map.fire("pm:create",{shape:this._shape,layer:n}),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex}}},_createMarker:function(t,e){var n=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return n._pmTempLayer=!0,this._layerGroup.addLayer(n),e&&(n.on("click",this._finishShape,this),this._tempSnapLayerIndex=this._otherSnapLayers.push(n)-1,this.options.snappable&&this._cleanupSnapping()),e&&this._hintMarker.setTooltipContent(Object(i.a)("tooltips.continueLine")),3===this._layer.getLatLngs().length&&this._hintMarker.setTooltipContent(Object(i.a)("tooltips.finishPoly")),n}})},function(t,e,n){"use strict";var r=n(1),i=n(0);r.a.Rectangle=r.a.extend({initialize:function(t){this._map=t,this._shape="Rectangle",this.toolbarButtonName="drawRectangle"},enable:function(t){if(L.Util.setOptions(this,t),this._enabled=!0,this._layerGroup=new L.LayerGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.rectangle([[0,0],[0,0]],this.options.pathOptions),this._layer._pmTempLayer=!0,this._startMarker=L.marker([0,0],{icon:L.divIcon({className:"marker-icon rect-start-marker"}),draggable:!0,zIndexOffset:100,opacity:this.options.cursorMarker?1:0}),this._startMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._startMarker),this._hintMarker=L.marker([0,0],{icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.tooltips&&this._hintMarker.bindTooltip(Object(i.a)("tooltips.firstVertex"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this.options.cursorMarker){L.DomUtil.addClass(this._hintMarker._icon,"visible"),this._styleMarkers=[];for(var e=0;e<2;e+=1){var n=L.marker([0,0],{icon:L.divIcon({className:"marker-icon rect-style-marker"}),draggable:!0,zIndexOffset:100});n._pmTempLayer=!0,this._layerGroup.addLayer(n),this._styleMarkers.push(n)}}this._map._container.style.cursor="crosshair",this._map.on("click",this._placeStartingMarkers,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.fire("pm:drawstart",{shape:this._shape,workingLayer:this._layer}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[]},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeStartingMarkers,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.fire("pm:drawend",{shape:this._shape}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping())},enabled:function(){return this._enabled},toggle:function(t){this.enabled()?this.disable():this.enable(t)},_placeStartingMarkers:function(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng();L.DomUtil.addClass(this._startMarker._icon,"visible"),this._startMarker.setLatLng(e),this.options.cursorMarker&&this._styleMarkers&&this._styleMarkers.forEach(function(t){L.DomUtil.addClass(t._icon,"visible"),t.setLatLng(e)}),this._map.off("click",this._placeStartingMarkers,this),this._map.on("click",this._finishShape,this),this._hintMarker.setTooltipContent(Object(i.a)("tooltips.finishRect")),this._setRectangleOrigin()},_setRectangleOrigin:function(){var t=this._startMarker.getLatLng();t&&(this._layerGroup.addLayer(this._layer),this._layer.setLatLngs([t,t]),this._hintMarker.on("move",this._syncRectangleSize,this))},_syncHintMarker:function(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){var e=t;e.target=this._hintMarker,this._handleSnapping(e)}},_syncRectangleSize:function(){var t=this,e=this._startMarker.getLatLng(),n=this._hintMarker.getLatLng();if(this._layer.setBounds([e,n]),this.options.cursorMarker&&this._styleMarkers){var r=[];this._findCorners().forEach(function(e){e.equals(t._startMarker.getLatLng())||e.equals(t._hintMarker.getLatLng())||r.push(e)}),r.forEach(function(e,n){t._styleMarkers[n].setLatLng(e)})}},_finishShape:function(t){var e=this._startMarker.getLatLng(),n=t.latlng,r=L.rectangle([e,n],this.options.pathOptions).addTo(this._map);this.disable(),this._map.fire("pm:create",{shape:this._shape,layer:r})},_findCorners:function(){var t=this._layer.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]}})},function(t,e,n){"use strict";var r=n(1),i=n(0);r.a.Circle=r.a.extend({initialize:function(t){this._map=t,this._shape="Circle",this.toolbarButtonName="drawCircle"},enable:function(t){L.Util.setOptions(this,t),this.options.radius=0,this._enabled=!0,this._layerGroup=new L.LayerGroup,this._layerGroup._pmTempLayer=!0,this._layerGroup.addTo(this._map),this._layer=L.circle([0,0],this.options.templineStyle),this._layer._pmTempLayer=!0,this._layerGroup.addLayer(this._layer),this._centerMarker=L.marker([0,0],{icon:L.divIcon({className:"marker-icon"}),draggable:!1,zIndexOffset:100}),this._centerMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._centerMarker),this._hintMarker=L.marker([0,0],{icon:L.divIcon({className:"marker-icon cursor-marker"})}),this._hintMarker._pmTempLayer=!0,this._layerGroup.addLayer(this._hintMarker),this.options.cursorMarker&&L.DomUtil.addClass(this._hintMarker._icon,"visible"),this.options.tooltips&&this._hintMarker.bindTooltip(Object(i.a)("tooltips.startCircle"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._hintline=L.polyline([],this.options.hintlineStyle),this._hintline._pmTempLayer=!0,this._layerGroup.addLayer(this._hintline),this._map._container.style.cursor="crosshair",this._map.on("click",this._placeCenterMarker,this),this._map.on("mousemove",this._syncHintMarker,this),this._map.fire("pm:drawstart",{shape:this._shape,workingLayer:this._layer}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._otherSnapLayers=[]},disable:function(){this._enabled&&(this._enabled=!1,this._map._container.style.cursor="",this._map.off("click",this._finishShape,this),this._map.off("click",this._placeCenterMarker,this),this._map.off("mousemove",this._syncHintMarker,this),this._map.removeLayer(this._layerGroup),this._map.fire("pm:drawend",{shape:this._shape}),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!1),this.options.snappable&&this._cleanupSnapping())},enabled:function(){return this._enabled},toggle:function(t){this.enabled()?this.disable():this.enable(t)},_syncHintLine:function(){var t=this._centerMarker.getLatLng();this._hintline.setLatLngs([t,this._hintMarker.getLatLng()])},_syncCircleRadius:function(){var t=this._centerMarker.getLatLng(),e=this._hintMarker.getLatLng(),n=t.distanceTo(e);this._layer.setRadius(n)},_syncHintMarker:function(t){if(this._hintMarker.setLatLng(t.latlng),this.options.snappable){var e=t;e.target=this._hintMarker,this._handleSnapping(e)}},_placeCenterMarker:function(t){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng();this._centerMarker.setLatLng(e),this._map.off("click",this._placeCenterMarker,this),this._map.on("click",this._finishShape,this),this._placeCircleCenter()},_placeCircleCenter:function(){var t=this._centerMarker.getLatLng();t&&(this._layer.setLatLng(t),this._hintMarker.on("move",this._syncHintLine,this),this._hintMarker.on("move",this._syncCircleRadius,this),this._hintMarker.setTooltipContent(Object(i.a)("tooltips.finishCircle")),this._layer.fire("pm:centerplaced",{shape:this._shape,workingLayer:this._layer,latlng:t}))},_finishShape:function(t){var e=this._centerMarker.getLatLng(),n=t.latlng,r=e.distanceTo(n),i=Object.assign({},this.options.pathOptions,{radius:r}),a=L.circle(e,i).addTo(this._map);this.disable(),this._map.fire("pm:create",{shape:this._shape,layer:a})},_createMarker:function(t){var e=new L.Marker(t,{draggable:!1,icon:L.divIcon({className:"marker-icon"})});return e._pmTempLayer=!0,this._layerGroup.addLayer(e),e}})},function(t,e,n){"use strict";var r=n(1),i=n(0);r.a.CircleMarker=r.a.Marker.extend({initialize:function(t){this._map=t,this._shape="CircleMarker",this.toolbarButtonName="drawCircleMarker"},enable:function(t){var e=this;L.Util.setOptions(this,t),this._enabled=!0,this._map.on("click",this._createMarker,this),this._map.pm.Toolbar.toggleButton(this.toolbarButtonName,!0),this._hintMarker=L.circleMarker([0,0],this.options.templineStyle),this._hintMarker._pmTempLayer=!0,this._hintMarker.addTo(this._map),this.options.tooltips&&this._hintMarker.bindTooltip(Object(i.a)("tooltips.placeCircleMarker"),{permanent:!0,offset:L.point(0,10),direction:"bottom",opacity:.8}).openTooltip(),this._layer=this._hintMarker,this._map.on("mousemove",this._syncHintMarker,this),this._map.fire("pm:drawstart",{shape:this._shape,workingLayer:this._layer}),this._map.eachLayer(function(t){e.isRelevantMarker(t)&&t.pm.enable()})},isRelevantMarker:function(t){return t instanceof L.CircleMarker&&!(t instanceof L.Circle)&&t.pm&&!t._pmTempLayer},_createMarker:function(t){if(t.latlng){this._hintMarker._snapped||this._hintMarker.setLatLng(t.latlng);var e=this._hintMarker.getLatLng(),n=L.circleMarker(e,this.options.pathOptions);n.addTo(this._map),n.pm.enable(),this._map.fire("pm:create",{shape:this._shape,marker:n,layer:n}),this._cleanupSnapping()}}})},function(t,e,n){"use strict";var r=n(148),i=n.n(r),a=n(149),o=n(1);o.a.Cut=o.a.Polygon.extend({initialize:function(t){this._map=t,this._shape="Cut",this.toolbarButtonName="cutPolygon"},_cut:function(t){var e=this,n=this._map._layers;Object.keys(n).map(function(t){return n[t]}).filter(function(t){return t.pm}).filter(function(t){return t instanceof L.Polygon}).filter(function(e){return e!==t}).filter(function(e){try{return!!i()(t.toGeoJSON(15),e.toGeoJSON(15))}catch(n){return console.error("You cant cut polygons with self-intersections"),!1}}).forEach(function(n){var r=Object(a.a)(n.toGeoJSON(15),t.toGeoJSON(15)),i=L.geoJSON(r,n.options).addTo(e._map);i.addTo(e._map),i.pm.enable(e.options),i.pm.disable(),n.fire("pm:cut",{shape:e._shape,layer:i,originalLayer:n}),e._map.fire("pm:cut",{shape:e._shape,layer:i,originalLayer:n}),n._pmTempLayer=!0,t._pmTempLayer=!0,n.remove(),t.remove(),0===i.getLayers().length&&e._map.pm.removeLayer({target:i})})},_finishShape:function(){if(this.options.allowSelfIntersection||(this._handleSelfIntersection(!1),!this._doesSelfIntersect)){var t=this._layer.getLatLngs(),e=L.polygon(t,this.options.pathOptions);this._cut(e),this.disable(),this._cleanupSnapping(),this._otherSnapLayers.splice(this._tempSnapLayerIndex,1),delete this._tempSnapLayerIndex}}})},function(t,e,n){"use strict";var r=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e};Object.defineProperty(e,"__esModule",{value:!0});var i=n(8),a=n(43),o=r(n(44));e["default"]=function s(t,e,n){void 0===n&&(n={});var r=a.getGeom(t),l=a.getGeom(e);if("Polygon"===r.type&&"Polygon"===l.type){var u=o.intersection(r.coordinates,l.coordinates);if(null===u||0===u.length)return null;if(1===u.length){var c=u[0][0][0],h=u[0][0][u[0][0].length-1];return c[0]===h[0]&&c[1]===h[1]?i.polygon(u[0],n.properties):null}return i.multiPolygon(u,n.properties)}if("MultiPolygon"===r.type){for(var p=[],f=0,d=r.coordinates;f1?t:null;case"MultiPolygon":var e=[];if(Object(l.flattenEach)(t,function(t){a()(t)>1&&e.push(t.geometry.coordinates)}),e.length)return{type:"MultiPolygon",coordinates:e}}}e.a=function(t,e){var n=Object(s.getGeom)(t),i=Object(s.getGeom)(e),a=t.properties||{};if(n=u(n),i=u(i),!n)return null;if(!i)return Object(o.feature)(n,a);var l=r.diff(n.coordinates,i.coordinates);return 0===l.length?null:1===l.length?Object(o.polygon)(l[0],a):Object(o.multiPolygon)(l,a)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),i=6378137;function a(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var n=1;n2){for(l=0;l0||(this._safeToCacheDragState&&(this._originalMapDragState=this._layer._map.dragging._enabled,this._safeToCacheDragState=!1),this._tempDragCoord=t.latlng,this._layer._map.on("mouseup",this._dragMixinOnMouseUp,this),this._layer._map.on("mousemove",this._dragMixinOnMouseMove,this))},dragging:function(){return this._dragging},_onLayerDrag:function(t){var e=t.latlng,n=e.lat-this._tempDragCoord.lat,r=e.lng-this._tempDragCoord.lng;if(this._layer instanceof L.CircleMarker)this._layer.setLatLng(e);else{var i=function t(e){return e.map(function(e){return Array.isArray(e)?t(e):{lat:e.lat+n,lng:e.lng+r}})}(this._layer.getLatLngs());this._layer.setLatLngs(i)}this._tempDragCoord=e,this._layer.fire("pm:drag",t)}};e.a=r},function(t,e,n){"use strict";n(2).a.LayerGroup=L.Class.extend({initialize:function(t){var e=this;this._layerGroup=t,this._layers=this.findLayers(),this._layers.forEach(function(t){return e._initLayer(t)}),this._layerGroup.on("layeradd",function(t){t.target._pmTempLayer||(e._layers=e.findLayers(),t.layer.pm&&e._initLayer(t.layer),t.target.pm.enabled()&&e.enable(e.getOptions()))})},findLayers:function(){var t=this._layerGroup.getLayers();return t=(t=(t=t.filter(function(t){return!(t instanceof L.LayerGroup)})).filter(function(t){return!!t.pm})).filter(function(t){return!t._pmTempLayer})},_initLayer:function(t){var e=this;["pm:edit","pm:update","pm:remove","pm:dragstart","pm:drag","pm:dragend","pm:snap","pm:unsnap","pm:cut","pm:intersect","pm:raiseMarkers","pm:markerdragend","pm:markerdragstart","pm:vertexadded","pm:vertexremoved","pm:centerplaced"].forEach(function(n){t.on(n,e._fireEvent,e)}),t.pm._layerGroup=this._layerGroup},_fireEvent:function(t){this._layerGroup.fireEvent(t.type,t)},toggleEdit:function(t){this._options=t,this._layers.forEach(function(e){e.pm.toggleEdit(t)})},enable:function(t){this._options=t,this._layers.forEach(function(e){e.pm.enable(t)})},disable:function(){this._layers.forEach(function(t){t.pm.disable()})},enabled:function(){var t=this._layers.find(function(t){return t.pm.enabled()});return!!t},dragging:function(){var t=this._layers.find(function(t){return t.pm.dragging()});return!!t},getOptions:function(){return this._options}})},function(t,e,n){"use strict";var r=n(2);r.a.Marker=r.a.extend({initialize:function(t){this._layer=t,this._enabled=!1,this._layer.on("dragend",this._onDragEnd,this)},toggleEdit:function(t){this.enabled()?this.disable():this.enable(t)},enable:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,t),this._map=this._layer._map,this.enabled()||(this._enabled=!0,this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this),this.options.draggable&&this._layer.dragging.enable(),this.options.snappable&&this._initSnappableMarkers())},enabled:function(){return this._enabled},disable:function(){this._enabled=!1,this._layer.dragging&&this._layer.dragging.disable(),this._layer.off("contextmenu",this._removeMarker,this),this._layerEdited&&this._layer.fire("pm:update",{}),this._layerEdited=!1},_removeMarker:function(t){var e=t.target;e.remove(),e.fire("pm:remove")},_onDragEnd:function(t){t.target.fire("pm:edit"),this._layerEdited=!0},_initSnappableMarkers:function(){var t=this._layer;this.options.snapDistance=this.options.snapDistance||30,t.off("drag",this._handleSnapping,this),t.on("drag",this._handleSnapping,this),t.off("dragend",this._cleanupSnapping,this),t.on("dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)}})},function(t,e,n){"use strict";var r=n(42),i=n.n(r),a=n(37),o=n.n(a),s=n(2),l=n(41),u=n(0);s.a.Line=s.a.extend({initialize:function(t){this._layer=t,this._enabled=!1},toggleEdit:function(t){return this.enabled()?this.disable():this.enable(t),this.enabled()},enable:function(t){L.Util.setOptions(this,t),this._map=this._layer._map,this._map&&(this.enabled()||this.disable(),this._enabled=!0,this._initMarkers(),this._layer.on("remove",this._onLayerRemove,this),this.options.allowSelfIntersection||this._layer.on("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval,this),this.options.allowSelfIntersection||(this.cachedColor||(this.cachedColor=this._layer.options.color),this.isRed=!1,this._handleLayerStyle()))},_onLayerRemove:function(t){this.disable(t.target)},enabled:function(){return this._enabled},disable:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this._layer;if(!this.enabled())return!1;if(t.pm._dragging)return!1;t.pm._enabled=!1,t.pm._markerGroup.clearLayers(),t.off("mousedown"),t.off("mouseup"),this._layer.off("remove",this._onLayerRemove,this),this.options.allowSelfIntersection||this._layer.off("pm:vertexremoved",this._handleSelfIntersectionOnVertexRemoval);var e=t._path?t._path:this._layer._renderer._container;return L.DomUtil.removeClass(e,"leaflet-pm-draggable"),this.hasSelfIntersection()&&L.DomUtil.removeClass(e,"leaflet-pm-invalid"),this._layerEdited&&this._layer.fire("pm:update",{}),this._layerEdited=!1,!0},hasSelfIntersection:function(){return i()(this._layer.toGeoJSON(15)).features.length>0},_handleSelfIntersectionOnVertexRemoval:function(){this._handleLayerStyle(!0),this.hasSelfIntersection()&&(this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers())},_handleLayerStyle:function(t){var e=this,n=this._layer;if(this.hasSelfIntersection()){if(this.isRed)return;t?(n.setStyle({color:"red"}),this.isRed=!0,window.setTimeout(function(){n.setStyle({color:e.cachedColor}),e.isRed=!1},200)):(n.setStyle({color:"red"}),this.isRed=!0),this._layer.fire("pm:intersect",{intersection:i()(this._layer.toGeoJSON(15))})}else n.setStyle({color:this.cachedColor}),this.isRed=!1},_initMarkers:function(){var t=this,e=this._map,n=this._layer.getLatLngs();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.LayerGroup,this._markerGroup._pmTempLayer=!0,e.addLayer(this._markerGroup);this._markers=function r(e){if(Array.isArray(e[0]))return e.map(r,t);var n=e.map(t._createMarker,t);return e.map(function(r,i){var a=t.isPolygon()?(i+1)%e.length:i+1;return t._createMiddleMarker(n[i],n[a])}),n}(n),this.options.snappable&&this._initSnappableMarkers()},_createMarker:function(t){var e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return e._pmTempLayer=!0,e.on("dragstart",this._onMarkerDragStart,this),e.on("move",this._onMarkerDrag,this),e.on("dragend",this._onMarkerDragEnd,this),this.options.preventMarkerRemoval||e.on("contextmenu",this._removeMarker,this),this._markerGroup.addLayer(e),e},_createMiddleMarker:function(t,e){var n=this;if(!t||!e)return!1;var r=l.a.calcMiddleLatLng(this._map,t.getLatLng(),e.getLatLng()),i=this._createMarker(r),a=L.divIcon({className:"marker-icon marker-icon-middle"});return i.setIcon(a),t._middleMarkerNext=i,e._middleMarkerPrev=i,i.on("click",function(){var r=L.divIcon({className:"marker-icon"});i.setIcon(r),n._addMarker(i,t,e)}),i.on("movestart",function(){i.on("moveend",function(){var t=L.divIcon({className:"marker-icon"});i.setIcon(t),i.off("moveend")}),n._addMarker(i,t,e)}),i},_addMarker:function(t,e,n){t.off("movestart"),t.off("click");var r=t.getLatLng(),i=this._layer._latlngs,a=this.findDeepMarkerIndex(this._markers,e),s=a.indexPath,l=a.index,u=a.parentPath,c=s.length>1?o()(i,u):i,h=s.length>1?o()(this._markers,u):this._markers;c.splice(l+1,0,r),h.splice(l+1,0,t),this._layer.setLatLngs(i),this._createMiddleMarker(e,t),this._createMiddleMarker(t,n),this._fireEdit(),this._layer.fire("pm:vertexadded",{layer:this._layer,marker:t,indexPath:this.findDeepMarkerIndex(this._markers,t).indexPath,latlng:r}),this.options.snappable&&this._initSnappableMarkers()},_removeMarker:function(t){if(!this.options.allowSelfIntersection){var e=this._layer.getLatLngs();this._coordsBeforeEdit=JSON.parse(JSON.stringify(e))}var n=t.target,r=this._layer.getLatLngs(),i=this.findDeepMarkerIndex(this._markers,n),a=i.indexPath,s=i.index,l=i.parentPath;if(a){var c,h,p=a.length>1?o()(r,l):r,f=a.length>1?o()(this._markers,l):this._markers;if(p.splice(s,1),this._layer.setLatLngs(r),p.length<=1&&(p.splice(0,p.length),this._layer.setLatLngs(r),this.disable(),this.enable(this.options)),Object(u.b)(r)&&this._layer.remove(),n._middleMarkerPrev&&this._markerGroup.removeLayer(n._middleMarkerPrev),n._middleMarkerNext&&this._markerGroup.removeLayer(n._middleMarkerNext),this._markerGroup.removeLayer(n),this.isPolygon()?(c=(s+1)%f.length,h=(s+(f.length-1))%f.length):(h=s-1<0?undefined:s-1,c=s+1>=f.length?undefined:s+1),c!==h){var d=f[h],g=f[c];this._createMiddleMarker(d,g)}f.splice(s,1),this._fireEdit(),this._layer.fire("pm:vertexremoved",{layer:this._layer,marker:n,indexPath:a})}},findDeepMarkerIndex:function(t,e){var n;t.some(function i(t){return function(r,a){var o=t.concat(a);return r._leaflet_id===e._leaflet_id?(n=o,!0):Array.isArray(r)&&r.some(i(o))}}([]));var r={};return n&&(r={indexPath:n,index:n[n.length-1],parentPath:n.slice(0,n.length-1)}),r},updatePolygonCoordsFromMarkerDrag:function(t){var e=this._layer.getLatLngs(),n=t.getLatLng(),r=this.findDeepMarkerIndex(this._markers,t),i=r.indexPath,a=r.index,s=r.parentPath;(i.length>1?o()(e,s):e).splice(a,1,n),this._layer.setLatLngs(e)},_onMarkerDrag:function(t){var e=t.target,n=this.findDeepMarkerIndex(this._markers,e),r=n.indexPath,i=n.index,a=n.parentPath;if(r){this.updatePolygonCoordsFromMarkerDrag(e);var s=r.length>1?o()(this._markers,a):this._markers,u=(i+1)%s.length,c=(i+(s.length-1))%s.length,h=e.getLatLng(),p=s[c].getLatLng(),f=s[u].getLatLng();if(e._middleMarkerNext){var d=l.a.calcMiddleLatLng(this._map,h,f);e._middleMarkerNext.setLatLng(d)}if(e._middleMarkerPrev){var g=l.a.calcMiddleLatLng(this._map,h,p);e._middleMarkerPrev.setLatLng(g)}this.options.allowSelfIntersection||this._handleLayerStyle()}},_onMarkerDragEnd:function(t){var e=t.target,n=this.findDeepMarkerIndex(this._markers,e).indexPath;if(!this.options.allowSelfIntersection&&this.hasSelfIntersection())return this._layer.setLatLngs(this._coordsBeforeEdit),this._coordsBeforeEdit=null,this._initMarkers(),void this._handleLayerStyle();this._layer.fire("pm:markerdragend",{markerEvent:t,indexPath:n}),this._fireEdit()},_onMarkerDragStart:function(t){var e=t.target,n=this.findDeepMarkerIndex(this._markers,e).indexPath;this._layer.fire("pm:markerdragstart",{markerEvent:t,indexPath:n}),this.options.allowSelfIntersection||(this._coordsBeforeEdit=this._layer.getLatLngs())},_fireEdit:function(){this._layerEdited=!0,this._layer.fire("pm:edit")}})},function(t,e,n){"use strict";var r=n(2);r.a.Polygon=r.a.Line.extend({})},function(t,e,n){"use strict";var r=n(2);function i(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,i=!1,a=undefined;try{for(var o,s=t[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!e||n.length!==e);r=!0);}catch(l){i=!0,a=l}finally{try{r||null==s["return"]||s["return"]()}finally{if(i)throw a}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}r.a.Rectangle=r.a.Polygon.extend({_initMarkers:function(){var t=this._map,e=this._findCorners();this._markerGroup&&this._markerGroup.clearLayers(),this._markerGroup=new L.LayerGroup,this._markerGroup._pmTempLayer=!0,t.addLayer(this._markerGroup),this._markers=[],this._markers[0]=e.map(this._createMarker,this);var n=i(this._markers,1);this._cornerMarkers=n[0],this.options.snappable&&this._initSnappableMarkers()},_createMarker:function(t,e){var n=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return n._origLatLng=t,n._index=e,n._pmTempLayer=!0,n.on("dragstart",this._onMarkerDragStart,this),n.on("drag",this._onMarkerDrag,this),n.on("dragend",this._onMarkerDragEnd,this),n.on("pm:snap",this._adjustRectangleForMarkerSnap,this),this.options.preventMarkerRemoval||n.on("contextmenu",this._removeMarker,this),this._markerGroup.addLayer(n),n},_removeMarker:function(){return null},_onMarkerDragStart:function(t){var e=t.target,n=this._findCorners();e._oppositeCornerLatLng=n[(e._index+2)%4],e._snapped=!1,this._layer.fire("pm:markerdragstart",{markerEvent:t})},_onMarkerDrag:function(t){var e=t.target;e._index!==undefined&&(e._snapped||this._adjustRectangleForMarkerMove(e))},_onMarkerDragEnd:function(t){var e=this._findCorners();this._adjustAllMarkers(e),this._cornerMarkers.forEach(function(t){delete t._oppositeCornerLatLng}),this._layer.setLatLngs(e),this._layer.fire("pm:markerdragend",{markerEvent:t}),this._fireEdit()},_adjustRectangleForMarkerMove:function(t){L.extend(t._origLatLng,t._latlng);var e=t.getLatLng();this._layer.setBounds(L.latLngBounds(e,t._oppositeCornerLatLng)),this._adjustAdjacentMarkers(t),this._layer.redraw()},_adjustRectangleForMarkerSnap:function(t){if(this.options.snappable){var e=t.target;this._adjustRectangleForMarkerMove(e)}},_adjustAllMarkers:function(t){t.length&&4===t.length?this._cornerMarkers.forEach(function(e,n){e.setLatLng(t[n])}):console.error("_adjustAllMarkers() requires an array of EXACTLY 4 LatLng coordinates")},_adjustAdjacentMarkers:function(t){if(t&&t.getLatLng&&t._oppositeCornerLatLng){var e=t.getLatLng(),n=t._oppositeCornerLatLng,r=[];this._findCorners().forEach(function(t){t.equals(e)||t.equals(n)||r.push(t)});var i=0;2===r.length&&this._cornerMarkers.forEach(function(t){var a=t.getLatLng();a.equals(e)||a.equals(n)||(t.setLatLng(r[i]),i+=1)})}else console.error("_adjustAdjacentMarkers() requires a valid Marker object")},_findCorners:function(){var t=this._layer.getBounds();return[t.getNorthWest(),t.getNorthEast(),t.getSouthEast(),t.getSouthWest()]}})},function(t,e,n){"use strict";var r=n(2);r.a.Circle=r.a.extend({initialize:function(t){this._layer=t,this._enabled=!1},toggleEdit:function(t){this.enabled()?this.disable():this.enable(t)},enabled:function(){return this._enabled},enable:function(t){var e=this;L.Util.setOptions(this,t),this._map=this._layer._map,this.enabled()||this.disable(),this._enabled=!0,this._initMarkers(),this._layer.on("remove",function(t){e.disable(t.target)})},disable:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this._layer;if(!this.enabled())return!1;if(t.pm._dragging)return!1;t.pm._enabled=!1,t.pm._helperLayers.clearLayers(),t.off("mousedown"),t.off("mouseup");var e=t._path?t._path:this._layer._renderer._container;return L.DomUtil.removeClass(e,"leaflet-pm-draggable"),this._layerEdited&&this._layer.fire("pm:update",{}),this._layerEdited=!1,!0},_initMarkers:function(){var t=this._map;this._helperLayers&&this._helperLayers.clearLayers(),this._helperLayers=new L.LayerGroup,this._helperLayers._pmTempLayer=!0,this._helperLayers.addTo(t);var e=this._layer.getLatLng(),n=this._layer._radius,r=this._getLatLngOnCircle(e,n);this._centerMarker=this._createCenterMarker(e),this._outerMarker=this._createOuterMarker(r),this._markers=[this._centerMarker,this._outerMarker],this._createHintLine(this._centerMarker,this._outerMarker),this.options.snappable&&this._initSnappableMarkers()},_getLatLngOnCircle:function(t,e){var n=this._map.project(t),r=L.point(n.x+e,n.y);return this._map.unproject(r)},_resizeCircle:function(){this._syncHintLine(),this._syncCircleRadius()},_moveCircle:function(t){var e=t.latlng;this._layer.setLatLng(e);var n=this._layer._radius,r=this._getLatLngOnCircle(e,n);this._outerMarker.setLatLng(r),this._syncHintLine(),this._layer.fire("pm:centerplaced",{layer:this._layer,latlng:e})},_onMarkerDragStart:function(t){this._layer.fire("pm:markerdragstart",{markerEvent:t})},_onMarkerDragEnd:function(t){this._fireEdit(),this._layer.fire("pm:markerdragend",{markerEvent:t})},_syncCircleRadius:function(){var t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng(),n=t.distanceTo(e);this._layer.setRadius(n)},_syncHintLine:function(){var t=this._centerMarker.getLatLng(),e=this._outerMarker.getLatLng();this._hintline.setLatLngs([t,e])},_createHintLine:function(t,e){var n=t.getLatLng(),r=e.getLatLng();this._hintline=L.polyline([n,r],this.options.hintlineStyle),this._hintline._pmTempLayer=!0,this._helperLayers.addLayer(this._hintline)},_createCenterMarker:function(t){var e=this._createMarker(t);return L.DomUtil.addClass(e._icon,"leaflet-pm-draggable"),e.on("drag",this._moveCircle,this),e},_createOuterMarker:function(t){var e=this._createMarker(t);return e.on("drag",this._resizeCircle,this),e},_createMarker:function(t){var e=new L.Marker(t,{draggable:!0,icon:L.divIcon({className:"marker-icon"})});return e._origLatLng=t,e._pmTempLayer=!0,e.on("dragstart",this._onMarkerDragStart,this),e.on("dragend",this._onMarkerDragEnd,this),this._helperLayers.addLayer(e),e},_fireEdit:function(){this._layer.fire("pm:edit"),this._layerEdited=!0}})},function(t,e,n){"use strict";var r=n(2);r.a.CircleMarker=r.a.extend({initialize:function(t){this._layer=t,this._enabled=!1},toggleEdit:function(t){this.enabled()?this.disable():this.enable(t)},enabled:function(){return this._enabled},enable:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{draggable:!0,snappable:!0};L.Util.setOptions(this,t),this._map=this._layer._map,this._map&&(this.enabled()||this.disable(),this._enabled=!0,this.options.preventMarkerRemoval||this._layer.on("contextmenu",this._removeMarker,this),this.options.draggable&&this.enableLayerDrag(),this.options.snappable&&this._initSnappableMarkers(),this._layer.on("pm:dragend",this._onMarkerDragEnd,this))},disable:function(){var t=arguments.length>0&&arguments[0]!==undefined?arguments[0]:this._layer;if(!this.enabled())return!1;if(t.pm._dragging)return!1;if(t.pm._enabled=!1,t._path){var e=t._path;L.DomUtil.removeClass(e,"leaflet-pm-draggable")}return this._layerEdited&&this._layer.fire("pm:update",{}),this._layerEdited=!1,!0},_moveMarker:function(t){var e=t.latlng;this._layer.setLatLng(e).redraw()},_removeMarker:function(){this._layer.fire("pm:remove"),this._layer.remove()},_fireEdit:function(){this._layer.fire("pm:edit"),this._layerEdited=!0},_onMarkerDragEnd:function(t){this._layer.fire("pm:markerdragend",{markerEvent:t}),this._fireEdit()},_initSnappableMarkers:function(){var t=this._layer;this.options.snapDistance=this.options.snapDistance||30,t.off("pm:drag",this._handleSnapping,this),t.on("pm:drag",this._handleSnapping,this),t.off("pm:dragend",this._cleanupSnapping,this),t.on("pm:dragend",this._cleanupSnapping,this),t.off("pm:dragstart",this._unsnap,this),t.on("pm:dragstart",this._unsnap,this)}})},function(t,e){},function(t,e){}]);