@mapcomponents/react-maplibre 0.1.46 → 0.1.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (157) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/coverage/clover.xml +14 -10
  3. package/coverage/coverage-final.json +1 -1
  4. package/coverage/lcov-report/index.html +17 -17
  5. package/coverage/lcov-report/src/components/MapLibreMap/MapLibreMap.tsx.html +1 -1
  6. package/coverage/lcov-report/src/components/MapLibreMap/index.html +1 -1
  7. package/coverage/lcov-report/src/components/MlCreatePdfButton/MlCreatePdfButton.tsx.html +1 -1
  8. package/coverage/lcov-report/src/components/MlCreatePdfButton/index.html +1 -1
  9. package/coverage/lcov-report/src/components/MlFeatureEditor/MlFeatureEditor.tsx.html +4 -4
  10. package/coverage/lcov-report/src/components/MlFeatureEditor/index.html +1 -1
  11. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/MlFillExtrusionLayer.tsx.html +1 -1
  12. package/coverage/lcov-report/src/components/MlFillExtrusionLayer/index.html +1 -1
  13. package/coverage/lcov-report/src/components/MlFollowGps/MlFollowGps.tsx.html +1 -1
  14. package/coverage/lcov-report/src/components/MlFollowGps/index.html +1 -1
  15. package/coverage/lcov-report/src/components/MlGPXViewer/MlGPXViewer.tsx.html +1 -1
  16. package/coverage/lcov-report/src/components/MlGPXViewer/gpxConverter.js.html +1 -1
  17. package/coverage/lcov-report/src/components/MlGPXViewer/index.html +1 -1
  18. package/coverage/lcov-report/src/components/MlGeoJsonLayer/MlGeoJsonLayer.tsx.html +1 -1
  19. package/coverage/lcov-report/src/components/MlGeoJsonLayer/index.html +1 -1
  20. package/coverage/lcov-report/src/components/MlImageMarkerLayer/MlImageMarkerLayer.tsx.html +1 -1
  21. package/coverage/lcov-report/src/components/MlImageMarkerLayer/index.html +1 -1
  22. package/coverage/lcov-report/src/components/MlLayer/MlLayer.tsx.html +1 -1
  23. package/coverage/lcov-report/src/components/MlLayer/index.html +1 -1
  24. package/coverage/lcov-report/src/components/MlLayerMagnify/MlLayerMagnify.tsx.html +1 -1
  25. package/coverage/lcov-report/src/components/MlLayerMagnify/index.html +1 -1
  26. package/coverage/lcov-report/src/components/MlLayerSwipe/MlLayerSwipe.tsx.html +1 -1
  27. package/coverage/lcov-report/src/components/MlLayerSwipe/index.html +1 -1
  28. package/coverage/lcov-report/src/components/MlLayerSwitcher/MlLayerSwitcher.js.html +1 -1
  29. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/LayerBox.js.html +1 -1
  30. package/coverage/lcov-report/src/components/MlLayerSwitcher/components/index.html +1 -1
  31. package/coverage/lcov-report/src/components/MlLayerSwitcher/index.html +1 -1
  32. package/coverage/lcov-report/src/components/MlMarker/MlMarker.tsx.html +1 -1
  33. package/coverage/lcov-report/src/components/MlMarker/index.html +1 -1
  34. package/coverage/lcov-report/src/components/MlMeasureTool/MlMeasureTool.tsx.html +103 -22
  35. package/coverage/lcov-report/src/components/MlMeasureTool/index.html +15 -15
  36. package/coverage/lcov-report/src/components/MlNavigationCompass/MlNavigationCompass.tsx.html +1 -1
  37. package/coverage/lcov-report/src/components/MlNavigationCompass/index.html +1 -1
  38. package/coverage/lcov-report/src/components/MlNavigationTools/MlNavigationTools.tsx.html +1 -1
  39. package/coverage/lcov-report/src/components/MlNavigationTools/index.html +1 -1
  40. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.js.html +1 -1
  41. package/coverage/lcov-report/src/components/MlOsmLayer/MlOsmLayer.stories_.js.html +1 -1
  42. package/coverage/lcov-report/src/components/MlOsmLayer/index.html +1 -1
  43. package/coverage/lcov-report/src/components/MlScaleReference/MlScaleReference.js.html +1 -1
  44. package/coverage/lcov-report/src/components/MlScaleReference/index.html +1 -1
  45. package/coverage/lcov-report/src/components/MlShareMapState/MlShareMapState.js.html +1 -1
  46. package/coverage/lcov-report/src/components/MlShareMapState/index.html +1 -1
  47. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/MlSpatialElevationProfile.js.html +1 -1
  48. package/coverage/lcov-report/src/components/MlSpatialElevationProfile/index.html +1 -1
  49. package/coverage/lcov-report/src/components/MlThreeJsLayer/MlThreeJsLayer.js.html +1 -1
  50. package/coverage/lcov-report/src/components/MlThreeJsLayer/index.html +1 -1
  51. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/MlTransitionGeoJsonLayer.tsx.html +1 -1
  52. package/coverage/lcov-report/src/components/MlTransitionGeoJsonLayer/index.html +1 -1
  53. package/coverage/lcov-report/src/components/MlUseMapDebugger/MlUseMapDebugger.js.html +1 -1
  54. package/coverage/lcov-report/src/components/MlUseMapDebugger/index.html +1 -1
  55. package/coverage/lcov-report/src/components/MlVectorTileLayer/MlVectorTileLayer.tsx.html +1 -1
  56. package/coverage/lcov-report/src/components/MlVectorTileLayer/index.html +1 -1
  57. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/MlWmsFeatureInfoPopup.js.html +1 -1
  58. package/coverage/lcov-report/src/components/MlWmsFeatureInfoPopup/index.html +1 -1
  59. package/coverage/lcov-report/src/components/MlWmsLayer/MlWmsLayer.tsx.html +1 -1
  60. package/coverage/lcov-report/src/components/MlWmsLayer/index.html +1 -1
  61. package/coverage/lcov-report/src/components/MlWmsLoader/MlWmsLoader.tsx.html +2 -2
  62. package/coverage/lcov-report/src/components/MlWmsLoader/index.html +1 -1
  63. package/coverage/lcov-report/src/contexts/MapContext.tsx.html +1 -1
  64. package/coverage/lcov-report/src/contexts/SimpleDataContext.js.html +1 -1
  65. package/coverage/lcov-report/src/contexts/SimpleDataProvider.js.html +1 -1
  66. package/coverage/lcov-report/src/contexts/index.html +1 -1
  67. package/coverage/lcov-report/src/hooks/index.html +1 -1
  68. package/coverage/lcov-report/src/hooks/useLayer.ts.html +1 -1
  69. package/coverage/lcov-report/src/hooks/useMap.ts.html +1 -1
  70. package/coverage/lcov-report/src/hooks/useMapState.ts.html +1 -1
  71. package/coverage/lcov-report/src/hooks/useWms.js.html +2 -2
  72. package/coverage/lcov-report/src/index.html +1 -1
  73. package/coverage/lcov-report/src/index.ts.html +5 -2
  74. package/coverage/lcov.info +35 -23
  75. package/dist/index.esm.js +37 -2
  76. package/dist/index.esm.js.map +1 -1
  77. package/docs-build/{0.0ee4f98c.iframe.bundle.js → 0.968bdc5f.iframe.bundle.js} +2 -2
  78. package/docs-build/0.968bdc5f.iframe.bundle.js.map +1 -0
  79. package/docs-build/{1.bb3cf738.iframe.bundle.js → 1.3530bc86.iframe.bundle.js} +3 -3
  80. package/docs-build/1.3530bc86.iframe.bundle.js.map +1 -0
  81. package/docs-build/{17.97db5b3f.iframe.bundle.js → 17.c96fb6bc.iframe.bundle.js} +2 -2
  82. package/docs-build/17.c96fb6bc.iframe.bundle.js.map +1 -0
  83. package/docs-build/{18.f8d843df.iframe.bundle.js → 18.0947f810.iframe.bundle.js} +3 -3
  84. package/docs-build/18.0947f810.iframe.bundle.js.map +1 -0
  85. package/docs-build/{19.c45e6b08.iframe.bundle.js → 19.44204e5a.iframe.bundle.js} +2 -2
  86. package/docs-build/19.44204e5a.iframe.bundle.js.map +1 -0
  87. package/docs-build/{2.42c790e4.iframe.bundle.js → 2.c62e9630.iframe.bundle.js} +2 -2
  88. package/docs-build/2.c62e9630.iframe.bundle.js.map +1 -0
  89. package/docs-build/{20.120bbcfb.iframe.bundle.js → 20.50a2ad76.iframe.bundle.js} +2 -2
  90. package/docs-build/20.50a2ad76.iframe.bundle.js.map +1 -0
  91. package/docs-build/{21.37c885f1.iframe.bundle.js → 21.ce55b70e.iframe.bundle.js} +2 -2
  92. package/docs-build/21.ce55b70e.iframe.bundle.js.map +1 -0
  93. package/docs-build/{22.7fbc99f4.iframe.bundle.js → 22.639c6bb4.iframe.bundle.js} +2 -2
  94. package/docs-build/22.639c6bb4.iframe.bundle.js.map +1 -0
  95. package/docs-build/{3.1a37a83e.iframe.bundle.js → 3.afb0e0a5.iframe.bundle.js} +2 -2
  96. package/docs-build/3.afb0e0a5.iframe.bundle.js.map +1 -0
  97. package/docs-build/catalogue/mc_meta.json +1 -1
  98. package/docs-build/iframe.html +1 -1
  99. package/docs-build/main~24120820.e956ad2c.iframe.bundle.js +2 -0
  100. package/docs-build/main~24120820.e956ad2c.iframe.bundle.js.map +1 -0
  101. package/docs-build/{vendors~main~0ad7406a.93aea1be.iframe.bundle.js → vendors~main~0ad7406a.834c9ace.iframe.bundle.js} +3 -3
  102. package/docs-build/vendors~main~0ad7406a.834c9ace.iframe.bundle.js.map +1 -0
  103. package/docs-build/vendors~main~0f485567.7297d057.iframe.bundle.js +2 -0
  104. package/docs-build/vendors~main~0f485567.7297d057.iframe.bundle.js.map +1 -0
  105. package/docs-build/{vendors~main~41a6ab2c.da377733.iframe.bundle.js → vendors~main~41a6ab2c.19d97527.iframe.bundle.js} +2 -2
  106. package/docs-build/vendors~main~41a6ab2c.19d97527.iframe.bundle.js.map +1 -0
  107. package/docs-build/{vendors~main~57c1f6cb.86178471.iframe.bundle.js → vendors~main~57c1f6cb.8a8dd47e.iframe.bundle.js} +2 -2
  108. package/docs-build/vendors~main~57c1f6cb.8a8dd47e.iframe.bundle.js.map +1 -0
  109. package/docs-build/{vendors~main~73914085.e2f34f8e.iframe.bundle.js → vendors~main~73914085.2e61c0dc.iframe.bundle.js} +13 -13
  110. package/docs-build/vendors~main~73914085.2e61c0dc.iframe.bundle.js.map +1 -0
  111. package/docs-build/{vendors~main~9c5b28f6.eefa7445.iframe.bundle.js → vendors~main~9c5b28f6.32356887.iframe.bundle.js} +3 -3
  112. package/docs-build/vendors~main~9c5b28f6.32356887.iframe.bundle.js.map +1 -0
  113. package/docs-build/vendors~main~b5906859.94dc520a.iframe.bundle.js +21 -0
  114. package/docs-build/vendors~main~b5906859.94dc520a.iframe.bundle.js.map +1 -0
  115. package/docs-build/{vendors~main~b8f44717.7b869975.iframe.bundle.js → vendors~main~b8f44717.8669cfb8.iframe.bundle.js} +2 -2
  116. package/docs-build/vendors~main~b8f44717.8669cfb8.iframe.bundle.js.map +1 -0
  117. package/docs-build/{vendors~main~b9cf3951.62d39717.iframe.bundle.js → vendors~main~b9cf3951.2a2025c3.iframe.bundle.js} +11 -11
  118. package/docs-build/vendors~main~b9cf3951.2a2025c3.iframe.bundle.js.map +1 -0
  119. package/docs-build/vendors~main~d939e436.bb2b0303.iframe.bundle.js +2 -0
  120. package/docs-build/vendors~main~d939e436.bb2b0303.iframe.bundle.js.map +1 -0
  121. package/docs-build/vendors~main~f420d588.3481b43e.iframe.bundle.js +107 -0
  122. package/docs-build/vendors~main~f420d588.3481b43e.iframe.bundle.js.map +1 -0
  123. package/package.json +1 -1
  124. package/public/catalogue/mc_meta.json +1 -0
  125. package/src/components/MlFeatureEditor/MlFeatureEditor.tsx +3 -3
  126. package/src/components/MlMeasureTool/MlMeasureTool.stories.js +68 -39
  127. package/src/components/MlMeasureTool/MlMeasureTool.tsx +38 -11
  128. package/src/components/MlWmsLoader/MlWmsLoader.tsx +1 -1
  129. package/src/hooks/useWms.js +1 -1
  130. package/src/index.ts +1 -0
  131. package/docs-build/0.0ee4f98c.iframe.bundle.js.map +0 -1
  132. package/docs-build/1.bb3cf738.iframe.bundle.js.map +0 -1
  133. package/docs-build/17.97db5b3f.iframe.bundle.js.map +0 -1
  134. package/docs-build/18.f8d843df.iframe.bundle.js.map +0 -1
  135. package/docs-build/19.c45e6b08.iframe.bundle.js.map +0 -1
  136. package/docs-build/2.42c790e4.iframe.bundle.js.map +0 -1
  137. package/docs-build/20.120bbcfb.iframe.bundle.js.map +0 -1
  138. package/docs-build/21.37c885f1.iframe.bundle.js.map +0 -1
  139. package/docs-build/22.7fbc99f4.iframe.bundle.js.map +0 -1
  140. package/docs-build/3.1a37a83e.iframe.bundle.js.map +0 -1
  141. package/docs-build/main~24120820.905c51c8.iframe.bundle.js +0 -2
  142. package/docs-build/main~24120820.905c51c8.iframe.bundle.js.map +0 -1
  143. package/docs-build/vendors~main~0ad7406a.93aea1be.iframe.bundle.js.map +0 -1
  144. package/docs-build/vendors~main~0f485567.6e7163ef.iframe.bundle.js +0 -2
  145. package/docs-build/vendors~main~0f485567.6e7163ef.iframe.bundle.js.map +0 -1
  146. package/docs-build/vendors~main~41a6ab2c.da377733.iframe.bundle.js.map +0 -1
  147. package/docs-build/vendors~main~57c1f6cb.86178471.iframe.bundle.js.map +0 -1
  148. package/docs-build/vendors~main~73914085.e2f34f8e.iframe.bundle.js.map +0 -1
  149. package/docs-build/vendors~main~9c5b28f6.eefa7445.iframe.bundle.js.map +0 -1
  150. package/docs-build/vendors~main~b5906859.210afc21.iframe.bundle.js +0 -21
  151. package/docs-build/vendors~main~b5906859.210afc21.iframe.bundle.js.map +0 -1
  152. package/docs-build/vendors~main~b8f44717.7b869975.iframe.bundle.js.map +0 -1
  153. package/docs-build/vendors~main~b9cf3951.62d39717.iframe.bundle.js.map +0 -1
  154. package/docs-build/vendors~main~d939e436.394e3bc7.iframe.bundle.js +0 -2
  155. package/docs-build/vendors~main~d939e436.394e3bc7.iframe.bundle.js.map +0 -1
  156. package/docs-build/vendors~main~f420d588.88814a6a.iframe.bundle.js +0 -107
  157. package/docs-build/vendors~main~f420d588.88814a6a.iframe.bundle.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendors~main~41a6ab2c.19d97527.iframe.bundle.js","sources":["webpack:///vendors~main~41a6ab2c.19d97527.iframe.bundle.js"],"mappings":"AAAA","sourceRoot":""}
@@ -1,2 +1,2 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[9],{287:function(t,e){function n(t,e){var n=t.getCenter(),o=t.getZoom(),r=t.getBearing(),i=t.getPitch();e.forEach((function(t){t.jumpTo({center:n,zoom:o,bearing:r,pitch:i})}))}t.exports=function(){var t,e=arguments.length;if(1===e)t=arguments[0];else{t=[];for(var o=0;o<e;o++)t.push(arguments[o])}var r=[];function i(){t.forEach((function(t,e){t.on("move",r[e])}))}function a(){t.forEach((function(t,e){t.off("move",r[e])}))}function s(t,e){a(),n(t,e),i()}return t.forEach((function(e,n){r[n]=s.bind(null,e,t.filter((function(t,e){return e!==n})))})),i(),function(){a(),r=[]}}},383:function(t,e,n){(function(e){t.exports=function(){"use strict";var t=function(t,e){var n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},o={on:function(t,e,o){if(void 0===n[t])throw new Error("Invalid event type: "+t);n[t].push({selector:e,fn:o})},render:function(t){e.store.featureChanged(t)}},r=function(t,r){for(var i=n[t],a=i.length;a--;){var s=i[a];if(s.selector(r)){s.fn.call(o,r)||e.store.render(),e.ui.updateMapClasses();break}}};return t.start.call(o),{render:t.render,stop:function(){t.stop&&t.stop()},trash:function(){t.trash&&(t.trash(),e.store.render())},combineFeatures:function(){t.combineFeatures&&t.combineFeatures()},uncombineFeatures:function(){t.uncombineFeatures&&t.uncombineFeatures()},drag:function(t){r("drag",t)},click:function(t){r("click",t)},mousemove:function(t){r("mousemove",t)},mousedown:function(t){r("mousedown",t)},mouseup:function(t){r("mouseup",t)},mouseout:function(t){r("mouseout",t)},keydown:function(t){r("keydown",t)},keyup:function(t){r("keyup",t)},touchstart:function(t){r("touchstart",t)},touchmove:function(t){r("touchmove",t)},touchend:function(t){r("touchend",t)},tap:function(t){r("tap",t)}}},n=6378137;function o(t){var e=0;if(t&&t.length>0){e+=Math.abs(r(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(r(t[n]))}return e}function r(t){var e,o,r,a,s,u,c=0,l=t.length;if(l>2){for(u=0;u<l;u++)u===l-2?(r=l-2,a=l-1,s=0):u===l-1?(r=l-1,a=0,s=1):(r=u,a=u+1,s=u+2),e=t[r],o=t[a],c+=(i(t[s][0])-i(e[0]))*Math.sin(i(o[1]));c=c*n*n/2}return c}function i(t){return t*Math.PI/180}var a=function t(e){var n,r=0;switch(e.type){case"Polygon":return o(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)r+=o(e.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)r+=t(e.geometries[n]);return r}},s="active",u="mapbox-gl-draw-hot",c="mapbox-gl-draw-cold",l="add",d="move",p="pointer",h="none",f={POLYGON:"polygon",LINE:"line_string",POINT:"point"},g="Feature",y="Polygon",m="LineString",v="Point",b="FeatureCollection",_="Multi",x={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},S="draw.create",C="draw.update",w="feature",M="midpoint",E="vertex",I="true",P="false",L=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],F={Point:0,LineString:1,Polygon:2};function k(t,e){var n=F[t.geometry.type]-F[e.geometry.type];return 0===n&&t.geometry.type===y?t.area-e.area:n}function O(t){if(this._items={},this._nums={},this._length=t?t.length:0,t)for(var e=0,n=t.length;e<n;e++)this.add(t[e]),void 0!==t[e]&&("string"==typeof t[e]?this._items[t[e]]=e:this._nums[t[e]]=e)}O.prototype.add=function(t){return this.has(t)||(this._length++,"string"==typeof t?this._items[t]=this._length:this._nums[t]=this._length),this},O.prototype.delete=function(t){return!1===this.has(t)||(this._length--,delete this._items[t],delete this._nums[t]),this},O.prototype.has=function(t){return!("string"!=typeof t&&"number"!=typeof t||void 0===this._items[t]&&void 0===this._nums[t])},O.prototype.values=function(){var t=this,e=[];return Object.keys(this._items).forEach((function(n){e.push({k:n,v:t._items[n]})})),Object.keys(this._nums).forEach((function(n){e.push({k:JSON.parse(n),v:t._nums[n]})})),e.sort((function(t,e){return t.v-e.v})).map((function(t){return t.k}))},O.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var T=[w,M,E],A={click:function(t,e,n){return j(t,e,n,n.options.clickBuffer)},touch:function(t,e,n){return j(t,e,n,n.options.touchBuffer)}};function j(t,e,n,o){if(null===n.map)return[];var r=t?function(t,e){return void 0===e&&(e=0),[[t.point.x-e,t.point.y-e],[t.point.x+e,t.point.y+e]]}(t,o):e,i={};n.options.styles&&(i.layers=n.options.styles.map((function(t){return t.id})));var s=n.map.queryRenderedFeatures(r,i).filter((function(t){return-1!==T.indexOf(t.properties.meta)})),u=new O,c=[];return s.forEach((function(t){var e=t.properties.id;u.has(e)||(u.add(e),c.push(t))})),function(t){return t.map((function(t){return t.geometry.type===y&&(t.area=a({type:g,property:{},geometry:t.geometry})),t})).sort(k).map((function(t){return delete t.area,t}))}(c)}function D(t,e){var n=A.click(t,null,e),o={mouse:h};return n[0]&&(o.mouse=n[0].properties.active===I?d:p,o.feature=n[0].properties.meta),-1!==e.events.currentModeName().indexOf("draw")&&(o.mouse=l),e.ui.queueMapClasses(o),e.ui.updateMapClasses(),n[0]}function N(t,e){var n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}function U(t,e,n){void 0===n&&(n={});var o=null!=n.fineTolerance?n.fineTolerance:4,r=null!=n.grossTolerance?n.grossTolerance:12,i=null!=n.interval?n.interval:500;t.point=t.point||e.point,t.time=t.time||e.time;var a=N(t.point,e.point);return a<o||a<r&&e.time-t.time<i}function B(t,e,n){void 0===n&&(n={});var o=null!=n.tolerance?n.tolerance:25,r=null!=n.interval?n.interval:250;return t.point=t.point||e.point,t.time=t.time||e.time,N(t.point,e.point)<o&&e.time-t.time<r}function R(t,e){return t(e={exports:{}},e.exports),e.exports}var V=R((function(t){var e=t.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var o=Math.log(Math.pow(2,t))/Math.log(n),r=2;o===1/0;r*=2)o=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var i=o-Math.floor(o),a="";for(r=0;r<Math.floor(o);r++)a=Math.floor(Math.random()*n).toString(n)+a;if(i){var s=Math.pow(n,i);a=Math.floor(Math.random()*s).toString(n)+a}var u=parseInt(a,n);return u!==1/0&&u>=Math.pow(2,t)?e(t,n):a};e.rack=function(t,n,o){var r=function(r){var a=0;do{if(a++>10){if(!o)throw new Error("too many ID collisions, use more bits");t+=o}var s=e(t,n)}while(Object.hasOwnProperty.call(i,s));return i[s]=r,s},i=r.hats={};return r.get=function(t){return r.hats[t]},r.set=function(t,e){return r.hats[t]=e,r},r.bits=t||128,r.base=n||16,r}})),z=function(t,e){this.ctx=t,this.properties=e.properties||{},this.coordinates=e.geometry.coordinates,this.id=e.id||V(),this.type=e.geometry.type};z.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},z.prototype.incomingCoords=function(t){this.setCoordinates(t)},z.prototype.setCoordinates=function(t){this.coordinates=t,this.changed()},z.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},z.prototype.setProperty=function(t,e){this.properties[t]=e},z.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:g,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},z.prototype.internal=function(t){var e={id:this.id,meta:w,"meta:type":this.type,active:P,mode:t};if(this.ctx.options.userProperties)for(var n in this.properties)e["user_"+n]=this.properties[n];return{type:g,properties:e,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var J=function(t,e){z.call(this,t,e)};(J.prototype=Object.create(z.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},J.prototype.updateCoordinate=function(t,e,n){this.coordinates=3===arguments.length?[e,n]:[t,e],this.changed()},J.prototype.getCoordinate=function(){return this.getCoordinates()};var G=function(t,e){z.call(this,t,e)};(G.prototype=Object.create(z.prototype)).isValid=function(){return this.coordinates.length>1},G.prototype.addCoordinate=function(t,e,n){this.changed();var o=parseInt(t,10);this.coordinates.splice(o,0,[e,n])},G.prototype.getCoordinate=function(t){var e=parseInt(t,10);return JSON.parse(JSON.stringify(this.coordinates[e]))},G.prototype.removeCoordinate=function(t){this.changed(),this.coordinates.splice(parseInt(t,10),1)},G.prototype.updateCoordinate=function(t,e,n){var o=parseInt(t,10);this.coordinates[o]=[e,n],this.changed()};var $=function(t,e){z.call(this,t,e),this.coordinates=this.coordinates.map((function(t){return t.slice(0,-1)}))};($.prototype=Object.create(z.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every((function(t){return t.length>2}))},$.prototype.incomingCoords=function(t){this.coordinates=t.map((function(t){return t.slice(0,-1)})),this.changed()},$.prototype.setCoordinates=function(t){this.coordinates=t,this.changed()},$.prototype.addCoordinate=function(t,e,n){this.changed();var o=t.split(".").map((function(t){return parseInt(t,10)}));this.coordinates[o[0]].splice(o[1],0,[e,n])},$.prototype.removeCoordinate=function(t){this.changed();var e=t.split(".").map((function(t){return parseInt(t,10)})),n=this.coordinates[e[0]];n&&(n.splice(e[1],1),n.length<3&&this.coordinates.splice(e[0],1))},$.prototype.getCoordinate=function(t){var e=t.split(".").map((function(t){return parseInt(t,10)})),n=this.coordinates[e[0]];return JSON.parse(JSON.stringify(n[e[1]]))},$.prototype.getCoordinates=function(){return this.coordinates.map((function(t){return t.concat([t[0]])}))},$.prototype.updateCoordinate=function(t,e,n){this.changed();var o=t.split("."),r=parseInt(o[0],10),i=parseInt(o[1],10);void 0===this.coordinates[r]&&(this.coordinates[r]=[]),this.coordinates[r][i]=[e,n]};var q={MultiPoint:J,MultiLineString:G,MultiPolygon:$},W=function(t,e,n,o,r){var i=n.split("."),a=parseInt(i[0],10),s=i[1]?i.slice(1).join("."):null;return t[a][e](s,o,r)},Z=function(t,e){if(z.call(this,t,e),delete this.coordinates,this.model=q[e.geometry.type],void 0===this.model)throw new TypeError(e.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(e.geometry.coordinates)};function Y(t){this.map=t.map,this.drawConfig=JSON.parse(JSON.stringify(t.options||{})),this._ctx=t}(Z.prototype=Object.create(z.prototype))._coordinatesToFeatures=function(t){var e=this,n=this.model.bind(this);return t.map((function(t){return new n(e.ctx,{id:V(),type:g,properties:{},geometry:{coordinates:t,type:e.type.replace("Multi","")}})}))},Z.prototype.isValid=function(){return this.features.every((function(t){return t.isValid()}))},Z.prototype.setCoordinates=function(t){this.features=this._coordinatesToFeatures(t),this.changed()},Z.prototype.getCoordinate=function(t){return W(this.features,"getCoordinate",t)},Z.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((function(t){return t.type===y?t.getCoordinates():t.coordinates}))))},Z.prototype.updateCoordinate=function(t,e,n){W(this.features,"updateCoordinate",t,e,n),this.changed()},Z.prototype.addCoordinate=function(t,e,n){W(this.features,"addCoordinate",t,e,n),this.changed()},Z.prototype.removeCoordinate=function(t){W(this.features,"removeCoordinate",t),this.changed()},Z.prototype.getFeatures=function(){return this.features},Y.prototype.setSelected=function(t){return this._ctx.store.setSelected(t)},Y.prototype.setSelectedCoordinates=function(t){var e=this;this._ctx.store.setSelectedCoordinates(t),t.reduce((function(t,n){return void 0===t[n.feature_id]&&(t[n.feature_id]=!0,e._ctx.store.get(n.feature_id).changed()),t}),{})},Y.prototype.getSelected=function(){return this._ctx.store.getSelected()},Y.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},Y.prototype.isSelected=function(t){return this._ctx.store.isSelected(t)},Y.prototype.getFeature=function(t){return this._ctx.store.get(t)},Y.prototype.select=function(t){return this._ctx.store.select(t)},Y.prototype.deselect=function(t){return this._ctx.store.deselect(t)},Y.prototype.deleteFeature=function(t,e){return void 0===e&&(e={}),this._ctx.store.delete(t,e)},Y.prototype.addFeature=function(t){return this._ctx.store.add(t)},Y.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},Y.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},Y.prototype.setActionableState=function(t){void 0===t&&(t={});var e={trash:t.trash||!1,combineFeatures:t.combineFeatures||!1,uncombineFeatures:t.uncombineFeatures||!1};return this._ctx.events.actionable(e)},Y.prototype.changeMode=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),this._ctx.events.changeMode(t,e,n)},Y.prototype.updateUIClasses=function(t){return this._ctx.ui.queueMapClasses(t)},Y.prototype.activateUIButton=function(t){return this._ctx.ui.setActiveButton(t)},Y.prototype.featuresAt=function(t,e,n){if(void 0===n&&(n="click"),"click"!==n&&"touch"!==n)throw new Error("invalid buffer type");return A[n](t,e,this._ctx)},Y.prototype.newFeature=function(t){var e=t.geometry.type;return e===v?new J(this._ctx,t):e===m?new G(this._ctx,t):e===y?new $(this._ctx,t):new Z(this._ctx,t)},Y.prototype.isInstanceOf=function(t,e){if(t===v)return e instanceof J;if(t===m)return e instanceof G;if(t===y)return e instanceof $;if("MultiFeature"===t)return e instanceof Z;throw new Error("Unknown feature class: "+t)},Y.prototype.doRender=function(t){return this._ctx.store.featureChanged(t)},Y.prototype.onSetup=function(){},Y.prototype.onDrag=function(){},Y.prototype.onClick=function(){},Y.prototype.onMouseMove=function(){},Y.prototype.onMouseDown=function(){},Y.prototype.onMouseUp=function(){},Y.prototype.onMouseOut=function(){},Y.prototype.onKeyUp=function(){},Y.prototype.onKeyDown=function(){},Y.prototype.onTouchStart=function(){},Y.prototype.onTouchMove=function(){},Y.prototype.onTouchEnd=function(){},Y.prototype.onTap=function(){},Y.prototype.onStop=function(){},Y.prototype.onTrash=function(){},Y.prototype.onCombineFeature=function(){},Y.prototype.onUncombineFeature=function(){},Y.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var K={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},H=Object.keys(K);function X(t){return[].concat(t).filter((function(t){return void 0!==t}))}function Q(){var t=this;if(!t.ctx.map||void 0===t.ctx.map.getSource(u))return l();var e=t.ctx.events.currentModeName();t.ctx.ui.queueMapClasses({mode:e});var n=[],o=[];t.isDirty?o=t.getAllIds():(n=t.getChangedIds().filter((function(e){return void 0!==t.get(e)})),o=t.sources.hot.filter((function(e){return e.properties.id&&-1===n.indexOf(e.properties.id)&&void 0!==t.get(e.properties.id)})).map((function(t){return t.properties.id}))),t.sources.hot=[];var r=t.sources.cold.length;t.sources.cold=t.isDirty?[]:t.sources.cold.filter((function(t){var e=t.properties.id||t.properties.parent;return-1===n.indexOf(e)}));var i=r!==t.sources.cold.length||o.length>0;function a(n,o){var r=t.get(n).internal(e);t.ctx.events.currentModeRender(r,(function(e){t.sources[o].push(e)}))}if(n.forEach((function(t){return a(t,"hot")})),o.forEach((function(t){return a(t,"cold")})),i&&t.ctx.map.getSource(c).setData({type:b,features:t.sources.cold}),t.ctx.map.getSource(u).setData({type:b,features:t.sources.hot}),t._emitSelectionChange&&(t.ctx.map.fire("draw.selectionchange",{features:t.getSelected().map((function(t){return t.toGeoJSON()})),points:t.getSelectedCoordinates().map((function(t){return{type:g,properties:{},geometry:{type:v,coordinates:t.coordinates}}}))}),t._emitSelectionChange=!1),t._deletedFeaturesToEmit.length){var s=t._deletedFeaturesToEmit.map((function(t){return t.toGeoJSON()}));t._deletedFeaturesToEmit=[],t.ctx.map.fire("draw.delete",{features:s})}function l(){t.isDirty=!1,t.clearChangedIds()}l(),t.ctx.map.fire("draw.render",{})}function tt(t){var e,n=this;this._features={},this._featureIds=new O,this._selectedFeatureIds=new O,this._selectedCoordinates=[],this._changedFeatureIds=new O,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=t,this.sources={hot:[],cold:[]},this.render=function(){e||(e=requestAnimationFrame((function(){e=null,Q.call(n)})))},this.isDirty=!1}function et(t,e){var n=t._selectedCoordinates.filter((function(e){return t._selectedFeatureIds.has(e.feature_id)}));t._selectedCoordinates.length===n.length||e.silent||(t._emitSelectionChange=!0),t._selectedCoordinates=n}tt.prototype.createRenderBatch=function(){var t=this,e=this.render,n=0;return this.render=function(){n++},function(){t.render=e,n>0&&t.render()}},tt.prototype.setDirty=function(){return this.isDirty=!0,this},tt.prototype.featureChanged=function(t){return this._changedFeatureIds.add(t),this},tt.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},tt.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},tt.prototype.getAllIds=function(){return this._featureIds.values()},tt.prototype.add=function(t){return this.featureChanged(t.id),this._features[t.id]=t,this._featureIds.add(t.id),this},tt.prototype.delete=function(t,e){var n=this;return void 0===e&&(e={}),X(t).forEach((function(t){n._featureIds.has(t)&&(n._featureIds.delete(t),n._selectedFeatureIds.delete(t),e.silent||-1===n._deletedFeaturesToEmit.indexOf(n._features[t])&&n._deletedFeaturesToEmit.push(n._features[t]),delete n._features[t],n.isDirty=!0)})),et(this,e),this},tt.prototype.get=function(t){return this._features[t]},tt.prototype.getAll=function(){var t=this;return Object.keys(this._features).map((function(e){return t._features[e]}))},tt.prototype.select=function(t,e){var n=this;return void 0===e&&(e={}),X(t).forEach((function(t){n._selectedFeatureIds.has(t)||(n._selectedFeatureIds.add(t),n._changedFeatureIds.add(t),e.silent||(n._emitSelectionChange=!0))})),this},tt.prototype.deselect=function(t,e){var n=this;return void 0===e&&(e={}),X(t).forEach((function(t){n._selectedFeatureIds.has(t)&&(n._selectedFeatureIds.delete(t),n._changedFeatureIds.add(t),e.silent||(n._emitSelectionChange=!0))})),et(this,e),this},tt.prototype.clearSelected=function(t){return void 0===t&&(t={}),this.deselect(this._selectedFeatureIds.values(),{silent:t.silent}),this},tt.prototype.setSelected=function(t,e){var n=this;return void 0===e&&(e={}),t=X(t),this.deselect(this._selectedFeatureIds.values().filter((function(e){return-1===t.indexOf(e)})),{silent:e.silent}),this.select(t.filter((function(t){return!n._selectedFeatureIds.has(t)})),{silent:e.silent}),this},tt.prototype.setSelectedCoordinates=function(t){return this._selectedCoordinates=t,this._emitSelectionChange=!0,this},tt.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},tt.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},tt.prototype.getSelected=function(){var t=this;return this._selectedFeatureIds.values().map((function(e){return t.get(e)}))},tt.prototype.getSelectedCoordinates=function(){var t=this;return this._selectedCoordinates.map((function(e){return{coordinates:t.get(e.feature_id).getCoordinate(e.coord_path)}}))},tt.prototype.isSelected=function(t){return this._selectedFeatureIds.has(t)},tt.prototype.setFeatureProperty=function(t,e,n){this.get(t).setProperty(e,n),this.featureChanged(t)},tt.prototype.storeMapConfig=function(){var t=this;L.forEach((function(e){t.ctx.map[e]&&(t._mapInitialConfig[e]=t.ctx.map[e].isEnabled())}))},tt.prototype.restoreMapConfig=function(){var t=this;Object.keys(this._mapInitialConfig).forEach((function(e){t._mapInitialConfig[e]?t.ctx.map[e].enable():t.ctx.map[e].disable()}))},tt.prototype.getInitialConfigValue=function(t){return void 0===this._mapInitialConfig[t]||this._mapInitialConfig[t]};var nt=function(){for(var t=arguments,e={},n=0;n<arguments.length;n++){var o=t[n];for(var r in o)ot.call(o,r)&&(e[r]=o[r])}return e},ot=Object.prototype.hasOwnProperty,rt=["mode","feature","mouse"];function it(e){var n=null,o=null,r={onRemove:function(){return e.map.off("load",r.connect),clearInterval(o),r.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.map=null,e.container=null,e.store=null,n&&n.parentNode&&n.parentNode.removeChild(n),n=null,this},connect:function(){e.map.off("load",r.connect),clearInterval(o),r.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd:function(i){var a=i.fire;return i.fire=function(t,e){var n=arguments;return 1===a.length&&1!==arguments.length&&(n=[nt({},{type:t},e)]),a.apply(i,n)},e.map=i,e.events=function(e){var n=Object.keys(e.options.modes).reduce((function(t,n){return t[n]=function(t){var e=Object.keys(t);return function(n,o){void 0===o&&(o={});var r={},i=e.reduce((function(e,n){return e[n]=t[n],e}),new Y(n));return{start:function(){var e=this;r=i.onSetup(o),H.forEach((function(n){var o,a=K[n],s=function(){return!1};t[a]&&(s=function(){return!0}),e.on(n,s,(o=a,function(t){return i[o](r,t)}))}))},stop:function(){i.onStop(r)},trash:function(){i.onTrash(r)},combineFeatures:function(){i.onCombineFeatures(r)},uncombineFeatures:function(){i.onUncombineFeatures(r)},render:function(t,e){i.toDisplayFeatures(r,t,e)}}}}(e.options.modes[n]),t}),{}),o={},r={},i={},a=null,s=null;i.drag=function(t,n){n({point:t.point,time:(new Date).getTime()})?(e.ui.queueMapClasses({mouse:"drag"}),s.drag(t)):t.originalEvent.stopPropagation()},i.mousedrag=function(t){i.drag(t,(function(t){return!U(o,t)}))},i.touchdrag=function(t){i.drag(t,(function(t){return!B(r,t)}))},i.mousemove=function(t){if(1===(void 0!==t.originalEvent.buttons?t.originalEvent.buttons:t.originalEvent.which))return i.mousedrag(t);var n=D(t,e);t.featureTarget=n,s.mousemove(t)},i.mousedown=function(t){o={time:(new Date).getTime(),point:t.point};var n=D(t,e);t.featureTarget=n,s.mousedown(t)},i.mouseup=function(t){var n=D(t,e);t.featureTarget=n,U(o,{point:t.point,time:(new Date).getTime()})?s.click(t):s.mouseup(t)},i.mouseout=function(t){s.mouseout(t)},i.touchstart=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){r={time:(new Date).getTime(),point:t.point};var n=A.touch(t,null,e)[0];t.featureTarget=n,s.touchstart(t)}},i.touchmove=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled)return s.touchmove(t),i.touchdrag(t)},i.touchend=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){var n=A.touch(t,null,e)[0];t.featureTarget=n,B(r,{time:(new Date).getTime(),point:t.point})?s.tap(t):s.touchend(t)}};var u=function(t){return!(8===t||46===t||t>=48&&t<=57)};function c(o,r,i){void 0===i&&(i={}),s.stop();var u=n[o];if(void 0===u)throw new Error(o+" is not valid");a=o;var c=u(e,r);s=t(c,e),i.silent||e.map.fire("draw.modechange",{mode:o}),e.store.setDirty(),e.store.render()}i.keydown=function(t){"mapboxgl-canvas"===(t.srcElement||t.target).classList[0]&&(8!==t.keyCode&&46!==t.keyCode||!e.options.controls.trash?u(t.keyCode)?s.keydown(t):49===t.keyCode&&e.options.controls.point?c(x.DRAW_POINT):50===t.keyCode&&e.options.controls.line_string?c(x.DRAW_LINE_STRING):51===t.keyCode&&e.options.controls.polygon&&c(x.DRAW_POLYGON):(t.preventDefault(),s.trash()))},i.keyup=function(t){u(t.keyCode)&&s.keyup(t)},i.zoomend=function(){e.store.changeZoom()},i.data=function(t){if("style"===t.dataType){var n=e.setup,o=e.map,r=e.options,i=e.store;r.styles.some((function(t){return o.getLayer(t.id)}))||(n.addLayers(),i.setDirty(),i.render())}};var l={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){a=e.options.defaultMode,s=t(n[a](e),e)},changeMode:c,actionable:function(t){var n=!1;Object.keys(t).forEach((function(e){if(void 0===l[e])throw new Error("Invalid action type");l[e]!==t[e]&&(n=!0),l[e]=t[e]})),n&&e.map.fire("draw.actionable",{actions:l})},currentModeName:function(){return a},currentModeRender:function(t,e){return s.render(t,e)},fire:function(t,e){i[t]&&i[t](e)},addEventListeners:function(){e.map.on("mousemove",i.mousemove),e.map.on("mousedown",i.mousedown),e.map.on("mouseup",i.mouseup),e.map.on("data",i.data),e.map.on("touchmove",i.touchmove),e.map.on("touchstart",i.touchstart),e.map.on("touchend",i.touchend),e.container.addEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",i.keydown),e.container.addEventListener("keyup",i.keyup))},removeEventListeners:function(){e.map.off("mousemove",i.mousemove),e.map.off("mousedown",i.mousedown),e.map.off("mouseup",i.mouseup),e.map.off("data",i.data),e.map.off("touchmove",i.touchmove),e.map.off("touchstart",i.touchstart),e.map.off("touchend",i.touchend),e.container.removeEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",i.keydown),e.container.removeEventListener("keyup",i.keyup))},trash:function(t){s.trash(t)},combineFeatures:function(){s.combineFeatures()},uncombineFeatures:function(){s.uncombineFeatures()},getMode:function(){return a}}}(e),e.ui=function(t){var e={},n=null,o={mode:null,feature:null,mouse:null},r={mode:null,feature:null,mouse:null};function i(t){r=nt(r,t)}function a(){var e,n;if(t.container){var i=[],a=[];rt.forEach((function(t){r[t]!==o[t]&&(i.push(t+"-"+o[t]),null!==r[t]&&a.push(t+"-"+r[t]))})),i.length>0&&(e=t.container.classList).remove.apply(e,i),a.length>0&&(n=t.container.classList).add.apply(n,a),o=nt(o,r)}}function u(t,e){void 0===e&&(e={});var o=document.createElement("button");return o.className="mapbox-gl-draw_ctrl-draw-btn "+e.className,o.setAttribute("title",e.title),e.container.appendChild(o),o.addEventListener("click",(function(o){if(o.preventDefault(),o.stopPropagation(),o.target===n)return c(),void e.onDeactivate();l(t),e.onActivate()}),!0),o}function c(){n&&(n.classList.remove(s),n=null)}function l(t){c();var o=e[t];o&&o&&"trash"!==t&&(o.classList.add(s),n=o)}return{setActiveButton:l,queueMapClasses:i,updateMapClasses:a,clearMapClasses:function(){i({mode:null,feature:null,mouse:null}),a()},addButtons:function(){var n=t.options.controls,o=document.createElement("div");return o.className="mapboxgl-ctrl-group mapboxgl-ctrl",n?(n[f.LINE]&&(e[f.LINE]=u(f.LINE,{container:o,className:"mapbox-gl-draw_line",title:"LineString tool "+(t.options.keybindings?"(l)":""),onActivate:function(){return t.events.changeMode(x.DRAW_LINE_STRING)},onDeactivate:function(){return t.events.trash()}})),n[f.POLYGON]&&(e[f.POLYGON]=u(f.POLYGON,{container:o,className:"mapbox-gl-draw_polygon",title:"Polygon tool "+(t.options.keybindings?"(p)":""),onActivate:function(){return t.events.changeMode(x.DRAW_POLYGON)},onDeactivate:function(){return t.events.trash()}})),n[f.POINT]&&(e[f.POINT]=u(f.POINT,{container:o,className:"mapbox-gl-draw_point",title:"Marker tool "+(t.options.keybindings?"(m)":""),onActivate:function(){return t.events.changeMode(x.DRAW_POINT)},onDeactivate:function(){return t.events.trash()}})),n.trash&&(e.trash=u("trash",{container:o,className:"mapbox-gl-draw_trash",title:"Delete",onActivate:function(){t.events.trash()}})),n.combine_features&&(e.combine_features=u("combineFeatures",{container:o,className:"mapbox-gl-draw_combine",title:"Combine",onActivate:function(){t.events.combineFeatures()}})),n.uncombine_features&&(e.uncombine_features=u("uncombineFeatures",{container:o,className:"mapbox-gl-draw_uncombine",title:"Uncombine",onActivate:function(){t.events.uncombineFeatures()}})),o):o},removeButtons:function(){Object.keys(e).forEach((function(t){var n=e[t];n.parentNode&&n.parentNode.removeChild(n),delete e[t]}))}}}(e),e.container=i.getContainer(),e.store=new tt(e),n=e.ui.addButtons(),e.options.boxSelect&&(i.boxZoom.disable(),i.dragPan.disable(),i.dragPan.enable()),i.loaded()?r.connect():(i.on("load",r.connect),o=setInterval((function(){i.loaded()&&r.connect()}),16)),e.events.start(),n},addLayers:function(){e.map.addSource(c,{data:{type:b,features:[]},type:"geojson"}),e.map.addSource(u,{data:{type:b,features:[]},type:"geojson"}),e.options.styles.forEach((function(t){e.map.addLayer(t)})),e.store.setDirty(!0),e.store.render()},removeLayers:function(){e.options.styles.forEach((function(t){e.map.getLayer(t.id)&&e.map.removeLayer(t.id)})),e.map.getSource(c)&&e.map.removeSource(c),e.map.getSource(u)&&e.map.removeSource(u)}};return e.setup=r,r}function at(t){return function(e){var n=e.featureTarget;return!!n&&!!n.properties&&n.properties.meta===t}}function st(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.active===I&&t.featureTarget.properties.meta===w}function ut(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.active===P&&t.featureTarget.properties.meta===w}function ct(t){return void 0===t.featureTarget}function lt(t){var e=t.featureTarget;return!!e&&!!e.properties&&e.properties.meta===E}function dt(t){return!!t.originalEvent&&!0===t.originalEvent.shiftKey}function pt(t){return 27===t.keyCode}function ht(t){return 13===t.keyCode}var ft=gt;function gt(t,e){this.x=t,this.y=e}function yt(t,e){var n=e.getBoundingClientRect();return new ft(t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0))}function mt(t,e,n,o){return{type:g,properties:{meta:E,parent:t,coord_path:n,active:o?I:P},geometry:{type:v,coordinates:e}}}function vt(t,e,n){void 0===e&&(e={}),void 0===n&&(n=null);var o,r=t.geometry,i=r.type,a=r.coordinates,s=t.properties&&t.properties.id,u=[];function c(t,n){var o="",r=null;t.forEach((function(t,i){var a=null!=n?n+"."+i:String(i),c=mt(s,t,a,l(a));if(e.midpoints&&r){var d=function(t,e,n){var o=e.geometry.coordinates,r=n.geometry.coordinates;if(o[1]>85||o[1]<-85||r[1]>85||r[1]<-85)return null;var i={lng:(o[0]+r[0])/2,lat:(o[1]+r[1])/2};return{type:g,properties:{meta:M,parent:t,lng:i.lng,lat:i.lat,coord_path:n.properties.coord_path},geometry:{type:v,coordinates:[i.lng,i.lat]}}}(s,r,c);d&&u.push(d)}r=c;var p=JSON.stringify(t);o!==p&&u.push(c),0===i&&(o=p)}))}function l(t){return!!e.selectedPaths&&-1!==e.selectedPaths.indexOf(t)}return i===v?u.push(mt(s,a,n,l(n))):i===y?a.forEach((function(t,e){c(t,null!==n?n+"."+e:String(e))})):i===m?c(a,n):0===i.indexOf(_)&&(o=i.replace(_,""),a.forEach((function(n,r){var i={type:g,properties:t.properties,geometry:{type:o,coordinates:n}};u=u.concat(vt(i,e,r))}))),u}gt.prototype={clone:function(){return new gt(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),o=e*this.x-n*this.y,r=n*this.x+e*this.y;return this.x=o,this.y=r,this},_rotateAround:function(t,e){var n=Math.cos(t),o=Math.sin(t),r=e.x+n*(this.x-e.x)-o*(this.y-e.y),i=e.y+o*(this.x-e.x)+n*(this.y-e.y);return this.x=r,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},gt.convert=function(t){return t instanceof gt?t:Array.isArray(t)?new gt(t[0],t[1]):t};var bt=function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)},_t=function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()}),0)},xt=function(t){if(!t||!t.type)return null;var e=St[t.type];return e?"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featurecollection"===e?t:void 0:null},St={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function Ct(t){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.reduce((function(t,e){return t.concat(Ct(e))}),[]),t;case"Feature":return t.geometry?Ct(t.geometry).map((function(e){var n={type:"Feature",properties:JSON.parse(JSON.stringify(t.properties)),geometry:e};return void 0!==t.id&&(n.id=t.id),n})):[t];case"MultiPoint":return t.coordinates.map((function(t){return{type:"Point",coordinates:t}}));case"MultiPolygon":return t.coordinates.map((function(t){return{type:"Polygon",coordinates:t}}));case"MultiLineString":return t.coordinates.map((function(t){return{type:"LineString",coordinates:t}}));case"GeometryCollection":return t.geometries.map(Ct).reduce((function(t,e){return t.concat(e)}),[]);case"Point":case"Polygon":case"LineString":return[t]}}var wt=R((function(t){var e=t.exports=function(t){return new n(t)};function n(t){this.value=t}function o(t,e,n){var o=[],a=[],l=!0;return function t(d){var p=n?r(d):d,h={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:a[a.length-1],parents:a,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(t,e){g.isRoot||(g.parent.node[g.key]=t),g.node=t,e&&(f=!1)},delete:function(t){delete g.parent.node[g.key],t&&(f=!1)},remove:function(t){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],t&&(f=!1)},keys:null,before:function(t){h.before=t},after:function(t){h.after=t},pre:function(t){h.pre=t},post:function(t){h.post=t},stop:function(){l=!1},block:function(){f=!1}};if(!l)return g;function y(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=i(g.node)),g.isLeaf=0==g.keys.length;for(var t=0;t<a.length;t++)if(a[t].node_===d){g.circular=a[t];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}y();var m=e.call(g,g.node);return void 0!==m&&g.update&&g.update(m),h.before&&h.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(a.push(g),y(),u(g.keys,(function(e,r){o.push(e),h.pre&&h.pre.call(g,g.node[e],e);var i=t(g.node[e]);n&&c.call(g.node,e)&&(g.node[e]=i.node),i.isLast=r==g.keys.length-1,i.isFirst=0==r,h.post&&h.post.call(g,i),o.pop()})),a.pop()),h.after&&h.after.call(g,g.node),g):g}(t).node}function r(t){if("object"==typeof t&&null!==t){var e;if(s(t))e=[];else if("[object Date]"===a(t))e=new Date(t.getTime?t.getTime():t);else if(function(t){return"[object RegExp]"===a(t)}(t))e=new RegExp(t);else if(function(t){return"[object Error]"===a(t)}(t))e={message:t.message};else if(function(t){return"[object Boolean]"===a(t)}(t))e=new Boolean(t);else if(function(t){return"[object Number]"===a(t)}(t))e=new Number(t);else if(function(t){return"[object String]"===a(t)}(t))e=new String(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else{var n=t.constructor&&t.constructor.prototype||t.__proto__||{},o=function(){};o.prototype=n,e=new o}return u(i(t),(function(n){e[n]=t[n]})),e}return t}n.prototype.get=function(t){for(var e=this.value,n=0;n<t.length;n++){var o=t[n];if(!e||!c.call(e,o)){e=void 0;break}e=e[o]}return e},n.prototype.has=function(t){for(var e=this.value,n=0;n<t.length;n++){var o=t[n];if(!e||!c.call(e,o))return!1;e=e[o]}return!0},n.prototype.set=function(t,e){for(var n=this.value,o=0;o<t.length-1;o++){var r=t[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[t[o]]=e,e},n.prototype.map=function(t){return o(this.value,t,!0)},n.prototype.forEach=function(t){return this.value=o(this.value,t,!1),this.value},n.prototype.reduce=function(t,e){var n=1===arguments.length,o=n?this.value:e;return this.forEach((function(e){this.isRoot&&n||(o=t.call(this,o,e))})),o},n.prototype.paths=function(){var t=[];return this.forEach((function(e){t.push(this.path)})),t},n.prototype.nodes=function(){var t=[];return this.forEach((function(e){t.push(this.node)})),t},n.prototype.clone=function(){var t=[],e=[];return function n(o){for(var a=0;a<t.length;a++)if(t[a]===o)return e[a];if("object"==typeof o&&null!==o){var s=r(o);return t.push(o),e.push(s),u(i(o),(function(t){s[t]=n(o[t])})),t.pop(),e.pop(),s}return o}(this.value)};var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function a(t){return Object.prototype.toString.call(t)}var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},u=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t)};u(i(n.prototype),(function(t){e[t]=function(e){var o=[].slice.call(arguments,1),r=new n(e);return r[t].apply(r,o)}}));var c=Object.hasOwnProperty||function(t,e){return e in t}})),Mt=Et;function Et(t){if(!(this instanceof Et))return new Et(t);this._bbox=t||[1/0,1/0,-1/0,-1/0],this._valid=!!t}Et.prototype.include=function(t){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},Et.prototype.equals=function(t){var e;return e=t instanceof Et?t.bbox():t,this._bbox[0]==e[0]&&this._bbox[1]==e[1]&&this._bbox[2]==e[2]&&this._bbox[3]==e[3]},Et.prototype.center=function(t){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Et.prototype.union=function(t){var e;return this._valid=!0,e=t instanceof Et?t.bbox():t,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},Et.prototype.bbox=function(){return this._valid?this._bbox:null},Et.prototype.contains=function(t){if(!t)return this._fastContains();if(!this._valid)return null;var e=t[0],n=t[1];return this._bbox[0]<=e&&this._bbox[1]<=n&&this._bbox[2]>=e&&this._bbox[3]>=n},Et.prototype.intersect=function(t){return this._valid?(e=t instanceof Et?t.bbox():t,!(this._bbox[0]>e[2]||this._bbox[2]<e[0]||this._bbox[3]<e[1]||this._bbox[1]>e[3])):null;var e},Et.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var t="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",t)},Et.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var It={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Pt=Object.keys(It),Lt=function(t){return Ft(t).bbox()};function Ft(t){for(var e=Mt(),n=function(t){if(!t)return[];var e=Ct(xt(t)),n=[];return e.features.forEach((function(t){t.geometry&&(n=n.concat(function t(e){return Array.isArray(e)&&e.length&&"number"==typeof e[0]?[e]:e.reduce((function(e,n){return Array.isArray(n)&&Array.isArray(n[0])?e.concat(t(n)):(e.push(n),e)}),[])}(t.geometry.coordinates)))})),n}(t),o=0;o<n.length;o++)e.include(n[o]);return e}function kt(t,e){var n=-90,o=90,r=-90,i=90,a=270,s=-270;t.forEach((function(t){var e=Lt(t),u=e[1],c=e[3],l=e[0],d=e[2];u>n&&(n=u),c<o&&(o=c),c>r&&(r=c),u<i&&(i=u),l<a&&(a=l),d>s&&(s=d)}));var u=e;return n+u.lat>85&&(u.lat=85-n),r+u.lat>90&&(u.lat=90-r),o+u.lat<-85&&(u.lat=-85-o),i+u.lat<-90&&(u.lat=-90-i),a+u.lng<=-270&&(u.lng+=360*Math.ceil(Math.abs(u.lng)/360)),s+u.lng>=270&&(u.lng-=360*Math.ceil(Math.abs(u.lng)/360)),u}function Ot(t,e){var n=kt(t.map((function(t){return t.toGeoJSON()})),e);t.forEach((function(t){var e,o=t.getCoordinates(),r=function(t){var e={lng:t[0]+n.lng,lat:t[1]+n.lat};return[e.lng,e.lat]},i=function(t){return t.map((function(t){return r(t)}))};t.type===v?e=r(o):t.type===m||"MultiPoint"===t.type?e=o.map(r):t.type===y||"MultiLineString"===t.type?e=o.map(i):"MultiPolygon"===t.type&&(e=o.map((function(t){return t.map((function(t){return i(t)}))}))),t.incomingCoords(e)}))}Lt.polygon=function(t){return Ft(t).polygon()},Lt.bboxify=function(t){return wt(t).map((function(t){t&&Pt.some((function(e){return!!t[e]&&-1!==It[e].indexOf(t.type)}))&&(t.bbox=Ft(t).bbox(),this.update(t))}))};var Tt={onSetup:function(t){var e=this,n={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:t.featureIds||[]};return this.setSelected(n.initiallySelectedFeatureIds.filter((function(t){return void 0!==e.getFeature(t)}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),n},fireUpdate:function(){this.map.fire(C,{action:"move",features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(){var t=this,e=this.getSelected(),n=e.filter((function(e){return t.isInstanceOf("MultiFeature",e)})),o=!1;if(e.length>1){o=!0;var r=e[0].type.replace("Multi","");e.forEach((function(t){t.type.replace("Multi","")!==r&&(o=!1)}))}var i=n.length>0,a=e.length>0;this.setActionableState({combineFeatures:o,uncombineFeatures:i,trash:a})},getUniqueIds:function(t){return t.length?t.map((function(t){return t.properties.id})).filter((function(t){return void 0!==t})).reduce((function(t,e){return t.add(e),t}),new O).values():[]},stopExtendedInteractions:function(t){t.boxSelectElement&&(t.boxSelectElement.parentNode&&t.boxSelectElement.parentNode.removeChild(t.boxSelectElement),t.boxSelectElement=null),this.map.dragPan.enable(),t.boxSelecting=!1,t.canBoxSelect=!1,t.dragMoving=!1,t.canDragMove=!1},onStop:function(){bt(this)},onMouseMove:function(t){return this.stopExtendedInteractions(t),!0},onMouseOut:function(t){return!t.dragMoving||this.fireUpdate()}};Tt.onTap=Tt.onClick=function(t,e){return ct(e)?this.clickAnywhere(t,e):at(E)(e)?this.clickOnVertex(t,e):function(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.meta===w}(e)?this.clickOnFeature(t,e):void 0},Tt.clickAnywhere=function(t){var e=this,n=this.getSelectedIds();n.length&&(this.clearSelectedFeatures(),n.forEach((function(t){return e.doRender(t)}))),bt(this),this.stopExtendedInteractions(t)},Tt.clickOnVertex=function(t,e){this.changeMode(x.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.updateUIClasses({mouse:d})},Tt.startOnActiveFeature=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),this.doRender(e.featureTarget.properties.id),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},Tt.clickOnFeature=function(t,e){var n=this;_t(this),this.stopExtendedInteractions(t);var o=dt(e),r=this.getSelectedIds(),i=e.featureTarget.properties.id,a=this.isSelected(i);if(!o&&a&&this.getFeature(i).type!==v)return this.changeMode(x.DIRECT_SELECT,{featureId:i});a&&o?(this.deselect(i),this.updateUIClasses({mouse:p}),1===r.length&&bt(this)):!a&&o?(this.select(i),this.updateUIClasses({mouse:d})):a||o||(r.forEach((function(t){return n.doRender(t)})),this.setSelected(i),this.updateUIClasses({mouse:d})),this.doRender(i)},Tt.onMouseDown=function(t,e){return st(e)?this.startOnActiveFeature(t,e):this.drawConfig.boxSelect&&function(t){return!!t.originalEvent&&!!t.originalEvent.shiftKey&&0===t.originalEvent.button}(e)?this.startBoxSelect(t,e):void 0},Tt.startBoxSelect=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),t.boxSelectStartLocation=yt(e.originalEvent,this.map.getContainer()),t.canBoxSelect=!0},Tt.onTouchStart=function(t,e){if(st(e))return this.startOnActiveFeature(t,e)},Tt.onDrag=function(t,e){return t.canDragMove?this.dragMove(t,e):this.drawConfig.boxSelect&&t.canBoxSelect?this.whileBoxSelect(t,e):void 0},Tt.whileBoxSelect=function(t,e){t.boxSelecting=!0,this.updateUIClasses({mouse:l}),t.boxSelectElement||(t.boxSelectElement=document.createElement("div"),t.boxSelectElement.classList.add("mapbox-gl-draw_boxselect"),this.map.getContainer().appendChild(t.boxSelectElement));var n=yt(e.originalEvent,this.map.getContainer()),o=Math.min(t.boxSelectStartLocation.x,n.x),r=Math.max(t.boxSelectStartLocation.x,n.x),i=Math.min(t.boxSelectStartLocation.y,n.y),a=Math.max(t.boxSelectStartLocation.y,n.y),s="translate("+o+"px, "+i+"px)";t.boxSelectElement.style.transform=s,t.boxSelectElement.style.WebkitTransform=s,t.boxSelectElement.style.width=r-o+"px",t.boxSelectElement.style.height=a-i+"px"},Tt.dragMove=function(t,e){t.dragMoving=!0,e.originalEvent.stopPropagation();var n={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};Ot(this.getSelected(),n),t.dragMoveLocation=e.lngLat},Tt.onMouseUp=function(t,e){var n=this;if(t.dragMoving)this.fireUpdate();else if(t.boxSelecting){var o=[t.boxSelectStartLocation,yt(e.originalEvent,this.map.getContainer())],r=this.featuresAt(null,o,"click"),i=this.getUniqueIds(r).filter((function(t){return!n.isSelected(t)}));i.length&&(this.select(i),i.forEach((function(t){return n.doRender(t)})),this.updateUIClasses({mouse:d}))}this.stopExtendedInteractions(t)},Tt.toDisplayFeatures=function(t,e,n){e.properties.active=this.isSelected(e.properties.id)?I:P,n(e),this.fireActionable(),e.properties.active===I&&e.geometry.type!==v&&vt(e).forEach(n)},Tt.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},Tt.onCombineFeatures=function(){var t=this.getSelected();if(!(0===t.length||t.length<2)){for(var e=[],n=[],o=t[0].type.replace("Multi",""),r=0;r<t.length;r++){var i=t[r];if(i.type.replace("Multi","")!==o)return;i.type.includes("Multi")?i.getCoordinates().forEach((function(t){e.push(t)})):e.push(i.getCoordinates()),n.push(i.toGeoJSON())}if(n.length>1){var a=this.newFeature({type:g,properties:n[0].properties,geometry:{type:"Multi"+o,coordinates:e}});this.addFeature(a),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([a.id]),this.map.fire("draw.combine",{createdFeatures:[a.toGeoJSON()],deletedFeatures:n})}this.fireActionable()}},Tt.onUncombineFeatures=function(){var t=this,e=this.getSelected();if(0!==e.length){for(var n=[],o=[],r=function(r){var i=e[r];t.isInstanceOf("MultiFeature",i)&&(i.getFeatures().forEach((function(e){t.addFeature(e),e.properties=i.properties,n.push(e.toGeoJSON()),t.select([e.id])})),t.deleteFeature(i.id,{silent:!0}),o.push(i.toGeoJSON()))},i=0;i<e.length;i++)r(i);n.length>1&&this.map.fire("draw.uncombine",{createdFeatures:n,deletedFeatures:o}),this.fireActionable()}};var At=at(E),jt=at(M),Dt={fireUpdate:function(){this.map.fire(C,{action:"change_coordinates",features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0})},startDragging:function(t,e){this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},stopDragging:function(t){this.map.dragPan.enable(),t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null},onVertex:function(t,e){this.startDragging(t,e);var n=e.featureTarget.properties,o=t.selectedCoordPaths.indexOf(n.coord_path);dt(e)||-1!==o?dt(e)&&-1===o&&t.selectedCoordPaths.push(n.coord_path):t.selectedCoordPaths=[n.coord_path];var r=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(r)},onMidpoint:function(t,e){this.startDragging(t,e);var n=e.featureTarget.properties;t.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),t.selectedCoordPaths=[n.coord_path]},pathsToCoordinates:function(t,e){return e.map((function(e){return{feature_id:t,coord_path:e}}))},onFeature:function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t)},dragFeature:function(t,e,n){Ot(this.getSelected(),n),t.dragMoveLocation=e.lngLat},dragVertex:function(t,e,n){for(var o=t.selectedCoordPaths.map((function(e){return t.feature.getCoordinate(e)})),r=kt(o.map((function(t){return{type:g,properties:{},geometry:{type:v,coordinates:t}}})),n),i=0;i<o.length;i++){var a=o[i];t.feature.updateCoordinate(t.selectedCoordPaths[i],a[0]+r.lng,a[1]+r.lat)}},clickNoTarget:function(){this.changeMode(x.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(x.SIMPLE_SELECT)},clickActiveFeature:function(t){t.selectedCoordPaths=[],this.clearSelectedCoordinates(),t.feature.changed()},onSetup:function(t){var e=t.featureId,n=this.getFeature(e);if(!n)throw new Error("You must provide a featureId to enter direct_select mode");if(n.type===v)throw new TypeError("direct_select mode doesn't handle point features");var o={featureId:e,feature:n,dragMoveLocation:t.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:t.coordPath?[t.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(e,o.selectedCoordPaths)),this.setSelected(e),_t(this),this.setActionableState({trash:!0}),o},onStop:function(){bt(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(t,e,n){t.featureId===e.properties.id?(e.properties.active=I,n(e),vt(e,{map:this.map,midpoints:!0,selectedPaths:t.selectedCoordPaths}).forEach(n)):(e.properties.active=P,n(e)),this.fireActionable(t)},onTrash:function(t){t.selectedCoordPaths.sort((function(t,e){return e.localeCompare(t,"en",{numeric:!0})})).forEach((function(e){return t.feature.removeCoordinate(e)})),this.fireUpdate(),t.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(t),!1===t.feature.isValid()&&(this.deleteFeature([t.featureId]),this.changeMode(x.SIMPLE_SELECT,{}))},onMouseMove:function(t,e){var n=st(e),o=At(e),r=0===t.selectedCoordPaths.length;return n&&r||o&&!r?this.updateUIClasses({mouse:d}):this.updateUIClasses({mouse:h}),this.stopDragging(t),!0},onMouseOut:function(t){return t.dragMoving&&this.fireUpdate(),!0}};Dt.onTouchStart=Dt.onMouseDown=function(t,e){return At(e)?this.onVertex(t,e):st(e)?this.onFeature(t,e):jt(e)?this.onMidpoint(t,e):void 0},Dt.onDrag=function(t,e){if(!0===t.canDragMove){t.dragMoving=!0,e.originalEvent.stopPropagation();var n={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};t.selectedCoordPaths.length>0?this.dragVertex(t,e,n):this.dragFeature(t,e,n),t.dragMoveLocation=e.lngLat}},Dt.onClick=function(t,e){return ct(e)?this.clickNoTarget(t,e):st(e)?this.clickActiveFeature(t,e):ut(e)?this.clickInactive(t,e):void this.stopDragging(t)},Dt.onTap=function(t,e){return ct(e)?this.clickNoTarget(t,e):st(e)?this.clickActiveFeature(t,e):ut(e)?this.clickInactive(t,e):void 0},Dt.onTouchEnd=Dt.onMouseUp=function(t){t.dragMoving&&this.fireUpdate(),this.stopDragging(t)};var Nt={};function Ut(t,e){return!!t.lngLat&&t.lngLat.lng===e[0]&&t.lngLat.lat===e[1]}Nt.onSetup=function(){var t=this.newFeature({type:g,properties:{},geometry:{type:v,coordinates:[]}});return this.addFeature(t),this.clearSelectedFeatures(),this.updateUIClasses({mouse:l}),this.activateUIButton(f.POINT),this.setActionableState({trash:!0}),{point:t}},Nt.stopDrawingAndRemove=function(t){this.deleteFeature([t.point.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT)},Nt.onTap=Nt.onClick=function(t,e){this.updateUIClasses({mouse:d}),t.point.updateCoordinate("",e.lngLat.lng,e.lngLat.lat),this.map.fire(S,{features:[t.point.toGeoJSON()]}),this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.point.id]})},Nt.onStop=function(t){this.activateUIButton(),t.point.getCoordinate().length||this.deleteFeature([t.point.id],{silent:!0})},Nt.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.point.id;if(e.properties.active=o?I:P,!o)return n(e)},Nt.onTrash=Nt.stopDrawingAndRemove,Nt.onKeyUp=function(t,e){if(pt(e)||ht(e))return this.stopDrawingAndRemove(t,e)};var Bt={onSetup:function(){var t=this.newFeature({type:g,properties:{},geometry:{type:y,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),_t(this),this.updateUIClasses({mouse:l}),this.activateUIButton(f.POLYGON),this.setActionableState({trash:!0}),{polygon:t,currentVertexPosition:0}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&Ut(e,t.polygon.coordinates[0][t.currentVertexPosition-1]))return this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.polygon.id]});this.updateUIClasses({mouse:l}),t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),t.currentVertexPosition++,t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},onMouseMove:function(t,e){t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),lt(e)&&this.updateUIClasses({mouse:p})}};Bt.onTap=Bt.onClick=function(t,e){return lt(e)?this.clickOnVertex(t,e):this.clickAnywhere(t,e)},Bt.onKeyUp=function(t,e){pt(e)?(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT)):ht(e)&&this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},Bt.onStop=function(t){this.updateUIClasses({mouse:h}),bt(this),this.activateUIButton(),void 0!==this.getFeature(t.polygon.id)&&(t.polygon.removeCoordinate("0."+t.currentVertexPosition),t.polygon.isValid()?this.map.fire(S,{features:[t.polygon.toGeoJSON()]}):(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT,{},{silent:!0})))},Bt.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.polygon.id;if(e.properties.active=o?I:P,!o)return n(e);if(0!==e.geometry.coordinates.length){var r=e.geometry.coordinates[0].length;if(!(r<3)){if(e.properties.meta=w,n(mt(t.polygon.id,e.geometry.coordinates[0][0],"0.0",!1)),r>3){var i=e.geometry.coordinates[0].length-3;n(mt(t.polygon.id,e.geometry.coordinates[0][i],"0."+i,!1))}if(r<=4){var a=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(n({type:g,properties:e.properties,geometry:{coordinates:a,type:m}}),3===r)return}return n(e)}}},Bt.onTrash=function(t){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT)};var Rt={onSetup:function(t){var e,n,o=(t=t||{}).featureId,r="forward";if(o){if(!(e=this.getFeature(o)))throw new Error("Could not find a feature with the provided featureId");var i=t.from;if(i&&"Feature"===i.type&&i.geometry&&"Point"===i.geometry.type&&(i=i.geometry),i&&"Point"===i.type&&i.coordinates&&2===i.coordinates.length&&(i=i.coordinates),!i||!Array.isArray(i))throw new Error("Please use the `from` property to indicate which point to continue the line from");var a=e.coordinates.length-1;if(e.coordinates[a][0]===i[0]&&e.coordinates[a][1]===i[1])n=a+1,e.addCoordinate.apply(e,[n].concat(e.coordinates[a]));else{if(e.coordinates[0][0]!==i[0]||e.coordinates[0][1]!==i[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");r="backwards",n=0,e.addCoordinate.apply(e,[n].concat(e.coordinates[0]))}}else e=this.newFeature({type:g,properties:{},geometry:{type:m,coordinates:[]}}),n=0,this.addFeature(e);return this.clearSelectedFeatures(),_t(this),this.updateUIClasses({mouse:l}),this.activateUIButton(f.LINE),this.setActionableState({trash:!0}),{line:e,currentVertexPosition:n,direction:r}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&Ut(e,t.line.coordinates[t.currentVertexPosition-1])||"backwards"===t.direction&&Ut(e,t.line.coordinates[t.currentVertexPosition+1]))return this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.line.id]});this.updateUIClasses({mouse:l}),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?(t.currentVertexPosition++,t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.line.id]})},onMouseMove:function(t,e){t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),lt(e)&&this.updateUIClasses({mouse:p})}};Rt.onTap=Rt.onClick=function(t,e){if(lt(e))return this.clickOnVertex(t,e);this.clickAnywhere(t,e)},Rt.onKeyUp=function(t,e){ht(e)?this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.line.id]}):pt(e)&&(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT))},Rt.onStop=function(t){bt(this),this.activateUIButton(),void 0!==this.getFeature(t.line.id)&&(t.line.removeCoordinate(""+t.currentVertexPosition),t.line.isValid()?this.map.fire(S,{features:[t.line.toGeoJSON()]}):(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT,{},{silent:!0})))},Rt.onTrash=function(t){this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT)},Rt.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.line.id;if(e.properties.active=o?I:P,!o)return n(e);e.geometry.coordinates.length<2||(e.properties.meta=w,n(mt(t.line.id,e.geometry.coordinates["forward"===t.direction?e.geometry.coordinates.length-2:1],""+("forward"===t.direction?e.geometry.coordinates.length-2:1),!1)),n(e))};var Vt={simple_select:Tt,direct_select:Dt,draw_point:Nt,draw_polygon:Bt,draw_line_string:Rt},zt={defaultMode:x.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}],modes:Vt,controls:{},userProperties:!1},Jt={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},Gt={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function $t(t,e){return t.map((function(t){return t.source?t:nt(t,{id:t.id+"."+e,source:"hot"===e?u:c})}))}var qt=R((function(t,n){var o="[object Arguments]",r="[object Map]",i="[object Object]",a="[object Set]",s=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c={};c["[object Float32Array]"]=c["[object Float64Array]"]=c["[object Int8Array]"]=c["[object Int16Array]"]=c["[object Int32Array]"]=c["[object Uint8Array]"]=c["[object Uint8ClampedArray]"]=c["[object Uint16Array]"]=c["[object Uint32Array]"]=!0,c[o]=c["[object Array]"]=c["[object ArrayBuffer]"]=c["[object Boolean]"]=c["[object DataView]"]=c["[object Date]"]=c["[object Error]"]=c["[object Function]"]=c[r]=c["[object Number]"]=c[i]=c["[object RegExp]"]=c[a]=c["[object String]"]=c["[object WeakMap]"]=!1;var l="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,p=l||d||Function("return this")(),h=n&&!n.nodeType&&n,f=h&&t&&!t.nodeType&&t,g=f&&f.exports===h,y=g&&l.process,m=function(){try{return y&&y.binding&&y.binding("util")}catch(t){}}(),v=m&&m.isTypedArray;function b(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function _(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}function x(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var S,C,w,M=Array.prototype,E=Function.prototype,I=Object.prototype,P=p["__core-js_shared__"],L=E.toString,F=I.hasOwnProperty,k=(S=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",O=I.toString,T=RegExp("^"+L.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),A=g?p.Buffer:void 0,j=p.Symbol,D=p.Uint8Array,N=I.propertyIsEnumerable,U=M.splice,B=j?j.toStringTag:void 0,R=Object.getOwnPropertySymbols,V=A?A.isBuffer:void 0,z=(C=Object.keys,w=Object,function(t){return C(w(t))}),J=ft(p,"DataView"),G=ft(p,"Map"),$=ft(p,"Promise"),q=ft(p,"Set"),W=ft(p,"WeakMap"),Z=ft(Object,"create"),Y=vt(J),K=vt(G),H=vt($),X=vt(q),Q=vt(W),tt=j?j.prototype:void 0,et=tt?tt.valueOf:void 0;function nt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function rt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new rt;++e<n;)this.add(t[e])}function at(t){var e=this.__data__=new ot(t);this.size=e.size}function st(t,e){for(var n=t.length;n--;)if(bt(t[n][0],e))return n;return-1}function ut(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":B&&B in Object(t)?function(t){var e=F.call(t,B),n=t[B];try{t[B]=void 0;var o=!0}catch(t){}var r=O.call(t);return o&&(e?t[B]=n:delete t[B]),r}(t):function(t){return O.call(t)}(t)}function ct(t){return Et(t)&&ut(t)==o}function lt(t,e,n,s,u){return t===e||(null==t||null==e||!Et(t)&&!Et(e)?t!=t&&e!=e:function(t,e,n,s,u,c){var l=xt(t),d=xt(e),p=l?"[object Array]":yt(t),h=d?"[object Array]":yt(e),f=(p=p==o?i:p)==i,g=(h=h==o?i:h)==i,y=p==h;if(y&&St(t)){if(!St(e))return!1;l=!0,f=!1}if(y&&!f)return c||(c=new at),l||It(t)?dt(t,e,n,s,u,c):function(t,e,n,o,i,s,u){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!s(new D(t),new D(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return bt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case r:var c=_;case a:var l=1&o;if(c||(c=x),t.size!=e.size&&!l)return!1;var d=u.get(t);if(d)return d==e;o|=2,u.set(t,e);var p=dt(c(t),c(e),o,i,s,u);return u.delete(t),p;case"[object Symbol]":if(et)return et.call(t)==et.call(e)}return!1}(t,e,p,n,s,u,c);if(!(1&n)){var m=f&&F.call(t,"__wrapped__"),v=g&&F.call(e,"__wrapped__");if(m||v){var b=m?t.value():t,S=v?e.value():e;return c||(c=new at),u(b,S,n,s,c)}}return!!y&&(c||(c=new at),function(t,e,n,o,r,i){var a=1&n,s=pt(t),u=s.length;if(u!=pt(e).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in e:F.call(e,l)))return!1}var d=i.get(t);if(d&&i.get(e))return d==e;var p=!0;i.set(t,e),i.set(e,t);for(var h=a;++c<u;){var f=t[l=s[c]],g=e[l];if(o)var y=a?o(g,f,l,e,t,i):o(f,g,l,t,e,i);if(!(void 0===y?f===g||r(f,g,n,o,i):y)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=t.constructor,v=e.constructor;m==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof v&&v instanceof v||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,n,s,u,c))}(t,e,n,s,lt,u))}function dt(t,e,n,o,r,i){var a=1&n,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(t);if(c&&i.get(e))return c==e;var l=-1,d=!0,p=2&n?new it:void 0;for(i.set(t,e),i.set(e,t);++l<s;){var h=t[l],f=e[l];if(o)var g=a?o(f,h,l,e,t,i):o(h,f,l,t,e,i);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!b(e,(function(t,e){if(a=e,!p.has(a)&&(h===t||r(h,t,n,o,i)))return p.push(e);var a}))){d=!1;break}}else if(h!==f&&!r(h,f,n,o,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function pt(t){return function(t,e,n){var o=e(t);return xt(t)?o:function(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t}(o,n(t))}(t,Pt,gt)}function ht(t,e){var n,o,r=t.__data__;return("string"==(o=typeof(n=e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function ft(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Mt(t)||function(t){return!!k&&k in t}(t))&&(Ct(t)?T:s).test(vt(t))}(n)?n:void 0}nt.prototype.clear=function(){this.__data__=Z?Z(null):{},this.size=0},nt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},nt.prototype.get=function(t){var e=this.__data__;if(Z){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return F.call(e,t)?e[t]:void 0},nt.prototype.has=function(t){var e=this.__data__;return Z?void 0!==e[t]:F.call(e,t)},nt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Z&&void 0===e?"__lodash_hash_undefined__":e,this},ot.prototype.clear=function(){this.__data__=[],this.size=0},ot.prototype.delete=function(t){var e=this.__data__,n=st(e,t);return!(n<0||(n==e.length-1?e.pop():U.call(e,n,1),--this.size,0))},ot.prototype.get=function(t){var e=this.__data__,n=st(e,t);return n<0?void 0:e[n][1]},ot.prototype.has=function(t){return st(this.__data__,t)>-1},ot.prototype.set=function(t,e){var n=this.__data__,o=st(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this},rt.prototype.clear=function(){this.size=0,this.__data__={hash:new nt,map:new(G||ot),string:new nt}},rt.prototype.delete=function(t){var e=ht(this,t).delete(t);return this.size-=e?1:0,e},rt.prototype.get=function(t){return ht(this,t).get(t)},rt.prototype.has=function(t){return ht(this,t).has(t)},rt.prototype.set=function(t,e){var n=ht(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},it.prototype.add=it.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},it.prototype.has=function(t){return this.__data__.has(t)},at.prototype.clear=function(){this.__data__=new ot,this.size=0},at.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var n=this.__data__;if(n instanceof ot){var o=n.__data__;if(!G||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new rt(o)}return n.set(t,e),this.size=n.size,this};var gt=R?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,o=null==t?0:t.length,r=0,i=[];++n<o;){var a=t[n];e(a)&&(i[r++]=a)}return i}(R(t),(function(e){return N.call(t,e)})))}:function(){return[]},yt=ut;function mt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<e}function vt(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function bt(t,e){return t===e||t!=t&&e!=e}(J&&"[object DataView]"!=yt(new J(new ArrayBuffer(1)))||G&&yt(new G)!=r||$&&"[object Promise]"!=yt($.resolve())||q&&yt(new q)!=a||W&&"[object WeakMap]"!=yt(new W))&&(yt=function(t){var e=ut(t),n=e==i?t.constructor:void 0,o=n?vt(n):"";if(o)switch(o){case Y:return"[object DataView]";case K:return r;case H:return"[object Promise]";case X:return a;case Q:return"[object WeakMap]"}return e});var _t=ct(function(){return arguments}())?ct:function(t){return Et(t)&&F.call(t,"callee")&&!N.call(t,"callee")},xt=Array.isArray,St=V||function(){return!1};function Ct(t){if(!Mt(t))return!1;var e=ut(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function wt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Mt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Et(t){return null!=t&&"object"==typeof t}var It=v?function(t){return function(e){return t(e)}}(v):function(t){return Et(t)&&wt(t.length)&&!!c[ut(t)]};function Pt(t){return null!=(e=t)&&wt(e.length)&&!Ct(e)?function(t,e){var n=xt(t),o=!n&&_t(t),r=!n&&!o&&St(t),i=!n&&!o&&!r&&It(t),a=n||o||r||i,s=a?function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}(t.length,String):[],u=s.length;for(var c in t)!e&&!F.call(t,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mt(c,u))||s.push(c);return s}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||I))return z(t);var e,n,o=[];for(var r in Object(t))F.call(t,r)&&"constructor"!=r&&o.push(r);return o}(t);var e}t.exports=function(t,e){return lt(t,e)}})),Wt={Polygon:$,LineString:G,Point:J,MultiPolygon:Z,MultiLineString:Z,MultiPoint:Z},Zt=function(t,e){var n={options:t=function(t){void 0===t&&(t={});var e=nt(t);return t.controls||(e.controls={}),!1===t.displayControlsDefault?e.controls=nt(Gt,t.controls):e.controls=nt(Jt,t.controls),(e=nt(zt,e)).styles=$t(e.styles,"cold").concat($t(e.styles,"hot")),e}(t)};e=function(t,e){return e.modes=x,e.getFeatureIdsAt=function(e){return A.click({point:e},null,t).map((function(t){return t.properties.id}))},e.getSelectedIds=function(){return t.store.getSelectedIds()},e.getSelected=function(){return{type:b,features:t.store.getSelectedIds().map((function(e){return t.store.get(e)})).map((function(t){return t.toGeoJSON()}))}},e.getSelectedPoints=function(){return{type:b,features:t.store.getSelectedCoordinates().map((function(t){return{type:g,properties:{},geometry:{type:v,coordinates:t.coordinates}}}))}},e.set=function(n){if(void 0===n.type||n.type!==b||!Array.isArray(n.features))throw new Error("Invalid FeatureCollection");var o=t.store.createRenderBatch(),r=t.store.getAllIds().slice(),i=e.add(n),a=new O(i);return(r=r.filter((function(t){return!a.has(t)}))).length&&e.delete(r),o(),i},e.add=function(e){var n=JSON.parse(JSON.stringify(xt(e))).features.map((function(e){if(e.id=e.id||V(),null===e.geometry)throw new Error("Invalid geometry: null");if(void 0===t.store.get(e.id)||t.store.get(e.id).type!==e.geometry.type){var n=Wt[e.geometry.type];if(void 0===n)throw new Error("Invalid geometry type: "+e.geometry.type+".");var o=new n(t,e);t.store.add(o)}else{var r=t.store.get(e.id);r.properties=e.properties,qt(r.getCoordinates(),e.geometry.coordinates)||r.incomingCoords(e.geometry.coordinates)}return e.id}));return t.store.render(),n},e.get=function(e){var n=t.store.get(e);if(n)return n.toGeoJSON()},e.getAll=function(){return{type:b,features:t.store.getAll().map((function(t){return t.toGeoJSON()}))}},e.delete=function(n){return t.store.delete(n,{silent:!0}),e.getMode()!==x.DIRECT_SELECT||t.store.getSelectedIds().length?t.store.render():t.events.changeMode(x.SIMPLE_SELECT,void 0,{silent:!0}),e},e.deleteAll=function(){return t.store.delete(t.store.getAllIds(),{silent:!0}),e.getMode()===x.DIRECT_SELECT?t.events.changeMode(x.SIMPLE_SELECT,void 0,{silent:!0}):t.store.render(),e},e.changeMode=function(n,o){return void 0===o&&(o={}),n===x.SIMPLE_SELECT&&e.getMode()===x.SIMPLE_SELECT?(r=o.featureIds||[],i=t.store.getSelectedIds(),r.length===i.length&&JSON.stringify(r.map((function(t){return t})).sort())===JSON.stringify(i.map((function(t){return t})).sort())||(t.store.setSelected(o.featureIds,{silent:!0}),t.store.render()),e):(n===x.DIRECT_SELECT&&e.getMode()===x.DIRECT_SELECT&&o.featureId===t.store.getSelectedIds()[0]||t.events.changeMode(n,o,{silent:!0}),e);var r,i},e.getMode=function(){return t.events.getMode()},e.trash=function(){return t.events.trash({silent:!0}),e},e.combineFeatures=function(){return t.events.combineFeatures({silent:!0}),e},e.uncombineFeatures=function(){return t.events.uncombineFeatures({silent:!0}),e},e.setFeatureProperty=function(n,o,r){return t.store.setFeatureProperty(n,o,r),e},e}(n,e),n.api=e;var o=it(n);return e.onAdd=o.onAdd,e.onRemove=o.onRemove,e.types=f,e.options=t,e};function Yt(t){Zt(t,this)}return Yt.modes=Vt,Yt}()}).call(this,n(75))},544:function(t,e,n){"use strict";function o(t,e){this.x=t,this.y=e}t.exports=o,o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),o=e*this.x-n*this.y,r=n*this.x+e*this.y;return this.x=o,this.y=r,this},_rotateAround:function(t,e){var n=Math.cos(t),o=Math.sin(t),r=e.x+n*(this.x-e.x)-o*(this.y-e.y),i=e.y+o*(this.x-e.x)+n*(this.y-e.y);return this.x=r,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t}},545:function(t,e,n){var o=n(974),r=n(978),i=n(979),a={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},s=Object.keys(a);function u(t){for(var e=i(),n=o(t),r=0;r<n.length;r++)e.include(n[r]);return e}t.exports=function(t){return u(t).bbox()},t.exports.polygon=function(t){return u(t).polygon()},t.exports.bboxify=function(t){return r(t).map((function(t){t&&(s.some((function(e){return!!t[e]&&-1!==a[e].indexOf(t.type)}))&&(t.bbox=u(t).bbox(),this.update(t)))}))}},972:function(t,e,n){var o=n(111),r=n(973);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);t.exports=r.locals||{}},973:function(t,e,n){(e=n(112)(!1)).push([t.i,'\n/* Override default control style */\n.mapbox-gl-draw_ctrl-bottom-left,\n.mapbox-gl-draw_ctrl-top-left {\n margin-left:0;\n border-radius:0 4px 4px 0;\n}\n.mapbox-gl-draw_ctrl-top-right,\n.mapbox-gl-draw_ctrl-bottom-right {\n margin-right:0;\n border-radius:4px 0 0 4px;\n}\n.mapbox-gl-draw_ctrl-draw {\n background-color:rgba(0,0,0,0.75);\n border-color:rgba(0,0,0,0.9);\n}\n.mapbox-gl-draw_ctrl-draw > button {\n border-color:rgba(0,0,0,0.9);\n color:rgba(255,255,255,0.5);\n width:30px;\n height:30px;\n}\n.mapbox-gl-draw_ctrl-draw > button:hover {\n background-color:rgba(0,0,0,0.85);\n color:rgba(255,255,255,0.75);\n}\n.mapbox-gl-draw_ctrl-draw > button.active,\n.mapbox-gl-draw_ctrl-draw > button.active:hover {\n background-color:rgba(0,0,0,0.95);\n color:#fff;\n}\n.mapbox-gl-draw_ctrl-draw-btn {\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.mapbox-gl-draw_point {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="m10 2c-3.3 0-6 2.7-6 6s6 9 6 9 6-5.7 6-9-2.7-6-6-6zm0 2c2.1 0 3.8 1.7 3.8 3.8 0 1.5-1.8 3.9-2.9 5.2h-1.7c-1.1-1.4-2.9-3.8-2.9-5.2-.1-2.1 1.6-3.8 3.7-3.8z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_polygon {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_line {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_trash {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_uncombine {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="m12 2c-.3 0-.5.1-.7.3l-1 1c-.4.4-.4 1 0 1.4l1 1c.4.4 1 .4 1.4 0l1-1c.4-.4.4-1 0-1.4l-1-1c-.2-.2-.4-.3-.7-.3zm4 4c-.3 0-.5.1-.7.3l-1 1c-.4.4-.4 1 0 1.4l1 1c.4.4 1 .4 1.4 0l1-1c.4-.4.4-1 0-1.4l-1-1c-.2-.2-.4-.3-.7-.3zm-7 1c-1 0-1 1-.5 1.5.3.3 1 1 1 1l-1 1s-.5.5 0 1 1 0 1 0l1-1 1 1c.5.5 1.5.5 1.5-.5v-4zm-5 3c-.3 0-.5.1-.7.3l-1 1c-.4.4-.4 1 0 1.4l4.9 4.9c.4.4 1 .4 1.4 0l1-1c.4-.4.4-1 0-1.4l-4.9-4.9c-.1-.2-.4-.3-.7-.3z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_combine {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="M12.1,2c-0.3,0-0.5,0.1-0.7,0.3l-1,1c-0.4,0.4-0.4,1,0,1.4l4.9,4.9c0.4,0.4,1,0.4,1.4,0l1-1 c0.4-0.4,0.4-1,0-1.4l-4.9-4.9C12.6,2.1,12.3,2,12.1,2z M8,8C7,8,7,9,7.5,9.5c0.3,0.3,1,1,1,1l-1,1c0,0-0.5,0.5,0,1s1,0,1,0l1-1l1,1 C11,13,12,13,12,12V8H8z M4,10c-0.3,0-0.5,0.1-0.7,0.3l-1,1c-0.4,0.4-0.4,1,0,1.4l1,1c0.4,0.4,1,0.4,1.4,0l1-1c0.4-0.4,0.4-1,0-1.4 l-1-1C4.5,10.1,4.3,10,4,10z M8,14c-0.3,0-0.5,0.1-0.7,0.3l-1,1c-0.4,0.4-0.4,1,0,1.4l1,1c0.4,0.4,1,0.4,1.4,0l1-1 c0.4-0.4,0.4-1,0-1.4l-1-1C8.5,14.1,8.3,14,8,14z"/>%3C/svg>\');\n}\n\n.mapboxgl-map.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: pointer;\n}\n.mapboxgl-map.mouse-move .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: move;\n}\n.mapboxgl-map.mouse-add .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: crosshair;\n}\n.mapboxgl-map.mouse-move.mode-direct_select .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: grab;\n cursor: -webkit-grab;\n}\n.mapboxgl-map.mode-direct_select.feature-vertex.mouse-move .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: move;\n}\n.mapboxgl-map.mode-direct_select.feature-midpoint.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: cell;\n}\n.mapboxgl-map.mode-direct_select.feature-feature.mouse-move .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: move;\n}\n.mapboxgl-map.mode-static.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n.mapbox-gl-draw_boxselect {\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: rgba(0,0,0,.1);\n border: 2px dotted #fff;\n opacity: 0.5;\n}\n',""]),t.exports=e},974:function(t,e,n){var o=n(975),r=n(976),i=n(977);r instanceof Function||(r=r.default),t.exports=function(t){if(!t)return[];var e=r(o(t)),n=[];return e.features.forEach((function(t){t.geometry&&(n=n.concat(i(t.geometry.coordinates)))})),n}},975:function(t,e){t.exports=function(t){if(!t||!t.type)return null;var e=n[t.type];if(!e)return null;if("geometry"===e)return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]};if("feature"===e)return{type:"FeatureCollection",features:[t]};if("featurecollection"===e)return t};var n={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},977:function(t,e){t.exports=function(t){return function t(e){if(Array.isArray(e)&&e.length&&"number"==typeof e[0])return[e];return e.reduce((function(e,n){return Array.isArray(n)&&Array.isArray(n[0])?e.concat(t(n)):(e.push(n),e)}),[])}(t)}},979:function(t,e){function n(t){if(!(this instanceof n))return new n(t);this._bbox=t||[1/0,1/0,-1/0,-1/0],this._valid=!!t}t.exports=n,n.prototype.include=function(t){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},n.prototype.equals=function(t){var e;return e=t instanceof n?t.bbox():t,this._bbox[0]==e[0]&&this._bbox[1]==e[1]&&this._bbox[2]==e[2]&&this._bbox[3]==e[3]},n.prototype.center=function(t){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},n.prototype.union=function(t){var e;return this._valid=!0,e=t instanceof n?t.bbox():t,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},n.prototype.bbox=function(){return this._valid?this._bbox:null},n.prototype.contains=function(t){if(!t)return this._fastContains();if(!this._valid)return null;var e=t[0],n=t[1];return this._bbox[0]<=e&&this._bbox[1]<=n&&this._bbox[2]>=e&&this._bbox[3]>=n},n.prototype.intersect=function(t){return this._valid?(e=t instanceof n?t.bbox():t,!(this._bbox[0]>e[2]||this._bbox[2]<e[0]||this._bbox[3]<e[1]||this._bbox[1]>e[3])):null;var e},n.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var t="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",t)},n.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null}}}]);
2
- //# sourceMappingURL=vendors~main~57c1f6cb.86178471.iframe.bundle.js.map
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[9],{296:function(t,e){function n(t,e){var n=t.getCenter(),o=t.getZoom(),r=t.getBearing(),i=t.getPitch();e.forEach((function(t){t.jumpTo({center:n,zoom:o,bearing:r,pitch:i})}))}t.exports=function(){var t,e=arguments.length;if(1===e)t=arguments[0];else{t=[];for(var o=0;o<e;o++)t.push(arguments[o])}var r=[];function i(){t.forEach((function(t,e){t.on("move",r[e])}))}function a(){t.forEach((function(t,e){t.off("move",r[e])}))}function s(t,e){a(),n(t,e),i()}return t.forEach((function(e,n){r[n]=s.bind(null,e,t.filter((function(t,e){return e!==n})))})),i(),function(){a(),r=[]}}},395:function(t,e,n){(function(e){t.exports=function(){"use strict";var t=function(t,e){var n={drag:[],click:[],mousemove:[],mousedown:[],mouseup:[],mouseout:[],keydown:[],keyup:[],touchstart:[],touchmove:[],touchend:[],tap:[]},o={on:function(t,e,o){if(void 0===n[t])throw new Error("Invalid event type: "+t);n[t].push({selector:e,fn:o})},render:function(t){e.store.featureChanged(t)}},r=function(t,r){for(var i=n[t],a=i.length;a--;){var s=i[a];if(s.selector(r)){s.fn.call(o,r)||e.store.render(),e.ui.updateMapClasses();break}}};return t.start.call(o),{render:t.render,stop:function(){t.stop&&t.stop()},trash:function(){t.trash&&(t.trash(),e.store.render())},combineFeatures:function(){t.combineFeatures&&t.combineFeatures()},uncombineFeatures:function(){t.uncombineFeatures&&t.uncombineFeatures()},drag:function(t){r("drag",t)},click:function(t){r("click",t)},mousemove:function(t){r("mousemove",t)},mousedown:function(t){r("mousedown",t)},mouseup:function(t){r("mouseup",t)},mouseout:function(t){r("mouseout",t)},keydown:function(t){r("keydown",t)},keyup:function(t){r("keyup",t)},touchstart:function(t){r("touchstart",t)},touchmove:function(t){r("touchmove",t)},touchend:function(t){r("touchend",t)},tap:function(t){r("tap",t)}}},n=6378137;function o(t){var e=0;if(t&&t.length>0){e+=Math.abs(r(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(r(t[n]))}return e}function r(t){var e,o,r,a,s,u,c=0,l=t.length;if(l>2){for(u=0;u<l;u++)u===l-2?(r=l-2,a=l-1,s=0):u===l-1?(r=l-1,a=0,s=1):(r=u,a=u+1,s=u+2),e=t[r],o=t[a],c+=(i(t[s][0])-i(e[0]))*Math.sin(i(o[1]));c=c*n*n/2}return c}function i(t){return t*Math.PI/180}var a=function t(e){var n,r=0;switch(e.type){case"Polygon":return o(e.coordinates);case"MultiPolygon":for(n=0;n<e.coordinates.length;n++)r+=o(e.coordinates[n]);return r;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(n=0;n<e.geometries.length;n++)r+=t(e.geometries[n]);return r}},s="active",u="mapbox-gl-draw-hot",c="mapbox-gl-draw-cold",l="add",d="move",p="pointer",h="none",f={POLYGON:"polygon",LINE:"line_string",POINT:"point"},g="Feature",y="Polygon",m="LineString",v="Point",b="FeatureCollection",_="Multi",x={DRAW_LINE_STRING:"draw_line_string",DRAW_POLYGON:"draw_polygon",DRAW_POINT:"draw_point",SIMPLE_SELECT:"simple_select",DIRECT_SELECT:"direct_select",STATIC:"static"},S="draw.create",C="draw.update",w="feature",M="midpoint",E="vertex",I="true",P="false",L=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate"],F={Point:0,LineString:1,Polygon:2};function k(t,e){var n=F[t.geometry.type]-F[e.geometry.type];return 0===n&&t.geometry.type===y?t.area-e.area:n}function O(t){if(this._items={},this._nums={},this._length=t?t.length:0,t)for(var e=0,n=t.length;e<n;e++)this.add(t[e]),void 0!==t[e]&&("string"==typeof t[e]?this._items[t[e]]=e:this._nums[t[e]]=e)}O.prototype.add=function(t){return this.has(t)||(this._length++,"string"==typeof t?this._items[t]=this._length:this._nums[t]=this._length),this},O.prototype.delete=function(t){return!1===this.has(t)||(this._length--,delete this._items[t],delete this._nums[t]),this},O.prototype.has=function(t){return!("string"!=typeof t&&"number"!=typeof t||void 0===this._items[t]&&void 0===this._nums[t])},O.prototype.values=function(){var t=this,e=[];return Object.keys(this._items).forEach((function(n){e.push({k:n,v:t._items[n]})})),Object.keys(this._nums).forEach((function(n){e.push({k:JSON.parse(n),v:t._nums[n]})})),e.sort((function(t,e){return t.v-e.v})).map((function(t){return t.k}))},O.prototype.clear=function(){return this._length=0,this._items={},this._nums={},this};var T=[w,M,E],A={click:function(t,e,n){return j(t,e,n,n.options.clickBuffer)},touch:function(t,e,n){return j(t,e,n,n.options.touchBuffer)}};function j(t,e,n,o){if(null===n.map)return[];var r=t?function(t,e){return void 0===e&&(e=0),[[t.point.x-e,t.point.y-e],[t.point.x+e,t.point.y+e]]}(t,o):e,i={};n.options.styles&&(i.layers=n.options.styles.map((function(t){return t.id})));var s=n.map.queryRenderedFeatures(r,i).filter((function(t){return-1!==T.indexOf(t.properties.meta)})),u=new O,c=[];return s.forEach((function(t){var e=t.properties.id;u.has(e)||(u.add(e),c.push(t))})),function(t){return t.map((function(t){return t.geometry.type===y&&(t.area=a({type:g,property:{},geometry:t.geometry})),t})).sort(k).map((function(t){return delete t.area,t}))}(c)}function D(t,e){var n=A.click(t,null,e),o={mouse:h};return n[0]&&(o.mouse=n[0].properties.active===I?d:p,o.feature=n[0].properties.meta),-1!==e.events.currentModeName().indexOf("draw")&&(o.mouse=l),e.ui.queueMapClasses(o),e.ui.updateMapClasses(),n[0]}function N(t,e){var n=t.x-e.x,o=t.y-e.y;return Math.sqrt(n*n+o*o)}function U(t,e,n){void 0===n&&(n={});var o=null!=n.fineTolerance?n.fineTolerance:4,r=null!=n.grossTolerance?n.grossTolerance:12,i=null!=n.interval?n.interval:500;t.point=t.point||e.point,t.time=t.time||e.time;var a=N(t.point,e.point);return a<o||a<r&&e.time-t.time<i}function B(t,e,n){void 0===n&&(n={});var o=null!=n.tolerance?n.tolerance:25,r=null!=n.interval?n.interval:250;return t.point=t.point||e.point,t.time=t.time||e.time,N(t.point,e.point)<o&&e.time-t.time<r}function R(t,e){return t(e={exports:{}},e.exports),e.exports}var V=R((function(t){var e=t.exports=function(t,n){if(n||(n=16),void 0===t&&(t=128),t<=0)return"0";for(var o=Math.log(Math.pow(2,t))/Math.log(n),r=2;o===1/0;r*=2)o=Math.log(Math.pow(2,t/r))/Math.log(n)*r;var i=o-Math.floor(o),a="";for(r=0;r<Math.floor(o);r++)a=Math.floor(Math.random()*n).toString(n)+a;if(i){var s=Math.pow(n,i);a=Math.floor(Math.random()*s).toString(n)+a}var u=parseInt(a,n);return u!==1/0&&u>=Math.pow(2,t)?e(t,n):a};e.rack=function(t,n,o){var r=function(r){var a=0;do{if(a++>10){if(!o)throw new Error("too many ID collisions, use more bits");t+=o}var s=e(t,n)}while(Object.hasOwnProperty.call(i,s));return i[s]=r,s},i=r.hats={};return r.get=function(t){return r.hats[t]},r.set=function(t,e){return r.hats[t]=e,r},r.bits=t||128,r.base=n||16,r}})),z=function(t,e){this.ctx=t,this.properties=e.properties||{},this.coordinates=e.geometry.coordinates,this.id=e.id||V(),this.type=e.geometry.type};z.prototype.changed=function(){this.ctx.store.featureChanged(this.id)},z.prototype.incomingCoords=function(t){this.setCoordinates(t)},z.prototype.setCoordinates=function(t){this.coordinates=t,this.changed()},z.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.coordinates))},z.prototype.setProperty=function(t,e){this.properties[t]=e},z.prototype.toGeoJSON=function(){return JSON.parse(JSON.stringify({id:this.id,type:g,properties:this.properties,geometry:{coordinates:this.getCoordinates(),type:this.type}}))},z.prototype.internal=function(t){var e={id:this.id,meta:w,"meta:type":this.type,active:P,mode:t};if(this.ctx.options.userProperties)for(var n in this.properties)e["user_"+n]=this.properties[n];return{type:g,properties:e,geometry:{coordinates:this.getCoordinates(),type:this.type}}};var J=function(t,e){z.call(this,t,e)};(J.prototype=Object.create(z.prototype)).isValid=function(){return"number"==typeof this.coordinates[0]&&"number"==typeof this.coordinates[1]},J.prototype.updateCoordinate=function(t,e,n){this.coordinates=3===arguments.length?[e,n]:[t,e],this.changed()},J.prototype.getCoordinate=function(){return this.getCoordinates()};var G=function(t,e){z.call(this,t,e)};(G.prototype=Object.create(z.prototype)).isValid=function(){return this.coordinates.length>1},G.prototype.addCoordinate=function(t,e,n){this.changed();var o=parseInt(t,10);this.coordinates.splice(o,0,[e,n])},G.prototype.getCoordinate=function(t){var e=parseInt(t,10);return JSON.parse(JSON.stringify(this.coordinates[e]))},G.prototype.removeCoordinate=function(t){this.changed(),this.coordinates.splice(parseInt(t,10),1)},G.prototype.updateCoordinate=function(t,e,n){var o=parseInt(t,10);this.coordinates[o]=[e,n],this.changed()};var $=function(t,e){z.call(this,t,e),this.coordinates=this.coordinates.map((function(t){return t.slice(0,-1)}))};($.prototype=Object.create(z.prototype)).isValid=function(){return 0!==this.coordinates.length&&this.coordinates.every((function(t){return t.length>2}))},$.prototype.incomingCoords=function(t){this.coordinates=t.map((function(t){return t.slice(0,-1)})),this.changed()},$.prototype.setCoordinates=function(t){this.coordinates=t,this.changed()},$.prototype.addCoordinate=function(t,e,n){this.changed();var o=t.split(".").map((function(t){return parseInt(t,10)}));this.coordinates[o[0]].splice(o[1],0,[e,n])},$.prototype.removeCoordinate=function(t){this.changed();var e=t.split(".").map((function(t){return parseInt(t,10)})),n=this.coordinates[e[0]];n&&(n.splice(e[1],1),n.length<3&&this.coordinates.splice(e[0],1))},$.prototype.getCoordinate=function(t){var e=t.split(".").map((function(t){return parseInt(t,10)})),n=this.coordinates[e[0]];return JSON.parse(JSON.stringify(n[e[1]]))},$.prototype.getCoordinates=function(){return this.coordinates.map((function(t){return t.concat([t[0]])}))},$.prototype.updateCoordinate=function(t,e,n){this.changed();var o=t.split("."),r=parseInt(o[0],10),i=parseInt(o[1],10);void 0===this.coordinates[r]&&(this.coordinates[r]=[]),this.coordinates[r][i]=[e,n]};var q={MultiPoint:J,MultiLineString:G,MultiPolygon:$},W=function(t,e,n,o,r){var i=n.split("."),a=parseInt(i[0],10),s=i[1]?i.slice(1).join("."):null;return t[a][e](s,o,r)},Z=function(t,e){if(z.call(this,t,e),delete this.coordinates,this.model=q[e.geometry.type],void 0===this.model)throw new TypeError(e.geometry.type+" is not a valid type");this.features=this._coordinatesToFeatures(e.geometry.coordinates)};function Y(t){this.map=t.map,this.drawConfig=JSON.parse(JSON.stringify(t.options||{})),this._ctx=t}(Z.prototype=Object.create(z.prototype))._coordinatesToFeatures=function(t){var e=this,n=this.model.bind(this);return t.map((function(t){return new n(e.ctx,{id:V(),type:g,properties:{},geometry:{coordinates:t,type:e.type.replace("Multi","")}})}))},Z.prototype.isValid=function(){return this.features.every((function(t){return t.isValid()}))},Z.prototype.setCoordinates=function(t){this.features=this._coordinatesToFeatures(t),this.changed()},Z.prototype.getCoordinate=function(t){return W(this.features,"getCoordinate",t)},Z.prototype.getCoordinates=function(){return JSON.parse(JSON.stringify(this.features.map((function(t){return t.type===y?t.getCoordinates():t.coordinates}))))},Z.prototype.updateCoordinate=function(t,e,n){W(this.features,"updateCoordinate",t,e,n),this.changed()},Z.prototype.addCoordinate=function(t,e,n){W(this.features,"addCoordinate",t,e,n),this.changed()},Z.prototype.removeCoordinate=function(t){W(this.features,"removeCoordinate",t),this.changed()},Z.prototype.getFeatures=function(){return this.features},Y.prototype.setSelected=function(t){return this._ctx.store.setSelected(t)},Y.prototype.setSelectedCoordinates=function(t){var e=this;this._ctx.store.setSelectedCoordinates(t),t.reduce((function(t,n){return void 0===t[n.feature_id]&&(t[n.feature_id]=!0,e._ctx.store.get(n.feature_id).changed()),t}),{})},Y.prototype.getSelected=function(){return this._ctx.store.getSelected()},Y.prototype.getSelectedIds=function(){return this._ctx.store.getSelectedIds()},Y.prototype.isSelected=function(t){return this._ctx.store.isSelected(t)},Y.prototype.getFeature=function(t){return this._ctx.store.get(t)},Y.prototype.select=function(t){return this._ctx.store.select(t)},Y.prototype.deselect=function(t){return this._ctx.store.deselect(t)},Y.prototype.deleteFeature=function(t,e){return void 0===e&&(e={}),this._ctx.store.delete(t,e)},Y.prototype.addFeature=function(t){return this._ctx.store.add(t)},Y.prototype.clearSelectedFeatures=function(){return this._ctx.store.clearSelected()},Y.prototype.clearSelectedCoordinates=function(){return this._ctx.store.clearSelectedCoordinates()},Y.prototype.setActionableState=function(t){void 0===t&&(t={});var e={trash:t.trash||!1,combineFeatures:t.combineFeatures||!1,uncombineFeatures:t.uncombineFeatures||!1};return this._ctx.events.actionable(e)},Y.prototype.changeMode=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),this._ctx.events.changeMode(t,e,n)},Y.prototype.updateUIClasses=function(t){return this._ctx.ui.queueMapClasses(t)},Y.prototype.activateUIButton=function(t){return this._ctx.ui.setActiveButton(t)},Y.prototype.featuresAt=function(t,e,n){if(void 0===n&&(n="click"),"click"!==n&&"touch"!==n)throw new Error("invalid buffer type");return A[n](t,e,this._ctx)},Y.prototype.newFeature=function(t){var e=t.geometry.type;return e===v?new J(this._ctx,t):e===m?new G(this._ctx,t):e===y?new $(this._ctx,t):new Z(this._ctx,t)},Y.prototype.isInstanceOf=function(t,e){if(t===v)return e instanceof J;if(t===m)return e instanceof G;if(t===y)return e instanceof $;if("MultiFeature"===t)return e instanceof Z;throw new Error("Unknown feature class: "+t)},Y.prototype.doRender=function(t){return this._ctx.store.featureChanged(t)},Y.prototype.onSetup=function(){},Y.prototype.onDrag=function(){},Y.prototype.onClick=function(){},Y.prototype.onMouseMove=function(){},Y.prototype.onMouseDown=function(){},Y.prototype.onMouseUp=function(){},Y.prototype.onMouseOut=function(){},Y.prototype.onKeyUp=function(){},Y.prototype.onKeyDown=function(){},Y.prototype.onTouchStart=function(){},Y.prototype.onTouchMove=function(){},Y.prototype.onTouchEnd=function(){},Y.prototype.onTap=function(){},Y.prototype.onStop=function(){},Y.prototype.onTrash=function(){},Y.prototype.onCombineFeature=function(){},Y.prototype.onUncombineFeature=function(){},Y.prototype.toDisplayFeatures=function(){throw new Error("You must overwrite toDisplayFeatures")};var K={drag:"onDrag",click:"onClick",mousemove:"onMouseMove",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseout:"onMouseOut",keyup:"onKeyUp",keydown:"onKeyDown",touchstart:"onTouchStart",touchmove:"onTouchMove",touchend:"onTouchEnd",tap:"onTap"},H=Object.keys(K);function X(t){return[].concat(t).filter((function(t){return void 0!==t}))}function Q(){var t=this;if(!t.ctx.map||void 0===t.ctx.map.getSource(u))return l();var e=t.ctx.events.currentModeName();t.ctx.ui.queueMapClasses({mode:e});var n=[],o=[];t.isDirty?o=t.getAllIds():(n=t.getChangedIds().filter((function(e){return void 0!==t.get(e)})),o=t.sources.hot.filter((function(e){return e.properties.id&&-1===n.indexOf(e.properties.id)&&void 0!==t.get(e.properties.id)})).map((function(t){return t.properties.id}))),t.sources.hot=[];var r=t.sources.cold.length;t.sources.cold=t.isDirty?[]:t.sources.cold.filter((function(t){var e=t.properties.id||t.properties.parent;return-1===n.indexOf(e)}));var i=r!==t.sources.cold.length||o.length>0;function a(n,o){var r=t.get(n).internal(e);t.ctx.events.currentModeRender(r,(function(e){t.sources[o].push(e)}))}if(n.forEach((function(t){return a(t,"hot")})),o.forEach((function(t){return a(t,"cold")})),i&&t.ctx.map.getSource(c).setData({type:b,features:t.sources.cold}),t.ctx.map.getSource(u).setData({type:b,features:t.sources.hot}),t._emitSelectionChange&&(t.ctx.map.fire("draw.selectionchange",{features:t.getSelected().map((function(t){return t.toGeoJSON()})),points:t.getSelectedCoordinates().map((function(t){return{type:g,properties:{},geometry:{type:v,coordinates:t.coordinates}}}))}),t._emitSelectionChange=!1),t._deletedFeaturesToEmit.length){var s=t._deletedFeaturesToEmit.map((function(t){return t.toGeoJSON()}));t._deletedFeaturesToEmit=[],t.ctx.map.fire("draw.delete",{features:s})}function l(){t.isDirty=!1,t.clearChangedIds()}l(),t.ctx.map.fire("draw.render",{})}function tt(t){var e,n=this;this._features={},this._featureIds=new O,this._selectedFeatureIds=new O,this._selectedCoordinates=[],this._changedFeatureIds=new O,this._deletedFeaturesToEmit=[],this._emitSelectionChange=!1,this._mapInitialConfig={},this.ctx=t,this.sources={hot:[],cold:[]},this.render=function(){e||(e=requestAnimationFrame((function(){e=null,Q.call(n)})))},this.isDirty=!1}function et(t,e){var n=t._selectedCoordinates.filter((function(e){return t._selectedFeatureIds.has(e.feature_id)}));t._selectedCoordinates.length===n.length||e.silent||(t._emitSelectionChange=!0),t._selectedCoordinates=n}tt.prototype.createRenderBatch=function(){var t=this,e=this.render,n=0;return this.render=function(){n++},function(){t.render=e,n>0&&t.render()}},tt.prototype.setDirty=function(){return this.isDirty=!0,this},tt.prototype.featureChanged=function(t){return this._changedFeatureIds.add(t),this},tt.prototype.getChangedIds=function(){return this._changedFeatureIds.values()},tt.prototype.clearChangedIds=function(){return this._changedFeatureIds.clear(),this},tt.prototype.getAllIds=function(){return this._featureIds.values()},tt.prototype.add=function(t){return this.featureChanged(t.id),this._features[t.id]=t,this._featureIds.add(t.id),this},tt.prototype.delete=function(t,e){var n=this;return void 0===e&&(e={}),X(t).forEach((function(t){n._featureIds.has(t)&&(n._featureIds.delete(t),n._selectedFeatureIds.delete(t),e.silent||-1===n._deletedFeaturesToEmit.indexOf(n._features[t])&&n._deletedFeaturesToEmit.push(n._features[t]),delete n._features[t],n.isDirty=!0)})),et(this,e),this},tt.prototype.get=function(t){return this._features[t]},tt.prototype.getAll=function(){var t=this;return Object.keys(this._features).map((function(e){return t._features[e]}))},tt.prototype.select=function(t,e){var n=this;return void 0===e&&(e={}),X(t).forEach((function(t){n._selectedFeatureIds.has(t)||(n._selectedFeatureIds.add(t),n._changedFeatureIds.add(t),e.silent||(n._emitSelectionChange=!0))})),this},tt.prototype.deselect=function(t,e){var n=this;return void 0===e&&(e={}),X(t).forEach((function(t){n._selectedFeatureIds.has(t)&&(n._selectedFeatureIds.delete(t),n._changedFeatureIds.add(t),e.silent||(n._emitSelectionChange=!0))})),et(this,e),this},tt.prototype.clearSelected=function(t){return void 0===t&&(t={}),this.deselect(this._selectedFeatureIds.values(),{silent:t.silent}),this},tt.prototype.setSelected=function(t,e){var n=this;return void 0===e&&(e={}),t=X(t),this.deselect(this._selectedFeatureIds.values().filter((function(e){return-1===t.indexOf(e)})),{silent:e.silent}),this.select(t.filter((function(t){return!n._selectedFeatureIds.has(t)})),{silent:e.silent}),this},tt.prototype.setSelectedCoordinates=function(t){return this._selectedCoordinates=t,this._emitSelectionChange=!0,this},tt.prototype.clearSelectedCoordinates=function(){return this._selectedCoordinates=[],this._emitSelectionChange=!0,this},tt.prototype.getSelectedIds=function(){return this._selectedFeatureIds.values()},tt.prototype.getSelected=function(){var t=this;return this._selectedFeatureIds.values().map((function(e){return t.get(e)}))},tt.prototype.getSelectedCoordinates=function(){var t=this;return this._selectedCoordinates.map((function(e){return{coordinates:t.get(e.feature_id).getCoordinate(e.coord_path)}}))},tt.prototype.isSelected=function(t){return this._selectedFeatureIds.has(t)},tt.prototype.setFeatureProperty=function(t,e,n){this.get(t).setProperty(e,n),this.featureChanged(t)},tt.prototype.storeMapConfig=function(){var t=this;L.forEach((function(e){t.ctx.map[e]&&(t._mapInitialConfig[e]=t.ctx.map[e].isEnabled())}))},tt.prototype.restoreMapConfig=function(){var t=this;Object.keys(this._mapInitialConfig).forEach((function(e){t._mapInitialConfig[e]?t.ctx.map[e].enable():t.ctx.map[e].disable()}))},tt.prototype.getInitialConfigValue=function(t){return void 0===this._mapInitialConfig[t]||this._mapInitialConfig[t]};var nt=function(){for(var t=arguments,e={},n=0;n<arguments.length;n++){var o=t[n];for(var r in o)ot.call(o,r)&&(e[r]=o[r])}return e},ot=Object.prototype.hasOwnProperty,rt=["mode","feature","mouse"];function it(e){var n=null,o=null,r={onRemove:function(){return e.map.off("load",r.connect),clearInterval(o),r.removeLayers(),e.store.restoreMapConfig(),e.ui.removeButtons(),e.events.removeEventListeners(),e.ui.clearMapClasses(),e.map=null,e.container=null,e.store=null,n&&n.parentNode&&n.parentNode.removeChild(n),n=null,this},connect:function(){e.map.off("load",r.connect),clearInterval(o),r.addLayers(),e.store.storeMapConfig(),e.events.addEventListeners()},onAdd:function(i){var a=i.fire;return i.fire=function(t,e){var n=arguments;return 1===a.length&&1!==arguments.length&&(n=[nt({},{type:t},e)]),a.apply(i,n)},e.map=i,e.events=function(e){var n=Object.keys(e.options.modes).reduce((function(t,n){return t[n]=function(t){var e=Object.keys(t);return function(n,o){void 0===o&&(o={});var r={},i=e.reduce((function(e,n){return e[n]=t[n],e}),new Y(n));return{start:function(){var e=this;r=i.onSetup(o),H.forEach((function(n){var o,a=K[n],s=function(){return!1};t[a]&&(s=function(){return!0}),e.on(n,s,(o=a,function(t){return i[o](r,t)}))}))},stop:function(){i.onStop(r)},trash:function(){i.onTrash(r)},combineFeatures:function(){i.onCombineFeatures(r)},uncombineFeatures:function(){i.onUncombineFeatures(r)},render:function(t,e){i.toDisplayFeatures(r,t,e)}}}}(e.options.modes[n]),t}),{}),o={},r={},i={},a=null,s=null;i.drag=function(t,n){n({point:t.point,time:(new Date).getTime()})?(e.ui.queueMapClasses({mouse:"drag"}),s.drag(t)):t.originalEvent.stopPropagation()},i.mousedrag=function(t){i.drag(t,(function(t){return!U(o,t)}))},i.touchdrag=function(t){i.drag(t,(function(t){return!B(r,t)}))},i.mousemove=function(t){if(1===(void 0!==t.originalEvent.buttons?t.originalEvent.buttons:t.originalEvent.which))return i.mousedrag(t);var n=D(t,e);t.featureTarget=n,s.mousemove(t)},i.mousedown=function(t){o={time:(new Date).getTime(),point:t.point};var n=D(t,e);t.featureTarget=n,s.mousedown(t)},i.mouseup=function(t){var n=D(t,e);t.featureTarget=n,U(o,{point:t.point,time:(new Date).getTime()})?s.click(t):s.mouseup(t)},i.mouseout=function(t){s.mouseout(t)},i.touchstart=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){r={time:(new Date).getTime(),point:t.point};var n=A.touch(t,null,e)[0];t.featureTarget=n,s.touchstart(t)}},i.touchmove=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled)return s.touchmove(t),i.touchdrag(t)},i.touchend=function(t){if(t.originalEvent.preventDefault(),e.options.touchEnabled){var n=A.touch(t,null,e)[0];t.featureTarget=n,B(r,{time:(new Date).getTime(),point:t.point})?s.tap(t):s.touchend(t)}};var u=function(t){return!(8===t||46===t||t>=48&&t<=57)};function c(o,r,i){void 0===i&&(i={}),s.stop();var u=n[o];if(void 0===u)throw new Error(o+" is not valid");a=o;var c=u(e,r);s=t(c,e),i.silent||e.map.fire("draw.modechange",{mode:o}),e.store.setDirty(),e.store.render()}i.keydown=function(t){"mapboxgl-canvas"===(t.srcElement||t.target).classList[0]&&(8!==t.keyCode&&46!==t.keyCode||!e.options.controls.trash?u(t.keyCode)?s.keydown(t):49===t.keyCode&&e.options.controls.point?c(x.DRAW_POINT):50===t.keyCode&&e.options.controls.line_string?c(x.DRAW_LINE_STRING):51===t.keyCode&&e.options.controls.polygon&&c(x.DRAW_POLYGON):(t.preventDefault(),s.trash()))},i.keyup=function(t){u(t.keyCode)&&s.keyup(t)},i.zoomend=function(){e.store.changeZoom()},i.data=function(t){if("style"===t.dataType){var n=e.setup,o=e.map,r=e.options,i=e.store;r.styles.some((function(t){return o.getLayer(t.id)}))||(n.addLayers(),i.setDirty(),i.render())}};var l={trash:!1,combineFeatures:!1,uncombineFeatures:!1};return{start:function(){a=e.options.defaultMode,s=t(n[a](e),e)},changeMode:c,actionable:function(t){var n=!1;Object.keys(t).forEach((function(e){if(void 0===l[e])throw new Error("Invalid action type");l[e]!==t[e]&&(n=!0),l[e]=t[e]})),n&&e.map.fire("draw.actionable",{actions:l})},currentModeName:function(){return a},currentModeRender:function(t,e){return s.render(t,e)},fire:function(t,e){i[t]&&i[t](e)},addEventListeners:function(){e.map.on("mousemove",i.mousemove),e.map.on("mousedown",i.mousedown),e.map.on("mouseup",i.mouseup),e.map.on("data",i.data),e.map.on("touchmove",i.touchmove),e.map.on("touchstart",i.touchstart),e.map.on("touchend",i.touchend),e.container.addEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.addEventListener("keydown",i.keydown),e.container.addEventListener("keyup",i.keyup))},removeEventListeners:function(){e.map.off("mousemove",i.mousemove),e.map.off("mousedown",i.mousedown),e.map.off("mouseup",i.mouseup),e.map.off("data",i.data),e.map.off("touchmove",i.touchmove),e.map.off("touchstart",i.touchstart),e.map.off("touchend",i.touchend),e.container.removeEventListener("mouseout",i.mouseout),e.options.keybindings&&(e.container.removeEventListener("keydown",i.keydown),e.container.removeEventListener("keyup",i.keyup))},trash:function(t){s.trash(t)},combineFeatures:function(){s.combineFeatures()},uncombineFeatures:function(){s.uncombineFeatures()},getMode:function(){return a}}}(e),e.ui=function(t){var e={},n=null,o={mode:null,feature:null,mouse:null},r={mode:null,feature:null,mouse:null};function i(t){r=nt(r,t)}function a(){var e,n;if(t.container){var i=[],a=[];rt.forEach((function(t){r[t]!==o[t]&&(i.push(t+"-"+o[t]),null!==r[t]&&a.push(t+"-"+r[t]))})),i.length>0&&(e=t.container.classList).remove.apply(e,i),a.length>0&&(n=t.container.classList).add.apply(n,a),o=nt(o,r)}}function u(t,e){void 0===e&&(e={});var o=document.createElement("button");return o.className="mapbox-gl-draw_ctrl-draw-btn "+e.className,o.setAttribute("title",e.title),e.container.appendChild(o),o.addEventListener("click",(function(o){if(o.preventDefault(),o.stopPropagation(),o.target===n)return c(),void e.onDeactivate();l(t),e.onActivate()}),!0),o}function c(){n&&(n.classList.remove(s),n=null)}function l(t){c();var o=e[t];o&&o&&"trash"!==t&&(o.classList.add(s),n=o)}return{setActiveButton:l,queueMapClasses:i,updateMapClasses:a,clearMapClasses:function(){i({mode:null,feature:null,mouse:null}),a()},addButtons:function(){var n=t.options.controls,o=document.createElement("div");return o.className="mapboxgl-ctrl-group mapboxgl-ctrl",n?(n[f.LINE]&&(e[f.LINE]=u(f.LINE,{container:o,className:"mapbox-gl-draw_line",title:"LineString tool "+(t.options.keybindings?"(l)":""),onActivate:function(){return t.events.changeMode(x.DRAW_LINE_STRING)},onDeactivate:function(){return t.events.trash()}})),n[f.POLYGON]&&(e[f.POLYGON]=u(f.POLYGON,{container:o,className:"mapbox-gl-draw_polygon",title:"Polygon tool "+(t.options.keybindings?"(p)":""),onActivate:function(){return t.events.changeMode(x.DRAW_POLYGON)},onDeactivate:function(){return t.events.trash()}})),n[f.POINT]&&(e[f.POINT]=u(f.POINT,{container:o,className:"mapbox-gl-draw_point",title:"Marker tool "+(t.options.keybindings?"(m)":""),onActivate:function(){return t.events.changeMode(x.DRAW_POINT)},onDeactivate:function(){return t.events.trash()}})),n.trash&&(e.trash=u("trash",{container:o,className:"mapbox-gl-draw_trash",title:"Delete",onActivate:function(){t.events.trash()}})),n.combine_features&&(e.combine_features=u("combineFeatures",{container:o,className:"mapbox-gl-draw_combine",title:"Combine",onActivate:function(){t.events.combineFeatures()}})),n.uncombine_features&&(e.uncombine_features=u("uncombineFeatures",{container:o,className:"mapbox-gl-draw_uncombine",title:"Uncombine",onActivate:function(){t.events.uncombineFeatures()}})),o):o},removeButtons:function(){Object.keys(e).forEach((function(t){var n=e[t];n.parentNode&&n.parentNode.removeChild(n),delete e[t]}))}}}(e),e.container=i.getContainer(),e.store=new tt(e),n=e.ui.addButtons(),e.options.boxSelect&&(i.boxZoom.disable(),i.dragPan.disable(),i.dragPan.enable()),i.loaded()?r.connect():(i.on("load",r.connect),o=setInterval((function(){i.loaded()&&r.connect()}),16)),e.events.start(),n},addLayers:function(){e.map.addSource(c,{data:{type:b,features:[]},type:"geojson"}),e.map.addSource(u,{data:{type:b,features:[]},type:"geojson"}),e.options.styles.forEach((function(t){e.map.addLayer(t)})),e.store.setDirty(!0),e.store.render()},removeLayers:function(){e.options.styles.forEach((function(t){e.map.getLayer(t.id)&&e.map.removeLayer(t.id)})),e.map.getSource(c)&&e.map.removeSource(c),e.map.getSource(u)&&e.map.removeSource(u)}};return e.setup=r,r}function at(t){return function(e){var n=e.featureTarget;return!!n&&!!n.properties&&n.properties.meta===t}}function st(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.active===I&&t.featureTarget.properties.meta===w}function ut(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.active===P&&t.featureTarget.properties.meta===w}function ct(t){return void 0===t.featureTarget}function lt(t){var e=t.featureTarget;return!!e&&!!e.properties&&e.properties.meta===E}function dt(t){return!!t.originalEvent&&!0===t.originalEvent.shiftKey}function pt(t){return 27===t.keyCode}function ht(t){return 13===t.keyCode}var ft=gt;function gt(t,e){this.x=t,this.y=e}function yt(t,e){var n=e.getBoundingClientRect();return new ft(t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0))}function mt(t,e,n,o){return{type:g,properties:{meta:E,parent:t,coord_path:n,active:o?I:P},geometry:{type:v,coordinates:e}}}function vt(t,e,n){void 0===e&&(e={}),void 0===n&&(n=null);var o,r=t.geometry,i=r.type,a=r.coordinates,s=t.properties&&t.properties.id,u=[];function c(t,n){var o="",r=null;t.forEach((function(t,i){var a=null!=n?n+"."+i:String(i),c=mt(s,t,a,l(a));if(e.midpoints&&r){var d=function(t,e,n){var o=e.geometry.coordinates,r=n.geometry.coordinates;if(o[1]>85||o[1]<-85||r[1]>85||r[1]<-85)return null;var i={lng:(o[0]+r[0])/2,lat:(o[1]+r[1])/2};return{type:g,properties:{meta:M,parent:t,lng:i.lng,lat:i.lat,coord_path:n.properties.coord_path},geometry:{type:v,coordinates:[i.lng,i.lat]}}}(s,r,c);d&&u.push(d)}r=c;var p=JSON.stringify(t);o!==p&&u.push(c),0===i&&(o=p)}))}function l(t){return!!e.selectedPaths&&-1!==e.selectedPaths.indexOf(t)}return i===v?u.push(mt(s,a,n,l(n))):i===y?a.forEach((function(t,e){c(t,null!==n?n+"."+e:String(e))})):i===m?c(a,n):0===i.indexOf(_)&&(o=i.replace(_,""),a.forEach((function(n,r){var i={type:g,properties:t.properties,geometry:{type:o,coordinates:n}};u=u.concat(vt(i,e,r))}))),u}gt.prototype={clone:function(){return new gt(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),o=e*this.x-n*this.y,r=n*this.x+e*this.y;return this.x=o,this.y=r,this},_rotateAround:function(t,e){var n=Math.cos(t),o=Math.sin(t),r=e.x+n*(this.x-e.x)-o*(this.y-e.y),i=e.y+o*(this.x-e.x)+n*(this.y-e.y);return this.x=r,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},gt.convert=function(t){return t instanceof gt?t:Array.isArray(t)?new gt(t[0],t[1]):t};var bt=function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t._ctx&&t._ctx.store&&t._ctx.store.getInitialConfigValue&&t._ctx.store.getInitialConfigValue("doubleClickZoom")&&t.map.doubleClickZoom.enable()}),0)},_t=function(t){setTimeout((function(){t.map&&t.map.doubleClickZoom&&t.map.doubleClickZoom.disable()}),0)},xt=function(t){if(!t||!t.type)return null;var e=St[t.type];return e?"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featurecollection"===e?t:void 0:null},St={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function Ct(t){switch(t&&t.type||null){case"FeatureCollection":return t.features=t.features.reduce((function(t,e){return t.concat(Ct(e))}),[]),t;case"Feature":return t.geometry?Ct(t.geometry).map((function(e){var n={type:"Feature",properties:JSON.parse(JSON.stringify(t.properties)),geometry:e};return void 0!==t.id&&(n.id=t.id),n})):[t];case"MultiPoint":return t.coordinates.map((function(t){return{type:"Point",coordinates:t}}));case"MultiPolygon":return t.coordinates.map((function(t){return{type:"Polygon",coordinates:t}}));case"MultiLineString":return t.coordinates.map((function(t){return{type:"LineString",coordinates:t}}));case"GeometryCollection":return t.geometries.map(Ct).reduce((function(t,e){return t.concat(e)}),[]);case"Point":case"Polygon":case"LineString":return[t]}}var wt=R((function(t){var e=t.exports=function(t){return new n(t)};function n(t){this.value=t}function o(t,e,n){var o=[],a=[],l=!0;return function t(d){var p=n?r(d):d,h={},f=!0,g={node:p,node_:d,path:[].concat(o),parent:a[a.length-1],parents:a,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(t,e){g.isRoot||(g.parent.node[g.key]=t),g.node=t,e&&(f=!1)},delete:function(t){delete g.parent.node[g.key],t&&(f=!1)},remove:function(t){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],t&&(f=!1)},keys:null,before:function(t){h.before=t},after:function(t){h.after=t},pre:function(t){h.pre=t},post:function(t){h.post=t},stop:function(){l=!1},block:function(){f=!1}};if(!l)return g;function y(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=i(g.node)),g.isLeaf=0==g.keys.length;for(var t=0;t<a.length;t++)if(a[t].node_===d){g.circular=a[t];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}y();var m=e.call(g,g.node);return void 0!==m&&g.update&&g.update(m),h.before&&h.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(a.push(g),y(),u(g.keys,(function(e,r){o.push(e),h.pre&&h.pre.call(g,g.node[e],e);var i=t(g.node[e]);n&&c.call(g.node,e)&&(g.node[e]=i.node),i.isLast=r==g.keys.length-1,i.isFirst=0==r,h.post&&h.post.call(g,i),o.pop()})),a.pop()),h.after&&h.after.call(g,g.node),g):g}(t).node}function r(t){if("object"==typeof t&&null!==t){var e;if(s(t))e=[];else if("[object Date]"===a(t))e=new Date(t.getTime?t.getTime():t);else if(function(t){return"[object RegExp]"===a(t)}(t))e=new RegExp(t);else if(function(t){return"[object Error]"===a(t)}(t))e={message:t.message};else if(function(t){return"[object Boolean]"===a(t)}(t))e=new Boolean(t);else if(function(t){return"[object Number]"===a(t)}(t))e=new Number(t);else if(function(t){return"[object String]"===a(t)}(t))e=new String(t);else if(Object.create&&Object.getPrototypeOf)e=Object.create(Object.getPrototypeOf(t));else if(t.constructor===Object)e={};else{var n=t.constructor&&t.constructor.prototype||t.__proto__||{},o=function(){};o.prototype=n,e=new o}return u(i(t),(function(n){e[n]=t[n]})),e}return t}n.prototype.get=function(t){for(var e=this.value,n=0;n<t.length;n++){var o=t[n];if(!e||!c.call(e,o)){e=void 0;break}e=e[o]}return e},n.prototype.has=function(t){for(var e=this.value,n=0;n<t.length;n++){var o=t[n];if(!e||!c.call(e,o))return!1;e=e[o]}return!0},n.prototype.set=function(t,e){for(var n=this.value,o=0;o<t.length-1;o++){var r=t[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[t[o]]=e,e},n.prototype.map=function(t){return o(this.value,t,!0)},n.prototype.forEach=function(t){return this.value=o(this.value,t,!1),this.value},n.prototype.reduce=function(t,e){var n=1===arguments.length,o=n?this.value:e;return this.forEach((function(e){this.isRoot&&n||(o=t.call(this,o,e))})),o},n.prototype.paths=function(){var t=[];return this.forEach((function(e){t.push(this.path)})),t},n.prototype.nodes=function(){var t=[];return this.forEach((function(e){t.push(this.node)})),t},n.prototype.clone=function(){var t=[],e=[];return function n(o){for(var a=0;a<t.length;a++)if(t[a]===o)return e[a];if("object"==typeof o&&null!==o){var s=r(o);return t.push(o),e.push(s),u(i(o),(function(t){s[t]=n(o[t])})),t.pop(),e.pop(),s}return o}(this.value)};var i=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};function a(t){return Object.prototype.toString.call(t)}var s=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},u=function(t,e){if(t.forEach)return t.forEach(e);for(var n=0;n<t.length;n++)e(t[n],n,t)};u(i(n.prototype),(function(t){e[t]=function(e){var o=[].slice.call(arguments,1),r=new n(e);return r[t].apply(r,o)}}));var c=Object.hasOwnProperty||function(t,e){return e in t}})),Mt=Et;function Et(t){if(!(this instanceof Et))return new Et(t);this._bbox=t||[1/0,1/0,-1/0,-1/0],this._valid=!!t}Et.prototype.include=function(t){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},Et.prototype.equals=function(t){var e;return e=t instanceof Et?t.bbox():t,this._bbox[0]==e[0]&&this._bbox[1]==e[1]&&this._bbox[2]==e[2]&&this._bbox[3]==e[3]},Et.prototype.center=function(t){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},Et.prototype.union=function(t){var e;return this._valid=!0,e=t instanceof Et?t.bbox():t,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},Et.prototype.bbox=function(){return this._valid?this._bbox:null},Et.prototype.contains=function(t){if(!t)return this._fastContains();if(!this._valid)return null;var e=t[0],n=t[1];return this._bbox[0]<=e&&this._bbox[1]<=n&&this._bbox[2]>=e&&this._bbox[3]>=n},Et.prototype.intersect=function(t){return this._valid?(e=t instanceof Et?t.bbox():t,!(this._bbox[0]>e[2]||this._bbox[2]<e[0]||this._bbox[3]<e[1]||this._bbox[1]>e[3])):null;var e},Et.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var t="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",t)},Et.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var It={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},Pt=Object.keys(It),Lt=function(t){return Ft(t).bbox()};function Ft(t){for(var e=Mt(),n=function(t){if(!t)return[];var e=Ct(xt(t)),n=[];return e.features.forEach((function(t){t.geometry&&(n=n.concat(function t(e){return Array.isArray(e)&&e.length&&"number"==typeof e[0]?[e]:e.reduce((function(e,n){return Array.isArray(n)&&Array.isArray(n[0])?e.concat(t(n)):(e.push(n),e)}),[])}(t.geometry.coordinates)))})),n}(t),o=0;o<n.length;o++)e.include(n[o]);return e}function kt(t,e){var n=-90,o=90,r=-90,i=90,a=270,s=-270;t.forEach((function(t){var e=Lt(t),u=e[1],c=e[3],l=e[0],d=e[2];u>n&&(n=u),c<o&&(o=c),c>r&&(r=c),u<i&&(i=u),l<a&&(a=l),d>s&&(s=d)}));var u=e;return n+u.lat>85&&(u.lat=85-n),r+u.lat>90&&(u.lat=90-r),o+u.lat<-85&&(u.lat=-85-o),i+u.lat<-90&&(u.lat=-90-i),a+u.lng<=-270&&(u.lng+=360*Math.ceil(Math.abs(u.lng)/360)),s+u.lng>=270&&(u.lng-=360*Math.ceil(Math.abs(u.lng)/360)),u}function Ot(t,e){var n=kt(t.map((function(t){return t.toGeoJSON()})),e);t.forEach((function(t){var e,o=t.getCoordinates(),r=function(t){var e={lng:t[0]+n.lng,lat:t[1]+n.lat};return[e.lng,e.lat]},i=function(t){return t.map((function(t){return r(t)}))};t.type===v?e=r(o):t.type===m||"MultiPoint"===t.type?e=o.map(r):t.type===y||"MultiLineString"===t.type?e=o.map(i):"MultiPolygon"===t.type&&(e=o.map((function(t){return t.map((function(t){return i(t)}))}))),t.incomingCoords(e)}))}Lt.polygon=function(t){return Ft(t).polygon()},Lt.bboxify=function(t){return wt(t).map((function(t){t&&Pt.some((function(e){return!!t[e]&&-1!==It[e].indexOf(t.type)}))&&(t.bbox=Ft(t).bbox(),this.update(t))}))};var Tt={onSetup:function(t){var e=this,n={dragMoveLocation:null,boxSelectStartLocation:null,boxSelectElement:void 0,boxSelecting:!1,canBoxSelect:!1,dragMoving:!1,canDragMove:!1,initiallySelectedFeatureIds:t.featureIds||[]};return this.setSelected(n.initiallySelectedFeatureIds.filter((function(t){return void 0!==e.getFeature(t)}))),this.fireActionable(),this.setActionableState({combineFeatures:!0,uncombineFeatures:!0,trash:!0}),n},fireUpdate:function(){this.map.fire(C,{action:"move",features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(){var t=this,e=this.getSelected(),n=e.filter((function(e){return t.isInstanceOf("MultiFeature",e)})),o=!1;if(e.length>1){o=!0;var r=e[0].type.replace("Multi","");e.forEach((function(t){t.type.replace("Multi","")!==r&&(o=!1)}))}var i=n.length>0,a=e.length>0;this.setActionableState({combineFeatures:o,uncombineFeatures:i,trash:a})},getUniqueIds:function(t){return t.length?t.map((function(t){return t.properties.id})).filter((function(t){return void 0!==t})).reduce((function(t,e){return t.add(e),t}),new O).values():[]},stopExtendedInteractions:function(t){t.boxSelectElement&&(t.boxSelectElement.parentNode&&t.boxSelectElement.parentNode.removeChild(t.boxSelectElement),t.boxSelectElement=null),this.map.dragPan.enable(),t.boxSelecting=!1,t.canBoxSelect=!1,t.dragMoving=!1,t.canDragMove=!1},onStop:function(){bt(this)},onMouseMove:function(t){return this.stopExtendedInteractions(t),!0},onMouseOut:function(t){return!t.dragMoving||this.fireUpdate()}};Tt.onTap=Tt.onClick=function(t,e){return ct(e)?this.clickAnywhere(t,e):at(E)(e)?this.clickOnVertex(t,e):function(t){return!!t.featureTarget&&!!t.featureTarget.properties&&t.featureTarget.properties.meta===w}(e)?this.clickOnFeature(t,e):void 0},Tt.clickAnywhere=function(t){var e=this,n=this.getSelectedIds();n.length&&(this.clearSelectedFeatures(),n.forEach((function(t){return e.doRender(t)}))),bt(this),this.stopExtendedInteractions(t)},Tt.clickOnVertex=function(t,e){this.changeMode(x.DIRECT_SELECT,{featureId:e.featureTarget.properties.parent,coordPath:e.featureTarget.properties.coord_path,startPos:e.lngLat}),this.updateUIClasses({mouse:d})},Tt.startOnActiveFeature=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),this.doRender(e.featureTarget.properties.id),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},Tt.clickOnFeature=function(t,e){var n=this;_t(this),this.stopExtendedInteractions(t);var o=dt(e),r=this.getSelectedIds(),i=e.featureTarget.properties.id,a=this.isSelected(i);if(!o&&a&&this.getFeature(i).type!==v)return this.changeMode(x.DIRECT_SELECT,{featureId:i});a&&o?(this.deselect(i),this.updateUIClasses({mouse:p}),1===r.length&&bt(this)):!a&&o?(this.select(i),this.updateUIClasses({mouse:d})):a||o||(r.forEach((function(t){return n.doRender(t)})),this.setSelected(i),this.updateUIClasses({mouse:d})),this.doRender(i)},Tt.onMouseDown=function(t,e){return st(e)?this.startOnActiveFeature(t,e):this.drawConfig.boxSelect&&function(t){return!!t.originalEvent&&!!t.originalEvent.shiftKey&&0===t.originalEvent.button}(e)?this.startBoxSelect(t,e):void 0},Tt.startBoxSelect=function(t,e){this.stopExtendedInteractions(t),this.map.dragPan.disable(),t.boxSelectStartLocation=yt(e.originalEvent,this.map.getContainer()),t.canBoxSelect=!0},Tt.onTouchStart=function(t,e){if(st(e))return this.startOnActiveFeature(t,e)},Tt.onDrag=function(t,e){return t.canDragMove?this.dragMove(t,e):this.drawConfig.boxSelect&&t.canBoxSelect?this.whileBoxSelect(t,e):void 0},Tt.whileBoxSelect=function(t,e){t.boxSelecting=!0,this.updateUIClasses({mouse:l}),t.boxSelectElement||(t.boxSelectElement=document.createElement("div"),t.boxSelectElement.classList.add("mapbox-gl-draw_boxselect"),this.map.getContainer().appendChild(t.boxSelectElement));var n=yt(e.originalEvent,this.map.getContainer()),o=Math.min(t.boxSelectStartLocation.x,n.x),r=Math.max(t.boxSelectStartLocation.x,n.x),i=Math.min(t.boxSelectStartLocation.y,n.y),a=Math.max(t.boxSelectStartLocation.y,n.y),s="translate("+o+"px, "+i+"px)";t.boxSelectElement.style.transform=s,t.boxSelectElement.style.WebkitTransform=s,t.boxSelectElement.style.width=r-o+"px",t.boxSelectElement.style.height=a-i+"px"},Tt.dragMove=function(t,e){t.dragMoving=!0,e.originalEvent.stopPropagation();var n={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};Ot(this.getSelected(),n),t.dragMoveLocation=e.lngLat},Tt.onMouseUp=function(t,e){var n=this;if(t.dragMoving)this.fireUpdate();else if(t.boxSelecting){var o=[t.boxSelectStartLocation,yt(e.originalEvent,this.map.getContainer())],r=this.featuresAt(null,o,"click"),i=this.getUniqueIds(r).filter((function(t){return!n.isSelected(t)}));i.length&&(this.select(i),i.forEach((function(t){return n.doRender(t)})),this.updateUIClasses({mouse:d}))}this.stopExtendedInteractions(t)},Tt.toDisplayFeatures=function(t,e,n){e.properties.active=this.isSelected(e.properties.id)?I:P,n(e),this.fireActionable(),e.properties.active===I&&e.geometry.type!==v&&vt(e).forEach(n)},Tt.onTrash=function(){this.deleteFeature(this.getSelectedIds()),this.fireActionable()},Tt.onCombineFeatures=function(){var t=this.getSelected();if(!(0===t.length||t.length<2)){for(var e=[],n=[],o=t[0].type.replace("Multi",""),r=0;r<t.length;r++){var i=t[r];if(i.type.replace("Multi","")!==o)return;i.type.includes("Multi")?i.getCoordinates().forEach((function(t){e.push(t)})):e.push(i.getCoordinates()),n.push(i.toGeoJSON())}if(n.length>1){var a=this.newFeature({type:g,properties:n[0].properties,geometry:{type:"Multi"+o,coordinates:e}});this.addFeature(a),this.deleteFeature(this.getSelectedIds(),{silent:!0}),this.setSelected([a.id]),this.map.fire("draw.combine",{createdFeatures:[a.toGeoJSON()],deletedFeatures:n})}this.fireActionable()}},Tt.onUncombineFeatures=function(){var t=this,e=this.getSelected();if(0!==e.length){for(var n=[],o=[],r=function(r){var i=e[r];t.isInstanceOf("MultiFeature",i)&&(i.getFeatures().forEach((function(e){t.addFeature(e),e.properties=i.properties,n.push(e.toGeoJSON()),t.select([e.id])})),t.deleteFeature(i.id,{silent:!0}),o.push(i.toGeoJSON()))},i=0;i<e.length;i++)r(i);n.length>1&&this.map.fire("draw.uncombine",{createdFeatures:n,deletedFeatures:o}),this.fireActionable()}};var At=at(E),jt=at(M),Dt={fireUpdate:function(){this.map.fire(C,{action:"change_coordinates",features:this.getSelected().map((function(t){return t.toGeoJSON()}))})},fireActionable:function(t){this.setActionableState({combineFeatures:!1,uncombineFeatures:!1,trash:t.selectedCoordPaths.length>0})},startDragging:function(t,e){this.map.dragPan.disable(),t.canDragMove=!0,t.dragMoveLocation=e.lngLat},stopDragging:function(t){this.map.dragPan.enable(),t.dragMoving=!1,t.canDragMove=!1,t.dragMoveLocation=null},onVertex:function(t,e){this.startDragging(t,e);var n=e.featureTarget.properties,o=t.selectedCoordPaths.indexOf(n.coord_path);dt(e)||-1!==o?dt(e)&&-1===o&&t.selectedCoordPaths.push(n.coord_path):t.selectedCoordPaths=[n.coord_path];var r=this.pathsToCoordinates(t.featureId,t.selectedCoordPaths);this.setSelectedCoordinates(r)},onMidpoint:function(t,e){this.startDragging(t,e);var n=e.featureTarget.properties;t.feature.addCoordinate(n.coord_path,n.lng,n.lat),this.fireUpdate(),t.selectedCoordPaths=[n.coord_path]},pathsToCoordinates:function(t,e){return e.map((function(e){return{feature_id:t,coord_path:e}}))},onFeature:function(t,e){0===t.selectedCoordPaths.length?this.startDragging(t,e):this.stopDragging(t)},dragFeature:function(t,e,n){Ot(this.getSelected(),n),t.dragMoveLocation=e.lngLat},dragVertex:function(t,e,n){for(var o=t.selectedCoordPaths.map((function(e){return t.feature.getCoordinate(e)})),r=kt(o.map((function(t){return{type:g,properties:{},geometry:{type:v,coordinates:t}}})),n),i=0;i<o.length;i++){var a=o[i];t.feature.updateCoordinate(t.selectedCoordPaths[i],a[0]+r.lng,a[1]+r.lat)}},clickNoTarget:function(){this.changeMode(x.SIMPLE_SELECT)},clickInactive:function(){this.changeMode(x.SIMPLE_SELECT)},clickActiveFeature:function(t){t.selectedCoordPaths=[],this.clearSelectedCoordinates(),t.feature.changed()},onSetup:function(t){var e=t.featureId,n=this.getFeature(e);if(!n)throw new Error("You must provide a featureId to enter direct_select mode");if(n.type===v)throw new TypeError("direct_select mode doesn't handle point features");var o={featureId:e,feature:n,dragMoveLocation:t.startPos||null,dragMoving:!1,canDragMove:!1,selectedCoordPaths:t.coordPath?[t.coordPath]:[]};return this.setSelectedCoordinates(this.pathsToCoordinates(e,o.selectedCoordPaths)),this.setSelected(e),_t(this),this.setActionableState({trash:!0}),o},onStop:function(){bt(this),this.clearSelectedCoordinates()},toDisplayFeatures:function(t,e,n){t.featureId===e.properties.id?(e.properties.active=I,n(e),vt(e,{map:this.map,midpoints:!0,selectedPaths:t.selectedCoordPaths}).forEach(n)):(e.properties.active=P,n(e)),this.fireActionable(t)},onTrash:function(t){t.selectedCoordPaths.sort((function(t,e){return e.localeCompare(t,"en",{numeric:!0})})).forEach((function(e){return t.feature.removeCoordinate(e)})),this.fireUpdate(),t.selectedCoordPaths=[],this.clearSelectedCoordinates(),this.fireActionable(t),!1===t.feature.isValid()&&(this.deleteFeature([t.featureId]),this.changeMode(x.SIMPLE_SELECT,{}))},onMouseMove:function(t,e){var n=st(e),o=At(e),r=0===t.selectedCoordPaths.length;return n&&r||o&&!r?this.updateUIClasses({mouse:d}):this.updateUIClasses({mouse:h}),this.stopDragging(t),!0},onMouseOut:function(t){return t.dragMoving&&this.fireUpdate(),!0}};Dt.onTouchStart=Dt.onMouseDown=function(t,e){return At(e)?this.onVertex(t,e):st(e)?this.onFeature(t,e):jt(e)?this.onMidpoint(t,e):void 0},Dt.onDrag=function(t,e){if(!0===t.canDragMove){t.dragMoving=!0,e.originalEvent.stopPropagation();var n={lng:e.lngLat.lng-t.dragMoveLocation.lng,lat:e.lngLat.lat-t.dragMoveLocation.lat};t.selectedCoordPaths.length>0?this.dragVertex(t,e,n):this.dragFeature(t,e,n),t.dragMoveLocation=e.lngLat}},Dt.onClick=function(t,e){return ct(e)?this.clickNoTarget(t,e):st(e)?this.clickActiveFeature(t,e):ut(e)?this.clickInactive(t,e):void this.stopDragging(t)},Dt.onTap=function(t,e){return ct(e)?this.clickNoTarget(t,e):st(e)?this.clickActiveFeature(t,e):ut(e)?this.clickInactive(t,e):void 0},Dt.onTouchEnd=Dt.onMouseUp=function(t){t.dragMoving&&this.fireUpdate(),this.stopDragging(t)};var Nt={};function Ut(t,e){return!!t.lngLat&&t.lngLat.lng===e[0]&&t.lngLat.lat===e[1]}Nt.onSetup=function(){var t=this.newFeature({type:g,properties:{},geometry:{type:v,coordinates:[]}});return this.addFeature(t),this.clearSelectedFeatures(),this.updateUIClasses({mouse:l}),this.activateUIButton(f.POINT),this.setActionableState({trash:!0}),{point:t}},Nt.stopDrawingAndRemove=function(t){this.deleteFeature([t.point.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT)},Nt.onTap=Nt.onClick=function(t,e){this.updateUIClasses({mouse:d}),t.point.updateCoordinate("",e.lngLat.lng,e.lngLat.lat),this.map.fire(S,{features:[t.point.toGeoJSON()]}),this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.point.id]})},Nt.onStop=function(t){this.activateUIButton(),t.point.getCoordinate().length||this.deleteFeature([t.point.id],{silent:!0})},Nt.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.point.id;if(e.properties.active=o?I:P,!o)return n(e)},Nt.onTrash=Nt.stopDrawingAndRemove,Nt.onKeyUp=function(t,e){if(pt(e)||ht(e))return this.stopDrawingAndRemove(t,e)};var Bt={onSetup:function(){var t=this.newFeature({type:g,properties:{},geometry:{type:y,coordinates:[[]]}});return this.addFeature(t),this.clearSelectedFeatures(),_t(this),this.updateUIClasses({mouse:l}),this.activateUIButton(f.POLYGON),this.setActionableState({trash:!0}),{polygon:t,currentVertexPosition:0}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&Ut(e,t.polygon.coordinates[0][t.currentVertexPosition-1]))return this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.polygon.id]});this.updateUIClasses({mouse:l}),t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),t.currentVertexPosition++,t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},onMouseMove:function(t,e){t.polygon.updateCoordinate("0."+t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),lt(e)&&this.updateUIClasses({mouse:p})}};Bt.onTap=Bt.onClick=function(t,e){return lt(e)?this.clickOnVertex(t,e):this.clickAnywhere(t,e)},Bt.onKeyUp=function(t,e){pt(e)?(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT)):ht(e)&&this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.polygon.id]})},Bt.onStop=function(t){this.updateUIClasses({mouse:h}),bt(this),this.activateUIButton(),void 0!==this.getFeature(t.polygon.id)&&(t.polygon.removeCoordinate("0."+t.currentVertexPosition),t.polygon.isValid()?this.map.fire(S,{features:[t.polygon.toGeoJSON()]}):(this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT,{},{silent:!0})))},Bt.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.polygon.id;if(e.properties.active=o?I:P,!o)return n(e);if(0!==e.geometry.coordinates.length){var r=e.geometry.coordinates[0].length;if(!(r<3)){if(e.properties.meta=w,n(mt(t.polygon.id,e.geometry.coordinates[0][0],"0.0",!1)),r>3){var i=e.geometry.coordinates[0].length-3;n(mt(t.polygon.id,e.geometry.coordinates[0][i],"0."+i,!1))}if(r<=4){var a=[[e.geometry.coordinates[0][0][0],e.geometry.coordinates[0][0][1]],[e.geometry.coordinates[0][1][0],e.geometry.coordinates[0][1][1]]];if(n({type:g,properties:e.properties,geometry:{coordinates:a,type:m}}),3===r)return}return n(e)}}},Bt.onTrash=function(t){this.deleteFeature([t.polygon.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT)};var Rt={onSetup:function(t){var e,n,o=(t=t||{}).featureId,r="forward";if(o){if(!(e=this.getFeature(o)))throw new Error("Could not find a feature with the provided featureId");var i=t.from;if(i&&"Feature"===i.type&&i.geometry&&"Point"===i.geometry.type&&(i=i.geometry),i&&"Point"===i.type&&i.coordinates&&2===i.coordinates.length&&(i=i.coordinates),!i||!Array.isArray(i))throw new Error("Please use the `from` property to indicate which point to continue the line from");var a=e.coordinates.length-1;if(e.coordinates[a][0]===i[0]&&e.coordinates[a][1]===i[1])n=a+1,e.addCoordinate.apply(e,[n].concat(e.coordinates[a]));else{if(e.coordinates[0][0]!==i[0]||e.coordinates[0][1]!==i[1])throw new Error("`from` should match the point at either the start or the end of the provided LineString");r="backwards",n=0,e.addCoordinate.apply(e,[n].concat(e.coordinates[0]))}}else e=this.newFeature({type:g,properties:{},geometry:{type:m,coordinates:[]}}),n=0,this.addFeature(e);return this.clearSelectedFeatures(),_t(this),this.updateUIClasses({mouse:l}),this.activateUIButton(f.LINE),this.setActionableState({trash:!0}),{line:e,currentVertexPosition:n,direction:r}},clickAnywhere:function(t,e){if(t.currentVertexPosition>0&&Ut(e,t.line.coordinates[t.currentVertexPosition-1])||"backwards"===t.direction&&Ut(e,t.line.coordinates[t.currentVertexPosition+1]))return this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.line.id]});this.updateUIClasses({mouse:l}),t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),"forward"===t.direction?(t.currentVertexPosition++,t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat)):t.line.addCoordinate(0,e.lngLat.lng,e.lngLat.lat)},clickOnVertex:function(t){return this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.line.id]})},onMouseMove:function(t,e){t.line.updateCoordinate(t.currentVertexPosition,e.lngLat.lng,e.lngLat.lat),lt(e)&&this.updateUIClasses({mouse:p})}};Rt.onTap=Rt.onClick=function(t,e){if(lt(e))return this.clickOnVertex(t,e);this.clickAnywhere(t,e)},Rt.onKeyUp=function(t,e){ht(e)?this.changeMode(x.SIMPLE_SELECT,{featureIds:[t.line.id]}):pt(e)&&(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT))},Rt.onStop=function(t){bt(this),this.activateUIButton(),void 0!==this.getFeature(t.line.id)&&(t.line.removeCoordinate(""+t.currentVertexPosition),t.line.isValid()?this.map.fire(S,{features:[t.line.toGeoJSON()]}):(this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT,{},{silent:!0})))},Rt.onTrash=function(t){this.deleteFeature([t.line.id],{silent:!0}),this.changeMode(x.SIMPLE_SELECT)},Rt.toDisplayFeatures=function(t,e,n){var o=e.properties.id===t.line.id;if(e.properties.active=o?I:P,!o)return n(e);e.geometry.coordinates.length<2||(e.properties.meta=w,n(mt(t.line.id,e.geometry.coordinates["forward"===t.direction?e.geometry.coordinates.length-2:1],""+("forward"===t.direction?e.geometry.coordinates.length-2:1),!1)),n(e))};var Vt={simple_select:Tt,direct_select:Dt,draw_point:Nt,draw_polygon:Bt,draw_line_string:Rt},zt={defaultMode:x.SIMPLE_SELECT,keybindings:!0,touchEnabled:!0,clickBuffer:2,touchBuffer:25,boxSelect:!0,displayControlsDefault:!0,styles:[{id:"gl-draw-polygon-fill-inactive",type:"fill",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],paint:{"fill-color":"#3bb2d0","fill-outline-color":"#3bb2d0","fill-opacity":.1}},{id:"gl-draw-polygon-fill-active",type:"fill",filter:["all",["==","active","true"],["==","$type","Polygon"]],paint:{"fill-color":"#fbb03b","fill-outline-color":"#fbb03b","fill-opacity":.1}},{id:"gl-draw-polygon-midpoint",type:"circle",filter:["all",["==","$type","Point"],["==","meta","midpoint"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-stroke-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","Polygon"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-polygon-stroke-active",type:"line",filter:["all",["==","active","true"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-line-inactive",type:"line",filter:["all",["==","active","false"],["==","$type","LineString"],["!=","mode","static"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#3bb2d0","line-width":2}},{id:"gl-draw-line-active",type:"line",filter:["all",["==","$type","LineString"],["==","active","true"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#fbb03b","line-dasharray":[.2,2],"line-width":2}},{id:"gl-draw-polygon-and-line-vertex-stroke-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-color":"#fff"}},{id:"gl-draw-polygon-and-line-vertex-inactive",type:"circle",filter:["all",["==","meta","vertex"],["==","$type","Point"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#fbb03b"}},{id:"gl-draw-point-point-stroke-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":5,"circle-opacity":1,"circle-color":"#fff"}},{id:"gl-draw-point-inactive",type:"circle",filter:["all",["==","active","false"],["==","$type","Point"],["==","meta","feature"],["!=","mode","static"]],paint:{"circle-radius":3,"circle-color":"#3bb2d0"}},{id:"gl-draw-point-stroke-active",type:"circle",filter:["all",["==","$type","Point"],["==","active","true"],["!=","meta","midpoint"]],paint:{"circle-radius":7,"circle-color":"#fff"}},{id:"gl-draw-point-active",type:"circle",filter:["all",["==","$type","Point"],["!=","meta","midpoint"],["==","active","true"]],paint:{"circle-radius":5,"circle-color":"#fbb03b"}},{id:"gl-draw-polygon-fill-static",type:"fill",filter:["all",["==","mode","static"],["==","$type","Polygon"]],paint:{"fill-color":"#404040","fill-outline-color":"#404040","fill-opacity":.1}},{id:"gl-draw-polygon-stroke-static",type:"line",filter:["all",["==","mode","static"],["==","$type","Polygon"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-line-static",type:"line",filter:["all",["==","mode","static"],["==","$type","LineString"]],layout:{"line-cap":"round","line-join":"round"},paint:{"line-color":"#404040","line-width":2}},{id:"gl-draw-point-static",type:"circle",filter:["all",["==","mode","static"],["==","$type","Point"]],paint:{"circle-radius":5,"circle-color":"#404040"}}],modes:Vt,controls:{},userProperties:!1},Jt={point:!0,line_string:!0,polygon:!0,trash:!0,combine_features:!0,uncombine_features:!0},Gt={point:!1,line_string:!1,polygon:!1,trash:!1,combine_features:!1,uncombine_features:!1};function $t(t,e){return t.map((function(t){return t.source?t:nt(t,{id:t.id+"."+e,source:"hot"===e?u:c})}))}var qt=R((function(t,n){var o="[object Arguments]",r="[object Map]",i="[object Object]",a="[object Set]",s=/^\[object .+?Constructor\]$/,u=/^(?:0|[1-9]\d*)$/,c={};c["[object Float32Array]"]=c["[object Float64Array]"]=c["[object Int8Array]"]=c["[object Int16Array]"]=c["[object Int32Array]"]=c["[object Uint8Array]"]=c["[object Uint8ClampedArray]"]=c["[object Uint16Array]"]=c["[object Uint32Array]"]=!0,c[o]=c["[object Array]"]=c["[object ArrayBuffer]"]=c["[object Boolean]"]=c["[object DataView]"]=c["[object Date]"]=c["[object Error]"]=c["[object Function]"]=c[r]=c["[object Number]"]=c[i]=c["[object RegExp]"]=c[a]=c["[object String]"]=c["[object WeakMap]"]=!1;var l="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,p=l||d||Function("return this")(),h=n&&!n.nodeType&&n,f=h&&t&&!t.nodeType&&t,g=f&&f.exports===h,y=g&&l.process,m=function(){try{return y&&y.binding&&y.binding("util")}catch(t){}}(),v=m&&m.isTypedArray;function b(t,e){for(var n=-1,o=null==t?0:t.length;++n<o;)if(e(t[n],n,t))return!0;return!1}function _(t){var e=-1,n=Array(t.size);return t.forEach((function(t,o){n[++e]=[o,t]})),n}function x(t){var e=-1,n=Array(t.size);return t.forEach((function(t){n[++e]=t})),n}var S,C,w,M=Array.prototype,E=Function.prototype,I=Object.prototype,P=p["__core-js_shared__"],L=E.toString,F=I.hasOwnProperty,k=(S=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||""))?"Symbol(src)_1."+S:"",O=I.toString,T=RegExp("^"+L.call(F).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),A=g?p.Buffer:void 0,j=p.Symbol,D=p.Uint8Array,N=I.propertyIsEnumerable,U=M.splice,B=j?j.toStringTag:void 0,R=Object.getOwnPropertySymbols,V=A?A.isBuffer:void 0,z=(C=Object.keys,w=Object,function(t){return C(w(t))}),J=ft(p,"DataView"),G=ft(p,"Map"),$=ft(p,"Promise"),q=ft(p,"Set"),W=ft(p,"WeakMap"),Z=ft(Object,"create"),Y=vt(J),K=vt(G),H=vt($),X=vt(q),Q=vt(W),tt=j?j.prototype:void 0,et=tt?tt.valueOf:void 0;function nt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function ot(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function rt(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var o=t[e];this.set(o[0],o[1])}}function it(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new rt;++e<n;)this.add(t[e])}function at(t){var e=this.__data__=new ot(t);this.size=e.size}function st(t,e){for(var n=t.length;n--;)if(bt(t[n][0],e))return n;return-1}function ut(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":B&&B in Object(t)?function(t){var e=F.call(t,B),n=t[B];try{t[B]=void 0;var o=!0}catch(t){}var r=O.call(t);return o&&(e?t[B]=n:delete t[B]),r}(t):function(t){return O.call(t)}(t)}function ct(t){return Et(t)&&ut(t)==o}function lt(t,e,n,s,u){return t===e||(null==t||null==e||!Et(t)&&!Et(e)?t!=t&&e!=e:function(t,e,n,s,u,c){var l=xt(t),d=xt(e),p=l?"[object Array]":yt(t),h=d?"[object Array]":yt(e),f=(p=p==o?i:p)==i,g=(h=h==o?i:h)==i,y=p==h;if(y&&St(t)){if(!St(e))return!1;l=!0,f=!1}if(y&&!f)return c||(c=new at),l||It(t)?dt(t,e,n,s,u,c):function(t,e,n,o,i,s,u){switch(n){case"[object DataView]":if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=e.byteLength||!s(new D(t),new D(e)));case"[object Boolean]":case"[object Date]":case"[object Number]":return bt(+t,+e);case"[object Error]":return t.name==e.name&&t.message==e.message;case"[object RegExp]":case"[object String]":return t==e+"";case r:var c=_;case a:var l=1&o;if(c||(c=x),t.size!=e.size&&!l)return!1;var d=u.get(t);if(d)return d==e;o|=2,u.set(t,e);var p=dt(c(t),c(e),o,i,s,u);return u.delete(t),p;case"[object Symbol]":if(et)return et.call(t)==et.call(e)}return!1}(t,e,p,n,s,u,c);if(!(1&n)){var m=f&&F.call(t,"__wrapped__"),v=g&&F.call(e,"__wrapped__");if(m||v){var b=m?t.value():t,S=v?e.value():e;return c||(c=new at),u(b,S,n,s,c)}}return!!y&&(c||(c=new at),function(t,e,n,o,r,i){var a=1&n,s=pt(t),u=s.length;if(u!=pt(e).length&&!a)return!1;for(var c=u;c--;){var l=s[c];if(!(a?l in e:F.call(e,l)))return!1}var d=i.get(t);if(d&&i.get(e))return d==e;var p=!0;i.set(t,e),i.set(e,t);for(var h=a;++c<u;){var f=t[l=s[c]],g=e[l];if(o)var y=a?o(g,f,l,e,t,i):o(f,g,l,t,e,i);if(!(void 0===y?f===g||r(f,g,n,o,i):y)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var m=t.constructor,v=e.constructor;m==v||!("constructor"in t)||!("constructor"in e)||"function"==typeof m&&m instanceof m&&"function"==typeof v&&v instanceof v||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,n,s,u,c))}(t,e,n,s,lt,u))}function dt(t,e,n,o,r,i){var a=1&n,s=t.length,u=e.length;if(s!=u&&!(a&&u>s))return!1;var c=i.get(t);if(c&&i.get(e))return c==e;var l=-1,d=!0,p=2&n?new it:void 0;for(i.set(t,e),i.set(e,t);++l<s;){var h=t[l],f=e[l];if(o)var g=a?o(f,h,l,e,t,i):o(h,f,l,t,e,i);if(void 0!==g){if(g)continue;d=!1;break}if(p){if(!b(e,(function(t,e){if(a=e,!p.has(a)&&(h===t||r(h,t,n,o,i)))return p.push(e);var a}))){d=!1;break}}else if(h!==f&&!r(h,f,n,o,i)){d=!1;break}}return i.delete(t),i.delete(e),d}function pt(t){return function(t,e,n){var o=e(t);return xt(t)?o:function(t,e){for(var n=-1,o=e.length,r=t.length;++n<o;)t[r+n]=e[n];return t}(o,n(t))}(t,Pt,gt)}function ht(t,e){var n,o,r=t.__data__;return("string"==(o=typeof(n=e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==n:null===n)?r["string"==typeof e?"string":"hash"]:r.map}function ft(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Mt(t)||function(t){return!!k&&k in t}(t))&&(Ct(t)?T:s).test(vt(t))}(n)?n:void 0}nt.prototype.clear=function(){this.__data__=Z?Z(null):{},this.size=0},nt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},nt.prototype.get=function(t){var e=this.__data__;if(Z){var n=e[t];return"__lodash_hash_undefined__"===n?void 0:n}return F.call(e,t)?e[t]:void 0},nt.prototype.has=function(t){var e=this.__data__;return Z?void 0!==e[t]:F.call(e,t)},nt.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Z&&void 0===e?"__lodash_hash_undefined__":e,this},ot.prototype.clear=function(){this.__data__=[],this.size=0},ot.prototype.delete=function(t){var e=this.__data__,n=st(e,t);return!(n<0||(n==e.length-1?e.pop():U.call(e,n,1),--this.size,0))},ot.prototype.get=function(t){var e=this.__data__,n=st(e,t);return n<0?void 0:e[n][1]},ot.prototype.has=function(t){return st(this.__data__,t)>-1},ot.prototype.set=function(t,e){var n=this.__data__,o=st(n,t);return o<0?(++this.size,n.push([t,e])):n[o][1]=e,this},rt.prototype.clear=function(){this.size=0,this.__data__={hash:new nt,map:new(G||ot),string:new nt}},rt.prototype.delete=function(t){var e=ht(this,t).delete(t);return this.size-=e?1:0,e},rt.prototype.get=function(t){return ht(this,t).get(t)},rt.prototype.has=function(t){return ht(this,t).has(t)},rt.prototype.set=function(t,e){var n=ht(this,t),o=n.size;return n.set(t,e),this.size+=n.size==o?0:1,this},it.prototype.add=it.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},it.prototype.has=function(t){return this.__data__.has(t)},at.prototype.clear=function(){this.__data__=new ot,this.size=0},at.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},at.prototype.get=function(t){return this.__data__.get(t)},at.prototype.has=function(t){return this.__data__.has(t)},at.prototype.set=function(t,e){var n=this.__data__;if(n instanceof ot){var o=n.__data__;if(!G||o.length<199)return o.push([t,e]),this.size=++n.size,this;n=this.__data__=new rt(o)}return n.set(t,e),this.size=n.size,this};var gt=R?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var n=-1,o=null==t?0:t.length,r=0,i=[];++n<o;){var a=t[n];e(a)&&(i[r++]=a)}return i}(R(t),(function(e){return N.call(t,e)})))}:function(){return[]},yt=ut;function mt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||u.test(t))&&t>-1&&t%1==0&&t<e}function vt(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function bt(t,e){return t===e||t!=t&&e!=e}(J&&"[object DataView]"!=yt(new J(new ArrayBuffer(1)))||G&&yt(new G)!=r||$&&"[object Promise]"!=yt($.resolve())||q&&yt(new q)!=a||W&&"[object WeakMap]"!=yt(new W))&&(yt=function(t){var e=ut(t),n=e==i?t.constructor:void 0,o=n?vt(n):"";if(o)switch(o){case Y:return"[object DataView]";case K:return r;case H:return"[object Promise]";case X:return a;case Q:return"[object WeakMap]"}return e});var _t=ct(function(){return arguments}())?ct:function(t){return Et(t)&&F.call(t,"callee")&&!N.call(t,"callee")},xt=Array.isArray,St=V||function(){return!1};function Ct(t){if(!Mt(t))return!1;var e=ut(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}function wt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Mt(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Et(t){return null!=t&&"object"==typeof t}var It=v?function(t){return function(e){return t(e)}}(v):function(t){return Et(t)&&wt(t.length)&&!!c[ut(t)]};function Pt(t){return null!=(e=t)&&wt(e.length)&&!Ct(e)?function(t,e){var n=xt(t),o=!n&&_t(t),r=!n&&!o&&St(t),i=!n&&!o&&!r&&It(t),a=n||o||r||i,s=a?function(t,e){for(var n=-1,o=Array(t);++n<t;)o[n]=e(n);return o}(t.length,String):[],u=s.length;for(var c in t)!e&&!F.call(t,c)||a&&("length"==c||r&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||mt(c,u))||s.push(c);return s}(t):function(t){if(n=(e=t)&&e.constructor,e!==("function"==typeof n&&n.prototype||I))return z(t);var e,n,o=[];for(var r in Object(t))F.call(t,r)&&"constructor"!=r&&o.push(r);return o}(t);var e}t.exports=function(t,e){return lt(t,e)}})),Wt={Polygon:$,LineString:G,Point:J,MultiPolygon:Z,MultiLineString:Z,MultiPoint:Z},Zt=function(t,e){var n={options:t=function(t){void 0===t&&(t={});var e=nt(t);return t.controls||(e.controls={}),!1===t.displayControlsDefault?e.controls=nt(Gt,t.controls):e.controls=nt(Jt,t.controls),(e=nt(zt,e)).styles=$t(e.styles,"cold").concat($t(e.styles,"hot")),e}(t)};e=function(t,e){return e.modes=x,e.getFeatureIdsAt=function(e){return A.click({point:e},null,t).map((function(t){return t.properties.id}))},e.getSelectedIds=function(){return t.store.getSelectedIds()},e.getSelected=function(){return{type:b,features:t.store.getSelectedIds().map((function(e){return t.store.get(e)})).map((function(t){return t.toGeoJSON()}))}},e.getSelectedPoints=function(){return{type:b,features:t.store.getSelectedCoordinates().map((function(t){return{type:g,properties:{},geometry:{type:v,coordinates:t.coordinates}}}))}},e.set=function(n){if(void 0===n.type||n.type!==b||!Array.isArray(n.features))throw new Error("Invalid FeatureCollection");var o=t.store.createRenderBatch(),r=t.store.getAllIds().slice(),i=e.add(n),a=new O(i);return(r=r.filter((function(t){return!a.has(t)}))).length&&e.delete(r),o(),i},e.add=function(e){var n=JSON.parse(JSON.stringify(xt(e))).features.map((function(e){if(e.id=e.id||V(),null===e.geometry)throw new Error("Invalid geometry: null");if(void 0===t.store.get(e.id)||t.store.get(e.id).type!==e.geometry.type){var n=Wt[e.geometry.type];if(void 0===n)throw new Error("Invalid geometry type: "+e.geometry.type+".");var o=new n(t,e);t.store.add(o)}else{var r=t.store.get(e.id);r.properties=e.properties,qt(r.getCoordinates(),e.geometry.coordinates)||r.incomingCoords(e.geometry.coordinates)}return e.id}));return t.store.render(),n},e.get=function(e){var n=t.store.get(e);if(n)return n.toGeoJSON()},e.getAll=function(){return{type:b,features:t.store.getAll().map((function(t){return t.toGeoJSON()}))}},e.delete=function(n){return t.store.delete(n,{silent:!0}),e.getMode()!==x.DIRECT_SELECT||t.store.getSelectedIds().length?t.store.render():t.events.changeMode(x.SIMPLE_SELECT,void 0,{silent:!0}),e},e.deleteAll=function(){return t.store.delete(t.store.getAllIds(),{silent:!0}),e.getMode()===x.DIRECT_SELECT?t.events.changeMode(x.SIMPLE_SELECT,void 0,{silent:!0}):t.store.render(),e},e.changeMode=function(n,o){return void 0===o&&(o={}),n===x.SIMPLE_SELECT&&e.getMode()===x.SIMPLE_SELECT?(r=o.featureIds||[],i=t.store.getSelectedIds(),r.length===i.length&&JSON.stringify(r.map((function(t){return t})).sort())===JSON.stringify(i.map((function(t){return t})).sort())||(t.store.setSelected(o.featureIds,{silent:!0}),t.store.render()),e):(n===x.DIRECT_SELECT&&e.getMode()===x.DIRECT_SELECT&&o.featureId===t.store.getSelectedIds()[0]||t.events.changeMode(n,o,{silent:!0}),e);var r,i},e.getMode=function(){return t.events.getMode()},e.trash=function(){return t.events.trash({silent:!0}),e},e.combineFeatures=function(){return t.events.combineFeatures({silent:!0}),e},e.uncombineFeatures=function(){return t.events.uncombineFeatures({silent:!0}),e},e.setFeatureProperty=function(n,o,r){return t.store.setFeatureProperty(n,o,r),e},e}(n,e),n.api=e;var o=it(n);return e.onAdd=o.onAdd,e.onRemove=o.onRemove,e.types=f,e.options=t,e};function Yt(t){Zt(t,this)}return Yt.modes=Vt,Yt}()}).call(this,n(76))},557:function(t,e,n){"use strict";function o(t,e){this.x=t,this.y=e}t.exports=o,o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,n=t.y-this.y;return e*e+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[0]*this.x+t[1]*this.y,n=t[2]*this.x+t[3]*this.y;return this.x=e,this.y=n,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),n=Math.sin(t),o=e*this.x-n*this.y,r=n*this.x+e*this.y;return this.x=o,this.y=r,this},_rotateAround:function(t,e){var n=Math.cos(t),o=Math.sin(t),r=e.x+n*(this.x-e.x)-o*(this.y-e.y),i=e.y+o*(this.x-e.x)+n*(this.y-e.y);return this.x=r,this.y=i,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o?t:Array.isArray(t)?new o(t[0],t[1]):t}},558:function(t,e,n){var o=n(990),r=n(994),i=n(995),a={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},s=Object.keys(a);function u(t){for(var e=i(),n=o(t),r=0;r<n.length;r++)e.include(n[r]);return e}t.exports=function(t){return u(t).bbox()},t.exports.polygon=function(t){return u(t).polygon()},t.exports.bboxify=function(t){return r(t).map((function(t){t&&(s.some((function(e){return!!t[e]&&-1!==a[e].indexOf(t.type)}))&&(t.bbox=u(t).bbox(),this.update(t)))}))}},988:function(t,e,n){var o=n(114),r=n(989);"string"==typeof(r=r.__esModule?r.default:r)&&(r=[[t.i,r,""]]);var i={insert:"head",singleton:!1};o(r,i);t.exports=r.locals||{}},989:function(t,e,n){(e=n(115)(!1)).push([t.i,'\n/* Override default control style */\n.mapbox-gl-draw_ctrl-bottom-left,\n.mapbox-gl-draw_ctrl-top-left {\n margin-left:0;\n border-radius:0 4px 4px 0;\n}\n.mapbox-gl-draw_ctrl-top-right,\n.mapbox-gl-draw_ctrl-bottom-right {\n margin-right:0;\n border-radius:4px 0 0 4px;\n}\n.mapbox-gl-draw_ctrl-draw {\n background-color:rgba(0,0,0,0.75);\n border-color:rgba(0,0,0,0.9);\n}\n.mapbox-gl-draw_ctrl-draw > button {\n border-color:rgba(0,0,0,0.9);\n color:rgba(255,255,255,0.5);\n width:30px;\n height:30px;\n}\n.mapbox-gl-draw_ctrl-draw > button:hover {\n background-color:rgba(0,0,0,0.85);\n color:rgba(255,255,255,0.75);\n}\n.mapbox-gl-draw_ctrl-draw > button.active,\n.mapbox-gl-draw_ctrl-draw > button.active:hover {\n background-color:rgba(0,0,0,0.95);\n color:#fff;\n}\n.mapbox-gl-draw_ctrl-draw-btn {\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.mapbox-gl-draw_point {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="m10 2c-3.3 0-6 2.7-6 6s6 9 6 9 6-5.7 6-9-2.7-6-6-6zm0 2c2.1 0 3.8 1.7 3.8 3.8 0 1.5-1.8 3.9-2.9 5.2h-1.7c-1.1-1.4-2.9-3.8-2.9-5.2-.1-2.1 1.6-3.8 3.7-3.8z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_polygon {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_line {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_trash {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="M10,3.4 c-0.8,0-1.5,0.5-1.8,1.2H5l-1,1v1h12v-1l-1-1h-3.2C11.5,3.9,10.8,3.4,10,3.4z M5,8v7c0,1,1,2,2,2h6c1,0,2-1,2-2V8h-2v5.5h-1.5V8h-3 v5.5H7V8H5z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_uncombine {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="m12 2c-.3 0-.5.1-.7.3l-1 1c-.4.4-.4 1 0 1.4l1 1c.4.4 1 .4 1.4 0l1-1c.4-.4.4-1 0-1.4l-1-1c-.2-.2-.4-.3-.7-.3zm4 4c-.3 0-.5.1-.7.3l-1 1c-.4.4-.4 1 0 1.4l1 1c.4.4 1 .4 1.4 0l1-1c.4-.4.4-1 0-1.4l-1-1c-.2-.2-.4-.3-.7-.3zm-7 1c-1 0-1 1-.5 1.5.3.3 1 1 1 1l-1 1s-.5.5 0 1 1 0 1 0l1-1 1 1c.5.5 1.5.5 1.5-.5v-4zm-5 3c-.3 0-.5.1-.7.3l-1 1c-.4.4-.4 1 0 1.4l4.9 4.9c.4.4 1 .4 1.4 0l1-1c.4-.4.4-1 0-1.4l-4.9-4.9c-.1-.2-.4-.3-.7-.3z"/>%3C/svg>\');\n}\n.mapbox-gl-draw_combine {\n background-image: url(\'data:image/svg+xml;utf8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="20" height="20">%3Cpath d="M12.1,2c-0.3,0-0.5,0.1-0.7,0.3l-1,1c-0.4,0.4-0.4,1,0,1.4l4.9,4.9c0.4,0.4,1,0.4,1.4,0l1-1 c0.4-0.4,0.4-1,0-1.4l-4.9-4.9C12.6,2.1,12.3,2,12.1,2z M8,8C7,8,7,9,7.5,9.5c0.3,0.3,1,1,1,1l-1,1c0,0-0.5,0.5,0,1s1,0,1,0l1-1l1,1 C11,13,12,13,12,12V8H8z M4,10c-0.3,0-0.5,0.1-0.7,0.3l-1,1c-0.4,0.4-0.4,1,0,1.4l1,1c0.4,0.4,1,0.4,1.4,0l1-1c0.4-0.4,0.4-1,0-1.4 l-1-1C4.5,10.1,4.3,10,4,10z M8,14c-0.3,0-0.5,0.1-0.7,0.3l-1,1c-0.4,0.4-0.4,1,0,1.4l1,1c0.4,0.4,1,0.4,1.4,0l1-1 c0.4-0.4,0.4-1,0-1.4l-1-1C8.5,14.1,8.3,14,8,14z"/>%3C/svg>\');\n}\n\n.mapboxgl-map.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: pointer;\n}\n.mapboxgl-map.mouse-move .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: move;\n}\n.mapboxgl-map.mouse-add .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: crosshair;\n}\n.mapboxgl-map.mouse-move.mode-direct_select .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: grab;\n cursor: -webkit-grab;\n}\n.mapboxgl-map.mode-direct_select.feature-vertex.mouse-move .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: move;\n}\n.mapboxgl-map.mode-direct_select.feature-midpoint.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: cell;\n}\n.mapboxgl-map.mode-direct_select.feature-feature.mouse-move .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: move;\n}\n.mapboxgl-map.mode-static.mouse-pointer .mapboxgl-canvas-container.mapboxgl-interactive {\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n.mapbox-gl-draw_boxselect {\n pointer-events: none;\n position: absolute;\n top: 0;\n left: 0;\n width: 0;\n height: 0;\n background: rgba(0,0,0,.1);\n border: 2px dotted #fff;\n opacity: 0.5;\n}\n',""]),t.exports=e},990:function(t,e,n){var o=n(991),r=n(992),i=n(993);r instanceof Function||(r=r.default),t.exports=function(t){if(!t)return[];var e=r(o(t)),n=[];return e.features.forEach((function(t){t.geometry&&(n=n.concat(i(t.geometry.coordinates)))})),n}},991:function(t,e){t.exports=function(t){if(!t||!t.type)return null;var e=n[t.type];if(!e)return null;if("geometry"===e)return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]};if("feature"===e)return{type:"FeatureCollection",features:[t]};if("featurecollection"===e)return t};var n={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},993:function(t,e){t.exports=function(t){return function t(e){if(Array.isArray(e)&&e.length&&"number"==typeof e[0])return[e];return e.reduce((function(e,n){return Array.isArray(n)&&Array.isArray(n[0])?e.concat(t(n)):(e.push(n),e)}),[])}(t)}},995:function(t,e){function n(t){if(!(this instanceof n))return new n(t);this._bbox=t||[1/0,1/0,-1/0,-1/0],this._valid=!!t}t.exports=n,n.prototype.include=function(t){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],t[0]),this._bbox[1]=Math.min(this._bbox[1],t[1]),this._bbox[2]=Math.max(this._bbox[2],t[0]),this._bbox[3]=Math.max(this._bbox[3],t[1]),this},n.prototype.equals=function(t){var e;return e=t instanceof n?t.bbox():t,this._bbox[0]==e[0]&&this._bbox[1]==e[1]&&this._bbox[2]==e[2]&&this._bbox[3]==e[3]},n.prototype.center=function(t){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null},n.prototype.union=function(t){var e;return this._valid=!0,e=t instanceof n?t.bbox():t,this._bbox[0]=Math.min(this._bbox[0],e[0]),this._bbox[1]=Math.min(this._bbox[1],e[1]),this._bbox[2]=Math.max(this._bbox[2],e[2]),this._bbox[3]=Math.max(this._bbox[3],e[3]),this},n.prototype.bbox=function(){return this._valid?this._bbox:null},n.prototype.contains=function(t){if(!t)return this._fastContains();if(!this._valid)return null;var e=t[0],n=t[1];return this._bbox[0]<=e&&this._bbox[1]<=n&&this._bbox[2]>=e&&this._bbox[3]>=n},n.prototype.intersect=function(t){return this._valid?(e=t instanceof n?t.bbox():t,!(this._bbox[0]>e[2]||this._bbox[2]<e[0]||this._bbox[3]<e[1]||this._bbox[1]>e[3])):null;var e},n.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var t="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",t)},n.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null}}}]);
2
+ //# sourceMappingURL=vendors~main~57c1f6cb.8a8dd47e.iframe.bundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vendors~main~57c1f6cb.8a8dd47e.iframe.bundle.js","sources":["webpack:///vendors~main~57c1f6cb.8a8dd47e.iframe.bundle.js"],"mappings":"AAAA","sourceRoot":""}