@fleet-frontend/mower-maps 0.2.0-beta.6 → 0.2.0-beta.8

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 (460) hide show
  1. package/dist/config/constants.d.ts.map +1 -0
  2. package/dist/config/edit.d.ts.map +1 -0
  3. package/dist/config/index.d.ts.map +1 -0
  4. package/dist/config/styles.d.ts.map +1 -0
  5. package/dist/context/common.d.ts.map +1 -0
  6. package/dist/context/index.d.ts.map +1 -0
  7. package/dist/{src/context → context}/mapEdit.d.ts +1 -0
  8. package/dist/context/mapEdit.d.ts.map +1 -0
  9. package/dist/{src/context → context}/mapRequest.d.ts.map +1 -1
  10. package/dist/context/svgEdit.d.ts.map +1 -0
  11. package/dist/{src/index.d.ts → index.d.ts} +5 -1
  12. package/dist/index.d.ts.map +1 -0
  13. package/dist/index.esm.js +296 -1961
  14. package/dist/index.js +342 -2002
  15. package/dist/processor/MapDataProcessor.d.ts.map +1 -0
  16. package/dist/processor/PathDataProcessor.d.ts.map +1 -0
  17. package/dist/processor/builder/AntennaDataBuilder.d.ts.map +1 -0
  18. package/dist/processor/builder/BoundaryDataBuilder.d.ts.map +1 -0
  19. package/dist/processor/builder/ChannelDataBuilder.d.ts.map +1 -0
  20. package/dist/processor/builder/ChargingPileDataBuilder.d.ts.map +1 -0
  21. package/dist/processor/builder/ObstacleDataBuilder.d.ts.map +1 -0
  22. package/dist/processor/builder/PathDataBuilder.d.ts.map +1 -0
  23. package/dist/processor/builder/PointDataBuilder.d.ts.map +1 -0
  24. package/dist/processor/builder/SvgElementDataBuilder.d.ts.map +1 -0
  25. package/dist/processor/builder/VisionOffDataBuilder.d.ts.map +1 -0
  26. package/dist/processor/builder/index.d.ts.map +1 -0
  27. package/dist/processor/index.d.ts.map +1 -0
  28. package/dist/processor/unified/BaseData.d.ts.map +1 -0
  29. package/dist/processor/unified/UnifiedMapDataProcessor.d.ts.map +1 -0
  30. package/dist/processor/unified/index.d.ts.map +1 -0
  31. package/dist/processor/unified/initData.d.ts.map +1 -0
  32. package/dist/render/AntennaManager.d.ts.map +1 -0
  33. package/dist/render/BoundaryLabelsManager.d.ts.map +1 -0
  34. package/dist/render/BoundarySvgRender.d.ts.map +1 -0
  35. package/dist/render/ChargingPileManager.d.ts.map +1 -0
  36. package/dist/render/MowerMapOverlay.d.ts.map +1 -0
  37. package/dist/render/MowerMapRenderer.d.ts.map +1 -0
  38. package/dist/render/MowerPositionManager.d.ts.map +1 -0
  39. package/dist/render/Overlay/domHelper.d.ts.map +1 -0
  40. package/dist/render/Overlay/overlay.d.ts.map +1 -0
  41. package/dist/render/Overlay/overlayView.d.ts.map +1 -0
  42. package/dist/render/SvgMapView.d.ts.map +1 -0
  43. package/dist/render/antennas/index.d.ts.map +1 -0
  44. package/dist/render/antennas/useAntennaInfo.d.ts.map +1 -0
  45. package/dist/render/boundaryLabels/index.d.ts.map +1 -0
  46. package/dist/render/boundaryLabels/useBoundaryLabels.d.ts.map +1 -0
  47. package/dist/render/charginPile/index.d.ts.map +1 -0
  48. package/dist/render/charginPile/useChargingPile.d.ts.map +1 -0
  49. package/dist/render/components/CustomModal/index.d.ts.map +1 -0
  50. package/dist/render/components/CutHeightSlider/index.d.ts.map +1 -0
  51. package/dist/render/drag/drag.d.ts.map +1 -0
  52. package/dist/render/drag/index.d.ts.map +1 -0
  53. package/dist/render/drag/rotate.d.ts.map +1 -0
  54. package/dist/render/drag/useDrag.d.ts.map +1 -0
  55. package/dist/render/layers/AntennaLayer.d.ts.map +1 -0
  56. package/dist/render/layers/BaseLayer.d.ts.map +1 -0
  57. package/dist/render/layers/BoundaryBorderLayer.d.ts.map +1 -0
  58. package/dist/render/layers/BoundaryLayer.d.ts.map +1 -0
  59. package/dist/render/layers/ChannelLayer.d.ts.map +1 -0
  60. package/dist/render/layers/ChargingPileLayer.d.ts.map +1 -0
  61. package/dist/render/layers/DrawLayer.d.ts.map +1 -0
  62. package/dist/render/layers/ObstacleLayer.d.ts.map +1 -0
  63. package/dist/render/layers/PathLayer.d.ts.map +1 -0
  64. package/dist/render/layers/PointLayer.d.ts.map +1 -0
  65. package/dist/render/layers/SvgElementLayer.d.ts.map +1 -0
  66. package/dist/render/layers/VisionOffLayer.d.ts.map +1 -0
  67. package/dist/render/layers/index.d.ts.map +1 -0
  68. package/dist/render/layers/types.d.ts.map +1 -0
  69. package/dist/render/mowerPosition/index.d.ts.map +1 -0
  70. package/dist/render/mowerPosition/usePosition.d.ts.map +1 -0
  71. package/dist/render/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts.map +1 -0
  72. package/dist/render/svgEditMap/components/AddEntry/index.d.ts.map +1 -0
  73. package/dist/render/svgEditMap/components/Crosshair/index.d.ts.map +1 -0
  74. package/dist/render/svgEditMap/components/HandleElementInfo/boundary.d.ts.map +1 -0
  75. package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts.map +1 -0
  76. package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts.map +1 -0
  77. package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts.map +1 -0
  78. package/dist/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts.map +1 -0
  79. package/dist/render/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts.map +1 -0
  80. package/dist/render/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts.map +1 -0
  81. package/dist/render/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts.map +1 -0
  82. package/dist/render/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts.map +1 -0
  83. package/dist/render/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts.map +1 -0
  84. package/dist/render/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts.map +1 -0
  85. package/dist/render/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts.map +1 -0
  86. package/dist/render/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts.map +1 -0
  87. package/dist/render/svgEditMap/components/HandleElementInfo/doodle.d.ts.map +1 -0
  88. package/dist/render/svgEditMap/components/HandleElementInfo/index.d.ts.map +1 -0
  89. package/dist/render/svgEditMap/components/HandleElementInfo/obstacle.d.ts.map +1 -0
  90. package/dist/render/svgEditMap/components/HandleElementInfo/visionOff.d.ts.map +1 -0
  91. package/dist/render/svgEditMap/components/contants.d.ts.map +1 -0
  92. package/dist/render/svgEditMap/hooks/useCheckElement.d.ts.map +1 -0
  93. package/dist/render/svgEditMap/hooks/useCreateVisionOffElement.d.ts.map +1 -0
  94. package/dist/render/svgEditMap/hooks/useHistoryHandle.d.ts.map +1 -0
  95. package/dist/render/svgEditMap/hooks/usePolygonDrawing.d.ts.map +1 -0
  96. package/dist/{src/render → render}/svgEditMap/index.d.ts +3 -0
  97. package/dist/render/svgEditMap/index.d.ts.map +1 -0
  98. package/dist/render/svgElement/BoundaryElement/index.d.ts.map +1 -0
  99. package/dist/render/svgElement/ChannelClipPath/index.d.ts.map +1 -0
  100. package/dist/render/svgElement/ChannelElement/index.d.ts.map +1 -0
  101. package/dist/render/svgElement/DoodleElement/index.d.ts.map +1 -0
  102. package/dist/render/svgElement/DoodleTransform/index.d.ts.map +1 -0
  103. package/dist/render/svgElement/Gelement/index.d.ts.map +1 -0
  104. package/dist/render/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts.map +1 -0
  105. package/dist/render/svgElement/Mobile/CreateObstacleElement/index.d.ts.map +1 -0
  106. package/dist/render/svgElement/ObstacleElement/index.d.ts.map +1 -0
  107. package/dist/render/svgElement/PolygonELement/components/DistanceLabels.d.ts.map +1 -0
  108. package/dist/render/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts.map +1 -0
  109. package/dist/render/svgElement/PolygonELement/dashPath/index.d.ts.map +1 -0
  110. package/dist/render/svgElement/PolygonELement/index.d.ts.map +1 -0
  111. package/dist/render/svgElement/PolygonELement/vertex/index.d.ts.map +1 -0
  112. package/dist/render/svgElement/TextElement/index.d.ts.map +1 -0
  113. package/dist/render/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts.map +1 -0
  114. package/dist/render/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts.map +1 -0
  115. package/dist/render/svgElement/TransformWrapper/HandleIcon/index.d.ts.map +1 -0
  116. package/dist/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts.map +1 -0
  117. package/dist/render/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts.map +1 -0
  118. package/dist/render/svgElement/VisionOffElement/index.d.ts.map +1 -0
  119. package/dist/render/svgElement/index.d.ts.map +1 -0
  120. package/dist/render/svgMap/index.d.ts.map +1 -0
  121. package/dist/render/svgMap/useSvgMapView.d.ts.map +1 -0
  122. package/dist/store/useCurrentMowingDataStore.d.ts.map +1 -0
  123. package/dist/store/usePartitionDataStore.d.ts.map +1 -0
  124. package/dist/types/antenna.d.ts.map +1 -0
  125. package/dist/types/common.d.ts.map +1 -0
  126. package/dist/types/constants.d.ts.map +1 -0
  127. package/dist/types/edit.d.ts.map +1 -0
  128. package/dist/types/elements.d.ts.map +1 -0
  129. package/dist/types/index.d.ts.map +1 -0
  130. package/dist/types/layers.d.ts.map +1 -0
  131. package/dist/types/map.d.ts.map +1 -0
  132. package/dist/types/path.d.ts.map +1 -0
  133. package/dist/types/processor.d.ts.map +1 -0
  134. package/dist/types/realTime.d.ts.map +1 -0
  135. package/dist/{src/types → types}/renderer.d.ts +1 -0
  136. package/dist/types/renderer.d.ts.map +1 -0
  137. package/dist/types/store.d.ts.map +1 -0
  138. package/dist/types/ui.d.ts.map +1 -0
  139. package/dist/types/utils.d.ts.map +1 -0
  140. package/dist/utils/boundaryUtils.d.ts.map +1 -0
  141. package/dist/utils/common.d.ts.map +1 -0
  142. package/dist/utils/coordinates.d.ts.map +1 -0
  143. package/dist/utils/dateTimeUtils.d.ts.map +1 -0
  144. package/dist/utils/display.d.ts.map +1 -0
  145. package/dist/utils/formatUtils.d.ts.map +1 -0
  146. package/dist/utils/geometryUtils.d.ts.map +1 -0
  147. package/dist/utils/handleRealTime.d.ts.map +1 -0
  148. package/dist/utils/index.d.ts.map +1 -0
  149. package/dist/utils/mapBounds.d.ts.map +1 -0
  150. package/dist/utils/math.d.ts.map +1 -0
  151. package/dist/utils/mower.d.ts.map +1 -0
  152. package/dist/utils/pathSegments.d.ts.map +1 -0
  153. package/dist/utils/pointInBoundary.d.ts.map +1 -0
  154. package/dist/utils/sleep.d.ts.map +1 -0
  155. package/dist/utils/svgParserNative.d.ts.map +1 -0
  156. package/dist/utils/svgTransform.d.ts.map +1 -0
  157. package/dist/utils/touchEvents.d.ts.map +1 -0
  158. package/dist/utils/unionFind.d.ts.map +1 -0
  159. package/package.json +1 -1
  160. package/dist/dev/components/AddPonit/index.d.ts +0 -35
  161. package/dist/dev/components/AddPonit/index.d.ts.map +0 -1
  162. package/dist/src/config/constants.d.ts.map +0 -1
  163. package/dist/src/config/edit.d.ts.map +0 -1
  164. package/dist/src/config/index.d.ts.map +0 -1
  165. package/dist/src/config/styles.d.ts.map +0 -1
  166. package/dist/src/context/common.d.ts.map +0 -1
  167. package/dist/src/context/index.d.ts.map +0 -1
  168. package/dist/src/context/mapEdit.d.ts.map +0 -1
  169. package/dist/src/context/svgEdit.d.ts.map +0 -1
  170. package/dist/src/index.d.ts.map +0 -1
  171. package/dist/src/processor/MapDataProcessor.d.ts.map +0 -1
  172. package/dist/src/processor/PathDataProcessor.d.ts.map +0 -1
  173. package/dist/src/processor/builder/AntennaDataBuilder.d.ts.map +0 -1
  174. package/dist/src/processor/builder/BoundaryDataBuilder.d.ts.map +0 -1
  175. package/dist/src/processor/builder/ChannelDataBuilder.d.ts.map +0 -1
  176. package/dist/src/processor/builder/ChargingPileDataBuilder.d.ts.map +0 -1
  177. package/dist/src/processor/builder/ObstacleDataBuilder.d.ts.map +0 -1
  178. package/dist/src/processor/builder/PathDataBuilder.d.ts.map +0 -1
  179. package/dist/src/processor/builder/PointDataBuilder.d.ts.map +0 -1
  180. package/dist/src/processor/builder/SvgElementDataBuilder.d.ts.map +0 -1
  181. package/dist/src/processor/builder/VisionOffDataBuilder.d.ts.map +0 -1
  182. package/dist/src/processor/builder/index.d.ts.map +0 -1
  183. package/dist/src/processor/index.d.ts.map +0 -1
  184. package/dist/src/processor/unified/BaseData.d.ts.map +0 -1
  185. package/dist/src/processor/unified/UnifiedMapDataProcessor.d.ts.map +0 -1
  186. package/dist/src/processor/unified/index.d.ts.map +0 -1
  187. package/dist/src/processor/unified/initData.d.ts.map +0 -1
  188. package/dist/src/render/AntennaManager.d.ts.map +0 -1
  189. package/dist/src/render/BoundaryLabelsManager.d.ts.map +0 -1
  190. package/dist/src/render/BoundarySvgRender.d.ts.map +0 -1
  191. package/dist/src/render/ChargingPileManager.d.ts.map +0 -1
  192. package/dist/src/render/MowerMapOverlay.d.ts.map +0 -1
  193. package/dist/src/render/MowerMapRenderer.d.ts.map +0 -1
  194. package/dist/src/render/MowerPositionManager.d.ts.map +0 -1
  195. package/dist/src/render/Overlay/domHelper.d.ts.map +0 -1
  196. package/dist/src/render/Overlay/overlay.d.ts.map +0 -1
  197. package/dist/src/render/Overlay/overlayView.d.ts.map +0 -1
  198. package/dist/src/render/SvgMapView.d.ts.map +0 -1
  199. package/dist/src/render/antennas/index.d.ts.map +0 -1
  200. package/dist/src/render/antennas/useAntennaInfo.d.ts.map +0 -1
  201. package/dist/src/render/boundaryLabels/index.d.ts.map +0 -1
  202. package/dist/src/render/boundaryLabels/useBoundaryLabels.d.ts.map +0 -1
  203. package/dist/src/render/charginPile/index.d.ts.map +0 -1
  204. package/dist/src/render/charginPile/useChargingPile.d.ts.map +0 -1
  205. package/dist/src/render/components/CustomModal/index.d.ts.map +0 -1
  206. package/dist/src/render/components/CutHeightSlider/index.d.ts.map +0 -1
  207. package/dist/src/render/drag/drag.d.ts.map +0 -1
  208. package/dist/src/render/drag/index.d.ts.map +0 -1
  209. package/dist/src/render/drag/rotate.d.ts.map +0 -1
  210. package/dist/src/render/drag/useDrag.d.ts.map +0 -1
  211. package/dist/src/render/layers/AntennaLayer.d.ts.map +0 -1
  212. package/dist/src/render/layers/BaseLayer.d.ts.map +0 -1
  213. package/dist/src/render/layers/BoundaryBorderLayer.d.ts.map +0 -1
  214. package/dist/src/render/layers/BoundaryLayer.d.ts.map +0 -1
  215. package/dist/src/render/layers/ChannelLayer.d.ts.map +0 -1
  216. package/dist/src/render/layers/ChargingPileLayer.d.ts.map +0 -1
  217. package/dist/src/render/layers/DrawLayer.d.ts.map +0 -1
  218. package/dist/src/render/layers/ObstacleLayer.d.ts.map +0 -1
  219. package/dist/src/render/layers/PathLayer.d.ts.map +0 -1
  220. package/dist/src/render/layers/PointLayer.d.ts.map +0 -1
  221. package/dist/src/render/layers/SvgElementLayer.d.ts.map +0 -1
  222. package/dist/src/render/layers/VisionOffLayer.d.ts.map +0 -1
  223. package/dist/src/render/layers/index.d.ts.map +0 -1
  224. package/dist/src/render/layers/types.d.ts.map +0 -1
  225. package/dist/src/render/mowerPosition/index.d.ts.map +0 -1
  226. package/dist/src/render/mowerPosition/usePosition.d.ts.map +0 -1
  227. package/dist/src/render/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts.map +0 -1
  228. package/dist/src/render/svgEditMap/components/AddEntry/index.d.ts.map +0 -1
  229. package/dist/src/render/svgEditMap/components/Crosshair/index.d.ts.map +0 -1
  230. package/dist/src/render/svgEditMap/components/HandleElementInfo/boundary.d.ts.map +0 -1
  231. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts.map +0 -1
  232. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts.map +0 -1
  233. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts.map +0 -1
  234. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts.map +0 -1
  235. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts.map +0 -1
  236. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts.map +0 -1
  237. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts.map +0 -1
  238. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts.map +0 -1
  239. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts.map +0 -1
  240. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts.map +0 -1
  241. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts.map +0 -1
  242. package/dist/src/render/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts.map +0 -1
  243. package/dist/src/render/svgEditMap/components/HandleElementInfo/doodle.d.ts.map +0 -1
  244. package/dist/src/render/svgEditMap/components/HandleElementInfo/index.d.ts.map +0 -1
  245. package/dist/src/render/svgEditMap/components/HandleElementInfo/obstacle.d.ts.map +0 -1
  246. package/dist/src/render/svgEditMap/components/HandleElementInfo/visionOff.d.ts.map +0 -1
  247. package/dist/src/render/svgEditMap/components/contants.d.ts.map +0 -1
  248. package/dist/src/render/svgEditMap/hooks/useCheckElement.d.ts.map +0 -1
  249. package/dist/src/render/svgEditMap/hooks/useCreateVisionOffElement.d.ts.map +0 -1
  250. package/dist/src/render/svgEditMap/hooks/useHistoryHandle.d.ts.map +0 -1
  251. package/dist/src/render/svgEditMap/hooks/usePolygonDrawing.d.ts.map +0 -1
  252. package/dist/src/render/svgEditMap/index.d.ts.map +0 -1
  253. package/dist/src/render/svgElement/BoundaryElement/index.d.ts.map +0 -1
  254. package/dist/src/render/svgElement/ChannelClipPath/index.d.ts.map +0 -1
  255. package/dist/src/render/svgElement/ChannelElement/index.d.ts.map +0 -1
  256. package/dist/src/render/svgElement/DoodleElement/index.d.ts.map +0 -1
  257. package/dist/src/render/svgElement/DoodleTransform/index.d.ts.map +0 -1
  258. package/dist/src/render/svgElement/Gelement/index.d.ts.map +0 -1
  259. package/dist/src/render/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts.map +0 -1
  260. package/dist/src/render/svgElement/Mobile/CreateObstacleElement/index.d.ts.map +0 -1
  261. package/dist/src/render/svgElement/ObstacleElement/index.d.ts.map +0 -1
  262. package/dist/src/render/svgElement/PolygonELement/components/DistanceLabels.d.ts.map +0 -1
  263. package/dist/src/render/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts.map +0 -1
  264. package/dist/src/render/svgElement/PolygonELement/dashPath/index.d.ts.map +0 -1
  265. package/dist/src/render/svgElement/PolygonELement/index.d.ts.map +0 -1
  266. package/dist/src/render/svgElement/PolygonELement/vertex/index.d.ts.map +0 -1
  267. package/dist/src/render/svgElement/TextElement/index.d.ts.map +0 -1
  268. package/dist/src/render/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts.map +0 -1
  269. package/dist/src/render/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts.map +0 -1
  270. package/dist/src/render/svgElement/TransformWrapper/HandleIcon/index.d.ts.map +0 -1
  271. package/dist/src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts.map +0 -1
  272. package/dist/src/render/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts.map +0 -1
  273. package/dist/src/render/svgElement/VisionOffElement/index.d.ts.map +0 -1
  274. package/dist/src/render/svgElement/index.d.ts.map +0 -1
  275. package/dist/src/render/svgMap/index.d.ts.map +0 -1
  276. package/dist/src/render/svgMap/useSvgMapView.d.ts.map +0 -1
  277. package/dist/src/store/useCurrentMowingDataStore.d.ts.map +0 -1
  278. package/dist/src/store/usePartitionDataStore.d.ts.map +0 -1
  279. package/dist/src/types/antenna.d.ts.map +0 -1
  280. package/dist/src/types/common.d.ts.map +0 -1
  281. package/dist/src/types/constants.d.ts.map +0 -1
  282. package/dist/src/types/edit.d.ts.map +0 -1
  283. package/dist/src/types/elements.d.ts.map +0 -1
  284. package/dist/src/types/index.d.ts.map +0 -1
  285. package/dist/src/types/layers.d.ts.map +0 -1
  286. package/dist/src/types/map.d.ts.map +0 -1
  287. package/dist/src/types/path.d.ts.map +0 -1
  288. package/dist/src/types/processor.d.ts.map +0 -1
  289. package/dist/src/types/realTime.d.ts.map +0 -1
  290. package/dist/src/types/renderer.d.ts.map +0 -1
  291. package/dist/src/types/store.d.ts.map +0 -1
  292. package/dist/src/types/ui.d.ts.map +0 -1
  293. package/dist/src/types/utils.d.ts.map +0 -1
  294. package/dist/src/utils/boundaryUtils.d.ts.map +0 -1
  295. package/dist/src/utils/common.d.ts.map +0 -1
  296. package/dist/src/utils/coordinates.d.ts.map +0 -1
  297. package/dist/src/utils/dateTimeUtils.d.ts.map +0 -1
  298. package/dist/src/utils/display.d.ts.map +0 -1
  299. package/dist/src/utils/formatUtils.d.ts.map +0 -1
  300. package/dist/src/utils/geometryUtils.d.ts.map +0 -1
  301. package/dist/src/utils/handleRealTime.d.ts.map +0 -1
  302. package/dist/src/utils/index.d.ts.map +0 -1
  303. package/dist/src/utils/mapBounds.d.ts.map +0 -1
  304. package/dist/src/utils/math.d.ts.map +0 -1
  305. package/dist/src/utils/mower.d.ts.map +0 -1
  306. package/dist/src/utils/pathSegments.d.ts.map +0 -1
  307. package/dist/src/utils/pointInBoundary.d.ts.map +0 -1
  308. package/dist/src/utils/sleep.d.ts.map +0 -1
  309. package/dist/src/utils/svgParserNative.d.ts.map +0 -1
  310. package/dist/src/utils/svgTransform.d.ts.map +0 -1
  311. package/dist/src/utils/touchEvents.d.ts.map +0 -1
  312. package/dist/src/utils/unionFind.d.ts.map +0 -1
  313. /package/dist/{src/config → config}/constants.d.ts +0 -0
  314. /package/dist/{src/config → config}/edit.d.ts +0 -0
  315. /package/dist/{src/config → config}/index.d.ts +0 -0
  316. /package/dist/{src/config → config}/styles.d.ts +0 -0
  317. /package/dist/{src/context → context}/common.d.ts +0 -0
  318. /package/dist/{src/context → context}/index.d.ts +0 -0
  319. /package/dist/{src/context → context}/mapRequest.d.ts +0 -0
  320. /package/dist/{src/context → context}/svgEdit.d.ts +0 -0
  321. /package/dist/{src/processor → processor}/MapDataProcessor.d.ts +0 -0
  322. /package/dist/{src/processor → processor}/PathDataProcessor.d.ts +0 -0
  323. /package/dist/{src/processor → processor}/builder/AntennaDataBuilder.d.ts +0 -0
  324. /package/dist/{src/processor → processor}/builder/BoundaryDataBuilder.d.ts +0 -0
  325. /package/dist/{src/processor → processor}/builder/ChannelDataBuilder.d.ts +0 -0
  326. /package/dist/{src/processor → processor}/builder/ChargingPileDataBuilder.d.ts +0 -0
  327. /package/dist/{src/processor → processor}/builder/ObstacleDataBuilder.d.ts +0 -0
  328. /package/dist/{src/processor → processor}/builder/PathDataBuilder.d.ts +0 -0
  329. /package/dist/{src/processor → processor}/builder/PointDataBuilder.d.ts +0 -0
  330. /package/dist/{src/processor → processor}/builder/SvgElementDataBuilder.d.ts +0 -0
  331. /package/dist/{src/processor → processor}/builder/VisionOffDataBuilder.d.ts +0 -0
  332. /package/dist/{src/processor → processor}/builder/index.d.ts +0 -0
  333. /package/dist/{src/processor → processor}/index.d.ts +0 -0
  334. /package/dist/{src/processor → processor}/unified/BaseData.d.ts +0 -0
  335. /package/dist/{src/processor → processor}/unified/UnifiedMapDataProcessor.d.ts +0 -0
  336. /package/dist/{src/processor → processor}/unified/index.d.ts +0 -0
  337. /package/dist/{src/processor → processor}/unified/initData.d.ts +0 -0
  338. /package/dist/{src/render → render}/AntennaManager.d.ts +0 -0
  339. /package/dist/{src/render → render}/BoundaryLabelsManager.d.ts +0 -0
  340. /package/dist/{src/render → render}/BoundarySvgRender.d.ts +0 -0
  341. /package/dist/{src/render → render}/ChargingPileManager.d.ts +0 -0
  342. /package/dist/{src/render → render}/MowerMapOverlay.d.ts +0 -0
  343. /package/dist/{src/render → render}/MowerMapRenderer.d.ts +0 -0
  344. /package/dist/{src/render → render}/MowerPositionManager.d.ts +0 -0
  345. /package/dist/{src/render → render}/Overlay/domHelper.d.ts +0 -0
  346. /package/dist/{src/render → render}/Overlay/overlay.d.ts +0 -0
  347. /package/dist/{src/render → render}/Overlay/overlayView.d.ts +0 -0
  348. /package/dist/{src/render → render}/SvgMapView.d.ts +0 -0
  349. /package/dist/{src/render → render}/antennas/index.d.ts +0 -0
  350. /package/dist/{src/render → render}/antennas/useAntennaInfo.d.ts +0 -0
  351. /package/dist/{src/render → render}/boundaryLabels/index.d.ts +0 -0
  352. /package/dist/{src/render → render}/boundaryLabels/useBoundaryLabels.d.ts +0 -0
  353. /package/dist/{src/render → render}/charginPile/index.d.ts +0 -0
  354. /package/dist/{src/render → render}/charginPile/useChargingPile.d.ts +0 -0
  355. /package/dist/{src/render → render}/components/CustomModal/index.d.ts +0 -0
  356. /package/dist/{src/render → render}/components/CutHeightSlider/index.d.ts +0 -0
  357. /package/dist/{src/render → render}/drag/drag.d.ts +0 -0
  358. /package/dist/{src/render → render}/drag/index.d.ts +0 -0
  359. /package/dist/{src/render → render}/drag/rotate.d.ts +0 -0
  360. /package/dist/{src/render → render}/drag/useDrag.d.ts +0 -0
  361. /package/dist/{src/render → render}/layers/AntennaLayer.d.ts +0 -0
  362. /package/dist/{src/render → render}/layers/BaseLayer.d.ts +0 -0
  363. /package/dist/{src/render → render}/layers/BoundaryBorderLayer.d.ts +0 -0
  364. /package/dist/{src/render → render}/layers/BoundaryLayer.d.ts +0 -0
  365. /package/dist/{src/render → render}/layers/ChannelLayer.d.ts +0 -0
  366. /package/dist/{src/render → render}/layers/ChargingPileLayer.d.ts +0 -0
  367. /package/dist/{src/render → render}/layers/DrawLayer.d.ts +0 -0
  368. /package/dist/{src/render → render}/layers/ObstacleLayer.d.ts +0 -0
  369. /package/dist/{src/render → render}/layers/PathLayer.d.ts +0 -0
  370. /package/dist/{src/render → render}/layers/PointLayer.d.ts +0 -0
  371. /package/dist/{src/render → render}/layers/SvgElementLayer.d.ts +0 -0
  372. /package/dist/{src/render → render}/layers/VisionOffLayer.d.ts +0 -0
  373. /package/dist/{src/render → render}/layers/index.d.ts +0 -0
  374. /package/dist/{src/render → render}/layers/types.d.ts +0 -0
  375. /package/dist/{src/render → render}/mowerPosition/index.d.ts +0 -0
  376. /package/dist/{src/render → render}/mowerPosition/usePosition.d.ts +0 -0
  377. /package/dist/{src/render → render}/svgEditMap/components/AddEntry/components/DoodleModal/index.d.ts +0 -0
  378. /package/dist/{src/render → render}/svgEditMap/components/AddEntry/index.d.ts +0 -0
  379. /package/dist/{src/render → render}/svgEditMap/components/Crosshair/index.d.ts +0 -0
  380. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/boundary.d.ts +0 -0
  381. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/DirectLine.d.ts +0 -0
  382. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/index.d.ts +0 -0
  383. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/component/MowDirection/util.d.ts +0 -0
  384. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/DirectionModal/index.d.ts +0 -0
  385. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/Header/index.d.ts +0 -0
  386. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/HeightModal/index.d.ts +0 -0
  387. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/Item/index.d.ts +0 -0
  388. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/MowingEdgeModal/index.d.ts +0 -0
  389. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/NameEdit/index.d.ts +0 -0
  390. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/NameEdit/nameModal.d.ts +0 -0
  391. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/OtherInfo/index.d.ts +0 -0
  392. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/components/TimePeriod/index.d.ts +0 -0
  393. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/doodle.d.ts +0 -0
  394. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/index.d.ts +0 -0
  395. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/obstacle.d.ts +0 -0
  396. /package/dist/{src/render → render}/svgEditMap/components/HandleElementInfo/visionOff.d.ts +0 -0
  397. /package/dist/{src/render → render}/svgEditMap/components/contants.d.ts +0 -0
  398. /package/dist/{src/render → render}/svgEditMap/hooks/useCheckElement.d.ts +0 -0
  399. /package/dist/{src/render → render}/svgEditMap/hooks/useCreateVisionOffElement.d.ts +0 -0
  400. /package/dist/{src/render → render}/svgEditMap/hooks/useHistoryHandle.d.ts +0 -0
  401. /package/dist/{src/render → render}/svgEditMap/hooks/usePolygonDrawing.d.ts +0 -0
  402. /package/dist/{src/render → render}/svgElement/BoundaryElement/index.d.ts +0 -0
  403. /package/dist/{src/render → render}/svgElement/ChannelClipPath/index.d.ts +0 -0
  404. /package/dist/{src/render → render}/svgElement/ChannelElement/index.d.ts +0 -0
  405. /package/dist/{src/render → render}/svgElement/DoodleElement/index.d.ts +0 -0
  406. /package/dist/{src/render → render}/svgElement/DoodleTransform/index.d.ts +0 -0
  407. /package/dist/{src/render → render}/svgElement/Gelement/index.d.ts +0 -0
  408. /package/dist/{src/render → render}/svgElement/Mobile/CreateObstacleElement/coordinateUtils.d.ts +0 -0
  409. /package/dist/{src/render → render}/svgElement/Mobile/CreateObstacleElement/index.d.ts +0 -0
  410. /package/dist/{src/render → render}/svgElement/ObstacleElement/index.d.ts +0 -0
  411. /package/dist/{src/render → render}/svgElement/PolygonELement/components/DistanceLabels.d.ts +0 -0
  412. /package/dist/{src/render → render}/svgElement/PolygonELement/components/DragDistanceIndicator.d.ts +0 -0
  413. /package/dist/{src/render → render}/svgElement/PolygonELement/dashPath/index.d.ts +0 -0
  414. /package/dist/{src/render → render}/svgElement/PolygonELement/index.d.ts +0 -0
  415. /package/dist/{src/render → render}/svgElement/PolygonELement/vertex/index.d.ts +0 -0
  416. /package/dist/{src/render → render}/svgElement/TextElement/index.d.ts +0 -0
  417. /package/dist/{src/render → render}/svgElement/TransformWrapper/DoodleTransformWrapper/DoodleTransformWrapper.d.ts +0 -0
  418. /package/dist/{src/render → render}/svgElement/TransformWrapper/DoodleTransformWrapper/useDoodleTransform.d.ts +0 -0
  419. /package/dist/{src/render → render}/svgElement/TransformWrapper/HandleIcon/index.d.ts +0 -0
  420. /package/dist/{src/render → render}/svgElement/TransformWrapper/VisionOffTransformWrapper/VisionOffTransformWrapper.d.ts +0 -0
  421. /package/dist/{src/render → render}/svgElement/TransformWrapper/VisionOffTransformWrapper/useVisionOffTransform.d.ts +0 -0
  422. /package/dist/{src/render → render}/svgElement/VisionOffElement/index.d.ts +0 -0
  423. /package/dist/{src/render → render}/svgElement/index.d.ts +0 -0
  424. /package/dist/{src/render → render}/svgMap/index.d.ts +0 -0
  425. /package/dist/{src/render → render}/svgMap/useSvgMapView.d.ts +0 -0
  426. /package/dist/{src/store → store}/useCurrentMowingDataStore.d.ts +0 -0
  427. /package/dist/{src/store → store}/usePartitionDataStore.d.ts +0 -0
  428. /package/dist/{src/types → types}/antenna.d.ts +0 -0
  429. /package/dist/{src/types → types}/common.d.ts +0 -0
  430. /package/dist/{src/types → types}/constants.d.ts +0 -0
  431. /package/dist/{src/types → types}/edit.d.ts +0 -0
  432. /package/dist/{src/types → types}/elements.d.ts +0 -0
  433. /package/dist/{src/types → types}/index.d.ts +0 -0
  434. /package/dist/{src/types → types}/layers.d.ts +0 -0
  435. /package/dist/{src/types → types}/map.d.ts +0 -0
  436. /package/dist/{src/types → types}/path.d.ts +0 -0
  437. /package/dist/{src/types → types}/processor.d.ts +0 -0
  438. /package/dist/{src/types → types}/realTime.d.ts +0 -0
  439. /package/dist/{src/types → types}/store.d.ts +0 -0
  440. /package/dist/{src/types → types}/ui.d.ts +0 -0
  441. /package/dist/{src/types → types}/utils.d.ts +0 -0
  442. /package/dist/{src/utils → utils}/boundaryUtils.d.ts +0 -0
  443. /package/dist/{src/utils → utils}/common.d.ts +0 -0
  444. /package/dist/{src/utils → utils}/coordinates.d.ts +0 -0
  445. /package/dist/{src/utils → utils}/dateTimeUtils.d.ts +0 -0
  446. /package/dist/{src/utils → utils}/display.d.ts +0 -0
  447. /package/dist/{src/utils → utils}/formatUtils.d.ts +0 -0
  448. /package/dist/{src/utils → utils}/geometryUtils.d.ts +0 -0
  449. /package/dist/{src/utils → utils}/handleRealTime.d.ts +0 -0
  450. /package/dist/{src/utils → utils}/index.d.ts +0 -0
  451. /package/dist/{src/utils → utils}/mapBounds.d.ts +0 -0
  452. /package/dist/{src/utils → utils}/math.d.ts +0 -0
  453. /package/dist/{src/utils → utils}/mower.d.ts +0 -0
  454. /package/dist/{src/utils → utils}/pathSegments.d.ts +0 -0
  455. /package/dist/{src/utils → utils}/pointInBoundary.d.ts +0 -0
  456. /package/dist/{src/utils → utils}/sleep.d.ts +0 -0
  457. /package/dist/{src/utils → utils}/svgParserNative.d.ts +0 -0
  458. /package/dist/{src/utils → utils}/svgTransform.d.ts +0 -0
  459. /package/dist/{src/utils → utils}/touchEvents.d.ts +0 -0
  460. /package/dist/{src/utils → utils}/unionFind.d.ts +0 -0
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
5
  var ReactDOM = require('react-dom');
6
- var antd = require('antd');
7
6
 
8
7
  function _interopNamespaceDefault(e) {
9
8
  var n = Object.create(null);
@@ -312,7 +311,7 @@ function initObstacle() {
312
311
  const obstacle = {
313
312
  id: null,
314
313
  area: 0,
315
- name: 'Obstacle',
314
+ name: 'off-imit island',
316
315
  status: 1,
317
316
  end_timestamp: 0,
318
317
  start_timestamp: 0,
@@ -1335,60 +1334,6 @@ function calculatePerpendicularFoot(point, lineStart, lineEnd) {
1335
1334
  function isFootOnSegment(foot) {
1336
1335
  return foot.param >= 0 && foot.param <= 1;
1337
1336
  }
1338
- /**
1339
- * 计算多边形的面积和周长
1340
- * @param coordinates 多边形顶点坐标数组 [[x1, y1], [x2, y2], ...]
1341
- * @returns 包含面积和周长的对象
1342
- */
1343
- function calculatePolygonAreaAndPerimeter(coordinates) {
1344
- if (!coordinates || coordinates.length < 3) {
1345
- return { area: 0, perimeter: 0 };
1346
- }
1347
- let area = 0;
1348
- let perimeter = 0;
1349
- const n = coordinates.length;
1350
- // 使用鞋带公式(Shoelace formula)计算面积
1351
- for (let i = 0; i < n; i++) {
1352
- const j = (i + 1) % n;
1353
- const [x1, y1] = coordinates[i];
1354
- const [x2, y2] = coordinates[j];
1355
- // 面积计算(鞋带公式)
1356
- area += x1 * y2 - x2 * y1;
1357
- // 周长计算(累加每条边的长度)
1358
- const dx = x2 - x1;
1359
- const dy = y2 - y1;
1360
- perimeter += Math.sqrt(dx * dx + dy * dy);
1361
- }
1362
- // 面积取绝对值并除以2
1363
- area = Math.abs(area) / 2;
1364
- return {
1365
- area,
1366
- perimeter
1367
- };
1368
- }
1369
- /**
1370
- * 计算矩形的长和宽
1371
- * @param points 矩形的4个顶点坐标 [[x1, y1], [x2, y2], [x3, y3], [x4, y4]]
1372
- * @returns 包含宽和高的数组 [width, height]
1373
- */
1374
- function calculateRectangleDimensions(points) {
1375
- if (!points || points.length !== 4) {
1376
- return [0, 0];
1377
- }
1378
- // 计算每条边的长度
1379
- const sides = [
1380
- Math.sqrt(Math.pow(points[1][0] - points[0][0], 2) + Math.pow(points[1][1] - points[0][1], 2)), // 0->1
1381
- Math.sqrt(Math.pow(points[2][0] - points[1][0], 2) + Math.pow(points[2][1] - points[1][1], 2)), // 1->2
1382
- Math.sqrt(Math.pow(points[3][0] - points[2][0], 2) + Math.pow(points[3][1] - points[2][1], 2)), // 2->3
1383
- Math.sqrt(Math.pow(points[0][0] - points[3][0], 2) + Math.pow(points[0][1] - points[3][1], 2)) // 3->0
1384
- ];
1385
- // 矩形的对边应该相等,所以我们取相邻的两条边作为宽和高
1386
- // sides[0] 和 sides[2] 是对边,sides[1] 和 sides[3] 是对边
1387
- const width = sides[0]; // 第一条边
1388
- const height = sides[1]; // 相邻的第二条边
1389
- // 返回宽和高的数组 [width, height] - 小的作为宽,大的作为高
1390
- return width <= height ? [width, height] : [height, width];
1391
- }
1392
1337
 
1393
1338
  /**
1394
1339
  * 按Python逻辑创建路径段:根据连续的两点之间的关系确定线段类型
@@ -2136,52 +2081,6 @@ function convertHeightsetToParams(value) {
2136
2081
  cuttingHeight: value,
2137
2082
  };
2138
2083
  }
2139
- function getDefaultAngle(recBaseAngle) {
2140
- if (recBaseAngle > -15 && recBaseAngle <= 15) {
2141
- return recBaseAngle;
2142
- }
2143
- else if (recBaseAngle > 15 && recBaseAngle <= 45) {
2144
- return recBaseAngle - 30;
2145
- }
2146
- else if (recBaseAngle > 45 && recBaseAngle <= 75) {
2147
- return recBaseAngle - 60;
2148
- }
2149
- else if (recBaseAngle > 75 && recBaseAngle <= 90) {
2150
- return recBaseAngle - 90;
2151
- }
2152
- else if (recBaseAngle > -90 && recBaseAngle <= -75) {
2153
- return recBaseAngle + 90;
2154
- }
2155
- else if (recBaseAngle > -75 && recBaseAngle <= -45) {
2156
- return recBaseAngle + 60;
2157
- }
2158
- else if (recBaseAngle > -45 && recBaseAngle <= -15) {
2159
- return recBaseAngle + 30;
2160
- }
2161
- }
2162
- function getSelectAngles(value) {
2163
- const A = 1 << 0; // bit0 = 1
2164
- const B = 1 << 1; // bit1 = 2
2165
- const C = 1 << 2; // bit2 = 4
2166
- const D = 1 << 3; // bit3 = 8
2167
- const E = 1 << 4; // bit4 = 16
2168
- const F = 1 << 5; // bit5 = 32
2169
- const directions = [];
2170
- // 检查每个位标志是否被设置
2171
- if (value & A)
2172
- directions.push(0, 180);
2173
- if (value & B)
2174
- directions.push(30, -150);
2175
- if (value & C)
2176
- directions.push(60, -120);
2177
- if (value & D)
2178
- directions.push(90, -90);
2179
- if (value & E)
2180
- directions.push(120, -60);
2181
- if (value & F)
2182
- directions.push(150, -30);
2183
- return directions;
2184
- }
2185
2084
 
2186
2085
  /** Detect free variable `global` from Node.js. */
2187
2086
  var freeGlobal$2 = typeof global == 'object' && global && global.Object === Object && global;
@@ -5094,18 +4993,6 @@ function convertAreaByUnits(area, type = UnitsType.Metric) {
5094
4993
  unit: UnitsAreaType.ACRE,
5095
4994
  };
5096
4995
  }
5097
- // 割草高度的转化
5098
- function convertCutHeightFormatted(value) {
5099
- return (Math.ceil(value * 0.03937 * 10) * 0.1).toFixed(1);
5100
- }
5101
- function getHeightUnit(unit) {
5102
- return unit === UnitsType.Metric ? 'mm' : 'inch';
5103
- }
5104
- function generateHeightStr(value, unit, hasUnit = false) {
5105
- const unitStr = getHeightUnit(unit);
5106
- const height = unit === UnitsType.Metric ? value : convertCutHeightFormatted(value || 0);
5107
- return hasUnit ? `${height} ${unitStr}` : value;
5108
- }
5109
4996
 
5110
4997
  /**
5111
4998
  * 日期时间格式化工具函数
@@ -8712,12 +8599,12 @@ function styleInject(css, ref) {
8712
8599
  }
8713
8600
  }
8714
8601
 
8715
- var css_248z$i = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
8716
- var styles$i = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
8717
- styleInject(css_248z$i);
8602
+ var css_248z$6 = ".index-module_edit__-5VvX {\n position: absolute;\n top: 0px;\n left: 0px;\n width: 100%;\n height: 100%;\n pointer-events: auto;\n z-index: 1000;\n cursor: move;\n touch-action: none;\n user-select: none;\n -webkit-tap-highlight-color: transparent;\n}\n.index-module_edit__-5VvX .index-module_border__JdNLM {\n position: absolute;\n inset: -10px;\n border: 2px dashed rgb(241, 102, 41);\n border-radius: 2px;\n pointer-events: none;\n}\n.index-module_edit__-5VvX .index-module_drag__uvdPG {\n position: absolute;\n inset: -10px;\n border-radius: 2px;\n}\n.index-module_edit__-5VvX .index-module_rotate__H-KIZ {\n position: absolute;\n top: -20px;\n right: -20px;\n width: 20px;\n height: 20px;\n cursor: grab;\n z-index: 1001;\n pointer-events: auto;\n}\n.index-module_edit__-5VvX .index-module_move__mZF8s {\n position: absolute;\n bottom: -20px;\n left: -20px;\n width: 20px;\n height: 20px;\n cursor: move;\n z-index: 1001;\n pointer-events: auto;\n}";
8603
+ var styles$6 = {"edit":"index-module_edit__-5VvX","border":"index-module_border__JdNLM","drag":"index-module_drag__uvdPG","rotate":"index-module_rotate__H-KIZ","move":"index-module_move__mZF8s"};
8604
+ styleInject(css_248z$6);
8718
8605
 
8719
8606
  const RotateHandle = ({ onRotateStart, isRotating }) => {
8720
- return (jsxRuntime.jsx("div", { className: styles$i.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
8607
+ return (jsxRuntime.jsx("div", { className: styles$6.rotate, onMouseDown: (e) => onRotateStart(e), onTouchStart: (e) => onRotateStart(e), style: { cursor: isRotating ? 'grabbing' : 'grab' }, dangerouslySetInnerHTML: { __html: DEFAULT_ROTATE_ICON } }));
8721
8608
  };
8722
8609
 
8723
8610
  /**
@@ -8789,7 +8676,7 @@ const DragHandle = ({ onDragStart, isDragging }) => {
8789
8676
  if (!isMobileDevice()) {
8790
8677
  return null;
8791
8678
  }
8792
- return (jsxRuntime.jsx("div", { className: styles$i.move, onMouseDown: (e) => {
8679
+ return (jsxRuntime.jsx("div", { className: styles$6.move, onMouseDown: (e) => {
8793
8680
  console.log('down');
8794
8681
  onDragStart(e);
8795
8682
  }, onTouchStart: (e) => onDragStart(e), onMouseUp: (e) => {
@@ -8823,7 +8710,7 @@ const MapDrag = ({ map: _map, dragCallbacks, onBoundaryLabelsCollapse, onTransfo
8823
8710
  if (!isDragMap) {
8824
8711
  return null;
8825
8712
  }
8826
- return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$i.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsxRuntime.jsx("div", { className: styles$i.border }), jsxRuntime.jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsxRuntime.jsx("div", { className: styles$i.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsxRuntime.jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
8713
+ return (jsxRuntime.jsxs("div", { ref: containerRef, className: styles$6.edit, style: { cursor: isDragging ? 'grabbing' : 'move' }, children: [jsxRuntime.jsx("div", { className: styles$6.border }), jsxRuntime.jsx(RotateHandle, { onRotateStart: handleRotateStart, isRotating: isRotating }), jsxRuntime.jsx("div", { className: styles$6.drag, onMouseDown: handleDragStartEvent, onTouchStart: handleDragStartEvent }), jsxRuntime.jsx(DragHandle, { onDragStart: handleDragStartEvent, isDragging: isDragging })] }));
8827
8714
  };
8828
8715
 
8829
8716
  /**
@@ -14547,9 +14434,9 @@ const SvgMapComponent = React.forwardRef(({ editMap, rotate, mapData, pathData,
14547
14434
  // 设置显示名称以便调试
14548
14435
  SvgMapComponent.displayName = 'SvgMapComponent';
14549
14436
 
14550
- var css_248z$h = ".index-module_mowerPosition__yLpIU {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n}";
14551
- var styles$h = {"mowerPosition":"index-module_mowerPosition__yLpIU"};
14552
- styleInject(css_248z$h);
14437
+ var css_248z$5 = ".index-module_mowerPosition__yLpIU {\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n width: 100%;\n height: 100%;\n}";
14438
+ var styles$5 = {"mowerPosition":"index-module_mowerPosition__yLpIU"};
14439
+ styleInject(css_248z$5);
14553
14440
 
14554
14441
  const usePosition = ({ mowerPositionData, viewBox, modelType, hasEdger, mapData, realTimeData, onMowingPositionChange, }) => {
14555
14442
  // DOM 元素引用,用于直接操作
@@ -14775,7 +14662,7 @@ const MowerPosition = React.memo(({ editMap, mowerPositionData, viewBox, modelTy
14775
14662
  pointerEvents: 'none',
14776
14663
  zIndex: 1000,
14777
14664
  }), []);
14778
- return (jsxRuntime.jsx("div", { className: styles$h.mowerPosition, style: containerStyle, children: jsxRuntime.jsx("div", { ref: elementRef, className: "mower-position", style: {
14665
+ return (jsxRuntime.jsx("div", { className: styles$5.mowerPosition, style: containerStyle, children: jsxRuntime.jsx("div", { ref: elementRef, className: "mower-position", style: {
14779
14666
  position: 'absolute',
14780
14667
  width: 30,
14781
14668
  height: 30,
@@ -14844,9 +14731,9 @@ const CharginPile = React.memo(({ mapData, mapConfig = {}, viewBox, rotation = 0
14844
14731
  }, children: jsxRuntime.jsx("img", { src: item.imageSrc, style: { width: '100%', height: '100%', objectFit: 'contain', opacity: 1 } }) }, `pile-${idx}`))) }));
14845
14732
  });
14846
14733
 
14847
- var css_248z$g = ".index-module_container__7IatW {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_boundaryLabel__GDHFn {\n position: absolute;\n background-color: rgba(30, 30, 31, 0.6);\n color: rgb(255, 255, 255);\n padding: 6px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: bold;\n max-width: 220px;\n pointer-events: auto;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n}\n\n.index-module_base__qy2SG {\n font-size: 14px;\n}\n\n.index-module_extended__0TMAt {\n margin-top: 6px;\n font-size: 11px;\n opacity: 0.9;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n padding-top: 6px;\n}";
14848
- var styles$g = {"container":"index-module_container__7IatW","boundaryLabel":"index-module_boundaryLabel__GDHFn","base":"index-module_base__qy2SG","extended":"index-module_extended__0TMAt"};
14849
- styleInject(css_248z$g);
14734
+ var css_248z$4 = ".index-module_container__7IatW {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_boundaryLabel__GDHFn {\n position: absolute;\n background-color: rgba(30, 30, 31, 0.6);\n color: rgb(255, 255, 255);\n padding: 6px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: bold;\n max-width: 220px;\n pointer-events: auto;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);\n cursor: pointer;\n user-select: none;\n white-space: nowrap;\n}\n\n.index-module_base__qy2SG {\n font-size: 14px;\n}\n\n.index-module_extended__0TMAt {\n margin-top: 6px;\n font-size: 11px;\n opacity: 0.9;\n border-top: 1px solid rgba(255, 255, 255, 0.2);\n padding-top: 6px;\n}";
14735
+ var styles$4 = {"container":"index-module_container__7IatW","boundaryLabel":"index-module_boundaryLabel__GDHFn","base":"index-module_base__qy2SG","extended":"index-module_extended__0TMAt"};
14736
+ styleInject(css_248z$4);
14850
14737
 
14851
14738
  const useBoundaryLabels = ({ mapData, pathData, unitType, viewBox, mowPartitionData, realTimeData = [], }) => {
14852
14739
  const [processStateIsMowing, updateProcessStateIsMowing] = React.useState(false);
@@ -15000,7 +14887,7 @@ const BoundaryLabels = React.memo(({ editMap, mapData, pathData, unitType, langu
15000
14887
  zIndex: expandedId != null ? 9999 : containerZIndex,
15001
14888
  display: editMap ? 'none' : 'block',
15002
14889
  }), [containerZIndex, expandedId, editMap]);
15003
- return (jsxRuntime.jsx("div", { className: styles$g.container, style: containerStyle, children: items.map((item) => (jsxRuntime.jsxs("div", { className: `${styles$g.boundaryLabel} boundary-label`, "data-boundary-id": item.id, style: {
14890
+ return (jsxRuntime.jsx("div", { className: styles$4.container, style: containerStyle, children: items.map((item) => (jsxRuntime.jsxs("div", { className: `${styles$4.boundaryLabel} boundary-label`, "data-boundary-id": item.id, style: {
15004
14891
  transform: `translate(-50%, -50%) rotate(${-rotation}deg)`,
15005
14892
  left: `${item.leftPct}%`,
15006
14893
  top: `${item.topPct}%`,
@@ -15010,12 +14897,12 @@ const BoundaryLabels = React.memo(({ editMap, mapData, pathData, unitType, langu
15010
14897
  if (onlyRead)
15011
14898
  return;
15012
14899
  handleClick(item.id);
15013
- }, children: [jsxRuntime.jsx("div", { className: styles$g.base, children: item.baseText }), jsxRuntime.jsxs("div", { className: styles$g.extended, style: { display: expandedId === item.id ? 'block' : 'none' }, children: [jsxRuntime.jsx("div", { style: { marginBottom: 3, fontWeight: 'bold' }, children: item.coverageText }), jsxRuntime.jsx("div", { children: item.dateText })] })] }, item.id))) }));
14900
+ }, children: [jsxRuntime.jsx("div", { className: styles$4.base, children: item.baseText }), jsxRuntime.jsxs("div", { className: styles$4.extended, style: { display: expandedId === item.id ? 'block' : 'none' }, children: [jsxRuntime.jsx("div", { style: { marginBottom: 3, fontWeight: 'bold' }, children: item.coverageText }), jsxRuntime.jsx("div", { children: item.dateText })] })] }, item.id))) }));
15014
14901
  });
15015
14902
 
15016
- var css_248z$f = ".index-module_container__gB52e {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_item__zHoZP {\n position: absolute;\n pointer-events: auto;\n}\n\n.index-module_icon__CS56A {\n position: relative;\n width: 24px;\n height: 24px;\n cursor: pointer;\n transition: transform 0.2s ease;\n}\n\n.index-module_tooltip__NMCmR {\n position: absolute;\n bottom: 40px;\n left: 0;\n background-color: rgb(247, 251, 255);\n color: rgb(65, 93, 116);\n padding: 10px;\n border-radius: 16px;\n font-size: 14px;\n text-align: left;\n}";
15017
- var styles$f = {"container":"index-module_container__gB52e","item":"index-module_item__zHoZP","icon":"index-module_icon__CS56A","tooltip":"index-module_tooltip__NMCmR"};
15018
- styleInject(css_248z$f);
14903
+ var css_248z$3 = ".index-module_container__gB52e {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n}\n\n.index-module_item__zHoZP {\n position: absolute;\n pointer-events: auto;\n}\n\n.index-module_icon__CS56A {\n position: relative;\n width: 24px;\n height: 24px;\n cursor: pointer;\n transition: transform 0.2s ease;\n}\n\n.index-module_tooltip__NMCmR {\n position: absolute;\n bottom: 40px;\n left: 0;\n background-color: rgb(247, 251, 255);\n color: rgb(65, 93, 116);\n padding: 10px;\n border-radius: 16px;\n font-size: 14px;\n text-align: left;\n}";
14904
+ var styles$3 = {"container":"index-module_container__gB52e","item":"index-module_item__zHoZP","icon":"index-module_icon__CS56A","tooltip":"index-module_tooltip__NMCmR"};
14905
+ styleInject(css_248z$3);
15019
14906
 
15020
14907
  const useAntennaInfo = (data = [], options = {}) => {
15021
14908
  const { viewBox } = options;
@@ -15124,13 +15011,13 @@ const Antennas = React.memo(({ editMap, antennaConfig = [], viewBox, rotation =
15124
15011
  document.addEventListener('pointerdown', handleOutside);
15125
15012
  return () => document.removeEventListener('pointerdown', handleOutside);
15126
15013
  }, []);
15127
- return (jsxRuntime.jsx("div", { className: styles$f.container, style: containerStyle, children: items.map((item) => (jsxRuntime.jsxs("div", { className: `antenna-container-item ${styles$f.item}`, style: {
15014
+ return (jsxRuntime.jsx("div", { className: styles$3.container, style: containerStyle, children: items.map((item) => (jsxRuntime.jsxs("div", { className: `antenna-container-item ${styles$3.item}`, style: {
15128
15015
  left: `${item.leftPct}%`,
15129
15016
  top: `${item.topPct}%`,
15130
15017
  transform: `translate(calc(-50% + ${item.offsetX || 0}px), calc(-50% + ${item.offsetY || 0}px)) rotate(${-rotation}deg)`,
15131
15018
  zIndex: openType === item.type ? 10000 : containerZIndex,
15132
15019
  pointerEvents: onlyRead ? 'none' : 'auto',
15133
- }, children: [jsxRuntime.jsx("div", { className: `antenna vector-antenna antenna-${item.type} ${item.isOnline ? 'antenna-online' : 'antenna-offline'} ${styles$f.icon}`, style: {}, onClick: (e) => {
15020
+ }, children: [jsxRuntime.jsx("div", { className: `antenna vector-antenna antenna-${item.type} ${item.isOnline ? 'antenna-online' : 'antenna-offline'} ${styles$3.icon}`, style: {}, onClick: (e) => {
15134
15021
  e.stopPropagation();
15135
15022
  if (onlyRead)
15136
15023
  return;
@@ -15145,7 +15032,7 @@ const Antennas = React.memo(({ editMap, antennaConfig = [], viewBox, rotation =
15145
15032
  return;
15146
15033
  e.currentTarget.style.transform =
15147
15034
  'scale(1)';
15148
- }, children: jsxRuntime.jsx("img", { src: item.imageSrc, style: { width: '100%', height: '100%', objectFit: 'contain', opacity: 1 } }) }), jsxRuntime.jsxs("div", { className: styles$f.tooltip, style: {
15035
+ }, children: jsxRuntime.jsx("img", { src: item.imageSrc, style: { width: '100%', height: '100%', objectFit: 'contain', opacity: 1 } }) }), jsxRuntime.jsxs("div", { className: styles$3.tooltip, style: {
15149
15036
  display: openType === item.type ? 'block' : 'none',
15150
15037
  minWidth: item.tooltip.minWidth,
15151
15038
  }, children: [jsxRuntime.jsx("div", { style: { marginBottom: 4, fontWeight: 600 }, children: item.tooltip.title }), jsxRuntime.jsxs("div", { style: { color: 'rgba(65, 93, 116, 1)', fontWeight: 400 }, children: [item.tooltip.statusText, item.tooltip.syncText || ''] })] })] }, `antenna-${item.type}`))) }));
@@ -15209,15 +15096,15 @@ const VertexElement = React.memo(({ r, stroke, ...props }) => {
15209
15096
  return (jsxRuntime.jsx("circle", { r: radius * overlayScale, stroke: stroke || '#fff', fill: '#fff', strokeWidth: 2 * overlayScale, ...props }));
15210
15097
  });
15211
15098
 
15212
- var _path$b;
15213
- function _extends$j() { return _extends$j = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$j.apply(null, arguments); }
15214
- var SvgDelete$1 = function SvgDelete(props) {
15215
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$j({
15099
+ var _path$2;
15100
+ function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
15101
+ var SvgDelete = function SvgDelete(props) {
15102
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
15216
15103
  xmlns: "http://www.w3.org/2000/svg",
15217
15104
  width: 16,
15218
15105
  height: 16,
15219
15106
  fill: "none"
15220
- }, props), _path$b || (_path$b = /*#__PURE__*/React__namespace.createElement("path", {
15107
+ }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
15221
15108
  fill: "#FD494D",
15222
15109
  d: "M6.667 12a.667.667 0 0 0 .666-.667v-4a.667.667 0 1 0-1.333 0v4a.667.667 0 0 0 .667.667m6.666-8h-2.666v-.667a2 2 0 0 0-2-2H7.333a2 2 0 0 0-2 2V4H2.667a.667.667 0 0 0 0 1.333h.666v7.334a2 2 0 0 0 2 2h5.334a2 2 0 0 0 2-2V5.333h.666a.667.667 0 1 0 0-1.333m-6.666-.667a.667.667 0 0 1 .666-.666h1.334a.667.667 0 0 1 .666.666V4H6.667zm4.666 9.334a.667.667 0 0 1-.666.666H5.333a.667.667 0 0 1-.666-.666V5.333h6.666zm-2-.667a.667.667 0 0 0 .667-.667v-4a.667.667 0 0 0-1.333 0v4a.667.667 0 0 0 .666.667"
15223
15110
  })));
@@ -15362,32 +15249,32 @@ const DistanceLabels = ({ coordinates, createMode = false, editMode = false, com
15362
15249
  }), ghostLastDistance && ghostLastMidpoint && (jsxRuntime.jsx(TextElement, { x: ghostLastMidpoint[0], y: ghostLastMidpoint[1], text: ghostLastDistance })), ghostFirstDistance && ghostFirstMidpoint && (jsxRuntime.jsx(TextElement, { x: ghostFirstMidpoint[0], y: ghostFirstMidpoint[1], text: ghostFirstDistance }))] }));
15363
15250
  };
15364
15251
 
15365
- var css_248z$e = ".index-module_polygonPathG__S-Bpl {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_vertex__-Qb1u {\n cursor: pointer;\n}\n\n.index-module_dragging__xSFdO {\n cursor: grabbing;\n}\n\n.index-module_createVertex__ldz2E {\n cursor: crosshair;\n}\n\n.index-module_addVertex__hrF71 {\n cursor: pointer;\n}\n\n.index-module_polygonPath__PynOn {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_notCreate__bFnkV {\n cursor: no-drop;\n}";
15366
- var styles$e = {"polygonPathG":"index-module_polygonPathG__S-Bpl","vertex":"index-module_vertex__-Qb1u","dragging":"index-module_dragging__xSFdO","addVertex":"index-module_addVertex__hrF71","polygonPath":"index-module_polygonPath__PynOn","notCreate":"index-module_notCreate__bFnkV"};
15367
- styleInject(css_248z$e);
15252
+ var css_248z$2 = ".index-module_polygonPathG__S-Bpl {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_vertex__-Qb1u {\n cursor: pointer;\n}\n\n.index-module_dragging__xSFdO {\n cursor: grabbing;\n}\n\n.index-module_createVertex__ldz2E {\n cursor: crosshair;\n}\n\n.index-module_addVertex__hrF71 {\n cursor: pointer;\n}\n\n.index-module_polygonPath__PynOn {\n pointer-events: stroke;\n cursor: pointer;\n}\n\n.index-module_notCreate__bFnkV {\n cursor: no-drop;\n}";
15253
+ var styles$2 = {"polygonPathG":"index-module_polygonPathG__S-Bpl","vertex":"index-module_vertex__-Qb1u","dragging":"index-module_dragging__xSFdO","addVertex":"index-module_addVertex__hrF71","polygonPath":"index-module_polygonPath__PynOn","notCreate":"index-module_notCreate__bFnkV"};
15254
+ styleInject(css_248z$2);
15368
15255
 
15369
- var CreateStatus;
15256
+ exports.CreateStatus = void 0;
15370
15257
  (function (CreateStatus) {
15371
15258
  CreateStatus["CREATING"] = "creating";
15372
15259
  CreateStatus["COMPLETED"] = "completed";
15373
- })(CreateStatus || (CreateStatus = {}));
15374
- var RecordTypeEnum;
15260
+ })(exports.CreateStatus || (exports.CreateStatus = {}));
15261
+ exports.RecordTypeEnum = void 0;
15375
15262
  (function (RecordTypeEnum) {
15376
15263
  RecordTypeEnum[RecordTypeEnum["DOODLE"] = 1] = "DOODLE";
15377
15264
  RecordTypeEnum[RecordTypeEnum["VISI_OFF"] = 2] = "VISI_OFF";
15378
15265
  RecordTypeEnum[RecordTypeEnum["OBSTACLE"] = 3] = "OBSTACLE";
15379
- })(RecordTypeEnum || (RecordTypeEnum = {}));
15380
- var RecordFunctionEnum;
15266
+ })(exports.RecordTypeEnum || (exports.RecordTypeEnum = {}));
15267
+ exports.RecordFunctionEnum = void 0;
15381
15268
  (function (RecordFunctionEnum) {
15382
15269
  RecordFunctionEnum[RecordFunctionEnum["ADD"] = 0] = "ADD";
15383
15270
  RecordFunctionEnum[RecordFunctionEnum["EDIT"] = 1] = "EDIT";
15384
- })(RecordFunctionEnum || (RecordFunctionEnum = {}));
15385
- var MobileEditMode;
15271
+ })(exports.RecordFunctionEnum || (exports.RecordFunctionEnum = {}));
15272
+ exports.MobileEditMode = void 0;
15386
15273
  (function (MobileEditMode) {
15387
15274
  MobileEditMode[MobileEditMode["START"] = 0] = "START";
15388
15275
  MobileEditMode[MobileEditMode["EDIT"] = 1] = "EDIT";
15389
15276
  MobileEditMode[MobileEditMode["CREATE"] = 2] = "CREATE";
15390
- })(MobileEditMode || (MobileEditMode = {}));
15277
+ })(exports.MobileEditMode || (exports.MobileEditMode = {}));
15391
15278
  var ClickEventType;
15392
15279
  (function (ClickEventType) {
15393
15280
  // 点击doodle的active time的时候触发
@@ -15399,7 +15286,7 @@ const INIT_EDIT_MAP_INFO = {
15399
15286
  createMode: null,
15400
15287
  elementType: undefined,
15401
15288
  isShowDrag: false,
15402
- mobileMode: MobileEditMode.START,
15289
+ mobileMode: exports.MobileEditMode.START,
15403
15290
  allVisionOffPoints: [],
15404
15291
  historyList: [],
15405
15292
  currentHistoryIndex: 0,
@@ -15940,7 +15827,7 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
15940
15827
  const { platform } = useCommonContext();
15941
15828
  // delete icon可能被上一个点遮挡,因为delete在右上方,所以手动处理点让点按照顺时针渲染,这样delete icon层级就会高一些
15942
15829
  const coordinates = React.useMemo(() => {
15943
- return editMapInfo?.createMode === CreateStatus.CREATING ? points : [...points].reverse();
15830
+ return editMapInfo?.createMode === exports.CreateStatus.CREATING ? points : [...points].reverse();
15944
15831
  }, [points, editMapInfo?.createMode]);
15945
15832
  // 计算点到线段的垂足坐标(使用通用工具函数)
15946
15833
  const calculatePerpendicularFoot$1 = React.useCallback((point, lineStart, lineEnd) => {
@@ -16087,8 +15974,8 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16087
15974
  }, [dragState.currentPosition, checkCanNotCreateAtPosition]);
16088
15975
  const generateVertexClassName = React.useMemo(() => {
16089
15976
  if (!dragState.isDragging)
16090
- return styles$e.vertex;
16091
- return showNotCreateCursor ? styles$e.notCreate : styles$e.dragging;
15977
+ return styles$2.vertex;
15978
+ return showNotCreateCursor ? styles$2.notCreate : styles$2.dragging;
16092
15979
  }, [dragState.isDragging, showNotCreateCursor]);
16093
15980
  // 使用 useRef 来存储 requestAnimationFrame ID
16094
15981
  const rafIdRef = React.useRef(null);
@@ -16161,7 +16048,7 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16161
16048
  newCoordinates[dragState.dragIndex] = dragState.currentPosition;
16162
16049
  }
16163
16050
  }
16164
- const result = editMapInfo?.createMode === CreateStatus.CREATING
16051
+ const result = editMapInfo?.createMode === exports.CreateStatus.CREATING
16165
16052
  ? newCoordinates
16166
16053
  : newCoordinates.reverse();
16167
16054
  onCoordinatesChange?.(result);
@@ -16266,24 +16153,24 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16266
16153
  const nextIndex = (dragState.dragIndex + 1) % coordinates.length;
16267
16154
  return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("line", { x1: coordinates[prevIndex][0], y1: coordinates[prevIndex][1], x2: dragState.originalPosition[0], y2: dragState.originalPosition[1], stroke: strokeColor, strokeWidth: strokeWidth, strokeOpacity: 0.5, strokeDasharray: "5,5", pointerEvents: "none" }), jsxRuntime.jsx("line", { x1: dragState.originalPosition[0], y1: dragState.originalPosition[1], x2: coordinates[nextIndex][0], y2: coordinates[nextIndex][1], stroke: strokeColor, strokeWidth: strokeWidth, strokeOpacity: 0.5, strokeDasharray: "5,5", pointerEvents: "none" })] }));
16268
16155
  })()] })), renderCoordinates.length >= 3 && (jsxRuntime.jsx("polygon", { className: "vector-boundary-fill", points: polygonPoints, fill: fillColor, fillOpacity: fillOpacity, stroke: "none" // 边框透明
16269
- , onClick: onPolygonClick })), jsxRuntime.jsxs("g", { className: styles$e.polygonPathG, children: [renderCoordinates.length >= 2 &&
16156
+ , onClick: onPolygonClick })), jsxRuntime.jsxs("g", { className: styles$2.polygonPathG, children: [renderCoordinates.length >= 2 &&
16270
16157
  pathSegments.map((segment, index) => {
16271
16158
  if (segment.points.length < 2)
16272
16159
  return null;
16273
16160
  const pathData = createPathData(segment.points);
16274
16161
  const isDash = segment.type === 1;
16275
- return (jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: isDash ? 'none' : strokeColor, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: styles$e.polygonPath, vectorEffect: "non-scaling-stroke", onClick: onPathClick }, index));
16162
+ return (jsxRuntime.jsx("path", { d: pathData, fill: "none", stroke: isDash ? 'none' : strokeColor, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity, strokeLinecap: "round", strokeLinejoin: "round", className: styles$2.polygonPath, vectorEffect: "non-scaling-stroke", onClick: onPathClick }, index));
16276
16163
  }), renderCoordinates.length >= 2 &&
16277
16164
  dashPaths.map((segment, index) => {
16278
16165
  if (segment.points.length < 2)
16279
16166
  return null;
16280
- return (jsxRuntime.jsx(DashPath, { className: styles$e.polygonPath, points: segment.points, stroke: strokeColor, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity }, index));
16167
+ return (jsxRuntime.jsx(DashPath, { className: styles$2.polygonPath, points: segment.points, stroke: strokeColor, strokeWidth: strokeWidth, strokeOpacity: strokeOpacity }, index));
16281
16168
  })] }), (editMode || (createMode && completed)) &&
16282
16169
  renderCoordinates.length >= 2 &&
16283
16170
  renderCoordinates.map((coord, index) => {
16284
16171
  const nextCoord = renderCoordinates[(index + 1) % renderCoordinates.length];
16285
16172
  const isDashPath = coord[2] === 1;
16286
- return (jsxRuntime.jsx("line", { x1: coord[0], y1: coord[1], x2: nextCoord[0], y2: nextCoord[1], stroke: isDashPath ? 'transparent' : strokeColor, strokeWidth: strokeWidth, className: styles$e.addVertex, vectorEffect: "non-scaling-stroke", ...(platform === PlatformType.H5
16173
+ return (jsxRuntime.jsx("line", { x1: coord[0], y1: coord[1], x2: nextCoord[0], y2: nextCoord[1], stroke: isDashPath ? 'transparent' : strokeColor, strokeWidth: strokeWidth, className: styles$2.addVertex, vectorEffect: "non-scaling-stroke", ...(platform === PlatformType.H5
16287
16174
  ? {
16288
16175
  onTouchStart: createReactEventHandler((e) => handleEdgeClick(e, index)),
16289
16176
  }
@@ -16384,7 +16271,7 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16384
16271
  onVertexDelete(renderCoordinates?.length - 1 - idx);
16385
16272
  }
16386
16273
  setTooltipIndex(null);
16387
- }, style: { cursor: 'pointer' }, children: [jsxRuntime.jsx("rect", { x: 0, y: -24, width: 20, height: 20, rx: 2, ry: 2, fill: "#fff", strokeWidth: 1, filter: "url(#vertex-tooltip-shadow)" }), jsxRuntime.jsx("g", { transform: `translate(2, -22)`, children: jsxRuntime.jsx(SvgDelete$1, {}) })] })), canComplete && (jsxRuntime.jsx("g", { style: { pointerEvents: 'none' }, transform: `translate(${coord[0] - 5 * overlayScale * 3}, ${coord[1] - 2.5 * overlayScale * 3}) scale(${overlayScale * 3})`, children: jsxRuntime.jsx("svg", { width: "10", height: "5", viewBox: "0 0 6 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M0.5 2.5L1.3452 3.3452C1.71469 3.71469 2.30636 3.73741 2.7031 3.39735L5.5 1", stroke: "#FF7A33", "stroke-linecap": "round" }) }) })
16274
+ }, style: { cursor: 'pointer' }, children: [jsxRuntime.jsx("rect", { x: 0, y: -24, width: 20, height: 20, rx: 2, ry: 2, fill: "#fff", strokeWidth: 1, filter: "url(#vertex-tooltip-shadow)" }), jsxRuntime.jsx("g", { transform: `translate(2, -22)`, children: jsxRuntime.jsx(SvgDelete, {}) })] })), canComplete && (jsxRuntime.jsx("g", { style: { pointerEvents: 'none' }, transform: `translate(${coord[0] - 5 * overlayScale * 3}, ${coord[1] - 2.5 * overlayScale * 3}) scale(${overlayScale * 3})`, children: jsxRuntime.jsx("svg", { width: "10", height: "5", viewBox: "0 0 6 5", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("path", { d: "M0.5 2.5L1.3452 3.3452C1.71469 3.71469 2.30636 3.73741 2.7031 3.39735L5.5 1", stroke: "#FF7A33", "stroke-linecap": "round" }) }) })
16388
16275
  // <rect
16389
16276
  // x={coord[0]}
16390
16277
  // y={coord[1]}
@@ -16402,7 +16289,7 @@ const PolygonElement = ({ points, fillColor = 'rgba(0, 0, 0, 0.1)', fillOpacity
16402
16289
 
16403
16290
  const BoundaryElement = ({ data }) => {
16404
16291
  const style = data.style || {};
16405
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
16292
+ const { editMapInfo, setEditMapInfo, onSelectElement } = useMapEditContext();
16406
16293
  const { platform } = useCommonContext();
16407
16294
  const currentPoints = React.useMemo(() => {
16408
16295
  if (editMapInfo?.selectElement?.id === data.id) {
@@ -16415,24 +16302,25 @@ const BoundaryElement = ({ data }) => {
16415
16302
  */
16416
16303
  const strokeWidth = React.useMemo(() => {
16417
16304
  // 如果是h5选中的情况下,边界需要加粗
16418
- if (platform === PlatformType.H5 && editMapInfo?.selectElement?.id === data.id) {
16305
+ if (editMapInfo?.selectElement?.id === data.id) {
16419
16306
  return dp2px((style.lineWidth || 3) * 2);
16420
16307
  }
16421
16308
  return dp2px(style.lineWidth || 3);
16422
- }, [platform, style, editMapInfo]);
16309
+ }, [style, editMapInfo]);
16423
16310
  /**
16424
16311
  * 点击边界的回调
16425
16312
  */
16426
16313
  const onPathClick = React.useCallback(() => {
16314
+ onSelectElement?.(exports.DataType.BOUNDARY);
16427
16315
  if (platform === PlatformType.H5) {
16428
16316
  // 对于地块来说,如果当前有元素是在编辑和创建模式下,则不进行选中
16429
- if (editMapInfo.mobileMode === MobileEditMode.EDIT ||
16430
- editMapInfo.mobileMode === MobileEditMode.CREATE) {
16317
+ if (editMapInfo.mobileMode === exports.MobileEditMode.EDIT ||
16318
+ editMapInfo.mobileMode === exports.MobileEditMode.CREATE) {
16431
16319
  return;
16432
16320
  }
16433
16321
  setEditMapInfo((prev) => ({
16434
16322
  ...prev,
16435
- mobileMode: MobileEditMode.START,
16323
+ mobileMode: exports.MobileEditMode.START,
16436
16324
  elementType: exports.DataType.BOUNDARY,
16437
16325
  selectElement: data,
16438
16326
  }));
@@ -16597,7 +16485,7 @@ const ObstacleElement = ({ data }) => {
16597
16485
  // 其他模式展示的是其他的样式
16598
16486
  if (platform === PlatformType.H5 &&
16599
16487
  editMapInfo?.selectElement?.id === data.id &&
16600
- editMapInfo.mobileMode === MobileEditMode.START) {
16488
+ editMapInfo.mobileMode === exports.MobileEditMode.START) {
16601
16489
  return (style.lineWidth || 2) * 3;
16602
16490
  }
16603
16491
  return style.lineWidth || 2;
@@ -16605,13 +16493,13 @@ const ObstacleElement = ({ data }) => {
16605
16493
  const onPathClick = React.useCallback(() => {
16606
16494
  if (platform === PlatformType.H5) {
16607
16495
  // h5编辑模式下,禁区只有在start模式下才需要选中
16608
- if (editMapInfo.mobileMode === MobileEditMode.EDIT ||
16609
- editMapInfo.mobileMode === MobileEditMode.CREATE) {
16496
+ if (editMapInfo.mobileMode === exports.MobileEditMode.EDIT ||
16497
+ editMapInfo.mobileMode === exports.MobileEditMode.CREATE) {
16610
16498
  return;
16611
16499
  }
16612
16500
  setEditMapInfo((prev) => ({
16613
16501
  ...prev,
16614
- mobileMode: MobileEditMode.START,
16502
+ mobileMode: exports.MobileEditMode.START,
16615
16503
  elementType: exports.DataType.OBSTACLE,
16616
16504
  selectElement: data,
16617
16505
  }));
@@ -16640,7 +16528,7 @@ const ObstacleElement = ({ data }) => {
16640
16528
  }, [disabledObstacles, data, onHandleEnterRecord, editMapInfo]);
16641
16529
  const editMode = React.useMemo(() => {
16642
16530
  if (platform === PlatformType.H5) {
16643
- return (editMapInfo?.mobileMode === MobileEditMode.EDIT &&
16531
+ return (editMapInfo?.mobileMode === exports.MobileEditMode.EDIT &&
16644
16532
  editMapInfo?.selectElement?.id === data.id);
16645
16533
  }
16646
16534
  return editMapInfo?.selectElement?.id === data.id;
@@ -16650,7 +16538,7 @@ const ObstacleElement = ({ data }) => {
16650
16538
  onPathClick();
16651
16539
  }
16652
16540
  }, onVertexDelete: (vertexIndex) => handleCreateVertexDelete(vertexIndex), onCoordinatesChange: (coordinates) => {
16653
- if (platform === PlatformType.H5 && editMapInfo.mobileMode === MobileEditMode.CREATE) {
16541
+ if (platform === PlatformType.H5 && editMapInfo.mobileMode === exports.MobileEditMode.CREATE) {
16654
16542
  return;
16655
16543
  }
16656
16544
  setEditMapInfo((prev) => ({
@@ -17072,15 +16960,15 @@ const useVisionOffTransform = (data, scaleConstraints
17072
16960
  };
17073
16961
  };
17074
16962
 
17075
- var _g$7, _defs$7;
17076
- function _extends$i() { return _extends$i = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$i.apply(null, arguments); }
16963
+ var _g$3, _defs$3;
16964
+ function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
17077
16965
  var SvgTransformDelete = function SvgTransformDelete(props) {
17078
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$i({
16966
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
17079
16967
  xmlns: "http://www.w3.org/2000/svg",
17080
16968
  width: 20,
17081
16969
  height: 20,
17082
16970
  fill: "none"
17083
- }, props), _g$7 || (_g$7 = /*#__PURE__*/React__namespace.createElement("g", {
16971
+ }, props), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
17084
16972
  clipPath: "url(#transform-delete_svg__a)"
17085
16973
  }, /*#__PURE__*/React__namespace.createElement("circle", {
17086
16974
  cx: 10,
@@ -17103,7 +16991,7 @@ var SvgTransformDelete = function SvgTransformDelete(props) {
17103
16991
  fill: "#fff",
17104
16992
  rx: 0.8,
17105
16993
  transform: "rotate(45 6.323 5.191)"
17106
- }))), _defs$7 || (_defs$7 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
16994
+ }))), _defs$3 || (_defs$3 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
17107
16995
  id: "transform-delete_svg__b",
17108
16996
  x1: 17.727,
17109
16997
  x2: -1.215,
@@ -17123,15 +17011,15 @@ var SvgTransformDelete = function SvgTransformDelete(props) {
17123
17011
  })))));
17124
17012
  };
17125
17013
 
17126
- var _g$6, _defs$6;
17127
- function _extends$h() { return _extends$h = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$h.apply(null, arguments); }
17014
+ var _g$2, _defs$2;
17015
+ function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
17128
17016
  var SvgTransformRotate = function SvgTransformRotate(props) {
17129
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$h({
17017
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
17130
17018
  xmlns: "http://www.w3.org/2000/svg",
17131
17019
  width: 21,
17132
17020
  height: 20,
17133
17021
  fill: "none"
17134
- }, props), _g$6 || (_g$6 = /*#__PURE__*/React__namespace.createElement("g", {
17022
+ }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
17135
17023
  clipPath: "url(#transform-rotate_svg__a)"
17136
17024
  }, /*#__PURE__*/React__namespace.createElement("path", {
17137
17025
  fill: "url(#transform-rotate_svg__b)",
@@ -17139,7 +17027,7 @@ var SvgTransformRotate = function SvgTransformRotate(props) {
17139
17027
  }), /*#__PURE__*/React__namespace.createElement("path", {
17140
17028
  fill: "#fff",
17141
17029
  d: "M11.602 14.719a5.447 5.447 0 0 1-6.608-5.116l-.004-.205a.818.818 0 0 1 1.633-.084l.004.084.01.285a3.81 3.81 0 0 0 2.127 3.137l.26.115a3.8 3.8 0 0 0 2.227.184l.276-.071q.29-.088.561-.219l-1.147-.441a.817.817 0 0 1 .587-1.525l2.54.977a.817.817 0 0 1 .316 1.308l.001.001a5.45 5.45 0 0 1-2.783 1.57M8.623 4.548a5.447 5.447 0 0 1 6.608 5.116l.004.204a.818.818 0 0 1-1.633.084l-.004-.084-.01-.284a3.81 3.81 0 0 0-2.127-3.138l-.26-.115a3.8 3.8 0 0 0-2.227-.184l-.276.072q-.29.087-.561.218l1.147.442a.817.817 0 0 1-.586 1.524l-2.542-.976a.817.817 0 0 1-.315-1.309 5.45 5.45 0 0 1 2.782-1.57"
17142
- }))), _defs$6 || (_defs$6 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
17030
+ }))), _defs$2 || (_defs$2 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
17143
17031
  id: "transform-rotate_svg__b",
17144
17032
  x1: 17.84,
17145
17033
  x2: -1.103,
@@ -17159,15 +17047,15 @@ var SvgTransformRotate = function SvgTransformRotate(props) {
17159
17047
  })))));
17160
17048
  };
17161
17049
 
17162
- var _g$5, _defs$5;
17163
- function _extends$g() { return _extends$g = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$g.apply(null, arguments); }
17050
+ var _g$1, _defs$1;
17051
+ function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
17164
17052
  var SvgTransformScale = function SvgTransformScale(props) {
17165
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$g({
17053
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
17166
17054
  xmlns: "http://www.w3.org/2000/svg",
17167
17055
  width: 21,
17168
17056
  height: 20,
17169
17057
  fill: "none"
17170
- }, props), _g$5 || (_g$5 = /*#__PURE__*/React__namespace.createElement("g", {
17058
+ }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
17171
17059
  clipPath: "url(#transform-scale_svg__a)"
17172
17060
  }, /*#__PURE__*/React__namespace.createElement("path", {
17173
17061
  fill: "url(#transform-scale_svg__b)",
@@ -17175,7 +17063,7 @@ var SvgTransformScale = function SvgTransformScale(props) {
17175
17063
  }), /*#__PURE__*/React__namespace.createElement("path", {
17176
17064
  fill: "#fff",
17177
17065
  d: "M5.078 8.265a.8.8 0 0 0 1.6.001v-.544l5.69 5.69h-.494a.8.8 0 0 0 0 1.6l2.474-.002a.8.8 0 0 0 .311-.062.8.8 0 0 0 .49-.738v-2.474a.8.8 0 1 0-1.6 0v.594L7.81 6.59h.544a.8.8 0 0 0 0-1.6H5.879a.8.8 0 0 0-.8.8z"
17178
- }))), _defs$5 || (_defs$5 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
17066
+ }))), _defs$1 || (_defs$1 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
17179
17067
  id: "transform-scale_svg__b",
17180
17068
  x1: 17.84,
17181
17069
  x2: -1.103,
@@ -17195,15 +17083,15 @@ var SvgTransformScale = function SvgTransformScale(props) {
17195
17083
  })))));
17196
17084
  };
17197
17085
 
17198
- var _g$4, _defs$4;
17199
- function _extends$f() { return _extends$f = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$f.apply(null, arguments); }
17086
+ var _g, _defs;
17087
+ function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
17200
17088
  var SvgTransformTranslate = function SvgTransformTranslate(props) {
17201
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$f({
17089
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
17202
17090
  xmlns: "http://www.w3.org/2000/svg",
17203
17091
  width: 20,
17204
17092
  height: 20,
17205
17093
  fill: "none"
17206
- }, props), _g$4 || (_g$4 = /*#__PURE__*/React__namespace.createElement("g", {
17094
+ }, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
17207
17095
  clipPath: "url(#transform-translate_svg__a)"
17208
17096
  }, /*#__PURE__*/React__namespace.createElement("circle", {
17209
17097
  cx: 10,
@@ -17213,7 +17101,7 @@ var SvgTransformTranslate = function SvgTransformTranslate(props) {
17213
17101
  }), /*#__PURE__*/React__namespace.createElement("path", {
17214
17102
  fill: "#fff",
17215
17103
  d: "M16.18 10.758a.8.8 0 0 0-.105-1.218l-1.66-1.66a.801.801 0 0 0-1.132 1.132l.383.381h-2.96V6.418l.385.386a.8.8 0 1 0 1.131-1.13l-1.75-1.75a.8.8 0 0 0-1.222.11L7.594 5.689a.8.8 0 0 0 1.131 1.13l.381-.38v2.954H6.137l.381-.38a.8.8 0 1 0-1.13-1.132l-1.752 1.75a.8.8 0 0 0 .106 1.22l1.66 1.66a.801.801 0 0 0 1.132-1.133l-.386-.385h2.958v2.972l-.38-.38a.8.8 0 0 0-1.132 1.131l1.751 1.75a.8.8 0 0 0 1.223-.11l1.654-1.655a.8.8 0 1 0-1.13-1.131l-.386.386v-2.963h2.978l-.385.384a.8.8 0 1 0 1.131 1.131z"
17216
- }))), _defs$4 || (_defs$4 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
17104
+ }))), _defs || (_defs = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
17217
17105
  id: "transform-translate_svg__b",
17218
17106
  x1: 17.727,
17219
17107
  x2: -1.215,
@@ -17257,7 +17145,7 @@ const VisionOffTransformWrapper = ({ data, isSelected = false, onSelect, onCance
17257
17145
  const style = data.style || {};
17258
17146
  const strokeWidth = React.useMemo(() => {
17259
17147
  if (platform === PlatformType.H5) {
17260
- if (editMapInfo?.mobileMode === MobileEditMode.START &&
17148
+ if (editMapInfo?.mobileMode === exports.MobileEditMode.START &&
17261
17149
  editMapInfo?.selectElement?.id === data.id) {
17262
17150
  return (style.lineWidth || 2) * 2;
17263
17151
  }
@@ -17443,7 +17331,7 @@ const VisionOffElement = ({ data, onSelect }) => {
17443
17331
  const isSelected = React.useMemo(() => {
17444
17332
  if (platform === PlatformType.H5) {
17445
17333
  // h5编辑模式下,想要展示操作框,需要是选中并且非start模式
17446
- return (editMapInfo?.mobileMode !== MobileEditMode.START &&
17334
+ return (editMapInfo?.mobileMode !== exports.MobileEditMode.START &&
17447
17335
  editMapInfo?.selectElement?.id === data.id &&
17448
17336
  editMapInfo.elementType === exports.DataType.VISION_OFF);
17449
17337
  }
@@ -17454,13 +17342,13 @@ const VisionOffElement = ({ data, onSelect }) => {
17454
17342
  // h5编辑模式下,
17455
17343
  // start模式可以任意选
17456
17344
  // create或者是edit模式的话,只有选中的是visionOff的时候才能选中
17457
- if ((editMapInfo.mobileMode === MobileEditMode.CREATE ||
17458
- editMapInfo.mobileMode === MobileEditMode.EDIT) &&
17345
+ if ((editMapInfo.mobileMode === exports.MobileEditMode.CREATE ||
17346
+ editMapInfo.mobileMode === exports.MobileEditMode.EDIT) &&
17459
17347
  editMapInfo.elementType !== exports.DataType.VISION_OFF) {
17460
17348
  return;
17461
17349
  }
17462
- if ((editMapInfo.mobileMode === MobileEditMode.CREATE ||
17463
- editMapInfo.mobileMode === MobileEditMode.EDIT) &&
17350
+ if ((editMapInfo.mobileMode === exports.MobileEditMode.CREATE ||
17351
+ editMapInfo.mobileMode === exports.MobileEditMode.EDIT) &&
17464
17352
  editMapInfo.elementType === exports.DataType.VISION_OFF) {
17465
17353
  setEditMapInfo((prev) => ({
17466
17354
  ...prev,
@@ -17474,7 +17362,7 @@ const VisionOffElement = ({ data, onSelect }) => {
17474
17362
  ...prev,
17475
17363
  selectElement: data,
17476
17364
  elementType: exports.DataType.VISION_OFF,
17477
- mobileMode: MobileEditMode.START,
17365
+ mobileMode: exports.MobileEditMode.START,
17478
17366
  }));
17479
17367
  return;
17480
17368
  }
@@ -17888,15 +17776,15 @@ const useDoodleTransform = (data, onTransformChange, options) => {
17888
17776
  };
17889
17777
  };
17890
17778
 
17891
- var _path$a;
17892
- function _extends$e() { return _extends$e = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$e.apply(null, arguments); }
17779
+ var _path$1;
17780
+ function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
17893
17781
  var SvgTransformArrow = function SvgTransformArrow(props) {
17894
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$e({
17782
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
17895
17783
  xmlns: "http://www.w3.org/2000/svg",
17896
17784
  width: 7,
17897
17785
  height: 11,
17898
17786
  fill: "none"
17899
- }, props), _path$a || (_path$a = /*#__PURE__*/React__namespace.createElement("path", {
17787
+ }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
17900
17788
  fill: "#fff",
17901
17789
  d: "M2.156 1.032a.777.777 0 0 0-1.061 0 .69.69 0 0 0-.062.943l.062.068 3.97 3.78-3.97 3.78a.69.69 0 0 0-.062.944l.062.067c.27.257.696.277.99.06l.07-.06 4.5-4.286a.69.69 0 0 0 .063-.943l-.062-.067z",
17902
17790
  opacity: 0.5
@@ -18235,7 +18123,7 @@ const DoodleElement = ({ data }) => {
18235
18123
  const { platform, doodleList } = useCommonContext();
18236
18124
  const isSelected = React.useMemo(() => {
18237
18125
  if (platform === PlatformType.H5) {
18238
- if (editMapInfo.mobileMode !== MobileEditMode.START &&
18126
+ if (editMapInfo.mobileMode !== exports.MobileEditMode.START &&
18239
18127
  editMapInfo?.selectElement?.id === data.id) {
18240
18128
  return true;
18241
18129
  }
@@ -18268,7 +18156,7 @@ const DoodleElement = ({ data }) => {
18268
18156
  }, [doodleList, originData]);
18269
18157
  const isSelectedWithoutOperation = React.useMemo(() => {
18270
18158
  if (platform === PlatformType.H5) {
18271
- if (editMapInfo.mobileMode === MobileEditMode.START &&
18159
+ if (editMapInfo.mobileMode === exports.MobileEditMode.START &&
18272
18160
  editMapInfo?.selectElement?.id === data.id) {
18273
18161
  return true;
18274
18162
  }
@@ -18283,8 +18171,8 @@ const DoodleElement = ({ data }) => {
18283
18171
  if (platform === PlatformType.H5) {
18284
18172
  // h5编辑模式下,
18285
18173
  // 如果是创建,只能选择新建的doodle
18286
- if (editMapInfo.mobileMode === MobileEditMode.CREATE ||
18287
- editMapInfo.mobileMode === MobileEditMode.EDIT) {
18174
+ if (editMapInfo.mobileMode === exports.MobileEditMode.CREATE ||
18175
+ editMapInfo.mobileMode === exports.MobileEditMode.EDIT) {
18288
18176
  return;
18289
18177
  }
18290
18178
  // 如果是编辑的话
@@ -18292,7 +18180,7 @@ const DoodleElement = ({ data }) => {
18292
18180
  ...prev,
18293
18181
  selectElement: data,
18294
18182
  elementType: exports.DataType.DOODLE,
18295
- mobileMode: MobileEditMode.START,
18183
+ mobileMode: exports.MobileEditMode.START,
18296
18184
  }));
18297
18185
  return;
18298
18186
  }
@@ -18373,7 +18261,6 @@ const DoodleElement = ({ data }) => {
18373
18261
  },
18374
18262
  });
18375
18263
  }, [transformedElements]);
18376
- console.log('originData--->', originData, minScale);
18377
18264
  return (jsxRuntime.jsx(DoodleTransformWrapper, { data: originData, onTransformChange: handleTransformChange, isSelected: isSelected, isSelectedWithoutOperation: isSelectedWithoutOperation, onSelect: handleSelect, onCancel: handleCancel, onDragEnd: handleDragEnd, showInfo: platform === PlatformType.H5, onClickInfo: handleClickInfo, minScale: minScale }));
18378
18265
  };
18379
18266
 
@@ -18394,8 +18281,8 @@ const SvgElement = React.memo(({ type, data, interactive = false }) => {
18394
18281
  }
18395
18282
  else if (type === 'visionOff') {
18396
18283
  if (platform === PlatformType.H5 &&
18397
- (editMapInfo.mobileMode === MobileEditMode.CREATE ||
18398
- editMapInfo.mobileMode === MobileEditMode.EDIT) &&
18284
+ (editMapInfo.mobileMode === exports.MobileEditMode.CREATE ||
18285
+ editMapInfo.mobileMode === exports.MobileEditMode.EDIT) &&
18399
18286
  editMapInfo.elementType === exports.DataType.VISION_OFF) {
18400
18287
  return null;
18401
18288
  }
@@ -18419,9 +18306,9 @@ const GElement = ({ type, children }) => {
18419
18306
  return jsxRuntime.jsx("g", { id: `layer-${type}`, children: children }, type);
18420
18307
  };
18421
18308
 
18422
- var css_248z$d = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n cursor: default;\n}\n.index-module_mapEdit__XC5Gw.index-module_createMode__14EPH {\n cursor: crosshair;\n}\n.index-module_mapEdit__XC5Gw.index-module_notCreateCursor__1-OjF {\n cursor: no-drop;\n}";
18423
- var styles$d = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
18424
- styleInject(css_248z$d);
18309
+ var css_248z$1 = ".index-module_mapEdit__XC5Gw {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n height: 100%;\n cursor: default;\n}\n.index-module_mapEdit__XC5Gw.index-module_createMode__14EPH {\n cursor: crosshair;\n}\n.index-module_mapEdit__XC5Gw.index-module_notCreateCursor__1-OjF {\n cursor: no-drop;\n}";
18310
+ var styles$1 = {"mapEdit":"index-module_mapEdit__XC5Gw","createMode":"index-module_createMode__14EPH","notCreateCursor":"index-module_notCreateCursor__1-OjF"};
18311
+ styleInject(css_248z$1);
18425
18312
 
18426
18313
  var classnames = {exports: {}};
18427
18314
 
@@ -18504,23 +18391,19 @@ var classnamesExports = classnames.exports;
18504
18391
  var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
18505
18392
 
18506
18393
  const ChannelClipPath = React.memo(() => {
18507
- const { svgElementDatas, svgRef } = useSvgEditContext();
18394
+ const { svgViewBox } = useCommonContext();
18395
+ const { svgElementDatas } = useSvgEditContext();
18508
18396
  const boundaryData = svgElementDatas?.[exports.DataType.BOUNDARY] || [];
18509
18397
  const [minX, minY, maxX, maxY] = React.useMemo(() => {
18510
- const baseVal = svgRef?.viewBox.baseVal;
18398
+ const baseVal = svgViewBox;
18511
18399
  return [
18512
18400
  baseVal?.x || 0,
18513
18401
  baseVal?.y || 0,
18514
18402
  baseVal?.x + (baseVal?.width || 0),
18515
18403
  baseVal?.y + (baseVal?.height || 0),
18516
18404
  ];
18517
- }, [
18518
- svgRef?.viewBox.baseVal?.x,
18519
- svgRef?.viewBox.baseVal?.y,
18520
- svgRef?.viewBox.baseVal?.width,
18521
- svgRef?.viewBox.baseVal?.height,
18522
- ]);
18523
- console.log('boundaryData---->', svgRef?.viewBox.baseVal);
18405
+ }, [svgViewBox]);
18406
+ console.log('boundaryData---->', svgViewBox);
18524
18407
  /**
18525
18408
  * 判断多边形是否为逆时针方向
18526
18409
  * 使用叉积法计算多边形的有向面积
@@ -18680,6 +18563,7 @@ const ChannelClipPath = React.memo(() => {
18680
18563
  if (partitionCoords.length >= 3) {
18681
18564
  // 判断方向并构建路径
18682
18565
  const isclockwise = isCounterclockwise(partitionCoords);
18566
+ console.log('partitionCoords===', partitionCoords, isclockwise);
18683
18567
  const partitionPath = buildPathData(partitionCoords, isclockwise);
18684
18568
  baseD += ` ${partitionPath}`;
18685
18569
  }
@@ -19420,13 +19304,13 @@ function usePolygonDrawing(options = {}) {
19420
19304
  const [mousePos, setMousePos] = React.useState(null);
19421
19305
  const { editMapInfo, setEditMapInfo } = useMapEditContext();
19422
19306
  const { checkCanNotCreateAtPosition } = useCheckElement();
19423
- const { addHistory, clearHistory } = useHistoryHandle();
19307
+ const { addHistory} = useHistoryHandle();
19424
19308
  const points = React.useMemo(() => {
19425
19309
  console.log('points->', editMapInfo?.selectElement?.points);
19426
19310
  return editMapInfo?.selectElement?.points?.map((item) => ({ x: item[0], y: item[1] })) || [];
19427
19311
  }, [editMapInfo?.selectElement?.points]);
19428
19312
  const completed = React.useMemo(() => {
19429
- return editMapInfo.createMode === CreateStatus.COMPLETED;
19313
+ return editMapInfo.createMode === exports.CreateStatus.COMPLETED;
19430
19314
  }, [editMapInfo.createMode]);
19431
19315
  // 使用 ahooks 的 useThrottleFn 来节流处理鼠标移动
19432
19316
  const { run: throttledMouseMove } = useThrottleFn((svgEl, clientX, clientY) => {
@@ -19473,9 +19357,14 @@ function usePolygonDrawing(options = {}) {
19473
19357
  if (points.length >= 3 && index === points.length - 1) {
19474
19358
  setEditMapInfo({
19475
19359
  ...editMapInfo,
19476
- createMode: CreateStatus.COMPLETED,
19360
+ createMode: exports.CreateStatus.COMPLETED,
19361
+ historyList: [
19362
+ {
19363
+ selectElement: editMapInfo.selectElement,
19364
+ },
19365
+ ],
19366
+ currentHistoryIndex: 0,
19477
19367
  });
19478
- clearHistory();
19479
19368
  }
19480
19369
  }, [points.length, editMapInfo]);
19481
19370
  const reset = React.useCallback(() => {
@@ -19725,7 +19614,7 @@ const useCreateVisionOffElement = () => {
19725
19614
 
19726
19615
  const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMapChange }, ref) => {
19727
19616
  const pointManagerRef = React.useRef(null);
19728
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
19617
+ const { editMapInfo, setEditMapInfo, onSelectElement } = useMapEditContext();
19729
19618
  const { getVisionOffPoints, centerPoint } = useCreateVisionOffElement();
19730
19619
  const { svgElementDatas } = useSvgEditContext();
19731
19620
  const { checkCanNotCreateAtPosition, checkDoodle } = useCheckElement();
@@ -19741,8 +19630,26 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
19741
19630
  return style;
19742
19631
  }, [mapConfig, editMapInfo.elementType]);
19743
19632
  const isCreating = React.useMemo(() => {
19744
- return editMapInfo.createMode === CreateStatus.CREATING;
19633
+ return editMapInfo.createMode === exports.CreateStatus.CREATING;
19745
19634
  }, [editMapInfo.createMode]);
19635
+ const centerBounds = React.useMemo(() => {
19636
+ if (!svgRef || !centerPoint)
19637
+ return null;
19638
+ const elementWidth = 50 * 10;
19639
+ const [minX, minY, maxX, maxY] = [
19640
+ centerPoint[0] - elementWidth / 2,
19641
+ centerPoint[1] - elementWidth / 2,
19642
+ centerPoint[0] + elementWidth / 2,
19643
+ centerPoint[1] + elementWidth / 2,
19644
+ ];
19645
+ const elementPoints = [
19646
+ [minX, minY],
19647
+ [minX, maxY],
19648
+ [maxX, maxY],
19649
+ [maxX, minY],
19650
+ ];
19651
+ return elementPoints;
19652
+ }, [centerPoint]);
19746
19653
  // 调整SVG大小的函数
19747
19654
  const adjustSvgSize = (layoutData) => {
19748
19655
  const padding = 20; // 添加一些边距以避免内容贴边
@@ -19832,23 +19739,73 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
19832
19739
  const svg = selectedDoodle?.svgStr;
19833
19740
  const minLength = selectedDoodle.minLength;
19834
19741
  const parseSvg = SvgParserNative.parseSvg(svg);
19835
- const svgMinLength = Math.min(parseSvg.width, parseSvg.height) / SCALE_FACTOR;
19742
+ const svgMinLength = parseSvg.height / SCALE_FACTOR;
19836
19743
  // 使用获取到的 SVG 内容,如果没有获取到则使用 URL
19837
19744
  newDoodle.svg = svg;
19838
19745
  newDoodle.scale = minLength / svgMinLength;
19839
19746
  newDoodle.direction = 0;
19840
19747
  newDoodle.center = restorePoint(centerPoint);
19841
- setEditMapInfo((prev) => ({
19842
- ...prev,
19748
+ if (platform === PlatformType.H5) {
19749
+ setEditMapInfo((prev) => ({
19750
+ ...prev,
19751
+ currentHistoryIndex: 0,
19752
+ mobileMode: exports.MobileEditMode.CREATE,
19753
+ elementType: exports.DataType.DOODLE,
19754
+ selectElement: newDoodle,
19755
+ }));
19756
+ addHistory({
19757
+ selectElement: newDoodle,
19758
+ });
19759
+ }
19760
+ else {
19761
+ setEditMapInfo({
19762
+ ...editMapInfo,
19763
+ historyList: [
19764
+ {
19765
+ selectElement: newDoodle,
19766
+ },
19767
+ ],
19768
+ currentHistoryIndex: 0,
19769
+ createMode: exports.CreateStatus.COMPLETED,
19770
+ elementType: exports.DataType.DOODLE,
19771
+ selectElement: newDoodle,
19772
+ isShowDrag: true,
19773
+ });
19774
+ }
19775
+ };
19776
+ const addElement = (type, item) => {
19777
+ let newElement = null;
19778
+ if (type === exports.DataType.BOUNDARY) {
19779
+ newElement = initBoundary();
19780
+ }
19781
+ else if (type === exports.DataType.OBSTACLE) {
19782
+ newElement = initObstacle();
19783
+ }
19784
+ else if (type === exports.DataType.CHANNEL) {
19785
+ newElement = initChannel();
19786
+ }
19787
+ else if (type === exports.DataType.VISION_OFF) {
19788
+ newElement = initVisionOff();
19789
+ newElement.points = centerBounds;
19790
+ }
19791
+ else if (type === exports.DataType.DOODLE) {
19792
+ addDoodle(item);
19793
+ return;
19794
+ }
19795
+ setEditMapInfo({
19796
+ ...editMapInfo,
19797
+ historyList: [
19798
+ {
19799
+ selectElement: newElement,
19800
+ },
19801
+ ],
19843
19802
  currentHistoryIndex: 0,
19844
- mobileMode: MobileEditMode.CREATE,
19845
- elementType: exports.DataType.DOODLE,
19846
- selectElement: newDoodle,
19847
- }));
19848
- addHistory({
19849
- selectElement: newDoodle,
19803
+ createMode: type === exports.DataType.VISION_OFF ? exports.CreateStatus.COMPLETED : exports.CreateStatus.CREATING,
19804
+ elementType: type,
19805
+ selectElement: newElement,
19850
19806
  });
19851
19807
  };
19808
+ const saveElement = (type, item) => { };
19852
19809
  React.useEffect(() => {
19853
19810
  onEditInfoMapChange?.(editMapInfo);
19854
19811
  }, [editMapInfo]);
@@ -19885,6 +19842,8 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
19885
19842
  addHistory,
19886
19843
  addDoodle,
19887
19844
  checkDoodle: () => checkDoodle?.(),
19845
+ addElement,
19846
+ saveElement,
19888
19847
  }));
19889
19848
  // 初始化多边形绘制 Hook
19890
19849
  const { onSvgClick, onSvgMouseMove, onPointClick, points, completed, mousePos, updatePoints } = usePolygonDrawing({ createMode: isCreating });
@@ -19899,10 +19858,9 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
19899
19858
  return false;
19900
19859
  return checkCanNotCreateAtPosition(mousePos);
19901
19860
  }, [mousePos, checkCanNotCreateAtPosition]);
19902
- console.log('editMapInfo--->', editMapInfo);
19903
- return (jsxRuntime.jsx("div", { ref: containerRef, className: classNames(styles$d.mapEdit, {
19904
- [styles$d.createMode]: isCreating,
19905
- [styles$d.notCreateCursor]: showNotCreateCursor,
19861
+ return (jsxRuntime.jsx("div", { ref: containerRef, className: classNames(styles$1.mapEdit, {
19862
+ [styles$1.createMode]: isCreating,
19863
+ [styles$1.notCreateCursor]: showNotCreateCursor,
19906
19864
  }), style: {
19907
19865
  display: editMap ? 'block' : 'none',
19908
19866
  }, children: jsxRuntime.jsxs("svg", { style: {
@@ -19948,7 +19906,7 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
19948
19906
  editMapInfo.createMode &&
19949
19907
  editMapInfo?.selectElement?.svg && (jsxRuntime.jsx(DoodleElement, { data: { ...editMapInfo?.selectElement } })), platform === PlatformType.H5 &&
19950
19908
  editMapInfo.elementType === exports.DataType.OBSTACLE &&
19951
- editMapInfo.mobileMode === MobileEditMode.CREATE && (jsxRuntime.jsx(CreateObstacleElement, { ref: pointManagerRef, styles: {
19909
+ editMapInfo.mobileMode === exports.MobileEditMode.CREATE && (jsxRuntime.jsx(CreateObstacleElement, { ref: pointManagerRef, styles: {
19952
19910
  fillColor: '#FF7133',
19953
19911
  strokeColor: '#FF7133',
19954
19912
  }, points: (editMapInfo?.selectElement?.points || []).map((p) => ({
@@ -19964,7 +19922,7 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
19964
19922
  points: new_points,
19965
19923
  },
19966
19924
  elementType: exports.DataType.OBSTACLE,
19967
- mobileMode: MobileEditMode.CREATE,
19925
+ mobileMode: exports.MobileEditMode.CREATE,
19968
19926
  };
19969
19927
  });
19970
19928
  addHistory({
@@ -19972,8 +19930,8 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
19972
19930
  });
19973
19931
  } })), platform === PlatformType.H5 &&
19974
19932
  editMapInfo.elementType === exports.DataType.VISION_OFF &&
19975
- (editMapInfo.mobileMode === MobileEditMode.CREATE ||
19976
- editMapInfo.mobileMode === MobileEditMode.EDIT) &&
19933
+ (editMapInfo.mobileMode === exports.MobileEditMode.CREATE ||
19934
+ editMapInfo.mobileMode === exports.MobileEditMode.EDIT) &&
19977
19935
  editMapInfo.allVisionOffPoints?.length > 0 &&
19978
19936
  editMapInfo.allVisionOffPoints.map((item) => (jsxRuntime.jsx(VisionOffElement, { data: {
19979
19937
  level: 100,
@@ -19995,1771 +19953,77 @@ const SvgEditMap = React.forwardRef(({ mapJson, mapConfig, editMap, onEditInfoMa
19995
19953
  id: item.id,
19996
19954
  } }))), platform === PlatformType.H5 &&
19997
19955
  editMapInfo.elementType === exports.DataType.DOODLE &&
19998
- editMapInfo.mobileMode === MobileEditMode.CREATE &&
19956
+ editMapInfo.mobileMode === exports.MobileEditMode.CREATE &&
19999
19957
  editMapInfo?.selectElement?.svg && (jsxRuntime.jsx(DoodleElement, { data: { ...editMapInfo?.selectElement } }))] }) }));
20000
19958
  });
20001
19959
  SvgEditMap.displayName = 'SvgEditMap';
20002
19960
 
20003
- var css_248z$c = ".index-module_addEntry__QsQHD {\n position: absolute;\n right: 8px;\n top: 8px;\n cursor: pointer;\n z-index: 10;\n}\n.index-module_addEntry__QsQHD .index-module_icon__qIgA4 {\n padding: 6px;\n border-radius: 8px;\n background: #fff;\n box-shadow: 2px 2px 12px 0px rgba(0, 0, 0, 0.2);\n}\n\n.index-module_addItem__mglwZ {\n display: flex;\n align-items: center;\n padding: 4px;\n justify-content: flex-start;\n cursor: pointer;\n}\n.index-module_addItem__mglwZ:hover {\n box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);\n border-radius: 4px;\n}\n.index-module_addItem__mglwZ:not(:last-child) {\n margin-bottom: 6px;\n}\n.index-module_addItem__mglwZ .index-module_icon__qIgA4 {\n width: 16px;\n height: 16px;\n}\n.index-module_addItem__mglwZ .index-module_label__QqZ-9 {\n font-weight: 500;\n font-size: 14px;\n line-height: 16px;\n color: rgb(158, 158, 158);\n margin-left: 4px;\n}";
20004
- var styles$c = {"addEntry":"index-module_addEntry__QsQHD","icon":"index-module_icon__qIgA4","addItem":"index-module_addItem__mglwZ","label":"index-module_label__QqZ-9"};
20005
- styleInject(css_248z$c);
20006
-
20007
- var _rect$2, _path$9, _defs$3;
20008
- function _extends$d() { return _extends$d = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$d.apply(null, arguments); }
20009
- var SvgAddEntry = function SvgAddEntry(props) {
20010
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$d({
20011
- xmlns: "http://www.w3.org/2000/svg",
20012
- width: 24,
20013
- height: 24,
20014
- fill: "none"
20015
- }, props), _rect$2 || (_rect$2 = /*#__PURE__*/React__namespace.createElement("rect", {
20016
- width: 10.95,
20017
- height: 10.95,
20018
- x: 10.613,
20019
- y: 3.15,
20020
- fill: "#1F1F1F",
20021
- stroke: "url(#add-entry_svg__a)",
20022
- strokeWidth: 0.3,
20023
- opacity: 0.795,
20024
- rx: 1.05
20025
- })), /*#__PURE__*/React__namespace.createElement("foreignObject", {
20026
- width: 23.468,
20027
- height: 20.501,
20028
- x: -1.543,
20029
- y: 3.499
20030
- }, /*#__PURE__*/React__namespace.createElement("div", {
20031
- xmlns: "http://www.w3.org/1999/xhtml",
20032
- style: {
20033
- backdropFilter: "blur(1.63px)",
20034
- clipPath: "url(#add-entry_svg__b)",
20035
- height: "100%",
20036
- width: "100%"
20037
- }
20038
- })), _path$9 || (_path$9 = /*#__PURE__*/React__namespace.createElement("path", {
20039
- fill: "#1F1F1F",
20040
- stroke: "url(#add-entry_svg__c)",
20041
- strokeWidth: 0.3,
20042
- d: "M9.302 7.402a1.05 1.05 0 0 1 1.778 0l7.27 11.578a1.05 1.05 0 0 1-.89 1.608H2.92a1.05 1.05 0 0 1-.889-1.608z",
20043
- "data-figma-bg-blur-radius": 3.262
20044
- })), _defs$3 || (_defs$3 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
20045
- id: "add-entry_svg__a",
20046
- x1: 16.851,
20047
- x2: 20.384,
20048
- y1: 10.392,
20049
- y2: 4.767,
20050
- gradientUnits: "userSpaceOnUse"
20051
- }, /*#__PURE__*/React__namespace.createElement("stop", {
20052
- stopColor: "#fff",
20053
- stopOpacity: 0.01
20054
- }), /*#__PURE__*/React__namespace.createElement("stop", {
20055
- offset: 1,
20056
- stopColor: "#fff"
20057
- })), /*#__PURE__*/React__namespace.createElement("linearGradient", {
20058
- id: "add-entry_svg__c",
20059
- x1: 21.47,
20060
- x2: 12.314,
20061
- y1: 15.036,
20062
- y2: 5.769,
20063
- gradientUnits: "userSpaceOnUse"
20064
- }, /*#__PURE__*/React__namespace.createElement("stop", {
20065
- stopColor: "#fff",
20066
- stopOpacity: 0.01
20067
- }), /*#__PURE__*/React__namespace.createElement("stop", {
20068
- offset: 1,
20069
- stopColor: "#fff"
20070
- })), /*#__PURE__*/React__namespace.createElement("clipPath", {
20071
- id: "add-entry_svg__b",
20072
- transform: "translate(1.543 -3.499)"
20073
- }, /*#__PURE__*/React__namespace.createElement("path", {
20074
- d: "M9.302 7.402a1.05 1.05 0 0 1 1.778 0l7.27 11.578a1.05 1.05 0 0 1-.89 1.608H2.92a1.05 1.05 0 0 1-.889-1.608z"
20075
- })))));
20076
- };
20077
-
20078
- var _path$8, _path2$3, _path3;
20079
- function _extends$c() { return _extends$c = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$c.apply(null, arguments); }
20080
- var SvgBoundary = function SvgBoundary(props) {
20081
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$c({
20082
- xmlns: "http://www.w3.org/2000/svg",
20083
- width: 16,
20084
- height: 16,
20085
- fill: "none"
20086
- }, props), _path$8 || (_path$8 = /*#__PURE__*/React__namespace.createElement("path", {
20087
- fill: "#1DBEAC",
20088
- fillRule: "evenodd",
20089
- d: "M3.385 2h9.23C13.38 2 14 2.62 14 3.385v9.23C14 13.38 13.38 14 12.615 14h-9.23C2.62 14 2 13.38 2 12.615v-9.23C2 2.62 2.62 2 3.385 2m9.692 1.385a.46.46 0 0 0-.462-.462h-9.23a.46.46 0 0 0-.462.462v9.23c0 .255.207.462.462.462h9.23a.46.46 0 0 0 .462-.462z",
20090
- clipRule: "evenodd",
20091
- opacity: 0.602
20092
- })), _path2$3 || (_path2$3 = /*#__PURE__*/React__namespace.createElement("path", {
20093
- fill: "#1DBEAC",
20094
- d: "M12.615 2.923c.255 0 .462.207.462.462v9.23a.46.46 0 0 1-.462.462h-9.23a.46.46 0 0 1-.462-.462v-9.23c0-.255.207-.462.462-.462z",
20095
- opacity: 0.152
20096
- })), _path3 || (_path3 = /*#__PURE__*/React__namespace.createElement("path", {
20097
- fill: "#1DBEAC",
20098
- fillRule: "evenodd",
20099
- d: "M2.833 2a.833.833 0 1 0 0 1.667.833.833 0 0 0 0-1.667m0 10.333a.833.833 0 1 0 0 1.667.833.833 0 0 0 0-1.667m9.5-9.5a.833.833 0 1 1 1.667 0 .833.833 0 0 1-1.667 0m.834 9.5a.833.833 0 1 0 0 1.667.833.833 0 0 0 0-1.667M6.49 10.333s.335-4.388 3.451-5.666c-1.725 2.439-1.725 5.666-1.725 5.666zm2.305 0s.548-4.108 2.872-4.816c-1.071 1.7-1.071 4.816-1.071 4.816zM6.87 5.517c-2.384 1.42-2.537 4.816-2.537 4.816h1.582s-.21-2.698.955-4.816",
20100
- clipRule: "evenodd"
20101
- })));
20102
- };
20103
-
20104
- var _path$7, _path2$2, _rect$1, _rect2$1;
20105
- function _extends$b() { return _extends$b = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$b.apply(null, arguments); }
20106
- var SvgLimitIsland = function SvgLimitIsland(props) {
20107
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$b({
19961
+ var _path;
19962
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
19963
+ var SvgMobileAddPoint = function SvgMobileAddPoint(props) {
19964
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
20108
19965
  xmlns: "http://www.w3.org/2000/svg",
20109
- width: 16,
20110
- height: 16,
19966
+ width: 36,
19967
+ height: 36,
20111
19968
  fill: "none"
20112
- }, props), _path$7 || (_path$7 = /*#__PURE__*/React__namespace.createElement("path", {
20113
- fill: "#FFA077",
20114
- d: "M11.725 6.714c-1.019-.137-2.516-1.488-1.9-2.14.588-.621 1.91.344 1.9 2.14"
20115
- })), _path2$2 || (_path2$2 = /*#__PURE__*/React__namespace.createElement("path", {
20116
- fill: "#FF5D17",
20117
- d: "M11.195 3.637c-.863.109-.623 2.341.354 3.024 1.603.79 2.575-.099 2.517-.459-.072-.445-.983-1.014-2.029-.274.455-.92-.08-2.387-.842-2.291M10.004 9.084l.308.87c1.202.178 2.002.494 2.002.856 0 .556-1.887 1.007-4.215 1.007-2.329 0-4.216-.451-4.217-1.007 0-.334.683-.63 1.733-.812l.593-1.679zm-.777-2.197.518 1.463-3.312-.667.443-1.253zM7.467 4.76a.535.535 0 0 1 1.01 0l.493 1.398L7.1 5.794z"
20118
- })), _rect$1 || (_rect$1 = /*#__PURE__*/React__namespace.createElement("rect", {
20119
- width: 14.237,
20120
- height: 10.667,
20121
- x: 0.882,
20122
- y: 2.667,
20123
- fill: "#F50",
20124
- opacity: 0.15,
20125
- rx: 2
20126
- })), _rect2$1 || (_rect2$1 = /*#__PURE__*/React__namespace.createElement("rect", {
20127
- width: 14.237,
20128
- height: 10.667,
20129
- x: 0.882,
20130
- y: 2.667,
20131
- stroke: "#FF5D17",
20132
- strokeWidth: 0.867,
20133
- rx: 2
19969
+ }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
19970
+ stroke: "#fff",
19971
+ strokeLinecap: "round",
19972
+ strokeLinejoin: "round",
19973
+ strokeWidth: 3,
19974
+ d: "M6 12V9a3 3 0 0 1 3-3h3M6 24v3a3 3 0 0 0 3 3h3M24 6h3a3 3 0 0 1 3 3v3m-6 18h3a3 3 0 0 0 3-3v-3m-16.5-6h9M18 13.5v9"
20134
19975
  })));
20135
19976
  };
20136
19977
 
20137
- var _rect, _rect2, _rect3, _rect4, _g$3;
20138
- function _extends$a() { return _extends$a = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$a.apply(null, arguments); }
20139
- var SvgVisionFence = function SvgVisionFence(props) {
20140
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$a({
20141
- xmlns: "http://www.w3.org/2000/svg",
20142
- width: 16,
20143
- height: 16,
20144
- fill: "none"
20145
- }, props), _rect || (_rect = /*#__PURE__*/React__namespace.createElement("rect", {
20146
- width: 14.333,
20147
- height: 10.667,
20148
- x: 0.833,
20149
- y: 2.667,
20150
- fill: "#B1D9FF",
20151
- rx: 2.667
20152
- })), _rect2 || (_rect2 = /*#__PURE__*/React__namespace.createElement("rect", {
20153
- width: 13.333,
20154
- height: 9.667,
20155
- x: 1.333,
20156
- y: 3.167,
20157
- stroke: "#5C9DFF",
20158
- strokeDasharray: "6.33 6.33",
20159
- rx: 1.333
20160
- })), _rect3 || (_rect3 = /*#__PURE__*/React__namespace.createElement("rect", {
20161
- width: 6,
20162
- height: 6,
20163
- x: 5,
20164
- y: 4.833,
20165
- fill: "#B1D9FF",
20166
- rx: 3
20167
- })), /*#__PURE__*/React__namespace.createElement("mask", {
20168
- id: "visionFence_svg__a",
20169
- width: 6,
20170
- height: 6,
20171
- x: 5,
20172
- y: 5,
20173
- maskUnits: "userSpaceOnUse",
20174
- style: {
20175
- maskType: "alpha"
20176
- }
20177
- }, _rect4 || (_rect4 = /*#__PURE__*/React__namespace.createElement("rect", {
20178
- width: 5.333,
20179
- height: 5.333,
20180
- x: 5.333,
20181
- y: 5.5,
20182
- fill: "#B1D9FF",
20183
- rx: 2.667
20184
- }))), _g$3 || (_g$3 = /*#__PURE__*/React__namespace.createElement("g", {
20185
- fill: "#5C9DFF",
20186
- mask: "url(#visionFence_svg__a)"
20187
- }, /*#__PURE__*/React__namespace.createElement("path", {
20188
- d: "m8.838 3.395.636.636-5.42 5.421-.637-.636zM9.896 4.452l.637.637-5.422 5.42-.636-.635zM10.954 5.51l.636.637-5.421 5.421-.636-.636zM12.172 6.547l.636.637-5.421 5.42-.636-.635z"
20189
- }))));
20190
- };
19978
+ var css_248z = ".index-module_crosshair__etey6 {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 40px;\n height: 40px;\n pointer-events: none;\n z-index: 99999;\n display: flex;\n justify-content: center;\n align-items: center;\n}";
19979
+ var styles = {"crosshair":"index-module_crosshair__etey6"};
19980
+ styleInject(css_248z);
20191
19981
 
20192
- var _g$2, _defs$2;
20193
- function _extends$9() { return _extends$9 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$9.apply(null, arguments); }
20194
- var SvgDoodle = function SvgDoodle(props) {
20195
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$9({
20196
- xmlns: "http://www.w3.org/2000/svg",
20197
- width: 16,
20198
- height: 16,
20199
- fill: "none"
20200
- }, props), _g$2 || (_g$2 = /*#__PURE__*/React__namespace.createElement("g", {
20201
- clipPath: "url(#doodle_svg__a)"
20202
- }, /*#__PURE__*/React__namespace.createElement("g", {
20203
- clipPath: "url(#doodle_svg__b)"
20204
- }, /*#__PURE__*/React__namespace.createElement("rect", {
20205
- width: 14.237,
20206
- height: 10.667,
20207
- x: 0.333,
20208
- y: 4.332,
20209
- fill: "#CBFCF7",
20210
- stroke: "#9AEEE5",
20211
- strokeWidth: 0.867,
20212
- rx: 2
20213
- }), /*#__PURE__*/React__namespace.createElement("path", {
20214
- fill: "#F2FFFD",
20215
- d: "M1.374 9.88a4 4 0 0 0 4 4h.546l.514-1.524c.073-.216-.087-.443-.312-.48-1.415-.229-3.6-1.485-4.399-4.639a.35.35 0 0 0-.135-.197c-.138.405-.214.84-.214 1.293z"
20216
- }), /*#__PURE__*/React__namespace.createElement("path", {
20217
- fill: "#50D0C2",
20218
- d: "M15.814 2.13c-.352 2.267-6.501 9.305-8.003 9.43a.282.282 0 0 1-.238-.455L15.565.828c.398.332.293 1.015.249 1.303"
20219
- }), /*#__PURE__*/React__namespace.createElement("path", {
20220
- fill: "#50D0C2",
20221
- d: "M14.208.95c-2.147.946-7.434 8.618-7.15 10.058a.2.2 0 0 0 .017.047.295.295 0 0 0 .498.051L15.565.826c-.437-.28-1.084.003-1.357.123"
20222
- }), /*#__PURE__*/React__namespace.createElement("path", {
20223
- fill: "#9CE7DE",
20224
- d: "M7.76 11.558a.282.282 0 0 1-.187-.453.295.295 0 0 1-.498-.05.2.2 0 0 1-.016-.048c-.108-.55.598-2.01 1.63-3.658l2.297 1.689c-1.348 1.415-2.6 2.473-3.174 2.522a.2.2 0 0 1-.053-.002"
20225
- }), /*#__PURE__*/React__namespace.createElement("path", {
20226
- fill: "#50D0C2",
20227
- d: "M5.602 11.02c.658-.873 1.769-1.145 2.482-.607.714.537.759 1.68.1 2.553-.657.873-2.733.94-2.733.94s-.507-2.013.15-2.886"
20228
- })))), _defs$2 || (_defs$2 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("clipPath", {
20229
- id: "doodle_svg__a"
20230
- }, /*#__PURE__*/React__namespace.createElement("path", {
20231
- fill: "#fff",
20232
- d: "M0 0h16v16H0z"
20233
- })), /*#__PURE__*/React__namespace.createElement("clipPath", {
20234
- id: "doodle_svg__b"
20235
- }, /*#__PURE__*/React__namespace.createElement("path", {
20236
- fill: "#fff",
20237
- d: "M0 0h16v16H0z"
20238
- })))));
19982
+ /**
19983
+ * 十字准心组件
19984
+ * 相对于父容器居中显示
19985
+ */
19986
+ const Crosshair = () => {
19987
+ const { platform } = useCommonContext();
19988
+ const { editMapInfo } = useMapEditContext();
19989
+ const isVisible = React.useMemo(() => {
19990
+ if (platform === PlatformType.H5 &&
19991
+ editMapInfo?.mobileMode === exports.MobileEditMode.CREATE &&
19992
+ editMapInfo?.elementType === exports.DataType.OBSTACLE) {
19993
+ return true;
19994
+ }
19995
+ return false;
19996
+ }, [platform, editMapInfo]);
19997
+ return isVisible ? (jsxRuntime.jsx("div", { className: styles.crosshair, children: jsxRuntime.jsx(SvgMobileAddPoint, {}) })) : null;
20239
19998
  };
20240
19999
 
20241
- var HandleElementMapType;
20242
- (function (HandleElementMapType) {
20243
- HandleElementMapType["name"] = "name";
20244
- HandleElementMapType["focus"] = "focus";
20245
- HandleElementMapType["delete"] = "delete";
20246
- HandleElementMapType["timePeriod"] = "timePeriod";
20247
- HandleElementMapType["area"] = "area";
20248
- HandleElementMapType["dooleExist"] = "dooleExist";
20249
- })(HandleElementMapType || (HandleElementMapType = {}));
20250
- const DATE_TYPE_MAP = [
20251
- { type: exports.DataType.BOUNDARY, label: 'Boundary', icon: jsxRuntime.jsx(SvgBoundary, {}) },
20252
- {
20253
- type: exports.DataType.OBSTACLE,
20254
- paramType: RecordTypeEnum.OBSTACLE,
20255
- label: 'Off-limit island',
20256
- icon: jsxRuntime.jsx(SvgLimitIsland, {}),
20257
- },
20258
- // { type: DataType.CHANNEL, label: 'Channel', icon: <ChannelIcon /> },
20259
- {
20260
- type: exports.DataType.VISION_OFF,
20261
- paramType: RecordTypeEnum.VISI_OFF,
20262
- label: 'VisionFence-off zone',
20263
- icon: jsxRuntime.jsx(SvgVisionFence, {}),
20264
- },
20265
- {
20266
- type: exports.DataType.DOODLE,
20267
- paramType: RecordTypeEnum.DOODLE,
20268
- label: 'Doodle',
20269
- icon: jsxRuntime.jsx(SvgDoodle, {}),
20270
- },
20271
- ];
20272
- ({
20273
- [exports.DataType.BOUNDARY]: {
20274
- },
20275
- [exports.DataType.OBSTACLE]: {
20276
- },
20277
- [exports.DataType.CHANNEL]: {
20278
- },
20279
- [exports.DataType.VISION_OFF]: {
20280
- },
20281
- [exports.DataType.DOODLE]: {
20282
- },
20283
- [exports.DataType.PATH]: undefined,
20284
- [exports.DataType.ANTENNA]: undefined,
20285
- [exports.DataType.CHARGING_PILE]: undefined,
20286
- });
20287
-
20288
- var css_248z$b = ".ant-modal .ant-modal-body .ant-modal-confirm-title {\n text-align: center;\n}\n.ant-modal .ant-modal-body .ant-modal-confirm-btns {\n margin-top: 24px;\n}\n.ant-modal .ant-modal-body .ant-modal-confirm-btns .ant-btn + .ant-btn {\n margin-left: 24px;\n}\n\n.index-module_modal__fkxhn.index-module_center__d461v .ant-modal-title {\n text-align: center;\n padding: 10px 20px 0;\n font-size: 18px;\n}\n.index-module_modal__fkxhn.index-module_center__d461v .ant-modal-header {\n margin-bottom: 24px;\n}\n.index-module_modal__fkxhn.index-module_center__d461v .ant-modal .ant-modal-footer {\n margin-top: 24px;\n}\n.index-module_modal__fkxhn.index-module_center__d461v .ant-modal .ant-modal-footer .ant-btn + .ant-btn {\n margin-left: 24px;\n}";
20289
- var styles$b = {"modal":"index-module_modal__fkxhn","center":"index-module_center__d461v"};
20290
- styleInject(css_248z$b);
20291
-
20292
- const CustomModal = ({ children, titleCenter, hasMinHeight, height, ...props }) => {
20293
- return (jsxRuntime.jsx(antd.Modal, { centered: true, styles: {
20294
- body: {
20295
- maxHeight: height ? `${height}px` : 'calc(100vh - 200px)',
20296
- minHeight: hasMinHeight ? '520px' : undefined,
20297
- overflow: 'auto',
20298
- },
20299
- }, wrapClassName: classNames(styles$b.modal, {
20300
- [styles$b.center]: titleCenter,
20301
- }), cancelButtonProps: { color: 'primary', variant: 'outlined' }, cancelText: 'Cancel', ...props, children: children }));
20000
+ // 验证GPS坐标是否有效
20001
+ const isValidGpsCoordinate = (coordinate) => {
20002
+ if (!coordinate || coordinate.length < 2)
20003
+ return false;
20004
+ const [lng, lat] = coordinate;
20005
+ // 检查是否为有效的GPS坐标范围,且不是原点(0,0)
20006
+ return (lng >= -180 &&
20007
+ lng <= 180 &&
20008
+ lat >= -90 &&
20009
+ lat <= 90 &&
20010
+ !(Math.abs(lng) < 0.001 && Math.abs(lat) < 0.001) // 排除接近(0,0)的坐标
20011
+ );
20302
20012
  };
20303
-
20304
- var css_248z$a = ".index-module_doodleModal__EGNPW .index-module_title__ViZuB {\n font-weight: 400;\n font-size: 14px;\n line-height: 20px;\n color: rgb(29, 29, 29);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T {\n display: flex;\n flex-wrap: wrap;\n gap: 10px;\n max-height: 230px;\n overflow-y: auto;\n width: 470px;\n margin: 20px auto 0;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 {\n width: 70px;\n height: 70px;\n padding: 10px;\n border-radius: 8px;\n cursor: pointer;\n border: 2px solid transparent;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n position: relative;\n background: rgb(233, 242, 241);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7:hover {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7.index-module_active__1OHfd {\n border: 2px solid #ff5a00;\n background-color: rgba(110, 220, 207, 0.1);\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7.index-module_active__1OHfd .index-module_selectIcon__EFQF- {\n display: block;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_svgImage__2OT8- {\n width: 100%;\n height: 100%;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_svgImage__2OT8- svg {\n width: 100%;\n height: 100%;\n}\n.index-module_doodleModal__EGNPW .index-module_content__h-60T .index-module_item__dvoq7 .index-module_selectIcon__EFQF- {\n position: absolute;\n bottom: 4px;\n right: 4px;\n display: none;\n}";
20305
- var styles$a = {"doodleModal":"index-module_doodleModal__EGNPW","title":"index-module_title__ViZuB","content":"index-module_content__h-60T","item":"index-module_item__dvoq7","active":"index-module_active__1OHfd","svgImage":"index-module_svgImage__2OT8-"};
20306
- styleInject(css_248z$a);
20307
-
20308
- const DoodleModal = ({ open, onSelect, setOpen, doodleList, centerPoint }) => {
20309
- const { editMapInfo, setEditMapInfo, onHandleEnterRecord } = useMapEditContext();
20310
- const [selectedDoodle, setSelectedDoodle] = React.useState(null);
20311
- const noNeed = React.useMemo(() => {
20312
- return '1234567890QWERTYUIOPASDFGHJKLZXCVBNM';
20313
- }, []);
20314
- // 选择 Doodle
20315
- const handleSelectDoodle = React.useCallback((item) => {
20316
- setSelectedDoodle(item);
20317
- }, []);
20318
- // 确认选择
20319
- const handleConfirm = React.useCallback(() => {
20320
- if (selectedDoodle) {
20321
- const newDoodle = initDoodle();
20322
- const svg = selectedDoodle?.svgStr;
20323
- const minLength = selectedDoodle.minLength;
20324
- const parseSvg = SvgParserNative.parseSvg(svg);
20325
- const svgMinLength = parseSvg.height / SCALE_FACTOR;
20326
- // 使用获取到的 SVG 内容,如果没有获取到则使用 URL
20327
- newDoodle.svg = svg;
20328
- newDoodle.scale = minLength / svgMinLength;
20329
- newDoodle.direction = 0;
20330
- newDoodle.center = restorePoint(centerPoint);
20331
- onHandleEnterRecord?.({
20332
- type: 1,
20333
- function: 0,
20334
- })?.then(() => {
20335
- setEditMapInfo({
20336
- ...editMapInfo,
20337
- historyList: [
20338
- {
20339
- selectElement: newDoodle,
20340
- },
20341
- ],
20342
- currentHistoryIndex: 0,
20343
- createMode: CreateStatus.COMPLETED,
20344
- elementType: exports.DataType.DOODLE,
20345
- selectElement: newDoodle,
20346
- isShowDrag: true,
20347
- });
20348
- setOpen(false);
20349
- onSelect?.(svg);
20350
- }, (error) => {
20351
- antd.message.error('Save failed, please try again');
20352
- });
20353
- }
20354
- }, [selectedDoodle, setEditMapInfo, editMapInfo, setOpen, onSelect, centerPoint]);
20355
- return (jsxRuntime.jsx(CustomModal, { width: 560, title: "Create doodle", titleCenter: true, open: open, onOk: handleConfirm, onCancel: () => setOpen(false), okButtonProps: { disabled: !selectedDoodle }, afterClose: () => setSelectedDoodle(null), okText: "Create", cancelText: "Cancel", children: jsxRuntime.jsxs("div", { className: styles$a.doodleModal, children: [jsxRuntime.jsx("div", { className: styles$a.title, children: "Select the doodle that you want to create" }), jsxRuntime.jsx("div", { className: styles$a.content, children: doodleList
20356
- ?.filter((item) => !noNeed.includes(item.name))
20357
- .map((item) => {
20358
- return (jsxRuntime.jsx("div", { className: classNames(styles$a.item, {
20359
- [styles$a.active]: selectedDoodle?.svg === item.svg,
20360
- }), onClick: () => handleSelectDoodle(item), children: jsxRuntime.jsx("div", { className: styles$a.svgImage, dangerouslySetInnerHTML: { __html: item?.svgStr } }) }, item.id));
20361
- }) })] }) }));
20362
- };
20363
-
20364
- const AddEntry = ({ doodleList, disabledObstacles, editMap }) => {
20365
- const { svgRef } = useSvgEditContext();
20366
- const { editMapInfo, setEditMapInfo, onHandleEnterRecord } = useMapEditContext();
20367
- const divRef = React.useRef(null);
20368
- const [open, setOpen] = React.useState(false);
20369
- const [doodleOpen, setDoodleOpen] = React.useState(false);
20370
- const centerPoint = React.useMemo(() => {
20371
- if (!svgRef)
20372
- return null;
20373
- const baseVal = svgRef?.viewBox.baseVal;
20374
- const center = [
20375
- baseVal?.x + (baseVal?.width || 0) / 2,
20376
- baseVal?.y + (baseVal?.height || 0) / 2,
20377
- ];
20378
- return center;
20379
- }, [svgRef?.viewBox?.baseVal?.x]);
20380
- const centerBounds = React.useMemo(() => {
20381
- if (!svgRef)
20382
- return null;
20383
- const elementWidth = 50 * 10;
20384
- const [minX, minY, maxX, maxY] = [
20385
- centerPoint[0] - elementWidth / 2,
20386
- centerPoint[1] - elementWidth / 2,
20387
- centerPoint[0] + elementWidth / 2,
20388
- centerPoint[1] + elementWidth / 2,
20389
- ];
20390
- const elementPoints = [
20391
- [minX, minY],
20392
- [minX, maxY],
20393
- [maxX, maxY],
20394
- [maxX, minY],
20395
- ];
20396
- return elementPoints;
20397
- }, [centerPoint]);
20398
- const addNewElement = React.useCallback((type, item) => {
20399
- setOpen(false);
20400
- let newElement = null;
20401
- if (type === exports.DataType.BOUNDARY) {
20402
- newElement = initBoundary();
20403
- }
20404
- else if (type === exports.DataType.OBSTACLE) {
20405
- newElement = initObstacle();
20406
- }
20407
- else if (type === exports.DataType.CHANNEL) {
20408
- newElement = initChannel();
20409
- }
20410
- else if (type === exports.DataType.VISION_OFF) {
20411
- newElement = initVisionOff();
20412
- newElement.points = centerBounds;
20413
- }
20414
- else if (type === exports.DataType.DOODLE) {
20415
- return setDoodleOpen(true);
20416
- }
20417
- onHandleEnterRecord?.({
20418
- type: item?.paramType,
20419
- function: item?.type === exports.DataType.OBSTACLE ? 0 : undefined,
20420
- })?.then(() => {
20421
- setEditMapInfo({
20422
- ...editMapInfo,
20423
- historyList: [
20424
- {
20425
- selectElement: newElement,
20426
- },
20427
- ],
20428
- currentHistoryIndex: 0,
20429
- createMode: type === exports.DataType.VISION_OFF ? CreateStatus.COMPLETED : CreateStatus.CREATING,
20430
- elementType: type,
20431
- selectElement: newElement,
20432
- });
20433
- }, (errorText) => {
20434
- antd.message.error('Save failed, please try again');
20435
- });
20436
- }, [centerBounds]);
20437
- const addItems = React.useMemo(() => {
20438
- return DATE_TYPE_MAP?.filter((item) => {
20439
- if (item.type === exports.DataType.OBSTACLE) {
20440
- return !disabledObstacles;
20441
- }
20442
- return item.type !== exports.DataType.BOUNDARY;
20443
- });
20444
- }, [disabledObstacles]);
20445
- // console.log('addEntry->', editMapInfo, editMap);
20446
- if (editMapInfo.createMode || editMapInfo.editMap || !editMap) {
20447
- return null;
20448
- }
20449
- return (jsxRuntime.jsxs("div", { ref: divRef, className: styles$c.addEntry, children: [jsxRuntime.jsx(antd.Popover, { open: open, onOpenChange: setOpen, arrow: false, placement: "leftTop", content: addItems?.map((item) => {
20450
- return (jsxRuntime.jsxs("div", { className: styles$c.addItem, onClick: () => {
20451
- addNewElement(item.type, item);
20452
- }, children: [jsxRuntime.jsx("div", { className: styles$c.icon, children: item?.icon }), jsxRuntime.jsx("div", { className: styles$c.label, children: item?.label })] }, item.label));
20453
- }), children: jsxRuntime.jsx("div", { className: styles$c.icon, children: jsxRuntime.jsx(SvgAddEntry, {}) }) }), jsxRuntime.jsx(DoodleModal, { centerPoint: centerPoint, doodleList: doodleList, open: doodleOpen, onOk: () => setDoodleOpen(false), setOpen: setDoodleOpen })] }));
20454
- };
20455
-
20456
- var css_248z$9 = ".index-module_handleElementInfo__vWIaf {\n position: absolute;\n right: 0;\n top: 0;\n border-radius: 8px;\n padding: 8px;\n background: #fff;\n width: 265px;\n user-select: none;\n}\n.index-module_handleElementInfo__vWIaf .index-module_border__iPL-- {\n margin: 8px 0;\n border-top: 1px solid #c5c5c5;\n}\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 {\n position: absolute;\n left: -96px;\n top: 0;\n display: flex;\n gap: 12px;\n}\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_undo__lPY1X,\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_redo__EU5u- {\n background: #fff;\n border-radius: 8px;\n padding: 6px;\n}\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_undo__lPY1X:not(.index-module_disabled__w6gCJ):hover,\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_redo__EU5u-:not(.index-module_disabled__w6gCJ):hover {\n opacity: 0.8;\n cursor: pointer;\n}\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_undo__lPY1X.index-module_disabled__w6gCJ,\n.index-module_handleElementInfo__vWIaf .index-module_undoAndRedo__EKeA8 .index-module_redo__EU5u-.index-module_disabled__w6gCJ {\n color: #d8d8d8;\n}\n.index-module_handleElementInfo__vWIaf .index-module_nameEdit__eVzQ- {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n.index-module_handleElementInfo__vWIaf .index-module_nameEdit__eVzQ- input {\n padding: 2px 0;\n}\n.index-module_handleElementInfo__vWIaf .index-module_nameEdit__eVzQ- .index-module_edit__b0r9I {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n.index-module_handleElementInfo__vWIaf .index-module_boundaryOther__FyJvt {\n padding-top: 4px;\n border-top: 1px solid rgb(197, 197, 197);\n}\n.index-module_handleElementInfo__vWIaf .index-module_handle__4mIxr {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 0px 0 4px 0;\n}\n\n.index-module_doodleInfo__bd2ua .index-module_time__1bUFf {\n width: 100%;\n}\n.index-module_doodleInfo__bd2ua .index-module_exist__gWtNo {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n}\n.index-module_doodleInfo__bd2ua .index-module_tip__1HNmj {\n color: #ff3f33;\n margin-top: 10px;\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n}\n\n.index-module_areaInfo__-WJPL {\n color: #9e9e9e;\n width: 100%;\n font-size: 14px;\n font-weight: 400;\n line-height: 16px; /* 114.286% */\n}\n.index-module_areaInfo__-WJPL .index-module_areaItem__fk-i2 {\n display: flex;\n justify-content: space-between;\n padding: 6px 0;\n}\n.index-module_areaInfo__-WJPL .index-module_areaItem__fk-i2:not(:last-child) {\n margin-bottom: 4px;\n}\n\n.index-module_boundaryInfo__VfR-N .index-module_otherEdit__17SuM {\n color: #1f1f1f;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n line-height: 16px;\n}\n.index-module_boundaryInfo__VfR-N .index-module_otherEdit__17SuM .index-module_otherItem__ATLFZ {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n}\n.index-module_boundaryInfo__VfR-N .index-module_otherEdit__17SuM .index-module_otherItem__ATLFZ .index-module_value__x3-se {\n margin-left: auto;\n}\n.index-module_boundaryInfo__VfR-N .index-module_otherEdit__17SuM .index-module_otherItem__ATLFZ .index-module_icon__167WB {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}";
20457
- var styles$9 = {"handleElementInfo":"index-module_handleElementInfo__vWIaf","border":"index-module_border__iPL--","undoAndRedo":"index-module_undoAndRedo__EKeA8","undo":"index-module_undo__lPY1X","redo":"index-module_redo__EU5u-","disabled":"index-module_disabled__w6gCJ","nameEdit":"index-module_nameEdit__eVzQ-","handle":"index-module_handle__4mIxr","doodleInfo":"index-module_doodleInfo__bd2ua","time":"index-module_time__1bUFf","exist":"index-module_exist__gWtNo","tip":"index-module_tip__1HNmj","areaInfo":"index-module_areaInfo__-WJPL","areaItem":"index-module_areaItem__fk-i2","boundaryInfo":"index-module_boundaryInfo__VfR-N","otherEdit":"index-module_otherEdit__17SuM","otherItem":"index-module_otherItem__ATLFZ","value":"index-module_value__x3-se","icon":"index-module_icon__167WB"};
20458
- styleInject(css_248z$9);
20459
-
20460
- var css_248z$8 = ".index-module_infoHeader__l9F6q {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 6px 0;\n}\n.index-module_infoHeader__l9F6q .index-module_headerIcon__sK1hg {\n width: 16px;\n height: 16px;\n}\n.index-module_infoHeader__l9F6q .index-module_headerName__UGnrH {\n margin-left: 4px;\n color: rgb(158, 158, 158);\n font-weight: 500;\n font-size: 14px;\n line-height: 16px;\n pointer-events: none;\n}\n.index-module_infoHeader__l9F6q .index-module_headerHandle__ymh7f {\n margin-left: auto;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n.index-module_infoHeader__l9F6q .index-module_headerHandle__ymh7f .index-module_focus__llcox {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}\n.index-module_infoHeader__l9F6q .index-module_headerHandle__ymh7f .index-module_delete__hD4-Q {\n width: 16px;\n height: 16px;\n margin-left: 8px;\n cursor: pointer;\n}";
20461
- var styles$8 = {"infoHeader":"index-module_infoHeader__l9F6q","headerIcon":"index-module_headerIcon__sK1hg","headerName":"index-module_headerName__UGnrH","headerHandle":"index-module_headerHandle__ymh7f","focus":"index-module_focus__llcox","delete":"index-module_delete__hD4-Q"};
20462
- styleInject(css_248z$8);
20463
-
20464
- var _path$6;
20465
- function _extends$8() { return _extends$8 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$8.apply(null, arguments); }
20466
- var SvgFocus = function SvgFocus(props) {
20467
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$8({
20468
- xmlns: "http://www.w3.org/2000/svg",
20469
- width: 16,
20470
- height: 16,
20471
- fill: "none"
20472
- }, props), _path$6 || (_path$6 = /*#__PURE__*/React__namespace.createElement("path", {
20473
- fill: "#FF5A00",
20474
- d: "M8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5m-1.733-4h-.022c-.728 0-1.306 0-1.77.038-.476.039-.878.12-1.246.307a3.17 3.17 0 0 0-1.384 1.384c-.187.367-.268.77-.307 1.246-.038.464-.038 1.042-.038 1.77v.022a.5.5 0 0 0 1 0c0-.755 0-1.292.035-1.711.033-.413.098-.67.201-.873.208-.408.54-.74.947-.947.203-.103.46-.167.873-.201.42-.034.956-.035 1.71-.035a.5.5 0 0 0 0-1m3.466 1c.756 0 1.292 0 1.711.035.413.033.67.098.873.201.408.208.74.54.947.947.103.203.167.46.201.873.034.42.035.956.035 1.71a.5.5 0 0 0 1 0v-.021c0-.728 0-1.306-.038-1.77-.039-.476-.12-.878-.307-1.246a3.17 3.17 0 0 0-1.384-1.384c-.368-.187-.77-.268-1.246-.307-.464-.038-1.042-.038-1.77-.038h-.022a.5.5 0 0 0 0 1M2.5 9.733a.5.5 0 0 0-1 0v.022c0 .728 0 1.306.038 1.77.039.476.12.878.307 1.246.304.596.788 1.08 1.384 1.384.367.187.77.268 1.246.307.464.038 1.042.038 1.77.038h.022a.5.5 0 0 0 0-1c-.755 0-1.292 0-1.711-.035-.413-.033-.67-.098-.873-.201a2.17 2.17 0 0 1-.947-.947c-.103-.203-.167-.46-.201-.873-.034-.42-.035-.956-.035-1.71m12 0a.5.5 0 0 0-1 0c0 .756 0 1.292-.035 1.711-.033.413-.098.67-.201.873-.208.408-.54.74-.947.947-.203.103-.46.167-.873.201-.42.034-.956.035-1.71.035a.5.5 0 0 0 0 1h.021c.728 0 1.306 0 1.77-.038.476-.039.878-.12 1.246-.307a3.17 3.17 0 0 0 1.384-1.384c.187-.368.268-.77.307-1.246.038-.464.038-1.042.038-1.77z"
20475
- })));
20476
- };
20477
-
20478
- var _path$5;
20479
- function _extends$7() { return _extends$7 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$7.apply(null, arguments); }
20480
- var SvgDelete = function SvgDelete(props) {
20481
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$7({
20482
- xmlns: "http://www.w3.org/2000/svg",
20483
- width: 16,
20484
- height: 16,
20485
- fill: "none"
20486
- }, props), _path$5 || (_path$5 = /*#__PURE__*/React__namespace.createElement("path", {
20487
- fill: "#FF5A00",
20488
- d: "M4.667 14q-.55 0-.942-.391a1.29 1.29 0 0 1-.392-.942V4h-.666V2.667H6V2h4v.667h3.333V4h-.666v8.667q0 .549-.392.942-.39.391-.942.391zM6 11.333h1.333v-6H6zm2.667 0H10v-6H8.667z"
20489
- })));
20490
- };
20491
-
20492
- const Header = ({ handleDelete, handleFocus, showFocus = false, showDelete = true, type, }) => {
20493
- const currentType = React.useMemo(() => {
20494
- return DATE_TYPE_MAP.find((item) => item.type === type);
20495
- }, [type]);
20496
- return (jsxRuntime.jsxs("div", { className: styles$8.infoHeader, children: [jsxRuntime.jsx("div", { className: styles$8.headerIcon, children: currentType?.icon }), jsxRuntime.jsx("div", { className: styles$8.headerName, children: currentType?.label }), jsxRuntime.jsxs("div", { className: styles$8.headerHandle, children: [showFocus && (jsxRuntime.jsx("div", { className: styles$8.focus, onClick: handleFocus, children: jsxRuntime.jsx(SvgFocus, {}) })), showDelete && (jsxRuntime.jsx("div", { className: styles$8.delete, onClick: handleDelete, children: jsxRuntime.jsx(SvgDelete, {}) }))] })] }));
20497
- };
20498
-
20499
- var css_248z$7 = ".index-module_nameEdit__O5bL0 {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n width: 100%;\n}\n.index-module_nameEdit__O5bL0 .index-module_content__Bi2fa {\n flex: 1;\n line-height: 28px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.index-module_nameEdit__O5bL0 .index-module_edit__3yRM0 {\n width: 16px;\n height: 16px;\n cursor: pointer;\n}";
20500
- var styles$7 = {"nameEdit":"index-module_nameEdit__O5bL0","content":"index-module_content__Bi2fa","edit":"index-module_edit__3yRM0"};
20501
- styleInject(css_248z$7);
20502
-
20503
- var _path$4;
20504
- function _extends$6() { return _extends$6 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$6.apply(null, arguments); }
20505
- var SvgEdit = function SvgEdit(props) {
20506
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$6({
20507
- xmlns: "http://www.w3.org/2000/svg",
20508
- width: 16,
20509
- height: 16,
20510
- fill: "none"
20511
- }, props), _path$4 || (_path$4 = /*#__PURE__*/React__namespace.createElement("path", {
20512
- fill: "#FF5A00",
20513
- d: "M9.068 1.916a.751.751 0 0 1 0 1.501h-4.9a.75.75 0 0 0-.75.75v7.667c0 .414.336.75.75.75h7.667c.414 0 .75-.336.75-.75v-4.9a.75.75 0 0 1 1.5 0v4.9a2.25 2.25 0 0 1-2.25 2.25H4.168a2.25 2.25 0 0 1-2.25-2.25V4.167a2.25 2.25 0 0 1 2.25-2.251zm3.735.22a.75.75 0 0 1 1.06 1.061L8.53 8.53a.75.75 0 0 1-1.06-1.06z"
20514
- })));
20515
- };
20516
-
20517
- const NameModal = ({ title, name, open, setOpen, onOk }) => {
20518
- const [nameValue, setNameValue] = React.useState('');
20519
- React.useEffect(() => {
20520
- if (open) {
20521
- setNameValue(name || '');
20522
- }
20523
- }, [name, open]);
20524
- return (jsxRuntime.jsx(CustomModal, { title: `${title}`, titleCenter: true, open: open, onOk: () => {
20525
- onOk?.(nameValue);
20526
- setOpen(false);
20527
- }, onCancel: () => setOpen(false), okText: "Confirm", afterClose: () => {
20528
- setNameValue('');
20529
- }, children: jsxRuntime.jsx(antd.Input, { maxLength: 12, showCount: true, placeholder: "Please enter boundary name", value: nameValue, onChange: (e) => setNameValue(e.target.value) }) }));
20530
- };
20531
-
20532
- const NameEdit = ({ title, name, onChange }) => {
20533
- const [open, setOpen] = React.useState(false);
20534
- return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: styles$7.nameEdit, children: [jsxRuntime.jsx("div", { className: styles$7.content, children: name }), jsxRuntime.jsx("div", { className: styles$7.edit, onClick: () => setOpen(true), children: jsxRuntime.jsx(SvgEdit, {}) })] }), jsxRuntime.jsx(NameModal, { title: title, name: name, open: open, setOpen: setOpen, onOk: onChange })] }));
20535
- };
20536
-
20537
- var _path$3;
20538
- function _extends$5() { return _extends$5 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$5.apply(null, arguments); }
20539
- var SvgArrow = function SvgArrow(props) {
20540
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$5({
20541
- xmlns: "http://www.w3.org/2000/svg",
20542
- width: 16,
20543
- height: 16,
20544
- fill: "none"
20545
- }, props), _path$3 || (_path$3 = /*#__PURE__*/React__namespace.createElement("path", {
20546
- fill: "#1F1F1F",
20547
- d: "M11.523 7.704c.005.014.015.026.02.04.049.125.065.268.046.406a.73.73 0 0 1-.152.363l-3.88 4.638a.47.47 0 0 1-.377.182.49.49 0 0 1-.369-.208.77.77 0 0 1-.144-.477.76.76 0 0 1 .164-.466l3.483-4.162-3.468-4.224a.77.77 0 0 1-.15-.462c0-.172.053-.338.148-.463a.49.49 0 0 1 .36-.204.47.47 0 0 1 .371.17l3.845 4.682q.007.017.017.032.008.01.018.019c.032.04.046.09.067.134"
20548
- })));
20549
- };
20550
-
20551
- var css_248z$6 = ".index-module_item__wwHEt {\n font-weight: 400;\n font-size: 14px;\n line-height: 16px;\n display: flex;\n align-items: center;\n padding: 6px 0;\n}\n.index-module_item__wwHEt:not(:last-child) {\n margin-bottom: 4px;\n}";
20552
- var styles$6 = {"item":"index-module_item__wwHEt"};
20553
- styleInject(css_248z$6);
20554
-
20555
- const Item = ({ children }) => {
20556
- return (jsxRuntime.jsx("div", { className: styles$6.item, children: children }));
20557
- };
20558
-
20559
- var css_248z$5 = ".index-module_edgeMowing__kmHPN .index-module_item__O2omj {\n border-bottom: 1px solid #C5C5C5;\n margin-bottom: 20px;\n}\n.index-module_edgeMowing__kmHPN .index-module_item__O2omj .index-module_content__ENa5I {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 4px 0;\n}\n.index-module_edgeMowing__kmHPN .index-module_item__O2omj .index-module_tip__BoRNQ {\n color: #9E9E9E;\n font-size: 14px;\n font-weight: 400;\n line-height: 16px;\n padding: 10px 0;\n}";
20560
- var styles$5 = {"edgeMowing":"index-module_edgeMowing__kmHPN","item":"index-module_item__O2omj","content":"index-module_content__ENa5I","tip":"index-module_tip__BoRNQ"};
20561
- styleInject(css_248z$5);
20562
-
20563
- const MowingEdgeModal = ({ open, setOpen, onChange, value }) => {
20564
- const [currentValue, setCurrentValue] = React.useState({});
20565
- const handleOk = () => {
20566
- onChange(currentValue);
20567
- setOpen(false);
20568
- };
20569
- React.useEffect(() => {
20570
- if (!open)
20571
- return;
20572
- setCurrentValue(value);
20573
- }, [open]);
20574
- return (jsxRuntime.jsx(CustomModal, { title: "Edge Mowing", titleCenter: true, open: open, onCancel: () => setOpen(false), onOk: handleOk, afterClose: () => {
20575
- setCurrentValue({});
20576
- }, children: jsxRuntime.jsxs("div", { className: styles$5.edgeMowing, children: [jsxRuntime.jsxs("div", { className: styles$5.item, children: [jsxRuntime.jsxs("div", { className: styles$5.content, children: [jsxRuntime.jsx("div", { className: styles$5.label, children: "Mow along boundary" }), jsxRuntime.jsx("div", { className: styles$5.value, children: jsxRuntime.jsx(antd.Switch, { checked: currentValue['edgeMowing'], onChange: (val) => setCurrentValue({
20577
- obstacleMowEdge: currentValue?.obstacleMowEdge,
20578
- edgeMowing: val,
20579
- }) }) })] }), jsxRuntime.jsx("div", { className: styles$5.tip, children: "When enabled, the mower will mow along the selected boundary." })] }), jsxRuntime.jsxs("div", { className: styles$5.item, children: [jsxRuntime.jsxs("div", { className: styles$5.content, children: [jsxRuntime.jsx("div", { className: styles$5.label, children: "Mow around off-limit island" }), jsxRuntime.jsx("div", { className: styles$5.value, children: jsxRuntime.jsx(antd.Switch, { value: currentValue['obstacleMowEdge'], onChange: (val) => setCurrentValue({
20580
- obstacleMowEdge: val,
20581
- edgeMowing: currentValue?.edgeMowing,
20582
- }) }) })] }), jsxRuntime.jsx("div", { className: styles$5.tip, children: "When enabled, the mower will mow around the off-limit islands within the selected mowing zone." })] })] }) }));
20583
- };
20584
-
20585
- var css_248z$4 = ".index-module_zoneHeightModal__ehNMQ {\n padding: 0 10px;\n}\n.index-module_zoneHeightModal__ehNMQ .ant-radio-group {\n display: block;\n}\n.index-module_zoneHeightModal__ehNMQ .index-module_item__wQUzZ {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 14px;\n opacity: 0.4;\n}\n.index-module_zoneHeightModal__ehNMQ .index-module_item__wQUzZ.index-module_checked__xbxQ4 {\n opacity: 1;\n}\n.index-module_zoneHeightModal__ehNMQ .index-module_item__wQUzZ:not(:last-child) {\n margin-bottom: 20px;\n}\n.index-module_zoneHeightModal__ehNMQ .index-module_item__wQUzZ .index-module_right__IuIfk {\n text-align: right;\n width: 300px;\n margin-left: auto;\n}";
20586
- var styles$4 = {"zoneHeightModal":"index-module_zoneHeightModal__ehNMQ","item":"index-module_item__wQUzZ","checked":"index-module_checked__xbxQ4","right":"index-module_right__IuIfk"};
20587
- styleInject(css_248z$4);
20588
-
20589
- const CutHeightSlider = ({ units, value, onChange, heightOptions, ...rest }) => {
20590
- const converteOptions = React.useCallback((options) => {
20591
- return options.map((item) => ({
20592
- label: units === UnitsType.Metric
20593
- ? `${item}`
20594
- : `${convertCutHeightFormatted(item)}`,
20595
- value: item,
20596
- }));
20597
- }, [units, convertCutHeightFormatted]);
20598
- const options = React.useMemo(() => {
20599
- if (heightOptions && heightOptions?.length > 0) {
20600
- return converteOptions(heightOptions);
20601
- }
20602
- return [];
20603
- }, [heightOptions, converteOptions]);
20604
- return (jsxRuntime.jsx(antd.Slider, { value: value, ...rest, tooltip: {
20605
- open: false,
20606
- }, step: null, min: options?.[0]?.value, max: options?.[options?.length - 1]?.value, marks: options?.reduce((acc, item) => {
20607
- acc[item?.value] = {
20608
- label: item?.label,
20609
- style: {
20610
- color: item?.value === Number(value)
20611
- ? 'rgba(241, 102, 41, 1)'
20612
- : 'rgba(0, 0, 0, 0.20)',
20613
- fontWeight: item?.value === Number(value) ? 'bold' : 'normal',
20614
- },
20615
- };
20616
- return acc;
20617
- }, {}), onChange: onChange }));
20618
- };
20619
-
20620
- var ZoneHeightModalTypeEnum;
20621
- (function (ZoneHeightModalTypeEnum) {
20622
- ZoneHeightModalTypeEnum[ZoneHeightModalTypeEnum["GLOBAL"] = 1] = "GLOBAL";
20623
- ZoneHeightModalTypeEnum[ZoneHeightModalTypeEnum["RADIO"] = 0] = "RADIO";
20624
- })(ZoneHeightModalTypeEnum || (ZoneHeightModalTypeEnum = {}));
20625
- const HeightModal = ({ zoneName, open, setOpen, onChange, value, heightOptions, globalHeight, }) => {
20626
- const { unitType } = useCommonContext();
20627
- const [currentValue, setCurrentValue] = React.useState(value);
20628
- const handleOk = React.useCallback(() => {
20629
- setOpen(false);
20630
- onChange?.(currentValue);
20631
- }, [currentValue, setOpen, onChange]);
20632
- const onHeightChange = React.useCallback((value) => {
20633
- console.log('change->', value);
20634
- setCurrentValue({
20635
- cuttingHeight: value,
20636
- isFlowGlobal: ZoneHeightModalTypeEnum.RADIO,
20637
- });
20638
- }, []);
20639
- console.log('globalHeight', globalHeight, heightOptions);
20640
- React.useEffect(() => {
20641
- if (!open)
20642
- return;
20643
- setCurrentValue(value);
20644
- }, [value, open]);
20645
- return (jsxRuntime.jsx(CustomModal, { title: `${zoneName} cutting height`, titleCenter: true, width: 600, open: open, onCancel: () => setOpen(false), onOk: handleOk, okText: "Confirm", afterClose: () => { }, children: jsxRuntime.jsx("div", { className: styles$4.zoneHeightModal, children: jsxRuntime.jsxs(antd.Radio.Group, { value: currentValue?.isFlowGlobal, onChange: (e) => setCurrentValue({
20646
- isFlowGlobal: e.target.value,
20647
- cuttingHeight: currentValue?.cuttingHeight,
20648
- }), children: [jsxRuntime.jsxs("div", { className: classNames(styles$4.item, {
20649
- [styles$4.checked]: currentValue?.isFlowGlobal === ZoneHeightModalTypeEnum.GLOBAL,
20650
- }), children: [jsxRuntime.jsx("div", { className: styles$4.left, children: jsxRuntime.jsx(antd.Radio, { value: ZoneHeightModalTypeEnum.GLOBAL, children: "Global" }) }), jsxRuntime.jsx("div", { className: styles$4.right, children: jsxRuntime.jsx("span", { style: { color: 'rgba(241, 102, 41, 1)' }, children: generateHeightStr(globalHeight, unitType, true) }) })] }), jsxRuntime.jsxs("div", { className: classNames(styles$4.item, {
20651
- [styles$4.checked]: currentValue?.isFlowGlobal === ZoneHeightModalTypeEnum.RADIO,
20652
- }), children: [jsxRuntime.jsx("div", { className: styles$4.left, children: jsxRuntime.jsxs(antd.Radio, { value: ZoneHeightModalTypeEnum.RADIO, children: ["Customize zone height (", getHeightUnit(unitType), ")"] }) }), jsxRuntime.jsx("div", { className: styles$4.right, children: jsxRuntime.jsx(CutHeightSlider, { units: unitType, value: currentValue?.cuttingHeight, heightOptions: heightOptions, onChange: onHeightChange }) })] })] }) }) }));
20653
- };
20654
-
20655
- var css_248z$3 = ".index-module_directions__Hv0zx {\n color: #1d1d1d;\n font-size: 14px;\n font-style: normal;\n font-weight: 400;\n}\n.index-module_directions__Hv0zx .index-module_default__sSWp4 {\n position: absolute;\n bottom: 20px;\n left: 9px;\n}\n.index-module_directions__Hv0zx .index-module_tips__VVEuO {\n line-height: 16px;\n}\n.index-module_directions__Hv0zx .index-module_optimal__07le4 {\n color: rgb(255, 113, 51);\n display: flex;\n align-items: center;\n justify-content: flex-start;\n gap: 6px;\n margin: 4px 0 12px;\n}\n.index-module_directions__Hv0zx .index-module_content__PiCFf {\n position: relative;\n width: 100%;\n margin-bottom: 12px;\n}\n.index-module_directions__Hv0zx .index-module_background__WM4u- {\n position: absolute;\n width: 100%;\n height: 300px;\n background: #f5f5f5;\n border-radius: 8px;\n z-index: 0;\n overflow: hidden;\n}\n.index-module_directions__Hv0zx .index-module_luppan__nGfH2 {\n inset: 0;\n z-index: 1;\n}\n.index-module_directions__Hv0zx .index-module_slideTip__RGnd1 {\n margin: 20px 0;\n}\n.index-module_directions__Hv0zx .index-module_slider__VDKnB {\n padding: 0 24px;\n}";
20656
- var styles$3 = {"directions":"index-module_directions__Hv0zx","default":"index-module_default__sSWp4","tips":"index-module_tips__VVEuO","optimal":"index-module_optimal__07le4","content":"index-module_content__PiCFf","background":"index-module_background__WM4u-","luppan":"index-module_luppan__nGfH2","slideTip":"index-module_slideTip__RGnd1","slider":"index-module_slider__VDKnB"};
20657
- styleInject(css_248z$3);
20658
-
20659
- var css_248z$2 = ".style-module_commonModalContainer__WHZnl {\n width: inherit;\n height: inherit;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 100%;\n height: 100%;\n box-sizing: border-box;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh {\n display: flex;\n flex-direction: column;\n width: 300px;\n height: 100%;\n position: relative;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directText__b7QUs {\n padding-top: 15px;\n color: #1d1d1d;\n text-align: center;\n font-size: 16px;\n font-weight: 600;\n line-height: 24px;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directOption__IFsis {\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n pointer-events: none;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directOption__IFsis .style-module_leftTop__H39Uk {\n width: 22px;\n height: 18px;\n position: absolute;\n top: -5px;\n left: 50%;\n transform: translate(-50%, 0) rotate(90deg);\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directOption__IFsis .style-module_rightBottom__f3c7n {\n width: 22px;\n height: 18px;\n position: absolute;\n bottom: -5px;\n left: 50%;\n transform: translate(-50%, 0) rotate(-90deg);\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n {\n flex: 1;\n min-height: 293px;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk {\n position: relative;\n width: 293px;\n height: 293px;\n border-radius: 50%;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directLineMain__p60DH {\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directLineMain__p60DH .style-module_directLineContent__D9N62 {\n position: absolute;\n left: 50%;\n top: 50%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n width: 18px;\n height: 224px;\n cursor: pointer;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directLineMain__p60DH .style-module_directLineContent__D9N62 .style-module_directLineText__DOhL4 {\n flex: 1;\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 12px;\n font-weight: 600;\n line-height: 1;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directLineMain__p60DH .style-module_directLineContent__D9N62 .style-module_directLine__ngnPh {\n width: 100%;\n height: 186px;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directCenterCircle__YUrtv {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n width: 28px;\n height: 28px;\n border: 6px solid #e0e0e6;\n background: #f2f3f6;\n border-radius: 50%;\n box-sizing: border-box;\n}\n.style-module_commonModalContainer__WHZnl .style-module_commonModalContent__UQ98C .style-module_content__tR9Fh .style-module_directDialPlateBox__tie9n .style-module_directDialPlate__zkFHk .style-module_directCenterCircle__YUrtv.style-module_active__ga2w0 {\n border-color: rgb(254, 226, 213);\n}";
20660
- var styles$2 = {"commonModalContainer":"style-module_commonModalContainer__WHZnl","commonModalContent":"style-module_commonModalContent__UQ98C","content":"style-module_content__tR9Fh","directOption":"style-module_directOption__IFsis","leftTop":"style-module_leftTop__H39Uk","rightBottom":"style-module_rightBottom__f3c7n","directDialPlateBox":"style-module_directDialPlateBox__tie9n","directDialPlate":"style-module_directDialPlate__zkFHk","directLineMain":"style-module_directLineMain__p60DH","directLineContent":"style-module_directLineContent__D9N62","directLineText":"style-module_directLineText__DOhL4","directLine":"style-module_directLine__ngnPh","directCenterCircle":"style-module_directCenterCircle__YUrtv","active":"style-module_active__ga2w0"};
20661
- styleInject(css_248z$2);
20662
-
20663
- const DirectionLine = (props) => {
20664
- const { selected = false, ...svgProps } = props;
20665
- const colorMap = React.useMemo(() => {
20666
- if (selected) {
20667
- return {
20668
- circleFill: '#FEE2D5',
20669
- circleStroke: '#FF7133',
20670
- line: '#FF7133',
20671
- };
20672
- }
20673
- return {
20674
- circleFill: '#E0E0E6',
20675
- circleStroke: '#B3B4C3',
20676
- line: '#D2D2E0',
20677
- };
20678
- }, [selected]);
20679
- return (jsxRuntime.jsxs("svg", { width: "16", height: "186", viewBox: "0 0 16 186", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...svgProps, children: [jsxRuntime.jsx("path", { d: "M8.54148 10.4062L7.98535 175.173", stroke: colorMap.line, strokeWidth: "2", strokeDasharray: "5 5" }), jsxRuntime.jsx("circle", { cx: "8.26392", cy: "177.535", r: "6.67359", fill: colorMap.circleFill, stroke: colorMap.circleStroke, strokeWidth: "2" }), jsxRuntime.jsx("circle", { cx: "8.26344", cy: "8.47047", r: "6.67359", fill: colorMap.circleFill, stroke: colorMap.circleStroke, strokeWidth: "2" })] }));
20680
- };
20681
-
20682
- var _g$1, _defs$1;
20683
- function _extends$4() { return _extends$4 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$4.apply(null, arguments); }
20684
- var SvgDirectDialPlate = function SvgDirectDialPlate(props) {
20685
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$4({
20686
- xmlns: "http://www.w3.org/2000/svg",
20687
- width: 293,
20688
- height: 293,
20689
- fill: "none"
20690
- }, props), _g$1 || (_g$1 = /*#__PURE__*/React__namespace.createElement("g", {
20691
- clipPath: "url(#direct-dial-plate_svg__a)"
20692
- }, /*#__PURE__*/React__namespace.createElement("g", {
20693
- opacity: 0.55
20694
- }, /*#__PURE__*/React__namespace.createElement("g", {
20695
- filter: "url(#direct-dial-plate_svg__b)",
20696
- shapeRendering: "crispEdges"
20697
- }, /*#__PURE__*/React__namespace.createElement("circle", {
20698
- cx: 146.549,
20699
- cy: 146.553,
20700
- r: 133.643,
20701
- fill: "#fff",
20702
- fillOpacity: 0.65
20703
- }), /*#__PURE__*/React__namespace.createElement("circle", {
20704
- cx: 146.549,
20705
- cy: 146.553,
20706
- r: 133.643,
20707
- stroke: "#C1C2D1"
20708
- })), /*#__PURE__*/React__namespace.createElement("g", {
20709
- filter: "url(#direct-dial-plate_svg__c)",
20710
- shapeRendering: "crispEdges"
20711
- }, /*#__PURE__*/React__namespace.createElement("circle", {
20712
- cx: 146.549,
20713
- cy: 146.553,
20714
- r: 140,
20715
- fill: "#fff",
20716
- fillOpacity: 0.65
20717
- }), /*#__PURE__*/React__namespace.createElement("circle", {
20718
- cx: 146.549,
20719
- cy: 146.553,
20720
- r: 140,
20721
- stroke: "#fff"
20722
- })), /*#__PURE__*/React__namespace.createElement("circle", {
20723
- cx: 146.549,
20724
- cy: 146.553,
20725
- r: 112,
20726
- fill: "#fff",
20727
- transform: "rotate(90 146.549 146.553)"
20728
- })), /*#__PURE__*/React__namespace.createElement("circle", {
20729
- cx: 146.549,
20730
- cy: 146.553,
20731
- r: 115,
20732
- stroke: "#E0E0E6",
20733
- strokeWidth: 6
20734
- }), /*#__PURE__*/React__namespace.createElement("path", {
20735
- fill: "#E0E0E7",
20736
- d: "m24.863 157.648-.078-.895 6.163-.54q.037.449.075.896zm6.162-21.672-.076.894-6.159-.539.078-.894zm1.346-10.014q-.079.442-.153.886l-6.08-1.071.157-.885zm-6.074 42.25-.156-.885 6.077-1.072q.074.444.153.886zm2.344 10.398-.234-.868 5.954-1.595q.114.434.23.868zm5.95-62.523q-.117.434-.23.869l-5.953-1.594.233-.869zm3.08-9.641-.307.843-5.788-2.105.308-.844zm-5.788 82.319-.307-.845 5.788-2.107q.152.423.307.844zm4.114 9.833-.38-.815 5.587-2.605q.189.408.381.814zM41.585 97.11q-.191.405-.38.814l-5.587-2.604.38-.815zm-.63 110.924-.45-.778 5.345-3.086q.224.39.45.777zm5.347-119.88q-.228.388-.451.777l-5.344-3.084.45-.778zm.412 128.85-.515-.736 5.064-3.546q.256.369.515.735zm4.55-136.626-5.062-3.543.515-.735 5.062 3.544q-.259.366-.515.734m6.713-8.735q-.29.343-.577.688l-4.74-3.977.576-.688zm-4.74 153.795-.577-.689 4.74-3.977q.287.346.577.688zM72.33 57.402q-.345.286-.69.577l-3.977-4.74.689-.578zm-3.977 183.041-.689-.578 3.978-4.74q.342.29.688.577zm11.29-188.662-3.546-5.063.736-.515 3.545 5.062q-.368.256-.735.517M76.834 246.9l-.735-.516 3.545-5.062q.366.26.734.516zM88.93 45.853q-.39.224-.778.451l-3.087-5.346.779-.449zm-3.084 206.741-.779-.449 3.086-5.345q.388.227.778.451zM97.923 41.206q-.408.188-.814.38l-2.605-5.585.813-.38zm-2.604 216.276-.814-.38 2.604-5.585q.407.191.815.38zm9.86 4.043-.844-.307 2.107-5.788q.422.154.844.306zm2.109-224.158q-.423.15-.845.306l-2.107-5.787.845-.308zm8.07 227.327-.868-.233 1.595-5.951q.434.116.869.229zm1.598-230.331q-.435.113-.869.23l-1.595-5.95.868-.233zm8.817 232.599-.884-.156 1.072-6.076q.441.078.885.153zm1.075-234.742q-.444.075-.885.152l-1.072-6.075.884-.156zm10.037-1.27q-.448.037-.895.076l-.539-6.158.895-.078zm-.535 237.365-.895-.079.539-6.159q.447.04.896.077zm20.4 0-.538-6.162q.448-.036.894-.076l.539 6.16zm.36-237.288q-.446-.04-.894-.077l.538-6.16.894.078zm10.029 1.346q-.443-.077-.886-.153l1.071-6.078.885.156zm.187 234.589-1.071-6.08q.443-.075.886-.152l1.071 6.076zm9.688-232.369q-.434-.116-.868-.23l1.594-5.953.867.234zm.728 230.1-1.595-5.954q.435-.113.87-.23l1.593 5.951zm8.912-227.02q-.42-.154-.843-.306l2.106-5.789.844.307zm1.264 223.853-2.106-5.789.844-.307 2.107 5.788zm9.863-4.044-2.603-5.586q.407-.189.813-.38l2.605 5.587zm-1.788-215.894q-.406-.192-.814-.38l2.604-5.587.815.38zm8.954 4.716a98 98 0 0 0-.777-.451l3.086-5.345.778.45zm2.308 206.291-3.085-5.345q.39-.224.776-.451l3.086 5.347zm6.202-200.813q-.367-.26-.735-.516l3.546-5.064.735.515zm2.809 195.119-3.544-5.064.735-.515 3.545 5.063zm5.192-188.922q-.344-.29-.689-.577l3.977-4.74.689.578zm3.288 182.465-3.977-4.742q.345-.287.688-.578l3.978 4.741zM235.7 72.334q-.287-.345-.577-.69l4.741-3.978.577.689zm4.162 153.103-4.739-3.978q.29-.344.577-.689l4.74 3.978zm1.973-145.059q-.257-.368-.517-.734l5.063-3.545.515.735zm4.549 136.626-5.064-3.547q.26-.366.516-.735l5.063 3.547zm.863-128.074q-.224-.39-.45-.776l5.345-3.086.449.777zm4.897 119.105-5.346-3.087q.226-.387.45-.777l5.345 3.087zm-.25-110.112q-.19-.408-.38-.813l5.585-2.605.38.815zm5.205 100.675-5.585-2.606q.191-.405.381-.813l5.584 2.604zm-1.365-91.309q-.151-.423-.306-.844l5.788-2.107.306.845zm5.482 81.477-5.788-2.108q.155-.421.306-.844l5.789 2.108zm-2.479-71.811q-.114-.435-.23-.869l5.951-1.594.232.869zm5.722 61.656-5.951-1.596q.116-.434.229-.867l5.954 1.595zm-3.578-51.762q-.076-.444-.153-.886l6.078-1.071.156.885zm5.923 41.363-6.076-1.072.153-.885 6.079 1.072zm-4.654-31.325q-.035-.447-.075-.894l6.156-.538.079.894zm6.084 20.762-6.159-.54q.04-.447.075-.895l6.162.54z"
20737
- }), /*#__PURE__*/React__namespace.createElement("path", {
20738
- fill: "#B3B4C3",
20739
- d: "M142.291 27.432v-11h1.684l5.82 8.27-1.339-.693h.97v-7.577h1.865v11h-1.677l-5.819-8.279 1.338.694h-.97v7.585zM57.438 66.693l-4.982-4.982.466-.466 7.337 1.287-.497.152.248-.248-4.14-4.14.463-.463 4.983 4.983-.453.452-7.354-1.278.5-.155-.248.249 4.143 4.143zM63.66 60.471l-6.353-3.611.49-.49 5.342 3.159.034-.035-3.052-5.448.466-.466 5.452 3.048.031-.03-3.156-5.346.487-.486 3.612 6.352-.435.436-5.387-2.942-.034.034 2.942 5.387zM52.28 232.95q-.53-.53-.753-1.105a2.3 2.3 0 0 1-.152-1.119q.07-.546.428-.98l.035-.042.47.47-.035.041a1.2 1.2 0 0 0-.27.698q-.024.396.163.818.189.424.573.808.376.376.79.542.419.162.801.11.387-.055.667-.335l.003-.003a1.07 1.07 0 0 0 .325-.843q-.022-.497-.466-1.204l-.398-.625q-.583-.922-.593-1.582-.007-.663.507-1.177l.004-.004q.397-.397.922-.486a2.1 2.1 0 0 1 1.09.11 2.9 2.9 0 0 1 1.064.704q.487.487.687 1.033.203.549.135 1.06-.063.51-.394.897l-.038.045-.47-.469.032-.045a1.2 1.2 0 0 0 .234-.628q.032-.357-.124-.739a2.15 2.15 0 0 0-.51-.732 2.2 2.2 0 0 0-.736-.501 1.47 1.47 0 0 0-.76-.11q-.367.048-.646.328l-.003.003a.98.98 0 0 0-.297.794q.03.467.47 1.16l.393.629q.405.638.539 1.139.138.504.028.911a1.7 1.7 0 0 1-.456.753l-.004.004a1.9 1.9 0 0 1-.994.545q-.552.103-1.14-.117-.586-.222-1.122-.756M56.209 236.672l3.611-6.353.49.49-3.159 5.341.035.035 5.448-3.052.466.466-3.049 5.452.032.031 5.344-3.156.487.487-6.353 3.611-.435-.435 2.942-5.386-.035-.035-5.386 2.942zM235.144 238.465q-.529.528-1.105.753a2.3 2.3 0 0 1-1.119.151 1.9 1.9 0 0 1-.98-.428l-.042-.034.47-.47.041.035q.301.245.698.269a1.75 1.75 0 0 0 .818-.162 2.7 2.7 0 0 0 .808-.573q.377-.377.542-.791.162-.417.111-.801a1.15 1.15 0 0 0-.335-.666l-.004-.004a1.07 1.07 0 0 0-.842-.324q-.498.02-1.205.466l-.625.397q-.922.583-1.581.594-.663.006-1.178-.508l-.003-.003a1.7 1.7 0 0 1-.487-.922 2.1 2.1 0 0 1 .11-1.091q.208-.566.705-1.064a2.9 2.9 0 0 1 1.032-.687q.549-.203 1.06-.134.511.061.898.393l.045.038-.47.47-.045-.031a1.18 1.18 0 0 0-.628-.235 1.6 1.6 0 0 0-.739.124 2.2 2.2 0 0 0-.732.511q-.345.346-.501.736a1.5 1.5 0 0 0-.11.759q.048.366.328.646l.003.003a.98.98 0 0 0 .794.297q.466-.03 1.161-.469l.628-.394q.64-.404 1.139-.539.504-.138.912-.027.406.11.753.456l.003.003q.442.442.545.994.104.553-.117 1.14-.22.587-.756 1.122M237.875 235.527l-4.982-4.983 3.007-3.007.425.425-2.538 2.538 1.796 1.795 2.413-2.414.421.422-2.413 2.413 1.916 1.916 2.538-2.537.424.424zM226.781 57.137l4.982-4.983.467.466-1.288 7.337-.152-.497.248.249 4.14-4.14.463.463-4.982 4.982-.453-.452 1.278-7.355.155.501-.248-.249-4.144 4.144zM231.943 62.298l4.982-4.982 3.008 3.007-.425.425-2.538-2.538-1.795 1.796 2.413 2.413-.421.421-2.413-2.413-1.917 1.916 2.538 2.538-.425.425zM266.486 152.604l-.197-11.065 6.803-.135.03 1.664-4.924.098.053 2.998 4.655-.092.028 1.572-4.655.092.057 3.167 4.923-.097.03 1.664zM146.805 276.672q-1.278 0-2.222-.378-.936-.377-1.476-1.052a2.8 2.8 0 0 1-.609-1.576l-.008-.102h1.903l.007.073q.047.443.366.77.327.326.867.515.541.182 1.233.182.663 0 1.172-.196.51-.196.799-.538.29-.348.29-.798v-.008a1.11 1.11 0 0 0-.465-.922q-.464-.363-1.529-.581l-1.18-.232q-1.69-.342-2.458-1.089-.762-.756-.761-1.924v-.007q0-.937.517-1.641.525-.705 1.439-1.097.92-.399 2.108-.399 1.218 0 2.108.392.89.384 1.4 1.053.51.667.571 1.51l.008.094h-1.872l-.016-.087a1.34 1.34 0 0 0-.357-.719 1.9 1.9 0 0 0-.754-.493 3.1 3.1 0 0 0-1.103-.182q-.602 0-1.073.182-.473.174-.746.493-.267.32-.267.77v.007q0 .552.449.915.457.363 1.484.567l1.18.239q1.157.233 1.88.617.723.385 1.058.959.342.565.342 1.365v.007q0 1.016-.525 1.757-.518.74-1.484 1.147-.959.407-2.276.407M16.514 152.004l-2.706-10h1.874l1.734 7.505h.098l1.993-7.505h1.601l2.014 7.505h.098l1.728-7.505h1.86l-2.7 10h-1.692l-2.056-7.159h-.105l-2.042 7.159z"
20740
- }))), _defs$1 || (_defs$1 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("filter", {
20741
- id: "direct-dial-plate_svg__b",
20742
- width: 276.285,
20743
- height: 276.285,
20744
- x: 8.406,
20745
- y: 8.41,
20746
- colorInterpolationFilters: "sRGB",
20747
- filterUnits: "userSpaceOnUse"
20748
- }, /*#__PURE__*/React__namespace.createElement("feFlood", {
20749
- floodOpacity: 0,
20750
- result: "BackgroundImageFix"
20751
- }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
20752
- "in": "SourceAlpha",
20753
- result: "hardAlpha",
20754
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
20755
- }), /*#__PURE__*/React__namespace.createElement("feOffset", null), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
20756
- stdDeviation: 2
20757
- }), /*#__PURE__*/React__namespace.createElement("feComposite", {
20758
- in2: "hardAlpha",
20759
- operator: "out"
20760
- }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
20761
- values: "0 0 0 0 0.0683333 0 0 0 0 0.103468 0 0 0 0 0.133333 0 0 0 0.25 0"
20762
- }), /*#__PURE__*/React__namespace.createElement("feBlend", {
20763
- in2: "BackgroundImageFix",
20764
- result: "effect1_dropShadow_10512_51195"
20765
- }), /*#__PURE__*/React__namespace.createElement("feBlend", {
20766
- "in": "SourceGraphic",
20767
- in2: "effect1_dropShadow_10512_51195",
20768
- result: "shape"
20769
- })), /*#__PURE__*/React__namespace.createElement("filter", {
20770
- id: "direct-dial-plate_svg__c",
20771
- width: 291,
20772
- height: 291,
20773
- x: 1.049,
20774
- y: 1.053,
20775
- colorInterpolationFilters: "sRGB",
20776
- filterUnits: "userSpaceOnUse"
20777
- }, /*#__PURE__*/React__namespace.createElement("feFlood", {
20778
- floodOpacity: 0,
20779
- result: "BackgroundImageFix"
20780
- }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
20781
- "in": "SourceAlpha",
20782
- result: "hardAlpha",
20783
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
20784
- }), /*#__PURE__*/React__namespace.createElement("feOffset", null), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
20785
- stdDeviation: 2.5
20786
- }), /*#__PURE__*/React__namespace.createElement("feComposite", {
20787
- in2: "hardAlpha",
20788
- operator: "out"
20789
- }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
20790
- values: "0 0 0 0 0.0683333 0 0 0 0 0.103468 0 0 0 0 0.133333 0 0 0 0.5 0"
20791
- }), /*#__PURE__*/React__namespace.createElement("feBlend", {
20792
- in2: "BackgroundImageFix",
20793
- result: "effect1_dropShadow_10512_51195"
20794
- }), /*#__PURE__*/React__namespace.createElement("feBlend", {
20795
- "in": "SourceGraphic",
20796
- in2: "effect1_dropShadow_10512_51195",
20797
- result: "shape"
20798
- })), /*#__PURE__*/React__namespace.createElement("clipPath", {
20799
- id: "direct-dial-plate_svg__a"
20800
- }, /*#__PURE__*/React__namespace.createElement("path", {
20801
- fill: "#fff",
20802
- d: "M.549 292.553v-292h292v292z"
20803
- })))));
20804
- };
20805
-
20806
- var _g, _defs;
20807
- function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
20808
- var SvgOption = function SvgOption(props) {
20809
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
20810
- xmlns: "http://www.w3.org/2000/svg",
20811
- width: 22,
20812
- height: 18,
20813
- fill: "none"
20814
- }, props), _g || (_g = /*#__PURE__*/React__namespace.createElement("g", {
20815
- filter: "url(#option_svg__a)"
20816
- }, /*#__PURE__*/React__namespace.createElement("mask", {
20817
- id: "option_svg__b",
20818
- width: 18,
20819
- height: 15,
20820
- x: 2,
20821
- y: 0.612,
20822
- fill: "#000",
20823
- maskUnits: "userSpaceOnUse"
20824
- }, /*#__PURE__*/React__namespace.createElement("path", {
20825
- fill: "#fff",
20826
- d: "M2 .612h18v15H2z"
20827
- }), /*#__PURE__*/React__namespace.createElement("path", {
20828
- d: "M4 4.39a1 1 0 0 1 1.599-.801l4.419 3.302h7.27v1.992H10.32L5.6 12.412A1 1 0 0 1 4 11.61z"
20829
- })), /*#__PURE__*/React__namespace.createElement("path", {
20830
- fill: "currentColor",
20831
- d: "M4 4.39a1 1 0 0 1 1.599-.801l4.419 3.302h7.27v1.992H10.32L5.6 12.412A1 1 0 0 1 4 11.61z"
20832
- }), /*#__PURE__*/React__namespace.createElement("path", {
20833
- fill: "#F5F6F8",
20834
- d: "M5.599 3.589 4.4 5.19zm4.419 3.302L8.82 8.493l.533.398h.665zm7.27 0h2v-2h-2zm0 1.992v2h2v-2zm-6.968 0v-2h-.665l-.532.398zM5.6 12.412l1.196 1.603.001-.001zM4 11.61H2v.001zm0-7.22h2a1 1 0 0 1-1.599.8L5.6 3.59l1.197-1.602C4.818.509 2 1.919 2 4.39zm1.599-.801L4.402 5.19 8.82 8.493l1.198-1.602 1.197-1.603-4.42-3.301zm4.419 3.302v2h7.27v-4h-7.27zm7.27 0h-2v1.992h4V6.89zm0 1.992v-2H10.32v4h6.967zm-6.968 0L9.123 7.28 4.4 10.81 5.6 12.411l1.197 1.602 4.722-3.53zM5.6 12.412l-1.197-1.603a1 1 0 0 1 1.598.8l-2 .001-2 .001c0 2.466 2.815 3.882 4.795 2.404zM4 11.61h2V4.39H2v7.22z",
20835
- mask: "url(#option_svg__b)"
20836
- }))), _defs || (_defs = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("filter", {
20837
- id: "option_svg__a",
20838
- width: 21.287,
20839
- height: 17.232,
20840
- x: 0,
20841
- y: 0.384,
20842
- colorInterpolationFilters: "sRGB",
20843
- filterUnits: "userSpaceOnUse"
20844
- }, /*#__PURE__*/React__namespace.createElement("feFlood", {
20845
- floodOpacity: 0,
20846
- result: "BackgroundImageFix"
20847
- }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
20848
- "in": "SourceAlpha",
20849
- result: "hardAlpha",
20850
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
20851
- }), /*#__PURE__*/React__namespace.createElement("feOffset", {
20852
- dy: 1
20853
- }), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
20854
- stdDeviation: 1
20855
- }), /*#__PURE__*/React__namespace.createElement("feComposite", {
20856
- in2: "hardAlpha",
20857
- operator: "out"
20858
- }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
20859
- values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
20860
- }), /*#__PURE__*/React__namespace.createElement("feBlend", {
20861
- in2: "BackgroundImageFix",
20862
- result: "effect1_dropShadow_13071_1578"
20863
- }), /*#__PURE__*/React__namespace.createElement("feBlend", {
20864
- "in": "SourceGraphic",
20865
- in2: "effect1_dropShadow_13071_1578",
20866
- result: "shape"
20867
- })))));
20868
- };
20869
-
20870
- // json中返回的是多选方向的加值,所以需要拆开
20871
- function convertDirectionToParams(value) {
20872
- const A = 1 << 0; // bit0 = 1
20873
- const B = 1 << 1; // bit1 = 2
20874
- const C = 1 << 2; // bit2 = 4
20875
- const D = 1 << 3; // bit3 = 8
20876
- const E = 1 << 4; // bit4 = 16
20877
- const F = 1 << 5; // bit5 = 32
20878
- const directions = [];
20879
- // 检查每个位标志是否被设置
20880
- if (value & A)
20881
- directions.push(A);
20882
- if (value & B)
20883
- directions.push(B);
20884
- if (value & C)
20885
- directions.push(C);
20886
- if (value & D)
20887
- directions.push(D);
20888
- if (value & E)
20889
- directions.push(E);
20890
- if (value & F)
20891
- directions.push(F);
20892
- return directions;
20893
- }
20894
-
20895
- const DEFAULT_LIST = [
20896
- {
20897
- value: 1 << 0,
20898
- text: 'A',
20899
- selected: false,
20900
- },
20901
- {
20902
- value: 1 << 1,
20903
- text: 'B',
20904
- selected: false,
20905
- },
20906
- {
20907
- value: 1 << 2,
20908
- text: 'C',
20909
- selected: false,
20910
- },
20911
- {
20912
- value: 1 << 3,
20913
- text: 'D',
20914
- selected: false,
20915
- },
20916
- {
20917
- value: 1 << 4,
20918
- text: 'E',
20919
- selected: false,
20920
- },
20921
- {
20922
- value: 1 << 5,
20923
- text: 'F',
20924
- selected: false,
20925
- },
20926
- ];
20927
- const MowDirection_L = (props) => {
20928
- const { value, angleValue, optionAngle = 45, zIndex = 10000, onChange,
20929
- // children,
20930
- } = props;
20931
- const [angle, setAngle] = React.useState(0);
20932
- const lineList = React.useMemo(() => {
20933
- return DEFAULT_LIST.map((item) => ({
20934
- ...item,
20935
- selected: convertDirectionToParams(value).includes(item.value),
20936
- }));
20937
- }, [value]);
20938
- // const [lineList, setLineList] = useState<LineItem[]>([
20939
- // {
20940
- // value: 1 << 0,
20941
- // text: 'A',
20942
- // selected: false,
20943
- // },
20944
- // {
20945
- // value: 1 << 1,
20946
- // text: 'B',
20947
- // selected: false,
20948
- // },
20949
- // {
20950
- // value: 1 << 2,
20951
- // text: 'C',
20952
- // selected: false,
20953
- // },
20954
- // {
20955
- // value: 1 << 3,
20956
- // text: 'D',
20957
- // selected: false,
20958
- // },
20959
- // {
20960
- // value: 1 << 4,
20961
- // text: 'E',
20962
- // selected: false,
20963
- // },
20964
- // {
20965
- // value: 1 << 5,
20966
- // text: 'F',
20967
- // selected: false,
20968
- // },
20969
- // ]);
20970
- const hitRectAngle = React.useMemo(() => {
20971
- const direction = lineList
20972
- ?.filter((item) => item?.selected)
20973
- ?.reduce((pre, line) => {
20974
- return pre + line.value;
20975
- }, 0);
20976
- const angles = getSelectAngles(direction)?.map((item) => item + angleValue);
20977
- return angles?.includes(optionAngle);
20978
- }, [lineList, angleValue, optionAngle]);
20979
- const allSelect = React.useMemo(() => {
20980
- return lineList?.every((item) => item?.selected);
20981
- }, [lineList]);
20982
- React.useEffect(() => {
20983
- setAngle(angleValue);
20984
- }, [angleValue]);
20985
- console.log('hitRectAngle-->', hitRectAngle);
20986
- const onLineClick = (index) => {
20987
- const newLine = lineList.map((line, i) => {
20988
- if (i === index) {
20989
- return {
20990
- ...line,
20991
- selected: !line.selected,
20992
- };
20993
- }
20994
- return { ...line };
20995
- });
20996
- onChange?.(newLine
20997
- ?.filter((item) => item?.selected)
20998
- .reduce((pre, line) => {
20999
- return pre + line.value;
21000
- }, 0));
21001
- };
21002
- return (jsxRuntime.jsx("div", { className: styles$2.commonModalContainer, style: { zIndex }, children: jsxRuntime.jsx("div", { className: styles$2.commonModalContent, children: jsxRuntime.jsxs("div", { className: styles$2.content, children: [jsxRuntime.jsx("div", { className: styles$2.directDialPlateBox, children: jsxRuntime.jsxs("div", { className: styles$2.directDialPlate, children: [jsxRuntime.jsx(SvgDirectDialPlate, {}), jsxRuntime.jsx("div", { className: styles$2.directLineMain, style: {
21003
- transform: `rotate(${angle}deg)`,
21004
- }, children: lineList.map((line, index) => (jsxRuntime.jsxs("div", { className: styles$2.directLineContent, style: {
21005
- transform: `translate(-50%, -50%) rotate(${30 * index}deg)`,
21006
- }, children: [jsxRuntime.jsx("div", { className: styles$2.directLineText, style: {
21007
- color: line.selected ? '#FF996C' : '#B3B4C3',
21008
- }, children: line.text }), jsxRuntime.jsx(DirectionLine, { className: styles$2.directLine, selected: line.selected, onClick: () => onLineClick(index) }), jsxRuntime.jsx("div", { className: styles$2.directLineText, style: {
21009
- transform: 'rotate(180deg)',
21010
- color: line.selected ? '#FF996C' : '#B3B4C3',
21011
- }, children: line.text })] }, line.value))) }), jsxRuntime.jsx("div", { className: classNames(styles$2.directCenterCircle, {
21012
- [styles$2.active]: allSelect && hitRectAngle,
21013
- }) })] }) }), jsxRuntime.jsxs("div", { className: styles$2.directOption, style: {
21014
- transform: `rotate(${optionAngle}deg)`,
21015
- color: hitRectAngle ? '#FF996C' : '#B3B4C3',
21016
- }, children: [jsxRuntime.jsx("div", { className: styles$2.leftTop, children: jsxRuntime.jsx(SvgOption, {}) }), jsxRuntime.jsx("div", { className: styles$2.rightBottom, children: jsxRuntime.jsx(SvgOption, {}) })] })] }) }) }));
21017
- };
21018
-
21019
- const BoundarySvgRender = React.memo(({ mapJson, id, maxWidth = 300 }) => {
21020
- const svgElementData = React.useMemo(() => {
21021
- const data = UnifiedMapDataProcessor.processMapData(mapJson, DEFAULT_STYLES) || {};
21022
- return data;
21023
- }, [mapJson, DEFAULT_STYLES]);
21024
- const boundaryInfo = React.useMemo(() => {
21025
- const boundary = svgElementData.boundary.find((item) => item.id === id);
21026
- return boundary;
21027
- }, [id, svgElementData]);
21028
- // 计算当前boundary的viewBox
21029
- const boundaryViewBox = React.useMemo(() => {
21030
- if (!boundaryInfo?.points || boundaryInfo.points.length === 0) {
21031
- return null;
21032
- }
21033
- // 计算边界
21034
- let minX = Infinity;
21035
- let minY = Infinity;
21036
- let maxX = -Infinity;
21037
- let maxY = -Infinity;
21038
- boundaryInfo.points.forEach((point) => {
21039
- minX = Math.min(minX, point[0]);
21040
- minY = Math.min(minY, point[1]);
21041
- maxX = Math.max(maxX, point[0]);
21042
- maxY = Math.max(maxY, point[1]);
21043
- });
21044
- // 添加边距
21045
- const padding = 50;
21046
- const width = maxX - minX + padding * 2;
21047
- const height = maxY - minY + padding * 2;
21048
- return {
21049
- x: minX - padding,
21050
- y: minY - padding,
21051
- width,
21052
- height,
21053
- };
21054
- }, [boundaryInfo]);
21055
- const style = React.useMemo(() => {
21056
- if (boundaryViewBox?.width > boundaryViewBox?.height) {
21057
- return {
21058
- width: maxWidth,
21059
- height: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
21060
- };
21061
- }
21062
- return {
21063
- width: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
21064
- height: maxWidth,
21065
- };
21066
- }, [boundaryViewBox, maxWidth]);
21067
- return (jsxRuntime.jsxs("div", { style: {
21068
- position: 'relative',
21069
- width: style.width,
21070
- height: style.height,
21071
- margin: '0 auto',
21072
- }, children: [jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `${boundaryViewBox.x} ${boundaryViewBox.y} ${boundaryViewBox.width} ${boundaryViewBox.height}`, width: `${style.width}px`, height: `${style.height}px`, style: { position: 'absolute', inset: 0, pointerEvents: 'none' }, children: Object.keys(svgElementData)?.map((key) => {
21073
- return svgElementData[key]?.map((element) => {
21074
- if (key === exports.DataType.VISION_OFF)
21075
- return null;
21076
- return (jsxRuntime.jsx(GElement, { type: key, data: svgElementData[key], children: jsxRuntime.jsx(SvgElement, { type: key, data: element, onSelect: () => { }, onCancel: () => { } }, element.id) }, key));
21077
- });
21078
- }) }), jsxRuntime.jsx(CharginPile, { mapData: mapJson, mapConfig: DEFAULT_STYLES, viewBox: boundaryViewBox || null, rotation: 0 })] }));
21079
- });
21080
-
21081
- const DirectionModal = ({ directionInfo, open, setOpen, zoneName, optionAngle, onChange, }) => {
21082
- const { mapJson, mapConfig } = useCommonContext();
21083
- const { editMapInfo } = useMapEditContext();
21084
- const [directions, setDirections] = React.useState(ALL_DIRECTION_SELECTED);
21085
- const [angle, setAngle] = React.useState(MIN_DIRECTION_ANGLE);
21086
- const canSetDefault = React.useMemo(() => {
21087
- const angles = getSelectAngles(directions)?.map((item) => item + angle);
21088
- const hitRectAngle = angles?.includes(optionAngle);
21089
- return directions !== ALL_DIRECTION_SELECTED || !hitRectAngle;
21090
- }, [directions, angle]);
21091
- const canSave = React.useMemo(() => {
21092
- return directions !== directionInfo?.direction || angle !== directionInfo?.angle;
21093
- }, [directions, angle, directionInfo]);
21094
- React.useEffect(() => {
21095
- if (!open)
21096
- return;
21097
- setDirections(directionInfo.direction);
21098
- setAngle(directionInfo.angle);
21099
- }, [directionInfo, open]);
21100
- const resetDirection = () => {
21101
- setDirections(ALL_DIRECTION_SELECTED);
21102
- const defaultAngle = getDefaultAngle(optionAngle);
21103
- console.log('defaultAngle=>', defaultAngle, optionAngle);
21104
- if (defaultAngle) {
21105
- setAngle(defaultAngle);
21106
- }
21107
- };
21108
- const handleCancel = React.useCallback(() => {
21109
- if (!canSave) {
21110
- setOpen(false);
21111
- return;
21112
- }
21113
- antd.Modal.confirm({
21114
- icon: null,
21115
- centered: true,
21116
- title: 'Exit editing',
21117
- content: 'Changes you made will not be saved. Are you sure you want to exit editing the mowing direction?',
21118
- onOk: () => {
21119
- setOpen(false);
21120
- },
21121
- okText: 'Exit',
21122
- cancelText: 'Continue editing',
21123
- });
21124
- }, [canSave, setOpen]);
21125
- console.log('directionInfo=>', directionInfo, mapJson);
21126
- return (jsxRuntime.jsx(CustomModal, { maskClosable: false, titleCenter: true, title: `${zoneName} mowing direction`, open: open, width: 600, onCancel: handleCancel, onOk: () => {
21127
- onChange?.(directions, angle);
21128
- setOpen(false);
21129
- }, okText: "Confirm", cancelText: "Cancel", okButtonProps: { disabled: !canSave }, afterClose: () => {
21130
- setDirections(ALL_DIRECTION_SELECTED);
21131
- setAngle(MIN_DIRECTION_ANGLE);
21132
- }, children: jsxRuntime.jsxs("div", { className: styles$3.directions, children: [jsxRuntime.jsx("div", { className: styles$3.default, children: jsxRuntime.jsx(antd.Button, { disabled: !canSetDefault, variant: "link", color: "primary", onClick: resetDirection, children: "Default" }) }), jsxRuntime.jsx("div", { className: styles$3.tips, children: "\u4E00\u4E2A\u7B80\u77ED\u7684\u8BF4\u660E\uFF0C\u5E0C\u671B\u80FD\u5145\u5F53\u7B80\u5355\u7684\u6559\u7A0B\uFF0C\u9700\u8981\u53EF\u5FC3\u6839\u636EC\u7AEF\u5DF2\u6709\u7684\u6574\u5408\u4E00\u4E0B" }), jsxRuntime.jsxs("div", { className: styles$3.optimal, children: [jsxRuntime.jsx("div", { children: "*" }), jsxRuntime.jsx(SvgOption, {}), jsxRuntime.jsx("div", { className: styles$3.text, children: "Optimal direction" })] }), jsxRuntime.jsxs("div", { className: styles$3.content, children: [jsxRuntime.jsx("div", { className: styles$3.background, children: jsxRuntime.jsx(BoundarySvgRender, { mapJson: mapJson, id: editMapInfo.selectElement.id }) }), jsxRuntime.jsx("div", { className: styles$3.luppan, children: jsxRuntime.jsx(MowDirection_L, { value: directions, angleValue: angle, optionAngle: optionAngle, onChange: (value) => {
21133
- console.log('valie=>', value);
21134
- if (!value)
21135
- return antd.message.warning('Choose at least one mowing direction');
21136
- setDirections(value);
21137
- } }) })] }), jsxRuntime.jsx("div", { className: styles$3.slideTip, children: "\u7528\u6237\u8FD8\u53EF\u4EE5\u901A\u8FC7\u6ED1\u8F68\u5FAE\u8C03\u5272\u8349\u65B9\u5411\uFF08\u975E\u5FC5\u987B\uFF09" }), jsxRuntime.jsx("div", { className: styles$3.slider, children: jsxRuntime.jsx(antd.Slider, { tooltip: {
21138
- formatter: (value) => `${value}°`,
21139
- }, min: MIN_DIRECTION_ANGLE, max: MAX_DIRECTION_ANGLE, value: angle, onChange: (value) => setAngle(value) }) })] }) }));
21140
- };
21141
-
21142
- const BoundaryInfo = ({ onHandleDelete }) => {
21143
- const { unitType, heightOptions, globalHeight } = useCommonContext();
21144
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
21145
- const nameValue = editMapInfo.selectElement?.name;
21146
- const onHandleFocus = () => { };
21147
- const [open, setOpen] = React.useState(false);
21148
- const [heightOpen, setHeightOpen] = React.useState(false);
21149
- const [directionOpen, setDirectionOpen] = React.useState(false);
21150
- const sizeValue = React.useMemo(() => {
21151
- const points = editMapInfo.selectElement?.points?.map((item) => [
21152
- item[0] / SCALE_FACTOR,
21153
- item[1] / SCALE_FACTOR,
21154
- ]);
21155
- const { area: areaValue, perimeter: perimeterValue } = calculatePolygonAreaAndPerimeter(points) || {};
21156
- const formatArea = convertAreaByUnits(areaValue);
21157
- const formatPerimeter = convertDistanceByUnits(perimeterValue);
21158
- return {
21159
- area: formatArea.value,
21160
- perimeter: formatPerimeter.value,
21161
- };
21162
- }, [editMapInfo.selectElement]);
21163
- const edgeMowingValue = React.useMemo(() => {
21164
- return {
21165
- edgeMowing: editMapInfo?.selectElement?.edgeMowing,
21166
- obstacleMowEdge: editMapInfo?.selectElement?.obstacleMowEdge,
21167
- };
21168
- }, [editMapInfo.selectElement]);
21169
- const heightValue = React.useMemo(() => {
21170
- return {
21171
- isFlowGlobal: editMapInfo?.selectElement?.isFlowGlobal,
21172
- cuttingHeight: editMapInfo?.selectElement?.cuttingHeight,
21173
- };
21174
- }, [editMapInfo.selectElement]);
21175
- const directionInfo = React.useMemo(() => {
21176
- return {
21177
- direction: editMapInfo?.selectElement?.direction,
21178
- angle: editMapInfo?.selectElement?.angle,
21179
- };
21180
- }, [editMapInfo.selectElement?.direction, editMapInfo.selectElement?.angle]);
21181
- const optionAngle = React.useMemo(() => {
21182
- return editMapInfo?.selectElement?.recBaseAngle;
21183
- }, [editMapInfo.selectElement?.recBaseAngle]);
21184
- console.log('height---->', editMapInfo?.selectElement, heightValue, edgeMowingValue);
21185
- return (jsxRuntime.jsxs("div", { className: styles$9.boundaryInfo, children: [jsxRuntime.jsx(Header, { handleDelete: onHandleDelete, handleFocus: onHandleFocus, type: editMapInfo.elementType }), jsxRuntime.jsx("div", { className: styles$9.nameEdit, children: jsxRuntime.jsx(NameEdit, { title: "Boundary name", name: nameValue, onChange: (name) => {
21186
- setEditMapInfo({
21187
- ...editMapInfo,
21188
- isShowDrag: false,
21189
- selectElement: {
21190
- ...editMapInfo.selectElement,
21191
- name: name,
21192
- },
21193
- });
21194
- } }) }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsxs("div", { className: styles$9.otherEdit, children: [jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Cutting height" }), jsxRuntime.jsx("div", { className: styles$9.value, children: generateHeightStr(heightValue?.cuttingHeight, unitType, true) }), jsxRuntime.jsx("div", { className: styles$9.icon, onClick: () => {
21195
- setHeightOpen(true);
21196
- }, children: jsxRuntime.jsx(SvgArrow, {}) })] }) }), jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Mowing direction" }), jsxRuntime.jsx("div", { className: styles$9.value }), jsxRuntime.jsx("div", { className: styles$9.icon, onClick: () => {
21197
- setDirectionOpen(true);
21198
- }, children: jsxRuntime.jsx(SvgArrow, {}) })] }) }), jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.otherItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Edge mowing" }), jsxRuntime.jsx("div", { className: styles$9.value }), jsxRuntime.jsx("div", { className: styles$9.icon, onClick: () => {
21199
- setOpen(true);
21200
- }, children: jsxRuntime.jsx(SvgArrow, {}) })] }) })] }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsxs("div", { className: styles$9.areaInfo, children: [jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Area:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.area })] }), jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Perimeter:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.perimeter })] })] }), jsxRuntime.jsx(MowingEdgeModal, { value: edgeMowingValue, onChange: (value) => {
21201
- setEditMapInfo({
21202
- ...editMapInfo,
21203
- selectElement: {
21204
- ...editMapInfo.selectElement,
21205
- edgeMowing: value.edgeMowing ? 1 : 0,
21206
- obstacleMowEdge: value.obstacleMowEdge ? 1 : 0,
21207
- },
21208
- });
21209
- }, open: open, setOpen: setOpen }), jsxRuntime.jsx(HeightModal, { zoneName: editMapInfo.selectElement?.name, heightOptions: heightOptions, globalHeight: globalHeight, open: heightOpen, setOpen: setHeightOpen, value: heightValue, onChange: (value) => {
21210
- setEditMapInfo({
21211
- ...editMapInfo,
21212
- selectElement: {
21213
- ...editMapInfo.selectElement,
21214
- cuttingHeight: value.cuttingHeight,
21215
- isFlowGlobal: value.isFlowGlobal,
21216
- },
21217
- });
21218
- } }), jsxRuntime.jsx(DirectionModal, { directionInfo: directionInfo, optionAngle: optionAngle, open: directionOpen, setOpen: setDirectionOpen, zoneName: editMapInfo.selectElement?.name, onChange: (direction, angle) => {
21219
- setEditMapInfo({
21220
- ...editMapInfo,
21221
- selectElement: {
21222
- ...editMapInfo.selectElement,
21223
- direction,
21224
- angle,
21225
- },
21226
- });
21227
- } })] }));
21228
- };
21229
-
21230
- var css_248z$1 = ".index-module_timePeriod__EkVZl {\n display: flex;\n flex-direction: column;\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodHeader__CgJGW {\n display: flex;\n align-items: center;\n justify-content: flex-start;\n padding: 4px 0;\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodHeader__CgJGW .index-module_timePeriodTitle__lnYno {\n font-weight: 400;\n font-size: 14px;\n line-height: 16px;\n color: rgb(0, 0, 0);\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodHeader__CgJGW .index-module_timePeriodHandle__pjDTA {\n margin-left: auto;\n display: flex;\n align-items: center;\n justify-content: flex-start;\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodContent__pTqdW {\n margin-top: 4px;\n}\n.index-module_timePeriod__EkVZl .index-module_timePeriodContent__pTqdW .index-module_timePeriodRadioItem__3rd-r {\n line-height: 28px;\n}";
21231
- var styles$1 = {"timePeriod":"index-module_timePeriod__EkVZl","timePeriodHeader":"index-module_timePeriodHeader__CgJGW","timePeriodTitle":"index-module_timePeriodTitle__lnYno","timePeriodHandle":"index-module_timePeriodHandle__pjDTA","timePeriodContent":"index-module_timePeriodContent__pTqdW","timePeriodRadioItem":"index-module_timePeriodRadioItem__3rd-r"};
21232
- styleInject(css_248z$1);
21233
-
21234
- var RadioValue;
21235
- (function (RadioValue) {
21236
- RadioValue[RadioValue["LONG_TIME"] = 0] = "LONG_TIME";
21237
- RadioValue[RadioValue["SHORT_TIME"] = 1] = "SHORT_TIME";
21238
- })(RadioValue || (RadioValue = {}));
21239
- const TimePeriod = ({ value, onChange }) => {
21240
- // eslint-disable-next-line no-undef
21241
- const [date, setDate] = React.useState();
21242
- const [open, setOpen] = React.useState(false);
21243
- const [radioValue, setRadioValue] = React.useState(RadioValue.LONG_TIME);
21244
- console.log('time period->', date, radioValue);
21245
- React.useEffect(() => {
21246
- if (!open && date?.length !== 2) {
21247
- setRadioValue(RadioValue.LONG_TIME);
21248
- }
21249
- }, [open]);
21250
- return (jsxRuntime.jsxs("div", { className: styles$1.timePeriod, children: [jsxRuntime.jsxs("div", { className: styles$1.timePeriodHeader, children: [jsxRuntime.jsx("div", { className: styles$1.timePeriodTitle, children: "Enabled" }), jsxRuntime.jsx("div", { className: styles$1.timePeriodHandle, children: jsxRuntime.jsx(antd.Switch, { checked: value.status === 1, onChange: (checked) => {
21251
- onChange({
21252
- ...value,
21253
- status: checked ? 1 : 0,
21254
- start_timestamp: checked ? value.start_timestamp : 0,
21255
- end_timestamp: checked ? value.end_timestamp : 0,
21256
- });
21257
- } }) })] }), jsxRuntime.jsx("div", { className: styles$1.timePeriodContent, children: jsxRuntime.jsxs(antd.Radio.Group, { value: radioValue, onChange: (e) => {
21258
- setRadioValue(e.target.value);
21259
- if (e.target.value === RadioValue.LONG_TIME) {
21260
- setDate(null);
21261
- onChange({
21262
- ...value,
21263
- start_timestamp: 0,
21264
- end_timestamp: 0,
21265
- });
21266
- }
21267
- else if (e.target.value === RadioValue.SHORT_TIME) {
21268
- setOpen(true);
21269
- // onChange({
21270
- // ...value,
21271
- // startTimestamp: dayjs().add(30, 'minute').unix(),
21272
- // endTimestamp: dayjs().add(1, 'hour').unix(),
21273
- // });
21274
- }
21275
- }, style: { display: 'flex', flexDirection: 'column', gap: '4px' }, children: [jsxRuntime.jsx(antd.Radio, { value: RadioValue.LONG_TIME, children: jsxRuntime.jsx("div", { className: styles$1.timePeriodRadioItem, children: "Always" }) }), jsxRuntime.jsx(antd.Radio, { value: RadioValue.SHORT_TIME, children: jsxRuntime.jsx("div", { className: styles$1.timePeriodRadioItem, children: jsxRuntime.jsx(antd.DatePicker.RangePicker, { open: open, value: date ? date : undefined, disabled: radioValue === RadioValue.LONG_TIME, showTime: { format: 'HH:mm' }, format: "MM/DD/YYYY HH:mm", preserveInvalidOnBlur: true, onOpenChange: (open) => {
21276
- setOpen(open);
21277
- }, onChange: (dateValue, dateString) => {
21278
- setDate(dateValue);
21279
- if (dateValue?.length === 2) {
21280
- onChange({
21281
- status: RadioValue.SHORT_TIME,
21282
- start_timestamp: dateValue[0].unix(),
21283
- end_timestamp: dateValue[1].unix(),
21284
- });
21285
- }
21286
- } }) }) })] }) })] }));
21287
- };
21288
-
21289
- const ObstacleInfo = ({ onHandleDelete }) => {
21290
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
21291
- const nameValue = editMapInfo.selectElement?.name;
21292
- console.log('obstacle->', editMapInfo.selectElement);
21293
- const timePeriodValue = React.useMemo(() => {
21294
- if (!editMapInfo.selectElement)
21295
- return null;
21296
- const status = editMapInfo.selectElement?.status;
21297
- const start_timestamp = editMapInfo.selectElement?.start_timestamp;
21298
- const end_timestamp = editMapInfo.selectElement?.end_timestamp;
21299
- return {
21300
- status,
21301
- start_timestamp,
21302
- end_timestamp,
21303
- };
21304
- }, [editMapInfo.selectElement]);
21305
- const sizeValue = React.useMemo(() => {
21306
- const points = editMapInfo.selectElement?.points?.map((item) => [
21307
- item[0] / SCALE_FACTOR,
21308
- item[1] / SCALE_FACTOR,
21309
- ]);
21310
- const { area: areaValue, perimeter: perimeterValue } = calculatePolygonAreaAndPerimeter(points) || {};
21311
- const formatArea = convertAreaByUnits(areaValue);
21312
- const formatPerimeter = convertDistanceByUnits(perimeterValue);
21313
- return {
21314
- area: formatArea.value,
21315
- perimeter: formatPerimeter.value,
21316
- };
21317
- }, [editMapInfo.selectElement]);
21318
- return (jsxRuntime.jsxs("div", { className: styles$9.obstacleInfo, children: [jsxRuntime.jsx(Header, { handleDelete: () => {
21319
- onHandleDelete();
21320
- }, handleFocus: () => { }, type: editMapInfo.elementType }), jsxRuntime.jsx("div", { className: styles$9.nameEdit, children: jsxRuntime.jsx(NameEdit, { title: "Obstacle name", name: nameValue, onChange: (name) => {
21321
- setEditMapInfo({
21322
- ...editMapInfo,
21323
- isShowDrag: false,
21324
- selectElement: {
21325
- ...editMapInfo.selectElement,
21326
- name: name,
21327
- },
21328
- });
21329
- } }) }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsx("div", { className: styles$9.timePeriod, children: jsxRuntime.jsx(TimePeriod, { value: timePeriodValue, onChange: (value) => {
21330
- setEditMapInfo({
21331
- ...editMapInfo,
21332
- isShowDrag: editMapInfo?.isShowDrag || false,
21333
- selectElement: {
21334
- ...editMapInfo.selectElement,
21335
- status: value.status,
21336
- start_timestamp: value.start_timestamp,
21337
- end_timestamp: value.end_timestamp,
21338
- },
21339
- });
21340
- } }) }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsxs("div", { className: styles$9.areaInfo, children: [jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Area:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.area })] }), jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Perimeter:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue?.perimeter })] })] })] }));
21341
- };
21342
-
21343
- const DoodleInfo = ({ onHandleDelete }) => {
21344
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
21345
- const options = React.useMemo(() => {
21346
- return new Array(30).fill(0).map((_, index) => {
21347
- return {
21348
- label: `${index + 1}day`,
21349
- value: index + 1,
21350
- };
21351
- });
21352
- }, []);
21353
- const isCreate = React.useMemo(() => {
21354
- return editMapInfo?.createMode;
21355
- }, [editMapInfo?.createMode]);
21356
- const doodleInfo = React.useMemo(() => {
21357
- if (!editMapInfo.selectElement)
21358
- return null;
21359
- const create_ts = editMapInfo?.selectElement?.create_ts;
21360
- const expiration_ts = editMapInfo.selectElement.expiration_ts;
21361
- const diff = expiration_ts - create_ts;
21362
- const day = Math.floor(diff / (60 * 60 * 24));
21363
- return {
21364
- day: day,
21365
- };
21366
- }, [editMapInfo?.selectElement]);
21367
- const remainDay = React.useMemo(() => {
21368
- if (!editMapInfo.selectElement)
21369
- return null;
21370
- const expiration_ts = editMapInfo.selectElement.expiration_ts;
21371
- const diff = expiration_ts - Date.now() / 1000;
21372
- return Math.floor(diff / (60 * 60 * 24));
21373
- }, [editMapInfo?.selectElement]);
21374
- const sizeValue = React.useMemo(() => {
21375
- if (!editMapInfo.selectElement || !editMapInfo.selectElement.svg)
21376
- return '';
21377
- const svg = editMapInfo.selectElement?.svg;
21378
- const scale = editMapInfo.selectElement.scale;
21379
- const parseSvg = SvgParserNative.parseSvg(svg);
21380
- const width = (parseSvg.width * scale) / SCALE_FACTOR;
21381
- const height = (parseSvg.height * scale) / SCALE_FACTOR;
21382
- console.log('parseSvg->', editMapInfo, parseSvg);
21383
- return `${width.toFixed(1)} m x ${height.toFixed(1)} m`;
21384
- }, [editMapInfo.selectElement]);
21385
- const handleChange = React.useCallback((day) => {
21386
- setEditMapInfo((pre) => {
21387
- return {
21388
- ...pre,
21389
- selectElement: {
21390
- ...pre.selectElement,
21391
- create_ts: Date.now() / 1000,
21392
- expiration_ts: Date.now() / 1000 + day * 24 * 60 * 60,
21393
- },
21394
- };
21395
- });
21396
- }, [editMapInfo.selectElement]);
21397
- console.log('doodleInfo->', doodleInfo);
21398
- return (jsxRuntime.jsxs("div", { className: styles$9.doodleInfo, children: [jsxRuntime.jsx(Header, { handleDelete: () => {
21399
- onHandleDelete();
21400
- }, handleFocus: () => { }, type: editMapInfo.elementType }), jsxRuntime.jsx("div", { className: styles$9.border }), isCreate ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(Item, { children: jsxRuntime.jsxs("div", { className: styles$9.time, children: [jsxRuntime.jsxs("div", { className: styles$9.exist, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Preserve doodle for" }), jsxRuntime.jsx("div", { className: styles$9.value, children: jsxRuntime.jsx(antd.Select, { defaultValue: doodleInfo?.day, style: { width: 80 }, onChange: (value) => handleChange(value), options: options }) })] }), doodleInfo?.day >= 14 && (jsxRuntime.jsx("div", { className: styles$9.tip, children: "* If the doodle lasts over 14 days, the grass may grow too tall for the mower to mow later." }))] }) }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsx("div", { className: styles$9.areaInfo, children: jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Size:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue })] }) })] })) : (jsxRuntime.jsxs("div", { className: styles$9.areaInfo, children: [jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Remaining time:" }), jsxRuntime.jsxs("div", { className: styles$9.value, children: [remainDay, " day"] })] }), jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Size:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue })] })] }))] }));
21401
- };
21402
-
21403
- const VisionOffInfo = ({ onHandleDelete }) => {
21404
- const { editMapInfo, setEditMapInfo } = useMapEditContext();
21405
- const sizeValue = React.useMemo(() => {
21406
- if (!editMapInfo.selectElement)
21407
- return '';
21408
- const points = editMapInfo.selectElement?.points;
21409
- const [width, height] = calculateRectangleDimensions(points);
21410
- const formatWidth = convertDistanceByUnits(width / SCALE_FACTOR);
21411
- const formatHeight = convertDistanceByUnits(height / SCALE_FACTOR);
21412
- return `${formatWidth.value} x ${formatHeight.value}`;
21413
- }, [editMapInfo.selectElement]);
21414
- return (jsxRuntime.jsxs("div", { className: "visionOffInfo", children: [jsxRuntime.jsx(Header, { handleDelete: () => {
21415
- onHandleDelete?.();
21416
- }, handleFocus: () => { }, type: exports.DataType.VISION_OFF }), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsx("div", { className: styles$9.areaInfo, children: jsxRuntime.jsxs("div", { className: styles$9.areaItem, children: [jsxRuntime.jsx("div", { className: styles$9.label, children: "Size:" }), jsxRuntime.jsx("div", { className: styles$9.value, children: sizeValue })] }) })] }));
21417
- };
21418
-
21419
- var _path$2, _path2$1;
21420
- function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
21421
- var SvgUndo = function SvgUndo(props) {
21422
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
21423
- xmlns: "http://www.w3.org/2000/svg",
21424
- width: 24,
21425
- height: 24,
21426
- fill: "none"
21427
- }, props), _path$2 || (_path$2 = /*#__PURE__*/React__namespace.createElement("path", {
21428
- stroke: "currentColor",
21429
- strokeLinecap: "round",
21430
- strokeLinejoin: "round",
21431
- strokeWidth: 2,
21432
- d: "M4.329 7.821h10.506a5.581 5.581 0 0 1 0 11.163h-5.27"
21433
- })), _path2$1 || (_path2$1 = /*#__PURE__*/React__namespace.createElement("path", {
21434
- stroke: "currentColor",
21435
- strokeLinecap: "round",
21436
- strokeLinejoin: "round",
21437
- strokeWidth: 2,
21438
- d: "m7.293 3.607-4.39 4.215 4.39 4.316"
21439
- })));
21440
- };
21441
-
21442
- var _path$1, _path2;
21443
- function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
21444
- var SvgRedo = function SvgRedo(props) {
21445
- return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
21446
- xmlns: "http://www.w3.org/2000/svg",
21447
- width: 24,
21448
- height: 24,
21449
- fill: "none"
21450
- }, props), _path$1 || (_path$1 = /*#__PURE__*/React__namespace.createElement("path", {
21451
- stroke: "currentColor",
21452
- strokeLinecap: "round",
21453
- strokeLinejoin: "round",
21454
- strokeWidth: 2,
21455
- d: "M19.672 7.821H9.165a5.581 5.581 0 1 0 0 11.163h5.27"
21456
- })), _path2 || (_path2 = /*#__PURE__*/React__namespace.createElement("path", {
21457
- stroke: "currentColor",
21458
- strokeLinecap: "round",
21459
- strokeLinejoin: "round",
21460
- strokeWidth: 2,
21461
- d: "m16.708 3.607 4.389 4.215-4.39 4.315"
21462
- })));
21463
- };
21464
-
21465
- const HandleElementInfo = () => {
21466
- const { svgElementDatas } = useSvgEditContext();
21467
- const { checkDoodle } = useCheckElement();
21468
- const { undo, redo } = useHistoryHandle();
21469
- const { editMapInfo, setEditMapInfo, onHandleStopRecord, onHandleCompleteRecord, onHandleDeleteElement, onUpdateBoundary, } = useMapEditContext();
21470
- const currentType = React.useMemo(() => {
21471
- return DATE_TYPE_MAP.find((item) => item.type === editMapInfo.elementType);
21472
- }, [editMapInfo.elementType]);
21473
- const isUndoDisabled = React.useMemo(() => {
21474
- if (editMapInfo?.elementType === exports.DataType.OBSTACLE &&
21475
- editMapInfo?.createMode === CreateStatus.CREATING) {
21476
- return !(editMapInfo?.currentHistoryIndex > 0 && editMapInfo?.historyList?.length);
21477
- }
21478
- else {
21479
- return !(editMapInfo?.currentHistoryIndex > 0 && editMapInfo?.historyList?.length);
21480
- }
21481
- }, [
21482
- editMapInfo?.currentHistoryIndex,
21483
- editMapInfo?.historyList,
21484
- editMapInfo?.createMode,
21485
- editMapInfo?.elementType,
21486
- ]);
21487
- const idRedoDisabled = React.useMemo(() => {
21488
- return !(editMapInfo?.currentHistoryIndex < editMapInfo?.historyList?.length - 1 &&
21489
- editMapInfo?.historyList?.length);
21490
- }, [editMapInfo?.currentHistoryIndex, editMapInfo?.historyList]);
21491
- const handleUndo = React.useCallback((e) => {
21492
- e.stopPropagation();
21493
- e.preventDefault();
21494
- if (isUndoDisabled)
21495
- return;
21496
- undo();
21497
- }, [undo, isUndoDisabled]);
21498
- const handleRedo = React.useCallback((e) => {
21499
- e.stopPropagation();
21500
- e.preventDefault();
21501
- if (idRedoDisabled)
21502
- return;
21503
- redo();
21504
- }, [redo, idRedoDisabled]);
21505
- const renderElementData = React.useCallback((element) => {
21506
- if (!editMapInfo.selectElement)
21507
- return null;
21508
- const data = {
21509
- doodle: undefined,
21510
- visionOffAreas: undefined,
21511
- obstacle: undefined,
21512
- boundary: undefined,
21513
- };
21514
- if (element?.type === exports.DataType.DOODLE) {
21515
- const doodleData = {
21516
- center: element.center,
21517
- direction: element.direction,
21518
- scale: element.scale,
21519
- svg: element.svg,
21520
- expiration_ts: element.expiration_ts,
21521
- create_ts: element.create_ts,
21522
- };
21523
- if (element?.id) {
21524
- doodleData.id = element?.id;
21525
- }
21526
- data.doodle = JSON.stringify([doodleData]);
21527
- }
21528
- if (element?.type === exports.DataType.VISION_OFF) {
21529
- const visionOffArea = svgElementDatas?.[exports.DataType.VISION_OFF]
21530
- ?.filter((item) => item.id !== element.id)
21531
- ?.map((item) => ({
21532
- id: item.id,
21533
- points: restorePointsFormat(item.points),
21534
- })) || [];
21535
- const visionOffAreaData = [
21536
- ...visionOffArea,
21537
- {
21538
- id: element?.id,
21539
- points: restorePointsFormat(element.points),
21540
- },
21541
- ]?.map((item) => {
21542
- if (item?.id) {
21543
- return {
21544
- id: item.id,
21545
- points: item.points,
21546
- };
21547
- }
21548
- return {
21549
- points: item.points,
21550
- };
21551
- }) || [];
21552
- data.visionOffAreas = JSON.stringify(visionOffAreaData);
21553
- }
21554
- if (element?.type === exports.DataType.OBSTACLE) {
21555
- data.obstacle = {
21556
- name: element?.name,
21557
- status: element?.status ?? 1,
21558
- end_timestamp: element?.end_timestamp,
21559
- start_timestamp: element?.start_timestamp,
21560
- points: restorePointsFormat(element.points),
21561
- };
21562
- if (element?.id) {
21563
- data.obstacle.id = element?.id;
21564
- }
21565
- }
21566
- if (element?.type === exports.DataType.BOUNDARY) {
21567
- data.boundary = {
21568
- cuttingHeight: element?.cuttingHeight,
21569
- isFlowGlobal: element?.isFlowGlobal,
21570
- angle: element?.angle,
21571
- direction: element?.direction,
21572
- name: element?.name,
21573
- edgeMowing: element?.edgeMowing,
21574
- edgeVision: element?.edgeVision,
21575
- obstacleMowEdge: element?.obstacleMowEdge,
21576
- };
21577
- if (element?.id) {
21578
- data.boundary.id = element?.id;
21579
- }
21580
- }
21581
- return data;
21582
- }, [editMapInfo.selectElement]);
21583
- const handleSave = React.useCallback(() => {
21584
- const params = renderElementData(editMapInfo?.selectElement);
21585
- const isObstacle = editMapInfo?.selectElement?.type === exports.DataType.OBSTACLE;
21586
- const hasNotEnoughPoints = params?.obstacle?.points?.length < 3;
21587
- const isDoodle = editMapInfo?.selectElement?.type === exports.DataType.DOODLE;
21588
- const doodleResult = checkDoodle();
21589
- if (isDoodle && !doodleResult?.isValid) {
21590
- antd.message.error('Keep more distance from boundaries, off-limit island and other doodles');
21591
- return;
21592
- }
21593
- if (isObstacle && hasNotEnoughPoints) {
21594
- antd.message.error('Save failed, please draw a closed shape');
21595
- return;
21596
- }
21597
- console.log('save->', editMapInfo, params);
21598
- if (editMapInfo?.selectElement?.type === exports.DataType.BOUNDARY) {
21599
- onUpdateBoundary?.(params)?.then(() => {
21600
- setEditMapInfo({
21601
- ...editMapInfo,
21602
- createMode: null,
21603
- elementType: null,
21604
- selectElement: null,
21605
- isShowDrag: false,
21606
- });
21607
- }, (errorText) => {
21608
- antd.message.error('Save failed, please try again');
21609
- });
21610
- }
21611
- else {
21612
- onHandleCompleteRecord?.(params)?.then(() => {
21613
- setEditMapInfo({
21614
- ...editMapInfo,
21615
- createMode: null,
21616
- elementType: null,
21617
- selectElement: null,
21618
- isShowDrag: false,
21619
- });
21620
- }, (errorText) => {
21621
- antd.message.error('Save failed, please try again');
21622
- });
21623
- }
21624
- }, [editMapInfo.selectElement, onUpdateBoundary, onHandleCompleteRecord]);
21625
- const handleCancel = React.useCallback(() => {
21626
- const name = DATE_TYPE_MAP.find((item) => item.type === editMapInfo.elementType)?.label;
21627
- antd.Modal.confirm({
21628
- icon: null,
21629
- centered: true,
21630
- title: 'Quit editing',
21631
- content: `Changes you made will not be saved. Are you sure you want to quit editing the ${name}?`,
21632
- okText: 'Quit',
21633
- cancelText: 'Keep editing',
21634
- onOk: () => {
21635
- onHandleStopRecord?.()?.then(() => {
21636
- setEditMapInfo({
21637
- ...editMapInfo,
21638
- createMode: null,
21639
- elementType: null,
21640
- selectElement: null,
21641
- isShowDrag: false,
21642
- });
21643
- });
21644
- },
21645
- });
21646
- }, [editMapInfo]);
21647
- const handleDelete = React.useCallback(() => {
21648
- console.log('handleDelete 1->', editMapInfo);
21649
- antd.Modal.confirm({
21650
- icon: null,
21651
- title: 'Delete',
21652
- content: 'Are you sure you want to delete this element?',
21653
- okText: 'Delete',
21654
- cancelText: 'Cancel',
21655
- onOk: () => {
21656
- onHandleStopRecord?.()?.then(() => {
21657
- console.log('handleDelete 2->', editMapInfo, onHandleDeleteElement);
21658
- if (editMapInfo?.selectElement?.id) {
21659
- onHandleDeleteElement?.({
21660
- id: editMapInfo.selectElement?.id,
21661
- type: editMapInfo.elementType,
21662
- })?.then(() => {
21663
- setEditMapInfo({
21664
- ...editMapInfo,
21665
- createMode: null,
21666
- elementType: null,
21667
- selectElement: null,
21668
- isShowDrag: false,
21669
- });
21670
- }, (errorText) => {
21671
- antd.message.error('Save failed, please try again');
21672
- });
21673
- }
21674
- else {
21675
- setEditMapInfo({
21676
- ...editMapInfo,
21677
- createMode: null,
21678
- elementType: null,
21679
- selectElement: null,
21680
- isShowDrag: false,
21681
- });
21682
- }
21683
- }, (errorText) => {
21684
- antd.message.error('Save failed, please try again');
21685
- });
21686
- },
21687
- });
21688
- }, [editMapInfo?.selectElement, onHandleDeleteElement, onHandleStopRecord]);
21689
- if (!editMapInfo.selectElement)
21690
- return null;
21691
- console.log('handleElementInfo->', editMapInfo, currentType);
21692
- return (jsxRuntime.jsxs("div", { className: styles$9.handleElementInfo, children: [editMapInfo?.elementType !== exports.DataType.BOUNDARY ? (jsxRuntime.jsxs("div", { className: styles$9.undoAndRedo, children: [jsxRuntime.jsx("div", { className: classNames(styles$9.undo, { [styles$9.disabled]: isUndoDisabled }), onClick: handleUndo, children: jsxRuntime.jsx(SvgUndo, {}) }), jsxRuntime.jsx("div", { className: classNames(styles$9.redo, { [styles$9.disabled]: idRedoDisabled }), onClick: handleRedo, children: jsxRuntime.jsx(SvgRedo, {}) })] })) : null, editMapInfo?.elementType === exports.DataType.BOUNDARY && (jsxRuntime.jsx(BoundaryInfo, { onHandleDelete: handleDelete })), editMapInfo?.elementType === exports.DataType.OBSTACLE && (jsxRuntime.jsx(ObstacleInfo, { onHandleDelete: handleDelete })), editMapInfo?.elementType === exports.DataType.DOODLE && jsxRuntime.jsx(DoodleInfo, { onHandleDelete: handleDelete }), editMapInfo?.elementType === exports.DataType.VISION_OFF && (jsxRuntime.jsx(VisionOffInfo, { onHandleDelete: handleDelete })), jsxRuntime.jsx("div", { className: styles$9.border }), jsxRuntime.jsx("div", { className: styles$9.handle, children: jsxRuntime.jsxs(antd.Space, { size: 12, children: [jsxRuntime.jsx(antd.Button, { variant: "outlined", color: "default", onClick: () => {
21693
- handleCancel();
21694
- }, children: "Cancel" }), jsxRuntime.jsx(antd.Button, { variant: "solid", color: "primary", onClick: handleSave, children: "Save" })] }) })] }));
21695
- };
21696
-
21697
- var _path;
21698
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
21699
- var SvgMobileAddPoint = function SvgMobileAddPoint(props) {
21700
- return /*#__PURE__*/React__namespace.createElement("svg", _extends({
21701
- xmlns: "http://www.w3.org/2000/svg",
21702
- width: 36,
21703
- height: 36,
21704
- fill: "none"
21705
- }, props), _path || (_path = /*#__PURE__*/React__namespace.createElement("path", {
21706
- stroke: "#fff",
21707
- strokeLinecap: "round",
21708
- strokeLinejoin: "round",
21709
- strokeWidth: 3,
21710
- d: "M6 12V9a3 3 0 0 1 3-3h3M6 24v3a3 3 0 0 0 3 3h3M24 6h3a3 3 0 0 1 3 3v3m-6 18h3a3 3 0 0 0 3-3v-3m-16.5-6h9M18 13.5v9"
21711
- })));
21712
- };
21713
-
21714
- var css_248z = ".index-module_crosshair__etey6 {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 40px;\n height: 40px;\n pointer-events: none;\n z-index: 99999;\n display: flex;\n justify-content: center;\n align-items: center;\n}";
21715
- var styles = {"crosshair":"index-module_crosshair__etey6"};
21716
- styleInject(css_248z);
21717
-
21718
- /**
21719
- * 十字准心组件
21720
- * 相对于父容器居中显示
21721
- */
21722
- const Crosshair = () => {
21723
- const { platform } = useCommonContext();
21724
- const { editMapInfo } = useMapEditContext();
21725
- const isVisible = React.useMemo(() => {
21726
- if (platform === PlatformType.H5 &&
21727
- editMapInfo?.mobileMode === MobileEditMode.CREATE &&
21728
- editMapInfo?.elementType === exports.DataType.OBSTACLE) {
21729
- return true;
21730
- }
21731
- return false;
21732
- }, [platform, editMapInfo]);
21733
- return isVisible ? (jsxRuntime.jsx("div", { className: styles.crosshair, children: jsxRuntime.jsx(SvgMobileAddPoint, {}) })) : null;
21734
- };
21735
-
21736
- // 验证GPS坐标是否有效
21737
- const isValidGpsCoordinate = (coordinate) => {
21738
- if (!coordinate || coordinate.length < 2)
21739
- return false;
21740
- const [lng, lat] = coordinate;
21741
- // 检查是否为有效的GPS坐标范围,且不是原点(0,0)
21742
- return (lng >= -180 &&
21743
- lng <= 180 &&
21744
- lat >= -90 &&
21745
- lat <= 90 &&
21746
- !(Math.abs(lng) < 0.001 && Math.abs(lat) < 0.001) // 排除接近(0,0)的坐标
21747
- );
21748
- };
21749
- // 旋转坐标点
21750
- const rotateCoordinate = (point, center, angleRadians) => {
21751
- const [x, y] = point;
21752
- const [cx, cy] = center;
21753
- // 将点移动到原点
21754
- const dx = x - cx;
21755
- const dy = y - cy;
21756
- // 应用旋转矩阵
21757
- const cos = Math.cos(angleRadians);
21758
- const sin = Math.sin(angleRadians);
21759
- const rotatedX = dx * cos - dy * sin;
21760
- const rotatedY = dx * sin + dy * cos;
21761
- // 移回原位置
21762
- return [rotatedX + cx, rotatedY + cy];
20013
+ // 旋转坐标点
20014
+ const rotateCoordinate = (point, center, angleRadians) => {
20015
+ const [x, y] = point;
20016
+ const [cx, cy] = center;
20017
+ // 将点移动到原点
20018
+ const dx = x - cx;
20019
+ const dy = y - cy;
20020
+ // 应用旋转矩阵
20021
+ const cos = Math.cos(angleRadians);
20022
+ const sin = Math.sin(angleRadians);
20023
+ const rotatedX = dx * cos - dy * sin;
20024
+ const rotatedY = dx * sin + dy * cos;
20025
+ // 移回原位置
20026
+ return [rotatedX + cx, rotatedY + cy];
21763
20027
  };
21764
20028
  // 获取有效的GPS边界
21765
20029
  const getValidGpsBounds = (mapData, rotation = 0) => {
@@ -21817,7 +20081,7 @@ const defaultMapConfig = DEFAULT_STYLES;
21817
20081
  // 地图渲染器组件
21818
20082
  const MowerMapRenderer = React.forwardRef(({ sn, platform = PlatformType.WEB, edger = false, unitType = UnitsType.Imperial, language = 'en', onlyRead = false, mapConfig,
21819
20083
  // pathConfig,
21820
- modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, onPathLoad, onError, className, style, googleMapInstance: _googleMapInstance, dragMap = false, dragCallbacks, defaultTransform, debug: _debug = false, doodleList = [], editMap = false, unStructMapData, disabledObstacles = false, onHandleEnterRecord, onHandleCompleteRecord, onHandleStopRecord, onHandleDeleteElement, onSaveBoundaryData, onSaveMap, onEditInfoMapChange, onUpdateBoundary, heightOptions, globalHeight, onHandleEvent, }, ref) => {
20084
+ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, onPathLoad, onError, className, style, googleMapInstance: _googleMapInstance, dragMap = false, dragCallbacks, defaultTransform, debug: _debug = false, doodleList = [], editMap = false, unStructMapData, disabledObstacles = false, onHandleEnterRecord, onHandleCompleteRecord, onHandleStopRecord, onHandleDeleteElement, onSaveBoundaryData, onSaveMap, onEditInfoMapChange, onUpdateBoundary, heightOptions, globalHeight, onHandleEvent, onSelectElement, }, ref) => {
21821
20085
  const [currentError, setCurrentError] = React.useState(null);
21822
20086
  const overlayRef = React.useRef(null);
21823
20087
  // const mapRef = useMap();
@@ -21865,7 +20129,10 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
21865
20129
  return {
21866
20130
  minDistance,
21867
20131
  editMapInfo,
21868
- setEditMapInfo,
20132
+ setEditMapInfo: (editMapInfo) => {
20133
+ setEditMapInfo(editMapInfo);
20134
+ onEditInfoMapChange?.(editMapInfo);
20135
+ },
21869
20136
  onHandleEnterRecord,
21870
20137
  onHandleCompleteRecord,
21871
20138
  onHandleStopRecord,
@@ -21874,6 +20141,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
21874
20141
  onHandleDeleteElement,
21875
20142
  onUpdateBoundary,
21876
20143
  onHandleEvent,
20144
+ onSelectElement,
21877
20145
  };
21878
20146
  }, [
21879
20147
  minDistance,
@@ -21886,6 +20154,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
21886
20154
  onSaveMap,
21887
20155
  onUpdateBoundary,
21888
20156
  onHandleEvent,
20157
+ onSelectElement,
21889
20158
  ]);
21890
20159
  // 合并配置
21891
20160
  const mergedMapConfig = React.useMemo(() => {
@@ -22279,6 +20548,10 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
22279
20548
  addDoodle: (doodle) => svgEditMapRef.current?.addDoodle(doodle),
22280
20549
  // 检查doodle
22281
20550
  checkDoodle: () => svgEditMapRef.current?.checkDoodle?.(),
20551
+ // 增加元素(web)
20552
+ addElement: (type, item) => svgEditMapRef.current?.addElement(type, item),
20553
+ // 保存元素
20554
+ saveElement: (type, item) => svgEditMapRef.current?.saveElement(type, item),
22282
20555
  }));
22283
20556
  /**
22284
20557
  * 根据割草机的位置更新路径
@@ -22293,7 +20566,7 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
22293
20566
  }
22294
20567
  // console.log('mowerrender------->', svgViewBox);
22295
20568
  // 使用goole maps自定义叠加层,返回debug信息(如果启用)
22296
- return (jsxRuntime.jsx(CommonContextProvider, { value: commonValue, children: jsxRuntime.jsx(SvgEditContextProvider, { value: svgEditValue, children: jsxRuntime.jsxs(MapEditContextProvider, { value: mapEditValue, children: [platform !== PlatformType.H5 && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(AddEntry, { disabledObstacles: disabledObstacles, doodleList: doodleList, editMap: editMap }), jsxRuntime.jsx(HandleElementInfo, { editMapInfo: editMapInfo, setEditMapInfo: setEditMapInfo })] })), platform === PlatformType.H5 && jsxRuntime.jsx(Crosshair, {}), jsxRuntime.jsxs(OverlayViewF, { onLoad: (lay) => {
20569
+ return (jsxRuntime.jsx(CommonContextProvider, { value: commonValue, children: jsxRuntime.jsx(SvgEditContextProvider, { value: svgEditValue, children: jsxRuntime.jsxs(MapEditContextProvider, { value: mapEditValue, children: [platform !== PlatformType.H5 && (jsxRuntime.jsx(jsxRuntime.Fragment, {})), platform === PlatformType.H5 && jsxRuntime.jsx(Crosshair, {}), jsxRuntime.jsxs(OverlayViewF, { onLoad: (lay) => {
22297
20570
  setOverlay(lay);
22298
20571
  }, onDraw: (style) => {
22299
20572
  const layout = Object.keys(style).reduce((pre, cur) => {
@@ -22311,6 +20584,69 @@ modelType, mapRef, mapJson, pathJson, realTimeData, antennaConfig, onMapLoad, on
22311
20584
  });
22312
20585
  MowerMapRenderer.displayName = 'MowerMapRenderer';
22313
20586
 
20587
+ const BoundarySvgRender = React.memo(({ mapJson, id, maxWidth = 300 }) => {
20588
+ const svgElementData = React.useMemo(() => {
20589
+ const data = UnifiedMapDataProcessor.processMapData(mapJson, DEFAULT_STYLES) || {};
20590
+ return data;
20591
+ }, [mapJson, DEFAULT_STYLES]);
20592
+ const boundaryInfo = React.useMemo(() => {
20593
+ const boundary = svgElementData.boundary.find((item) => item.id === id);
20594
+ return boundary;
20595
+ }, [id, svgElementData]);
20596
+ // 计算当前boundary的viewBox
20597
+ const boundaryViewBox = React.useMemo(() => {
20598
+ if (!boundaryInfo?.points || boundaryInfo.points.length === 0) {
20599
+ return null;
20600
+ }
20601
+ // 计算边界
20602
+ let minX = Infinity;
20603
+ let minY = Infinity;
20604
+ let maxX = -Infinity;
20605
+ let maxY = -Infinity;
20606
+ boundaryInfo.points.forEach((point) => {
20607
+ minX = Math.min(minX, point[0]);
20608
+ minY = Math.min(minY, point[1]);
20609
+ maxX = Math.max(maxX, point[0]);
20610
+ maxY = Math.max(maxY, point[1]);
20611
+ });
20612
+ // 添加边距
20613
+ const padding = 50;
20614
+ const width = maxX - minX + padding * 2;
20615
+ const height = maxY - minY + padding * 2;
20616
+ return {
20617
+ x: minX - padding,
20618
+ y: minY - padding,
20619
+ width,
20620
+ height,
20621
+ };
20622
+ }, [boundaryInfo]);
20623
+ const style = React.useMemo(() => {
20624
+ if (boundaryViewBox?.width > boundaryViewBox?.height) {
20625
+ return {
20626
+ width: maxWidth,
20627
+ height: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
20628
+ };
20629
+ }
20630
+ return {
20631
+ width: maxWidth * (boundaryViewBox.height / boundaryViewBox.width),
20632
+ height: maxWidth,
20633
+ };
20634
+ }, [boundaryViewBox, maxWidth]);
20635
+ return (jsxRuntime.jsxs("div", { style: {
20636
+ position: 'relative',
20637
+ width: style.width,
20638
+ height: style.height,
20639
+ margin: '0 auto',
20640
+ }, children: [jsxRuntime.jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: `${boundaryViewBox.x} ${boundaryViewBox.y} ${boundaryViewBox.width} ${boundaryViewBox.height}`, width: `${style.width}px`, height: `${style.height}px`, style: { position: 'absolute', inset: 0, pointerEvents: 'none' }, children: Object.keys(svgElementData)?.map((key) => {
20641
+ return svgElementData[key]?.map((element) => {
20642
+ if (key === exports.DataType.VISION_OFF)
20643
+ return null;
20644
+ return (jsxRuntime.jsx(GElement, { type: key, data: svgElementData[key], children: jsxRuntime.jsx(SvgElement, { type: key, data: element, onSelect: () => { }, onCancel: () => { } }, element.id) }, key));
20645
+ });
20646
+ }) }), jsxRuntime.jsx(CharginPile, { mapData: mapJson, mapConfig: DEFAULT_STYLES, viewBox: boundaryViewBox || null, rotation: 0 })] }));
20647
+ });
20648
+
20649
+ exports.ALL_DIRECTION_SELECTED = ALL_DIRECTION_SELECTED;
22314
20650
  exports.AntennaData = AntennaData;
22315
20651
  exports.AntennaDataBuilder = AntennaDataBuilder;
22316
20652
  exports.BaseData = BaseData;
@@ -22319,11 +20655,14 @@ exports.BoundarySvgRender = BoundarySvgRender;
22319
20655
  exports.ChannelData = ChannelData;
22320
20656
  exports.ChargingPileData = ChargingPileData;
22321
20657
  exports.DoodleData = DoodleData;
20658
+ exports.MAX_DIRECTION_ANGLE = MAX_DIRECTION_ANGLE;
20659
+ exports.MIN_DIRECTION_ANGLE = MIN_DIRECTION_ANGLE;
22322
20660
  exports.MapDataProcessor = MapDataProcessor;
22323
20661
  exports.MowerMapRenderer = MowerMapRenderer;
22324
20662
  exports.ObstacleData = ObstacleData;
22325
20663
  exports.PathData = PathData;
22326
20664
  exports.PathDataProcessor = PathDataProcessor;
20665
+ exports.SCALE_FACTOR = SCALE_FACTOR;
22327
20666
  exports.SvgParserNative = SvgParserNative;
22328
20667
  exports.UnifiedMapDataProcessor = UnifiedMapDataProcessor;
22329
20668
  exports.VisionOffData = VisionOffData;
@@ -22334,3 +20673,4 @@ exports.initChannel = initChannel;
22334
20673
  exports.initDoodle = initDoodle;
22335
20674
  exports.initObstacle = initObstacle;
22336
20675
  exports.initVisionOff = initVisionOff;
20676
+ exports.restorePointsFormat = restorePointsFormat;