kitchen-simulator 1.1.1-test.60 → 1.1.1-test.61

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 (321) hide show
  1. package/es/@history.js +10 -2
  2. package/es/AppContext.js +10 -3
  3. package/es/KitchenConfigurator.js +92 -96
  4. package/es/KitchenConfiguratorApp.js +143 -136
  5. package/es/actions/area-actions.js +12 -5
  6. package/es/actions/export.js +29 -12
  7. package/es/actions/groups-actions.js +45 -27
  8. package/es/actions/holes-actions.js +55 -34
  9. package/es/actions/items-actions.js +145 -94
  10. package/es/actions/lines-actions.js +36 -21
  11. package/es/actions/project-actions.js +145 -94
  12. package/es/actions/scene-actions.js +21 -11
  13. package/es/actions/vertices-actions.js +15 -7
  14. package/es/actions/viewer2d-actions.js +36 -21
  15. package/es/actions/viewer3d-actions.js +18 -9
  16. package/es/catalog/areas/area/planner-element.js +9 -2
  17. package/es/catalog/catalog.js +21 -24
  18. package/es/catalog/factories/area-factory-3d.js +31 -22
  19. package/es/catalog/factories/area-factory.js +20 -14
  20. package/es/catalog/factories/export.js +24 -6
  21. package/es/catalog/factories/wall-factory-3d.js +41 -31
  22. package/es/catalog/factories/wall-factory.js +31 -21
  23. package/es/catalog/holes/door-closet/planner-element.js +24 -15
  24. package/es/catalog/holes/door-double/planner-element.js +24 -15
  25. package/es/catalog/holes/door-exterior/planner-element.js +25 -16
  26. package/es/catalog/holes/door-interior/planner-element.js +25 -16
  27. package/es/catalog/holes/door-panic/planner-element.js +16 -7
  28. package/es/catalog/holes/door-panic-double/planner-element.js +24 -15
  29. package/es/catalog/holes/door-sliding/planner-element.js +25 -16
  30. package/es/catalog/holes/doorway-framed/planner-element.js +20 -11
  31. package/es/catalog/holes/doorway-frameless/planner-element.js +16 -7
  32. package/es/catalog/holes/export.js +97 -13
  33. package/es/catalog/holes/window-clear/planner-element.js +19 -10
  34. package/es/catalog/holes/window-cross/planner-element.js +19 -10
  35. package/es/catalog/holes/window-double-hung/planner-element.js +19 -10
  36. package/es/catalog/holes/window-vertical/planner-element.js +19 -10
  37. package/es/catalog/lines/wall/planner-element.js +9 -2
  38. package/es/catalog/molding/molding-dcm/planner-element.js +14 -5
  39. package/es/catalog/molding/molding-fbm/planner-element.js +14 -5
  40. package/es/catalog/molding/molding-lrm/planner-element.js +14 -5
  41. package/es/catalog/properties/export.js +80 -20
  42. package/es/catalog/properties/property-checkbox.js +31 -27
  43. package/es/catalog/properties/property-color.js +23 -16
  44. package/es/catalog/properties/property-enum.js +31 -29
  45. package/es/catalog/properties/property-hidden.js +16 -9
  46. package/es/catalog/properties/property-lenght-measure.js +45 -39
  47. package/es/catalog/properties/property-length-measure.js +43 -42
  48. package/es/catalog/properties/property-length-measure_hole.js +45 -39
  49. package/es/catalog/properties/property-number.js +24 -17
  50. package/es/catalog/properties/property-read-only.js +23 -16
  51. package/es/catalog/properties/property-string.js +23 -16
  52. package/es/catalog/properties/property-toggle.js +23 -16
  53. package/es/catalog/properties/shared-property-style.js +7 -1
  54. package/es/catalog/utils/FuseUtils.js +15 -11
  55. package/es/catalog/utils/exporter.js +15 -11
  56. package/es/catalog/utils/geom-utils.js +29 -13
  57. package/es/catalog/utils/item-loader.js +97 -91
  58. package/es/catalog/utils/load-obj.js +28 -20
  59. package/es/catalog/utils/mtl-loader.js +8 -3
  60. package/es/catalog/utils/obj-loader.js +8 -3
  61. package/es/class/FuseUtils.js +15 -11
  62. package/es/class/area.js +28 -26
  63. package/es/class/export.js +95 -23
  64. package/es/class/group.js +59 -62
  65. package/es/class/guide.js +21 -19
  66. package/es/class/hole.js +89 -87
  67. package/es/class/item.js +147 -150
  68. package/es/class/layer.js +65 -63
  69. package/es/class/line.js +143 -144
  70. package/es/class/project.js +98 -94
  71. package/es/class/vertex.js +35 -33
  72. package/es/components/content.js +28 -19
  73. package/es/components/disclaimer/disclaimer.js +18 -10
  74. package/es/components/export.js +32 -8
  75. package/es/components/style/button.js +31 -30
  76. package/es/components/style/cancel-button.js +14 -8
  77. package/es/components/style/content-container.js +16 -12
  78. package/es/components/style/content-title.js +20 -15
  79. package/es/components/style/delete-button.js +17 -9
  80. package/es/components/style/export.js +120 -30
  81. package/es/components/style/form-block.js +15 -12
  82. package/es/components/style/form-color-input.js +14 -8
  83. package/es/components/style/form-label.js +15 -12
  84. package/es/components/style/form-number-input.js +49 -47
  85. package/es/components/style/form-number-input_2.js +44 -42
  86. package/es/components/style/form-select.js +24 -26
  87. package/es/components/style/form-slider.js +17 -11
  88. package/es/components/style/form-submit-button.js +17 -9
  89. package/es/components/style/form-text-input.js +34 -33
  90. package/es/components/viewer2d/area.js +24 -17
  91. package/es/components/viewer2d/export.js +120 -30
  92. package/es/components/viewer2d/grids/grid-horizontal-streak.js +17 -10
  93. package/es/components/viewer2d/grids/grid-streak.js +17 -10
  94. package/es/components/viewer2d/grids/grid-vertical-streak.js +17 -10
  95. package/es/components/viewer2d/grids/grids.js +19 -15
  96. package/es/components/viewer2d/group.js +24 -15
  97. package/es/components/viewer2d/item.js +70 -66
  98. package/es/components/viewer2d/layer.js +30 -23
  99. package/es/components/viewer2d/line.js +111 -101
  100. package/es/components/viewer2d/ruler.js +29 -22
  101. package/es/components/viewer2d/rulerDist.js +28 -21
  102. package/es/components/viewer2d/rulerX.js +47 -45
  103. package/es/components/viewer2d/rulerY.js +45 -43
  104. package/es/components/viewer2d/scene.js +41 -45
  105. package/es/components/viewer2d/snap.js +22 -13
  106. package/es/components/viewer2d/state.js +27 -23
  107. package/es/components/viewer2d/utils.js +37 -29
  108. package/es/components/viewer2d/vertex.js +17 -8
  109. package/es/components/viewer2d/viewer2d.js +163 -164
  110. package/es/components/viewer3d/camera-controls-module/camera-controls.module.js +23 -24
  111. package/es/components/viewer3d/dcm.js +7 -1
  112. package/es/components/viewer3d/fbm.js +7 -1
  113. package/es/components/viewer3d/front3D.js +21 -17
  114. package/es/components/viewer3d/grid-creator.js +17 -8
  115. package/es/components/viewer3d/grids/grid-horizontal-streak.js +14 -6
  116. package/es/components/viewer3d/grids/grid-streak.js +13 -5
  117. package/es/components/viewer3d/grids/grid-vertical-streak.js +14 -6
  118. package/es/components/viewer3d/libs/first-person-controls.js +9 -2
  119. package/es/components/viewer3d/libs/helvetiker_regular.typeface.js +7 -1
  120. package/es/components/viewer3d/libs/mtl-loader.js +7 -1
  121. package/es/components/viewer3d/libs/obj-loader.js +7 -1
  122. package/es/components/viewer3d/libs/orbit-controls.js +8 -2
  123. package/es/components/viewer3d/libs/pointer-lock-controls.js +8 -2
  124. package/es/components/viewer3d/lrm.js +7 -1
  125. package/es/components/viewer3d/model.js +7 -1
  126. package/es/components/viewer3d/pointer-lock-navigation.js +10 -3
  127. package/es/components/viewer3d/ruler-utils/itemRect.js +25 -18
  128. package/es/components/viewer3d/ruler-utils/layer3D.js +66 -59
  129. package/es/components/viewer3d/ruler-utils/ruler3D.js +46 -42
  130. package/es/components/viewer3d/ruler-utils/scene3D.js +17 -9
  131. package/es/components/viewer3d/ruler-utils/state3D.js +11 -4
  132. package/es/components/viewer3d/scene-creator.js +227 -198
  133. package/es/components/viewer3d/three-memory-cleaner.js +12 -3
  134. package/es/components/viewer3d/viewer3d-first-person.js +46 -46
  135. package/es/components/viewer3d/viewer3d.js +202 -202
  136. package/es/constants.js +358 -349
  137. package/es/index.js +13 -6
  138. package/es/models.js +184 -183
  139. package/es/plugins/SVGLoader.js +53 -48
  140. package/es/plugins/autosave.js +9 -3
  141. package/es/plugins/console-debugger.js +12 -8
  142. package/es/plugins/export.js +32 -8
  143. package/es/plugins/keyboard.js +35 -29
  144. package/es/reducers/areas-reducer.js +13 -7
  145. package/es/reducers/export.js +96 -24
  146. package/es/reducers/groups-reducer.js +37 -31
  147. package/es/reducers/holes-reducer.js +49 -43
  148. package/es/reducers/items-reducer.js +112 -106
  149. package/es/reducers/lines-reducer.js +34 -28
  150. package/es/reducers/project-reducer.js +111 -105
  151. package/es/reducers/reducer.js +23 -16
  152. package/es/reducers/scene-reducer.js +21 -15
  153. package/es/reducers/user-reducer.js +11 -5
  154. package/es/reducers/vertices-reducer.js +17 -11
  155. package/es/reducers/viewer2d-reducer.js +24 -18
  156. package/es/reducers/viewer3d-reducer.js +22 -16
  157. package/es/shared-style.js +16 -10
  158. package/es/styles/export.js +11 -3
  159. package/es/translator/en.js +7 -1
  160. package/es/translator/it.js +7 -1
  161. package/es/translator/ru.js +7 -1
  162. package/es/translator/translator.js +19 -17
  163. package/es/utils/browser.js +9 -2
  164. package/es/utils/convert-units-lite.js +7 -1
  165. package/es/utils/email-validator.js +7 -1
  166. package/es/utils/export.js +46 -15
  167. package/es/utils/geometry.js +278 -190
  168. package/es/utils/get-edges-of-subgraphs.js +9 -2
  169. package/es/utils/graph-cycles.js +11 -8
  170. package/es/utils/graph-inner-cycles.js +18 -10
  171. package/es/utils/graph.js +17 -13
  172. package/es/utils/helper.js +63 -41
  173. package/es/utils/history.js +15 -8
  174. package/es/utils/id-broker.js +15 -12
  175. package/es/utils/logger.js +7 -1
  176. package/es/utils/math.js +12 -5
  177. package/es/utils/molding.js +144 -125
  178. package/es/utils/name-generator.js +13 -11
  179. package/es/utils/objects-utils.js +19 -7
  180. package/es/utils/phone-validator.js +7 -1
  181. package/es/utils/process-black-list.js +10 -6
  182. package/es/utils/react-if.js +12 -6
  183. package/es/utils/snap-scene.js +34 -32
  184. package/es/utils/snap.js +59 -51
  185. package/es/utils/summarizeCart.js +7 -1
  186. package/es/utils/threeCSG.es6.js +22 -17
  187. package/es/version.js +7 -1
  188. package/lib/@history.js +1 -1
  189. package/lib/AppContext.js +1 -1
  190. package/lib/KitchenConfigurator.js +37 -49
  191. package/lib/KitchenConfiguratorApp.js +60 -61
  192. package/lib/actions/export.js +1 -1
  193. package/lib/catalog/areas/area/planner-element.js +1 -1
  194. package/lib/catalog/catalog.js +7 -15
  195. package/lib/catalog/factories/area-factory-3d.js +1 -1
  196. package/lib/catalog/factories/area-factory.js +4 -6
  197. package/lib/catalog/factories/export.js +1 -1
  198. package/lib/catalog/factories/wall-factory-3d.js +2 -2
  199. package/lib/catalog/factories/wall-factory.js +2 -2
  200. package/lib/catalog/holes/door-closet/planner-element.js +2 -2
  201. package/lib/catalog/holes/door-double/planner-element.js +2 -2
  202. package/lib/catalog/holes/door-exterior/planner-element.js +2 -2
  203. package/lib/catalog/holes/door-interior/planner-element.js +2 -2
  204. package/lib/catalog/holes/door-panic/planner-element.js +2 -2
  205. package/lib/catalog/holes/door-panic-double/planner-element.js +2 -2
  206. package/lib/catalog/holes/door-sliding/planner-element.js +2 -2
  207. package/lib/catalog/holes/doorway-framed/planner-element.js +2 -2
  208. package/lib/catalog/holes/doorway-frameless/planner-element.js +2 -2
  209. package/lib/catalog/holes/export.js +2 -2
  210. package/lib/catalog/holes/window-clear/planner-element.js +2 -2
  211. package/lib/catalog/holes/window-cross/planner-element.js +2 -2
  212. package/lib/catalog/holes/window-double-hung/planner-element.js +2 -2
  213. package/lib/catalog/holes/window-vertical/planner-element.js +2 -2
  214. package/lib/catalog/lines/wall/planner-element.js +1 -1
  215. package/lib/catalog/molding/molding-dcm/planner-element.js +2 -2
  216. package/lib/catalog/molding/molding-fbm/planner-element.js +2 -2
  217. package/lib/catalog/molding/molding-lrm/planner-element.js +2 -2
  218. package/lib/catalog/properties/export.js +1 -1
  219. package/lib/catalog/properties/property-checkbox.js +3 -6
  220. package/lib/catalog/properties/property-color.js +1 -1
  221. package/lib/catalog/properties/property-enum.js +4 -9
  222. package/lib/catalog/properties/property-hidden.js +1 -1
  223. package/lib/catalog/properties/property-lenght-measure.js +5 -6
  224. package/lib/catalog/properties/property-length-measure.js +7 -13
  225. package/lib/catalog/properties/property-length-measure_hole.js +5 -6
  226. package/lib/catalog/properties/property-number.js +1 -1
  227. package/lib/catalog/properties/property-read-only.js +1 -1
  228. package/lib/catalog/properties/property-string.js +1 -1
  229. package/lib/catalog/properties/property-toggle.js +1 -1
  230. package/lib/catalog/utils/FuseUtils.js +8 -10
  231. package/lib/catalog/utils/exporter.js +3 -5
  232. package/lib/catalog/utils/geom-utils.js +1 -1
  233. package/lib/catalog/utils/item-loader.js +9 -14
  234. package/lib/class/FuseUtils.js +8 -10
  235. package/lib/class/area.js +7 -10
  236. package/lib/class/export.js +1 -1
  237. package/lib/class/group.js +11 -19
  238. package/lib/class/guide.js +9 -12
  239. package/lib/class/hole.js +5 -8
  240. package/lib/class/item.js +10 -18
  241. package/lib/class/layer.js +5 -8
  242. package/lib/class/line.js +12 -19
  243. package/lib/class/project.js +8 -10
  244. package/lib/class/vertex.js +7 -10
  245. package/lib/components/content.js +2 -2
  246. package/lib/components/disclaimer/disclaimer.js +1 -1
  247. package/lib/components/export.js +1 -1
  248. package/lib/components/style/button.js +15 -21
  249. package/lib/components/style/cancel-button.js +5 -6
  250. package/lib/components/style/content-container.js +3 -6
  251. package/lib/components/style/content-title.js +8 -11
  252. package/lib/components/style/delete-button.js +6 -7
  253. package/lib/components/style/export.js +1 -1
  254. package/lib/components/style/form-block.js +7 -11
  255. package/lib/components/style/form-color-input.js +5 -6
  256. package/lib/components/style/form-label.js +7 -11
  257. package/lib/components/style/form-number-input.js +13 -18
  258. package/lib/components/style/form-number-input_2.js +13 -18
  259. package/lib/components/style/form-select.js +10 -19
  260. package/lib/components/style/form-slider.js +5 -6
  261. package/lib/components/style/form-submit-button.js +6 -7
  262. package/lib/components/style/form-text-input.js +17 -22
  263. package/lib/components/viewer2d/area.js +1 -1
  264. package/lib/components/viewer2d/export.js +1 -1
  265. package/lib/components/viewer2d/grids/grid-horizontal-streak.js +1 -1
  266. package/lib/components/viewer2d/grids/grid-streak.js +1 -1
  267. package/lib/components/viewer2d/grids/grid-vertical-streak.js +1 -1
  268. package/lib/components/viewer2d/grids/grids.js +4 -9
  269. package/lib/components/viewer2d/group.js +2 -2
  270. package/lib/components/viewer2d/item.js +5 -10
  271. package/lib/components/viewer2d/layer.js +1 -1
  272. package/lib/components/viewer2d/line.js +2 -2
  273. package/lib/components/viewer2d/ruler.js +1 -1
  274. package/lib/components/viewer2d/rulerDist.js +1 -1
  275. package/lib/components/viewer2d/rulerX.js +13 -18
  276. package/lib/components/viewer2d/rulerY.js +13 -18
  277. package/lib/components/viewer2d/scene.js +21 -32
  278. package/lib/components/viewer2d/snap.js +2 -2
  279. package/lib/components/viewer2d/state.js +5 -10
  280. package/lib/components/viewer2d/utils.js +5 -9
  281. package/lib/components/viewer2d/vertex.js +2 -2
  282. package/lib/components/viewer2d/viewer2d.js +13 -23
  283. package/lib/components/viewer3d/camera-controls-module/camera-controls.module.js +14 -20
  284. package/lib/components/viewer3d/front3D.js +4 -9
  285. package/lib/components/viewer3d/grid-creator.js +2 -2
  286. package/lib/components/viewer3d/grids/grid-horizontal-streak.js +1 -1
  287. package/lib/components/viewer3d/grids/grid-streak.js +1 -1
  288. package/lib/components/viewer3d/grids/grid-vertical-streak.js +1 -1
  289. package/lib/components/viewer3d/pointer-lock-navigation.js +1 -1
  290. package/lib/components/viewer3d/ruler-utils/itemRect.js +1 -1
  291. package/lib/components/viewer3d/ruler-utils/layer3D.js +1 -1
  292. package/lib/components/viewer3d/ruler-utils/ruler3D.js +3 -6
  293. package/lib/components/viewer3d/ruler-utils/scene3D.js +1 -1
  294. package/lib/components/viewer3d/ruler-utils/state3D.js +1 -1
  295. package/lib/components/viewer3d/scene-creator.js +16 -21
  296. package/lib/components/viewer3d/three-memory-cleaner.js +1 -1
  297. package/lib/components/viewer3d/viewer3d-first-person.js +11 -16
  298. package/lib/components/viewer3d/viewer3d.js +15 -20
  299. package/lib/index.js +1 -1
  300. package/lib/models.js +51 -56
  301. package/lib/plugins/console-debugger.js +3 -6
  302. package/lib/plugins/export.js +1 -1
  303. package/lib/reducers/export.js +1 -1
  304. package/lib/styles/export.js +1 -1
  305. package/lib/translator/translator.js +5 -9
  306. package/lib/utils/export.js +2 -2
  307. package/lib/utils/geometry.js +11 -18
  308. package/lib/utils/graph-inner-cycles.js +1 -1
  309. package/lib/utils/graph.js +7 -10
  310. package/lib/utils/helper.js +7 -7
  311. package/lib/utils/history.js +1 -1
  312. package/lib/utils/id-broker.js +5 -8
  313. package/lib/utils/molding.js +14 -19
  314. package/lib/utils/name-generator.js +5 -8
  315. package/lib/utils/objects-utils.js +5 -3
  316. package/lib/utils/process-black-list.js +3 -5
  317. package/lib/utils/react-if.js +1 -1
  318. package/lib/utils/snap-scene.js +3 -7
  319. package/lib/utils/snap.js +22 -26
  320. package/lib/utils/threeCSG.es6.js +14 -14
  321. package/package.json +24 -18
package/es/class/line.js CHANGED
@@ -1,31 +1,31 @@
1
- function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
8
- function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
9
- function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
10
- function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
11
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
12
- function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
- import { fromJS, List, Map } from 'immutable';
14
- import { Group, Hole, Layer, Vertex } from "./export";
15
- import { GeometryUtils, history, IDBroker, NameGenerator, SnapSceneUtils, SnapUtils } from "../utils/export";
16
- import * as Three from 'three';
17
- import { END_DRAGGING_LINE, END_DRAGGING_VERTEX, END_DRAWING_LINE, EPSILON, MIN_ANGLE_DISALLOW_DRAW_WALL, MODE_DRAGGING_LINE, MODE_DRAWING_LINE, MODE_IDLE, MODE_WAITING_DRAWING_LINE, UNIT_ANGLE } from "../constants";
18
- import { isEmpty } from "../utils/helper";
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ var _typeof = require("@babel/runtime/helpers/typeof");
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports["default"] = void 0;
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
+ var _immutable = require("immutable");
13
+ var _export = require("./export");
14
+ var _export2 = require("../utils/export");
15
+ var Three = _interopRequireWildcard(require("three"));
16
+ var _constants = require("../constants");
17
+ var _helper = require("../utils/helper");
18
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
19
19
  var timeGlobal = 0;
20
20
  var TimeRecorder = /*#__PURE__*/function () {
21
21
  function TimeRecorder(name) {
22
- _classCallCheck(this, TimeRecorder);
22
+ (0, _classCallCheck2["default"])(this, TimeRecorder);
23
23
  this.name = name;
24
24
  if (name === 'beginDrawingLine') {
25
25
  console.log('time__ Start Drawing');
26
26
  }
27
27
  }
28
- return _createClass(TimeRecorder, [{
28
+ return (0, _createClass2["default"])(TimeRecorder, [{
29
29
  key: "start",
30
30
  value: function start() {
31
31
  this.first = Date.now();
@@ -44,11 +44,11 @@ var TimeRecorder = /*#__PURE__*/function () {
44
44
  }
45
45
  }]);
46
46
  }();
47
- var Line = /*#__PURE__*/function () {
47
+ var Line = exports["default"] = /*#__PURE__*/function () {
48
48
  function Line() {
49
- _classCallCheck(this, Line);
49
+ (0, _classCallCheck2["default"])(this, Line);
50
50
  }
51
- return _createClass(Line, null, [{
51
+ return (0, _createClass2["default"])(Line, null, [{
52
52
  key: "create",
53
53
  value: function create(state, layerID, type, x0, y0, x1, y1, properties) {
54
54
  var lineCreatedDateTime = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : new Date().getTime();
@@ -57,18 +57,18 @@ var Line = /*#__PURE__*/function () {
57
57
  // return { updatedState: state };
58
58
  // }
59
59
  // ///////////////
60
- var lineID = IDBroker.acquireID();
61
- var _Vertex$add = Vertex.add(state, layerID, x0, y0, 'lines', lineID),
60
+ var lineID = _export2.IDBroker.acquireID();
61
+ var _Vertex$add = _export.Vertex.add(state, layerID, x0, y0, 'lines', lineID),
62
62
  stateV0 = _Vertex$add.updatedState,
63
63
  v0 = _Vertex$add.vertex;
64
- var _Vertex$add2 = Vertex.add(stateV0, layerID, x1, y1, 'lines', lineID),
64
+ var _Vertex$add2 = _export.Vertex.add(stateV0, layerID, x1, y1, 'lines', lineID),
65
65
  stateV1 = _Vertex$add2.updatedState,
66
66
  v1 = _Vertex$add2.vertex;
67
67
  state = stateV1;
68
68
  var line = state.catalog.factoryElement(type, {
69
69
  id: lineID,
70
- name: NameGenerator.generateName('lines', state.catalog.getIn(['elements', type, 'info', 'title'])),
71
- vertices: new List([v0.id, v1.id]),
70
+ name: _export2.NameGenerator.generateName('lines', state.catalog.getIn(['elements', type, 'info', 'title'])),
71
+ vertices: new _immutable.List([v0.id, v1.id]),
72
72
  type: type
73
73
  }, properties);
74
74
  line = line.set('createdDateTime', lineCreatedDateTime !== undefined ? lineCreatedDateTime : new Date().getTime());
@@ -90,7 +90,7 @@ var Line = /*#__PURE__*/function () {
90
90
  value: function select(state, layerID, lineID) {
91
91
  var _line$vertices, _line$vertices$get, _line$vertices2, _line$vertices2$get;
92
92
  // Try selecting the layer first
93
- var layerResult = Layer.select(state, layerID);
93
+ var layerResult = _export.Layer.select(state, layerID);
94
94
  if (!layerResult || !layerResult.updatedState) {
95
95
  return {
96
96
  updatedState: state
@@ -107,7 +107,7 @@ var Line = /*#__PURE__*/function () {
107
107
  }
108
108
 
109
109
  // Select the line element
110
- var lineSelectResult = Layer.selectElement(state, layerID, 'lines', lineID);
110
+ var lineSelectResult = _export.Layer.selectElement(state, layerID, 'lines', lineID);
111
111
  if (lineSelectResult !== null && lineSelectResult !== void 0 && lineSelectResult.updatedState) {
112
112
  state = lineSelectResult.updatedState;
113
113
  }
@@ -115,7 +115,7 @@ var Line = /*#__PURE__*/function () {
115
115
  // Select the first vertex (if available)
116
116
  var firstVertex = (_line$vertices = line.vertices) === null || _line$vertices === void 0 || (_line$vertices$get = _line$vertices.get) === null || _line$vertices$get === void 0 ? void 0 : _line$vertices$get.call(_line$vertices, 0);
117
117
  if (firstVertex !== undefined) {
118
- var v1Result = Layer.selectElement(state, layerID, 'vertices', firstVertex);
118
+ var v1Result = _export.Layer.selectElement(state, layerID, 'vertices', firstVertex);
119
119
  if (v1Result !== null && v1Result !== void 0 && v1Result.updatedState) {
120
120
  state = v1Result.updatedState;
121
121
  }
@@ -124,7 +124,7 @@ var Line = /*#__PURE__*/function () {
124
124
  // Select the second vertex (if available)
125
125
  var secondVertex = (_line$vertices2 = line.vertices) === null || _line$vertices2 === void 0 || (_line$vertices2$get = _line$vertices2.get) === null || _line$vertices2$get === void 0 ? void 0 : _line$vertices2$get.call(_line$vertices2, 1);
126
126
  if (secondVertex !== undefined) {
127
- var v2Result = Layer.selectElement(state, layerID, 'vertices', secondVertex);
127
+ var v2Result = _export.Layer.selectElement(state, layerID, 'vertices', secondVertex);
128
128
  if (v2Result !== null && v2Result !== void 0 && v2Result.updatedState) {
129
129
  state = v2Result.updatedState;
130
130
  }
@@ -140,14 +140,14 @@ var Line = /*#__PURE__*/function () {
140
140
  if (line) {
141
141
  state = this.unselect(state, layerID, lineID).updatedState;
142
142
  line.holes.forEach(function (holeID) {
143
- return state = Hole.remove(state, layerID, holeID).updatedState;
143
+ return state = _export.Hole.remove(state, layerID, holeID).updatedState;
144
144
  });
145
- state = Layer.removeElement(state, layerID, 'lines', lineID).updatedState;
145
+ state = _export.Layer.removeElement(state, layerID, 'lines', lineID).updatedState;
146
146
  line.vertices.forEach(function (vertexID) {
147
- return state = Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
147
+ return state = _export.Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
148
148
  });
149
149
  state.getIn(['scene', 'groups']).forEach(function (group) {
150
- return state = Group.removeElement(state, group.id, layerID, 'lines', lineID).updatedState;
150
+ return state = _export.Group.removeElement(state, group.id, layerID, 'lines', lineID).updatedState;
151
151
  });
152
152
  }
153
153
  return {
@@ -177,9 +177,9 @@ var Line = /*#__PURE__*/function () {
177
177
  value: function unselect(state, layerID, lineID) {
178
178
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
179
179
  if (line) {
180
- state = Layer.unselect(state, layerID, 'vertices', line.vertices.get(0)).updatedState;
181
- state = Layer.unselect(state, layerID, 'vertices', line.vertices.get(1)).updatedState;
182
- state = Layer.unselect(state, layerID, 'lines', lineID).updatedState;
180
+ state = _export.Layer.unselect(state, layerID, 'vertices', line.vertices.get(0)).updatedState;
181
+ state = _export.Layer.unselect(state, layerID, 'vertices', line.vertices.get(1)).updatedState;
182
+ state = _export.Layer.unselect(state, layerID, 'lines', lineID).updatedState;
183
183
  }
184
184
  return {
185
185
  updatedState: state
@@ -202,8 +202,8 @@ var Line = /*#__PURE__*/function () {
202
202
  stateL2 = _Line$create2.updatedState,
203
203
  line1 = _Line$create2.line;
204
204
  state = stateL2;
205
- var splitPointOffset = GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, x, y);
206
- var minVertex = GeometryUtils.minVertex(v0, v1);
205
+ var splitPointOffset = _export2.GeometryUtils.pointPositionOnLineSegment(x0, y0, x1, y1, x, y);
206
+ var minVertex = _export2.GeometryUtils.minVertex(v0, v1);
207
207
  line.holes.forEach(function (holeID) {
208
208
  var hole = state.getIn(['scene', 'layers', layerID, 'holes', holeID]);
209
209
  var holeOffset = hole.offset;
@@ -218,7 +218,7 @@ var Line = /*#__PURE__*/function () {
218
218
  offset = 1 - offset;
219
219
  }
220
220
  */
221
- state = Hole.create(state, layerID, hole.type, line0.id, offset, hole.properties).updatedState;
221
+ state = _export.Hole.create(state, layerID, hole.type, line0.id, offset, hole.properties).updatedState;
222
222
  } else {
223
223
  var _offset = (holeOffset - splitPointOffset) / (1 - splitPointOffset);
224
224
  /*
@@ -226,7 +226,7 @@ var Line = /*#__PURE__*/function () {
226
226
  offset = 1 - offset;
227
227
  }
228
228
  */
229
- state = Hole.create(state, layerID, hole.type, line1.id, _offset, hole.properties).updatedState;
229
+ state = _export.Hole.create(state, layerID, hole.type, line1.id, _offset, hole.properties).updatedState;
230
230
  }
231
231
  });
232
232
 
@@ -236,13 +236,13 @@ var Line = /*#__PURE__*/function () {
236
236
  return lines && lines.contains(lineID);
237
237
  });
238
238
  lineGroups.forEach(function (group) {
239
- state = Group.addElement(state, group.id, layerID, 'lines', line0.id).updatedState;
240
- state = Group.addElement(state, group.id, layerID, 'lines', line1.id).updatedState;
239
+ state = _export.Group.addElement(state, group.id, layerID, 'lines', line0.id).updatedState;
240
+ state = _export.Group.addElement(state, group.id, layerID, 'lines', line1.id).updatedState;
241
241
  });
242
242
  state = Line.remove(state, layerID, lineID).updatedState;
243
243
  return {
244
244
  updatedState: state,
245
- lines: new List([line0, line1])
245
+ lines: new _immutable.List([line0, line1])
246
246
  };
247
247
  }
248
248
  }, {
@@ -250,7 +250,7 @@ var Line = /*#__PURE__*/function () {
250
250
  value: function addFromPoints(state, layerID, type, points, properties, holes) {
251
251
  var _this = this;
252
252
  var lineCreatedDateTime = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : new Date().getTime();
253
- points = new List(points).sort(function (_ref, _ref2) {
253
+ points = new _immutable.List(points).sort(function (_ref, _ref2) {
254
254
  var x1 = _ref.x,
255
255
  y1 = _ref.y;
256
256
  var x2 = _ref2.x,
@@ -258,7 +258,7 @@ var Line = /*#__PURE__*/function () {
258
258
  return x1 === x2 ? y1 - y2 : x1 - x2;
259
259
  });
260
260
  var pointsPair = points.zip(points.skip(1)).filterNot(function (_ref3) {
261
- var _ref4 = _slicedToArray(_ref3, 2),
261
+ var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
262
262
  _ref4$ = _ref4[0],
263
263
  x1 = _ref4$.x,
264
264
  y1 = _ref4$.y,
@@ -269,7 +269,7 @@ var Line = /*#__PURE__*/function () {
269
269
  });
270
270
  var lines = [];
271
271
  pointsPair.forEach(function (_ref5) {
272
- var _ref6 = _slicedToArray(_ref5, 2),
272
+ var _ref6 = (0, _slicedToArray2["default"])(_ref5, 2),
273
273
  _ref6$ = _ref6[0],
274
274
  x1 = _ref6$.x,
275
275
  y1 = _ref6$.y,
@@ -280,10 +280,10 @@ var Line = /*#__PURE__*/function () {
280
280
  stateL = _this$create.updatedState,
281
281
  line = _this$create.line;
282
282
  state = stateL;
283
- var lineLength = GeometryUtils.pointsDistance(x1, y1, x2, y2);
284
- var alpha = GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
285
- var cosAlpha = GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
286
- var sinAlpha = GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
283
+ var lineLength = _export2.GeometryUtils.pointsDistance(x1, y1, x2, y2);
284
+ var alpha = _export2.GeometryUtils.absAngleBetweenTwoPoints(x1, y1, x2, y2);
285
+ var cosAlpha = _export2.GeometryUtils.cosWithThreshold(Math.abs(alpha), 0.0000001);
286
+ var sinAlpha = _export2.GeometryUtils.sinWithThreshold(Math.abs(alpha), 0.0000001);
287
287
  if (holes) {
288
288
  holes.forEach(function (holeWithOffsetPoint) {
289
289
  var offset = holeWithOffsetPoint.hole.toJS().offset;
@@ -291,16 +291,16 @@ var Line = /*#__PURE__*/function () {
291
291
  var _holeWithOffsetPoint$ = holeWithOffsetPoint.offsetPosition,
292
292
  xp = _holeWithOffsetPoint$.x,
293
293
  yp = _holeWithOffsetPoint$.y;
294
- if (GeometryUtils.isPointOnLineSegment(x1, y1, x2, y2, xp, yp)) {
295
- var newOffset = GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, xp, yp);
294
+ if (_export2.GeometryUtils.isPointOnLineSegment(x1, y1, x2, y2, xp, yp)) {
295
+ var newOffset = _export2.GeometryUtils.pointPositionOnLineSegment(x1, y1, x2, y2, xp, yp);
296
296
  if (newOffset >= 0 && newOffset <= 1) {
297
297
  //add the position of hole
298
- var temp = Hole.create(state, layerID, holeWithOffsetPoint.hole.type, line.id, newOffset, holeWithOffsetPoint.hole.properties, xp, yp);
298
+ var temp = _export.Hole.create(state, layerID, holeWithOffsetPoint.hole.type, line.id, newOffset, holeWithOffsetPoint.hole.properties, xp, yp);
299
299
  state = temp.updatedState;
300
300
  var holeX = 0,
301
301
  holeY = 0,
302
302
  holeID = temp.hole.id;
303
- if (GeometryUtils.almostEqual(y1, y2)) {
303
+ if (_export2.GeometryUtils.almostEqual(y1, y2)) {
304
304
  if (x1 > x2) {
305
305
  holeX = x1 - lineLength * newOffset;
306
306
  holeY = y1;
@@ -308,7 +308,7 @@ var Line = /*#__PURE__*/function () {
308
308
  holeX = x1 + lineLength * newOffset;
309
309
  holeY = y1;
310
310
  }
311
- } else if (GeometryUtils.almostEqual(x1, x2)) {
311
+ } else if (_export2.GeometryUtils.almostEqual(x1, x2)) {
312
312
  if (y1 > y2) {
313
313
  holeX = x1;
314
314
  holeY = y1 - lineLength * newOffset;
@@ -343,7 +343,7 @@ var Line = /*#__PURE__*/function () {
343
343
  });
344
344
  return {
345
345
  updatedState: state,
346
- lines: new List(lines),
346
+ lines: new _immutable.List(lines),
347
347
  newline: lines[0]
348
348
  };
349
349
  }
@@ -363,21 +363,21 @@ var Line = /*#__PURE__*/function () {
363
363
  var _line$vertices$map$to = line.vertices.map(function (vertexID) {
364
364
  return reducedState.getIn(['scene', 'layers', layerID, 'vertices']).get(vertexID);
365
365
  }).toArray(),
366
- _line$vertices$map$to2 = _slicedToArray(_line$vertices$map$to, 2),
366
+ _line$vertices$map$to2 = (0, _slicedToArray2["default"])(_line$vertices$map$to, 2),
367
367
  v0 = _line$vertices$map$to2[0],
368
368
  v1 = _line$vertices$map$to2[1];
369
- var hasCommonEndpoint = GeometryUtils.samePoints(v0, points[0]) || GeometryUtils.samePoints(v0, points[1]) || GeometryUtils.samePoints(v1, points[0]) || GeometryUtils.samePoints(v1, points[1]);
370
- var intersection = GeometryUtils.twoLineSegmentsIntersection(points[0], points[1], v0, v1);
369
+ var hasCommonEndpoint = _export2.GeometryUtils.samePoints(v0, points[0]) || _export2.GeometryUtils.samePoints(v0, points[1]) || _export2.GeometryUtils.samePoints(v1, points[0]) || _export2.GeometryUtils.samePoints(v1, points[1]);
370
+ var intersection = _export2.GeometryUtils.twoLineSegmentsIntersection(points[0], points[1], v0, v1);
371
371
  if (intersection.type === 'colinear') {
372
372
  if (!oldHoles) {
373
373
  oldHoles = [];
374
374
  }
375
- var orderedVertices = GeometryUtils.orderVertices(points);
375
+ var orderedVertices = _export2.GeometryUtils.orderVertices(points);
376
376
  reducedState.getIn(['scene', 'layers', layerID, 'lines', line.id, 'holes']).forEach(function (holeID) {
377
377
  var hole = reducedState.getIn(['scene', 'layers', layerID, 'holes', holeID]);
378
- var oldLineLength = GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
379
- var offset = GeometryUtils.samePoints(orderedVertices[1], line.vertices.get(1)) ? 1 - hole.offset : hole.offset;
380
- var offsetPosition = GeometryUtils.extendLine(v0.x, v0.y, v1.x, v1.y, oldLineLength * offset);
378
+ var oldLineLength = _export2.GeometryUtils.pointsDistance(v0.x, v0.y, v1.x, v1.y);
379
+ var offset = _export2.GeometryUtils.samePoints(orderedVertices[1], line.vertices.get(1)) ? 1 - hole.offset : hole.offset;
380
+ var offsetPosition = _export2.GeometryUtils.extendLine(v0.x, v0.y, v1.x, v1.y, oldLineLength * offset);
381
381
  oldHoles.push({
382
382
  hole: hole,
383
383
  offsetPosition: offsetPosition
@@ -406,8 +406,8 @@ var Line = /*#__PURE__*/function () {
406
406
  key: "replaceVertex",
407
407
  value: function replaceVertex(state, layerID, lineID, vertexIndex, x, y) {
408
408
  var vertexID = state.getIn(['scene', 'layers', layerID, 'lines', lineID, 'vertices', vertexIndex]);
409
- state = Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
410
- var _Vertex$add3 = Vertex.add(state, layerID, x, y, 'lines', lineID),
409
+ state = _export.Vertex.remove(state, layerID, vertexID, 'lines', lineID).updatedState;
410
+ var _Vertex$add3 = _export.Vertex.add(state, layerID, x, y, 'lines', lineID),
411
411
  stateV = _Vertex$add3.updatedState,
412
412
  vertex = _Vertex$add3.vertex;
413
413
  state = stateV;
@@ -423,8 +423,8 @@ var Line = /*#__PURE__*/function () {
423
423
  key: "selectToolDrawingLine",
424
424
  value: function selectToolDrawingLine(state, sceneComponentType) {
425
425
  state = state.merge({
426
- mode: MODE_WAITING_DRAWING_LINE,
427
- drawingSupport: new Map({
426
+ mode: _constants.MODE_WAITING_DRAWING_LINE,
427
+ drawingSupport: new _immutable.Map({
428
428
  type: sceneComponentType
429
429
  })
430
430
  });
@@ -436,16 +436,16 @@ var Line = /*#__PURE__*/function () {
436
436
  key: "beginDrawingLine",
437
437
  value: function beginDrawingLine(state, layerID, x, y) {
438
438
  // if end drawing by created area
439
- if (state.mode == MODE_IDLE) {
439
+ if (state.mode == _constants.MODE_IDLE) {
440
440
  return {
441
441
  updatedState: state
442
442
  };
443
443
  }
444
444
  // ///////////////
445
- var snapElements = SnapSceneUtils.sceneSnapElements(state.scene, new List(), state.snapMask);
445
+ var snapElements = _export2.SnapSceneUtils.sceneSnapElements(state.scene, new _immutable.List(), state.snapMask);
446
446
  var snap = null;
447
447
  if (state.snapMask && !state.snapMask.isEmpty()) {
448
- snap = SnapUtils.nearestSnap(snapElements, x, y, state.snapMask);
448
+ snap = _export2.SnapUtils.nearestSnap(snapElements, x, y, state.snapMask);
449
449
  if (snap) {
450
450
  var _snap$point = snap.point;
451
451
  x = _snap$point.x;
@@ -453,36 +453,36 @@ var Line = /*#__PURE__*/function () {
453
453
  }
454
454
  snapElements = snapElements.withMutations(function (snapElements) {
455
455
  var a, b, c;
456
- var _GeometryUtils$horizo = GeometryUtils.horizontalLine(y);
456
+ var _GeometryUtils$horizo = _export2.GeometryUtils.horizontalLine(y);
457
457
  a = _GeometryUtils$horizo.a;
458
458
  b = _GeometryUtils$horizo.b;
459
459
  c = _GeometryUtils$horizo.c;
460
- SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
461
- var _GeometryUtils$vertic = GeometryUtils.verticalLine(x);
460
+ _export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
461
+ var _GeometryUtils$vertic = _export2.GeometryUtils.verticalLine(x);
462
462
  a = _GeometryUtils$vertic.a;
463
463
  b = _GeometryUtils$vertic.b;
464
464
  c = _GeometryUtils$vertic.c;
465
- SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
466
- var _GeometryUtils$upcros = GeometryUtils.upcrossLine(x, y);
465
+ _export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
466
+ var _GeometryUtils$upcros = _export2.GeometryUtils.upcrossLine(x, y);
467
467
  a = _GeometryUtils$upcros.a;
468
468
  b = _GeometryUtils$upcros.b;
469
469
  c = _GeometryUtils$upcros.c;
470
- SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
471
- var _GeometryUtils$downcr = GeometryUtils.downcrossLine(x, y);
470
+ _export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
471
+ var _GeometryUtils$downcr = _export2.GeometryUtils.downcrossLine(x, y);
472
472
  a = _GeometryUtils$downcr.a;
473
473
  b = _GeometryUtils$downcr.b;
474
474
  c = _GeometryUtils$downcr.c;
475
- SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
475
+ _export2.SnapUtils.addLineSnap(snapElements, a, b, c, 10, 3, null);
476
476
  });
477
477
  }
478
478
  var drawingSupport = state.get('drawingSupport').set('layerID', layerID);
479
- state = Layer.unselectAll(state, layerID).updatedState;
479
+ state = _export.Layer.unselectAll(state, layerID).updatedState;
480
480
  var _Line$create3 = Line.create(state, layerID, drawingSupport.get('type'), x, y, x, y),
481
481
  stateL = _Line$create3.updatedState,
482
482
  line = _Line$create3.line;
483
483
  state = Line.select(stateL, layerID, line.id).updatedState;
484
484
  state = state.merge({
485
- mode: MODE_DRAWING_LINE,
485
+ mode: _constants.MODE_DRAWING_LINE,
486
486
  snapElements: snapElements,
487
487
  activeSnapElement: snap ? snap.snap : null,
488
488
  drawingSupport: drawingSupport
@@ -496,7 +496,7 @@ var Line = /*#__PURE__*/function () {
496
496
  value: function updateDrawingLine(state, x, y, relatedLines) {
497
497
  var snap = null;
498
498
  if (state.snapMask && !state.snapMask.isEmpty()) {
499
- snap = SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
499
+ snap = _export2.SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
500
500
  if (snap) {
501
501
  var _snap$point2 = snap.point;
502
502
  x = _snap$point2.x;
@@ -512,7 +512,7 @@ var Line = /*#__PURE__*/function () {
512
512
  var moveFlag = true;
513
513
  var tx = vertices[drawingLine.vertices[1]].x;
514
514
  var ty = vertices[drawingLine.vertices[1]].y;
515
- if (!isEmpty(relatedLines)) {
515
+ if (!(0, _helper.isEmpty)(relatedLines)) {
516
516
  vertices[drawingLine.vertices[1]].x = x;
517
517
  vertices[drawingLine.vertices[1]].y = y;
518
518
  }
@@ -522,12 +522,12 @@ var Line = /*#__PURE__*/function () {
522
522
  if (drawingLine.vertices[0] !== drawingLine.vertices[1]) {
523
523
  relatedLines.forEach(function (line) {
524
524
  // get the points of two lines(drawing line and related line)
525
- if (!isEmpty(line)) {
525
+ if (!(0, _helper.isEmpty)(line)) {
526
526
  // the angle between two lines(line, drawingLine)
527
- lineAngle = GeometryUtils.angleBetweenTwoLines(line, drawingLine, vertices);
527
+ lineAngle = _export2.GeometryUtils.angleBetweenTwoLines(line, drawingLine, vertices);
528
528
  // check whether the angle is less than or bigger than specific value.
529
529
  absAngle = Math.abs(lineAngle);
530
- if (absAngle < MIN_ANGLE_DISALLOW_DRAW_WALL || absAngle > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
530
+ if (absAngle < _constants.MIN_ANGLE_DISALLOW_DRAW_WALL || absAngle > 360 - _constants.MIN_ANGLE_DISALLOW_DRAW_WALL) {
531
531
  moveFlag = false;
532
532
  } else moveFlag = true;
533
533
  }
@@ -539,20 +539,20 @@ var Line = /*#__PURE__*/function () {
539
539
  tx = x;
540
540
  ty = y;
541
541
  } else {
542
- var rest = MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
542
+ var rest = _constants.MIN_ANGLE_DISALLOW_DRAW_WALL - absAngle;
543
543
  // the origin point of rotation(snapping)
544
544
  var ox = vertices[drawingLine.vertices[0]].x;
545
545
  var oy = vertices[drawingLine.vertices[0]].y;
546
546
  // determine the direction of rotation.
547
547
  rest = lineAngle > 0 ? -rest : rest;
548
548
  // rotate the current point to last point around the first point of drawing line.
549
- var res = GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
549
+ var res = _export2.GeometryUtils.rotatePointAroundPoint(x, y, ox, oy, rest);
550
550
  tx = res.x;
551
551
  ty = res.y;
552
552
  }
553
553
  // angle snapping as a value of UNIT_ANGLE
554
- if (moveFlag && !isEmpty(absAngle) && absAngle % UNIT_ANGLE !== 0) {
555
- var result = GeometryUtils.snapAngleByUnit(lineAngle, vertices, drawingLine, tx, ty, drawingLine.vertices[1]);
554
+ if (moveFlag && !(0, _helper.isEmpty)(absAngle) && absAngle % _constants.UNIT_ANGLE !== 0) {
555
+ var result = _export2.GeometryUtils.snapAngleByUnit(lineAngle, vertices, drawingLine, tx, ty, drawingLine.vertices[1]);
556
556
  tx = result.x;
557
557
  ty = result.y;
558
558
  }
@@ -582,9 +582,9 @@ var Line = /*#__PURE__*/function () {
582
582
  var _layer$lines$get;
583
583
  var holeOffset = [];
584
584
  (_layer$lines$get = layer.lines.get(lineID)) === null || _layer$lines$get === void 0 || _layer$lines$get.holes.forEach(function (holeID) {
585
- var lineLength = GeometryUtils.pointsDistance(nv0.x, nv0.y, nv1.x, nv1.y);
586
- var minV = GeometryUtils.minVertex(nv0, nv1);
587
- var maxV = GeometryUtils.maxVertex(nv0, nv1);
585
+ var lineLength = _export2.GeometryUtils.pointsDistance(nv0.x, nv0.y, nv1.x, nv1.y);
586
+ var minV = _export2.GeometryUtils.minVertex(nv0, nv1);
587
+ var maxV = _export2.GeometryUtils.maxVertex(nv0, nv1);
588
588
  var alpha = Math.atan2(maxV.y - minV.y, maxV.x - minV.x);
589
589
  var hole = layer.holes.get(holeID);
590
590
  var pointOnLine = lineLength * hole.offset;
@@ -625,7 +625,7 @@ var Line = /*#__PURE__*/function () {
625
625
  return mgline.id === lineID;
626
626
  });
627
627
  });
628
- if (!isEmpty(relatedLineID)) {
628
+ if (!(0, _helper.isEmpty)(relatedLineID)) {
629
629
  var relatedLine = layer.lines.get(relatedLineID[0]);
630
630
  var intersectionPoint = vertex;
631
631
  var startPoint, endPoint;
@@ -642,8 +642,8 @@ var Line = /*#__PURE__*/function () {
642
642
  var tline2 = {
643
643
  vertices: [intersectionPoint.id, endPoint.id]
644
644
  };
645
- var angle = Math.abs(GeometryUtils.angleBetweenTwoLines(tline1, tline2, allVertices.toJS()));
646
- if (Math.abs(angle - 180) <= EPSILON) {
645
+ var angle = Math.abs(_export2.GeometryUtils.angleBetweenTwoLines(tline1, tline2, allVertices.toJS()));
646
+ if (Math.abs(angle - 180) <= _constants.EPSILON) {
647
647
  selectedLineInfo.mergelines.push(relatedLine);
648
648
  selectedLineInfo.points[0] = startPoint;
649
649
  selectedLineInfo.points[1] = endPoint;
@@ -661,7 +661,7 @@ var Line = /*#__PURE__*/function () {
661
661
  var allVertices = state.getIn(['scene', 'layers', layerID, 'vertices']);
662
662
  var lineID = state.getIn(['scene', 'layers', layerID, 'selected', 'lines']).first();
663
663
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
664
- if (isEmpty(line)) {
664
+ if ((0, _helper.isEmpty)(line)) {
665
665
  return {
666
666
  updatedState: state
667
667
  };
@@ -693,13 +693,13 @@ var Line = /*#__PURE__*/function () {
693
693
  var holesWithOffsetPosition = [];
694
694
  var lineID = layer.getIn(['selected', 'lines']).first(); // lines : [id]
695
695
  var line = layer.getIn(['lines', lineID]);
696
- if (isEmpty(line)) {
696
+ if ((0, _helper.isEmpty)(line)) {
697
697
  return {
698
698
  updatedState: state
699
699
  };
700
700
  }
701
701
  mergeInfo.mergelines.forEach(function (line) {
702
- if ([END_DRAGGING_LINE, END_DRAGGING_VERTEX].includes(actionType)) {
702
+ if ([_constants.END_DRAGGING_LINE, _constants.END_DRAGGING_VERTEX].includes(actionType)) {
703
703
  var tmpGroups = state //get groups membership if present
704
704
  .getIn(['scene', 'groups']).filter(function (group) {
705
705
  var lines = group.getIn(['elements', layerID, 'lines']);
@@ -718,20 +718,20 @@ var Line = /*#__PURE__*/function () {
718
718
  state = Line.remove(state, layerID, line.id).updatedState;
719
719
  });
720
720
  var ret;
721
- if (!GeometryUtils.samePoints(mergeInfo.points[0], mergeInfo.points[1])) {
721
+ if (!_export2.GeometryUtils.samePoints(mergeInfo.points[0], mergeInfo.points[1])) {
722
722
  ret = Line.createAvoidingIntersections(state, layerID, line.type, mergeInfo.points[0].x, mergeInfo.points[0].y, mergeInfo.points[1].x, mergeInfo.points[1].y, line.properties, holesWithOffsetPosition, line.createdDateTime);
723
723
  state = ret.updatedState;
724
724
  }
725
- if ([END_DRAGGING_LINE, END_DRAGGING_VERTEX].includes(actionType)) {
725
+ if ([_constants.END_DRAGGING_LINE, _constants.END_DRAGGING_VERTEX].includes(actionType)) {
726
726
  //re-add to old line's groups if present
727
727
  ret.lines.forEach(function (addedLine) {
728
728
  lineGroups.forEach(function (oldLineGroup) {
729
- state = Group.addElement(state, oldLineGroup.id, layerID, 'lines', addedLine.id).updatedState;
729
+ state = _export.Group.addElement(state, oldLineGroup.id, layerID, 'lines', addedLine.id).updatedState;
730
730
  });
731
731
  });
732
732
  }
733
- state = Layer.removeZeroLengthLines(state, layerID).updatedState;
734
- if (!isEmpty((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.newline)) {
733
+ state = _export.Layer.removeZeroLengthLines(state, layerID).updatedState;
734
+ if (!(0, _helper.isEmpty)((_ret = ret) === null || _ret === void 0 ? void 0 : _ret.newline)) {
735
735
  state = this.select(state, layerID, ret.newline.get('id')).updatedState;
736
736
  }
737
737
  return {
@@ -746,10 +746,10 @@ var Line = /*#__PURE__*/function () {
746
746
  var lineID = layer.getIn(['selected', 'lines']).first(); // lines : [id]
747
747
  var line = layer.getIn(['lines', lineID]);
748
748
  var drawingInfo = {};
749
- if (!isEmpty(line)) {
749
+ if (!(0, _helper.isEmpty)(line)) {
750
750
  drawingInfo.drawingLine = line;
751
751
  }
752
- state = Layer.detectAndUpdateAreas(state, layerID, drawingInfo).updatedState;
752
+ state = _export.Layer.detectAndUpdateAreas(state, layerID, drawingInfo).updatedState;
753
753
  return {
754
754
  updatedState: state
755
755
  };
@@ -771,16 +771,16 @@ var Line = /*#__PURE__*/function () {
771
771
  var layerID = state.getIn(['scene', 'selectedLayer']);
772
772
  var lineID = state.getIn(['scene', 'layers', layerID, 'selected', 'lines']).first();
773
773
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
774
- if (isEmpty(line)) {
774
+ if ((0, _helper.isEmpty)(line)) {
775
775
  return {
776
776
  updatedState: state
777
777
  };
778
778
  }
779
- if (!isEmpty(v0)) {
779
+ if (!(0, _helper.isEmpty)(v0)) {
780
780
  state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(0), 'x'], v0.x);
781
781
  state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(0), 'y'], v0.y);
782
782
  }
783
- if (!isEmpty(v1)) {
783
+ if (!(0, _helper.isEmpty)(v1)) {
784
784
  state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(1), 'x'], v1.x);
785
785
  state = state.setIn(['scene', 'layers', layerID, 'vertices', line.vertices.get(1), 'y'], v1.y);
786
786
  }
@@ -794,7 +794,7 @@ var Line = /*#__PURE__*/function () {
794
794
  key: "endDrawingLine",
795
795
  value: function endDrawingLine(state, x, y) {
796
796
  if (state.snapMask && !state.snapMask.isEmpty()) {
797
- var snap = SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
797
+ var snap = _export2.SnapUtils.nearestSnap(state.snapElements, x, y, state.snapMask);
798
798
  if (snap) {
799
799
  var _snap$point3 = snap.point;
800
800
  x = _snap$point3.x;
@@ -807,8 +807,8 @@ var Line = /*#__PURE__*/function () {
807
807
  if (drawingLine.vertices[0] === drawingLine.vertices[1]) {
808
808
  state = Line.remove(state, layerID, lineID).updatedState;
809
809
  state = state.merge({
810
- mode: MODE_IDLE,
811
- snapElements: new List(),
810
+ mode: _constants.MODE_IDLE,
811
+ snapElements: new _immutable.List(),
812
812
  activeSnapElement: null
813
813
  });
814
814
  return {
@@ -819,10 +819,10 @@ var Line = /*#__PURE__*/function () {
819
819
  x: x,
820
820
  y: y
821
821
  }, state).updatedState;
822
- state = this.applyWallChanges(state, END_DRAWING_LINE).updatedState;
822
+ state = this.applyWallChanges(state, _constants.END_DRAWING_LINE).updatedState;
823
823
  state = state.merge({
824
- mode: MODE_WAITING_DRAWING_LINE,
825
- snapElements: new List(),
824
+ mode: _constants.MODE_WAITING_DRAWING_LINE,
825
+ snapElements: new _immutable.List(),
826
826
  activeSnapElement: null
827
827
  });
828
828
  return {
@@ -832,15 +832,15 @@ var Line = /*#__PURE__*/function () {
832
832
  }, {
833
833
  key: "beginDraggingLine",
834
834
  value: function beginDraggingLine(state, layerID, lineID, x, y) {
835
- var snapElements = SnapSceneUtils.sceneSnapElements(state.scene, new List(), state.snapMask);
835
+ var snapElements = _export2.SnapSceneUtils.sceneSnapElements(state.scene, new _immutable.List(), state.snapMask);
836
836
  var layer = state.scene.layers.get(layerID);
837
837
  var line = layer.lines.get(lineID);
838
838
  var vertex0 = layer.vertices.get(line.vertices.get(0));
839
839
  var vertex1 = layer.vertices.get(line.vertices.get(1));
840
840
  state = state.merge({
841
- mode: MODE_DRAGGING_LINE,
841
+ mode: _constants.MODE_DRAGGING_LINE,
842
842
  snapElements: snapElements,
843
- draggingSupport: Map({
843
+ draggingSupport: (0, _immutable.Map)({
844
844
  layerID: layerID,
845
845
  lineID: lineID,
846
846
  startPointX: x,
@@ -878,7 +878,7 @@ var Line = /*#__PURE__*/function () {
878
878
  var vec1 = pos1.clone().sub(cen).normalize();
879
879
  var vec2 = pos2.clone().sub(cen).normalize();
880
880
  var angle = Math.floor(vec1.angle() * 180 / Math.PI - vec2.angle() * 180 / Math.PI + 0.5);
881
- if (Math.abs(angle) < MIN_ANGLE_DISALLOW_DRAW_WALL || Math.abs(angle) > 360 - MIN_ANGLE_DISALLOW_DRAW_WALL) {
881
+ if (Math.abs(angle) < _constants.MIN_ANGLE_DISALLOW_DRAW_WALL || Math.abs(angle) > 360 - _constants.MIN_ANGLE_DISALLOW_DRAW_WALL) {
882
882
  mvFlag.push(false);
883
883
  } else {
884
884
  mvFlag.push(true);
@@ -918,8 +918,8 @@ var Line = /*#__PURE__*/function () {
918
918
  var curSnap0 = null,
919
919
  curSnap1 = null;
920
920
  if (state.snapMask && !state.snapMask.isEmpty()) {
921
- curSnap0 = SnapUtils.nearestSnap(snapElements, newVertex0X, newVertex0Y, state.snapMask);
922
- curSnap1 = SnapUtils.nearestSnap(snapElements, newVertex1X, newVertex1Y, state.snapMask);
921
+ curSnap0 = _export2.SnapUtils.nearestSnap(snapElements, newVertex0X, newVertex0Y, state.snapMask);
922
+ curSnap1 = _export2.SnapUtils.nearestSnap(snapElements, newVertex1X, newVertex1Y, state.snapMask);
923
923
  }
924
924
  var deltaX = 0,
925
925
  deltaY = 0;
@@ -1003,8 +1003,8 @@ var Line = /*#__PURE__*/function () {
1003
1003
  var newVertex1X = draggingSupport.get('startVertex1X') + diffX;
1004
1004
  var newVertex1Y = draggingSupport.get('startVertex1Y') + diffY;
1005
1005
  if (state.snapMask && !state.snapMask.isEmpty()) {
1006
- var curSnap0 = SnapUtils.nearestSnap(state.snapElements, newVertex0X, newVertex0Y, state.snapMask);
1007
- var curSnap1 = SnapUtils.nearestSnap(state.snapElements, newVertex1X, newVertex1Y, state.snapMask);
1006
+ var curSnap0 = _export2.SnapUtils.nearestSnap(state.snapElements, newVertex0X, newVertex0Y, state.snapMask);
1007
+ var curSnap1 = _export2.SnapUtils.nearestSnap(state.snapElements, newVertex1X, newVertex1Y, state.snapMask);
1008
1008
  var deltaX = 0,
1009
1009
  deltaY = 0;
1010
1010
  if (curSnap0 && curSnap1) {
@@ -1041,9 +1041,9 @@ var Line = /*#__PURE__*/function () {
1041
1041
  newVertex0Y = newResult.newVertex0Y;
1042
1042
  newVertex1X = newResult.newVertex1X;
1043
1043
  newVertex1Y = newResult.newVertex1Y;
1044
- state = Layer.mergeEqualsVertices(state, layerID, line.vertices.get(0)).updatedState;
1045
- state = Layer.mergeEqualsVertices(state, layerID, line.vertices.get(1)).updatedState;
1046
- if (GeometryUtils.samePoints({
1044
+ state = _export.Layer.mergeEqualsVertices(state, layerID, line.vertices.get(0)).updatedState;
1045
+ state = _export.Layer.mergeEqualsVertices(state, layerID, line.vertices.get(1)).updatedState;
1046
+ if (_export2.GeometryUtils.samePoints({
1047
1047
  newVertex0X: newVertex0X,
1048
1048
  newVertex0Y: newVertex0Y
1049
1049
  }, {
@@ -1059,13 +1059,13 @@ var Line = /*#__PURE__*/function () {
1059
1059
  x: newVertex1X,
1060
1060
  y: newVertex1Y
1061
1061
  }, state).updatedState;
1062
- state = this.applyWallChanges(state, END_DRAGGING_LINE).updatedState;
1062
+ state = this.applyWallChanges(state, _constants.END_DRAGGING_LINE).updatedState;
1063
1063
  }
1064
1064
  state = state.merge({
1065
- mode: MODE_IDLE,
1065
+ mode: _constants.MODE_IDLE,
1066
1066
  draggingSupport: null,
1067
1067
  activeSnapElement: null,
1068
- snapElements: new List()
1068
+ snapElements: new _immutable.List()
1069
1069
  });
1070
1070
  return {
1071
1071
  updatedState: state
@@ -1082,7 +1082,7 @@ var Line = /*#__PURE__*/function () {
1082
1082
  }, {
1083
1083
  key: "setJsProperties",
1084
1084
  value: function setJsProperties(state, layerID, lineID, properties) {
1085
- return this.setProperties(state, layerID, lineID, fromJS(properties));
1085
+ return this.setProperties(state, layerID, lineID, (0, _immutable.fromJS)(properties));
1086
1086
  }
1087
1087
  }, {
1088
1088
  key: "updateProperties",
@@ -1097,7 +1097,7 @@ var Line = /*#__PURE__*/function () {
1097
1097
  }, {
1098
1098
  key: "updateJsProperties",
1099
1099
  value: function updateJsProperties(state, layerID, lineID, properties) {
1100
- return this.updateProperties(state, layerID, lineID, fromJS(properties));
1100
+ return this.updateProperties(state, layerID, lineID, (0, _immutable.fromJS)(properties));
1101
1101
  }
1102
1102
  }, {
1103
1103
  key: "setAttributes",
@@ -1116,17 +1116,17 @@ var Line = /*#__PURE__*/function () {
1116
1116
  delete lAttr['lineToExtend'];
1117
1117
  delete lAttr['lineLength'];
1118
1118
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
1119
- state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineID], fromJS(lAttr)).mergeIn(['scene', 'layers', layerID, 'vertices', vertexOne.id], {
1119
+ state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineID], (0, _immutable.fromJS)(lAttr)).mergeIn(['scene', 'layers', layerID, 'vertices', vertexOne.id], {
1120
1120
  x: vertexOne.x,
1121
1121
  y: vertexOne.y
1122
1122
  }).mergeIn(['scene', 'layers', layerID, 'vertices', vertexTwo.id], {
1123
1123
  x: vertexTwo.x,
1124
1124
  y: vertexTwo.y
1125
- }).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'misc'], new Map({
1125
+ }).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'misc'], new _immutable.Map({
1126
1126
  _unitLength: lineLength._unit
1127
1127
  })).mergeIn(['scene', 'layers', layerID, 'lines', lineID, 'focus'], true);
1128
1128
  if (lineToExtend) {
1129
- state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id], fromJS(lAttr)).mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id, 'misc'], new Map({
1129
+ state = state.mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id], (0, _immutable.fromJS)(lAttr)).mergeIn(['scene', 'layers', layerID, 'lines', lineToExtend.id, 'misc'], new _immutable.Map({
1130
1130
  _unitLength: lineLength._unit
1131
1131
  }));
1132
1132
  }
@@ -1142,14 +1142,14 @@ var Line = /*#__PURE__*/function () {
1142
1142
  y: vertexFour.y
1143
1143
  });
1144
1144
  }
1145
- state = Layer.mergeEqualsVertices(state, layerID, vertexOne.id).updatedState;
1145
+ state = _export.Layer.mergeEqualsVertices(state, layerID, vertexOne.id).updatedState;
1146
1146
  if (vertexOne.x != vertexTwo.x && vertexOne.y != vertexTwo.y) {
1147
- state = Layer.mergeEqualsVertices(state, layerID, vertexTwo.id).updatedState;
1147
+ state = _export.Layer.mergeEqualsVertices(state, layerID, vertexTwo.id).updatedState;
1148
1148
  }
1149
1149
  state = this.select(state, layerID, lineID).updatedState;
1150
- state = this.applyWallChanges(state, END_DRAWING_LINE).updatedState;
1150
+ state = this.applyWallChanges(state, _constants.END_DRAWING_LINE).updatedState;
1151
1151
  state = state.merge({
1152
- sceneHistory: history.historyPush(state.sceneHistory, state.scene)
1152
+ sceneHistory: _export2.history.historyPush(state.sceneHistory, state.scene)
1153
1153
  });
1154
1154
  if (state.mode.endsWith('_LINE')) {
1155
1155
  state = state.setIn(['scene', 'setLineAttributes'], true);
@@ -1163,11 +1163,11 @@ var Line = /*#__PURE__*/function () {
1163
1163
  key: "setVerticesCoords",
1164
1164
  value: function setVerticesCoords(state, layerID, lineID, x1, y1, x2, y2) {
1165
1165
  var line = state.getIn(['scene', 'layers', layerID, 'lines', lineID]);
1166
- state = Vertex.setAttributes(state, layerID, line.vertices.get(0), new Map({
1166
+ state = _export.Vertex.setAttributes(state, layerID, line.vertices.get(0), new _immutable.Map({
1167
1167
  x: x1,
1168
1168
  y: y1
1169
1169
  })).updatedState;
1170
- state = Vertex.setAttributes(state, layerID, line.vertices.get(1), new Map({
1170
+ state = _export.Vertex.setAttributes(state, layerID, line.vertices.get(1), new _immutable.Map({
1171
1171
  x: x2,
1172
1172
  y: y2
1173
1173
  })).updatedState;
@@ -1176,5 +1176,4 @@ var Line = /*#__PURE__*/function () {
1176
1176
  };
1177
1177
  }
1178
1178
  }]);
1179
- }();
1180
- export { Line as default };
1179
+ }();